@modern-js/repo-generator 0.0.0-next-20230927181242 → 0.0.0-next-20231009010937

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 (3) hide show
  1. package/dist/index.js +123 -257
  2. package/package.json +11 -11
  3. package/src/index.ts +4 -12
package/dist/index.js CHANGED
@@ -36293,7 +36293,7 @@ var require_logger = __commonJS({
36293
36293
  return Logger2;
36294
36294
  },
36295
36295
  logger: function() {
36296
- return logger2;
36296
+ return logger3;
36297
36297
  }
36298
36298
  });
36299
36299
  var _interop_require_default = require_interop_require_default();
@@ -36402,8 +36402,8 @@ ${_chalk.default.grey(rest.join("\n"))}`;
36402
36402
  });
36403
36403
  }
36404
36404
  };
36405
- var logger2 = new Logger2();
36406
- logger2.Logger = Logger2;
36405
+ var logger3 = new Logger2();
36406
+ logger3.Logger = Logger2;
36407
36407
  }
36408
36408
  });
36409
36409
 
@@ -54619,13 +54619,13 @@ var require_logger2 = __commonJS({
54619
54619
  "use strict";
54620
54620
  exports.__esModule = true;
54621
54621
  var _utils = require_utils2();
54622
- var logger2 = {
54622
+ var logger3 = {
54623
54623
  methodMap: ["debug", "info", "warn", "error"],
54624
54624
  level: "info",
54625
54625
  // Maps a given level value to the `methodMap` indexes above.
54626
54626
  lookupLevel: function lookupLevel(level) {
54627
54627
  if (typeof level === "string") {
54628
- var levelMap = _utils.indexOf(logger2.methodMap, level.toLowerCase());
54628
+ var levelMap = _utils.indexOf(logger3.methodMap, level.toLowerCase());
54629
54629
  if (levelMap >= 0) {
54630
54630
  level = levelMap;
54631
54631
  } else {
@@ -54636,9 +54636,9 @@ var require_logger2 = __commonJS({
54636
54636
  },
54637
54637
  // Can be overridden in the host environment
54638
54638
  log: function log(level) {
54639
- level = logger2.lookupLevel(level);
54640
- if (typeof console !== "undefined" && logger2.lookupLevel(logger2.level) <= level) {
54641
- var method = logger2.methodMap[level];
54639
+ level = logger3.lookupLevel(level);
54640
+ if (typeof console !== "undefined" && logger3.lookupLevel(logger3.level) <= level) {
54641
+ var method = logger3.methodMap[level];
54642
54642
  if (!console[method]) {
54643
54643
  method = "log";
54644
54644
  }
@@ -54649,7 +54649,7 @@ var require_logger2 = __commonJS({
54649
54649
  }
54650
54650
  }
54651
54651
  };
54652
- exports["default"] = logger2;
54652
+ exports["default"] = logger3;
54653
54653
  module2.exports = exports["default"];
54654
54654
  }
54655
54655
  });
@@ -54695,7 +54695,7 @@ var require_proto_access = __commonJS({
54695
54695
  }
54696
54696
  var _createNewLookupObject = require_create_new_lookup_object();
54697
54697
  var _logger = require_logger2();
54698
- var logger2 = _interopRequireWildcard(_logger);
54698
+ var logger3 = _interopRequireWildcard(_logger);
54699
54699
  var loggedProperties = /* @__PURE__ */ Object.create(null);
54700
54700
  function createProtoAccessControl(runtimeOptions) {
54701
54701
  var defaultMethodWhiteList = /* @__PURE__ */ Object.create(null);
@@ -54736,7 +54736,7 @@ var require_proto_access = __commonJS({
54736
54736
  function logUnexpecedPropertyAccessOnce(propertyName) {
54737
54737
  if (loggedProperties[propertyName] !== true) {
54738
54738
  loggedProperties[propertyName] = true;
54739
- logger2.log("error", 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
54739
+ logger3.log("error", 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
54740
54740
  }
54741
54741
  }
54742
54742
  function resetLoggedProperties() {
@@ -124789,10 +124789,9 @@ var require_env2 = __commonJS({
124789
124789
  var env_exports = {};
124790
124790
  __export2(env_exports, {
124791
124791
  getNodeEnv: () => getNodeEnv,
124792
+ isBrowser: () => isBrowser,
124792
124793
  isDev: () => isDev,
124793
- isFastRefresh: () => isFastRefresh,
124794
124794
  isProd: () => isProd,
124795
- isProdProfile: () => isProdProfile,
124796
124795
  isTest: () => isTest
124797
124796
  });
124798
124797
  module2.exports = __toCommonJS2(env_exports);
@@ -124800,39 +124799,6 @@ var require_env2 = __commonJS({
124800
124799
  var isDev = () => getNodeEnv() === "development";
124801
124800
  var isProd = () => getNodeEnv() === "production";
124802
124801
  var isTest = () => getNodeEnv() === "test";
124803
- var isProdProfile = () => isProd() && process.argv.includes("--profile");
124804
- var isFastRefresh = () => isDev() && process.env.FAST_REFRESH !== "false";
124805
- }
124806
- });
124807
-
124808
- // ../../../toolkit/utils/dist/cjs/cli/is/platform.js
124809
- var require_platform2 = __commonJS({
124810
- "../../../toolkit/utils/dist/cjs/cli/is/platform.js"(exports, module2) {
124811
- "use strict";
124812
- var __defProp2 = Object.defineProperty;
124813
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
124814
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
124815
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
124816
- var __export2 = (target, all) => {
124817
- for (var name in all)
124818
- __defProp2(target, name, { get: all[name], enumerable: true });
124819
- };
124820
- var __copyProps2 = (to, from, except, desc) => {
124821
- if (from && typeof from === "object" || typeof from === "function") {
124822
- for (let key of __getOwnPropNames2(from))
124823
- if (!__hasOwnProp2.call(to, key) && key !== except)
124824
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
124825
- }
124826
- return to;
124827
- };
124828
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
124829
- var platform_exports = {};
124830
- __export2(platform_exports, {
124831
- isBrowser: () => isBrowser,
124832
- isNodeJS: () => isNodeJS
124833
- });
124834
- module2.exports = __toCommonJS2(platform_exports);
124835
- var isNodeJS = () => typeof process !== "undefined" && process.versions != null && process.versions.node != null && process.versions.electron == null;
124836
124802
  var isBrowser = () => typeof window !== "undefined";
124837
124803
  }
124838
124804
  });
@@ -125253,7 +125219,6 @@ var require_is2 = __commonJS({
125253
125219
  var is_exports = {};
125254
125220
  module2.exports = __toCommonJS2(is_exports);
125255
125221
  __reExport(is_exports, require_env2(), module2.exports);
125256
- __reExport(is_exports, require_platform2(), module2.exports);
125257
125222
  __reExport(is_exports, require_type2(), module2.exports);
125258
125223
  __reExport(is_exports, require_config4(), module2.exports);
125259
125224
  __reExport(is_exports, require_project2(), module2.exports);
@@ -125566,15 +125531,98 @@ var require_get3 = __commonJS({
125566
125531
  }
125567
125532
  });
125568
125533
 
125534
+ // ../../../../node_modules/.pnpm/rslog@1.0.0/node_modules/rslog/dist/lib/index.js
125535
+ var require_lib3 = __commonJS({
125536
+ "../../../../node_modules/.pnpm/rslog@1.0.0/node_modules/rslog/dist/lib/index.js"(exports, module2) {
125537
+ "use strict";
125538
+ var L = Object.defineProperty;
125539
+ var _ = Object.getOwnPropertyDescriptor;
125540
+ var F = Object.getOwnPropertyNames;
125541
+ var G = Object.prototype.hasOwnProperty;
125542
+ var j = (e, t) => {
125543
+ for (var l in t)
125544
+ L(e, l, { get: t[l], enumerable: true });
125545
+ };
125546
+ var Y = (e, t, l, n) => {
125547
+ if (t && typeof t == "object" || typeof t == "function")
125548
+ for (let r of F(t))
125549
+ !G.call(e, r) && r !== l && L(e, r, { get: () => t[r], enumerable: !(n = _(t, r)) || n.enumerable });
125550
+ return e;
125551
+ };
125552
+ var I = (e) => Y(L({}, "__esModule", { value: true }), e);
125553
+ var W = {};
125554
+ j(W, { createLogger: () => u, logger: () => N });
125555
+ module2.exports = I(W);
125556
+ var P = /^\s*at\s.*:\d+:\d+[\s)]*$/;
125557
+ var V = /^\s*at\s.*\(<anonymous>\)$/;
125558
+ var C = (e) => P.test(e) || V.test(e);
125559
+ var { env: x } = process;
125560
+ var f = !("NO_COLOR" in x) && ("FORCE_COLOR" in x || process.platform === "win32" || process.stdout.isTTY && x.TERM !== "dumb" || "CI" in x);
125561
+ var p = (e, t, l = e) => f ? (n) => {
125562
+ let r = "" + n, o = r.indexOf(t, e.length);
125563
+ return ~o ? e + M(r, t, l, o) + t : e + r + t;
125564
+ } : String;
125565
+ var M = (e, t, l, n) => {
125566
+ let r = e.substring(0, n) + l, o = e.substring(n + t.length), a = o.indexOf(t);
125567
+ return ~a ? r + M(o, t, l, a) : r + o;
125568
+ };
125569
+ var c = p("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m");
125570
+ var $ = p("\x1B[31m", "\x1B[39m");
125571
+ var y = p("\x1B[32m", "\x1B[39m");
125572
+ var T = p("\x1B[33m", "\x1B[39m");
125573
+ var w = p("\x1B[35m", "\x1B[39m");
125574
+ var E = p("\x1B[36m", "\x1B[39m");
125575
+ var v = p("\x1B[90m", "\x1B[39m");
125576
+ var O = [189, 255, 243];
125577
+ var h = [74, 194, 154];
125578
+ var R = (e) => !/[\s\n]/.test(e);
125579
+ var k = (e) => {
125580
+ if (!f)
125581
+ return e;
125582
+ let t = [...e], l = t.filter(R).length, n = O[0], r = O[1], o = O[2], a = (h[0] - n) / l, g = (h[1] - r) / l, i = (h[2] - o) / l, s = "";
125583
+ for (let m of t)
125584
+ R(m) && (n += a, r += g, o += i), s += `\x1B[38;2;${Math.round(n)};${Math.round(r)};${Math.round(o)}m${m}\x1B[39m`;
125585
+ return c(s);
125586
+ };
125587
+ var S = { error: 0, warn: 1, info: 2, log: 3, verbose: 4 };
125588
+ var d = { error: { label: "error", level: "error", color: $ }, warn: { label: "warn", level: "warn", color: T }, info: { label: "info", level: "info", color: E }, start: { label: "start", level: "info", color: E }, ready: { label: "ready", level: "info", color: y }, success: { label: "success", level: "info", color: y }, log: { level: "log" }, debug: { label: "debug", level: "verbose", color: w } };
125589
+ var u = (e = {}) => {
125590
+ let t = e.level || "log", l = (r, o, ...a) => {
125591
+ if (S[d[r].level] > S[t])
125592
+ return;
125593
+ if (o == null)
125594
+ return console.log();
125595
+ let g = d[r], i = "", s = "";
125596
+ if ("label" in g && (i = (g.label || "").padEnd(7), i = c(g.color ? g.color(i) : i)), o instanceof Error)
125597
+ if (o.stack) {
125598
+ let [m, ...b] = o.stack.split(`
125599
+ `);
125600
+ s = `${m.replace("Error: ", "")}
125601
+ ${v(b.join(`
125602
+ `))}`;
125603
+ } else
125604
+ s = o.message;
125605
+ else
125606
+ g.level === "error" && typeof o == "string" ? s = o.split(`
125607
+ `).map((b) => C(b) ? v(b) : b).join(`
125608
+ `) : s = `${o}`;
125609
+ console.log(i.length ? `${i} ${s}` : s, ...a);
125610
+ }, n = { greet: (r) => l("log", k(r)) };
125611
+ return Object.keys(d).forEach((r) => {
125612
+ n[r] = (...o) => l(r, ...o);
125613
+ }), n;
125614
+ };
125615
+ var N = u();
125616
+ }
125617
+ });
125618
+
125569
125619
  // ../../../toolkit/utils/dist/cjs/cli/logger.js
125570
125620
  var require_logger3 = __commonJS({
125571
125621
  "../../../toolkit/utils/dist/cjs/cli/logger.js"(exports, module2) {
125572
125622
  "use strict";
125573
- var __create2 = Object.create;
125574
125623
  var __defProp2 = Object.defineProperty;
125575
125624
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
125576
125625
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
125577
- var __getProtoOf2 = Object.getPrototypeOf;
125578
125626
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
125579
125627
  var __export2 = (target, all) => {
125580
125628
  for (var name in all)
@@ -125588,134 +125636,14 @@ var require_logger3 = __commonJS({
125588
125636
  }
125589
125637
  return to;
125590
125638
  };
125591
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
125592
- // If the importer is in node compatibility mode or this is not an ESM
125593
- // file that has been converted to a CommonJS file using a Babel-
125594
- // compatible transform (i.e. "__esModule" has not been set), then set
125595
- // "default" to the CommonJS "module.exports" for node compatibility.
125596
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
125597
- mod
125598
- ));
125599
125639
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
125600
125640
  var logger_exports = {};
125601
125641
  __export2(logger_exports, {
125602
- Logger: () => Logger2,
125603
- isErrorStackMessage: () => isErrorStackMessage,
125604
- logger: () => logger2
125642
+ createLogger: () => import_rslog.createLogger,
125643
+ logger: () => import_rslog.logger
125605
125644
  });
125606
125645
  module2.exports = __toCommonJS2(logger_exports);
125607
- var import_chalk = __toESM2(require_chalk2());
125608
- var LOG_LEVEL = {
125609
- error: 0,
125610
- warn: 1,
125611
- info: 2,
125612
- debug: 3,
125613
- log: 4
125614
- };
125615
- var LOG_TYPES = {
125616
- error: {
125617
- color: "red",
125618
- label: "error",
125619
- level: "error"
125620
- },
125621
- info: {
125622
- color: "cyan",
125623
- label: "info",
125624
- level: "info"
125625
- },
125626
- ready: {
125627
- color: "green",
125628
- label: "ready",
125629
- level: "info"
125630
- },
125631
- success: {
125632
- color: "green",
125633
- label: "success",
125634
- level: "info"
125635
- },
125636
- warn: {
125637
- color: "yellow",
125638
- label: "warn",
125639
- level: "warn"
125640
- },
125641
- debug: {
125642
- color: "red",
125643
- label: "debug",
125644
- level: "debug"
125645
- },
125646
- log: {
125647
- level: "log"
125648
- }
125649
- };
125650
- var DEFAULT_CONFIG = {
125651
- displayLabel: true,
125652
- uppercaseLabel: false
125653
- };
125654
- var errorStackRegExp = /^\s*at\s.*:\d+:\d+[\s)]*$/;
125655
- var anonymousErrorStackRegExp = /^\s*at\s.*\(<anonymous>\)$/;
125656
- var isErrorStackMessage = (message) => errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
125657
- var Logger2 = class {
125658
- _log(type, message, ...args) {
125659
- if (message === void 0 || message === null) {
125660
- console.log();
125661
- return;
125662
- }
125663
- if (LOG_LEVEL[type] > LOG_LEVEL[this.level]) {
125664
- return;
125665
- }
125666
- let label = "";
125667
- let text = "";
125668
- const logType = this.types[type];
125669
- if (this.config.displayLabel && logType.label) {
125670
- label = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
125671
- label = label.padEnd(this.longestLabel.length);
125672
- label = import_chalk.default.bold(logType.color ? import_chalk.default[logType.color](label) : label);
125673
- }
125674
- if (message instanceof Error) {
125675
- if (message.stack) {
125676
- const [name, ...rest] = message.stack.split("\n");
125677
- text = `${name}
125678
- ${import_chalk.default.grey(rest.join("\n"))}`;
125679
- } else {
125680
- text = message.message;
125681
- }
125682
- } else if (logType.level === "error" && typeof message === "string") {
125683
- const lines = message.split("\n");
125684
- text = lines.map((line) => isErrorStackMessage(line) ? import_chalk.default.gray(line) : line).join("\n");
125685
- } else {
125686
- text = `${message}`;
125687
- }
125688
- const log = label.length > 0 ? `${label} ${text}` : text;
125689
- console.log(log, ...args);
125690
- }
125691
- getLongestLabel() {
125692
- let longestLabel = "";
125693
- Object.keys(this.types).forEach((type) => {
125694
- const { label = "" } = this.types[type];
125695
- if (label.length > longestLabel.length) {
125696
- longestLabel = label;
125697
- }
125698
- });
125699
- return longestLabel;
125700
- }
125701
- constructor(options = {}) {
125702
- this.level = options.level || LOG_TYPES.log.level;
125703
- this.config = {
125704
- ...DEFAULT_CONFIG,
125705
- ...options.config || {}
125706
- };
125707
- this.types = {
125708
- ...LOG_TYPES,
125709
- ...options.types || {}
125710
- };
125711
- this.longestLabel = this.getLongestLabel();
125712
- Object.keys(this.types).forEach((type) => {
125713
- this[type] = this._log.bind(this, type);
125714
- });
125715
- }
125716
- };
125717
- var logger2 = new Logger2();
125718
- logger2.Logger = Logger2;
125646
+ var import_rslog = require_lib3();
125719
125647
  }
125720
125648
  });
125721
125649
 
@@ -125807,30 +125735,13 @@ var require_alias2 = __commonJS({
125807
125735
  __export2(alias_exports, {
125808
125736
  getAliasConfig: () => getAliasConfig,
125809
125737
  getUserAlias: () => getUserAlias,
125810
- mergeAlias: () => mergeAlias,
125811
- validAlias: () => validAlias
125738
+ mergeAlias: () => mergeAlias
125812
125739
  });
125813
125740
  module2.exports = __toCommonJS2(alias_exports);
125814
125741
  var import_fs = __toESM2(require("fs"));
125815
125742
  var import_path19 = __toESM2(require("path"));
125816
- var import_compiled = require_compiled2();
125817
125743
  var import_get = require_get3();
125818
125744
  var import_applyOptionsChain = require_applyOptionsChain2();
125819
- var validAlias = (modernConfig, { tsconfigPath }) => {
125820
- const { source: { alias } } = modernConfig;
125821
- if (!alias) {
125822
- return null;
125823
- }
125824
- const isTsProject = import_fs.default.existsSync(tsconfigPath);
125825
- if (!isTsProject) {
125826
- return null;
125827
- }
125828
- const userAlias = getUserAlias(alias);
125829
- if (Object.keys(userAlias).length > 0) {
125830
- return import_compiled.chalk.red('Note: Please use `compilerOptions.paths` in "tsconfig.json" file replace `source.alias` config in "modern.config.js/ts" when project is typescript');
125831
- }
125832
- return null;
125833
- };
125834
125745
  var mergeAlias = (alias) => (0, import_applyOptionsChain.applyOptionsChain)({}, alias);
125835
125746
  var getAliasConfig = (aliasOption, option) => {
125836
125747
  var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
@@ -126118,7 +126029,6 @@ var require_monorepo2 = __commonJS({
126118
126029
  findMonorepoRoot: () => findMonorepoRoot,
126119
126030
  getMonorepoPackages: () => getMonorepoPackages2,
126120
126031
  isLerna: () => isLerna,
126121
- isModernjsMonorepo: () => isModernjsMonorepo,
126122
126032
  isMonorepo: () => isMonorepo,
126123
126033
  isPnpmWorkspaces: () => isPnpmWorkspaces,
126124
126034
  isYarnWorkspaces: () => isYarnWorkspaces
@@ -126145,18 +126055,6 @@ var require_monorepo2 = __commonJS({
126145
126055
  };
126146
126056
  var isPnpmWorkspaces = (root) => import_fs.default.existsSync(import_path19.default.join(root, WORKSPACE_FILES.PNPM));
126147
126057
  var isMonorepo = (root) => isLerna(root) || isYarnWorkspaces(root) || isPnpmWorkspaces(root);
126148
- var isModernjsMonorepo = (root) => {
126149
- const pkgJsonPath = import_path19.default.join(root, "package.json");
126150
- if (!import_fs.default.existsSync(pkgJsonPath)) {
126151
- return false;
126152
- }
126153
- const json = JSON.parse(import_fs.default.readFileSync(pkgJsonPath, "utf8"));
126154
- const deps = {
126155
- ...json.dependencies || {},
126156
- ...json.devDependencies || {}
126157
- };
126158
- return Boolean(deps["@modern-js/monorepo-tools"]);
126159
- };
126160
126058
  var findMonorepoRoot = (appDirectory, maxDepth = PACKAGE_MAX_DEPTH) => {
126161
126059
  let inMonorepo = false;
126162
126060
  for (let depth = 0; depth < maxDepth; depth++) {
@@ -130329,7 +130227,7 @@ var __generator9 = function(thisArg, body) {
130329
130227
  var GeneratorCore = /* @__PURE__ */ function() {
130330
130228
  "use strict";
130331
130229
  function GeneratorCore2(param) {
130332
- var logger2 = param.logger, materialsManager = param.materialsManager, outputPath = param.outputPath;
130230
+ var logger3 = param.logger, materialsManager = param.materialsManager, outputPath = param.outputPath;
130333
130231
  _class_call_check6(this, GeneratorCore2);
130334
130232
  _define_property7(this, "logger", void 0);
130335
130233
  _define_property7(this, "materialsManager", void 0);
@@ -130369,7 +130267,7 @@ var GeneratorCore = /* @__PURE__ */ function() {
130369
130267
  });
130370
130268
  _define_property7(this, "_context", void 0);
130371
130269
  _define_property7(this, "event", void 0);
130372
- this.logger = logger2;
130270
+ this.logger = logger3;
130373
130271
  this.materialsManager = materialsManager;
130374
130272
  this.outputPath = outputPath;
130375
130273
  this.basePath = process.cwd();
@@ -132161,12 +132059,12 @@ var __generator15 = function(thisArg, body) {
132161
132059
  };
132162
132060
  var MaterialsManager = /* @__PURE__ */ function() {
132163
132061
  "use strict";
132164
- function MaterialsManager2(logger2, registryUrl) {
132062
+ function MaterialsManager2(logger3, registryUrl) {
132165
132063
  _class_call_check7(this, MaterialsManager2);
132166
132064
  _define_property8(this, "logger", void 0);
132167
132065
  _define_property8(this, "registryUrl", void 0);
132168
132066
  _define_property8(this, "materialMap", void 0);
132169
- this.logger = logger2;
132067
+ this.logger = logger3;
132170
132068
  this.registryUrl = registryUrl;
132171
132069
  this.materialMap = {};
132172
132070
  }
@@ -132387,14 +132285,14 @@ var __generator16 = function(thisArg, body) {
132387
132285
  var CodeSmith = /* @__PURE__ */ function() {
132388
132286
  "use strict";
132389
132287
  function CodeSmith2(param) {
132390
- var debug2 = param.debug, logger2 = param.logger, registryUrl = param.registryUrl;
132288
+ var debug2 = param.debug, logger3 = param.logger, registryUrl = param.registryUrl;
132391
132289
  _class_call_check8(this, CodeSmith2);
132392
132290
  _define_property9(this, "core", void 0);
132393
132291
  _define_property9(this, "materialsManager", void 0);
132394
132292
  _define_property9(this, "debug", false);
132395
132293
  _define_property9(this, "logger", void 0);
132396
132294
  this.debug = debug2 || false;
132397
- this.logger = logger2 || new Logger(debug2 ? LoggerLevel.Debug : LoggerLevel.Info);
132295
+ this.logger = logger3 || new Logger(debug2 ? LoggerLevel.Debug : LoggerLevel.Info);
132398
132296
  this.materialsManager = new MaterialsManager(this.logger, registryUrl);
132399
132297
  }
132400
132298
  _create_class8(CodeSmith2, [
@@ -144951,11 +144849,11 @@ function _getNoteVersion() {
144951
144849
  });
144952
144850
  return _getNoteVersion.apply(this, arguments);
144953
144851
  }
144954
- function checkUseNvm(cwd, logger2) {
144852
+ function checkUseNvm(cwd, logger3) {
144955
144853
  return _checkUseNvm.apply(this, arguments);
144956
144854
  }
144957
144855
  function _checkUseNvm() {
144958
- _checkUseNvm = _async_to_generator25(function(cwd, logger2) {
144856
+ _checkUseNvm = _async_to_generator25(function(cwd, logger3) {
144959
144857
  var nvmrcContent, expectNodeVersion, currentNodeVersion, e;
144960
144858
  return __generator31(this, function(_state) {
144961
144859
  switch (_state.label) {
@@ -145002,7 +144900,7 @@ function _checkUseNvm() {
145002
144900
  ];
145003
144901
  case 4:
145004
144902
  if (!_state.sent()) {
145005
- logger2.warn("current node version is not expect, you should install ".concat(expectNodeVersion));
144903
+ logger3.warn("current node version is not expect, you should install ".concat(expectNodeVersion));
145006
144904
  return [
145007
144905
  2,
145008
144906
  false
@@ -146063,9 +145961,7 @@ var ZH_LOCALE2 = {
146063
145961
  sub_solution: {
146064
145962
  self: "请选择你想创建的工程类型",
146065
145963
  mwa: "Web 应用",
146066
- mwa_test: "Web 应用(测试)",
146067
- module: "Npm 模块",
146068
- inner_module: "Npm 模块(内部)"
145964
+ module: "Npm 模块"
146069
145965
  },
146070
145966
  action: {
146071
145967
  self: "请选择你想要的操作",
@@ -146161,9 +146057,7 @@ var EN_LOCALE2 = {
146161
146057
  sub_solution: {
146162
146058
  self: "Please select the type of project you want to create:",
146163
146059
  mwa: "Web App",
146164
- mwa_test: "Web App (Test)",
146165
146060
  module: "Npm Module",
146166
- inner_module: "Npm Module (Inner)",
146167
146061
  monorepo: "Monorepo"
146168
146062
  },
146169
146063
  action: {
@@ -146272,9 +146166,7 @@ var Solution;
146272
146166
  var SubSolution;
146273
146167
  (function(SubSolution22) {
146274
146168
  SubSolution22["MWA"] = "mwa";
146275
- SubSolution22["MWATest"] = "mwa_test";
146276
146169
  SubSolution22["Module"] = "module";
146277
- SubSolution22["InnerModule"] = "inner_module";
146278
146170
  })(SubSolution || (SubSolution = {}));
146279
146171
  var SolutionText = {
146280
146172
  [Solution.MWA]: () => i18n2.t(localeKeys2.solution.mwa),
@@ -146283,24 +146175,13 @@ var SolutionText = {
146283
146175
  };
146284
146176
  var SubSolutionText = {
146285
146177
  [SubSolution.MWA]: () => i18n2.t(localeKeys2.sub_solution.mwa),
146286
- [SubSolution.MWATest]: () => i18n2.t(localeKeys2.sub_solution.mwa_test),
146287
- [SubSolution.Module]: () => i18n2.t(localeKeys2.sub_solution.module),
146288
- [SubSolution.InnerModule]: () => i18n2.t(localeKeys2.sub_solution.inner_module)
146178
+ [SubSolution.Module]: () => i18n2.t(localeKeys2.sub_solution.module)
146289
146179
  };
146290
146180
  var SolutionToolsMap = {
146291
146181
  [Solution.MWA]: "@modern-js/app-tools",
146292
146182
  [Solution.Module]: "@modern-js/module-tools",
146293
146183
  [Solution.Monorepo]: "@modern-js/monorepo-tools"
146294
146184
  };
146295
- function getSolutionNameFromSubSolution(solution) {
146296
- if (solution === SubSolution.MWATest) {
146297
- return Solution.MWA;
146298
- }
146299
- if (solution === SubSolution.InnerModule) {
146300
- return Solution.Module;
146301
- }
146302
- return solution;
146303
- }
146304
146185
  var getSolutionSchema = (extra = {}) => {
146305
146186
  return {
146306
146187
  type: "object",
@@ -146330,7 +146211,7 @@ var getSolutionSchema = (extra = {}) => {
146330
146211
  };
146331
146212
  };
146332
146213
  var getScenesSchema = (extra = {}) => {
146333
- const hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution] && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
146214
+ const hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution] && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
146334
146215
  return {
146335
146216
  type: "object",
146336
146217
  properties: hasPlugin ? {
@@ -146338,7 +146219,7 @@ var getScenesSchema = (extra = {}) => {
146338
146219
  type: "string",
146339
146220
  title: i18n2.t(localeKeys2.scenes.self),
146340
146221
  enum: (() => {
146341
- const solution = (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution;
146222
+ const solution = extra === null || extra === void 0 ? void 0 : extra.solution;
146342
146223
  const items = ((extra === null || extra === void 0 ? void 0 : extra.customPlugin) ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[solution]) || [] : []).map((plugin) => ({
146343
146224
  value: plugin.key,
146344
146225
  label: extra.locale === "zh" ? plugin.name_zh || plugin.name : plugin.name
@@ -146363,9 +146244,7 @@ var SolutionGenerator = {
146363
146244
  };
146364
146245
  var SubSolutionGenerator = {
146365
146246
  [SubSolution.MWA]: "@modern-js/mwa-generator",
146366
- [SubSolution.MWATest]: "@modern-js/mwa-generator",
146367
- [SubSolution.Module]: "@modern-js/module-generator",
146368
- [SubSolution.InnerModule]: "@modern-js/module-generator"
146247
+ [SubSolution.Module]: "@modern-js/module-generator"
146369
146248
  };
146370
146249
 
146371
146250
  // ../../generator-common/dist/esm-node/common/language.js
@@ -146961,20 +146840,10 @@ var getMonorepoNewActionSchema = (extra = {}) => {
146961
146840
  };
146962
146841
  var MonorepoNewActionConfig = {
146963
146842
  [SubSolution.MWA]: {
146964
- isMonorepoSubProject: true,
146965
- isTest: false
146966
- },
146967
- [SubSolution.MWATest]: {
146968
- isMonorepoSubProject: true,
146969
- isTest: true
146843
+ isMonorepoSubProject: true
146970
146844
  },
146971
146845
  [SubSolution.Module]: {
146972
- isMonorepoSubProject: true,
146973
- isPublic: true
146974
- },
146975
- [SubSolution.InnerModule]: {
146976
- isMonorepoSubProject: true,
146977
- isPublic: false
146846
+ isMonorepoSubProject: true
146978
146847
  }
146979
146848
  };
146980
146849
 
@@ -149609,7 +149478,7 @@ var PluginType;
149609
149478
  // ../../generator-plugin/dist/esm/index.js
149610
149479
  var GeneratorPlugin = /* @__PURE__ */ function() {
149611
149480
  "use strict";
149612
- function GeneratorPlugin2(logger2, event) {
149481
+ function GeneratorPlugin2(logger3, event) {
149613
149482
  var locale = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "en";
149614
149483
  _class_call_check15(this, GeneratorPlugin2);
149615
149484
  _define_property20(this, "plugins", []);
@@ -149618,7 +149487,7 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
149618
149487
  _define_property20(this, "event", void 0);
149619
149488
  _define_property20(this, "logger", void 0);
149620
149489
  this.event = event;
149621
- this.logger = logger2;
149490
+ this.logger = logger3;
149622
149491
  if (event) {
149623
149492
  event.on("forged", this.handleForged.bind(this));
149624
149493
  }
@@ -150093,14 +149962,11 @@ var getNeedRunPlugin = (context, generatorPlugin) => {
150093
149962
  return false;
150094
149963
  }
150095
149964
  const { extendPlugin, customPlugin } = generatorPlugin;
150096
- const { isMonorepo, solution, scenes } = context.config;
150097
- const pluginSolution = isMonorepo ? getSolutionNameFromSubSolution(solution) : solution;
150098
- if (!scenes || scenes === pluginSolution) {
150099
- return (extendPlugin == null ? void 0 : extendPlugin[pluginSolution]) && extendPlugin[pluginSolution].length > 0;
149965
+ const { solution, scenes } = context.config;
149966
+ if (!scenes || scenes === solution) {
149967
+ return (extendPlugin == null ? void 0 : extendPlugin[solution]) && extendPlugin[solution].length > 0;
150100
149968
  }
150101
- return Boolean(
150102
- (_a2 = customPlugin[pluginSolution]) == null ? void 0 : _a2.find((plugin) => plugin.key === scenes)
150103
- );
149969
+ return Boolean((_a2 = customPlugin[solution]) == null ? void 0 : _a2.find((plugin) => plugin.key === scenes));
150104
149970
  };
150105
149971
  var handleTemplateFile = async (context, generator, appApi, generatorPlugin) => {
150106
149972
  const { isMonorepo } = context.config;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-20230927181242",
18
+ "version": "0.0.0-next-20231009010937",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -29,16 +29,16 @@
29
29
  "@types/node": "^14",
30
30
  "jest": "^29",
31
31
  "typescript": "^5",
32
- "@modern-js/base-generator": "0.0.0-next-20230927181242",
33
- "@modern-js/generator-common": "0.0.0-next-20230927181242",
34
- "@modern-js/generator-plugin": "0.0.0-next-20230927181242",
35
- "@modern-js/generator-utils": "0.0.0-next-20230927181242",
36
- "@modern-js/module-generator": "0.0.0-next-20230927181242",
37
- "@modern-js/monorepo-generator": "0.0.0-next-20230927181242",
38
- "@modern-js/utils": "0.0.0-next-20230927181242",
39
- "@scripts/build": "0.0.0-next-20230927181242",
40
- "@modern-js/mwa-generator": "0.0.0-next-20230927181242",
41
- "@scripts/jest-config": "0.0.0-next-20230927181242"
32
+ "@modern-js/generator-common": "0.0.0-next-20231009010937",
33
+ "@modern-js/base-generator": "0.0.0-next-20231009010937",
34
+ "@modern-js/module-generator": "0.0.0-next-20231009010937",
35
+ "@modern-js/generator-plugin": "0.0.0-next-20231009010937",
36
+ "@modern-js/monorepo-generator": "0.0.0-next-20231009010937",
37
+ "@modern-js/mwa-generator": "0.0.0-next-20231009010937",
38
+ "@scripts/build": "0.0.0-next-20231009010937",
39
+ "@scripts/jest-config": "0.0.0-next-20231009010937",
40
+ "@modern-js/generator-utils": "0.0.0-next-20231009010937",
41
+ "@modern-js/utils": "0.0.0-next-20231009010937"
42
42
  },
43
43
  "sideEffects": false,
44
44
  "publishConfig": {
package/src/index.ts CHANGED
@@ -13,7 +13,6 @@ import {
13
13
  SubSolution,
14
14
  SubSolutionGenerator,
15
15
  MonorepoNewActionConfig,
16
- getSolutionNameFromSubSolution,
17
16
  getScenesSchema,
18
17
  } from '@modern-js/generator-common';
19
18
  import { GeneratorPlugin } from '@modern-js/generator-plugin';
@@ -47,18 +46,11 @@ const getNeedRunPlugin = (
47
46
  return false;
48
47
  }
49
48
  const { extendPlugin, customPlugin } = generatorPlugin;
50
- const { isMonorepo, solution, scenes } = context.config;
51
- const pluginSolution = isMonorepo
52
- ? getSolutionNameFromSubSolution(solution)
53
- : solution;
54
- if (!scenes || scenes === pluginSolution) {
55
- return (
56
- extendPlugin?.[pluginSolution] && extendPlugin[pluginSolution].length > 0
57
- );
49
+ const { solution, scenes } = context.config;
50
+ if (!scenes || scenes === solution) {
51
+ return extendPlugin?.[solution] && extendPlugin[solution].length > 0;
58
52
  }
59
- return Boolean(
60
- customPlugin[pluginSolution]?.find(plugin => plugin.key === scenes),
61
- );
53
+ return Boolean(customPlugin[solution]?.find(plugin => plugin.key === scenes));
62
54
  };
63
55
 
64
56
  const handleTemplateFile = async (