diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ac8f61e4d..cccaf5157 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -5,40 +5,38 @@ name: Coverage on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: build: - runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [20.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm config set registry https://registry.yarnpkg.com/ - # - run: npm install - - run: npm install --global pnpm - - run: pnpm i - - run: npm run beforetest - - run: npm run cover - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - files: /home/runner/work/idraw/idraw/reports/clover.xml # optional - flags: unittests # optional - name: codecov-umbrella # optional - fail_ci_if_error: true # optional (default = false) - verbose: true # optional (default = false) - + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm config set registry https://registry.yarnpkg.com/ + # - run: npm install + - run: npm install --global pnpm + - run: pnpm i + - run: npm run beforetest + - run: npm run cover + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: /home/runner/work/idraw/idraw/reports/clover.xml # optional + flags: unittests # optional + name: codecov-umbrella # optional + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c3a977c5e..07cae8e6b 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -5,29 +5,28 @@ name: Node.js CI on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: build: - runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [20.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm config set registry https://registry.yarnpkg.com/ - # - run: npm install - - run: npm install --global pnpm - - run: pnpm i - - run: npm run beforetest - - run: npm run test + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm config set registry https://registry.yarnpkg.com/ + # - run: npm install + - run: npm install --global pnpm + - run: pnpm i + - run: npm run beforetest + - run: npm run test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c22ef9957..24e0df04b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,21 +19,22 @@ jobs: - run: pnpm i - run: npm run test - run: npm run build - - run: npm publish --provenance --access public -w ./packages/types --tag next + # - run: npm publish --provenance --access public -w ./packages/types --tag next + - run: npm publish --provenance --access public -w ./packages/types env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: npm publish --provenance --access public -w ./packages/util --tag next + - run: npm publish --provenance --access public -w ./packages/util env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: npm publish --provenance --access public -w ./packages/renderer --tag next + - run: npm publish --provenance --access public -w ./packages/renderer env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: npm publish --provenance --access public -w ./packages/board --tag next + - run: npm publish --provenance --access public -w ./packages/board env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: npm publish --provenance --access public -w ./packages/core --tag next + - run: npm publish --provenance --access public -w ./packages/core env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: npm publish --provenance --access public -w ./packages/idraw --tag next + - run: npm publish --provenance --access public -w ./packages/idraw env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 18c94daea..f4993356c 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ CI - + Version @@ -54,7 +54,11 @@ The preview of `@idraw/studo`. Click [here](https://github.com/idrawjs/studio) to get it.
- + +
+ +
+
## Install @@ -75,8 +79,6 @@ const idraw = new iDraw( { width: 600, height: 400, - contextWidth: 600, - contextHeight: 400, devicePixelRatio: 1, } ); @@ -87,8 +89,8 @@ idraw.addElement({ w: 200, h: 100, type: "rect", - desc: { - bgColor: "#f7d3c1", + detail: { + background: "#f7d3c1", borderRadius: 20, borderWidth: 4, borderColor: "#ff6032", @@ -107,9 +109,7 @@ function Demo() { useEffect(() => { const idraw = new iDraw(ref.current, { width: 600, - height: 400, - contextWidth: 600, - contextHeight: 400, + height: 400, devicePixelRatio: 1, }); idraw.addElement({ @@ -119,8 +119,8 @@ function Demo() { w: 200, h: 100, type: "rect", - desc: { - bgColor: "#f7d3c1", + detail: { + background: "#f7d3c1", borderRadius: 20, borderWidth: 4, borderColor: "#ff6032", @@ -149,9 +149,7 @@ const mount = ref(); onMounted(() => { const idraw = new iDraw(mount.value, { width: 600, - height: 400, - contextWidth: 600, - contextHeight: 400, + height: 400, devicePixelRatio: 1, }); idraw.addElement({ @@ -161,8 +159,8 @@ onMounted(() => { w: 200, h: 100, type: "rect", - desc: { - bgColor: "#f7d3c1", + detail: { + background: "#f7d3c1", borderRadius: 20, borderWidth: 4, borderColor: "#ff6032", @@ -183,8 +181,8 @@ To contribute, please follow the steps: - `git clone git@github.com:idrawjs/idraw.git` - `cd idraw` -- `npm i` -- `npm run init` +- `pnpm i` +- `npm run dev` ### Step 2: Development diff --git a/assets/preview/idraw-studio-dark.png b/assets/preview/idraw-studio-dark.png new file mode 100644 index 000000000..91faa183c Binary files /dev/null and b/assets/preview/idraw-studio-dark.png differ diff --git a/assets/preview/idraw-studio-light.png b/assets/preview/idraw-studio-light.png new file mode 100644 index 000000000..b53c136d8 Binary files /dev/null and b/assets/preview/idraw-studio-light.png differ diff --git a/assets/preview/idraw-studio-preview.png b/assets/preview/idraw-studio-preview.png deleted file mode 100644 index e1c2c3cf2..000000000 Binary files a/assets/preview/idraw-studio-preview.png and /dev/null differ diff --git a/package.json b/package.json index 99c6e2c50..7d35d1c37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": false, - "version": "0.4.0-beta.1", + "version": "0.4.0-beta.2", "workspaces": [ "packages/*" ], diff --git a/packages/board/package.json b/packages/board/package.json index 90631e922..95f7f5584 100644 --- a/packages/board/package.json +++ b/packages/board/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/board", - "version": "0.4.0-beta.1", + "version": "0.4.0-beta.2", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", @@ -21,12 +21,12 @@ "author": "chenshenhai", "license": "MIT", "devDependencies": { - "@idraw/types": "^0.4.0-beta.1" + "@idraw/types": "^0.4.0-beta.2" }, "dependencies": {}, "peerDependencies": { - "@idraw/util": "^0.4.0-beta.1", - "@idraw/renderer": "^0.4.0-beta.1" + "@idraw/util": "^0.4.0-beta.2", + "@idraw/renderer": "^0.4.0-beta.2" }, "publishConfig": { "access": "public", diff --git a/packages/core/package.json b/packages/core/package.json index 343f978cb..272aceabc 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/core", - "version": "0.4.0-beta.1", + "version": "0.4.0-beta.2", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", @@ -21,13 +21,13 @@ "author": "chenshenhai", "license": "MIT", "devDependencies": { - "@idraw/types": "^0.4.0-beta.1" + "@idraw/types": "^0.4.0-beta.2" }, "dependencies": {}, "peerDependencies": { - "@idraw/board": "^0.4.0-beta.1", - "@idraw/renderer": "^0.4.0-beta.1", - "@idraw/util": "^0.4.0-beta.1" + "@idraw/board": "^0.4.0-beta.2", + "@idraw/renderer": "^0.4.0-beta.2", + "@idraw/util": "^0.4.0-beta.2" }, "publishConfig": { "access": "public", diff --git a/packages/idraw/package.json b/packages/idraw/package.json index 98dd0f792..0c33166cc 100644 --- a/packages/idraw/package.json +++ b/packages/idraw/package.json @@ -1,6 +1,6 @@ { "name": "idraw", - "version": "0.4.0-beta.1", + "version": "0.4.0-beta.2", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", @@ -22,11 +22,11 @@ "license": "MIT", "devDependencies": {}, "dependencies": { - "@idraw/board": "^0.4.0-beta.1", - "@idraw/core": "^0.4.0-beta.1", - "@idraw/renderer": "^0.4.0-beta.1", - "@idraw/types": "^0.4.0-beta.1", - "@idraw/util": "^0.4.0-beta.1" + "@idraw/board": "^0.4.0-beta.2", + "@idraw/core": "^0.4.0-beta.2", + "@idraw/renderer": "^0.4.0-beta.2", + "@idraw/types": "^0.4.0-beta.2", + "@idraw/util": "^0.4.0-beta.2" }, "publishConfig": { "access": "public", diff --git a/packages/lab/package.json b/packages/lab/package.json index c1f28f2d7..fb63f51c1 100644 --- a/packages/lab/package.json +++ b/packages/lab/package.json @@ -1,17 +1,17 @@ { "name": "@idraw/lab", - "version": "0.4.0-beta.1", + "version": "0.4.0-beta.2", "dependencies": { "@ant-design/icons": "^5.1.3", - "@idraw/core": "^0.4.0-beta.1", - "@idraw/util": "^0.4.0-beta.1", + "@idraw/core": "^0.4.0-beta.2", + "@idraw/util": "^0.4.0-beta.2", "antd": "^5.5.0", "classnames": "^2.3.2", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@idraw/types": "^0.4.0-beta.1", + "@idraw/types": "^0.4.0-beta.2", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.1" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index b548d214d..960a879e4 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/renderer", - "version": "0.4.0-beta.1", + "version": "0.4.0-beta.2", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", @@ -21,11 +21,11 @@ "author": "chenshenhai", "license": "MIT", "devDependencies": { - "@idraw/types": "^0.4.0-beta.1" + "@idraw/types": "^0.4.0-beta.2" }, "dependencies": {}, "peerDependencies": { - "@idraw/util": "^0.4.0-beta.1" + "@idraw/util": "^0.4.0-beta.2" }, "publishConfig": { "access": "public", diff --git a/packages/types/package.json b/packages/types/package.json index e170d4229..86f5804ff 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/types", - "version": "0.4.0-beta.1", + "version": "0.4.0-beta.2", "description": "", "main": "src/index.ts", "types": "src/index.ts", diff --git a/packages/util/package.json b/packages/util/package.json index 0ee48c287..8474f8941 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/util", - "version": "0.4.0-beta.1", + "version": "0.4.0-beta.2", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2761332e8..a2b528fa5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -144,48 +144,48 @@ importers: packages/board: dependencies: '@idraw/renderer': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../renderer '@idraw/util': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../util devDependencies: '@idraw/types': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../types packages/core: dependencies: '@idraw/board': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../board '@idraw/renderer': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../renderer '@idraw/util': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../util devDependencies: '@idraw/types': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../types packages/idraw: dependencies: '@idraw/board': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../board '@idraw/core': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../core '@idraw/renderer': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../renderer '@idraw/types': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../types '@idraw/util': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../util packages/lab: @@ -194,10 +194,10 @@ importers: specifier: ^5.1.3 version: 5.1.3(react-dom@18.2.0)(react@18.2.0) '@idraw/core': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../core '@idraw/util': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../util antd: specifier: ^5.5.0 @@ -213,7 +213,7 @@ importers: version: 18.2.0(react@18.2.0) devDependencies: '@idraw/types': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../types '@types/react': specifier: ^18.2.0 @@ -225,11 +225,11 @@ importers: packages/renderer: dependencies: '@idraw/util': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../util devDependencies: '@idraw/types': - specifier: ^0.4.0-beta.1 + specifier: ^0.4.0-beta.2 version: link:../types packages/types: {}