@modern-js/create 2.11.0 → 2.12.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.
Files changed (2) hide show
  1. package/dist/index.js +323 -22
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -34983,12 +34983,16 @@ var require_commands = __commonJS({
34983
34983
  __export2(commands_exports, {
34984
34984
  getArgv: () => getArgv,
34985
34985
  getCommand: () => getCommand,
34986
+ getFullArgv: () => getFullArgv,
34986
34987
  isDevCommand: () => isDevCommand
34987
34988
  });
34988
34989
  module2.exports = __toCommonJS2(commands_exports);
34989
- var getArgv = () => {
34990
+ var getFullArgv = () => {
34990
34991
  var _a;
34991
- return (((_a = process.env.MODERN_ARGV) == null ? void 0 : _a.split(" ")) || process.argv).slice(2);
34992
+ return ((_a = process.env.MODERN_ARGV) == null ? void 0 : _a.split(" ")) || process.argv;
34993
+ };
34994
+ var getArgv = () => {
34995
+ return getFullArgv().slice(2);
34992
34996
  };
34993
34997
  var getCommand = () => {
34994
34998
  const args = getArgv();
@@ -37157,19 +37161,16 @@ var require_prettyInstructions = __commonJS({
37157
37161
  };
37158
37162
  var getAddressUrls = (protocol = "http", port) => {
37159
37163
  const ipv4Interfaces = getIpv4Interfaces();
37160
- return ipv4Interfaces.reduce(
37161
- (memo, detail) => {
37162
- let type = "Network: ";
37163
- let url = `${protocol}://${detail.address}:${port}`;
37164
- if (detail.address.includes(`localhost`) || detail.internal) {
37165
- type = "Local: ";
37166
- url = `${protocol}://localhost:${port}`;
37167
- }
37168
- memo.push({ type, url });
37169
- return memo;
37170
- },
37171
- []
37172
- );
37164
+ return ipv4Interfaces.reduce((memo, detail) => {
37165
+ let label = "Network: ";
37166
+ let url = `${protocol}://${detail.address}:${port}`;
37167
+ if (detail.address.includes(`localhost`) || detail.internal) {
37168
+ label = "Local: ";
37169
+ url = `${protocol}://localhost:${port}`;
37170
+ }
37171
+ memo.push({ label, url });
37172
+ return memo;
37173
+ }, []);
37173
37174
  };
37174
37175
  var prettyInstructions = (appContext, config) => {
37175
37176
  const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
@@ -37181,15 +37182,15 @@ var require_prettyInstructions = __commonJS({
37181
37182
  let message = "App running at:\n\n";
37182
37183
  if ((0, import_is.isSingleEntry)(entrypoints) || apiOnly) {
37183
37184
  message += urls.map(
37184
- ({ type, url }) => ` ${import_compiled.chalk.bold(`> ${type.padEnd(10)}`)}${import_compiled.chalk.cyanBright(
37185
+ ({ label, url }) => ` ${import_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${import_compiled.chalk.cyanBright(
37185
37186
  normalizeUrl(`${url}/${routes[0].urlPath}`)
37186
37187
  )}
37187
37188
  `
37188
37189
  ).join("");
37189
37190
  } else {
37190
37191
  const maxNameLength = Math.max(...routes.map((r) => r.entryName.length));
37191
- urls.forEach(({ type, url }) => {
37192
- message += ` ${import_compiled.chalk.bold(`> ${type}`)}
37192
+ urls.forEach(({ label, url }) => {
37193
+ message += ` ${import_compiled.chalk.bold(`> ${label}`)}
37193
37194
  `;
37194
37195
  routes.forEach(({ entryName, urlPath, isSSR }) => {
37195
37196
  if (!checkedEntries.includes(entryName)) {
@@ -71274,6 +71275,306 @@ var require_browser = __commonJS({
71274
71275
  }
71275
71276
  });
71276
71277
 
71278
+ // ../../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
71279
+ var require_has_flag = __commonJS({
71280
+ "../../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module2) {
71281
+ "use strict";
71282
+ module2.exports = (flag, argv = process.argv) => {
71283
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
71284
+ const position = argv.indexOf(prefix + flag);
71285
+ const terminatorPosition = argv.indexOf("--");
71286
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
71287
+ };
71288
+ }
71289
+ });
71290
+
71291
+ // ../../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
71292
+ var require_supports_color = __commonJS({
71293
+ "../../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module2) {
71294
+ "use strict";
71295
+ var os2 = require("os");
71296
+ var tty = require("tty");
71297
+ var hasFlag = require_has_flag();
71298
+ var { env } = process;
71299
+ var forceColor;
71300
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
71301
+ forceColor = 0;
71302
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
71303
+ forceColor = 1;
71304
+ }
71305
+ if ("FORCE_COLOR" in env) {
71306
+ if (env.FORCE_COLOR === "true") {
71307
+ forceColor = 1;
71308
+ } else if (env.FORCE_COLOR === "false") {
71309
+ forceColor = 0;
71310
+ } else {
71311
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
71312
+ }
71313
+ }
71314
+ function translateLevel(level) {
71315
+ if (level === 0) {
71316
+ return false;
71317
+ }
71318
+ return {
71319
+ level,
71320
+ hasBasic: true,
71321
+ has256: level >= 2,
71322
+ has16m: level >= 3
71323
+ };
71324
+ }
71325
+ function supportsColor(haveStream, streamIsTTY) {
71326
+ if (forceColor === 0) {
71327
+ return 0;
71328
+ }
71329
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
71330
+ return 3;
71331
+ }
71332
+ if (hasFlag("color=256")) {
71333
+ return 2;
71334
+ }
71335
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
71336
+ return 0;
71337
+ }
71338
+ const min = forceColor || 0;
71339
+ if (env.TERM === "dumb") {
71340
+ return min;
71341
+ }
71342
+ if (process.platform === "win32") {
71343
+ const osRelease = os2.release().split(".");
71344
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
71345
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
71346
+ }
71347
+ return 1;
71348
+ }
71349
+ if ("CI" in env) {
71350
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
71351
+ return 1;
71352
+ }
71353
+ return min;
71354
+ }
71355
+ if ("TEAMCITY_VERSION" in env) {
71356
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
71357
+ }
71358
+ if (env.COLORTERM === "truecolor") {
71359
+ return 3;
71360
+ }
71361
+ if ("TERM_PROGRAM" in env) {
71362
+ const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
71363
+ switch (env.TERM_PROGRAM) {
71364
+ case "iTerm.app":
71365
+ return version2 >= 3 ? 3 : 2;
71366
+ case "Apple_Terminal":
71367
+ return 2;
71368
+ }
71369
+ }
71370
+ if (/-256(color)?$/i.test(env.TERM)) {
71371
+ return 2;
71372
+ }
71373
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
71374
+ return 1;
71375
+ }
71376
+ if ("COLORTERM" in env) {
71377
+ return 1;
71378
+ }
71379
+ return min;
71380
+ }
71381
+ function getSupportLevel(stream) {
71382
+ const level = supportsColor(stream, stream && stream.isTTY);
71383
+ return translateLevel(level);
71384
+ }
71385
+ module2.exports = {
71386
+ supportsColor: getSupportLevel,
71387
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
71388
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
71389
+ };
71390
+ }
71391
+ });
71392
+
71393
+ // ../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js
71394
+ var require_node = __commonJS({
71395
+ "../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js"(exports, module2) {
71396
+ var tty = require("tty");
71397
+ var util = require("util");
71398
+ exports.init = init;
71399
+ exports.log = log;
71400
+ exports.formatArgs = formatArgs;
71401
+ exports.save = save;
71402
+ exports.load = load;
71403
+ exports.useColors = useColors;
71404
+ exports.destroy = util.deprecate(
71405
+ () => {
71406
+ },
71407
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
71408
+ );
71409
+ exports.colors = [6, 2, 3, 4, 5, 1];
71410
+ try {
71411
+ const supportsColor = require_supports_color();
71412
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
71413
+ exports.colors = [
71414
+ 20,
71415
+ 21,
71416
+ 26,
71417
+ 27,
71418
+ 32,
71419
+ 33,
71420
+ 38,
71421
+ 39,
71422
+ 40,
71423
+ 41,
71424
+ 42,
71425
+ 43,
71426
+ 44,
71427
+ 45,
71428
+ 56,
71429
+ 57,
71430
+ 62,
71431
+ 63,
71432
+ 68,
71433
+ 69,
71434
+ 74,
71435
+ 75,
71436
+ 76,
71437
+ 77,
71438
+ 78,
71439
+ 79,
71440
+ 80,
71441
+ 81,
71442
+ 92,
71443
+ 93,
71444
+ 98,
71445
+ 99,
71446
+ 112,
71447
+ 113,
71448
+ 128,
71449
+ 129,
71450
+ 134,
71451
+ 135,
71452
+ 148,
71453
+ 149,
71454
+ 160,
71455
+ 161,
71456
+ 162,
71457
+ 163,
71458
+ 164,
71459
+ 165,
71460
+ 166,
71461
+ 167,
71462
+ 168,
71463
+ 169,
71464
+ 170,
71465
+ 171,
71466
+ 172,
71467
+ 173,
71468
+ 178,
71469
+ 179,
71470
+ 184,
71471
+ 185,
71472
+ 196,
71473
+ 197,
71474
+ 198,
71475
+ 199,
71476
+ 200,
71477
+ 201,
71478
+ 202,
71479
+ 203,
71480
+ 204,
71481
+ 205,
71482
+ 206,
71483
+ 207,
71484
+ 208,
71485
+ 209,
71486
+ 214,
71487
+ 215,
71488
+ 220,
71489
+ 221
71490
+ ];
71491
+ }
71492
+ } catch (error) {
71493
+ }
71494
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
71495
+ return /^debug_/i.test(key);
71496
+ }).reduce((obj, key) => {
71497
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
71498
+ return k.toUpperCase();
71499
+ });
71500
+ let val = process.env[key];
71501
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
71502
+ val = true;
71503
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
71504
+ val = false;
71505
+ } else if (val === "null") {
71506
+ val = null;
71507
+ } else {
71508
+ val = Number(val);
71509
+ }
71510
+ obj[prop] = val;
71511
+ return obj;
71512
+ }, {});
71513
+ function useColors() {
71514
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
71515
+ }
71516
+ function formatArgs(args) {
71517
+ const { namespace: name, useColors: useColors2 } = this;
71518
+ if (useColors2) {
71519
+ const c = this.color;
71520
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
71521
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
71522
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
71523
+ args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
71524
+ } else {
71525
+ args[0] = getDate() + name + " " + args[0];
71526
+ }
71527
+ }
71528
+ function getDate() {
71529
+ if (exports.inspectOpts.hideDate) {
71530
+ return "";
71531
+ }
71532
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
71533
+ }
71534
+ function log(...args) {
71535
+ return process.stderr.write(util.format(...args) + "\n");
71536
+ }
71537
+ function save(namespaces) {
71538
+ if (namespaces) {
71539
+ process.env.DEBUG = namespaces;
71540
+ } else {
71541
+ delete process.env.DEBUG;
71542
+ }
71543
+ }
71544
+ function load() {
71545
+ return process.env.DEBUG;
71546
+ }
71547
+ function init(debug2) {
71548
+ debug2.inspectOpts = {};
71549
+ const keys = Object.keys(exports.inspectOpts);
71550
+ for (let i = 0; i < keys.length; i++) {
71551
+ debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
71552
+ }
71553
+ }
71554
+ module2.exports = require_common()(exports);
71555
+ var { formatters } = module2.exports;
71556
+ formatters.o = function(v) {
71557
+ this.inspectOpts.colors = this.useColors;
71558
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
71559
+ };
71560
+ formatters.O = function(v) {
71561
+ this.inspectOpts.colors = this.useColors;
71562
+ return util.inspect(v, this.inspectOpts);
71563
+ };
71564
+ }
71565
+ });
71566
+
71567
+ // ../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js
71568
+ var require_src = __commonJS({
71569
+ "../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js"(exports, module2) {
71570
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
71571
+ module2.exports = require_browser();
71572
+ } else {
71573
+ module2.exports = require_node();
71574
+ }
71575
+ }
71576
+ });
71577
+
71277
71578
  // ../../../node_modules/.pnpm/follow-redirects@1.15.1/node_modules/follow-redirects/debug.js
