Skip to content

Commit

Permalink
[optimize] text2color() supports Exclude colors
Browse files Browse the repository at this point in the history
[optimize] remove CSS imports in Bundle scripts
[optimize] update Upstream packages
  • Loading branch information
TechQuery committed Sep 5, 2022
1 parent 8d1f44f commit c864750
Show file tree
Hide file tree
Showing 10 changed files with 618 additions and 476 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 7
Expand All @@ -18,18 +19,21 @@ jobs:
cache: pnpm
- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Build & Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Update document
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./docs
personal_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true

- name: Deploy preview
uses: amondnet/vercel-action@v20
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}

- uses: amondnet/vercel-action@v20
- uses: amondnet/vercel-action@v25
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
Expand Down
12 changes: 8 additions & 4 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,23 @@ A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstr
```html
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]-beta1/dist/css/bootstrap.min.css"
href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/bootstrap-icons@1.8.3/font/bootstrap-icons.css"
href="https://unpkg.com/bootstrap-icons@1.9.1/font/bootstrap-icons.css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/animate.min.css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/themes/prism.min.css"
href="https://unpkg.com/[email protected]/themes/prism.min.css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/dist/index.umd.css"
/>
```

Expand Down Expand Up @@ -79,7 +83,7 @@ A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstr
2. add Git tag

```shell
git tag vx.xx.x # 0.23.0
git tag vx.xx.x # such as v0.23.0
```

3. review tag
Expand Down
22 changes: 22 additions & 0 deletions bundle-fix.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /usr/bin/env ts-node

import { promises } from 'fs';

const list = [
{ file: 'dist/index.js', pattern: 'import "./index.css";' },
{ file: 'dist/index.umd.js', pattern: 'require("./index.umd.css");' }
];

(async () => {
console.log();
console.time('Bundle fix');

for (const { file, pattern } of list) {
const code = await promises.readFile(file, { encoding: 'utf-8' });

await promises.writeFile(file, code.replace(pattern, '').trim());

console.log(`[fixed] ${file}`);
}
console.timeEnd('Bundle fix');
})();
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "idea-react",
"version": "0.26.5",
"version": "0.26.8",
"license": "LGPL-3.0",
"author": "[email protected]",
"description": "A React advanced components library based on TypeScript & Bootstrap, built by idea2app remote developers team.",
Expand All @@ -25,33 +25,35 @@
"dependencies": {
"@editorjs/editorjs": "^2.25.0",
"@editorjs/paragraph": "^2.8.0",
"@swc/helpers": "^0.4.3",
"@swc/helpers": "^0.4.11",
"classnames": "^2.3.1",
"editorjs-html": "^3.4.2",
"lodash": "^4.17.21",
"prismjs": "^1.28.0",
"prismjs": "^1.29.0",
"react": "^17.0.2",
"react-bootstrap": "^2.4.0",
"react-bootstrap": "^2.5.0",
"react-dom": "^17.0.2",
"react-editor-js": "^2.1.0",
"react-element-to-jsx-string": "^15.0.0",
"web-utility": "^3.7.6"
"web-utility": "^3.9.2"
},
"devDependencies": {
"@parcel/packager-ts": "^2.6.2",
"@parcel/transformer-less": "^2.6.2",
"@parcel/transformer-typescript-types": "^2.6.2",
"@types/lodash": "^4.14.182",
"@parcel/packager-ts": "~2.7.0",
"@parcel/transformer-less": "~2.7.0",
"@parcel/transformer-typescript-types": "~2.7.0",
"@types/lodash": "^4.14.184",
"@types/node": "^14.18.27",
"@types/prismjs": "^1.26.0",
"@types/react": "^17.0.47",
"@types/react": "^17.0.49",
"@types/react-dom": "^17.0.17",
"husky": "^8.0.1",
"less": "^4.1.3",
"lint-staged": "^13.0.3",
"open-cli": "^7.0.1",
"parcel": "^2.6.2",
"parcel": "~2.7.0",
"prettier": "^2.7.1",
"typedoc": "^0.23.7",
"ts-node": "^10.9.1",
"typedoc": "^0.23.14",
"typedoc-plugin-mdn-links": "^2.0.0",
"typescript": "~4.7.4"
},
Expand All @@ -73,7 +75,7 @@
"scripts": {
"prepare": "husky install",
"test": "lint-staged",
"make": "parcel build",
"make": "parcel build --no-source-maps && ts-node bundle-fix",
"build": "rm -rf dist/ docs/ && typedoc source/ && npm run make",
"start": "typedoc source/ && open-cli docs/index.html",
"prepublishOnly": "npm test && npm run build",
Expand Down
Loading

1 comment on commit c864750

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for idea-react ready!

✅ Preview
https://idea-react-haopekvt4-stevending1st.vercel.app

Built with commit c864750.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.