@modern-js/upgrade-generator 3.1.20 → 3.1.21
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 +58 -46
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -84457,9 +84457,9 @@ var require_ms = __commonJS({
|
|
|
84457
84457
|
}
|
|
84458
84458
|
});
|
|
84459
84459
|
|
|
84460
|
-
// ../../../../node_modules/.pnpm/debug@4.3.
|
|
84460
|
+
// ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/common.js
|
|
84461
84461
|
var require_common2 = __commonJS({
|
|
84462
|
-
"../../../../node_modules/.pnpm/debug@4.3.
|
|
84462
|
+
"../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/common.js"(exports, module2) {
|
|
84463
84463
|
function setup(env) {
|
|
84464
84464
|
createDebug.debug = createDebug;
|
|
84465
84465
|
createDebug.default = createDebug;
|
|
@@ -84620,9 +84620,9 @@ var require_common2 = __commonJS({
|
|
|
84620
84620
|
}
|
|
84621
84621
|
});
|
|
84622
84622
|
|
|
84623
|
-
// ../../../../node_modules/.pnpm/debug@4.3.
|
|
84623
|
+
// ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/browser.js
|
|
84624
84624
|
var require_browser = __commonJS({
|
|
84625
|
-
"../../../../node_modules/.pnpm/debug@4.3.
|
|
84625
|
+
"../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/browser.js"(exports, module2) {
|
|
84626
84626
|
exports.formatArgs = formatArgs;
|
|
84627
84627
|
exports.save = save;
|
|
84628
84628
|
exports.load = load;
|
|
@@ -84802,27 +84802,29 @@ var require_has_flag = __commonJS({
|
|
|
84802
84802
|
}
|
|
84803
84803
|
});
|
|
84804
84804
|
|
|
84805
|
-
// ../../../../node_modules/.pnpm/supports-color@
|
|
84805
|
+
// ../../../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js
|
|
84806
84806
|
var require_supports_color = __commonJS({
|
|
84807
|
-
"../../../../node_modules/.pnpm/supports-color@
|
|
84807
|
+
"../../../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js"(exports, module2) {
|
|
84808
84808
|
"use strict";
|
|
84809
84809
|
var os = require("os");
|
|
84810
84810
|
var tty = require("tty");
|
|
84811
84811
|
var hasFlag = require_has_flag();
|
|
84812
84812
|
var { env } = process;
|
|
84813
|
-
var
|
|
84813
|
+
var flagForceColor;
|
|
84814
84814
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
84815
|
-
|
|
84815
|
+
flagForceColor = 0;
|
|
84816
84816
|
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
84817
|
-
|
|
84817
|
+
flagForceColor = 1;
|
|
84818
84818
|
}
|
|
84819
|
-
|
|
84820
|
-
if (
|
|
84821
|
-
|
|
84822
|
-
|
|
84823
|
-
|
|
84824
|
-
|
|
84825
|
-
|
|
84819
|
+
function envForceColor() {
|
|
84820
|
+
if ("FORCE_COLOR" in env) {
|
|
84821
|
+
if (env.FORCE_COLOR === "true") {
|
|
84822
|
+
return 1;
|
|
84823
|
+
}
|
|
84824
|
+
if (env.FORCE_COLOR === "false") {
|
|
84825
|
+
return 0;
|
|
84826
|
+
}
|
|
84827
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
84826
84828
|
}
|
|
84827
84829
|
}
|
|
84828
84830
|
function translateLevel(level) {
|
|
@@ -84836,15 +84838,22 @@ var require_supports_color = __commonJS({
|
|
|
84836
84838
|
has16m: level >= 3
|
|
84837
84839
|
};
|
|
84838
84840
|
}
|
|
84839
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
84841
|
+
function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
84842
|
+
const noFlagForceColor = envForceColor();
|
|
84843
|
+
if (noFlagForceColor !== void 0) {
|
|
84844
|
+
flagForceColor = noFlagForceColor;
|
|
84845
|
+
}
|
|
84846
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
84840
84847
|
if (forceColor === 0) {
|
|
84841
84848
|
return 0;
|
|
84842
84849
|
}
|
|
84843
|
-
if (
|
|
84844
|
-
|
|
84845
|
-
|
|
84846
|
-
|
|
84847
|
-
|
|
84850
|
+
if (sniffFlags) {
|
|
84851
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
84852
|
+
return 3;
|
|
84853
|
+
}
|
|
84854
|
+
if (hasFlag("color=256")) {
|
|
84855
|
+
return 2;
|
|
84856
|
+
}
|
|
84848
84857
|
}
|
|
84849
84858
|
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
84850
84859
|
return 0;
|
|
@@ -84861,7 +84870,7 @@ var require_supports_color = __commonJS({
|
|
|
84861
84870
|
return 1;
|
|
84862
84871
|
}
|
|
84863
84872
|
if ("CI" in env) {
|
|
84864
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
84873
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
84865
84874
|
return 1;
|
|
84866
84875
|
}
|
|
84867
84876
|
return min;
|
|
@@ -84873,7 +84882,7 @@ var require_supports_color = __commonJS({
|
|
|
84873
84882
|
return 3;
|
|
84874
84883
|
}
|
|
84875
84884
|
if ("TERM_PROGRAM" in env) {
|
|
84876
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
84885
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
84877
84886
|
switch (env.TERM_PROGRAM) {
|
|
84878
84887
|
case "iTerm.app":
|
|
84879
84888
|
return version >= 3 ? 3 : 2;
|
|
@@ -84892,21 +84901,23 @@ var require_supports_color = __commonJS({
|
|
|
84892
84901
|
}
|
|
84893
84902
|
return min;
|
|
84894
84903
|
}
|
|
84895
|
-
function getSupportLevel(stream) {
|
|
84896
|
-
const level = supportsColor(stream,
|
|
84904
|
+
function getSupportLevel(stream, options = {}) {
|
|
84905
|
+
const level = supportsColor(stream, __spreadValues({
|
|
84906
|
+
streamIsTTY: stream && stream.isTTY
|
|
84907
|
+
}, options));
|
|
84897
84908
|
return translateLevel(level);
|
|
84898
84909
|
}
|
|
84899
84910
|
module2.exports = {
|
|
84900
84911
|
supportsColor: getSupportLevel,
|
|
84901
|
-
stdout:
|
|
84902
|
-
stderr:
|
|
84912
|
+
stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
|
|
84913
|
+
stderr: getSupportLevel({ isTTY: tty.isatty(2) })
|
|
84903
84914
|
};
|
|
84904
84915
|
}
|
|
84905
84916
|
});
|
|
84906
84917
|
|
|
84907
|
-
// ../../../../node_modules/.pnpm/debug@4.3.
|
|
84918
|
+
// ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/node.js
|
|
84908
84919
|
var require_node2 = __commonJS({
|
|
84909
|
-
"../../../../node_modules/.pnpm/debug@4.3.
|
|
84920
|
+
"../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/node.js"(exports, module2) {
|
|
84910
84921
|
var tty = require("tty");
|
|
84911
84922
|
var util = require("util");
|
|
84912
84923
|
exports.init = init;
|
|
@@ -85078,9 +85089,9 @@ var require_node2 = __commonJS({
|
|
|
85078
85089
|
}
|
|
85079
85090
|
});
|
|
85080
85091
|
|
|
85081
|
-
// ../../../../node_modules/.pnpm/debug@4.3.
|
|
85092
|
+
// ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/index.js
|
|
85082
85093
|
var require_src3 = __commonJS({
|
|
85083
|
-
"../../../../node_modules/.pnpm/debug@4.3.
|
|
85094
|
+
"../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/index.js"(exports, module2) {
|
|
85084
85095
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
85085
85096
|
module2.exports = require_browser();
|
|
85086
85097
|
} else {
|
|
@@ -117477,9 +117488,10 @@ var require_prettyInstructions = __commonJS({
|
|
|
117477
117488
|
}, []);
|
|
117478
117489
|
};
|
|
117479
117490
|
var prettyInstructions = (appContext, config) => {
|
|
117480
|
-
var _config_dev;
|
|
117491
|
+
var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
|
|
117481
117492
|
const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
|
|
117482
|
-
const
|
|
117493
|
+
const isHttps = (0, _is.isDev)() && ((_appContext_builder_context_devServer = (_appContext_builder = appContext.builder) === null || _appContext_builder === void 0 ? void 0 : _appContext_builder.context.devServer) === null || _appContext_builder_context_devServer === void 0 ? void 0 : _appContext_builder_context_devServer.https);
|
|
117494
|
+
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
|
117483
117495
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
|
117484
117496
|
let message = "App running at:\n\n";
|
|
117485
117497
|
if ((0, _is.isSingleEntry)(entrypoints) || apiOnly) {
|
|
@@ -117924,7 +117936,7 @@ var mime = Import.lazy("../compiled/mime-types", require);
|
|
|
117924
117936
|
var chokidar = Import.lazy("../compiled/chokidar", require);
|
|
117925
117937
|
var inquirer = Import.lazy("../compiled/inquirer", require);
|
|
117926
117938
|
|
|
117927
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
117939
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm/index.js
|
|
117928
117940
|
var import_lodash6 = __toESM(require_lodash2());
|
|
117929
117941
|
var import_comment_json = __toESM(require_src2());
|
|
117930
117942
|
|
|
@@ -130025,10 +130037,10 @@ var Schema = (
|
|
|
130025
130037
|
}()
|
|
130026
130038
|
);
|
|
130027
130039
|
|
|
130028
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.
|
|
130040
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm/prompt.js
|
|
130029
130041
|
var import_inquirer = __toESM(require_inquirer());
|
|
130030
130042
|
|
|
130031
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.
|
|
130043
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm/transform.js
|
|
130032
130044
|
var import_lodash2 = __toESM(require_lodash2());
|
|
130033
130045
|
function asyncGeneratorStep9(gen, resolve, reject, _next, _throw, key, arg) {
|
|
130034
130046
|
try {
|
|
@@ -130375,7 +130387,7 @@ function transformForm(schema) {
|
|
|
130375
130387
|
return getQuestionFromSchema(schema, configValue, validateMap, initValue);
|
|
130376
130388
|
}
|
|
130377
130389
|
|
|
130378
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.
|
|
130390
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm/prompt.js
|
|
130379
130391
|
function asyncGeneratorStep10(gen, resolve, reject, _next, _throw, key, arg) {
|
|
130380
130392
|
try {
|
|
130381
130393
|
var info = gen[key](arg);
|
|
@@ -130899,7 +130911,7 @@ function _prompt() {
|
|
|
130899
130911
|
return _prompt.apply(this, arguments);
|
|
130900
130912
|
}
|
|
130901
130913
|
|
|
130902
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.
|
|
130914
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm/inquirer.js
|
|
130903
130915
|
function asyncGeneratorStep11(gen, resolve, reject, _next, _throw, key, arg) {
|
|
130904
130916
|
try {
|
|
130905
130917
|
var info = gen[key](arg);
|
|
@@ -131139,7 +131151,7 @@ var CLIReader = /* @__PURE__ */ function() {
|
|
|
131139
131151
|
return CLIReader2;
|
|
131140
131152
|
}();
|
|
131141
131153
|
|
|
131142
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131154
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm/index.js
|
|
131143
131155
|
var import_inquirer2 = __toESM(require_inquirer2());
|
|
131144
131156
|
|
|
131145
131157
|
// ../../../../node_modules/.pnpm/@modern-js+plugin-i18n@2.18.0/node_modules/@modern-js/plugin-i18n/dist/esm-node/index.js
|
|
@@ -131218,7 +131230,7 @@ var I18n = class {
|
|
|
131218
131230
|
}
|
|
131219
131231
|
};
|
|
131220
131232
|
|
|
131221
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131233
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm/locale/zh.js
|
|
131222
131234
|
var ZH_LOCALE = {
|
|
131223
131235
|
environment: {
|
|
131224
131236
|
node_version: "请升级 Node 版本至 LIS",
|
|
@@ -131245,7 +131257,7 @@ var ZH_LOCALE = {
|
|
|
131245
131257
|
}
|
|
131246
131258
|
};
|
|
131247
131259
|
|
|
131248
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131260
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm/locale/en.js
|
|
131249
131261
|
var EN_LOCALE = {
|
|
131250
131262
|
environment: {
|
|
131251
131263
|
node_version: "please upgrade node to lts version",
|
|
@@ -131272,14 +131284,14 @@ var EN_LOCALE = {
|
|
|
131272
131284
|
}
|
|
131273
131285
|
};
|
|
131274
131286
|
|
|
131275
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131287
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm/locale/index.js
|
|
131276
131288
|
var i18n = new I18n();
|
|
131277
131289
|
var localeKeys = i18n.init("zh", {
|
|
131278
131290
|
zh: ZH_LOCALE,
|
|
131279
131291
|
en: EN_LOCALE
|
|
131280
131292
|
});
|
|
131281
131293
|
|
|
131282
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131294
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm/utils/transform.js
|
|
131283
131295
|
var import_lodash5 = __toESM(require_lodash2());
|
|
131284
131296
|
function asyncGeneratorStep12(gen, resolve, reject, _next, _throw, key, arg) {
|
|
131285
131297
|
try {
|
|
@@ -131488,7 +131500,7 @@ function transformInquirerSchema(questions) {
|
|
|
131488
131500
|
return questions;
|
|
131489
131501
|
}
|
|
131490
131502
|
|
|
131491
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131503
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm/utils/checkUseNvm.js
|
|
131492
131504
|
var import_path4 = __toESM(require("path"));
|
|
131493
131505
|
function asyncGeneratorStep13(gen, resolve, reject, _next, _throw, key, arg) {
|
|
131494
131506
|
try {
|
|
@@ -131752,7 +131764,7 @@ function _checkUseNvm() {
|
|
|
131752
131764
|
return _checkUseNvm.apply(this, arguments);
|
|
131753
131765
|
}
|
|
131754
131766
|
|
|
131755
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131767
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.5_@modern-js+codesmith@2.2.5_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm/index.js
|
|
131756
131768
|
function _array_like_to_array(arr, len) {
|
|
131757
131769
|
if (len == null || len > arr.length)
|
|
131758
131770
|
len = arr.length;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.1.
|
|
18
|
+
"version": "3.1.21",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"@types/node": "^14",
|
|
31
31
|
"jest": "^29",
|
|
32
32
|
"typescript": "^5",
|
|
33
|
-
"@scripts/build": "2.22.
|
|
34
|
-
"@scripts/jest-config": "2.22.
|
|
35
|
-
"@modern-js/generator-
|
|
36
|
-
"@modern-js/plugin-i18n": "2.22.
|
|
37
|
-
"@modern-js/generator-
|
|
33
|
+
"@scripts/build": "2.22.1",
|
|
34
|
+
"@scripts/jest-config": "2.22.1",
|
|
35
|
+
"@modern-js/generator-utils": "3.1.21",
|
|
36
|
+
"@modern-js/plugin-i18n": "2.22.1",
|
|
37
|
+
"@modern-js/generator-common": "3.1.21"
|
|
38
38
|
},
|
|
39
39
|
"sideEffects": false,
|
|
40
40
|
"publishConfig": {
|