@nwire/cli 0.13.0 → 0.13.2
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/lib/dev-host.js +12 -0
- package/dist/lib/studio-host-api.js +9 -7
- package/package.json +5 -5
package/dist/lib/dev-host.js
CHANGED
|
@@ -46,6 +46,7 @@ import { createRequire } from "node:module";
|
|
|
46
46
|
import sirv from "sirv";
|
|
47
47
|
import { createServer as createViteServer } from "vite";
|
|
48
48
|
import { createStudioHostApi } from "./studio-host-api.js";
|
|
49
|
+
import { ensureScanFresh } from "./ensure-scan.js";
|
|
49
50
|
// ── Active-endpoint selection helpers ────────────────────────────────────────
|
|
50
51
|
/**
|
|
51
52
|
* Determine which mount should front the HTTP surface.
|
|
@@ -267,6 +268,17 @@ export async function startDevHost(opts) {
|
|
|
267
268
|
// (workers/cron/non-HTTP) still run in-process and are observable via
|
|
268
269
|
// telemetry + manifest.
|
|
269
270
|
adoptMount(active);
|
|
271
|
+
// Build/refresh `.nwire/manifest.json` so Studio's manifest-backed pages
|
|
272
|
+
// (Map, Trace, Plugins, schemas…) have data from the first request and stay
|
|
273
|
+
// current across HMR reloads. Static scan + topology fold — no app boot of
|
|
274
|
+
// its own; fingerprint-gated so an unchanged tree is a near no-op. A scan
|
|
275
|
+
// failure must never take down the dev host, so it's best-effort.
|
|
276
|
+
try {
|
|
277
|
+
await ensureScanFresh(opts.cwd, { quiet: true });
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
// manifest stays as-is; Studio data pages degrade, the wire keeps serving.
|
|
281
|
+
}
|
|
270
282
|
}
|
|
271
283
|
// Initial load — boot the wire for the first time.
|
|
272
284
|
await loadEntry();
|
|
@@ -82,11 +82,12 @@ function sseWrite(res, event, data) {
|
|
|
82
82
|
* GET /__nwire/manifest.json
|
|
83
83
|
*
|
|
84
84
|
* Serves the disk-built `.nwire/manifest.json`. When a live runtime is
|
|
85
|
-
* present the static file already reflects the
|
|
86
|
-
* the intent for future increments is to fold live handler
|
|
87
|
-
* from the runtime so the manifest stays accurate during HMR.
|
|
88
|
-
* disk file is served verbatim (the same as standalone Studio) —
|
|
89
|
-
*
|
|
85
|
+
* present the static file already reflects the source tree as of the last
|
|
86
|
+
* scan; the intent for future increments is to fold live handler
|
|
87
|
+
* registrations from the runtime so the manifest stays accurate during HMR.
|
|
88
|
+
* Today the disk file is served verbatim (the same as standalone Studio) —
|
|
89
|
+
* the dev host calls `ensureScanFresh` on each (re)load so the file exists
|
|
90
|
+
* from the first request and tracks source edits across HMR.
|
|
90
91
|
*
|
|
91
92
|
* A `?force=true` query param is reserved for a future "rebuild" button
|
|
92
93
|
* trigger but is not acted on here (that requires spawning `nwire cache`).
|
|
@@ -286,8 +287,9 @@ export function createStudioHostApi(opts) {
|
|
|
286
287
|
const pathname = new URL(url, "http://x").pathname;
|
|
287
288
|
if (!pathname.startsWith("/__nwire/"))
|
|
288
289
|
return false;
|
|
289
|
-
// ── manifest
|
|
290
|
-
if (req.method === "GET" &&
|
|
290
|
+
// ── manifest (accept the `.json` route and the bare alias) ─────────────
|
|
291
|
+
if (req.method === "GET" &&
|
|
292
|
+
(pathname === "/__nwire/manifest.json" || pathname === "/__nwire/manifest")) {
|
|
291
293
|
handleManifest(req, res, cwd);
|
|
292
294
|
return true;
|
|
293
295
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nwire/cli",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "Nwire CLI — branded TUI. Dev, run, please, build, test, fmt, lint, check, ps, logs, cache, ls, studio. One surface for the whole framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"react": "^18.3.1",
|
|
38
38
|
"sirv": "^3.0.1",
|
|
39
39
|
"vite": "npm:rolldown-vite@latest",
|
|
40
|
-
"@nwire/
|
|
41
|
-
"@nwire/
|
|
42
|
-
"@nwire/scan": "0.13.
|
|
43
|
-
"@nwire/mcp": "0.13.
|
|
40
|
+
"@nwire/hooks": "0.13.2",
|
|
41
|
+
"@nwire/endpoint": "0.13.2",
|
|
42
|
+
"@nwire/scan": "0.13.2",
|
|
43
|
+
"@nwire/mcp": "0.13.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^22.19.9",
|