@modern-js/server-core 2.20.0 → 2.21.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,24 @@
|
|
|
1
1
|
# @modern-js/server-plugin
|
|
2
2
|
|
|
3
|
+
## 2.21.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 26dcf3a: chore: bump typescript to v5 in devDependencies
|
|
8
|
+
|
|
9
|
+
chore: 升级 devDependencies 中的 typescript 版本到 v5
|
|
10
|
+
|
|
11
|
+
- 43b4e83: feat: support security.nonce for add nonce attribute on script tag
|
|
12
|
+
feat: 支持 security.nonce 配置,为 script 标签添加 nonce 属性
|
|
13
|
+
- Updated dependencies [e81eeaf]
|
|
14
|
+
- Updated dependencies [26dcf3a]
|
|
15
|
+
- Updated dependencies [056627f]
|
|
16
|
+
- Updated dependencies [0fc15ca]
|
|
17
|
+
- Updated dependencies [43b4e83]
|
|
18
|
+
- Updated dependencies [ad78387]
|
|
19
|
+
- @modern-js/utils@2.21.0
|
|
20
|
+
- @modern-js/plugin@2.21.0
|
|
21
|
+
|
|
3
22
|
## 2.20.0
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -38,12 +38,10 @@ export declare const ConfigContext: import("@modern-js/plugin").Context<UserConf
|
|
|
38
38
|
/**
|
|
39
39
|
* Get original content of user config.
|
|
40
40
|
*/
|
|
41
|
-
|
|
42
41
|
export declare const useConfigContext: () => UserConfig;
|
|
43
42
|
/**
|
|
44
43
|
* Get app context, including directories, plugins and some static infos.
|
|
45
44
|
*/
|
|
46
|
-
|
|
47
45
|
export declare const useAppContext: () => ISAppContext;
|
|
48
46
|
declare const pluginAPI: {
|
|
49
47
|
useAppContext: () => ISAppContext;
|
|
@@ -105,13 +103,10 @@ declare const serverHooks: {
|
|
|
105
103
|
reset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
106
104
|
};
|
|
107
105
|
/** All hooks of server plugin. */
|
|
108
|
-
|
|
109
106
|
export type ServerHooks = typeof serverHooks;
|
|
110
107
|
/** All hook callbacks of server plugin. */
|
|
111
|
-
|
|
112
108
|
export type ServerHookCallbacks = ToThreads<ServerHooks>;
|
|
113
109
|
/** All apis for server plugin. */
|
|
114
|
-
|
|
115
110
|
export type PluginAPI = typeof pluginAPI & CommonAPI<ServerHooks>;
|
|
116
111
|
export declare const createServerManager: () => import("@modern-js/plugin").AsyncManager<{
|
|
117
112
|
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
@@ -230,7 +225,6 @@ export declare const serverManager: import("@modern-js/plugin").AsyncManager<{
|
|
|
230
225
|
setAppContext: (value: ISAppContext) => void;
|
|
231
226
|
}>;
|
|
232
227
|
/** Plugin options of a server plugin. */
|
|
233
|
-
|
|
234
228
|
export type ServerPlugin = PluginOptions<ServerHooks, AsyncSetup<ServerHooks, PluginAPI>>;
|
|
235
229
|
export type ServerConfig = {
|
|
236
230
|
bff?: BffUserConfig;
|
|
@@ -403,7 +397,7 @@ export declare const createPlugin: (setup?: AsyncSetup<{
|
|
|
403
397
|
useAppContext: () => ISAppContext;
|
|
404
398
|
useConfigContext: () => UserConfig;
|
|
405
399
|
setAppContext: (value: ISAppContext) => void;
|
|
406
|
-
}
|
|
400
|
+
}>> | undefined) => import("@modern-js/plugin").AsyncPlugin<{
|
|
407
401
|
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
408
402
|
addWebMiddleware: (_input: any) => void;
|
|
409
403
|
addAPIMiddleware: (_input: any) => void;
|
|
@@ -2,6 +2,7 @@ import { BffNormalizedConfig, BffUserConfig } from './bff';
|
|
|
2
2
|
import { DevNormalizedConfig, DevUserConfig } from './dev';
|
|
3
3
|
import { HtmlNormalizedConfig, HtmlUserConfig } from './html';
|
|
4
4
|
import { OutputNormalizedConfig, OutputUserConfig } from './output';
|
|
5
|
+
import { SecurityNormalizedConfig, SecurityUserConfig } from './security';
|
|
5
6
|
import { ServerNormalizedConfig, ServerUserConfig } from './server';
|
|
6
7
|
import { SourceNormalizedConfig, SourceUserConfig } from './source';
|
|
7
8
|
import { ToolsNormalizedConfig, ToolsUserConfig } from './tools';
|
|
@@ -24,6 +25,7 @@ export interface UserConfig {
|
|
|
24
25
|
html?: HtmlUserConfig;
|
|
25
26
|
bff?: BffUserConfig;
|
|
26
27
|
dev?: DevUserConfig;
|
|
28
|
+
security?: SecurityUserConfig;
|
|
27
29
|
}
|
|
28
30
|
export type ServerOptions = {
|
|
29
31
|
output: OutputNormalizedConfig;
|
|
@@ -34,4 +36,5 @@ export type ServerOptions = {
|
|
|
34
36
|
html: HtmlNormalizedConfig;
|
|
35
37
|
bff: BffNormalizedConfig;
|
|
36
38
|
dev?: DevNormalizedConfig;
|
|
39
|
+
security?: SecurityNormalizedConfig;
|
|
37
40
|
};
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.21.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -33,20 +33,20 @@
|
|
|
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.21.0",
|
|
37
|
+
"@modern-js/utils": "2.21.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/jest": "^29",
|
|
41
41
|
"@types/node": "^14",
|
|
42
42
|
"http-proxy-middleware": "^2.0.4",
|
|
43
43
|
"jest": "^29",
|
|
44
|
-
"ts-jest": "^29.0
|
|
45
|
-
"typescript": "^
|
|
46
|
-
"@modern-js/types": "2.
|
|
47
|
-
"@modern-js/babel-preset-app": "2.
|
|
48
|
-
"@scripts/build": "2.
|
|
49
|
-
"@scripts/jest-config": "2.
|
|
44
|
+
"ts-jest": "^29.1.0",
|
|
45
|
+
"typescript": "^5",
|
|
46
|
+
"@modern-js/types": "2.21.0",
|
|
47
|
+
"@modern-js/babel-preset-app": "2.21.0",
|
|
48
|
+
"@scripts/build": "2.21.0",
|
|
49
|
+
"@scripts/jest-config": "2.21.0"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"publishConfig": {
|