@modern-js/types 1.5.5 → 1.6.1

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,32 @@
1
1
  # @modern-js/types
2
2
 
3
+ ## 1.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 44e3bb1: feat: support response headers
8
+ feat: 支持设置响应头
9
+
10
+ ## 1.6.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 33cebd2: chore(core): move Hooks types define to `@modern-js/core`
15
+
16
+ chore(core): 移动 Hooks 类型定义到 `@modern-js/core` 包
17
+
18
+ - 33cebd2: chore(types): delete `http-proxy-middleware` dependence(unused)
19
+
20
+ chore(types): 删除未使用依赖 `http-proxy-middleware`
21
+
22
+ ## 1.5.6
23
+
24
+ ### Patch Changes
25
+
26
+ - efab847: use client init data first if exist
27
+ - Updated dependencies [5b7a5a7]
28
+ - @modern-js/plugin@1.4.2
29
+
3
30
  ## 1.5.5
4
31
 
5
32
  ### Patch Changes
package/cli/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { AsyncWaterfall, AsyncWorkflow } from '@modern-js/plugin';
2
- import { Compiler, MultiCompiler, Configuration } from 'webpack';
3
1
  import { ServerRoute } from '../server';
4
2
 
5
3
  /**
@@ -67,69 +65,3 @@ export interface IAppContext {
67
65
  internalDirAlias: string;
68
66
  internalSrcAlias: string;
69
67
  }
70
-
71
- export interface Hooks {
72
- beforeDev: AsyncWorkflow<void, unknown>;
73
- afterDev: AsyncWorkflow<void, unknown>;
74
- beforeCreateCompiler: AsyncWorkflow<
75
- {
76
- webpackConfigs: Configuration[];
77
- },
78
- unknown
79
- >;
80
- afterCreateCompiler: AsyncWorkflow<
81
- {
82
- compiler: Compiler | MultiCompiler | undefined;
83
- },
84
- unknown
85
- >;
86
- beforePrintInstructions: AsyncWaterfall<{
87
- instructions: string;
88
- }>;
89
- beforeBuild: AsyncWorkflow<
90
- {
91
- webpackConfigs: Configuration[];
92
- },
93
- unknown
94
- >;
95
- afterBuild: AsyncWorkflow<void, unknown>;
96
- afterMonorepoDeploy: AsyncWorkflow<
97
- { operator: any; deployProjectNames: string[] },
98
- void
99
- >;
100
- beforeDeploy: AsyncWorkflow<Record<string, any>, unknown>;
101
- afterDeploy: AsyncWorkflow<Record<string, any>, unknown>;
102
- modifyEntryExport: AsyncWaterfall<{
103
- entrypoint: Entrypoint;
104
- exportStatement: string;
105
- }>;
106
- modifyEntryImports: AsyncWaterfall<{
107
- imports: ImportStatement[];
108
- entrypoint: Entrypoint;
109
- }>;
110
- modifyEntryRuntimePlugins: AsyncWaterfall<{
111
- entrypoint: Entrypoint;
112
- plugins: RuntimePlugin[];
113
- }>;
114
- modifyEntryRenderFunction: AsyncWaterfall<{
115
- entrypoint: Entrypoint;
116
- code: string;
117
- }>;
118
- modifyFileSystemRoutes: AsyncWaterfall<{
119
- entrypoint: Entrypoint;
120
- routes: Route[];
121
- }>;
122
- modifyServerRoutes: AsyncWaterfall<{
123
- routes: ServerRoute[];
124
- }>;
125
- htmlPartials: AsyncWaterfall<{
126
- entrypoint: Entrypoint;
127
- partials: HtmlPartials;
128
- }>;
129
- addRuntimeExports: AsyncWaterfall<void>;
130
- beforeGenerateRoutes: AsyncWaterfall<{
131
- entrypoint: Entrypoint;
132
- code: string;
133
- }>;
134
- addDefineTypes: AsyncWaterfall<void>;
135
- }
package/package.json CHANGED
@@ -11,13 +11,8 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.5.5",
14
+ "version": "1.6.1",
15
15
  "types": "./index.d.ts",
16
- "dependencies": {
17
- "@modern-js/plugin": "^1.4.0",
18
- "http-proxy-middleware": "^2.0.4",
19
- "webpack": "^5.54.0"
20
- },
21
16
  "exports": {
22
17
  ".": "./index.d.ts",
23
18
  "./server": {
@@ -56,7 +56,7 @@ export type BaseSSRServerContext = {
56
56
  [propsName: string]: any;
57
57
  };
58
58
  response: {
59
- setHeader: (key: string, value: any) => void;
59
+ setHeader: (key: string, value: string) => void;
60
60
  status: (code: number) => void;
61
61
  };
62
62
  redirection: { url?: string; status?: number };
package/server/route.d.ts CHANGED
@@ -15,5 +15,6 @@ export interface ServerRoute {
15
15
  bundle?: string;
16
16
  // if route has modern product
17
17
  enableModernMode?: boolean;
18
- // specialHeader?: SpecialHeader[];
18
+ // response header for routes
19
+ responseHeaders?: Record<string, unknown>;
19
20
  }