@modern-js/mwa-generator 3.4.17 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -38
- package/package.json +11 -11
- package/src/index.ts +2 -6
package/dist/index.js
CHANGED
|
@@ -61868,11 +61868,6 @@ var EN_LOCALE2 = {
|
|
|
61868
61868
|
func: "Function",
|
|
61869
61869
|
framework: "Framework"
|
|
61870
61870
|
}
|
|
61871
|
-
},
|
|
61872
|
-
buildTools: {
|
|
61873
|
-
self: "Please select the bundler:",
|
|
61874
|
-
webpack: "webpack",
|
|
61875
|
-
rspack: "Rspack (experimental)"
|
|
61876
61871
|
}
|
|
61877
61872
|
};
|
|
61878
61873
|
|
|
@@ -61960,11 +61955,6 @@ var ZH_LOCALE2 = {
|
|
|
61960
61955
|
func: "函数模式",
|
|
61961
61956
|
framework: "框架模式"
|
|
61962
61957
|
}
|
|
61963
|
-
},
|
|
61964
|
-
buildTools: {
|
|
61965
|
-
self: "请选择构建工具",
|
|
61966
|
-
webpack: "webpack",
|
|
61967
|
-
rspack: "Rspack (实验性)"
|
|
61968
61958
|
}
|
|
61969
61959
|
};
|
|
61970
61960
|
|
|
@@ -62105,36 +62095,13 @@ var getPackagePathSchema = (extra) => {
|
|
|
62105
62095
|
};
|
|
62106
62096
|
};
|
|
62107
62097
|
|
|
62108
|
-
// ../../generator-common/dist/esm-node/mwa/common.js
|
|
62109
|
-
var Framework;
|
|
62110
|
-
(function(Framework2) {
|
|
62111
|
-
Framework2["Express"] = "express";
|
|
62112
|
-
Framework2["Koa"] = "koa";
|
|
62113
|
-
})(Framework || (Framework = {}));
|
|
62114
|
-
var BuildTools;
|
|
62115
|
-
(function(BuildTools2) {
|
|
62116
|
-
BuildTools2["Webpack"] = "webpack";
|
|
62117
|
-
BuildTools2["Rspack"] = "rspack";
|
|
62118
|
-
})(BuildTools || (BuildTools = {}));
|
|
62119
|
-
var getBuildToolsSchema = (_extra = {}) => {
|
|
62120
|
-
return {
|
|
62121
|
-
type: "string",
|
|
62122
|
-
title: i18n2.t(localeKeys2.buildTools.self),
|
|
62123
|
-
enum: Object.values(BuildTools).map((tool) => ({
|
|
62124
|
-
value: tool,
|
|
62125
|
-
label: i18n2.t(localeKeys2.buildTools[tool])
|
|
62126
|
-
}))
|
|
62127
|
-
};
|
|
62128
|
-
};
|
|
62129
|
-
|
|
62130
62098
|
// ../../generator-common/dist/esm-node/mwa/project.js
|
|
62131
62099
|
var getMWASchemaProperties = (extra) => {
|
|
62132
62100
|
return {
|
|
62133
62101
|
packageName: getPackageNameSchema(extra),
|
|
62134
62102
|
packagePath: getPackagePathSchema(extra),
|
|
62135
62103
|
language: getLanguageSchema(extra),
|
|
62136
|
-
packageManager: getPackageManagerSchema(extra)
|
|
62137
|
-
buildTools: getBuildToolsSchema(extra)
|
|
62104
|
+
packageManager: getPackageManagerSchema(extra)
|
|
62138
62105
|
};
|
|
62139
62106
|
};
|
|
62140
62107
|
var getMWASchema = (extra = {}) => {
|
|
@@ -62146,8 +62113,7 @@ var getMWASchema = (extra = {}) => {
|
|
|
62146
62113
|
var MWADefaultConfig = {
|
|
62147
62114
|
language: Language.TS,
|
|
62148
62115
|
packageManager: PackageManager.Pnpm,
|
|
62149
|
-
needModifyMWAConfig: BooleanConfig.NO
|
|
62150
|
-
buildTools: BuildTools.Webpack
|
|
62116
|
+
needModifyMWAConfig: BooleanConfig.NO
|
|
62151
62117
|
};
|
|
62152
62118
|
|
|
62153
62119
|
// ../../generator-utils/dist/esm/index.js
|
|
@@ -62391,8 +62357,8 @@ var handleTemplateFile = async (context, generator, appApi) => {
|
|
|
62391
62357
|
);
|
|
62392
62358
|
generator.logger.debug(`inputData=${JSON.stringify(ans)}`, ans);
|
|
62393
62359
|
const { packageName, packagePath, language, packageManager } = ans;
|
|
62394
|
-
const { packagesInfo
|
|
62395
|
-
const bundler =
|
|
62360
|
+
const { packagesInfo } = context.config;
|
|
62361
|
+
const bundler = `'rspack', // Set to 'webpack' to enable webpack`;
|
|
62396
62362
|
const projectPath = getMWAProjectPath(
|
|
62397
62363
|
packagePath,
|
|
62398
62364
|
isMonorepoSubProject
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.
|
|
18
|
+
"version": "3.5.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"/dist/index.js"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@modern-js/utils": "2.
|
|
26
|
+
"@modern-js/utils": "2.59.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@modern-js/codesmith": "2.4.1",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
"@types/node": "^14",
|
|
33
33
|
"jest": "^29",
|
|
34
34
|
"typescript": "^5",
|
|
35
|
-
"@modern-js/
|
|
36
|
-
"@modern-js/
|
|
37
|
-
"@modern-js/entry-generator": "3.
|
|
38
|
-
"@modern-js/generator-
|
|
39
|
-
"@modern-js/packages-generator": "3.
|
|
40
|
-
"@
|
|
41
|
-
"@modern-js/plugin-i18n": "2.
|
|
42
|
-
"@
|
|
43
|
-
"@scripts/build": "2.
|
|
35
|
+
"@modern-js/dependence-generator": "3.5.0",
|
|
36
|
+
"@modern-js/base-generator": "3.5.0",
|
|
37
|
+
"@modern-js/entry-generator": "3.5.0",
|
|
38
|
+
"@modern-js/generator-utils": "3.5.0",
|
|
39
|
+
"@modern-js/packages-generator": "3.5.0",
|
|
40
|
+
"@scripts/jest-config": "2.59.0",
|
|
41
|
+
"@modern-js/plugin-i18n": "2.59.0",
|
|
42
|
+
"@modern-js/generator-common": "3.5.0",
|
|
43
|
+
"@scripts/build": "2.59.0"
|
|
44
44
|
},
|
|
45
45
|
"sideEffects": false,
|
|
46
46
|
"publishConfig": {
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
|
|
3
3
|
import { AppAPI } from '@modern-js/codesmith-api-app';
|
|
4
4
|
import {
|
|
5
5
|
BaseGenerator,
|
|
6
|
-
BuildTools,
|
|
7
6
|
EntryGenerator,
|
|
8
7
|
Language,
|
|
9
8
|
PackagesGenerator,
|
|
@@ -108,12 +107,9 @@ export const handleTemplateFile = async (
|
|
|
108
107
|
generator.logger.debug(`inputData=${JSON.stringify(ans)}`, ans);
|
|
109
108
|
|
|
110
109
|
const { packageName, packagePath, language, packageManager } = ans;
|
|
111
|
-
const { packagesInfo
|
|
110
|
+
const { packagesInfo } = context.config;
|
|
112
111
|
|
|
113
|
-
const bundler =
|
|
114
|
-
buildTools === BuildTools.Rspack
|
|
115
|
-
? `'experimental-rspack',`
|
|
116
|
-
: `'webpack', // Set to 'experimental-rspack' to enable rspack ⚡️🦀`;
|
|
112
|
+
const bundler = `'rspack', // Set to 'webpack' to enable webpack`;
|
|
117
113
|
|
|
118
114
|
const projectPath = getMWAProjectPath(
|
|
119
115
|
packagePath as string,
|