@modern-js/types 2.29.0 → 2.31.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @modern-js/types
2
2
 
3
+ ## 2.31.0
4
+
5
+ ## 2.30.0
6
+
7
+ ### Minor Changes
8
+
9
+ - a5ee81a: feat(server): add new server hooks `beforeServerInit` & `afterServerInit`
10
+ feat(server): 添加新的服务端钩子 `beforeServerInit` & `afterServerInit`
11
+
12
+ ### Patch Changes
13
+
14
+ - b6ab299: fix(prod-server): remove req bodyParser, let uesr parses body by themself.
15
+ fix(prod-server): 移除 req bodyParser, 让用户自行解析 body
16
+
3
17
  ## 2.29.0
4
18
 
5
19
  ### Minor Changes
package/cli/index.d.ts CHANGED
@@ -1,6 +1,22 @@
1
1
  import type { Merge } from 'type-fest';
2
2
 
3
- export type { Config as JestConfigTypes } from '@jest/types';
3
+ import type { Config as JestConfigTypes } from '@jest/types';
4
+
5
+ export type JestConfig = JestConfigTypes.Config;
6
+
7
+ export interface TestConfig {
8
+ /**
9
+ * Decide which transformer will be used to compile file
10
+ * Default: babel-jest
11
+ */
12
+ transformer?: 'babel-jest' | 'ts-jest';
13
+
14
+ /**
15
+ * Original jest config
16
+ * Doc: https://jestjs.io/docs/configuration
17
+ */
18
+ jest?: JestConfig | ((jestConfig: JestConfig) => JestConfig);
19
+ }
4
20
 
5
21
  /**
6
22
  * Bundle entrypoint
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.29.0",
18
+ "version": "2.31.0",
19
19
  "types": "./index.d.ts",
20
20
  "exports": {
21
21
  ".": {
@@ -45,8 +45,8 @@
45
45
  "http-proxy-middleware": "^2.0.4",
46
46
  "jest": "^29",
47
47
  "type-fest": "2.15.0",
48
- "@scripts/jest-config": "2.29.0",
49
- "@scripts/build": "2.29.0"
48
+ "@scripts/jest-config": "2.31.0",
49
+ "@scripts/build": "2.31.0"
50
50
  },
51
51
  "sideEffects": false,
52
52
  "publishConfig": {
@@ -60,7 +60,6 @@ export type BaseSSRServerContext = {
60
60
  query: Record<string, string>;
61
61
  headers: IncomingHttpHeaders;
62
62
  host: string;
63
- body?: string;
64
63
  [propsName: string]: any;
65
64
  };
66
65
  response: {
@@ -105,6 +104,11 @@ export type BaseSSRServerContext = {
105
104
  mode?: SSRMode; // ssr type
106
105
  };
107
106
 
107
+ export interface ServerInitHookContext {
108
+ app?: httpServer;
109
+ server: ModernServerInterface;
110
+ }
111
+
108
112
  export interface ISAppContext {
109
113
  appDirectory: string;
110
114
  distDirectory: string;