@vitejs/devtools-rpc 0.0.0-alpha.2 → 0.0.0-alpha.21
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/client-C3McYp9c.d.mts +13 -0
- package/dist/index.d.mts +15 -0
- package/dist/{index.js → index.mjs} +6 -2
- package/dist/{index-BOWJO778.d.ts → presets/index.d.mts} +1 -1
- package/dist/presets/ws/client.d.mts +3 -0
- package/dist/presets/ws/{client.js → client.mjs} +2 -3
- package/dist/presets/ws/server.d.mts +503 -0
- package/dist/presets/ws/{server.js → server.mjs} +284 -294
- package/package.json +11 -11
- package/dist/index.d.ts +0 -15
- package/dist/presets/index.d.ts +0 -2
- package/dist/presets/index.js +0 -3
- package/dist/presets/ws/client.d.ts +0 -17
- package/dist/presets/ws/server.d.ts +0 -13
- /package/dist/{presets-CXNlz3L-.js → presets/index.mjs} +0 -0
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/devtools-rpc",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-alpha.
|
|
4
|
+
"version": "0.0.0-alpha.21",
|
|
5
5
|
"description": "DevTools rpc for Vite (work in progress)",
|
|
6
6
|
"author": "VoidZero Inc.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/vitejs/devtools#readme",
|
|
9
9
|
"repository": {
|
|
10
|
-
"directory": "packages/
|
|
10
|
+
"directory": "packages/rpc",
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/vitejs/devtools.git"
|
|
13
13
|
},
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
],
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"exports": {
|
|
22
|
-
".": "./dist/index.
|
|
23
|
-
"./presets": "./dist/presets/index.
|
|
24
|
-
"./presets/ws/client": "./dist/presets/ws/client.
|
|
25
|
-
"./presets/ws/server": "./dist/presets/ws/server.
|
|
22
|
+
".": "./dist/index.mjs",
|
|
23
|
+
"./presets": "./dist/presets/index.mjs",
|
|
24
|
+
"./presets/ws/client": "./dist/presets/ws/client.mjs",
|
|
25
|
+
"./presets/ws/server": "./dist/presets/ws/server.mjs",
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
|
-
"main": "./dist/index.
|
|
29
|
-
"module": "./dist/index.
|
|
30
|
-
"types": "./dist/index.d.
|
|
28
|
+
"main": "./dist/index.mjs",
|
|
29
|
+
"module": "./dist/index.mjs",
|
|
30
|
+
"types": "./dist/index.d.mts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"birpc": "^
|
|
40
|
+
"birpc": "^4.0.0",
|
|
41
41
|
"structured-clone-es": "^1.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"tsdown": "^0.
|
|
44
|
+
"tsdown": "^0.18.2",
|
|
45
45
|
"ws": "^8.18.3"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
package/dist/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BirpcGroup, BirpcOptions, BirpcReturn, EventOptions } from "birpc";
|
|
2
|
-
|
|
3
|
-
//#region src/client.d.ts
|
|
4
|
-
declare function createRpcClient<ServerFunctions = Record<string, never>, ClientFunctions extends object = Record<string, never>>(functions: ClientFunctions, options: {
|
|
5
|
-
preset: BirpcOptions<ServerFunctions>;
|
|
6
|
-
rpcOptions?: Partial<BirpcOptions<ServerFunctions>>;
|
|
7
|
-
}): BirpcReturn<ServerFunctions, ClientFunctions>;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/server.d.ts
|
|
10
|
-
declare function createRpcServer<ClientFunctions extends object = Record<string, never>, ServerFunctions extends object = Record<string, never>>(functions: ServerFunctions, options: {
|
|
11
|
-
preset: (rpc: BirpcGroup<ClientFunctions, ServerFunctions>) => void;
|
|
12
|
-
rpcOptions?: EventOptions<ClientFunctions>;
|
|
13
|
-
}): BirpcGroup<ClientFunctions, ServerFunctions>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { createRpcClient, createRpcServer };
|
package/dist/presets/index.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { RpcClientPreset, RpcClientPresetBasicType, RpcClientPresetReturnType, RpcServerPreset, RpcServerPresetBasicType, RpcServerPresetReturnType, defineRpcClientPreset, defineRpcServerPreset } from "../index-BOWJO778.js";
|
|
2
|
-
export { RpcClientPreset, RpcClientPresetBasicType, RpcClientPresetReturnType, RpcServerPreset, RpcServerPresetBasicType, RpcServerPresetReturnType, defineRpcClientPreset, defineRpcServerPreset };
|
package/dist/presets/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { RpcClientPreset } from "../../index-BOWJO778.js";
|
|
2
|
-
|
|
3
|
-
//#region src/presets/ws/client.d.ts
|
|
4
|
-
interface WebSocketRpcClientOptions {
|
|
5
|
-
url: string;
|
|
6
|
-
onConnected?: (e: Event) => void;
|
|
7
|
-
onError?: (e: Error) => void;
|
|
8
|
-
onDisconnected?: (e: CloseEvent) => void;
|
|
9
|
-
}
|
|
10
|
-
declare const createWsRpcPreset: RpcClientPreset<(options: WebSocketRpcClientOptions) => {
|
|
11
|
-
on: (handler: (data: string) => void) => void;
|
|
12
|
-
post: (data: string) => void;
|
|
13
|
-
serialize: (obj: any) => string;
|
|
14
|
-
deserialize: (str: string) => unknown;
|
|
15
|
-
}>;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { WebSocketRpcClientOptions, createWsRpcPreset };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RpcServerPreset } from "../../index-BOWJO778.js";
|
|
2
|
-
import { BirpcGroup, BirpcOptions } from "birpc";
|
|
3
|
-
import { WebSocket } from "ws";
|
|
4
|
-
|
|
5
|
-
//#region src/presets/ws/server.d.ts
|
|
6
|
-
interface WebSocketRpcServerOptions {
|
|
7
|
-
port: number;
|
|
8
|
-
onConnected?: (ws: WebSocket) => void;
|
|
9
|
-
onDisconnected?: (ws: WebSocket) => void;
|
|
10
|
-
}
|
|
11
|
-
declare const createWsRpcPreset: RpcServerPreset<(options: WebSocketRpcServerOptions) => <ClientFunctions, ServerFunctions>(rpc: BirpcGroup<ClientFunctions, ServerFunctions>, options?: Pick<BirpcOptions<ClientFunctions>, 'serialize' | 'deserialize'>) => void>;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { WebSocketRpcServerOptions, createWsRpcPreset };
|
|
File without changes
|