@modern-js/packages-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 +137 -23
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -84902,9 +84902,9 @@ var require_ms = __commonJS({
|
|
|
84902
84902
|
}
|
|
84903
84903
|
});
|
|
84904
84904
|
|
|
84905
|
-
// ../../../../node_modules/.pnpm/debug@4.3.
|
|
84905
|
+
// ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/common.js
|
|
84906
84906
|
var require_common2 = __commonJS({
|
|
84907
|
-
"../../../../node_modules/.pnpm/debug@4.3.
|
|
84907
|
+
"../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/common.js"(exports, module2) {
|
|
84908
84908
|
function setup(env) {
|
|
84909
84909
|
createDebug.debug = createDebug;
|
|
84910
84910
|
createDebug.default = createDebug;
|
|
@@ -85065,9 +85065,9 @@ var require_common2 = __commonJS({
|
|
|
85065
85065
|
}
|
|
85066
85066
|
});
|
|
85067
85067
|
|
|
85068
|
-
// ../../../../node_modules/.pnpm/debug@4.3.
|
|
85068
|
+
// ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/browser.js
|
|
85069
85069
|
var require_browser = __commonJS({
|
|
85070
|
-
"../../../../node_modules/.pnpm/debug@4.3.
|
|
85070
|
+
"../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/browser.js"(exports, module2) {
|
|
85071
85071
|
exports.formatArgs = formatArgs;
|
|
85072
85072
|
exports.save = save;
|
|
85073
85073
|
exports.load = load;
|
|
@@ -85234,9 +85234,122 @@ var require_browser = __commonJS({
|
|
|
85234
85234
|
}
|
|
85235
85235
|
});
|
|
85236
85236
|
|
|
85237
|
-
// ../../../../node_modules/.pnpm/
|
|
85237
|
+
// ../../../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js
|
|
85238
|
+
var require_supports_color2 = __commonJS({
|
|
85239
|
+
"../../../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js"(exports, module2) {
|
|
85240
|
+
"use strict";
|
|
85241
|
+
var os = require("os");
|
|
85242
|
+
var tty = require("tty");
|
|
85243
|
+
var hasFlag = require_has_flag();
|
|
85244
|
+
var { env } = process;
|
|
85245
|
+
var flagForceColor;
|
|
85246
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
85247
|
+
flagForceColor = 0;
|
|
85248
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
85249
|
+
flagForceColor = 1;
|
|
85250
|
+
}
|
|
85251
|
+
function envForceColor() {
|
|
85252
|
+
if ("FORCE_COLOR" in env) {
|
|
85253
|
+
if (env.FORCE_COLOR === "true") {
|
|
85254
|
+
return 1;
|
|
85255
|
+
}
|
|
85256
|
+
if (env.FORCE_COLOR === "false") {
|
|
85257
|
+
return 0;
|
|
85258
|
+
}
|
|
85259
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
85260
|
+
}
|
|
85261
|
+
}
|
|
85262
|
+
function translateLevel(level) {
|
|
85263
|
+
if (level === 0) {
|
|
85264
|
+
return false;
|
|
85265
|
+
}
|
|
85266
|
+
return {
|
|
85267
|
+
level,
|
|
85268
|
+
hasBasic: true,
|
|
85269
|
+
has256: level >= 2,
|
|
85270
|
+
has16m: level >= 3
|
|
85271
|
+
};
|
|
85272
|
+
}
|
|
85273
|
+
function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
85274
|
+
const noFlagForceColor = envForceColor();
|
|
85275
|
+
if (noFlagForceColor !== void 0) {
|
|
85276
|
+
flagForceColor = noFlagForceColor;
|
|
85277
|
+
}
|
|
85278
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
85279
|
+
if (forceColor === 0) {
|
|
85280
|
+
return 0;
|
|
85281
|
+
}
|
|
85282
|
+
if (sniffFlags) {
|
|
85283
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
85284
|
+
return 3;
|
|
85285
|
+
}
|
|
85286
|
+
if (hasFlag("color=256")) {
|
|
85287
|
+
return 2;
|
|
85288
|
+
}
|
|
85289
|
+
}
|
|
85290
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
85291
|
+
return 0;
|
|
85292
|
+
}
|
|
85293
|
+
const min = forceColor || 0;
|
|
85294
|
+
if (env.TERM === "dumb") {
|
|
85295
|
+
return min;
|
|
85296
|
+
}
|
|
85297
|
+
if (process.platform === "win32") {
|
|
85298
|
+
const osRelease = os.release().split(".");
|
|
85299
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
85300
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
85301
|
+
}
|
|
85302
|
+
return 1;
|
|
85303
|
+
}
|
|
85304
|
+
if ("CI" in env) {
|
|
85305
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
85306
|
+
return 1;
|
|
85307
|
+
}
|
|
85308
|
+
return min;
|
|
85309
|
+
}
|
|
85310
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
85311
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
85312
|
+
}
|
|
85313
|
+
if (env.COLORTERM === "truecolor") {
|
|
85314
|
+
return 3;
|
|
85315
|
+
}
|
|
85316
|
+
if ("TERM_PROGRAM" in env) {
|
|
85317
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
85318
|
+
switch (env.TERM_PROGRAM) {
|
|
85319
|
+
case "iTerm.app":
|
|
85320
|
+
return version >= 3 ? 3 : 2;
|
|
85321
|
+
case "Apple_Terminal":
|
|
85322
|
+
return 2;
|
|
85323
|
+
}
|
|
85324
|
+
}
|
|
85325
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
85326
|
+
return 2;
|
|
85327
|
+
}
|
|
85328
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
85329
|
+
return 1;
|
|
85330
|
+
}
|
|
85331
|
+
if ("COLORTERM" in env) {
|
|
85332
|
+
return 1;
|
|
85333
|
+
}
|
|
85334
|
+
return min;
|
|
85335
|
+
}
|
|
85336
|
+
function getSupportLevel(stream, options = {}) {
|
|
85337
|
+
const level = supportsColor(stream, __spreadValues({
|
|
85338
|
+
streamIsTTY: stream && stream.isTTY
|
|
85339
|
+
}, options));
|
|
85340
|
+
return translateLevel(level);
|
|
85341
|
+
}
|
|
85342
|
+
module2.exports = {
|
|
85343
|
+
supportsColor: getSupportLevel,
|
|
85344
|
+
stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
|
|
85345
|
+
stderr: getSupportLevel({ isTTY: tty.isatty(2) })
|
|
85346
|
+
};
|
|
85347
|
+
}
|
|
85348
|
+
});
|
|
85349
|
+
|
|
85350
|
+
// ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/node.js
|
|
85238
85351
|
var require_node2 = __commonJS({
|
|
85239
|
-
"../../../../node_modules/.pnpm/debug@4.3.
|
|
85352
|
+
"../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/node.js"(exports, module2) {
|
|
85240
85353
|
var tty = require("tty");
|
|
85241
85354
|
var util = require("util");
|
|
85242
85355
|
exports.init = init;
|
|
@@ -85252,7 +85365,7 @@ var require_node2 = __commonJS({
|
|
|
85252
85365
|
);
|
|
85253
85366
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
85254
85367
|
try {
|
|
85255
|
-
const supportsColor =
|
|
85368
|
+
const supportsColor = require_supports_color2();
|
|
85256
85369
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
85257
85370
|
exports.colors = [
|
|
85258
85371
|
20,
|
|
@@ -85408,9 +85521,9 @@ var require_node2 = __commonJS({
|
|
|
85408
85521
|
}
|
|
85409
85522
|
});
|
|
85410
85523
|
|
|
85411
|
-
// ../../../../node_modules/.pnpm/debug@4.3.
|
|
85524
|
+
// ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/index.js
|
|
85412
85525
|
var require_src3 = __commonJS({
|
|
85413
|
-
"../../../../node_modules/.pnpm/debug@4.3.
|
|
85526
|
+
"../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/index.js"(exports, module2) {
|
|
85414
85527
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
85415
85528
|
module2.exports = require_browser();
|
|
85416
85529
|
} else {
|
|
@@ -117807,9 +117920,10 @@ var require_prettyInstructions = __commonJS({
|
|
|
117807
117920
|
}, []);
|
|
117808
117921
|
};
|
|
117809
117922
|
var prettyInstructions = (appContext, config) => {
|
|
117810
|
-
var _config_dev;
|
|
117923
|
+
var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
|
|
117811
117924
|
const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
|
|
117812
|
-
const
|
|
117925
|
+
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);
|
|
117926
|
+
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
|
117813
117927
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
|
117814
117928
|
let message = "App running at:\n\n";
|
|
117815
117929
|
if ((0, _is.isSingleEntry)(entrypoints) || apiOnly) {
|
|
@@ -118246,7 +118360,7 @@ var mime = Import.lazy("../compiled/mime-types", require);
|
|
|
118246
118360
|
var chokidar = Import.lazy("../compiled/chokidar", require);
|
|
118247
118361
|
var inquirer = Import.lazy("../compiled/inquirer", require);
|
|
118248
118362
|
|
|
118249
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
118363
|
+
// ../../../../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
|
|
118250
118364
|
var import_lodash6 = __toESM(require_lodash2());
|
|
118251
118365
|
var import_comment_json = __toESM(require_src2());
|
|
118252
118366
|
|
|
@@ -130347,10 +130461,10 @@ var Schema = (
|
|
|
130347
130461
|
}()
|
|
130348
130462
|
);
|
|
130349
130463
|
|
|
130350
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.
|
|
130464
|
+
// ../../../../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
|
|
130351
130465
|
var import_inquirer = __toESM(require_inquirer());
|
|
130352
130466
|
|
|
130353
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.
|
|
130467
|
+
// ../../../../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
|
|
130354
130468
|
var import_lodash2 = __toESM(require_lodash2());
|
|
130355
130469
|
function asyncGeneratorStep9(gen, resolve, reject, _next, _throw, key, arg) {
|
|
130356
130470
|
try {
|
|
@@ -130697,7 +130811,7 @@ function transformForm(schema) {
|
|
|
130697
130811
|
return getQuestionFromSchema(schema, configValue, validateMap, initValue);
|
|
130698
130812
|
}
|
|
130699
130813
|
|
|
130700
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.
|
|
130814
|
+
// ../../../../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
|
|
130701
130815
|
function asyncGeneratorStep10(gen, resolve, reject, _next, _throw, key, arg) {
|
|
130702
130816
|
try {
|
|
130703
130817
|
var info = gen[key](arg);
|
|
@@ -131221,7 +131335,7 @@ function _prompt() {
|
|
|
131221
131335
|
return _prompt.apply(this, arguments);
|
|
131222
131336
|
}
|
|
131223
131337
|
|
|
131224
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.2.
|
|
131338
|
+
// ../../../../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
|
|
131225
131339
|
function asyncGeneratorStep11(gen, resolve, reject, _next, _throw, key, arg) {
|
|
131226
131340
|
try {
|
|
131227
131341
|
var info = gen[key](arg);
|
|
@@ -131461,7 +131575,7 @@ var CLIReader = /* @__PURE__ */ function() {
|
|
|
131461
131575
|
return CLIReader2;
|
|
131462
131576
|
}();
|
|
131463
131577
|
|
|
131464
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131578
|
+
// ../../../../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
|
|
131465
131579
|
var import_inquirer2 = __toESM(require_inquirer2());
|
|
131466
131580
|
|
|
131467
131581
|
// ../../../../node_modules/.pnpm/@modern-js+plugin-i18n@2.18.0/node_modules/@modern-js/plugin-i18n/dist/esm-node/index.js
|
|
@@ -131540,7 +131654,7 @@ var I18n = class {
|
|
|
131540
131654
|
}
|
|
131541
131655
|
};
|
|
131542
131656
|
|
|
131543
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131657
|
+
// ../../../../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
|
|
131544
131658
|
var ZH_LOCALE = {
|
|
131545
131659
|
environment: {
|
|
131546
131660
|
node_version: "请升级 Node 版本至 LIS",
|
|
@@ -131567,7 +131681,7 @@ var ZH_LOCALE = {
|
|
|
131567
131681
|
}
|
|
131568
131682
|
};
|
|
131569
131683
|
|
|
131570
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131684
|
+
// ../../../../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
|
|
131571
131685
|
var EN_LOCALE = {
|
|
131572
131686
|
environment: {
|
|
131573
131687
|
node_version: "please upgrade node to lts version",
|
|
@@ -131594,14 +131708,14 @@ var EN_LOCALE = {
|
|
|
131594
131708
|
}
|
|
131595
131709
|
};
|
|
131596
131710
|
|
|
131597
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131711
|
+
// ../../../../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
|
|
131598
131712
|
var i18n = new I18n();
|
|
131599
131713
|
var localeKeys = i18n.init("zh", {
|
|
131600
131714
|
zh: ZH_LOCALE,
|
|
131601
131715
|
en: EN_LOCALE
|
|
131602
131716
|
});
|
|
131603
131717
|
|
|
131604
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131718
|
+
// ../../../../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
|
|
131605
131719
|
var import_lodash5 = __toESM(require_lodash2());
|
|
131606
131720
|
function asyncGeneratorStep12(gen, resolve, reject, _next, _throw, key, arg) {
|
|
131607
131721
|
try {
|
|
@@ -131810,7 +131924,7 @@ function transformInquirerSchema(questions) {
|
|
|
131810
131924
|
return questions;
|
|
131811
131925
|
}
|
|
131812
131926
|
|
|
131813
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
131927
|
+
// ../../../../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
|
|
131814
131928
|
var import_path4 = __toESM(require("path"));
|
|
131815
131929
|
function asyncGeneratorStep13(gen, resolve, reject, _next, _throw, key, arg) {
|
|
131816
131930
|
try {
|
|
@@ -132074,7 +132188,7 @@ function _checkUseNvm() {
|
|
|
132074
132188
|
return _checkUseNvm.apply(this, arguments);
|
|
132075
132189
|
}
|
|
132076
132190
|
|
|
132077
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.2.
|
|
132191
|
+
// ../../../../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
|
|
132078
132192
|
function _array_like_to_array(arr, len) {
|
|
132079
132193
|
if (len == null || len > arr.length)
|
|
132080
132194
|
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,10 +30,10 @@
|
|
|
30
30
|
"@types/node": "^14",
|
|
31
31
|
"jest": "^29",
|
|
32
32
|
"typescript": "^5",
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
33
|
+
"@scripts/jest-config": "2.22.1",
|
|
34
|
+
"@scripts/build": "2.22.1",
|
|
35
|
+
"@modern-js/generator-utils": "3.1.21",
|
|
36
|
+
"@modern-js/generator-common": "3.1.21"
|
|
37
37
|
},
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"publishConfig": {
|