@modern-js/mwa-generator 3.1.38 → 3.2.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/dist/index.js +113 -2181
- package/package.json +11 -12
- package/src/index.ts +1 -19
- package/templates/base-template/package.json.handlebars +8 -4
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.
|
|
18
|
+
"version": "3.2.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
@@ -25,21 +25,20 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@modern-js/codesmith": "2.2.5",
|
|
27
27
|
"@modern-js/codesmith-api-app": "2.2.5",
|
|
28
|
-
"@modern-js/codesmith-api-json": "2.2.5",
|
|
29
28
|
"@types/jest": "^29",
|
|
30
29
|
"@types/node": "^14",
|
|
31
30
|
"jest": "^29",
|
|
32
31
|
"typescript": "^5",
|
|
33
|
-
"@modern-js/entry-generator": "3.
|
|
34
|
-
"@modern-js/generator-utils": "3.
|
|
35
|
-
"@modern-js/packages-generator": "3.
|
|
36
|
-
"@modern-js/rspack-generator": "3.
|
|
37
|
-
"@modern-js/plugin-i18n": "2.
|
|
38
|
-
"@modern-js/
|
|
39
|
-
"@modern-js/generator
|
|
40
|
-
"@modern-js/
|
|
41
|
-
"@scripts/
|
|
42
|
-
"@scripts/
|
|
32
|
+
"@modern-js/entry-generator": "3.2.0",
|
|
33
|
+
"@modern-js/generator-utils": "3.2.0",
|
|
34
|
+
"@modern-js/packages-generator": "3.2.0",
|
|
35
|
+
"@modern-js/rspack-generator": "3.2.0",
|
|
36
|
+
"@modern-js/plugin-i18n": "2.34.0",
|
|
37
|
+
"@modern-js/generator-common": "3.2.0",
|
|
38
|
+
"@modern-js/base-generator": "3.2.0",
|
|
39
|
+
"@modern-js/dependence-generator": "3.2.0",
|
|
40
|
+
"@scripts/build": "2.34.0",
|
|
41
|
+
"@scripts/jest-config": "2.34.0"
|
|
43
42
|
},
|
|
44
43
|
"sideEffects": false,
|
|
45
44
|
"publishConfig": {
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
|
3
3
|
import { AppAPI } from '@modern-js/codesmith-api-app';
|
|
4
|
-
import { JsonAPI } from '@modern-js/codesmith-api-json';
|
|
5
4
|
import {
|
|
6
5
|
i18n as commonI18n,
|
|
7
6
|
BaseGenerator,
|
|
@@ -38,8 +37,6 @@ export const handleTemplateFile = async (
|
|
|
38
37
|
generator: GeneratorCore,
|
|
39
38
|
appApi: AppAPI,
|
|
40
39
|
) => {
|
|
41
|
-
const jsonAPI = new JsonAPI(generator);
|
|
42
|
-
|
|
43
40
|
const { isMonorepoSubProject, isTest, projectDir = '' } = context.config;
|
|
44
41
|
|
|
45
42
|
const { outputPath } = generator;
|
|
@@ -148,26 +145,11 @@ export const handleTemplateFile = async (
|
|
|
148
145
|
isMonorepoSubProject,
|
|
149
146
|
modernVersion,
|
|
150
147
|
packageManager,
|
|
148
|
+
isTs: language === Language.TS,
|
|
151
149
|
},
|
|
152
150
|
);
|
|
153
151
|
|
|
154
152
|
if (language === Language.TS) {
|
|
155
|
-
await jsonAPI.update(
|
|
156
|
-
context.materials.default.get(path.join(projectPath, 'package.json')),
|
|
157
|
-
{
|
|
158
|
-
query: {},
|
|
159
|
-
update: {
|
|
160
|
-
$set: {
|
|
161
|
-
'devDependencies.typescript': '~5.0.4',
|
|
162
|
-
'devDependencies.@types/jest': '~29.2.4',
|
|
163
|
-
'devDependencies.@types/node': '~16.11.7',
|
|
164
|
-
'devDependencies.@types/react': '~18.0.26',
|
|
165
|
-
'devDependencies.@types/react-dom': '~18.0.10',
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
);
|
|
170
|
-
|
|
171
153
|
await appApi.forgeTemplate(
|
|
172
154
|
'templates/ts-template/**/*',
|
|
173
155
|
undefined,
|
|
@@ -19,10 +19,7 @@
|
|
|
19
19
|
"node": ">=16.18.1"
|
|
20
20
|
},
|
|
21
21
|
"lint-staged": {
|
|
22
|
-
"*.{ts,tsx}": [
|
|
23
|
-
"node --max_old_space_size=8192 ./node_modules/eslint/bin/eslint.js --fix --color --cache --quiet"
|
|
24
|
-
],
|
|
25
|
-
"*.{js,jsx,mjs,mjsx,cjs,cjsx}": [
|
|
22
|
+
"*.{js,jsx,ts,tsx,mjs,cjs}": [
|
|
26
23
|
"node --max_old_space_size=8192 ./node_modules/eslint/bin/eslint.js --fix --color --cache --quiet"
|
|
27
24
|
]
|
|
28
25
|
},
|
|
@@ -41,6 +38,13 @@
|
|
|
41
38
|
"@modern-js/eslint-config": "{{modernVersion}}",
|
|
42
39
|
"@modern-js/tsconfig":"{{modernVersion}}",
|
|
43
40
|
"@modern-js-app/eslint-config": "{{modernVersion}}",
|
|
41
|
+
{{#if isTs}}
|
|
42
|
+
"typescript": "~5.0.4",
|
|
43
|
+
"@types/jest": "~29.2.4",
|
|
44
|
+
"@types/node": "~16.11.7",
|
|
45
|
+
"@types/react": "~18.0.26",
|
|
46
|
+
"@types/react-dom": "~18.0.10",
|
|
47
|
+
{{/if}}
|
|
44
48
|
"lint-staged": "~13.1.0",
|
|
45
49
|
"prettier": "~2.8.1",
|
|
46
50
|
"husky": "~8.0.1",
|