@modern-js/server 2.0.0-beta.7 → 2.0.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 +20 -0
- package/dist/types/dev-tools/dev-middleware/index.d.ts +1 -1
- package/dist/types/dev-tools/mock/getMockData.d.ts +2 -2
- package/dist/types/dev-tools/watcher/index.d.ts +1 -1
- package/dist/types/server/dev-server.d.ts +1 -1
- package/dist/types/types.d.ts +7 -7
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @modern-js/server
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dda38c9c3e: chore: v2
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [c9e800d39a]
|
|
12
|
+
- Updated dependencies [edd1cfb1af]
|
|
13
|
+
- Updated dependencies [6bda14ed71]
|
|
14
|
+
- Updated dependencies [dda38c9c3e]
|
|
15
|
+
- Updated dependencies [8b8e1bb571]
|
|
16
|
+
- Updated dependencies [ffb2ed4]
|
|
17
|
+
- Updated dependencies [bbe4c4ab64]
|
|
18
|
+
- @modern-js/prod-server@2.0.0
|
|
19
|
+
- @modern-js/utils@2.0.0
|
|
20
|
+
- @modern-js/types@2.0.0
|
|
21
|
+
- @modern-js/server-utils@2.0.0
|
|
22
|
+
|
|
3
23
|
## 2.0.0-beta.7
|
|
4
24
|
|
|
5
25
|
### Major Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Server } from 'http';
|
|
4
4
|
import { EventEmitter } from 'events';
|
|
5
5
|
import { DevServerOptions, DevMiddlewareAPI, DevMiddleware as CustomDevMiddleware } from '../../types';
|
|
6
|
-
|
|
6
|
+
type Options = {
|
|
7
7
|
dev: DevServerOptions;
|
|
8
8
|
devMiddleware?: CustomDevMiddleware;
|
|
9
9
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
3
|
import type { ModernServerContext, NextFunction } from '@modern-js/types';
|
|
4
|
-
export
|
|
4
|
+
export type MockConfig = Record<string, {
|
|
5
5
|
data: any;
|
|
6
6
|
} | ((req: IncomingMessage, res: ServerResponse, next: NextFunction) => Promise<void>)>;
|
|
7
|
-
export
|
|
7
|
+
export type MockApi = {
|
|
8
8
|
method: string;
|
|
9
9
|
path: string;
|
|
10
10
|
handler: ReturnType<typeof createFunctionDataHandler | typeof createStaticDataHandler>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FSWatcher, WatchOptions } from '@modern-js/utils';
|
|
2
|
-
export
|
|
2
|
+
export type WatchEvent = 'add' | 'change' | 'unlink';
|
|
3
3
|
export declare const defaultWatchOptions: {
|
|
4
4
|
ignoreInitial: boolean;
|
|
5
5
|
ignored: RegExp;
|
|
@@ -16,7 +16,7 @@ export declare class ModernDevServer extends ModernServer {
|
|
|
16
16
|
onInit(runner: ServerHookRunner, app: Server): Promise<void>;
|
|
17
17
|
private applyDefaultMiddlewares;
|
|
18
18
|
onRepack(options?: BuildOptions): void;
|
|
19
|
-
createHTTPServer(handler: (req: IncomingMessage, res: ServerResponse, next?: () => void) => void): Promise<Server | import("https").Server
|
|
19
|
+
createHTTPServer(handler: (req: IncomingMessage, res: ServerResponse, next?: () => void) => void): Promise<Server<typeof IncomingMessage, typeof ServerResponse> | import("https").Server<typeof IncomingMessage, typeof ServerResponse>>;
|
|
20
20
|
protected warmupSSRBundle(): void;
|
|
21
21
|
protected onServerChange({
|
|
22
22
|
filepath,
|
package/dist/types/types.d.ts
CHANGED
|
@@ -3,15 +3,15 @@ import type { IncomingMessage, ServerResponse } from 'http';
|
|
|
3
3
|
import type { DevServerOptions, DevServerHttpsOptions, NextFunction } from '@modern-js/types';
|
|
4
4
|
import type { ModernServerOptions } from '@modern-js/prod-server';
|
|
5
5
|
export type { DevServerOptions, DevServerHttpsOptions };
|
|
6
|
-
|
|
7
|
-
export
|
|
6
|
+
type Middleware = (req: IncomingMessage, res: ServerResponse, next: NextFunction) => Promise<void>;
|
|
7
|
+
export type DevMiddlewareAPI = Middleware & {
|
|
8
8
|
close: (callback: (err: Error | null | undefined) => void) => any;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type MiddlewareCallbacks = {
|
|
11
11
|
onInvalid: () => void;
|
|
12
12
|
onDone: (stats: any) => void;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type DevMiddlewareOptions = {
|
|
15
15
|
/** To ensure HMR works, the devMiddleware need inject the hmr client path into page when HMR enable. */
|
|
16
16
|
hmrClientPath?: string;
|
|
17
17
|
/** The options need by compiler middleware (like webpackMiddleware) */
|
|
@@ -30,9 +30,9 @@ export declare type DevMiddlewareOptions = {
|
|
|
30
30
|
* - Notify server when compiler hooks are triggered.
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
export
|
|
34
|
-
export
|
|
33
|
+
export type DevMiddleware = (options: DevMiddlewareOptions) => DevMiddlewareAPI;
|
|
34
|
+
export type ExtraOptions = {
|
|
35
35
|
dev: boolean | Partial<DevServerOptions>;
|
|
36
36
|
devMiddleware?: DevMiddleware;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type ModernDevServerOptions = ModernServerOptions & ExtraOptions;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.0.0
|
|
14
|
+
"version": "2.0.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"minimatch": "^3.0.4",
|
|
35
35
|
"path-to-regexp": "^6.2.0",
|
|
36
36
|
"ws": "^8.2.0",
|
|
37
|
-
"@modern-js/prod-server": "2.0.0
|
|
38
|
-
"@modern-js/server-utils": "2.0.0
|
|
39
|
-
"@modern-js/types": "2.0.0
|
|
40
|
-
"@modern-js/utils": "2.0.0
|
|
37
|
+
"@modern-js/prod-server": "2.0.0",
|
|
38
|
+
"@modern-js/server-utils": "2.0.0",
|
|
39
|
+
"@modern-js/types": "2.0.0",
|
|
40
|
+
"@modern-js/utils": "2.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/connect-history-api-fallback": "^1.3.5",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"typescript": "^4",
|
|
53
53
|
"webpack": "^5.75.0",
|
|
54
54
|
"websocket": "^1",
|
|
55
|
-
"@modern-js/server-core": "2.0.0
|
|
56
|
-
"@scripts/
|
|
57
|
-
"@scripts/
|
|
55
|
+
"@modern-js/server-core": "2.0.0",
|
|
56
|
+
"@scripts/jest-config": "2.0.0",
|
|
57
|
+
"@scripts/build": "2.0.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"devcert": "^1.0.0",
|