@nwire/cli 0.13.0 → 0.13.1

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.
@@ -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 last `nwire cache` run;
86
- * the intent for future increments is to fold live handler registrations
87
- * from the runtime so the manifest stays accurate during HMR. Today the
88
- * disk file is served verbatim (the same as standalone Studio) — this is
89
- * correct: `nwire dev` runs `nwire cache --if-stale` at boot.
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`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nwire/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
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/endpoint": "0.13.0",
41
- "@nwire/hooks": "0.13.0",
42
- "@nwire/scan": "0.13.0",
43
- "@nwire/mcp": "0.13.0"
40
+ "@nwire/endpoint": "0.13.1",
41
+ "@nwire/hooks": "0.13.1",
42
+ "@nwire/mcp": "0.13.1",
43
+ "@nwire/scan": "0.13.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^22.19.9",