Skip to content

Commit

Permalink
feat: optimize generator bundle (#4838)
Browse files Browse the repository at this point in the history
  • Loading branch information
caohuilin authored Oct 24, 2023
1 parent af507b3 commit 8f43163
Show file tree
Hide file tree
Showing 50 changed files with 573 additions and 434 deletions.
34 changes: 34 additions & 0 deletions .changeset/warm-days-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
'@modern-js/module-test-generator': patch
'@modern-js/tailwindcss-generator': patch
'@modern-js/dependence-generator': patch
'@modern-js/changeset-generator': patch
'@modern-js/generator-generator': patch
'@modern-js/router-v5-generator': patch
'@modern-js/storybook-generator': patch
'@modern-js/monorepo-generator': patch
'@modern-js/packages-generator': patch
'@modern-js/upgrade-generator': patch
'@modern-js/module-generator': patch
'@modern-js/rspack-generator': patch
'@modern-js/server-generator': patch
'@modern-js/entry-generator': patch
'@modern-js/base-generator': patch
'@modern-js/repo-generator': patch
'@modern-js/test-generator': patch
'@modern-js/bff-generator': patch
'@modern-js/mwa-generator': patch
'@modern-js/ssg-generator': patch
'@modern-js/generator-common': patch
'@modern-js/generator-plugin': patch
'@modern-js/generator-utils': patch
'@modern-js/sandpack-react': patch
'@modern-js/new-action': patch
'@modern-js/upgrade': patch
'@modern-js/create': patch
'@scripts/build': patch
---

feat: optimize generator bundle

feat: 优化生成器打包
6 changes: 3 additions & 3 deletions packages/generator/generator-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/codesmith-formily": "2.2.5",
"@modern-js/codesmith-formily": "2.3.0",
"@modern-js/plugin-i18n": "workspace:*",
"@swc/helpers": "0.5.1"
},
"devDependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
Expand Down
10 changes: 5 additions & 5 deletions packages/generator/generator-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"test": "jest"
},
"dependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-git": "2.2.5",
"@modern-js/codesmith-api-json": "2.2.5",
"@modern-js/codesmith-api-npm": "2.2.5",
"@modern-js/codesmith-formily": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-git": "2.3.0",
"@modern-js/codesmith-api-json": "2.3.0",
"@modern-js/codesmith-api-npm": "2.3.0",
"@modern-js/codesmith-formily": "2.3.0",
"@modern-js/generator-common": "workspace:*",
"@modern-js/generator-utils": "workspace:*",
"@modern-js/new-action": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/generator-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@swc/helpers": "0.5.1"
},
"devDependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
11 changes: 3 additions & 8 deletions packages/generator/generators/base-generator/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { generatorBuildConfig } = require('@scripts/build');

module.exports = {
buildConfig: {
target: 'es2019',
autoExternal: false,
alias: {
chalk: '@modern-js/utils/chalk',
},
dts: false,
},
buildConfig: generatorBuildConfig,
};
8 changes: 5 additions & 3 deletions packages/generator/generators/base-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
"build": "modern-lib build",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/utils": "workspace:*"
},
"devDependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/generator-common": "workspace:*",
"@modern-js/generator-utils": "workspace:*",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
11 changes: 3 additions & 8 deletions packages/generator/generators/bff-generator/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { generatorBuildConfig } = require('@scripts/build');

module.exports = {
buildConfig: {
target: 'es2019',
autoExternal: false,
alias: {
chalk: '@modern-js/utils/chalk',
},
dts: false,
},
buildConfig: generatorBuildConfig,
};
10 changes: 6 additions & 4 deletions packages/generator/generators/bff-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@
"build": "modern-lib build",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/utils": "workspace:*"
},
"devDependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith-api-json": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/codesmith-api-json": "2.3.0",
"@modern-js/generator-common": "workspace:*",
"@modern-js/plugin-i18n": "workspace:*",
"@modern-js/generator-utils": "workspace:*",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { generatorBuildConfig } = require('@scripts/build');

module.exports = {
buildConfig: {
target: 'es2019',
autoExternal: false,
alias: {
chalk: '@modern-js/utils/chalk',
},
dts: false,
},
buildConfig: generatorBuildConfig,
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
"build": "modern-lib build",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/utils": "workspace:*"
},
"devDependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/generator-common": "workspace:*",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { generatorBuildConfig } = require('@scripts/build');

