@modern-js/create 1.21.1 → 1.21.3
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 +14 -2
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -75652,6 +75652,7 @@ var ZH_LOCALE = {
|
|
|
75652
75652
|
module: "\u4E00\u952E\u521B\u5EFA\u6A21\u5757\u5316\u5E94\u7528(\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E)",
|
|
75653
75653
|
monorepo: "\u4E00\u952E\u5E38\u89C1 Monorepo \u5E94\u7528(\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E)",
|
|
75654
75654
|
config: "\u521B\u5EFA\u9879\u76EE\u9ED8\u8BA4\u914D\u7F6E(JSON \u5B57\u7B26\u4E32)",
|
|
75655
|
+
packages: "\u521B\u5EFA\u9879\u76EE\u6307\u5B9A\u7279\u5B9A\u4F9D\u8D56\u7248\u672C\u4FE1\u606F",
|
|
75655
75656
|
distTag: "\u751F\u6210\u9879\u76EE\u65F6\u751F\u6210\u5668\u4F7F\u7528\u7279\u6B8A\u7684 npm Tag",
|
|
75656
75657
|
registry: "\u5728\u521B\u5EFA\u8FC7\u7A0B\u4E2D\u5B9A\u5236 npm Registry",
|
|
75657
75658
|
debug: "\u5F00\u542F Debug \u6A21\u5F0F\uFF0C\u6253\u5370\u8C03\u8BD5\u65E5\u5FD7\u4FE1\u606F",
|
|
@@ -75669,6 +75670,7 @@ var EN_LOCALE = {
|
|
|
75669
75670
|
module: "create module application using default config",
|
|
75670
75671
|
monorepo: "create monorepo application using default config",
|
|
75671
75672
|
config: "set default project config(json string)",
|
|
75673
|
+
packages: "set project specific dependency version information",
|
|
75672
75674
|
distTag: `use specified tag version for it's generator`,
|
|
75673
75675
|
registry: "set npm registry url to run npm command",
|
|
75674
75676
|
debug: "using debug mode to log something",
|
|
@@ -75731,7 +75733,7 @@ function createDir(dirname, pwd) {
|
|
|
75731
75733
|
}
|
|
75732
75734
|
var REPO_GENERATOR = "@modern-js/repo-generator";
|
|
75733
75735
|
function getDefaultConfig(projectDir = import_path.default.basename(process.cwd()), options3, logger) {
|
|
75734
|
-
const { mwa, module: module2, monorepo, config, registry, distTag, plugin } = options3;
|
|
75736
|
+
const { mwa, module: module2, monorepo, config, packages, registry, distTag, plugin } = options3;
|
|
75735
75737
|
let initialConfig = {};
|
|
75736
75738
|
try {
|
|
75737
75739
|
if (config) {
|
|
@@ -75767,6 +75769,16 @@ function getDefaultConfig(projectDir = import_path.default.basename(process.cwd(
|
|
|
75767
75769
|
if (plugin) {
|
|
75768
75770
|
initialConfig.plugins = plugin;
|
|
75769
75771
|
}
|
|
75772
|
+
try {
|
|
75773
|
+
if (packages) {
|
|
75774
|
+
const packagesInfo = JSON.parse(packages);
|
|
75775
|
+
initialConfig.packagesInfo = packagesInfo;
|
|
75776
|
+
}
|
|
75777
|
+
} catch (e) {
|
|
75778
|
+
logger.error("packages parameter format is incorrect");
|
|
75779
|
+
logger.debug("parse packages error: ", e);
|
|
75780
|
+
process.exit(1);
|
|
75781
|
+
}
|
|
75770
75782
|
return initialConfig;
|
|
75771
75783
|
}
|
|
75772
75784
|
async function createAction(projectDir, options3) {
|
|
@@ -75814,7 +75826,7 @@ async function createAction(projectDir, options3) {
|
|
|
75814
75826
|
function src_default() {
|
|
75815
75827
|
i18n.changeLanguage({ locale: getLocaleLanguage() });
|
|
75816
75828
|
const program = new import_utils4.Command();
|
|
75817
|
-
program.usage("[projectDir]").description(i18n.t(localeKeys.command.description)).argument("[projectDir]").option("-c, --config <config>", i18n.t(localeKeys.command.config), "{}").option("--mwa", i18n.t(localeKeys.command.mwa), false).option("--module", i18n.t(localeKeys.command.module), false).option("--monorepo", i18n.t(localeKeys.command.monorepo), false).option("-p, --plugin <plugin>", i18n.t(localeKeys.command.plugin), (val, memo) => {
|
|
75829
|
+
program.usage("[projectDir]").description(i18n.t(localeKeys.command.description)).argument("[projectDir]").option("-c, --config <config>", i18n.t(localeKeys.command.config), "{}").option("--packages <packages>", i18n.t(localeKeys.command.packages), "{}").option("--mwa", i18n.t(localeKeys.command.mwa), false).option("--module", i18n.t(localeKeys.command.module), false).option("--monorepo", i18n.t(localeKeys.command.monorepo), false).option("-p, --plugin <plugin>", i18n.t(localeKeys.command.plugin), (val, memo) => {
|
|
75818
75830
|
memo.push(val);
|
|
75819
75831
|
return memo;
|
|
75820
75832
|
}, []).option("--dist-tag <distTag>", i18n.t(localeKeys.command.distTag), "").option("--registry <registry>", i18n.t(localeKeys.command.registry), "").option("-d,--debug", i18n.t(localeKeys.command.debug), false).action(createAction);
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.21.
|
|
14
|
+
"version": "1.21.3",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/index.js",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/runtime": "^7.18.0",
|
|
37
37
|
"@modern-js/codesmith": "1.6.3",
|
|
38
|
-
"@modern-js/generator-plugin-plugin": "2.4.
|
|
39
|
-
"@modern-js/plugin-i18n": "1.21.
|
|
40
|
-
"@modern-js/repo-generator": "2.4.
|
|
41
|
-
"@modern-js/utils": "1.21.
|
|
42
|
-
"@scripts/build": "1.21.
|
|
43
|
-
"@scripts/jest-config": "1.21.
|
|
38
|
+
"@modern-js/generator-plugin-plugin": "2.4.8",
|
|
39
|
+
"@modern-js/plugin-i18n": "1.21.3",
|
|
40
|
+
"@modern-js/repo-generator": "2.4.8",
|
|
41
|
+
"@modern-js/utils": "1.21.3",
|
|
42
|
+
"@scripts/build": "1.21.3",
|
|
43
|
+
"@scripts/jest-config": "1.21.3",
|
|
44
44
|
"@types/jest": "^27",
|
|
45
45
|
"@types/node": "^14",
|
|
46
46
|
"jest": "^27",
|