@modern-js/bff-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 +126 -63
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -18879,7 +18879,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
18879
18879
  }
18880
18880
  function baseFunctions(object, props) {
18881
18881
  return arrayFilter(props, function(key) {
18882
- return isFunction(object[key]);
18882
+ return isFunction2(object[key]);
18883
18883
  });
18884
18884
  }
18885
18885
  function baseGet(object, path2) {
@@ -19042,7 +19042,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
19042
19042
  if (!isObject5(value) || isMasked(value)) {
19043
19043
  return false;
19044
19044
  }
19045
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
19045
+ var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
19046
19046
  return pattern.test(toSource(value));
19047
19047
  }
19048
19048
  function baseIsRegExp(value) {
@@ -19164,7 +19164,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
19164
19164
  newValue = objValue;
19165
19165
  if (isArguments(objValue)) {
19166
19166
  newValue = toPlainObject(objValue);
19167
- } else if (!isObject5(objValue) || isFunction(objValue)) {
19167
+ } else if (!isObject5(objValue) || isFunction2(objValue)) {
19168
19168
  newValue = initCloneObject(srcValue);
19169
19169
  }
19170
19170
  } else {
@@ -20466,7 +20466,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
20466
20466
  function isMasked(func) {
20467
20467
  return !!maskSrcKey && maskSrcKey in func;
20468
20468
  }
20469
- var isMaskable = coreJsData ? isFunction : stubFalse;
20469
+ var isMaskable = coreJsData ? isFunction2 : stubFalse;
20470
20470
  function isPrototype(value) {
20471
20471
  var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
20472
20472
  return value === proto;
@@ -21579,7 +21579,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
21579
21579
  var isArray4 = Array2.isArray;
21580
21580
  var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
21581
21581
  function isArrayLike(value) {
21582
- return value != null && isLength(value.length) && !isFunction(value);
21582
+ return value != null && isLength(value.length) && !isFunction2(value);
21583
21583
  }
21584
21584
  function isArrayLikeObject(value) {
21585
21585
  return isObjectLike(value) && isArrayLike(value);
@@ -21631,7 +21631,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
21631
21631
  function isFinite2(value) {
21632
21632
  return typeof value == "number" && nativeIsFinite(value);
21633
21633
  }
21634
- function isFunction(value) {
21634
+ function isFunction2(value) {
21635
21635
  if (!isObject5(value)) {
21636
21636
  return false;
21637
21637
  }
@@ -21954,7 +21954,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
21954
21954
  index = length;
21955
21955
  value = defaultValue;
21956
21956
  }
21957
- object = isFunction(value) ? value.call(object) : value;
21957
+ object = isFunction2(value) ? value.call(object) : value;
21958
21958
  }
21959
21959
  return object;
21960
21960
  }
@@ -21975,7 +21975,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
21975
21975
  if (isArrLike) {
21976
21976
  accumulator = isArr4 ? new Ctor() : [];
21977
21977
  } else if (isObject5(object)) {
21978
- accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
21978
+ accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object)) : {};
21979
21979
  } else {
21980
21980
  accumulator = {};
21981
21981
  }
@@ -22392,7 +22392,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
22392
22392
  object = this;
22393
22393
  methodNames = baseFunctions(source, keys(source));
22394
22394
  }
