@rspack/dev-server 2.0.0-beta.5 → 2.0.0-beta.7
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/clients/WebSocketClient.js +1 -1
- package/client/modules/logger/createConsoleLogger.js +1 -1
- package/client/modules/logger/index.js +3 -3
- package/client/socket.js +2 -1
- package/client/utils/ansiHTML.js +1 -1
- package/client/utils/sendMessage.js +1 -1
- package/dist/0~launch-editor.js +2 -1
- package/dist/0~open.js +13 -9
- package/dist/0~p-retry.js +1 -1
- package/dist/config.d.ts +4 -3
- package/dist/index.js +1467 -1
- package/dist/rslib-runtime.js +5 -5
- package/dist/server.d.ts +10 -9
- package/dist/types.d.ts +13 -70
- package/package.json +9 -12
- package/dist/131.js +0 -1474
package/README.md
CHANGED
|
@@ -107,9 +107,9 @@ server.startCallback(() => {
|
|
|
107
107
|
|
|
108
108
|
## Credits
|
|
109
109
|
|
|
110
|
-
This
|
|
110
|
+
This repository is forked from [webpack-dev-server](https://github.com/webpack/webpack-dev-server). It adapts the original implementation for the Rspack ecosystem, bridging behavioral differences with webpack while adding Rspack-specific capabilities.
|
|
111
111
|
|
|
112
|
-
> Thanks to the [webpack-dev-server](https://github.com/webpack/webpack-dev-server)
|
|
112
|
+
> Thanks to the [webpack-dev-server](https://github.com/webpack/webpack-dev-server) maintainers and its original creator, [@sokra](https://github.com/sokra).
|
|
113
113
|
|
|
114
114
|
## License
|
|
115
115
|
|
package/client/socket.js
CHANGED
package/client/utils/ansiHTML.js
CHANGED
package/dist/0~launch-editor.js
CHANGED
|
@@ -445,7 +445,7 @@ __webpack_require__.add({
|
|
|
445
445
|
module.exports.createColors = createColors;
|
|
446
446
|
},
|
|
447
447
|
"./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
448
|
-
|
|
448
|
+
__webpack_require__("./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js");
|
|
449
449
|
exports.parse = __webpack_require__("./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js");
|
|
450
450
|
},
|
|
451
451
|
"./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js" (module) {
|
|
@@ -616,3 +616,4 @@ __webpack_require__.add({
|
|
|
616
616
|
module.exports = __rspack_external_url;
|
|
617
617
|
}
|
|
618
618
|
});
|
|
619
|
+
__webpack_require__("./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js");
|
package/dist/0~open.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import node_process from "node:process";
|
|
2
|
-
import
|
|
2
|
+
import node_path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import node_child_process, { execFile as external_node_child_process_execFile } from "node:child_process";
|
|
3
5
|
import promises, { constants } from "node:fs/promises";
|
|
6
|
+
import { promisify } from "node:util";
|
|
7
|
+
import node_os from "node:os";
|
|
8
|
+
import node_fs from "node:fs";
|
|
4
9
|
import { Buffer } from "node:buffer";
|
|
5
|
-
import { node_fs, node_os, node_path, promisify, fileURLToPath } from "./131.js";
|
|
6
10
|
let isDockerCached;
|
|
7
11
|
function hasDockerEnv() {
|
|
8
12
|
try {
|
|
@@ -49,12 +53,12 @@ const isWsl = ()=>{
|
|
|
49
53
|
}
|
|
50
54
|
};
|
|
51
55
|
const is_wsl = node_process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
52
|
-
const
|
|
56
|
+
const execFile = promisify(node_child_process.execFile);
|
|
53
57
|
const powerShellPath = ()=>`${node_process.env.SYSTEMROOT || node_process.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
54
58
|
const executePowerShell = async (command, options = {})=>{
|
|
55
59
|
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
56
60
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
57
|
-
return
|
|
61
|
+
return execFile(psPath ?? powerShellPath(), [
|
|
58
62
|
...executePowerShell.argumentsPrefix,
|
|
59
63
|
encodedCommand
|
|
60
64
|
], {
|
|
@@ -161,7 +165,7 @@ function defineLazyProperty(object, propertyName, valueGetter) {
|
|
|
161
165
|
});
|
|
162
166
|
return object;
|
|
163
167
|
}
|
|
164
|
-
const execFileAsync = promisify(
|
|
168
|
+
const execFileAsync = promisify(external_node_child_process_execFile);
|
|
165
169
|
async function defaultBrowserId() {
|
|
166
170
|
if ('darwin' !== node_process.platform) throw new Error('macOS only');
|
|
167
171
|
const { stdout } = await execFileAsync('defaults', [
|
|
@@ -172,7 +176,7 @@ async function defaultBrowserId() {
|
|
|
172
176
|
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
173
177
|
return match?.groups.id ?? 'com.apple.Safari';
|
|
174
178
|
}
|
|
175
|
-
const run_applescript_execFileAsync = promisify(
|
|
179
|
+
const run_applescript_execFileAsync = promisify(external_node_child_process_execFile);
|
|
176
180
|
async function runAppleScript(script, { humanReadableOutput = true } = {}) {
|
|
177
181
|
if ('darwin' !== node_process.platform) throw new Error('macOS only');
|
|
178
182
|
const outputArguments = humanReadableOutput ? [] : [
|
|
@@ -188,7 +192,7 @@ async function runAppleScript(script, { humanReadableOutput = true } = {}) {
|
|
|
188
192
|
async function bundleName(bundleId) {
|
|
189
193
|
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
190
194
|
}
|
|
191
|
-
const windows_execFileAsync = promisify(
|
|
195
|
+
const windows_execFileAsync = promisify(external_node_child_process_execFile);
|
|
192
196
|
const windowsBrowserProgIds = {
|
|
193
197
|
MSEdgeHTM: {
|
|
194
198
|
name: 'Edge',
|
|
@@ -277,7 +281,7 @@ async function defaultBrowser(_execFileAsync = windows_execFileAsync) {
|
|
|
277
281
|
id
|
|
278
282
|
};
|
|
279
283
|
}
|
|
280
|
-
const default_browser_execFileAsync = promisify(
|
|
284
|
+
const default_browser_execFileAsync = promisify(external_node_child_process_execFile);
|
|
281
285
|
const titleize = (string)=>string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x)=>x.toUpperCase());
|
|
282
286
|
async function default_browser_defaultBrowser() {
|
|
283
287
|
if ('darwin' === node_process.platform) {
|
|
@@ -544,4 +548,4 @@ defineLazyProperty(open_apps, 'safari', ()=>detectPlatformBinary({
|
|
|
544
548
|
darwin: 'Safari'
|
|
545
549
|
}));
|
|
546
550
|
const node_modules_open = open_open;
|
|
547
|
-
export
|
|
551
|
+
export default node_modules_open;
|
package/dist/0~p-retry.js
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DevServerClient, DevServerOpenOptions } from '@rspack/core';
|
|
2
|
+
import type { ConnectHistoryApiFallbackOptions, DevServer, NormalizedStatic, ServerConfiguration, WatchFiles, WebSocketServerConfiguration } from './types';
|
|
2
3
|
export interface ResolvedDevServer extends DevServer {
|
|
3
4
|
port: number | string;
|
|
4
5
|
static: false | Array<NormalizedStatic>;
|
|
5
6
|
devMiddleware: DevServer['devMiddleware'];
|
|
6
7
|
hot: boolean | 'only';
|
|
7
8
|
host?: string;
|
|
8
|
-
open:
|
|
9
|
+
open: DevServerOpenOptions[];
|
|
9
10
|
magicHtml: boolean;
|
|
10
11
|
liveReload: boolean;
|
|
11
12
|
webSocketServer: false | WebSocketServerConfiguration;
|
|
12
13
|
proxy: Required<DevServer['proxy']>;
|
|
13
|
-
client:
|
|
14
|
+
client: DevServerClient;
|
|
14
15
|
allowedHosts: 'auto' | string[] | 'all';
|
|
15
16
|
compress: boolean;
|
|
16
17
|
historyApiFallback: false | ConnectHistoryApiFallbackOptions;
|