@modern-js/generator-utils 2.2.1 → 2.3.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/CHANGELOG.md +27 -0
- package/dist/js/modern/index.js +11 -1
- package/dist/js/node/index.js +21 -0
- package/dist/types/index.d.ts +3 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @modern-js/generator-utils
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- beecff68d: feat: create new project use modern current latest version
|
|
8
|
+
|
|
9
|
+
feat: @modern-js/create 创建项目使用 Modern.js 最新依赖版本
|
|
10
|
+
|
|
11
|
+
- 1100dd58c: chore: support react 18
|
|
12
|
+
|
|
13
|
+
chore: 支持 React 18
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 9d9bbfd05: feat: update codesmith package
|
|
18
|
+
|
|
19
|
+
feat: 升级 codesmith 包版本
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [641592f52]
|
|
22
|
+
- Updated dependencies [3904b30a5]
|
|
23
|
+
- Updated dependencies [1100dd58c]
|
|
24
|
+
- Updated dependencies [e04e6e76a]
|
|
25
|
+
- Updated dependencies [81c66e4a4]
|
|
26
|
+
- Updated dependencies [2c305b6f5]
|
|
27
|
+
- @modern-js/utils@1.16.0
|
|
28
|
+
- @modern-js/plugin-i18n@1.16.0
|
|
29
|
+
|
|
3
30
|
## 2.2.1
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/dist/js/modern/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fs, ora, execa, getMonorepoPackages, canUseNpm, canUsePnpm, canUseYarn
|
|
|
3
3
|
import { stripAnsi } from "./utils/strip-ansi";
|
|
4
4
|
import { i18n, localeKeys } from "./locale";
|
|
5
5
|
export * from "./utils";
|
|
6
|
-
export { fs, execa, readTsConfigByFile, getPackageManager, canUseNpm, canUsePnpm, canUseYarn } from '@modern-js/utils';
|
|
6
|
+
export { fs, execa, readTsConfigByFile, getPackageManager, canUseNpm, canUsePnpm, canUseYarn, isReact18 } from '@modern-js/utils';
|
|
7
7
|
export { i18n } from "./locale";
|
|
8
8
|
export async function getPackageVersion(packageName, registry) {
|
|
9
9
|
const spinner = ora('Loading...').start();
|
|
@@ -48,6 +48,16 @@ export async function getPackageVersion(packageName, registry) {
|
|
|
48
48
|
spinner.stop();
|
|
49
49
|
throw new Error('not found npm, please install npm before');
|
|
50
50
|
}
|
|
51
|
+
const SolutionDep = {
|
|
52
|
+
mwa: '@modern-js/app-tools',
|
|
53
|
+
module: '@modern-js/module-tools',
|
|
54
|
+
monorepo: '@modern-js/monorepo-tools'
|
|
55
|
+
};
|
|
56
|
+
export async function getModernVersion(solution) {
|
|
57
|
+
const dep = SolutionDep[solution];
|
|
58
|
+
const modernVersion = await getPackageVersion(dep);
|
|
59
|
+
return modernVersion;
|
|
60
|
+
}
|
|
51
61
|
export function getPackageManagerText(packageManager) {
|
|
52
62
|
return packageManager === 'yarn' ? 'yarn' : `${packageManager} run`;
|
|
53
63
|
}
|
package/dist/js/node/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
getPackageVersion: true,
|
|
8
|
+
getModernVersion: true,
|
|
8
9
|
getPackageManagerText: true,
|
|
9
10
|
isTsProject: true,
|
|
10
11
|
getPackageObj: true,
|
|
@@ -20,6 +21,7 @@ var _exportNames = {
|
|
|
20
21
|
canUseNpm: true,
|
|
21
22
|
canUsePnpm: true,
|
|
22
23
|
canUseYarn: true,
|
|
24
|
+
isReact18: true,
|
|
23
25
|
i18n: true
|
|
24
26
|
};
|
|
25
27
|
Object.defineProperty(exports, "canUseNpm", {
|
|
@@ -54,6 +56,7 @@ Object.defineProperty(exports, "fs", {
|
|
|
54
56
|
});
|
|
55
57
|
exports.getAllPackages = getAllPackages;
|
|
56
58
|
exports.getMWAProjectPath = getMWAProjectPath;
|
|
59
|
+
exports.getModernVersion = getModernVersion;
|
|
57
60
|
exports.getModuleProjectPath = getModuleProjectPath;
|
|
58
61
|
Object.defineProperty(exports, "getPackageManager", {
|
|
59
62
|
enumerable: true,
|
|
@@ -70,6 +73,12 @@ Object.defineProperty(exports, "i18n", {
|
|
|
70
73
|
return _locale.i18n;
|
|
71
74
|
}
|
|
72
75
|
});
|
|
76
|
+
Object.defineProperty(exports, "isReact18", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _utils.isReact18;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
73
82
|
exports.isTsProject = isTsProject;
|
|
74
83
|
Object.defineProperty(exports, "readTsConfigByFile", {
|
|
75
84
|
enumerable: true,
|
|
@@ -148,6 +157,18 @@ async function getPackageVersion(packageName, registry) {
|
|
|
148
157
|
throw new Error('not found npm, please install npm before');
|
|
149
158
|
}
|
|
150
159
|
|
|
160
|
+
const SolutionDep = {
|
|
161
|
+
mwa: '@modern-js/app-tools',
|
|
162
|
+
module: '@modern-js/module-tools',
|
|
163
|
+
monorepo: '@modern-js/monorepo-tools'
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
async function getModernVersion(solution) {
|
|
167
|
+
const dep = SolutionDep[solution];
|
|
168
|
+
const modernVersion = await getPackageVersion(dep);
|
|
169
|
+
return modernVersion;
|
|
170
|
+
}
|
|
171
|
+
|
|
151
172
|
function getPackageManagerText(packageManager) {
|
|
152
173
|
return packageManager === 'yarn' ? 'yarn' : `${packageManager} run`;
|
|
153
174
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { GeneratorContext } from '@modern-js/codesmith';
|
|
2
2
|
export * from './utils';
|
|
3
|
-
export { fs, execa, readTsConfigByFile, getPackageManager, canUseNpm, canUsePnpm, canUseYarn } from '@modern-js/utils';
|
|
3
|
+
export { fs, execa, readTsConfigByFile, getPackageManager, canUseNpm, canUsePnpm, canUseYarn, isReact18 } from '@modern-js/utils';
|
|
4
4
|
export { i18n } from './locale';
|
|
5
5
|
export declare function getPackageVersion(packageName: string, registry?: string): Promise<string>;
|
|
6
|
+
declare type Solution = 'mwa' | 'module' | 'monorepo';
|
|
7
|
+
export declare function getModernVersion(solution: Solution): Promise<string>;
|
|
6
8
|
export declare function getPackageManagerText(packageManager: 'pnpm' | 'yarn' | 'npm'): string;
|
|
7
9
|
export declare function isTsProject(appDir: string): boolean;
|
|
8
10
|
export declare function getPackageObj(context: GeneratorContext): Promise<any>;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.3.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.18.0",
|
|
31
|
-
"@modern-js/plugin-i18n": "1.
|
|
32
|
-
"@modern-js/utils": "1.
|
|
31
|
+
"@modern-js/plugin-i18n": "1.16.0",
|
|
32
|
+
"@modern-js/utils": "1.16.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@modern-js/codesmith": "^1.
|
|
35
|
+
"@modern-js/codesmith": "^1.5.0",
|
|
36
|
+
"@scripts/build": "1.15.0",
|
|
37
|
+
"@scripts/jest-config": "1.15.0",
|
|
36
38
|
"@types/jest": "^27",
|
|
37
39
|
"@types/node": "^14",
|
|
38
|
-
"typescript": "^4",
|
|
39
|
-
"@scripts/build": "1.15.0",
|
|
40
40
|
"jest": "^27",
|
|
41
|
-
"
|
|
41
|
+
"typescript": "^4"
|
|
42
42
|
},
|
|
43
43
|
"sideEffects": false,
|
|
44
44
|
"modernConfig": {
|