Skip to content

Commit

Permalink
build: 优化构建时常 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei authored Jul 20, 2023
1 parent 18b4609 commit 3e70f33
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 47 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 9 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,4 +38,3 @@ jobs:
directory: dist
branch: gh-pages
force: true

2 changes: 2 additions & 0 deletions Develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

采用多包管理方式,对应的包如下:

<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*QxdxQYWrqRgAAAAAAAAAAAAADmJ7AQ/original" width="600">

| 文件路径 | 包名 | 简介 |
| --------------------------- | -------------------------- | ---------------- |
| packages/li-sdk | `@antv/li-sdk` | SDK |
Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"version": {
"message": "chore: publish %s",
Expand Down
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
}
},
"namedInputs": {
"default": ["{projectRoot}/src/**/*"]
"default": ["{projectRoot}/src/**/*"],
"production": ["default"]
},
"targetDefaults": {
"start": {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/li-analysis-assets/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
6 changes: 2 additions & 4 deletions packages/li-analysis-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -77,9 +78,6 @@
"registry": "https://registry.npmjs.org"
},
"nx": {
"implicitDependencies": [
"@antv/li-sdk",
"@antv/li-p2"
]
"implicitDependencies": []
}
}
2 changes: 1 addition & 1 deletion packages/li-core-assets/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
6 changes: 2 additions & 4 deletions packages/li-core-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -71,9 +72,6 @@
"registry": "https://registry.npmjs.org"
},
"nx": {
"implicitDependencies": [
"@antv/li-sdk",
"@antv/li-p2"
]
"implicitDependencies": []
}
}
2 changes: 1 addition & 1 deletion packages/li-editor/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
7 changes: 1 addition & 6 deletions packages/li-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -81,11 +82,5 @@
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"nx": {
"implicitDependencies": [
"@antv/li-sdk",
"@antv/li-p2"
]
}
}
2 changes: 1 addition & 1 deletion packages/li-p2/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
1 change: 1 addition & 0 deletions packages/li-p2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/li-sdk/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
1 change: 1 addition & 0 deletions packages/li-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 3e70f33

Please sign in to comment.