diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 549f7f17..5a91825e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,10 +9,10 @@ jobs: matrix: node-version: [16.x] steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - run: yarn install - - run: yarn lerna run ci --stream + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: yarn install + - run: yarn prepublishOnly diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd7ff063..7290ad13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,30 +5,27 @@ on: types: [created, edited] jobs: - build: + publish-site: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: 16 - - run: | + + - name: Build package + run: | yarn install yarn build:package - publish-site: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 16 - - run: | + - name: Build examples builder + run: | cd examples/builder yarn install yarn build - - run: | + + - name: Push gh-pages + run: | cd dist git init git config --local user.name antv @@ -41,4 +38,3 @@ jobs: directory: dist branch: gh-pages force: true - diff --git a/Develop.md b/Develop.md index 74364581..c84a13ce 100644 --- a/Develop.md +++ b/Develop.md @@ -2,6 +2,8 @@ 采用多包管理方式,对应的包如下: + + | 文件路径 | 包名 | 简介 | | --------------------------- | -------------------------- | ---------------- | | packages/li-sdk | `@antv/li-sdk` | SDK | diff --git a/lerna.json b/lerna.json index 19507802..2a5efeaf 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,6 @@ "$schema": "node_modules/lerna/schemas/lerna-schema.json", "version": "independent", "npmClient": "yarn", - "useWorkspaces": true, "command": { "version": { "message": "chore: publish %s", diff --git a/nx.json b/nx.json index 78042c0e..1cc4c4c2 100644 --- a/nx.json +++ b/nx.json @@ -9,7 +9,8 @@ } }, "namedInputs": { - "default": ["{projectRoot}/src/**/*"] + "default": ["{projectRoot}/src/**/*"], + "production": ["default"] }, "targetDefaults": { "start": { diff --git a/package.json b/package.json index a475226d..776bfae9 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,10 @@ "build:core-assets": "lerna run build --scope=@antv/li-core-assets", "build:analysis-assets": "lerna run build --scope=@antv/li-analysis-assets", "build:package": "lerna run build --skip-nx-cache", + "build": "cross-env BUNDLE_ENV=bundle npm run build:package", "package-version": "lerna version --conventional-commits", "package-preversion": "lerna version --conventional-prerelease", - "prepublishOnly": "lerna run doctor && npm run build:package", + "prepublishOnly": "lerna run doctor && npm run build", "package-publish": "lerna publish from-package", "package-betapublish": "lerna publish from-package --dist-tag beta", "postpublish": "scripts/intranet-sync.sh" @@ -36,7 +37,7 @@ "eslint-plugin-import": "^2.26.0", "gh-pages": "^4.0.0", "husky": "^8.0.1", - "lerna": "^6.6.1", + "lerna": "^7.1.4", "lint-staged": "^13.0.3", "typescript": "^4.7.4", "webpack-bundle-analyzer": "^4.6.1", diff --git a/packages/li-analysis-assets/.fatherrc.ts b/packages/li-analysis-assets/.fatherrc.ts index f721c43e..2ccdf295 100644 --- a/packages/li-analysis-assets/.fatherrc.ts +++ b/packages/li-analysis-assets/.fatherrc.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'father'; import { getUMDConfig } from '../../scripts/fatherrc.base'; -const isBundle = process.env.BUNDLE_ENV !== 'bundless' && process.env.NODE_ENV === 'production'; +const isBundle = process.env.BUNDLE_ENV === 'bundle' && process.env.NODE_ENV === 'production'; export default defineConfig({ extends: '../../.fatherrc.base.ts', diff --git a/packages/li-analysis-assets/package.json b/packages/li-analysis-assets/package.json index 9ce261c8..ff860e84 100644 --- a/packages/li-analysis-assets/package.json +++ b/packages/li-analysis-assets/package.json @@ -27,6 +27,7 @@ ], "scripts": { "build": "npm run clean && father build", + "bundle": "cross-env BUNDLE_ENV=bundle npm run build", "clean": "rimraf dist", "dev": "father dev", "docs:build": "dumi build", @@ -77,9 +78,6 @@ "registry": "https://registry.npmjs.org" }, "nx": { - "implicitDependencies": [ - "@antv/li-sdk", - "@antv/li-p2" - ] + "implicitDependencies": [] } } diff --git a/packages/li-core-assets/.fatherrc.ts b/packages/li-core-assets/.fatherrc.ts index 5fa213e5..12d7db6b 100644 --- a/packages/li-core-assets/.fatherrc.ts +++ b/packages/li-core-assets/.fatherrc.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'father'; import { getUMDConfig } from '../../scripts/fatherrc.base'; -const isBundle = process.env.BUNDLE_ENV !== 'bundless' && process.env.NODE_ENV === 'production'; +const isBundle = process.env.BUNDLE_ENV === 'bundle' && process.env.NODE_ENV === 'production'; export default defineConfig({ extends: '../../.fatherrc.base.ts', diff --git a/packages/li-core-assets/package.json b/packages/li-core-assets/package.json index 8fff261b..c4028035 100644 --- a/packages/li-core-assets/package.json +++ b/packages/li-core-assets/package.json @@ -27,6 +27,7 @@ ], "scripts": { "build": "npm run clean && father build", + "bundle": "cross-env BUNDLE_ENV=bundle npm run build", "clean": "rimraf dist", "dev": "father dev", "docs:build": "dumi build", @@ -71,9 +72,6 @@ "registry": "https://registry.npmjs.org" }, "nx": { - "implicitDependencies": [ - "@antv/li-sdk", - "@antv/li-p2" - ] + "implicitDependencies": [] } } diff --git a/packages/li-editor/.fatherrc.ts b/packages/li-editor/.fatherrc.ts index 6c6e34d9..99ecc463 100644 --- a/packages/li-editor/.fatherrc.ts +++ b/packages/li-editor/.fatherrc.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'father'; import { getUMDConfig } from '../../scripts/fatherrc.base'; -const isBundle = process.env.BUNDLE_ENV !== 'bundless' && process.env.NODE_ENV === 'production'; +const isBundle = process.env.BUNDLE_ENV === 'bundle' && process.env.NODE_ENV === 'production'; export default defineConfig({ extends: '../../.fatherrc.base.ts', diff --git a/packages/li-editor/package.json b/packages/li-editor/package.json index c59360cc..ed8cca10 100644 --- a/packages/li-editor/package.json +++ b/packages/li-editor/package.json @@ -24,6 +24,7 @@ ], "scripts": { "build": "npm run clean && father build", + "bundle": "cross-env BUNDLE_ENV=bundle npm run build", "clean": "rimraf dist", "dev": "father dev", "docs:build": "dumi build", @@ -81,11 +82,5 @@ "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org" - }, - "nx": { - "implicitDependencies": [ - "@antv/li-sdk", - "@antv/li-p2" - ] } } diff --git a/packages/li-p2/.fatherrc.ts b/packages/li-p2/.fatherrc.ts index 2cf687c1..7cc3f725 100644 --- a/packages/li-p2/.fatherrc.ts +++ b/packages/li-p2/.fatherrc.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'father'; import { getUMDConfig } from '../../scripts/fatherrc.base'; -const isBundle = process.env.BUNDLE_ENV !== 'bundless' && process.env.NODE_ENV === 'production'; +const isBundle = process.env.BUNDLE_ENV === 'bundle' && process.env.NODE_ENV === 'production'; export default defineConfig({ extends: '../../.fatherrc.base.ts', diff --git a/packages/li-p2/package.json b/packages/li-p2/package.json index fc451418..878f40ab 100644 --- a/packages/li-p2/package.json +++ b/packages/li-p2/package.json @@ -27,6 +27,7 @@ ], "scripts": { "build": "npm run clean && father build", + "bundle": "cross-env BUNDLE_ENV=bundle npm run build", "clean": "rimraf dist", "dev": "father dev", "docs:build": "dumi build", diff --git a/packages/li-sdk/.fatherrc.ts b/packages/li-sdk/.fatherrc.ts index 33741fc4..15579806 100644 --- a/packages/li-sdk/.fatherrc.ts +++ b/packages/li-sdk/.fatherrc.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'father'; import { getUMDConfig } from '../../scripts/fatherrc.base'; -const isBundle = process.env.BUNDLE_ENV !== 'bundless' && process.env.NODE_ENV === 'production'; +const isBundle = process.env.BUNDLE_ENV === 'bundle' && process.env.NODE_ENV === 'production'; export default defineConfig({ extends: '../../.fatherrc.base.ts', diff --git a/packages/li-sdk/package.json b/packages/li-sdk/package.json index 989b1881..4bd1c604 100644 --- a/packages/li-sdk/package.json +++ b/packages/li-sdk/package.json @@ -24,6 +24,7 @@ ], "scripts": { "build": "npm run clean && father build", + "bundle": "cross-env BUNDLE_ENV=bundle npm run build", "clean": "rimraf dist", "dev": "father dev", "docs:build": "dumi build", diff --git a/tsconfig.json b/tsconfig.json index 30b1aef9..d62f0f58 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,11 +15,11 @@ "experimentalDecorators": true, "resolveJsonModule": true, "paths": { - "@antv/li-sdk": ["packages/li-sdk/src"], - "@antv/li-p2": ["packages/li-p2/src"], - "@antv/li-editor": ["packages/li-editor/src"], + "@antv/li-analysis-assets": ["packages/li-analysis-assets/src"], "@antv/li-core-assets": ["packages/li-core-assets/src"], - "@antv/li-analysis-assets": ["packages/li-analysis-assets/src"] + "@antv/li-editor": ["packages/li-editor/src"], + "@antv/li-p2": ["packages/li-p2/src"], + "@antv/li-sdk": ["packages/li-sdk/src"] } }, "exclude": ["node_modules", "lib", "es", "dist"]