@modern-js/mwa-generator 3.4.15 → 3.4.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +153 -153
  2. package/package.json +13 -13
  3. package/src/index.ts +10 -13
package/dist/index.js CHANGED
@@ -6620,9 +6620,9 @@ var require_lib = __commonJS({
6620
6620
  }
6621
6621
  });
6622
6622
 
6623
- // ../../../../node_modules/.pnpm/@modern-js+utils@2.58.0/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
6623
+ // ../../../../node_modules/.pnpm/@modern-js+utils@2.58.1/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
6624
6624
  var require_chalk = __commonJS({
6625
- "../../../../node_modules/.pnpm/@modern-js+utils@2.58.0/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
6625
+ "../../../../node_modules/.pnpm/@modern-js+utils@2.58.1/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
6626
6626
  "use strict";
6627
6627
  (() => {
6628
6628
  var e = { 44: (e2, t2, n2) => {
@@ -51057,12 +51057,12 @@ __export(src_exports, {
51057
51057
  module.exports = __toCommonJS(src_exports);
51058
51058
  var import_path7 = __toESM(require("path"));
51059
51059
 
51060
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
51060
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
51061
51061
  var import_path = __toESM(require("path"));
51062
51062
  var import_utils = require("@modern-js/utils");
51063
51063
  var FS_RESOURCE = "_codesmith_core_fs_resource";
51064
51064
 
51065
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
51065
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
51066
51066
  var import_utils2 = require("@modern-js/utils");
51067
51067
  async function fsExists(path7) {
51068
51068
  try {
@@ -51073,13 +51073,13 @@ async function fsExists(path7) {
51073
51073
  }
51074
51074
  }
51075
51075
 
51076
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
51076
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
51077
51077
  var import_ejs = __toESM(require_ejs());
51078
51078
  function renderString(template, fullData) {
51079
51079
  return import_ejs.default.render(template, fullData) || "";
51080
51080
  }
51081
51081
 
51082
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
51082
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
51083
51083
  var EjsAPI = class {
51084
51084
  async renderTemplate(templateResource, target, parameters = {}) {
51085
51085
  if (templateResource._type !== FS_RESOURCE) {
@@ -51111,7 +51111,7 @@ var EjsAPI = class {
51111
51111
  }
51112
51112
  };
51113
51113
 
51114
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
51114
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
51115
51115
  var import_path2 = __toESM(require("path"));
51116
51116
  var import_utils4 = require("@modern-js/utils");
51117
51117
  var FsAPI = class {
@@ -51138,7 +51138,7 @@ var FsAPI = class {
51138
51138
  }
51139
51139
  };
51140
51140
 
51141
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
51141
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
51142
51142
  var import_utils5 = require("@modern-js/utils");
51143
51143
  async function canUseGit() {
51144
51144
  try {
@@ -51213,7 +51213,7 @@ async function gitCommit(cwd, commitMessage) {
51213
51213
  });
51214
51214
  }
51215
51215
 
51216
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
51216
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
51217
51217
  var GitAPI = class {
51218
51218
  async isInGitRepo(cwd = this.generatorCore.outputPath) {
51219
51219
  const canUse = await canUseGit();
@@ -51263,7 +51263,7 @@ var GitAPI = class {
51263
51263
  }
51264
51264
  };
51265
51265
 
51266
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
51266
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
51267
51267
  var import_handlebars = __toESM(require_lib());
51268
51268
  function renderString2(template, fullData, registers) {
51269
51269
  const helpers = {
@@ -51277,7 +51277,7 @@ function renderString2(template, fullData, registers) {
51277
51277
  return import_handlebars.default.compile(template)(fullData) || "";
51278
51278
  }
51279
51279
 
51280
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
51280
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
51281
51281
  var HandlebarsAPI = class {
51282
51282
  async registerHelp(helpers) {
51283
51283
  this.registers.helpers = {
@@ -51325,7 +51325,7 @@ var HandlebarsAPI = class {
51325
51325
  }
51326
51326
  };
51327
51327
 
51328
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.0/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
51328
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
51329
51329
  var import_utils8 = require("@modern-js/utils");
51330
51330
  async function canUseNvm() {
51331
51331
  try {
@@ -51375,7 +51375,7 @@ async function canUsePnpm() {
51375
51375
  }
51376
51376
  }
51377
51377
 
51378
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.0/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
51378
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
51379
51379
  var import_utils9 = require("@modern-js/utils");
51380
51380
  function execaWithStreamLog(command, args, options) {
51381
51381
  const promise = (0, import_utils9.execa)(command, args, {
@@ -51471,7 +51471,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
51471
51471
  throw new Error("please install pnpm first");
51472
51472
  }
51473
51473
 
51474
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.0/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
51474
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
51475
51475
  var NpmAPI = class {
51476
51476
  npmInstall({ cwd, registryUrl, ignoreScripts }) {
51477
51477
  return npmInstall({
@@ -61055,10 +61055,10 @@ var Schema = (
61055
61055
  }()
61056
61056
  );
61057
61057
 
61058
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61058
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61059
61059
  var import_inquirer = __toESM(require_inquirer());
61060
61060
 
61061
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
61061
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
61062
61062
  var import_lodash = require("@modern-js/utils/lodash");
61063
61063
  function validateSchema(schema) {
61064
61064
  const { type, properties } = schema;
@@ -61150,7 +61150,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
61150
61150
  return getQuestionFromSchema(schema, configValue, validateMap, initValue);
61151
61151
  }
61152
61152
 
61153
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61153
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61154
61154
  var compileRule = (rule, scope) => {
61155
61155
  const state = Schema.compile(rule, {
61156
61156
  $self: {},
@@ -61254,7 +61254,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
61254
61254
  return answers;
61255
61255
  }
61256
61256
 
61257
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
61257
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
61258
61258
  var CLIReader = class {
61259
61259
  getAnswers() {
61260
61260
  return this.answers;
@@ -61283,7 +61283,7 @@ var CLIReader = class {
61283
61283
  }
61284
61284
  };
61285
61285
 
61286
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
61286
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
61287
61287
  var import_utils13 = require("@modern-js/utils");
61288
61288
  var import_lodash5 = require("@modern-js/utils/lodash");
61289
61289
  var import_comment_json = __toESM(require_src2());
@@ -61352,7 +61352,7 @@ var I18n = class {
61352
61352
  }
61353
61353
  };
61354
61354
 
61355
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
61355
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
61356
61356
  var EN_LOCALE = {
61357
61357
  environment: {
61358
61358
  node_version: "please upgrade node to lts version",
@@ -61379,7 +61379,7 @@ var EN_LOCALE = {
61379
61379
  }
61380
61380
  };
61381
61381
 
61382
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
61382
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
61383
61383
  var ZH_LOCALE = {
61384
61384
  environment: {
61385
61385
  node_version: "请升级 Node 版本至 LIS",
@@ -61406,14 +61406,14 @@ var ZH_LOCALE = {
61406
61406
  }
61407
61407
  };
61408
61408
 
61409
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
61409
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
61410
61410
  var i18n = new I18n();
61411
61411
  var localeKeys = i18n.init("zh", {
61412
61412
  zh: ZH_LOCALE,
61413
61413
  en: EN_LOCALE
61414
61414
  });
61415
61415
 
61416
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
61416
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
61417
61417
  var import_path4 = __toESM(require("path"));
61418
61418
  var import_utils12 = require("@modern-js/utils");
61419
61419
  var NODE_MAJOR_VERSION_MAP = {
@@ -61461,7 +61461,7 @@ async function checkUseNvm(cwd, logger) {
61461
61461
  }
61462
61462
  }
61463
61463
 
61464
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
61464
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
61465
61465
  var import_lodash4 = require("@modern-js/utils/lodash");
61466
61466
  function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
61467
61467
  for (const question of questions) {
@@ -61489,7 +61489,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
61489
61489
  return questions;
61490
61490
  }
61491
61491
 
61492
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
61492
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
61493
61493
  var AppAPI = class {
61494
61494
  async checkEnvironment(nodeVersion) {
61495
61495
  if (import_utils13.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
@@ -61784,98 +61784,6 @@ var I18n2 = class {
61784
61784
  }
61785
61785
  };
61786
61786
 
61787
- // ../../generator-common/dist/esm-node/locale/zh.js
61788
- var ZH_LOCALE2 = {
61789
- solution: {
61790
- self: "请选择你想创建的工程类型",
61791
- mwa: "Web 应用",
61792
- module: "Npm 模块",
61793
- custom: "自定义",
61794
- default: "默认"
61795
- },
61796
- scenes: {
61797
- self: "请选择项目场景"
61798
- },
61799
- sub_solution: {
61800
- self: "请选择你想创建的工程类型",
61801
- mwa: "Web 应用",
61802
- module: "Npm 模块"
61803
- },
61804
- action: {
61805
- self: "请选择你想要的操作",
61806
- function: {
61807
- self: "启用可选功能",
61808
- question: "请选择功能名称",
61809
- tailwindcss: "启用「Tailwind CSS」 支持",
61810
- bff: "启用「BFF」功能",
61811
- micro_frontend: "启用「微前端」模式",
61812
- i18n: "启用「国际化(i18n)」功能",
61813
- storybookV7: "启用「Storybook」V7",
61814
- runtime_api: "启用「Runtime API」",
61815
- ssg: "启用「SSG」功能",
61816
- polyfill: "启用「基于 UA 的 Polyfill」功能",
61817
- proxy: "启用「全局代理」",
61818
- swc: "启用「SWC 编译」",
61819
- module_doc: "启动「模块文档」功能"
61820
- },
61821
- element: {
61822
- self: "创建工程元素",
61823
- question: "请选择创建元素类型",
61824
- entry: "新建「应用入口」",
61825
- server: "新建「自定义 Web Server」源码目录"
61826
- },
61827
- refactor: {
61828
- self: "自动重构",
61829
- question: "请选择重构类型",
61830
- react_router_5: "使用 React Router v5"
61831
- }
61832
- },
61833
- boolean: {
61834
- yes: "是",
61835
- no: "否"
61836
- },
61837
- language: {
61838
- self: "请选择开发语言"
61839
- },
61840
- packageManager: {
61841
- self: "请选择包管理工具"
61842
- },
61843
- entry: {
61844
- name: "请填写入口名称",
61845
- no_empty: "入口名称不能为空!",
61846
- no_pages: '入口名称不支持 "pages"!'
61847
- },
61848
- packageName: {
61849
- self: "请填写项目名称",
61850
- sub_name: "请填写子项目名称",
61851
- no_empty: "项目名称不能为空!"
61852
- },
61853
- packagePath: {
61854
- self: "请填写子项目目录名称",
61855
- no_empty: "目录名称不能为空!",
61856
- format: "目录名称只能使用小写字母、数字和分隔线(-)、下划线(_)和目录分隔符(/)"
61857
- },
61858
- framework: {
61859
- self: "请选择运行时框架",
61860
- egg: "Egg",
61861
- express: "Express",
61862
- koa: "Koa",
61863
- nest: "Nest"
61864
- },
61865
- bff: {
61866
- bffType: {
61867
- self: "请选择 BFF 类型",
61868
- func: "函数模式",
61869
- framework: "框架模式"
61870
- }
61871
- },
61872
- buildTools: {
61873
- self: "请选择构建工具",
61874
- webpack: "webpack",
61875
- rspack: "Rspack (实验性)"
61876
- }
61877
- };
61878
-
61879
61787
  // ../../generator-common/dist/esm-node/locale/en.js
61880
61788
  var EN_LOCALE2 = {
61881
61789
  solution: {
@@ -61968,6 +61876,98 @@ var EN_LOCALE2 = {
61968
61876
  }
61969
61877
  };
61970
61878
 
61879
+ // ../../generator-common/dist/esm-node/locale/zh.js
61880
+ var ZH_LOCALE2 = {
61881
+ solution: {
61882
+ self: "请选择你想创建的工程类型",
61883
+ mwa: "Web 应用",
61884
+ module: "Npm 模块",
61885
+ custom: "自定义",
61886
+ default: "默认"
61887
+ },
61888
+ scenes: {
61889
+ self: "请选择项目场景"
61890
+ },
61891
+ sub_solution: {
61892
+ self: "请选择你想创建的工程类型",
61893
+ mwa: "Web 应用",
61894
+ module: "Npm 模块"
61895
+ },
61896
+ action: {
61897
+ self: "请选择你想要的操作",
61898
+ function: {
61899
+ self: "启用可选功能",
61900
+ question: "请选择功能名称",
61901
+ tailwindcss: "启用「Tailwind CSS」 支持",
61902
+ bff: "启用「BFF」功能",
61903
+ micro_frontend: "启用「微前端」模式",
61904
+ i18n: "启用「国际化(i18n)」功能",
61905
+ storybookV7: "启用「Storybook」V7",
61906
+ runtime_api: "启用「Runtime API」",
61907
+ ssg: "启用「SSG」功能",
61908
+ polyfill: "启用「基于 UA 的 Polyfill」功能",
61909
+ proxy: "启用「全局代理」",
61910
+ swc: "启用「SWC 编译」",
61911
+ module_doc: "启动「模块文档」功能"
61912
+ },
61913
+ element: {
61914
+ self: "创建工程元素",
61915
+ question: "请选择创建元素类型",
61916
+ entry: "新建「应用入口」",
61917
+ server: "新建「自定义 Web Server」源码目录"
61918
+ },
61919
+ refactor: {
61920
+ self: "自动重构",
61921
+ question: "请选择重构类型",
61922
+ react_router_5: "使用 React Router v5"
61923
+ }
61924
+ },
61925
+ boolean: {
61926
+ yes: "是",
61927
+ no: "否"
61928
+ },
61929
+ language: {
61930
+ self: "请选择开发语言"
61931
+ },
61932
+ packageManager: {
61933
+ self: "请选择包管理工具"
61934
+ },
61935
+ entry: {
61936
+ name: "请填写入口名称",
61937
+ no_empty: "入口名称不能为空!",
61938
+ no_pages: '入口名称不支持 "pages"!'
61939
+ },
61940
+ packageName: {
61941
+ self: "请填写项目名称",
61942
+ sub_name: "请填写子项目名称",
61943
+ no_empty: "项目名称不能为空!"
61944
+ },
61945
+ packagePath: {
61946
+ self: "请填写子项目目录名称",
61947
+ no_empty: "目录名称不能为空!",
61948
+ format: "目录名称只能使用小写字母、数字和分隔线(-)、下划线(_)和目录分隔符(/)"
61949
+ },
61950
+ framework: {
61951
+ self: "请选择运行时框架",
61952
+ egg: "Egg",
61953
+ express: "Express",
61954
+ koa: "Koa",
61955
+ nest: "Nest"
61956
+ },
61957
+ bff: {
61958
+ bffType: {
61959
+ self: "请选择 BFF 类型",
61960
+ func: "函数模式",
61961
+ framework: "框架模式"
61962
+ }
61963
+ },
61964
+ buildTools: {
61965
+ self: "请选择构建工具",
61966
+ webpack: "webpack",
61967
+ rspack: "Rspack (实验性)"
61968
+ }
61969
+ };
61970
+
61971
61971
  // ../../generator-common/dist/esm-node/locale/index.js
61972
61972
  var i18n2 = new I18n2();
61973
61973
  var localeKeys2 = i18n2.init("en", {
@@ -62075,7 +62075,7 @@ var getPackageNameSchema = (extra = {}) => {
62075
62075
  };
62076
62076
 
62077
62077
  // ../../generator-common/dist/esm-node/common/packagePath.js
62078
- var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
62078
+ var PackagePathRegex = /^[a-z0-9-_]+[a-z0-9-\/_]*$/;
62079
62079
  var getPackagePathSchema = (extra) => {
62080
62080
  return {
62081
62081
  type: "string",
@@ -62154,38 +62154,23 @@ var MWADefaultConfig = {
62154
62154
  var import_path6 = __toESM(require("path"));
62155
62155
  var import_utils15 = require("@modern-js/utils");
62156
62156
 
62157
- // ../../generator-utils/dist/esm/utils/stripAnsi.js
62158
- function ansiRegex2({ onlyFirst = false } = {}) {
62159
- const pattern = [
62160
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
62161
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
62162
- ].join("|");
62163
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
62164
- }
62165
- function stripAnsi2(string) {
62166
- if (typeof string !== "string") {
62167
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
62168
- }
62169
- return string.replace(ansiRegex2(), "");
62170
- }
62171
-
62172
- // ../../generator-utils/dist/esm/locale/zh.js
62173
- var ZH_LOCALE3 = {
62157
+ // ../../generator-utils/dist/esm/locale/en.js
62158
+ var EN_LOCALE3 = {
62174
62159
  packageName: {
62175
- exit: "项目名称 {value} 已存在"
62160
+ exit: "package name `{value}` is already exists"
62176
62161
  },
62177
62162
  packagePath: {
62178
- exit: "目录 {value} 已存在"
62163
+ exit: "package path {value} is already exists"
62179
62164
  }
62180
62165
  };
62181
62166
 
62182
- // ../../generator-utils/dist/esm/locale/en.js
62183
- var EN_LOCALE3 = {
62167
+ // ../../generator-utils/dist/esm/locale/zh.js
62168
+ var ZH_LOCALE3 = {
62184
62169
  packageName: {
62185
- exit: "package name `{value}` is already exists"
62170
+ exit: "项目名称 {value} 已存在"
62186
62171
  },
62187
62172
  packagePath: {
62188
- exit: "package path {value} is already exists"
62173
+ exit: "目录 {value} 已存在"
62189
62174
  }
62190
62175
  };
62191
62176
 
@@ -62196,6 +62181,21 @@ var localeKeys3 = i18n3.init("en", {
62196
62181
  en: EN_LOCALE3
62197
62182
  });
62198
62183
 
62184
+ // ../../generator-utils/dist/esm/utils/stripAnsi.js
62185
+ function ansiRegex2({ onlyFirst = false } = {}) {
62186
+ const pattern = [
62187
+ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
62188
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
62189
+ ].join("|");
62190
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
62191
+ }
62192
+ function stripAnsi2(string) {
62193
+ if (typeof string !== "string") {
62194
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
62195
+ }
62196
+ return string.replace(ansiRegex2(), "");
62197
+ }
62198
+
62199
62199
  // ../../generator-utils/dist/esm/utils/getGeneratorPath.js
62200
62200
  var import_path5 = __toESM(require("path"));
62201
62201
  var getGeneratorPath = (generator, distTag, paths) => {
@@ -62296,18 +62296,6 @@ function getMWAProjectPath(packagePath, isMonorepoSubProject) {
62296
62296
  return "";
62297
62297
  }
62298
62298
 
62299
- // src/locale/zh.ts
62300
- var ZH_LOCALE4 = {
62301
- get_packages_error: "获取包列表失败,请检查环境后重试",
62302
- success: `创建成功!
62303
- 可在新项目的目录下运行以下命令:
62304
- {packageManager} dev # 启动开发服务器
62305
- {packageManager} build # 构建生产环境产物
62306
- {packageManager} serve # 启动生产环境服务
62307
- {packageManager} lint # 运行 ESLint 并自动修复问题
62308
- {packageManager} new # 启用可选功能或创建项目要素`
62309
- };
62310
-
62311
62299
  // src/locale/en.ts
62312
62300
  var EN_LOCALE4 = {
62313
62301
  get_packages_error: "get all packages failed,please check this environment and try again",
@@ -62320,6 +62308,18 @@ You can run the following command in the directory of the new project:
62320
62308
  {packageManager} new # Enable optional features or add a new entry`
62321
62309
  };
62322
62310
 
62311
+ // src/locale/zh.ts
62312
+ var ZH_LOCALE4 = {
62313
+ get_packages_error: "获取包列表失败,请检查环境后重试",
62314
+ success: `创建成功!
62315
+ 可在新项目的目录下运行以下命令:
62316
+ {packageManager} dev # 启动开发服务器
62317
+ {packageManager} build # 构建生产环境产物
62318
+ {packageManager} serve # 启动生产环境服务
62319
+ {packageManager} lint # 运行 ESLint 并自动修复问题
62320
+ {packageManager} new # 启用可选功能或创建项目要素`
62321
+ };
62322
+
62323
62323
  // src/locale/index.ts
62324
62324
  var i18n4 = new I18n2();
62325
62325
  var localeKeys4 = i18n4.init("en", { zh: ZH_LOCALE4, en: EN_LOCALE4 });
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.4.15",
18
+ "version": "3.4.17",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -23,24 +23,24 @@
23
23
  "/dist/index.js"
24
24
  ],
25
25
  "dependencies": {
26
- "@modern-js/utils": "2.58.1"
26
+ "@modern-js/utils": "2.58.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@modern-js/codesmith": "2.4.0",
30
- "@modern-js/codesmith-api-app": "2.4.0",
29
+ "@modern-js/codesmith": "2.4.1",
30
+ "@modern-js/codesmith-api-app": "2.4.1",
31
31
  "@types/jest": "^29",
32
32
  "@types/node": "^14",
33
33
  "jest": "^29",
34
34
  "typescript": "^5",
35
- "@modern-js/base-generator": "3.4.15",
36
- "@modern-js/entry-generator": "3.4.15",
37
- "@modern-js/generator-common": "3.4.15",
38
- "@modern-js/dependence-generator": "3.4.15",
39
- "@modern-js/generator-utils": "3.4.15",
40
- "@modern-js/packages-generator": "3.4.15",
41
- "@modern-js/plugin-i18n": "2.58.1",
42
- "@scripts/build": "2.58.1",
43
- "@scripts/jest-config": "2.58.1"
35
+ "@modern-js/base-generator": "3.4.17",
36
+ "@modern-js/dependence-generator": "3.4.17",
37
+ "@modern-js/entry-generator": "3.4.17",
38
+ "@modern-js/generator-common": "3.4.17",
39
+ "@modern-js/packages-generator": "3.4.17",
40
+ "@modern-js/generator-utils": "3.4.17",
41
+ "@modern-js/plugin-i18n": "2.58.3",
42
+ "@scripts/jest-config": "2.58.3",
43
+ "@scripts/build": "2.58.3"
44
44
  },
45
45
  "sideEffects": false,
46
46
  "publishConfig": {
package/src/index.ts CHANGED
@@ -1,25 +1,25 @@
1
1
  import path from 'path';
2
- import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
2
+ import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
3
3
  import { AppAPI } from '@modern-js/codesmith-api-app';
4
4
  import {
5
- i18n as commonI18n,
6
5
  BaseGenerator,
7
- Solution,
8
- getMWASchema,
9
- Language,
6
+ BuildTools,
10
7
  EntryGenerator,
8
+ Language,
11
9
  PackagesGenerator,
12
- BuildTools,
10
+ Solution,
11
+ i18n as commonI18n,
12
+ getMWASchema,
13
13
  } from '@modern-js/generator-common';
14
14
  import {
15
- getMWAProjectPath,
16
15
  getAllPackages,
16
+ getGeneratorPath,
17
+ getMWAProjectPath,
18
+ getModernVersion,
19
+ getPackageManagerText,
17
20
  i18n as utilsI18n,
18
21
  validatePackageName,
19
22
  validatePackagePath,
20
- getPackageManagerText,
21
- getModernVersion,
22
- getGeneratorPath,
23
23
  } from '@modern-js/generator-utils';
24
24
  import { i18n, localeKeys } from './locale';
25
25
 
@@ -207,7 +207,6 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
207
207
  i18n.changeLanguage({ locale });
208
208
 
209
209
  if (!(await appApi.checkEnvironment())) {
210
- // eslint-disable-next-line no-process-exit
211
210
  process.exit(1);
212
211
  }
213
212
 
@@ -220,7 +219,6 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
220
219
  ({ projectPath } = await handleTemplateFile(context, generator, appApi));
221
220
  } catch (e) {
222
221
  generator.logger.error(e);
223
- // eslint-disable-next-line no-process-exit
224
222
  process.exit(1);
225
223
  }
226
224
 
@@ -237,7 +235,6 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
237
235
  await appApi.runGitAndInstall(context.config.gitCommitMessage);
238
236
  } catch (e) {
239
237
  generator.logger.error(e);
240
- // eslint-disable-next-line no-process-exit
241
238
  process.exit(1);
242
239
  }
243
240