@modern-js/server-core 2.28.0 → 2.30.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 +24 -0
- package/dist/cjs/plugin.js +4 -0
- package/dist/esm/plugin.js +4 -0
- package/dist/types/plugin.d.ts +15 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @modern-js/server-plugin
|
|
2
2
|
|
|
3
|
+
## 2.30.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a5ee81a: feat(server): add new server hooks `beforeServerInit` & `afterServerInit`
|
|
8
|
+
feat(server): 添加新的服务端钩子 `beforeServerInit` & `afterServerInit`
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- @modern-js/utils@2.30.0
|
|
13
|
+
- @modern-js/plugin@2.30.0
|
|
14
|
+
|
|
15
|
+
## 2.29.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [e6b5355]
|
|
20
|
+
- Updated dependencies [93db783]
|
|
21
|
+
- Updated dependencies [cba7675]
|
|
22
|
+
- Updated dependencies [99052ea]
|
|
23
|
+
- Updated dependencies [1d71d2e]
|
|
24
|
+
- @modern-js/utils@2.29.0
|
|
25
|
+
- @modern-js/plugin@2.29.0
|
|
26
|
+
|
|
3
27
|
## 2.28.0
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -44,6 +44,8 @@ const prepareWebServer = (0, _plugin.createAsyncPipeline)();
|
|
|
44
44
|
const prepareApiServer = (0, _plugin.createAsyncPipeline)();
|
|
45
45
|
const onApiChange = (0, _plugin.createWaterfall)();
|
|
46
46
|
const repack = (0, _plugin.createWaterfall)();
|
|
47
|
+
const beforeServerInit = (0, _plugin.createAsyncWaterfall)();
|
|
48
|
+
const afterServerInit = (0, _plugin.createAsyncWaterfall)();
|
|
47
49
|
const beforeDevServer = (0, _plugin.createParallelWorkflow)();
|
|
48
50
|
const setupCompiler = (0, _plugin.createParallelWorkflow)();
|
|
49
51
|
const afterDevServer = (0, _plugin.createParallelWorkflow)();
|
|
@@ -86,6 +88,8 @@ const serverHooks = {
|
|
|
86
88
|
prepareApiServer,
|
|
87
89
|
repack,
|
|
88
90
|
onApiChange,
|
|
91
|
+
beforeServerInit,
|
|
92
|
+
afterServerInit,
|
|
89
93
|
beforeDevServer,
|
|
90
94
|
setupCompiler,
|
|
91
95
|
afterDevServer,
|
package/dist/esm/plugin.js
CHANGED
|
@@ -7,6 +7,8 @@ const prepareWebServer = createAsyncPipeline();
|
|
|
7
7
|
const prepareApiServer = createAsyncPipeline();
|
|
8
8
|
const onApiChange = createWaterfall();
|
|
9
9
|
const repack = createWaterfall();
|
|
10
|
+
const beforeServerInit = createAsyncWaterfall();
|
|
11
|
+
const afterServerInit = createAsyncWaterfall();
|
|
10
12
|
const beforeDevServer = createParallelWorkflow();
|
|
11
13
|
const setupCompiler = createParallelWorkflow();
|
|
12
14
|
const afterDevServer = createParallelWorkflow();
|
|
@@ -49,6 +51,8 @@ const serverHooks = {
|
|
|
49
51
|
prepareApiServer,
|
|
50
52
|
repack,
|
|
51
53
|
onApiChange,
|
|
54
|
+
beforeServerInit,
|
|
55
|
+
afterServerInit,
|
|
52
56
|
beforeDevServer,
|
|
53
57
|
setupCompiler,
|
|
54
58
|
afterDevServer,
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { IncomingMessage, ServerResponse } from 'http';
|
|
|
4
4
|
import { Readable } from 'stream';
|
|
5
5
|
import type { Component } from 'react';
|
|
6
6
|
import { CommonAPI, ToThreads, AsyncSetup, PluginOptions } from '@modern-js/plugin';
|
|
7
|
-
import type { ModernServerContext, BaseSSRServerContext, AfterMatchContext, AfterRenderContext, MiddlewareContext, ISAppContext, ServerRoute, HttpMethodDecider } from '@modern-js/types';
|
|
7
|
+
import type { ModernServerContext, BaseSSRServerContext, AfterMatchContext, AfterRenderContext, MiddlewareContext, ISAppContext, ServerRoute, HttpMethodDecider, ServerInitHookContext } from '@modern-js/types';
|
|
8
8
|
import type { BffUserConfig, ServerOptions, UserConfig } from './types/config';
|
|
9
9
|
export type WebAdapter = (ctx: MiddlewareContext) => void | Promise<void>;
|
|
10
10
|
export type Adapter = (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
@@ -63,6 +63,8 @@ declare const serverHooks: {
|
|
|
63
63
|
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
64
64
|
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
65
65
|
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
66
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
67
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
66
68
|
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
67
69
|
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
68
70
|
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
@@ -123,6 +125,8 @@ export declare const createServerManager: () => import("@modern-js/plugin").Asyn
|
|
|
123
125
|
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
124
126
|
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
125
127
|
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
128
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
129
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
126
130
|
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
127
131
|
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
128
132
|
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
@@ -181,6 +185,8 @@ export declare const serverManager: import("@modern-js/plugin").AsyncManager<{
|
|
|
181
185
|
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
182
186
|
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
183
187
|
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
188
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
189
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
184
190
|
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
185
191
|
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
186
192
|
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
@@ -245,6 +251,8 @@ export declare const createPlugin: (setup?: AsyncSetup<{
|
|
|
245
251
|
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
246
252
|
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
247
253
|
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
254
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
255
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
248
256
|
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
249
257
|
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
250
258
|
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
@@ -302,6 +310,8 @@ export declare const createPlugin: (setup?: AsyncSetup<{
|
|
|
302
310
|
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
303
311
|
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
304
312
|
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
313
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
314
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
305
315
|
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
306
316
|
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
307
317
|
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
@@ -355,6 +365,8 @@ export declare const createPlugin: (setup?: AsyncSetup<{
|
|
|
355
365
|
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
356
366
|
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
357
367
|
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
368
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
369
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
358
370
|
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
359
371
|
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
360
372
|
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
@@ -412,6 +424,8 @@ export declare const createPlugin: (setup?: AsyncSetup<{
|
|
|
412
424
|
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
413
425
|
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
414
426
|
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
427
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
428
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
415
429
|
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
416
430
|
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
417
431
|
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.30.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@swc/helpers": "0.5.1",
|
|
36
|
-
"@modern-js/plugin": "2.
|
|
37
|
-
"@modern-js/utils": "2.
|
|
36
|
+
"@modern-js/plugin": "2.30.0",
|
|
37
|
+
"@modern-js/utils": "2.30.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/jest": "^29",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"jest": "^29",
|
|
44
44
|
"ts-jest": "^29.1.0",
|
|
45
45
|
"typescript": "^5",
|
|
46
|
-
"@modern-js/babel-preset-app": "2.
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@scripts/jest-config": "2.
|
|
46
|
+
"@modern-js/babel-preset-app": "2.30.0",
|
|
47
|
+
"@modern-js/types": "2.30.0",
|
|
48
|
+
"@scripts/build": "2.30.0",
|
|
49
|
+
"@scripts/jest-config": "2.30.0"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"publishConfig": {
|