@devframes/vite 0.9.10 → 0.9.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/single.d.mts CHANGED
@@ -2,6 +2,7 @@ import { IncomingMessage, ServerResponse } from "node:http";
2
2
  import { Plugin } from "vite";
3
3
  import { DevframeDefinition, McpSetting } from "devframe";
4
4
  import { DevframeAuthHandler } from "devframe/node/auth";
5
+ import { WsOriginRegistry } from "devframe/rpc/transports/ws-server";
5
6
  //#region src/single.d.ts
6
7
  /**
7
8
  * The slice of a Vite dev server these plugins touch, deliberately
@@ -92,6 +93,16 @@ interface DevframeViteBridgeOptions {
92
93
  * surface is non-empty); `false` disables the route regardless.
93
94
  */
94
95
  mcp?: McpSetting;
96
+ /**
97
+ * Widen the WebSocket origin check beyond devframe's loopback-only
98
+ * default. A bridge serves the tool same-origin with the host Vite app,
99
+ * so reaching it from a non-loopback origin (`vite --host`, containers,
100
+ * Codespaces, tunnels) needs the dev server's own origin allowed. Pass
101
+ * extra origins, a {@link WsOriginRegistry}, or `false` to disable the
102
+ * check (safe when the bridge's auth gate owns the trust boundary).
103
+ * Forwarded verbatim to `initDevframe`.
104
+ */
105
+ allowedOrigins?: readonly string[] | WsOriginRegistry | false;
95
106
  }
96
107
  /**
97
108
  * Bridge a devframe's RPC + WebSocket backend into an existing Vite dev
package/dist/single.mjs CHANGED
@@ -76,7 +76,8 @@ function devframeViteBridge(d, options = {}) {
76
76
  * than leaving the socket ungated. `false` opts out explicitly.
77
77
  */
78
78
  auth: options.auth,
79
- mcp: options.mcp
79
+ mcp: options.mcp,
80
+ allowedOrigins: options.allowedOrigins
80
81
  });
81
82
  server.middlewares.use(created.nodeMiddleware);
82
83
  await created.ready;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/vite",
3
3
  "type": "module",
4
- "version": "0.9.10",
4
+ "version": "0.9.12",
5
5
  "description": "Vite plugin for mounting a devframe inside any Vite-based host (Astro, SolidStart, Nuxt, plain Vite apps).",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -30,9 +30,9 @@
30
30
  "dist"
31
31
  ],
32
32
  "peerDependencies": {
33
- "@devframes/hub": "0.9.10",
34
- "@devframes/hub-ui": "0.9.10",
35
- "devframe": "0.9.10",
33
+ "@devframes/hub": "0.9.12",
34
+ "@devframes/hub-ui": "0.9.12",
35
+ "devframe": "0.9.12",
36
36
  "vite": "^7.0.0 || ^8.0.0"
37
37
  },
38
38
  "peerDependenciesMeta": {
@@ -50,15 +50,17 @@
50
50
  "pathe": "^2.0.3"
51
51
  },
52
52
  "devDependencies": {
53
- "@devframes/hub": "0.9.10",
54
- "@devframes/hub-ui": "0.9.10",
53
+ "@devframes/hub": "0.9.12",
54
+ "@devframes/hub-ui": "0.9.12",
55
55
  "@modelcontextprotocol/client": "^2.0.0",
56
56
  "@types/node": "^26.4.0",
57
- "devframe": "0.9.10",
57
+ "@types/ws": "^8.18.1",
58
+ "devframe": "0.9.12",
58
59
  "get-port-please": "^3.2.0",
59
60
  "tsdown": "^0.22.14",
60
61
  "vite": "^8.2.2",
61
- "vitest": "^4.1.11"
62
+ "vitest": "^4.1.11",
63
+ "ws": "^8.21.3"
62
64
  },
63
65
  "scripts": {
64
66
  "build": "tsdown",