@vitejs/devtools 0.0.0-alpha.3 → 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/dirs.js CHANGED
@@ -1,3 +1,9 @@
1
- import { dirClientStandalone, dirDist } from "./dirs-B7dOX6eI.js";
1
+ import { join } from "node:path";
2
+ import { fileURLToPath } from "node:url";
2
3
 
4
+ //#region src/dirs.ts
5
+ const dirDist = fileURLToPath(new URL("../dist", import.meta.url));
6
+ const dirClientStandalone = join(dirDist, "client/standalone");
7
+
8
+ //#endregion
3
9
  export { dirClientStandalone, dirDist };