@rspack/dev-server 2.0.0-beta.6 → 2.0.0-rc.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/README.md +2 -2
- package/client/overlay.d.ts +4 -1
- package/dist/0~launch-editor.js +17 -35
- package/dist/0~serve-static.js +2211 -0
- package/dist/0~serve-static.js.LICENSE.txt +108 -0
- package/dist/831.js +2641 -0
- package/dist/config.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1469
- package/dist/server.d.ts +4 -4
- package/dist/servers/BaseServer.d.ts +2 -2
- package/dist/servers/WebsocketServer.d.ts +2 -2
- package/dist/types.d.ts +9 -8
- package/package.json +19 -20
- package/dist/rslib-runtime.js +0 -75
package/dist/server.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack-dev-server/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import type { DevServerClient, DevServerHeaders, DevServerHost, DevServerProxyConfigArray, DevServerStatic } from '@rspack/core';
|
|
11
|
-
import type { BasicApplication, BasicServer, ClientConnection, Compiler, ConnectHistoryApiFallbackOptions, DevMiddlewareContext, DevMiddlewareOptions, DevServer, EXPECTED_ANY, FSWatcher, HTTPServer, LiteralUnion, Middleware, MultiCompiler, MultiStats, Open, Port, Request, RequestHandler, Response, ServerConfiguration, ServerType, Socket, Stats, StatsOptions, WatchFiles, WatchOptions, WebSocketServerConfiguration, WebSocketServerImplementation } from './types';
|
|
12
|
-
import type { ConnectApplication } from './types';
|
|
11
|
+
import type { BasicApplication, BasicServer, ClientConnection, Compiler, ConnectHistoryApiFallbackOptions, DevMiddlewareContext, DevMiddlewareOptions, DevServer, EXPECTED_ANY, FSWatcher, HTTPServer, LiteralUnion, Middleware, MultiCompiler, MultiStats, Open, Port, Request, RequestHandler, Response, ServerConfiguration, ServerType, Socket, Stats, StatsOptions, WatchFiles, WatchOptions, WebSocketServerConfiguration, WebSocketServerImplementation } from './types.js';
|
|
12
|
+
import type { ConnectApplication } from './types.js';
|
|
13
13
|
export interface Configuration<A extends BasicApplication = ConnectApplication, S extends BasicServer = HTTPServer> {
|
|
14
14
|
ipc?: boolean | string;
|
|
15
15
|
host?: DevServerHost;
|
|
@@ -48,7 +48,7 @@ declare class Server<A extends BasicApplication = ConnectApplication, S extends
|
|
|
48
48
|
currentHash: string | undefined;
|
|
49
49
|
isTlsServer: boolean;
|
|
50
50
|
webSocketServer: WebSocketServerImplementation | null | undefined;
|
|
51
|
-
middleware: import('
|
|
51
|
+
middleware: import('@rspack/dev-middleware').API<Request, Response> | undefined;
|
|
52
52
|
server: S | undefined;
|
|
53
53
|
app: A | undefined;
|
|
54
54
|
stats: Stats | MultiStats | undefined;
|
|
@@ -64,7 +64,7 @@ declare class Server<A extends BasicApplication = ConnectApplication, S extends
|
|
|
64
64
|
isValidHost(headers: Record<string, string | undefined>, headerToCheck: string, validateHost?: boolean): boolean;
|
|
65
65
|
sendMessage(clients: ClientConnection[], type: string, data?: EXPECTED_ANY, params?: EXPECTED_ANY): void;
|
|
66
66
|
watchFiles(watchPath: string | string[], watchOptions?: WatchOptions): Promise<void>;
|
|
67
|
-
invalidate(callback?: import('
|
|
67
|
+
invalidate(callback?: import('@rspack/dev-middleware').Callback): void;
|
|
68
68
|
start(): Promise<void>;
|
|
69
69
|
startCallback(callback?: (err?: Error) => void): void;
|
|
70
70
|
stop(): Promise<void>;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack-dev-server/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Server } from '../server';
|
|
11
|
-
import type { ClientConnection } from '../types';
|
|
10
|
+
import type { Server } from '../server.js';
|
|
11
|
+
import type { ClientConnection } from '../types.js';
|
|
12
12
|
declare class BaseServer {
|
|
13
13
|
server: Server;
|
|
14
14
|
clients: ClientConnection[];
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack-dev-server/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import * as Ws from 'ws';
|
|
11
|
-
import type { Server } from '../server';
|
|
12
|
-
import BaseServer from './BaseServer';
|
|
11
|
+
import type { Server } from '../server.js';
|
|
12
|
+
import BaseServer from './BaseServer.js';
|
|
13
13
|
export declare class WebsocketServer extends BaseServer {
|
|
14
14
|
static heartbeatInterval: number;
|
|
15
15
|
implementation: Ws.WebSocketServer;
|
package/dist/types.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type { FSWatcher, ChokidarOptions as WatchOptions } from 'chokidar';
|
|
|
5
5
|
import type { Server as ConnectApplication, IncomingMessage as ConnectIncomingMessage, ErrorHandleFunction, HandleFunction, NextHandleFunction } from 'connect-next';
|
|
6
6
|
import type { RequestHandler } from 'http-proxy-middleware';
|
|
7
7
|
export type { FSWatcher, WatchOptions, RequestHandler, BasicServer, HTTPServer, ServerOptions, IncomingMessage, ConnectApplication, };
|
|
8
|
-
export type { IPv6 } from 'ipaddr.js';
|
|
9
8
|
export type { Socket } from 'node:net';
|
|
10
9
|
export type { AddressInfo } from 'node:net';
|
|
11
10
|
export type { NetworkInterfaceInfo } from 'node:os';
|
|
@@ -17,8 +16,8 @@ export type LiteralUnion<T extends U, U> = T | (U & Record<never, never>);
|
|
|
17
16
|
export type ConnectHistoryApiFallbackOptions = Exclude<NonNullable<DevServer['historyApiFallback']>, boolean>;
|
|
18
17
|
export type Request<T extends BasicApplication = ConnectApplication> = T extends ConnectApplication ? ConnectIncomingMessage : IncomingMessage;
|
|
19
18
|
export type Response = ServerResponse;
|
|
20
|
-
export type DevMiddlewareOptions<T extends Request, U extends Response> = import('
|
|
21
|
-
export type DevMiddlewareContext<T extends Request, U extends Response> = import('
|
|
19
|
+
export type DevMiddlewareOptions<T extends Request, U extends Response> = import('@rspack/dev-middleware').Options<T, U>;
|
|
20
|
+
export type DevMiddlewareContext<T extends Request, U extends Response> = import('@rspack/dev-middleware').Context<T, U>;
|
|
22
21
|
export type Port = number | LiteralUnion<'auto', string>;
|
|
23
22
|
export interface WatchFiles {
|
|
24
23
|
paths: string | string[];
|
|
@@ -64,10 +63,12 @@ export interface MiddlewareObject {
|
|
|
64
63
|
}
|
|
65
64
|
export type Middleware = MiddlewareObject | DevServerMiddlewareHandler | ErrorHandleFunction;
|
|
66
65
|
export type OverlayMessageOptions = boolean | ((error: Error) => void);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
type UseFn = {
|
|
67
|
+
(fn: NextHandleFunction): BasicApplication;
|
|
68
|
+
(fn: HandleFunction): BasicApplication;
|
|
69
|
+
(route: string, fn: NextHandleFunction): BasicApplication;
|
|
70
|
+
(route: string, fn: HandleFunction): BasicApplication;
|
|
71
|
+
};
|
|
71
72
|
export type BasicApplication = {
|
|
72
|
-
use:
|
|
73
|
+
use: UseFn;
|
|
73
74
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/dev-server",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc.0",
|
|
4
4
|
"description": "Development server for rspack",
|
|
5
5
|
"homepage": "https://rspack.rs",
|
|
6
6
|
"bugs": "https://github.com/rstackjs/rspack-dev-server/issues",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"bump": "npx bumpp",
|
|
27
27
|
"dev": "rslib -w",
|
|
28
28
|
"format": "prettier --write .",
|
|
29
|
-
"lint": "
|
|
30
|
-
"lint:write": "
|
|
29
|
+
"lint": "rslint",
|
|
30
|
+
"lint:write": "rslint --fix",
|
|
31
31
|
"prettier:ci": "prettier --check .",
|
|
32
32
|
"test": "pnpm run test:install && pnpm run build && rstest",
|
|
33
33
|
"test:install": "cross-env ./node_modules/.bin/puppeteer browsers install chrome"
|
|
@@ -37,31 +37,29 @@
|
|
|
37
37
|
},
|
|
38
38
|
"nano-staged": {
|
|
39
39
|
"*.{yaml,yml,json,md,json5}": [
|
|
40
|
-
"npm
|
|
40
|
+
"npm run format"
|
|
41
41
|
],
|
|
42
42
|
"*.{js,jsx,ts,tsx,mjs,cjs}": [
|
|
43
43
|
"npm run format",
|
|
44
|
-
"
|
|
44
|
+
"rslint --fix"
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
+
"@rspack/dev-middleware": "^2.0.0",
|
|
48
49
|
"@types/ws": "^8.18.1",
|
|
49
50
|
"chokidar": "^5.0.0",
|
|
50
51
|
"connect-history-api-fallback": "^2.0.0",
|
|
51
52
|
"connect-next": "^4.0.0",
|
|
52
53
|
"http-proxy-middleware": "^3.0.5",
|
|
53
|
-
"
|
|
54
|
-
"serve-static": "^2.2.1",
|
|
55
|
-
"webpack-dev-middleware": "^7.4.5",
|
|
56
|
-
"ws": "^8.19.0"
|
|
54
|
+
"ws": "^8.20.0"
|
|
57
55
|
},
|
|
58
56
|
"devDependencies": {
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@rspack/core": "2.0.0-
|
|
57
|
+
"@hono/node-server": "^1.19.12",
|
|
58
|
+
"@rslib/core": "^0.20.2",
|
|
59
|
+
"@rslint/core": "^0.3.3",
|
|
60
|
+
"@rspack/core": "2.0.0-rc.0",
|
|
63
61
|
"@rspack/plugin-react-refresh": "1.6.1",
|
|
64
|
-
"@rstest/core": "^0.9.
|
|
62
|
+
"@rstest/core": "^0.9.5",
|
|
65
63
|
"@types/mime-types": "3.0.1",
|
|
66
64
|
"@types/node": "^24.12.0",
|
|
67
65
|
"@types/serve-static": "^2.2.0",
|
|
@@ -70,22 +68,23 @@
|
|
|
70
68
|
"cross-env": "^10.1.0",
|
|
71
69
|
"css-loader": "^7.1.4",
|
|
72
70
|
"express": "^5.2.1",
|
|
73
|
-
"hono": "^4.12.
|
|
71
|
+
"hono": "^4.12.9",
|
|
74
72
|
"http-compression": "^1.1.2",
|
|
75
73
|
"http-proxy": "^1.18.1",
|
|
76
|
-
"
|
|
74
|
+
"ipaddr.js": "^2.3.0",
|
|
75
|
+
"launch-editor": "^2.13.2",
|
|
77
76
|
"nano-staged": "^0.9.0",
|
|
78
77
|
"open": "^11.0.0",
|
|
79
78
|
"p-retry": "^7.1.1",
|
|
80
79
|
"prettier": "3.8.1",
|
|
81
|
-
"puppeteer": "^24.
|
|
80
|
+
"puppeteer": "^24.40.0",
|
|
82
81
|
"react-refresh": "0.18.0",
|
|
83
82
|
"require-from-string": "^2.0.2",
|
|
84
83
|
"selfsigned": "^5.5.0",
|
|
84
|
+
"serve-static": "^2.2.1",
|
|
85
85
|
"simple-git-hooks": "^2.13.1",
|
|
86
86
|
"style-loader": "^4.0.0",
|
|
87
|
-
"typescript": "^
|
|
88
|
-
"webpack-dev-middleware": "^7.4.5"
|
|
87
|
+
"typescript": "^6.0.2"
|
|
89
88
|
},
|
|
90
89
|
"peerDependencies": {
|
|
91
90
|
"@rspack/core": "^2.0.0-0",
|
|
@@ -96,7 +95,7 @@
|
|
|
96
95
|
"optional": true
|
|
97
96
|
}
|
|
98
97
|
},
|
|
99
|
-
"packageManager": "pnpm@10.
|
|
98
|
+
"packageManager": "pnpm@10.33.0",
|
|
100
99
|
"engines": {
|
|
101
100
|
"node": "^20.19.0 || >=22.12.0"
|
|
102
101
|
},
|
package/dist/rslib-runtime.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var __webpack_modules__ = {};
|
|
2
|
-
var __webpack_module_cache__ = {};
|
|
3
|
-
function __webpack_require__(moduleId) {
|
|
4
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
-
exports: {}
|
|
8
|
-
};
|
|
9
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
10
|
-
return module.exports;
|
|
11
|
-
}
|
|
12
|
-
__webpack_require__.m = __webpack_modules__;
|
|
13
|
-
(()=>{
|
|
14
|
-
__webpack_require__.n = (module)=>{
|
|
15
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
16
|
-
__webpack_require__.d(getter, {
|
|
17
|
-
a: getter
|
|
18
|
-
});
|
|
19
|
-
return getter;
|
|
20
|
-
};
|
|
21
|
-
})();
|
|
22
|
-
(()=>{
|
|
23
|
-
var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
|
|
24
|
-
var leafPrototypes;
|
|
25
|
-
__webpack_require__.t = function(value, mode) {
|
|
26
|
-
if (1 & mode) value = this(value);
|
|
27
|
-
if (8 & mode) return value;
|
|
28
|
-
if ('object' == typeof value && value) {
|
|
29
|
-
if (4 & mode && value.__esModule) return value;
|
|
30
|
-
if (16 & mode && 'function' == typeof value.then) return value;
|
|
31
|
-
}
|
|
32
|
-
var ns = Object.create(null);
|
|
33
|
-
__webpack_require__.r(ns);
|
|
34
|
-
var def = {};
|
|
35
|
-
leafPrototypes = leafPrototypes || [
|
|
36
|
-
null,
|
|
37
|
-
getProto({}),
|
|
38
|
-
getProto([]),
|
|
39
|
-
getProto(getProto)
|
|
40
|
-
];
|
|
41
|
-
for(var current = 2 & mode && value; ('object' == typeof current || 'function' == typeof current) && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
|
|
42
|
-
def[key] = ()=>value[key];
|
|
43
|
-
});
|
|
44
|
-
def['default'] = ()=>value;
|
|
45
|
-
__webpack_require__.d(ns, def);
|
|
46
|
-
return ns;
|
|
47
|
-
};
|
|
48
|
-
})();
|
|
49
|
-
(()=>{
|
|
50
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
51
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: definition[key]
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
})();
|
|
57
|
-
(()=>{
|
|
58
|
-
__webpack_require__.add = function(modules) {
|
|
59
|
-
Object.assign(__webpack_require__.m, modules);
|
|
60
|
-
};
|
|
61
|
-
})();
|
|
62
|
-
(()=>{
|
|
63
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
64
|
-
})();
|
|
65
|
-
(()=>{
|
|
66
|
-
__webpack_require__.r = (exports)=>{
|
|
67
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
68
|
-
value: 'Module'
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(exports, '__esModule', {
|
|
71
|
-
value: true
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
})();
|
|
75
|
-
export { __webpack_require__ };
|