@vitejs/devtools-rpc 0.0.0-alpha.22 → 0.0.0-alpha.23
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.
|
@@ -31,7 +31,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
34
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/constants.js
|
|
35
35
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
36
36
|
const BINARY_TYPES = [
|
|
37
37
|
"nodebuffer",
|
|
@@ -42,6 +42,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
42
42
|
if (hasBlob) BINARY_TYPES.push("blob");
|
|
43
43
|
module.exports = {
|
|
44
44
|
BINARY_TYPES,
|
|
45
|
+
CLOSE_TIMEOUT: 3e4,
|
|
45
46
|
EMPTY_BUFFER: Buffer.alloc(0),
|
|
46
47
|
GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
|
|
47
48
|
hasBlob,
|
|
@@ -54,7 +55,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
54
55
|
}));
|
|
55
56
|
|
|
56
57
|
//#endregion
|
|
57
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
58
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/buffer-util.js
|
|
58
59
|
var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
59
60
|
const { EMPTY_BUFFER } = require_constants();
|
|
60
61
|
const FastBuffer = Buffer[Symbol.species];
|
|
@@ -155,7 +156,7 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
155
156
|
}));
|
|
156
157
|
|
|
157
158
|
//#endregion
|
|
158
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
159
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/limiter.js
|
|
159
160
|
var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
160
161
|
const kDone = Symbol("kDone");
|
|
161
162
|
const kRun = Symbol("kRun");
|
|
@@ -207,7 +208,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
207
208
|
}));
|
|
208
209
|
|
|
209
210
|
//#endregion
|
|
210
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
211
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/permessage-deflate.js
|
|
211
212
|
var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
212
213
|
const zlib = __require("zlib");
|
|
213
214
|
const bufferUtil = require_buffer_util();
|
|
@@ -541,7 +542,7 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
541
542
|
}));
|
|
542
543
|
|
|
543
544
|
//#endregion
|
|
544
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
545
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/validation.js
|
|
545
546
|
var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
546
547
|
const { isUtf8 } = __require("buffer");
|
|
547
548
|
const { hasBlob } = require_constants();
|
|
@@ -738,7 +739,7 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
738
739
|
}));
|
|
739
740
|
|
|
740
741
|
//#endregion
|
|
741
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
742
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/receiver.js
|
|
742
743
|
var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
743
744
|
const { Writable } = __require("stream");
|
|
744
745
|
const PerMessageDeflate = require_permessage_deflate();
|
|
@@ -1186,7 +1187,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1186
1187
|
}));
|
|
1187
1188
|
|
|
1188
1189
|
//#endregion
|
|
1189
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
1190
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/sender.js
|
|
1190
1191
|
var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1191
1192
|
const { Duplex: Duplex$3 } = __require("stream");
|
|
1192
1193
|
const { randomFillSync } = __require("crypto");
|
|
@@ -1682,7 +1683,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1682
1683
|
}));
|
|
1683
1684
|
|
|
1684
1685
|
//#endregion
|
|
1685
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
1686
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/event-target.js
|
|
1686
1687
|
var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1687
1688
|
const { kForOnEventAttribute, kListener } = require_constants();
|
|
1688
1689
|
const kCode = Symbol("kCode");
|
|
@@ -1902,7 +1903,7 @@ var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1902
1903
|
}));
|
|
1903
1904
|
|
|
1904
1905
|
//#endregion
|
|
1905
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
1906
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/extension.js
|
|
1906
1907
|
var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1907
1908
|
const { tokenChars } = require_validation();
|
|
1908
1909
|
/**
|
|
@@ -2046,7 +2047,7 @@ var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2046
2047
|
}));
|
|
2047
2048
|
|
|
2048
2049
|
//#endregion
|
|
2049
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
2050
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket.js
|
|
2050
2051
|
var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2051
2052
|
const EventEmitter$1 = __require("events");
|
|
2052
2053
|
const https = __require("https");
|
|
@@ -2060,11 +2061,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2060
2061
|
const Receiver = require_receiver();
|
|
2061
2062
|
const Sender = require_sender();
|
|
2062
2063
|
const { isBlob } = require_validation();
|
|
2063
|
-
const { BINARY_TYPES, EMPTY_BUFFER, GUID, kForOnEventAttribute, kListener, kStatusCode, kWebSocket, NOOP } = require_constants();
|
|
2064
|
+
const { BINARY_TYPES, CLOSE_TIMEOUT, EMPTY_BUFFER, GUID, kForOnEventAttribute, kListener, kStatusCode, kWebSocket, NOOP } = require_constants();
|
|
2064
2065
|
const { EventTarget: { addEventListener, removeEventListener } } = require_event_target();
|
|
2065
2066
|
const { format, parse } = require_extension();
|
|
2066
2067
|
const { toBuffer } = require_buffer_util();
|
|
2067
|
-
const closeTimeout = 30 * 1e3;
|
|
2068
2068
|
const kAborted = Symbol("kAborted");
|
|
2069
2069
|
const protocolVersions = [8, 13];
|
|
2070
2070
|
const readyStates = [
|
|
@@ -2115,6 +2115,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2115
2115
|
initAsClient(this, address, protocols, options);
|
|
2116
2116
|
} else {
|
|
2117
2117
|
this._autoPong = options.autoPong;
|
|
2118
|
+
this._closeTimeout = options.closeTimeout;
|
|
2118
2119
|
this._isServer = true;
|
|
2119
2120
|
}
|
|
2120
2121
|
}
|
|
@@ -2535,6 +2536,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2535
2536
|
* times in the same tick
|
|
2536
2537
|
* @param {Boolean} [options.autoPong=true] Specifies whether or not to
|
|
2537
2538
|
* automatically send a pong in response to a ping
|
|
2539
|
+
* @param {Number} [options.closeTimeout=30000] Duration in milliseconds to wait
|
|
2540
|
+
* for the closing handshake to finish after `websocket.close()` is called
|
|
2538
2541
|
* @param {Function} [options.finishRequest] A function which can be used to
|
|
2539
2542
|
* customize the headers of each http request before it is sent
|
|
2540
2543
|
* @param {Boolean} [options.followRedirects=false] Whether or not to follow
|
|
@@ -2561,6 +2564,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2561
2564
|
const opts = {
|
|
2562
2565
|
allowSynchronousEvents: true,
|
|
2563
2566
|
autoPong: true,
|
|
2567
|
+
closeTimeout: CLOSE_TIMEOUT,
|
|
2564
2568
|
protocolVersion: protocolVersions[1],
|
|
2565
2569
|
maxPayload: 100 * 1024 * 1024,
|
|
2566
2570
|
skipUTF8Validation: false,
|
|
@@ -2578,6 +2582,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2578
2582
|
port: void 0
|
|
2579
2583
|
};
|
|
2580
2584
|
websocket._autoPong = opts.autoPong;
|
|
2585
|
+
websocket._closeTimeout = opts.closeTimeout;
|
|
2581
2586
|
if (!protocolVersions.includes(opts.protocolVersion)) throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`);
|
|
2582
2587
|
let parsedUrl;
|
|
2583
2588
|
if (address instanceof URL) parsedUrl = address;
|
|
@@ -2951,7 +2956,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2951
2956
|
* @private
|
|
2952
2957
|
*/
|
|
2953
2958
|
function setCloseTimer(websocket) {
|
|
2954
|
-
websocket._closeTimer = setTimeout(websocket._socket.destroy.bind(websocket._socket),
|
|
2959
|
+
websocket._closeTimer = setTimeout(websocket._socket.destroy.bind(websocket._socket), websocket._closeTimeout);
|
|
2955
2960
|
}
|
|
2956
2961
|
/**
|
|
2957
2962
|
* The listener of the socket `'close'` event.
|
|
@@ -2964,8 +2969,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2964
2969
|
this.removeListener("data", socketOnData);
|
|
2965
2970
|
this.removeListener("end", socketOnEnd);
|
|
2966
2971
|
websocket._readyState = WebSocket.CLOSING;
|
|
2967
|
-
|
|
2968
|
-
|
|
2972
|
+
if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && this._readableState.length !== 0) {
|
|
2973
|
+
const chunk = this.read(this._readableState.length);
|
|
2974
|
+
websocket._receiver.write(chunk);
|
|
2975
|
+
}
|
|
2969
2976
|
websocket._receiver.end();
|
|
2970
2977
|
this[kWebSocket] = void 0;
|
|
2971
2978
|
clearTimeout(websocket._closeTimer);
|
|
@@ -3012,7 +3019,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3012
3019
|
}));
|
|
3013
3020
|
|
|
3014
3021
|
//#endregion
|
|
3015
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
3022
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/stream.js
|
|
3016
3023
|
var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3017
3024
|
require_websocket();
|
|
3018
3025
|
const { Duplex: Duplex$1 } = __require("stream");
|
|
@@ -3129,7 +3136,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3129
3136
|
}));
|
|
3130
3137
|
|
|
3131
3138
|
//#endregion
|
|
3132
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
3139
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/subprotocol.js
|
|
3133
3140
|
var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3134
3141
|
const { tokenChars } = require_validation();
|
|
3135
3142
|
/**
|
|
@@ -3169,7 +3176,7 @@ var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3169
3176
|
}));
|
|
3170
3177
|
|
|
3171
3178
|
//#endregion
|
|
3172
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
3179
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket-server.js
|
|
3173
3180
|
var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3174
3181
|
const EventEmitter = __require("events");
|
|
3175
3182
|
const http = __require("http");
|
|
@@ -3179,7 +3186,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
3179
3186
|
const PerMessageDeflate = require_permessage_deflate();
|
|
3180
3187
|
const subprotocol = require_subprotocol();
|
|
3181
3188
|
const WebSocket = require_websocket();
|
|
3182
|
-
const { GUID, kWebSocket } = require_constants();
|
|
3189
|
+
const { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants();
|
|
3183
3190
|
const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
|
|
3184
3191
|
const RUNNING = 0;
|
|
3185
3192
|
const CLOSING = 1;
|
|
@@ -3203,6 +3210,9 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
3203
3210
|
* pending connections
|
|
3204
3211
|
* @param {Boolean} [options.clientTracking=true] Specifies whether or not to
|
|
3205
3212
|
* track clients
|
|
3213
|
+
* @param {Number} [options.closeTimeout=30000] Duration in milliseconds to
|
|
3214
|
+
* wait for the closing handshake to finish after `websocket.close()` is
|
|
3215
|
+
* called
|
|
3206
3216
|
* @param {Function} [options.handleProtocols] A hook to handle protocols
|
|
3207
3217
|
* @param {String} [options.host] The hostname where to bind the server
|
|
3208
3218
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
@@ -3231,6 +3241,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
3231
3241
|
perMessageDeflate: false,
|
|
3232
3242
|
handleProtocols: null,
|
|
3233
3243
|
clientTracking: true,
|
|
3244
|
+
closeTimeout: CLOSE_TIMEOUT,
|
|
3234
3245
|
verifyClient: null,
|
|
3235
3246
|
noServer: false,
|
|
3236
3247
|
backlog: null,
|
|
@@ -3540,7 +3551,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
3540
3551
|
}));
|
|
3541
3552
|
|
|
3542
3553
|
//#endregion
|
|
3543
|
-
//#region ../../node_modules/.pnpm/ws@8.
|
|
3554
|
+
//#region ../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/wrapper.mjs
|
|
3544
3555
|
var import_stream = /* @__PURE__ */ __toESM(require_stream(), 1);
|
|
3545
3556
|
var import_receiver = /* @__PURE__ */ __toESM(require_receiver(), 1);
|
|
3546
3557
|
var import_sender = /* @__PURE__ */ __toESM(require_sender(), 1);
|
|
@@ -3562,7 +3573,8 @@ const createWsRpcPreset = defineRpcServerPreset((options) => {
|
|
|
3562
3573
|
wss.on("connection", (ws, req) => {
|
|
3563
3574
|
const meta = {
|
|
3564
3575
|
id: id++,
|
|
3565
|
-
ws
|
|
3576
|
+
ws,
|
|
3577
|
+
subscribedStates: /* @__PURE__ */ new Set()
|
|
3566
3578
|
};
|
|
3567
3579
|
const channel = {
|
|
3568
3580
|
post: (data) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/devtools-rpc",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-alpha.
|
|
4
|
+
"version": "0.0.0-alpha.23",
|
|
5
5
|
"description": "DevTools rpc for Vite (work in progress)",
|
|
6
6
|
"author": "VoidZero Inc.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"structured-clone-es": "^1.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"tsdown": "^0.18.
|
|
45
|
-
"ws": "^8.
|
|
44
|
+
"tsdown": "^0.18.4",
|
|
45
|
+
"ws": "^8.19.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsdown",
|