@modern-js/upgrade-generator 3.4.17 → 3.6.0

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.
package/dist/index.js CHANGED
@@ -52689,12 +52689,12 @@ __export(src_exports, {
52689
52689
  module.exports = __toCommonJS(src_exports);
52690
52690
  var import_path6 = __toESM(require("path"));
52691
52691
 
52692
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
52692
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
52693
52693
  var import_path = __toESM(require("path"));
52694
52694
  var import_utils = require("@modern-js/utils");
52695
52695
  var FS_RESOURCE = "_codesmith_core_fs_resource";
52696
52696
 
52697
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
52697
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
52698
52698
  var import_utils2 = require("@modern-js/utils");
52699
52699
  async function fsExists(path6) {
52700
52700
  try {
@@ -52705,13 +52705,13 @@ async function fsExists(path6) {
52705
52705
  }
52706
52706
  }
52707
52707
 
52708
- // ../../../../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
52708
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
52709
52709
  var import_ejs = __toESM(require_ejs());
52710
52710
  function renderString(template, fullData) {
52711
52711
  return import_ejs.default.render(template, fullData) || "";
52712
52712
  }
52713
52713
 
52714
- // ../../../../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
52714
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
52715
52715
  var EjsAPI = class {
52716
52716
  async renderTemplate(templateResource, target, parameters = {}) {
52717
52717
  if (templateResource._type !== FS_RESOURCE) {
@@ -52743,7 +52743,7 @@ var EjsAPI = class {
52743
52743
  }
52744
52744
  };
52745
52745
 
52746
- // ../../../../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
52746
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
52747
52747
  var import_path2 = __toESM(require("path"));
52748
52748
  var import_utils4 = require("@modern-js/utils");
52749
52749
  var FsAPI = class {
@@ -52770,7 +52770,7 @@ var FsAPI = class {
52770
52770
  }
52771
52771
  };
52772
52772
 
52773
- // ../../../../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
52773
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
52774
52774
  var import_utils5 = require("@modern-js/utils");
52775
52775
  async function canUseGit() {
52776
52776
  try {
@@ -52845,7 +52845,7 @@ async function gitCommit(cwd, commitMessage) {
52845
52845
  });
52846
52846
  }
52847
52847
 
52848
- // ../../../../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
52848
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
52849
52849
  var GitAPI = class {
52850
52850
  async isInGitRepo(cwd = this.generatorCore.outputPath) {
52851
52851
  const canUse = await canUseGit();
@@ -52895,7 +52895,7 @@ var GitAPI = class {
52895
52895
  }
52896
52896
  };
52897
52897
 
52898
- // ../../../../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
52898
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
52899
52899
  var import_handlebars = __toESM(require_lib());
52900
52900
  function renderString2(template, fullData, registers) {
52901
52901
  const helpers = {
@@ -52909,7 +52909,7 @@ function renderString2(template, fullData, registers) {
52909
52909
  return import_handlebars.default.compile(template)(fullData) || "";
52910
52910
  }
52911
52911
 
52912
- // ../../../../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
52912
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
52913
52913
  var HandlebarsAPI = class {
52914
52914
  async registerHelp(helpers) {
52915
52915
  this.registers.helpers = {
@@ -52957,7 +52957,7 @@ var HandlebarsAPI = class {
52957
52957
  }
52958
52958
  };
52959
52959
 
52960
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
52960
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.2/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
52961
52961
  var import_utils8 = require("@modern-js/utils");
52962
52962
  async function canUseNvm() {
52963
52963
  try {
@@ -53007,7 +53007,7 @@ async function canUsePnpm() {
53007
53007
  }
53008
53008
  }
53009
53009
 
53010
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
53010
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.2/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
53011
53011
  var import_utils9 = require("@modern-js/utils");
53012
53012
  function execaWithStreamLog(command, args, options) {
53013
53013
  const promise = (0, import_utils9.execa)(command, args, {
@@ -53103,7 +53103,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
53103
53103
  throw new Error("please install pnpm first");
53104
53104
  }
53105
53105
 
53106
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
53106
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.2/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
53107
53107
  var NpmAPI = class {
53108
53108
  npmInstall({ cwd, registryUrl, ignoreScripts }) {
53109
53109
  return npmInstall({
@@ -62687,10 +62687,10 @@ var Schema = (
62687
62687
  }()
62688
62688
  );
62689
62689
 
62690
- // ../../../../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
62690
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
62691
62691
  var import_inquirer = __toESM(require_inquirer());
62692
62692
 
62693
- // ../../../../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
62693
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
62694
62694
  var import_lodash = require("@modern-js/utils/lodash");
62695
62695
  function validateSchema(schema) {
62696
62696
  const { type, properties } = schema;
@@ -62782,7 +62782,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
62782
62782
  return getQuestionFromSchema(schema, configValue, validateMap, initValue);
62783
62783
  }
62784
62784
 
62785
- // ../../../../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
62785
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
62786
62786
  var compileRule = (rule, scope) => {
62787
62787
  const state = Schema.compile(rule, {
62788
62788
  $self: {},
@@ -62886,7 +62886,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
62886
62886
  return answers;
62887
62887
  }
62888
62888
 
62889
- // ../../../../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
62889
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
62890
62890
  var CLIReader = class {
62891
62891
  getAnswers() {
62892
62892
  return this.answers;
@@ -62915,7 +62915,7 @@ var CLIReader = class {
62915
62915
  }
62916
62916
  };
62917
62917
 
62918
- // ../../../../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
62918
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
62919
62919
  var import_utils13 = require("@modern-js/utils");
62920
62920
  var import_lodash5 = require("@modern-js/utils/lodash");
62921
62921
  var import_comment_json = __toESM(require_src2());
@@ -62984,7 +62984,7 @@ var I18n = class {
62984
62984
  }
62985
62985
  };
62986
62986
 
62987
- // ../../../../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
62987
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
62988
62988
  var EN_LOCALE = {
62989
62989
  environment: {
62990
62990
  node_version: "please upgrade node to lts version",
@@ -63011,7 +63011,7 @@ var EN_LOCALE = {
63011
63011
  }
63012
63012
  };
63013
63013
 
63014
- // ../../../../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
63014
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
63015
63015
  var ZH_LOCALE = {
63016
63016
  environment: {
63017
63017
  node_version: "请升级 Node 版本至 LIS",
@@ -63038,14 +63038,14 @@ var ZH_LOCALE = {
63038
63038
  }
63039
63039
  };
63040
63040
 
63041
- // ../../../../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
63041
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
63042
63042
  var i18n = new I18n();
63043
63043
  var localeKeys = i18n.init("zh", {
63044
63044
  zh: ZH_LOCALE,
63045
63045
  en: EN_LOCALE
63046
63046
  });
63047
63047
 
63048
- // ../../../../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
63048
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
63049
63049
  var import_path4 = __toESM(require("path"));
63050
63050
  var import_utils12 = require("@modern-js/utils");
63051
63051
  var NODE_MAJOR_VERSION_MAP = {
@@ -63093,7 +63093,7 @@ async function checkUseNvm(cwd, logger2) {
63093
63093
  }
63094
63094
  }
63095
63095
 
63096
- // ../../../../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
63096
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
63097
63097
  var import_lodash4 = require("@modern-js/utils/lodash");
63098
63098
  function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
63099
63099
  for (const question of questions) {
@@ -63121,7 +63121,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
63121
63121
  return questions;
63122
63122
  }
63123
63123
 
63124
- // ../../../../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
63124
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
63125
63125
  var AppAPI = class {
63126
63126
  async checkEnvironment(nodeVersion) {
63127
63127
  if (import_utils13.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
@@ -63353,11 +63353,11 @@ var AppAPI = class {
63353
63353
  }
63354
63354
  };
63355
63355
 
63356
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
63356
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.2/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
63357
63357
  var import_comment_json2 = __toESM(require_src2());
63358
63358
  var declarationUpdate = __toESM(require_dist());
63359
63359
 
63360
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
63360
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.2/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
63361
63361
  async function editJson(generatorCore, resource, getNewJsonValue) {
63362
63362
  const originJsonValue = await resource.value();
63363
63363
  const newJsonString = await getNewJsonValue(originJsonValue.content);
@@ -63370,7 +63370,7 @@ async function editJson(generatorCore, resource, getNewJsonValue) {
63370
63370
  return newJsonString;
63371
63371
  }
63372
63372
 
63373
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
63373
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.2/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
63374
63374
  var JsonAPI = class {
63375
63375
  async get(resource) {
63376
63376
  const originJsonValue = await resource.value();
@@ -63382,27 +63382,27 @@ var JsonAPI = class {
63382
63382
  throw new Error("resource content is not a legal json");
63383
63383
  }
63384
63384
  }
63385
- async extend(resource, obj) {
63385
+ async extend(resource, obj, endWithNewLine = false) {
63386
63386
  await editJson(this.generatorCore, resource, async () => {
63387
63387
  const originJsonValue = await resource.value();
63388
63388
  try {
63389
63389
  const origin = import_comment_json2.default.parse(originJsonValue.content);
63390
63390
  const newObj = import_comment_json2.default.assign(origin, obj);
63391
63391
  const jsonIntent = 2;
63392
- return import_comment_json2.default.stringify(newObj, void 0, jsonIntent);
63392
+ return import_comment_json2.default.stringify(newObj, void 0, jsonIntent) + (endWithNewLine ? "\n" : "");
63393
63393
  } catch (e) {
63394
63394
  this.generatorCore.logger.debug("[JSON API] parse json error:", e);
63395
63395
  throw new Error("resource content is not a legal json");
63396
63396
  }
63397
63397
  });
63398
63398
  }
63399
- async update(resource, operation) {
63399
+ async update(resource, operation, endWithNewLine = false) {
63400
63400
  await editJson(this.generatorCore, resource, (text) => {
63401
63401
  try {
63402
63402
  const jsonContent = import_comment_json2.default.parse(text);
63403
63403
  declarationUpdate.query(jsonContent, operation.query, operation.update);
63404
63404
  const jsonIntent = 2;
63405
- return Promise.resolve(import_comment_json2.default.stringify(jsonContent, void 0, jsonIntent));
63405
+ return Promise.resolve(import_comment_json2.default.stringify(jsonContent, void 0, jsonIntent) + (endWithNewLine ? "\n" : ""));
63406
63406
  } catch (e) {
63407
63407
  this.generatorCore.logger.debug("[JSON API] parse json error:", e);
63408
63408
  throw new Error("resource content is not a legal json");
@@ -63561,11 +63561,6 @@ var EN_LOCALE2 = {
63561
63561
  func: "Function",
63562
63562
  framework: "Framework"
63563
63563
  }
63564
- },
63565
- buildTools: {
63566
- self: "Please select the bundler:",
63567
- webpack: "webpack",
63568
- rspack: "Rspack (experimental)"
63569
63564
  }
63570
63565
  };
63571
63566
 
@@ -63653,11 +63648,6 @@ var ZH_LOCALE2 = {
63653
63648
  func: "函数模式",
63654
63649
  framework: "框架模式"
63655
63650
  }
63656
- },
63657
- buildTools: {
63658
- self: "请选择构建工具",
63659
- webpack: "webpack",
63660
- rspack: "Rspack (实验性)"
63661
63651
  }
63662
63652
  };
63663
63653
 
@@ -63841,8 +63831,7 @@ var EN_LOCALE3 = {
63841
63831
  no_solution: "You should install Modern.js solution tools first",
63842
63832
  more_solution: "The project is not allowed to contain more than one solution tool"
63843
63833
  },
63844
- success: "Upgrade Modern.js package version success!",
63845
- updateHusky: "Upgrade husky to v8"
63834
+ success: "Upgrade Modern.js package version success!"
63846
63835
  };
63847
63836
 
63848
63837
  // src/locale/zh.ts
@@ -63857,8 +63846,7 @@ var ZH_LOCALE3 = {
63857
63846
  `,
63858
63847
  more_solution: "项目中不允许同时包含多种工程方案相关依赖,请先移除不相关的工程方案依赖。"
63859
63848
  },
63860
- success: "已更新 Modern.js 依赖至最新版本",
63861
- updateHusky: "升级 Husky 至 v8"
63849
+ success: "已更新 Modern.js 依赖至最新版本"
63862
63850
  };
63863
63851
 
63864
63852
  // src/locale/index.ts
@@ -63868,8 +63856,10 @@ var localeKeys3 = i18n3.init("en", { zh: ZH_LOCALE3, en: EN_LOCALE3 });
63868
63856
  // src/index.ts
63869
63857
  var SpecialModernDeps = [
63870
63858
  "@modern-js/plugin-storybook",
63871
- "@modern-js/builder-rspack-provider"
63859
+ "@modern-js/builder-rspack-provider",
63872
63860
  // need be removed after 2.46.1
63861
+ "@modern-js/eslint-config",
63862
+ "@modern-js-app/eslint-config"
63873
63863
  ];
63874
63864
  var DeprecatedModernBuilderDeps = [
63875
63865
  "@modern-js/builder-plugin-image-compress",
@@ -63914,7 +63904,7 @@ var handleTemplateFile = async (context, generator, appApi) => {
63914
63904
  );
63915
63905
  if (Object.keys(deps).filter(
63916
63906
  (dep) => dep.startsWith("@modern-js") || dep.startsWith("@modern-js-app")
63917
- ).filter((dep) => !dep.includes("electron")).filter((dep) => !dep.includes("codesmith") && !dep.includes("easy-form")).filter((dep) => !dep.startsWith("@modern-js-reduck")).every((dep) => deps[dep] === modernVersion)) {
63907
+ ).filter((dep) => !dep.includes("electron")).filter((dep) => !dep.includes("codesmith") && !dep.includes("easy-form")).filter((dep) => !dep.startsWith("@modern-js-reduck")).filter((dep) => !dep.includes("eslint-config")).every((dep) => deps[dep] === modernVersion)) {
63918
63908
  generator.logger.info(
63919
63909
  `[${i18n3.t(localeKeys3.alreadyLatest)}]: ${modernVersion}`
63920
63910
  );
@@ -63991,44 +63981,10 @@ var handleTemplateFile = async (context, generator, appApi) => {
63991
63981
  update: {
63992
63982
  $set: updateInfo
63993
63983
  }
63994
- }
63984
+ },
63985
+ true
63995
63986
  );
63996
63987
  spinner.stop();
63997
- const huskyVersion = deps.husky;
63998
- try {
63999
- if (huskyVersion && import_utils18.semver.lt(huskyVersion, "8.0.0")) {
64000
- generator.logger.info(`${i18n3.t(localeKeys3.updateHusky)}`);
64001
- await jsonAPI.update(
64002
- context.materials.default.get(import_path6.default.join(appDir, "package.json")),
64003
- {
64004
- query: {},
64005
- update: {
64006
- $set: {
64007
- "devDependencies.husky": "^8.0.0"
64008
- }
64009
- }
64010
- }
64011
- );
64012
- const pkgPath = context.materials.default.get(
64013
- import_path6.default.join(appDir, "package.json")
64014
- ).filePath;
64015
- const pkgInfo2 = import_utils18.fs.readJSONSync(pkgPath, "utf-8");
64016
- const { prepare } = pkgInfo2.scripts;
64017
- if (!prepare) {
64018
- pkgInfo2.scripts.prepare = "husky install";
64019
- } else if (!prepare.includes("husky install")) {
64020
- pkgInfo2.scripts.prepare = `${prepare} && husky install`;
64021
- }
64022
- pkgInfo2.husky = void 0;
64023
- import_utils18.fs.writeJSONSync(pkgPath, pkgInfo2, { spaces: 2 });
64024
- await appApi.forgeTemplate("templates/**/*");
64025
- import_utils18.fs.chmodSync(
64026
- import_path6.default.join(generator.outputPath, ".husky", "pre-commit"),
64027
- "755"
64028
- );
64029
- }
64030
- } catch (e) {
64031
- }
64032
63988
  await appApi.runInstall();
64033
63989
  appApi.showSuccessInfo(i18n3.t(localeKeys3.success));
64034
63990
  };
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.4.17",
18
+ "version": "3.6.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -23,21 +23,21 @@
23
23
  "/dist/index.js"
24
24
  ],
25
25
  "dependencies": {
26
- "@modern-js/codesmith": "2.4.1",
27
- "@modern-js/codesmith-api-app": "2.4.1",
28
- "@modern-js/codesmith-api-json": "2.4.1",
29
- "@modern-js/generator-common": "3.4.17",
30
- "@modern-js/generator-utils": "3.4.17",
31
- "@modern-js/plugin-i18n": "2.58.3",
32
- "@modern-js/utils": "2.58.3"
26
+ "@modern-js/codesmith": "2.4.2",
27
+ "@modern-js/codesmith-api-app": "2.4.2",
28
+ "@modern-js/codesmith-api-json": "2.4.2",
29
+ "@modern-js/generator-common": "3.6.0",
30
+ "@modern-js/generator-utils": "3.6.0",
31
+ "@modern-js/plugin-i18n": "2.60.0",
32
+ "@modern-js/utils": "2.60.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/jest": "^29",
36
36
  "@types/node": "^14",
37
37
  "jest": "^29",
38
38
  "typescript": "^5",
39
- "@scripts/build": "2.58.3",
40
- "@scripts/jest-config": "2.58.3"
39
+ "@scripts/jest-config": "2.60.0",
40
+ "@scripts/build": "2.60.0"
41
41
  },
42
42
  "sideEffects": false,
43
43
  "publishConfig": {
package/src/index.ts CHANGED
@@ -25,6 +25,8 @@ import { i18n, localeKeys } from './locale';
25
25
  const SpecialModernDeps = [
26
26
  '@modern-js/plugin-storybook',
27
27
  '@modern-js/builder-rspack-provider', // need be removed after 2.46.1
28
+ '@modern-js/eslint-config',
29
+ '@modern-js-app/eslint-config',
28
30
  ];
29
31
 
30
32
  const DeprecatedModernBuilderDeps = [
@@ -91,6 +93,7 @@ export const handleTemplateFile = async (
91
93
  .filter(dep => !dep.includes('electron'))
92
94
  .filter(dep => !dep.includes('codesmith') && !dep.includes('easy-form'))
93
95
  .filter(dep => !dep.startsWith('@modern-js-reduck'))
96
+ .filter(dep => !dep.includes('eslint-config'))
94
97
  .every(dep => deps[dep] === modernVersion)
95
98
  ) {
96
99
  generator.logger.info(
@@ -177,49 +180,11 @@ export const handleTemplateFile = async (
177
180
  $set: updateInfo,
178
181
  },
179
182
  },
183
+ true,
180
184
  );
181
185
 
182
186
  spinner.stop();
183
187
 
184
- // update husky
185
- const huskyVersion = deps.husky;
186
- try {
187
- if (huskyVersion && semver.lt(huskyVersion, '8.0.0')) {
188
- generator.logger.info(`${i18n.t(localeKeys.updateHusky)}`);
189
- await jsonAPI.update(
190
- context.materials.default.get(path.join(appDir, 'package.json')),
191
- {
192
- query: {},
193
- update: {
194
- $set: {
195
- 'devDependencies.husky': '^8.0.0',
196
- },
197
- },
198
- },
199
- );
200
-
201
- const pkgPath = context.materials.default.get(
202
- path.join(appDir, 'package.json'),
203
- ).filePath;
204
- const pkgInfo = fs.readJSONSync(pkgPath, 'utf-8');
205
- const { prepare } = pkgInfo.scripts;
206
- if (!prepare) {
207
- pkgInfo.scripts.prepare = 'husky install';
208
- } else if (!prepare.includes('husky install')) {
209
- pkgInfo.scripts.prepare = `${prepare} && husky install`;
210
- }
211
- pkgInfo.husky = undefined;
212
-
213
- fs.writeJSONSync(pkgPath, pkgInfo, { spaces: 2 });
214
-
215
- await appApi.forgeTemplate('templates/**/*');
216
- fs.chmodSync(
217
- path.join(generator.outputPath, '.husky', 'pre-commit'),
218
- '755',
219
- );
220
- }
221
- } catch (e) {}
222
-
223
188
  await appApi.runInstall();
224
189
 
225
190
  appApi.showSuccessInfo(i18n.t(localeKeys.success));
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- npx --no-install lint-staged