@vitejs/devtools-kit 0.0.0-alpha.10 → 0.0.0-alpha.12
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.d.ts +13 -3
- package/dist/client.js +2 -2
- package/dist/{index-BtaHil_c.d.ts → index-CQIA5hSl.d.ts} +22 -11
- package/dist/index.d.ts +2 -2
- package/package.json +3 -3
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DevToolsRpcServerFunctions, E as DevToolsRpcClientFunctions, g as DevToolsDockEntry, u as ConnectionMeta } from "./index-
|
|
1
|
+
import { D as DevToolsRpcServerFunctions, E as DevToolsRpcClientFunctions, g as DevToolsDockEntry, u as ConnectionMeta } from "./index-CQIA5hSl.js";
|
|
2
2
|
import { WebSocketRpcClientOptions } from "@vitejs/devtools-rpc/presets/ws/client";
|
|
3
3
|
import { BirpcOptions, BirpcReturn } from "birpc";
|
|
4
4
|
|
|
@@ -9,7 +9,10 @@ interface DevToolsRpcClientOptions {
|
|
|
9
9
|
wsOptions?: Partial<WebSocketRpcClientOptions>;
|
|
10
10
|
rpcOptions?: Partial<BirpcOptions<DevToolsRpcServerFunctions>>;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Context for client scripts running in dock entries
|
|
14
|
+
*/
|
|
15
|
+
interface DockClientScriptContext {
|
|
13
16
|
/**
|
|
14
17
|
* The dock entry info of the current dock item
|
|
15
18
|
*/
|
|
@@ -18,6 +21,13 @@ interface ImportScriptContext {
|
|
|
18
21
|
* The current state of the dock
|
|
19
22
|
*/
|
|
20
23
|
dockState: 'active' | 'inactive';
|
|
24
|
+
/**
|
|
25
|
+
* Type of the client environment
|
|
26
|
+
*
|
|
27
|
+
* 'embedded' - running inside an embedded floating panel
|
|
28
|
+
* 'standalone' - running inside a standlone window (no user app)
|
|
29
|
+
*/
|
|
30
|
+
clientType: 'embedded' | 'standalone';
|
|
21
31
|
/**
|
|
22
32
|
* Function to hide the panel, if applicable
|
|
23
33
|
*/
|
|
@@ -32,4 +42,4 @@ declare function getDevToolsRpcClient(options?: DevToolsRpcClientOptions): Promi
|
|
|
32
42
|
rpc: BirpcReturn<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions>;
|
|
33
43
|
}>;
|
|
34
44
|
//#endregion
|
|
35
|
-
export { DevToolsRpcClientOptions,
|
|
45
|
+
export { DevToolsRpcClientOptions, DockClientScriptContext, getDevToolsRpcClient };
|
package/dist/client.js
CHANGED
|
@@ -7,7 +7,7 @@ function isNumeric(str) {
|
|
|
7
7
|
return `${+str}` === `${str}`;
|
|
8
8
|
}
|
|
9
9
|
async function getDevToolsRpcClient(options = {}) {
|
|
10
|
-
const { baseURL = "/.devtools/" } = options;
|
|
10
|
+
const { baseURL = "/.devtools/", rpcOptions = {} } = options;
|
|
11
11
|
const urls = Array.isArray(baseURL) ? baseURL : [baseURL];
|
|
12
12
|
let connectionMeta = options.connectionMeta;
|
|
13
13
|
if (!connectionMeta) {
|
|
@@ -25,7 +25,7 @@ async function getDevToolsRpcClient(options = {}) {
|
|
|
25
25
|
url: isNumeric(connectionMeta.websocket) ? `${location.protocol.replace("http", "ws")}//${location.hostname}:${connectionMeta.websocket}` : connectionMeta.websocket,
|
|
26
26
|
...options.wsOptions
|
|
27
27
|
}),
|
|
28
|
-
|
|
28
|
+
rpcOptions
|
|
29
29
|
});
|
|
30
30
|
return {
|
|
31
31
|
connectionMeta,
|
|
@@ -37,10 +37,25 @@ interface DevToolsViewHost {
|
|
|
37
37
|
*/
|
|
38
38
|
hostStatic: (baseUrl: string, distDir: string) => void;
|
|
39
39
|
}
|
|
40
|
+
type DevToolsDockEntryCategory = 'app' | 'framework' | 'web' | 'advanced' | 'default';
|
|
40
41
|
interface DevToolsDockEntryBase {
|
|
41
42
|
id: string;
|
|
42
43
|
title: string;
|
|
43
|
-
icon: string
|
|
44
|
+
icon: string | {
|
|
45
|
+
light: string;
|
|
46
|
+
dark: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The default order of the entry in the dock.
|
|
50
|
+
* The higher the number the earlier it appears.
|
|
51
|
+
* @default 0
|
|
52
|
+
*/
|
|
53
|
+
defaultOrder?: number;
|
|
54
|
+
/**
|
|
55
|
+
* The category of the entry
|
|
56
|
+
* @default 'default'
|
|
57
|
+
*/
|
|
58
|
+
category?: DevToolsDockEntryCategory;
|
|
44
59
|
}
|
|
45
60
|
interface ClientScriptEntry {
|
|
46
61
|
/**
|
|
@@ -64,23 +79,19 @@ interface DevToolsViewIframe extends DevToolsDockEntryBase {
|
|
|
64
79
|
*/
|
|
65
80
|
frameId?: string;
|
|
66
81
|
/**
|
|
67
|
-
* Optional script to import into the iframe
|
|
82
|
+
* Optional client script to import into the iframe
|
|
68
83
|
*/
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
interface DevToolsViewWebComponent extends DevToolsDockEntryBase {
|
|
72
|
-
type: 'webcomponent';
|
|
73
|
-
import: ClientScriptEntry;
|
|
84
|
+
clientScript?: ClientScriptEntry;
|
|
74
85
|
}
|
|
75
86
|
interface DevToolsViewAction extends DevToolsDockEntryBase {
|
|
76
87
|
type: 'action';
|
|
77
|
-
|
|
88
|
+
action: ClientScriptEntry;
|
|
78
89
|
}
|
|
79
90
|
interface DevToolsViewCustomRender extends DevToolsDockEntryBase {
|
|
80
91
|
type: 'custom-render';
|
|
81
|
-
|
|
92
|
+
renderer: ClientScriptEntry;
|
|
82
93
|
}
|
|
83
|
-
type DevToolsDockEntry = DevToolsViewIframe |
|
|
94
|
+
type DevToolsDockEntry = DevToolsViewIframe | DevToolsViewAction | DevToolsViewCustomRender;
|
|
84
95
|
//#endregion
|
|
85
96
|
//#region src/types/vite-plugin.d.ts
|
|
86
97
|
interface DevToolsCapabilities {
|
|
@@ -153,4 +164,4 @@ interface PluginWithDevTools extends Plugin {
|
|
|
153
164
|
devtools?: DevToolsPluginOptions;
|
|
154
165
|
}
|
|
155
166
|
//#endregion
|
|
156
|
-
export {
|
|
167
|
+
export { DevToolsViewIframe as C, DevToolsRpcServerFunctions as D, DevToolsRpcClientFunctions as E, DevToolsViewHost as S, Thenable as T, DevToolsDockEntryBase as _, RpcDefinitionsToFunctions as a, DevToolsViewAction as b, RpcFunctionType as c, DevToolsCapabilities as d, DevToolsNodeContext as f, DevToolsDockEntry as g, ClientScriptEntry as h, RpcDefinitionsFilter as i, RpcFunctionsHost as l, DevToolsPluginOptions as m, BirpcFn as n, RpcFunctionDefinition as o, DevToolsNodeUtils as p, BirpcReturn$1 as r, RpcFunctionSetupResult as s, PluginWithDevTools as t, ConnectionMeta as u, DevToolsDockEntryCategory as v, EntriesToObject as w, DevToolsViewCustomRender as x, DevToolsDockHost as y };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as DevToolsViewIframe, D as DevToolsRpcServerFunctions, E as DevToolsRpcClientFunctions, S as DevToolsViewHost, T as Thenable, _ as DevToolsDockEntryBase, a as RpcDefinitionsToFunctions, b as DevToolsViewAction, c as RpcFunctionType, d as DevToolsCapabilities, f as DevToolsNodeContext, g as DevToolsDockEntry, h as ClientScriptEntry, i as RpcDefinitionsFilter, l as RpcFunctionsHost, m as DevToolsPluginOptions, n as BirpcFn, o as RpcFunctionDefinition, p as DevToolsNodeUtils, r as BirpcReturn, s as RpcFunctionSetupResult, t as PluginWithDevTools, u as ConnectionMeta, v as DevToolsDockEntryCategory, w as EntriesToObject, x as DevToolsViewCustomRender, y as DevToolsDockHost } from "./index-CQIA5hSl.js";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/rpc.d.ts
|
|
4
4
|
declare function defineRpcFunction<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN>): RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN>;
|
|
5
5
|
declare function getRpcHandler<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN>, context: DevToolsNodeContext): Promise<(...args: ARGS) => RETURN>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { BirpcFn, BirpcReturn, ClientScriptEntry, ConnectionMeta, DevToolsCapabilities, DevToolsDockEntry, DevToolsDockEntryBase, DevToolsDockHost, DevToolsNodeContext, DevToolsNodeUtils, DevToolsPluginOptions, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsViewAction, DevToolsViewCustomRender, DevToolsViewHost, DevToolsViewIframe,
|
|
7
|
+
export { BirpcFn, BirpcReturn, ClientScriptEntry, ConnectionMeta, DevToolsCapabilities, DevToolsDockEntry, DevToolsDockEntryBase, DevToolsDockEntryCategory, DevToolsDockHost, DevToolsNodeContext, DevToolsNodeUtils, DevToolsPluginOptions, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsViewAction, DevToolsViewCustomRender, DevToolsViewHost, DevToolsViewIframe, EntriesToObject, PluginWithDevTools, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcFunctionDefinition, RpcFunctionSetupResult, RpcFunctionType, RpcFunctionsHost, Thenable, defineRpcFunction, getRpcHandler };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/devtools-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-alpha.
|
|
4
|
+
"version": "0.0.0-alpha.12",
|
|
5
5
|
"description": "Vite DevTools Kit",
|
|
6
6
|
"author": "VoidZero Inc.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"vite": "
|
|
33
|
+
"vite": "*"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"birpc": "^2.6.1",
|
|
37
|
-
"@vitejs/devtools-rpc": "0.0.0-alpha.
|
|
37
|
+
"@vitejs/devtools-rpc": "0.0.0-alpha.12"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"tsdown": "^0.15.12",
|