@vitejs/devtools-rpc 0.1.3 → 0.1.4
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.
|
@@ -7,7 +7,7 @@ interface WebSocketRpcClientOptions {
|
|
|
7
7
|
onConnected?: (e: Event) => void;
|
|
8
8
|
onError?: (e: Error) => void;
|
|
9
9
|
onDisconnected?: (e: CloseEvent) => void;
|
|
10
|
-
|
|
10
|
+
authToken?: string;
|
|
11
11
|
}
|
|
12
12
|
declare const createWsRpcPreset: RpcClientPreset<(options: WebSocketRpcClientOptions) => ChannelOptions>;
|
|
13
13
|
//#endregion
|
|
@@ -4,7 +4,7 @@ import { parse, stringify } from "structured-clone-es";
|
|
|
4
4
|
function NOOP() {}
|
|
5
5
|
const createWsRpcPreset = defineRpcClientPreset((options) => {
|
|
6
6
|
let url = options.url;
|
|
7
|
-
if (options.
|
|
7
|
+
if (options.authToken) url = `${url}?vite_devtools_auth_token=${encodeURIComponent(options.authToken)}`;
|
|
8
8
|
const ws = new WebSocket(url);
|
|
9
9
|
const { onConnected = NOOP, onError = NOOP, onDisconnected = NOOP } = options;
|
|
10
10
|
ws.addEventListener("open", (e) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/devtools-rpc",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"description": "Vite DevTools RPC Layer",
|
|
6
6
|
"author": "VoidZero Inc.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"birpc": "^4.0.0",
|
|
44
44
|
"ohash": "^2.0.11",
|
|
45
45
|
"p-limit": "^7.3.0",
|
|
46
|
-
"structured-clone-es": "^
|
|
47
|
-
"valibot": "^1.
|
|
46
|
+
"structured-clone-es": "^2.0.0",
|
|
47
|
+
"valibot": "^1.3.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"tsdown": "^0.21.
|
|
50
|
+
"tsdown": "^0.21.4",
|
|
51
51
|
"ws": "^8.19.0"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|