@modern-js/mwa-generator 3.1.39 → 3.2.1

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/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.1.39",
18
+ "version": "3.2.1",
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/base-generator": "3.1.39",
34
- "@modern-js/generator-utils": "3.1.39",
35
- "@modern-js/dependence-generator": "3.1.39",
36
- "@modern-js/packages-generator": "3.1.39",
37
- "@modern-js/rspack-generator": "3.1.39",
38
- "@modern-js/entry-generator": "3.1.39",
39
- "@modern-js/plugin-i18n": "2.33.1",
40
- "@modern-js/generator-common": "3.1.39",
41
- "@scripts/jest-config": "2.33.1",
42
- "@scripts/build": "2.33.1"
32
+ "@modern-js/dependence-generator": "3.2.1",
33
+ "@modern-js/generator-utils": "3.2.1",
34
+ "@modern-js/packages-generator": "3.2.1",
35
+ "@modern-js/rspack-generator": "3.2.1",
36
+ "@modern-js/plugin-i18n": "2.35.0",
37
+ "@modern-js/entry-generator": "3.2.1",
38
+ "@modern-js/generator-common": "3.2.1",
39
+ "@modern-js/base-generator": "3.2.1",
40
+ "@scripts/build": "2.35.0",
41
+ "@scripts/jest-config": "2.35.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,
@@ -14,25 +14,25 @@ Install the dependencies:
14
14
 
15
15
  Start the dev server:
16
16
 
17
- ```
17
+ ```bash
18
18
  {{packageManager}} dev
19
19
  ```
20
20
 
21
21
  Enable optional features or add a new entry:
22
22
 
23
- ```
23
+ ```bash
24
24
  {{packageManager}} new
25
25
  ```
26
26
 
27
27
  Build the app for production:
28
28
 
29
- ```
29
+ ```bash
30
30
  {{packageManager}} build
31
31
  ```
32
32
 
33
33
  Preview the production build locally:
34
34
 
35
- ```
35
+ ```bash
36
36
  {{packageManager}} serve
37
37
  ```
38
38
 
@@ -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",