@modern-js/server-core 2.40.0 → 2.42.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/types/index.d.ts +1 -1
- package/dist/types/loadPlugins.d.ts +2 -2
- package/dist/types/plugin.d.ts +411 -411
- package/dist/types/types/config/bff.d.ts +5 -5
- package/dist/types/types/config/dev.d.ts +2 -2
- package/dist/types/types/config/html.d.ts +3 -3
- package/dist/types/types/config/index.d.ts +20 -20
- package/dist/types/types/config/output.d.ts +17 -16
- package/dist/types/types/config/security.d.ts +2 -2
- package/dist/types/types/config/server.d.ts +36 -36
- package/dist/types/types/config/share.d.ts +1 -1
- package/dist/types/types/config/source.d.ts +2 -2
- package/dist/types/types/config/tools.d.ts +2 -2
- package/package.json +7 -7
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InternalPlugins } from '@modern-js/types';
|
|
2
2
|
import { createPlugin, ServerPlugin } from './plugin';
|
|
3
3
|
export declare const loadPlugins: (appDirectory: string, configPlugins: ServerPlugin[], options: {
|
|
4
|
-
|
|
5
|
-
}) => ReturnType<typeof createPlugin>[];
|
|
4
|
+
internalPlugins?: InternalPlugins;
|
|
5
|
+
}) => ReturnType<typeof createPlugin>[];
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -9,26 +9,26 @@ 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>;
|
|
11
11
|
export type WebServerStartInput = {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
pwd: string;
|
|
13
|
+
config: Record<string, any>;
|
|
14
14
|
};
|
|
15
15
|
export type LoaderHandler = (context: ModernServerContext) => Promise<void>;
|
|
16
16
|
export type APIServerStartInput = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
pwd: string;
|
|
18
|
+
prefix?: string;
|
|
19
|
+
httpMethodDecider?: HttpMethodDecider;
|
|
20
|
+
config?: {
|
|
21
|
+
middleware?: Array<any>;
|
|
22
|
+
};
|
|
23
|
+
render?: (req: IncomingMessage, res: ServerResponse, url?: string) => Promise<string | Readable | null>;
|
|
24
24
|
};
|
|
25
25
|
type Change = {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
filename: string;
|
|
27
|
+
event: 'add' | 'change' | 'unlink';
|
|
28
28
|
};
|
|
29
29
|
export type Route = Record<string, unknown>;
|
|
30
30
|
export type RequestResult = {
|
|
31
|
-
|
|
31
|
+
isfinish: boolean;
|
|
32
32
|
};
|
|
33
33
|
export type SSRServerContext = Record<string, unknown>;
|
|
34
34
|
export type RenderContext = Record<string, unknown>;
|
|
@@ -44,65 +44,65 @@ export declare const useConfigContext: () => UserConfig;
|
|
|
44
44
|
*/
|
|
45
45
|
export declare const useAppContext: () => ISAppContext;
|
|
46
46
|
declare const pluginAPI: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
useAppContext: () => ISAppContext;
|
|
48
|
+
useConfigContext: () => UserConfig;
|
|
49
|
+
setAppContext: (value: ISAppContext) => void;
|
|
50
50
|
};
|
|
51
51
|
declare const serverHooks: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
52
|
+
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
53
|
+
addWebMiddleware: (_input: any) => void;
|
|
54
|
+
addAPIMiddleware: (_input: any) => void;
|
|
55
|
+
}, unknown>;
|
|
56
|
+
config: import("@modern-js/plugin").Waterfall<ServerConfig>;
|
|
57
|
+
prepare: import("@modern-js/plugin").Waterfall<void>;
|
|
58
|
+
prepareLoaderHandler: import("@modern-js/plugin").AsyncPipeline<{
|
|
59
|
+
serverRoutes: ServerRoute[];
|
|
60
|
+
distDir: string;
|
|
61
|
+
}, LoaderHandler>;
|
|
62
|
+
prepareWebServer: import("@modern-js/plugin").AsyncPipeline<WebServerStartInput, WebAdapter>;
|
|
63
|
+
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
64
|
+
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
65
|
+
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
66
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
67
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
68
|
+
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
69
|
+
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
70
|
+
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
71
|
+
beforeRouteSet: import("@modern-js/plugin").AsyncPipeline<Route[], Route[]>;
|
|
72
|
+
afterRouteSet: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
|
|
73
|
+
beforeProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
74
|
+
afterProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
75
|
+
listen: import("@modern-js/plugin").ParallelWorkflow<{
|
|
76
|
+
ip: string;
|
|
77
|
+
port: number;
|
|
78
|
+
}, any[]>;
|
|
79
|
+
beforeServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
80
|
+
afterServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
81
|
+
extendSSRContext: import("@modern-js/plugin").AsyncWaterfall<BaseSSRServerContext>;
|
|
82
|
+
extendContext: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, ModernServerContext>;
|
|
83
|
+
handleError: import("@modern-js/plugin").ParallelWorkflow<{
|
|
84
|
+
error: Error;
|
|
85
|
+
}, unknown>;
|
|
86
|
+
beforeMatch: import("@modern-js/plugin").AsyncPipeline<{
|
|
87
|
+
context: ModernServerContext;
|
|
88
|
+
}, any>;
|
|
89
|
+
afterMatch: import("@modern-js/plugin").AsyncPipeline<AfterMatchContext, any>;
|
|
90
|
+
prefetch: import("@modern-js/plugin").ParallelWorkflow<{
|
|
91
|
+
context: SSRServerContext;
|
|
92
|
+
}, unknown>;
|
|
93
|
+
renderToString: import("@modern-js/plugin").AsyncPipeline<{
|
|
94
|
+
App: Component;
|
|
95
|
+
context: RenderContext;
|
|
96
|
+
}, string>;
|
|
97
|
+
beforeRender: import("@modern-js/plugin").AsyncPipeline<{
|
|
98
|
+
context: ModernServerContext;
|
|
99
|
+
}, any>;
|
|
100
|
+
afterRender: import("@modern-js/plugin").AsyncPipeline<AfterRenderContext, any>;
|
|
101
|
+
beforeSend: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, RequestResult>;
|
|
102
|
+
afterSend: import("@modern-js/plugin").ParallelWorkflow<{
|
|
103
|
+
context: ModernServerContext;
|
|
104
|
+
}, unknown>;
|
|
105
|
+
reset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
106
106
|
};
|
|
107
107
|
/** All hooks of server plugin. */
|
|
108
108
|
export type ServerHooks = typeof serverHooks;
|
|
@@ -111,362 +111,362 @@ export type ServerHookCallbacks = ToThreads<ServerHooks>;
|
|
|
111
111
|
/** All apis for server plugin. */
|
|
112
112
|
export type PluginAPI = typeof pluginAPI & CommonAPI<ServerHooks>;
|
|
113
113
|
export declare const createServerManager: () => import("@modern-js/plugin").AsyncManager<{
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
114
|
+
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
115
|
+
addWebMiddleware: (_input: any) => void;
|
|
116
|
+
addAPIMiddleware: (_input: any) => void;
|
|
117
|
+
}, unknown>;
|
|
118
|
+
config: import("@modern-js/plugin").Waterfall<ServerConfig>;
|
|
119
|
+
prepare: import("@modern-js/plugin").Waterfall<void>;
|
|
120
|
+
prepareLoaderHandler: import("@modern-js/plugin").AsyncPipeline<{
|
|
121
|
+
serverRoutes: ServerRoute[];
|
|
122
|
+
distDir: string;
|
|
123
|
+
}, LoaderHandler>;
|
|
124
|
+
prepareWebServer: import("@modern-js/plugin").AsyncPipeline<WebServerStartInput, WebAdapter>;
|
|
125
|
+
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
126
|
+
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
127
|
+
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
128
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
129
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
130
|
+
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
131
|
+
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
132
|
+
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
133
|
+
beforeRouteSet: import("@modern-js/plugin").AsyncPipeline<Route[], Route[]>;
|
|
134
|
+
afterRouteSet: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
|
|
135
|
+
beforeProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
136
|
+
afterProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
137
|
+
listen: import("@modern-js/plugin").ParallelWorkflow<{
|
|
138
|
+
ip: string;
|
|
139
|
+
port: number;
|
|
140
|
+
}, any[]>;
|
|
141
|
+
beforeServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
142
|
+
afterServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
143
|
+
extendSSRContext: import("@modern-js/plugin").AsyncWaterfall<BaseSSRServerContext>;
|
|
144
|
+
extendContext: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, ModernServerContext>;
|
|
145
|
+
handleError: import("@modern-js/plugin").ParallelWorkflow<{
|
|
146
|
+
error: Error;
|
|
147
|
+
}, unknown>;
|
|
148
|
+
beforeMatch: import("@modern-js/plugin").AsyncPipeline<{
|
|
149
|
+
context: ModernServerContext;
|
|
150
|
+
}, any>;
|
|
151
|
+
afterMatch: import("@modern-js/plugin").AsyncPipeline<AfterMatchContext, any>;
|
|
152
|
+
prefetch: import("@modern-js/plugin").ParallelWorkflow<{
|
|
153
|
+
context: SSRServerContext;
|
|
154
|
+
}, unknown>;
|
|
155
|
+
renderToString: import("@modern-js/plugin").AsyncPipeline<{
|
|
156
|
+
App: Component;
|
|
157
|
+
context: RenderContext;
|
|
158
|
+
}, string>;
|
|
159
|
+
beforeRender: import("@modern-js/plugin").AsyncPipeline<{
|
|
160
|
+
context: ModernServerContext;
|
|
161
|
+
}, any>;
|
|
162
|
+
afterRender: import("@modern-js/plugin").AsyncPipeline<AfterRenderContext, any>;
|
|
163
|
+
beforeSend: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, RequestResult>;
|
|
164
|
+
afterSend: import("@modern-js/plugin").ParallelWorkflow<{
|
|
165
|
+
context: ModernServerContext;
|
|
166
|
+
}, unknown>;
|
|
167
|
+
reset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
168
168
|
}, {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
useAppContext: () => ISAppContext;
|
|
170
|
+
useConfigContext: () => UserConfig;
|
|
171
|
+
setAppContext: (value: ISAppContext) => void;
|
|
172
172
|
}>;
|
|
173
173
|
export declare const serverManager: import("@modern-js/plugin").AsyncManager<{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
174
|
+
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
175
|
+
addWebMiddleware: (_input: any) => void;
|
|
176
|
+
addAPIMiddleware: (_input: any) => void;
|
|
177
|
+
}, unknown>;
|
|
178
|
+
config: import("@modern-js/plugin").Waterfall<ServerConfig>;
|
|
179
|
+
prepare: import("@modern-js/plugin").Waterfall<void>;
|
|
180
|
+
prepareLoaderHandler: import("@modern-js/plugin").AsyncPipeline<{
|
|
181
|
+
serverRoutes: ServerRoute[];
|
|
182
|
+
distDir: string;
|
|
183
|
+
}, LoaderHandler>;
|
|
184
|
+
prepareWebServer: import("@modern-js/plugin").AsyncPipeline<WebServerStartInput, WebAdapter>;
|
|
185
|
+
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
186
|
+
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
187
|
+
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
188
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
189
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
190
|
+
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
191
|
+
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
192
|
+
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
193
|
+
beforeRouteSet: import("@modern-js/plugin").AsyncPipeline<Route[], Route[]>;
|
|
194
|
+
afterRouteSet: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
|
|
195
|
+
beforeProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
196
|
+
afterProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
197
|
+
listen: import("@modern-js/plugin").ParallelWorkflow<{
|
|
198
|
+
ip: string;
|
|
199
|
+
port: number;
|
|
200
|
+
}, any[]>;
|
|
201
|
+
beforeServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
202
|
+
afterServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
203
|
+
extendSSRContext: import("@modern-js/plugin").AsyncWaterfall<BaseSSRServerContext>;
|
|
204
|
+
extendContext: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, ModernServerContext>;
|
|
205
|
+
handleError: import("@modern-js/plugin").ParallelWorkflow<{
|
|
206
|
+
error: Error;
|
|
207
|
+
}, unknown>;
|
|
208
|
+
beforeMatch: import("@modern-js/plugin").AsyncPipeline<{
|
|
209
|
+
context: ModernServerContext;
|
|
210
|
+
}, any>;
|
|
211
|
+
afterMatch: import("@modern-js/plugin").AsyncPipeline<AfterMatchContext, any>;
|
|
212
|
+
prefetch: import("@modern-js/plugin").ParallelWorkflow<{
|
|
213
|
+
context: SSRServerContext;
|
|
214
|
+
}, unknown>;
|
|
215
|
+
renderToString: import("@modern-js/plugin").AsyncPipeline<{
|
|
216
|
+
App: Component;
|
|
217
|
+
context: RenderContext;
|
|
218
|
+
}, string>;
|
|
219
|
+
beforeRender: import("@modern-js/plugin").AsyncPipeline<{
|
|
220
|
+
context: ModernServerContext;
|
|
221
|
+
}, any>;
|
|
222
|
+
afterRender: import("@modern-js/plugin").AsyncPipeline<AfterRenderContext, any>;
|
|
223
|
+
beforeSend: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, RequestResult>;
|
|
224
|
+
afterSend: import("@modern-js/plugin").ParallelWorkflow<{
|
|
225
|
+
context: ModernServerContext;
|
|
226
|
+
}, unknown>;
|
|
227
|
+
reset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
228
228
|
}, {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
useAppContext: () => ISAppContext;
|
|
230
|
+
useConfigContext: () => UserConfig;
|
|
231
|
+
setAppContext: (value: ISAppContext) => void;
|
|
232
232
|
}>;
|
|
233
233
|
/** Plugin options of a server plugin. */
|
|
234
234
|
export type ServerPlugin = PluginOptions<ServerHooks, AsyncSetup<ServerHooks, PluginAPI>>;
|
|
235
235
|
export type ServerConfig = {
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
bff?: BffUserConfig;
|
|
237
|
+
plugins?: ServerPlugin[];
|
|
238
238
|
};
|
|
239
239
|
export declare const createPlugin: (setup?: AsyncSetup<{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
240
|
+
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
241
|
+
addWebMiddleware: (_input: any) => void;
|
|
242
|
+
addAPIMiddleware: (_input: any) => void;
|
|
243
|
+
}, unknown>;
|
|
244
|
+
config: import("@modern-js/plugin").Waterfall<ServerConfig>;
|
|
245
|
+
prepare: import("@modern-js/plugin").Waterfall<void>;
|
|
246
|
+
prepareLoaderHandler: import("@modern-js/plugin").AsyncPipeline<{
|
|
247
|
+
serverRoutes: ServerRoute[];
|
|
248
|
+
distDir: string;
|
|
249
|
+
}, LoaderHandler>;
|
|
250
|
+
prepareWebServer: import("@modern-js/plugin").AsyncPipeline<WebServerStartInput, WebAdapter>;
|
|
251
|
+
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
252
|
+
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
253
|
+
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
254
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
255
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
256
|
+
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
257
|
+
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
258
|
+
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
259
|
+
beforeRouteSet: import("@modern-js/plugin").AsyncPipeline<Route[], Route[]>;
|
|
260
|
+
afterRouteSet: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
|
|
261
|
+
beforeProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
262
|
+
afterProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
263
|
+
listen: import("@modern-js/plugin").ParallelWorkflow<{
|
|
264
|
+
ip: string;
|
|
265
|
+
port: number;
|
|
266
|
+
}, any[]>;
|
|
267
|
+
beforeServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
268
|
+
afterServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
269
|
+
extendSSRContext: import("@modern-js/plugin").AsyncWaterfall<BaseSSRServerContext>;
|
|
270
|
+
extendContext: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, ModernServerContext>;
|
|
271
|
+
handleError: import("@modern-js/plugin").ParallelWorkflow<{
|
|
272
|
+
error: Error;
|
|
273
|
+
}, unknown>;
|
|
274
|
+
beforeMatch: import("@modern-js/plugin").AsyncPipeline<{
|
|
275
|
+
context: ModernServerContext;
|
|
276
|
+
}, any>;
|
|
277
|
+
afterMatch: import("@modern-js/plugin").AsyncPipeline<AfterMatchContext, any>;
|
|
278
|
+
prefetch: import("@modern-js/plugin").ParallelWorkflow<{
|
|
279
|
+
context: SSRServerContext;
|
|
280
|
+
}, unknown>;
|
|
281
|
+
renderToString: import("@modern-js/plugin").AsyncPipeline<{
|
|
282
|
+
App: Component;
|
|
283
|
+
context: RenderContext;
|
|
284
|
+
}, string>;
|
|
285
|
+
beforeRender: import("@modern-js/plugin").AsyncPipeline<{
|
|
286
|
+
context: ModernServerContext;
|
|
287
|
+
}, any>;
|
|
288
|
+
afterRender: import("@modern-js/plugin").AsyncPipeline<AfterRenderContext, any>;
|
|
289
|
+
beforeSend: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, RequestResult>;
|
|
290
|
+
afterSend: import("@modern-js/plugin").ParallelWorkflow<{
|
|
291
|
+
context: ModernServerContext;
|
|
292
|
+
}, unknown>;
|
|
293
|
+
reset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
294
294
|
}, {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
useAppContext: () => ISAppContext;
|
|
296
|
+
useConfigContext: () => UserConfig;
|
|
297
|
+
setAppContext: (value: ISAppContext) => void;
|
|
298
298
|
}> | undefined, options?: PluginOptions<{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
299
|
+
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
300
|
+
addWebMiddleware: (_input: any) => void;
|
|
301
|
+
addAPIMiddleware: (_input: any) => void;
|
|
302
|
+
}, unknown>;
|
|
303
|
+
config: import("@modern-js/plugin").Waterfall<ServerConfig>;
|
|
304
|
+
prepare: import("@modern-js/plugin").Waterfall<void>;
|
|
305
|
+
prepareLoaderHandler: import("@modern-js/plugin").AsyncPipeline<{
|
|
306
|
+
serverRoutes: ServerRoute[];
|
|
307
|
+
distDir: string;
|
|
308
|
+
}, LoaderHandler>;
|
|
309
|
+
prepareWebServer: import("@modern-js/plugin").AsyncPipeline<WebServerStartInput, WebAdapter>;
|
|
310
|
+
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
311
|
+
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
312
|
+
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
313
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
314
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
315
|
+
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
316
|
+
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
317
|
+
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
318
|
+
beforeRouteSet: import("@modern-js/plugin").AsyncPipeline<Route[], Route[]>;
|
|
319
|
+
afterRouteSet: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
|
|
320
|
+
beforeProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
321
|
+
afterProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
322
|
+
listen: import("@modern-js/plugin").ParallelWorkflow<{
|
|
323
|
+
ip: string;
|
|
324
|
+
port: number;
|
|
325
|
+
}, any[]>;
|
|
326
|
+
beforeServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
327
|
+
afterServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
328
|
+
extendSSRContext: import("@modern-js/plugin").AsyncWaterfall<BaseSSRServerContext>;
|
|
329
|
+
extendContext: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, ModernServerContext>;
|
|
330
|
+
handleError: import("@modern-js/plugin").ParallelWorkflow<{
|
|
331
|
+
error: Error;
|
|
332
|
+
}, unknown>;
|
|
333
|
+
beforeMatch: import("@modern-js/plugin").AsyncPipeline<{
|
|
334
|
+
context: ModernServerContext;
|
|
335
|
+
}, any>;
|
|
336
|
+
afterMatch: import("@modern-js/plugin").AsyncPipeline<AfterMatchContext, any>;
|
|
337
|
+
prefetch: import("@modern-js/plugin").ParallelWorkflow<{
|
|
338
|
+
context: SSRServerContext;
|
|
339
|
+
}, unknown>;
|
|
340
|
+
renderToString: import("@modern-js/plugin").AsyncPipeline<{
|
|
341
|
+
App: Component;
|
|
342
|
+
context: RenderContext;
|
|
343
|
+
}, string>;
|
|
344
|
+
beforeRender: import("@modern-js/plugin").AsyncPipeline<{
|
|
345
|
+
context: ModernServerContext;
|
|
346
|
+
}, any>;
|
|
347
|
+
afterRender: import("@modern-js/plugin").AsyncPipeline<AfterRenderContext, any>;
|
|
348
|
+
beforeSend: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, RequestResult>;
|
|
349
|
+
afterSend: import("@modern-js/plugin").ParallelWorkflow<{
|
|
350
|
+
context: ModernServerContext;
|
|
351
|
+
}, unknown>;
|
|
352
|
+
reset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
353
353
|
}, AsyncSetup<{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
354
|
+
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
355
|
+
addWebMiddleware: (_input: any) => void;
|
|
356
|
+
addAPIMiddleware: (_input: any) => void;
|
|
357
|
+
}, unknown>;
|
|
358
|
+
config: import("@modern-js/plugin").Waterfall<ServerConfig>;
|
|
359
|
+
prepare: import("@modern-js/plugin").Waterfall<void>;
|
|
360
|
+
prepareLoaderHandler: import("@modern-js/plugin").AsyncPipeline<{
|
|
361
|
+
serverRoutes: ServerRoute[];
|
|
362
|
+
distDir: string;
|
|
363
|
+
}, LoaderHandler>;
|
|
364
|
+
prepareWebServer: import("@modern-js/plugin").AsyncPipeline<WebServerStartInput, WebAdapter>;
|
|
365
|
+
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
366
|
+
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
367
|
+
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
368
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
369
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
370
|
+
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
371
|
+
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
372
|
+
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
373
|
+
beforeRouteSet: import("@modern-js/plugin").AsyncPipeline<Route[], Route[]>;
|
|
374
|
+
afterRouteSet: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
|
|
375
|
+
beforeProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
376
|
+
afterProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
377
|
+
listen: import("@modern-js/plugin").ParallelWorkflow<{
|
|
378
|
+
ip: string;
|
|
379
|
+
port: number;
|
|
380
|
+
}, any[]>;
|
|
381
|
+
beforeServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
382
|
+
afterServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
383
|
+
extendSSRContext: import("@modern-js/plugin").AsyncWaterfall<BaseSSRServerContext>;
|
|
384
|
+
extendContext: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, ModernServerContext>;
|
|
385
|
+
handleError: import("@modern-js/plugin").ParallelWorkflow<{
|
|
386
|
+
error: Error;
|
|
387
|
+
}, unknown>;
|
|
388
|
+
beforeMatch: import("@modern-js/plugin").AsyncPipeline<{
|
|
389
|
+
context: ModernServerContext;
|
|
390
|
+
}, any>;
|
|
391
|
+
afterMatch: import("@modern-js/plugin").AsyncPipeline<AfterMatchContext, any>;
|
|
392
|
+
prefetch: import("@modern-js/plugin").ParallelWorkflow<{
|
|
393
|
+
context: SSRServerContext;
|
|
394
|
+
}, unknown>;
|
|
395
|
+
renderToString: import("@modern-js/plugin").AsyncPipeline<{
|
|
396
|
+
App: Component;
|
|
397
|
+
context: RenderContext;
|
|
398
|
+
}, string>;
|
|
399
|
+
beforeRender: import("@modern-js/plugin").AsyncPipeline<{
|
|
400
|
+
context: ModernServerContext;
|
|
401
|
+
}, any>;
|
|
402
|
+
afterRender: import("@modern-js/plugin").AsyncPipeline<AfterRenderContext, any>;
|
|
403
|
+
beforeSend: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, RequestResult>;
|
|
404
|
+
afterSend: import("@modern-js/plugin").ParallelWorkflow<{
|
|
405
|
+
context: ModernServerContext;
|
|
406
|
+
}, unknown>;
|
|
407
|
+
reset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
408
408
|
}, {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
409
|
+
useAppContext: () => ISAppContext;
|
|
410
|
+
useConfigContext: () => UserConfig;
|
|
411
|
+
setAppContext: (value: ISAppContext) => void;
|
|
412
412
|
}>> | undefined) => import("@modern-js/plugin").AsyncPlugin<{
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
413
|
+
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
414
|
+
addWebMiddleware: (_input: any) => void;
|
|
415
|
+
addAPIMiddleware: (_input: any) => void;
|
|
416
|
+
}, unknown>;
|
|
417
|
+
config: import("@modern-js/plugin").Waterfall<ServerConfig>;
|
|
418
|
+
prepare: import("@modern-js/plugin").Waterfall<void>;
|
|
419
|
+
prepareLoaderHandler: import("@modern-js/plugin").AsyncPipeline<{
|
|
420
|
+
serverRoutes: ServerRoute[];
|
|
421
|
+
distDir: string;
|
|
422
|
+
}, LoaderHandler>;
|
|
423
|
+
prepareWebServer: import("@modern-js/plugin").AsyncPipeline<WebServerStartInput, WebAdapter>;
|
|
424
|
+
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<APIServerStartInput, Adapter>;
|
|
425
|
+
repack: import("@modern-js/plugin").Waterfall<void>;
|
|
426
|
+
onApiChange: import("@modern-js/plugin").Waterfall<Change[]>;
|
|
427
|
+
beforeServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
428
|
+
afterServerInit: import("@modern-js/plugin").AsyncWaterfall<ServerInitHookContext>;
|
|
429
|
+
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
430
|
+
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
431
|
+
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
432
|
+
beforeRouteSet: import("@modern-js/plugin").AsyncPipeline<Route[], Route[]>;
|
|
433
|
+
afterRouteSet: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
|
|
434
|
+
beforeProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
435
|
+
afterProdServer: import("@modern-js/plugin").ParallelWorkflow<ServerOptions, any>;
|
|
436
|
+
listen: import("@modern-js/plugin").ParallelWorkflow<{
|
|
437
|
+
ip: string;
|
|
438
|
+
port: number;
|
|
439
|
+
}, any[]>;
|
|
440
|
+
beforeServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
441
|
+
afterServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
442
|
+
extendSSRContext: import("@modern-js/plugin").AsyncWaterfall<BaseSSRServerContext>;
|
|
443
|
+
extendContext: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, ModernServerContext>;
|
|
444
|
+
handleError: import("@modern-js/plugin").ParallelWorkflow<{
|
|
445
|
+
error: Error;
|
|
446
|
+
}, unknown>;
|
|
447
|
+
beforeMatch: import("@modern-js/plugin").AsyncPipeline<{
|
|
448
|
+
context: ModernServerContext;
|
|
449
|
+
}, any>;
|
|
450
|
+
afterMatch: import("@modern-js/plugin").AsyncPipeline<AfterMatchContext, any>;
|
|
451
|
+
prefetch: import("@modern-js/plugin").ParallelWorkflow<{
|
|
452
|
+
context: SSRServerContext;
|
|
453
|
+
}, unknown>;
|
|
454
|
+
renderToString: import("@modern-js/plugin").AsyncPipeline<{
|
|
455
|
+
App: Component;
|
|
456
|
+
context: RenderContext;
|
|
457
|
+
}, string>;
|
|
458
|
+
beforeRender: import("@modern-js/plugin").AsyncPipeline<{
|
|
459
|
+
context: ModernServerContext;
|
|
460
|
+
}, any>;
|
|
461
|
+
afterRender: import("@modern-js/plugin").AsyncPipeline<AfterRenderContext, any>;
|
|
462
|
+
beforeSend: import("@modern-js/plugin").AsyncPipeline<ModernServerContext, RequestResult>;
|
|
463
|
+
afterSend: import("@modern-js/plugin").ParallelWorkflow<{
|
|
464
|
+
context: ModernServerContext;
|
|
465
|
+
}, unknown>;
|
|
466
|
+
reset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
467
467
|
}, {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
468
|
+
useAppContext: () => ISAppContext;
|
|
469
|
+
useConfigContext: () => UserConfig;
|
|
470
|
+
setAppContext: (value: ISAppContext) => void;
|
|
471
471
|
}>;
|
|
472
|
-
export {};
|
|
472
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Options } from 'http-proxy-middleware';
|
|
2
2
|
import type { HttpMethodDecider } from '@modern-js/types';
|
|
3
3
|
export interface BffUserConfig {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
prefix?: string;
|
|
5
|
+
proxy?: Record<string, Options>;
|
|
6
|
+
httpMethodDecider?: HttpMethodDecider;
|
|
7
|
+
enableHandleWeb?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export type BffNormalizedConfig = BffUserConfig;
|
|
9
|
+
export type BffNormalizedConfig = BffUserConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface HtmlUserConfig {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
favicon?: string;
|
|
3
|
+
faviconByEntries?: Record<string, string | undefined>;
|
|
4
4
|
}
|
|
5
|
-
export type HtmlNormalizedConfig = HtmlUserConfig;
|
|
5
|
+
export type HtmlNormalizedConfig = HtmlUserConfig;
|
|
@@ -13,28 +13,28 @@ export * from './server';
|
|
|
13
13
|
export * from './source';
|
|
14
14
|
export * from './tools';
|
|
15
15
|
interface RuntimeUserConfig {
|
|
16
|
-
|
|
16
|
+
[property: string]: any;
|
|
17
17
|
}
|
|
18
18
|
type RuntimeNormalizedConfig = RuntimeUserConfig;
|
|
19
19
|
export interface UserConfig {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
output?: OutputUserConfig;
|
|
21
|
+
source?: SourceUserConfig;
|
|
22
|
+
tools?: ToolsUserConfig;
|
|
23
|
+
server?: ServerUserConfig;
|
|
24
|
+
runtime?: RuntimeUserConfig;
|
|
25
|
+
html?: HtmlUserConfig;
|
|
26
|
+
bff?: BffUserConfig;
|
|
27
|
+
dev?: DevUserConfig;
|
|
28
|
+
security?: SecurityUserConfig;
|
|
29
29
|
}
|
|
30
30
|
export type ServerOptions = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
31
|
+
output: OutputNormalizedConfig;
|
|
32
|
+
source: SourceNormalizedConfig;
|
|
33
|
+
tools: ToolsNormalizedConfig;
|
|
34
|
+
server: ServerNormalizedConfig;
|
|
35
|
+
runtime: RuntimeNormalizedConfig;
|
|
36
|
+
html: HtmlNormalizedConfig;
|
|
37
|
+
bff: BffNormalizedConfig;
|
|
38
|
+
dev?: DevNormalizedConfig;
|
|
39
|
+
security?: SecurityNormalizedConfig;
|
|
40
|
+
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
export interface OutputUserConfig {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
distPath?: {
|
|
3
|
+
root?: string;
|
|
4
|
+
js?: string;
|
|
5
|
+
css?: string;
|
|
6
|
+
svg?: string;
|
|
7
|
+
font?: string;
|
|
8
|
+
html?: string;
|
|
9
|
+
image?: string;
|
|
10
|
+
media?: string;
|
|
11
|
+
server?: string;
|
|
12
|
+
};
|
|
13
|
+
enableInlineRouteManifests?: boolean;
|
|
14
|
+
disableInlineRouteManifests?: boolean;
|
|
15
|
+
path?: string;
|
|
16
|
+
assetPrefix?: string;
|
|
17
|
+
polyfill?: 'entry' | 'usage' | 'ua' | 'off';
|
|
17
18
|
}
|
|
18
|
-
export type OutputNormalizedConfig = OutputUserConfig;
|
|
19
|
+
export type OutputNormalizedConfig = OutputUserConfig;
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import type { SSRMode } from '@modern-js/types';
|
|
2
2
|
import type { WatchOptions } from '@modern-js/utils';
|
|
3
3
|
type Route = string | string[] | {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
route?: string | string[];
|
|
5
|
+
disableSpa?: boolean;
|
|
6
|
+
resHeaders?: Record<string, unknown>;
|
|
7
7
|
};
|
|
8
8
|
export type Routes = Record<string, Route>;
|
|
9
9
|
type PreloadLink = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
url: string;
|
|
11
|
+
as?: string;
|
|
12
|
+
rel?: string;
|
|
13
13
|
};
|
|
14
14
|
type PreloadInclude = Array<string | PreloadLink>;
|
|
15
15
|
interface PreloadAttributes {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
script?: Record<string, boolean | string>;
|
|
17
|
+
style?: Record<string, boolean | string>;
|
|
18
|
+
image?: Record<string, boolean | string>;
|
|
19
|
+
font?: Record<string, boolean | string>;
|
|
20
20
|
}
|
|
21
21
|
export type SSRPreload = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
/** Include external preload links to enhance the page's performance by preloading additional resources. */
|
|
23
|
+
include?: PreloadInclude;
|
|
24
|
+
/** Utilize string matching to exclude specific preload links. */
|
|
25
|
+
exclude?: RegExp | string;
|
|
26
|
+
/** Disable preload when the User-Agent is matched. */
|
|
27
|
+
userAgentFilter?: RegExp | string;
|
|
28
|
+
/** Include additional attributes to the Header Link. */
|
|
29
|
+
attributes?: PreloadAttributes;
|
|
30
30
|
};
|
|
31
31
|
export type SSR = boolean | {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
forceCSR?: boolean;
|
|
33
|
+
mode?: SSRMode;
|
|
34
|
+
preload?: boolean | SSRPreload;
|
|
35
|
+
inlineScript?: boolean;
|
|
36
|
+
disablePrerender?: boolean;
|
|
37
37
|
};
|
|
38
38
|
export type SSRByEntries = Record<string, SSR>;
|
|
39
39
|
export interface ServerUserConfig {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
routes?: Routes;
|
|
41
|
+
publicRoutes?: Record<string, string>;
|
|
42
|
+
ssr?: SSR;
|
|
43
|
+
ssrByEntries?: SSRByEntries;
|
|
44
|
+
baseUrl?: string | string[];
|
|
45
|
+
port?: number;
|
|
46
|
+
logger?: boolean | Record<string, any>;
|
|
47
|
+
metrics?: boolean | Record<string, any>;
|
|
48
|
+
enableMicroFrontendDebug?: boolean;
|
|
49
|
+
watchOptions?: WatchOptions;
|
|
50
|
+
compiler?: 'babel' | 'typescript';
|
|
51
|
+
enableFrameworkExt?: boolean;
|
|
52
52
|
}
|
|
53
53
|
export type ServerNormalizedConfig = ServerUserConfig;
|
|
54
|
-
export {};
|
|
54
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Alias } from '@modern-js/utils';
|
|
2
2
|
import type { ChainedConfig } from './share';
|
|
3
3
|
export interface SourceUserConfig {
|
|
4
|
-
|
|
4
|
+
alias?: ChainedConfig<Alias>;
|
|
5
5
|
}
|
|
6
|
-
export type SourceNormalizedConfig = SourceUserConfig;
|
|
6
|
+
export type SourceNormalizedConfig = SourceUserConfig;
|
|
@@ -2,7 +2,7 @@ import { BabelTransformOptions } from '@modern-js/types/common';
|
|
|
2
2
|
import { ChainedConfig } from './share';
|
|
3
3
|
type ToolsBabelConfig = ChainedConfig<BabelTransformOptions, any>;
|
|
4
4
|
export interface ToolsUserConfig {
|
|
5
|
-
|
|
5
|
+
babel?: ToolsBabelConfig;
|
|
6
6
|
}
|
|
7
7
|
export type ToolsNormalizedConfig = ToolsUserConfig;
|
|
8
|
-
export {};
|
|
8
|
+
export {};
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.42.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@swc/helpers": "0.5.
|
|
36
|
-
"@modern-js/
|
|
37
|
-
"@modern-js/
|
|
35
|
+
"@swc/helpers": "0.5.3",
|
|
36
|
+
"@modern-js/utils": "2.42.0",
|
|
37
|
+
"@modern-js/plugin": "2.42.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/jest": "^29",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"jest": "^29",
|
|
44
44
|
"ts-jest": "^29.1.0",
|
|
45
45
|
"typescript": "^5",
|
|
46
|
-
"@modern-js/types": "2.
|
|
47
|
-
"@scripts/build": "2.
|
|
48
|
-
"@scripts/jest-config": "2.
|
|
46
|
+
"@modern-js/types": "2.42.0",
|
|
47
|
+
"@scripts/build": "2.42.0",
|
|
48
|
+
"@scripts/jest-config": "2.42.0"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false,
|
|
51
51
|
"publishConfig": {
|