@modern-js/create 2.21.1 → 2.22.1

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 +117 -77
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -15512,9 +15512,9 @@ var require_ms = __commonJS({
15512
15512
  }
15513
15513
  });
15514
15514
 
15515
- // ../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js
15515
+ // ../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/common.js
15516
15516
  var require_common = __commonJS({
15517
- "../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js"(exports, module2) {
15517
+ "../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/common.js"(exports, module2) {
15518
15518
  function setup(env) {
15519
15519
  createDebug.debug = createDebug;
15520
15520
  createDebug.default = createDebug;
@@ -15675,9 +15675,9 @@ var require_common = __commonJS({
15675
15675
  }
15676
15676
  });
15677
15677
 
15678
- // ../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js
15678
+ // ../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/browser.js
15679
15679
  var require_browser = __commonJS({
15680
- "../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js"(exports, module2) {
15680
+ "../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/browser.js"(exports, module2) {
15681
15681
  exports.formatArgs = formatArgs;
15682
15682
  exports.save = save;
15683
15683
  exports.load = load;
@@ -15857,27 +15857,29 @@ var require_has_flag = __commonJS({
15857
15857
  }
15858
15858
  });
15859
15859
 
15860
- // ../../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
15860
+ // ../../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js
15861
15861
  var require_supports_color = __commonJS({
15862
- "../../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module2) {
15862
+ "../../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js"(exports, module2) {
15863
15863
  "use strict";
15864
15864
  var os3 = require("os");
15865
15865
  var tty = require("tty");
15866
15866
  var hasFlag = require_has_flag();
15867
15867
  var { env } = process;
15868
- var forceColor;
15868
+ var flagForceColor;
15869
15869
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
15870
- forceColor = 0;
15870
+ flagForceColor = 0;
15871
15871
  } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
15872
- forceColor = 1;
15872
+ flagForceColor = 1;
15873
15873
  }
15874
- if ("FORCE_COLOR" in env) {
15875
- if (env.FORCE_COLOR === "true") {
15876
- forceColor = 1;
15877
- } else if (env.FORCE_COLOR === "false") {
15878
- forceColor = 0;
15879
- } else {
15880
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
15874
+ function envForceColor() {
15875
+ if ("FORCE_COLOR" in env) {
15876
+ if (env.FORCE_COLOR === "true") {
15877
+ return 1;
15878
+ }
15879
+ if (env.FORCE_COLOR === "false") {
15880
+ return 0;
15881
+ }
15882
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
15881
15883
  }
15882
15884
  }
15883
15885
  function translateLevel(level) {
@@ -15891,15 +15893,22 @@ var require_supports_color = __commonJS({
15891
15893
  has16m: level >= 3
15892
15894
  };
15893
15895
  }
15894
- function supportsColor(haveStream, streamIsTTY) {
15896
+ function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
15897
+ const noFlagForceColor = envForceColor();
15898
+ if (noFlagForceColor !== void 0) {
15899
+ flagForceColor = noFlagForceColor;
15900
+ }
15901
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
15895
15902
  if (forceColor === 0) {
15896
15903
  return 0;
15897
15904
  }
15898
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
15899
- return 3;
15900
- }
15901
- if (hasFlag("color=256")) {
15902
- return 2;
15905
+ if (sniffFlags) {
15906
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
15907
+ return 3;
15908
+ }
15909
+ if (hasFlag("color=256")) {
15910
+ return 2;
15911
+ }
15903
15912
  }
15904
15913
  if (haveStream && !streamIsTTY && forceColor === void 0) {
15905
15914
  return 0;
@@ -15916,7 +15925,7 @@ var require_supports_color = __commonJS({
15916
15925
  return 1;
15917
15926
  }
15918
15927
  if ("CI" in env) {
15919
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
15928
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
15920
15929
  return 1;
15921
15930
  }
15922
15931
  return min;
@@ -15928,7 +15937,7 @@ var require_supports_color = __commonJS({
15928
15937
  return 3;
15929
15938
  }
15930
15939
  if ("TERM_PROGRAM" in env) {
15931
- const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
15940
+ const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
15932
15941
  switch (env.TERM_PROGRAM) {
15933
15942
  case "iTerm.app":
15934
15943
  return version2 >= 3 ? 3 : 2;
@@ -15947,21 +15956,23 @@ var require_supports_color = __commonJS({
15947
15956
  }
15948
15957
  return min;
15949
15958
  }
15950
- function getSupportLevel(stream) {
15951
- const level = supportsColor(stream, stream && stream.isTTY);
15959
+ function getSupportLevel(stream, options = {}) {
15960
+ const level = supportsColor(stream, __spreadValues({
15961
+ streamIsTTY: stream && stream.isTTY
15962
+ }, options));
15952
15963
  return translateLevel(level);
15953
15964
  }
15954
15965
  module2.exports = {
15955
15966
  supportsColor: getSupportLevel,
15956
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
15957
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
15967
+ stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
15968
+ stderr: getSupportLevel({ isTTY: tty.isatty(2) })
15958
15969
  };
15959
15970
  }
15960
15971
  });
15961
15972
 
15962
- // ../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js
15973
+ // ../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/node.js
15963
15974
  var require_node = __commonJS({
15964
- "../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js"(exports, module2) {
15975
+ "../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/node.js"(exports, module2) {
15965
15976
  var tty = require("tty");
15966
15977
  var util = require("util");
15967
15978
  exports.init = init;
@@ -16133,9 +16144,9 @@ var require_node = __commonJS({
16133
16144
  }
16134
16145
  });
16135
16146
 
16136
- // ../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js
16147
+ // ../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/index.js
16137
16148
  var require_src = __commonJS({
16138
- "../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js"(exports, module2) {
16149
+ "../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/index.js"(exports, module2) {
16139
16150
  if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
16140
16151
  module2.exports = require_browser();
16141
16152
  } else {
@@ -36429,7 +36440,7 @@ function getLocaleLanguage() {
36429
36440
  // src/createAction.ts
36430
36441
  var import_path9 = __toESM(require("path"));
36431
36442
 
36432
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/logger/constants.js
36443
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/logger/constants.js
36433
36444
  var LoggerLevel;
36434
36445
  (function(LoggerLevel2) {
36435
36446
  LoggerLevel2["Error"] = "error";
@@ -36468,7 +36479,7 @@ var mime = Import.lazy("../compiled/mime-types", require);
36468
36479
  var chokidar = Import.lazy("../compiled/chokidar", require);
36469
36480
  var inquirer = Import.lazy("../compiled/inquirer", require);
36470
36481
 
36471
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/logger/index.js
36482
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/logger/index.js
36472
36483
  function _array_like_to_array(arr, len) {
36473
36484
  if (len == null || len > arr.length)
36474
36485
  len = arr.length;
@@ -36653,20 +36664,20 @@ var Logger = /* @__PURE__ */ function() {
36653
36664
  return Logger22;
36654
36665
  }();
36655
36666
 
36656
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/codesmith/index.js
36667
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/codesmith/index.js
36657
36668
  var import_path7 = __toESM(require("path"));
36658
36669
 
36659
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/generator/index.js
36670
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/generator/index.js
36660
36671
  var import_path4 = __toESM(require("path"));
36661
36672
  var import_events = require("events");
36662
36673
 
36663
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/materials/FsMaterial.js
36674
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/materials/FsMaterial.js
36664
36675
  var import_path2 = __toESM(require("path"));
36665
36676
 
36666
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/materials/FsResource.js
36677
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/materials/FsResource.js
36667
36678
  var import_path = __toESM(require("path"));
36668
36679
 
36669
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/materials/constants.js
36680
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/materials/constants.js
36670
36681
  var IMAGE_EXT_LIST = [
36671
36682
  ".jpg",
36672
36683
  ".jpeg",
@@ -36680,7 +36691,7 @@ var IMAGE_EXT_LIST = [
36680
36691
  ".wmf"
36681
36692
  ];
36682
36693
 
36683
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/materials/FsResource.js
36694
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/materials/FsResource.js
36684
36695
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
36685
36696
  try {
36686
36697
  var info = gen[key](arg);
@@ -36912,7 +36923,7 @@ var FsResource = /* @__PURE__ */ function() {
36912
36923
  return FsResource2;
36913
36924
  }();
36914
36925
 
36915
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/materials/FsMaterial.js
36926
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/materials/FsMaterial.js
36916
36927
  function asyncGeneratorStep2(gen, resolve, reject, _next, _throw, key, arg) {
36917
36928
  try {
36918
36929
  var info = gen[key](arg);
@@ -37136,7 +37147,7 @@ var FsMaterial = /* @__PURE__ */ function() {
37136
37147
  return FsMaterial2;
37137
37148
  }();
37138
37149
 
37139
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/nodeRequire.js
37150
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/nodeRequire.js
37140
37151
  var nodeRequire = function(path11) {
37141
37152
  try {
37142
37153
  var module2 = __non_webpack_require__(path11);
@@ -37153,10 +37164,10 @@ var nodeRequire = function(path11) {
37153
37164
  }
37154
37165
  };
37155
37166
 
37156
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/getGeneratorDir.js
37167
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/getGeneratorDir.js
37157
37168
  var import_path3 = __toESM(require("path"));
37158
37169
 
37159
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/fsExists.js
37170
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/fsExists.js
37160
37171
  function asyncGeneratorStep3(gen, resolve, reject, _next, _throw, key, arg) {
37161
37172
  try {
37162
37173
  var info = gen[key](arg);
@@ -37329,7 +37340,7 @@ function _fsExists() {
37329
37340
  return _fsExists.apply(this, arguments);
37330
37341
  }
37331
37342
 
37332
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/getGeneratorDir.js
37343
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/getGeneratorDir.js
37333
37344
  function asyncGeneratorStep4(gen, resolve, reject, _next, _throw, key, arg) {
37334
37345
  try {
37335
37346
  var info = gen[key](arg);
@@ -37523,7 +37534,7 @@ function _getGeneratorDir() {
37523
37534
  return _getGeneratorDir.apply(this, arguments);
37524
37535
  }
37525
37536
 
37526
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/generator/index.js
37537
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/generator/index.js
37527
37538
  function asyncGeneratorStep5(gen, resolve, reject, _next, _throw, key, arg) {
37528
37539
  try {
37529
37540
  var info = gen[key](arg);
@@ -37737,6 +37748,7 @@ var GeneratorCore = /* @__PURE__ */ function() {
37737
37748
  _define_property4(this, "logger", void 0);
37738
37749
  _define_property4(this, "materialsManager", void 0);
37739
37750
  _define_property4(this, "outputPath", void 0);
37751
+ _define_property4(this, "basePath", void 0);
37740
37752
  var _this = this;
37741
37753
  _define_property4(this, "output", {
37742
37754
  fs: function() {
@@ -37774,6 +37786,7 @@ var GeneratorCore = /* @__PURE__ */ function() {
37774
37786
  this.logger = logger;
37775
37787
  this.materialsManager = materialsManager;
37776
37788
  this.outputPath = outputPath;
37789
+ this.basePath = process.cwd();
37777
37790
  this.event = new import_events.EventEmitter();
37778
37791
  this.event.setMaxListeners(15);
37779
37792
  this._context = _object_spread({
@@ -37816,6 +37829,12 @@ var GeneratorCore = /* @__PURE__ */ function() {
37816
37829
  this.outputPath = outputPath;
37817
37830
  }
37818
37831
  },
37832
+ {
37833
+ key: "setbasePath",
37834
+ value: function setbasePath(basePath) {
37835
+ this.basePath = basePath;
37836
+ }
37837
+ },
37819
37838
  {
37820
37839
  key: "loadLocalGenerator",
37821
37840
  value: function loadLocalGenerator(generator) {
@@ -37966,11 +37985,15 @@ var GeneratorCore = /* @__PURE__ */ function() {
37966
37985
  value: function loadGenerator(generator) {
37967
37986
  var _this = this;
37968
37987
  return _async_to_generator5(function() {
37969
- var loadGeneratorPromise, _ref, generatorPkg, pkgJson, materialKey, generatorScript;
37988
+ var generatorPath, loadGeneratorPromise, _ref, generatorPkg, pkgJson, materialKey, generatorScript;
37970
37989
  return __generator5(this, function(_state) {
37971
37990
  switch (_state.label) {
37972
37991
  case 0:
37973
- loadGeneratorPromise = import_path4.default.isAbsolute(generator) ? _this.loadLocalGenerator(generator) : _this.loadRemoteGenerator(generator);
37992
+ generatorPath = generator;
37993
+ if (generator.startsWith("file:")) {
37994
+ generatorPath = import_path4.default.join(_this.basePath, generator.slice(5));
37995
+ }
37996
+ loadGeneratorPromise = import_path4.default.isAbsolute(generatorPath) ? _this.loadLocalGenerator(generatorPath) : _this.loadRemoteGenerator(generator);
37974
37997
  return [
37975
37998
  4,
37976
37999
  loadGeneratorPromise
@@ -38031,6 +38054,7 @@ var GeneratorCore = /* @__PURE__ */ function() {
38031
38054
  material: generatorPkg
38032
38055
  });
38033
38056
  spinner.stop();
38057
+ _this.setbasePath(_this._context.current.material.basePath);
38034
38058
  return [
38035
38059
  4,
38036
38060
  generatorScript(_this._context, _this)
@@ -38052,7 +38076,7 @@ var GeneratorCore = /* @__PURE__ */ function() {
38052
38076
  var relativePwdPath = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", config = arguments.length > 2 ? arguments[2] : void 0;
38053
38077
  var _this = this;
38054
38078
  return _async_to_generator5(function() {
38055
- var spinner, _ref, materialKey, generatorPkg, generatorScript, subContext, preOutputPath;
38079
+ var spinner, _ref, materialKey, generatorPkg, generatorScript, subContext, preOutputPath, preBasePath;
38056
38080
  return __generator5(this, function(_state) {
38057
38081
  switch (_state.label) {
38058
38082
  case 0:
@@ -38081,7 +38105,9 @@ var GeneratorCore = /* @__PURE__ */ function() {
38081
38105
  });
38082
38106
  _this.logger.debug("subContext", subContext);
38083
38107
  preOutputPath = _this.outputPath;
38108
+ preBasePath = _this.basePath;
38084
38109
  _this.setOutputPath(import_path4.default.resolve(_this.outputPath, relativePwdPath || ""));
38110
+ _this.setbasePath(subContext.current.material.basePath);
38085
38111
  spinner.stop();
38086
38112
  return [
38087
38113
  4,
@@ -38090,6 +38116,7 @@ var GeneratorCore = /* @__PURE__ */ function() {
38090
38116
  case 2:
38091
38117
  _state.sent();
38092
38118
  _this.setOutputPath(preOutputPath);
38119
+ _this.setbasePath(preBasePath);
38093
38120
  return [
38094
38121
  2
38095
38122
  ];
@@ -38102,10 +38129,10 @@ var GeneratorCore = /* @__PURE__ */ function() {
38102
38129
  return GeneratorCore2;
38103
38130
  }();
38104
38131
 
38105
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/materials/index.js
38132
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/materials/index.js
38106
38133
  var import_path6 = __toESM(require("path"));
38107
38134
 
38108
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/packageManager.js
38135
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/packageManager.js
38109
38136
  var import_path5 = __toESM(require("path"));
38110
38137
  function asyncGeneratorStep6(gen, resolve, reject, _next, _throw, key, arg) {
38111
38138
  try {
@@ -38438,7 +38465,7 @@ function _runInstall() {
38438
38465
  return _runInstall.apply(this, arguments);
38439
38466
  }
38440
38467
 
38441
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/timeoutPromise.js
38468
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/timeoutPromise.js
38442
38469
  function asyncGeneratorStep7(gen, resolve, reject, _next, _throw, key, arg) {
38443
38470
  try {
38444
38471
  var info = gen[key](arg);
@@ -38628,16 +38655,16 @@ function _timeoutPromise() {
38628
38655
  return _timeoutPromise.apply(this, arguments);
38629
38656
  }
38630
38657
 
38631
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/downloadPackage.js
38658
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/downloadPackage.js
38632
38659
  var import_os = __toESM(require("os"));
38633
38660
  var import_axios = __toESM(require_axios2());
38634
38661
  var import_tar = __toESM(require_tar());
38635
38662
 
38636
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/constants.js
38663
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/constants.js
38637
38664
  var NPM_API_TIMEOUT = 3e4;
38638
38665
  var CATCHE_VALIDITY_PREIOD = 12 * 3600 * 1e3;
38639
38666
 
38640
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/getNpmTarballUrl.js
38667
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/getNpmTarballUrl.js
38641
38668
  function asyncGeneratorStep8(gen, resolve, reject, _next, _throw, key, arg) {
38642
38669
  try {
38643
38670
  var info = gen[key](arg);
@@ -38814,7 +38841,7 @@ function _getNpmTarballUrl() {
38814
38841
  return _getNpmTarballUrl.apply(this, arguments);
38815
38842
  }
38816
38843
 
38817
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/getNpmVersion.js
38844
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/getNpmVersion.js
38818
38845
  function asyncGeneratorStep9(gen, resolve, reject, _next, _throw, key, arg) {
38819
38846
  try {
38820
38847
  var info = gen[key](arg);
@@ -38986,7 +39013,7 @@ function _getNpmVersion() {
38986
39013
  return _getNpmVersion.apply(this, arguments);
38987
39014
  }
38988
39015
 
38989
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/downloadPackage.js
39016
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/downloadPackage.js
38990
39017
  function asyncGeneratorStep10(gen, resolve, reject, _next, _throw, key, arg) {
38991
39018
  try {
38992
39019
  var info = gen[key](arg);
@@ -39240,6 +39267,11 @@ function _downloadPackage() {
39240
39267
  case 0:
39241
39268
  pkgVersion = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : "latest", options = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
39242
39269
  registryUrl = options.registryUrl, install = options.install;
39270
+ if (!!import_semver.default.valid(pkgVersion))
39271
+ return [
39272
+ 3,
39273
+ 2
39274
+ ];
39243
39275
  return [
39244
39276
  4,
39245
39277
  getNpmVersion(pkgName, {
@@ -39252,26 +39284,34 @@ function _downloadPackage() {
39252
39284
  if (version2 === void 0) {
39253
39285
  throw new Error("package ".concat(pkgName, "@").concat(pkgVersion, " not found in registry"));
39254
39286
  }
39287
+ return [
39288
+ 3,
39289
+ 3
39290
+ ];
39291
+ case 2:
39292
+ version2 = pkgVersion;
39293
+ _state.label = 3;
39294
+ case 3:
39255
39295
  targetDir = "".concat(import_os.default.tmpdir(), "/csmith-generator/").concat(pkgName, "@").concat(version2);
39256
39296
  return [
39257
39297
  4,
39258
39298
  fsExists(targetDir)
39259
39299
  ];
39260
- case 2:
39300
+ case 4:
39261
39301
  _tmp = _state.sent();
39262
39302
  if (!_tmp)
39263
39303
  return [
39264
39304
  3,
39265
- 4
39305
+ 6
39266
39306
  ];
39267
39307
  return [
39268
39308
  4,
39269
39309
  isValidCache(targetDir)
39270
39310
  ];
39271
- case 3:
39311
+ case 5:
39272
39312
  _tmp = _state.sent();
39273
- _state.label = 4;
39274
- case 4:
39313
+ _state.label = 6;
39314
+ case 6:
39275
39315
  if (_tmp) {
39276
39316
  return [
39277
39317
  2,
@@ -39282,13 +39322,13 @@ function _downloadPackage() {
39282
39322
  4,
39283
39323
  import_fs_extra.default.remove(targetDir)
39284
39324
  ];
39285
- case 5:
39325
+ case 7:
39286
39326
  _state.sent();
39287
39327
  return [
39288
39328
  4,
39289
39329
  import_fs_extra.default.mkdirp(targetDir)
39290
39330
  ];
39291
- case 6:
39331
+ case 8:
39292
39332
  _state.sent();
39293
39333
  return [
39294
39334
  4,
@@ -39296,34 +39336,34 @@ function _downloadPackage() {
39296
39336
  registryUrl
39297
39337
  })
39298
39338
  ];
39299
- case 7:
39339
+ case 9:
39300
39340
  tarballPkg = _state.sent();
39301
39341
  return [
39302
39342
  4,
39303
39343
  downloadAndDecompressTargz(tarballPkg, targetDir)
39304
39344
  ];
39305
- case 8:
39345
+ case 10:
39306
39346
  _state.sent();
39307
39347
  if (!install)
39308
39348
  return [
39309
39349
  3,
39310
- 10
39350
+ 12
39311
39351
  ];
39312
39352
  return [
39313
39353
  4,
39314
39354
  runInstall(targetDir, registryUrl)
39315
39355
  ];
39316
- case 9:
39356
+ case 11:
39317
39357
  _state.sent();
39318
- _state.label = 10;
39319
- case 10:
39358
+ _state.label = 12;
39359
+ case 12:
39320
39360
  return [
39321
39361
  4,
39322
39362
  import_fs_extra.default.writeFile("".concat(targetDir, "/.codesmith.completed"), (/* @__PURE__ */ new Date()).toISOString(), {
39323
39363
  encoding: "utf-8"
39324
39364
  })
39325
39365
  ];
39326
- case 11:
39366
+ case 13:
39327
39367
  _state.sent();
39328
39368
  return [
39329
39369
  2,
@@ -39335,7 +39375,7 @@ function _downloadPackage() {
39335
39375
  return _downloadPackage.apply(this, arguments);
39336
39376
  }
39337
39377
 
39338
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/utils/getPackageInfo.js
39378
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/utils/getPackageInfo.js
39339
39379
  function getPackageInfo(packageName) {
39340
39380
  if (!packageName) {
39341
39381
  throw new Error("package is not exisit");
@@ -39359,7 +39399,7 @@ function getPackageInfo(packageName) {
39359
39399
  };
39360
39400
  }
39361
39401
 
39362
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/materials/index.js
39402
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/materials/index.js
39363
39403
  function asyncGeneratorStep11(gen, resolve, reject, _next, _throw, key, arg) {
39364
39404
  try {
39365
39405
  var info = gen[key](arg);
@@ -39584,7 +39624,7 @@ var MaterialsManager = /* @__PURE__ */ function() {
39584
39624
  return MaterialsManager2;
39585
39625
  }();
39586
39626
 
39587
- // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.3/node_modules/@modern-js/codesmith/dist/esm/codesmith/index.js
39627
+ // ../../../node_modules/.pnpm/@modern-js+codesmith@2.2.5/node_modules/@modern-js/codesmith/dist/esm/codesmith/index.js
39588
39628
  function asyncGeneratorStep12(gen, resolve, reject, _next, _throw, key, arg) {
39589
39629
  try {
39590
39630
  var info = gen[key](arg);
@@ -39896,7 +39936,7 @@ var CodeSmith = /* @__PURE__ */ function() {
39896
39936
  }();
39897
39937
 
39898
39938
  // package.json
39899
- var version = "2.21.1";
39939
+ var version = "2.22.1";
39900
39940
 
39901
39941
  // ../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
39902
39942
  function _define_property7(obj, key, value) {
@@ -39973,7 +40013,7 @@ var I18n = class {
39973
40013
  // src/locale/zh.ts
39974
40014
  var ZH_LOCALE = {
39975
40015
  command: {
39976
- description: "创建 @modern-js 应用",
40016
+ description: "创建 Modern.js 工程方案",
39977
40017
  mwa: "一键创建 Web 应用(使用默认配置)",
39978
40018
  module: "一键创建 Module 应用(使用默认配置)",
39979
40019
  monorepo: "一键常见 Monorepo 应用(使用默认配置)",
@@ -39999,7 +40039,7 @@ var ZH_LOCALE = {
39999
40039
  // src/locale/en.ts
40000
40040
  var EN_LOCALE = {
40001
40041
  command: {
40002
- description: "create @modern-js application",
40042
+ description: "create Modern.js solution project",
40003
40043
  mwa: "create mwa application using default config",
40004
40044
  module: "create module application using default config",
40005
40045
  monorepo: "create monorepo application using default config",
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.21.1",
18
+ "version": "2.22.1",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/index.js",
@@ -37,18 +37,18 @@
37
37
  }
38
38
  },
39
39
  "devDependencies": {
40
- "@modern-js/codesmith": "2.2.3",
40
+ "@modern-js/codesmith": "2.2.5",
41
41
  "@types/jest": "^29",
42
42
  "@types/node": "^14",
43
43
  "jest": "^29",
44
44
  "ts-node": "^10.9.1",
45
45
  "typescript": "^5",
46
- "@modern-js/generator-plugin-plugin": "3.1.19",
47
- "@modern-js/utils": "2.21.1",
48
- "@modern-js/repo-generator": "3.1.19",
49
- "@modern-js/plugin-i18n": "2.21.1",
50
- "@scripts/jest-config": "2.21.1",
51
- "@scripts/build": "2.21.1"
46
+ "@modern-js/plugin-i18n": "2.22.1",
47
+ "@modern-js/generator-plugin-plugin": "3.1.21",
48
+ "@modern-js/repo-generator": "3.1.21",
49
+ "@modern-js/utils": "2.22.1",
50
+ "@scripts/build": "2.22.1",
51
+ "@scripts/jest-config": "2.22.1"
52
52
  },
53
53
  "publishConfig": {
54
54
  "registry": "https://registry.npmjs.org/",