@vitejs/devtools-rpc 0.0.0-alpha.32 → 0.0.0-alpha.34
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.mjs +1 -3
- package/dist/index.mjs +1 -8
- package/dist/presets/index.mjs +1 -2
- package/dist/presets/ws/client.mjs +1 -3
- package/dist/presets/ws/server.d.mts +1 -1
- package/dist/presets/ws/server.mjs +3 -3562
- package/dist/server.mjs +1 -3
- package/package.json +5 -2
package/dist/client.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createBirpc } from "birpc";
|
|
2
|
-
|
|
3
2
|
//#region src/client.ts
|
|
4
3
|
function createRpcClient(functions, options) {
|
|
5
4
|
const { preset, rpcOptions = {} } = options;
|
|
@@ -10,6 +9,5 @@ function createRpcClient(functions, options) {
|
|
|
10
9
|
proxify: false
|
|
11
10
|
});
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
//#endregion
|
|
15
|
-
export { createRpcClient };
|
|
13
|
+
export { createRpcClient };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { hash } from "ohash";
|
|
2
2
|
import pLimit from "p-limit";
|
|
3
|
-
|
|
4
3
|
//#region src/cache.ts
|
|
5
4
|
/**
|
|
6
5
|
* @experimental API is expected to change.
|
|
@@ -36,7 +35,6 @@ var RpcCacheManager = class {
|
|
|
36
35
|
else this.cacheMap.clear();
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
39
|
//#region src/handler.ts
|
|
42
40
|
async function getRpcResolvedSetupResult(definition, context) {
|
|
@@ -55,7 +53,6 @@ async function getRpcHandler(definition, context) {
|
|
|
55
53
|
if (!result.handler) throw new Error(`[devtools-rpc] Either handler or setup function must be provided for RPC function "${definition.name}"`);
|
|
56
54
|
return result.handler;
|
|
57
55
|
}
|
|
58
|
-
|
|
59
56
|
//#endregion
|
|
60
57
|
//#region src/collector.ts
|
|
61
58
|
var RpcFunctionsCollectorBase = class {
|
|
@@ -125,7 +122,6 @@ var RpcFunctionsCollectorBase = class {
|
|
|
125
122
|
return Array.from(this.definitions.keys());
|
|
126
123
|
}
|
|
127
124
|
};
|
|
128
|
-
|
|
129
125
|
//#endregion
|
|
130
126
|
//#region src/define.ts
|
|
131
127
|
function defineRpcFunction(definition) {
|
|
@@ -136,7 +132,6 @@ function createDefineWrapperWithContext() {
|
|
|
136
132
|
return definition;
|
|
137
133
|
};
|
|
138
134
|
}
|
|
139
|
-
|
|
140
135
|
//#endregion
|
|
141
136
|
//#region src/validation.ts
|
|
142
137
|
/**
|
|
@@ -159,7 +154,6 @@ function validateDefinitions(definitions) {
|
|
|
159
154
|
function validateDefinition(definition) {
|
|
160
155
|
validateDefinitions([definition]);
|
|
161
156
|
}
|
|
162
|
-
|
|
163
157
|
//#endregion
|
|
164
158
|
//#region src/dumps.ts
|
|
165
159
|
function getDumpRecordKey(functionName, args) {
|
|
@@ -316,6 +310,5 @@ function createClientFromDump(store, options = {}) {
|
|
|
316
310
|
function getDefinitionsWithDumps(definitions) {
|
|
317
311
|
return definitions.filter((def) => def.dump !== void 0);
|
|
318
312
|
}
|
|
319
|
-
|
|
320
313
|
//#endregion
|
|
321
|
-
export { RpcCacheManager, RpcFunctionsCollectorBase, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, validateDefinition, validateDefinitions };
|
|
314
|
+
export { RpcCacheManager, RpcFunctionsCollectorBase, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, validateDefinition, validateDefinitions };
|
package/dist/presets/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { defineRpcClientPreset } from "../index.mjs";
|
|
2
2
|
import { parse, stringify } from "structured-clone-es";
|
|
3
|
-
|
|
4
3
|
//#region src/presets/ws/client.ts
|
|
5
4
|
function NOOP() {}
|
|
6
5
|
const createWsRpcPreset = defineRpcClientPreset((options) => {
|
|
@@ -37,6 +36,5 @@ const createWsRpcPreset = defineRpcClientPreset((options) => {
|
|
|
37
36
|
deserialize: parse
|
|
38
37
|
};
|
|
39
38
|
});
|
|
40
|
-
|
|
41
39
|
//#endregion
|
|
42
|
-
export { createWsRpcPreset };
|
|
40
|
+
export { createWsRpcPreset };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RpcServerPreset } from "../index.mjs";
|
|
2
2
|
import { BirpcGroup, BirpcOptions } from "birpc";
|
|
3
3
|
import { ServerOptions } from "node:https";
|
|
4
|
-
import { IncomingMessage } from "node:http";
|
|
5
4
|
import { WebSocket } from "ws";
|
|
5
|
+
import { IncomingMessage } from "node:http";
|
|
6
6
|
|
|
7
7
|
//#region src/presets/ws/server.d.ts
|
|
8
8
|
interface DevToolsNodeRpcSessionMeta {
|