@modern-js/repo-generator 2.4.4 → 2.4.6

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 +134 -65
  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 {
@@ -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;
@@ -34928,10 +34928,10 @@ var require_type = __commonJSMin((exports) => {
34928
34928
  return Array.isArray(obj);
34929
34929
  }
34930
34930
  exports.isArray = isArray4;
34931
- function isFunction3(func) {
34931
+ function isFunction4(func) {
34932
34932
  return typeof func === "function";
34933
34933
  }
34934
- exports.isFunction = isFunction3;
34934
+ exports.isFunction = isFunction4;
34935
34935
  function isObject5(obj) {
34936
34936
  return obj !== null && typeof obj === "object";
34937
34937
  }
@@ -42498,10 +42498,10 @@ var require_util = __commonJSMin((exports) => {
42498
42498
  return objectToString(e) === "[object Error]" || e instanceof Error;
42499
42499
  }
42500
42500
  exports.isError = isError;
42501
- function isFunction3(arg) {
42501
+ function isFunction4(arg) {
42502
42502
  return typeof arg === "function";
42503
42503
  }
42504
- exports.isFunction = isFunction3;
42504
+ exports.isFunction = isFunction4;
42505
42505
  function isPrimitive(arg) {
42506
42506
  return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
42507
42507
  }
@@ -43779,7 +43779,7 @@ var require_stringify = __commonJSMin((exports, module2) => {
43779
43779
  var {
43780
43780
  isArray: isArray4,
43781
43781
  isObject: isObject5,
43782
- isFunction: isFunction3,
43782
+ isFunction: isFunction4,
43783
43783
  isNumber,
43784
43784
  isString: isString3
43785
43785
  } = require_util();
@@ -43906,10 +43906,10 @@ var require_stringify = __commonJSMin((exports, module2) => {
43906
43906
  };
43907
43907
  function stringify(key, holder, gap) {
43908
43908
  let value = holder[key];
43909
- if (isObject5(value) && isFunction3(value.toJSON)) {
43909
+ if (isObject5(value) && isFunction4(value.toJSON)) {
43910
43910
  value = value.toJSON(key);
43911
43911
  }
43912
- if (isFunction3(replacer)) {
43912
+ if (isFunction4(replacer)) {
43913
43913
  value = replacer.call(holder, key, value);
43914
43914
  }
43915
43915
  switch (typeof value) {
@@ -43944,7 +43944,7 @@ var require_stringify = __commonJSMin((exports, module2) => {
43944
43944
  if (!indent_) {
43945
43945
  return JSON.stringify(value, replacer_);
43946
43946
  }
43947
- if (!isFunction3(replacer_) && !isArray4(replacer_)) {
43947
+ if (!isFunction4(replacer_) && !isArray4(replacer_)) {
43948
43948
  replacer_ = null;
43949
43949
  }
43950
43950
  replacer = replacer_;
@@ -44067,13 +44067,20 @@ var require_install = __commonJSMin((exports) => {
44067
44067
  }));
44068
44068
  return promise;
44069
44069
  }
44070
- async function npmInstall2(cwd, registryUrl) {
44070
+ async function npmInstall2({
44071
+ cwd,
44072
+ registryUrl,
44073
+ ignoreScripts
44074
+ }) {
44071
44075
  const canUse = await (0, _env.canUseNpm)();
44072
44076
  if (canUse) {
44073
44077
  const params = ["install"];
44074
44078
  if (registryUrl) {
44075
44079
  params.push(`--registry=${registryUrl}`);
44076
44080
  }
44081
+ if (ignoreScripts) {
44082
+ params.push("--ignore-scripts");
44083
+ }
44077
44084
  return execaWithStreamLog("npm", params, {
44078
44085
  cwd,
44079
44086
  env: process.env
@@ -44081,13 +44088,20 @@ var require_install = __commonJSMin((exports) => {
44081
44088
  }
44082
44089
  throw new Error("please install npm first");
44083
44090
  }
44084
- async function yarnInstall2(cwd, registryUrl) {
44091
+ async function yarnInstall2({
44092
+ cwd,
44093
+ registryUrl,
44094
+ ignoreScripts
44095
+ }) {
44085
44096
  const canUse = await (0, _env.canUseYarn)();
44086
44097
  if (canUse) {
44087
44098
  const params = ["install"];
44088
44099
  if (registryUrl) {
44089
44100
  params.push(`--registry=${registryUrl}`);
44090
44101
  }
44102
+ if (ignoreScripts) {
44103
+ params.push("--ignore-scripts");
44104
+ }
44091
44105
  return execaWithStreamLog("yarn", params, {
44092
44106
  cwd,
44093
44107
  env: process.env
@@ -44095,13 +44109,20 @@ var require_install = __commonJSMin((exports) => {
44095
44109
  }
44096
44110
  throw new Error("please install yarn first");
44097
44111
  }
44098
- async function pnpmInstall2(cwd, registryUrl) {
44112
+ async function pnpmInstall2({
44113
+ cwd,
44114
+ registryUrl,
44115
+ ignoreScripts
44116
+ }) {
44099
44117
  const canUse = await (0, _env.canUsePnpm)();
44100
44118
  if (canUse) {
44101
44119
  const params = ["install"];
44102
44120
  if (registryUrl) {
44103
44121
  params.push(`--registry=${registryUrl}`);
44104
44122
  }
44123
+ if (ignoreScripts) {
44124
+ params.push("--ignore-scripts");
44125
+ }
44105
44126
  return execaWithStreamLog("pnpm", params, {
44106
44127
  cwd,
44107
44128
  env: process.env
@@ -44197,14 +44218,38 @@ var require_node = __commonJSMin((exports) => {
44197
44218
  _defineProperty2(this, "generatorCore", void 0);
44198
44219
  this.generatorCore = generatorCore;
44199
44220
  }
44200
- npmInstall(cwd = this.generatorCore.outputPath) {
44201
- return (0, _utils.npmInstall)(cwd);
44221
+ npmInstall({
44222
+ cwd,
44223
+ registryUrl,
44224
+ ignoreScripts
44225
+ }) {
44226
+ return (0, _utils.npmInstall)({
44227
+ cwd: cwd || this.generatorCore.outputPath,
44228
+ registryUrl,
44229
+ ignoreScripts
44230
+ });
44202
44231
  }
44203
- yarnInstall(cwd = this.generatorCore.outputPath) {
44204
- return (0, _utils.yarnInstall)(cwd);
44232
+ yarnInstall({
44233
+ cwd,
44234
+ registryUrl,
44235
+ ignoreScripts
44236
+ }) {
44237
+ return (0, _utils.yarnInstall)({
44238
+ cwd: cwd || this.generatorCore.outputPath,
44239
+ registryUrl,
44240
+ ignoreScripts
44241
+ });
44205
44242
  }
44206
- pnpmInstall(cwd = this.generatorCore.outputPath) {
44207
- return (0, _utils.pnpmInstall)(cwd);
44243
+ pnpmInstall({
44244
+ cwd,
44245
+ registryUrl,
44246
+ ignoreScripts
44247
+ }) {
44248
+ return (0, _utils.pnpmInstall)({
44249
+ cwd: cwd || this.generatorCore.outputPath,
44250
+ registryUrl,
44251
+ ignoreScripts
44252
+ });
44208
44253
  }
44209
44254
  };
44210
44255
  exports.NpmAPI = NpmAPI;
@@ -44990,11 +45035,11 @@ var require_utils3 = __commonJSMin((exports, module2) => {
44990
45035
  function isBlob(val) {
44991
45036
  return toString5.call(val) === "[object Blob]";
44992
45037
  }
44993
- function isFunction3(val) {
45038
+ function isFunction4(val) {
44994
45039
  return toString5.call(val) === "[object Function]";
44995
45040
  }
44996
45041
  function isStream(val) {
44997
- return isObject5(val) && isFunction3(val.pipe);
45042
+ return isObject5(val) && isFunction4(val.pipe);
44998
45043
  }
44999
45044
  function isURLSearchParams(val) {
45000
45045
  return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
@@ -45075,7 +45120,7 @@ var require_utils3 = __commonJSMin((exports, module2) => {
45075
45120
  isDate,
45076
45121
  isFile,
45077
45122
  isBlob,
45078
- isFunction: isFunction3,
45123
+ isFunction: isFunction4,
45079
45124
  isStream,
45080
45125
  isURLSearchParams,
45081
45126
  isStandardBrowserEnv,
@@ -52791,15 +52836,15 @@ var require_utils5 = __commonJSMin((exports) => {
52791
52836
  }
52792
52837
  var toString5 = Object.prototype.toString;
52793
52838
  exports.toString = toString5;
52794
- var isFunction3 = function isFunction4(value) {
52839
+ var isFunction4 = function isFunction5(value) {
52795
52840
  return typeof value === "function";
52796
52841
  };
52797
- if (isFunction3(/x/)) {
52798
- exports.isFunction = isFunction3 = function(value) {
52842
+ if (isFunction4(/x/)) {
52843
+ exports.isFunction = isFunction4 = function(value) {
52799
52844
  return typeof value === "function" && toString5.call(value) === "[object Function]";
52800
52845
  };
52801
52846
  }
52802
- exports.isFunction = isFunction3;
52847
+ exports.isFunction = isFunction4;
52803
52848
  var isArray4 = Array.isArray || function(value) {
52804
52849
  return value && typeof value === "object" ? toString5.call(value) === "[object Array]" : false;
52805
52850
  };
@@ -60866,14 +60911,14 @@ var require_isFunction = __commonJSMin((exports, module2) => {
60866
60911
  var funcTag = "[object Function]";
60867
60912
  var genTag = "[object GeneratorFunction]";
60868
60913
  var proxyTag = "[object Proxy]";
60869
- function isFunction3(value) {
60914
+ function isFunction4(value) {
60870
60915
  if (!isObject5(value)) {
60871
60916
  return false;
60872
60917
  }
60873
60918
  var tag = baseGetTag(value);
60874
60919
  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
60875
60920
  }
60876
- module2.exports = isFunction3;
60921
+ module2.exports = isFunction4;
60877
60922
  });
60878
60923
  var require_coreJsData = __commonJSMin((exports, module2) => {
60879
60924
  var root = require_root();
@@ -60910,7 +60955,7 @@ var require_toSource = __commonJSMin((exports, module2) => {
60910
60955
  module2.exports = toSource;
60911
60956
  });
60912
60957
  var require_baseIsNative = __commonJSMin((exports, module2) => {
60913
- var isFunction3 = require_isFunction();
60958
+ var isFunction4 = require_isFunction();
60914
60959
  var isMasked = require_isMasked();
60915
60960
  var isObject5 = require_isObject();
60916
60961
  var toSource = require_toSource();
@@ -60925,7 +60970,7 @@ var require_baseIsNative = __commonJSMin((exports, module2) => {
60925
60970
  if (!isObject5(value) || isMasked(value)) {
60926
60971
  return false;
60927
60972
  }
60928
- var pattern = isFunction3(value) ? reIsNative : reIsHostCtor;
60973
+ var pattern = isFunction4(value) ? reIsNative : reIsHostCtor;
60929
60974
  return pattern.test(toSource(value));
60930
60975
  }
60931
60976
  module2.exports = baseIsNative;
@@ -61124,10 +61169,10 @@ var require_isLength = __commonJSMin((exports, module2) => {
61124
61169
  module2.exports = isLength;
61125
61170
  });
61126
61171
  var require_isArrayLike = __commonJSMin((exports, module2) => {
61127
- var isFunction3 = require_isFunction();
61172
+ var isFunction4 = require_isFunction();
61128
61173
  var isLength = require_isLength();
61129
61174
  function isArrayLike(value) {
61130
- return value != null && isLength(value.length) && !isFunction3(value);
61175
+ return value != null && isLength(value.length) && !isFunction4(value);
61131
61176
  }
61132
61177
  module2.exports = isArrayLike;
61133
61178
  });
@@ -63040,10 +63085,10 @@ var require_isFunction2 = __commonJSMin((exports) => {
63040
63085
  "use strict";
63041
63086
  Object.defineProperty(exports, "__esModule", { value: true });
63042
63087
  exports.isFunction = void 0;
63043
- function isFunction3(value) {
63088
+ function isFunction4(value) {
63044
63089
  return typeof value === "function";
63045
63090
  }
63046
- exports.isFunction = isFunction3;
63091
+ exports.isFunction = isFunction4;
63047
63092
  });
63048
63093
  var require_createErrorClass = __commonJSMin((exports) => {
63049
63094
  "use strict";
@@ -97272,7 +97317,7 @@ var require_baseMergeDeep = __commonJSMin((exports, module2) => {
97272
97317
  var isArray4 = require_isArray();
97273
97318
  var isArrayLikeObject = require_isArrayLikeObject();
97274
97319
  var isBuffer = require_isBuffer();
97275
- var isFunction3 = require_isFunction();
97320
+ var isFunction4 = require_isFunction();
97276
97321
  var isObject5 = require_isObject();
97277
97322
  var isPlainObject = require_isPlainObject();
97278
97323
  var isTypedArray = require_isTypedArray();
@@ -97307,7 +97352,7 @@ var require_baseMergeDeep = __commonJSMin((exports, module2) => {
97307
97352
  newValue = objValue;
97308
97353
  if (isArguments(objValue)) {
97309
97354
  newValue = toPlainObject(objValue);
97310
- } else if (!isObject5(objValue) || isFunction3(objValue)) {
97355
+ } else if (!isObject5(objValue) || isFunction4(objValue)) {
97311
97356
  newValue = initCloneObject(srcValue);
97312
97357
  }
97313
97358
  } else {
@@ -111267,7 +111312,7 @@ function getQuestionFromSchema(schema) {
111267
111312
  }
111268
111313
  var questions = fields.map(function(field) {
111269
111314
  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") {
111315
+ if (type === "void" || type === "object") {
111271
111316
  return getQuestionFromSchema(properties[field], configValue, validateMap, initValue);
111272
111317
  }
111273
111318
  if (type !== "string" && type !== "number") {
@@ -111285,7 +111330,9 @@ function getQuestionFromSchema(schema) {
111285
111330
  break;
111286
111331
  }
111287
111332
  _context.next = 3;
111288
- return validate(input, fieldValidate);
111333
+ return validate(input, (0, import_lodash.isFunction)(fieldValidate) ? {
111334
+ validator: fieldValidate
111335
+ } : fieldValidate);
111289
111336
  case 3:
111290
111337
  _result = _context.sent;
111291
111338
  if (!((_result$error = _result.error) !== null && _result$error !== void 0 && _result$error.length)) {
@@ -111708,10 +111755,12 @@ var init_inquirer = __esmMin(() => {
111708
111755
  });
111709
111756
  var treeshaking_exports2 = {};
111710
111757
  __export2(treeshaking_exports2, {
111711
- CLIReader: () => CLIReader
111758
+ CLIReader: () => CLIReader,
111759
+ validate: () => validate
111712
111760
  });
111713
111761
  var init_treeshaking2 = __esmMin(() => {
111714
111762
  init_inquirer();
111763
+ init_esm4();
111715
111764
  });
111716
111765
  function getObjKeyMap(obj) {
111717
111766
  var prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
@@ -112395,7 +112444,7 @@ var require_node8 = __commonJSMin((exports) => {
112395
112444
  }
112396
112445
  return true;
112397
112446
  }
112398
- async runInstall(command) {
112447
+ async runInstall(command, options3) {
112399
112448
  const {
112400
112449
  config: {
112401
112450
  packageManager,
@@ -112409,11 +112458,11 @@ var require_node8 = __commonJSMin((exports) => {
112409
112458
  if (command) {
112410
112459
  intallPromise = (0, _utils.execa)(command);
112411
112460
  } else if (packageManager === "pnpm") {
112412
- intallPromise = this.npmApi.pnpmInstall();
112461
+ intallPromise = this.npmApi.pnpmInstall(options3 || {});
112413
112462
  } else if (packageManager === "yarn") {
112414
- intallPromise = this.npmApi.yarnInstall();
112463
+ intallPromise = this.npmApi.yarnInstall(options3 || {});
112415
112464
  } else {
112416
- intallPromise = this.npmApi.npmInstall();
112465
+ intallPromise = this.npmApi.npmInstall(options3 || {});
112417
112466
  }
112418
112467
  try {
112419
112468
  await intallPromise;
@@ -112506,6 +112555,21 @@ var require_node8 = __commonJSMin((exports) => {
112506
112555
  throw new Error("run sub generator failed");
112507
112556
  }
112508
112557
  }
112558
+ mergeAnswers(answers, configValue) {
112559
+ const inputData = (0, _lodash.merge)(answers, configValue);
112560
+ this.generatorContext.config = (0, _lodash.merge)(this.generatorContext.config, inputData);
112561
+ return inputData;
112562
+ }
112563
+ async getInputBySchemaFunc(schemaFunc, configValue = {}, validateMap = {}, initValue = {}) {
112564
+ const reader = new _codesmithFormily.CLIReader({
112565
+ schema: schemaFunc(configValue),
112566
+ validateMap,
112567
+ initValue
112568
+ });
112569
+ reader.setAnswers(configValue);
112570
+ const answers = await reader.start();
112571
+ return this.mergeAnswers(answers, configValue);
112572
+ }
112509
112573
  async getInputBySchema(schema, configValue = {}, validateMap = {}, initValue = {}, type = "easy-form") {
112510
112574
  if (type === "easy-form") {
112511
112575
  const reader = new _easyFormCli.CliReader({
@@ -112516,9 +112580,7 @@ var require_node8 = __commonJSMin((exports) => {
112516
112580
  return new Promise((resolve, reject) => {
112517
112581
  reader.startQuestion({
112518
112582
  onComplete: (answers) => {
112519
- const inputData = (0, _lodash.merge)(answers, configValue);
112520
- this.generatorContext.config = (0, _lodash.merge)(this.generatorContext.config, inputData);
112521
- resolve(inputData);
112583
+ resolve(this.mergeAnswers(answers, configValue));
112522
112584
  },
112523
112585
  onError: (error) => {
112524
112586
  reject(error);
@@ -112532,10 +112594,11 @@ var require_node8 = __commonJSMin((exports) => {
112532
112594
  initValue
112533
112595
  });
112534
112596
  reader.setAnswers(configValue);
112535
- return reader.start();
112597
+ const answers = await reader.start();
112598
+ return this.mergeAnswers(answers, configValue);
112536
112599
  } else {
112537
- const result = await _inquirer.default.prompt((0, _transform.transformInquirerSchema)(schema, configValue, validateMap, initValue));
112538
- return _objectSpread(_objectSpread({}, configValue), result);
112600
+ const answers = await _inquirer.default.prompt((0, _transform.transformInquirerSchema)(schema, configValue, validateMap, initValue));
112601
+ return this.mergeAnswers(answers, configValue);
112539
112602
  }
112540
112603
  }
112541
112604
  };
@@ -113541,7 +113604,7 @@ var init_common3 = __esmMin(() => {
113541
113604
  });
113542
113605
  ActionTypeTextMap = (_ActionTypeTextMap = {}, _defineProperty(_ActionTypeTextMap, ActionType.Element, ActionElementText), _defineProperty(_ActionTypeTextMap, ActionType.Function, ActionFunctionText), _defineProperty(_ActionTypeTextMap, ActionType.Refactor, ActionRefactorText), _ActionTypeTextMap);
113543
113606
  });
113544
- var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap, MWASpecialSchemaMap, MWANewActionSchema, MWAActionFunctionsDevDependencies, MWAActionFunctionsDependencies, MWAActionFunctionsAppendTypeContent, MWANewActionGenerators;
113607
+ var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _MWAActionFunctionsAp, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap, MWASpecialSchemaMap, MWANewActionSchema, MWAActionFunctionsDevDependencies, MWAActionFunctionsDependencies, MWAActionFunctionsAppendTypeContent, MWANewActionGenerators;
113545
113608
  var init_mwa2 = __esmMin(() => {
113546
113609
  init_defineProperty();
113547
113610
  init_common3();
@@ -113600,7 +113663,7 @@ var init_mwa2 = __esmMin(() => {
113600
113663
  };
113601
113664
  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);
113602
113665
  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
- MWAActionFunctionsAppendTypeContent = _defineProperty({}, ActionFunction.MicroFrontend, "/// <reference types='@modern-js/plugin-garfish/types' />");
113666
+ MWAActionFunctionsAppendTypeContent = (_MWAActionFunctionsAp = {}, _defineProperty(_MWAActionFunctionsAp, ActionFunction.MicroFrontend, "/// <reference types='@modern-js/plugin-garfish/types' />"), _defineProperty(_MWAActionFunctionsAp, ActionFunction.Test, "/// <reference types='@modern-js/plugin-testing/types' />"), _MWAActionFunctionsAp);
113604
113667
  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);
113605
113668
  });
113606
113669
  var _ModuleActionFunction, _ModuleActionFunction2, _ModuleActionFunction3, _ActionType$Function2, ModuleActionTypes, ModuleActionFunctions, ModuleActionTypesMap, ModuleSpecialSchemaMap, ModuleNewActionSchema, ModuleActionFunctionsDevDependencies, ModuleActionFunctionsPeerDependencies, ModuleActionFunctionsDependencies, ModuleNewActionGenerators;
@@ -143240,10 +143303,10 @@ var require_type2 = __commonJSMin((exports) => {
143240
143303
  return Array.isArray(obj);
143241
143304
  }
143242
143305
  exports.isArray = isArray4;
143243
- function isFunction3(func) {
143306
+ function isFunction4(func) {
143244
143307
  return typeof func === "function";
143245
143308
  }
143246
- exports.isFunction = isFunction3;
143309
+ exports.isFunction = isFunction4;
143247
143310
  function isObject5(obj) {
143248
143311
  return obj !== null && typeof obj === "object";
143249
143312
  }
@@ -144972,7 +145035,7 @@ var require_node9 = __commonJSMin((exports) => {
144972
145035
  const version5 = await getPackageVersion(packageName, registry2);
144973
145036
  return version5;
144974
145037
  };
144975
- if (!packageName.startsWith("@modern-js")) {
145038
+ if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
144976
145039
  return getLatetPluginVersion();
144977
145040
  }
144978
145041
  const pkgPath = _path.default.join(__require.resolve(_generatorCommon.SolutionToolsMap[solution], {
@@ -147475,7 +147538,9 @@ var PluginNpmAPI = /* @__PURE__ */ function() {
147475
147538
  break;
147476
147539
  }
147477
147540
  _context.next = 3;
147478
- return (0, import_codesmith_api_npm.pnpmInstall)(this.projectPath);
147541
+ return (0, import_codesmith_api_npm.pnpmInstall)({
147542
+ cwd: this.projectPath
147543
+ });
147479
147544
  case 3:
147480
147545
  _context.next = 12;
147481
147546
  break;
@@ -147485,13 +147550,17 @@ var PluginNpmAPI = /* @__PURE__ */ function() {
147485
147550
  break;
147486
147551
  }
147487
147552
  _context.next = 8;
147488
- return (0, import_codesmith_api_npm.yarnInstall)(this.projectPath);
147553
+ return (0, import_codesmith_api_npm.yarnInstall)({
147554
+ cwd: this.projectPath
147555
+ });
147489
147556
  case 8:
147490
147557
  _context.next = 12;
147491
147558
  break;
147492
147559
  case 10:
147493
147560
  _context.next = 12;
147494
- return (0, import_codesmith_api_npm.npmInstall)(this.projectPath);
147561
+ return (0, import_codesmith_api_npm.npmInstall)({
147562
+ cwd: this.projectPath
147563
+ });
147495
147564
  case 12:
147496
147565
  case "end":
147497
147566
  return _context.stop();
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.4.4",
14
+ "version": "2.4.6",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "main": "./dist/index.js",
17
17
  "files": [
@@ -23,18 +23,18 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@babel/runtime": "^7.18.0",
26
- "@modern-js/base-generator": "2.4.4",
27
- "@modern-js/codesmith": "1.6.1",
28
- "@modern-js/codesmith-api-app": "1.6.1",
29
- "@modern-js/generator-common": "2.4.4",
30
- "@modern-js/generator-plugin": "2.4.4",
31
- "@modern-js/generator-utils": "2.4.4",
32
- "@modern-js/module-generator": "2.4.4",
33
- "@modern-js/monorepo-generator": "2.4.4",
34
- "@modern-js/mwa-generator": "2.4.4",
35
- "@modern-js/utils": "1.20.1",
36
- "@scripts/build": "1.20.1",
37
- "@scripts/jest-config": "1.20.1",
26
+ "@modern-js/base-generator": "2.4.6",
27
+ "@modern-js/codesmith": "1.6.3",
28
+ "@modern-js/codesmith-api-app": "1.6.3",
29
+ "@modern-js/generator-common": "2.4.6",
30
+ "@modern-js/generator-plugin": "2.4.6",
31
+ "@modern-js/generator-utils": "2.4.6",
32
+ "@modern-js/module-generator": "2.4.6",
33
+ "@modern-js/monorepo-generator": "2.4.6",
34
+ "@modern-js/mwa-generator": "2.4.6",
35
+ "@modern-js/utils": "1.21.1",
36
+ "@scripts/build": "1.21.1",
37
+ "@scripts/jest-config": "1.21.1",
38
38
  "@types/jest": "^27",
39
39
  "@types/node": "^14",
40
40
  "jest": "^27",