@modern-js/types 1.5.6 → 1.6.2

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.2
4
+
5
+ ### Patch Changes
6
+
7
+ - c423820: fix: missing devServer.proxy.cookieDomainRewrite type
8
+
9
+ fix: 修复 devServer.proxy.cookieDomainRewrite 类型缺失的问题
10
+
11
+ ## 1.6.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 44e3bb1: feat: support response headers
16
+ feat: 支持设置响应头
17
+
18
+ ## 1.6.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 33cebd2: chore(core): move Hooks types define to `@modern-js/core`
23
+
24
+ chore(core): 移动 Hooks 类型定义到 `@modern-js/core` 包
25
+
26
+ - 33cebd2: chore(types): delete `http-proxy-middleware` dependence(unused)
27
+
28
+ chore(types): 删除未使用依赖 `http-proxy-middleware`
29
+
3
30
  ## 1.5.6
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.6",
14
+ "version": "1.6.2",
15
15
  "types": "./index.d.ts",
16
- "dependencies": {
17
- "@modern-js/plugin": "^1.4.2",
18
- "http-proxy-middleware": "^2.0.4",
19
- "webpack": "^5.54.0"
20
- },
21
16
  "exports": {
22
17
  ".": "./index.d.ts",
23
18
  "./server": {
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
  }
package/server/utils.d.ts CHANGED
@@ -32,6 +32,8 @@ export type ProxyDetail = {
32
32
  ) => string | undefined | null | false;
33
33
  context?: string | string[];
34
34
  changeOrigin?: boolean;
35
+ /** Rewrites domain of set-cookie headers. */
36
+ cookieDomainRewrite?: false | string | Record<string, string>;
35
37
  };
36
38
 
37
39
  export type BffProxyOptions =