@vitejs/devtools 0.0.0-alpha.29 → 0.0.0-alpha.30
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/index.d.ts +24 -1
- package/dist/index.js +20 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StartOptions } from "./cli-commands.js";
|
|
1
2
|
import { Plugin, ResolvedConfig, ViteDevServer } from "vite";
|
|
2
3
|
import { SharedStatePatch } from "@vitejs/devtools-kit/utils/shared-state";
|
|
3
4
|
import * as _vitejs_devtools_rpc0 from "@vitejs/devtools-rpc";
|
|
@@ -8,6 +9,28 @@ import * as h3 from "h3";
|
|
|
8
9
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
9
10
|
import * as birpc from "birpc";
|
|
10
11
|
|
|
12
|
+
//#region src/node/config.d.ts
|
|
13
|
+
interface DevToolsConfig extends Partial<StartOptions> {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Disable client authentication.
|
|
17
|
+
*
|
|
18
|
+
* Beware that if you disable client authentication,
|
|
19
|
+
* any browsers can connect to the devtools and access to your server and filesystem.
|
|
20
|
+
* (including other devices, if you open server `host` option to LAN or WAN)
|
|
21
|
+
*
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
clientAuth?: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface ResolvedDevToolsConfig {
|
|
27
|
+
config: Omit<DevToolsConfig, 'enabled'> & {
|
|
28
|
+
host: string;
|
|
29
|
+
};
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare function normalizeDevToolsConfig(config: DevToolsConfig | boolean | undefined, host: string): ResolvedDevToolsConfig;
|
|
33
|
+
//#endregion
|
|
11
34
|
//#region src/node/context.d.ts
|
|
12
35
|
declare function createDevToolsContext(viteConfig: ResolvedConfig, viteServer?: ViteDevServer): Promise<DevToolsNodeContext>;
|
|
13
36
|
//#endregion
|
|
@@ -222,4 +245,4 @@ declare function createDevToolsMiddleware(options: CreateWsServerOptions): Promi
|
|
|
222
245
|
getConnectionMeta: () => Promise<_vitejs_devtools_kit0.ConnectionMeta>;
|
|
223
246
|
}>;
|
|
224
247
|
//#endregion
|
|
225
|
-
export { DevTools, createDevToolsContext, createDevToolsMiddleware };
|
|
248
|
+
export { DevTools, DevToolsConfig, ResolvedDevToolsConfig, createDevToolsContext, createDevToolsMiddleware, normalizeDevToolsConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
import { a as createDevToolsContext, n as createDevToolsMiddleware, t as DevTools } from "./plugins-BbzqUdpu.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
//#region src/node/utils.ts
|
|
4
|
+
function isObject(value) {
|
|
5
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/node/config.ts
|
|
10
|
+
function normalizeDevToolsConfig(config, host) {
|
|
11
|
+
return {
|
|
12
|
+
enabled: config === true || !!(config && config.enabled),
|
|
13
|
+
config: {
|
|
14
|
+
...isObject(config) ? config : {},
|
|
15
|
+
clientAuth: isObject(config) ? config.clientAuth ?? true : true,
|
|
16
|
+
host: isObject(config) ? config.host ?? host : host
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { DevTools, createDevToolsContext, createDevToolsMiddleware, normalizeDevToolsConfig };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/devtools",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-alpha.
|
|
4
|
+
"version": "0.0.0-alpha.30",
|
|
5
5
|
"description": "Vite DevTools",
|
|
6
6
|
"author": "VoidZero Inc.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"sirv": "^3.0.2",
|
|
54
54
|
"tinyexec": "^1.0.2",
|
|
55
55
|
"ws": "^8.19.0",
|
|
56
|
-
"@vitejs/devtools-kit": "0.0.0-alpha.
|
|
57
|
-
"@vitejs/devtools-
|
|
58
|
-
"@vitejs/devtools-
|
|
56
|
+
"@vitejs/devtools-kit": "0.0.0-alpha.30",
|
|
57
|
+
"@vitejs/devtools-rolldown": "0.0.0-alpha.30",
|
|
58
|
+
"@vitejs/devtools-rpc": "0.0.0-alpha.30"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@clack/prompts": "^1.0.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"vue": "^3.5.27",
|
|
72
72
|
"vue-router": "^5.0.2",
|
|
73
73
|
"vue-tsc": "^3.2.4",
|
|
74
|
-
"@vitejs/devtools-rolldown": "0.0.0-alpha.
|
|
74
|
+
"@vitejs/devtools-rolldown": "0.0.0-alpha.30"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "pnpm build:js && pnpm build:standalone",
|