@modern-js/bff-generator 3.4.15 → 3.4.17

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.
Files changed (3) hide show
  1. package/dist/index.js +1234 -1204
  2. package/package.json +10 -10
  3. package/src/index.ts +17 -23
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.4.15",
18
+ "version": "3.4.17",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./src/index.ts",
21
21
  "main": "./dist/index.js",
@@ -24,21 +24,21 @@
24
24
  "/dist/index.js"
25
25
  ],
26
26
  "dependencies": {
27
- "@modern-js/utils": "2.58.1"
27
+ "@modern-js/utils": "2.58.3"
28
28
  },
29
29
  "devDependencies": {
30
- "@modern-js/codesmith": "2.4.0",
31
- "@modern-js/codesmith-api-app": "2.4.0",
32
- "@modern-js/codesmith-api-json": "2.4.0",
30
+ "@modern-js/codesmith": "2.4.1",
31
+ "@modern-js/codesmith-api-app": "2.4.1",
32
+ "@modern-js/codesmith-api-json": "2.4.1",
33
33
  "@types/jest": "^29",
34
34
  "@types/node": "^14",
35
35
  "jest": "^29",
36
36
  "typescript": "^5",
37
- "@modern-js/generator-utils": "3.4.15",
38
- "@modern-js/generator-common": "3.4.15",
39
- "@scripts/build": "2.58.1",
40
- "@scripts/jest-config": "2.58.1",
41
- "@modern-js/plugin-i18n": "2.58.1"
37
+ "@modern-js/generator-common": "3.4.17",
38
+ "@modern-js/plugin-i18n": "2.58.3",
39
+ "@scripts/build": "2.58.3",
40
+ "@modern-js/generator-utils": "3.4.17",
41
+ "@scripts/jest-config": "2.58.3"
42
42
  },
43
43
  "sideEffects": false,
44
44
  "publishConfig": {
package/src/index.ts CHANGED
@@ -1,27 +1,27 @@
1
1
  import path from 'path';
2
- import {
3
- fs,
4
- chalk,
5
- getPackageVersion,
6
- getModernPluginVersion,
7
- isTsProject,
8
- readTsConfigByFile,
9
- getModernConfigFile,
10
- } from '@modern-js/generator-utils';
11
- import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
2
+ import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
12
3
  import { AppAPI } from '@modern-js/codesmith-api-app';
13
4
  import { JsonAPI } from '@modern-js/codesmith-api-json';
14
5
  import {
15
- getBFFSchema,
6
+ BFFPluginDependence,
7
+ BFFPluginName,
16
8
  BFFType,
17
- i18n as commonI18n,
18
9
  Framework,
19
- Language,
20
10
  FrameworkAppendTypeContent,
11
+ Language,
21
12
  Solution,
22
- BFFPluginName,
23
- BFFPluginDependence,
13
+ i18n as commonI18n,
14
+ getBFFSchema,
24
15
  } from '@modern-js/generator-common';
16
+ import {
17
+ fs,
18
+ chalk,
19
+ getModernConfigFile,
20
+ getModernPluginVersion,
21
+ getPackageVersion,
22
+ isTsProject,
23
+ readTsConfigByFile,
24
+ } from '@modern-js/generator-utils';
25
25
  import { i18n, localeKeys } from './locale';
26
26
 
27
27
  function isEmptyApiDir(apiDir: string) {
@@ -79,9 +79,7 @@ export const handleTemplateFile = async (
79
79
 
80
80
  if (framework === Framework.Express || framework === Framework.Koa) {
81
81
  updateInfo = {
82
- [`devDependencies.@types/${
83
- framework as string
84
- }`]: `~${await getPackageVersion(`@types/${framework as string}`)}`,
82
+ [`devDependencies.@types/${framework as string}`]: `~${await getPackageVersion(`@types/${framework as string}`)}`,
85
83
  };
86
84
  }
87
85
 
@@ -101,9 +99,7 @@ export const handleTemplateFile = async (
101
99
  'dependencies.@modern-js/plugin-bff': `${await getBffPluginVersion(
102
100
  '@modern-js/plugin-bff',
103
101
  )}`,
104
- [`dependencies.@modern-js/plugin-${
105
- framework as string
106
- }`]: `${await getBffPluginVersion(
102
+ [`dependencies.@modern-js/plugin-${framework as string}`]: `${await getBffPluginVersion(
107
103
  `@modern-js/plugin-${framework as string}`,
108
104
  )}`,
109
105
  'devDependencies.ts-node': '~10.8.1',
@@ -236,7 +232,6 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
236
232
  commonI18n.changeLanguage({ locale });
237
233
 
238
234
  if (!(await appApi.checkEnvironment())) {
239
- // eslint-disable-next-line no-process-exit
240
235
  process.exit(1);
241
236
  }
242
237
 
@@ -247,7 +242,6 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
247
242
  try {
248
243
  await handleTemplateFile(context, generator, appApi);
249
244
  } catch (e) {
250
- // eslint-disable-next-line no-process-exit
251
245
  process.exit(1);
252
246
  }
253
247