@modern-js/create 2.60.6 → 2.62.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 +9 -48
- package/package.json +5 -6
package/dist/index.js
CHANGED
|
@@ -45928,7 +45928,7 @@ var CodeSmith = class {
|
|
|
45928
45928
|
};
|
|
45929
45929
|
|
|
45930
45930
|
// package.json
|
|
45931
|
-
var version = "2.
|
|
45931
|
+
var version = "2.62.0";
|
|
45932
45932
|
|
|
45933
45933
|
// src/utils/index.ts
|
|
45934
45934
|
var import_path9 = __toESM(require("path"));
|
|
@@ -45950,19 +45950,9 @@ function createDir(dirname, pwd) {
|
|
|
45950
45950
|
}
|
|
45951
45951
|
|
|
45952
45952
|
// src/createAction.ts
|
|
45953
|
-
var
|
|
45953
|
+
var MWA_GENERATOR = "@modern-js/mwa-generator";
|
|
45954
45954
|
function getDefaultConfig(projectDir = import_path10.default.basename(process.cwd()), options = {}, logger) {
|
|
45955
|
-
const {
|
|
45956
|
-
mwa,
|
|
45957
|
-
module: module2,
|
|
45958
|
-
config,
|
|
45959
|
-
packages,
|
|
45960
|
-
registry,
|
|
45961
|
-
distTag,
|
|
45962
|
-
plugin,
|
|
45963
|
-
needInstall,
|
|
45964
|
-
lang
|
|
45965
|
-
} = options;
|
|
45955
|
+
const { mwa, config, packages, registry, distTag, needInstall, lang } = options;
|
|
45966
45956
|
let initialConfig = {};
|
|
45967
45957
|
try {
|
|
45968
45958
|
if (config) {
|
|
@@ -45979,12 +45969,6 @@ function getDefaultConfig(projectDir = import_path10.default.basename(process.cw
|
|
|
45979
45969
|
if (mwa) {
|
|
45980
45970
|
initialConfig.defaultSolution = "mwa";
|
|
45981
45971
|
}
|
|
45982
|
-
if (module2) {
|
|
45983
|
-
initialConfig.defaultSolution = "module";
|
|
45984
|
-
if (!initialConfig.packageName) {
|
|
45985
|
-
initialConfig.packageName = projectDir;
|
|
45986
|
-
}
|
|
45987
|
-
}
|
|
45988
45972
|
if (registry) {
|
|
45989
45973
|
initialConfig.registry = registry;
|
|
45990
45974
|
}
|
|
@@ -45992,9 +45976,6 @@ function getDefaultConfig(projectDir = import_path10.default.basename(process.cw
|
|
|
45992
45976
|
initialConfig.distTag = distTag;
|
|
45993
45977
|
}
|
|
45994
45978
|
initialConfig.defaultBranch = initialConfig.defaultBranch || "main";
|
|
45995
|
-
if (plugin) {
|
|
45996
|
-
initialConfig.plugins = plugin;
|
|
45997
|
-
}
|
|
45998
45979
|
if (!needInstall) {
|
|
45999
45980
|
initialConfig.noNeedInstall = true;
|
|
46000
45981
|
}
|
|
@@ -46016,15 +45997,7 @@ function getDefaultConfig(projectDir = import_path10.default.basename(process.cw
|
|
|
46016
45997
|
function createAction(projectDir, options) {
|
|
46017
45998
|
return __async(this, null, function* () {
|
|
46018
45999
|
var _a, _b, _c, _d;
|
|
46019
|
-
const {
|
|
46020
|
-
lang,
|
|
46021
|
-
version: version2,
|
|
46022
|
-
debug: debug2,
|
|
46023
|
-
registry,
|
|
46024
|
-
distTag,
|
|
46025
|
-
generator: customGenerator,
|
|
46026
|
-
time
|
|
46027
|
-
} = options;
|
|
46000
|
+
const { lang, version: version2, debug: debug2, registry, distTag, time } = options;
|
|
46028
46001
|
const smith = new CodeSmith({
|
|
46029
46002
|
debug: debug2,
|
|
46030
46003
|
time,
|
|
@@ -46045,13 +46018,9 @@ function createAction(projectDir, options) {
|
|
|
46045
46018
|
}).start();
|
|
46046
46019
|
const prepareGlobalPromise = smith.prepareGlobal();
|
|
46047
46020
|
const prepareGeneratorPromise = smith.prepareGenerators([
|
|
46048
|
-
`@modern-js/repo-generator@${distTag || "latest"}`,
|
|
46049
|
-
`@modern-js/repo-next-generator@${distTag || "latest"}`,
|
|
46050
46021
|
`@modern-js/base-generator@${distTag || "latest"}`,
|
|
46051
46022
|
`@modern-js/mwa-generator@${distTag || "latest"}`,
|
|
46052
|
-
`@modern-js/entry-generator@${distTag || "latest"}
|
|
46053
|
-
`@modern-js/module-generator@${distTag || "latest"}`,
|
|
46054
|
-
`@modern-js/changeset-generator@${distTag || "latest"}`
|
|
46023
|
+
`@modern-js/entry-generator@${distTag || "latest"}`
|
|
46055
46024
|
]);
|
|
46056
46025
|
smith.logger.debug("📦 @modern-js/create:", `v${version}`);
|
|
46057
46026
|
smith.logger.debug("💡 [Current Dir]:", projectDir || "");
|
|
@@ -46067,9 +46036,9 @@ function createAction(projectDir, options) {
|
|
|
46067
46036
|
process.exit(1);
|
|
46068
46037
|
}
|
|
46069
46038
|
const config = getDefaultConfig(projectDir, options, smith.logger);
|
|
46070
|
-
let generator =
|
|
46071
|
-
if (process.env.CODESMITH_ENV === "development" && generator ===
|
|
46072
|
-
generator = require.resolve(
|
|
46039
|
+
let generator = MWA_GENERATOR;
|
|
46040
|
+
if (process.env.CODESMITH_ENV === "development" && generator === MWA_GENERATOR) {
|
|
46041
|
+
generator = require.resolve(MWA_GENERATOR);
|
|
46073
46042
|
} else if (!import_path10.default.isAbsolute(generator) && distTag) {
|
|
46074
46043
|
generator = `${generator}@${distTag}`;
|
|
46075
46044
|
yield prepareGeneratorPromise;
|
|
@@ -46108,15 +46077,7 @@ function src_default() {
|
|
|
46108
46077
|
i18n.changeLanguage({ locale: getLocaleLanguage() });
|
|
46109
46078
|
const program2 = new Command();
|
|
46110
46079
|
program2.command("clean-cache").description(i18n.t(localeKeys.command.cleanCache)).action(cleanCacheAction);
|
|
46111
|
-
program2.usage("[projectDir]").description(i18n.t(localeKeys.command.description)).argument("[projectDir]").option("--version", i18n.t(localeKeys.command.version)).option("--lang <lang>", i18n.t(localeKeys.command.lang)).option("-c, --config <config>", i18n.t(localeKeys.command.config), "{}").option("-d,--debug", i18n.t(localeKeys.command.debug), false).option("--
|
|
46112
|
-
"-p, --plugin <plugin>",
|
|
46113
|
-
i18n.t(localeKeys.command.plugin),
|
|
46114
|
-
(val, memo) => {
|
|
46115
|
-
memo.push(val);
|
|
46116
|
-
return memo;
|
|
46117
|
-
},
|
|
46118
|
-
[]
|
|
46119
|
-
).option("--dist-tag <distTag>", i18n.t(localeKeys.command.distTag), "").option("--packages <packages>", i18n.t(localeKeys.command.packages), "{}").option("--registry <registry>", i18n.t(localeKeys.command.registry), "").option("--no-need-install", i18n.t(localeKeys.command.noNeedInstall)).option("--time", i18n.t(localeKeys.command.time), false).action(createAction);
|
|
46080
|
+
program2.usage("[projectDir]").description(i18n.t(localeKeys.command.description)).argument("[projectDir]").option("--version", i18n.t(localeKeys.command.version)).option("--lang <lang>", i18n.t(localeKeys.command.lang)).option("-c, --config <config>", i18n.t(localeKeys.command.config), "{}").option("-d,--debug", i18n.t(localeKeys.command.debug), false).option("--dist-tag <distTag>", i18n.t(localeKeys.command.distTag), "").option("--packages <packages>", i18n.t(localeKeys.command.packages), "{}").option("--registry <registry>", i18n.t(localeKeys.command.registry), "").option("--no-need-install", i18n.t(localeKeys.command.noNeedInstall)).option("--time", i18n.t(localeKeys.command.time), false).action(createAction);
|
|
46120
46081
|
program2.parse(process.argv);
|
|
46121
46082
|
}
|
|
46122
46083
|
/*! Bundled license information:
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.62.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/index.js",
|
|
@@ -45,11 +45,10 @@
|
|
|
45
45
|
"jest": "^29",
|
|
46
46
|
"ts-node": "^10.9.1",
|
|
47
47
|
"typescript": "^5",
|
|
48
|
-
"@modern-js/
|
|
49
|
-
"@modern-js/
|
|
50
|
-
"@scripts/build": "2.
|
|
51
|
-
"@scripts/jest-config": "2.
|
|
52
|
-
"@modern-js/repo-generator": "3.7.2"
|
|
48
|
+
"@modern-js/plugin-i18n": "2.62.0",
|
|
49
|
+
"@modern-js/mwa-generator": "3.7.4",
|
|
50
|
+
"@scripts/build": "2.62.0",
|
|
51
|
+
"@scripts/jest-config": "2.62.0"
|
|
53
52
|
},
|
|
54
53
|
"publishConfig": {
|
|
55
54
|
"registry": "https://registry.npmjs.org/",
|