@modern-js/generator-utils 3.1.28 → 3.1.29
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 +19 -0
- package/dist/cjs/utils/package.js +13 -9
- package/dist/esm/utils/package.js +13 -9
- package/dist/types/utils/package.d.ts +1 -1
- package/package.json +6 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @modern-js/generator-utils
|
|
2
2
|
|
|
3
|
+
## 3.1.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8322a51: chore: migrate packages from tsc to module-lib build
|
|
8
|
+
|
|
9
|
+
chore: 将使用 tsc 的包迁移到 module-lib 构建
|
|
10
|
+
|
|
11
|
+
- bd2c1ff: fix: get package available version error
|
|
12
|
+
|
|
13
|
+
fix: 修复获取包可用版本时报错
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [91d14b8]
|
|
16
|
+
- Updated dependencies [8322a51]
|
|
17
|
+
- Updated dependencies [6d7104d]
|
|
18
|
+
- @modern-js/utils@2.27.0
|
|
19
|
+
- @modern-js/generator-common@3.1.29
|
|
20
|
+
- @modern-js/plugin-i18n@2.27.0
|
|
21
|
+
|
|
3
22
|
## 3.1.28
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -26,16 +26,20 @@ _export(exports, {
|
|
|
26
26
|
const _utils = require("@modern-js/utils");
|
|
27
27
|
async function isPackageExist(packageName, registry) {
|
|
28
28
|
if (await (0, _utils.canUseNpm)()) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
try {
|
|
30
|
+
const args = [
|
|
31
|
+
"view",
|
|
32
|
+
packageName,
|
|
33
|
+
"version"
|
|
34
|
+
];
|
|
35
|
+
if (registry) {
|
|
36
|
+
args.push(`--registry=${registry}`);
|
|
37
|
+
}
|
|
38
|
+
const result = await (0, _utils.execa)("npm", args);
|
|
39
|
+
return (0, _utils.stripAnsi)(result.stdout);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
return false;
|
|
36
42
|
}
|
|
37
|
-
const result = await (0, _utils.execa)("npm", args);
|
|
38
|
-
return (0, _utils.stripAnsi)(result.stdout);
|
|
39
43
|
}
|
|
40
44
|
throw new Error("not found npm, please install npm before");
|
|
41
45
|
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { canUseNpm, execa, logger, semver, stripAnsi } from "@modern-js/utils";
|
|
2
2
|
export async function isPackageExist(packageName, registry) {
|
|
3
3
|
if (await canUseNpm()) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
try {
|
|
5
|
+
const args = [
|
|
6
|
+
"view",
|
|
7
|
+
packageName,
|
|
8
|
+
"version"
|
|
9
|
+
];
|
|
10
|
+
if (registry) {
|
|
11
|
+
args.push(`--registry=${registry}`);
|
|
12
|
+
}
|
|
13
|
+
const result = await execa("npm", args);
|
|
14
|
+
return stripAnsi(result.stdout);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
return false;
|
|
11
17
|
}
|
|
12
|
-
const result = await execa("npm", args);
|
|
13
|
-
return stripAnsi(result.stdout);
|
|
14
18
|
}
|
|
15
19
|
throw new Error("not found npm, please install npm before");
|
|
16
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function isPackageExist(packageName: string, registry?: string): Promise<string>;
|
|
1
|
+
export declare function isPackageExist(packageName: string, registry?: string): Promise<string | false>;
|
|
2
2
|
export declare function isPackageDeprecated(packageName: string, registry?: string): Promise<string>;
|
|
3
3
|
export declare function semverDecrease(version: string): string;
|
|
4
4
|
/**
|
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.29",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@swc/helpers": "0.5.1",
|
|
34
|
-
"@modern-js/plugin-i18n": "2.
|
|
35
|
-
"@modern-js/generator-common": "3.1.
|
|
36
|
-
"@modern-js/utils": "2.
|
|
34
|
+
"@modern-js/plugin-i18n": "2.27.0",
|
|
35
|
+
"@modern-js/generator-common": "3.1.29",
|
|
36
|
+
"@modern-js/utils": "2.27.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@modern-js/codesmith": "2.2.5",
|
|
@@ -41,15 +41,10 @@
|
|
|
41
41
|
"@types/node": "^14",
|
|
42
42
|
"jest": "^29",
|
|
43
43
|
"typescript": "^5",
|
|
44
|
-
"@scripts/build": "2.
|
|
45
|
-
"@scripts/jest-config": "2.
|
|
44
|
+
"@scripts/build": "2.27.0",
|
|
45
|
+
"@scripts/jest-config": "2.27.0"
|
|
46
46
|
},
|
|
47
47
|
"sideEffects": false,
|
|
48
|
-
"modernConfig": {
|
|
49
|
-
"output": {
|
|
50
|
-
"packageMode": "node-js"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
48
|
"publishConfig": {
|
|
54
49
|
"registry": "https://registry.npmjs.org/",
|
|
55
50
|
"access": "public",
|