@modern-js/upgrade-generator 2.4.10 → 2.4.11

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 +25 -22
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -145976,7 +145976,7 @@ var require_node10 = __commonJSMin((exports) => {
145976
145976
  distTag
145977
145977
  } = options3;
145978
145978
  const getLatetPluginVersion = async () => {
145979
- const version5 = await getPackageVersion(`${packageName}@${distTag}`, registry2);
145979
+ const version5 = await getPackageVersion(`${packageName}@${distTag || "latest"}`, registry2);
145980
145980
  return version5;
145981
145981
  };
145982
145982
  if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
@@ -146160,28 +146160,31 @@ var handleTemplateFile = async (context, generator, appApi) => {
146160
146160
  });
146161
146161
  spinner.stop();
146162
146162
  const huskyVersion = deps.husky;
146163
- if (huskyVersion && import_generator_utils.semver.lt(huskyVersion, "8.0.0")) {
146164
- generator.logger.info(`${i18n2.t(localeKeys2.updateHusky)}`);
146165
- await jsonAPI.update(context.materials.default.get(import_path.default.join(appDir, "package.json")), {
146166
- query: {},
146167
- update: {
146168
- $set: {
146169
- "devDependencies.husky": "^8.0.0"
146163
+ try {
146164
+ if (huskyVersion && import_generator_utils.semver.lt(huskyVersion, "8.0.0")) {
146165
+ generator.logger.info(`${i18n2.t(localeKeys2.updateHusky)}`);
146166
+ await jsonAPI.update(context.materials.default.get(import_path.default.join(appDir, "package.json")), {
146167
+ query: {},
146168
+ update: {
146169
+ $set: {
146170
+ "devDependencies.husky": "^8.0.0"
146171
+ }
146170
146172
  }
146171
- }
146172
- });
146173
- const pkgPath = context.materials.default.get(import_path.default.join(appDir, "package.json")).filePath;
146174
- const pkgInfo2 = import_generator_utils.fs.readJSONSync(pkgPath, "utf-8");
146175
- const { prepare } = pkgInfo2.scripts;
146176
- if (!prepare) {
146177
- pkgInfo2.scripts.prepare = "husky install";
146178
- } else if (!prepare.includes("husky install")) {
146179
- pkgInfo2.scripts.prepare = `${prepare} && husky install`;
146180
- }
146181
- pkgInfo2.husky = void 0;
146182
- import_generator_utils.fs.writeJSONSync(pkgPath, pkgInfo2, { spaces: 2 });
146183
- await appApi.forgeTemplate("templates/**/*");
146184
- import_generator_utils.fs.chmodSync(import_path.default.join(generator.outputPath, ".husky", "pre-commit"), "755");
146173
+ });
146174
+ const pkgPath = context.materials.default.get(import_path.default.join(appDir, "package.json")).filePath;
146175
+ const pkgInfo2 = import_generator_utils.fs.readJSONSync(pkgPath, "utf-8");
146176
+ const { prepare } = pkgInfo2.scripts;
146177
+ if (!prepare) {
146178
+ pkgInfo2.scripts.prepare = "husky install";
146179
+ } else if (!prepare.includes("husky install")) {
146180
+ pkgInfo2.scripts.prepare = `${prepare} && husky install`;
146181
+ }
146182
+ pkgInfo2.husky = void 0;
146183
+ import_generator_utils.fs.writeJSONSync(pkgPath, pkgInfo2, { spaces: 2 });
146184
+ await appApi.forgeTemplate("templates/**/*");
146185
+ import_generator_utils.fs.chmodSync(import_path.default.join(generator.outputPath, ".husky", "pre-commit"), "755");
146186
+ }
146187
+ } catch (e) {
146185
146188
  }
146186
146189
  await appApi.runInstall();
146187
146190
  appApi.showSuccessInfo(i18n2.t(localeKeys2.success));
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.4.10",
14
+ "version": "2.4.11",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "main": "./dist/index.js",
17
17
  "files": [
@@ -27,11 +27,11 @@
27
27
  "@types/node": "^14",
28
28
  "jest": "^27",
29
29
  "typescript": "^4",
30
- "@modern-js/generator-common": "2.4.10",
31
- "@modern-js/generator-utils": "2.4.10",
32
- "@modern-js/plugin-i18n": "1.21.5",
33
- "@scripts/build": "1.21.5",
34
- "@scripts/jest-config": "1.21.5"
30
+ "@modern-js/generator-common": "2.4.11",
31
+ "@modern-js/plugin-i18n": "1.21.6",
32
+ "@scripts/build": "1.21.6",
33
+ "@modern-js/generator-utils": "2.4.11",
34
+ "@scripts/jest-config": "1.21.6"
35
35
  },
36
36
  "sideEffects": false,
37
37
  "publishConfig": {