@vitejs/devtools 0.0.0-alpha.30 → 0.0.0-alpha.31

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