@modern-js/generator-utils 3.1.16 → 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 +39 -0
- package/dist/cjs/index.js +13 -22
- package/dist/cjs/utils/index.js +3 -15
- package/dist/esm/index.js +10 -3
- package/dist/types/utils/package.d.ts +0 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
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
|
+
|
|
30
|
+
## 3.1.17
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- 6b9d90a: chore: remove @babel/runtime. add @swc/helper and enable `externalHelper` config.
|
|
35
|
+
chore: 移除 @babel/runtime 依赖. 增加 @swc/helpers 依赖并且开启 `externalHelpers` 配置
|
|
36
|
+
- Updated dependencies [3c4e0a5]
|
|
37
|
+
- Updated dependencies [6b9d90a]
|
|
38
|
+
- @modern-js/utils@2.20.0
|
|
39
|
+
- @modern-js/generator-common@3.1.17
|
|
40
|
+
- @modern-js/plugin-i18n@2.20.0
|
|
41
|
+
|
|
3
42
|
## 3.1.16
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -36,32 +36,16 @@ _export(exports, {
|
|
|
36
36
|
getDocProjectPath: () => getDocProjectPath,
|
|
37
37
|
getModernConfigFile: () => getModernConfigFile
|
|
38
38
|
});
|
|
39
|
-
const
|
|
39
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
40
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
41
|
+
const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
|
|
40
42
|
const _utils = require("@modern-js/utils");
|
|
41
43
|
const _generatorcommon = require("@modern-js/generator-common");
|
|
42
44
|
const _stripAnsi = require("./utils/stripAnsi");
|
|
43
45
|
const _locale = require("./locale");
|
|
44
46
|
const _package = require("./utils/package");
|
|
45
47
|
const _fsExist = require("./utils/fsExist");
|
|
46
|
-
_export_star(require("./utils"), exports);
|
|
47
|
-
function _export_star(from, to) {
|
|
48
|
-
Object.keys(from).forEach(function(k) {
|
|
49
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
50
|
-
Object.defineProperty(to, k, {
|
|
51
|
-
enumerable: true,
|
|
52
|
-
get: function() {
|
|
53
|
-
return from[k];
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return from;
|
|
59
|
-
}
|
|
60
|
-
function _interop_require_default(obj) {
|
|
61
|
-
return obj && obj.__esModule ? obj : {
|
|
62
|
-
default: obj
|
|
63
|
-
};
|
|
64
|
-
}
|
|
48
|
+
_export_star._(require("./utils"), exports);
|
|
65
49
|
async function getPackageVersion(packageName, registry) {
|
|
66
50
|
const spinner = (0, _utils.ora)({
|
|
67
51
|
text: "Load Generator...",
|
|
@@ -112,11 +96,18 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
|
112
96
|
if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
|
|
113
97
|
return getLatetPluginVersion("latest");
|
|
114
98
|
}
|
|
115
|
-
|
|
99
|
+
let pkgPath = _path.default.join(require.resolve(_generatorcommon.SolutionToolsMap[solution], {
|
|
116
100
|
paths: [
|
|
117
101
|
cwd
|
|
118
102
|
]
|
|
119
|
-
}), "
|
|
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
|
+
}
|
|
120
111
|
if (_utils.fs.existsSync(pkgPath)) {
|
|
121
112
|
const pkgInfo = _utils.fs.readJSONSync(pkgPath);
|
|
122
113
|
const modernVersion = pkgInfo.version;
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -2,18 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
_export_star
|
|
6
|
-
_export_star(require("./
|
|
7
|
-
|
|
8
|
-
Object.keys(from).forEach(function(k) {
|
|
9
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
10
|
-
Object.defineProperty(to, k, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function() {
|
|
13
|
-
return from[k];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
return from;
|
|
19
|
-
}
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./stripAnsi"), exports);
|
|
7
|
+
_export_star._(require("./package"), exports);
|
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
|
-
|
|
61
|
+
let pkgPath = path.join(require.resolve(SolutionToolsMap[solution], {
|
|
62
62
|
paths: [
|
|
63
63
|
cwd
|
|
64
64
|
]
|
|
65
|
-
}), "
|
|
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;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.1.
|
|
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",
|
|
@@ -30,19 +30,19 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@modern-js/plugin-i18n": "2.
|
|
35
|
-
"@modern-js/generator-common": "3.1.
|
|
36
|
-
"@modern-js/utils": "2.
|
|
33
|
+
"@swc/helpers": "0.5.1",
|
|
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.
|
|
39
|
+
"@modern-js/codesmith": "2.2.3",
|
|
40
40
|
"@types/jest": "^29",
|
|
41
41
|
"@types/node": "^14",
|
|
42
42
|
"jest": "^29",
|
|
43
|
-
"typescript": "^
|
|
44
|
-
"@scripts/
|
|
45
|
-
"@scripts/
|
|
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": {
|