22395
- var chain2 = !(isObject5(options3) && "chain" in options3) || !!options3.chain, isFunc = isFunction(object);
22395
+ var chain2 = !(isObject5(options3) && "chain" in options3) || !!options3.chain, isFunc = isFunction2(object);
22396
22396
  arrayEach(methodNames, function(methodName) {
22397
22397
  var func = source[methodName];
22398
22398
  object[methodName] = func;
@@ -22727,7 +22727,7 @@ var require_lodash = __commonJSMin((exports, module2) => {
22727
22727
  lodash.isEqualWith = isEqualWith;
22728
22728
  lodash.isError = isError;
22729
22729
  lodash.isFinite = isFinite2;
22730
- lodash.isFunction = isFunction;
22730
+ lodash.isFunction = isFunction2;
22731
22731
  lodash.isInteger = isInteger;
22732
22732
  lodash.isLength = isLength;
22733
22733
  lodash.isMap = isMap2;
@@ -34891,10 +34891,10 @@ var require_type = __commonJSMin((exports) => {
34891
34891
  return Array.isArray(obj);
34892
34892
  }
34893
34893
  exports.isArray = isArray4;
34894
- function isFunction(func) {
34894
+ function isFunction2(func) {
34895
34895
  return typeof func === "function";
34896
34896
  }
34897
- exports.isFunction = isFunction;
34897
+ exports.isFunction = isFunction2;
34898
34898
  function isObject5(obj) {
34899
34899
  return obj !== null && typeof obj === "object";
34900
34900
  }
@@ -37395,7 +37395,7 @@ var init_common3 = __esmMin(() => {
37395
37395
  });
37396
37396
  ActionTypeTextMap = (_ActionTypeTextMap = {}, _defineProperty(_ActionTypeTextMap, ActionType.Element, ActionElementText), _defineProperty(_ActionTypeTextMap, ActionType.Function, ActionFunctionText), _defineProperty(_ActionTypeTextMap, ActionType.Refactor, ActionRefactorText), _ActionTypeTextMap);
37397
37397
  });
37398
- var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap, MWASpecialSchemaMap, MWANewActionSchema, MWAActionFunctionsDevDependencies, MWAActionFunctionsDependencies, MWAActionFunctionsAppendTypeContent, MWANewActionGenerators;
37398
+ var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _MWAActionFunctionsAp, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap, MWASpecialSchemaMap, MWANewActionSchema, MWAActionFunctionsDevDependencies, MWAActionFunctionsDependencies, MWAActionFunctionsAppendTypeContent, MWANewActionGenerators;
37399
37399
  var init_mwa2 = __esmMin(() => {
37400
37400
  init_defineProperty();
37401
37401
  init_common3();
@@ -37454,7 +37454,7 @@ var init_mwa2 = __esmMin(() => {
37454
37454
  };
37455
37455
  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);
37456
37456
  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);
37457
- MWAActionFunctionsAppendTypeContent = _defineProperty({}, ActionFunction.MicroFrontend, "/// <reference types='@modern-js/plugin-garfish/types' />");
37457
+ 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);
37458
37458
  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);
37459
37459
  });
37460
37460
  var _ModuleActionFunction, _ModuleActionFunction2, _ModuleActionFunction3, _ActionType$Function2, ModuleActionTypes, ModuleActionFunctions, ModuleActionTypesMap, ModuleSpecialSchemaMap, ModuleNewActionSchema, ModuleActionFunctionsDevDependencies, ModuleActionFunctionsPeerDependencies, ModuleActionFunctionsDependencies, ModuleNewActionGenerators;
@@ -38016,7 +38016,7 @@ var require_node = __commonJSMin((exports) => {
38016
38016
  const version5 = await getPackageVersion2(packageName, registry2);
38017
38017
  return version5;
38018
38018
  };
38019
- if (!packageName.startsWith("@modern-js")) {
38019
+ if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
38020
38020
  return getLatetPluginVersion();
38021
38021
  }
38022
38022
  const pkgPath = _path.default.join(__require.resolve(_generatorCommon.SolutionToolsMap[solution], {
@@ -67566,10 +67566,10 @@ var require_type2 = __commonJSMin((exports) => {
67566
67566
  return Array.isArray(obj);
67567
67567
  }
67568
67568
  exports.isArray = isArray4;
67569
- function isFunction(func) {
67569
+ function isFunction2(func) {
67570
67570
  return typeof func === "function";
67571
67571
  }
67572
- exports.isFunction = isFunction;
67572
+ exports.isFunction = isFunction2;
67573
67573
  function isObject5(obj) {
67574
67574
  return obj !== null && typeof obj === "object";
67575
67575
  }
@@ -75136,10 +75136,10 @@ var require_util = __commonJSMin((exports) => {
75136
75136
  return objectToString(e) === "[object Error]" || e instanceof Error;
75137
75137
  }
75138
75138
  exports.isError = isError;
75139
- function isFunction(arg) {
75139
+ function isFunction2(arg) {
75140
75140
  return typeof arg === "function";
75141
75141
  }
75142
- exports.isFunction = isFunction;
75142
+ exports.isFunction = isFunction2;
75143
75143
  function isPrimitive(arg) {
75144
75144
  return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
75145
75145
  }
@@ -76417,7 +76417,7 @@ var require_stringify = __commonJSMin((exports, module2) => {
76417
76417
  var {
76418
76418
  isArray: isArray4,
76419
76419
  isObject: isObject5,
76420
- isFunction,
76420
+ isFunction: isFunction2,
76421
76421
  isNumber,
76422
76422
  isString: isString3
76423
76423
  } = require_util();
@@ -76544,10 +76544,10 @@ var require_stringify = __commonJSMin((exports, module2) => {
76544
76544
  };
76545
76545
  function stringify(key, holder, gap) {
76546
76546
  let value = holder[key];
76547
- if (isObject5(value) && isFunction(value.toJSON)) {
76547
+ if (isObject5(value) && isFunction2(value.toJSON)) {
76548
76548
  value = value.toJSON(key);
76549
76549
  }
76550
- if (isFunction(replacer)) {
76550
+ if (isFunction2(replacer)) {
76551
76551
  value = replacer.call(holder, key, value);
76552
76552
  }
76553
76553
  switch (typeof value) {
@@ -76582,7 +76582,7 @@ var require_stringify = __commonJSMin((exports, module2) => {
76582
76582
  if (!indent_) {
76583
76583
  return JSON.stringify(value, replacer_);
76584
76584
  }
76585
- if (!isFunction(replacer_) && !isArray4(replacer_)) {
76585
+ if (!isFunction2(replacer_) && !isArray4(replacer_)) {
76586
76586
  replacer_ = null;
76587
76587
  }
76588
76588
  replacer = replacer_;
@@ -76705,13 +76705,20 @@ var require_install = __commonJSMin((exports) => {
76705
76705
  }));
76706
76706
  return promise;
76707
76707
  }
76708
- async function npmInstall(cwd, registryUrl) {
76708
+ async function npmInstall({
76709
+ cwd,
76710
+ registryUrl,
76711
+ ignoreScripts
76712
+ }) {
76709
76713
  const canUse = await (0, _env.canUseNpm)();
76710
76714
  if (canUse) {
76711
76715
  const params = ["install"];
76712
76716
  if (registryUrl) {
76713
76717
  params.push(`--registry=${registryUrl}`);
76714
76718
  }
76719
+ if (ignoreScripts) {
76720
+ params.push("--ignore-scripts");
76721
+ }
76715
76722
  return execaWithStreamLog("npm", params, {
76716
76723
  cwd,
76717
76724
  env: process.env
@@ -76719,13 +76726,20 @@ var require_install = __commonJSMin((exports) => {
76719
76726
  }
76720
76727
  throw new Error("please install npm first");
76721
76728
  }
76722
- async function yarnInstall(cwd, registryUrl) {
76729
+ async function yarnInstall({
76730
+ cwd,
76731
+ registryUrl,
76732
+ ignoreScripts
76733
+ }) {
76723
76734
  const canUse = await (0, _env.canUseYarn)();
76724
76735
  if (canUse) {
76725
76736
  const params = ["install"];
76726
76737
  if (registryUrl) {
76727
76738
  params.push(`--registry=${registryUrl}`);
76728
76739
  }
76740
+ if (ignoreScripts) {
76741
+ params.push("--ignore-scripts");
76742
+ }
76729
76743
  return execaWithStreamLog("yarn", params, {
76730
76744
  cwd,
76731
76745
  env: process.env
@@ -76733,13 +76747,20 @@ var require_install = __commonJSMin((exports) => {
76733
76747
  }
76734
76748
  throw new Error("please install yarn first");
76735
76749
  }
76736
- async function pnpmInstall(cwd, registryUrl) {
76750
+ async function pnpmInstall({
76751
+ cwd,
76752
+ registryUrl,
76753
+ ignoreScripts
76754
+ }) {
76737
76755
  const canUse = await (0, _env.canUsePnpm)();
76738
76756
  if (canUse) {
76739
76757
  const params = ["install"];
76740
76758
  if (registryUrl) {
76741
76759
  params.push(`--registry=${registryUrl}`);
76742
76760
  }
76761
+ if (ignoreScripts) {
76762
+ params.push("--ignore-scripts");
76763
+ }
76743
76764
  return execaWithStreamLog("pnpm", params, {
76744
76765
  cwd,
76745
76766
  env: process.env
@@ -76835,14 +76856,38 @@ var require_node2 = __commonJSMin((exports) => {
76835
76856
  _defineProperty2(this, "generatorCore", void 0);
76836
76857
  this.generatorCore = generatorCore;
76837
76858
  }
76838
- npmInstall(cwd = this.generatorCore.outputPath) {
76839
- return (0, _utils.npmInstall)(cwd);
76859
+ npmInstall({
76860
+ cwd,
76861
+ registryUrl,
76862
+ ignoreScripts
76863
+ }) {
76864
+ return (0, _utils.npmInstall)({
76865
+ cwd: cwd || this.generatorCore.outputPath,
76866
+ registryUrl,
76867
+ ignoreScripts
76868
+ });
76840
76869
  }
76841
- yarnInstall(cwd = this.generatorCore.outputPath) {
76842
- return (0, _utils.yarnInstall)(cwd);
76870
+ yarnInstall({
76871
+ cwd,
76872
+ registryUrl,
76873
+ ignoreScripts
76874
+ }) {
76875
+ return (0, _utils.yarnInstall)({
76876
+ cwd: cwd || this.generatorCore.outputPath,
76877
+ registryUrl,
76878
+ ignoreScripts
76879
+ });
76843
76880
  }
76844
- pnpmInstall(cwd = this.generatorCore.outputPath) {
76845
- return (0, _utils.pnpmInstall)(cwd);
76881
+ pnpmInstall({
76882
+ cwd,
76883
+ registryUrl,
76884
+ ignoreScripts
76885
+ }) {
76886
+ return (0, _utils.pnpmInstall)({
76887
+ cwd: cwd || this.generatorCore.outputPath,
76888
+ registryUrl,
76889
+ ignoreScripts
76890
+ });
76846
76891
  }
76847
76892
  };
76848
76893
  exports.NpmAPI = NpmAPI;
@@ -77628,11 +77673,11 @@ var require_utils4 = __commonJSMin((exports, module2) => {
77628
77673
  function isBlob(val) {
77629
77674
  return toString5.call(val) === "[object Blob]";
77630
77675
  }
77631
- function isFunction(val) {
77676
+ function isFunction2(val) {
77632
77677
  return toString5.call(val) === "[object Function]";
77633
77678
  }
77634
77679
  function isStream(val) {
77635
- return isObject5(val) && isFunction(val.pipe);
77680
+ return isObject5(val) && isFunction2(val.pipe);
77636
77681
  }
77637
77682
  function isURLSearchParams(val) {
77638
77683
  return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
@@ -77713,7 +77758,7 @@ var require_utils4 = __commonJSMin((exports, module2) => {
77713
77758
  isDate,
77714
77759
  isFile,
77715
77760
  isBlob,
77716
- isFunction,
77761
+ isFunction: isFunction2,
77717
77762
  isStream,
77718
77763
  isURLSearchParams,
77719
77764
  isStandardBrowserEnv,
@@ -85429,15 +85474,15 @@ var require_utils6 = __commonJSMin((exports) => {
85429
85474
  }
85430
85475
  var toString5 = Object.prototype.toString;
85431
85476
  exports.toString = toString5;
85432
- var isFunction = function isFunction2(value) {
85477
+ var isFunction2 = function isFunction3(value) {
85433
85478
  return typeof value === "function";
85434
85479
  };
85435
- if (isFunction(/x/)) {
85436
- exports.isFunction = isFunction = function(value) {
85480
+ if (isFunction2(/x/)) {
85481
+ exports.isFunction = isFunction2 = function(value) {
85437
85482
  return typeof value === "function" && toString5.call(value) === "[object Function]";
85438
85483
  };
85439
85484
  }
85440
- exports.isFunction = isFunction;
85485
+ exports.isFunction = isFunction2;
85441
85486
  var isArray4 = Array.isArray || function(value) {
85442
85487
  return value && typeof value === "object" ? toString5.call(value) === "[object Array]" : false;
85443
85488
  };
@@ -93504,14 +93549,14 @@ var require_isFunction = __commonJSMin((exports, module2) => {
93504
93549
  var funcTag = "[object Function]";
93505
93550
  var genTag = "[object GeneratorFunction]";
93506
93551
  var proxyTag = "[object Proxy]";
93507
- function isFunction(value) {
93552
+ function isFunction2(value) {
93508
93553
  if (!isObject5(value)) {
93509
93554
  return false;
93510
93555
  }
93511
93556
  var tag = baseGetTag(value);
93512
93557
  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
93513
93558
  }
93514
- module2.exports = isFunction;
93559
+ module2.exports = isFunction2;
93515
93560
  });
93516
93561
  var require_coreJsData = __commonJSMin((exports, module2) => {
93517
93562
  var root = require_root();
@@ -93548,7 +93593,7 @@ var require_toSource = __commonJSMin((exports, module2) => {
93548
93593
  module2.exports = toSource;
93549
93594
  });
93550
93595
  var require_baseIsNative = __commonJSMin((exports, module2) => {
93551
- var isFunction = require_isFunction();
93596
+ var isFunction2 = require_isFunction();
93552
93597
  var isMasked = require_isMasked();
93553
93598
  var isObject5 = require_isObject();
93554
93599
  var toSource = require_toSource();
@@ -93563,7 +93608,7 @@ var require_baseIsNative = __commonJSMin((exports, module2) => {
93563
93608
  if (!isObject5(value) || isMasked(value)) {
93564
93609
  return false;
93565
93610
  }
93566
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
93611
+ var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
93567
93612
  return pattern.test(toSource(value));
93568
93613
  }
93569
93614
  module2.exports = baseIsNative;
@@ -93762,10 +93807,10 @@ var require_isLength = __commonJSMin((exports, module2) => {
93762
93807
  module2.exports = isLength;
93763
93808
  });
93764
93809
  var require_isArrayLike = __commonJSMin((exports, module2) => {
93765
- var isFunction = require_isFunction();
93810
+ var isFunction2 = require_isFunction();
93766
93811
  var isLength = require_isLength();
93767
93812
  function isArrayLike(value) {
93768
- return value != null && isLength(value.length) && !isFunction(value);
93813
+ return value != null && isLength(value.length) && !isFunction2(value);
93769
93814
  }
93770
93815
  module2.exports = isArrayLike;
93771
93816
  });
@@ -95678,10 +95723,10 @@ var require_isFunction2 = __commonJSMin((exports) => {
95678
95723
  "use strict";
95679
95724
  Object.defineProperty(exports, "__esModule", { value: true });
95680
95725
  exports.isFunction = void 0;
95681
- function isFunction(value) {
95726
+ function isFunction2(value) {
95682
95727
  return typeof value === "function";
95683
95728
  }
95684
- exports.isFunction = isFunction;
95729
+ exports.isFunction = isFunction2;
95685
95730
  });
95686
95731
  var require_createErrorClass = __commonJSMin((exports) => {
95687
95732
  "use strict";
@@ -129789,7 +129834,7 @@ var require_baseMergeDeep = __commonJSMin((exports, module2) => {
129789
129834
  var isArray4 = require_isArray();
129790
129835
  var isArrayLikeObject = require_isArrayLikeObject();
129791
129836
  var isBuffer = require_isBuffer();
129792
- var isFunction = require_isFunction();
129837
+ var isFunction2 = require_isFunction();
129793
129838
  var isObject5 = require_isObject();
129794
129839
  var isPlainObject = require_isPlainObject();
129795
129840
  var isTypedArray = require_isTypedArray();
@@ -129824,7 +129869,7 @@ var require_baseMergeDeep = __commonJSMin((exports, module2) => {
129824
129869
  newValue = objValue;
129825
129870
  if (isArguments(objValue)) {
129826
129871
  newValue = toPlainObject(objValue);
129827
- } else if (!isObject5(objValue) || isFunction(objValue)) {
129872
+ } else if (!isObject5(objValue) || isFunction2(objValue)) {
129828
129873
  newValue = initCloneObject(srcValue);
129829
129874
  }
129830
129875
  } else {
@@ -143784,7 +143829,7 @@ function getQuestionFromSchema(schema) {
143784
143829
  }
143785
143830
  var questions = fields.map(function(field) {
143786
143831
  var _field = properties[field], type = _field.type, title = _field.title, defaultValue = _field["default"], items5 = _field["enum"], fieldValidate = _field["x-validate"], extra = _objectWithoutProperties(_field, _excluded2);
143787
- if (type === "void") {
143832
+ if (type === "void" || type === "object") {
143788
143833
  return getQuestionFromSchema(properties[field], configValue, validateMap, initValue);
143789
143834
  }
143790
143835
  if (type !== "string" && type !== "number") {
@@ -143802,7 +143847,9 @@ function getQuestionFromSchema(schema) {
143802
143847
  break;
143803
143848
  }
143804
143849
  _context.next = 3;
143805
- return validate4(input, fieldValidate);
143850
+ return validate4(input, (0, import_lodash3.isFunction)(fieldValidate) ? {
143851
+ validator: fieldValidate
143852
+ } : fieldValidate);
143806
143853
  case 3:
143807
143854
  _result = _context.sent;
143808
143855
  if (!((_result$error = _result.error) !== null && _result$error !== void 0 && _result$error.length)) {
@@ -144225,10 +144272,12 @@ var init_inquirer = __esmMin(() => {
144225
144272
  });
144226
144273
  var treeshaking_exports4 = {};
144227
144274
  __export2(treeshaking_exports4, {
144228
- CLIReader: () => CLIReader
144275
+ CLIReader: () => CLIReader,
144276
+ validate: () => validate4
144229
144277
  });
144230
144278
  var init_treeshaking4 = __esmMin(() => {
144231
144279
  init_inquirer();
144280
+ init_esm4();
144232
144281
  });
144233
144282
  function getObjKeyMap2(obj) {
144234
144283
  var prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
@@ -144912,7 +144961,7 @@ var require_node9 = __commonJSMin((exports) => {
144912
144961
  }
144913
144962
  return true;
144914
144963
  }
144915
- async runInstall(command) {
144964
+ async runInstall(command, options3) {
144916
144965
  const {
144917
144966
  config: {
144918
144967
  packageManager,
@@ -144926,11 +144975,11 @@ var require_node9 = __commonJSMin((exports) => {
144926
144975
  if (command) {
144927
144976
  intallPromise = (0, _utils.execa)(command);
144928
144977
  } else if (packageManager === "pnpm") {
144929
- intallPromise = this.npmApi.pnpmInstall();
144978
+ intallPromise = this.npmApi.pnpmInstall(options3 || {});
144930
144979
  } else if (packageManager === "yarn") {
144931
- intallPromise = this.npmApi.yarnInstall();
144980
+ intallPromise = this.npmApi.yarnInstall(options3 || {});
144932
144981
  } else {
144933
- intallPromise = this.npmApi.npmInstall();
144982
+ intallPromise = this.npmApi.npmInstall(options3 || {});
144934
144983
  }
144935
144984
  try {
144936
144985
  await intallPromise;
@@ -145023,6 +145072,21 @@ var require_node9 = __commonJSMin((exports) => {
145023
145072
  throw new Error("run sub generator failed");
145024
145073
  }
145025
145074
  }
145075
+ mergeAnswers(answers, configValue) {
145076
+ const inputData = (0, _lodash.merge)(answers, configValue);
145077
+ this.generatorContext.config = (0, _lodash.merge)(this.generatorContext.config, inputData);
145078
+ return inputData;
145079
+ }
145080
+ async getInputBySchemaFunc(schemaFunc, configValue = {}, validateMap = {}, initValue = {}) {
145081
+ const reader = new _codesmithFormily.CLIReader({
145082
+ schema: schemaFunc(configValue),
145083
+ validateMap,
145084
+ initValue
145085
+ });
145086
+ reader.setAnswers(configValue);
145087
+ const answers = await reader.start();
145088
+ return this.mergeAnswers(answers, configValue);
145089
+ }
145026
145090
  async getInputBySchema(schema, configValue = {}, validateMap = {}, initValue = {}, type = "easy-form") {
145027
145091
  if (type === "easy-form") {
145028
145092
  const reader = new _easyFormCli.CliReader({
@@ -145033,9 +145097,7 @@ var require_node9 = __commonJSMin((exports) => {
145033
145097
  return new Promise((resolve, reject) => {
145034
145098
  reader.startQuestion({
145035
145099
  onComplete: (answers) => {
145036
- const inputData = (0, _lodash.merge)(answers, configValue);
145037
- this.generatorContext.config = (0, _lodash.merge)(this.generatorContext.config, inputData);
145038
- resolve(inputData);
145100
+ resolve(this.mergeAnswers(answers, configValue));
145039
145101
  },
145040
145102
  onError: (error) => {
145041
145103
  reject(error);
@@ -145049,10 +145111,11 @@ var require_node9 = __commonJSMin((exports) => {
145049
145111
  initValue
145050
145112
  });
145051
145113
  reader.setAnswers(configValue);
145052
- return reader.start();
145114
+ const answers = await reader.start();
145115
+ return this.mergeAnswers(answers, configValue);
145053
145116
  } else {
145054
- const result = await _inquirer.default.prompt((0, _transform.transformInquirerSchema)(schema, configValue, validateMap, initValue));
145055
- return _objectSpread(_objectSpread({}, configValue), result);
145117
+ const answers = await _inquirer.default.prompt((0, _transform.transformInquirerSchema)(schema, configValue, validateMap, initValue));
145118
+ return this.mergeAnswers(answers, configValue);
145056
145119
  }
145057
145120
  }
145058
145121
  };
@@ -146144,6 +146207,6 @@ var src_default = async (context, generator) => {
146144
146207
  } catch (e) {
146145
146208
  process.exit(1);
146146
146209
  }
146147
- await appApi.runInstall();
146210
+ await appApi.runInstall(void 0, { ignoreScripts: true });
146148
146211
  generator.logger.debug(`forge @modern-js/bff-generator succeed `);
146149
146212
  };
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
  "types": "./src/index.ts",
17
17
  "main": "./dist/index.js",
@@ -21,13 +21,13 @@
21
21
  ],
22
22
  "devDependencies": {
23
23
  "@babel/runtime": "^7.18.0",
24
- "@modern-js/codesmith": "1.6.1",
25
- "@modern-js/codesmith-api-app": "1.6.1",
26
- "@modern-js/codesmith-api-json": "1.6.1",
27
- "@modern-js/generator-common": "2.4.4",
28
- "@modern-js/generator-utils": "2.4.4",
29
- "@scripts/build": "1.20.1",
30
- "@scripts/jest-config": "1.20.1",
24
+ "@modern-js/codesmith": "1.6.3",
25
+ "@modern-js/codesmith-api-app": "1.6.3",
26
+ "@modern-js/codesmith-api-json": "1.6.3",
27
+ "@modern-js/generator-common": "2.4.6",
28
+ "@modern-js/generator-utils": "2.4.6",
29
+ "@scripts/build": "1.21.1",
30
+ "@scripts/jest-config": "1.21.1",
31
31
  "@types/jest": "^27",
32
32
  "@types/node": "^14",
33
33
  "jest": "^27",