@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 CHANGED
@@ -107,9 +107,9 @@ server.startCallback(() => {
107
107
 
108
108
  ## Credits
109
109
 
110
- This plugin is forked from [webpack-dev-server](https://github.com/webpack/webpack-dev-server), and is used to smooth out some differences between rspack and webpack, while also providing rspack-specific new features.
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) project created by [@sokra](https://github.com/sokra)
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
 
@@ -29,4 +29,4 @@ class WebSocketClient {
29
29
  };
30
30
  }
31
31
  }
32
- export { WebSocketClient as default };
32
+ export default WebSocketClient;
@@ -116,4 +116,4 @@ const createConsoleLogger = ({ level = 'info', debug = false, console })=>{
116
116
  };
117
117
  return logger;
118
118
  };
119
- export { createConsoleLogger as default };
119
+ export default createConsoleLogger;
@@ -26,8 +26,8 @@ const hooks = {
26
26
  ])
27
27
  };
28
28
  const logger = {
29
- getLogger,
30
- configureDefaultLogger,
31
- hooks
29
+ getLogger: getLogger,
30
+ configureDefaultLogger: configureDefaultLogger,
31
+ hooks: hooks
32
32
  };
33
33
  export { logger };
package/client/socket.js CHANGED
@@ -30,4 +30,5 @@ function socket(url, handlers, reconnect) {
30
30
  });
31
31
  }
32
32
  const client_src_socket = socket;
33
- export { client, client_src_socket as default };
33
+ export default client_src_socket;
34
+ export { client };
@@ -192,4 +192,4 @@ function _setTags(colors) {
192
192
  }
193
193
  }
194
194
  ansiHTML.reset();
195
- export { ansiHTML as default };
195
+ export default ansiHTML;
@@ -5,4 +5,4 @@ function sendMsg(type, data) {
5
5
  }, '*');
6
6
  }
7
7
  const sendMessage = sendMsg;
8
- export { sendMessage as default };
8
+ export default sendMessage;
@@ -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
- exports.quote = __webpack_require__("./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js");
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 node_child_process, { execFile } from "node:child_process";
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 powershell_utils_execFile = promisify(node_child_process.execFile);
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 powershell_utils_execFile(psPath ?? powerShellPath(), [
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(execFile);
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(execFile);
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(execFile);
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(execFile);
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 { node_modules_open };
551
+ export default node_modules_open;
package/dist/0~p-retry.js CHANGED
@@ -155,4 +155,4 @@ async function pRetry(input, options = {}) {
155
155
  }
156
156
  throw new Error('Retry attempts exhausted without throwing an error.');
157
157
  }
158
- export { pRetry };
158
+ export default pRetry;
package/dist/config.d.ts CHANGED
@@ -1,16 +1,17 @@
1
- import type { ClientConfiguration, ConnectHistoryApiFallbackOptions, DevServer, NormalizedStatic, Open, ServerConfiguration, WatchFiles, WebSocketServerConfiguration } from './types';
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: 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: ClientConfiguration;
14
+ client: DevServerClient;
14
15
  allowedHosts: 'auto' | string[] | 'all';
15
16
  compress: boolean;
16
17
  historyApiFallback: false | ConnectHistoryApiFallbackOptions;