@rsdoctor/core 2.0.1 → 2.0.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/e.js +233 -3876
- package/dist/e.js.LICENSE.txt +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +106 -101
- package/dist/r.js +3981 -504
- package/package.json +12 -13
package/dist/e.js.LICENSE.txt
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -396,7 +396,7 @@ declare class RsdoctorServer implements SDK.RsdoctorServerInstance {
|
|
|
396
396
|
getClientUrl(route: Client.RsdoctorClientRoutes, baselineUrl: string, currentUrl: string): string;
|
|
397
397
|
getClientUrl(route?: 'homepage'): string;
|
|
398
398
|
openClientPage(route: Client.RsdoctorClientRoutes, baselineUrl: string, currentUrl: string): Promise<void>;
|
|
399
|
-
openClientPage(route?: 'homepage'): Promise<void>;
|
|
399
|
+
openClientPage(route?: 'homepage', autoOpenBrowser?: boolean): Promise<void>;
|
|
400
400
|
sendAPIDataToClient<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(api: T, msg: SDK.ServerAPI.SocketResponseType<T>): void;
|
|
401
401
|
broadcast(): Promise<void>;
|
|
402
402
|
dispose: (exitCode?: number) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1060,8 +1060,8 @@ moduleFactories.add({
|
|
|
1060
1060
|
return list.push(header.substring(start, end)), list;
|
|
1061
1061
|
}
|
|
1062
1062
|
},
|
|
1063
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1064
|
-
let { EMPTY_BUFFER } = rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
1063
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/buffer-util.js" (module) {
|
|
1064
|
+
let { websocketMask, websocketUnmask } = __rspack_createRequire_require("http"), { EMPTY_BUFFER } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/constants.js"), FastBuffer = Buffer[Symbol.species];
|
|
1065
1065
|
function _mask(source, mask, output, offset, length) {
|
|
1066
1066
|
for(let i = 0; i < length; i++)output[offset + i] = source[i] ^ mask[3 & i];
|
|
1067
1067
|
}
|
|
@@ -1089,7 +1089,12 @@ moduleFactories.add({
|
|
|
1089
1089
|
},
|
|
1090
1090
|
toBuffer,
|
|
1091
1091
|
unmask: _unmask
|
|
1092
|
-
},
|
|
1092
|
+
}, websocketMask) module.exports.mask = function(source, mask, output, offset, length) {
|
|
1093
|
+
length < 24 ? _mask(source, mask, output, offset, length) : websocketMask(source, mask, output, offset, length);
|
|
1094
|
+
}, module.exports.unmask = function(buffer, mask) {
|
|
1095
|
+
buffer.length < 24 ? _unmask(buffer, mask) : websocketUnmask(buffer, mask);
|
|
1096
|
+
};
|
|
1097
|
+
else if (!process.env.WS_NO_BUFFER_UTIL) try {
|
|
1093
1098
|
let bufferUtil = rspackRequire(Object(function() {
|
|
1094
1099
|
var e = Error("Cannot find module 'bufferutil'");
|
|
1095
1100
|
throw e.code = 'MODULE_NOT_FOUND', e;
|
|
@@ -1101,7 +1106,7 @@ moduleFactories.add({
|
|
|
1101
1106
|
};
|
|
1102
1107
|
} catch (e) {}
|
|
1103
1108
|
},
|
|
1104
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1109
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/constants.js" (module) {
|
|
1105
1110
|
let BINARY_TYPES = [
|
|
1106
1111
|
'nodebuffer',
|
|
1107
1112
|
'arraybuffer',
|
|
@@ -1120,8 +1125,8 @@ moduleFactories.add({
|
|
|
1120
1125
|
NOOP: ()=>{}
|
|
1121
1126
|
};
|
|
1122
1127
|
},
|
|
1123
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1124
|
-
let { kForOnEventAttribute, kListener } = rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
1128
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/event-target.js" (module) {
|
|
1129
|
+
let { kForOnEventAttribute, kListener } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/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');
|
|
1125
1130
|
class Event {
|
|
1126
1131
|
constructor(type){
|
|
1127
1132
|
this[kTarget] = null, this[kType] = type;
|
|
@@ -1236,8 +1241,8 @@ moduleFactories.add({
|
|
|
1236
1241
|
MessageEvent
|
|
1237
1242
|
};
|
|
1238
1243
|
},
|
|
1239
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1240
|
-
let { tokenChars } = rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
1244
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/extension.js" (module) {
|
|
1245
|
+
let { tokenChars } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/validation.js");
|
|
1241
1246
|
function push(dest, name, elem) {
|
|
1242
1247
|
void 0 === dest[name] ? dest[name] = [
|
|
1243
1248
|
elem
|
|
@@ -1299,7 +1304,7 @@ moduleFactories.add({
|
|
|
1299
1304
|
}
|
|
1300
1305
|
};
|
|
1301
1306
|
},
|
|
1302
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1307
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/limiter.js" (module) {
|
|
1303
1308
|
let kDone = Symbol('kDone'), kRun = Symbol('kRun');
|
|
1304
1309
|
module.exports = class {
|
|
1305
1310
|
constructor(concurrency){
|
|
@@ -1318,8 +1323,8 @@ moduleFactories.add({
|
|
|
1318
1323
|
}
|
|
1319
1324
|
};
|
|
1320
1325
|
},
|
|
1321
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1322
|
-
let zlibLimiter, zlib = __rspack_createRequire_require("zlib"), bufferUtil = rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
1326
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/permessage-deflate.js" (module) {
|
|
1327
|
+
let zlibLimiter, zlib = __rspack_createRequire_require("zlib"), bufferUtil = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/buffer-util.js"), Limiter = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/limiter.js"), { kStatusCode } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/constants.js"), FastBuffer = Buffer[Symbol.species], TRAILER = Buffer.from([
|
|
1323
1328
|
0x00,
|
|
1324
1329
|
0x00,
|
|
1325
1330
|
0xff,
|
|
@@ -1439,8 +1444,8 @@ moduleFactories.add({
|
|
|
1439
1444
|
}
|
|
1440
1445
|
};
|
|
1441
1446
|
},
|
|
1442
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1443
|
-
let { Writable } = __rspack_createRequire_require("stream"), PerMessageDeflate = rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
1447
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/receiver.js" (module) {
|
|
1448
|
+
let { Writable } = __rspack_createRequire_require("stream"), PerMessageDeflate = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/permessage-deflate.js"), { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/constants.js"), { concat, toArrayBuffer, unmask } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/buffer-util.js"), { isValidStatusCode, isValidUTF8 } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/validation.js"), FastBuffer = Buffer[Symbol.species];
|
|
1444
1449
|
module.exports = class extends Writable {
|
|
1445
1450
|
constructor(options = {}){
|
|
1446
1451
|
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;
|
|
@@ -1609,8 +1614,8 @@ moduleFactories.add({
|
|
|
1609
1614
|
}
|
|
1610
1615
|
};
|
|
1611
1616
|
},
|
|
1612
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
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.
|
|
1617
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/sender.js" (module) {
|
|
1618
|
+
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.1/node_modules/ws/lib/permessage-deflate.js"), { EMPTY_BUFFER, kWebSocket, NOOP } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/constants.js"), { isBlob, isValidStatusCode } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/validation.js"), { mask: applyMask, toBuffer } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/buffer-util.js"), kByteLength = Symbol('kByteLength'), maskBuffer = Buffer.alloc(4), randomPoolPointer = 8192;
|
|
1614
1619
|
function callCallbacks(sender, err, cb) {
|
|
1615
1620
|
'function' == typeof cb && cb(err);
|
|
1616
1621
|
for(let i = 0; i < sender._queue.length; i++){
|
|
@@ -1631,7 +1636,7 @@ moduleFactories.add({
|
|
|
1631
1636
|
let payloadLength = dataLength;
|
|
1632
1637
|
dataLength >= 65536 ? (offset += 8, payloadLength = 127) : dataLength > 125 && (offset += 2, payloadLength = 126);
|
|
1633
1638
|
let target = Buffer.allocUnsafe(merge ? dataLength + offset : offset);
|
|
1634
|
-
return (target[0] = options.fin ? 0x80 | options.opcode : options.opcode, options.rsv1 && (target[0] |= 0x40), target[1] = payloadLength, 126 === payloadLength ? target.writeUInt16BE(dataLength, 2) : 127 === payloadLength && (target[2] = target[3] = 0, target.writeUIntBE(dataLength, 4, 6)), options.mask) ? (target[1] |= 0x80, target[offset - 4] = mask[0], target[offset - 3] = mask[1], target[offset - 2] = mask[2], target[offset - 1] = mask[3],
|
|
1639
|
+
return (target[0] = options.fin ? 0x80 | options.opcode : options.opcode, options.rsv1 && (target[0] |= 0x40), target[1] = payloadLength, 126 === payloadLength ? target.writeUInt16BE(dataLength, 2) : 127 === payloadLength && (target[2] = target[3] = 0, target.writeUIntBE(dataLength, 4, 6)), options.mask) ? (target[1] |= 0x80, target[offset - 4] = mask[0], target[offset - 3] = mask[1], target[offset - 2] = mask[2], target[offset - 1] = mask[3], dataLength) ? skipMasking ? [
|
|
1635
1640
|
target,
|
|
1636
1641
|
data
|
|
1637
1642
|
] : merge ? (applyMask(data, mask, target, offset, dataLength), [
|
|
@@ -1640,8 +1645,12 @@ moduleFactories.add({
|
|
|
1640
1645
|
target,
|
|
1641
1646
|
data
|
|
1642
1647
|
]) : [
|
|
1648
|
+
target
|
|
1649
|
+
] : dataLength ? [
|
|
1643
1650
|
target,
|
|
1644
1651
|
data
|
|
1652
|
+
] : [
|
|
1653
|
+
target
|
|
1645
1654
|
];
|
|
1646
1655
|
}
|
|
1647
1656
|
close(code, data, mask, cb) {
|
|
@@ -1789,8 +1798,8 @@ moduleFactories.add({
|
|
|
1789
1798
|
}
|
|
1790
1799
|
};
|
|
1791
1800
|
},
|
|
1792
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1793
|
-
rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
1801
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/stream.js" (module) {
|
|
1802
|
+
rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/websocket.js");
|
|
1794
1803
|
let { Duplex } = __rspack_createRequire_require("stream");
|
|
1795
1804
|
function emitClose(stream) {
|
|
1796
1805
|
stream.emit('close');
|
|
@@ -1842,8 +1851,8 @@ moduleFactories.add({
|
|
|
1842
1851
|
}, duplex.on('end', duplexOnEnd), duplex.on('error', duplexOnError), duplex;
|
|
1843
1852
|
};
|
|
1844
1853
|
},
|
|
1845
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1846
|
-
let { tokenChars } = rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
1854
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/subprotocol.js" (module) {
|
|
1855
|
+
let { tokenChars } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/validation.js");
|
|
1847
1856
|
module.exports = {
|
|
1848
1857
|
parse: function(header) {
|
|
1849
1858
|
let protocols = new Set(), start = -1, end = -1, i = 0;
|
|
@@ -1866,8 +1875,8 @@ moduleFactories.add({
|
|
|
1866
1875
|
}
|
|
1867
1876
|
};
|
|
1868
1877
|
},
|
|
1869
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
1870
|
-
let { isUtf8 } = __rspack_createRequire_require("buffer"), { hasBlob } = rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
1878
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/validation.js" (module) {
|
|
1879
|
+
let { isUtf8 } = __rspack_createRequire_require("buffer"), { hasBlob } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/constants.js");
|
|
1871
1880
|
function _isValidUTF8(buf) {
|
|
1872
1881
|
let len = buf.length, i = 0;
|
|
1873
1882
|
for(; i < len;)if ((0x80 & buf[i]) == 0) i++;
|
|
@@ -2034,8 +2043,8 @@ moduleFactories.add({
|
|
|
2034
2043
|
};
|
|
2035
2044
|
} catch (e) {}
|
|
2036
2045
|
},
|
|
2037
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
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.
|
|
2046
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/websocket-server.js" (module) {
|
|
2047
|
+
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.1/node_modules/ws/lib/extension.js"), PerMessageDeflate = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/permessage-deflate.js"), subprotocol = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/subprotocol.js"), WebSocket = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/websocket.js"), { CLOSE_TIMEOUT, GUID, kWebSocket } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/constants.js"), keyRegex = /^[+/0-9A-Za-z]{22}==$/;
|
|
2039
2048
|
function emitClose(server) {
|
|
2040
2049
|
server._state = 2, server.emit('close');
|
|
2041
2050
|
}
|
|
@@ -2208,8 +2217,8 @@ moduleFactories.add({
|
|
|
2208
2217
|
}
|
|
2209
2218
|
};
|
|
2210
2219
|
},
|
|
2211
|
-
"../../node_modules/.pnpm/ws@8.22.
|
|
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.
|
|
2220
|
+
"../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/websocket.js" (module) {
|
|
2221
|
+
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.1/node_modules/ws/lib/permessage-deflate.js"), Receiver = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/receiver.js"), Sender = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/sender.js"), { isBlob } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/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.1/node_modules/ws/lib/constants.js"), { EventTarget: { addEventListener, removeEventListener } } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/event-target.js"), { format, parse } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/extension.js"), { toBuffer } = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/buffer-util.js"), kAborted = Symbol('kAborted'), protocolVersions = [
|
|
2213
2222
|
8,
|
|
2214
2223
|
13
|
|
2215
2224
|
], readyStates = [
|
|
@@ -2285,8 +2294,8 @@ moduleFactories.add({
|
|
|
2285
2294
|
opts.headers['Sec-WebSocket-Protocol'] = protocols.join(',');
|
|
2286
2295
|
}
|
|
2287
2296
|
if (opts.origin && (opts.protocolVersion < 13 ? opts.headers['Sec-WebSocket-Origin'] = opts.origin : opts.headers.Origin = opts.origin), (parsedUrl.username || parsedUrl.password) && (opts.auth = `${parsedUrl.username}:${parsedUrl.password}`), isIpcUrl) {
|
|
2288
|
-
let
|
|
2289
|
-
opts.socketPath =
|
|
2297
|
+
let i = opts.path.indexOf(':');
|
|
2298
|
+
-1 === i ? (opts.socketPath = opts.path, opts.path = '') : (opts.socketPath = opts.path.slice(0, i), opts.path = opts.path.slice(i + 1));
|
|
2290
2299
|
}
|
|
2291
2300
|
if (opts.followRedirects) {
|
|
2292
2301
|
if (0 === websocket._redirects) {
|
|
@@ -3217,8 +3226,8 @@ function build(dir, opts = {}) {
|
|
|
3217
3226
|
}(req, res, data.abs, data.stats, data.headers)) : next ? next() : isNotFound(req, res);
|
|
3218
3227
|
};
|
|
3219
3228
|
}
|
|
3220
|
-
rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
3221
|
-
let websocket = rspackRequire("../../node_modules/.pnpm/ws@8.22.
|
|
3229
|
+
rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/stream.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/extension.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/permessage-deflate.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/receiver.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/sender.js"), rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/subprotocol.js");
|
|
3230
|
+
let websocket = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/websocket.js"), websocket_server = rspackRequire("../../node_modules/.pnpm/ws@8.22.1/node_modules/ws/lib/websocket-server.js");
|
|
3222
3231
|
class SocketAPILoader {
|
|
3223
3232
|
constructor(options){
|
|
3224
3233
|
this.options = options, this.dataLoader = new Data.APIDataLoader(this);
|
|
@@ -3912,33 +3921,7 @@ let execAsync = promisify(exec), supportedChromiumBrowsers = [
|
|
|
3912
3921
|
'Brave Browser',
|
|
3913
3922
|
'Vivaldi',
|
|
3914
3923
|
'Chromium'
|
|
3915
|
-
],
|
|
3916
|
-
let targetBrowser = process.env.BROWSER;
|
|
3917
|
-
if (!targetBrowser || !supportedChromiumBrowsers.includes(targetBrowser)) {
|
|
3918
|
-
let { stdout: ps } = await execAsync('ps cax');
|
|
3919
|
-
targetBrowser = supportedChromiumBrowsers.find((b)=>ps.includes(b));
|
|
3920
|
-
}
|
|
3921
|
-
return targetBrowser;
|
|
3922
|
-
}, openWithDefaultBrowser = async (url)=>{
|
|
3923
|
-
try {
|
|
3924
|
-
return await node_modules_open(url), !0;
|
|
3925
|
-
} catch (err) {
|
|
3926
|
-
return rsdoctorLogger.error('Failed to open Rsdoctor URL.'), rsdoctorLogger.error(err), !1;
|
|
3927
|
-
}
|
|
3928
|
-
};
|
|
3929
|
-
async function openBrowser(url, needEncodeURI = !0) {
|
|
3930
|
-
if ('darwin' === process.platform) try {
|
|
3931
|
-
let targetBrowser = await getTargetBrowser();
|
|
3932
|
-
if (targetBrowser) return await execAsync(`osascript openChrome.applescript "${needEncodeURI ? encodeURI(url) : url}" "${targetBrowser}"`, {
|
|
3933
|
-
cwd: join(__rspack_import_meta_dirname__, '../static')
|
|
3934
|
-
}), !0;
|
|
3935
|
-
rsdoctorLogger.debug('Failed to find the target browser.');
|
|
3936
|
-
} catch (err) {
|
|
3937
|
-
rsdoctorLogger.debug("Failed to open Rsdoctor URL with apple script."), rsdoctorLogger.debug(err);
|
|
3938
|
-
}
|
|
3939
|
-
return openWithDefaultBrowser(url);
|
|
3940
|
-
}
|
|
3941
|
-
let bytes_0 = rspackRequire("../../node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/index.js"), http_errors = rspackRequire("../../node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js");
|
|
3924
|
+
], bytes_0 = rspackRequire("../../node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/index.js"), http_errors = rspackRequire("../../node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js");
|
|
3942
3925
|
function entityTooLargeError(props) {
|
|
3943
3926
|
return props.type = 'entity.too.large', http_errors(413, 'request entity too large', props);
|
|
3944
3927
|
}
|
|
@@ -4397,7 +4380,31 @@ class RsdoctorServer {
|
|
|
4397
4380
|
}
|
|
4398
4381
|
async openClientPage(...args) {
|
|
4399
4382
|
let relativeUrl = this.getClientUrl(...args), needEncodeURI = args[0] === Client.RsdoctorClientRoutes.BundleDiff, url = `http://${this.host}:${this.port}${relativeUrl}`, localhostUrl = `http://localhost:${this.port}${relativeUrl}`;
|
|
4400
|
-
await
|
|
4383
|
+
!1 !== args[1] && await async function(url, needEncodeURI = !0) {
|
|
4384
|
+
if ('darwin' === process.platform) try {
|
|
4385
|
+
let targetBrowser = await (async ()=>{
|
|
4386
|
+
let targetBrowser = process.env.BROWSER;
|
|
4387
|
+
if (!targetBrowser || !supportedChromiumBrowsers.includes(targetBrowser)) {
|
|
4388
|
+
let { stdout: ps } = await execAsync('ps cax');
|
|
4389
|
+
targetBrowser = supportedChromiumBrowsers.find((b)=>ps.includes(b));
|
|
4390
|
+
}
|
|
4391
|
+
return targetBrowser;
|
|
4392
|
+
})();
|
|
4393
|
+
if (targetBrowser) return await execAsync(`osascript openChrome.applescript "${needEncodeURI ? encodeURI(url) : url}" "${targetBrowser}"`, {
|
|
4394
|
+
cwd: join(__rspack_import_meta_dirname__, '../static')
|
|
4395
|
+
}), !0;
|
|
4396
|
+
rsdoctorLogger.debug('Failed to find the target browser.');
|
|
4397
|
+
} catch (err) {
|
|
4398
|
+
rsdoctorLogger.debug("Failed to open Rsdoctor URL with apple script."), rsdoctorLogger.debug(err);
|
|
4399
|
+
}
|
|
4400
|
+
return (async (url)=>{
|
|
4401
|
+
try {
|
|
4402
|
+
return await node_modules_open(url), !0;
|
|
4403
|
+
} catch (err) {
|
|
4404
|
+
return rsdoctorLogger.error('Failed to open Rsdoctor URL.'), rsdoctorLogger.error(err), !1;
|
|
4405
|
+
}
|
|
4406
|
+
})(url);
|
|
4407
|
+
}(localhostUrl, !needEncodeURI), this._printServerUrl && rsdoctorLogger.info(`Analyzer running on: ${color.cyan(url)}`);
|
|
4401
4408
|
}
|
|
4402
4409
|
sendAPIDataToClient(api, msg) {
|
|
4403
4410
|
this._socket?.sendAPIData(api, msg);
|
|
@@ -4619,41 +4626,6 @@ function findRoot(startDir = process.cwd()) {
|
|
|
4619
4626
|
}
|
|
4620
4627
|
return firstPkgDir || null;
|
|
4621
4628
|
}
|
|
4622
|
-
async function writeManifestShards(jsonFragments, folder, options = {}) {
|
|
4623
|
-
if (0 === jsonFragments.length) throw Error('Cannot write empty JSON fragments.');
|
|
4624
|
-
let { index = 0, shardSize = 10485760, compressionLevel } = options;
|
|
4625
|
-
if (!Number.isSafeInteger(shardSize) || shardSize <= 0) throw Error('Manifest shard size must be a positive integer.');
|
|
4626
|
-
if (void 0 !== compressionLevel && (!Number.isInteger(compressionLevel) || compressionLevel < 0 || compressionLevel > 9)) throw RangeError('`compressionLevel` must be an integer between 0 and 9.');
|
|
4627
|
-
await node_fs_promises.mkdir(folder, {
|
|
4628
|
-
recursive: !0
|
|
4629
|
-
});
|
|
4630
|
-
let files = [], shardParts = [], shardLength = 0, flushShard = async ()=>{
|
|
4631
|
-
if (0 === shardLength) return;
|
|
4632
|
-
let basename = String(index + files.length), filePath = node_path.resolve(folder, basename);
|
|
4633
|
-
await node_fs_promises.writeFile(filePath, shardParts.join(''), 'utf8'), files.push({
|
|
4634
|
-
path: filePath,
|
|
4635
|
-
basename
|
|
4636
|
-
}), shardParts = [], shardLength = 0;
|
|
4637
|
-
}, appendEncodedText = async (encodedText)=>{
|
|
4638
|
-
let offset = 0;
|
|
4639
|
-
for(; offset < encodedText.length;){
|
|
4640
|
-
let length = Math.min(shardSize - shardLength, encodedText.length - offset);
|
|
4641
|
-
shardParts.push(encodedText.slice(offset, offset + length)), shardLength += length, offset += length, shardLength === shardSize && await flushShard();
|
|
4642
|
-
}
|
|
4643
|
-
}, compressor = Readable.from(jsonFragments, {
|
|
4644
|
-
objectMode: !1
|
|
4645
|
-
}).pipe(createDeflate(void 0 === compressionLevel ? void 0 : {
|
|
4646
|
-
level: compressionLevel
|
|
4647
|
-
})), base64Remainder = Buffer.alloc(0);
|
|
4648
|
-
for await (let chunk of compressor){
|
|
4649
|
-
let compressedChunk = Buffer.from(chunk), bytes = base64Remainder.length ? Buffer.concat([
|
|
4650
|
-
base64Remainder,
|
|
4651
|
-
compressedChunk
|
|
4652
|
-
]) : compressedChunk, encodableLength = bytes.length - bytes.length % 3;
|
|
4653
|
-
encodableLength > 0 && await appendEncodedText(bytes.subarray(0, encodableLength).toString('base64')), base64Remainder = Buffer.from(bytes.subarray(encodableLength));
|
|
4654
|
-
}
|
|
4655
|
-
return base64Remainder.length > 0 && await appendEncodedText(base64Remainder.toString('base64')), await flushShard(), files;
|
|
4656
|
-
}
|
|
4657
4629
|
String((date = new Date()).getMonth() + 1).padStart(2, '0'), String(date.getDate()).padStart(2, '0'), date.getFullYear();
|
|
4658
4630
|
var lib_0_default = compatGetDefaultExport(rspackRequire("../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/index.js"));
|
|
4659
4631
|
class SDKCore {
|
|
@@ -4783,7 +4755,41 @@ class SDKCore {
|
|
|
4783
4755
|
let folder = node_path.resolve(dir, key);
|
|
4784
4756
|
return {
|
|
4785
4757
|
name: key,
|
|
4786
|
-
files: await
|
|
4758
|
+
files: await async function(jsonFragments, folder, options = {}) {
|
|
4759
|
+
if (0 === jsonFragments.length) throw Error('Cannot write empty JSON fragments.');
|
|
4760
|
+
let { index = 0, shardSize = 10485760, compressionLevel } = options;
|
|
4761
|
+
if (!Number.isSafeInteger(shardSize) || shardSize <= 0) throw Error('Manifest shard size must be a positive integer.');
|
|
4762
|
+
if (void 0 !== compressionLevel && (!Number.isInteger(compressionLevel) || compressionLevel < 0 || compressionLevel > 9)) throw RangeError('`compressionLevel` must be an integer between 0 and 9.');
|
|
4763
|
+
await node_fs_promises.mkdir(folder, {
|
|
4764
|
+
recursive: !0
|
|
4765
|
+
});
|
|
4766
|
+
let files = [], shardParts = [], shardLength = 0, flushShard = async ()=>{
|
|
4767
|
+
if (0 === shardLength) return;
|
|
4768
|
+
let basename = String(index + files.length), filePath = node_path.resolve(folder, basename);
|
|
4769
|
+
await node_fs_promises.writeFile(filePath, shardParts.join(''), 'utf8'), files.push({
|
|
4770
|
+
path: filePath,
|
|
4771
|
+
basename
|
|
4772
|
+
}), shardParts = [], shardLength = 0;
|
|
4773
|
+
}, appendEncodedText = async (encodedText)=>{
|
|
4774
|
+
let offset = 0;
|
|
4775
|
+
for(; offset < encodedText.length;){
|
|
4776
|
+
let length = Math.min(shardSize - shardLength, encodedText.length - offset);
|
|
4777
|
+
shardParts.push(encodedText.slice(offset, offset + length)), shardLength += length, offset += length, shardLength === shardSize && await flushShard();
|
|
4778
|
+
}
|
|
4779
|
+
}, compressor = Readable.from(jsonFragments, {
|
|
4780
|
+
objectMode: !1
|
|
4781
|
+
}).pipe(createDeflate(void 0 === compressionLevel ? void 0 : {
|
|
4782
|
+
level: compressionLevel
|
|
4783
|
+
})), base64Remainder = Buffer.alloc(0);
|
|
4784
|
+
for await (let chunk of compressor){
|
|
4785
|
+
let compressedChunk = Buffer.from(chunk), bytes = base64Remainder.length ? Buffer.concat([
|
|
4786
|
+
base64Remainder,
|
|
4787
|
+
compressedChunk
|
|
4788
|
+
]) : compressedChunk, encodableLength = bytes.length - bytes.length % 3;
|
|
4789
|
+
encodableLength > 0 && await appendEncodedText(bytes.subarray(0, encodableLength).toString('base64')), base64Remainder = Buffer.from(bytes.subarray(encodableLength));
|
|
4790
|
+
}
|
|
4791
|
+
return base64Remainder.length > 0 && await appendEncodedText(base64Remainder.toString('base64')), await flushShard(), files;
|
|
4792
|
+
}(jsonFragments, folder, {
|
|
4787
4793
|
index,
|
|
4788
4794
|
compressionLevel
|
|
4789
4795
|
})
|
|
@@ -5305,7 +5311,7 @@ class RsdoctorSDKController {
|
|
|
5305
5311
|
return this.slaves.filter((item)=>this.activeSlaves.has(item));
|
|
5306
5312
|
}
|
|
5307
5313
|
}
|
|
5308
|
-
var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/core","version":"2.0.
|
|
5314
|
+
var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/core","version":"2.0.2","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:*","@swc-next/parser":"0.3.0","caniuse-lite":"^1.0.30001820","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","babel-loader":"10.1.1","browserslist-load-config":"^1.0.4","connect-next":"catalog:","cors":"2.8.6","envinfo":"7.21.0","estree-walker":"3.0.3","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.6","string-loader":"0.0.1","ts-loader":"^9.6.2","typescript":"catalog:","ws":"8.22.1"},"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/"}}');
|
|
5309
5315
|
let pluginTapName = 'RsdoctorRspackPlugin', pluginTapPostOptions = {
|
|
5310
5316
|
name: pluginTapName,
|
|
5311
5317
|
stage: 999
|
|
@@ -5346,7 +5352,7 @@ class RsdoctorRspackPlugin {
|
|
|
5346
5352
|
Manifest.RsdoctorManifestClientRoutes.Overall
|
|
5347
5353
|
]), context.sdk instanceof RsdoctorPrimarySDK ? context.sdk.setOutputDir(context.sdk.parent.getCompilerOutputDir(context.sdk)) : context.sdk.setOutputDir(this.getOutputDir(compiler)), await context.sdk.writeStore(getWriteStoreOptions(compiler));
|
|
5348
5354
|
let isPrimaryCompiler = !(context.sdk instanceof RsdoctorPrimarySDK) || context.sdk.isMaster;
|
|
5349
|
-
this.options.disableClientServer || !isPrimaryCompiler || context.hasOpenedClientAutomatically || (context.hasOpenedClientAutomatically = !0, this.options.output.mode === SDK.IMode[SDK.IMode.brief] ? await handleBriefModeReport(context.sdk, this.options, this.options.disableClientServer) : await context.sdk.server.openClientPage('homepage')), this.shouldDisposeSDK() && await this.disposeSDK(context, bootstrapTask);
|
|
5355
|
+
this.options.disableClientServer || !isPrimaryCompiler || context.hasOpenedClientAutomatically || (context.hasOpenedClientAutomatically = !0, this.options.output.mode === SDK.IMode[SDK.IMode.brief] ? await handleBriefModeReport(context.sdk, this.options, this.options.disableClientServer, this.options.autoOpenBrowser) : await context.sdk.server.openClientPage('homepage', this.options.autoOpenBrowser)), this.shouldDisposeSDK() && await this.disposeSDK(context, bootstrapTask);
|
|
5350
5356
|
} finally{
|
|
5351
5357
|
timeEnd('RsdoctorRspackPlugin.done');
|
|
5352
5358
|
}
|
|
@@ -5531,7 +5537,7 @@ class RsdoctorRspackPlugin {
|
|
|
5531
5537
|
});
|
|
5532
5538
|
}
|
|
5533
5539
|
registerChildCompiler(parentCompiler, childCompiler, compilerName, compilerIndex, parentContext) {
|
|
5534
|
-
if (!(parentContext.sdk instanceof RsdoctorPrimarySDK) || this.shouldIgnoreChildCompiler(childCompiler, compilerName)) return;
|
|
5540
|
+
if (this.removeInheritedRsdoctorTaps(childCompiler), !(parentContext.sdk instanceof RsdoctorPrimarySDK) || !this.options.multiCompiler.enabled || this.shouldIgnoreChildCompiler(childCompiler, compilerName)) return;
|
|
5535
5541
|
let parentSDK = parentContext.sdk, controller = parentSDK.parent, compilerPath = childCompiler.compilerPath || `${parentCompiler.compilerPath}${compilerName}|${compilerIndex}|`, childKey = `${parentSDK.id}:${compilerPath}`, registeredChild = this.childPlugins.get(childKey);
|
|
5536
5542
|
if (registeredChild?.compiler === childCompiler) return;
|
|
5537
5543
|
controller.setOutputDir(parentSDK, this.getOutputDir(parentCompiler));
|
|
@@ -5550,9 +5556,7 @@ class RsdoctorRspackPlugin {
|
|
|
5550
5556
|
return sdk.dependencies = [
|
|
5551
5557
|
parentSDK.name
|
|
5552
5558
|
], sdk;
|
|
5553
|
-
})()
|
|
5554
|
-
this.removeInheritedRsdoctorTaps(childCompiler);
|
|
5555
|
-
let childPlugin = new RsdoctorRspackPlugin({
|
|
5559
|
+
})(), childPlugin = new RsdoctorRspackPlugin({
|
|
5556
5560
|
...this.childOptions,
|
|
5557
5561
|
sdkInstance: childSDK
|
|
5558
5562
|
});
|
|
@@ -5562,7 +5566,8 @@ class RsdoctorRspackPlugin {
|
|
|
5562
5566
|
}), childPlugin.apply(childCompiler);
|
|
5563
5567
|
}
|
|
5564
5568
|
shouldIgnoreChildCompiler(childCompiler, compilerName) {
|
|
5565
|
-
|
|
5569
|
+
let ignoredNames = this.options.multiCompiler.ignoreChildCompilers;
|
|
5570
|
+
return !!childCompiler.name && (ignoredChildCompilerNames.has(childCompiler.name) || ignoredNames.includes(childCompiler.name)) || ignoredChildCompilerNames.has(compilerName) || ignoredNames.includes(compilerName);
|
|
5566
5571
|
}
|
|
5567
5572
|
getChildCompilerDisplayName(name, compilerIndex) {
|
|
5568
5573
|
if (!name) return `Child compiler ${compilerIndex}`;
|