From e4d155d77d5c6e5eb2b9ca1addfc3c63149c742d Mon Sep 17 00:00:00 2001 From: "xuying.xu" Date: Mon, 14 Oct 2024 20:37:47 +0800 Subject: [PATCH] fix: export version --- lerna.json | 7 ++----- package.json | 3 ++- packages/f2/.fatherrc.js | 2 +- packages/f2/src/index.ts | 6 +++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lerna.json b/lerna.json index 8d0b60d94..4556ede6b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,18 +1,15 @@ { "npmClient": "yarn", - "useWorkspaces": true, + "packages": ["packages/*"], "version": "5.6.0", "command": { "bootstrap": { "ci": false, - "npmClientArgs": [ - "--no-package-lock" - ] + "npmClientArgs": ["--no-package-lock"] }, "publish": { "commitHooks": false, "conventionalCommits": true, - "createRelease": "github", "message": "🤖 publish", "exact": true } diff --git a/package.json b/package.json index ecdcaa1a2..749c465b1 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "prettier": "prettier --write './packages/**/*.{ts,tsx}'", "canary": "npm run build && npm run test && lerna publish --canary --dist-tag next", "release": "lerna publish --yes --summary-file", + "version": "lerna version --json", "site:build": "cd ./site && npm run site:build", "site:clean": "cd ./site && npm run site:clean", "site:deploy": "cd ./site && npm run site:deploy", @@ -82,7 +83,7 @@ "jest": "^26.6.3", "jest-electron": "^0.1.12", "jest-image-snapshot": "^6.1.0", - "lerna": "^6.6.2", + "lerna": "^8.1.2", "limit-size": "^0.1.4", "pre-commit": "^1.2.2", "rollup-plugin-visualizer": "^5.6.0", diff --git a/packages/f2/.fatherrc.js b/packages/f2/.fatherrc.js index 8af2fbca5..9267d1315 100644 --- a/packages/f2/.fatherrc.js +++ b/packages/f2/.fatherrc.js @@ -35,7 +35,7 @@ export default process.env.CI && process.env.CI === 'true' { "search": "VERSION", "searchTemplateStrings": true, - "replace": JSON.stringify(require('./package').version) + "replace": require('./package').version } ] } diff --git a/packages/f2/src/index.ts b/packages/f2/src/index.ts index 552f00e90..50140e795 100644 --- a/packages/f2/src/index.ts +++ b/packages/f2/src/index.ts @@ -2,7 +2,7 @@ export * from '@antv/f-engine'; export { default as Chart, ChartProps } from './chart'; -export { Scale, ScaleConfig } from './deps/f2-scale/src'; +export * from './deps/f2-scale/src'; export * from './components'; -//@ts-ignore -export default { version: 'VERSION' }; + +export { version } from '../package.json';