@rspack/dev-server 2.0.0-rc.0 → 2.0.0-rc.2
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/dist/0~chokidar.js +1477 -0
- package/dist/0~chokidar.js.LICENSE.txt +1 -0
- package/dist/0~connect-history-api-fallback.js +76 -0
- package/dist/0~connect-next.js +1245 -0
- package/dist/0~connect-next.js.LICENSE.txt +57 -0
- package/dist/0~debug.js +621 -0
- package/dist/0~http-proxy-middleware.js +4661 -0
- package/dist/0~http-proxy-middleware.js.LICENSE.txt +69 -0
- package/dist/0~launch-editor.js +2 -2
- package/dist/0~open.js +11 -7
- package/dist/0~p-retry.js +8 -5
- package/dist/0~serve-static.js +3 -619
- package/dist/{831.js → 108.js} +2486 -8
- package/dist/index.d.ts +587 -2
- package/dist/index.js +1 -1
- package/package.json +14 -14
- package/dist/config.d.ts +0 -22
- package/dist/getPort.d.ts +0 -13
- package/dist/server.d.ts +0 -73
- package/dist/servers/BaseServer.d.ts +0 -17
- package/dist/servers/WebsocketServer.d.ts +0 -17
- package/dist/types.d.ts +0 -74
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Array of passes.
|
|
3
|
+
*
|
|
4
|
+
* A `pass` is just a function that is executed on `req, res, options`
|
|
5
|
+
* so that you can easily add new checks while still keeping the base
|
|
6
|
+
* flexible.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*!
|
|
10
|
+
* Array of passes.
|
|
11
|
+
*
|
|
12
|
+
* A `pass` is just a function that is executed on `req, socket, options`
|
|
13
|
+
* so that you can easily add new checks while still keeping the base
|
|
14
|
+
* flexible.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/*!
|
|
18
|
+
* Caron dimonio, con occhi di bragia
|
|
19
|
+
* loro accennando, tutte le raccoglie;
|
|
20
|
+
* batte col remo qualunque s’adagia
|
|
21
|
+
*
|
|
22
|
+
* Charon the demon, with the eyes of glede,
|
|
23
|
+
* Beckoning to them, collects them all together,
|
|
24
|
+
* Beats with his oar whoever lags behind
|
|
25
|
+
*
|
|
26
|
+
* Dante - The Divine Comedy (Canto III)
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/*!
|
|
30
|
+
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
33
|
+
* Licensed under the MIT License.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/*!
|
|
37
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
40
|
+
* Licensed under the MIT License.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/*!
|
|
44
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
45
|
+
*
|
|
46
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
47
|
+
* Released under the MIT License.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/*!
|
|
51
|
+
* is-number <https://github.com/jonschlinkert/is-number>
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
54
|
+
* Released under the MIT License.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/*!
|
|
58
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
59
|
+
*
|
|
60
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
61
|
+
* Released under the MIT License.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/*!
|
|
65
|
+
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
66
|
+
*
|
|
67
|
+
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
68
|
+
* Released under the MIT License.
|
|
69
|
+
*/
|
package/dist/0~launch-editor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __webpack_require__ } from "./
|
|
2
|
-
import "./
|
|
1
|
+
import { __webpack_require__ } from "./108.js";
|
|
2
|
+
import "./108.js";
|
|
3
3
|
__webpack_require__.add({
|
|
4
4
|
"./node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/editor-info/linux.js" (module) {
|
|
5
5
|
module.exports = {
|
package/dist/0~open.js
CHANGED
|
@@ -47,10 +47,10 @@ const isWsl = ()=>{
|
|
|
47
47
|
return true;
|
|
48
48
|
}
|
|
49
49
|
try {
|
|
50
|
-
|
|
51
|
-
} catch {
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
if (node_fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft')) return !isInsideContainer();
|
|
51
|
+
} catch {}
|
|
52
|
+
if (node_fs.existsSync('/proc/sys/fs/binfmt_misc/WSLInterop') || node_fs.existsSync('/run/WSL')) return !isInsideContainer();
|
|
53
|
+
return false;
|
|
54
54
|
};
|
|
55
55
|
const is_wsl = node_process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
56
56
|
const execFile = promisify(node_child_process.execFile);
|
|
@@ -174,19 +174,23 @@ async function defaultBrowserId() {
|
|
|
174
174
|
'LSHandlers'
|
|
175
175
|
]);
|
|
176
176
|
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
177
|
-
|
|
177
|
+
const browserId = match?.groups.id ?? 'com.apple.Safari';
|
|
178
|
+
if ('com.apple.safari' === browserId) return 'com.apple.Safari';
|
|
179
|
+
return browserId;
|
|
178
180
|
}
|
|
179
181
|
const run_applescript_execFileAsync = promisify(external_node_child_process_execFile);
|
|
180
|
-
async function runAppleScript(script, { humanReadableOutput = true } = {}) {
|
|
182
|
+
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
181
183
|
if ('darwin' !== node_process.platform) throw new Error('macOS only');
|
|
182
184
|
const outputArguments = humanReadableOutput ? [] : [
|
|
183
185
|
'-ss'
|
|
184
186
|
];
|
|
187
|
+
const execOptions = {};
|
|
188
|
+
if (signal) execOptions.signal = signal;
|
|
185
189
|
const { stdout } = await run_applescript_execFileAsync("osascript", [
|
|
186
190
|
'-e',
|
|
187
191
|
script,
|
|
188
192
|
outputArguments
|
|
189
|
-
]);
|
|
193
|
+
], execOptions);
|
|
190
194
|
return stdout.trim();
|
|
191
195
|
}
|
|
192
196
|
async function bundleName(bundleId) {
|
package/dist/0~p-retry.js
CHANGED
|
@@ -2,19 +2,22 @@ const objectToString = Object.prototype.toString;
|
|
|
2
2
|
const isError = (value)=>'[object Error]' === objectToString.call(value);
|
|
3
3
|
const errorMessages = new Set([
|
|
4
4
|
'network error',
|
|
5
|
-
'Failed to fetch',
|
|
6
5
|
'NetworkError when attempting to fetch resource.',
|
|
7
6
|
'The Internet connection appears to be offline.',
|
|
8
|
-
'Load failed',
|
|
9
7
|
'Network request failed',
|
|
10
8
|
'fetch failed',
|
|
11
|
-
'terminated'
|
|
9
|
+
'terminated',
|
|
10
|
+
' A network error occurred.',
|
|
11
|
+
'Network connection lost'
|
|
12
12
|
]);
|
|
13
13
|
function isNetworkError(error) {
|
|
14
14
|
const isValid = error && isError(error) && 'TypeError' === error.name && 'string' == typeof error.message;
|
|
15
15
|
if (!isValid) return false;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const { message, stack } = error;
|
|
17
|
+
if ('Load failed' === message) return void 0 === stack || '__sentry_captured__' in error;
|
|
18
|
+
if (message.startsWith('error sending request for url')) return true;
|
|
19
|
+
if ('Failed to fetch' === message || message.startsWith('Failed to fetch (') && message.endsWith(')')) return true;
|
|
20
|
+
return errorMessages.has(message);
|
|
18
21
|
}
|
|
19
22
|
function validateRetries(retries) {
|
|
20
23
|
if ('number' == typeof retries) {
|