module.exports = {
buildConfig: {
target: 'es2019',
autoExternal: false,
alias: {
chalk: '@modern-js/utils/chalk',
},
dts: false,
},
buildConfig: generatorBuildConfig,
};
10 changes: 6 additions & 4 deletions packages/generator/generators/dependence-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@
"build": "modern-lib build",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/utils": "workspace:*"
},
"devDependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith-api-json": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/codesmith-api-json": "2.3.0",
"@modern-js/generator-common": "workspace:*",
"@modern-js/generator-utils": "workspace:*",
"@modern-js/plugin-i18n": "workspace:*",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
11 changes: 3 additions & 8 deletions packages/generator/generators/entry-generator/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { generatorBuildConfig } = require('@scripts/build');

module.exports = {
buildConfig: {
target: 'es2019',
autoExternal: false,
alias: {
chalk: '@modern-js/utils/chalk',
},
dts: false,
},
buildConfig: generatorBuildConfig,
};
10 changes: 6 additions & 4 deletions packages/generator/generators/entry-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@
"build": "modern-lib build",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/utils": "workspace:*"
},
"devDependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith-api-handlebars": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/codesmith-api-handlebars": "2.3.0",
"@modern-js/generator-common": "workspace:*",
"@modern-js/generator-utils": "workspace:*",
"@modern-js/plugin-i18n": "workspace:*",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { generatorBuildConfig } = require('@scripts/build');

module.exports = {
buildConfig: {
target: 'es2019',
autoExternal: false,
alias: {
chalk: '@modern-js/utils/chalk',
},
dts: false,
},
buildConfig: generatorBuildConfig,
};
10 changes: 6 additions & 4 deletions packages/generator/generators/generator-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@
"build": "modern-lib build",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/utils": "workspace:*"
},
"devDependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith-api-json": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/codesmith-api-json": "2.3.0",
"@modern-js/generator-common": "workspace:*",
"@modern-js/generator-utils": "workspace:*",
"@modern-js/module-generator": "workspace:*",
"@modern-js/plugin-i18n": "workspace:*",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
11 changes: 3 additions & 8 deletions packages/generator/generators/module-generator/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { generatorBuildConfig } = require('@scripts/build');

module.exports = {
buildConfig: {
target: 'es2019',
autoExternal: false,
alias: {
chalk: '@modern-js/utils/chalk',
},
dts: false,
},
buildConfig: generatorBuildConfig,
};
8 changes: 5 additions & 3 deletions packages/generator/generators/module-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,19 @@
"build": "modern-lib build",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/utils": "workspace:*"
},
"devDependencies": {
"@modern-js/base-generator": "workspace:*",
"@modern-js/changeset-generator": "workspace:*",
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/dependence-generator": "workspace:*",
"@modern-js/generator-common": "workspace:*",
"@modern-js/generator-utils": "workspace:*",
"@modern-js/plugin-i18n": "workspace:*",
"@modern-js/packages-generator": "workspace:*",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { generatorBuildConfig } = require('@scripts/build');

module.exports = {
buildConfig: {
target: 'es2019',
autoExternal: false,
alias: {
chalk: '@modern-js/utils/chalk',
},
dts: false,
},
buildConfig: generatorBuildConfig,
};
10 changes: 6 additions & 4 deletions packages/generator/generators/module-test-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@
"build": "modern-lib build",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/utils": "workspace:*"
},
"devDependencies": {
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith-api-json": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/codesmith-api-json": "2.3.0",
"@modern-js/dependence-generator": "workspace:*",
"@modern-js/generator-common": "workspace:*",
"@modern-js/generator-utils": "workspace:*",
"@modern-js/plugin-i18n": "workspace:*",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { generatorBuildConfig } = require('@scripts/build');

module.exports = {
buildConfig: {
target: 'es2019',
autoExternal: false,
alias: {
chalk: '@modern-js/utils/chalk',
},
dts: false,
},
buildConfig: generatorBuildConfig,
};
10 changes: 6 additions & 4 deletions packages/generator/generators/monorepo-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,19 @@
"build": "modern-lib build",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@modern-js/utils": "workspace:*"
},
"devDependencies": {
"@modern-js/base-generator": "workspace:*",
"@modern-js/changeset-generator": "workspace:*",
"@modern-js/codesmith": "2.2.5",
"@modern-js/codesmith-api-app": "2.2.5",
"@modern-js/codesmith-api-json": "2.2.5",
"@modern-js/codesmith": "2.3.0",
"@modern-js/codesmith-api-app": "2.3.0",
"@modern-js/codesmith-api-json": "2.3.0",
"@modern-js/generator-common": "workspace:*",
"@modern-js/generator-utils": "workspace:*",
"@modern-js/plugin-i18n": "workspace:*",
"@modern-js/packages-generator": "workspace:*",
"@modern-js/utils": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/jest": "^29",
Expand Down
Loading

0 comments on commit 8f43163

Please sign in to comment.