71278
71579
  var require_debug5 = __commonJS({
71279
71580
  "../../../node_modules/.pnpm/follow-redirects@1.15.1/node_modules/follow-redirects/debug.js"(exports, module2) {
@@ -71281,7 +71582,7 @@ var require_debug5 = __commonJS({
71281
71582
  module2.exports = function() {
71282
71583
  if (!debug2) {
71283
71584
  try {
71284
- debug2 = require_browser()("follow-redirects");
71585
+ debug2 = require_src()("follow-redirects");
71285
71586
  } catch (error) {
71286
71587
  }
71287
71588
  if (typeof debug2 !== "function") {
@@ -78415,7 +78716,7 @@ var require_codesmith = __commonJS({
78415
78716
  });
78416
78717
 
78417
78718
  // ../../../node_modules/.pnpm/@modern-js+codesmith@2.0.5/node_modules/@modern-js/codesmith/dist/js/node/index.js
78418
- var require_node = __commonJS({
78719
+ var require_node2 = __commonJS({
78419
78720
  "../../../node_modules/.pnpm/@modern-js+codesmith@2.0.5/node_modules/@modern-js/codesmith/dist/js/node/index.js"(exports) {
78420
78721
  "use strict";
78421
78722
  Object.defineProperty(exports, "__esModule", {
@@ -78521,10 +78822,10 @@ var import_utils5 = __toESM(require_dist());
78521
78822
 
78522
78823
  // src/createAction.ts
78523
78824
  var import_path2 = __toESM(require("path"));
78524
- var import_codesmith = __toESM(require_node());
78825
+ var import_codesmith = __toESM(require_node2());
78525
78826
 
78526
78827
  // package.json
78527
- var version = "2.11.0";
78828
+ var version = "2.12.0";
78528
78829
 
78529
78830
  // ../../cli/plugin-i18n/dist/esm-node/index.js
78530
78831
  var import_lodash2 = __toESM(require_lodash2());
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.11.0",
14
+ "version": "2.12.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/index.js",
@@ -40,12 +40,12 @@
40
40
  "jest": "^29",
41
41
  "ts-node": "^10.1.0",
42
42
  "typescript": "^4",
43
- "@modern-js/generator-plugin-plugin": "3.1.1",
44
- "@modern-js/plugin-i18n": "2.11.0",
45
- "@modern-js/repo-generator": "3.1.1",
46
- "@modern-js/utils": "2.11.0",
47
- "@scripts/jest-config": "2.11.0",
48
- "@scripts/build": "2.11.0"
43
+ "@modern-js/generator-plugin-plugin": "3.1.2",
44
+ "@modern-js/plugin-i18n": "2.12.0",
45
+ "@modern-js/repo-generator": "3.1.2",
46
+ "@modern-js/utils": "2.12.0",
47
+ "@scripts/build": "2.12.0",
48
+ "@scripts/jest-config": "2.12.0"
49
49
  },
50
50
  "sideEffects": false,
51
51
  "publishConfig": {