@modern-js/types 1.18.1-alpha.0 → 1.18.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,6 +1,15 @@
1
1
  # @modern-js/types
2
2
 
3
- ## 1.18.1-alpha.0
3
+ ## 1.18.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 318e149: fix: tools.devServer type missing some properties
8
+
9
+ fix: 修复 tools.devServer 类型定义不完整的问题
10
+
11
+ - 60d95ad: fix: dev server config should be optional
12
+ fix: devServer 配置项应该是可选配置的
4
13
 
5
14
  ## 1.18.0
6
15
 
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.18.1-alpha.0",
14
+ "version": "1.18.1",
15
15
  "types": "./index.d.ts",
16
16
  "exports": {
17
17
  ".": "./index.d.ts",
@@ -21,8 +21,8 @@
21
21
  }
22
22
  },
23
23
  "devDependencies": {
24
- "@scripts/build": "1.18.1-alpha.0",
25
- "@scripts/jest-config": "1.18.1-alpha.0",
24
+ "@scripts/build": "1.18.1",
25
+ "@scripts/jest-config": "1.18.1",
26
26
  "@types/jest": "^27",
27
27
  "@types/node": "^14",
28
28
  "http-proxy-middleware": "^2.0.4",
@@ -0,0 +1,38 @@
1
+ import type { IncomingMessage, ServerResponse } from 'http';
2
+ import type { NextFunction, BffProxyOptions } from './utils';
3
+
4
+ export type DevServerHttpsOptions = boolean | { key: string; cert: string };
5
+
6
+ export type RequestHandler = (
7
+ req: IncomingMessage,
8
+ res: ServerResponse,
9
+ next: NextFunction,
10
+ ) => void;
11
+
12
+ export type DevServerOptions = {
13
+ /** config of hmr client. */
14
+ client?: {
15
+ path?: string;
16
+ port?: string;
17
+ host?: string;
18
+ logging?: string;
19
+ overlay?: boolean;
20
+ progress?: boolean;
21
+ };
22
+ devMiddleware?: {
23
+ writeToDisk: boolean | ((filename: string) => boolean);
24
+ };
25
+ proxy?: BffProxyOptions;
26
+ headers?: Record<string, string>;
27
+ before?: RequestHandler[];
28
+ after?: RequestHandler[];
29
+ /** Whether to watch files change. */
30
+ watch?: boolean;
31
+ /** Whether to enable hot reload. */
32
+ hot?: boolean | string;
33
+ /** Whether to enable page reload. */
34
+ liveReload?: boolean;
35
+ /** Whether to enable https. */
36
+ https?: DevServerHttpsOptions;
37
+ [propName: string]: any;
38
+ };
package/server/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './context';
2
2
  export * from './hook';
3
3
  export * from './utils';
4
4
  export * from './route';
5
+ export * from './devServer';