@modern-js/generator-utils 3.1.17 → 3.1.18

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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @modern-js/generator-utils
2
2
 
3
+ ## 3.1.18
4
+
5
+ ### Patch Changes
6
+
7
+ - a9839b4: fix: generator get modern plugin version error
8
+
9
+ fix: 修复生成器获取插件版本错误
10
+
11
+ - 26dcf3a: chore: bump typescript to v5 in devDependencies
12
+
13
+ chore: 升级 devDependencies 中的 typescript 版本到 v5
14
+
15
+ - de8f73f: feat: update codesmith version
16
+
17
+ feat: 更新 codesmith 版本
18
+
19
+ - Updated dependencies [e81eeaf]
20
+ - Updated dependencies [26dcf3a]
21
+ - Updated dependencies [056627f]
22
+ - Updated dependencies [de8f73f]
23
+ - Updated dependencies [0fc15ca]
24
+ - Updated dependencies [43b4e83]
25
+ - Updated dependencies [ad78387]
26
+ - @modern-js/utils@2.21.0
27
+ - @modern-js/generator-common@3.1.18
28
+ - @modern-js/plugin-i18n@2.21.0
29
+
3
30
  ## 3.1.17
4
31
 
5
32
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -96,11 +96,18 @@ async function getModernPluginVersion(solution, packageName, options = {
96
96
  if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
97
97
  return getLatetPluginVersion("latest");
98
98
  }
99
- const pkgPath = _path.default.join(require.resolve(_generatorcommon.SolutionToolsMap[solution], {
99
+ let pkgPath = _path.default.join(require.resolve(_generatorcommon.SolutionToolsMap[solution], {
100
100
  paths: [
101
101
  cwd
102
102
  ]
103
- }), "../../../../", "package.json");
103
+ }), "../../..", "package.json");
104
+ if (solution === _generatorcommon.Solution.Module) {
105
+ pkgPath = _path.default.join(require.resolve(_generatorcommon.SolutionToolsMap[solution], {
106
+ paths: [
107
+ cwd
108
+ ]
109
+ }), "../..", "package.json");
110
+ }
104
111
  if (_utils.fs.existsSync(pkgPath)) {
105
112
  const pkgInfo = _utils.fs.readJSONSync(pkgPath);
106
113
  const modernVersion = pkgInfo.version;
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import path from "path";
2
2
  import { fs, ora, execa, getMonorepoPackages, canUseNpm, canUsePnpm } from "@modern-js/utils";
3
- import { SolutionToolsMap } from "@modern-js/generator-common";
3
+ import { Solution, SolutionToolsMap } from "@modern-js/generator-common";
4
4
  import { stripAnsi } from "./utils/stripAnsi";
5
5
  import { i18n, localeKeys } from "./locale";
6
6
  import { getAvailableVersion } from "./utils/package";
@@ -58,11 +58,18 @@ export async function getModernPluginVersion(solution, packageName, options = {
58
58
  if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
59
59
  return getLatetPluginVersion("latest");
60
60
  }
61
- const pkgPath = path.join(require.resolve(SolutionToolsMap[solution], {
61
+ let pkgPath = path.join(require.resolve(SolutionToolsMap[solution], {
62
62
  paths: [
63
63
  cwd
64
64
  ]
65
- }), "../../../../", "package.json");
65
+ }), "../../..", "package.json");
66
+ if (solution === Solution.Module) {
67
+ pkgPath = path.join(require.resolve(SolutionToolsMap[solution], {
68
+ paths: [
69
+ cwd
70
+ ]
71
+ }), "../..", "package.json");
72
+ }
66
73
  if (fs.existsSync(pkgPath)) {
67
74
  const pkgInfo = fs.readJSONSync(pkgPath);
68
75
  const modernVersion = pkgInfo.version;
@@ -6,5 +6,4 @@ export declare function semverDecrease(version: string): string;
6
6
  * tools 存在 hotfix 版本,从 tools 版本号向下找当前插件版本号
7
7
  * 限制只在当前小版本号范围内寻找
8
8
  */
9
-
10
9
  export declare function getAvailableVersion(packageName: string, currentVersion: string, registry?: string): Promise<string>;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.1.17",
18
+ "version": "3.1.18",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -31,18 +31,18 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@swc/helpers": "0.5.1",
34
- "@modern-js/plugin-i18n": "2.20.0",
35
- "@modern-js/generator-common": "3.1.17",
36
- "@modern-js/utils": "2.20.0"
34
+ "@modern-js/plugin-i18n": "2.21.0",
35
+ "@modern-js/generator-common": "3.1.18",
36
+ "@modern-js/utils": "2.21.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@modern-js/codesmith": "2.2.0",
39
+ "@modern-js/codesmith": "2.2.3",
40
40
  "@types/jest": "^29",
41
41
  "@types/node": "^14",
42
42
  "jest": "^29",
43
- "typescript": "^4",
44
- "@scripts/build": "2.20.0",
45
- "@scripts/jest-config": "2.20.0"
43
+ "typescript": "^5",
44
+ "@scripts/jest-config": "2.21.0",
45
+ "@scripts/build": "2.21.0"
46
46
  },
47
47
  "sideEffects": false,
48
48
  "modernConfig": {