@devframes/vite 1.0.0 → 1.2.0
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/hub.mjs +5 -6
- package/dist/single.d.mts +1 -1
- package/package.json +13 -13
package/dist/hub.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
2
|
import { resolve } from "pathe";
|
|
3
|
-
import { Server } from "node:http";
|
|
4
3
|
import { DEVFRAMES_HUB_BASE, normalizeHubBase } from "@devframes/hub/constants";
|
|
5
4
|
import { initHub } from "@devframes/hub/initiate";
|
|
6
5
|
//#region src/hub.ts
|
|
@@ -53,7 +52,7 @@ function viteDevframeHub(options = {}) {
|
|
|
53
52
|
const cwd = options.cwd ?? viteConfig?.root ?? process.cwd();
|
|
54
53
|
const ui = await resolveUi();
|
|
55
54
|
const devframes = attachClientScripts(options.devframes, options.clientScripts);
|
|
56
|
-
const httpServer = server.httpServer
|
|
55
|
+
const httpServer = server.httpServer ?? void 0;
|
|
57
56
|
const hub = initHub({
|
|
58
57
|
base,
|
|
59
58
|
cwd,
|
|
@@ -70,8 +69,8 @@ function viteDevframeHub(options = {}) {
|
|
|
70
69
|
auth: options.auth,
|
|
71
70
|
/**
|
|
72
71
|
* Share Vite's own HTTP server for the WS upgrade at `<base>__ws`, with no
|
|
73
|
-
* side-car port to discover. A pinned `port` uses a side-car instead
|
|
74
|
-
*
|
|
72
|
+
* side-car port to discover. A pinned `port` uses a side-car instead,
|
|
73
|
+
* and a middleware-mode Vite (no `httpServer`) asks for an auto-port
|
|
75
74
|
* side-car. Clients discover either via `__connection.json`.
|
|
76
75
|
*/
|
|
77
76
|
server: httpServer,
|
|
@@ -139,8 +138,8 @@ function viteDevframeHub(options = {}) {
|
|
|
139
138
|
}
|
|
140
139
|
/**
|
|
141
140
|
* Share Vite's own HTTP server for the WS upgrade unless a `port` pins a
|
|
142
|
-
* side-car, or
|
|
143
|
-
*
|
|
141
|
+
* side-car, or there is no server to share (middleware mode), which needs an
|
|
142
|
+
* auto-port side-car.
|
|
144
143
|
*/
|
|
145
144
|
function resolveWsBinding(port, httpServer) {
|
|
146
145
|
if (port != null) return { ws: { port } };
|
package/dist/single.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IncomingMessage, ServerResponse } from "node:http";
|
|
2
1
|
import { Plugin } from "vite";
|
|
3
2
|
import { DevframeDefinition, McpSetting } from "devframe";
|
|
4
3
|
import { DevframeAuthHandler } from "devframe/node/auth";
|
|
5
4
|
import { WsOriginRegistry } from "devframe/rpc/transports/ws-server";
|
|
5
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
6
6
|
//#region src/single.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* The slice of a Vite dev server these plugins touch, deliberately
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
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": "1.
|
|
34
|
-
"@devframes/hub-ui": "1.
|
|
35
|
-
"devframe": "1.
|
|
33
|
+
"@devframes/hub": "1.2.0",
|
|
34
|
+
"@devframes/hub-ui": "1.2.0",
|
|
35
|
+
"devframe": "1.2.0",
|
|
36
36
|
"vite": "^7.0.0 || ^8.0.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
@@ -50,17 +50,17 @@
|
|
|
50
50
|
"pathe": "^2.0.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@devframes/hub": "1.
|
|
54
|
-
"@devframes/hub-ui": "1.
|
|
55
|
-
"@modelcontextprotocol/client": "^2.
|
|
56
|
-
"@types/node": "^26.
|
|
57
|
-
"@types/ws": "^8.18.
|
|
58
|
-
"devframe": "1.
|
|
53
|
+
"@devframes/hub": "1.2.0",
|
|
54
|
+
"@devframes/hub-ui": "1.2.0",
|
|
55
|
+
"@modelcontextprotocol/client": "^2.2.0",
|
|
56
|
+
"@types/node": "^26.6.4",
|
|
57
|
+
"@types/ws": "^8.18.2",
|
|
58
|
+
"devframe": "1.2.0",
|
|
59
59
|
"get-port-please": "^3.2.0",
|
|
60
60
|
"tsdown": "^0.23.0",
|
|
61
|
-
"vite": "^8.3.
|
|
62
|
-
"vitest": "^5.0.
|
|
63
|
-
"ws": "^8.
|
|
61
|
+
"vite": "^8.3.2",
|
|
62
|
+
"vitest": "^5.0.3",
|
|
63
|
+
"ws": "^8.22.0"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "tsdown",
|