@modern-js/bff-generator 3.2.11 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +78 -120
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -14527,9 +14527,9 @@ var require_ejs = __commonJS({
14527
14527
  }
14528
14528
  });
14529
14529
 
14530
- // ../../../../node_modules/.pnpm/@modern-js+utils@2.37.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
14530
+ // ../../../../node_modules/.pnpm/@modern-js+utils@2.39.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
14531
14531
  var require_chalk = __commonJS({
14532
- "../../../../node_modules/.pnpm/@modern-js+utils@2.37.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
14532
+ "../../../../node_modules/.pnpm/@modern-js+utils@2.39.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
14533
14533
  "use strict";
14534
14534
  (() => {
14535
14535
  var e = { 44: (e2, t2, n2) => {
@@ -52693,7 +52693,7 @@ var import_path6 = __toESM(require("path"));
52693
52693
  var import_path = __toESM(require("path"));
52694
52694
  var import_utils4 = require("@modern-js/utils");
52695
52695
 
52696
- // ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
52696
+ // ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_define_property.js
52697
52697
  function _define_property(obj, key, value) {
52698
52698
  if (key in obj) {
52699
52699
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
@@ -52802,7 +52802,8 @@ var ZH_LOCALE = {
52802
52802
  polyfill: "启用「基于 UA 的 Polyfill」功能",
52803
52803
  proxy: "启用「全局代理」",
52804
52804
  swc: "启用「SWC 编译」",
52805
- rspack: "启用「Rspack 构建」(实验性)"
52805
+ rspack: "启用「Rspack 构建」(实验性)",
52806
+ module_doc: "启动「模块文档」功能"
52806
52807
  },
52807
52808
  element: {
52808
52809
  self: "创建工程元素",
@@ -52900,7 +52901,8 @@ var EN_LOCALE = {
52900
52901
  polyfill: "Enable UA-based Polyfill Feature",
52901
52902
  proxy: "Enable Global Proxy",
52902
52903
  swc: "Enable SWC Compile",
52903
- rspack: "Enable Rspack Build (experimental)"
52904
+ rspack: "Enable Rspack Build (experimental)",
52905
+ module_doc: "Enable Module Doc"
52904
52906
  },
52905
52907
  element: {
52906
52908
  self: "Create Element",
@@ -52979,28 +52981,10 @@ var SubSolution;
52979
52981
  SubSolution2["MWA"] = "mwa";
52980
52982
  SubSolution2["Module"] = "module";
52981
52983
  })(SubSolution || (SubSolution = {}));
52982
- var SolutionText = {
52983
- [Solution.MWA]: () => i18n.t(localeKeys.solution.mwa),
52984
- [Solution.Module]: () => i18n.t(localeKeys.solution.module),
52985
- [Solution.Monorepo]: () => i18n.t(localeKeys.solution.monorepo)
52986
- };
52987
- var SubSolutionText = {
52988
- [SubSolution.MWA]: () => i18n.t(localeKeys.sub_solution.mwa),
52989
- [SubSolution.Module]: () => i18n.t(localeKeys.sub_solution.module)
52990
- };
52991
52984
  var SolutionToolsMap = {
52992
- [Solution.MWA]: "@modern-js/app-tools",
52993
- [Solution.Module]: "@modern-js/module-tools",
52994
- [Solution.Monorepo]: "@modern-js/monorepo-tools"
52995
- };
52996
- var SolutionGenerator = {
52997
- [Solution.MWA]: "@modern-js/mwa-generator",
52998
- [Solution.Module]: "@modern-js/module-generator",
52999
- [Solution.Monorepo]: "@modern-js/monorepo-generator"
53000
- };
53001
- var SubSolutionGenerator = {
53002
- [SubSolution.MWA]: "@modern-js/mwa-generator",
53003
- [SubSolution.Module]: "@modern-js/module-generator"
52985
+ ["mwa"]: "@modern-js/app-tools",
52986
+ ["module"]: "@modern-js/module-tools",
52987
+ ["monorepo"]: "@modern-js/monorepo-tools"
53004
52988
  };
53005
52989
 
53006
52990
  // ../../generator-common/dist/esm-node/common/language.js
@@ -53009,10 +52993,6 @@ var Language;
53009
52993
  Language2["TS"] = "ts";
53010
52994
  Language2["JS"] = "js";
53011
52995
  })(Language || (Language = {}));
53012
- var LanguageName = {
53013
- [Language.TS]: "TS",
53014
- [Language.JS]: "ES6+"
53015
- };
53016
52996
 
53017
52997
  // ../../generator-common/dist/esm-node/mwa/common.js
53018
52998
  var Framework;
@@ -53036,8 +53016,8 @@ var getFrameworkSchema = (_extra = {}) => {
53036
53016
  };
53037
53017
  };
53038
53018
  var FrameworkAppendTypeContent = {
53039
- [Framework.Express]: `/// <reference types='@modern-js/plugin-express/types' />`,
53040
- [Framework.Koa]: `/// <reference types='@modern-js/plugin-koa/types' />`
53019
+ ["express"]: `/// <reference types='@modern-js/plugin-express/types' />`,
53020
+ ["koa"]: `/// <reference types='@modern-js/plugin-koa/types' />`
53041
53021
  };
53042
53022
 
53043
53023
  // ../../generator-common/dist/esm-node/mwa/bff.js
@@ -53069,7 +53049,7 @@ var getBFFSchema = (extra = {}) => {
53069
53049
  };
53070
53050
  };
53071
53051
  var MWADefaultBffConfig = {
53072
- bffType: BFFType.Func,
53052
+ bffType: "func",
53073
53053
  frameWork: Framework.Express
53074
53054
  };
53075
53055
 
@@ -53101,49 +53081,12 @@ var ActionFunction;
53101
53081
  ActionFunction2["Proxy"] = "proxy";
53102
53082
  ActionFunction2["SWC"] = "swc";
53103
53083
  ActionFunction2["Rspack"] = "rspack";
53084
+ ActionFunction2["ModuleDoc"] = "module_doc";
53104
53085
  })(ActionFunction || (ActionFunction = {}));
53105
53086
  var ActionRefactor;
53106
53087
  (function(ActionRefactor2) {
53107
53088
  ActionRefactor2["ReactRouter5"] = "react_router_5";
53108
53089
  })(ActionRefactor || (ActionRefactor = {}));
53109
- var ActionTypeText = {
53110
- [ActionType.Function]: () => i18n.t(localeKeys.action.function.self),
53111
- [ActionType.Element]: () => i18n.t(localeKeys.action.element.self),
53112
- [ActionType.Refactor]: () => i18n.t(localeKeys.action.refactor.self)
53113
- };
53114
- var ActionTypeQuestionText = {
53115
- [ActionType.Function]: () => i18n.t(localeKeys.action.function.question),
53116
- [ActionType.Element]: () => i18n.t(localeKeys.action.element.question),
53117
- [ActionType.Refactor]: () => i18n.t(localeKeys.action.refactor.question)
53118
- };
53119
- var ActionElementText = {
53120
- [ActionElement.Entry]: () => i18n.t(localeKeys.action.element.entry),
53121
- [ActionElement.Server]: () => i18n.t(localeKeys.action.element.server)
53122
- };
53123
- var ActionFunctionText = {
53124
- [ActionFunction.TailwindCSS]: () => i18n.t(localeKeys.action.function.tailwindcss),
53125
- [ActionFunction.BFF]: () => i18n.t(localeKeys.action.function.bff),
53126
- [ActionFunction.MicroFrontend]: () => i18n.t(localeKeys.action.function.micro_frontend),
53127
- [ActionFunction.I18n]: () => i18n.t(localeKeys.action.function.i18n),
53128
- [ActionFunction.Test]: () => i18n.t(localeKeys.action.function.test),
53129
- [ActionFunction.E2ETest]: () => i18n.t(localeKeys.action.function.e2e_test),
53130
- [ActionFunction.Storybook]: () => i18n.t(localeKeys.action.function.storybook),
53131
- [ActionFunction.StorybookV7]: () => i18n.t(localeKeys.action.function.storybookV7),
53132
- [ActionFunction.RuntimeApi]: () => i18n.t(localeKeys.action.function.runtime_api),
53133
- [ActionFunction.SSG]: () => i18n.t(localeKeys.action.function.ssg),
53134
- [ActionFunction.Polyfill]: () => i18n.t(localeKeys.action.function.polyfill),
53135
- [ActionFunction.Proxy]: () => i18n.t(localeKeys.action.function.proxy),
53136
- [ActionFunction.SWC]: () => i18n.t(localeKeys.action.function.swc),
53137
- [ActionFunction.Rspack]: () => i18n.t(localeKeys.action.function.rspack)
53138
- };
53139
- var ActionRefactorText = {
53140
- [ActionRefactor.ReactRouter5]: () => i18n.t(localeKeys.action.refactor.react_router_5)
53141
- };
53142
- var ActionTypeTextMap = {
53143
- [ActionType.Element]: ActionElementText,
53144
- [ActionType.Function]: ActionFunctionText,
53145
- [ActionType.Refactor]: ActionRefactorText
53146
- };
53147
53090
 
53148
53091
  // ../../generator-common/dist/esm-node/newAction/mwa/index.js
53149
53092
  var MWAActionTypes = [
@@ -53464,12 +53407,21 @@ async function getModernConfigFile(appDir) {
53464
53407
  return isTsProject(appDir) ? "modern.config.ts" : "modern.config.js";
53465
53408
  }
53466
53409
 
53467
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
53410
+ // ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
53411
+ function _define_property2(obj, key, value) {
53412
+ if (key in obj) {
53413
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
53414
+ } else
53415
+ obj[key] = value;
53416
+ return obj;
53417
+ }
53418
+
53419
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
53468
53420
  var import_utils18 = require("@modern-js/utils");
53469
53421
  var import_lodash7 = require("@modern-js/utils/lodash");
53470
53422
  var import_comment_json = __toESM(require_src2());
53471
53423
 
53472
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.0/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
53424
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
53473
53425
  var import_utils6 = require("@modern-js/utils");
53474
53426
  async function canUseNvm() {
53475
53427
  try {
@@ -53519,7 +53471,7 @@ async function canUsePnpm3() {
53519
53471
  }
53520
53472
  }
53521
53473
 
53522
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.0/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
53474
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
53523
53475
  var import_utils7 = require("@modern-js/utils");
53524
53476
  function execaWithStreamLog(command, args, options) {
53525
53477
  const promise = (0, import_utils7.execa)(command, args, {
@@ -53615,7 +53567,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
53615
53567
  throw new Error("please install pnpm first");
53616
53568
  }
53617
53569
 
53618
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.0/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
53570
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
53619
53571
  var NpmAPI = class {
53620
53572
  npmInstall({ cwd, registryUrl, ignoreScripts }) {
53621
53573
  return npmInstall({
@@ -53639,12 +53591,12 @@ var NpmAPI = class {
53639
53591
  });
53640
53592
  }
53641
53593
  constructor(generatorCore) {
53642
- _define_property(this, "generatorCore", void 0);
53594
+ _define_property2(this, "generatorCore", void 0);
53643
53595
  this.generatorCore = generatorCore;
53644
53596
  }
53645
53597
  };
53646
53598
 
53647
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.0_@modern-js+codesmith@2.3.0/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
53599
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
53648
53600
  var import_utils9 = require("@modern-js/utils");
53649
53601
  async function canUseGit() {
53650
53602
  try {
@@ -53719,7 +53671,7 @@ async function gitCommit(cwd, commitMessage) {
53719
53671
  });
53720
53672
  }
53721
53673
 
53722
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.0_@modern-js+codesmith@2.3.0/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
53674
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
53723
53675
  var GitAPI = class {
53724
53676
  async isInGitRepo(cwd = this.generatorCore.outputPath) {
53725
53677
  const canUse = await canUseGit();
@@ -53764,19 +53716,19 @@ var GitAPI = class {
53764
53716
  }
53765
53717
  }
53766
53718
  constructor(generatorCore, generatorContext) {
53767
- _define_property(this, "generatorCore", void 0);
53768
- _define_property(this, "generatorContext", void 0);
53719
+ _define_property2(this, "generatorCore", void 0);
53720
+ _define_property2(this, "generatorContext", void 0);
53769
53721
  this.generatorCore = generatorCore;
53770
53722
  this.generatorContext = generatorContext;
53771
53723
  }
53772
53724
  };
53773
53725
 
53774
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.0/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
53726
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
53775
53727
  var import_path2 = __toESM(require("path"));
53776
53728
  var import_utils11 = require("@modern-js/utils");
53777
53729
  var FS_RESOURCE = "_codesmith_core_fs_resource";
53778
53730
 
53779
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.0/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
53731
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
53780
53732
  var import_utils12 = require("@modern-js/utils");
53781
53733
  async function fsExists(path6) {
53782
53734
  try {
@@ -53787,7 +53739,7 @@ async function fsExists(path6) {
53787
53739
  }
53788
53740
  }
53789
53741
 
53790
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.0_@modern-js+codesmith@2.3.0/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
53742
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
53791
53743
  var import_handlebars = __toESM(require_lib());
53792
53744
  function renderString(template, fullData, registers) {
53793
53745
  const helpers = {
@@ -53801,7 +53753,7 @@ function renderString(template, fullData, registers) {
53801
53753
  return import_handlebars.default.compile(template)(fullData) || "";
53802
53754
  }
53803
53755
 
53804
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.0_@modern-js+codesmith@2.3.0/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
53756
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
53805
53757
  var HandlebarsAPI = class {
53806
53758
  async registerHelp(helpers) {
53807
53759
  this.registers.helpers = {
@@ -53841,8 +53793,8 @@ var HandlebarsAPI = class {
53841
53793
  );
53842
53794
  }
53843
53795
  constructor(generatorCore, registers) {
53844
- _define_property(this, "generatorCore", void 0);
53845
- _define_property(this, "registers", void 0);
53796
+ _define_property2(this, "generatorCore", void 0);
53797
+ _define_property2(this, "registers", void 0);
53846
53798
  this.generatorCore = generatorCore;
53847
53799
  this.registers = registers || {
53848
53800
  helpers: {},
@@ -53851,13 +53803,13 @@ var HandlebarsAPI = class {
53851
53803
  }
53852
53804
  };
53853
53805
 
53854
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.0_@modern-js+codesmith@2.3.0/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
53806
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
53855
53807
  var import_ejs = __toESM(require_ejs());
53856
53808
  function renderString2(template, fullData) {
53857
53809
  return import_ejs.default.render(template, fullData) || "";
53858
53810
  }
53859
53811
 
53860
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.0_@modern-js+codesmith@2.3.0/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
53812
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
53861
53813
  var EjsAPI = class {
53862
53814
  async renderTemplate(templateResource, target, parameters = {}) {
53863
53815
  if (templateResource._type !== FS_RESOURCE) {
@@ -53885,12 +53837,12 @@ var EjsAPI = class {
53885
53837
  );
53886
53838
  }
53887
53839
  constructor(generatorCore) {
53888
- _define_property(this, "generatorCore", void 0);
53840
+ _define_property2(this, "generatorCore", void 0);
53889
53841
  this.generatorCore = generatorCore;
53890
53842
  }
53891
53843
  };
53892
53844
 
53893
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.0_@modern-js+codesmith@2.3.0/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
53845
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
53894
53846
  var import_path3 = __toESM(require("path"));
53895
53847
  var import_utils15 = require("@modern-js/utils");
53896
53848
  var FsAPI = class {
@@ -53913,7 +53865,7 @@ var FsAPI = class {
53913
53865
  }));
53914
53866
  }
53915
53867
  constructor(generatorCore) {
53916
- _define_property(this, "generatorCore", void 0);
53868
+ _define_property2(this, "generatorCore", void 0);
53917
53869
  this.generatorCore = generatorCore;
53918
53870
  }
53919
53871
  };
@@ -63474,10 +63426,10 @@ var Schema = (
63474
63426
  }()
63475
63427
  );
63476
63428
 
63477
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
63429
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
63478
63430
  var import_inquirer = __toESM(require_inquirer());
63479
63431
 
63480
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
63432
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
63481
63433
  var import_lodash3 = require("@modern-js/utils/lodash");
63482
63434
  function validateSchema(schema) {
63483
63435
  const { type, properties } = schema;
@@ -63569,7 +63521,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
63569
63521
  return getQuestionFromSchema(schema, configValue, validateMap, initValue);
63570
63522
  }
63571
63523
 
63572
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
63524
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
63573
63525
  var compileRule = (rule, scope) => {
63574
63526
  const state = Schema.compile(rule, {
63575
63527
  $self: {},
@@ -63673,7 +63625,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
63673
63625
  return answers;
63674
63626
  }
63675
63627
 
63676
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
63628
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
63677
63629
  var CLIReader = class {
63678
63630
  getAnswers() {
63679
63631
  return this.answers;
@@ -63693,10 +63645,10 @@ var CLIReader = class {
63693
63645
  return answers;
63694
63646
  }
63695
63647
  constructor(options) {
63696
- _define_property(this, "schema", null);
63697
- _define_property(this, "validateMap", void 0);
63698
- _define_property(this, "initValue", void 0);
63699
- _define_property(this, "answers", {});
63648
+ _define_property2(this, "schema", null);
63649
+ _define_property2(this, "validateMap", void 0);
63650
+ _define_property2(this, "initValue", void 0);
63651
+ _define_property2(this, "answers", {});
63700
63652
  const { schema, validateMap, initValue } = options;
63701
63653
  this.schema = schema;
63702
63654
  this.validateMap = validateMap || {};
@@ -63704,7 +63656,7 @@ var CLIReader = class {
63704
63656
  }
63705
63657
  };
63706
63658
 
63707
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
63659
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
63708
63660
  var import_inquirer2 = __toESM(require_inquirer2());
63709
63661
 
63710
63662
  // ../../../../node_modules/.pnpm/@modern-js+plugin-i18n@2.37.2/node_modules/@modern-js/plugin-i18n/dist/esm-node/index.js
@@ -63765,12 +63717,12 @@ var I18n2 = class {
63765
63717
  };
63766
63718
  }
63767
63719
  constructor() {
63768
- _define_property(this, "language", "en");
63769
- _define_property(this, "languageMap", {});
63720
+ _define_property2(this, "language", "en");
63721
+ _define_property2(this, "languageMap", {});
63770
63722
  }
63771
63723
  };
63772
63724
 
63773
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
63725
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
63774
63726
  var ZH_LOCALE2 = {
63775
63727
  environment: {
63776
63728
  node_version: "请升级 Node 版本至 LIS",
@@ -63797,7 +63749,7 @@ var ZH_LOCALE2 = {
63797
63749
  }
63798
63750
  };
63799
63751
 
63800
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
63752
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
63801
63753
  var EN_LOCALE2 = {
63802
63754
  environment: {
63803
63755
  node_version: "please upgrade node to lts version",
@@ -63824,14 +63776,14 @@ var EN_LOCALE2 = {
63824
63776
  }
63825
63777
  };
63826
63778
 
63827
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
63779
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
63828
63780
  var i18n2 = new I18n2();
63829
63781
  var localeKeys2 = i18n2.init("zh", {
63830
63782
  zh: ZH_LOCALE2,
63831
63783
  en: EN_LOCALE2
63832
63784
  });
63833
63785
 
63834
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
63786
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
63835
63787
  var import_lodash6 = require("@modern-js/utils/lodash");
63836
63788
  function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
63837
63789
  for (const question of questions) {
@@ -63859,7 +63811,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
63859
63811
  return questions;
63860
63812
  }
63861
63813
 
63862
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
63814
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
63863
63815
  var import_path5 = __toESM(require("path"));
63864
63816
  var import_utils17 = require("@modern-js/utils");
63865
63817
  var NODE_MAJOR_VERSION_MAP = {
@@ -63907,7 +63859,7 @@ async function checkUseNvm(cwd, logger2) {
63907
63859
  }
63908
63860
  }
63909
63861
 
63910
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.0_@modern-js+codesmith@2.3.0_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
63862
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
63911
63863
  var AppAPI = class {
63912
63864
  async checkEnvironment(nodeVersion) {
63913
63865
  if (import_utils18.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
@@ -63996,6 +63948,7 @@ var AppAPI = class {
63996
63948
  }
63997
63949
  async forgeTemplate(templatePattern, filter, rename, parameters, type = "handlebars") {
63998
63950
  try {
63951
+ this.generatorCore.logger.timing(`forgeTemplate`);
63999
63952
  const { material } = this.generatorContext.current;
64000
63953
  const resourceMap = await material.find(templatePattern, {
64001
63954
  nodir: true,
@@ -64016,10 +63969,13 @@ var AppAPI = class {
64016
63969
  this.generatorCore.logger.debug("base forging failed:", e);
64017
63970
  this.generatorCore.logger.warn(i18n2.t(localeKeys2.templated.failed));
64018
63971
  throw new Error("base forging failed");
63972
+ } finally {
63973
+ this.generatorCore.logger.timing(`forgeTemplate`, true);
64019
63974
  }
64020
63975
  }
64021
63976
  async renderTemplateByFileType(templatePattern, filter, rename, parameters) {
64022
63977
  try {
63978
+ this.generatorCore.logger.timing(`renderTemplateByFileType`);
64023
63979
  const { material } = this.generatorContext.current;
64024
63980
  const resourceMap = await material.find(templatePattern, {
64025
63981
  nodir: true,
@@ -64050,6 +64006,8 @@ var AppAPI = class {
64050
64006
  this.generatorCore.logger.debug("base forging failed:", e);
64051
64007
  this.generatorCore.logger.warn(i18n2.t(localeKeys2.templated.failed));
64052
64008
  throw new Error("base forging failed");
64009
+ } finally {
64010
+ this.generatorCore.logger.timing(`renderTemplateByFileType`, true);
64053
64011
  }
64054
64012
  }
64055
64013
  async updateWorkspace(folder, workspaceName = "monorepo.code-workspace") {
@@ -64119,14 +64077,14 @@ var AppAPI = class {
64119
64077
  }
64120
64078
  }
64121
64079
  constructor(generatorContext, generatorCore) {
64122
- _define_property(this, "i18n", i18n2);
64123
- _define_property(this, "npmApi", void 0);
64124
- _define_property(this, "gitApi", void 0);
64125
- _define_property(this, "handlebarsAPI", void 0);
64126
- _define_property(this, "ejsAPI", void 0);
64127
- _define_property(this, "fsAPI", void 0);
64128
- _define_property(this, "generatorCore", void 0);
64129
- _define_property(this, "generatorContext", void 0);
64080
+ _define_property2(this, "i18n", i18n2);
64081
+ _define_property2(this, "npmApi", void 0);
64082
+ _define_property2(this, "gitApi", void 0);
64083
+ _define_property2(this, "handlebarsAPI", void 0);
64084
+ _define_property2(this, "ejsAPI", void 0);
64085
+ _define_property2(this, "fsAPI", void 0);
64086
+ _define_property2(this, "generatorCore", void 0);
64087
+ _define_property2(this, "generatorContext", void 0);
64130
64088
  this.generatorCore = generatorCore;
64131
64089
  this.generatorContext = generatorContext;
64132
64090
  this.npmApi = new NpmAPI(generatorCore);
@@ -64137,11 +64095,11 @@ var AppAPI = class {
64137
64095
  }
64138
64096
  };
64139
64097
 
64140
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.0/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
64098
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
64141
64099
  var import_comment_json2 = __toESM(require_src2());
64142
64100
  var declarationUpdate = __toESM(require_dist());
64143
64101
 
64144
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.0/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
64102
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
64145
64103
  async function editJson(generatorCore, resource, getNewJsonValue) {
64146
64104
  const originJsonValue = await resource.value();
64147
64105
  const newJsonString = await getNewJsonValue(originJsonValue.content);
@@ -64154,7 +64112,7 @@ async function editJson(generatorCore, resource, getNewJsonValue) {
64154
64112
  return newJsonString;
64155
64113
  }
64156
64114
 
64157
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.0/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
64115
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
64158
64116
  var JsonAPI = class {
64159
64117
  async get(resource) {
64160
64118
  const originJsonValue = await resource.value();
@@ -64194,7 +64152,7 @@ var JsonAPI = class {
64194
64152
  });
64195
64153
  }
64196
64154
  constructor(generatorCore) {
64197
- _define_property(this, "generatorCore", void 0);
64155
+ _define_property2(this, "generatorCore", void 0);
64198
64156
  this.generatorCore = generatorCore;
64199
64157
  }
64200
64158
  };
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.2.11",
18
+ "version": "3.3.1",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./src/index.ts",
21
21
  "main": "./dist/index.js",
@@ -24,21 +24,21 @@
24
24
  "/dist/index.js"
25
25
  ],
26
26
  "dependencies": {
27
- "@modern-js/utils": "2.40.0"
27
+ "@modern-js/utils": "2.42.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@modern-js/codesmith": "2.3.0",
31
- "@modern-js/codesmith-api-app": "2.3.0",
32
- "@modern-js/codesmith-api-json": "2.3.0",
30
+ "@modern-js/codesmith": "2.3.1",
31
+ "@modern-js/codesmith-api-app": "2.3.1",
32
+ "@modern-js/codesmith-api-json": "2.3.1",
33
33
  "@types/jest": "^29",
34
34
  "@types/node": "^14",
35
35
  "jest": "^29",
36
36
  "typescript": "^5",
37
- "@modern-js/generator-common": "3.2.11",
38
- "@modern-js/plugin-i18n": "2.40.0",
39
- "@modern-js/generator-utils": "3.2.11",
40
- "@scripts/build": "2.40.0",
41
- "@scripts/jest-config": "2.40.0"
37
+ "@modern-js/generator-common": "3.3.1",
38
+ "@modern-js/plugin-i18n": "2.42.0",
39
+ "@scripts/jest-config": "2.42.0",
40
+ "@modern-js/generator-utils": "3.3.1",
41
+ "@scripts/build": "2.42.0"
42
42
  },
43
43
  "sideEffects": false,
44
44
  "publishConfig": {