@modern-js/repo-generator 0.0.0-canary-20221013114431 → 0.0.0-next-20221014065800

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 +881 -1063
  2. package/package.json +13 -13
package/dist/index.js CHANGED
@@ -1339,7 +1339,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
1339
1339
  }
1340
1340
  function baseFunctions(object, props) {
1341
1341
  return arrayFilter(props, function(key) {
1342
- return isFunction3(object[key]);
1342
+ return isFunction4(object[key]);
1343
1343
  });
1344
1344
  }
1345
1345
  function baseGet(object, path6) {
@@ -1502,7 +1502,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
1502
1502
  if (!isObject5(value) || isMasked(value)) {
1503
1503
  return false;
1504
1504
  }
1505
- var pattern = isFunction3(value) ? reIsNative : reIsHostCtor;
1505
+ var pattern = isFunction4(value) ? reIsNative : reIsHostCtor;
1506
1506
  return pattern.test(toSource(value));
1507
1507
  }
1508
1508
  function baseIsRegExp(value) {
@@ -1624,7 +1624,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
1624
1624
  newValue = objValue;
1625
1625
  if (isArguments(objValue)) {
1626
1626
  newValue = toPlainObject(objValue);
1627
- } else if (!isObject5(objValue) || isFunction3(objValue)) {
1627
+ } else if (!isObject5(objValue) || isFunction4(objValue)) {
1628
1628
  newValue = initCloneObject(srcValue);
1629
1629
  }
1630
1630
  } else {
@@ -1962,8 +1962,8 @@ var require_lodash = __commonJSMin((exports, module2) => {
1962
1962
  if (result2 instanceof LazyWrapper) {
1963
1963
  result2 = result2.value();
1964
1964
  }
1965
- return arrayReduce(actions, function(result3, action3) {
1966
- return action3.func.apply(action3.thisArg, arrayPush([result3], action3.args));
1965
+ return arrayReduce(actions, function(result3, action2) {
1966
+ return action2.func.apply(action2.thisArg, arrayPush([result3], action2.args));
1967
1967
  }, result2);
1968
1968
  }
1969
1969
  function baseXor(arrays, iteratee2, comparator) {
@@ -2926,7 +2926,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
2926
2926
  function isMasked(func) {
2927
2927
  return !!maskSrcKey && maskSrcKey in func;
2928
2928
  }
2929
- var isMaskable = coreJsData ? isFunction3 : stubFalse;
2929
+ var isMaskable = coreJsData ? isFunction4 : stubFalse;
2930
2930
  function isPrototype(value) {
2931
2931
  var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
2932
2932
  return value === proto;
@@ -4039,7 +4039,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
4039
4039
  var isArray4 = Array2.isArray;
4040
4040
  var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
4041
4041
  function isArrayLike(value) {
4042
- return value != null && isLength(value.length) && !isFunction3(value);
4042
+ return value != null && isLength(value.length) && !isFunction4(value);
4043
4043
  }
4044
4044
  function isArrayLikeObject(value) {
4045
4045
  return isObjectLike(value) && isArrayLike(value);
@@ -4091,7 +4091,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
4091
4091
  function isFinite2(value) {
4092
4092
  return typeof value == "number" && nativeIsFinite(value);
4093
4093
  }
4094
- function isFunction3(value) {
4094
+ function isFunction4(value) {
4095
4095
  if (!isObject5(value)) {
4096
4096
  return false;
4097
4097
  }
@@ -4414,7 +4414,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
4414
4414
  index = length;
4415
4415
  value = defaultValue;
4416
4416
  }
4417
- object = isFunction3(value) ? value.call(object) : value;
4417
+ object = isFunction4(value) ? value.call(object) : value;
4418
4418
  }
4419
4419
  return object;
4420
4420
  }
@@ -4435,7 +4435,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
4435
4435
  if (isArrLike) {
4436
4436
  accumulator = isArr4 ? new Ctor() : [];
4437
4437
  } else if (isObject5(object)) {
4438
- accumulator = isFunction3(Ctor) ? baseCreate(getPrototype(object)) : {};
4438
+ accumulator = isFunction4(Ctor) ? baseCreate(getPrototype(object)) : {};
4439
4439
  } else {
4440
4440
  accumulator = {};
4441
4441
  }
@@ -4852,7 +4852,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
4852
4852
  object = this;
4853
4853
  methodNames = baseFunctions(source, keys(source));
4854
4854
  }
4855
- var chain2 = !(isObject5(options3) && "chain" in options3) || !!options3.chain, isFunc = isFunction3(object);
4855
+ var chain2 = !(isObject5(options3) && "chain" in options3) || !!options3.chain, isFunc = isFunction4(object);
4856
4856
  arrayEach(methodNames, function(methodName) {
4857
4857
  var func = source[methodName];
4858
4858
  object[methodName] = func;
@@ -5187,7 +5187,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
5187
5187
  lodash.isEqualWith = isEqualWith;
5188
5188
  lodash.isError = isError;
5189
5189
  lodash.isFinite = isFinite2;
5190
- lodash.isFunction = isFunction3;
5190
+ lodash.isFunction = isFunction4;
5191
5191
  lodash.isInteger = isInteger;
5192
5192
  lodash.isLength = isLength;
5193
5193
  lodash.isMap = isMap2;
@@ -34589,7 +34589,6 @@ var require_logger = __commonJSMin((exports) => {
34589
34589
  Object.defineProperty(exports, "__esModule", { value: true });
34590
34590
  exports.logger = exports.Logger = void 0;
34591
34591
  var chalk_1 = __importDefault(require_chalk());
34592
- var { grey, underline } = chalk_1.default;
34593
34592
  var LOG_LEVEL = {
34594
34593
  error: 0,
34595
34594
  warn: 1,
@@ -34604,13 +34603,18 @@ var require_logger = __commonJSMin((exports) => {
34604
34603
  level: "error"
34605
34604
  },
34606
34605
  info: {
34607
- color: "blue",
34606
+ color: "cyan",
34608
34607
  label: "info",
34609
34608
  level: "info"
34610
34609
  },
34610
+ success: {
34611
+ color: "green",
34612
+ label: "Success",
34613
+ level: "info"
34614
+ },
34611
34615
  warn: {
34612
34616
  color: "yellow",
34613
- label: "warning",
34617
+ label: "warn",
34614
34618
  level: "warn"
34615
34619
  },
34616
34620
  debug: {
@@ -34622,13 +34626,10 @@ var require_logger = __commonJSMin((exports) => {
34622
34626
  };
34623
34627
  var DEFAULT_CONFIG = {
34624
34628
  displayLabel: true,
34625
- underlineLabel: true,
34626
34629
  uppercaseLabel: false
34627
34630
  };
34628
34631
  var Logger = class {
34629
34632
  constructor(options3 = {}) {
34630
- this.logCount = 200;
34631
- this.history = {};
34632
34633
  this.level = options3.level || LOG_TYPES.log.level;
34633
34634
  this.config = { ...DEFAULT_CONFIG, ...options3.config || {} };
34634
34635
  this.types = {
@@ -34640,77 +34641,46 @@ var require_logger = __commonJSMin((exports) => {
34640
34641
  this[type] = this._log.bind(this, type);
34641
34642
  });
34642
34643
  }
34643
- retainLog(type, message) {
34644
- if (!this.history[type]) {
34645
- this.history[type] = [];
34646
- }
34647
- this.history[type].push(message);
34648
- while (this.history[type].length > this.logCount) {
34649
- this.history[type].shift();
34650
- }
34651
- }
34652
34644
  _log(type, message, ...args) {
34653
- if (message === void 0) {
34645
+ if (message === void 0 || message === null) {
34654
34646
  console.log();
34655
34647
  return;
34656
34648
  }
34657
34649
  if (LOG_LEVEL[type] > LOG_LEVEL[this.level]) {
34658
34650
  return;
34659
34651
  }
34660
- let label21 = "";
34652
+ let label = "";
34661
34653
  let text = "";
34662
34654
  const logType = this.types[type];
34663
34655
  if (this.config.displayLabel && logType.label) {
34664
- label21 = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
34665
- if (this.config.underlineLabel) {
34666
- label21 = underline(label21).padEnd(this.longestUnderlinedLabel.length + 1);
34667
- } else {
34668
- label21 = label21.padEnd(this.longestLabel.length + 1);
34669
- }
34670
- label21 = logType.color ? chalk_1.default[logType.color](label21) : label21;
34656
+ label = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
34657
+ label = label.padEnd(this.longestLabel.length);
34658
+ label = chalk_1.default.bold(logType.color ? chalk_1.default[logType.color](label) : label);
34671
34659
  }
34672
34660
  if (message instanceof Error) {
34673
34661
  if (message.stack) {
34674
34662
  const [name5, ...rest] = message.stack.split("\n");
34675
34663
  text = `${name5}
34676
- ${grey(rest.join("\n"))}`;
34664
+ ${chalk_1.default.grey(rest.join("\n"))}`;
34677
34665
  } else {
34678
34666
  text = message.message;
34679
34667
  }
34680
34668
  } else {
34681
34669
  text = `${message}`;
34682
34670
  }
34683
- if (logType.level === "warn" || logType.level === "error") {
34684
- this.retainLog(type, text);
34685
- }
34686
- const log = label21.length > 0 ? `${label21} ${text}` : text;
34671
+ const log = label.length > 0 ? `${label} ${text}` : text;
34687
34672
  console.log(log, ...args);
34688
34673
  }
34689
34674
  getLongestLabel() {
34690
34675
  let longestLabel = "";
34691
34676
  Object.keys(this.types).forEach((type) => {
34692
- const { label: label21 = "" } = this.types[type];
34693
- if (label21.length > longestLabel.length) {
34694
- longestLabel = label21;
34677
+ const { label = "" } = this.types[type];
34678
+ if (label.length > longestLabel.length) {
34679
+ longestLabel = label;
34695
34680
  }
34696
34681
  });
34697
34682
  return longestLabel;
34698
34683
  }
34699
- get longestUnderlinedLabel() {
34700
- return underline(this.longestLabel);
34701
- }
34702
- getRetainedLogs(type) {
34703
- return this.history[type] || [];
34704
- }
34705
- clearRetainedLogs(type) {
34706
- if (type) {
34707
- if (this.history[type]) {
34708
- this.history[type] = [];
34709
- }
34710
- } else {
34711
- this.history = {};
34712
- }
34713
- }
34714
34684
  };
34715
34685
  exports.Logger = Logger;
34716
34686
  var logger = new Logger();
@@ -34928,10 +34898,10 @@ var require_type = __commonJSMin((exports) => {
34928
34898
  return Array.isArray(obj);
34929
34899
  }
34930
34900
  exports.isArray = isArray4;
34931
- function isFunction3(func) {
34901
+ function isFunction4(func) {
34932
34902
  return typeof func === "function";
34933
34903
  }
34934
- exports.isFunction = isFunction3;
34904
+ exports.isFunction = isFunction4;
34935
34905
  function isObject5(obj) {
34936
34906
  return obj !== null && typeof obj === "object";
34937
34907
  }
@@ -35370,10 +35340,13 @@ var require_getPort = __commonJSMin((exports) => {
35370
35340
  var net_1 = __importDefault(__require("net"));
35371
35341
  var compiled_1 = require_compiled();
35372
35342
  var logger_1 = require_logger();
35373
- var getPort = async (port, tryLimits = 20) => {
35343
+ var getPort = async (port, { tryLimits = 20, strictPort = false } = {}) => {
35374
35344
  if (typeof port === "string") {
35375
35345
  port = parseInt(port, 10);
35376
35346
  }
35347
+ if (strictPort) {
35348
+ tryLimits = 1;
35349
+ }
35377
35350
  const original = port;
35378
35351
  let found = false;
35379
35352
  let attempts = 0;
@@ -35400,7 +35373,11 @@ var require_getPort = __commonJSMin((exports) => {
35400
35373
  }
35401
35374
  }
35402
35375
  if (port !== original) {
35403
- logger_1.logger.info(compiled_1.chalk.red(`Something is already running on port ${original}. ${compiled_1.chalk.yellow(`Use port ${port} instead.`)}`));
35376
+ if (strictPort) {
35377
+ throw new Error(`Port "${original}" is occupied, please choose another one.`);
35378
+ } else {
35379
+ logger_1.logger.info(`Something is already running on port ${original}. ${compiled_1.chalk.yellow(`Use port ${port} instead.`)}`);
35380
+ }
35404
35381
  }
35405
35382
  return port;
35406
35383
  };
@@ -36212,15 +36189,20 @@ var require_chainId = __commonJSMin((exports) => {
36212
36189
  }
36213
36190
  };
36214
36191
  });
36215
- var require_reactVersion = __commonJSMin((exports) => {
36192
+ var require_version = __commonJSMin((exports) => {
36216
36193
  "use strict";
36217
36194
  var __importDefault = exports && exports.__importDefault || function(mod) {
36218
36195
  return mod && mod.__esModule ? mod : { "default": mod };
36219
36196
  };
36220
36197
  Object.defineProperty(exports, "__esModule", { value: true });
36221
- exports.isReact18 = void 0;
36198
+ exports.isReact18 = exports.getPnpmVersion = void 0;
36222
36199
  var path_1 = __importDefault(__require("path"));
36223
36200
  var compiled_1 = require_compiled();
36201
+ async function getPnpmVersion() {
36202
+ const { stdout } = await (0, compiled_1.execa)("pnpm", ["--version"]);
36203
+ return stdout;
36204
+ }
36205
+ exports.getPnpmVersion = getPnpmVersion;
36224
36206
  var isReact18 = (cwd) => {
36225
36207
  const pkgPath = path_1.default.join(cwd, "package.json");
36226
36208
  if (!compiled_1.fs.existsSync(pkgPath)) {
@@ -36297,7 +36279,7 @@ var require_dist = __commonJSMin((exports) => {
36297
36279
  __exportStar(require_tryResolve(), exports);
36298
36280
  __exportStar(require_analyzeProject(), exports);
36299
36281
  __exportStar(require_chainId(), exports);
36300
- __exportStar(require_reactVersion(), exports);
36282
+ __exportStar(require_version(), exports);
36301
36283
  });
36302
36284
  var require_esprima = __commonJSMin((exports, module2) => {
36303
36285
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -37419,9 +37401,9 @@ var require_esprima = __commonJSMin((exports, module2) => {
37419
37401
  }();
37420
37402
  exports2.BlockStatement = BlockStatement;
37421
37403
  var BreakStatement = function() {
37422
- function BreakStatement2(label21) {
37404
+ function BreakStatement2(label) {
37423
37405
  this.type = syntax_1.Syntax.BreakStatement;
37424
- this.label = label21;
37406
+ this.label = label;
37425
37407
  }
37426
37408
  return BreakStatement2;
37427
37409
  }();
@@ -37493,9 +37475,9 @@ var require_esprima = __commonJSMin((exports, module2) => {
37493
37475
  }();
37494
37476
  exports2.ConditionalExpression = ConditionalExpression;
37495
37477
  var ContinueStatement = function() {
37496
- function ContinueStatement2(label21) {
37478
+ function ContinueStatement2(label) {
37497
37479
  this.type = syntax_1.Syntax.ContinueStatement;
37498
- this.label = label21;
37480
+ this.label = label;
37499
37481
  }
37500
37482
  return ContinueStatement2;
37501
37483
  }();
@@ -37686,9 +37668,9 @@ var require_esprima = __commonJSMin((exports, module2) => {
37686
37668
  }();
37687
37669
  exports2.ImportSpecifier = ImportSpecifier;
37688
37670
  var LabeledStatement = function() {
37689
- function LabeledStatement2(label21, body) {
37671
+ function LabeledStatement2(label, body) {
37690
37672
  this.type = syntax_1.Syntax.LabeledStatement;
37691
- this.label = label21;
37673
+ this.label = label;
37692
37674
  this.body = body;
37693
37675
  }
37694
37676
  return LabeledStatement2;
@@ -39835,38 +39817,38 @@ var require_esprima = __commonJSMin((exports, module2) => {
39835
39817
  Parser3.prototype.parseContinueStatement = function() {
39836
39818
  var node = this.createNode();
39837
39819
  this.expectKeyword("continue");
39838
- var label21 = null;
39820
+ var label = null;
39839
39821
  if (this.lookahead.type === 3 && !this.hasLineTerminator) {
39840
39822
  var id = this.parseVariableIdentifier();
39841
- label21 = id;
39823
+ label = id;
39842
39824
  var key = "$" + id.name;
39843
39825
  if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
39844
39826
  this.throwError(messages_1.Messages.UnknownLabel, id.name);
39845
39827
  }
39846
39828
  }
39847
39829
  this.consumeSemicolon();
39848
- if (label21 === null && !this.context.inIteration) {
39830
+ if (label === null && !this.context.inIteration) {
39849
39831
  this.throwError(messages_1.Messages.IllegalContinue);
39850
39832
  }
39851
- return this.finalize(node, new Node.ContinueStatement(label21));
39833
+ return this.finalize(node, new Node.ContinueStatement(label));
39852
39834
  };
39853
39835
  Parser3.prototype.parseBreakStatement = function() {
39854
39836
  var node = this.createNode();
39855
39837
  this.expectKeyword("break");
39856
- var label21 = null;
39838
+ var label = null;
39857
39839
  if (this.lookahead.type === 3 && !this.hasLineTerminator) {
39858
39840
  var id = this.parseVariableIdentifier();
39859
39841
  var key = "$" + id.name;
39860
39842
  if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
39861
39843
  this.throwError(messages_1.Messages.UnknownLabel, id.name);
39862
39844
  }
39863
- label21 = id;
39845
+ label = id;
39864
39846
  }
39865
39847
  this.consumeSemicolon();
39866
- if (label21 === null && !this.context.inIteration && !this.context.inSwitch) {
39848
+ if (label === null && !this.context.inIteration && !this.context.inSwitch) {
39867
39849
  this.throwError(messages_1.Messages.IllegalBreak);
39868
39850
  }
39869
- return this.finalize(node, new Node.BreakStatement(label21));
39851
+ return this.finalize(node, new Node.BreakStatement(label));
39870
39852
  };
39871
39853
  Parser3.prototype.parseReturnStatement = function() {
39872
39854
  if (!this.context.inFunctionBody) {
@@ -42498,10 +42480,10 @@ var require_util = __commonJSMin((exports) => {
42498
42480
  return objectToString(e) === "[object Error]" || e instanceof Error;
42499
42481
  }
42500
42482
  exports.isError = isError;
42501
- function isFunction3(arg) {
42483
+ function isFunction4(arg) {
42502
42484
  return typeof arg === "function";
42503
42485
  }
42504
- exports.isFunction = isFunction3;
42486
+ exports.isFunction = isFunction4;
42505
42487
  function isPrimitive(arg) {
42506
42488
  return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
42507
42489
  }
@@ -43345,7 +43327,7 @@ var require_array = __commonJSMin((exports, module2) => {
43345
43327
  splice(...args) {
43346
43328
  const { length } = this;
43347
43329
  const ret = super.splice(...args);
43348
- let [begin, deleteCount, ...items5] = args;
43330
+ let [begin, deleteCount, ...items] = args;
43349
43331
  if (begin < 0) {
43350
43332
  begin += length;
43351
43333
  }
@@ -43356,7 +43338,7 @@ var require_array = __commonJSMin((exports, module2) => {
43356
43338
  }
43357
43339
  const {
43358
43340
  length: item_length
43359
- } = items5;
43341
+ } = items;
43360
43342
  const offset = item_length - deleteCount;
43361
43343
  const start = begin + deleteCount;
43362
43344
  const count = length - start;
@@ -43383,12 +43365,12 @@ var require_array = __commonJSMin((exports, module2) => {
43383
43365
  move_comments(array, this, begin, before - begin, -begin);
43384
43366
  return array;
43385
43367
  }
43386
- unshift(...items5) {
43368
+ unshift(...items) {
43387
43369
  const { length } = this;
43388
- const ret = super.unshift(...items5);
43370
+ const ret = super.unshift(...items);
43389
43371
  const {
43390
43372
  length: items_length
43391
- } = items5;
43373
+ } = items;
43392
43374
  if (items_length > 0) {
43393
43375
  move_comments(this, this, 0, length, items_length, true);
43394
43376
  }
@@ -43411,14 +43393,14 @@ var require_array = __commonJSMin((exports, module2) => {
43411
43393
  remove_comments(this, this.length);
43412
43394
  return ret;
43413
43395
  }
43414
- concat(...items5) {
43396
+ concat(...items) {
43415
43397
  let { length } = this;
43416
- const ret = super.concat(...items5);
43417
- if (!items5.length) {
43398
+ const ret = super.concat(...items);
43399
+ if (!items.length) {
43418
43400
  return ret;
43419
43401
  }
43420
43402
  move_comments(ret, this, 0, this.length, 0);
43421
- items5.forEach((item) => {
43403
+ items.forEach((item) => {
43422
43404
  const prev = length;
43423
43405
  length += isArray4(item) ? item.length : 1;
43424
43406
  if (!(item instanceof CommentArray)) {
@@ -43779,7 +43761,7 @@ var require_stringify = __commonJSMin((exports, module2) => {
43779
43761
  var {
43780
43762
  isArray: isArray4,
43781
43763
  isObject: isObject5,
43782
- isFunction: isFunction3,
43764
+ isFunction: isFunction4,
43783
43765
  isNumber,
43784
43766
  isString: isString3
43785
43767
  } = require_util();
@@ -43906,10 +43888,10 @@ var require_stringify = __commonJSMin((exports, module2) => {
43906
43888
  };
43907
43889
  function stringify(key, holder, gap) {
43908
43890
  let value = holder[key];
43909
- if (isObject5(value) && isFunction3(value.toJSON)) {
43891
+ if (isObject5(value) && isFunction4(value.toJSON)) {
43910
43892
  value = value.toJSON(key);
43911
43893
  }
43912
- if (isFunction3(replacer)) {
43894
+ if (isFunction4(replacer)) {
43913
43895
  value = replacer.call(holder, key, value);
43914
43896
  }
43915
43897
  switch (typeof value) {
@@ -43944,7 +43926,7 @@ var require_stringify = __commonJSMin((exports, module2) => {
43944
43926
  if (!indent_) {
43945
43927
  return JSON.stringify(value, replacer_);
43946
43928
  }
43947
- if (!isFunction3(replacer_) && !isArray4(replacer_)) {
43929
+ if (!isFunction4(replacer_) && !isArray4(replacer_)) {
43948
43930
  replacer_ = null;
43949
43931
  }
43950
43932
  replacer = replacer_;
@@ -44990,11 +44972,11 @@ var require_utils3 = __commonJSMin((exports, module2) => {
44990
44972
  function isBlob(val) {
44991
44973
  return toString5.call(val) === "[object Blob]";
44992
44974
  }
44993
- function isFunction3(val) {
44975
+ function isFunction4(val) {
44994
44976
  return toString5.call(val) === "[object Function]";
44995
44977
  }
44996
44978
  function isStream(val) {
44997
- return isObject5(val) && isFunction3(val.pipe);
44979
+ return isObject5(val) && isFunction4(val.pipe);
44998
44980
  }
44999
44981
  function isURLSearchParams(val) {
45000
44982
  return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
@@ -45075,7 +45057,7 @@ var require_utils3 = __commonJSMin((exports, module2) => {
45075
45057
  isDate,
45076
45058
  isFile,
45077
45059
  isBlob,
45078
- isFunction: isFunction3,
45060
+ isFunction: isFunction4,
45079
45061
  isStream,
45080
45062
  isURLSearchParams,
45081
45063
  isStandardBrowserEnv,
@@ -52791,15 +52773,15 @@ var require_utils5 = __commonJSMin((exports) => {
52791
52773
  }
52792
52774
  var toString5 = Object.prototype.toString;
52793
52775
  exports.toString = toString5;
52794
- var isFunction3 = function isFunction4(value) {
52776
+ var isFunction4 = function isFunction5(value) {
52795
52777
  return typeof value === "function";
52796
52778
  };
52797
- if (isFunction3(/x/)) {
52798
- exports.isFunction = isFunction3 = function(value) {
52779
+ if (isFunction4(/x/)) {
52780
+ exports.isFunction = isFunction4 = function(value) {
52799
52781
  return typeof value === "function" && toString5.call(value) === "[object Function]";
52800
52782
  };
52801
52783
  }
52802
- exports.isFunction = isFunction3;
52784
+ exports.isFunction = isFunction4;
52803
52785
  var isArray4 = Array.isArray || function(value) {
52804
52786
  return value && typeof value === "object" ? toString5.call(value) === "[object Array]" : false;
52805
52787
  };
@@ -54125,18 +54107,18 @@ var require_parser = __commonJSMin((exports, module2) => {
54125
54107
  }
54126
54108
  return token;
54127
54109
  }
54128
- var symbol, preErrorSymbol, state, action3, a, r, yyval = {}, p, len, newState, expected;
54110
+ var symbol, preErrorSymbol, state, action2, a, r, yyval = {}, p, len, newState, expected;
54129
54111
  while (true) {
54130
54112
  state = stack[stack.length - 1];
54131
54113
  if (this.defaultActions[state]) {
54132
- action3 = this.defaultActions[state];
54114
+ action2 = this.defaultActions[state];
54133
54115
  } else {
54134
54116
  if (symbol === null || typeof symbol == "undefined") {
54135
54117
  symbol = lex();
54136
54118
  }
54137
- action3 = table[state] && table[state][symbol];
54119
+ action2 = table[state] && table[state][symbol];
54138
54120
  }
54139
- if (typeof action3 === "undefined" || !action3.length || !action3[0]) {
54121
+ if (typeof action2 === "undefined" || !action2.length || !action2[0]) {
54140
54122
  var errStr = "";
54141
54123
  if (!recovering) {
54142
54124
  expected = [];
@@ -54152,15 +54134,15 @@ var require_parser = __commonJSMin((exports, module2) => {
54152
54134
  this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected });
54153
54135
  }
54154
54136
  }
54155
- if (action3[0] instanceof Array && action3.length > 1) {
54137
+ if (action2[0] instanceof Array && action2.length > 1) {
54156
54138
  throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
54157
54139
  }
54158
- switch (action3[0]) {
54140
+ switch (action2[0]) {
54159
54141
  case 1:
54160
54142
  stack.push(symbol);
54161
54143
  vstack.push(this.lexer.yytext);
54162
54144
  lstack.push(this.lexer.yylloc);
54163
- stack.push(action3[1]);
54145
+ stack.push(action2[1]);
54164
54146
  symbol = null;
54165
54147
  if (!preErrorSymbol) {
54166
54148
  yyleng = this.lexer.yyleng;
@@ -54175,13 +54157,13 @@ var require_parser = __commonJSMin((exports, module2) => {
54175
54157
  }
54176
54158
  break;
54177
54159
  case 2:
54178
- len = this.productions_[action3[1]][1];
54160
+ len = this.productions_[action2[1]][1];
54179
54161
  yyval.$ = vstack[vstack.length - len];
54180
54162
  yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
54181
54163
  if (ranges) {
54182
54164
  yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
54183
54165
  }
54184
- r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action3[1], vstack, lstack);
54166
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action2[1], vstack, lstack);
54185
54167
  if (typeof r !== "undefined") {
54186
54168
  return r;
54187
54169
  }
@@ -54190,7 +54172,7 @@ var require_parser = __commonJSMin((exports, module2) => {
54190
54172
  vstack = vstack.slice(0, -1 * len);
54191
54173
  lstack = lstack.slice(0, -1 * len);
54192
54174
  }
54193
- stack.push(this.productions_[action3[1]][0]);
54175
+ stack.push(this.productions_[action2[1]][0]);
54194
54176
  vstack.push(yyval.$);
54195
54177
  lstack.push(yyval._$);
54196
54178
  newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
@@ -57655,11 +57637,11 @@ var require_javascript_compiler = __commonJSMin((exports, module2) => {
57655
57637
  var functionCall = this.source.functionCall(functionLookupCode, "call", helper.callParams);
57656
57638
  this.push(functionCall);
57657
57639
  },
57658
- itemsSeparatedBy: function itemsSeparatedBy(items5, separator) {
57640
+ itemsSeparatedBy: function itemsSeparatedBy(items, separator) {
57659
57641
  var result = [];
57660
- result.push(items5[0]);
57661
- for (var i = 1; i < items5.length; i++) {
57662
- result.push(separator, items5[i]);
57642
+ result.push(items[0]);
57643
+ for (var i = 1; i < items.length; i++) {
57644
+ result.push(separator, items[i]);
57663
57645
  }
57664
57646
  return result;
57665
57647
  },
@@ -60866,14 +60848,14 @@ var require_isFunction = __commonJSMin((exports, module2) => {
60866
60848
  var funcTag = "[object Function]";
60867
60849
  var genTag = "[object GeneratorFunction]";
60868
60850
  var proxyTag = "[object Proxy]";
60869
- function isFunction3(value) {
60851
+ function isFunction4(value) {
60870
60852
  if (!isObject5(value)) {
60871
60853
  return false;
60872
60854
  }
60873
60855
  var tag = baseGetTag(value);
60874
60856
  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
60875
60857
  }
60876
- module2.exports = isFunction3;
60858
+ module2.exports = isFunction4;
60877
60859
  });
60878
60860
  var require_coreJsData = __commonJSMin((exports, module2) => {
60879
60861
  var root = require_root();
@@ -60910,7 +60892,7 @@ var require_toSource = __commonJSMin((exports, module2) => {
60910
60892
  module2.exports = toSource;
60911
60893
  });
60912
60894
  var require_baseIsNative = __commonJSMin((exports, module2) => {
60913
- var isFunction3 = require_isFunction();
60895
+ var isFunction4 = require_isFunction();
60914
60896
  var isMasked = require_isMasked();
60915
60897
  var isObject5 = require_isObject();
60916
60898
  var toSource = require_toSource();
@@ -60925,7 +60907,7 @@ var require_baseIsNative = __commonJSMin((exports, module2) => {
60925
60907
  if (!isObject5(value) || isMasked(value)) {
60926
60908
  return false;
60927
60909
  }
60928
- var pattern = isFunction3(value) ? reIsNative : reIsHostCtor;
60910
+ var pattern = isFunction4(value) ? reIsNative : reIsHostCtor;
60929
60911
  return pattern.test(toSource(value));
60930
60912
  }
60931
60913
  module2.exports = baseIsNative;
@@ -61124,10 +61106,10 @@ var require_isLength = __commonJSMin((exports, module2) => {
61124
61106
  module2.exports = isLength;
61125
61107
  });
61126
61108
  var require_isArrayLike = __commonJSMin((exports, module2) => {
61127
- var isFunction3 = require_isFunction();
61109
+ var isFunction4 = require_isFunction();
61128
61110
  var isLength = require_isLength();
61129
61111
  function isArrayLike(value) {
61130
- return value != null && isLength(value.length) && !isFunction3(value);
61112
+ return value != null && isLength(value.length) && !isFunction4(value);
61131
61113
  }
61132
61114
  module2.exports = isArrayLike;
61133
61115
  });
@@ -63040,10 +63022,10 @@ var require_isFunction2 = __commonJSMin((exports) => {
63040
63022
  "use strict";
63041
63023
  Object.defineProperty(exports, "__esModule", { value: true });
63042
63024
  exports.isFunction = void 0;
63043
- function isFunction3(value) {
63025
+ function isFunction4(value) {
63044
63026
  return typeof value === "function";
63045
63027
  }
63046
- exports.isFunction = isFunction3;
63028
+ exports.isFunction = isFunction4;
63047
63029
  });
63048
63030
  var require_createErrorClass = __commonJSMin((exports) => {
63049
63031
  "use strict";
@@ -64875,8 +64857,8 @@ var require_AsapAction = __commonJSMin((exports) => {
64875
64857
  if (delay != null && delay > 0 || delay == null && this.delay > 0) {
64876
64858
  return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
64877
64859
  }
64878
- if (!scheduler.actions.some(function(action3) {
64879
- return action3.id === id;
64860
+ if (!scheduler.actions.some(function(action2) {
64861
+ return action2.id === id;
64880
64862
  })) {
64881
64863
  immediateProvider_1.immediateProvider.clearImmediate(id);
64882
64864
  scheduler._scheduled = void 0;
@@ -64949,23 +64931,23 @@ var require_AsyncScheduler = __commonJSMin((exports) => {
64949
64931
  _this._scheduled = void 0;
64950
64932
  return _this;
64951
64933
  }
64952
- AsyncScheduler2.prototype.flush = function(action3) {
64934
+ AsyncScheduler2.prototype.flush = function(action2) {
64953
64935
  var actions = this.actions;
64954
64936
  if (this._active) {
64955
- actions.push(action3);
64937
+ actions.push(action2);
64956
64938
  return;
64957
64939
  }
64958
64940
  var error;
64959
64941
  this._active = true;
64960
64942
  do {
64961
- if (error = action3.execute(action3.state, action3.delay)) {
64943
+ if (error = action2.execute(action2.state, action2.delay)) {
64962
64944
  break;
64963
64945
  }
64964
- } while (action3 = actions.shift());
64946
+ } while (action2 = actions.shift());
64965
64947
  this._active = false;
64966
64948
  if (error) {
64967
- while (action3 = actions.shift()) {
64968
- action3.unsubscribe();
64949
+ while (action2 = actions.shift()) {
64950
+ action2.unsubscribe();
64969
64951
  }
64970
64952
  throw error;
64971
64953
  }
@@ -65005,22 +64987,22 @@ var require_AsapScheduler = __commonJSMin((exports) => {
65005
64987
  function AsapScheduler2() {
65006
64988
  return _super !== null && _super.apply(this, arguments) || this;
65007
64989
  }
65008
- AsapScheduler2.prototype.flush = function(action3) {
64990
+ AsapScheduler2.prototype.flush = function(action2) {
65009
64991
  this._active = true;
65010
64992
  var flushId = this._scheduled;
65011
64993
  this._scheduled = void 0;
65012
64994
  var actions = this.actions;
65013
64995
  var error;
65014
- action3 = action3 || actions.shift();
64996
+ action2 = action2 || actions.shift();
65015
64997
  do {
65016
- if (error = action3.execute(action3.state, action3.delay)) {
64998
+ if (error = action2.execute(action2.state, action2.delay)) {
65017
64999
  break;
65018
65000
  }
65019
- } while ((action3 = actions[0]) && action3.id === flushId && actions.shift());
65001
+ } while ((action2 = actions[0]) && action2.id === flushId && actions.shift());
65020
65002
  this._active = false;
65021
65003
  if (error) {
65022
- while ((action3 = actions[0]) && action3.id === flushId && actions.shift()) {
65023
- action3.unsubscribe();
65004
+ while ((action2 = actions[0]) && action2.id === flushId && actions.shift()) {
65005
+ action2.unsubscribe();
65024
65006
  }
65025
65007
  throw error;
65026
65008
  }
@@ -65207,8 +65189,8 @@ var require_AnimationFrameAction = __commonJSMin((exports) => {
65207
65189
  if (delay != null && delay > 0 || delay == null && this.delay > 0) {
65208
65190
  return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
65209
65191
  }
65210
- if (!scheduler.actions.some(function(action3) {
65211
- return action3.id === id;
65192
+ if (!scheduler.actions.some(function(action2) {
65193
+ return action2.id === id;
65212
65194
  })) {
65213
65195
  animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
65214
65196
  scheduler._scheduled = void 0;
@@ -65250,22 +65232,22 @@ var require_AnimationFrameScheduler = __commonJSMin((exports) => {
65250
65232
  function AnimationFrameScheduler2() {
65251
65233
  return _super !== null && _super.apply(this, arguments) || this;
65252
65234
  }
65253
- AnimationFrameScheduler2.prototype.flush = function(action3) {
65235
+ AnimationFrameScheduler2.prototype.flush = function(action2) {
65254
65236
  this._active = true;
65255
65237
  var flushId = this._scheduled;
65256
65238
  this._scheduled = void 0;
65257
65239
  var actions = this.actions;
65258
65240
  var error;
65259
- action3 = action3 || actions.shift();
65241
+ action2 = action2 || actions.shift();
65260
65242
  do {
65261
- if (error = action3.execute(action3.state, action3.delay)) {
65243
+ if (error = action2.execute(action2.state, action2.delay)) {
65262
65244
  break;
65263
65245
  }
65264
- } while ((action3 = actions[0]) && action3.id === flushId && actions.shift());
65246
+ } while ((action2 = actions[0]) && action2.id === flushId && actions.shift());
65265
65247
  this._active = false;
65266
65248
  if (error) {
65267
- while ((action3 = actions[0]) && action3.id === flushId && actions.shift()) {
65268
- action3.unsubscribe();
65249
+ while ((action2 = actions[0]) && action2.id === flushId && actions.shift()) {
65250
+ action2.unsubscribe();
65269
65251
  }
65270
65252
  throw error;
65271
65253
  }
@@ -65331,17 +65313,17 @@ var require_VirtualTimeScheduler = __commonJSMin((exports) => {
65331
65313
  VirtualTimeScheduler2.prototype.flush = function() {
65332
65314
  var _a2 = this, actions = _a2.actions, maxFrames = _a2.maxFrames;
65333
65315
  var error;
65334
- var action3;
65335
- while ((action3 = actions[0]) && action3.delay <= maxFrames) {
65316
+ var action2;
65317
+ while ((action2 = actions[0]) && action2.delay <= maxFrames) {
65336
65318
  actions.shift();
65337
- this.frame = action3.delay;
65338
- if (error = action3.execute(action3.state, action3.delay)) {
65319
+ this.frame = action2.delay;
65320
+ if (error = action2.execute(action2.state, action2.delay)) {
65339
65321
  break;
65340
65322
  }
65341
65323
  }
65342
65324
  if (error) {
65343
- while (action3 = actions.shift()) {
65344
- action3.unsubscribe();
65325
+ while (action2 = actions.shift()) {
65326
+ action2.unsubscribe();
65345
65327
  }
65346
65328
  throw error;
65347
65329
  }
@@ -65373,9 +65355,9 @@ var require_VirtualTimeScheduler = __commonJSMin((exports) => {
65373
65355
  return _super.prototype.schedule.call(this, state, delay);
65374
65356
  }
65375
65357
  this.active = false;
65376
- var action3 = new VirtualAction2(this.scheduler, this.work);
65377
- this.add(action3);
65378
- return action3.schedule(state, delay);
65358
+ var action2 = new VirtualAction2(this.scheduler, this.work);
65359
+ this.add(action2);
65360
+ return action2.schedule(state, delay);
65379
65361
  } else {
65380
65362
  return Subscription_1.Subscription.EMPTY;
65381
65363
  }
@@ -79105,15 +79087,15 @@ var require_ora2 = __commonJSMin((exports, module2) => {
79105
79087
  return new Ora(options3);
79106
79088
  };
79107
79089
  module2.exports = oraFactory;
79108
- module2.exports.promise = (action3, options3) => {
79109
- if (typeof action3.then !== "function") {
79090
+ module2.exports.promise = (action2, options3) => {
79091
+ if (typeof action2.then !== "function") {
79110
79092
  throw new TypeError("Parameter `action` must be a Promise");
79111
79093
  }
79112
79094
  const spinner = new Ora(options3);
79113
79095
  spinner.start();
79114
79096
  (async () => {
79115
79097
  try {
79116
- await action3;
79098
+ await action2;
79117
79099
  spinner.succeed();
79118
79100
  } catch {
79119
79101
  spinner.fail();
@@ -79294,13 +79276,13 @@ var require_base3 = __commonJSMin((exports, module2) => {
79294
79276
  }
79295
79277
  handleSubmitEvents(submit) {
79296
79278
  const self3 = this;
79297
- const validate5 = runAsync(this.opt.validate);
79279
+ const validate2 = runAsync(this.opt.validate);
79298
79280
  const asyncFilter = runAsync(this.opt.filter);
79299
79281
  const validation = submit.pipe(flatMap((value) => {
79300
79282
  this.startSpinner(value, this.opt.filteringText);
79301
79283
  return asyncFilter(value, self3.answers).then((filteredValue) => {
79302
79284
  this.startSpinner(filteredValue, this.opt.validatingText);
79303
- return validate5(filteredValue, self3.answers).then((isValid5) => ({ isValid: isValid5, value: filteredValue }), (err) => ({ isValid: err, value: filteredValue }));
79285
+ return validate2(filteredValue, self3.answers).then((isValid5) => ({ isValid: isValid5, value: filteredValue }), (err) => ({ isValid: err, value: filteredValue }));
79304
79286
  }, (err) => ({ isValid: err }));
79305
79287
  }), share());
79306
79288
  const success = validation.pipe(filter3((state) => state.isValid === true), take(1));
@@ -97272,7 +97254,7 @@ var require_baseMergeDeep = __commonJSMin((exports, module2) => {
97272
97254
  var isArray4 = require_isArray();
97273
97255
  var isArrayLikeObject = require_isArrayLikeObject();
97274
97256
  var isBuffer = require_isBuffer();
97275
- var isFunction3 = require_isFunction();
97257
+ var isFunction4 = require_isFunction();
97276
97258
  var isObject5 = require_isObject();
97277
97259
  var isPlainObject = require_isPlainObject();
97278
97260
  var isTypedArray = require_isTypedArray();
@@ -97307,7 +97289,7 @@ var require_baseMergeDeep = __commonJSMin((exports, module2) => {
97307
97289
  newValue = objValue;
97308
97290
  if (isArguments(objValue)) {
97309
97291
  newValue = toPlainObject(objValue);
97310
- } else if (!isObject5(objValue) || isFunction3(objValue)) {
97292
+ } else if (!isObject5(objValue) || isFunction4(objValue)) {
97311
97293
  newValue = initCloneObject(srcValue);
97312
97294
  }
97313
97295
  } else {
@@ -97428,7 +97410,7 @@ var init_stateField = __esmMin(() => {
97428
97410
  if (typeof value.action === "function") {
97429
97411
  schema.state.value = {
97430
97412
  effectedByFields: value.effectedByFields,
97431
- action: function action3(data, lastValue) {
97413
+ action: function action2(data, lastValue) {
97432
97414
  return value.action(data, lastValue || initValue);
97433
97415
  }
97434
97416
  };
@@ -97746,8 +97728,8 @@ var init_checkSchema = __esmMin(() => {
97746
97728
  };
97747
97729
  checkRepeatItems = function checkRepeatItems2(schema, extra) {
97748
97730
  if (schema.items && schema.items.length > 0) {
97749
- var items5 = getItems(schema, {}, extra);
97750
- var keys = items5.map(function(x) {
97731
+ var items = getItems(schema, {}, extra);
97732
+ var keys = items.map(function(x) {
97751
97733
  return x.key;
97752
97734
  });
97753
97735
  var tmp = [];
@@ -97929,9 +97911,9 @@ var init_baseReader = __esmMin(() => {
97929
97911
  initValues[_schema.key] = _this.getSchemaDefaultValue(_schema, brothers, isRoot);
97930
97912
  }
97931
97913
  if (_schema.items) {
97932
- var items5 = getItems(_schema, _this.data, _this.extra);
97933
- items5.forEach(function(each2) {
97934
- return readDefaultValue2(each2, items5.map(function(x) {
97914
+ var items = getItems(_schema, _this.data, _this.extra);
97915
+ items.forEach(function(each2) {
97916
+ return readDefaultValue2(each2, items.map(function(x) {
97935
97917
  return x.key;
97936
97918
  }), false);
97937
97919
  });
@@ -97949,7 +97931,7 @@ var init_baseReader = __esmMin(() => {
97949
97931
  if (!isEffectedValue(val)) {
97950
97932
  return val;
97951
97933
  }
97952
- var _ref = val, _ref$effectedByFields = _ref.effectedByFields, effectedByFields = _ref$effectedByFields === void 0 ? [] : _ref$effectedByFields, action3 = _ref.action, rest = _objectWithoutProperties(_ref, _excluded);
97934
+ var _ref = val, _ref$effectedByFields = _ref.effectedByFields, effectedByFields = _ref$effectedByFields === void 0 ? [] : _ref$effectedByFields, action2 = _ref.action, rest = _objectWithoutProperties(_ref, _excluded);
97953
97935
  if (isRoot) {
97954
97936
  throw Error("[".concat(schema.key, "] top level should not have effects"));
97955
97937
  }
@@ -97961,7 +97943,7 @@ var init_baseReader = __esmMin(() => {
97961
97943
  }
97962
97944
  return _objectSpread2({
97963
97945
  effectedByFields: curNodeEffectedByFields,
97964
- action: action3
97946
+ action: action2
97965
97947
  }, rest);
97966
97948
  };
97967
97949
  return handleEffects(state.value);
@@ -98945,7 +98927,7 @@ var require_utils10 = __commonJSMin((exports) => {
98945
98927
  }, choices);
98946
98928
  };
98947
98929
  exports.getQuestion = getQuestion;
98948
- var when8 = (schema, answers, extra) => {
98930
+ var when = (schema, answers, extra) => {
98949
98931
  if (schema.when && typeof schema.when === "function") {
98950
98932
  return schema.when(answers, extra);
98951
98933
  }
@@ -98971,7 +98953,7 @@ var require_utils10 = __commonJSMin((exports) => {
98971
98953
  });
98972
98954
  return (answers) => {
98973
98955
  try {
98974
- if (!when8(schema, answers, nodeInfo.extra)) {
98956
+ if (!when(schema, answers, nodeInfo.extra)) {
98975
98957
  return Promise.resolve(true);
98976
98958
  }
98977
98959
  const question = getQuestion({
@@ -99575,18 +99557,18 @@ var require_transformSchema = __commonJSMin((exports) => {
99575
99557
  schemaItem.label = schemaItem.state.cliLabel;
99576
99558
  }
99577
99559
  const {
99578
- when: when8,
99579
- validate: validate5
99560
+ when,
99561
+ validate: validate2
99580
99562
  } = schemaItem;
99581
99563
  schemaItem.when = (values, extra) => {
99582
99564
  if (!(0, _lodash.isUndefined)(configValue[schemaItem.key])) {
99583
99565
  return false;
99584
99566
  }
99585
- return when8 ? when8(values, extra) : true;
99567
+ return when ? when(values, extra) : true;
99586
99568
  };
99587
99569
  schemaItem.validate = async (value, data, extra) => {
99588
- if (validate5) {
99589
- const result = await validate5(value, data, extra);
99570
+ if (validate2) {
99571
+ const result = await validate2(value, data, extra);
99590
99572
  if (!result.success) {
99591
99573
  return result;
99592
99574
  }
@@ -101962,11 +101944,11 @@ var init_esm = __esmMin(() => {
101962
101944
  return path6;
101963
101945
  };
101964
101946
  this.push = function() {
101965
- var items5 = [];
101947
+ var items = [];
101966
101948
  for (var _i = 0; _i < arguments.length; _i++) {
101967
- items5[_i] = arguments[_i];
101949
+ items[_i] = arguments[_i];
101968
101950
  }
101969
- return _this.concat.apply(_this, __spreadArray([], __read(items5), false));
101951
+ return _this.concat.apply(_this, __spreadArray([], __read(items), false));
101970
101952
  };
101971
101953
  this.pop = function() {
101972
101954
  if (_this.isMatchPattern || _this.isRegExp) {
@@ -101975,18 +101957,18 @@ var init_esm = __esmMin(() => {
101975
101957
  return new Path2(_this.segments.slice(0, _this.segments.length - 1));
101976
101958
  };
101977
101959
  this.splice = function(start, deleteCount) {
101978
- var items5 = [];
101960
+ var items = [];
101979
101961
  for (var _i = 2; _i < arguments.length; _i++) {
101980
- items5[_i - 2] = arguments[_i];
101962
+ items[_i - 2] = arguments[_i];
101981
101963
  }
101982
101964
  if (_this.isMatchPattern || _this.isRegExp) {
101983
101965
  throw new Error("".concat(_this.entire, " cannot be splice"));
101984
101966
  }
101985
- items5 = items5.reduce(function(buf, item) {
101967
+ items = items.reduce(function(buf, item) {
101986
101968
  return buf.concat(parseString(item));
101987
101969
  }, []);
101988
101970
  var segments_ = _this.segments.slice();
101989
- segments_.splice.apply(segments_, __spreadArray([start, deleteCount], __read(items5), false));
101971
+ segments_.splice.apply(segments_, __spreadArray([start, deleteCount], __read(items), false));
101990
101972
  return new Path2(segments_);
101991
101973
  };
101992
101974
  this.forEach = function(callback) {
@@ -107068,9 +107050,9 @@ var init_BaseField = __esmMin(() => {
107068
107050
  return Path.parse(pattern).matchAliasGroup(_this.address, _this.path);
107069
107051
  };
107070
107052
  this.inject = function(actions) {
107071
- each(actions, function(action3, key) {
107072
- if (isFn(action3)) {
107073
- _this.actions[key] = action3;
107053
+ each(actions, function(action2, key) {
107054
+ if (isFn(action2)) {
107055
+ _this.actions[key] = action2;
107074
107056
  }
107075
107057
  });
107076
107058
  };
@@ -108082,16 +108064,16 @@ var init_ArrayField = __esmMin(() => {
108082
108064
  var _this = _super.call(this, address, props, form, designable) || this;
108083
108065
  _this.displayName = "ArrayField";
108084
108066
  _this.push = function() {
108085
- var items5 = [];
108067
+ var items = [];
108086
108068
  for (var _i = 0; _i < arguments.length; _i++) {
108087
- items5[_i] = arguments[_i];
108069
+ items[_i] = arguments[_i];
108088
108070
  }
108089
108071
  return action(function() {
108090
108072
  var _a2;
108091
108073
  if (!isArr(_this.value)) {
108092
108074
  _this.value = [];
108093
108075
  }
108094
- (_a2 = _this.value).push.apply(_a2, __spreadArray6([], __read6(items5), false));
108076
+ (_a2 = _this.value).push.apply(_a2, __spreadArray6([], __read6(items), false));
108095
108077
  return _this.onInput(_this.value);
108096
108078
  });
108097
108079
  };
@@ -108109,9 +108091,9 @@ var init_ArrayField = __esmMin(() => {
108109
108091
  });
108110
108092
  };
108111
108093
  _this.insert = function(index) {
108112
- var items5 = [];
108094
+ var items = [];
108113
108095
  for (var _i = 1; _i < arguments.length; _i++) {
108114
- items5[_i - 1] = arguments[_i];
108096
+ items[_i - 1] = arguments[_i];
108115
108097
  }
108116
108098
  return action(function() {
108117
108099
  var _a2;
@@ -108120,9 +108102,9 @@ var init_ArrayField = __esmMin(() => {
108120
108102
  }
108121
108103
  spliceArrayState(_this, {
108122
108104
  startIndex: index,
108123
- insertCount: items5.length
108105
+ insertCount: items.length
108124
108106
  });
108125
- (_a2 = _this.value).splice.apply(_a2, __spreadArray6([index, 0], __read6(items5), false));
108107
+ (_a2 = _this.value).splice.apply(_a2, __spreadArray6([index, 0], __read6(items), false));
108126
108108
  return _this.onInput(_this.value);
108127
108109
  });
108128
108110
  };
@@ -108147,9 +108129,9 @@ var init_ArrayField = __esmMin(() => {
108147
108129
  });
108148
108130
  };
108149
108131
  _this.unshift = function() {
108150
- var items5 = [];
108132
+ var items = [];
108151
108133
  for (var _i = 0; _i < arguments.length; _i++) {
108152
- items5[_i] = arguments[_i];
108134
+ items[_i] = arguments[_i];
108153
108135
  }
108154
108136
  return action(function() {
108155
108137
  var _a2;
@@ -108158,9 +108140,9 @@ var init_ArrayField = __esmMin(() => {
108158
108140
  }
108159
108141
  spliceArrayState(_this, {
108160
108142
  startIndex: 0,
108161
- insertCount: items5.length
108143
+ insertCount: items.length
108162
108144
  });
108163
- (_a2 = _this.value).unshift.apply(_a2, __spreadArray6([], __read6(items5), false));
108145
+ (_a2 = _this.value).unshift.apply(_a2, __spreadArray6([], __read6(items), false));
108164
108146
  return _this.onInput(_this.value);
108165
108147
  });
108166
108148
  };
@@ -109199,7 +109181,7 @@ var init_transformer = __esmMin(() => {
109199
109181
  if (isFn(reaction2)) {
109200
109182
  return reaction2(field, baseScope);
109201
109183
  }
109202
- var when8 = reaction2.when, fulfill = reaction2.fulfill, otherwise = reaction2.otherwise, target = reaction2.target, effects = reaction2.effects;
109184
+ var when = reaction2.when, fulfill = reaction2.fulfill, otherwise = reaction2.otherwise, target = reaction2.target, effects = reaction2.effects;
109203
109185
  var run = function() {
109204
109186
  var $deps = getDependencies(field, reaction2.dependencies);
109205
109187
  var $dependencies = $deps;
@@ -109208,8 +109190,8 @@ var init_transformer = __esmMin(() => {
109208
109190
  $deps,
109209
109191
  $dependencies
109210
109192
  });
109211
- var compiledWhen = shallowCompile(when8, scope);
109212
- var condition = when8 ? compiledWhen : true;
109193
+ var compiledWhen = shallowCompile(when, scope);
109194
+ var condition = when ? compiledWhen : true;
109213
109195
  var request = condition ? fulfill : otherwise;
109214
109196
  var runner2 = condition ? fulfill === null || fulfill === void 0 ? void 0 : fulfill.run : otherwise === null || otherwise === void 0 ? void 0 : otherwise.run;
109215
109197
  setSchemaFieldState({
@@ -109529,10 +109511,10 @@ var init_schema = __esmMin(() => {
109529
109511
  }
109530
109512
  return _this.items;
109531
109513
  };
109532
- this.setAdditionalItems = function(items5) {
109533
- if (!items5)
109514
+ this.setAdditionalItems = function(items) {
109515
+ if (!items)
109534
109516
  return;
109535
- _this.additionalItems = new Schema2(items5, _this);
109517
+ _this.additionalItems = new Schema2(items, _this);
109536
109518
  return _this.additionalItems;
109537
109519
  };
109538
109520
  this.findDefinitions = function(ref2) {
@@ -110206,13 +110188,13 @@ var require_base4 = __commonJSMin((exports, module2) => {
110206
110188
  }
110207
110189
  handleSubmitEvents(submit) {
110208
110190
  const self3 = this;
110209
- const validate5 = runAsync(this.opt.validate);
110191
+ const validate2 = runAsync(this.opt.validate);
110210
110192
  const asyncFilter = runAsync(this.opt.filter);
110211
110193
  const validation = submit.pipe(flatMap((value) => {
110212
110194
  this.startSpinner(value, this.opt.filteringText);
110213
110195
  return asyncFilter(value, self3.answers).then((filteredValue) => {
110214
110196
  this.startSpinner(filteredValue, this.opt.validatingText);
110215
- return validate5(filteredValue, self3.answers).then((isValid5) => ({ isValid: isValid5, value: filteredValue }), (err) => ({ isValid: err, value: filteredValue }));
110197
+ return validate2(filteredValue, self3.answers).then((isValid5) => ({ isValid: isValid5, value: filteredValue }), (err) => ({ isValid: err, value: filteredValue }));
110216
110198
  }, (err) => ({ isValid: err }));
110217
110199
  }), share());
110218
110200
  const success = validation.pipe(filter3((state) => state.isValid === true), take(1));
@@ -111266,8 +111248,8 @@ function getQuestionFromSchema(schema) {
111266
111248
  return [];
111267
111249
  }
111268
111250
  var questions = fields.map(function(field) {
111269
- var _field = properties[field], type = _field.type, title = _field.title, defaultValue = _field["default"], items5 = _field["enum"], fieldValidate = _field["x-validate"], extra = _objectWithoutProperties(_field, _excluded2);
111270
- if (type === "void") {
111251
+ var _field = properties[field], type = _field.type, title = _field.title, defaultValue = _field["default"], items = _field["enum"], fieldValidate = _field["x-validate"], extra = _objectWithoutProperties(_field, _excluded2);
111252
+ if (type === "void" || type === "object") {
111271
111253
  return getQuestionFromSchema(properties[field], configValue, validateMap, initValue);
111272
111254
  }
111273
111255
  if (type !== "string" && type !== "number") {
@@ -111285,7 +111267,9 @@ function getQuestionFromSchema(schema) {
111285
111267
  break;
111286
111268
  }
111287
111269
  _context.next = 3;
111288
- return validate(input, fieldValidate);
111270
+ return validate(input, (0, import_lodash.isFunction)(fieldValidate) ? {
111271
+ validator: fieldValidate
111272
+ } : fieldValidate);
111289
111273
  case 3:
111290
111274
  _result = _context.sent;
111291
111275
  if (!((_result$error = _result.error) !== null && _result$error !== void 0 && _result$error.length)) {
@@ -111322,16 +111306,16 @@ function getQuestionFromSchema(schema) {
111322
111306
  message: title || field,
111323
111307
  "default": initValue[field] || defaultValue,
111324
111308
  origin: extra,
111325
- validate: function validate5(input) {
111309
+ validate: function validate2(input) {
111326
111310
  return questionValidate(field, input);
111327
111311
  },
111328
111312
  when: !configValue[field]
111329
111313
  };
111330
- if (items5) {
111314
+ if (items) {
111331
111315
  if ((0, import_lodash.isArray)(defaultValue)) {
111332
111316
  return _objectSpread2(_objectSpread2({}, result), {}, {
111333
111317
  type: "checkbox",
111334
- choices: items5.map(function(item) {
111318
+ choices: items.map(function(item) {
111335
111319
  return {
111336
111320
  type: "choice",
111337
111321
  name: (0, import_lodash.isObject)(item) ? item.label : item,
@@ -111342,7 +111326,7 @@ function getQuestionFromSchema(schema) {
111342
111326
  }
111343
111327
  return _objectSpread2(_objectSpread2({}, result), {}, {
111344
111328
  type: "list",
111345
- choices: items5.map(function(item) {
111329
+ choices: items.map(function(item) {
111346
111330
  return {
111347
111331
  type: "choice",
111348
111332
  name: (0, import_lodash.isObject)(item) ? item.label : item,
@@ -111471,7 +111455,7 @@ var init_prompt = __esmMin(() => {
111471
111455
  return state;
111472
111456
  };
111473
111457
  handleXReactions = /* @__PURE__ */ function() {
111474
- var _ref = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(xReactions, answers, items5, item) {
111458
+ var _ref = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(xReactions, answers, items, item) {
111475
111459
  var answer, _iterator, _step, _loop;
111476
111460
  return _regeneratorRuntime().wrap(function _callee$(_context2) {
111477
111461
  while (1) {
@@ -111508,12 +111492,12 @@ var init_prompt = __esmMin(() => {
111508
111492
  value: answer[item.name]
111509
111493
  }),
111510
111494
  $values: answers,
111511
- $target: items5.find(function(it2) {
111495
+ $target: items.find(function(it2) {
111512
111496
  return it2.name === (xReaction === null || xReaction === void 0 ? void 0 : xReaction.target);
111513
111497
  })
111514
111498
  };
111515
111499
  state = xReaction !== null && xReaction !== void 0 && xReaction.when && !compileRule(xReaction === null || xReaction === void 0 ? void 0 : xReaction.when, _scope) ? compileRule(xReaction === null || xReaction === void 0 ? void 0 : (_xReaction$otherwise = xReaction.otherwise) === null || _xReaction$otherwise === void 0 ? void 0 : _xReaction$otherwise.state, _scope) : compileRule(xReaction === null || xReaction === void 0 ? void 0 : (_xReaction$fulfill = xReaction.fulfill) === null || _xReaction$fulfill === void 0 ? void 0 : _xReaction$fulfill.state, _scope);
111516
- _iterator2 = _createForOfIteratorHelper(items5);
111500
+ _iterator2 = _createForOfIteratorHelper(items);
111517
111501
  _context.prev = 12;
111518
111502
  _iterator2.s();
111519
111503
  case 14:
@@ -111563,7 +111547,7 @@ var init_prompt = __esmMin(() => {
111563
111547
  break;
111564
111548
  }
111565
111549
  dependencies3 = xReaction === null || xReaction === void 0 ? void 0 : xReaction.dependencies;
111566
- $dependencies = items5.filter(function(it2) {
111550
+ $dependencies = items.filter(function(it2) {
111567
111551
  return dependencies3.includes(it2.name);
111568
111552
  }).map(function(it2) {
111569
111553
  return answers[it2.name];
@@ -111708,10 +111692,12 @@ var init_inquirer = __esmMin(() => {
111708
111692
  });
111709
111693
  var treeshaking_exports2 = {};
111710
111694
  __export2(treeshaking_exports2, {
111711
- CLIReader: () => CLIReader
111695
+ CLIReader: () => CLIReader,
111696
+ validate: () => validate
111712
111697
  });
111713
111698
  var init_treeshaking2 = __esmMin(() => {
111714
111699
  init_inquirer();
111700
+ init_esm4();
111715
111701
  });
111716
111702
  function getObjKeyMap(obj) {
111717
111703
  var prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
@@ -112506,6 +112492,21 @@ var require_node8 = __commonJSMin((exports) => {
112506
112492
  throw new Error("run sub generator failed");
112507
112493
  }
112508
112494
  }
112495
+ mergeAnswers(answers, configValue) {
112496
+ const inputData = (0, _lodash.merge)(answers, configValue);
112497
+ this.generatorContext.config = (0, _lodash.merge)(this.generatorContext.config, inputData);
112498
+ return inputData;
112499
+ }
112500
+ async getInputBySchemaFunc(schemaFunc, configValue = {}, validateMap = {}, initValue = {}) {
112501
+ const reader = new _codesmithFormily.CLIReader({
112502
+ schema: schemaFunc(configValue),
112503
+ validateMap,
112504
+ initValue
112505
+ });
112506
+ reader.setAnswers(configValue);
112507
+ const answers = await reader.start();
112508
+ return this.mergeAnswers(answers, configValue);
112509
+ }
112509
112510
  async getInputBySchema(schema, configValue = {}, validateMap = {}, initValue = {}, type = "easy-form") {
112510
112511
  if (type === "easy-form") {
112511
112512
  const reader = new _easyFormCli.CliReader({
@@ -112516,9 +112517,7 @@ var require_node8 = __commonJSMin((exports) => {
112516
112517
  return new Promise((resolve, reject) => {
112517
112518
  reader.startQuestion({
112518
112519
  onComplete: (answers) => {
112519
- const inputData = (0, _lodash.merge)(answers, configValue);
112520
- this.generatorContext.config = (0, _lodash.merge)(this.generatorContext.config, inputData);
112521
- resolve(inputData);
112520
+ resolve(this.mergeAnswers(answers, configValue));
112522
112521
  },
112523
112522
  onError: (error) => {
112524
112523
  reject(error);
@@ -112532,10 +112531,11 @@ var require_node8 = __commonJSMin((exports) => {
112532
112531
  initValue
112533
112532
  });
112534
112533
  reader.setAnswers(configValue);
112535
- return reader.start();
112534
+ const answers = await reader.start();
112535
+ return this.mergeAnswers(answers, configValue);
112536
112536
  } else {
112537
- const result = await _inquirer.default.prompt((0, _transform.transformInquirerSchema)(schema, configValue, validateMap, initValue));
112538
- return _objectSpread(_objectSpread({}, configValue), result);
112537
+ const answers = await _inquirer.default.prompt((0, _transform.transformInquirerSchema)(schema, configValue, validateMap, initValue));
112538
+ return this.mergeAnswers(answers, configValue);
112539
112539
  }
112540
112540
  }
112541
112541
  };
@@ -112673,7 +112673,6 @@ var init_zh = __esmMin(() => {
112673
112673
  sass: "\u542F\u7528 Sass \u652F\u6301",
112674
112674
  bff: "\u542F\u7528\u300CBFF\u300D\u529F\u80FD",
112675
112675
  micro_frontend: "\u542F\u7528\u300C\u5FAE\u524D\u7AEF\u300D\u6A21\u5F0F",
112676
- electron: "\u542F\u7528\u300CElectron\u300D\u6A21\u5F0F",
112677
112676
  i18n: "\u542F\u7528\u300C\u56FD\u9645\u5316\uFF08i18n\uFF09\u300D\u529F\u80FD",
112678
112677
  test: "\u542F\u7528\u300C\u5355\u5143\u6D4B\u8BD5 / \u96C6\u6210\u6D4B\u8BD5\u300D\u529F\u80FD",
112679
112678
  e2e_test: "\u542F\u7528\u300CE2E \u6D4B\u8BD5\u300D\u529F\u80FD",
@@ -112705,11 +112704,6 @@ var init_zh = __esmMin(() => {
112705
112704
  packageManager: {
112706
112705
  self: "\u8BF7\u9009\u62E9\u5305\u7BA1\u7406\u5DE5\u5177"
112707
112706
  },
112708
- runWay: {
112709
- self: "\u662F\u5426\u9700\u8981\u652F\u6301\u4EE5\u4E0B\u7C7B\u578B\u5E94\u7528",
112710
- no: "\u4E0D\u9700\u8981",
112711
- electron: "Electron"
112712
- },
112713
112707
  entry: {
112714
112708
  name: "\u8BF7\u586B\u5199\u5165\u53E3\u540D\u79F0",
112715
112709
  no_empty: "\u5165\u53E3\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\uFF01",
@@ -112778,7 +112772,6 @@ var init_en = __esmMin(() => {
112778
112772
  sass: "Enable Sass",
112779
112773
  bff: "Enable BFF",
112780
112774
  micro_frontend: "Enable Micro Frontend",
112781
- electron: "Enable Electron",
112782
112775
  i18n: "Enable Internationalization (i18n)",
112783
112776
  test: "Enable Unit Test / Integration Test",
112784
112777
  e2e_test: "Enable E2E Test",
@@ -112820,11 +112813,6 @@ var init_en = __esmMin(() => {
112820
112813
  no_empty: "The package path cannot be empty!",
112821
112814
  format: "Only lowercase letters, numbers and delimiters (-), and underscore (_), and directory delimiters (/) can be used in package path."
112822
112815
  },
112823
- runWay: {
112824
- self: "Do you need to support the following types of applications",
112825
- no: "Not Enabled",
112826
- electron: "Electron"
112827
- },
112828
112816
  entry: {
112829
112817
  name: "Entry name",
112830
112818
  no_empty: "The entry name cannot be empty!",
@@ -112863,7 +112851,7 @@ var init_locale2 = __esmMin(() => {
112863
112851
  en: EN_LOCALE
112864
112852
  });
112865
112853
  });
112866
- var _BooleanConfigName, BooleanConfig, BooleanConfigName, BooleanSchemas;
112854
+ var _BooleanConfigName, BooleanConfig, BooleanConfigName, getBooleanSchemas;
112867
112855
  var init_boolean = __esmMin(() => {
112868
112856
  init_defineProperty();
112869
112857
  init_locale2();
@@ -112876,13 +112864,15 @@ var init_boolean = __esmMin(() => {
112876
112864
  }), _defineProperty(_BooleanConfigName, BooleanConfig.YES, function() {
112877
112865
  return i18n.t(localeKeys["boolean"].yes);
112878
112866
  }), _BooleanConfigName);
112879
- BooleanSchemas = [{
112880
- key: BooleanConfig.NO,
112881
- label: BooleanConfigName[BooleanConfig.NO]
112882
- }, {
112883
- key: BooleanConfig.YES,
112884
- label: BooleanConfigName[BooleanConfig.YES]
112885
- }];
112867
+ getBooleanSchemas = function getBooleanSchemas2() {
112868
+ return [{
112869
+ value: BooleanConfig.NO,
112870
+ label: BooleanConfigName[BooleanConfig.NO]()
112871
+ }, {
112872
+ value: BooleanConfig.YES,
112873
+ label: BooleanConfigName[BooleanConfig.YES]()
112874
+ }];
112875
+ };
112886
112876
  });
112887
112877
  function getSolutionNameFromSubSolution(solution) {
112888
112878
  if (solution === SubSolution.MWATest) {
@@ -112893,7 +112883,7 @@ function getSolutionNameFromSubSolution(solution) {
112893
112883
  }
112894
112884
  return solution;
112895
112885
  }
112896
- var _SolutionText, _SubSolutionText, _SolutionToolsMap, _SolutionGenerator, _SubSolutionGenerator, Solution, SubSolution, SolutionText, SubSolutionText, SolutionToolsMap, SolutionSchema, SubSolutionSchema, BaseGenerator, SolutionGenerator, SubSolutionGenerator, ChangesetGenerator, DependenceGenerator, EntryGenerator, ElectronGenerator, EslintGenerator;
112886
+ var _SolutionText, _SubSolutionText, _SolutionToolsMap, _SolutionGenerator, _SubSolutionGenerator, Solution, SubSolution, SolutionText, SubSolutionText, SolutionToolsMap, getSolutionSchema, getScenesSchema, BaseGenerator, SolutionGenerator, SubSolutionGenerator, ChangesetGenerator, DependenceGenerator, EntryGenerator, EslintGenerator;
112897
112887
  var init_solution = __esmMin(() => {
112898
112888
  init_toConsumableArray();
112899
112889
  init_defineProperty();
@@ -112926,114 +112916,64 @@ var init_solution = __esmMin(() => {
112926
112916
  return i18n.t(localeKeys.sub_solution.inner_module);
112927
112917
  }), _SubSolutionText);
112928
112918
  SolutionToolsMap = (_SolutionToolsMap = {}, _defineProperty(_SolutionToolsMap, Solution.MWA, "@modern-js/app-tools"), _defineProperty(_SolutionToolsMap, Solution.Module, "@modern-js/module-tools"), _defineProperty(_SolutionToolsMap, Solution.Monorepo, "@modern-js/monorepo-tools"), _SolutionToolsMap);
112929
- SolutionSchema = {
112930
- key: "solution_schema",
112931
- isObject: true,
112932
- items: [{
112933
- key: "solution",
112934
- label: function label() {
112935
- return i18n.t(localeKeys.solution.self);
112936
- },
112937
- type: ["string"],
112938
- mutualExclusion: true,
112939
- items: function items(_data, extra) {
112940
- var _extra$customPlugin, _extra$customPlugin$c;
112941
- var items5 = ((extra === null || extra === void 0 ? void 0 : extra.solutions) || Object.values(Solution)).filter(function(solution) {
112942
- return !(extra !== null && extra !== void 0 && extra.isSubProject && solution === Solution.Monorepo);
112943
- }).map(function(solution) {
112944
- return {
112945
- key: solution,
112946
- label: SolutionText[solution]
112947
- };
112948
- });
112949
- if (extra !== null && extra !== void 0 && (_extra$customPlugin = extra.customPlugin) !== null && _extra$customPlugin !== void 0 && (_extra$customPlugin$c = _extra$customPlugin.custom) !== null && _extra$customPlugin$c !== void 0 && _extra$customPlugin$c.length) {
112950
- return [].concat(_toConsumableArray(items5), [{
112951
- key: "custom",
112952
- label: i18n.t(localeKeys.solution.custom)
112953
- }]);
112954
- }
112955
- return items5;
112956
- }
112957
- }, {
112958
- key: "scenes",
112959
- label: function label2() {
112960
- return i18n.t(localeKeys.scenes.self);
112961
- },
112962
- type: ["string"],
112963
- mutualExclusion: true,
112964
- when: function when(data, extra) {
112965
- return (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[data.solution] && extra.customPlugin[data.solution].length > 0;
112966
- },
112967
- items: function items2(data, extra) {
112968
- var items5 = (extra !== null && extra !== void 0 && extra.customPlugin ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[data.solution]) || [] : []).map(function(plugin) {
112969
- return {
112970
- key: plugin.key,
112971
- label: plugin.name
112972
- };
112973
- });
112974
- if (data.solution && data.solution !== "custom") {
112975
- items5.unshift({
112976
- key: data.solution,
112977
- label: "".concat(SolutionText[data.solution](), "(").concat(i18n.t(localeKeys.solution["default"]), ")")
112978
- });
112919
+ getSolutionSchema = function getSolutionSchema2() {
112920
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
112921
+ return {
112922
+ type: "object",
112923
+ properties: {
112924
+ solution: {
112925
+ type: "string",
112926
+ title: extra.isMonorepo ? i18n.t(localeKeys.sub_solution.self) : i18n.t(localeKeys.solution.self),
112927
+ "enum": function() {
112928
+ var _extra$customPlugin, _extra$customPlugin$c;
112929
+ var items = ((extra === null || extra === void 0 ? void 0 : extra.solutions) || Object.values(extra !== null && extra !== void 0 && extra.isMonorepo ? SubSolution : Solution)).filter(function(solution) {
112930
+ return !(extra !== null && extra !== void 0 && extra.isSubProject && solution === Solution.Monorepo);
112931
+ }).map(function(solution) {
112932
+ return {
112933
+ value: solution,
112934
+ label: extra !== null && extra !== void 0 && extra.isMonorepo ? SubSolutionText[solution]() : SolutionText[solution]()
112935
+ };
112936
+ });
112937
+ if (extra !== null && extra !== void 0 && (_extra$customPlugin = extra.customPlugin) !== null && _extra$customPlugin !== void 0 && (_extra$customPlugin$c = _extra$customPlugin.custom) !== null && _extra$customPlugin$c !== void 0 && _extra$customPlugin$c.length) {
112938
+ return [].concat(_toConsumableArray(items), [{
112939
+ value: "custom",
112940
+ label: i18n.t(localeKeys.solution.custom)
112941
+ }]);
112942
+ }
112943
+ return items;
112944
+ }()
112979
112945
  }
112980
- return items5;
112981
112946
  }
112982
- }]
112947
+ };
112983
112948
  };
112984
- SubSolutionSchema = {
112985
- key: "sub_solution_schema",
112986
- isObject: true,
112987
- items: [{
112988
- key: "solution",
112989
- label: function label3() {
112990
- return i18n.t(localeKeys.sub_solution.self);
112991
- },
112992
- type: ["string"],
112993
- mutualExclusion: true,
112994
- items: function items3(_data, extra) {
112995
- var _extra$customPlugin2, _extra$customPlugin2$;
112996
- var items5 = Object.values(SubSolution).map(function(solution) {
112997
- return {
112998
- key: solution,
112999
- label: SubSolutionText[solution]
113000
- };
113001
- });
113002
- if (extra !== null && extra !== void 0 && (_extra$customPlugin2 = extra.customPlugin) !== null && _extra$customPlugin2 !== void 0 && (_extra$customPlugin2$ = _extra$customPlugin2.custom) !== null && _extra$customPlugin2$ !== void 0 && _extra$customPlugin2$.length) {
113003
- return [].concat(_toConsumableArray(items5), [{
113004
- key: "custom",
113005
- label: i18n.t(localeKeys.solution.custom)
113006
- }]);
113007
- }
113008
- return items5;
113009
- }
113010
- }, {
113011
- key: "scenes",
113012
- label: function label4() {
113013
- return i18n.t(localeKeys.scenes.self);
113014
- },
113015
- type: ["string"],
113016
- mutualExclusion: true,
113017
- when: function when2(data, extra) {
113018
- return (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[getSolutionNameFromSubSolution(data.solution)] && extra.customPlugin[getSolutionNameFromSubSolution(data.solution)].length > 0;
113019
- },
113020
- items: function items4(data, extra) {
113021
- var solution = getSolutionNameFromSubSolution(data.solution);
113022
- var items5 = (extra !== null && extra !== void 0 && extra.customPlugin ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[solution]) || [] : []).map(function(plugin) {
113023
- return {
113024
- key: plugin.key,
113025
- label: plugin.name
113026
- };
113027
- });
113028
- if (data.solution && data.solution !== "custom") {
113029
- items5.unshift({
113030
- key: data.solution,
113031
- label: "".concat(SubSolutionText[data.solution](), "(").concat(i18n.t(localeKeys.solution["default"]), ")")
113032
- });
112949
+ getScenesSchema = function getScenesSchema2() {
112950
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
112951
+ var hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[extra !== null && extra !== 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 && extra.isMonorepoSubProject ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
112952
+ return {
112953
+ type: "object",
112954
+ properties: hasPlugin ? {
112955
+ scenes: {
112956
+ type: "string",
112957
+ title: i18n.t(localeKeys.scenes.self),
112958
+ "enum": function() {
112959
+ var solution = extra !== null && extra !== void 0 && extra.isMonorepoSubProject ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution;
112960
+ var items = (extra !== null && extra !== void 0 && extra.customPlugin ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[solution]) || [] : []).map(function(plugin) {
112961
+ return {
112962
+ value: plugin.key,
112963
+ label: plugin.name
112964
+ };
112965
+ });
112966
+ if (solution && solution !== "custom") {
112967
+ items.unshift({
112968
+ value: solution,
112969
+ label: "".concat(extra !== null && extra !== void 0 && extra.isMonorepoSubProject ? SubSolutionText[solution]() : SolutionText[solution](), "(").concat(i18n.t(localeKeys.solution["default"]), ")")
112970
+ });
112971
+ }
112972
+ return items;
112973
+ }()
113033
112974
  }
113034
- return items5;
113035
- }
113036
- }]
112975
+ } : {}
112976
+ };
113037
112977
  };
113038
112978
  BaseGenerator = "@modern-js/base-generator";
113039
112979
  SolutionGenerator = (_SolutionGenerator = {}, _defineProperty(_SolutionGenerator, Solution.MWA, "@modern-js/mwa-generator"), _defineProperty(_SolutionGenerator, Solution.Module, "@modern-js/module-generator"), _defineProperty(_SolutionGenerator, Solution.Monorepo, "@modern-js/monorepo-generator"), _SolutionGenerator);
@@ -113041,10 +112981,9 @@ var init_solution = __esmMin(() => {
113041
112981
  ChangesetGenerator = "@modern-js/changeset-generator";
113042
112982
  DependenceGenerator = "@modern-js/dependence-generator";
113043
112983
  EntryGenerator = "@modern-js/entry-generator";
113044
- ElectronGenerator = "@modern-js/electron-generator";
113045
112984
  EslintGenerator = "@modern-js/eslint-generator";
113046
112985
  });
113047
- var _LanguageName, Language, LanguageName, LanguageSchema;
112986
+ var _LanguageName, Language, LanguageName, getLanguageSchema;
113048
112987
  var init_language = __esmMin(() => {
113049
112988
  init_defineProperty();
113050
112989
  init_locale2();
@@ -113052,27 +112991,22 @@ var init_language = __esmMin(() => {
113052
112991
  Language2["TS"] = "ts";
113053
112992
  Language2["JS"] = "js";
113054
112993
  })(Language || (Language = {}));
113055
- LanguageName = (_LanguageName = {}, _defineProperty(_LanguageName, Language.TS, function() {
113056
- return "TS";
113057
- }), _defineProperty(_LanguageName, Language.JS, function() {
113058
- return "ES6+";
113059
- }), _LanguageName);
113060
- LanguageSchema = {
113061
- key: "language",
113062
- type: ["string"],
113063
- label: function label5() {
113064
- return i18n.t(localeKeys.language.self);
113065
- },
113066
- mutualExclusion: true,
113067
- items: Object.values(Language).map(function(language) {
113068
- return {
113069
- key: language,
113070
- label: LanguageName[language]
113071
- };
113072
- })
112994
+ LanguageName = (_LanguageName = {}, _defineProperty(_LanguageName, Language.TS, "TS"), _defineProperty(_LanguageName, Language.JS, "ES6+"), _LanguageName);
112995
+ getLanguageSchema = function getLanguageSchema2() {
112996
+ var _extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
112997
+ return {
112998
+ type: "string",
112999
+ title: i18n.t(localeKeys.language.self),
113000
+ "enum": Object.values(Language).map(function(language) {
113001
+ return {
113002
+ value: language,
113003
+ label: LanguageName[language]
113004
+ };
113005
+ })
113006
+ };
113073
113007
  };
113074
113008
  });
113075
- var _PackageManagerName, PackageManager, PackageManagerName, PackageManagerSchema;
113009
+ var _PackageManagerName, PackageManager, PackageManagerName, getPackageManagerSchema;
113076
113010
  var init_package_manager = __esmMin(() => {
113077
113011
  init_defineProperty();
113078
113012
  init_locale2();
@@ -113081,94 +113015,83 @@ var init_package_manager = __esmMin(() => {
113081
113015
  PackageManager2["Yarn"] = "yarn";
113082
113016
  PackageManager2["Npm"] = "npm";
113083
113017
  })(PackageManager || (PackageManager = {}));
113084
- PackageManagerName = (_PackageManagerName = {}, _defineProperty(_PackageManagerName, PackageManager.Pnpm, function() {
113085
- return "pnpm";
113086
- }), _defineProperty(_PackageManagerName, PackageManager.Yarn, function() {
113087
- return "Yarn";
113088
- }), _defineProperty(_PackageManagerName, PackageManager.Npm, function() {
113089
- return "npm";
113090
- }), _PackageManagerName);
113091
- PackageManagerSchema = {
113092
- key: "packageManager",
113093
- type: ["string"],
113094
- label: function label6() {
113095
- return i18n.t(localeKeys.packageManager.self);
113096
- },
113097
- mutualExclusion: true,
113098
- when: function when3(_values, extra) {
113099
- return !(extra !== null && extra !== void 0 && extra.isMonorepoSubProject) && !(extra !== null && extra !== void 0 && extra.isSubProject);
113100
- },
113101
- items: Object.values(PackageManager).map(function(packageManager) {
113102
- return {
113103
- key: packageManager,
113104
- label: PackageManagerName[packageManager]
113105
- };
113106
- })
113018
+ PackageManagerName = (_PackageManagerName = {}, _defineProperty(_PackageManagerName, PackageManager.Pnpm, "pnpm"), _defineProperty(_PackageManagerName, PackageManager.Yarn, "Yarn"), _defineProperty(_PackageManagerName, PackageManager.Npm, "npm"), _PackageManagerName);
113019
+ getPackageManagerSchema = function getPackageManagerSchema2() {
113020
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113021
+ return {
113022
+ type: "string",
113023
+ title: i18n.t(localeKeys.packageManager.self),
113024
+ "enum": Object.values(PackageManager).filter(function(packageManager) {
113025
+ return (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
113026
+ }).map(function(packageManager) {
113027
+ return {
113028
+ value: packageManager,
113029
+ label: PackageManagerName[packageManager]
113030
+ };
113031
+ }),
113032
+ "x-reactions": [{
113033
+ dependencies: [],
113034
+ fulfill: {
113035
+ state: {
113036
+ visible: !(extra !== null && extra !== void 0 && extra.isMonorepoSubProject) && !(extra !== null && extra !== void 0 && extra.isSubProject)
113037
+ }
113038
+ }
113039
+ }]
113040
+ };
113107
113041
  };
113108
113042
  });
113109
- var PackageNameSchema;
113043
+ var getPackageNameSchema;
113110
113044
  var init_package_name = __esmMin(() => {
113111
113045
  init_locale2();
113112
- PackageNameSchema = {
113113
- key: "packageName",
113114
- label: function label7(_, extra) {
113115
- return extra !== null && extra !== void 0 && extra.isMonorepoSubProject ? i18n.t(localeKeys.packageName.sub_name) : i18n.t(localeKeys.packageName.self);
113116
- },
113117
- type: ["string"],
113118
- when: function when4(_, extra) {
113119
- return Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra !== null && extra !== void 0 && extra.isMwa);
113120
- },
113121
- validate: function validate2(value) {
113122
- if (!value) {
113123
- return {
113124
- success: false,
113125
- error: i18n.t(localeKeys.packageName.no_empty)
113126
- };
113046
+ getPackageNameSchema = function getPackageNameSchema2() {
113047
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113048
+ return {
113049
+ type: "string",
113050
+ title: extra !== null && extra !== void 0 && extra.isMonorepoSubProject ? i18n.t(localeKeys.packageName.sub_name) : i18n.t(localeKeys.packageName.self),
113051
+ "x-reactions": [{
113052
+ dependencies: [],
113053
+ fulfill: {
113054
+ state: {
113055
+ visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra !== null && extra !== void 0 && extra.isMwa)
113056
+ }
113057
+ }
113058
+ }],
113059
+ "x-validate": function xValidate(value) {
113060
+ if (!value) {
113061
+ return i18n.t(localeKeys.packageName.no_empty);
113062
+ }
113063
+ return "";
113127
113064
  }
113128
- return {
113129
- success: true
113130
- };
113131
- }
113065
+ };
113132
113066
  };
113133
113067
  });
113134
- var PackagePathRegex, PackagePathSchema;
113068
+ var PackagePathRegex, getPackagePathSchema;
113135
113069
  var init_package_path = __esmMin(() => {
113136
113070
  init_locale2();
113137
113071
  PackagePathRegex = new RegExp("^[a-z0-9]*[-_/]?([a-z0-9]*[-_]?[a-z0-9]*)*[-_/]?[a-z0-9-_]+$");
113138
- PackagePathSchema = {
113139
- key: "packagePath",
113140
- label: function label8() {
113141
- return i18n.t(localeKeys.packagePath.self);
113142
- },
113143
- type: ["string"],
113144
- when: function when5(_, extra) {
113145
- return Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject);
113146
- },
113147
- state: {
113148
- value: {
113149
- effectedByFields: ["packageName"],
113150
- action: function action2(data) {
113151
- return "".concat(data.packageName || "");
113072
+ getPackagePathSchema = function getPackagePathSchema2(extra) {
113073
+ return {
113074
+ type: "string",
113075
+ title: i18n.t(localeKeys.packagePath.self),
113076
+ "x-reactions": [{
113077
+ dependencies: ["packageName"],
113078
+ fulfill: {
113079
+ state: {
113080
+ value: "{{$deps[0]}}",
113081
+ visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
113082
+ }
113083
+ }
113084
+ }],
113085
+ "x-validate": function xValidate(value) {
113086
+ if (!value) {
113087
+ return i18n.t(localeKeys.packagePath.no_empty);
113152
113088
  }
113089
+ if (!PackagePathRegex.test(value)) {
113090
+ return i18n.t(localeKeys.packagePath.format);
113091
+ }
113092
+ return "";
113153
113093
  }
113154
- },
113155
- validate: function validate3(value) {
113156
- if (!value) {
113157
- return {
113158
- success: false,
113159
- error: i18n.t(localeKeys.packagePath.no_empty)
113160
- };
113161
- }
113162
- if (!PackagePathRegex.test(value)) {
113163
- return {
113164
- success: false,
113165
- error: i18n.t(localeKeys.packagePath.format)
113166
- };
113167
- }
113168
- return {
113169
- success: true
113170
- };
113171
- }
113094
+ };
113172
113095
  };
113173
113096
  });
113174
113097
  var init_common = __esmMin(() => {
@@ -113179,14 +113102,17 @@ var init_common = __esmMin(() => {
113179
113102
  init_package_name();
113180
113103
  init_package_path();
113181
113104
  });
113182
- var BaseSchemas, BaseSchema, BaseDefaultConfig;
113105
+ var getBaseSchema, BaseDefaultConfig;
113183
113106
  var init_project = __esmMin(() => {
113184
113107
  init_common();
113185
- BaseSchemas = [PackageManagerSchema];
113186
- BaseSchema = {
113187
- key: "base",
113188
- isObject: true,
113189
- items: BaseSchemas
113108
+ getBaseSchema = function getBaseSchema2() {
113109
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113110
+ return {
113111
+ type: "object",
113112
+ properties: {
113113
+ packageManager: getPackageManagerSchema(extra)
113114
+ }
113115
+ };
113190
113116
  };
113191
113117
  BaseDefaultConfig = {
113192
113118
  packageManager: PackageManager.Pnpm
@@ -113195,14 +113121,23 @@ var init_project = __esmMin(() => {
113195
113121
  var init_base = __esmMin(() => {
113196
113122
  init_project();
113197
113123
  });
113198
- var ModuleSchemas, ModuleSchema, ModuleDefaultConfig;
113124
+ var getModuleSchemaProperties, getModuleSchema, ModuleDefaultConfig;
113199
113125
  var init_project2 = __esmMin(() => {
113200
113126
  init_common();
113201
- ModuleSchemas = [PackageNameSchema, PackagePathSchema, LanguageSchema, PackageManagerSchema];
113202
- ModuleSchema = {
113203
- key: "module",
113204
- isObject: true,
113205
- items: ModuleSchemas
113127
+ getModuleSchemaProperties = function getModuleSchemaProperties2(extra) {
113128
+ return {
113129
+ packageName: getPackageNameSchema(extra),
113130
+ packagePath: getPackagePathSchema(extra),
113131
+ language: getLanguageSchema(extra),
113132
+ packageManager: getPackageManagerSchema(extra)
113133
+ };
113134
+ };
113135
+ getModuleSchema = function getModuleSchema2() {
113136
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113137
+ return {
113138
+ type: "object",
113139
+ properties: getModuleSchemaProperties(extra)
113140
+ };
113206
113141
  };
113207
113142
  ModuleDefaultConfig = {
113208
113143
  language: Language.TS,
@@ -113212,20 +113147,17 @@ var init_project2 = __esmMin(() => {
113212
113147
  var init_module = __esmMin(() => {
113213
113148
  init_project2();
113214
113149
  });
113215
- var MonorepoPackageManagerSchema, MonorepoSchemas, MonorepoSchema, MonorepoDefaultConfig;
113150
+ var getMonorepoSchema, MonorepoDefaultConfig;
113216
113151
  var init_project3 = __esmMin(() => {
113217
- init_objectSpread2();
113218
113152
  init_common();
113219
- MonorepoPackageManagerSchema = _objectSpread2(_objectSpread2({}, PackageManagerSchema), {}, {
113220
- items: PackageManagerSchema.items.filter(function(item) {
113221
- return item.key !== PackageManager.Npm;
113222
- })
113223
- });
113224
- MonorepoSchemas = [MonorepoPackageManagerSchema];
113225
- MonorepoSchema = {
113226
- key: "monorepo",
113227
- isObject: true,
113228
- items: MonorepoSchemas
113153
+ getMonorepoSchema = function getMonorepoSchema2() {
113154
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113155
+ return {
113156
+ type: "object",
113157
+ properties: {
113158
+ packageManager: getPackageManagerSchema(extra)
113159
+ }
113160
+ };
113229
113161
  };
113230
113162
  MonorepoDefaultConfig = {
113231
113163
  packageManager: PackageManager.Pnpm
@@ -113234,75 +113166,45 @@ var init_project3 = __esmMin(() => {
113234
113166
  var init_monorepo = __esmMin(() => {
113235
113167
  init_project3();
113236
113168
  });
113237
- var _FrameworkAppendTypeC, mwaConfigWhenFunc, RunWay, RunWaySchema, ClientRoute, ClientRouteSchema, NeedModifyMWAConfigSchema, Framework, FrameworkSchema, FrameworkAppendTypeContent;
113169
+ var _FrameworkAppendTypeC, ClientRoute, getClientRouteSchema, getNeedModifyMWAConfigSchema, Framework, getFrameworkSchema, FrameworkAppendTypeContent;
113238
113170
  var init_common2 = __esmMin(() => {
113239
113171
  init_defineProperty();
113240
113172
  init_locale2();
113241
113173
  init_boolean();
113242
- mwaConfigWhenFunc = function mwaConfigWhenFunc2(values) {
113243
- return values.needModifyMWAConfig === BooleanConfig.YES;
113244
- };
113245
- (function(RunWay2) {
113246
- RunWay2["No"] = "no";
113247
- RunWay2["Electron"] = "electron";
113248
- })(RunWay || (RunWay = {}));
113249
- RunWaySchema = {
113250
- key: "runWay",
113251
- type: ["string"],
113252
- label: function label9() {
113253
- return i18n.t(localeKeys.runWay.self);
113254
- },
113255
- mutualExclusion: true,
113256
- when: function when6(_, extra) {
113257
- return (extra === null || extra === void 0 ? void 0 : extra.isEmptySrc) === void 0 ? true : Boolean(extra === null || extra === void 0 ? void 0 : extra.isEmptySrc);
113258
- },
113259
- state: {
113260
- value: RunWay.No
113261
- },
113262
- items: Object.values(RunWay).map(function(runWay) {
113263
- return {
113264
- key: runWay,
113265
- label: function label21() {
113266
- return i18n.t(localeKeys.runWay[runWay]);
113267
- }
113268
- };
113269
- })
113270
- };
113271
113174
  (function(ClientRoute2) {
113272
113175
  ClientRoute2["SelfControlRoute"] = "selfControlRoute";
113273
113176
  ClientRoute2["ConventionalRoute"] = "conventionalRoute";
113274
113177
  })(ClientRoute || (ClientRoute = {}));
113275
- ClientRouteSchema = {
113276
- key: "clientRoute",
113277
- type: ["string"],
113278
- label: function label10() {
113279
- return i18n.t(localeKeys.entry.clientRoute.self);
113280
- },
113281
- mutualExclusion: true,
113282
- when: mwaConfigWhenFunc,
113283
- state: {
113284
- value: ClientRoute.SelfControlRoute
113285
- },
113286
- items: Object.values(ClientRoute).map(function(clientRoute) {
113287
- return {
113288
- key: clientRoute,
113289
- label: function label21() {
113290
- return i18n.t(localeKeys.entry.clientRoute[clientRoute]);
113178
+ getClientRouteSchema = function getClientRouteSchema2() {
113179
+ var _extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113180
+ return {
113181
+ type: "string",
113182
+ title: i18n.t(localeKeys.entry.clientRoute.self),
113183
+ "default": ClientRoute.SelfControlRoute,
113184
+ "enum": Object.values(ClientRoute).map(function(clientRoute) {
113185
+ return {
113186
+ value: clientRoute,
113187
+ label: i18n.t(localeKeys.entry.clientRoute[clientRoute])
113188
+ };
113189
+ }),
113190
+ "x-reactions": [{
113191
+ dependencies: ["needModifyMWAConfig"],
113192
+ fulfill: {
113193
+ state: {
113194
+ visible: '{{$deps[0]=== "'.concat(BooleanConfig.YES, '"}}')
113195
+ }
113291
113196
  }
113292
- };
113293
- })
113197
+ }]
113198
+ };
113294
113199
  };
113295
- NeedModifyMWAConfigSchema = {
113296
- key: "needModifyMWAConfig",
113297
- label: function label11() {
113298
- return i18n.t(localeKeys.entry.needModifyConfig);
113299
- },
113300
- type: ["string"],
113301
- mutualExclusion: true,
113302
- state: {
113303
- value: BooleanConfig.NO
113304
- },
113305
- items: BooleanSchemas
113200
+ getNeedModifyMWAConfigSchema = function getNeedModifyMWAConfigSchema2() {
113201
+ var _extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113202
+ return {
113203
+ type: "string",
113204
+ title: i18n.t(localeKeys.entry.needModifyConfig),
113205
+ "default": BooleanConfig.NO,
113206
+ "enum": getBooleanSchemas()
113207
+ };
113306
113208
  };
113307
113209
  (function(Framework2) {
113308
113210
  Framework2["Express"] = "express";
@@ -113310,77 +113212,71 @@ var init_common2 = __esmMin(() => {
113310
113212
  Framework2["Egg"] = "egg";
113311
113213
  Framework2["Nest"] = "nest";
113312
113214
  })(Framework || (Framework = {}));
113313
- FrameworkSchema = {
113314
- key: "framework",
113315
- type: ["string"],
113316
- label: function label12() {
113317
- return i18n.t(localeKeys.framework.self);
113318
- },
113319
- mutualExclusion: true,
113320
- items: Object.values(Framework).map(function(framework) {
113321
- return {
113322
- key: framework,
113323
- label: function label21() {
113324
- return i18n.t(localeKeys.framework[framework]);
113325
- }
113326
- };
113327
- })
113215
+ getFrameworkSchema = function getFrameworkSchema2() {
113216
+ var _extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113217
+ return {
113218
+ type: "string",
113219
+ title: i18n.t(localeKeys.framework.self),
113220
+ "enum": Object.values(Framework).map(function(framework) {
113221
+ return {
113222
+ value: framework,
113223
+ label: i18n.t(localeKeys.framework[framework])
113224
+ };
113225
+ })
113226
+ };
113328
113227
  };
113329
113228
  FrameworkAppendTypeContent = (_FrameworkAppendTypeC = {}, _defineProperty(_FrameworkAppendTypeC, Framework.Express, "/// <reference types='@modern-js/plugin-express/types' />"), _defineProperty(_FrameworkAppendTypeC, Framework.Koa, "/// <reference types='@modern-js/plugin-koa/types' />"), _defineProperty(_FrameworkAppendTypeC, Framework.Egg, "/// <reference types='@modern-js/plugin-egg/types' />"), _defineProperty(_FrameworkAppendTypeC, Framework.Nest, "/// <reference types='@modern-js/plugin-nest/types' />"), _FrameworkAppendTypeC);
113330
113229
  });
113331
- var EntryNameSchema, EntrySchemas, EntrySchema, MWADefaultEntryConfig;
113230
+ var getEntryNameSchema, getEntrySchemaProperties, getEntrySchema, MWADefaultEntryConfig;
113332
113231
  var init_entry = __esmMin(() => {
113333
113232
  init_locale2();
113334
113233
  init_common();
113335
113234
  init_common2();
113336
- EntryNameSchema = {
113337
- key: "name",
113338
- type: ["string"],
113339
- label: function label13() {
113340
- return i18n.t(localeKeys.entry.name);
113341
- },
113342
- state: {
113343
- value: "entry"
113344
- },
113345
- validate: function validate4(value) {
113346
- if (!value) {
113347
- return {
113348
- success: false,
113349
- error: i18n.t(localeKeys.entry.no_empty)
113350
- };
113351
- }
113352
- if (value === "pages") {
113353
- return {
113354
- success: false,
113355
- error: i18n.t(localeKeys.entry.no_pages)
113356
- };
113357
- }
113358
- return {
113359
- success: true
113360
- };
113361
- },
113362
- when: function when7(_values, extra) {
113363
- if (extra !== null && extra !== void 0 && extra.isEmptySrc) {
113364
- return false;
113365
- }
113366
- return true;
113367
- }
113235
+ getEntryNameSchema = function getEntryNameSchema2() {
113236
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113237
+ return {
113238
+ type: "string",
113239
+ title: i18n.t(localeKeys.entry.name),
113240
+ "default": "entry",
113241
+ "x-validate": function xValidate(value) {
113242
+ if (!value) {
113243
+ return i18n.t(localeKeys.entry.no_empty);
113244
+ }
113245
+ if (value === "pages") {
113246
+ return i18n.t(localeKeys.entry.no_pages);
113247
+ }
113248
+ return "";
113249
+ },
113250
+ "x-reactions": [{
113251
+ dependencies: [],
113252
+ fulfill: {
113253
+ state: {
113254
+ visible: !(extra !== null && extra !== void 0 && extra.isEmptySrc)
113255
+ }
113256
+ }
113257
+ }]
113258
+ };
113368
113259
  };
113369
- EntrySchemas = [EntryNameSchema, NeedModifyMWAConfigSchema, ClientRouteSchema];
113370
- EntrySchema = {
113371
- key: "entry",
113372
- label: function label14() {
113373
- return i18n.t(localeKeys.action.element.entry);
113374
- },
113375
- isObject: true,
113376
- items: EntrySchemas
113260
+ getEntrySchemaProperties = function getEntrySchemaProperties2(extra) {
113261
+ return {
113262
+ name: getEntryNameSchema(extra),
113263
+ needModifyMWAConfig: getNeedModifyMWAConfigSchema(extra),
113264
+ clientRoute: getClientRouteSchema(extra)
113265
+ };
113266
+ };
113267
+ getEntrySchema = function getEntrySchema2() {
113268
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113269
+ return {
113270
+ type: "object",
113271
+ properties: getEntrySchemaProperties(extra)
113272
+ };
113377
113273
  };
113378
113274
  MWADefaultEntryConfig = {
113379
113275
  needModifyMWAConfig: BooleanConfig.NO,
113380
113276
  clientRoute: ClientRoute.SelfControlRoute
113381
113277
  };
113382
113278
  });
113383
- var BFFType, BFFTypeSchema, BFFSchemas, BFFSchema, MWADefaultBffConfig;
113279
+ var BFFType, getBFFTypeSchema, getBFFchemaProperties, getBFFSchema, MWADefaultBffConfig;
113384
113280
  var init_bff = __esmMin(() => {
113385
113281
  init_locale2();
113386
113282
  init_common2();
@@ -113388,66 +113284,76 @@ var init_bff = __esmMin(() => {
113388
113284
  BFFType2["Func"] = "func";
113389
113285
  BFFType2["Framework"] = "framework";
113390
113286
  })(BFFType || (BFFType = {}));
113391
- BFFTypeSchema = {
113392
- key: "bffType",
113393
- type: ["string"],
113394
- label: function label15() {
113395
- return i18n.t(localeKeys.bff.bffType.self);
113396
- },
113397
- mutualExclusion: true,
113398
- items: Object.values(BFFType).map(function(bffType) {
113399
- return {
113400
- key: bffType,
113401
- label: function label21() {
113402
- return i18n.t(localeKeys.bff.bffType[bffType]);
113403
- }
113404
- };
113405
- })
113287
+ getBFFTypeSchema = function getBFFTypeSchema2() {
113288
+ var _extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113289
+ return {
113290
+ type: "string",
113291
+ title: i18n.t(localeKeys.bff.bffType.self),
113292
+ "enum": Object.values(BFFType).map(function(bffType) {
113293
+ return {
113294
+ value: bffType,
113295
+ label: i18n.t(localeKeys.bff.bffType[bffType])
113296
+ };
113297
+ })
113298
+ };
113406
113299
  };
113407
- BFFSchemas = [BFFTypeSchema, FrameworkSchema];
113408
- BFFSchema = {
113409
- key: "bff",
113410
- label: function label16() {
113411
- return i18n.t(localeKeys.action["function"].bff);
113412
- },
113413
- isObject: true,
113414
- items: BFFSchemas
113300
+ getBFFchemaProperties = function getBFFchemaProperties2(extra) {
113301
+ return {
113302
+ bffType: getBFFTypeSchema(extra),
113303
+ framework: getFrameworkSchema(extra)
113304
+ };
113305
+ };
113306
+ getBFFSchema = function getBFFSchema2() {
113307
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113308
+ return {
113309
+ type: "object",
113310
+ properties: getBFFchemaProperties(extra)
113311
+ };
113415
113312
  };
113416
113313
  MWADefaultBffConfig = {
113417
113314
  bffType: BFFType.Func,
113418
113315
  frameWork: Framework.Express
113419
113316
  };
113420
113317
  });
113421
- var MWASchemas, MWASchema, MWADefaultConfig;
113318
+ var getMWASchemaProperties, getMWASchema, MWADefaultConfig;
113422
113319
  var init_project4 = __esmMin(() => {
113423
113320
  init_common();
113424
113321
  init_common2();
113425
- MWASchemas = [PackageNameSchema, PackagePathSchema, LanguageSchema, PackageManagerSchema, RunWaySchema, NeedModifyMWAConfigSchema, ClientRouteSchema];
113426
- MWASchema = {
113427
- key: "mwa",
113428
- isObject: true,
113429
- items: MWASchemas
113322
+ getMWASchemaProperties = function getMWASchemaProperties2(extra) {
113323
+ return {
113324
+ packageName: getPackageNameSchema(extra),
113325
+ packagePath: getPackagePathSchema(extra),
113326
+ language: getLanguageSchema(extra),
113327
+ packageManager: getPackageManagerSchema(extra),
113328
+ needModifyMWAConfig: getNeedModifyMWAConfigSchema(extra),
113329
+ clientRoute: getClientRouteSchema(extra)
113330
+ };
113331
+ };
113332
+ getMWASchema = function getMWASchema2() {
113333
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113334
+ return {
113335
+ type: "object",
113336
+ properties: getMWASchemaProperties(extra)
113337
+ };
113430
113338
  };
113431
113339
  MWADefaultConfig = {
113432
113340
  language: Language.TS,
113433
113341
  packageManager: PackageManager.Pnpm,
113434
- runWay: RunWay.No,
113435
113342
  needModifyMWAConfig: BooleanConfig.NO,
113436
113343
  clientRoute: ClientRoute.SelfControlRoute
113437
113344
  };
113438
113345
  });
113439
- var ServerSchemas, ServerSchema, MWADefaultServerConfig;
113346
+ var getServerSchema, MWADefaultServerConfig;
113440
113347
  var init_server = __esmMin(() => {
113441
- init_locale2();
113442
113348
  init_common2();
113443
- ServerSchemas = [FrameworkSchema];
113444
- ServerSchema = {
113445
- key: "server",
113446
- label: function label17() {
113447
- return i18n.t(localeKeys.action.element.server);
113448
- },
113449
- isObject: true,
113450
- items: ServerSchemas
113349
+ getServerSchema = function getServerSchema2() {
113350
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113351
+ return {
113352
+ type: "object",
113353
+ properties: {
113354
+ framework: getFrameworkSchema(extra)
113355
+ }
113356
+ };
113451
113357
  };
113452
113358
  MWADefaultServerConfig = {
113453
113359
  framework: Framework.Express
@@ -113479,7 +113385,6 @@ var init_common3 = __esmMin(() => {
113479
113385
  ActionFunction2["Sass"] = "sass";
113480
113386
  ActionFunction2["BFF"] = "bff";
113481
113387
  ActionFunction2["MicroFrontend"] = "micro_frontend";
113482
- ActionFunction2["Electron"] = "electron";
113483
113388
  ActionFunction2["I18n"] = "i18n";
113484
113389
  ActionFunction2["Test"] = "test";
113485
113390
  ActionFunction2["E2ETest"] = "e2e_test";
@@ -113515,8 +113420,6 @@ var init_common3 = __esmMin(() => {
113515
113420
  return i18n.t(localeKeys.action["function"].bff);
113516
113421
  }), _defineProperty(_ActionFunctionText, ActionFunction.MicroFrontend, function() {
113517
113422
  return i18n.t(localeKeys.action["function"].micro_frontend);
113518
- }), _defineProperty(_ActionFunctionText, ActionFunction.Electron, function() {
113519
- return i18n.t(localeKeys.action["function"].electron);
113520
113423
  }), _defineProperty(_ActionFunctionText, ActionFunction.I18n, function() {
113521
113424
  return i18n.t(localeKeys.action["function"].i18n);
113522
113425
  }), _defineProperty(_ActionFunctionText, ActionFunction.Test, function() {
@@ -113541,7 +113444,7 @@ var init_common3 = __esmMin(() => {
113541
113444
  });
113542
113445
  ActionTypeTextMap = (_ActionTypeTextMap = {}, _defineProperty(_ActionTypeTextMap, ActionType.Element, ActionElementText), _defineProperty(_ActionTypeTextMap, ActionType.Function, ActionFunctionText), _defineProperty(_ActionTypeTextMap, ActionType.Refactor, ActionRefactorText), _ActionTypeTextMap);
113543
113446
  });
113544
- var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap, MWASpecialSchemaMap, MWANewActionSchema, MWAActionFunctionsDevDependencies, MWAActionFunctionsDependencies, MWAActionFunctionsAppendTypeContent, MWANewActionGenerators;
113447
+ var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap, getMWANewActionSchema, MWAActionFunctionsDevDependencies, MWAActionFunctionsDependencies, MWAActionFunctionsAppendTypeContent, MWANewActionGenerators;
113545
113448
  var init_mwa2 = __esmMin(() => {
113546
113449
  init_defineProperty();
113547
113450
  init_common3();
@@ -113557,7 +113460,6 @@ var init_mwa2 = __esmMin(() => {
113557
113460
  ActionFunction.BFF,
113558
113461
  ActionFunction.SSG,
113559
113462
  ActionFunction.MicroFrontend,
113560
- ActionFunction.Electron,
113561
113463
  ActionFunction.Test,
113562
113464
  ActionFunction.Storybook,
113563
113465
  ActionFunction.Polyfill,
@@ -113566,44 +113468,72 @@ var init_mwa2 = __esmMin(() => {
113566
113468
  MWAActionElements = [ActionElement.Entry, ActionElement.Server];
113567
113469
  MWAActionReactors = [ActionRefactor.BFFToApp];
113568
113470
  MWAActionTypesMap = (_MWAActionTypesMap = {}, _defineProperty(_MWAActionTypesMap, ActionType.Element, MWAActionElements), _defineProperty(_MWAActionTypesMap, ActionType.Function, MWAActionFunctions), _defineProperty(_MWAActionTypesMap, ActionType.Refactor, MWAActionReactors), _MWAActionTypesMap);
113569
- MWASpecialSchemaMap = _defineProperty({}, ActionFunction.Storybook, {
113570
- key: ActionFunction.Storybook,
113571
- label: function label18() {
113572
- return i18n.t(localeKeys.action["function"].mwa_storybook);
113573
- }
113574
- });
113575
- MWANewActionSchema = {
113576
- key: "mwa_new_action",
113577
- isObject: true,
113578
- items: [{
113579
- key: "actionType",
113580
- label: function label19() {
113581
- return i18n.t(localeKeys.action.self);
113582
- },
113583
- type: ["string"],
113584
- mutualExclusion: true,
113585
- items: MWAActionTypes.map(function(type) {
113586
- return {
113587
- key: type,
113588
- label: ActionTypeText[type],
113589
- type: ["string"],
113590
- mutualExclusion: true,
113591
- items: MWAActionTypesMap[type].map(function(item) {
113592
- return MWASpecialSchemaMap[item] || {
113593
- key: item,
113594
- label: ActionTypeTextMap[type][item]
113471
+ getMWANewActionSchema = function getMWANewActionSchema2() {
113472
+ var _properties;
113473
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113474
+ var _extra$funcMap = extra.funcMap, funcMap = _extra$funcMap === void 0 ? {} : _extra$funcMap;
113475
+ var funcs = MWAActionFunctions.filter(function(func) {
113476
+ return !funcMap[func];
113477
+ });
113478
+ return {
113479
+ type: "object",
113480
+ properties: (_properties = {
113481
+ actionType: {
113482
+ type: "string",
113483
+ title: i18n.t(localeKeys.action.self),
113484
+ "enum": MWAActionTypes.filter(function(type) {
113485
+ return type === ActionType.Function ? funcs.length > 0 : true;
113486
+ }).map(function(type) {
113487
+ return {
113488
+ value: type,
113489
+ label: ActionTypeText[type](),
113490
+ type: ["string"]
113595
113491
  };
113596
113492
  })
113597
- };
113598
- })
113599
- }]
113493
+ }
113494
+ }, _defineProperty(_properties, ActionType.Element, {
113495
+ type: "string",
113496
+ title: ActionTypeText[ActionType.Element](),
113497
+ "enum": MWAActionElements.map(function(element) {
113498
+ return {
113499
+ value: element,
113500
+ label: ActionElementText[element]()
113501
+ };
113502
+ }),
113503
+ "x-reactions": [{
113504
+ dependencies: ["actionType"],
113505
+ fulfill: {
113506
+ state: {
113507
+ visible: '{{$deps[0] === "element"}}'
113508
+ }
113509
+ }
113510
+ }]
113511
+ }), _defineProperty(_properties, ActionType.Function, {
113512
+ type: "string",
113513
+ title: ActionTypeText[ActionType.Function](),
113514
+ "enum": funcs.map(function(func) {
113515
+ return {
113516
+ value: func,
113517
+ label: func === ActionFunction.Storybook ? i18n.t(localeKeys.action["function"].mwa_storybook) : ActionFunctionText[func]()
113518
+ };
113519
+ }),
113520
+ "x-reactions": [{
113521
+ dependencies: ["actionType"],
113522
+ fulfill: {
113523
+ state: {
113524
+ visible: '{{$deps[0] === "function"}}'
113525
+ }
113526
+ }
113527
+ }]
113528
+ }), _properties)
113529
+ };
113600
113530
  };
113601
- MWAActionFunctionsDevDependencies = (_MWAActionFunctionsDe = {}, _defineProperty(_MWAActionFunctionsDe, ActionFunction.Less, "@modern-js/plugin-less"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Sass, "@modern-js/plugin-sass"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.SSG, "@modern-js/plugin-ssg"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Test, "@modern-js/plugin-testing"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.E2ETest, "@modern-js/plugin-e2e"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Electron, "@modern-js/plugin-electron"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Storybook, "@modern-js/plugin-storybook"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Proxy, "@modern-js/plugin-proxy"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.TailwindCSS, "tailwindcss"), _MWAActionFunctionsDe);
113531
+ MWAActionFunctionsDevDependencies = (_MWAActionFunctionsDe = {}, _defineProperty(_MWAActionFunctionsDe, ActionFunction.Less, "@modern-js/plugin-less"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Sass, "@modern-js/plugin-sass"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.SSG, "@modern-js/plugin-ssg"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Test, "@modern-js/plugin-testing"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.E2ETest, "@modern-js/plugin-e2e"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Storybook, "@modern-js/plugin-storybook"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Proxy, "@modern-js/plugin-proxy"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.TailwindCSS, "tailwindcss"), _MWAActionFunctionsDe);
113602
113532
  MWAActionFunctionsDependencies = (_MWAActionFunctionsDe2 = {}, _defineProperty(_MWAActionFunctionsDe2, ActionFunction.BFF, "@modern-js/plugin-bff"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.MicroFrontend, "@modern-js/plugin-garfish"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.I18n, "@modern-js/plugin-i18n"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.TailwindCSS, "@modern-js/plugin-tailwindcss"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.Polyfill, "@modern-js/plugin-polyfill"), _MWAActionFunctionsDe2);
113603
113533
  MWAActionFunctionsAppendTypeContent = _defineProperty({}, ActionFunction.MicroFrontend, "/// <reference types='@modern-js/plugin-garfish/types' />");
113604
- MWANewActionGenerators = (_MWANewActionGenerato = {}, _defineProperty(_MWANewActionGenerato, ActionType.Element, (_ActionType$Element = {}, _defineProperty(_ActionType$Element, ActionElement.Entry, "@modern-js/entry-generator"), _defineProperty(_ActionType$Element, ActionElement.Server, "@modern-js/server-generator"), _ActionType$Element)), _defineProperty(_MWANewActionGenerato, ActionType.Function, (_ActionType$Function = {}, _defineProperty(_ActionType$Function, ActionFunction.TailwindCSS, "@modern-js/tailwindcss-generator"), _defineProperty(_ActionType$Function, ActionFunction.Less, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Sass, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.BFF, "@modern-js/bff-generator"), _defineProperty(_ActionType$Function, ActionFunction.MicroFrontend, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Electron, "@modern-js/electron-generator"), _defineProperty(_ActionType$Function, ActionFunction.I18n, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Test, "@modern-js/test-generator"), _defineProperty(_ActionType$Function, ActionFunction.E2ETest, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Doc, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Storybook, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.SSG, "@modern-js/ssg-generator"), _defineProperty(_ActionType$Function, ActionFunction.Polyfill, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Proxy, "@modern-js/dependence-generator"), _ActionType$Function)), _defineProperty(_MWANewActionGenerato, ActionType.Refactor, _defineProperty({}, ActionRefactor.BFFToApp, "@modern-js/bff-refactor-generator")), _MWANewActionGenerato);
113534
+ MWANewActionGenerators = (_MWANewActionGenerato = {}, _defineProperty(_MWANewActionGenerato, ActionType.Element, (_ActionType$Element = {}, _defineProperty(_ActionType$Element, ActionElement.Entry, "@modern-js/entry-generator"), _defineProperty(_ActionType$Element, ActionElement.Server, "@modern-js/server-generator"), _ActionType$Element)), _defineProperty(_MWANewActionGenerato, ActionType.Function, (_ActionType$Function = {}, _defineProperty(_ActionType$Function, ActionFunction.TailwindCSS, "@modern-js/tailwindcss-generator"), _defineProperty(_ActionType$Function, ActionFunction.Less, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Sass, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.BFF, "@modern-js/bff-generator"), _defineProperty(_ActionType$Function, ActionFunction.MicroFrontend, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.I18n, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Test, "@modern-js/test-generator"), _defineProperty(_ActionType$Function, ActionFunction.E2ETest, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Doc, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Storybook, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.SSG, "@modern-js/ssg-generator"), _defineProperty(_ActionType$Function, ActionFunction.Polyfill, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Proxy, "@modern-js/dependence-generator"), _ActionType$Function)), _defineProperty(_MWANewActionGenerato, ActionType.Refactor, _defineProperty({}, ActionRefactor.BFFToApp, "@modern-js/bff-refactor-generator")), _MWANewActionGenerato);
113605
113535
  });
113606
- var _ModuleActionFunction, _ModuleActionFunction2, _ModuleActionFunction3, _ActionType$Function2, ModuleActionTypes, ModuleActionFunctions, ModuleActionTypesMap, ModuleSpecialSchemaMap, ModuleNewActionSchema, ModuleActionFunctionsDevDependencies, ModuleActionFunctionsPeerDependencies, ModuleActionFunctionsDependencies, ModuleNewActionGenerators;
113536
+ var _ModuleActionFunction, _ModuleActionFunction2, _ModuleActionFunction3, _ActionType$Function2, ModuleActionTypes, ModuleActionFunctions, ModuleActionTypesMap, ModuleSpecialSchemaMap, getModuleNewActionSchema, ModuleActionFunctionsDevDependencies, ModuleActionFunctionsPeerDependencies, ModuleActionFunctionsDependencies, ModuleNewActionGenerators;
113607
113537
  var init_module2 = __esmMin(() => {
113608
113538
  init_defineProperty();
113609
113539
  init_common3();
@@ -113618,45 +113548,62 @@ var init_module2 = __esmMin(() => {
113618
113548
  ];
113619
113549
  ModuleActionTypesMap = _defineProperty({}, ActionType.Function, ModuleActionFunctions);
113620
113550
  ModuleSpecialSchemaMap = {};
113621
- ModuleNewActionSchema = {
113622
- key: "Module_new_action",
113623
- isObject: true,
113624
- items: [{
113625
- key: "actionType",
113626
- label: function label20() {
113627
- return i18n.t(localeKeys.action.self);
113628
- },
113629
- type: ["string"],
113630
- mutualExclusion: true,
113631
- items: ModuleActionTypes.map(function(type) {
113632
- return {
113633
- key: type,
113634
- label: ActionTypeText[type],
113635
- type: ["string"],
113636
- mutualExclusion: true,
113637
- items: ModuleActionFunctions.map(function(func) {
113638
- return ModuleSpecialSchemaMap[func] || {
113639
- key: func,
113640
- label: ActionFunctionText[func]
113551
+ getModuleNewActionSchema = function getModuleNewActionSchema2() {
113552
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113553
+ var _extra$funcMap = extra.funcMap, funcMap = _extra$funcMap === void 0 ? {} : _extra$funcMap;
113554
+ return {
113555
+ type: "object",
113556
+ properties: _defineProperty({
113557
+ actionType: {
113558
+ type: "string",
113559
+ title: i18n.t(localeKeys.action.self),
113560
+ "enum": ModuleActionTypes.map(function(type) {
113561
+ return {
113562
+ value: type,
113563
+ label: ActionTypeText[type](),
113564
+ type: ["string"]
113641
113565
  };
113642
113566
  })
113643
- };
113567
+ }
113568
+ }, ActionType.Function, {
113569
+ type: "string",
113570
+ title: ActionTypeText[ActionType.Function](),
113571
+ "enum": ModuleActionFunctions.filter(function(func) {
113572
+ return !funcMap[func];
113573
+ }).map(function(func) {
113574
+ return {
113575
+ value: func,
113576
+ label: ActionFunctionText[func]()
113577
+ };
113578
+ }),
113579
+ "x-reactions": [{
113580
+ dependencies: ["actionType"],
113581
+ fulfill: {
113582
+ state: {
113583
+ visible: '{{$deps[0] === "function"}}'
113584
+ }
113585
+ }
113586
+ }]
113644
113587
  })
113645
- }]
113588
+ };
113646
113589
  };
113647
113590
  ModuleActionFunctionsDevDependencies = (_ModuleActionFunction = {}, _defineProperty(_ModuleActionFunction, ActionFunction.Less, "@modern-js/plugin-less"), _defineProperty(_ModuleActionFunction, ActionFunction.Sass, "@modern-js/plugin-sass"), _defineProperty(_ModuleActionFunction, ActionFunction.Storybook, "@modern-js/plugin-storybook"), _defineProperty(_ModuleActionFunction, ActionFunction.RuntimeApi, "@modern-js/runtime"), _defineProperty(_ModuleActionFunction, ActionFunction.TailwindCSS, "tailwindcss"), _ModuleActionFunction);
113648
113591
  ModuleActionFunctionsPeerDependencies = (_ModuleActionFunction2 = {}, _defineProperty(_ModuleActionFunction2, ActionFunction.RuntimeApi, "@modern-js/runtime"), _defineProperty(_ModuleActionFunction2, ActionFunction.TailwindCSS, "tailwindcss"), _ModuleActionFunction2);
113649
113592
  ModuleActionFunctionsDependencies = (_ModuleActionFunction3 = {}, _defineProperty(_ModuleActionFunction3, ActionFunction.I18n, "@modern-js/plugin-i18n"), _defineProperty(_ModuleActionFunction3, ActionFunction.TailwindCSS, "@modern-js/plugin-tailwindcss"), _ModuleActionFunction3);
113650
113593
  ModuleNewActionGenerators = _defineProperty({}, ActionType.Function, (_ActionType$Function2 = {}, _defineProperty(_ActionType$Function2, ActionFunction.TailwindCSS, "@modern-js/tailwindcss-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Less, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Sass, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.I18n, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Test, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Doc, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Storybook, "@modern-js/storybook-generator"), _defineProperty(_ActionType$Function2, ActionFunction.RuntimeApi, "@modern-js/dependence-generator"), _ActionType$Function2));
113651
113594
  });
113652
- var _MonorepoNewActionCon, MonorepoNewActionSchema, MonorepoNewActionConfig;
113595
+ var _MonorepoNewActionCon, getMonorepoNewActionSchema, MonorepoNewActionConfig;
113653
113596
  var init_monorepo2 = __esmMin(() => {
113654
113597
  init_defineProperty();
113655
113598
  init_common();
113656
- MonorepoNewActionSchema = {
113657
- key: "monorepo_new_action",
113658
- isObject: true,
113659
- items: [SubSolutionSchema]
113599
+ getMonorepoNewActionSchema = function getMonorepoNewActionSchema2() {
113600
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113601
+ return {
113602
+ type: "object",
113603
+ properties: {
113604
+ solution: getSolutionSchema(extra)
113605
+ }
113606
+ };
113660
113607
  };
113661
113608
  MonorepoNewActionConfig = (_MonorepoNewActionCon = {}, _defineProperty(_MonorepoNewActionCon, SubSolution.MWA, {
113662
113609
  isMonorepoSubProject: true,
@@ -113678,14 +113625,24 @@ var init_newAction = __esmMin(() => {
113678
113625
  init_module2();
113679
113626
  init_monorepo2();
113680
113627
  });
113681
- var GeneratorSchemas, GeneratorSchema, GeneratorDefaultConfig;
113628
+ var getGeneratorSchemaProperties, getGeneratorSchema, GeneratorDefaultConfig;
113682
113629
  var init_generator = __esmMin(() => {
113683
113630
  init_common();
113684
- GeneratorSchemas = [PackageNameSchema, PackagePathSchema, PackageManagerSchema, LanguageSchema];
113685
- GeneratorSchema = {
113686
- key: "generator-generator",
113687
- isObject: true,
113688
- items: Object.values(GeneratorSchemas)
113631
+ getGeneratorSchemaProperties = function getGeneratorSchemaProperties2() {
113632
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113633
+ return {
113634
+ packageName: getPackageNameSchema(extra),
113635
+ packagePath: getPackagePathSchema(extra),
113636
+ packageManager: getPackageManagerSchema(extra),
113637
+ language: getLanguageSchema(extra)
113638
+ };
113639
+ };
113640
+ getGeneratorSchema = function getGeneratorSchema2() {
113641
+ var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113642
+ return {
113643
+ type: "object",
113644
+ properties: getGeneratorSchemaProperties(extra)
113645
+ };
113689
113646
  };
113690
113647
  GeneratorDefaultConfig = {
113691
113648
  packageManager: PackageManager.Pnpm,
@@ -113706,34 +113663,20 @@ __export2(treeshaking_exports5, {
113706
113663
  ActionType: () => ActionType,
113707
113664
  ActionTypeText: () => ActionTypeText,
113708
113665
  ActionTypeTextMap: () => ActionTypeTextMap,
113709
- BFFSchema: () => BFFSchema,
113710
- BFFSchemas: () => BFFSchemas,
113711
113666
  BFFType: () => BFFType,
113712
- BFFTypeSchema: () => BFFTypeSchema,
113713
113667
  BaseDefaultConfig: () => BaseDefaultConfig,
113714
113668
  BaseGenerator: () => BaseGenerator,
113715
- BaseSchema: () => BaseSchema,
113716
- BaseSchemas: () => BaseSchemas,
113717
113669
  BooleanConfig: () => BooleanConfig,
113718
113670
  BooleanConfigName: () => BooleanConfigName,
113719
- BooleanSchemas: () => BooleanSchemas,
113720
113671
  ChangesetGenerator: () => ChangesetGenerator,
113721
113672
  ClientRoute: () => ClientRoute,
113722
- ClientRouteSchema: () => ClientRouteSchema,
113723
113673
  DependenceGenerator: () => DependenceGenerator,
113724
- ElectronGenerator: () => ElectronGenerator,
113725
113674
  EntryGenerator: () => EntryGenerator,
113726
- EntrySchema: () => EntrySchema,
113727
- EntrySchemas: () => EntrySchemas,
113728
113675
  EslintGenerator: () => EslintGenerator,
113729
113676
  Framework: () => Framework,
113730
113677
  FrameworkAppendTypeContent: () => FrameworkAppendTypeContent,
113731
- FrameworkSchema: () => FrameworkSchema,
113732
113678
  GeneratorDefaultConfig: () => GeneratorDefaultConfig,
113733
- GeneratorSchema: () => GeneratorSchema,
113734
113679
  Language: () => Language,
113735
- LanguageName: () => LanguageName,
113736
- LanguageSchema: () => LanguageSchema,
113737
113680
  MWAActionElements: () => MWAActionElements,
113738
113681
  MWAActionFunctions: () => MWAActionFunctions,
113739
113682
  MWAActionFunctionsAppendTypeContent: () => MWAActionFunctionsAppendTypeContent,
@@ -113747,10 +113690,6 @@ __export2(treeshaking_exports5, {
113747
113690
  MWADefaultEntryConfig: () => MWADefaultEntryConfig,
113748
113691
  MWADefaultServerConfig: () => MWADefaultServerConfig,
113749
113692
  MWANewActionGenerators: () => MWANewActionGenerators,
113750
- MWANewActionSchema: () => MWANewActionSchema,
113751
- MWASchema: () => MWASchema,
113752
- MWASchemas: () => MWASchemas,
113753
- MWASpecialSchemaMap: () => MWASpecialSchemaMap,
113754
113693
  ModuleActionFunctions: () => ModuleActionFunctions,
113755
113694
  ModuleActionFunctionsDependencies: () => ModuleActionFunctionsDependencies,
113756
113695
  ModuleActionFunctionsDevDependencies: () => ModuleActionFunctionsDevDependencies,
@@ -113759,40 +113698,51 @@ __export2(treeshaking_exports5, {
113759
113698
  ModuleActionTypesMap: () => ModuleActionTypesMap,
113760
113699
  ModuleDefaultConfig: () => ModuleDefaultConfig,
113761
113700
  ModuleNewActionGenerators: () => ModuleNewActionGenerators,
113762
- ModuleNewActionSchema: () => ModuleNewActionSchema,
113763
- ModuleSchema: () => ModuleSchema,
113764
- ModuleSchemas: () => ModuleSchemas,
113765
113701
  ModuleSpecialSchemaMap: () => ModuleSpecialSchemaMap,
113766
113702
  MonorepoDefaultConfig: () => MonorepoDefaultConfig,
113767
113703
  MonorepoNewActionConfig: () => MonorepoNewActionConfig,
113768
- MonorepoNewActionSchema: () => MonorepoNewActionSchema,
113769
- MonorepoSchema: () => MonorepoSchema,
113770
- MonorepoSchemas: () => MonorepoSchemas,
113771
- NeedModifyMWAConfigSchema: () => NeedModifyMWAConfigSchema,
113772
113704
  PackageManager: () => PackageManager,
113773
113705
  PackageManagerName: () => PackageManagerName,
113774
- PackageManagerSchema: () => PackageManagerSchema,
113775
- PackageNameSchema: () => PackageNameSchema,
113776
- PackagePathSchema: () => PackagePathSchema,
113777
- RunWay: () => RunWay,
113778
- RunWaySchema: () => RunWaySchema,
113779
- ServerSchema: () => ServerSchema,
113780
- ServerSchemas: () => ServerSchemas,
113781
113706
  Solution: () => Solution,
113782
113707
  SolutionDefaultConfig: () => SolutionDefaultConfig,
113783
113708
  SolutionGenerator: () => SolutionGenerator,
113784
- SolutionSchema: () => SolutionSchema,
113785
113709
  SolutionSchemas: () => SolutionSchemas,
113786
113710
  SolutionText: () => SolutionText,
113787
113711
  SolutionToolsMap: () => SolutionToolsMap,
113788
113712
  SubSolution: () => SubSolution,
113789
113713
  SubSolutionGenerator: () => SubSolutionGenerator,
113790
- SubSolutionSchema: () => SubSolutionSchema,
113791
113714
  SubSolutionText: () => SubSolutionText,
113715
+ getBFFSchema: () => getBFFSchema,
113716
+ getBFFTypeSchema: () => getBFFTypeSchema,
113717
+ getBFFchemaProperties: () => getBFFchemaProperties,
113718
+ getBaseSchema: () => getBaseSchema,
113719
+ getBooleanSchemas: () => getBooleanSchemas,
113720
+ getClientRouteSchema: () => getClientRouteSchema,
113721
+ getEntryNameSchema: () => getEntryNameSchema,
113722
+ getEntrySchema: () => getEntrySchema,
113723
+ getEntrySchemaProperties: () => getEntrySchemaProperties,
113724
+ getFrameworkSchema: () => getFrameworkSchema,
113725
+ getGeneratorSchema: () => getGeneratorSchema,
113726
+ getGeneratorSchemaProperties: () => getGeneratorSchemaProperties,
113727
+ getLanguageSchema: () => getLanguageSchema,
113728
+ getMWANewActionSchema: () => getMWANewActionSchema,
113729
+ getMWASchema: () => getMWASchema,
113730
+ getMWASchemaProperties: () => getMWASchemaProperties,
113731
+ getModuleNewActionSchema: () => getModuleNewActionSchema,
113732
+ getModuleSchema: () => getModuleSchema,
113733
+ getModuleSchemaProperties: () => getModuleSchemaProperties,
113734
+ getMonorepoNewActionSchema: () => getMonorepoNewActionSchema,
113735
+ getMonorepoSchema: () => getMonorepoSchema,
113736
+ getNeedModifyMWAConfigSchema: () => getNeedModifyMWAConfigSchema,
113737
+ getPackageManagerSchema: () => getPackageManagerSchema,
113738
+ getPackageNameSchema: () => getPackageNameSchema,
113739
+ getPackagePathSchema: () => getPackagePathSchema,
113740
+ getScenesSchema: () => getScenesSchema,
113741
+ getServerSchema: () => getServerSchema,
113792
113742
  getSolutionNameFromSubSolution: () => getSolutionNameFromSubSolution,
113743
+ getSolutionSchema: () => getSolutionSchema,
113793
113744
  i18n: () => i18n,
113794
- localeKeys: () => localeKeys,
113795
- mwaConfigWhenFunc: () => mwaConfigWhenFunc
113745
+ localeKeys: () => localeKeys
113796
113746
  });
113797
113747
  var _SolutionDefaultConfi, _SolutionSchemas, SolutionDefaultConfig, SolutionSchemas;
113798
113748
  var init_treeshaking5 = __esmMin(() => {
@@ -113811,7 +113761,7 @@ var init_treeshaking5 = __esmMin(() => {
113811
113761
  init_expand();
113812
113762
  init_base();
113813
113763
  SolutionDefaultConfig = (_SolutionDefaultConfi = {}, _defineProperty(_SolutionDefaultConfi, Solution.MWA, MWADefaultConfig), _defineProperty(_SolutionDefaultConfi, Solution.Module, ModuleDefaultConfig), _defineProperty(_SolutionDefaultConfi, Solution.Monorepo, MonorepoDefaultConfig), _SolutionDefaultConfi);
113814
- SolutionSchemas = (_SolutionSchemas = {}, _defineProperty(_SolutionSchemas, Solution.MWA, MWASchemas), _defineProperty(_SolutionSchemas, Solution.Module, ModuleSchemas), _defineProperty(_SolutionSchemas, Solution.Monorepo, MonorepoSchemas), _defineProperty(_SolutionSchemas, "custom", BaseSchemas), _SolutionSchemas);
113764
+ SolutionSchemas = (_SolutionSchemas = {}, _defineProperty(_SolutionSchemas, Solution.MWA, getMWASchema), _defineProperty(_SolutionSchemas, Solution.Module, getModuleSchema), _defineProperty(_SolutionSchemas, Solution.Monorepo, getMonorepoSchema), _defineProperty(_SolutionSchemas, "custom", getBaseSchema), _SolutionSchemas);
113815
113765
  });
113816
113766
  var require_import_lazy2 = __commonJSMin((exports, module2) => {
113817
113767
  (() => {
@@ -142991,13 +142941,13 @@ var require_logger4 = __commonJSMin((exports) => {
142991
142941
  if (LOG_LEVEL[type] > LOG_LEVEL[this.level]) {
142992
142942
  return;
142993
142943
  }
142994
- let label21 = "";
142944
+ let label = "";
142995
142945
  let text = "";
142996
142946
  const logType = this.types[type];
142997
142947
  if (this.config.displayLabel && logType.label) {
142998
- label21 = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
142999
- label21 = label21.padEnd(this.longestLabel.length);
143000
- label21 = chalk_1.default.bold(logType.color ? chalk_1.default[logType.color](label21) : label21);
142948
+ label = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
142949
+ label = label.padEnd(this.longestLabel.length);
142950
+ label = chalk_1.default.bold(logType.color ? chalk_1.default[logType.color](label) : label);
143001
142951
  }
143002
142952
  if (message instanceof Error) {
143003
142953
  if (message.stack) {
@@ -143010,15 +142960,15 @@ ${chalk_1.default.grey(rest.join("\n"))}`;
143010
142960
  } else {
143011
142961
  text = `${message}`;
143012
142962
  }
143013
- const log = label21.length > 0 ? `${label21} ${text}` : text;
142963
+ const log = label.length > 0 ? `${label} ${text}` : text;
143014
142964
  console.log(log, ...args);
143015
142965
  }
143016
142966
  getLongestLabel() {
143017
142967
  let longestLabel = "";
143018
142968
  Object.keys(this.types).forEach((type) => {
143019
- const { label: label21 = "" } = this.types[type];
143020
- if (label21.length > longestLabel.length) {
143021
- longestLabel = label21;
142969
+ const { label = "" } = this.types[type];
142970
+ if (label.length > longestLabel.length) {
142971
+ longestLabel = label;
143022
142972
  }
143023
142973
  });
143024
142974
  return longestLabel;
@@ -143240,10 +143190,10 @@ var require_type2 = __commonJSMin((exports) => {
143240
143190
  return Array.isArray(obj);
143241
143191
  }
143242
143192
  exports.isArray = isArray4;
143243
- function isFunction3(func) {
143193
+ function isFunction4(func) {
143244
143194
  return typeof func === "function";
143245
143195
  }
143246
- exports.isFunction = isFunction3;
143196
+ exports.isFunction = isFunction4;
143247
143197
  function isObject5(obj) {
143248
143198
  return obj !== null && typeof obj === "object";
143249
143199
  }
@@ -143335,17 +143285,23 @@ var require_compatRequire2 = __commonJSMin((exports) => {
143335
143285
  Object.defineProperty(exports, "__esModule", { value: true });
143336
143286
  exports.cleanRequireCache = exports.requireExistModule = exports.compatRequire = void 0;
143337
143287
  var findExists_1 = require_findExists2();
143338
- var compatRequire = (filePath) => {
143288
+ var compatRequire = (filePath, interop = true) => {
143339
143289
  const mod = __require(filePath);
143340
- return (mod === null || mod === void 0 ? void 0 : mod.__esModule) ? mod.default : mod;
143290
+ const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
143291
+ return rtnESMDefault ? mod.default : mod;
143341
143292
  };
143342
143293
  exports.compatRequire = compatRequire;
143343
- var requireExistModule = (filename, extensions = [".ts", ".js"]) => {
143344
- const exist = (0, findExists_1.findExists)(extensions.map((ext) => `${filename}${ext}`));
143294
+ var requireExistModule = (filename, opt) => {
143295
+ const final = {
143296
+ extensions: [".ts", ".js"],
143297
+ interop: true,
143298
+ ...opt
143299
+ };
143300
+ const exist = (0, findExists_1.findExists)(final.extensions.map((ext) => `${filename}${ext}`));
143345
143301
  if (!exist) {
143346
143302
  return null;
143347
143303
  }
143348
- return (0, exports.compatRequire)(exist);
143304
+ return (0, exports.compatRequire)(exist, final.interop);
143349
143305
  };
143350
143306
  exports.requireExistModule = requireExistModule;
143351
143307
  var cleanRequireCache = (filelist) => {
@@ -143378,6 +143334,7 @@ var require_constants6 = __commonJSMin((exports) => {
143378
143334
  "@modern-js/app-tools": { cli: "@modern-js/app-tools/cli" },
143379
143335
  "@modern-js/monorepo-tools": { cli: "@modern-js/monorepo-tools/cli" },
143380
143336
  "@modern-js/module-tools": { cli: "@modern-js/module-tools/cli" },
143337
+ "@modern-js/module-tools-v2": { cli: "@modern-js/module-tools-v2" },
143381
143338
  "@modern-js/runtime": { cli: "@modern-js/runtime/cli" },
143382
143339
  "@modern-js/plugin-less": { cli: "@modern-js/plugin-less/cli" },
143383
143340
  "@modern-js/plugin-sass": { cli: "@modern-js/plugin-sass/cli" },
@@ -143420,7 +143377,10 @@ var require_constants6 = __commonJSMin((exports) => {
143420
143377
  cli: "@modern-js/plugin-polyfill/cli",
143421
143378
  server: "@modern-js/plugin-polyfill"
143422
143379
  },
143423
- "@modern-js/plugin-nocode": { cli: "@modern-js/plugin-nocode/cli" }
143380
+ "@modern-js/plugin-nocode": { cli: "@modern-js/plugin-nocode/cli" },
143381
+ "@modern-js/plugin-router-legacy": {
143382
+ cli: "@modern-js/plugin-router-legacy/cli"
143383
+ }
143424
143384
  };
143425
143385
  exports.PLUGIN_SCHEMAS = {
143426
143386
  "@modern-js/runtime": [
@@ -144531,7 +144491,7 @@ var require_chainId2 = __commonJSMin((exports) => {
144531
144491
  }
144532
144492
  };
144533
144493
  });
144534
- var require_version = __commonJSMin((exports) => {
144494
+ var require_version2 = __commonJSMin((exports) => {
144535
144495
  "use strict";
144536
144496
  var __importDefault = exports && exports.__importDefault || function(mod) {
144537
144497
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -144621,7 +144581,7 @@ var require_dist2 = __commonJSMin((exports) => {
144621
144581
  __exportStar(require_tryResolve2(), exports);
144622
144582
  __exportStar(require_analyzeProject2(), exports);
144623
144583
  __exportStar(require_chainId2(), exports);
144624
- __exportStar(require_version(), exports);
144584
+ __exportStar(require_version2(), exports);
144625
144585
  });
144626
144586
  var require_strip_ansi4 = __commonJSMin((exports) => {
144627
144587
  "use strict";
@@ -146041,23 +146001,23 @@ var require_utils15 = __commonJSMin((exports) => {
146041
146001
  }
146042
146002
  };
146043
146003
  exports.readJson = readJson;
146044
- function hasEnabledFunction(action3, dependencies3, devDependencies3, peerDependencies, cwd) {
146004
+ function hasEnabledFunction(action2, dependencies3, devDependencies3, peerDependencies, cwd) {
146045
146005
  const packageJsonPath = _path.default.normalize(`${cwd}/package.json`);
146046
146006
  const packageJson = readJson(packageJsonPath);
146047
- if (!dependencies3[action3] && !devDependencies3[action3]) {
146007
+ if (!dependencies3[action2] && !devDependencies3[action2]) {
146048
146008
  return false;
146049
146009
  }
146050
- if (dependencies3[action3]) {
146010
+ if (dependencies3[action2]) {
146051
146011
  var _packageJson$dependen;
146052
- return (_packageJson$dependen = packageJson.dependencies) === null || _packageJson$dependen === void 0 ? void 0 : _packageJson$dependen[dependencies3[action3]];
146012
+ return (_packageJson$dependen = packageJson.dependencies) === null || _packageJson$dependen === void 0 ? void 0 : _packageJson$dependen[dependencies3[action2]];
146053
146013
  }
146054
- if (peerDependencies[action3]) {
146014
+ if (peerDependencies[action2]) {
146055
146015
  var _packageJson$peerDepe;
146056
- return (_packageJson$peerDepe = packageJson.peerDependencies) === null || _packageJson$peerDepe === void 0 ? void 0 : _packageJson$peerDepe[peerDependencies[action3]];
146016
+ return (_packageJson$peerDepe = packageJson.peerDependencies) === null || _packageJson$peerDepe === void 0 ? void 0 : _packageJson$peerDepe[peerDependencies[action2]];
146057
146017
  }
146058
- if (!peerDependencies[action3] && devDependencies3[action3]) {
146018
+ if (!peerDependencies[action2] && devDependencies3[action2]) {
146059
146019
  var _packageJson$devDepen;
146060
- return (_packageJson$devDepen = packageJson.devDependencies) === null || _packageJson$devDepen === void 0 ? void 0 : _packageJson$devDepen[devDependencies3[action3]];
146020
+ return (_packageJson$devDepen = packageJson.devDependencies) === null || _packageJson$devDepen === void 0 ? void 0 : _packageJson$devDepen[devDependencies3[action2]];
146061
146021
  }
146062
146022
  return false;
146063
146023
  }
@@ -146082,6 +146042,35 @@ var require_mwa = __commonJSMin((exports) => {
146082
146042
  var _generatorCommon = (init_treeshaking5(), __toCommonJS2(treeshaking_exports5));
146083
146043
  var _generatorUtils = require_node9();
146084
146044
  var _utils = require_utils15();
146045
+ function ownKeys2(object, enumerableOnly) {
146046
+ var keys = Object.keys(object);
146047
+ if (Object.getOwnPropertySymbols) {
146048
+ var symbols = Object.getOwnPropertySymbols(object);
146049
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
146050
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
146051
+ })), keys.push.apply(keys, symbols);
146052
+ }
146053
+ return keys;
146054
+ }
146055
+ function _objectSpread(target) {
146056
+ for (var i = 1; i < arguments.length; i++) {
146057
+ var source = arguments[i] != null ? arguments[i] : {};
146058
+ i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
146059
+ _defineProperty2(target, key, source[key]);
146060
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
146061
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
146062
+ });
146063
+ }
146064
+ return target;
146065
+ }
146066
+ function _defineProperty2(obj, key, value) {
146067
+ if (key in obj) {
146068
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
146069
+ } else {
146070
+ obj[key] = value;
146071
+ }
146072
+ return obj;
146073
+ }
146085
146074
  var MWANewAction2 = async (options3) => {
146086
146075
  const {
146087
146076
  locale = "zh",
@@ -146118,19 +146107,17 @@ var require_mwa = __commonJSMin((exports) => {
146118
146107
  data: {},
146119
146108
  current: null
146120
146109
  }, mockGeneratorCore);
146121
- const schema = (0, _codesmithApiApp.forEach)(_generatorCommon.MWANewActionSchema, (schemaItem) => {
146122
- if (_generatorCommon.MWAActionFunctions.includes(schemaItem.key)) {
146123
- const enable = (0, _utils.hasEnabledFunction)(schemaItem.key, _generatorCommon.MWAActionFunctionsDependencies, _generatorCommon.MWAActionFunctionsDevDependencies, {}, cwd);
146124
- const {
146125
- when: when8
146126
- } = schemaItem;
146127
- schemaItem.when = enable ? () => false : when8;
146128
- }
146110
+ const funcMap = {};
146111
+ _generatorCommon.MWAActionFunctions.forEach((func) => {
146112
+ const enable = (0, _utils.hasEnabledFunction)(func, _generatorCommon.MWAActionFunctionsDependencies, _generatorCommon.MWAActionFunctionsDevDependencies, {}, cwd);
146113
+ funcMap[func] = enable;
146129
146114
  });
146130
- const ans = await appAPI.getInputBySchema(schema, UserConfig);
146115
+ const ans = await appAPI.getInputBySchemaFunc(_generatorCommon.getMWANewActionSchema, _objectSpread(_objectSpread({}, UserConfig), {}, {
146116
+ funcMap
146117
+ }));
146131
146118
  const actionType = ans.actionType;
146132
- const action3 = ans[actionType];
146133
- const generator = (0, _utils.getGeneratorPath)(_generatorCommon.MWANewActionGenerators[actionType][action3], distTag);
146119
+ const action2 = ans[actionType];
146120
+ const generator = (0, _utils.getGeneratorPath)(_generatorCommon.MWANewActionGenerators[actionType][action2], distTag);
146134
146121
  if (!generator) {
146135
146122
  throw new Error(`no valid option`);
146136
146123
  }
@@ -146139,8 +146126,8 @@ var require_mwa = __commonJSMin((exports) => {
146139
146126
  registry: registry2
146140
146127
  });
146141
146128
  };
146142
- const devDependency = _generatorCommon.MWAActionFunctionsDevDependencies[action3];
146143
- const dependency = _generatorCommon.MWAActionFunctionsDependencies[action3];
146129
+ const devDependency = _generatorCommon.MWAActionFunctionsDevDependencies[action2];
146130
+ const dependency = _generatorCommon.MWAActionFunctionsDependencies[action2];
146144
146131
  const finalConfig = (0, _lodash.merge)(UserConfig, ans, {
146145
146132
  locale: UserConfig.locale || locale,
146146
146133
  packageManager: UserConfig.packageManager || await (0, _generatorUtils.getPackageManager)(cwd)
@@ -146151,7 +146138,7 @@ var require_mwa = __commonJSMin((exports) => {
146151
146138
  dependencies: dependency ? {
146152
146139
  [dependency]: `${await getMwaPluginVersion(dependency)}`
146153
146140
  } : {},
146154
- appendTypeContent: _generatorCommon.MWAActionFunctionsAppendTypeContent[action3]
146141
+ appendTypeContent: _generatorCommon.MWAActionFunctionsAppendTypeContent[action2]
146155
146142
  });
146156
146143
  const task = [{
146157
146144
  name: generator,
@@ -146179,6 +146166,35 @@ var require_module = __commonJSMin((exports) => {
146179
146166
  var _generatorCommon = (init_treeshaking5(), __toCommonJS2(treeshaking_exports5));
146180
146167
  var _generatorUtils = require_node9();
146181
146168
  var _utils = require_utils15();
146169
+ function ownKeys2(object, enumerableOnly) {
146170
+ var keys = Object.keys(object);
146171
+ if (Object.getOwnPropertySymbols) {
146172
+ var symbols = Object.getOwnPropertySymbols(object);
146173
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
146174
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
146175
+ })), keys.push.apply(keys, symbols);
146176
+ }
146177
+ return keys;
146178
+ }
146179
+ function _objectSpread(target) {
146180
+ for (var i = 1; i < arguments.length; i++) {
146181
+ var source = arguments[i] != null ? arguments[i] : {};
146182
+ i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
146183
+ _defineProperty2(target, key, source[key]);
146184
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
146185
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
146186
+ });
146187
+ }
146188
+ return target;
146189
+ }
146190
+ function _defineProperty2(obj, key, value) {
146191
+ if (key in obj) {
146192
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
146193
+ } else {
146194
+ obj[key] = value;
146195
+ }
146196
+ return obj;
146197
+ }
146182
146198
  var ModuleNewAction2 = async (options3) => {
146183
146199
  const {
146184
146200
  locale = "zh",
@@ -146216,32 +146232,30 @@ var require_module = __commonJSMin((exports) => {
146216
146232
  current: null
146217
146233
  }, mockGeneratorCore);
146218
146234
  let hasOption = false;
146219
- const schema = (0, _codesmithApiApp.forEach)(_generatorCommon.ModuleNewActionSchema, (schemaItem) => {
146220
- if (_generatorCommon.ModuleActionFunctions.includes(schemaItem.key)) {
146221
- const enable = (0, _utils.hasEnabledFunction)(schemaItem.key, _generatorCommon.ModuleActionFunctionsDependencies, _generatorCommon.ModuleActionFunctionsDevDependencies, _generatorCommon.ModuleActionFunctionsPeerDependencies, cwd);
146222
- const {
146223
- when: when8
146224
- } = schemaItem;
146225
- schemaItem.when = enable ? () => false : when8;
146226
- if (!enable) {
146227
- hasOption = true;
146228
- }
146235
+ const funcMap = {};
146236
+ _generatorCommon.ModuleActionFunctions.forEach((func) => {
146237
+ const enable = (0, _utils.hasEnabledFunction)(func, _generatorCommon.ModuleActionFunctionsDependencies, _generatorCommon.ModuleActionFunctionsDevDependencies, _generatorCommon.ModuleActionFunctionsPeerDependencies, cwd);
146238
+ funcMap[func] = enable;
146239
+ if (!enable) {
146240
+ hasOption = true;
146229
146241
  }
146230
146242
  });
146231
146243
  if (!hasOption) {
146232
146244
  smith.logger.warn("no option can be enabled");
146233
146245
  process.exit(1);
146234
146246
  }
146235
- const ans = await appAPI.getInputBySchema(schema, UserConfig);
146247
+ const ans = await appAPI.getInputBySchemaFunc(_generatorCommon.getModuleNewActionSchema, _objectSpread(_objectSpread({}, UserConfig), {}, {
146248
+ funcMap
146249
+ }));
146236
146250
  const actionType = ans.actionType;
146237
- const action3 = ans[actionType];
146238
- const generator = (0, _utils.getGeneratorPath)(_generatorCommon.ModuleNewActionGenerators[actionType][action3], distTag);
146251
+ const action2 = ans[actionType];
146252
+ const generator = (0, _utils.getGeneratorPath)(_generatorCommon.ModuleNewActionGenerators[actionType][action2], distTag);
146239
146253
  if (!generator) {
146240
146254
  throw new Error(`no valid option`);
146241
146255
  }
146242
- const devDependency = _generatorCommon.ModuleActionFunctionsDevDependencies[action3];
146243
- const dependency = _generatorCommon.ModuleActionFunctionsDependencies[action3];
146244
- const peerDependency = _generatorCommon.ModuleActionFunctionsPeerDependencies[action3];
146256
+ const devDependency = _generatorCommon.ModuleActionFunctionsDevDependencies[action2];
146257
+ const dependency = _generatorCommon.ModuleActionFunctionsDependencies[action2];
146258
+ const peerDependency = _generatorCommon.ModuleActionFunctionsPeerDependencies[action2];
146245
146259
  const getModulePluginVersion = (packageName) => {
146246
146260
  return (0, _generatorUtils.getModernPluginVersion)(_generatorCommon.Solution.Module, packageName, {
146247
146261
  registry: registry2
@@ -147091,36 +147105,32 @@ var PluginGitAPI = /* @__PURE__ */ function() {
147091
147105
  }]);
147092
147106
  return PluginGitAPI2;
147093
147107
  }();
147094
- init_objectSpread2();
147095
147108
  init_classCallCheck();
147096
147109
  init_createClass();
147097
147110
  init_defineProperty();
147098
147111
  var import_lodash6 = __toESM2(require_lodash2());
147099
- var InputType;
147100
- (function(InputType2) {
147101
- InputType2["Input"] = "input";
147102
- InputType2["Radio"] = "radio";
147103
- InputType2["Checkbox"] = "checkbox";
147104
- })(InputType || (InputType = {}));
147105
147112
  var PluginInputContext = /* @__PURE__ */ function() {
147106
- function PluginInputContext2(inputs) {
147113
+ function PluginInputContext2(solutionSchema) {
147107
147114
  _classCallCheck(this, PluginInputContext2);
147108
147115
  _defineProperty(this, "inputValue", {});
147109
147116
  _defineProperty(this, "defaultConfig", {});
147110
- _defineProperty(this, "inputs", []);
147117
+ _defineProperty(this, "solutionSchemaFunc", void 0);
147118
+ _defineProperty(this, "solutionSchema", {});
147111
147119
  _defineProperty(this, "extendInputMap", {});
147112
- _defineProperty(this, "extendOptionMap", {});
147113
- this.inputs = inputs;
147120
+ this.solutionSchemaFunc = solutionSchema;
147114
147121
  }
147115
147122
  _createClass(PluginInputContext2, [{
147123
+ key: "prepare",
147124
+ value: function prepare(inputData) {
147125
+ this.solutionSchema = this.solutionSchemaFunc(inputData).properties;
147126
+ }
147127
+ }, {
147116
147128
  key: "context",
147117
147129
  get: function get4() {
147118
147130
  return {
147119
147131
  addInputBefore: this.addInputBefore.bind(this),
147120
147132
  addInputAfter: this.addInputAfter.bind(this),
147121
147133
  setInput: this.setInput.bind(this),
147122
- addOptionBefore: this.addOptionBefore.bind(this),
147123
- addOptionAfter: this.addOptionAfter.bind(this),
147124
147134
  setInputValue: this.setInputValue.bind(this),
147125
147135
  setDefaultConfig: this.setDefualtConfig.bind(this)
147126
147136
  };
@@ -147128,169 +147138,80 @@ var PluginInputContext = /* @__PURE__ */ function() {
147128
147138
  }, {
147129
147139
  key: "validateInputKey",
147130
147140
  value: function validateInputKey(inputKey) {
147131
- if (!this.inputs.find(function(item) {
147132
- return item.key === inputKey;
147133
- })) {
147141
+ if (!this.solutionSchema[inputKey]) {
147134
147142
  throw new Error("the input key ".concat(inputKey, " not found"));
147135
147143
  }
147136
147144
  }
147137
147145
  }, {
147138
147146
  key: "validateInput",
147139
- value: function validateInput(input) {
147147
+ value: function validateInput(inputKey) {
147140
147148
  var _this = this;
147141
- if (this.inputs.find(function(item) {
147142
- return item.key === input.key;
147143
- })) {
147144
- throw new Error("the input key ".concat(input.key, " already exists"));
147149
+ if (this.solutionSchema[inputKey]) {
147150
+ throw new Error("the input key ".concat(inputKey, " already exists"));
147145
147151
  }
147146
147152
  Object.keys(this.extendInputMap).forEach(function(key) {
147147
- if (_this.extendInputMap[key].before.find(function(item) {
147148
- return item.key === input.key;
147149
- }) || _this.extendInputMap[key].after.find(function(item) {
147150
- return item.key === input.key;
147151
- })) {
147152
- throw new Error("the input key ".concat(input.key, " is already added"));
147153
- }
147154
- });
147155
- }
147156
- }, {
147157
- key: "validateOption",
147158
- value: function validateOption(key, option) {
147159
- var _input$items, _this2 = this;
147160
- var input = this.inputs.find(function(item) {
147161
- return item.key === key;
147162
- });
147163
- if (input && (_input$items = input.items) !== null && _input$items !== void 0 && _input$items.find(function(item) {
147164
- return item.key === option.key;
147165
- })) {
147166
- throw new Error("the option key ".concat(option.key, " already exists"));
147167
- }
147168
- Object.keys(this.extendInputMap).forEach(function(inputKey) {
147169
- var _beforeInput$options, _afterInput$options;
147170
- var beforeInput = _this2.extendInputMap[inputKey].before.find(function(item) {
147171
- return item.key === key;
147172
- });
147173
- var afterInput = _this2.extendInputMap[inputKey].after.find(function(item) {
147174
- return item.key === key;
147175
- });
147176
- if (beforeInput && (_beforeInput$options = beforeInput.options) !== null && _beforeInput$options !== void 0 && _beforeInput$options.find(function(item) {
147177
- return item.key === option.key;
147178
- }) || afterInput && (_afterInput$options = afterInput.options) !== null && _afterInput$options !== void 0 && _afterInput$options.find(function(item) {
147179
- return item.key === option.key;
147180
- })) {
147181
- throw new Error("the option key ".concat(option.key, " is already added"));
147153
+ if (_this.extendInputMap[key].before[inputKey] || _this.extendInputMap[key].after[inputKey]) {
147154
+ throw new Error("the input key ".concat(inputKey, " is already added"));
147182
147155
  }
147183
147156
  });
147184
147157
  }
147185
- }, {
147186
- key: "validateOptionKey",
147187
- value: function validateOptionKey(key, optionKey) {
147188
- var _input$items2, _this3 = this;
147189
- var input = this.inputs.find(function(item) {
147190
- return item.key === key;
147191
- });
147192
- if (input && !((_input$items2 = input.items) !== null && _input$items2 !== void 0 && _input$items2.find(function(item) {
147193
- return item.key === optionKey;
147194
- }))) {
147195
- throw new Error("the option key ".concat(optionKey, " is not found"));
147196
- }
147197
- var foundFlag = false;
147198
- Object.keys(this.extendInputMap).forEach(function(inputKey) {
147199
- var _beforeInput$options2, _afterInput$options2;
147200
- var beforeInput = _this3.extendInputMap[inputKey].before.find(function(item) {
147201
- return item.key === key;
147202
- });
147203
- var afterInput = _this3.extendInputMap[inputKey].after.find(function(item) {
147204
- return item.key === key;
147205
- });
147206
- if (beforeInput || afterInput) {
147207
- foundFlag = true;
147208
- }
147209
- if (beforeInput && !((_beforeInput$options2 = beforeInput.options) !== null && _beforeInput$options2 !== void 0 && _beforeInput$options2.find(function(item) {
147210
- return item.key === optionKey;
147211
- })) || afterInput && !((_afterInput$options2 = afterInput.options) !== null && _afterInput$options2 !== void 0 && _afterInput$options2.find(function(item) {
147212
- return item.key === optionKey;
147213
- }))) {
147214
- throw new Error("the option key ".concat(optionKey, " is not found"));
147215
- }
147216
- });
147217
- if (!input && !foundFlag) {
147218
- throw new Error("the input key ".concat(key, " is not found"));
147219
- }
147220
- }
147221
147158
  }, {
147222
147159
  key: "addInputBefore",
147223
147160
  value: function addInputBefore(key, input) {
147224
147161
  this.validateInputKey(key);
147225
- this.validateInput(input);
147226
- if (this.extendInputMap[key]) {
147227
- this.extendInputMap[key].before.push(input);
147228
- } else {
147229
- this.extendInputMap[key] = {
147230
- before: [input],
147231
- after: []
147232
- };
147162
+ var properties = input.properties || {};
147163
+ for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {
147164
+ var inputKey = _Object$keys[_i];
147165
+ this.validateInput(inputKey);
147166
+ if (this.extendInputMap[key]) {
147167
+ this.extendInputMap[key].before[inputKey] = properties[inputKey];
147168
+ } else {
147169
+ this.extendInputMap[key] = {
147170
+ before: _defineProperty({}, inputKey, properties[inputKey]),
147171
+ after: {}
147172
+ };
147173
+ }
147233
147174
  }
147234
147175
  }
147235
147176
  }, {
147236
147177
  key: "addInputAfter",
147237
147178
  value: function addInputAfter(key, input) {
147238
147179
  this.validateInputKey(key);
147239
- this.validateInput(input);
147240
- if (this.extendInputMap[key]) {
147241
- this.extendInputMap[key].after.push(input);
147242
- } else {
147243
- this.extendInputMap[key] = {
147244
- before: [],
147245
- after: [input]
147246
- };
147180
+ var properties = input.properties || {};
147181
+ for (var _i2 = 0, _Object$keys2 = Object.keys(properties); _i2 < _Object$keys2.length; _i2++) {
147182
+ var inputKey = _Object$keys2[_i2];
147183
+ this.validateInput(inputKey);
147184
+ if (this.extendInputMap[key]) {
147185
+ this.extendInputMap[key].after[inputKey] = properties[inputKey];
147186
+ } else {
147187
+ this.extendInputMap[key] = {
147188
+ before: {},
147189
+ after: _defineProperty({}, inputKey, properties[inputKey])
147190
+ };
147191
+ }
147247
147192
  }
147248
147193
  }
147249
147194
  }, {
147250
147195
  key: "setInput",
147251
147196
  value: function setInput(key, field, value) {
147252
- var index = this.inputs.findIndex(function(item) {
147253
- return item.key === key;
147254
- });
147255
- if (index !== -1) {
147256
- var originInput = this.transformSchema(this.inputs[index]);
147257
- var _input = this.getFinalInput(originInput);
147258
- var targetValue = (0, import_lodash6.isFunction)(value) ? value(_input) : value;
147259
- this.inputs[index] = this.transformInput(_objectSpread2(_objectSpread2({}, originInput), {}, _defineProperty({}, field, targetValue)));
147260
- if (field === "options") {
147261
- this.resetExtendOptionMap(key);
147262
- }
147197
+ var schema = this.solutionSchema[key];
147198
+ if (schema) {
147199
+ schema[field] = (0, import_lodash6.isFunction)(value) ? value(schema) : value;
147263
147200
  return;
147264
147201
  }
147265
147202
  var findFlag = false;
147266
- for (var _i = 0, _Object$keys = Object.keys(this.extendInputMap); _i < _Object$keys.length; _i++) {
147267
- var inputKey = _Object$keys[_i];
147268
- var beforeIndex = this.extendInputMap[inputKey].before.findIndex(function(item) {
147269
- return item.key === key;
147270
- });
147271
- var afterIndex = this.extendInputMap[inputKey].after.findIndex(function(item) {
147272
- return item.key === key;
147273
- });
147274
- if (beforeIndex !== -1) {
147203
+ for (var _i3 = 0, _Object$keys3 = Object.keys(this.extendInputMap); _i3 < _Object$keys3.length; _i3++) {
147204
+ var inputKey = _Object$keys3[_i3];
147205
+ var beforeSchema = this.extendInputMap[inputKey].before[key];
147206
+ if (beforeSchema) {
147275
147207
  findFlag = true;
147276
- var originBeforeInput = this.extendInputMap[inputKey].before[beforeIndex];
147277
- var _input2 = this.getFinalInput(originBeforeInput);
147278
- var _targetValue = (0, import_lodash6.isFunction)(value) ? value(_input2) : value;
147279
- this.extendInputMap[inputKey].before[beforeIndex] = _objectSpread2(_objectSpread2({}, originBeforeInput), {}, _defineProperty({}, field, _targetValue));
147280
- if (field === "options") {
147281
- this.resetExtendOptionMap(key);
147282
- }
147208
+ beforeSchema[field] = (0, import_lodash6.isFunction)(value) ? value(schema) : value;
147283
147209
  break;
147284
147210
  }
147285
- if (afterIndex !== -1) {
147211
+ var afterSchema = this.extendInputMap[inputKey].after[key];
147212
+ if (afterSchema) {
147286
147213
  findFlag = true;
147287
- var originAfterInput = this.extendInputMap[inputKey].after[afterIndex];
147288
- var _input3 = this.getFinalInput(originAfterInput);
147289
- var _targetValue2 = (0, import_lodash6.isFunction)(value) ? value(_input3) : value;
147290
- this.extendInputMap[inputKey].after[afterIndex] = _objectSpread2(_objectSpread2({}, originAfterInput), {}, _defineProperty({}, field, _targetValue2));
147291
- if (field === "options") {
147292
- this.resetExtendOptionMap(key);
147293
- }
147214
+ afterSchema[field] = (0, import_lodash6.isFunction)(value) ? value(schema) : value;
147294
147215
  break;
147295
147216
  }
147296
147217
  }
@@ -147298,135 +147219,26 @@ var PluginInputContext = /* @__PURE__ */ function() {
147298
147219
  throw new Error("the input ".concat(key, " not found"));
147299
147220
  }
147300
147221
  }
147301
- }, {
147302
- key: "transformInput",
147303
- value: function transformInput(input) {
147304
- var _input$options, _input$options2;
147305
- var valueOption = (_input$options = input.options) === null || _input$options === void 0 ? void 0 : _input$options.find(function(option) {
147306
- return option.isDefault;
147307
- });
147308
- return {
147309
- key: input.key,
147310
- label: input.name,
147311
- type: ["string"],
147312
- mutualExclusion: input.type === InputType.Radio,
147313
- coexit: input.type === InputType.Checkbox,
147314
- items: (_input$options2 = input.options) === null || _input$options2 === void 0 ? void 0 : _input$options2.map(function(option) {
147315
- return {
147316
- key: option.key,
147317
- label: option.name,
147318
- when: option.when
147319
- };
147320
- }),
147321
- when: input.when,
147322
- state: {
147323
- value: valueOption ? valueOption.key : void 0
147324
- },
147325
- validate: input.validate
147326
- };
147327
- }
147328
- }, {
147329
- key: "transformSchema",
147330
- value: function transformSchema(schema) {
147331
- var _schema$items;
147332
- return {
147333
- key: schema.key,
147334
- name: schema.label,
147335
- type: schema.mutualExclusion ? InputType.Radio : schema.coexit ? InputType.Checkbox : InputType.Input,
147336
- options: (_schema$items = schema.items) === null || _schema$items === void 0 ? void 0 : _schema$items.map(function(item) {
147337
- var _schema$state;
147338
- return {
147339
- key: item.key,
147340
- name: item.label,
147341
- isDefault: item.key === ((_schema$state = schema.state) === null || _schema$state === void 0 ? void 0 : _schema$state.value)
147342
- };
147343
- }),
147344
- when: schema.when,
147345
- validate: schema.validate
147346
- };
147347
- }
147348
- }, {
147349
- key: "getFinalInput",
147350
- value: function getFinalInput(input) {
147351
- var _this4 = this;
147352
- var extendOption = this.extendOptionMap[input.key];
147353
- if (extendOption) {
147354
- var _input$options3;
147355
- var result = [];
147356
- (_input$options3 = input.options) === null || _input$options3 === void 0 ? void 0 : _input$options3.forEach(function(option) {
147357
- var _ref = extendOption[option.key] || {
147358
- before: [],
147359
- after: []
147360
- }, before = _ref.before, after = _ref.after;
147361
- before.forEach(function(item) {
147362
- return result.push(item);
147363
- });
147364
- result.push(option);
147365
- after.forEach(function(item) {
147366
- return result.push(item);
147367
- });
147368
- _this4.extendOptionMap[input.key][option.key] = {
147369
- before: [],
147370
- after: []
147371
- };
147372
- });
147373
- input.options = result;
147374
- }
147375
- return input;
147376
- }
147377
147222
  }, {
147378
147223
  key: "getFinalInputs",
147379
147224
  value: function getFinalInputs() {
147380
- var _this5 = this;
147381
- var result = [];
147382
- this.inputs.forEach(function(input) {
147383
- var _ref2 = _this5.extendInputMap[input.key] || {
147384
- before: [],
147385
- after: []
147386
- }, before = _ref2.before, after = _ref2.after;
147387
- before.forEach(function(item) {
147388
- return result.push(_this5.transformInput(_this5.getFinalInput(item)));
147389
- });
147390
- result.push(_this5.transformInput(_this5.getFinalInput(_this5.transformSchema(input))));
147391
- after.forEach(function(item) {
147392
- return result.push(_this5.transformInput(_this5.getFinalInput(item)));
147225
+ var _this2 = this;
147226
+ var result = {};
147227
+ Object.keys(this.solutionSchema).forEach(function(key) {
147228
+ var _ref = _this2.extendInputMap[key] || {
147229
+ before: {},
147230
+ after: {}
147231
+ }, before = _ref.before, after = _ref.after;
147232
+ Object.keys(before).forEach(function(beforeKey) {
147233
+ return result[beforeKey] = before[beforeKey];
147234
+ });
147235
+ result[key] = _this2.solutionSchema[key];
147236
+ Object.keys(after).forEach(function(afterKey) {
147237
+ return result[afterKey] = after[afterKey];
147393
147238
  });
147394
147239
  });
147395
147240
  return result;
147396
147241
  }
147397
- }, {
147398
- key: "initExtendOptionMap",
147399
- value: function initExtendOptionMap(key, optionKey) {
147400
- this.extendOptionMap[key] = this.extendOptionMap[key] || _defineProperty({}, key, _defineProperty({}, optionKey, {
147401
- before: [],
147402
- after: []
147403
- }));
147404
- this.extendOptionMap[key][optionKey] = this.extendOptionMap[key][optionKey] || {
147405
- before: [],
147406
- after: []
147407
- };
147408
- }
147409
- }, {
147410
- key: "resetExtendOptionMap",
147411
- value: function resetExtendOptionMap(key) {
147412
- this.extendOptionMap[key] = {};
147413
- }
147414
- }, {
147415
- key: "addOptionBefore",
147416
- value: function addOptionBefore(key, optionKey, option) {
147417
- this.validateOptionKey(key, optionKey);
147418
- this.validateOption(key, option);
147419
- this.initExtendOptionMap(key, optionKey);
147420
- this.extendOptionMap[key][optionKey].before.push(option);
147421
- }
147422
- }, {
147423
- key: "addOptionAfter",
147424
- value: function addOptionAfter(key, optionKey, option) {
147425
- this.validateOptionKey(key, optionKey);
147426
- this.validateOption(key, option);
147427
- this.initExtendOptionMap(key, optionKey);
147428
- this.extendOptionMap[key][optionKey].after.push(option);
147429
- }
147430
147242
  }, {
147431
147243
  key: "setInputValue",
147432
147244
  value: function setInputValue(value) {
@@ -147688,7 +147500,7 @@ var LifeCycle2;
147688
147500
  LifeCycle3["AfterForged"] = "afterForged";
147689
147501
  })(LifeCycle2 || (LifeCycle2 = {}));
147690
147502
  var PluginContext = /* @__PURE__ */ function() {
147691
- function PluginContext2(inputs, locale) {
147503
+ function PluginContext2(solutionSchema, locale) {
147692
147504
  var _defineProperty2;
147693
147505
  _classCallCheck(this, PluginContext2);
147694
147506
  _defineProperty(this, "generator", void 0);
@@ -147701,7 +147513,7 @@ var PluginContext = /* @__PURE__ */ function() {
147701
147513
  _defineProperty(this, "lifeCycleFuncMap", (_defineProperty2 = {}, _defineProperty(_defineProperty2, LifeCycle2.OnForged, function() {
147702
147514
  }), _defineProperty(_defineProperty2, LifeCycle2.AfterForged, function() {
147703
147515
  }), _defineProperty2));
147704
- this.inputContext = new PluginInputContext(inputs);
147516
+ this.inputContext = new PluginInputContext(solutionSchema);
147705
147517
  this.gitAPI = new PluginGitAPI();
147706
147518
  this.fileAPI = new PluginFileAPI();
147707
147519
  this.locale = locale;
@@ -147726,6 +147538,11 @@ var PluginContext = /* @__PURE__ */ function() {
147726
147538
  get: function get4() {
147727
147539
  return _objectSpread2(_objectSpread2({}, this.gitAPI.method), this.npmAPI.method);
147728
147540
  }
147541
+ }, {
147542
+ key: "handlePrepareInput",
147543
+ value: function handlePrepareInput(config) {
147544
+ this.inputContext.prepare(config);
147545
+ }
147729
147546
  }, {
147730
147547
  key: "handlePrepareContext",
147731
147548
  value: function handlePrepareContext(generator, solution, projectPath, templatePath, inputData) {
@@ -147997,13 +147814,13 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
147997
147814
  }()
147998
147815
  }, {
147999
147816
  key: "getInputSchema",
148000
- value: function getInputSchema(solution) {
148001
- var items5 = [];
147817
+ value: function getInputSchema() {
147818
+ var properties = {};
148002
147819
  var _iterator = _createForOfIteratorHelper(this.plugins), _step;
148003
147820
  try {
148004
147821
  for (_iterator.s(); !(_step = _iterator.n()).done; ) {
148005
147822
  var info = _step.value;
148006
- items5 = [].concat(_toConsumableArray(items5), _toConsumableArray(info.context.inputContext.getFinalInputs()));
147823
+ properties = _objectSpread2(_objectSpread2({}, properties), info.context.inputContext.getFinalInputs());
148007
147824
  }
148008
147825
  } catch (err) {
148009
147826
  _iterator.e(err);
@@ -148011,9 +147828,8 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
148011
147828
  _iterator.f();
148012
147829
  }
148013
147830
  return {
148014
- key: "".concat(solution, "_plugin_schema"),
148015
- isObject: true,
148016
- items: items5
147831
+ type: "object",
147832
+ properties
148017
147833
  };
148018
147834
  }
148019
147835
  }, {
@@ -148081,6 +147897,7 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
148081
147897
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
148082
147898
  info = _step4.value;
148083
147899
  info.context = new PluginContext(SolutionSchemas[solution], inputData.locale);
147900
+ info.context.inputContext.prepare(inputData);
148084
147901
  info.module(info.context.context);
148085
147902
  }
148086
147903
  } catch (err) {
@@ -148250,10 +148067,11 @@ var getNeedRunPlugin = (context, generatorPlugin) => {
148250
148067
  };
148251
148068
  var handleTemplateFile = async (context, generator, appApi, generatorPlugin) => {
148252
148069
  const { isMonorepo } = context.config;
148253
- const { solution } = await appApi.getInputBySchema(isMonorepo ? MonorepoNewActionSchema : SolutionSchema, {
148070
+ const { solution } = await appApi.getInputBySchemaFunc(isMonorepo ? getMonorepoNewActionSchema : getSolutionSchema, {
148254
148071
  ...context.config,
148255
148072
  customPlugin: generatorPlugin?.customPlugin
148256
148073
  });
148074
+ await appApi.getInputBySchemaFunc(getScenesSchema, context.config);
148257
148075
  const solutionGenerator = solution === "custom" ? BaseGenerator : isMonorepo ? SubSolutionGenerator[solution] : SolutionGenerator[solution];
148258
148076
  if (!solution || !solutionGenerator) {
148259
148077
  generator.logger.error("solution is not valid ");