@rsdoctor/core 2.0.0-rc.2 → 2.0.0-rc.3
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/e.js +59 -74
- package/dist/e.js.LICENSE.txt +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +802 -143
- package/dist/r.js +69 -76
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -3,21 +3,20 @@ import { createRequire as __rspack_createRequire } from "node:module";
|
|
|
3
3
|
import { rspackRequire, moduleFactories, definePropertyGetters, makeNamespaceObject, compatGetDefaultExport } from "./rslib-runtime.js";
|
|
4
4
|
import { Algorithm, Bundle, Data, Loader, Lodash, decycle } from "@rsdoctor/shared/common-browser";
|
|
5
5
|
import node_assert from "node:assert";
|
|
6
|
-
import node_fs from "node:fs";
|
|
7
|
-
import path_0 from "path";
|
|
6
|
+
import node_fs, * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
7
|
+
import path_0, { join as external_path_join, resolve as external_path_resolve } from "path";
|
|
8
8
|
import { createRequire } from "module";
|
|
9
9
|
import { Client, Constants, Manifest, SDK } from "@rsdoctor/shared/types";
|
|
10
10
|
import { SourceMapConsumer } from "source-map";
|
|
11
11
|
import { ChunkGraph, ModuleGraph, PackageGraph } from "@rsdoctor/shared/graph";
|
|
12
|
-
import
|
|
13
|
-
import fs from "fs";
|
|
12
|
+
import node_path, { join, normalize, resolve as external_node_path_resolve, sep as external_node_path_sep, dirname as __rspack_dirname } from "node:path";
|
|
13
|
+
import fs, { readdirSync, statSync } from "fs";
|
|
14
14
|
import os_0 from "os";
|
|
15
15
|
import assert from "assert";
|
|
16
16
|
import { PassThrough } from "stream";
|
|
17
17
|
import { isIP } from "node:net";
|
|
18
18
|
import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
|
|
19
19
|
import { exec } from "node:child_process";
|
|
20
|
-
import node_path, { join, dirname as __rspack_dirname } from "node:path";
|
|
21
20
|
import { promisify } from "node:util";
|
|
22
21
|
import { randomBytes } from "crypto";
|
|
23
22
|
import { AsyncResource } from "node:async_hooks";
|
|
@@ -30,6 +29,7 @@ import { InternalResolverPlugin, getYarnVersion, InternalPluginsPlugin, node_mod
|
|
|
30
29
|
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
31
30
|
var date, __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
32
31
|
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
32
|
+
import * as __rspack_external_node_querystring_5092a520 from "node:querystring";
|
|
33
33
|
moduleFactories.add({
|
|
34
34
|
"../../node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/index.js" (module) {
|
|
35
35
|
module.exports = function(value, options) {
|
|
@@ -160,7 +160,7 @@ moduleFactories.add({
|
|
|
160
160
|
}();
|
|
161
161
|
},
|
|
162
162
|
"../../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js" (module) {
|
|
163
|
-
var relative =
|
|
163
|
+
var relative = __rspack_createRequire_require("path").relative;
|
|
164
164
|
module.exports = function(namespace) {
|
|
165
165
|
var namespace1, namespace2;
|
|
166
166
|
if (!namespace) throw TypeError('argument namespace is required');
|
|
@@ -305,7 +305,7 @@ moduleFactories.add({
|
|
|
305
305
|
}
|
|
306
306
|
},
|
|
307
307
|
"../../node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js" (module) {
|
|
308
|
-
var HttpError,
|
|
308
|
+
var HttpError, exports, codes, HttpError1, deprecate = rspackRequire("../../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js")('http-errors'), setPrototypeOf = rspackRequire("../../node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.js"), statuses = rspackRequire("../../node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/index.js"), inherits = rspackRequire("../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"), toIdentifier = rspackRequire("../../node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/index.js");
|
|
309
309
|
function codeClass(status) {
|
|
310
310
|
return Number(String(status).charAt(0) + '00');
|
|
311
311
|
}
|
|
@@ -336,7 +336,7 @@ moduleFactories.add({
|
|
|
336
336
|
return inherits(HttpError, Error), HttpError;
|
|
337
337
|
}(), module.exports.isHttpError = (HttpError = module.exports.HttpError, function(val) {
|
|
338
338
|
return !!val && 'object' == typeof val && (val instanceof HttpError || val instanceof Error && 'boolean' == typeof val.expose && 'number' == typeof val.statusCode && val.status === val.statusCode);
|
|
339
|
-
}),
|
|
339
|
+
}), exports = module.exports, codes = statuses.codes, HttpError1 = module.exports.HttpError, codes.forEach(function(code) {
|
|
340
340
|
var CodeError, name = toIdentifier(statuses.message[code]);
|
|
341
341
|
switch(codeClass(code)){
|
|
342
342
|
case 400:
|
|
@@ -379,7 +379,7 @@ moduleFactories.add({
|
|
|
379
379
|
return inherits(ServerError, HttpError), nameFunc(ServerError, className), ServerError.prototype.status = code, ServerError.prototype.statusCode = code, ServerError.prototype.expose = !1, ServerError;
|
|
380
380
|
}(HttpError1, name, code);
|
|
381
381
|
}
|
|
382
|
-
CodeError && (
|
|
382
|
+
CodeError && (exports[code] = CodeError, exports[name] = CodeError);
|
|
383
383
|
});
|
|
384
384
|
},
|
|
385
385
|
"../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js" (module) {
|
|
@@ -409,7 +409,23 @@ moduleFactories.add({
|
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
411
|
},
|
|
412
|
-
"../../node_modules/.pnpm/launch-editor@2.14.
|
|
412
|
+
"../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/construct-windows-launch-command.js" (module) {
|
|
413
|
+
function escapeCmdArgs(cmdArgs) {
|
|
414
|
+
return cmdArgs.replace(/([&|<>,;=^])/g, '^$1');
|
|
415
|
+
}
|
|
416
|
+
function doubleQuoteIfNeeded(str) {
|
|
417
|
+
return str.includes('^') ? `^"${str}^"` : str.includes(' ') ? `"${str}"` : str;
|
|
418
|
+
}
|
|
419
|
+
module.exports = function(editor, args) {
|
|
420
|
+
if (args.some((arg)=>/[\r\n]/.test(arg))) throw Error('Cannot launch an editor with an argument containing a line break');
|
|
421
|
+
if (args.some((arg)=>arg.includes('%'))) throw Error('Cannot launch an editor with an argument containing "%"');
|
|
422
|
+
return [
|
|
423
|
+
editor,
|
|
424
|
+
...args.map(escapeCmdArgs)
|
|
425
|
+
].map(doubleQuoteIfNeeded).join(' ');
|
|
426
|
+
};
|
|
427
|
+
},
|
|
428
|
+
"../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/linux.js" (module) {
|
|
413
429
|
module.exports = {
|
|
414
430
|
atom: 'atom',
|
|
415
431
|
Brackets: 'brackets',
|
|
@@ -441,7 +457,7 @@ moduleFactories.add({
|
|
|
441
457
|
zed: 'zed'
|
|
442
458
|
};
|
|
443
459
|
},
|
|
444
|
-
"../../node_modules/.pnpm/launch-editor@2.14.
|
|
460
|
+
"../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/macos.js" (module) {
|
|
445
461
|
module.exports = {
|
|
446
462
|
'/Applications/Atom.app/Contents/MacOS/Atom': 'atom',
|
|
447
463
|
'/Applications/Atom Beta.app/Contents/MacOS/Atom Beta': '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
|
|
@@ -474,7 +490,7 @@ moduleFactories.add({
|
|
|
474
490
|
'/Applications/Zed.app/Contents/MacOS/zed': 'zed'
|
|
475
491
|
};
|
|
476
492
|
},
|
|
477
|
-
"../../node_modules/.pnpm/launch-editor@2.14.
|
|
493
|
+
"../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/windows.js" (module) {
|
|
478
494
|
module.exports = [
|
|
479
495
|
'Brackets.exe',
|
|
480
496
|
'Code.exe',
|
|
@@ -505,9 +521,12 @@ moduleFactories.add({
|
|
|
505
521
|
'Antigravity.exe'
|
|
506
522
|
];
|
|
507
523
|
},
|
|
508
|
-
"../../node_modules/.pnpm/launch-editor@2.14.
|
|
509
|
-
let path =
|
|
524
|
+
"../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/get-args.js" (module) {
|
|
525
|
+
let os = __rspack_createRequire_require("os"), path = __rspack_createRequire_require("path");
|
|
510
526
|
module.exports = function(editor, fileName, lineNumber, columnNumber = 1) {
|
|
527
|
+
if (fileName = path.resolve(fileName), 'linux' === process.platform && fileName.startsWith('/mnt/') && /Microsoft/i.test(os.release()) && (fileName = `./${path.relative('', fileName)}`), !lineNumber) return [
|
|
528
|
+
fileName
|
|
529
|
+
];
|
|
511
530
|
switch(path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '')){
|
|
512
531
|
case 'atom':
|
|
513
532
|
case 'Atom':
|
|
@@ -602,8 +621,8 @@ moduleFactories.add({
|
|
|
602
621
|
];
|
|
603
622
|
};
|
|
604
623
|
},
|
|
605
|
-
"../../node_modules/.pnpm/launch-editor@2.14.
|
|
606
|
-
let path =
|
|
624
|
+
"../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/guess.js" (module) {
|
|
625
|
+
let path = __rspack_createRequire_require("path"), shellQuote = rspackRequire("../../node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/index.js"), childProcess = __rspack_createRequire_require("child_process"), COMMON_EDITORS_MACOS = rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/macos.js"), COMMON_EDITORS_LINUX = rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/linux.js"), COMMON_EDITORS_WIN = rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/windows.js");
|
|
607
626
|
function getEditorFromMacProcesses(output) {
|
|
608
627
|
let processNames = Object.keys(COMMON_EDITORS_MACOS), processList = output.split('\n');
|
|
609
628
|
for(let i = 0; i < processNames.length; i++){
|
|
@@ -684,27 +703,25 @@ moduleFactories.add({
|
|
|
684
703
|
];
|
|
685
704
|
}, module.exports.getEditorFromMacProcesses = getEditorFromMacProcesses, module.exports.getEditorFromWindowsProcesses = getEditorFromWindowsProcesses, module.exports.getEditorFromLinuxProcesses = getEditorFromLinuxProcesses;
|
|
686
705
|
},
|
|
687
|
-
"../../node_modules/.pnpm/launch-editor@2.14.
|
|
688
|
-
let fs =
|
|
706
|
+
"../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/index.js" (module) {
|
|
707
|
+
let fs = __rspack_createRequire_require("fs"), path = __rspack_createRequire_require("path"), colors = rspackRequire("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"), childProcess = __rspack_createRequire_require("child_process"), guessEditor = rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/guess.js"), getArgumentsForFile = rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/get-args.js"), constructWindowsLaunchCommand = rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/construct-windows-launch-command.js"), parseFile = rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/parse-file.js"), currentChildProcess = null;
|
|
689
708
|
module.exports = function(file, specifiedEditor, onErrorCallback) {
|
|
690
|
-
var
|
|
691
|
-
let fileName,
|
|
692
|
-
|
|
693
|
-
lineNumber: (match = file1.match(positionRE)) && match[1],
|
|
694
|
-
columnNumber: match && match[3]
|
|
695
|
-
}), { fileName: fileName1 } = parsed, { lineNumber, columnNumber } = parsed;
|
|
696
|
-
if ('win32' === process.platform && path.resolve(fileName1).startsWith('\\\\')) return onErrorCallback(fileName1, "UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");
|
|
697
|
-
if (!fs.existsSync(fileName1)) return;
|
|
698
|
-
'function' == typeof specifiedEditor && (onErrorCallback = specifiedEditor, specifiedEditor = void 0), cb = onErrorCallback, onErrorCallback = (fileName, errorMessage)=>{
|
|
709
|
+
var cb;
|
|
710
|
+
let launchCommand, { fileName, lineNumber, columnNumber } = parseFile(file);
|
|
711
|
+
if ('function' == typeof specifiedEditor && (onErrorCallback = specifiedEditor, specifiedEditor = void 0), cb = onErrorCallback, onErrorCallback = (fileName, errorMessage)=>{
|
|
699
712
|
console.log(), console.log(colors.red('Could not open ' + path.basename(fileName) + ' in the editor.')), errorMessage && ('.' !== errorMessage[errorMessage.length - 1] && (errorMessage += '.'), console.log(colors.red('The editor process exited with an error: ' + errorMessage))), console.log(), cb && cb(fileName, errorMessage);
|
|
700
|
-
};
|
|
713
|
+
}, 'win32' === process.platform && fileName.startsWith('\\\\')) return onErrorCallback(fileName, "UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");
|
|
714
|
+
if (!fs.existsSync(fileName)) return;
|
|
701
715
|
let [editor, ...args] = guessEditor(specifiedEditor);
|
|
702
|
-
if (!editor) return void onErrorCallback(
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
}
|
|
707
|
-
|
|
716
|
+
if (!editor) return void onErrorCallback(fileName, null);
|
|
717
|
+
let extraArgs = getArgumentsForFile(editor, fileName, lineNumber, columnNumber);
|
|
718
|
+
if (args.push.apply(args, extraArgs), 'win32' === process.platform) try {
|
|
719
|
+
launchCommand = constructWindowsLaunchCommand(editor, args);
|
|
720
|
+
} catch (error) {
|
|
721
|
+
onErrorCallback(fileName, error.message);
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
currentChildProcess && function(editor) {
|
|
708
725
|
switch(editor){
|
|
709
726
|
case 'vim':
|
|
710
727
|
case 'emacs':
|
|
@@ -712,30 +729,31 @@ moduleFactories.add({
|
|
|
712
729
|
return !0;
|
|
713
730
|
}
|
|
714
731
|
return !1;
|
|
715
|
-
}(editor) && currentChildProcess.kill('SIGKILL'), 'win32' === process.platform
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
return cmdArgs.replace(/([&|<>,;=^])/g, '^$1');
|
|
720
|
-
})
|
|
721
|
-
].map(function(str) {
|
|
722
|
-
return str.includes('^') ? `^"${str}^"` : str.includes(' ') ? `"${str}"` : str;
|
|
723
|
-
}).join(' ');
|
|
724
|
-
currentChildProcess = childProcess.exec(launchCommand, {
|
|
725
|
-
stdio: 'inherit',
|
|
726
|
-
shell: !0
|
|
727
|
-
});
|
|
728
|
-
} else currentChildProcess = childProcess.spawn(editor, args, {
|
|
732
|
+
}(editor) && currentChildProcess.kill('SIGKILL'), (currentChildProcess = 'win32' === process.platform ? childProcess.exec(launchCommand, {
|
|
733
|
+
stdio: 'inherit',
|
|
734
|
+
shell: !0
|
|
735
|
+
}) : childProcess.spawn(editor, args, {
|
|
729
736
|
stdio: 'inherit'
|
|
730
|
-
})
|
|
731
|
-
|
|
732
|
-
currentChildProcess = null, errorCode && onErrorCallback(fileName1, '(code ' + errorCode + ')');
|
|
737
|
+
})).on('exit', function(errorCode) {
|
|
738
|
+
currentChildProcess = null, errorCode && onErrorCallback(fileName, '(code ' + errorCode + ')');
|
|
733
739
|
}), currentChildProcess.on('error', function(error) {
|
|
734
740
|
let { code, message } = error;
|
|
735
|
-
'ENOENT' === code && (message = `${message} ('${editor}' command does not exist in 'PATH')`), onErrorCallback(
|
|
741
|
+
'ENOENT' === code && (message = `${message} ('${editor}' command does not exist in 'PATH')`), onErrorCallback(fileName, message);
|
|
736
742
|
});
|
|
737
743
|
};
|
|
738
744
|
},
|
|
745
|
+
"../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/parse-file.js" (module) {
|
|
746
|
+
let path = __rspack_createRequire_require("path"), positionRE = /:(\d+)(:(\d+))?$/;
|
|
747
|
+
module.exports = function(file) {
|
|
748
|
+
file.startsWith('file://') && (file = __rspack_createRequire_require("url").fileURLToPath(file));
|
|
749
|
+
let unresolvedFileName = file.replace(positionRE, ''), fileName = unresolvedFileName ? path.resolve(unresolvedFileName) : '', match = file.match(positionRE);
|
|
750
|
+
return {
|
|
751
|
+
fileName,
|
|
752
|
+
lineNumber: match && match[1],
|
|
753
|
+
columnNumber: match && match[3]
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
},
|
|
739
757
|
"../../node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js" (module) {
|
|
740
758
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
741
759
|
module.exports = !function() {
|
|
@@ -780,21 +798,40 @@ moduleFactories.add({
|
|
|
780
798
|
return obj;
|
|
781
799
|
});
|
|
782
800
|
},
|
|
783
|
-
"../../node_modules/.pnpm/shell-quote@1.
|
|
784
|
-
rspackRequire("../../node_modules/.pnpm/shell-quote@1.
|
|
801
|
+
"../../node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/index.js" (__unused_rspack_module, exports) {
|
|
802
|
+
rspackRequire("../../node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/quote.js"), exports.parse = rspackRequire("../../node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/parse.js");
|
|
785
803
|
},
|
|
786
|
-
"../../node_modules/.pnpm/shell-quote@1.
|
|
787
|
-
for(var CONTROL = "(
|
|
788
|
-
var startsWithToken = RegExp('^' + TOKEN);
|
|
804
|
+
"../../node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/parse.js" (module) {
|
|
805
|
+
for(var CONTROL = "(?:\\|\\||\\&(?:\\&|>>?)|;;\\&?|[;|]\\&|\\<\\(|\\<\\<\\<|\\<\\<-|\\<\\<(?!\\()|>>|>[&|(]|<[&>]|[&;()|<>])", controlRE = RegExp('^' + CONTROL + '$'), META = '|&;()<> \\t', ANSI_C_BODY = '(?:\\\\[\\s\\S]|[^\\\\\'])*?', ANSI_C_QUOTE = '\\$\'' + ANSI_C_BODY + '\'', ansiCAt = RegExp('\\$\'' + ANSI_C_BODY + '(?:(\')|\\\\?$)', 'g'), hash = /^#$/, TOKEN = '', i = 0; i < 4; i++)TOKEN += (0x100000000 * Math.random()).toString(16);
|
|
806
|
+
var startsWithToken = RegExp('^' + TOKEN), ansiCEscape = /\\([0-7]{1,3}|x[\dA-Fa-f]{1,2}|u[\dA-Fa-f]{1,4}|U[\dA-Fa-f]{1,8}|c(?:\\\\|[\s\S])|[abeEfnrtv\\'"?])/g;
|
|
807
|
+
function expandAnsiCEscape(m, escape) {
|
|
808
|
+
var kind = escape.charAt(0);
|
|
809
|
+
if ('c' === kind) {
|
|
810
|
+
var ctrl = escape.charAt(1);
|
|
811
|
+
return '?' === ctrl ? '\x7F' : String.fromCharCode(0x1F & ctrl.charCodeAt(0));
|
|
812
|
+
}
|
|
813
|
+
if ('x' === kind || 'u' === kind || 'U' === kind) {
|
|
814
|
+
var cp = parseInt(escape.slice(1), 16);
|
|
815
|
+
return cp > 0x10FFFF ? m : String.fromCharCode.apply(null, cp > 0xFFFF ? [
|
|
816
|
+
0xD7C0 + (cp >> 10),
|
|
817
|
+
0xDC00 + (0x3FF & cp)
|
|
818
|
+
] : [
|
|
819
|
+
cp
|
|
820
|
+
]);
|
|
821
|
+
}
|
|
822
|
+
if (kind >= '0' && kind <= '7') return String.fromCharCode(0xFF & parseInt(escape, 8));
|
|
823
|
+
var letter = 'abeEfnrtv'.indexOf(escape);
|
|
824
|
+
return letter < 0 ? escape : '\x07\b\x1B\x1B\f\n\r\t\v'.charAt(letter);
|
|
825
|
+
}
|
|
789
826
|
module.exports = function(s, env, opts) {
|
|
790
827
|
var mapped = function(string, env, opts) {
|
|
791
828
|
opts || (opts = {});
|
|
792
|
-
var BS = opts.escape || '\\', matches = function(s, r) {
|
|
793
|
-
for(var matchObj, origIndex = r.lastIndex, matches = []; matchObj = r.exec(s);)matches.
|
|
829
|
+
var BS = opts.escape || '\\', ifs = !0 === opts.splitUnquoted ? ' \t\n' : 'string' == typeof opts.splitUnquoted ? opts.splitUnquoted : '', BAREWORD = '(\\' + BS + '[\'"$\\' + BS + META + ']|\\$\\$|\\$(?!' + ANSI_C_QUOTE.slice(2) + ')|[^\\s\'"$' + META + '])+', matches = function(s, r) {
|
|
830
|
+
for(var matchObj, origIndex = r.lastIndex, matches = []; matchObj = r.exec(s);)matches[matches.length] = matchObj, r.lastIndex === matchObj.index && (r.lastIndex += 1);
|
|
794
831
|
return r.lastIndex = origIndex, matches;
|
|
795
832
|
}(string, RegExp([
|
|
796
833
|
'(' + CONTROL + ')',
|
|
797
|
-
'(' +
|
|
834
|
+
'(' + ANSI_C_QUOTE + '|' + BAREWORD + '|' + ('"(?:\\' + BS + '[\\s\\S]|[^"\\') + BS + "])*\"|'([^']*?)')+"
|
|
798
835
|
].join('|'), 'g'));
|
|
799
836
|
if (0 === matches.length) return [];
|
|
800
837
|
env || (env = {});
|
|
@@ -805,12 +842,12 @@ moduleFactories.add({
|
|
|
805
842
|
if (controlRE.test(s)) return {
|
|
806
843
|
op: s
|
|
807
844
|
};
|
|
808
|
-
var quote = !1, esc = !1, out = '', isGlob = !1;
|
|
845
|
+
var quote = !1, esc = !1, out = '', words = [], sawQuote = !1, pendingNw = null, isGlob = !1;
|
|
809
846
|
for(i = 0; i < s.length; i++){
|
|
810
847
|
var c = s.charAt(i);
|
|
811
|
-
if (isGlob = isGlob || !quote && ('*' === c || '?' === c), esc) out += c, esc = !1;
|
|
848
|
+
if (ifs && '$' !== c && flushRun(), isGlob = isGlob || !quote && ('*' === c || '?' === c), esc) out += c, esc = !1;
|
|
812
849
|
else if (quote) c === quote ? quote = !1 : "'" == quote ? out += c : c === BS ? (i += 1, '"' === (c = s.charAt(i)) || c === BS || '$' === c ? out += c : out += BS + c) : '$' === c ? out += parseEnvVar() : out += c;
|
|
813
|
-
else if ('"' === c || "'" === c) quote = c;
|
|
850
|
+
else if ('"' === c || "'" === c) quote = c, sawQuote = !0;
|
|
814
851
|
else if (controlRE.test(c)) return {
|
|
815
852
|
op: s
|
|
816
853
|
};
|
|
@@ -826,51 +863,91 @@ moduleFactories.add({
|
|
|
826
863
|
return [
|
|
827
864
|
commentObj
|
|
828
865
|
];
|
|
829
|
-
} else c === BS
|
|
866
|
+
} else if (c === BS) esc = !0;
|
|
867
|
+
else if ('$' === c && "'" === s.charAt(i + 1) && (ansiCAt.lastIndex = i, ansiCAt.exec(s)[1])) flushRun(), sawQuote = !0, out += s.slice(i + 2, ansiCAt.lastIndex - 1).replace(ansiCEscape, expandAnsiCEscape).split('\0')[0], i = ansiCAt.lastIndex - 1;
|
|
868
|
+
else if ('$' === c) {
|
|
869
|
+
var value = parseEnvVar();
|
|
870
|
+
if (ifs) for(var vi = 0; vi < value.length; vi += 1){
|
|
871
|
+
var vc = value.charAt(vi);
|
|
872
|
+
0 > ifs.indexOf(vc) ? (flushRun(), out += vc) : null === pendingNw ? pendingNw = +(' ' !== vc && '\t' !== vc && '\n' !== vc) : ' ' !== vc && '\t' !== vc && '\n' !== vc && (pendingNw += 1);
|
|
873
|
+
}
|
|
874
|
+
else out += value;
|
|
875
|
+
} else out += c;
|
|
830
876
|
}
|
|
831
|
-
|
|
877
|
+
if (isGlob) return {
|
|
832
878
|
op: 'glob',
|
|
833
879
|
pattern: out
|
|
834
|
-
}
|
|
880
|
+
};
|
|
881
|
+
if (ifs) {
|
|
882
|
+
if (null !== pendingNw && pendingNw > 0) {
|
|
883
|
+
words[words.length] = out, out = '';
|
|
884
|
+
for(var te = 1; te < pendingNw; te += 1)words[words.length] = '';
|
|
885
|
+
}
|
|
886
|
+
return ('' !== out || sawQuote && 0 === words.length) && (words[words.length] = out), words;
|
|
887
|
+
}
|
|
888
|
+
return out;
|
|
835
889
|
}
|
|
836
890
|
function parseEnvVar() {
|
|
837
891
|
i += 1;
|
|
838
892
|
var env1, key, r, varend, varname, char = s.charAt(i);
|
|
839
893
|
if ('{' === char) {
|
|
840
894
|
if (i += 1, '}' === s.charAt(i)) throw Error('Bad substitution: ' + s.slice(i - 2, i + 1));
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
895
|
+
var depth = 1;
|
|
896
|
+
for(varend = i; depth > 0 && varend < s.length;)'{' === s.charAt(varend) && '$' === s.charAt(varend - 1) ? depth += 1 : '}' === s.charAt(varend) && (depth -= 1), varend += 1;
|
|
897
|
+
if (0 !== depth) throw Error('Bad substitution: ' + s.slice(i));
|
|
898
|
+
varend -= 1, varname = s.slice(i, varend), i = varend;
|
|
899
|
+
} else if (/[*@#?$!-]/.test(char)) varname = char;
|
|
844
900
|
else {
|
|
845
901
|
var slicedFromI = s.slice(i);
|
|
846
902
|
(varend = slicedFromI.match(/[^\w\d_]/)) ? (varname = slicedFromI.slice(0, varend.index), i += varend.index - 1) : (varname = slicedFromI, i = s.length);
|
|
847
903
|
}
|
|
848
904
|
return env1 = env, key = varname, (void 0 === (r = 'function' == typeof env1 ? env1(key) : env1[key]) && '' != key ? r = '' : void 0 === r && (r = '$'), 'object' == typeof r) ? '' + TOKEN + JSON.stringify(r) + TOKEN : '' + r;
|
|
849
905
|
}
|
|
906
|
+
function flushRun() {
|
|
907
|
+
if (null !== pendingNw) {
|
|
908
|
+
if (0 === pendingNw) '' !== out && (words[words.length] = out, out = '');
|
|
909
|
+
else {
|
|
910
|
+
words[words.length] = out, out = '';
|
|
911
|
+
for(var fe = 1; fe < pendingNw; fe += 1)words[words.length] = '';
|
|
912
|
+
}
|
|
913
|
+
pendingNw = null;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
850
916
|
}).reduce(function(prev, arg) {
|
|
851
|
-
return void 0 === arg
|
|
917
|
+
return void 0 === arg || [].concat(arg).forEach(function(entry) {
|
|
918
|
+
prev[prev.length] = entry;
|
|
919
|
+
}), prev;
|
|
852
920
|
}, []);
|
|
853
921
|
}(s, env, opts);
|
|
854
922
|
return 'function' != typeof env ? mapped : mapped.reduce(function(acc, s) {
|
|
855
|
-
if ('object' == typeof s) return acc.
|
|
923
|
+
if ('object' == typeof s) return acc[acc.length] = s, acc;
|
|
856
924
|
var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));
|
|
857
|
-
return 1 === xs.length ? acc.
|
|
858
|
-
|
|
859
|
-
})
|
|
925
|
+
return 1 === xs.length ? acc[acc.length] = xs[0] : xs.filter(Boolean).forEach(function(x) {
|
|
926
|
+
acc[acc.length] = startsWithToken.test(x) ? JSON.parse(x.split(TOKEN)[1]) : x;
|
|
927
|
+
}), acc;
|
|
860
928
|
}, []);
|
|
861
929
|
};
|
|
862
930
|
},
|
|
863
|
-
"../../node_modules/.pnpm/shell-quote@1.
|
|
931
|
+
"../../node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/quote.js" (module) {
|
|
864
932
|
var OPS = [
|
|
865
933
|
'||',
|
|
866
934
|
'&&',
|
|
935
|
+
';;&',
|
|
867
936
|
';;',
|
|
937
|
+
';&',
|
|
868
938
|
'|&',
|
|
869
939
|
'<(',
|
|
940
|
+
'>(',
|
|
870
941
|
'<<<',
|
|
942
|
+
'<<-',
|
|
943
|
+
'<<',
|
|
871
944
|
'>>',
|
|
872
945
|
'>&',
|
|
946
|
+
'>|',
|
|
947
|
+
'&>>',
|
|
948
|
+
'&>',
|
|
873
949
|
'<&',
|
|
950
|
+
'<>',
|
|
874
951
|
'&',
|
|
875
952
|
';',
|
|
876
953
|
'(',
|
|
@@ -878,27 +955,29 @@ moduleFactories.add({
|
|
|
878
955
|
'|',
|
|
879
956
|
'<',
|
|
880
957
|
'>'
|
|
881
|
-
], LINE_TERMINATORS = /[\n\r\u2028\u2029]/, GLOB_SHELL_SPECIAL = /[\s#!"$&'()
|
|
958
|
+
], LINE_TERMINATORS = /[\n\r\u2028\u2029]/, GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|~]/g;
|
|
882
959
|
module.exports = function(xs) {
|
|
960
|
+
var sawComment = !1;
|
|
883
961
|
return xs.map(function(s) {
|
|
962
|
+
if (sawComment && 'string' == typeof s && LINE_TERMINATORS.test(s)) throw TypeError('a token after a `comment` must not contain line terminators');
|
|
884
963
|
if ('' === s) return '\'\'';
|
|
885
964
|
if (s && 'object' == typeof s) {
|
|
886
|
-
if ('glob' === s.op) {
|
|
965
|
+
if ('op' in s && 'glob' === s.op) {
|
|
887
966
|
if ('string' != typeof s.pattern) throw TypeError('glob token requires a string `pattern`');
|
|
888
967
|
if (LINE_TERMINATORS.test(s.pattern)) throw TypeError('glob `pattern` must not contain line terminators');
|
|
889
|
-
return s.pattern.replace(GLOB_SHELL_SPECIAL, '\\$&');
|
|
968
|
+
return '' === s.pattern ? '\'\'' : s.pattern.replace(GLOB_SHELL_SPECIAL, '\\$&');
|
|
890
969
|
}
|
|
891
|
-
if ('string' == typeof s.op) {
|
|
970
|
+
if ('op' in s && 'string' == typeof s.op) {
|
|
892
971
|
if (0 > OPS.indexOf(s.op)) throw TypeError('invalid `op` value: ' + JSON.stringify(s.op));
|
|
893
972
|
return s.op.replace(/[\s\S]/g, '\\$&');
|
|
894
973
|
}
|
|
895
|
-
if ('string' == typeof s.comment) {
|
|
974
|
+
if ('comment' in s && 'string' == typeof s.comment) {
|
|
896
975
|
if (LINE_TERMINATORS.test(s.comment)) throw TypeError('`comment` must not contain line terminators');
|
|
897
|
-
return '#' + s.comment;
|
|
976
|
+
return sawComment = !0, '#' + s.comment;
|
|
898
977
|
}
|
|
899
978
|
throw TypeError('unrecognized object token shape');
|
|
900
979
|
}
|
|
901
|
-
return /
|
|
980
|
+
return /'/.test(s) && /!/.test(s) ? "'" + s.replace(/'/g, "'\"'\"'") + "'" : /["\s\\]/.test(s) && !/'/.test(s) ? "'" + s + "'" : /["'\s]/.test(s) ? '"' + s.replace(/(["\\$`])/g, '\\$1') + '"' : String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g, '$1\\$2');
|
|
902
981
|
}).join(' ');
|
|
903
982
|
};
|
|
904
983
|
},
|
|
@@ -981,8 +1060,8 @@ moduleFactories.add({
|
|
|
981
1060
|
return list.push(header.substring(start, end)), list;
|
|
982
1061
|
}
|
|
983
1062
|
},
|
|
984
|
-
"../../node_modules/.pnpm/ws@8.
|
|
985
|
-
let { EMPTY_BUFFER } = rspackRequire("../../node_modules/.pnpm/ws@8.
|
|
1063
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/buffer-util.js" (module) {
|
|
1064
|
+
let { EMPTY_BUFFER } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js"), FastBuffer = Buffer[Symbol.species];
|
|
986
1065
|
function _mask(source, mask, output, offset, length) {
|
|
987
1066
|
for(let i = 0; i < length; i++)output[offset + i] = source[i] ^ mask[3 & i];
|
|
988
1067
|
}
|
|
@@ -1022,7 +1101,7 @@ moduleFactories.add({
|
|
|
1022
1101
|
};
|
|
1023
1102
|
} catch (e) {}
|
|
1024
1103
|
},
|
|
1025
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1104
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js" (module) {
|
|
1026
1105
|
let BINARY_TYPES = [
|
|
1027
1106
|
'nodebuffer',
|
|
1028
1107
|
'arraybuffer',
|
|
@@ -1041,8 +1120,8 @@ moduleFactories.add({
|
|
|
1041
1120
|
NOOP: ()=>{}
|
|
1042
1121
|
};
|
|
1043
1122
|
},
|
|
1044
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1045
|
-
let { kForOnEventAttribute, kListener } = rspackRequire("../../node_modules/.pnpm/ws@8.
|
|
1123
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/event-target.js" (module) {
|
|
1124
|
+
let { kForOnEventAttribute, kListener } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js"), kCode = Symbol('kCode'), kData = Symbol('kData'), kError = Symbol('kError'), kMessage = Symbol('kMessage'), kReason = Symbol('kReason'), kTarget = Symbol('kTarget'), kType = Symbol('kType'), kWasClean = Symbol('kWasClean');
|
|
1046
1125
|
class Event {
|
|
1047
1126
|
constructor(type){
|
|
1048
1127
|
this[kTarget] = null, this[kType] = type;
|
|
@@ -1157,8 +1236,8 @@ moduleFactories.add({
|
|
|
1157
1236
|
MessageEvent
|
|
1158
1237
|
};
|
|
1159
1238
|
},
|
|
1160
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1161
|
-
let { tokenChars } = rspackRequire("../../node_modules/.pnpm/ws@8.
|
|
1239
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/extension.js" (module) {
|
|
1240
|
+
let { tokenChars } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/validation.js");
|
|
1162
1241
|
function push(dest, name, elem) {
|
|
1163
1242
|
void 0 === dest[name] ? dest[name] = [
|
|
1164
1243
|
elem
|
|
@@ -1220,7 +1299,7 @@ moduleFactories.add({
|
|
|
1220
1299
|
}
|
|
1221
1300
|
};
|
|
1222
1301
|
},
|
|
1223
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1302
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/limiter.js" (module) {
|
|
1224
1303
|
let kDone = Symbol('kDone'), kRun = Symbol('kRun');
|
|
1225
1304
|
module.exports = class {
|
|
1226
1305
|
constructor(concurrency){
|
|
@@ -1239,8 +1318,8 @@ moduleFactories.add({
|
|
|
1239
1318
|
}
|
|
1240
1319
|
};
|
|
1241
1320
|
},
|
|
1242
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1243
|
-
let zlibLimiter, zlib =
|
|
1321
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/permessage-deflate.js" (module) {
|
|
1322
|
+
let zlibLimiter, zlib = __rspack_createRequire_require("zlib"), bufferUtil = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/buffer-util.js"), Limiter = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/limiter.js"), { kStatusCode } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js"), FastBuffer = Buffer[Symbol.species], TRAILER = Buffer.from([
|
|
1244
1323
|
0x00,
|
|
1245
1324
|
0x00,
|
|
1246
1325
|
0xff,
|
|
@@ -1360,8 +1439,8 @@ moduleFactories.add({
|
|
|
1360
1439
|
}
|
|
1361
1440
|
};
|
|
1362
1441
|
},
|
|
1363
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1364
|
-
let { Writable } =
|
|
1442
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/receiver.js" (module) {
|
|
1443
|
+
let { Writable } = __rspack_createRequire_require("stream"), PerMessageDeflate = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/permessage-deflate.js"), { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js"), { concat, toArrayBuffer, unmask } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/buffer-util.js"), { isValidStatusCode, isValidUTF8 } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/validation.js"), FastBuffer = Buffer[Symbol.species];
|
|
1365
1444
|
module.exports = class extends Writable {
|
|
1366
1445
|
constructor(options = {}){
|
|
1367
1446
|
super(), this._allowSynchronousEvents = void 0 === options.allowSynchronousEvents || options.allowSynchronousEvents, this._binaryType = options.binaryType || BINARY_TYPES[0], this._extensions = options.extensions || {}, this._isServer = !!options.isServer, this._maxBufferedChunks = 0 | options.maxBufferedChunks, this._maxFragments = 0 | options.maxFragments, this._maxPayload = 0 | options.maxPayload, this._skipUTF8Validation = !!options.skipUTF8Validation, this[kWebSocket] = void 0, this._bufferedBytes = 0, this._buffers = [], this._compressed = !1, this._payloadLength = 0, this._mask = void 0, this._fragmented = 0, this._masked = !1, this._fin = !1, this._opcode = 0, this._totalPayloadLength = 0, this._messageLength = 0, this._numFragments = 0, this._fragments = [], this._errored = !1, this._loop = !1, this._state = 0;
|
|
@@ -1530,8 +1609,8 @@ moduleFactories.add({
|
|
|
1530
1609
|
}
|
|
1531
1610
|
};
|
|
1532
1611
|
},
|
|
1533
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1534
|
-
let randomPool, { Duplex } =
|
|
1612
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/sender.js" (module) {
|
|
1613
|
+
let randomPool, { Duplex } = __rspack_createRequire_require("stream"), { randomFillSync } = __rspack_createRequire_require("crypto"), { types: { isUint8Array } } = __rspack_createRequire_require("util"), PerMessageDeflate = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/permessage-deflate.js"), { EMPTY_BUFFER, kWebSocket, NOOP } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js"), { isBlob, isValidStatusCode } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/validation.js"), { mask: applyMask, toBuffer } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/buffer-util.js"), kByteLength = Symbol('kByteLength'), maskBuffer = Buffer.alloc(4), randomPoolPointer = 8192;
|
|
1535
1614
|
function callCallbacks(sender, err, cb) {
|
|
1536
1615
|
'function' == typeof cb && cb(err);
|
|
1537
1616
|
for(let i = 0; i < sender._queue.length; i++){
|
|
@@ -1710,9 +1789,9 @@ moduleFactories.add({
|
|
|
1710
1789
|
}
|
|
1711
1790
|
};
|
|
1712
1791
|
},
|
|
1713
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1714
|
-
rspackRequire("../../node_modules/.pnpm/ws@8.
|
|
1715
|
-
let { Duplex } =
|
|
1792
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/stream.js" (module) {
|
|
1793
|
+
rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket.js");
|
|
1794
|
+
let { Duplex } = __rspack_createRequire_require("stream");
|
|
1716
1795
|
function emitClose(stream) {
|
|
1717
1796
|
stream.emit('close');
|
|
1718
1797
|
}
|
|
@@ -1763,8 +1842,8 @@ moduleFactories.add({
|
|
|
1763
1842
|
}, duplex.on('end', duplexOnEnd), duplex.on('error', duplexOnError), duplex;
|
|
1764
1843
|
};
|
|
1765
1844
|
},
|
|
1766
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1767
|
-
let { tokenChars } = rspackRequire("../../node_modules/.pnpm/ws@8.
|
|
1845
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/subprotocol.js" (module) {
|
|
1846
|
+
let { tokenChars } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/validation.js");
|
|
1768
1847
|
module.exports = {
|
|
1769
1848
|
parse: function(header) {
|
|
1770
1849
|
let protocols = new Set(), start = -1, end = -1, i = 0;
|
|
@@ -1787,8 +1866,8 @@ moduleFactories.add({
|
|
|
1787
1866
|
}
|
|
1788
1867
|
};
|
|
1789
1868
|
},
|
|
1790
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1791
|
-
let { isUtf8 } =
|
|
1869
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/validation.js" (module) {
|
|
1870
|
+
let { isUtf8 } = __rspack_createRequire_require("buffer"), { hasBlob } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js");
|
|
1792
1871
|
function _isValidUTF8(buf) {
|
|
1793
1872
|
let len = buf.length, i = 0;
|
|
1794
1873
|
for(; i < len;)if ((0x80 & buf[i]) == 0) i++;
|
|
@@ -1955,8 +2034,8 @@ moduleFactories.add({
|
|
|
1955
2034
|
};
|
|
1956
2035
|
} catch (e) {}
|
|
1957
2036
|
},
|
|
1958
|
-
"../../node_modules/.pnpm/ws@8.
|
|
1959
|
-
let EventEmitter =
|
|
2037
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket-server.js" (module) {
|
|
2038
|
+
let EventEmitter = __rspack_createRequire_require("events"), http = __rspack_createRequire_require("http"), { Duplex } = __rspack_createRequire_require("stream"), { createHash } = __rspack_createRequire_require("crypto"), extension = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/extension.js"), PerMessageDeflate = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/permessage-deflate.js"), subprotocol = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/subprotocol.js"), WebSocket = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket.js"), { CLOSE_TIMEOUT, GUID, kWebSocket } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js"), keyRegex = /^[+/0-9A-Za-z]{22}==$/;
|
|
1960
2039
|
function emitClose(server) {
|
|
1961
2040
|
server._state = 2, server.emit('close');
|
|
1962
2041
|
}
|
|
@@ -2129,8 +2208,8 @@ moduleFactories.add({
|
|
|
2129
2208
|
}
|
|
2130
2209
|
};
|
|
2131
2210
|
},
|
|
2132
|
-
"../../node_modules/.pnpm/ws@8.
|
|
2133
|
-
let EventEmitter =
|
|
2211
|
+
"../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket.js" (module) {
|
|
2212
|
+
let EventEmitter = __rspack_createRequire_require("events"), https = __rspack_createRequire_require("https"), http = __rspack_createRequire_require("http"), net = __rspack_createRequire_require("net"), tls = __rspack_createRequire_require("tls"), { randomBytes, createHash } = __rspack_createRequire_require("crypto"), { Duplex, Readable } = __rspack_createRequire_require("stream"), { URL: URL1 } = __rspack_createRequire_require("url"), PerMessageDeflate = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/permessage-deflate.js"), Receiver = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/receiver.js"), Sender = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/sender.js"), { isBlob } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/validation.js"), { BINARY_TYPES, CLOSE_TIMEOUT, EMPTY_BUFFER, GUID, kForOnEventAttribute, kListener, kStatusCode, kWebSocket, NOOP } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js"), { EventTarget: { addEventListener, removeEventListener } } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/event-target.js"), { format, parse } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/extension.js"), { toBuffer } = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/buffer-util.js"), kAborted = Symbol('kAborted'), protocolVersions = [
|
|
2134
2213
|
8,
|
|
2135
2214
|
13
|
|
2136
2215
|
], readyStates = [
|
|
@@ -2141,7 +2220,11 @@ moduleFactories.add({
|
|
|
2141
2220
|
], subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
|
|
2142
2221
|
class WebSocket extends EventEmitter {
|
|
2143
2222
|
constructor(address, protocols, options){
|
|
2144
|
-
super(), this._binaryType = BINARY_TYPES[0], this._closeCode = 1006, this._closeFrameReceived = !1, this._closeFrameSent = !1, this._closeMessage = EMPTY_BUFFER, this._closeTimer = null, this._errorEmitted = !1, this._extensions = {}, this._paused = !1, this._protocol = '', this._readyState = WebSocket.CONNECTING, this._receiver = null, this._sender = null, this._socket = null, null !== address ? (this._bufferedAmount = 0, this._isServer = !1, this._redirects = 0, void 0 === protocols ? protocols =
|
|
2223
|
+
super(), this._binaryType = BINARY_TYPES[0], this._closeCode = 1006, this._closeFrameReceived = !1, this._closeFrameSent = !1, this._closeMessage = EMPTY_BUFFER, this._closeTimer = null, this._errorEmitted = !1, this._extensions = {}, this._paused = !1, this._protocol = '', this._readyState = WebSocket.CONNECTING, this._receiver = null, this._sender = null, this._socket = null, null !== address ? (this._bufferedAmount = 0, this._isServer = !1, this._redirects = 0, void 0 === protocols ? protocols = options && void 0 !== options.protocols ? Array.isArray(options.protocols) ? options.protocols : [
|
|
2224
|
+
options.protocols
|
|
2225
|
+
] : [] : Array.isArray(protocols) || (protocols = 'object' == typeof protocols && null !== protocols ? void 0 === (options = protocols).protocols ? [] : Array.isArray(options.protocols) ? options.protocols : [
|
|
2226
|
+
options.protocols
|
|
2227
|
+
] : [
|
|
2145
2228
|
protocols
|
|
2146
2229
|
]), function initAsClient(websocket, address, protocols, options) {
|
|
2147
2230
|
let parsedUrl, invalidUrlMessage, perMessageDeflate, req, opts = {
|
|
@@ -2160,6 +2243,7 @@ moduleFactories.add({
|
|
|
2160
2243
|
socketPath: void 0,
|
|
2161
2244
|
hostname: void 0,
|
|
2162
2245
|
protocol: void 0,
|
|
2246
|
+
protocols: void 0,
|
|
2163
2247
|
timeout: void 0,
|
|
2164
2248
|
method: 'GET',
|
|
2165
2249
|
host: void 0,
|
|
@@ -2341,9 +2425,9 @@ moduleFactories.add({
|
|
|
2341
2425
|
this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end();
|
|
2342
2426
|
return;
|
|
2343
2427
|
}
|
|
2344
|
-
this.
|
|
2428
|
+
this._sender.close(code, data, !this._isServer, (err)=>{
|
|
2345
2429
|
!err && (this._closeFrameSent = !0, (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end());
|
|
2346
|
-
}), setCloseTimer(this);
|
|
2430
|
+
}), this._readyState = WebSocket.CLOSING, setCloseTimer(this);
|
|
2347
2431
|
}
|
|
2348
2432
|
}
|
|
2349
2433
|
pause() {
|
|
@@ -2517,26 +2601,8 @@ moduleFactories.add({
|
|
|
2517
2601
|
});
|
|
2518
2602
|
}), WebSocket.prototype.addEventListener = addEventListener, WebSocket.prototype.removeEventListener = removeEventListener, module.exports = WebSocket;
|
|
2519
2603
|
},
|
|
2520
|
-
|
|
2521
|
-
module.exports = __rspack_createRequire_require("
|
|
2522
|
-
},
|
|
2523
|
-
"crypto?c60e" (module) {
|
|
2524
|
-
module.exports = __rspack_createRequire_require("crypto");
|
|
2525
|
-
},
|
|
2526
|
-
"http?6b68" (module) {
|
|
2527
|
-
module.exports = __rspack_createRequire_require("http");
|
|
2528
|
-
},
|
|
2529
|
-
https (module) {
|
|
2530
|
-
module.exports = __rspack_createRequire_require("https");
|
|
2531
|
-
},
|
|
2532
|
-
tls (module) {
|
|
2533
|
-
module.exports = __rspack_createRequire_require("tls");
|
|
2534
|
-
},
|
|
2535
|
-
url (module) {
|
|
2536
|
-
module.exports = __rspack_createRequire_require("url");
|
|
2537
|
-
},
|
|
2538
|
-
zlib (module) {
|
|
2539
|
-
module.exports = __rspack_createRequire_require("zlib");
|
|
2604
|
+
util (module) {
|
|
2605
|
+
module.exports = __rspack_createRequire_require("util");
|
|
2540
2606
|
},
|
|
2541
2607
|
"../../node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/codes.json" (module) {
|
|
2542
2608
|
module.exports = JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}');
|
|
@@ -2605,8 +2671,554 @@ makeNamespaceObject(apis_namespaceObject), definePropertyGetters(apis_namespaceO
|
|
|
2605
2671
|
ProjectAPI: ()=>ProjectAPI,
|
|
2606
2672
|
RendererAPI: ()=>RendererAPI,
|
|
2607
2673
|
ResolverAPI: ()=>ResolverAPI
|
|
2608
|
-
})
|
|
2609
|
-
let
|
|
2674
|
+
});
|
|
2675
|
+
let mimes = {
|
|
2676
|
+
"3g2": "video/3gpp2",
|
|
2677
|
+
"3gp": "video/3gpp",
|
|
2678
|
+
"3gpp": "video/3gpp",
|
|
2679
|
+
"3mf": "model/3mf",
|
|
2680
|
+
aac: "audio/aac",
|
|
2681
|
+
ac: "application/pkix-attr-cert",
|
|
2682
|
+
adp: "audio/adpcm",
|
|
2683
|
+
adts: "audio/aac",
|
|
2684
|
+
ai: "application/postscript",
|
|
2685
|
+
aml: "application/automationml-aml+xml",
|
|
2686
|
+
amlx: "application/automationml-amlx+zip",
|
|
2687
|
+
amr: "audio/amr",
|
|
2688
|
+
apng: "image/apng",
|
|
2689
|
+
appcache: "text/cache-manifest",
|
|
2690
|
+
appinstaller: "application/appinstaller",
|
|
2691
|
+
appx: "application/appx",
|
|
2692
|
+
appxbundle: "application/appxbundle",
|
|
2693
|
+
asc: "application/pgp-keys",
|
|
2694
|
+
atom: "application/atom+xml",
|
|
2695
|
+
atomcat: "application/atomcat+xml",
|
|
2696
|
+
atomdeleted: "application/atomdeleted+xml",
|
|
2697
|
+
atomsvc: "application/atomsvc+xml",
|
|
2698
|
+
au: "audio/basic",
|
|
2699
|
+
avci: "image/avci",
|
|
2700
|
+
avcs: "image/avcs",
|
|
2701
|
+
avif: "image/avif",
|
|
2702
|
+
aw: "application/applixware",
|
|
2703
|
+
bdoc: "application/bdoc",
|
|
2704
|
+
bin: "application/octet-stream",
|
|
2705
|
+
bmp: "image/bmp",
|
|
2706
|
+
bpk: "application/octet-stream",
|
|
2707
|
+
btf: "image/prs.btif",
|
|
2708
|
+
btif: "image/prs.btif",
|
|
2709
|
+
buffer: "application/octet-stream",
|
|
2710
|
+
ccxml: "application/ccxml+xml",
|
|
2711
|
+
cdfx: "application/cdfx+xml",
|
|
2712
|
+
cdmia: "application/cdmi-capability",
|
|
2713
|
+
cdmic: "application/cdmi-container",
|
|
2714
|
+
cdmid: "application/cdmi-domain",
|
|
2715
|
+
cdmio: "application/cdmi-object",
|
|
2716
|
+
cdmiq: "application/cdmi-queue",
|
|
2717
|
+
cer: "application/pkix-cert",
|
|
2718
|
+
cgm: "image/cgm",
|
|
2719
|
+
cjs: "application/node",
|
|
2720
|
+
class: "application/java-vm",
|
|
2721
|
+
coffee: "text/coffeescript",
|
|
2722
|
+
conf: "text/plain",
|
|
2723
|
+
cpl: "application/cpl+xml",
|
|
2724
|
+
cpt: "application/mac-compactpro",
|
|
2725
|
+
crl: "application/pkix-crl",
|
|
2726
|
+
css: "text/css",
|
|
2727
|
+
csv: "text/csv",
|
|
2728
|
+
cu: "application/cu-seeme",
|
|
2729
|
+
cwl: "application/cwl",
|
|
2730
|
+
cww: "application/prs.cww",
|
|
2731
|
+
davmount: "application/davmount+xml",
|
|
2732
|
+
dbk: "application/docbook+xml",
|
|
2733
|
+
deb: "application/octet-stream",
|
|
2734
|
+
def: "text/plain",
|
|
2735
|
+
deploy: "application/octet-stream",
|
|
2736
|
+
dib: "image/bmp",
|
|
2737
|
+
"disposition-notification": "message/disposition-notification",
|
|
2738
|
+
dist: "application/octet-stream",
|
|
2739
|
+
distz: "application/octet-stream",
|
|
2740
|
+
dll: "application/octet-stream",
|
|
2741
|
+
dmg: "application/octet-stream",
|
|
2742
|
+
dms: "application/octet-stream",
|
|
2743
|
+
doc: "application/msword",
|
|
2744
|
+
dot: "application/msword",
|
|
2745
|
+
dpx: "image/dpx",
|
|
2746
|
+
drle: "image/dicom-rle",
|
|
2747
|
+
dsc: "text/prs.lines.tag",
|
|
2748
|
+
dssc: "application/dssc+der",
|
|
2749
|
+
dtd: "application/xml-dtd",
|
|
2750
|
+
dump: "application/octet-stream",
|
|
2751
|
+
dwd: "application/atsc-dwd+xml",
|
|
2752
|
+
ear: "application/java-archive",
|
|
2753
|
+
ecma: "application/ecmascript",
|
|
2754
|
+
elc: "application/octet-stream",
|
|
2755
|
+
emf: "image/emf",
|
|
2756
|
+
eml: "message/rfc822",
|
|
2757
|
+
emma: "application/emma+xml",
|
|
2758
|
+
emotionml: "application/emotionml+xml",
|
|
2759
|
+
eps: "application/postscript",
|
|
2760
|
+
epub: "application/epub+zip",
|
|
2761
|
+
exe: "application/octet-stream",
|
|
2762
|
+
exi: "application/exi",
|
|
2763
|
+
exp: "application/express",
|
|
2764
|
+
exr: "image/aces",
|
|
2765
|
+
ez: "application/andrew-inset",
|
|
2766
|
+
fdf: "application/fdf",
|
|
2767
|
+
fdt: "application/fdt+xml",
|
|
2768
|
+
fits: "image/fits",
|
|
2769
|
+
g3: "image/g3fax",
|
|
2770
|
+
gbr: "application/rpki-ghostbusters",
|
|
2771
|
+
geojson: "application/geo+json",
|
|
2772
|
+
gif: "image/gif",
|
|
2773
|
+
glb: "model/gltf-binary",
|
|
2774
|
+
gltf: "model/gltf+json",
|
|
2775
|
+
gml: "application/gml+xml",
|
|
2776
|
+
gpx: "application/gpx+xml",
|
|
2777
|
+
gram: "application/srgs",
|
|
2778
|
+
grxml: "application/srgs+xml",
|
|
2779
|
+
gxf: "application/gxf",
|
|
2780
|
+
gz: "application/gzip",
|
|
2781
|
+
h261: "video/h261",
|
|
2782
|
+
h263: "video/h263",
|
|
2783
|
+
h264: "video/h264",
|
|
2784
|
+
heic: "image/heic",
|
|
2785
|
+
heics: "image/heic-sequence",
|
|
2786
|
+
heif: "image/heif",
|
|
2787
|
+
heifs: "image/heif-sequence",
|
|
2788
|
+
hej2: "image/hej2k",
|
|
2789
|
+
held: "application/atsc-held+xml",
|
|
2790
|
+
hjson: "application/hjson",
|
|
2791
|
+
hlp: "application/winhlp",
|
|
2792
|
+
hqx: "application/mac-binhex40",
|
|
2793
|
+
hsj2: "image/hsj2",
|
|
2794
|
+
htm: "text/html",
|
|
2795
|
+
html: "text/html",
|
|
2796
|
+
ics: "text/calendar",
|
|
2797
|
+
ief: "image/ief",
|
|
2798
|
+
ifb: "text/calendar",
|
|
2799
|
+
iges: "model/iges",
|
|
2800
|
+
igs: "model/iges",
|
|
2801
|
+
img: "application/octet-stream",
|
|
2802
|
+
in: "text/plain",
|
|
2803
|
+
ini: "text/plain",
|
|
2804
|
+
ink: "application/inkml+xml",
|
|
2805
|
+
inkml: "application/inkml+xml",
|
|
2806
|
+
ipfix: "application/ipfix",
|
|
2807
|
+
iso: "application/octet-stream",
|
|
2808
|
+
its: "application/its+xml",
|
|
2809
|
+
jade: "text/jade",
|
|
2810
|
+
jar: "application/java-archive",
|
|
2811
|
+
jhc: "image/jphc",
|
|
2812
|
+
jls: "image/jls",
|
|
2813
|
+
jp2: "image/jp2",
|
|
2814
|
+
jpe: "image/jpeg",
|
|
2815
|
+
jpeg: "image/jpeg",
|
|
2816
|
+
jpf: "image/jpx",
|
|
2817
|
+
jpg: "image/jpeg",
|
|
2818
|
+
jpg2: "image/jp2",
|
|
2819
|
+
jpgm: "image/jpm",
|
|
2820
|
+
jpgv: "video/jpeg",
|
|
2821
|
+
jph: "image/jph",
|
|
2822
|
+
jpm: "image/jpm",
|
|
2823
|
+
jpx: "image/jpx",
|
|
2824
|
+
js: "text/javascript",
|
|
2825
|
+
json: "application/json",
|
|
2826
|
+
json5: "application/json5",
|
|
2827
|
+
jsonld: "application/ld+json",
|
|
2828
|
+
jsonml: "application/jsonml+json",
|
|
2829
|
+
jsx: "text/jsx",
|
|
2830
|
+
jt: "model/jt",
|
|
2831
|
+
jxr: "image/jxr",
|
|
2832
|
+
jxra: "image/jxra",
|
|
2833
|
+
jxrs: "image/jxrs",
|
|
2834
|
+
jxs: "image/jxs",
|
|
2835
|
+
jxsc: "image/jxsc",
|
|
2836
|
+
jxsi: "image/jxsi",
|
|
2837
|
+
jxss: "image/jxss",
|
|
2838
|
+
kar: "audio/midi",
|
|
2839
|
+
ktx: "image/ktx",
|
|
2840
|
+
ktx2: "image/ktx2",
|
|
2841
|
+
less: "text/less",
|
|
2842
|
+
lgr: "application/lgr+xml",
|
|
2843
|
+
list: "text/plain",
|
|
2844
|
+
litcoffee: "text/coffeescript",
|
|
2845
|
+
log: "text/plain",
|
|
2846
|
+
lostxml: "application/lost+xml",
|
|
2847
|
+
lrf: "application/octet-stream",
|
|
2848
|
+
m1v: "video/mpeg",
|
|
2849
|
+
m21: "application/mp21",
|
|
2850
|
+
m2a: "audio/mpeg",
|
|
2851
|
+
m2v: "video/mpeg",
|
|
2852
|
+
m3a: "audio/mpeg",
|
|
2853
|
+
m4a: "audio/mp4",
|
|
2854
|
+
m4p: "application/mp4",
|
|
2855
|
+
m4s: "video/iso.segment",
|
|
2856
|
+
ma: "application/mathematica",
|
|
2857
|
+
mads: "application/mads+xml",
|
|
2858
|
+
maei: "application/mmt-aei+xml",
|
|
2859
|
+
man: "text/troff",
|
|
2860
|
+
manifest: "text/cache-manifest",
|
|
2861
|
+
map: "application/json",
|
|
2862
|
+
mar: "application/octet-stream",
|
|
2863
|
+
markdown: "text/markdown",
|
|
2864
|
+
mathml: "application/mathml+xml",
|
|
2865
|
+
mb: "application/mathematica",
|
|
2866
|
+
mbox: "application/mbox",
|
|
2867
|
+
md: "text/markdown",
|
|
2868
|
+
mdx: "text/mdx",
|
|
2869
|
+
me: "text/troff",
|
|
2870
|
+
mesh: "model/mesh",
|
|
2871
|
+
meta4: "application/metalink4+xml",
|
|
2872
|
+
metalink: "application/metalink+xml",
|
|
2873
|
+
mets: "application/mets+xml",
|
|
2874
|
+
mft: "application/rpki-manifest",
|
|
2875
|
+
mid: "audio/midi",
|
|
2876
|
+
midi: "audio/midi",
|
|
2877
|
+
mime: "message/rfc822",
|
|
2878
|
+
mj2: "video/mj2",
|
|
2879
|
+
mjp2: "video/mj2",
|
|
2880
|
+
mjs: "text/javascript",
|
|
2881
|
+
mml: "text/mathml",
|
|
2882
|
+
mods: "application/mods+xml",
|
|
2883
|
+
mov: "video/quicktime",
|
|
2884
|
+
mp2: "audio/mpeg",
|
|
2885
|
+
mp21: "application/mp21",
|
|
2886
|
+
mp2a: "audio/mpeg",
|
|
2887
|
+
mp3: "audio/mpeg",
|
|
2888
|
+
mp4: "video/mp4",
|
|
2889
|
+
mp4a: "audio/mp4",
|
|
2890
|
+
mp4s: "application/mp4",
|
|
2891
|
+
mp4v: "video/mp4",
|
|
2892
|
+
mpd: "application/dash+xml",
|
|
2893
|
+
mpe: "video/mpeg",
|
|
2894
|
+
mpeg: "video/mpeg",
|
|
2895
|
+
mpf: "application/media-policy-dataset+xml",
|
|
2896
|
+
mpg: "video/mpeg",
|
|
2897
|
+
mpg4: "video/mp4",
|
|
2898
|
+
mpga: "audio/mpeg",
|
|
2899
|
+
mpp: "application/dash-patch+xml",
|
|
2900
|
+
mrc: "application/marc",
|
|
2901
|
+
mrcx: "application/marcxml+xml",
|
|
2902
|
+
ms: "text/troff",
|
|
2903
|
+
mscml: "application/mediaservercontrol+xml",
|
|
2904
|
+
msh: "model/mesh",
|
|
2905
|
+
msi: "application/octet-stream",
|
|
2906
|
+
msix: "application/msix",
|
|
2907
|
+
msixbundle: "application/msixbundle",
|
|
2908
|
+
msm: "application/octet-stream",
|
|
2909
|
+
msp: "application/octet-stream",
|
|
2910
|
+
mtl: "model/mtl",
|
|
2911
|
+
musd: "application/mmt-usd+xml",
|
|
2912
|
+
mxf: "application/mxf",
|
|
2913
|
+
mxmf: "audio/mobile-xmf",
|
|
2914
|
+
mxml: "application/xv+xml",
|
|
2915
|
+
n3: "text/n3",
|
|
2916
|
+
nb: "application/mathematica",
|
|
2917
|
+
nq: "application/n-quads",
|
|
2918
|
+
nt: "application/n-triples",
|
|
2919
|
+
obj: "model/obj",
|
|
2920
|
+
oda: "application/oda",
|
|
2921
|
+
oga: "audio/ogg",
|
|
2922
|
+
ogg: "audio/ogg",
|
|
2923
|
+
ogv: "video/ogg",
|
|
2924
|
+
ogx: "application/ogg",
|
|
2925
|
+
omdoc: "application/omdoc+xml",
|
|
2926
|
+
onepkg: "application/onenote",
|
|
2927
|
+
onetmp: "application/onenote",
|
|
2928
|
+
onetoc: "application/onenote",
|
|
2929
|
+
onetoc2: "application/onenote",
|
|
2930
|
+
opf: "application/oebps-package+xml",
|
|
2931
|
+
opus: "audio/ogg",
|
|
2932
|
+
otf: "font/otf",
|
|
2933
|
+
owl: "application/rdf+xml",
|
|
2934
|
+
oxps: "application/oxps",
|
|
2935
|
+
p10: "application/pkcs10",
|
|
2936
|
+
p7c: "application/pkcs7-mime",
|
|
2937
|
+
p7m: "application/pkcs7-mime",
|
|
2938
|
+
p7s: "application/pkcs7-signature",
|
|
2939
|
+
p8: "application/pkcs8",
|
|
2940
|
+
pdf: "application/pdf",
|
|
2941
|
+
pfr: "application/font-tdpfr",
|
|
2942
|
+
pgp: "application/pgp-encrypted",
|
|
2943
|
+
pkg: "application/octet-stream",
|
|
2944
|
+
pki: "application/pkixcmp",
|
|
2945
|
+
pkipath: "application/pkix-pkipath",
|
|
2946
|
+
pls: "application/pls+xml",
|
|
2947
|
+
png: "image/png",
|
|
2948
|
+
prc: "model/prc",
|
|
2949
|
+
prf: "application/pics-rules",
|
|
2950
|
+
provx: "application/provenance+xml",
|
|
2951
|
+
ps: "application/postscript",
|
|
2952
|
+
pskcxml: "application/pskc+xml",
|
|
2953
|
+
pti: "image/prs.pti",
|
|
2954
|
+
qt: "video/quicktime",
|
|
2955
|
+
raml: "application/raml+yaml",
|
|
2956
|
+
rapd: "application/route-apd+xml",
|
|
2957
|
+
rdf: "application/rdf+xml",
|
|
2958
|
+
relo: "application/p2p-overlay+xml",
|
|
2959
|
+
rif: "application/reginfo+xml",
|
|
2960
|
+
rl: "application/resource-lists+xml",
|
|
2961
|
+
rld: "application/resource-lists-diff+xml",
|
|
2962
|
+
rmi: "audio/midi",
|
|
2963
|
+
rnc: "application/relax-ng-compact-syntax",
|
|
2964
|
+
rng: "application/xml",
|
|
2965
|
+
roa: "application/rpki-roa",
|
|
2966
|
+
roff: "text/troff",
|
|
2967
|
+
rq: "application/sparql-query",
|
|
2968
|
+
rs: "application/rls-services+xml",
|
|
2969
|
+
rsat: "application/atsc-rsat+xml",
|
|
2970
|
+
rsd: "application/rsd+xml",
|
|
2971
|
+
rsheet: "application/urc-ressheet+xml",
|
|
2972
|
+
rss: "application/rss+xml",
|
|
2973
|
+
rtf: "text/rtf",
|
|
2974
|
+
rtx: "text/richtext",
|
|
2975
|
+
rusd: "application/route-usd+xml",
|
|
2976
|
+
s3m: "audio/s3m",
|
|
2977
|
+
sbml: "application/sbml+xml",
|
|
2978
|
+
scq: "application/scvp-cv-request",
|
|
2979
|
+
scs: "application/scvp-cv-response",
|
|
2980
|
+
sdp: "application/sdp",
|
|
2981
|
+
senmlx: "application/senml+xml",
|
|
2982
|
+
sensmlx: "application/sensml+xml",
|
|
2983
|
+
ser: "application/java-serialized-object",
|
|
2984
|
+
setpay: "application/set-payment-initiation",
|
|
2985
|
+
setreg: "application/set-registration-initiation",
|
|
2986
|
+
sgi: "image/sgi",
|
|
2987
|
+
sgm: "text/sgml",
|
|
2988
|
+
sgml: "text/sgml",
|
|
2989
|
+
shex: "text/shex",
|
|
2990
|
+
shf: "application/shf+xml",
|
|
2991
|
+
shtml: "text/html",
|
|
2992
|
+
sieve: "application/sieve",
|
|
2993
|
+
sig: "application/pgp-signature",
|
|
2994
|
+
sil: "audio/silk",
|
|
2995
|
+
silo: "model/mesh",
|
|
2996
|
+
siv: "application/sieve",
|
|
2997
|
+
slim: "text/slim",
|
|
2998
|
+
slm: "text/slim",
|
|
2999
|
+
sls: "application/route-s-tsid+xml",
|
|
3000
|
+
smi: "application/smil+xml",
|
|
3001
|
+
smil: "application/smil+xml",
|
|
3002
|
+
snd: "audio/basic",
|
|
3003
|
+
so: "application/octet-stream",
|
|
3004
|
+
spdx: "text/spdx",
|
|
3005
|
+
spp: "application/scvp-vp-response",
|
|
3006
|
+
spq: "application/scvp-vp-request",
|
|
3007
|
+
spx: "audio/ogg",
|
|
3008
|
+
sql: "application/sql",
|
|
3009
|
+
sru: "application/sru+xml",
|
|
3010
|
+
srx: "application/sparql-results+xml",
|
|
3011
|
+
ssdl: "application/ssdl+xml",
|
|
3012
|
+
ssml: "application/ssml+xml",
|
|
3013
|
+
stk: "application/hyperstudio",
|
|
3014
|
+
stl: "model/stl",
|
|
3015
|
+
stpx: "model/step+xml",
|
|
3016
|
+
stpxz: "model/step-xml+zip",
|
|
3017
|
+
stpz: "model/step+zip",
|
|
3018
|
+
styl: "text/stylus",
|
|
3019
|
+
stylus: "text/stylus",
|
|
3020
|
+
svg: "image/svg+xml",
|
|
3021
|
+
svgz: "image/svg+xml",
|
|
3022
|
+
swidtag: "application/swid+xml",
|
|
3023
|
+
t: "text/troff",
|
|
3024
|
+
t38: "image/t38",
|
|
3025
|
+
td: "application/urc-targetdesc+xml",
|
|
3026
|
+
tei: "application/tei+xml",
|
|
3027
|
+
teicorpus: "application/tei+xml",
|
|
3028
|
+
text: "text/plain",
|
|
3029
|
+
tfi: "application/thraud+xml",
|
|
3030
|
+
tfx: "image/tiff-fx",
|
|
3031
|
+
tif: "image/tiff",
|
|
3032
|
+
tiff: "image/tiff",
|
|
3033
|
+
toml: "application/toml",
|
|
3034
|
+
tr: "text/troff",
|
|
3035
|
+
trig: "application/trig",
|
|
3036
|
+
ts: "video/mp2t",
|
|
3037
|
+
tsd: "application/timestamped-data",
|
|
3038
|
+
tsv: "text/tab-separated-values",
|
|
3039
|
+
ttc: "font/collection",
|
|
3040
|
+
ttf: "font/ttf",
|
|
3041
|
+
ttl: "text/turtle",
|
|
3042
|
+
ttml: "application/ttml+xml",
|
|
3043
|
+
txt: "text/plain",
|
|
3044
|
+
u3d: "model/u3d",
|
|
3045
|
+
u8dsn: "message/global-delivery-status",
|
|
3046
|
+
u8hdr: "message/global-headers",
|
|
3047
|
+
u8mdn: "message/global-disposition-notification",
|
|
3048
|
+
u8msg: "message/global",
|
|
3049
|
+
ubj: "application/ubjson",
|
|
3050
|
+
uri: "text/uri-list",
|
|
3051
|
+
uris: "text/uri-list",
|
|
3052
|
+
urls: "text/uri-list",
|
|
3053
|
+
vcard: "text/vcard",
|
|
3054
|
+
vrml: "model/vrml",
|
|
3055
|
+
vtt: "text/vtt",
|
|
3056
|
+
vxml: "application/voicexml+xml",
|
|
3057
|
+
war: "application/java-archive",
|
|
3058
|
+
wasm: "application/wasm",
|
|
3059
|
+
wav: "audio/wav",
|
|
3060
|
+
weba: "audio/webm",
|
|
3061
|
+
webm: "video/webm",
|
|
3062
|
+
webmanifest: "application/manifest+json",
|
|
3063
|
+
webp: "image/webp",
|
|
3064
|
+
wgsl: "text/wgsl",
|
|
3065
|
+
wgt: "application/widget",
|
|
3066
|
+
wif: "application/watcherinfo+xml",
|
|
3067
|
+
wmf: "image/wmf",
|
|
3068
|
+
woff: "font/woff",
|
|
3069
|
+
woff2: "font/woff2",
|
|
3070
|
+
wrl: "model/vrml",
|
|
3071
|
+
wsdl: "application/wsdl+xml",
|
|
3072
|
+
wspolicy: "application/wspolicy+xml",
|
|
3073
|
+
x3d: "model/x3d+xml",
|
|
3074
|
+
x3db: "model/x3d+fastinfoset",
|
|
3075
|
+
x3dbz: "model/x3d+binary",
|
|
3076
|
+
x3dv: "model/x3d-vrml",
|
|
3077
|
+
x3dvz: "model/x3d+vrml",
|
|
3078
|
+
x3dz: "model/x3d+xml",
|
|
3079
|
+
xaml: "application/xaml+xml",
|
|
3080
|
+
xav: "application/xcap-att+xml",
|
|
3081
|
+
xca: "application/xcap-caps+xml",
|
|
3082
|
+
xcs: "application/calendar+xml",
|
|
3083
|
+
xdf: "application/xcap-diff+xml",
|
|
3084
|
+
xdssc: "application/dssc+xml",
|
|
3085
|
+
xel: "application/xcap-el+xml",
|
|
3086
|
+
xenc: "application/xenc+xml",
|
|
3087
|
+
xer: "application/patch-ops-error+xml",
|
|
3088
|
+
xfdf: "application/xfdf",
|
|
3089
|
+
xht: "application/xhtml+xml",
|
|
3090
|
+
xhtml: "application/xhtml+xml",
|
|
3091
|
+
xhvml: "application/xv+xml",
|
|
3092
|
+
xlf: "application/xliff+xml",
|
|
3093
|
+
xm: "audio/xm",
|
|
3094
|
+
xml: "text/xml",
|
|
3095
|
+
xns: "application/xcap-ns+xml",
|
|
3096
|
+
xop: "application/xop+xml",
|
|
3097
|
+
xpl: "application/xproc+xml",
|
|
3098
|
+
xsd: "application/xml",
|
|
3099
|
+
xsf: "application/prs.xsf+xml",
|
|
3100
|
+
xsl: "application/xml",
|
|
3101
|
+
xslt: "application/xml",
|
|
3102
|
+
xspf: "application/xspf+xml",
|
|
3103
|
+
xvm: "application/xv+xml",
|
|
3104
|
+
xvml: "application/xv+xml",
|
|
3105
|
+
yaml: "text/yaml",
|
|
3106
|
+
yang: "application/yang",
|
|
3107
|
+
yin: "application/yin+xml",
|
|
3108
|
+
yml: "text/yaml",
|
|
3109
|
+
zip: "application/zip"
|
|
3110
|
+
}, noop = ()=>{};
|
|
3111
|
+
function toAssume(uri, extns) {
|
|
3112
|
+
let i = 0, x, len = uri.length - 1;
|
|
3113
|
+
47 === uri.charCodeAt(len) && (uri = uri.substring(0, len));
|
|
3114
|
+
let arr = [], tmp = `${uri}/index`;
|
|
3115
|
+
for(; i < extns.length; i++)x = extns[i] ? `.${extns[i]}` : '', uri && arr.push(uri + x), arr.push(tmp + x);
|
|
3116
|
+
return arr;
|
|
3117
|
+
}
|
|
3118
|
+
function viaCache(cache, uri, extns) {
|
|
3119
|
+
let i = 0, data, arr = toAssume(uri, extns);
|
|
3120
|
+
for(; i < arr.length; i++)if (data = cache[arr[i]]) return data;
|
|
3121
|
+
}
|
|
3122
|
+
function viaLocal(dir, isEtag, uri, extns) {
|
|
3123
|
+
let abs, stats, name, headers, i = 0, arr = toAssume(uri, extns);
|
|
3124
|
+
for(; i < arr.length; i++)if ((abs = normalize(join(dir, name = arr[i]))).startsWith(dir) && __rspack_external_node_fs_1b05aee1.existsSync(abs)) {
|
|
3125
|
+
if ((stats = __rspack_external_node_fs_1b05aee1.statSync(abs)).isDirectory()) continue;
|
|
3126
|
+
return (headers = toHeaders(name, stats, isEtag))['Cache-Control'] = isEtag ? 'no-cache' : 'no-store', {
|
|
3127
|
+
abs,
|
|
3128
|
+
stats,
|
|
3129
|
+
headers
|
|
3130
|
+
};
|
|
3131
|
+
}
|
|
3132
|
+
}
|
|
3133
|
+
function is404(req, res) {
|
|
3134
|
+
return res.statusCode = 404, res.end();
|
|
3135
|
+
}
|
|
3136
|
+
let ENCODING = {
|
|
3137
|
+
'.br': 'br',
|
|
3138
|
+
'.gz': 'gzip'
|
|
3139
|
+
};
|
|
3140
|
+
function toHeaders(name, stats, isEtag) {
|
|
3141
|
+
let tmp, idx, enc = ENCODING[name.slice(-3)], ctype = mimes[!~(idx = (tmp = ('' + name.slice(0, enc && -3)).trim().toLowerCase()).lastIndexOf('.')) ? tmp : tmp.substring(++idx)] || '';
|
|
3142
|
+
'text/html' === ctype && (ctype += ';charset=utf-8');
|
|
3143
|
+
let headers = {
|
|
3144
|
+
'Content-Length': stats.size,
|
|
3145
|
+
'Content-Type': ctype,
|
|
3146
|
+
'Last-Modified': stats.mtime.toUTCString()
|
|
3147
|
+
};
|
|
3148
|
+
return enc && (headers['Content-Encoding'] = enc), isEtag && (headers.ETag = `W/"${stats.size}-${stats.mtime.getTime()}"`), headers;
|
|
3149
|
+
}
|
|
3150
|
+
function build(dir, opts = {}) {
|
|
3151
|
+
dir = external_node_path_resolve(dir || '.');
|
|
3152
|
+
let isNotFound = opts.onNoMatch || is404, setHeaders = opts.setHeaders || noop, extensions = opts.extensions || [
|
|
3153
|
+
'html',
|
|
3154
|
+
'htm'
|
|
3155
|
+
], gzips = opts.gzip && extensions.map((x)=>`${x}.gz`).concat('gz'), brots = opts.brotli && extensions.map((x)=>`${x}.br`).concat('br'), FILES = {}, fallback = '/', isEtag = !!opts.etag, isSPA = !!opts.single;
|
|
3156
|
+
if ('string' == typeof opts.single) {
|
|
3157
|
+
let idx = opts.single.lastIndexOf('.');
|
|
3158
|
+
fallback += ~idx ? opts.single.substring(0, idx) : opts.single;
|
|
3159
|
+
}
|
|
3160
|
+
let ignores = [];
|
|
3161
|
+
!1 !== opts.ignores && (ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/), opts.dotfiles ? ignores.push(/\/\.\w/) : ignores.push(/\/\.well-known/), [].concat(opts.ignores || []).forEach((x)=>{
|
|
3162
|
+
ignores.push(RegExp(x, 'i'));
|
|
3163
|
+
}));
|
|
3164
|
+
let cc = null != opts.maxAge && `public,max-age=${opts.maxAge}`;
|
|
3165
|
+
cc && opts.immutable ? cc += ',immutable' : cc && 0 === opts.maxAge && (cc += ',must-revalidate'), opts.dev || function totalist(dir, callback, pre = '') {
|
|
3166
|
+
let arr = readdirSync(dir = external_path_resolve('.', dir)), i = 0, abs, stats;
|
|
3167
|
+
for(; i < arr.length; i++)(stats = statSync(abs = external_path_join(dir, arr[i]))).isDirectory() ? totalist(abs, callback, external_path_join(pre, arr[i])) : callback(external_path_join(pre, arr[i]), abs, stats);
|
|
3168
|
+
}(dir, (name, abs, stats)=>{
|
|
3169
|
+
if (/\.well-known[\\+\/]/.test(name)) ;
|
|
3170
|
+
else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return;
|
|
3171
|
+
let headers = toHeaders(name, stats, isEtag);
|
|
3172
|
+
cc && (headers['Cache-Control'] = cc), FILES['/' + name.normalize().replace(/\\+/g, '/')] = {
|
|
3173
|
+
abs,
|
|
3174
|
+
stats,
|
|
3175
|
+
headers
|
|
3176
|
+
};
|
|
3177
|
+
});
|
|
3178
|
+
let lookup = opts.dev ? viaLocal.bind(0, dir + external_node_path_sep, isEtag) : viaCache.bind(0, FILES);
|
|
3179
|
+
return function(req, res, next) {
|
|
3180
|
+
let extns = [
|
|
3181
|
+
''
|
|
3182
|
+
], pathname = function(req) {
|
|
3183
|
+
let raw = req.url;
|
|
3184
|
+
if (null == raw) return;
|
|
3185
|
+
let prev = req._parsedUrl;
|
|
3186
|
+
if (prev && prev.raw === raw) return prev;
|
|
3187
|
+
let pathname = raw, search = '', query;
|
|
3188
|
+
if (raw.length > 1) {
|
|
3189
|
+
let idx = raw.indexOf('?', 1);
|
|
3190
|
+
-1 !== idx && (search = raw.substring(idx), pathname = raw.substring(0, idx), search.length > 1 && (query = __rspack_external_node_querystring_5092a520.parse(search.substring(1))));
|
|
3191
|
+
}
|
|
3192
|
+
return req._parsedUrl = {
|
|
3193
|
+
pathname,
|
|
3194
|
+
search,
|
|
3195
|
+
query,
|
|
3196
|
+
raw
|
|
3197
|
+
};
|
|
3198
|
+
}(req).pathname, val = req.headers['accept-encoding'] || '';
|
|
3199
|
+
if (gzips && val.includes('gzip') && extns.unshift(...gzips), brots && /(br|brotli)/i.test(val) && extns.unshift(...brots), extns.push(...extensions), -1 !== pathname.indexOf('%')) try {
|
|
3200
|
+
pathname = decodeURI(pathname);
|
|
3201
|
+
} catch (err) {}
|
|
3202
|
+
let data = lookup(pathname, extns) || isSPA && !function(uri, arr) {
|
|
3203
|
+
for(let i = 0; i < arr.length; i++)if (arr[i].test(uri)) return !0;
|
|
3204
|
+
}(pathname, ignores) && lookup(fallback, extns);
|
|
3205
|
+
return data ? isEtag && req.headers['if-none-match'] === data.headers.ETag ? (res.writeHead(304), res.end()) : void ((gzips || brots) && res.setHeader('Vary', 'Accept-Encoding'), setHeaders(res, pathname, data.stats), function(req, res, file, stats, headers) {
|
|
3206
|
+
let code = 200, tmp, opts = {};
|
|
3207
|
+
for(let key in headers = {
|
|
3208
|
+
...headers
|
|
3209
|
+
})(tmp = res.getHeader(key)) && (headers[key] = tmp);
|
|
3210
|
+
if ((tmp = res.getHeader('content-type')) && (headers['Content-Type'] = tmp), req.headers.range) {
|
|
3211
|
+
code = 206;
|
|
3212
|
+
let [x, y] = req.headers.range.replace('bytes=', '').split('-'), end = opts.end = parseInt(y, 10) || stats.size - 1, start = opts.start = parseInt(x, 10) || 0;
|
|
3213
|
+
if (end >= stats.size && (end = stats.size - 1), start >= stats.size) return res.setHeader('Content-Range', `bytes */${stats.size}`), res.statusCode = 416, res.end();
|
|
3214
|
+
headers['Content-Range'] = `bytes ${start}-${end}/${stats.size}`, headers['Content-Length'] = end - start + 1, headers['Accept-Ranges'] = 'bytes';
|
|
3215
|
+
}
|
|
3216
|
+
res.writeHead(code, headers), __rspack_external_node_fs_1b05aee1.createReadStream(file, opts).pipe(res);
|
|
3217
|
+
}(req, res, data.abs, data.stats, data.headers)) : next ? next() : isNotFound(req, res);
|
|
3218
|
+
};
|
|
3219
|
+
}
|
|
3220
|
+
rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/stream.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/extension.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/permessage-deflate.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/receiver.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/sender.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/subprotocol.js");
|
|
3221
|
+
let websocket = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket.js"), websocket_server = rspackRequire("../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket-server.js");
|
|
2610
3222
|
class SocketAPILoader {
|
|
2611
3223
|
constructor(options){
|
|
2612
3224
|
this.options = options, this.dataLoader = new Data.APIDataLoader(this);
|
|
@@ -3476,11 +4088,16 @@ function getContentType(req) {
|
|
|
3476
4088
|
function normalizeReadError(error, charset) {
|
|
3477
4089
|
return error instanceof Error && 'status' in error && 'number' == typeof error.status ? charset && 'type' in error && 'encoding.unsupported' === error.type ? createHttpError(415, `unsupported charset "${charset.toUpperCase()}"`, 'charset.unsupported') : error : createHttpError(400, error instanceof Error ? error.message : 'failed to read request body', 'request.invalid');
|
|
3478
4090
|
}
|
|
3479
|
-
var lib_default = compatGetDefaultExport(rspackRequire("../../node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js")), launch_editor_default = compatGetDefaultExport(rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.
|
|
4091
|
+
var lib_default = compatGetDefaultExport(rspackRequire("../../node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js")), launch_editor_default = compatGetDefaultExport(rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/index.js"));
|
|
3480
4092
|
let server_require = createRequire(import.meta.url), OPEN_IN_EDITOR_EDITORS = new Set(SDK.OPEN_IN_EDITOR_EDITORS), LARGE_JSON_BODY_ROUTES = new Set([
|
|
3481
4093
|
SDK.ServerAPI.API.ReportLoader,
|
|
3482
4094
|
SDK.ServerAPI.API.ReportSourceMap
|
|
3483
|
-
])
|
|
4095
|
+
]), CLIENT_OVERRIDE_CONTENT_TYPES = {
|
|
4096
|
+
'.css': 'text/css; charset=utf-8',
|
|
4097
|
+
'.html': 'text/html; charset=utf-8',
|
|
4098
|
+
'.js': "application/javascript; charset=utf-8",
|
|
4099
|
+
'.json': 'application/json; charset=utf-8'
|
|
4100
|
+
};
|
|
3484
4101
|
class RsdoctorServer {
|
|
3485
4102
|
constructor(sdk, port = defaultPort, config){
|
|
3486
4103
|
this.sdk = sdk, this.disposed = !0, this._socketToken = randomBytes(16).toString('hex'), this.get = (route, cb)=>{
|
|
@@ -3499,7 +4116,7 @@ class RsdoctorServer {
|
|
|
3499
4116
|
sdk,
|
|
3500
4117
|
server: this,
|
|
3501
4118
|
apis: Object.values(apis_namespaceObject)
|
|
3502
|
-
}), this._innerClientPath = config?.innerClientPath || '', this._printServerUrl = config?.printServerUrl ?? !0, this._cors = config?.cors;
|
|
4119
|
+
}), this._innerClientPath = config?.innerClientPath || '', this._innerClientOverrides = config?.innerClientOverrides, this._printServerUrl = config?.printServerUrl ?? !0, this._cors = config?.cors;
|
|
3503
4120
|
}
|
|
3504
4121
|
get app() {
|
|
3505
4122
|
return this._server.app;
|
|
@@ -3520,6 +4137,25 @@ class RsdoctorServer {
|
|
|
3520
4137
|
get innerClientPath() {
|
|
3521
4138
|
return this._innerClientPath;
|
|
3522
4139
|
}
|
|
4140
|
+
get innerClientOverrides() {
|
|
4141
|
+
return this._innerClientOverrides;
|
|
4142
|
+
}
|
|
4143
|
+
applyClientOverrides() {
|
|
4144
|
+
let overrides = this._innerClientOverrides;
|
|
4145
|
+
overrides && (Object.entries(overrides.files ?? {}).forEach(([route, filePath])=>{
|
|
4146
|
+
let pathname = `/${route.replace(/^\/+/, '')}`;
|
|
4147
|
+
this.app.use(pathname, (_req, res, next)=>{
|
|
4148
|
+
if (!fs.existsSync(filePath)) return next();
|
|
4149
|
+
let contentType = CLIENT_OVERRIDE_CONTENT_TYPES[path_0.extname(filePath)];
|
|
4150
|
+
contentType && res.setHeader('Content-Type', contentType), res.setHeader('Cache-Control', 'no-store'), res.end(fs.readFileSync(filePath));
|
|
4151
|
+
});
|
|
4152
|
+
}), Object.entries(overrides.directories ?? {}).forEach(([route, dirPath])=>{
|
|
4153
|
+
let pathname = `/${route.replace(/^\/+|\/+$/g, '')}`;
|
|
4154
|
+
this.app.use(pathname, build(dirPath, {
|
|
4155
|
+
dev: !0
|
|
4156
|
+
}));
|
|
4157
|
+
}));
|
|
4158
|
+
}
|
|
3523
4159
|
async createInnerServer() {
|
|
3524
4160
|
let lastError, expectedPort = this.port;
|
|
3525
4161
|
for(let retry = 0; retry < 10; retry++){
|
|
@@ -3680,9 +4316,9 @@ class RsdoctorServer {
|
|
|
3680
4316
|
let pathname = new URL(req.url || '/', 'http://localhost').pathname;
|
|
3681
4317
|
return LARGE_JSON_BODY_ROUTES.has(pathname) ? '500mb' : '10mb';
|
|
3682
4318
|
}
|
|
3683
|
-
})), await this._router.setup();
|
|
4319
|
+
})), await this._router.setup(), this.applyClientOverrides();
|
|
3684
4320
|
let clientHtmlPath = this._innerClientPath ? this._innerClientPath : server_require.resolve('@rsdoctor/client'), clientDistPath = path_0.resolve(clientHtmlPath, '..');
|
|
3685
|
-
this.app.use(
|
|
4321
|
+
this.app.use(build(clientDistPath, {
|
|
3686
4322
|
dev: !0
|
|
3687
4323
|
})), this.app.use('/__open-in-editor', (req, res, next)=>{
|
|
3688
4324
|
if ('GET' !== req.method && 'HEAD' !== req.method) return next();
|
|
@@ -4179,6 +4815,7 @@ class RsdoctorSDK extends SDKCore {
|
|
|
4179
4815
|
let serverConfig = options.config?.server, port = serverConfig?.port ?? options.port;
|
|
4180
4816
|
this.server = options.config?.noServer ? new RsdoctorFakeServer(this, port) : new RsdoctorServer(this, port, {
|
|
4181
4817
|
innerClientPath: options.config?.innerClientPath || '',
|
|
4818
|
+
innerClientOverrides: options.config?.innerClientOverrides,
|
|
4182
4819
|
printServerUrl: options.config?.printLog?.serverUrls,
|
|
4183
4820
|
cors: serverConfig?.cors
|
|
4184
4821
|
}), this.type = Lodash.isNumber(options.type) ? options.type : SDK.ToDataType.Normal, this.extraConfig = options.config, this.root = findRoot() ?? '';
|
|
@@ -4566,7 +5203,16 @@ class RsdoctorSDKController {
|
|
|
4566
5203
|
if (slave === this.master) return this.outputDir || slave.outputDir;
|
|
4567
5204
|
let rootOutputDir = this.outputDir || this.master?.outputDir || slave.outputDir, existing = this.compilerDirectories.get(slave);
|
|
4568
5205
|
if (existing?.name === slave.name) return node_path.join(rootOutputDir, existing.directory);
|
|
4569
|
-
let name =
|
|
5206
|
+
let name = function(name, isChild) {
|
|
5207
|
+
let normalized = isChild ? name.replace(/\s+/g, '-') || 'compiler' : name.replace(/[^a-zA-Z0-9_$-]+/g, '-').replace(/^-+|-+$/g, '') || 'compiler';
|
|
5208
|
+
if (120 >= Buffer.byteLength(normalized)) return normalized;
|
|
5209
|
+
let hash = createHash('sha256').update(name).digest('hex').slice(0, 12), prefix = function(value, maxBytes) {
|
|
5210
|
+
let end = value.length;
|
|
5211
|
+
for(; Buffer.byteLength(value.slice(0, end)) > maxBytes;)end -= 1;
|
|
5212
|
+
return value.slice(0, end);
|
|
5213
|
+
}(normalized, 120 - hash.length - 1);
|
|
5214
|
+
return `${prefix}-${hash}`;
|
|
5215
|
+
}(slave.name, slave.isChild), folder = slave.isChild ? '.slaves' : 'compilers', occupied = new Set([
|
|
4570
5216
|
...this.compilerDirectories.values()
|
|
4571
5217
|
].map(({ directory })=>directory.toLowerCase())), directory = node_path.join(folder, name), suffix = 2;
|
|
4572
5218
|
for(; occupied.has(directory.toLowerCase());)directory = node_path.join(folder, `${name}-${suffix++}`);
|
|
@@ -4659,7 +5305,7 @@ class RsdoctorSDKController {
|
|
|
4659
5305
|
return this.slaves.filter((item)=>this.activeSlaves.has(item));
|
|
4660
5306
|
}
|
|
4661
5307
|
}
|
|
4662
|
-
var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/core","version":"2.0.0-rc.
|
|
5308
|
+
var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/core","version":"2.0.0-rc.3","repository":{"type":"git","url":"https://github.com/web-infra-dev/rsdoctor","directory":"packages/core"},"license":"MIT","type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./proxy-loader":{"types":"./dist/proxy-loader.d.ts","default":"./dist/proxy-loader.js"}},"main":"dist/index.js","types":"dist/index.d.ts","typesVersions":{"*":{".":["./dist/index.d.ts"],"proxy-loader":["./dist/proxy-loader.d.ts"]}},"files":["dist","static"],"scripts":{"build":"rs lib","dev":"npm run start","start":"rs lib -w","test":"rs test"},"dependencies":{"@rsdoctor/client":"workspace:*","@rsdoctor/shared":"workspace:*","caniuse-lite":"^1.0.30001815","sirv":"catalog:","source-map":"catalog:"},"devDependencies":{"@babel/code-frame":"7.26.2","@rsbuild/plugin-check-syntax":"catalog:","@rspack/core":"catalog:","@rspack/lite-tapable":"catalog:","@scripts/test-helper":"workspace:*","@types/babel__code-frame":"7.27.0","@types/cors":"2.8.19","@types/envinfo":"7.8.4","@types/estree":"catalog:","@types/fs-extra":"catalog:","@types/node":"catalog:","@types/semver":"^7.8.0","@types/ws":"^8.18.2","acorn":"^8.10.0","acorn-import-attributes":"^1.9.5","acorn-walk":"8.3.5","babel-loader":"10.1.1","browserslist-load-config":"^1.0.3","connect-next":"catalog:","cors":"2.8.6","envinfo":"7.21.0","filesize":"catalog:","fs-extra":"catalog:","get-port":"5.1.1","json-stream-stringify":"3.0.1","launch-editor":"^2.14.2","lines-and-columns":"2.0.4","open":"^11.0.4","raw-body":"4.0.0","rslog":"^2.3.0","semver":"^7.8.5","string-loader":"0.0.1","ts-loader":"^9.6.2","typescript":"catalog:","ws":"8.22.0"},"peerDependencies":{"@rspack/core":"^2.0.0"},"peerDependenciesMeta":{"@rspack/core":{"optional":true}},"engines":{"node":"^20.19.0 || >=22.12.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}');
|
|
4663
5309
|
let pluginTapName = 'RsdoctorRspackPlugin', pluginTapPostOptions = {
|
|
4664
5310
|
name: pluginTapName,
|
|
4665
5311
|
stage: 999
|
|
@@ -4669,7 +5315,10 @@ let pluginTapName = 'RsdoctorRspackPlugin', pluginTapPostOptions = {
|
|
|
4669
5315
|
function getWriteStoreOptions(compiler) {
|
|
4670
5316
|
return isCompilerWatching(compiler) ? watchWriteStoreOptions : void 0;
|
|
4671
5317
|
}
|
|
4672
|
-
let hasGreeted = !1
|
|
5318
|
+
let hasGreeted = !1, ignoredChildCompilerNames = new Set([
|
|
5319
|
+
'HtmlRspackCompiler',
|
|
5320
|
+
'mini-css-extract-plugin'
|
|
5321
|
+
]);
|
|
4673
5322
|
class RsdoctorCompilerContext {
|
|
4674
5323
|
constructor(sdk, options){
|
|
4675
5324
|
this.sdk = sdk, this.options = options, this.name = pluginTapName, this.isRsdoctorPlugin = !0, this.modulesGraph = new ModuleGraph(), this.applied = !1, this.hasOpenedClientAutomatically = !1;
|
|
@@ -4816,11 +5465,12 @@ class RsdoctorRspackPlugin {
|
|
|
4816
5465
|
}
|
|
4817
5466
|
}
|
|
4818
5467
|
createCompilerContext() {
|
|
4819
|
-
let controller = this.controller, { output, innerClientPath, printLog, server, features } = this.options;
|
|
5468
|
+
let controller = this.controller, { output, innerClientPath, innerClientOverrides, printLog, server, features } = this.options;
|
|
4820
5469
|
return new RsdoctorCompilerContext(controller.createSlave({
|
|
4821
5470
|
name: this.defaultName,
|
|
4822
5471
|
extraConfig: {
|
|
4823
5472
|
innerClientPath,
|
|
5473
|
+
innerClientOverrides,
|
|
4824
5474
|
printLog,
|
|
4825
5475
|
server,
|
|
4826
5476
|
mode: output.mode || void 0,
|
|
@@ -4881,13 +5531,13 @@ class RsdoctorRspackPlugin {
|
|
|
4881
5531
|
});
|
|
4882
5532
|
}
|
|
4883
5533
|
registerChildCompiler(parentCompiler, childCompiler, compilerName, compilerIndex, parentContext) {
|
|
4884
|
-
if (!(parentContext.sdk instanceof RsdoctorPrimarySDK)) return;
|
|
5534
|
+
if (!(parentContext.sdk instanceof RsdoctorPrimarySDK) || this.shouldIgnoreChildCompiler(childCompiler, compilerName)) return;
|
|
4885
5535
|
let parentSDK = parentContext.sdk, controller = parentSDK.parent, compilerPath = childCompiler.compilerPath || `${parentCompiler.compilerPath}${compilerName}|${compilerIndex}|`, childKey = `${parentSDK.id}:${compilerPath}`, registeredChild = this.childPlugins.get(childKey);
|
|
4886
5536
|
if (registeredChild?.compiler === childCompiler) return;
|
|
4887
5537
|
controller.setOutputDir(parentSDK, this.getOutputDir(parentCompiler));
|
|
4888
5538
|
let childSDK = (()=>{
|
|
4889
5539
|
if (registeredChild) return registeredChild.sdk;
|
|
4890
|
-
let safeCompilerPath = compilerPath.replace(/[^a-zA-Z0-9._-]+/g, '-') || `${compilerName}-${compilerIndex}`, displayName = childCompiler.name || compilerName
|
|
5540
|
+
let safeCompilerPath = compilerPath.replace(/[^a-zA-Z0-9._-]+/g, '-') || `${compilerName}-${compilerIndex}`, displayName = this.getChildCompilerDisplayName(childCompiler.name || compilerName, compilerIndex), sdk = controller.createSlave({
|
|
4891
5541
|
name: `child-${safeCompilerPath}`,
|
|
4892
5542
|
displayName,
|
|
4893
5543
|
compilerPath,
|
|
@@ -4911,6 +5561,15 @@ class RsdoctorRspackPlugin {
|
|
|
4911
5561
|
sdk: childSDK
|
|
4912
5562
|
}), childPlugin.apply(childCompiler);
|
|
4913
5563
|
}
|
|
5564
|
+
shouldIgnoreChildCompiler(childCompiler, compilerName) {
|
|
5565
|
+
return !!childCompiler.name && ignoredChildCompilerNames.has(childCompiler.name) || ignoredChildCompilerNames.has(compilerName);
|
|
5566
|
+
}
|
|
5567
|
+
getChildCompilerDisplayName(name, compilerIndex) {
|
|
5568
|
+
if (!name) return `Child compiler ${compilerIndex}`;
|
|
5569
|
+
if (!name.startsWith('worker-loader ')) return name;
|
|
5570
|
+
let request = name.slice(14), resource = request.split('!').at(-1)?.split('?')[0], fileName = resource && node_path.basename(node_path.win32.basename(resource));
|
|
5571
|
+
return fileName ? `worker-loader: ${fileName}` : 'worker-loader';
|
|
5572
|
+
}
|
|
4914
5573
|
removeInheritedRsdoctorTaps(compiler) {
|
|
4915
5574
|
for (let hook of Object.values(compiler.hooks))Array.isArray(hook.taps) && (hook.taps = hook.taps.filter((tap)=>tap.name !== pluginTapName && !tap.name.startsWith(`${pluginTapName}:`)));
|
|
4916
5575
|
}
|