@nifrajs/cli 5.1.0 → 5.3.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/CHANGELOG.md +3313 -0
- package/README.md +3 -0
- package/dist/agent-files.d.ts +19 -11
- package/dist/agent-files.d.ts.map +1 -1
- package/dist/agent-files.js +26 -18
- package/dist/agent-files.js.map +1 -1
- package/dist/assure-hydration.d.ts.map +1 -1
- package/dist/assure-hydration.js +7 -2
- package/dist/assure-hydration.js.map +1 -1
- package/dist/assure.d.ts.map +1 -1
- package/dist/assure.js +14 -1
- package/dist/assure.js.map +1 -1
- package/dist/capabilities-tool.d.ts.map +1 -1
- package/dist/capabilities-tool.js +131 -45
- package/dist/capabilities-tool.js.map +1 -1
- package/dist/check-diagnostics.d.ts +5 -0
- package/dist/check-diagnostics.d.ts.map +1 -1
- package/dist/check-diagnostics.js +5 -0
- package/dist/check-diagnostics.js.map +1 -1
- package/dist/check-scan.d.ts +9 -3
- package/dist/check-scan.d.ts.map +1 -1
- package/dist/check-scan.js +61 -21
- package/dist/check-scan.js.map +1 -1
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +55 -15
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +37 -18
- package/dist/cli.js.map +1 -1
- package/dist/command-catalog.d.ts.map +1 -1
- package/dist/command-catalog.js +9 -5
- package/dist/command-catalog.js.map +1 -1
- package/dist/db-tool.d.ts.map +1 -1
- package/dist/db-tool.js +2 -1
- package/dist/db-tool.js.map +1 -1
- package/dist/dev-bun-config.d.ts +6 -3
- package/dist/dev-bun-config.d.ts.map +1 -1
- package/dist/dev-bun-config.js +13 -10
- package/dist/dev-bun-config.js.map +1 -1
- package/dist/dev-feed-tool.d.ts +3 -2
- package/dist/dev-feed-tool.d.ts.map +1 -1
- package/dist/dev-feed-tool.js +26 -5
- package/dist/dev-feed-tool.js.map +1 -1
- package/dist/doctor.d.ts +15 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +79 -61
- package/dist/doctor.js.map +1 -1
- package/dist/env-file.d.ts.map +1 -1
- package/dist/env-file.js +41 -8
- package/dist/env-file.js.map +1 -1
- package/dist/i18n-check.d.ts +11 -1
- package/dist/i18n-check.d.ts.map +1 -1
- package/dist/i18n-check.js +170 -17
- package/dist/i18n-check.js.map +1 -1
- package/dist/init-agents.d.ts +46 -6
- package/dist/init-agents.d.ts.map +1 -1
- package/dist/init-agents.js +193 -31
- package/dist/init-agents.js.map +1 -1
- package/dist/internal/project-specifiers.d.ts.map +1 -1
- package/dist/internal/project-specifiers.js +9 -1
- package/dist/internal/project-specifiers.js.map +1 -1
- package/dist/internal/source-facts.d.ts +22 -0
- package/dist/internal/source-facts.d.ts.map +1 -1
- package/dist/internal/source-facts.js +322 -0
- package/dist/internal/source-facts.js.map +1 -1
- package/dist/internal/workspace-packages.d.ts +22 -0
- package/dist/internal/workspace-packages.d.ts.map +1 -0
- package/dist/internal/workspace-packages.js +215 -0
- package/dist/internal/workspace-packages.js.map +1 -0
- package/dist/load.d.ts +7 -2
- package/dist/load.d.ts.map +1 -1
- package/dist/load.js +11 -2
- package/dist/load.js.map +1 -1
- package/dist/lock-links.d.ts +42 -0
- package/dist/lock-links.d.ts.map +1 -0
- package/dist/lock-links.js +144 -0
- package/dist/lock-links.js.map +1 -0
- package/dist/mcp-exec.d.ts +1 -0
- package/dist/mcp-exec.d.ts.map +1 -1
- package/dist/mcp-exec.js +16 -5
- package/dist/mcp-exec.js.map +1 -1
- package/dist/mcp-http.js +1 -1
- package/dist/mcp-io.d.ts +23 -3
- package/dist/mcp-io.d.ts.map +1 -1
- package/dist/mcp-io.js +59 -12
- package/dist/mcp-io.js.map +1 -1
- package/dist/mcp-isolate.d.ts.map +1 -1
- package/dist/mcp-isolate.js +2 -1
- package/dist/mcp-isolate.js.map +1 -1
- package/dist/mcp-root.d.ts +6 -4
- package/dist/mcp-root.d.ts.map +1 -1
- package/dist/mcp-root.js +12 -8
- package/dist/mcp-root.js.map +1 -1
- package/dist/migrate-layout.d.ts +2 -1
- package/dist/migrate-layout.d.ts.map +1 -1
- package/dist/migrate-layout.js +435 -29
- package/dist/migrate-layout.js.map +1 -1
- package/dist/project-site.d.ts +7 -0
- package/dist/project-site.d.ts.map +1 -0
- package/dist/project-site.js +19 -0
- package/dist/project-site.js.map +1 -0
- package/dist/recipes/4.0.0.d.ts.map +1 -1
- package/dist/recipes/4.0.0.js +2 -0
- package/dist/recipes/4.0.0.js.map +1 -1
- package/dist/recipes/5.1.0.d.ts +9 -0
- package/dist/recipes/5.1.0.d.ts.map +1 -0
- package/dist/recipes/5.1.0.js +22 -0
- package/dist/recipes/5.1.0.js.map +1 -0
- package/dist/recipes/5.2.0.d.ts +10 -0
- package/dist/recipes/5.2.0.d.ts.map +1 -0
- package/dist/recipes/5.2.0.js +32 -0
- package/dist/recipes/5.2.0.js.map +1 -0
- package/dist/recipes/5.3.0.d.ts +11 -0
- package/dist/recipes/5.3.0.d.ts.map +1 -0
- package/dist/recipes/5.3.0.js +35 -0
- package/dist/recipes/5.3.0.js.map +1 -0
- package/dist/recipes/index.d.ts +3 -0
- package/dist/recipes/index.d.ts.map +1 -1
- package/dist/recipes/index.js +9 -0
- package/dist/recipes/index.js.map +1 -1
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +4 -0
- package/dist/review.js.map +1 -1
- package/dist/rule-explain.d.ts +26 -0
- package/dist/rule-explain.d.ts.map +1 -0
- package/dist/rule-explain.js +49 -0
- package/dist/rule-explain.js.map +1 -0
- package/dist/rules/codes.d.ts +4 -0
- package/dist/rules/codes.d.ts.map +1 -1
- package/dist/rules/codes.js +4 -0
- package/dist/rules/codes.js.map +1 -1
- package/dist/rules/contract-visibility.d.ts.map +1 -1
- package/dist/rules/contract-visibility.js +93 -21
- package/dist/rules/contract-visibility.js.map +1 -1
- package/dist/rules/explanations.d.ts +14 -0
- package/dist/rules/explanations.d.ts.map +1 -0
- package/dist/rules/explanations.js +326 -0
- package/dist/rules/explanations.js.map +1 -0
- package/dist/rules/legacy.d.ts.map +1 -1
- package/dist/rules/legacy.js +24 -1
- package/dist/rules/legacy.js.map +1 -1
- package/dist/rules/merge-auth.d.ts +12 -0
- package/dist/rules/merge-auth.d.ts.map +1 -0
- package/dist/rules/merge-auth.js +52 -0
- package/dist/rules/merge-auth.js.map +1 -0
- package/dist/rules/pages.d.ts +51 -0
- package/dist/rules/pages.d.ts.map +1 -1
- package/dist/rules/pages.js +293 -2
- package/dist/rules/pages.js.map +1 -1
- package/dist/rules/route-statement.d.ts +10 -0
- package/dist/rules/route-statement.d.ts.map +1 -0
- package/dist/rules/route-statement.js +150 -0
- package/dist/rules/route-statement.js.map +1 -0
- package/dist/rules/routes.d.ts +3 -2
- package/dist/rules/routes.d.ts.map +1 -1
- package/dist/rules/routes.js +4 -3
- package/dist/rules/routes.js.map +1 -1
- package/dist/rules/zones.d.ts.map +1 -1
- package/dist/rules/zones.js +3 -2
- package/dist/rules/zones.js.map +1 -1
- package/dist/typecheck-coverage.d.ts +11 -0
- package/dist/typecheck-coverage.d.ts.map +1 -1
- package/dist/typecheck-coverage.js +50 -7
- package/dist/typecheck-coverage.js.map +1 -1
- package/dist/upgrade.d.ts +80 -11
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +332 -65
- package/dist/upgrade.js.map +1 -1
- package/dist/verification-plan.d.ts.map +1 -1
- package/dist/verification-plan.js +2 -0
- package/dist/verification-plan.js.map +1 -1
- package/dist/version-drift.d.ts.map +1 -1
- package/dist/version-drift.js +12 -1
- package/dist/version-drift.js.map +1 -1
- package/dist/web-app-options.d.ts +1 -1
- package/dist/web-app-options.d.ts.map +1 -1
- package/dist/web-app-options.js.map +1 -1
- package/docs/examples.json +19 -1
- package/docs/llms-full.txt +716 -138
- package/docs/types.json +516 -74
- package/package.json +13 -12
- package/src/agent-files.ts +27 -17
- package/src/assure-hydration.ts +8 -1
- package/src/assure.ts +11 -1
- package/src/capabilities-tool.ts +159 -50
- package/src/check-diagnostics.ts +10 -0
- package/src/check-scan.ts +64 -19
- package/src/check.ts +75 -15
- package/src/cli.ts +38 -17
- package/src/command-catalog.ts +16 -8
- package/src/db-tool.ts +2 -0
- package/src/dev-bun-config.ts +13 -9
- package/src/dev-feed-tool.ts +40 -6
- package/src/doctor.ts +102 -66
- package/src/env-file.ts +42 -7
- package/src/i18n-check.ts +254 -18
- package/src/init-agents.ts +221 -41
- package/src/internal/project-specifiers.ts +9 -1
- package/src/internal/source-facts.ts +397 -0
- package/src/internal/workspace-packages.ts +218 -0
- package/src/load.ts +19 -3
- package/src/lock-links.ts +173 -0
- package/src/mcp-exec.ts +18 -4
- package/src/mcp-http.ts +1 -1
- package/src/mcp-io.ts +72 -12
- package/src/mcp-isolate.ts +2 -0
- package/src/mcp-root.ts +14 -8
- package/src/migrate-layout.ts +496 -31
- package/src/project-site.ts +18 -0
- package/src/recipes/4.0.0.ts +2 -0
- package/src/recipes/5.1.0.ts +23 -0
- package/src/recipes/5.2.0.ts +33 -0
- package/src/recipes/5.3.0.ts +36 -0
- package/src/recipes/index.ts +9 -0
- package/src/review.ts +4 -0
- package/src/rule-explain.ts +75 -0
- package/src/rules/codes.ts +4 -0
- package/src/rules/contract-visibility.ts +118 -20
- package/src/rules/explanations.ts +339 -0
- package/src/rules/legacy.ts +24 -1
- package/src/rules/merge-auth.ts +55 -0
- package/src/rules/pages.ts +381 -2
- package/src/rules/route-statement.ts +170 -0
- package/src/rules/routes.ts +4 -3
- package/src/rules/zones.ts +3 -2
- package/src/typecheck-coverage.ts +51 -6
- package/src/upgrade.ts +430 -70
- package/src/verification-plan.ts +6 -0
- package/src/version-drift.ts +15 -0
- package/src/web-app-options.ts +9 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,3313 @@
|
|
|
1
|
+
# @nifrajs/cli
|
|
2
|
+
|
|
3
|
+
## 5.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7ab9692: `nifra check` reports NF-C045, a warning, for a route added to a server as a statement of its own (`app.get("/x", h)` with its result unused) when that server is exported or read by `typeof`. The route is served, but `typeof app`, which the typed client reads, never includes it. `// nifra-expect NF-C045: <reason>` above the statement accepts a route kept off the type on purpose.
|
|
8
|
+
|
|
9
|
+
The raw-`Response` advisory (NF-C007) and the static route scan read routes chained onto `createWebApp(...)` as well as `server(...)`. NF-C007 also counts a `Response` held in a local before it is returned, a handler's `c.json()` or `c.text()`, and a call to a function imported from a relative module that returns one, reported at each route that returns it.
|
|
10
|
+
- 2a429e6: `nifra build --target bun` and `--target node` prerender the routes that opt in (`export const prerender = true`, or `getStaticPaths`) into `_prerendered/` beside `server.js`. The server then answers those pages from their file instead of rendering them on every request.
|
|
11
|
+
|
|
12
|
+
The file is served from the page route, so `use` middleware and every request hook still run first. A gate in front of a page still applies, and response hooks still add their headers. The page carries the `content-language` and Content-Security-Policy its build-time render produced. Loader headers and cookies are not sent, as for any prerendered page.
|
|
13
|
+
|
|
14
|
+
These keep rendering on demand:
|
|
15
|
+
- a request with a query string
|
|
16
|
+
- a navigation data or server-component request
|
|
17
|
+
- a draft-mode visitor
|
|
18
|
+
- a page whose build-time render set a cookie, was `private` or `no-store`, or varied on a request header
|
|
19
|
+
- every page of an app with a `nonce`, whose documents need a nonce minted per request.
|
|
20
|
+
|
|
21
|
+
On Node, the SSR benchmark's prerendered catalog page is served about 2.1x (Svelte) to 2.6x (Vue) faster than rendering it on each request.
|
|
22
|
+
|
|
23
|
+
New in `@nifrajs/web`:
|
|
24
|
+
- `createWebApp({ prerenderedPages })`
|
|
25
|
+
- `prerenderedPageReader`, which opens only the build's own files inside the directory and keeps each page in memory once read, up to 32 MiB by default
|
|
26
|
+
- `PrerenderEntry.serveHeaders` on `prerenderRoutes` results.
|
|
27
|
+
|
|
28
|
+
Prerendering now runs during these builds, so it loads every route module and runs the opted-in loaders at build time. Two effects:
|
|
29
|
+
- If a route module cannot load there, the build warns and every page renders on demand, as before.
|
|
30
|
+
- A secret in a prerendered page fails the build, as it does for `--target static`.
|
|
31
|
+
|
|
32
|
+
The Vite pipeline, `deno`, and the edge targets are unchanged.
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- 7ab9692: `nifra check` reports NF-C044, a warning, for a `createWebApp` call that passes a `clientEntry` and no `copyChunks` in an app with copy tables (`@nifrajs/i18n/copy`). A production client build moves the tables into one chunk per locale that a page loads from the `copyChunks` its server lists, so such a server fails on the first page that renders copy, while `nifra dev` (which never splits) and e2e pass. The finding names the server manifest the module already imports from, which exports `copyChunks`; `// nifra-expect NF-C044: <reason>` on the call accepts a server that never serves those pages. An app on TypeScript 7, whose build keeps tables whole, is not reported.
|
|
37
|
+
- 7ab9692: Add build-time schema compilation that emits typed static validators without runtime code generation. Generated modules preserve strict validation and structured issues while avoiding the schema builder and dynamic compiler in deployed bundles.
|
|
38
|
+
- 84acf41: A `nifra` server that takes SIGTERM or Ctrl+C waits for the warm worker it had to SIGKILL to exit before it ends, so the worker is gone when the server is, instead of lingering in the process table until its new parent reaps it.
|
|
39
|
+
|
|
40
|
+
A schema whose property key, `format` name or custom kind holds a quote, backslash or line break, or whose literal holds a backslash or line break, now validates on the eval-free checker and is refused by build-time compilation. TypeBox splices that text into generated source unescaped, so a quote could end the string and run the rest as code.
|
|
41
|
+
|
|
42
|
+
Prepare immutable route modules and layout chains in production while executing authorization gates and loaders for every request. Mutable manifests can disable module preparation with `cacheRouteModules: false`.
|
|
43
|
+
|
|
44
|
+
Reduce output projection bookkeeping for uniform subtrees, reuse request-bound cache views, and record completed cache spans without allocating an active observation. Span parentage, sampling, redaction, exporter isolation, and capability enforcement remain intact.
|
|
45
|
+
|
|
46
|
+
Keep custom start-only `ObservationLifecycle` implementations compatible. The factory returns the extended `RecordingObservationLifecycle` interface with the new `record` method.
|
|
47
|
+
|
|
48
|
+
Mark the migration parser's TypeScript keyword-kind comparison as syntax, so the security check does not mistake it for a secret comparison.
|
|
49
|
+
- 7ab9692: `nifra upgrade 5.3.0` prints what changes for a 5.2 app: `status()` with a `number` code types `data` as its body, a plain return beside `status(200, ...)` unions the two bodies, NF-C045, NF-C044, the wider raw-`Response` advisory, and peer ranges left alone.
|
|
50
|
+
- 7ab9692: `nifra upgrade` leaves a `peerDependencies` range alone when it already admits the target, and raises one that excludes it keeping its operator (a strict `<` or `>` becomes `<=` or `>=`, so the raised range admits the target), even with `--exact`: a library's `">=3.1.0"` floor stays put instead of becoming `">=5.2.0"`. A peer range no longer sets the version an upgrade starts from either: that comes from the lowest version a dependency, devDependency or override pins, then the lowest installed, and a peer floor only when nothing else names one, so a library workspace whose devDependencies are already on the target's major no longer replays the recipes of the releases its peer floor names. `nifra check` (NF-D002) and `nifra doctor` no longer count a peer floor as a second version of nifra in the workspace.
|
|
51
|
+
- 3fa5688: `nifra mcp` no longer hangs at startup in a project whose bunfig preload keeps its process alive. The probes that tell which variables the project's `.env` files set ran the project's preloads and waited for the process to end; they now skip the project's bunfig, exit as soon as they have printed, and are bounded in time and output. A probe that still fails stops the server with an error naming the cause, instead of serving with values it cannot attribute.
|
|
52
|
+
- 37e1a14: Stopping a warm `nifra_run`/`nifra_render` worker now ends the processes the app started too. The worker was signalled alone, so a child process the backend spawned kept running after the worker exited (and after the MCP server closed). It now runs in its own process group, which gets SIGTERM and then SIGKILL after the grace period, and a terminal signal to the server reaches it.
|
|
53
|
+
- bb38d29: GraphQL documents whose fragments reach no field are refused before validation. Such a fragment reads zero on complexity, depth and field pairs, but graphql-js compares every pair of fragments a selection set spreads before it reports an unknown fragment or a cycle, so 64 KiB of `...A1 ...A2 ...` whose fragments each spread an unknown fragment, themselves or a shared cycle passed every limit and held the event loop for about 400 ms per request. A spread of an unknown fragment and a fragment cycle are now refused with graphql-js's message (without `locations`) before `validate()`, which answers that document in about 12 ms, parsing included. A new `maxFragmentComparisons` limit (default 100,000) counts the fragment comparisons validation would make, stopping once past the limit, so many valid fragments that each select a distinct field are bounded as well: 1,000 such spreads validated in 70 ms and 2,000 in 400 ms, and are now refused. The default admits a binary tree of 255 fragments. Set it on `respondGraphql`, `graphqlWebSocket` or `mountGraphql`, which shares it with its subscriptions.
|
|
54
|
+
- 14f3726: A process the project starts no longer outlives an MCP call that loaded it. The cold `nifra_run`, `nifra_render` and `nifra_ws` path, the isolated project child behind `nifra mcp`'s project tools and resources, the database tools and the hydration run now stop the child's process group once the child exits (SIGTERM, then SIGKILL after the grace period), as the warm worker already did. A helper that inherited the child's stderr also held the call open until its deadline (30 s for a cold run) or, for a project tool call, which has none, until the helper exited; the call now returns when the child does.
|
|
55
|
+
- da2694f: NF-C007 no longer reports a route the typed client still types. A handler that returns a plain value beside a raw `Response` (`if (!note) return c.json({ error }, 404); return note`) keeps `data` typed, because the client drops a bare `Response` from the union, and a route that declares `{ response: t.… }` is typed by its schema, as the advisory's own hint says. A handler whose returns are all a `Response`, or calls `nifra check` cannot see into, is still reported. The batteries starter checks clean again, and the ISR starter marks its built-file route.
|
|
56
|
+
- 4254ba6: `nifra upgrade` no longer writes a range that excludes the version it upgrades to. A strict bound kept its operator, so a peer `"<5.2.0"` became `"<5.3.0"` and a dependency `">5.2.0"` became `">5.3.0"`, both still refusing 5.3.0; they now become `"<=5.3.0"` and `">=5.3.0"`. An upper bound that already admits the target, such as `"<6.0.0"`, is left as written in every field; it was rewritten to `"<5.3.0"` and refused as a rollback, which blocked the whole upgrade.
|
|
57
|
+
- c145f2e: `nifra upgrade` rewrites a nested npm override only inside the object it sits in. A nifra package's `{ ".": "5.2.0" }` was replaced across the whole `overrides` field, so another package's `{ ".": "5.2.0" }` at the same version moved to the nifra target too, a version that package may not have.
|
|
58
|
+
- 86c6573: When `nifra mcp` takes SIGINT, SIGTERM or SIGHUP, it stops every child it runs in its own process group (warm workers, a hydration run, a `nifra check` typecheck), waits for each group to exit, sends SIGKILL to what is left after the kill grace period, and only then takes the signal. It took the signal at once, so a worker that catches SIGTERM, or a process it started that ignores it, outlived the server; a Ctrl+C in the terminal no longer reaches a child in its own group directly. A second signal while the children stop ends the server at once.
|
|
59
|
+
- 55b9a41: `destroy(c, session)` empties and detaches the session object it is passed. Committing that object later in the same request now starts a new session holding only what was set after the call. In store mode, that commit used to vanish against the revocation marker, so a flash message set after logout was lost without an error. In cookie mode, it signed the logged-out data, user id included, into a fresh cookie. The 5.3.0 upgrade notes say so.
|
|
60
|
+
- 5f240c4: A Pi turn whose provider refused its sign-in or API key now fails with `PI_AUTH_REQUIRED`, so a client can ask for a new login or key; any other failed model call stays `PI_MODEL_FAILED`. An expired OAuth login (`invalid_refresh_token`) or an incorrect API key used to report `PI_MODEL_FAILED` like an overloaded model. The 5.3.0 upgrade notes say so.
|
|
61
|
+
- Updated dependencies [7ab9692]
|
|
62
|
+
- Updated dependencies [7ab9692]
|
|
63
|
+
- Updated dependencies [0e1d03f]
|
|
64
|
+
- Updated dependencies [808bac8]
|
|
65
|
+
- Updated dependencies [605c246]
|
|
66
|
+
- Updated dependencies [271917a]
|
|
67
|
+
- Updated dependencies [d4bae56]
|
|
68
|
+
- Updated dependencies [007060d]
|
|
69
|
+
- Updated dependencies [48c9895]
|
|
70
|
+
- Updated dependencies [69dfb60]
|
|
71
|
+
- Updated dependencies [190ab39]
|
|
72
|
+
- Updated dependencies [605c246]
|
|
73
|
+
- Updated dependencies [13224fe]
|
|
74
|
+
- Updated dependencies [00c266e]
|
|
75
|
+
- Updated dependencies [7cf8df3]
|
|
76
|
+
- Updated dependencies [2a429e6]
|
|
77
|
+
- @nifrajs/agent-review@5.3.0
|
|
78
|
+
- @nifrajs/client@5.3.0
|
|
79
|
+
- @nifrajs/core@5.3.0
|
|
80
|
+
- @nifrajs/i18n@5.3.0
|
|
81
|
+
- @nifrajs/mcp@5.3.0
|
|
82
|
+
- @nifrajs/mcp-db@5.3.0
|
|
83
|
+
- @nifrajs/runner@5.3.0
|
|
84
|
+
- @nifrajs/schema@5.3.0
|
|
85
|
+
- @nifrajs/testing@5.3.0
|
|
86
|
+
- @nifrajs/web@5.3.0
|
|
87
|
+
|
|
88
|
+
## 5.2.1
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- 604967f: `nifra check`'s NF-C035 accepts `// nifra-expect NF-C035: <reason>` on a `createWebApp` call, or on its `apiPrefix` line, for an app whose backend another server already serves where `nifra dev` does. The finding at the call says so, and for a call that passes no `apiPrefix` it adds that one there would give the backend a second path that skips that server's middleware.
|
|
93
|
+
- ec8080c: `nifra upgrade --write` no longer runs `nifra check` against packages its edits have not installed: that check read the release being left, so it could fail on a mix of versions or pass on the old one. While package.json pins or bun.lock entries it changed are not installed, or `node_modules` holds a nifra package at another version, it prints the install command (`bun install`, or `pnpm`, `yarn` or `npm install` by lockfile) and `nifra check` to run after it, and exits 0, so `nifra upgrade <version> --write && bun install` chains. `--json` reports `install` in place of `check`. The hook-scope diff waits for the install too: the report from before the edits is saved for `nifra routes --hooks --since`.
|
|
94
|
+
- @nifrajs/agent-review@5.2.1
|
|
95
|
+
- @nifrajs/client@5.2.1
|
|
96
|
+
- @nifrajs/core@5.2.1
|
|
97
|
+
- @nifrajs/i18n@5.2.1
|
|
98
|
+
- @nifrajs/mcp@5.2.1
|
|
99
|
+
- @nifrajs/mcp-db@5.2.1
|
|
100
|
+
- @nifrajs/runner@5.2.1
|
|
101
|
+
- @nifrajs/schema@5.2.1
|
|
102
|
+
- @nifrajs/testing@5.2.1
|
|
103
|
+
- @nifrajs/web@5.2.1
|
|
104
|
+
|
|
105
|
+
## 5.2.0
|
|
106
|
+
|
|
107
|
+
### Minor Changes
|
|
108
|
+
|
|
109
|
+
- 3860e98: `nifra check` (NF-C039) reads a contract imported from a workspace package, such as `@team/contracts/contract`, through that package's `exports`: subpaths, `*` patterns, and the `bun`, `import` and `default` conditions, plus `types` when it names a TypeScript source. A package linked from outside every `node_modules` counts as the workspace's; one installed from a registry is never read. The scan also follows `export * from` and `export { x } from` re-exports on the way to the contract, and reads a `...operations` spread of another operations object where that object is written. When the contract still cannot be read, the warning names the package and why.
|
|
110
|
+
- 0082cc0: `nifra explain NF-C007` (and `nifra_explain` given a code as its `error`) answers a `nifra check` rule code from the catalog: its title, the review check it reports under, what it reports and why it matters, the fix, the command that applies or starts it when there is one, and its docs page. An unknown or retired code is refused with exit 1 instead of being explained as an unhandled error.
|
|
111
|
+
- 744d3ba: `nifra migrate layout` lists a moved path that a JS or TS module names only in comments as a follow-up, not an issue, so it no longer fails the run. A mention in code or a string, or in a non-JS tooling file, is still an issue. `followUps[].command` is now optional: a comment to update has no command.
|
|
112
|
+
- a040478: `nifra doctor` and `nifra check` (NF-D003) report a `file:` dependency whose recorded dependencies in `bun.lock` differ from what its `package.json` declares now. Bun records them once and never reads that `package.json` again, even under `bun install --force`, so it keeps installing the recorded versions beside the declared ones. The fix is `bun update <package>`. `nifra upgrade` reads the lock against the manifests it is about to write: a dry run lists the entries it would leave stale, and `--write` drops them so the next `bun install` records them again. A lock not laid out one entry per line is left alone and the `bun update` is named instead. The mixed-versions advisory (NF-D002) also counts an exact nifra pin such an entry records.
|
|
113
|
+
- d66ba12: `nifra init-agents --sync-mcp` and `nifra upgrade --write`, run in a workspace member, also re-pin the MCP launch in the directories above it, up to the repository root: a root `.mcp.json` that launches `mcp app` is the member's to re-pin. A file is rewritten only when every nifra launch in it serves that member, resolved the way `nifra mcp` resolves it; a file that also launches another project, holds a pin no launch accounts for, or is a symlink is reported and left alone. Outside a repository nothing above the project is read.
|
|
114
|
+
- 5edd0ba: `nifra upgrade` stops before writing anything when a `link:` or `file:` dependency outside the project installs its own `@nifrajs/*` at a version other than the target. Its imports resolve from its own `node_modules`, so after the upgrade a `server()` it builds could no longer be merged into the app, and that only failed at the first `merge()`. The refusal names each linked repository, its versions and the commands that upgrade it; `--allow-linked-skew` upgrades the project anyway. A dry run prints the plan with the same blocker and exits non-zero. A linked copy that resolves back into the project follows its install and does not count.
|
|
115
|
+
|
|
116
|
+
`merge()` given a server from another loaded copy of `@nifrajs/core` names every copy in its error, this one first, with the version of each copy that has built a `server()`, and says how to collapse them. With one copy loaded the message is unchanged. Copies older than this release are named by path alone, and a production build keeps the short message.
|
|
117
|
+
- df0fbb3: A project that declares `@nifrajs/cli` now launches its MCP server as `bunx @nifrajs/cli mcp`, with no version pin. `bunx` runs the CLI the project installs, so the server moves with every upgrade and the launch never goes stale. New scaffolds and `nifra init-agents` write this form. `nifra init-agents --sync-mcp` and `nifra upgrade --write` drop an existing pin in such a project, and `nifra doctor` points out a pin that is left. A project that does not declare the CLI keeps the exact-version pin, since an unpinned `bunx` there would run a cached `latest`. A launch in a workspace root's files stays pinned too, because the root need not hold the CLI's bin. `create-nifra/agent-files`: `mcpConfig(pin?)`, `mcpJson(pin?)` and `agentsMcpSection(pin?)` take an optional pin. `MCP_CONFIG` is now the unpinned config a scaffold writes.
|
|
118
|
+
- 000b4cb: `nifra check` reports NF-C043, a warning, for a `merge()` whose server authenticates none of its routes while the server it is merged into authenticates its own with `authenticate()` or an auth plugin that records `authenticated` for the routes after it. A merged route keeps the hooks of the server that declared it, so that authentication never runs for it. A merged server that authenticates any route of its own is not reported. `// nifra-expect NF-C043: <reason>` on the merge line accepts a module that is public on purpose. The rule reads the app `nifra.assurance.ts` loads.
|
|
119
|
+
|
|
120
|
+
`@nifrajs/core/reflection` exports `reflectMergeAuthGaps(app)`, the record behind the rule, collected by a development load.
|
|
121
|
+
- 6082ba5: Capability provenance now also starts from the module that registered each route. While the CLI loads `nifra.assurance.ts`, a development load records the `file:line:col` of each route registration through every `group()` and `merge()`, and `reflectRouteSites()` from `@nifrajs/core/reflection` returns it. The walk adds that module to the ones the static text scan finds, so a route with a computed path, or on a server a helper builds, is covered without `provenance.routeModules`. Recording happens only with `NIFRA_ROUTE_SITES=1` outside production, and a production build carries none of it. The sites stay out of `reflectRoutes()`, so no absolute path reaches a written artifact.
|
|
122
|
+
- ed13e36: `nifra upgrade` carries a 5.1.0 recipe, so an upgrade across 5.1.0 prints what can change for an app: merged routes recompiled under the parent's response contract and effect ledger, cross-site form posts refused with `403`, and `clientIp.trustedHops` with no socket peer. `nifra upgrade --list` prints the notes of every release after the version the project declares, and `--json` carries `installed` and every version's `notes`.
|
|
123
|
+
|
|
124
|
+
`reflectHooks` (and so `nifra routes --hooks`, and the hook-scope diff `nifra upgrade` saves) lists the runtimes a route resolved at registration beside its hooks: `responseContract` named by its mode, `effectLedger` and `idempotency`, each with the site `route`. A merged route that gains a parent's contract on upgrade now shows up in `nifra routes --hooks --since`.
|
|
125
|
+
|
|
126
|
+
The release gate fails a minor or major release that has no upgrade recipe of its own.
|
|
127
|
+
- 7ad66f5: NF-C035 also reads app modules that call `createWebApp` from `@nifrajs/web` themselves. A call that mounts a backend (`api`) with no `apiPrefix`, or with a string different from the `apiPrefix` `nifra dev` reads from the framework config, is reported at the call with both values: production then serves the backend somewhere `nifra dev`, end-to-end runs under it and the rest of `nifra check` never exercised. An `apiPrefix` imported from `backend/framework.ts` or `nifra.config.ts` matches by construction; options built from a spread or a variable, or a value the scan cannot read, are not reported.
|
|
128
|
+
- 281a48e: `nifra i18n check` checks copy tables: when the entry exports a `copy` from `defineCopy()` (with or without `catalogs`), it finds that definition's tables across the project's source, turns them into a catalog per locale and runs every catalog check on them, reporting each table at its `file:line`. Two tables with one id, an id that nests under another, and a table key that a catalog also uses are errors; a table or registry it cannot read statically is a warning that says why.
|
|
129
|
+
- 1d20d1f: `checkCatalogs()` catches partly translated text. In a locale that does not write in Latin, `latin-share` reports a message of at least `minWords` (6) words whose share of Latin-script words is above `maxLatinShare` (0.6), with words split by `Intl.Segmenter` so Japanese and Thai count too; `latinWords` lists the brands and units a translation keeps. Each such locale's coverage row carries its `latinShare`, with a warning above `maxLocaleLatinShare` (0.1). `volume` reports a default message of at least `minVolumeGraphemes` (80) graphemes translated to under `minVolumeRatio` (0.32) of its length, a summary rather than a translation; Han scripts are left out of it. `rules` adds an app's own checks, run on every message of every locale and reported as `custom:<code>`, which `ignore` takes. `nifra i18n check` reads these options from the entry's `check` export and shows each locale's Latin share.
|
|
130
|
+
- 1d20d1f: An app registers its locale routing once: `export const i18n = urls` (the router `defineI18nRouting()` returns) from `backend/framework.ts`, which `nifra dev`, `nifra build` and the generated server entry pass to `createWebApp({ i18n })`. Every document then takes `<html lang dir>` from the registry's `documentMeta(localeOf(path))` unless the route's meta sets `lang`, on a hard load and after each client navigation, and carries `Content-Language`. Each adapter's new `useLocale()` returns the page's locale key, and `<I18nProvider>` formats in the page's locale when no `locale` is passed, with no loader handing either over. A route under a `[lang]` or `[[lang]]` directory runs `matchSegment()` before any middleware: an unserved locale, or a page missing from it, is a 404 through the app's `_404`, and a non-canonical prefix such as `/en/x` with an unprefixed default is a 308 to `/x`.
|
|
131
|
+
- 1ebc48a: `nifra check` typechecks every project `tsconfig.json` references, each as its own program, so a solution-style tsconfig (`"files": []` plus `references`) no longer passes having read nothing. A project whose code is split across sibling configs names them in `nifra.check.json` as `"tsconfigs": ["tsconfig.json", "tsconfig.server.json"]`; the list replaces the default, is echoed in the human, JSON and MCP results, and a listed config that does not exist fails the typecheck. The zone coverage check reads the union of the programs, and an error two programs both report is shown once.
|
|
132
|
+
|
|
133
|
+
### Patch Changes
|
|
134
|
+
|
|
135
|
+
- 9498cf8: The package ships its `CHANGELOG.md`, so the installed package has the notes for every version, as the GitHub release does. Before, the tarball held only the code, `README.md`, `LICENSE` and `package.json`.
|
|
136
|
+
- ac65b5c: `nifra doctor` prints its full report again: the bundler, the dependency scan scope, production readiness, each undeclared import and duplicate install with its fix, and the advisories (a CLI that differs from the project's nifra, mixed nifra versions, stale `file:` entries in `bun.lock`, stale MCP pins). It had printed only whether it passed, while `--json` and the MCP tool carried the detail.
|
|
137
|
+
- 426cbcd: `nifra check` reports a raw `Response` return (NF-C007) only inside a route handler: a function passed to `.get("/path", …)` and the other method registrations, a function value of an `implement(contract, {...})` map, a local function either one names, and a local function a handler returns a call to. A helper that returns a `Response` for an auth stage's `rejected`, or any other function no route registers, is no longer flagged. A handler registered from data, such as a loop over route objects, is not followed.
|
|
138
|
+
- 3edee08: `nifra verify --release` runs a `site` gate, `bun run check:site`, after `sitemap`. A project without that script reports the gate as undeclared, as it does for the other repository gates.
|
|
139
|
+
- a3e6c9f: `nifra upgrade 5.2.0` prints what changes for a 5.1 app: closed header schemas read only declared names, `extra: "strip"` projects tagged unions, the development hook audit reports more ordering mistakes (and throws on them under `unusedScopedHooks: "error"`), NF-C043, the wider capability walk, the unpinned MCP launch and the linked-repository refusal.
|
|
140
|
+
- b9e7c6b: The Bun production build (`buildClient`, `buildServer`, `nifra build`) and the `nifra dev --bun` client expand `import.meta.glob` the way Vite does, through the new `importGlobPlugin` in `@nifrajs/web/build`. A literal pattern, or an array of them, starting with `./`, `../` or `/` (the app root) with `!` exclusions becomes an object keyed as Vite keys it, of lazy `() => import(...)` loaders or, with `eager: true`, the modules themselves; `import: "default"` (or a name) picks one export, and `typeof import.meta.glob` reads `"function"`. A mention in a comment, a string or JSX text is left as written. A computed pattern, an alias or another option fails the build naming the file and line, and a client bundle that still calls `import.meta.glob` (a module another plugin loaded first) is refused instead of shipping a glob that loads nothing.
|
|
141
|
+
- 9b7a0b4: Capability provenance (`nifra check` NF-C014, `nifra assure`) walks each installed package's import closure once per run, under its own 5000-module budget, instead of once per route inside the route's 500-module budget. A dependency with hundreds of data modules, such as a validation library's locale tables, no longer truncates every route that imports it, and its imports are still read: a forbidden effect import anywhere in the package is reported for each route that reaches it. A package past its own budget still fails closed, naming the package entry.
|
|
142
|
+
- ddca15d: `nifra migrate layout` reads `import.meta.glob`: the files a literal pattern loads count as imports of the module that loads them, so they move with it, and each pattern is checked after the moves. One whose files moved together into another folder is re-pointed there (`!` exclusions included); one whose files no longer sit under one folder, or a computed pattern, is reported instead of silently matching nothing.
|
|
143
|
+
- 0afa2b4: `nifra migrate layout` follows a top-level `const dir = import.meta.dir` (or `import.meta.dirname`, `__dirname`) the way it follows the expression itself: `resolve(dir, "src/x.tsx")`, `join(dir, ...)`, `dir + "/x"` and `` `${dir}/x` `` are re-pointed when the file they name moves, in a module that moves and in one that stays, such as a root build script. A name the file also declares elsewhere is left alone and reported.
|
|
144
|
+
- 46ffd25: `nifra migrate layout` rewrites the moved files the app's own `package.json` names by exact path in `main`, `module`, `types`, `browser`, `source`, `bin`, `exports`, `imports`, `files` and `scripts`, keeping a written `./`, and lists the change under `tooling`. A value with a `*` outside `scripts` is a pattern over a folder and stays, as do `"//"` note keys; the path scan still reports what stays.
|
|
145
|
+
- a56a67d: `nifra migrate layout` re-points the paths a moved shell script builds from its own folder: `$(dirname "$0")/..`, `$(dirname "${BASH_SOURCE[0]}")/../..` and `${0%/*}/x.sh` name the same place from the script's new folder. A script that uses its folder with no literal path after it, such as `$(cd "$(dirname "$0")" && pwd)`, is reported as an issue to check by hand.
|
|
146
|
+
- 288d68f: `nifra migrate layout` lists every line where a workspace sibling names a moved app file, not only the first. A sibling that names the path in code is an issue whose message gives each code line and any comment lines beside them; a sibling that names it only in comments is a follow-up, as a comment inside the app already is.
|
|
147
|
+
- 8f125db: With both `nifra.config.ts` and `backend/framework.ts`, `nifra dev` (Vite and Bun pipelines) and `nifra build` take `publicEnvPrefix` from `backend/framework.ts` when `nifra.config.ts` leaves it unset, as they already did for the server options. `nifra check` reads `nifra.config.ts` first, so every command draws the browser environment line from the same value. A `publicEnvPrefix` that is not a string is refused at load, naming the file.
|
|
148
|
+
- 2aa2fb0: `nifra upgrade` from 3.x names two 4.0 changes that show up in tests and tooling rather than in pages: page data arrives in one `<script type="application/json" id="__nifra-handover">` (read it through `HANDOVER_ID`) instead of a script assigning `window.__NIFRA_DATA__`, and `x-nifra-isr-revalidate` / `x-nifra-isr-tags` are set only under a cache wrapper such as `withISR`. The 5.0 migration guide lists both, and covers an app that strips `/api` in its own `Proxy` or `fetch` wrapper: replace it with `apiStrip`, and serve any other prefix it handled through `mounts`.
|
|
149
|
+
- 5479750: `tablesToCatalogs()` builds every catalog and nested block with a null prototype, so a copy table id segment or a locale key named `__proto__` is an ordinary entry and never reaches `Object.prototype`. The copy scanner substitutes a tsconfig `paths` match into its target as written, so a `$&` in an import path stays literal. `nifra upgrade` prints a linked repository's path with forward slashes on every platform, in the blocker line and in the `cd` command it suggests.
|
|
150
|
+
- Updated dependencies [9498cf8]
|
|
151
|
+
- Updated dependencies [1f3ff32]
|
|
152
|
+
- Updated dependencies [4bb8e52]
|
|
153
|
+
- Updated dependencies [cdff19d]
|
|
154
|
+
- Updated dependencies [5edd0ba]
|
|
155
|
+
- Updated dependencies [000b4cb]
|
|
156
|
+
- Updated dependencies [c5455fb]
|
|
157
|
+
- Updated dependencies [6082ba5]
|
|
158
|
+
- Updated dependencies [fd58beb]
|
|
159
|
+
- Updated dependencies [ea25a61]
|
|
160
|
+
- Updated dependencies [ed13e36]
|
|
161
|
+
- Updated dependencies [281a48e]
|
|
162
|
+
- Updated dependencies [281a48e]
|
|
163
|
+
- Updated dependencies [1d20d1f]
|
|
164
|
+
- Updated dependencies [1d20d1f]
|
|
165
|
+
- Updated dependencies [746ada9]
|
|
166
|
+
- Updated dependencies [1d20d1f]
|
|
167
|
+
- Updated dependencies [b9e7c6b]
|
|
168
|
+
- @nifrajs/agent-review@5.2.0
|
|
169
|
+
- @nifrajs/client@5.2.0
|
|
170
|
+
- @nifrajs/core@5.2.0
|
|
171
|
+
- @nifrajs/i18n@5.2.0
|
|
172
|
+
- @nifrajs/mcp@5.2.0
|
|
173
|
+
- @nifrajs/mcp-db@5.2.0
|
|
174
|
+
- @nifrajs/runner@5.2.0
|
|
175
|
+
- @nifrajs/schema@5.2.0
|
|
176
|
+
- @nifrajs/testing@5.2.0
|
|
177
|
+
- @nifrajs/web@5.2.0
|
|
178
|
+
|
|
179
|
+
## 5.1.0
|
|
180
|
+
|
|
181
|
+
### Minor Changes
|
|
182
|
+
|
|
183
|
+
- 2a0a5d3: `nifra explain` brings the `nifra_explain` MCP tool to the command line: `nifra explain "<message>" --stack "<stack>"` prints the diagnostic code, the frame in the app's source with its codeframe, and the cause and fix when nifra recognises the error; with no message it explains the running dev server's latest error. `--json` prints the diagnostic, and the command exits `2` when there is nothing to explain.
|
|
184
|
+
- b276c67: `nifra assure --bundle` (and `--strict`) carries an `assurance` gate. Route-assurance findings fail it; before, the bundle never evaluated the route policy, so a failing policy could still come back green. A declared response or error schema that no `responseContract()` enforces is a warning there, so `--strict` refuses a green verdict while any route is typed-only or warn-only.
|
|
185
|
+
|
|
186
|
+
`nifra levels` names the typed-only routes and says where the plugin has to go: on the server that registers them, before them. When `responseContract()` already covers other routes, the reason says so, instead of advising an install that has already happened. It also prints the baseline rule that makes L1 require enforcement.
|
|
187
|
+
|
|
188
|
+
The static route scan follows one import hop: a module that builds its server with a local helper (`newServer().get(...)`, where `newServer` comes from a project file that calls `server()`) is read as a backend. A route that still has no static provenance coverage now says why: which file appears to register it on a server the scan cannot identify, or that no file registers it with a readable path. Either way the reason points at `capabilities.provenance.routeModules`.
|
|
189
|
+
- 513ec28: `nifra migrate layout --zones` keeps every module the layout would move into `frontend/`, `backend/` or `shared/` where it is and lists it in the app's `"nifra": { "zones": ... }` instead: the widest folder whose files all belong to one side, or the file itself where its folder holds both. A data file a zone imports is listed the same way instead of being reported. Route files are still split, the root `backend.ts` and `framework.ts` still move, and a second run lists nothing new.
|
|
190
|
+
- 2a0a5d3: `nifra schemas --check` exits `1` when a loader or action has no output schema, a generated one is stale, or a draft admits any value, for CI. A value typed `any` or `unknown` still drafts as `t.json()`; `nifra schemas` and `nifra migrate layout` now list each such path, and NF-C030 warns on the line in a generated schema. A drafted union no longer adds `t.optional(t.null())` for the keys only other branches declare.
|
|
191
|
+
- e8c482a: `nifra check` reports NF-C042, a warning, for a layout loader that refuses access in its own body (`redirect()`, `statusPage(401)` or `statusPage(403)`, or `new Response(...)`) when the layout does not export `gate = true` and has no `middleware`. A client navigation that keeps the layout skips that loader, and an action below it runs without it, so the check does not protect the pages under it. A refusal inside a helper the loader calls is not seen; the development warning in `@nifrajs/web` catches that case when it runs.
|
|
192
|
+
|
|
193
|
+
### Patch Changes
|
|
194
|
+
|
|
195
|
+
- 30c2a6e: With both `nifra.config.ts` and `backend/framework.ts`, every command takes `apiPrefix`, `apiStrip`, `mounts`, `csp`, `nonce`, `serverComponents` and `use` from `backend/framework.ts` when `nifra.config.ts` leaves them unset, and validates them there. Before, `nifra dev` loaded only `nifra.config.ts` and the server entry `nifra build` generates imported only the options it set, so an `apiPrefix` set in `backend/framework.ts` alone served the backend nowhere over HTTP. NF-C035 reads the same merged value, reports a missing `apiPrefix` as a warning instead of information, and `nifra fix --code NF-C035` adds the mount to `backend/framework.ts`. A new site scaffold states `export const apiPrefix = ""` in `backend/framework.ts`, so it starts without the warning.
|
|
196
|
+
- 2a0a5d3: `nifra check` reports a route, layout, error, not-found, status or loading `.tsx`/`.jsx` that exports `loader`, `action`, `middleware` or another server-only name as NF-C041, an error, matching the build and the server, which already refuse it. `nifra fix --code NF-C041` moves the export and the code only it uses into the route's `.backend.ts`, merging with the one that exists. `nifra fix --code NF-C038` now runs the layout migration it names; its recipe was missing, so the fix did nothing.
|
|
197
|
+
- bab2b2e: NF-S001 (a gate whose catch block fails open) is a warning, not an error, in browser code proven to belong to a nifra web app (a route's page, `frontend/`), the same proof NF-S002 already uses: a check that fails open in the browser grants nothing the server does not check again. Backend, shared, API-only and unclassified files still fail the check, a `// nifra-expect NF-S001: <reason>` comment still makes the finding information, and the retired `@nifra-gate-reviewed` marker still silences nothing.
|
|
198
|
+
- 2a0a5d3: NF-S001 accepts more ways a gate's `catch` denies. A returned object whose `ok`, `allowed`, `authorized`, `authenticated`, `valid`, `success` or `granted` field is `false` is a denial, and so is an `authenticate…` function returning `null`, `undefined` or nothing. A `check…`/`verify…`/`ensure…`/`validate…` name is a gate only when the security word ends the name or a word in it, so `validateTokenizer`, `checkAccessibility` and `validateOriginalUrl` are no longer gates while `checkPermissions` and `verifySignatures` still are.
|
|
199
|
+
- 13d64c1: `nifra migrate layout` rewrites an alias import of a moved module as a relative path when no target of that alias covers the new location (`"@/*": ["./src/*"]` cannot name `frontend/src/`), instead of leaving it as written. Every rewritten specifier, aliased or relative, is checked to resolve to its module in the layout the migration leaves, and one that does not is reported. An alias with a `?query` suffix resolves and keeps its suffix, a package.json `#import` keeps its leading `#`, and an import of a moved route export through an alias that cannot name the backend half is pointed at it by a relative path.
|
|
200
|
+
- 83ab40c: `nifra migrate layout` reads a config module path built with `resolve`/`join` from `node:path` on the config's own folder (`import.meta.dir`, `import.meta.dirname`, `__dirname`), or with `fileURLToPath(new URL(..., import.meta.url))`, as an entry, and re-points it when its module moves; `nifra check` reads `clientModule` the same way for NF-C028. A moved file's own-folder path is re-pointed even when the file itself stays. A test moves with the subject beside it (`x.test.ts` next to `x.ts`, or in `__tests__/`), with its `__snapshots__` file, instead of zoning on its own imports; one whose subjects land in different folders stays and is reported. Every `tsconfig*.json` at the app root keeps each file in, or out of, its program as before: an entry naming a moved file follows it, a folder or glob gains its twin under the zone folder (`src` -> `frontend/src`) where adding the whole zone folder would take in files it left out, and an excluded folder gains its twin in `exclude`. A sibling package in the same workspace that names a moved file, by a relative import or a path string, is reported; the migration never edits files outside the app.
|
|
201
|
+
- 2a0a5d3: `nifra migrate layout` keeps the `/api` mount 3.x and 4.x made by default: moving a root `backend.ts` adds `export const apiPrefix = "/api"` to the framework config unless one is set. A folder whose imported files all go to one zone now moves whole, so files nothing imports yet stay beside their folder instead of being left behind; a file using `node:` or `bun:` never follows its folder into `frontend/` or `shared/`, and a nested package stops the move. A missing output schema on a backend half the run did not write is listed under `next` (`followUps` with `--json`) with the `nifra schemas --write` command and no longer makes the command exit `1`.
|
|
202
|
+
- 2846361: `nifra migrate layout` drafts the missing `loaderOutput`/`actionOutput` of each backend half it writes from the function's return type, read from the layout as planned, so the dry run lists the drafts (`schemas` in the result) and `--write` writes them with the `nifra:generated` line. A half where no draft can be written (an unreadable type, `t` or the schema name already bound) is reported with the reason. NF-C030 now carries a fix: `nifra fix --code NF-C030` drafts only the declaration the finding names, the same draft `nifra schemas --write` writes, and leaves every other schema in the file as it is. A draft's marker line asks the author to review what the browser may see, and `nifra schemas` lists the returned fields a draft leaves out (credential-like names, values that are not JSON). TypeScript 7 reads a file that is not on disk yet under the root as the caller spells it.
|
|
203
|
+
- bb9e858: `nifra migrate layout` splits a route more cleanly. A local `export { X }` or `export { X as Y }` counts as a read of `X` by the half that keeps that export, so the page keeps the import it re-exports and an export list shared with `loader` gives each half only its own names. An import a half reads only in types becomes `import type` (always in the backend half, and in the page where the split narrowed the import), so neither bundler loads the module for it and `nifra check` sees no zone edge. Constant data both halves read (literals, arrays and objects of them, `Object.keys`-style reads, and the types they need) moves once to a `x.shared.ts` beside the route, which both halves import and the page re-exports from; data that changes, runs code or reads an import is still copied into each half, and the report says why. An `import()` of a split route read only for moved exports (`(await import(x)).loader`, a destructuring, or a variable used only as `mod.loader`) loads the backend half instead.
|
|
204
|
+
- 5372e3a: A package's own `"nifra": { "environment": ... }` may give each export entry its own side: `{ ".": "backend", "./react": "frontend", "./schema": "library" }`. An import is judged by the entry it names, the exact subpath first and then the most specific `*` pattern, so two entries backed by one file keep their own sides; importing an entry the map leaves out is an error, as is a key or side the map cannot use. A file reached by path alone, through a relative or aliased deep import, takes the side of every mapped entry that reaches it through the package's own imports under any export condition, and a file no mapped entry reaches is an error. An import that binds only types (`import type`, `export type`, or a `{ }` list of `type` specifiers) grants no ownership, so a backend file a frontend entry only types against stays backend. The Bun and Vite client and server builds, both dev servers, `nifra check` (NF-C028 and NF-C004) and the editor plugin apply the same rules. The Vite builds record the specifier behind each such import, since Rollup keeps only the resolved file. `classify(file, specifier)` on a zone classifier takes the import as written, and `declaredSide(environment, specifier)` reads one declaration. A package-wide string and the app's `"zones": { "packages": ... }` defaults behave as before, and a package's own declaration outranks them. A third-party package's side is read from its root manifest, past a nested `package.json` such as `dist/esm/package.json`.
|
|
205
|
+
- 2a0a5d3: With `apiPrefix` set and `apiStrip` off, the backend sees each request's full path, so a route registered outside the prefix is reachable only in-process through `ctx.api`. `nifra routes` marks such a route `in-process only` (`inProcessOnly` with `--json`), and `nifra dev` and `nifra build` warn about them.
|
|
206
|
+
- c1beda1: `nifra check` decides which imports load a module the way the compiler emits them. An import whose named specifiers are all `type` (`import { type X } from "./x"`) is no zone edge (NF-C028), as it already was no server-only edge (NF-C004), unless the file's tsconfig sets `verbatimModuleSyntax`, under which it is emitted as `import {} from "./x"` and both rules check it. An import with a default binding (`import x, { type Y } from "./x"`) and an explicit `import {} from "./x"` or `export {} from "./x"` load their module and are checked by both rules.
|
|
207
|
+
- 0950139: `nifra upgrade --write` moves the MCP launch pin in `.mcp.json`, `.cursor/mcp.json`, `CLAUDE.md` and the `## MCP server` section of `AGENTS.md` to the target version, the same edit `nifra init-agents --sync-mcp` makes, and the dry run lists each one. A symlinked file or folder is left alone. Other versions pinned in `CLAUDE.md` and `AGENTS.md` are listed with their line, alongside the Dockerfiles, CI workflows and other lockfiles the upgrade already lists.
|
|
208
|
+
- 2a0a5d3: NF-D002 ignores an installed nifra package that neither the workspace nor an installed nifra package declares, such as a leftover `create-nifra`, and groups the installs it reports by version and location (`5 packages at 4.0.2 under <dir> (@nifrajs/cli, @nifrajs/client, @nifrajs/core and 2 more)`) instead of listing every package on one line.
|
|
209
|
+
- 40df00d: `nifra check` (and MCP `nifra_check`) reports contract drift when every route schema the contract lock recorded has been removed. It used to see that no route declares a schema now, answer with only the "trust manifest is vacuous" note, and pass while `nifra contracts check` failed. The note now appears only when the lock and the routes agree.
|
|
210
|
+
- 347a882: `nifra fix` with no `--code` no longer rewrites `contracts.lock.json` or migrates the project layout. Both accept a change a person should review first, so a bare `nifra fix` lists them under `skipped` with the command that applies each; `nifra fix --code NF-K001` still re-snapshots the lock.
|
|
211
|
+
- badfd1e: `nifra review --diff` run from an app inside a larger repository (`apps/web` in a monorepo) now reviews the app's changed files. Git listed changed tracked files relative to the repository root while findings are relative to the app, so a new error in a changed file was counted out of scope and the review passed.
|
|
212
|
+
- 02ba421: `nifra check` (and `nifra_check`) now fails when the directory has TypeScript sources but no `tsconfig.json`, with a `typecheck` error that says the gate did not run and how to add one, as it already did for a `tsconfig.json` with no `typescript` install. Before, the typecheck was reported as skipped and the check passed, so a project with type errors and no tsconfig got a green check. A project with only JavaScript (and declaration files) still skips the typecheck and passes.
|
|
213
|
+
- 5a5dbaf: `nifra dev`, `nifra build` and `nifra start` now read `--flag=value` as well as `--flag value` (`nifra build --target=vercel` builds for Vercel), and refuse an unknown flag, a stray argument or a flag missing its value with exit code 1 instead of ignoring it. Before, `nifra build --target=vercel` or a mistyped `--targt vercel` built the default target and exited 0. `--help` after one of these commands now prints the usage instead of starting the command.
|
|
214
|
+
- 6db673f: `nifra build`, `nifra sdk` and `nifra upgrade --write` now exit once they finish, even when the app they imported keeps the process alive (a database or Redis client, an interval). nifra waits two seconds, says on stderr what is holding the process, and exits with the command's own exit code, as the read-only commands such as `nifra routes` already did. Before, these commands finished their work and then never exited, so a CI step or script running them hung.
|
|
215
|
+
- 346fddb: A command run with `--json` that stops on an error (`nifra routes --json` outside a project, an unknown option, an exception the command throws) now prints `{ "ok": false, "error": "<message>" }` on stdout, beside the message on stderr and the same nonzero exit code. Before, stdout stayed empty, so a script or agent parsing it got a JSON parse error instead of the reason.
|
|
216
|
+
- 1a4a7a3: A cancelled or timed-out `nifra_run`, `nifra_render` or `nifra_ws` call, a replaced warm worker, and a cancelled or timed-out `nifra_hydrate` run now end even when the app catches SIGTERM. The child gets SIGTERM, then SIGKILL two seconds later, as `nifra_test` already did. Before, an app with a SIGTERM handler and a request that never answered kept the tool call waiting forever and left the process running after the MCP server moved on.
|
|
217
|
+
- 9176f43: The MCP tools, `nifra fix` and `nifra review` now refuse a project path that is a dangling symlink pointing outside the project, such as an `api-snapshot.json` linked to a file that does not exist yet elsewhere. Before, the containment check walked up to the link's existing parent, found it inside the project and allowed the path, so a write through the link created the file outside the project. A dangling link whose target is inside the project still works and resolves to that target.
|
|
218
|
+
- 7dae126: When `nifra mcp` hands the session to the project's own `@nifrajs/cli` (the project installs another release), that CLI now runs with no `.env` files loaded, the same as the server itself. Before, the hand-off started the project's `node_modules/.bin/nifra` shim, whose Bun loaded the project's `.env`, and the inherited marker then told that CLI the values were already gone, so the project's secrets stayed inside the MCP process. The hand-off now runs the script the package's `bin` names with `bun --no-env-file`.
|
|
219
|
+
- 1747473: `nifra mcp` now answers `initialize` (and `ping`) straight away while the app loads in the background, and a monorepo's apps load side by side. Before, the server read the app's declared tools before it answered anything, one app after another, so a backend whose import awaited a database connection held up the handshake for as long as the import took (up to 30 seconds per app), and an MCP client could give up on the server. Tool, resource and prompt calls still wait for the app as before.
|
|
220
|
+
- 4ff8188: `nifra migrate --from tailwind --to stylex --write` now places its StyleX import and `create()` block after the file's directives and imports even when comments sit around them. Before, a comment above `"use client"` put the block above the directive, so the file lost its client boundary, and a trailing `// comment` on the last import pushed the block to the end of the file, so the module threw a ReferenceError when it loaded.
|
|
221
|
+
- fc0eba0: The release verification runner, started as a script (`bun packages/cli/src/release-verification.ts`, which the nifra repository's `bun run verify` and `bun run check:release` use), now fails a gate whose `package.json` script is missing and skips the gates after it, with the missing script named in the fix. Before, the gate was reported as `undeclared` and the run still passed, so renaming a script silently dropped its gate from the release check. `nifra verify` and the `nifra_verify` MCP tool keep reporting such a gate as `undeclared` for a project that does not declare the nifra repository's scripts.
|
|
222
|
+
- 62bce1c: On Windows, `nifra fix`, `nifra review --sarif` and the other project path checks accept a project whose directory path has an 8.3 short name in it (such as `C:\Users\RUNNER~1`). The dangling-symlink check in this release (9176f43) compared the project root and the path through two canonicalizers, one that expands short names and one that keeps them, so every path in such a project read as outside it. Both sides now go through the same one.
|
|
223
|
+
- 03e8ebe: `nifra verify --release` runs the library test suites once. Its `coverage` gate already fails on any failing test, so the release plan no longer has a separate `tests` gate. A new `rest-tests` gate runs `bun run test:rest`, the suites the coverage run leaves out. The default plan (`nifra verify`) still runs `tests`.
|
|
224
|
+
- Updated dependencies [78b2a04]
|
|
225
|
+
- Updated dependencies [638efe5]
|
|
226
|
+
- Updated dependencies [2a0a5d3]
|
|
227
|
+
- Updated dependencies [abb4354]
|
|
228
|
+
- Updated dependencies [5372e3a]
|
|
229
|
+
- Updated dependencies [b276c67]
|
|
230
|
+
- Updated dependencies [50d510f]
|
|
231
|
+
- Updated dependencies [29d6649]
|
|
232
|
+
- Updated dependencies [2a0a5d3]
|
|
233
|
+
- Updated dependencies [72e1b4b]
|
|
234
|
+
- Updated dependencies [7bb8a67]
|
|
235
|
+
- Updated dependencies [513ec28]
|
|
236
|
+
- @nifrajs/web@5.1.0
|
|
237
|
+
- @nifrajs/agent-review@5.1.0
|
|
238
|
+
- @nifrajs/mcp@5.1.0
|
|
239
|
+
- @nifrajs/mcp-db@5.1.0
|
|
240
|
+
- @nifrajs/testing@5.1.0
|
|
241
|
+
- @nifrajs/core@5.1.0
|
|
242
|
+
- @nifrajs/runner@5.1.0
|
|
243
|
+
- @nifrajs/client@5.1.0
|
|
244
|
+
- @nifrajs/i18n@5.1.0
|
|
245
|
+
- @nifrajs/schema@5.1.0
|
|
246
|
+
|
|
247
|
+
## 5.0.0
|
|
248
|
+
|
|
249
|
+
### Major Changes
|
|
250
|
+
|
|
251
|
+
- 3db36b3: `createWebApp` serves `api` over HTTP only at the `apiPrefix` it is given; without one the backend is loader-only (`ctx.api`) and a request under `/api` reaches page routing. 4.x mounted it at `/api` by default. `nifra dev`, `nifra build`, `nifra routes` and the page-under-mount check (NF-C027) follow the same rule for `backend/framework.ts`.
|
|
252
|
+
|
|
253
|
+
`nifra check` reports a `backend/framework.ts` that sets no `apiPrefix` while `backend/app.ts` exports a backend (NF-C035, info), and `nifra fix --code NF-C035` adds `export const apiPrefix = "/api"` to keep the 4.x mount. Set `apiPrefix = ""` to state that the backend is loader-only.
|
|
254
|
+
|
|
255
|
+
- e7a275b: `nifra check` findings are silenced with one comment form: `// nifra-expect <code>: <reason>`, on the flagged line or anywhere in the comment block directly above it. It answers only the code it names. Every security finding (NF-S001 to NF-S006) and every error needs the reason; an advisory accepts the comment without one. The names `sql-dynamic` (NF-C006), `raw-response` (NF-C007), `reserved-segment` (NF-C018), `route-overlap` (NF-C024, NF-C025) and `param-modifier` (NF-C026) still work in place of the code, so `// nifra-expect route-overlap` now needs a reason too. A silenced security finding stays in the report as information, with the comment and its reason as evidence.
|
|
256
|
+
|
|
257
|
+
`@nifra-gate-reviewed` silences nothing: the finding under it fails as any other and names the comment to write instead. `nifra upgrade 5.0.0` lists every such comment with the line it covered and never writes a reason.
|
|
258
|
+
|
|
259
|
+
- 58e27a5: `nifra check` fails with NF-C038 on an app still on the retired root layout: a root `backend.ts` or `framework.ts` in an app with `routes/` or a config, or, elsewhere, one that exports `backend` or `adapter`. No contract gate reads those files there, so the check no longer passes without running them. The finding names `nifra migrate layout`. A `backend.ts` module in a project that is not a routed app, and exports no `backend`, is no longer read as the retired layout by any command. NF-C035 no longer reports an API-only app, which has no page routing for `/api` to fall into.
|
|
260
|
+
- eeee88b: `nifra check` reports a non-constant-time secret comparison (NF-S002) as advisory only for browser code inside a nifra web app: a directory with `nifra.config.ts` or `backend/framework.ts`, or whose nearest package.json depends on `@nifrajs/web` or a `@nifrajs/web-*` adapter. A `routes/` or `frontend/` file anywhere else, such as in an API-only project or a package without a web dependency, is server code, so the comparison fails the check. `nifra fix --code NF-S002` rewrites exactly the comparisons the check reports.
|
|
261
|
+
- 15a3a66: Root status pages (`_404.tsx`, `_<status>.tsx`) and `_error.tsx` render inside the layouts above them with their loader data, and the server puts a status page's `meta` in the head. For an unmatched URL the root middleware and layout loaders run first; otherwise the page reuses the layout data the request already loaded. When those layouts cannot render it (a loader throws, a gate or the middleware refuses) a root status page renders alone and is not hydrated, and an `_error` renders inside its layouts without their data, with the same status. A page rendered with layout data is `private, no-store`, and a client navigation that lands on one loads the URL as a document. `export const inLayouts = false` renders a page the 4.x way and runs no layout loader for it.
|
|
262
|
+
|
|
263
|
+
`createClientRouter` takes `layoutStatusRoutes`: status route ids whose page renders inside layouts, which a soft navigation loads as a document.
|
|
264
|
+
|
|
265
|
+
`nifra check` reports a root status page that imports the root layout to wrap itself, since it now renders that layout twice (NF-C034, warning). The site templates' `_404` pages no longer wrap the layout.
|
|
266
|
+
|
|
267
|
+
- 3976f19: `nifra check` follows the imports the bundler follows when it checks zones (NF-C028) and server-only imports (NF-C004): relative paths, tsconfig `paths` and `baseUrl` (through `extends`, from the nearest `tsconfig.json` or `jsconfig.json`), and package.json `imports`. A route that reaches backend code or a file in no zone through `~/lib/x` or `#db` is reported as it is through `../lib/x`. The app's `clientModule` counts as browser code wherever it lives: a `clientModule` in no zone or in backend code is an NF-C028 error at the config line, and what it imports is checked like a route's imports. A file in no zone is followed into what it imports, so every file the build would refuse is reported, each at its own import.
|
|
268
|
+
|
|
269
|
+
### Minor Changes
|
|
270
|
+
|
|
271
|
+
- 78a639a: `"nifra": { "kind": "api" }` in package.json declares a project that serves no pages. `nifra check` reads it from the nearest package.json, statically, and there skips the checks that read zones (NF-C028 to NF-C033) and the server-only import check (NF-C004), and treats every file as server code for NF-S002. A directory with web config (`nifra.config.ts` exporting `adapter`, or `backend/framework.ts`) keeps its zone checks under the setting, and NF-C037 reports the clash as an error. A value other than `"api"` or `"web"` is an NF-C028 error naming the file. An NF-C028 or NF-C004 finding outside any web app now names the setting. Builds and dev servers do not read it.
|
|
272
|
+
- 503682a: A directory with `backend/app.ts` and no web config is read as an API-only app by `nifra routes`, `nifra context`, `nifra openapi` and `nifra mcp`. They load `backend/app.ts` alone, without an adapter. `nifra context` names the app API-only and lists no pages. `nifra routes --modes` says it has no page routes to read. The tools, resources and prompts the backend declares are listed by `nifra mcp`, and the `nifra://routes` and `nifra://openapi` resources answer. `nifra dev` and `nifra build` still need a web config; their error names the API-only reading when `backend/app.ts` exists.
|
|
273
|
+
- 0aed425: Required `basicAuth`, `bearer`, `apiKey` and `jwt` refuse in the `authenticate()` stage: before the body is read or validated and before any `derive` or `beforeHandle`. An unauthenticated request gets the 401 and its challenge, never a 413 or a 422, on every route shape, lane and WebSocket handshake. With valid credentials an invalid body is still a 422. `optional: true` never refuses and keeps validation first. A `verify` that throws in required mode is a 503. A rate limiter written as a `beforeHandle` behind these guards no longer sees refused requests; `rateLimit()` runs in `onRequest` and still counts them.
|
|
274
|
+
|
|
275
|
+
The `authenticate()` input adds `params`, the raw `search`, the parsed and frozen `query` (the parser `c.query` uses; a repeated key is an array) and the `request` (its body must not be read). The query is for short-lived, single-use tickets, such as one for a WebSocket handshake.
|
|
276
|
+
|
|
277
|
+
Project evidence and reflection keep a route's chosen `validationOrder`.
|
|
278
|
+
|
|
279
|
+
`nifra check` reports a route that claims runtime authentication, declares an input schema and authenticates in a hook that runs after validation (NF-S008, warning). It reads the backend the contract-lock check loads, so it runs when `contracts.lock.json` exists. Fix it with `authenticate()`, or with `validationOrder: "auth-before-validation"` on the route.
|
|
280
|
+
|
|
281
|
+
The dev feed (`nifra_logs`, `nifra_errors`, request traces and the persisted log) records a query's keys and never its values.
|
|
282
|
+
|
|
283
|
+
- 448817b: `nifra check` treats the mounts its assurance source declares `opaque` (a better-auth handler mounted with `mounts: [{ path, app, opaque }]`) as external mounts, so a `fetch` into one is no longer reported as a hand-rolled API call. A mount without that declaration, and a path that escapes the prefix with `..`, are still checked. The prefixes are listed with the `nifra.check.json` `externalMounts` in the report.
|
|
284
|
+
- 200a590: `nifra check` accepts `// nifra-expect NF-C002: <reason>` on a hand-rolled `fetch`, `EventSource` or `WebSocket` call to the app's own API, for a call no typed client covers, such as a static file or a foreign handler's endpoint. The finding stays in the report as `info`, with the comment as evidence. A comment with no reason after the colon silences nothing, and the error says so.
|
|
285
|
+
- 3b325d0: `nifra schemas` drafts `loaderOutput` and `actionOutput` from each loader's and action's TypeScript return type. A dry run reports what every route needs; `--write` puts a schema, marked `nifra:generated`, above each loader or action that has none, leaving out credential-like field names and values that are not JSON. Marked schemas are kept in step with the return type on later runs, and `nifra check` reports NF-C033 when one has drifted. Hand-written schemas are never rewritten: the report lists the returned fields each one drops, by path. Works with TypeScript 5, 6 and 7.
|
|
286
|
+
- b89f48b: The static route scan reads a path given as a module-level string `const`, with or without `as const`, in the same file or exported from a project file it imports, and a template with no substitution. Capability provenance and the route lints now see those routes. A route whose path is another expression, such as an interpolated template, gets an NF-C036 finding (info) that names the expression; `// nifra-expect NF-C036: <reason>` above the registration accepts it.
|
|
287
|
+
- 357c390: `nifra check` reports contract operations the source implements but `backend/app.ts` does not serve (NF-C039, a warning). It finds each `implement(contract, ...)` call from `@nifrajs/core/contract` in the checked package (a nested package with its own package.json is left to its own check) (also through a project module that re-exports it), reads the contract's `defineContract({...})` in the same file or in a module imported through a relative path or an alias, and compares each operation's method and path with the routes the backend serves, a group or mount prefix included. The served routes come from the backend the contract-lock check loads, so the comparison runs when `contracts.lock.json` exists. With no `backend/app.ts`, one finding counts the implemented operations no gate can see. An operation whose method or path is not a string literal, or a contract the scan cannot read, is reported instead of skipped.
|
|
288
|
+
- c87bf7c: `nifra check` reports NF-C030 (a loader or action without its output schema) as an error when the
|
|
289
|
+
function's own body returns a data literal: an object, array, string, template, number or boolean,
|
|
290
|
+
as an expression body or a `return` of the function itself, including one inside `if`, `else`,
|
|
291
|
+
`for`, `while`, `try` or a `switch` case. The runtime refuses every request that reaches such a
|
|
292
|
+
return. A `return` inside a nested function, method, class or braced `case` block, and any
|
|
293
|
+
expression whose value the source does not show (a call, a variable, a ternary), keep the warning.
|
|
294
|
+
- 412a9ee: The Bun dev server answers only loopback host names (`localhost`, `*.localhost`, `127.0.0.1`, `[::1]`) and refuses any other `Host` with 403. It already listened on 127.0.0.1 only, but answered any `Host`, so a page on another site whose name a DNS rebind pointed at 127.0.0.1 could read SSR pages, loader data and the error overlay. A name the server should answer under (a hosts-file entry, a tunnel) goes in the new `allowedHosts` option of `createDevServer`, or in `export const dev = { allowedHosts: [...] }` in `nifra.config.ts`.
|
|
295
|
+
- b9cc68c: `nifra doctor` flags a `buildManifest(...)` call whose file list, an array literal or
|
|
296
|
+
`import.meta.glob` patterns, reaches a page under `routes/` but not the `.backend.*` half beside it.
|
|
297
|
+
`buildManifest` pairs the halves only from the list it is given, so such a manifest serves that page
|
|
298
|
+
without its loader, action and guards, which a test then passes against. The advisory names the
|
|
299
|
+
missing halves and points to `discoverRoutes(dir)` from `@nifrajs/web/fs` or the generated
|
|
300
|
+
`server-manifest`. It never fails the run. The testing guide documents both as the way to give a test
|
|
301
|
+
the routes the app serves.
|
|
302
|
+
- 1a6616f: `reflectHooks(server)` from `@nifrajs/core/reflection` reports, for every route and for each prefix's unmatched paths, the hooks that run in order: their kind, the plugin or function name, and the site that registered them (`app`, `group <prefix>`, `merge #n`, `mount <path>`). Static `responseHeaders()` declarations appear with their header names. Origins are recorded only outside production builds; a production report sets `complete: false`.
|
|
303
|
+
|
|
304
|
+
`nifra routes --hooks [--json]` prints that report, and `--since <file>` prints only what runs differently from a saved one. `nifra upgrade --write` saves the report to `.nifra/hooks-before-upgrade.json` before it edits anything and prints the hook-scope diff (`--no-hooks` skips it). `nifra check --json` includes the report as `hooks` when `nifra.assurance.ts` names a `source`.
|
|
305
|
+
|
|
306
|
+
- 846e2f6: `invariants` in `nifra.assurance.ts` accepts the L4 runner's fixture options - `witnesses`, `prepareRequest`, `isRejected`, `include` and `maxMutationsPerInput` - and `nifra levels` and the `nifra_levels` MCP tool pass them to every L4 run. `invariants.setup` provisions a throwaway target only when L4 runs: it is called once, before the first L4 request and never when the config is imported, and the `teardown` it returns runs after the run, a failing one included. A config needs an `executor`, a `setup`, or both. The contract witness and case-context types now live in `@nifrajs/core/assurance`; `@nifrajs/testing` re-exports them unchanged.
|
|
307
|
+
- d3e79c4: A layout's `meta` receives its own loader data as `data`, the value its component renders, or `null` when the layout has no loader, and the page's data as `pageData`. A layout that loads the locale sets `<html lang>` from its data, and a client navigation keeps it, since the soft-navigation head resolves each layout's `meta` with the same data the server used. A page's `meta` is unchanged and also receives `pageData`. `resolveChainMeta` from `@nifrajs/web/client` resolves a route's `meta` chain this way. Generated route types add `Route.MetaArgs`, typed with the module's own loader data.
|
|
308
|
+
|
|
309
|
+
Upgrading: a layout `meta` that read the page's data as `data` reads `pageData` now. `nifra check` reports a layout with no loader whose `meta` reads `data` (NF-C040), and the 5.0.0 upgrade notes name the change.
|
|
310
|
+
|
|
311
|
+
- 66554bd: `nifra migrate layout` migrates an API-only app: one that declares `"nifra": { "kind": "api" }`, or has no web config, no `routes/` and a `backend.ts` that exports `backend`. Only `backend.ts` moves, to `backend/app.ts`, with its own relative imports and the imports that name it. Nothing is split or zoned. The migration adds `backend` to tsconfig `include` and `.nifra/` to `.gitignore`, and adds `"nifra": { "kind": "api" }` to package.json when the app declares no kind: the dry run lists it, `--write` writes it. Web config without `routes/` stops the migration with the choice to make, and so does a declared API kind beside web config. The JSON result carries `mode: "web" | "api"`.
|
|
312
|
+
- 47d1723: `nifra migrate layout` follows imports through tsconfig `paths` and `baseUrl` and package.json `imports`, so a module reached only through an alias is zoned and moved like any other. An alias import of a moved module is rewritten through the same alias, keeping its style (extension, index), when one of that alias's targets covers the new location; otherwise it is left as written and reported. The config's `clientModule` and `componentPipeline.entries` paths are entries too: `clientModule` and `entries.client` are browser code, `entries.ssr` and `entries.rsc` server code, and each path is rewritten when its module moves. A specifier that names no installed package, built-in or app file is reported instead of skipped.
|
|
313
|
+
- fc0284a: Add opt-in server components across React, Vue, Svelte, Solid and Preact. Closed schemas project public props, owner GET admission and read capabilities govern every refresh, and private responses bypass shared caches. React uses native Flight; Vue, Svelte, Solid and Preact preserve native island state and owned ranges.
|
|
314
|
+
|
|
315
|
+
Add coordinated Vite builds and development generations, guarded component references, generated Bun/Node/Deno/Workers/Pages/Vercel outputs, typed outlets, router and server-function refresh integration, and release certification for browsers, packaged consumers, resource limits and performance. Existing applications retain their default rendering pipeline.
|
|
316
|
+
|
|
317
|
+
Reuse registered Web middleware continuations across requests while retaining request-local state.
|
|
318
|
+
|
|
319
|
+
- 9f58295: An opaque mount can declare the routes it serves: `opaque: { reason, routes: [{ method, path, capabilities }] }` on `mount()`, `mountFetch()` and a `createWebApp` `mounts` entry. Capability assurance reports those routes with `analysis: "declared"` beside the known gap, checks their capabilities against the policy (an unknown id, or a domain write on a safe method, fails), and records them in the lockfile. `reflectMounts` returns them, project evidence carries them, the `nifra context` index lists them, and an adversarial contract run notes them as having no contract to test. A malformed declaration or a path outside the mount stops the analysis with an error that names it. A mount without a reason fails as before.
|
|
320
|
+
- fe75b54: CLI commands that import the app only to read its declarations (`check`, `routes`, `context`, `openapi`, `contracts`, `capabilities`, `manifest`, `doctor`, `diff`, `sync-routes`, `sync-manifest`, and `assure` without its bundle flags) set `NIFRA_REFLECT` to the command name first, so app code can skip connecting to its services. A catalog command whose app keeps the process open after the command has answered (a client that reconnects, an interval) now exits 2 seconds later with its own exit code and a note, instead of running until it is killed.
|
|
321
|
+
- b70b18a: The generated `./+types/<name>` module declares `Route.Loader` and `Route.Action`. Annotate a
|
|
322
|
+
route's loader, `export const loader: Route.Loader = async ({ params, api }) => ...`, and what it
|
|
323
|
+
returns is checked against `loaderOutput` at compile time. A field of the wrong type, a `defer(...)`
|
|
324
|
+
whose value does not match its `t.deferred(...)` field, or any data from a loader with no
|
|
325
|
+
`loaderOutput` is a type error. A redirect, a `Response` and returning nothing stay allowed.
|
|
326
|
+
`Route.Action` does the same against `actionOutput`, `revalidate(paths, data)` included. A field the
|
|
327
|
+
schema does not declare is not a type error, because the output guard drops it.
|
|
328
|
+
|
|
329
|
+
`@nifrajs/client` exports the types behind them: `InputOf<Module, Name>` (what a route module's
|
|
330
|
+
output schema accepts), `RouteLoaderReturn<Module>` and `RouteActionReturn<Module>`.
|
|
331
|
+
|
|
332
|
+
`nifra scaffold` and the `create-nifra` starters write the annotation. `nifra schemas` reports a
|
|
333
|
+
generated schema over an annotated loader or action as unchecked (NF-C033 warns), because the
|
|
334
|
+
annotation, not the body, is then the function's return type.
|
|
335
|
+
|
|
336
|
+
- b5607a3: `nifra check` and `nifra capabilities` read a WebSocket route's path given as a module-level string `const`, in the same file or imported from a project file, as they do for HTTP routes. A socket path built at runtime gets the same NF-C036 finding, listed as `WS`.
|
|
337
|
+
- 8d55d0b: The interpolated-SQL check (NF-C006) reads a function-local `const` as static text when its initializer is, so `const dir = desc ? "DESC" : "ASC"` or `const cols = "id, email"` inside a handler no longer flags. It also reads `.join(sep?)` with a literal or absent separator over an array that still holds its literal elements: an inline array, `Object.freeze([...])`, or a `const` array in the same file that is not exported and is only ever read with `.join()`, `.includes()`, `.indexOf()` or `.length`. An imported array counts only when frozen; `as const` does not count. A `let`, a parameter, an array that is pushed to, passed to a call or exported unfrozen, a shadowed name, and a template with a call inside still flag.
|
|
338
|
+
- a18cef3: `nifra upgrade 5.0.0` pins the fixed group to 5.0.0 and prints each changed default with the `nifra check` finding or the one-line setting that keeps the 4.x behavior: the backend's `apiPrefix` (NF-C035), status pages inside their layouts (NF-C034, `inLayouts = false`), the WebSocket handshake's route chain, per-request Response ownership, and the optional `invariants.executor`.
|
|
339
|
+
- b782d6c: `nifra doctor` and `nifra check` report mixed nifra versions in one workspace. They read the
|
|
340
|
+
versions pinned in `package.json` files, the versions installed in `node_modules` (followed to their
|
|
341
|
+
real location, so a linked repository reports its own) and the running CLI. When more than one
|
|
342
|
+
version appears, doctor prints an advisory naming each version and its source, and check reports
|
|
343
|
+
`NF-D002` (info) with the fix `nifra upgrade <highest>`, which runs each release's migration steps
|
|
344
|
+
before re-pinning. Neither fails the run, and both only read files.
|
|
345
|
+
|
|
346
|
+
The `nifra upgrade` plan now lists group packages linked from outside the workspace root under
|
|
347
|
+
"Left alone" (`UpgradePlan.linkedOutside`). The upgrade edits only files under the root and never
|
|
348
|
+
follows a symlinked package directory or `package.json`.
|
|
349
|
+
|
|
350
|
+
- e0a25fe: `app.ws(path, { capabilities })` declares the capability ids a socket's code may reach, as an HTTP route's `capabilities` does. Reflection lists them on the `"WS"` route, and `nifra capabilities check` covers sockets: it finds each `.ws("/path", ...)` registration, compares the declaration with the effects reachable from that module, and reports an undeclared reach. A write whose definition needs request idempotency fails on a socket, which has no request idempotency. The handshake context carries the guard, so a runtime capability beacon in `upgrade()` fails closed on an undeclared capability.
|
|
351
|
+
- 3630b6e: `reflectRoutes()` lists each WebSocket route under the pseudo-method `"WS"`, after the HTTP routes, with the evidence its handshake enforces: `nifra.authenticated` from the auth guards registered before it and `nifra.rate-limited` from the app's request hooks. A socket never claims evidence whose enforcement its message handlers bypass. Route assurance therefore classifies every socket, and an assurance rule selects sockets with `methods: ["WS"]`; a policy whose rules name only HTTP methods reports each socket as `unclassified-route`.
|
|
352
|
+
|
|
353
|
+
### Patch Changes
|
|
354
|
+
|
|
355
|
+
- Preserve the complete compiler file list when Bun exits with buffered output, so fresh scaffolds and large projects receive accurate TypeScript program coverage checks.
|
|
356
|
+
- Normalize upgrade and version-drift report paths across Windows and Unix, and reject invalid TypeScript path substitutions with multiple wildcards.
|
|
357
|
+
|
|
358
|
+
- 22e3df7: feat(web): the app's package.json can set zones with `"nifra": { "zones": { ... } }`. `packages` gives a side to packages that do not declare one, by exact name or a trailing-`*` prefix (`"@shop/*": "library"`); a package's own declaration still wins. `backend`, `frontend` and `shared` list extra app folders that count as that zone folder (`"backend": ["migrations"]`). Every build, dev server, `nifra check` and the TypeScript plugin read the setting; an invalid one fails with the exact key. An undeclared package is now reported once for the whole package, in the build and in `nifra check`, instead of once per file.
|
|
359
|
+
- 4ce36d6: `nifra check` treats a module as backend-only only when it imports `@nifrajs/web/backend-only` in code. A mention of that import in a comment or a string, such as a note on how to opt in, no longer makes every route that imports the module fail with a server-only import error.
|
|
360
|
+
- 8325581: Capability provenance follows an installed package hoisted above the app (a monorepo's root `node_modules`) the way it already followed one in the app's own `node_modules`. A route reaching a forbidden import through a hoisted package reported clean.
|
|
361
|
+
- ad489d5: Capability provenance now follows imports into a workspace package that lives beside the app, as in an `apps/web` + `packages/*` monorepo. Before, a route reaching a forbidden import through such a package reported clean, because the walk stopped at any module outside the app directory. Installed packages under `node_modules` outside the app are still not entered.
|
|
362
|
+
- b2fe060: `nifra check`'s server-only import walk (NF-C004) no longer stops at 8 hops or 200 modules. A sink past either limit, such as one module in a barrel of 250, was dropped without a word and the check passed. The walk now reads, parses and resolves each module once per check and searches each module's chain once, however many routes share it: 400 routes over 250 shared modules went from about 101,000 module reads and 1.3 s to 251 reads and 49 ms. `createServerOnlyChains` is the per-check entry point; `resolveServerOnlyChains` still answers for one module.
|
|
363
|
+
- f2f037e: The `nifra check` help and the CLI README now say that with a `contracts.lock.json`, `nifra check` imports `backend/app.ts`, running its top-level code, in `--lints-only` mode too, to compare the routes it serves against the lock. They described the gate as static only.
|
|
364
|
+
- d8315d2: `nifra check` keeps an interpolated-SQL site that a `// nifra-expect NF-C006: <reason>` comment silences in the report, as information carrying the comment's reason, as it already did for silenced security findings. A silenced finding from a rule outside the named sections is now reported with severity `info` instead of `warning`, and a report section that holds only information is marked `•` and `(info)` instead of the warning sign.
|
|
365
|
+
- eb37e45: The `nifra check` report counts info findings as info, not as advisory: a section reads `⚠ <rule>: 1 (advisory) (+1 info)` or `✗ <rule>: 1 (+1 info)`, and the closing line reads `✓ check passed (1 advisory, 2 info)`. Before, a silenced finding (info) was counted as advisory.
|
|
366
|
+
- 21adacc: `nifra check` reads an output schema given by name. `export const loaderOutput = userOutput` (or `output: userOutput` on a server function) passed NF-C031 even when `userOutput` named a credential field, because only the text after the `=` was read. The check now follows a bare name to its top-level declaration in the same file, through aliases, and reports each sensitive field once.
|
|
367
|
+
- 83dccf3: NF-C031 reads the schemas an output schema names inside it (`t.object({ user: userSchema })`, `t.array(member)`) and schemas imported from another project file, each where it is declared. A sensitive field in such a schema passed `nifra check` and failed only when the route loaded. A schema under `t.declassified(...)` is not followed, and a schema shared by several routes is reported once, at its declaration.
|
|
368
|
+
- 0d5c101: `nifra check` reads every file a build loads, not only TypeScript. `.jsx`, `.svelte` and `.vue` files, and `.js`/`.mjs`/`.cjs` files under `routes/`, `frontend/`, `shared/` or `backend/` (or with a zone suffix), now get the source rules: a `.jsx` or `.svelte` route importing `pg`, reading `process.env.DATABASE_URL` or carrying a secret key passed before. Svelte and Vue files are scanned as their `<script>` blocks, with the whole file read where markup can hold code, and this works on a TypeScript 7 install too. JavaScript files outside a zone (bundler configs, scripts) stay out of the scan.
|
|
369
|
+
- 9e041e6: `nifra check` no longer compares every pair of routes in a file for overlaps (NF-C024): only routes whose leading literal segments agree are compared, so a file with 2,000 routes under distinct prefixes is checked in milliseconds instead of seconds. The verification work graph de-duplicates edges and walks impact through an edge index, so building and querying it grow linearly with the number of routes.
|
|
370
|
+
- 4d894b0: `nifra check`'s server-only import rule (NF-C004) names server code the way the browser build does. It knew eight drivers; it now takes the build's list of server packages and driver entries (`stripe`, `@prisma/client`, `jsonwebtoken`, `bcrypt`, `nodemailer` and the rest), bare Node builtins with no browser counterpart (`fs`, `child_process`, `crypto`, ...), `require("x")` and `import x = require("x")`, and an installed workspace package that declares `"nifra": { "environment": "backend" }`. Bare `events`, `buffer`, `path` and `util` still pass, since each also names a browser polyfill. `@nifrajs/web/zones` exports the check as `isServerPackageSpecifier`.
|
|
371
|
+
- a9a7317: `nifra check`'s interpolated-SQL rule (NF-C006) now reads the ways a statement reaches a driver that it used to miss:
|
|
372
|
+
|
|
373
|
+
- A statement held in a `var` or a reassigned `let`, or built up in steps (`let q = "SELECT …"; q += \` AND name = '${name}'\``). The rule checks every value assigned to the variable.
|
|
374
|
+
- A pg or mysql2 config object (`{ text }` or `{ sql }`).
|
|
375
|
+
- node-sqlite3's `all`/`get`/`each` and pg-promise's `any`/`one`/`none`/`many` and related calls. These names are common outside SQL, so these calls, and bare calls such as a destructured `query(…)`, only flag text that starts like a statement.
|
|
376
|
+
- A statement passed through `String(…)`, `.trim()`, `.toString()`, `.concat(…)` or `[…].join(…)`.
|
|
377
|
+
- A template that only joins values (`` `${where}` ``).
|
|
378
|
+
- A template-literal method key (`` db[`query`](…) ``).
|
|
379
|
+
- A same-file function that passes one of its parameters to a query. Its callers are now checked.
|
|
380
|
+
|
|
381
|
+
A `sql` tag that the same file defines as a function is no longer trusted as a driver's binding tag. A `nifra-expect NF-C006` marker now has to sit in a comment; inside a string the call passes, it no longer silences the finding.
|
|
382
|
+
|
|
383
|
+
- b2e1ad2: A cancelled `nifra check` (an MCP cancel, or Ctrl+C) now stops every process its typecheck started, not only the `tsc` entry, so it ends at once instead of waiting for a compiler process still holding its output. Ctrl+C in a terminal still stops the check.
|
|
384
|
+
- 19eb11d: feat(check): `nifra check` fails the typecheck when TypeScript files under `routes/`, `frontend/`, `backend/` or `shared/` sit outside the tsc program, so a stale tsconfig `include` can no longer pass a typecheck that never read them. One finding per folder lists the files. A file the tsconfig's `exclude` names (inherited through `extends`) is out on purpose and not reported; others kept out on purpose go under `"typecheck": { "ignore": [...] }` in `nifra.check.json`.
|
|
385
|
+
- 1bf6625: `nifra check`'s zone rules (NF-C028, NF-C029, NF-C032 and the data guards) see every file the build zones. A file outside `routes/`, `frontend/`, `backend/` and `shared/` was skipped, so a folder declared in `"nifra": { "zones": { "frontend": [...] } }` and a `lib/x.frontend.ts` file could read private environment variables or carry a secret key without a finding. Such a file now belongs to the nearest app around it. A relative project root passed to `collectCheckResult` is resolved first; before, it left every file unzoned.
|
|
386
|
+
- ea2e861: `nifra check` and `nifra doctor` read a regex literal that contains a quote or backtick as a regex, so the code after it is no longer misread as a string or a template.
|
|
387
|
+
- 0feb6f4: Flags typed before the command (`nifra --json check`, `nifra --env-file .env dev`) now reach the command instead of being silently ignored.
|
|
388
|
+
- de63922: `nifra mcp` exits when its client closes stdin, also after a `warm: true` call to `nifra_run` or `nifra_render`. The warm worker those calls start used to keep the server process alive after the session ended. The server now stops every warm worker and starts no new ones once stdin closes.
|
|
389
|
+
- e57f36c: `nifra migrate layout` keeps the import a page's classic JSX compiles to. A route written with a `/** @jsx h */` pragma lost `import { h } from "preact"` when its loader moved to the backend half, because no identifier in the page names `h`. JSX now counts as a use of the `@jsx` and `@jsxFrag` pragma bindings, or of `React` when the file sets neither and no `@jsxImportSource`.
|
|
390
|
+
- 817492d: fix(cli): `@nifrajs/cli` no longer depends on `create-nifra`. It ships its own copy of the agent-file generators, so installing the CLI pulls in only `@nifrajs/*` packages and a scoped release-age exclusion covers the whole tree.
|
|
391
|
+
- fcbbfa8: `nifra scaffold` and the `nifra_scaffold` tool write a vanilla page as `routes/<name>.tsx`. They wrote `routes/<name>.ts`, which route discovery does not read as a page, so the app failed to load with `"<name>.backend.ts" has no frontend half`. The page needs no JSX to use the `.tsx` extension.
|
|
392
|
+
- 232df6f: `nifra sdk --language python` writes a model's required fields before its optional ones. A model that listed an optional property before a required one produced a dataclass that Python refused to import (`non-default argument follows default argument`). Each group keeps the schema's order.
|
|
393
|
+
- 917f942: The MCP tools that run project code in a subprocess (`nifra_test`, `nifra_run`, `nifra_render`, `nifra_ws`, the database tools and the app's own tools) end on time when their timeout or a cancel fires. A process the project started could hold the output pipes open after its parent was killed, so a 2 second `nifra_test` timeout took as long as that process lived. On macOS and Linux these subprocesses now lead their own process group, and stopping one stops everything it started. `nifra_test` follows a SIGTERM with SIGKILL after two seconds.
|
|
394
|
+
- 4330e40: Server components and `nifra check` no longer crash on a project that installs TypeScript 7. TypeScript 7's package exports only `version`, with no in-process compiler API, so loading the component pipeline used to fail with a TypeError on first use. The pipeline now raises `NIFRA_TS_UNSUPPORTED` with the fix: pin the project to TypeScript 6. `nifra check` reports the same code. It gives no component module a receipt, so each one is checked as an ordinary backend import. The pipeline reads `componentPipeline` from a config file through `staticComponentPipeline` in `@nifrajs/web/server-components/source`.
|
|
395
|
+
- 82b511f: NF-C039 counts a contract's operations as served only where one mount prefix serves them together. Each operation was matched on its own by path suffix, so a `/` operation matched any route of its method and `/:id` matched any route ending in `/:id`: an implementation `backend/app.ts` never mounted could pass when unrelated routes happened to end the same way.
|
|
396
|
+
- 8c2c76a: feat(contracts): `contracts.lock.json` records the digest format it was hashed with. A lock from another format fails `nifra contracts check` (NF-K001) with one "re-snapshot" diagnostic instead of reporting every route as changed, and a lock without a format notes that it may predate the 4.0.1 rehash when it reports drift.
|
|
397
|
+
- 77621c5: `nifra dev --bun` now carries a bunfig string holding a newline, tab or other control character into the dev server's config intact; such a value used to make the generated config unparseable.
|
|
398
|
+
- 4db7481: `nifra dev` on Bun applies the `package.json` single-copy declaration (`"nifra": { "singleCopy": [...] }`) to the browser bundle, as `buildClient` does, so a linked package with its own copy of a declared package loads the app's copy without a `clientPlugins` entry. An app that also lists `singleCopyPlugin()` gets that instance in the resolver's place, once.
|
|
399
|
+
- 39e2346: `nifra diff` with a missing baseline says where it looked and to create it with `nifra snapshot`, instead of a raw file error. Its text output lists each change with its severity, breaking first, and a summary line; the `--json` shape is unchanged. `nifra snapshot` and `nifra diff` on an app still on the retired root layout name `nifra migrate layout`. The contract proof reports a baseline outside the project as `the baseline <path> is outside the project directory`, a symlink that leaves it included.
|
|
400
|
+
- 26c584e: `nifra doctor` (and the undeclared-dependency rule in `nifra check`) now read `tsconfig.json` the way TypeScript does. It used strict `JSON.parse` and ignored `extends`. A tsconfig with a comment or a trailing comma, or one that takes its `paths` from a shared base, made every alias import look like an undeclared package and failed the check. Doctor now uses the nearest tsconfig at or above each package, follows its `extends` chain, and accepts comments and trailing commas.
|
|
401
|
+
- 714ba4b: `nifra check` reports packages duplicated with the same cause and install topology as one `duplicate-install` finding: the message names every package, and the fix and suggested config carry one `singleCopy` list covering all of them. `identityPreflight` in `--json` output still lists each package.
|
|
402
|
+
- 96f440d: `nifra check` reads a `nifra-expect` marker on a finding's own line only from that line's comment. A marker inside a string literal on the flagged line, such as `token === expected ? "nifra-expect NF-S002: ..." : ""`, no longer silences or downgrades the finding.
|
|
403
|
+
- cc81d85: `nifra check`'s fail-open gate rule (NF-S001) now reads a gate's catch block as code. Before, the words "throw" or "return false" anywhere in the block counted as failing closed, even inside a comment, a string, or a callback the catch never runs. The rule also recognises more gate names:
|
|
404
|
+
|
|
405
|
+
- `authenticate…`, `authorise…` and names ending in `Guard`.
|
|
406
|
+
- `ensure`, `verify`, `check` or `validate` followed by what a gate decides on, such as `verifyToken`, `ensureLoggedIn` or `checkPermission`. `ensureDir` and `checkHealth` are still not treated as gates.
|
|
407
|
+
|
|
408
|
+
- 7c32c99: A `nifra:generated` output schema that was edited by hand is no longer reported as current. Before, `nifra schemas` and `nifra check` (NF-C033) compared only the hash in the marker line with a fresh render. The marker still matched after an edit, so a schema widened to `t.json()` passed. Both now also compare the schema's text with what `nifra schemas --write` would write. Reformatting, comments, quote style, quoted keys, trailing commas and semicolons do not count as edits. An edited schema is reported as stale with `edited: true`, and `--write` restores the generated version.
|
|
409
|
+
- 077657f: `server({ gracefulSignals: { drainMs } })`, and `serve(app, { signals: { drainMs } })` on Node and Deno, set how long in-flight requests get to finish when SIGTERM or SIGINT stops the server before the stop forces them closed. `true` keeps the 10 second default. `nifra doctor` counts the object form as a graceful lifecycle.
|
|
410
|
+
- 9a71e97: A hydration run (`nifra assure --hydration`, `nifra replay`) that times out or is cancelled now stops every process the project's code started, not only its own child, so it ends at its timeout instead of waiting on a process still holding its output. Ctrl+C in a terminal still stops the run.
|
|
411
|
+
- 6d92f92: `nifra init-agents` now reports a symlinked agent file (a `CLAUDE.md` aliased to `AGENTS.md`, say) as left alone and writes the rest, instead of stopping the whole run. It still never writes through a symlink.
|
|
412
|
+
- 437d3cd: `postgresRoleSql` and `nifra db-role` grant the role `SELECT` on each allowed schema only. On Postgres 14 and later, with nothing excluded, the role used to get `pg_read_all_data`, which reads every schema in the database whatever `schemas` named.
|
|
413
|
+
- 3caaa91: On Windows, the `nifra_explain` MCP tool no longer shows a source codeframe for a file on another drive than the project; only files inside the project are shown.
|
|
414
|
+
- 4877175: The `nifra_routes` MCP tool now holds `since` to the project directory, like every other path argument, instead of reading a hook report from any path.
|
|
415
|
+
- 177915f: fix(mcp): `nifra mcp` re-reads the nifra version the project installs on every tool call, not only at startup. After an upgrade during a session, the version-sensitive tools (`nifra_check`, `nifra_types`, `nifra_docs`, `nifra_example`, `nifra_assure`, `nifra_contracts`) refuse with the restart fix instead of answering for the release the server started with.
|
|
416
|
+
- ca54a23: `nifra mcp` started at a workspace root no longer walks every `node_modules` below a `**` workspace pattern to find the nifra app. The probe reads only the directories a pattern can match, within a fixed budget, and an unreadable `node_modules` no longer makes it fail.
|
|
417
|
+
- 4893381: The `nifra_ws` MCP tool starts the project's backend on 127.0.0.1 for its WebSocket check. It listened on every interface, so the app, with its environment loaded, was reachable from the network while the check ran.
|
|
418
|
+
- 347d7f4: `nifra migrate layout` keeps the `;` a file was written with on every import and export it rebuilds. A module that imports a moved export (`loader`, `action`, ...) from a route, a test included, now imports it from the route's backend half, and a statement that also names what stayed is split in two; a namespace or dynamic import that reads a moved name, and `export *`, are reported. When the app is one folder down in a package (`--dir src`), imports in the code beside it that the migration moves or splits out from under them are reported with the new path, and run from the package folder it names the `--dir` to use. A loader or action without an output schema is reported with `nifra schemas --write` as the way to draft one.
|
|
419
|
+
- 20016a1: `nifra migrate layout --write` runs on a machine without git, falling back to the app's own `.gitignore` to decide whether `.nifra/` is ignored. It now removes only the folders its moves emptied, leaving folders that were already empty in place.
|
|
420
|
+
- d96c958: feat(cli): `nifra migrate layout` updates the tooling around moved code. It rewrites `mock.module()`, `vi.mock()` and `jest.mock()` paths with the imports, adds the zone folders moved TypeScript lands in to tsconfig `include` (editing only that array, comments kept), adds `.nifra/` to `.gitignore` when nothing ignores it, and reports Tailwind `content` globs that no longer match moved files. Data files (JSON, YAML, CSV and similar) are reported instead of moved, since other tools may read them by path, and folders listed under `"nifra": { "zones" }` in package.json stay where they are.
|
|
421
|
+
- 838187b: `nifra port` now scans a source file whose name only starts with "build" (such as `buildings.ts`). It still skips build scripts: `build.ts`, `build-<target>.ts` and `build.<name>.ts`.
|
|
422
|
+
- 3fc5246: The generated Python SDK imports when a named array or union schema refers to a model declared after it: model aliases are now lazy `type` statements. Responses and error bodies typed by an alias now decode into their models instead of staying plain dicts.
|
|
423
|
+
- e6cfcd7: `nifra verify --release` runs the sitemap gate (`check:sitemap`), which the default plan already ran. The full release plan skipped it, so a docs page added or removed without regenerating the sitemap passed release verification.
|
|
424
|
+
- 7396253: `nifra replay` and the `nifra_replay` MCP tool now work in a project reached through a symlinked directory, and refuse a replay file that is itself a link out of the project.
|
|
425
|
+
- 0d439a5: `nifra review` files every built-in check code under its own check. Codes added after NF-C023 fell through to `configuration`, so a private environment read or a credential in browser code (NF-C029, NF-C032) and the output-schema data guard (NF-C030, NF-C031, NF-C033) were reported as configuration rather than security. Route-table codes now report under `route-boundary`, zone imports under `server-boundary`, and contract visibility (NF-C039) under `contract-witness`.
|
|
426
|
+
- aed07a2: `nifra review --diff` no longer drops a server-only import finding (NF-C004) whose route did not change. When a changed module adds the import that pulls server code into the browser bundle, the finding is reported on the route's import line. Review now keeps the finding in scope when any project file on the chain changed. Each NF-C004 finding records the files its chain runs through, and the diagnostic's compatibility view carries them as `modules`.
|
|
427
|
+
- 7f12784: `nifra check` no longer reports these as non-constant-time secret comparisons (NF-S002): a comparison against `true` or `false`; a name whose last word states a fact about the secret rather than holding it (`type`, `kind`, `name`, `id`, `ids`, `length`, `len`, `count`, `size`, `mode`, `policy`, `version`, `sqlstate`, `status`, `enabled`, `required`, `ttl`, `expiry`, `expires`), such as `tokenType` or `SECRET_CAP_SQLSTATE`; and a comparison of two configuration reads (`process.env.X`, `Bun.env.X`, `import.meta.env.X`, `Deno.env.get("X")`, and `env.X` or `c.env.UPPER_SNAKE` where `env` or `c` is a parameter of the enclosing function). The secret word anywhere else in a name still matches, so `tokenValue`, `passwordHash`, `secretCode` and `tokenPrefix` are still reported, as is a configuration read compared with anything else.
|
|
428
|
+
- cda6392: `nifra check`'s interpolated SQL rule (NF-C006) reads a `$${...}` span as a Postgres placeholder number when the expression provably evaluates to a number: arithmetic other than `+` (which always yields one), a `+` of two numbers, the index parameter of an array callback (`map`, `forEach`, `Array.from` and the like) that is never reassigned, a `const` or `for` counter that only ever holds numbers, `params.push(...)`, `Number`/`parseInt`/`parseFloat`/`Math.*`, and the `.length` of an array a local binding builds from a literal. `xs.map(fn).join(...)` and `Array.from(n, fn).join(...)` resolve when the callback's text does, so batch `VALUES ($1, $2), ...` and `IN ($1, $2, ...)` lists no longer need a `nifra-expect` comment, and a local array built with `.push(...)` of such text (a `WHERE` builder) resolves as well. A type annotation proves nothing, so a parameter typed `number` still flags.
|
|
429
|
+
- 25d3d2b: `nifra migrate --from tailwind --to stylex` now rewrites only real JSX `className` attributes. A `className=` inside a template literal, string, comment, regex or JSX text is left as written, and a `.ts` module (which cannot hold JSX) is not rewritten.
|
|
430
|
+
- f4e6ce5: `nifra upgrade --write --json` now prints one JSON document: the post-upgrade check result is included as `check` instead of being printed as a text report after the JSON.
|
|
431
|
+
- 2b8aa01: `nifra upgrade` moves the fixed group's pins in `overrides` (npm and Bun, nested ones included), `resolutions` (Yarn and Bun) and `pnpm.overrides` along with the dependency fields, refusing a rollback there the same way, and rewrites each pin only inside the field it was read from. An override also counts toward the installed version that picks the recipes to run and toward the mixed-versions report in `nifra doctor` and `nifra check`. Another version pinned outside package.json is listed with its line and never edited: MCP configs such as `.mcp.json`, Dockerfiles and compose files, CI workflows, and lockfiles other than the workspace's own, with a note to regenerate them. The JSON plan carries them as `strayPins`.
|
|
432
|
+
- 47ed9a9: `nifra check` runs the checks that read zones (NF-C028 to NF-C033) and the server-only import check (NF-C004) only on nifra code. The directory the check runs in always counts. Below it, a package whose package.json names neither `nifra` nor a `@nifrajs/` package and has no `nifra` setting, with no `nifra.config.ts` or `backend/framework.ts` on the way up, is another project, such as another framework's app kept in the same repository, so its `routes/` folder is not read as nifra routes.
|
|
433
|
+
- Updated dependencies [7169820]
|
|
434
|
+
- Updated dependencies [42153fb]
|
|
435
|
+
- Updated dependencies [22e3df7]
|
|
436
|
+
- Updated dependencies [a0a02f4]
|
|
437
|
+
- Updated dependencies [0aed425]
|
|
438
|
+
- Updated dependencies [eaf030b]
|
|
439
|
+
- Updated dependencies [7de0397]
|
|
440
|
+
- Updated dependencies [1af7543]
|
|
441
|
+
- Updated dependencies [674c658]
|
|
442
|
+
- Updated dependencies [de27557]
|
|
443
|
+
- Updated dependencies [dd0e530]
|
|
444
|
+
- Updated dependencies [2173644]
|
|
445
|
+
- Updated dependencies [c333ca7]
|
|
446
|
+
- Updated dependencies [4d894b0]
|
|
447
|
+
- Updated dependencies [4edee67]
|
|
448
|
+
- Updated dependencies [281f5de]
|
|
449
|
+
- Updated dependencies [6a95376]
|
|
450
|
+
- Updated dependencies [6426107]
|
|
451
|
+
- Updated dependencies [23b3672]
|
|
452
|
+
- Updated dependencies [61901cd]
|
|
453
|
+
- Updated dependencies [5e366e2]
|
|
454
|
+
- Updated dependencies [2938a0d]
|
|
455
|
+
- Updated dependencies [dc8439c]
|
|
456
|
+
- Updated dependencies [b19cb37]
|
|
457
|
+
- Updated dependencies [4330e40]
|
|
458
|
+
- Updated dependencies [4199ff3]
|
|
459
|
+
- Updated dependencies [90d9ee6]
|
|
460
|
+
- Updated dependencies [364a234]
|
|
461
|
+
- Updated dependencies [c06cba5]
|
|
462
|
+
- Updated dependencies [f4d3852]
|
|
463
|
+
- Updated dependencies [4a82ae0]
|
|
464
|
+
- Updated dependencies [0ff867a]
|
|
465
|
+
- Updated dependencies [e7391bf]
|
|
466
|
+
- Updated dependencies [0b80a59]
|
|
467
|
+
- Updated dependencies [c64db12]
|
|
468
|
+
- Updated dependencies [3753104]
|
|
469
|
+
- Updated dependencies [4b3b1fa]
|
|
470
|
+
- Updated dependencies [3562557]
|
|
471
|
+
- Updated dependencies [53087f3]
|
|
472
|
+
- Updated dependencies [2def6c7]
|
|
473
|
+
- Updated dependencies [b5b5bc3]
|
|
474
|
+
- Updated dependencies [22e1777]
|
|
475
|
+
- Updated dependencies [3a483cd]
|
|
476
|
+
- Updated dependencies [35f52c7]
|
|
477
|
+
- Updated dependencies [343cb81]
|
|
478
|
+
- Updated dependencies [8860117]
|
|
479
|
+
- Updated dependencies [412a9ee]
|
|
480
|
+
- Updated dependencies [65883e5]
|
|
481
|
+
- Updated dependencies [0e20529]
|
|
482
|
+
- Updated dependencies [d91fd44]
|
|
483
|
+
- Updated dependencies [f7e36ec]
|
|
484
|
+
- Updated dependencies [262e46d]
|
|
485
|
+
- Updated dependencies [b13e071]
|
|
486
|
+
- Updated dependencies [944623d]
|
|
487
|
+
- Updated dependencies [6d9869d]
|
|
488
|
+
- Updated dependencies [077657f]
|
|
489
|
+
- Updated dependencies [b9cc68c]
|
|
490
|
+
- Updated dependencies [de2cc1d]
|
|
491
|
+
- Updated dependencies [a5963cb]
|
|
492
|
+
- Updated dependencies [05aac0e]
|
|
493
|
+
- Updated dependencies [1a6616f]
|
|
494
|
+
- Updated dependencies [ecd738e]
|
|
495
|
+
- Updated dependencies [7775c2b]
|
|
496
|
+
- Updated dependencies [3db36b3]
|
|
497
|
+
- Updated dependencies [7544cc0]
|
|
498
|
+
- Updated dependencies [dab880c]
|
|
499
|
+
- Updated dependencies [7775c2b]
|
|
500
|
+
- Updated dependencies [09c47c5]
|
|
501
|
+
- Updated dependencies [326caee]
|
|
502
|
+
- Updated dependencies [f8e0ed5]
|
|
503
|
+
- Updated dependencies [a588c18]
|
|
504
|
+
- Updated dependencies [1cdcfe5]
|
|
505
|
+
- Updated dependencies [e195fe8]
|
|
506
|
+
- Updated dependencies [846e2f6]
|
|
507
|
+
- Updated dependencies [55f4fdb]
|
|
508
|
+
- Updated dependencies [7775c2b]
|
|
509
|
+
- Updated dependencies [d3e79c4]
|
|
510
|
+
- Updated dependencies [d922f65]
|
|
511
|
+
- Updated dependencies [5b17850]
|
|
512
|
+
- Updated dependencies [e58690c]
|
|
513
|
+
- Updated dependencies [5377b66]
|
|
514
|
+
- Updated dependencies [437d3cd]
|
|
515
|
+
- Updated dependencies [cd07938]
|
|
516
|
+
- Updated dependencies [aadd9fc]
|
|
517
|
+
- Updated dependencies [ea16748]
|
|
518
|
+
- Updated dependencies [a1eda0a]
|
|
519
|
+
- Updated dependencies [fc0284a]
|
|
520
|
+
- Updated dependencies [5b22f4d]
|
|
521
|
+
- Updated dependencies [1b94593]
|
|
522
|
+
- Updated dependencies [9f58295]
|
|
523
|
+
- Updated dependencies [62d73a7]
|
|
524
|
+
- Updated dependencies [2f7299a]
|
|
525
|
+
- Updated dependencies [29e62a0]
|
|
526
|
+
- Updated dependencies [c613e7d]
|
|
527
|
+
- Updated dependencies [5975163]
|
|
528
|
+
- Updated dependencies [b9608ac]
|
|
529
|
+
- Updated dependencies [7a165de]
|
|
530
|
+
- Updated dependencies [4064f36]
|
|
531
|
+
- Updated dependencies [d8f11a5]
|
|
532
|
+
- Updated dependencies [e9e02cf]
|
|
533
|
+
- Updated dependencies [b70b18a]
|
|
534
|
+
- Updated dependencies [6f42b38]
|
|
535
|
+
- Updated dependencies [870227d]
|
|
536
|
+
- Updated dependencies [b77ae4c]
|
|
537
|
+
- Updated dependencies [6ad9582]
|
|
538
|
+
- Updated dependencies [48aad8c]
|
|
539
|
+
- Updated dependencies [c669308]
|
|
540
|
+
- Updated dependencies [2fbb4f0]
|
|
541
|
+
- Updated dependencies [1d66252]
|
|
542
|
+
- Updated dependencies [a6a6834]
|
|
543
|
+
- Updated dependencies [166a6ff]
|
|
544
|
+
- Updated dependencies [79be5af]
|
|
545
|
+
- Updated dependencies [41050ed]
|
|
546
|
+
- Updated dependencies [fc837cb]
|
|
547
|
+
- Updated dependencies [c92f85f]
|
|
548
|
+
- Updated dependencies [bf6eeb0]
|
|
549
|
+
- Updated dependencies [5a3c27a]
|
|
550
|
+
- Updated dependencies [15a3a66]
|
|
551
|
+
- Updated dependencies [b7eff12]
|
|
552
|
+
- Updated dependencies [c669c6a]
|
|
553
|
+
- Updated dependencies [b40e83e]
|
|
554
|
+
- Updated dependencies [067ea67]
|
|
555
|
+
- Updated dependencies [b80ce77]
|
|
556
|
+
- Updated dependencies [6e88552]
|
|
557
|
+
- Updated dependencies [9b971fc]
|
|
558
|
+
- Updated dependencies [2577fc7]
|
|
559
|
+
- Updated dependencies [9b1acc9]
|
|
560
|
+
- Updated dependencies [391ab3c]
|
|
561
|
+
- Updated dependencies [3bf7d6b]
|
|
562
|
+
- Updated dependencies [7775c2b]
|
|
563
|
+
- Updated dependencies [ab1935b]
|
|
564
|
+
- Updated dependencies [740109f]
|
|
565
|
+
- Updated dependencies [e0a25fe]
|
|
566
|
+
- Updated dependencies [3630b6e]
|
|
567
|
+
- Updated dependencies [1290c6d]
|
|
568
|
+
- Updated dependencies [d0a7d58]
|
|
569
|
+
- @nifrajs/web@5.0.0
|
|
570
|
+
- @nifrajs/agent-review@5.0.0
|
|
571
|
+
- @nifrajs/core@5.0.0
|
|
572
|
+
- @nifrajs/mcp@5.0.0
|
|
573
|
+
- @nifrajs/testing@5.0.0
|
|
574
|
+
- @nifrajs/client@5.0.0
|
|
575
|
+
- @nifrajs/i18n@5.0.0
|
|
576
|
+
- @nifrajs/mcp-db@5.0.0
|
|
577
|
+
- @nifrajs/schema@5.0.0
|
|
578
|
+
- @nifrajs/runner@5.0.0
|
|
579
|
+
|
|
580
|
+
## 4.0.2
|
|
581
|
+
|
|
582
|
+
### Patch Changes
|
|
583
|
+
|
|
584
|
+
- Updated dependencies [fcd6a5b]
|
|
585
|
+
- @nifrajs/web@4.0.2
|
|
586
|
+
- @nifrajs/agent-review@4.0.2
|
|
587
|
+
- @nifrajs/client@4.0.2
|
|
588
|
+
- @nifrajs/core@4.0.2
|
|
589
|
+
- @nifrajs/i18n@4.0.2
|
|
590
|
+
- @nifrajs/mcp@4.0.2
|
|
591
|
+
- @nifrajs/mcp-db@4.0.2
|
|
592
|
+
- @nifrajs/runner@4.0.2
|
|
593
|
+
- @nifrajs/schema@4.0.2
|
|
594
|
+
- @nifrajs/testing@4.0.2
|
|
595
|
+
- create-nifra@4.0.2
|
|
596
|
+
|
|
597
|
+
## 4.0.1
|
|
598
|
+
|
|
599
|
+
### Patch Changes
|
|
600
|
+
|
|
601
|
+
- 3fffcd1: `nifra migrate layout` puts a module only route pages use in `frontend/` even when a generated
|
|
602
|
+
`server-manifest.ts` imports every page. The server renders a page it imports rather than running it,
|
|
603
|
+
so the server's reach stops at route pages.
|
|
604
|
+
- fb8e364: `nifra migrate layout` re-points a moved module's paths from its own location so each still reaches
|
|
605
|
+
what it did: `join(import.meta.dir, "..", "x")`, `import.meta.dir + "/../x"`, `` `${__dirname}/../x` ``
|
|
606
|
+
and `new URL("../x", import.meta.url)` with literal segments; any other use of its location is
|
|
607
|
+
reported. It also reports a folder that some files leave while others stay (a runner that lists
|
|
608
|
+
`migrations/` misses what moved), and scripts or config beside the code (`package.json`, shell scripts,
|
|
609
|
+
YAML, TOML) that name a moved file by path. An import that still reads like an old path but resolves
|
|
610
|
+
after the moves is no longer reported.
|
|
611
|
+
- 12e420e: `nifra sync-manifest` fails when `routes/` does not build a route table, such as a duplicate route or
|
|
612
|
+
two routes of one shape that share a path. It prints the error under the manifest's file name, leaves
|
|
613
|
+
the manifest untouched, and exits with status 1, where it used to report that no generated
|
|
614
|
+
server-manifest.ts was found and exit 0. The `nifra_sync_manifest` MCP tool answers `ok: false` with
|
|
615
|
+
the error on that manifest's result, and the `manifest.sync` fix recipe refuses with the same error.
|
|
616
|
+
The command also prints one line per manifest: synced (with added and removed routes), already in
|
|
617
|
+
sync, or refused.
|
|
618
|
+
- be27a41: `nifra upgrade` to 4.0 notes two more changes an app may hit. Page routes of one shape that share a
|
|
619
|
+
path fail with "overlapping routes", and same-method backend registrations that accept a shared path
|
|
620
|
+
are reported (NF-C024). `contracts.lock.json` also needs one `nifra contracts snapshot`: a route whose
|
|
621
|
+
schema has a property named `description`, `title`, `default`, `example` or `examples` gets a new
|
|
622
|
+
digest, because earlier digests skipped those properties.
|
|
623
|
+
- Updated dependencies [bbb2b27]
|
|
624
|
+
- Updated dependencies [2957acd]
|
|
625
|
+
- Updated dependencies [4bd292a]
|
|
626
|
+
- Updated dependencies [55e813b]
|
|
627
|
+
- @nifrajs/web@4.0.1
|
|
628
|
+
- @nifrajs/agent-review@4.0.1
|
|
629
|
+
- @nifrajs/client@4.0.1
|
|
630
|
+
- @nifrajs/core@4.0.1
|
|
631
|
+
- @nifrajs/i18n@4.0.1
|
|
632
|
+
- @nifrajs/mcp@4.0.1
|
|
633
|
+
- @nifrajs/mcp-db@4.0.1
|
|
634
|
+
- @nifrajs/runner@4.0.1
|
|
635
|
+
- @nifrajs/schema@4.0.1
|
|
636
|
+
- @nifrajs/testing@4.0.1
|
|
637
|
+
- create-nifra@4.0.1
|
|
638
|
+
|
|
639
|
+
## 4.0.0
|
|
640
|
+
|
|
641
|
+
### Major Changes
|
|
642
|
+
|
|
643
|
+
- 214d674: feat(cli)!: `backend/app.ts` and `backend/framework.ts`, and `nifra migrate layout`
|
|
644
|
+
|
|
645
|
+
The CLI reads the backend from `backend/app.ts` and the render adapter from `backend/framework.ts`.
|
|
646
|
+
An app that still has a root `backend.ts` or `framework.ts` is refused with the command that moves it.
|
|
647
|
+
|
|
648
|
+
`nifra migrate layout` moves an app onto the zoned layout: it splits each route into `x.tsx` and
|
|
649
|
+
`x.backend.ts`, folds `_middleware.ts` into `_layout.backend.ts`, moves the root files under
|
|
650
|
+
`backend/`, places every other module in `frontend/`, `backend/` or `shared/` by who imports it, and
|
|
651
|
+
rewrites the imports. It is a dry run until `--write`, and it lists what it could not decide - a
|
|
652
|
+
helper both halves need, a page that reads a server export at runtime, a path named in a string.
|
|
653
|
+
|
|
654
|
+
`nifra check` holds source to the same zones the builds enforce, with the same classifier
|
|
655
|
+
(`@nifrajs/web/zones`). NF-C004 follows browser code - a route's frontend half, `frontend/` and
|
|
656
|
+
`shared/` - to Node and Bun built-ins, server packages, backend modules and the `backend-only` marker,
|
|
657
|
+
naming the chain; a `*.fn.ts` module counts as its stub. NF-C028 reports a zoned file importing one in
|
|
658
|
+
no zone, backend code importing frontend code, and shared code importing anything but shared code.
|
|
659
|
+
NF-C029 reports browser code reading a private environment variable, honouring a literal
|
|
660
|
+
`publicEnvPrefix` in `backend/framework.ts`. NF-C005 names the retired `@nifrajs/web/server-only` and
|
|
661
|
+
`@nifrajs/web/plugins/vite-server-only` imports with their replacements. A route's `x.backend.ts` half
|
|
662
|
+
counts as a route file for manifest drift (NF-C012), and NF-S002 grades severity by zone.
|
|
663
|
+
|
|
664
|
+
- 6c978a1: feat(cli)!: the deploy target lives in `nifra.config.ts`
|
|
665
|
+
|
|
666
|
+
- `export const target = "node"` in `nifra.config.ts` is what `nifra build` emits without
|
|
667
|
+
`--target` (still `bun` when neither is given). `nifra port` and `nifra doctor` read it before any
|
|
668
|
+
script heuristic.
|
|
669
|
+
- `nifra target` shows it; `nifra target <t>` switches it, rewriting only that line.
|
|
670
|
+
- The Cloudflare Pages target is `cloudflare` in `nifra build --target`, `nifra port --target` and the
|
|
671
|
+
config; `cf-pages` is refused with the new name.
|
|
672
|
+
|
|
673
|
+
### Minor Changes
|
|
674
|
+
|
|
675
|
+
- c3057ee: feat: AGENTS.md is the one copy of an app's agent guidance
|
|
676
|
+
|
|
677
|
+
A scaffold and `nifra init-agents` write `AGENTS.md` plus a pointer to it for each agent:
|
|
678
|
+
`CLAUDE.md` and `GEMINI.md` import it, `.cursor/rules/nifra.mdc` is an always-applied Cursor rule
|
|
679
|
+
that attaches it, and `.github/copilot-instructions.md` names it. None of them carries guidance of its
|
|
680
|
+
own, so they cannot drift apart. A web app's `AGENTS.md` gains a "Project structure" section on the
|
|
681
|
+
frontend/backend zones the build enforces, and `nifra init-agents` appends it to an app with `routes/`.
|
|
682
|
+
|
|
683
|
+
- 4e31e3f: `nifra cdn-check <url>` checks a deployed page behind a CDN. It requests the page twice and once as a soft navigation, names the CDN (Cloudflare, Vercel or Fastly) from its status header, and reports whether the second request was served from cache. It fails, exiting 1, when `x-nifra-isr-*` headers reach the visitor or when a soft navigation is answered with the cached document, which is what a Cloudflare zone does without a Cache Rule bypassing requests that carry `x-nifra-data`. It also warns when CDN-only headers are visible or when browsers may keep the HTML. CLI only.
|
|
684
|
+
- 6902bac: fix(cli): `nifra check` follows a literal dynamic `import()` from browser code
|
|
685
|
+
|
|
686
|
+
The backend-code check (NF-C004) treats `import("../lib/x")` with a string-literal specifier like a
|
|
687
|
+
static import: from a page and through its local imports, down to backend code, a Node built-in, a
|
|
688
|
+
known server package or a module marked `@nifrajs/web/backend-only`. The client build bundles a
|
|
689
|
+
dynamic import's target as a lazy chunk, so these were build failures `nifra check` passed. Type
|
|
690
|
+
positions (`typeof import("x")`, `import("x").Pool`) and computed specifiers are not followed. A
|
|
691
|
+
removed package imported dynamically is reported too.
|
|
692
|
+
|
|
693
|
+
- d680264: feat(cli): `nifra check` reports route data without an output schema
|
|
694
|
+
|
|
695
|
+
NF-C030 warns about a route backend half whose loader or action may return data without its
|
|
696
|
+
`loaderOutput` or `actionOutput`. NF-C031 is an error for an output schema that names a sensitive
|
|
697
|
+
field (`password`, `token`, `apiKey`, ...) without `t.declassified`.
|
|
698
|
+
|
|
699
|
+
- a4428b2: `nifra db` and the `nifra_db_schema`, `nifra_db_query` and `nifra_db_role` MCP tools read the development database an app declares as `devDatabase` in `nifra.config.ts`, SQLite or Postgres. `DATABASE_URL` is never read on its own.
|
|
700
|
+
|
|
701
|
+
- `nifra db schema [<table>]` lists tables, row estimates, columns, keys and indexes. `nifra db query "<sql>"` runs one read-only SELECT, and `--explain [--analyze]` returns its plan. Queries are on for a declared database unless `query: false`; a Postgres host other than loopback, `*.localhost` or a unix socket needs `allowHosts`.
|
|
702
|
+
- Each call runs in a fresh process that is killed at `timeoutMs` plus one second, so a runaway query or a crash comes back as a refusal with a stable `NIFRA_DB_*` code, a fix and a docs link.
|
|
703
|
+
- A Postgres superuser, or a role that can reach server files, server programs or another database, is refused queries. `nifra db role` prints the SQL for a read-only role and runs none of it.
|
|
704
|
+
- A query that reads a credential column (or one in `redactColumns`) in any form is refused with `NIFRA_DB_COLUMN_REFUSED`, unless `revealColumns` names it. Rows are capped by `maxRows` and `maxResultBytes`, values pass through the dev feed's redactor, and every answer is marked untrusted.
|
|
705
|
+
- Each call is appended to `.nifra/db-audit.jsonl` (owner-only, rotated at 1 MB) with its redacted SQL, fingerprint, row count, duration and refusal code, never its rows. `nifra db audit` shows it.
|
|
706
|
+
|
|
707
|
+
- 8b99424: feat: `nifra errors`, `nifra logs` and their MCP tools read the running dev server
|
|
708
|
+
|
|
709
|
+
`nifra errors` / `nifra_errors` and `nifra logs` / `nifra_logs` find the project's running
|
|
710
|
+
`nifra dev` server without being given a port (its record, else the one live server among a
|
|
711
|
+
workspace's apps), check that it answers as itself, and read what it recorded: errors as structured
|
|
712
|
+
diagnostics with filters by category, request and staleness, and console output by level, source,
|
|
713
|
+
request and text. Pass the returned `cursor` as `since` to see only what is new. When the server is
|
|
714
|
+
gone they read the log it left behind, so a crash still leaves a record. `nifra errors` exits 1 while
|
|
715
|
+
the current code has open errors. Every answer says that entry text is application output, to be
|
|
716
|
+
read as data.
|
|
717
|
+
|
|
718
|
+
`nifra_explain` no longer needs a port: with no pasted error it returns the latest error of any
|
|
719
|
+
kind. `nifra_inspect` reads the dev server's own request traces (with a `requestId` filter), so it
|
|
720
|
+
no longer needs the `@nifrajs/devtools` plugin, and falls back to it only for a port no record names.
|
|
721
|
+
`nifra_run` results carry the console output and the structured errors each request produced.
|
|
722
|
+
|
|
723
|
+
- 20c05b2: `nifra i18n check` looks for its entry module at `shared/i18n.ts` first, where an app keeps the locales and catalogs both sides import.
|
|
724
|
+
- 595a4e3: feat(cli): `nifra init-agents` at a workspace root names its nifra member in the MCP launch. When the
|
|
725
|
+
root is not itself a nifra project and exactly one workspace member is, the `.mcp.json` and
|
|
726
|
+
`.cursor/mcp.json` it writes launch `mcp <member>`, and `--sync-mcp` adds the member to an existing
|
|
727
|
+
launch that names no directory. A launch that already names one keeps it, the markdown launch commands
|
|
728
|
+
keep their wording, and with several nifra members nothing is named. `--sync-mcp` also pins to the
|
|
729
|
+
member's installed nifra when the root has none, as in an isolated install.
|
|
730
|
+
- 4acb99f: feat(cli): `nifra mcp` started at a package-manager workspace root serves its nifra app.
|
|
731
|
+
When neither the spawn directory nor any ancestor is a nifra project, the server reads the spawn
|
|
732
|
+
directory's `package.json` `workspaces` (the array form or `{ packages }`), and adopts the one member
|
|
733
|
+
that depends on `@nifrajs/*` or has a `nifra.config.ts`. The root's source reads `workspace`. With
|
|
734
|
+
several nifra members it adopts none, and project tools refuse with a message naming each member to
|
|
735
|
+
pass to `nifra mcp <dir>`. A client workspace folder that is a workspace root offers its nifra member
|
|
736
|
+
the same way. An explicit `nifra mcp <dir>` is never redirected, and `node_modules` is never a member.
|
|
737
|
+
- 505a5f4: `nifra migrate layout` also moves an app off the retired names and reports what the data guard needs:
|
|
738
|
+
|
|
739
|
+
- each `x.server.ts` module moves under `backend/` without the suffix (`lib/db.server.ts` becomes
|
|
740
|
+
`backend/lib/db.ts`), and every import of it is rewritten; one a route frontend still imports at
|
|
741
|
+
runtime, or whose new path is taken, is reported instead;
|
|
742
|
+
- `@nifrajs/web/server-only` imports become `@nifrajs/web/backend-only`, and `ServerOnly` imported from
|
|
743
|
+
`@nifrajs/web` becomes `BackendOnly`;
|
|
744
|
+
- an import of `@nifrajs/web/plugins/vite-server-only` is reported for removal;
|
|
745
|
+
- a loader or action that returns data without `loaderOutput` / `actionOutput` is reported, since the
|
|
746
|
+
server refuses that data.
|
|
747
|
+
|
|
748
|
+
- a8b33bc: `nifra check` reports an import of a name that moved to a package subpath under NF-C005, naming the module that exports it now, and `nifra fix --code NF-C005` rewrites the import - re-exports and aliases included. It covers `solidBunPlugin` (`@nifrajs/web-solid/plugin`) and `svelteBunPlugin` (`@nifrajs/web-svelte/plugin`).
|
|
749
|
+
- df9352a: `nifra_scaffold` returns a route pair: the page, typed through its generated `./+types` module, and
|
|
750
|
+
its `.backend.ts` half with the loader and its `loaderOutput` schema. With `write`, it creates both
|
|
751
|
+
files (refusing when either exists) and generates the route's types. Vanilla pages declare
|
|
752
|
+
`hydrate = false` and their `islandScripts` in the backend half.
|
|
753
|
+
- 22e2af8: feat(cli): `nifra check` reports credentials in browser code
|
|
754
|
+
|
|
755
|
+
NF-C032 is an error for what looks like a credential in a route's frontend half, `frontend/`,
|
|
756
|
+
`shared/` or `public/`, with the scanner `nifra build` runs. `nifra build` reads `secretExemptions`
|
|
757
|
+
from `nifra.config.ts`, and `nifra check` honors the same entries when they are written as literals.
|
|
758
|
+
|
|
759
|
+
- 046a1e1: feat(cli): `nifra upgrade` runs every release recipe between the installed version and the target
|
|
760
|
+
|
|
761
|
+
The installed version is the lowest `@nifrajs/*`, `nifra` or `create-nifra` version the workspace
|
|
762
|
+
declares. `nifra upgrade <version>` applies each release recipe after it, up to the target, oldest
|
|
763
|
+
first - dependency moves, import moves and notes labeled by release - then pins the fixed group to the
|
|
764
|
+
target, so a 1.x or 2.x app reaches the target in one run. Any version up to the CLI's own is a target.
|
|
765
|
+
`--exact` pins exact versions instead of keeping `^`/`~`.
|
|
766
|
+
|
|
767
|
+
A target newer than the CLI prints the command for that release's CLI
|
|
768
|
+
(`bunx @nifrajs/cli@<version> upgrade <version>`, with the same flags) and changes nothing; a target
|
|
769
|
+
that is not a bare release version is refused. The 4.0.0 recipe moves `@nifrajs/web/server-only`
|
|
770
|
+
imports to `@nifrajs/web/backend-only`, leads with `nifra migrate layout`, and notes the changes an
|
|
771
|
+
existing app may observe: the zoned layout, required output schemas, the credential scan, the
|
|
772
|
+
`cloudflare` target name, `withISR` query bypass, pages under a mount failing at startup, exact method matching,
|
|
773
|
+
resolved dot segments, JSON media-type matching, required endpoint secrets, the empty `clientEntry`
|
|
774
|
+
error, typed-client dot-segment refusal, canonical base64url signatures and locale-formatted plural `#`.
|
|
775
|
+
|
|
776
|
+
- a0cfffa: `export const clientIp = "platform"` in `nifra.config.ts` makes a `cloudflare` or `vercel` build read `c.clientIp` from the header that platform's edge overwrites (`cf-connecting-ip`, `x-real-ip`), so per-caller middleware such as `rateLimit` works there. Without it an edge build still has no caller address; Bun, Node and Deno builds use the socket peer either way. `buildTarget` and `generateServerEntry` take the same `clientIp` option. Site scaffolds declare it.
|
|
777
|
+
- 93e5e7f: Errors come with a prompt to paste into a coding agent: the error, where it is, the recognised cause, one fix, and steps that end in a check the agent runs itself (`nifra_errors` with a `since` cursor, then `nifra check`). App-supplied text is fenced and labeled as data, paths are project-relative, the home directory never appears, and the prompt is capped at 8000 characters.
|
|
778
|
+
|
|
779
|
+
- Codes with more than one right fix (`NIFRA_BACKEND_IN_CLIENT`, `NIFRA_BACKEND_ONLY_IN_CLIENT`, `NIFRA_OUTPUT_SENSITIVE_FIELD`, `NIFRA_OUTPUT_UNDECLARED_DEFERRED`, `NIFRA_OUTPUT_RAW_RESPONSE`, `NIFRA_OUTPUT_SCHEMA_MISMATCH`) list each as a labeled `fixOptions` entry on the `Diagnostic`, with one prompt per option.
|
|
780
|
+
- The dev overlay has a Copy prompt button per fix. A page load whose render throws gets the overlay on both dev pipelines; data requests and API calls keep the app's JSON 500.
|
|
781
|
+
- A dev page that reports a browser error shows a badge listing that page's errors with their code, message, codeframe, fix and Copy prompt buttons. It renders in a closed shadow root, loads under the page's CSP (nonce, exact URL, or `'strict-dynamic'`), is only fetched once a page errors, and turns off with `nifra dev --no-indicator`, `export const dev = { indicator: false }` in `nifra.config.ts`, or `indicator: false` on `createDevServer`/`createViteDevServer`.
|
|
782
|
+
- `nifra errors --prompt` (and `nifra_errors` with `prompt: true`) prints the prompt for the newest entry; `--id` picks an entry and `--option` picks a fix by its label.
|
|
783
|
+
- `@nifrajs/web/diagnostic-prompt` exports `buildFixPrompt`, `fixPrompts` and `catalogFixPrompts` without Node APIs, for use in a browser bundle.
|
|
784
|
+
|
|
785
|
+
- 772249a: feat(i18n): catalog checks - `checkCatalogs()` and `nifra i18n check`
|
|
786
|
+
|
|
787
|
+
`checkCatalogs({ locales, catalogs, ignore })` from the new `@nifrajs/i18n/check` entry checks every
|
|
788
|
+
catalog in a locale registry the way `t()` reads it: coverage per locale (counting messages inherited
|
|
789
|
+
through `chain()`), missing keys and keys the default catalog does not have, ICU syntax,
|
|
790
|
+
placeholder and rich-tag parity with the default message, a missing `other` case, plural categories
|
|
791
|
+
the locale's grammar uses that a message never states, script purity (letters outside
|
|
792
|
+
`Intl.Locale(tag).maximize().script`, and, as a warning, words mixing Latin with it), and messages identical to the
|
|
793
|
+
default in another language. It returns findings with a severity (`error`, `warning`, `info`) and a
|
|
794
|
+
per-locale coverage table; `ignore` skips keys per check.
|
|
795
|
+
|
|
796
|
+
`nifra i18n check [entry]` imports the module exporting `locales` and `catalogs` (the first
|
|
797
|
+
`i18n.ts` in the project root, `lib/`, `src/`, `src/lib/` or `app/` by default; catalogs may be
|
|
798
|
+
lazy loaders such as `() => import("./fr.json")`) and prints the report. It exits 1 on an error, and
|
|
799
|
+
with `--strict` on a warning; `--json` prints the result.
|
|
800
|
+
|
|
801
|
+
- ff4a062: feat(core): one handler can be registered under several methods, and under a method outside the
|
|
802
|
+
standard seven, with `all()` and `method()` from `@nifrajs/core/methods`:
|
|
803
|
+
|
|
804
|
+
```ts
|
|
805
|
+
import { server } from "@nifrajs/core/server";
|
|
806
|
+
import { all, method } from "@nifrajs/core/methods";
|
|
807
|
+
|
|
808
|
+
const app = server()
|
|
809
|
+
// GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS /echo
|
|
810
|
+
.use(all("/echo", (c) => ({ method: c.req.method })))
|
|
811
|
+
.use(method("PURGE", "/cache/:key", (c) => ({ purged: c.params.key })))
|
|
812
|
+
.use(method(["GET", "POST"], "/search", (c) => ({ q: c.query.get("q") })));
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
- Each method is an ordinary route: it is listed by `app.routes()`, takes a schema and hooks, works
|
|
816
|
+
inside `group()`, and throws `DUPLICATE_ROUTE` against a route already registered for the same
|
|
817
|
+
method and path. One call is one registration: if any of its routes is refused, none is added.
|
|
818
|
+
- `all()` is the seven standard methods, not a catch-all. A request with any other method is still a
|
|
819
|
+
`405` with an `Allow` header. `mount()` remains the way to pass every method through.
|
|
820
|
+
- A method name is case-insensitive and registered uppercase. It is a token of letters, digits and
|
|
821
|
+
hyphens that starts with a letter, at most 32 characters. `TRACE`, `CONNECT` and `TRACK` cannot be
|
|
822
|
+
registered; those and any other value throw `INVALID_METHOD`.
|
|
823
|
+
- The standard methods in a call join the typed registry and the typed client. A custom method has
|
|
824
|
+
no typed-client call.
|
|
825
|
+
- An assurance policy's `methods` selector takes standard methods only, so it never matches a
|
|
826
|
+
custom-method route. Classify such a route with a path rule; unmatched, it is reported as
|
|
827
|
+
`unclassified-route`.
|
|
828
|
+
- Whether a custom method reaches the app is up to the runtime's HTTP parser: `PROPFIND`, `REPORT`,
|
|
829
|
+
`PURGE` and `QUERY` arrive on Bun, Node, Deno and workerd, and a token the parser does not know
|
|
830
|
+
can be answered by the runtime itself.
|
|
831
|
+
- `Router.add` from `@nifrajs/core/router` accepts the same method tokens, and
|
|
832
|
+
`isRegistrableMethod(name)` from that subpath reports whether a name is one.
|
|
833
|
+
`RouteDescriptor.method` is typed `RouteMethod`: a standard `Method` or another such token.
|
|
834
|
+
|
|
835
|
+
feat(schema): `toOpenAPI` leaves a custom-method route out of the document. A path item has a field
|
|
836
|
+
for each standard method and none for any other.
|
|
837
|
+
|
|
838
|
+
feat(cli): `nifra check` reads the routes `all()` and `method()` register, so the duplicate,
|
|
839
|
+
overlap, reserved-segment and param-modifier rules cover them, reported once per call. The route
|
|
840
|
+
brief and `--json` output list a custom-method route with a `fetch` call. The capability report
|
|
841
|
+
attributes a module to every path an optional-param route serves, and to `all()` and `method()`
|
|
842
|
+
routes.
|
|
843
|
+
|
|
844
|
+
- 8e30090: feat: a mount nifra cannot analyze is a declared known gap, not a silent hole. Routes behind
|
|
845
|
+
`mount()` and `mountFetch()` are invisible to route reflection, so capability assurance could not
|
|
846
|
+
see them and said nothing. Both now take `opaque: "<reason>"`, and so does a `createWebApp`
|
|
847
|
+
`mounts` entry. Capability assurance lists a mount with a reason as a known gap
|
|
848
|
+
(`report.gaps`, `{ kind: "opaque-mount", path, reason }`): `nifra check` and
|
|
849
|
+
`nifra capabilities check` print it on every run, and it fails nothing and lowers no level. A mount
|
|
850
|
+
on the analyzed app without a reason fails with the new `opaque-mount-undeclared` finding, which
|
|
851
|
+
suggests `merge()` for a nifra `server()` and `opaque` for anything else. A mount whose app publishes
|
|
852
|
+
composed evidence (the API `createWebApp` mounts) is not reported. `webProjectEvidence` accepts a
|
|
853
|
+
`mounts` entry without an evidence provider when it declares `opaque`. New exports:
|
|
854
|
+
`reflectMounts` and `ReflectedMount` from `@nifrajs/core/reflection`, `CapabilityGap` from
|
|
855
|
+
`@nifrajs/core/capabilities`; project evidence snapshots gain an optional `mounts` list, absent for
|
|
856
|
+
an app with no mounts.
|
|
857
|
+
- 28f3aaf: feat(core): a path can end in optional params, written `:name?`. The route serves the path with the
|
|
858
|
+
param and without it:
|
|
859
|
+
|
|
860
|
+
```ts
|
|
861
|
+
app
|
|
862
|
+
// GET /users and GET /users/42
|
|
863
|
+
.get("/users/:id?", (c) =>
|
|
864
|
+
c.params.id === undefined ? { all: true } : { id: c.params.id }
|
|
865
|
+
)
|
|
866
|
+
// GET /archive, GET /archive/2026 and GET /archive/2026/09
|
|
867
|
+
.get("/archive/:year?/:month?", (c) => ({
|
|
868
|
+
year: c.params.year,
|
|
869
|
+
month: c.params.month,
|
|
870
|
+
}));
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
- Optional params are whole segments at the end of the path. Several in a row are filled left to
|
|
874
|
+
right: a later one is present only when every earlier one is. A `?` anywhere else (`/a/:id?/b`,
|
|
875
|
+
`/v-:id?`) is literal text, as before.
|
|
876
|
+
- An optional param is typed `string | undefined`. When the path omits it, it is absent from
|
|
877
|
+
`c.params`, not an empty string. A `params` schema that requires it answers `422` on the shorter
|
|
878
|
+
path.
|
|
879
|
+
- The route is registered once per path it serves, with the same handler, schema and hooks.
|
|
880
|
+
`app.routes()`, `group()`, `merge()`, `implement()`, `ws()` and the typed registry all see those
|
|
881
|
+
paths, so `GET /users` registered next to `GET /users/:id?` throws `DUPLICATE_ROUTE`. A route that
|
|
882
|
+
is rejected leaves none of its HTTP paths registered.
|
|
883
|
+
- The typed client calls each path: `api.users.get()` and `api.users({ id }).get()`.
|
|
884
|
+
- `defineContract` accepts the same paths; two operations that serve the same method and path are
|
|
885
|
+
refused.
|
|
886
|
+
- `expandOptionalParams(pattern)` from `@nifrajs/core/pattern` returns the paths a pattern serves,
|
|
887
|
+
shortest first. `Router.add` from `@nifrajs/core/router` registers exactly the pattern it is given;
|
|
888
|
+
a caller that wants the optional form adds each expanded pattern.
|
|
889
|
+
- `routePatternOverlap` compares every path each side serves, under one work budget for the call.
|
|
890
|
+
|
|
891
|
+
feat(edge): the compact server accepts the same optional params.
|
|
892
|
+
|
|
893
|
+
feat(schema): `toOpenAPI` emits one operation per path an optional-param route serves. A shorter
|
|
894
|
+
path declares only the parameters it has. For a contract, the operation name is the `operationId` of
|
|
895
|
+
the full path, and the shorter paths carry none.
|
|
896
|
+
|
|
897
|
+
feat(cli): `nifra check` reports `NF-C026` (warning) for a param followed by `?`, `*`, `+`, `{`, `(`
|
|
898
|
+
or `<` that the path grammar reads as literal text, and names a `?` route that no request can reach.
|
|
899
|
+
`// nifra-expect param-modifier` above the registration marks a deliberate literal. Overlap and
|
|
900
|
+
duplicate checks read an optional-param route as every path it serves.
|
|
901
|
+
|
|
902
|
+
- 6d20355: feat(core): a path param can say which values it accepts, written in braces after the name. A
|
|
903
|
+
request whose value does not fit is not served by that route:
|
|
904
|
+
|
|
905
|
+
```ts
|
|
906
|
+
app
|
|
907
|
+
// /users/me is its own route; /users/42 is this one; /users/ada is a 404
|
|
908
|
+
.get("/users/me", () => ({ me: true }))
|
|
909
|
+
.get("/users/:id{[0-9]+}", (c) => ({ id: Number(c.params.id) }))
|
|
910
|
+
// a list of values, and a count
|
|
911
|
+
.get("/img/:size{thumb|full}/:file", (c) => ({
|
|
912
|
+
size: c.params.size,
|
|
913
|
+
file: c.params.file,
|
|
914
|
+
}))
|
|
915
|
+
.get("/countries/:code{[A-Z]{2}}", (c) => ({ code: c.params.code }))
|
|
916
|
+
// inside a segment, and optional at the end of a path
|
|
917
|
+
.get("/files/:name.:ext{png|jpg}", (c) => ({
|
|
918
|
+
name: c.params.name,
|
|
919
|
+
ext: c.params.ext,
|
|
920
|
+
}))
|
|
921
|
+
.get("/posts/:page{[0-9]+}?", (c) => ({ page: c.params.page ?? "1" }));
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
- A constraint is one character class with an optional count (`[0-9]`, `[a-z0-9_-]+`, `\d{4}`,
|
|
925
|
+
`\w{2,8}`), or a list of two or more values (`png|jpg|webp`). A class holds letters, digits, ranges
|
|
926
|
+
of them, `\d`, `\w` and `. _ ~ ! $ & ' ( ) + , ; = @ -`; there is no negated class and a count
|
|
927
|
+
starts at one. Anything else in braces (`:id{int}`, `:id{.+}`, `:id{[0-9]+|[a-z]+}`) is literal
|
|
928
|
+
text, as before.
|
|
929
|
+
- The param stays a `string`, keyed by its bare name: `Params<"/users/:id{[0-9]+}">` is
|
|
930
|
+
`{ id: string }`.
|
|
931
|
+
- The value is checked as it was sent, before percent-decoding. `/users/4%32` does not fit
|
|
932
|
+
`:id{[0-9]+}`; a broader route beside it serves that request.
|
|
933
|
+
- The narrowest route answers, whatever the order of registration: literal text, then a list, then a
|
|
934
|
+
class, then a bare `:param`, then a wildcard. Between two constraints of a kind, the one that
|
|
935
|
+
accepts fewer values is tried first. A method the narrowest matching route does not have answers
|
|
936
|
+
`405`, as it does for a literal route beside a param route.
|
|
937
|
+
- Two spellings of one constraint (`[0-9]+`, `\d+`, `[0-9]{1,}`) are one route: the same method
|
|
938
|
+
registered on both throws `DUPLICATE_ROUTE`.
|
|
939
|
+
- Inside a segment the text around the params is placed first and each value is then checked; the
|
|
940
|
+
router does not look for another split.
|
|
941
|
+
- `routePatternOverlap` takes constraints into account: `/users/me` and `/users/:id{[0-9]+}` do not
|
|
942
|
+
overlap.
|
|
943
|
+
- `@nifrajs/core/pattern` exports `paramConstraint(text)`, which reads a constraint at the start of
|
|
944
|
+
`text`, and the `ParamConstraint` type. A param part of a compiled mixed segment carries its
|
|
945
|
+
constraint as `c`.
|
|
946
|
+
|
|
947
|
+
feat(edge): the compact server accepts the same constraints.
|
|
948
|
+
|
|
949
|
+
feat(schema): `toOpenAPI` writes a constrained param into the path template by its bare name
|
|
950
|
+
(`/users/{id}`). Its schema is `{ type: "string", pattern }` for a character class and
|
|
951
|
+
`{ type: "string", enum }` for a list of values; a declared `params` schema still takes precedence.
|
|
952
|
+
|
|
953
|
+
feat(client): a constrained param is passed by its bare name, `api.users({ id: "42" }).get()`. Two
|
|
954
|
+
param routes at one position (`/users/:id{[0-9]+}` beside `/users/:slug`, or a param beside a
|
|
955
|
+
wildcard) are each callable, picked by the name of the key. The client does not check a value
|
|
956
|
+
against its constraint.
|
|
957
|
+
|
|
958
|
+
feat(cli): `nifra check` accepts a supported constraint and keeps reporting other text in braces
|
|
959
|
+
(`NF-C026`); `NF-C024` and `NF-C025` follow the router's reading of a constraint. `nifra routes` and
|
|
960
|
+
the generated client calls print the bare name. `nifra scaffold` refuses a page path that carries a
|
|
961
|
+
constraint.
|
|
962
|
+
|
|
963
|
+
feat(testing): `runAdversarialContract` builds a request path whose values satisfy each param's
|
|
964
|
+
constraint, and fills a part-literal segment (`/files/:name.json`) param by param.
|
|
965
|
+
|
|
966
|
+
feat(web): a route file name that would read as a param constraint (`[id]{a|b}.tsx`) is refused at
|
|
967
|
+
build time with a message that names the file. `llms.txt` prints client calls with the bare name.
|
|
968
|
+
|
|
969
|
+
- d50f73e: feat: generated route types
|
|
970
|
+
|
|
971
|
+
Every route file gets a generated `Route` namespace, imported from `./+types/<name>` by both halves
|
|
972
|
+
of the route:
|
|
973
|
+
|
|
974
|
+
```ts
|
|
975
|
+
// routes/blog/[slug].backend.ts
|
|
976
|
+
import type { Route } from "./+types/[slug]"
|
|
977
|
+
export const loaderOutput = t.object({ title: t.string() })
|
|
978
|
+
export async function loader({ api, params }: Route.LoaderArgs) { ... }
|
|
979
|
+
|
|
980
|
+
// routes/blog/[slug].tsx
|
|
981
|
+
import type { Route } from "./+types/[slug]"
|
|
982
|
+
export default function Post({ data, params }: Route.ComponentProps) { ... }
|
|
983
|
+
```
|
|
984
|
+
|
|
985
|
+
`Route.Params` comes from the path (`[id]`, optional `[[lang]]`, catch-all `[...path]`).
|
|
986
|
+
`Route.LoaderData` and `Route.ActionData` are the output types of `loaderOutput` and `actionOutput`,
|
|
987
|
+
so a component is typed with exactly what reaches it. `Route.LoaderArgs` types `api` from the app's
|
|
988
|
+
`backend/app.ts`, which `.nifra/types/register.d.ts` registers once with `@nifrajs/client`'s new
|
|
989
|
+
`Register` interface; no route imports the backend for its types.
|
|
990
|
+
|
|
991
|
+
`nifra types` writes the files to `.nifra/types` (and `--check` fails when one is stale); `nifra dev`,
|
|
992
|
+
`nifra build` and `nifra check` refresh them, and `nifra dev` keeps them current as routes are added
|
|
993
|
+
or removed. A route resolves `./+types/<name>` through `"rootDirs": [".", "./.nifra/types"]` in
|
|
994
|
+
tsconfig, which the scaffolded site and ISR apps now carry; `nifra types` says so when it is missing.
|
|
995
|
+
`@nifrajs/web/route-types` exports the generator.
|
|
996
|
+
|
|
997
|
+
- 52bb49e: Support TypeScript 5, 6, and 7 in Nifra's syntax and response-reflection scanners. TypeScript 7 projects use its unstable AST and asynchronous project APIs through a shared compatibility session, with unsupported compiler majors failing closed.
|
|
998
|
+
- a158b74: feat(web): a page file under a mount fails at startup, at build and in `nifra check`, instead of
|
|
999
|
+
answering with the mount's 404. A mount in front of the page router - the backend at `apiPrefix`, a
|
|
1000
|
+
`mounts` entry, or an `app.mount()` inside `use` - answers every request under its path, and its 404
|
|
1001
|
+
is final (`fallbackOn: 404` only tries the next mount), so a page there could never render.
|
|
1002
|
+
`createWebApp` now throws at startup, naming each file, the URL it serves and the mount; `nifra build`
|
|
1003
|
+
refuses to build; and `nifra check` reports `NF-C027` for a page under the backend's prefix, reading
|
|
1004
|
+
`apiPrefix` when `backend/framework.ts` exports it as a string literal (an `info` finding says so when it does
|
|
1005
|
+
not).
|
|
1006
|
+
|
|
1007
|
+
`backend/framework.ts` can export `apiPrefix`, `apiStrip`, `mounts`, `csp` and `nonce`. `nifra dev`,
|
|
1008
|
+
`nifra build` (the generated server entry and the static prerender), `nifra mcp`'s render tool and the
|
|
1009
|
+
hydration gate pass the same set to `createWebApp`, and the render tool and the hydration gate now
|
|
1010
|
+
apply `use` as well. A field of the wrong type fails at load, naming it, and a value
|
|
1011
|
+
`nifra.config.ts` exports must be the one `backend/framework.ts` exports, or the build stops. `nifra routes`
|
|
1012
|
+
lists the backend under the configured prefix, at the served path when `apiStrip` is set.
|
|
1013
|
+
|
|
1014
|
+
New exports: `preRouteMountPaths` from `@nifrajs/core/mount`; `shadowedPages`,
|
|
1015
|
+
`formatShadowedPages`, `normalizeMountPath` and `ShadowedPage` from `@nifrajs/web/route-manifest`;
|
|
1016
|
+
`SERVER_ENTRY_OPTIONS` and the `optionImports` option of `generateServerEntry` and `buildTarget` from
|
|
1017
|
+
`@nifrajs/web/build`.
|
|
1018
|
+
|
|
1019
|
+
Upgrading: an app with a page file under its backend prefix (`routes/api/*` with a backend)
|
|
1020
|
+
started before and answered that page with a 404; it now fails to start until the file moves out of
|
|
1021
|
+
the prefix or the prefix changes.
|
|
1022
|
+
|
|
1023
|
+
### Patch Changes
|
|
1024
|
+
|
|
1025
|
+
- f96196f: `nifra dev` on the Bun pipeline applies the `define` from `nifra.config.ts` to the browser bundle and to server rendering, as `nifra build` does. Vue's feature flags reach the dev client, so the "Feature flags ... are not explicitly defined" warning no longer appears. A config `define` entry wins over the same name in the app's own `bunfig.toml`, and a value that is not a string is refused by name.
|
|
1026
|
+
- 20c05b2: `nifra check` reports its import finding as "backend code in browser code", and `nifra_frontend` and `nifra_learn` point at the route's `.backend.ts` half for loaders, actions and their output schemas.
|
|
1027
|
+
- 736fae8: `nifra check` treats a value re-export (`export { x } from "y"`, `export * from "y"`, `export * as ns from "y"`) as an import edge, the way a bundler does. The server-only import scan, its transitive chain through barrel files, and the zone import check (NF-C028) now follow re-exports. `export type …` re-exports, and with a TypeScript install an all-type named re-export, are skipped as before.
|
|
1028
|
+
- a5cf1c3: `nifra check` on a project using TypeScript 7 completes when it follows an import into a module outside the scanned set, such as a `.js` helper with its own imports. Previously the whole check stopped with "TypeScript 7 source file was not preloaded". The import scan reads such a module with its lexical rule. For the SQL scan, such a module proves no constant, the same as a module that does not parse.
|
|
1029
|
+
- 2ed4c59: `nifra_run`, `nifra_render`, `nifra_ws`, `nifra_test`, the `nifra check` typecheck and the `nifra fix` rebuild and codemod start their child processes with the Bun that runs nifra, not the first `bun` on `PATH`. An MCP client that starts `nifra mcp` with a minimal `PATH` no longer breaks them, and a `bun` shim earlier on `PATH` is never picked up.
|
|
1030
|
+
- 8b8dde2: `nifra contracts snapshot` writes `contracts.lock.json` routes, and `nifra sdk` emits operations, in code-unit order instead of `localeCompare` order, so the files a project commits come out the same on every machine. A lock or SDK whose routes the two orders rank differently (mixed case, `-` beside `_`) is reordered once when it is next written; `nifra contracts check` compares routes by key and is unaffected.
|
|
1031
|
+
- 8739624: The contracts lock digest covers schema properties named `title`, `description`, `default`, `example` or `examples`, and the instance data inside `enum` and `const`. Those annotation keywords on a schema itself still do not count as a contract change. A lock written by an earlier release reports each route with such a property as changed once; review it and run `nifra contracts snapshot`.
|
|
1032
|
+
- cc3e0fa: The contracts lock digest covers a schema property named `__proto__`, so `nifra contracts check` reports a change to that property's schema.
|
|
1033
|
+
- 20c05b2: `nifra_docs`, `nifra_example` and `nifra_types` match a camelCase heading by its whole word as well as its parts, so a `websocket` query finds the WebSockets section by name.
|
|
1034
|
+
- f23d036: `nifra doctor --fix` re-points a path dependency it copies from an ancestor `package.json` (`file:`, `link:`, `portal:`, or `./`/`../` specs) so the copy names the same directory from the package being fixed. Previously the spec was copied unchanged and resolved against the wrong directory. Version ranges and `workspace:` specs are copied as before.
|
|
1035
|
+
- 612fdfe: `nifra_explain` shows a codeframe only from project source files. A stack frame naming a dotfile or anything under a dot directory, such as `.env` or `.git/config`, gets no source excerpt.
|
|
1036
|
+
- 0e622ae: NF-S001 reads a gate written as an arrow or function expression by the name it is bound to, such as `const requireAuth = async () => …` or `{ canEdit: () => … }`, so a fail-open catch in one is reported like one in a function declaration.
|
|
1037
|
+
- d90e509: fix(cli): the `nifra_gallery` MCP tool declares itself non-destructive and idempotent in its
|
|
1038
|
+
annotations, so clients that gate tool calls on those hints run it without asking.
|
|
1039
|
+
- 8a2e7e5: fix(cli): `nifra assure --hydration` hydrates every route in its DOM run and fails when hydration does
|
|
1040
|
+
not happen. With `happy-dom` installed, the run could not load a code-split client entry, imported
|
|
1041
|
+
the entry only once (so routes after the first were never hydrated), and checked the page before the
|
|
1042
|
+
framework had hydrated it. It now builds the entry so its chunks load from disk, gives each route its
|
|
1043
|
+
own copy, waits for the document's `data-nifra-hydrated` marker (up to 5s) and reports a route that
|
|
1044
|
+
never gets there. An error the client throws while hydrating is reported too. The page data comes
|
|
1045
|
+
only from the document's handover, as in a browser, and framework runtimes get the DOM globals they
|
|
1046
|
+
use (Vue's `SVGElement`).
|
|
1047
|
+
- d1e82be: The hydration gate (`nifra assure --hydration`, `nifra_hydrate`, hydration replays) no longer reports a false NF-H001 when a project's config or loader prints to stdout: the runner's answer travels on its own tagged line, and `console.log` output from project code goes to stderr. A run now stops after five minutes, `nifra_hydrate` stops when the MCP call is cancelled, and the runner's output is bounded.
|
|
1048
|
+
- 3e7cb83: The import scanners behind `nifra check`, `nifra doctor` and the capability provenance check read an import or re-export clause by its grammar: a default binding, then `* as name` or a `{ … }` list. Previously they scanned lazily to the next `from`. A long module with many `export const` lines and no string literal now scans in linear time; 16,000 lines took over 4 seconds before. Each re-export is attributed to its own line, and minified `import{a}from"x"` is read too.
|
|
1049
|
+
- d2e392a: feat(cli): `nifra init-agents --sync-mcp` re-pins the `@nifrajs/cli@x.y.z` MCP launch in `.mcp.json`,
|
|
1050
|
+
`.cursor/mcp.json`, `CLAUDE.md` and the `## MCP server` section of `AGENTS.md` to the nifra the
|
|
1051
|
+
project installs. Only the version changes; every other byte stays as it is, no file is created, and
|
|
1052
|
+
a second run is a no-op. The CLI-version drift warnings from `nifra mcp` and `nifra doctor` recommend
|
|
1053
|
+
it, `nifra doctor` flags a stale pin even when the CLI itself matches, and a plain `nifra init-agents`
|
|
1054
|
+
run points any kept file with a stale pin at the flag.
|
|
1055
|
+
- a84f546: `nifra verify --release` runs the leak matrix (`bun run check:leak-matrix`): every way server code or a
|
|
1056
|
+
credential can reach a browser, against both bundlers, both dev servers, the server build, each
|
|
1057
|
+
framework's route syntax and each deploy target's output.
|
|
1058
|
+
- 9fc5ef3: `nifra manifest emit --sign <keyId>` is available only from the CLI. The `nifra_manifest` MCP tool no longer lists `sign` in its input schema and answers a call that passes it with `{ ok: false, error: "sign is available only from the nifra CLI" }`, so an agent cannot ask the operator's `manifest.signer` callback to sign a manifest. Commands declare such fields with the new `cliOnlyFields` on their spec; the catalog entry carries them, and `commandMcpInputSchema()` gives the schema an MCP tool advertises.
|
|
1059
|
+
- 0140def: `nifra_run` and `nifra_ws` return as soon as the answer is written. An app that keeps a handle open at load, such as a database pool or an interval, made each call wait out the 30-second child timeout.
|
|
1060
|
+
- 6745d2a: `nifra mcp` runs no project code in its own process and keeps none of the project's `.env`. The tools that load the app (`nifra_context`, `nifra_routes`, `nifra_check`, `nifra_openapi` and the rest), the routes and OpenAPI resources, and the tools, resources and prompts the app declares on its backend run in a fresh subprocess per call, started in the project's directory. Each call sees the project's current code and its `.env`, wherever the client started the server, and a config or backend that exits or hangs fails only that call. `nifra_run`, `nifra_render`, `nifra_ws` and `nifra_hydrate` also start their processes in the project's directory. A server that Bun started with `.env` values serves from a copy of itself that never loads them; values set in the environment and `--env-file` values are kept. In a monorepo, each app's tools see that app's `.env` and no longer the root's; to share values across apps, set them in the environment or pass `--env-file`. A call that loads the app costs one process start, tens of milliseconds, more when the config imports heavy plugins.
|
|
1061
|
+
- 3c70d9c: `nifra mcp --env-file <path>` values now reach the processes its tools start: `nifra_run` (one-off and `warm`), `nifra_render`, `nifra_ws`, `nifra_hydrate`, `nifra_test` and the `nifra_db_*` tools see them, as the app's own tools and the tools that load the app do.
|
|
1062
|
+
- 429eff5: `nifra_run` and `nifra_render` with `warm: true` reuse one hot worker for the whole MCP session, as documented, instead of starting a new one per call. The source fingerprint that restarts the worker on a change no longer walks `node_modules`, build output or dot directories.
|
|
1063
|
+
- ed12674: `nifra openapi` works on an API-only app: with no `nifra.config.ts` or `backend/framework.ts`, it reads `backend/app.ts` alone instead of asking for a UI adapter.
|
|
1064
|
+
- c224eda: `nifra review --diff` no longer passes a change while the project has a type error in a file outside the diff. A change can break a caller it never touched, so the `typecheck` check reports `unavailable` with reason `filtered-out-of-scope` and the review is `inconclusive`. The text report names the reason next to each unavailable check.
|
|
1065
|
+
- 58c092b: `nifra sdk` generates the client for a backend whose routes it reads from `backend/app.ts`, instead
|
|
1066
|
+
of failing before it writes anything.
|
|
1067
|
+
- 82f2e7d: `nifra sdk --lang go` writes a property's JSON name into a struct tag only when Go's `encoding/json` can read it there. A property name with a quote, backslash, backtick, comma or control character has no struct-tag spelling. Such a field is left out and reported like any other unsupported schema, and `--strict` refuses the document. A property named `-` is tagged `json:"-,"`, so it is no longer dropped.
|
|
1068
|
+
- 7911e4a: NF-S002 flags a comparison against a secret read from configuration: an `UPPER_SNAKE` member such as `process.env.API_TOKEN` or `env.WEBHOOK_SECRET`, and a string-keyed read such as `process.env["API_KEY"]`. PascalCase enum members such as `ts.SyntaxKind.PlusToken` stay unflagged.
|
|
1069
|
+
- c8a345d: `nifra check` reads every `secretExemptions` entry in `nifra.config.ts` when a string in it holds a bracket, brace or colon, such as the file `routes/[lang]/index.tsx`, instead of dropping that entry and the ones after it.
|
|
1070
|
+
- bc73e9c: `nifra_test` keeps `pattern` inside the selected project. A pattern that resolves outside it, by `../`, an absolute path or a symlink, is refused before `bun test` starts.
|
|
1071
|
+
- c4567cf: `nifra_test` keeps only the first 4,000 and last 8,000 characters of a test run's output as it reads, instead of holding all of it before trimming, so a run that prints hundreds of megabytes no longer grows the MCP server's memory with it. When output was dropped, the result marks where and how many bytes were left out.
|
|
1072
|
+
- e8df2af: `nifra fix --code NF-S002` rewrites every flagged comparison in a file in one pass, found from the syntax tree rather than the reported line. A file with several comparisons, a property operand such as `headers.signature`, or a `"use server"` directive now comes out correct, and an existing `timingSafeEqual` import no longer collides with the added helper.
|
|
1073
|
+
- e414818: `nifra check` parses a `.ts`, `.mts`, or `.cts` file as TypeScript instead of TSX in its SQL interpolation scan, security rules, nano and island lints, and route source facts. A generic arrow (`<T>(items: T[]) => ...`) or an angle-bracket cast in such a file no longer makes the file unparsable or hides the code after it from those checks, so findings they missed there now appear.
|
|
1074
|
+
- 0fb7a13: `nifra check`'s typed-client rewrite for a simple own-API `fetch` appends a path segment the client reserves (`get`, `post`, `options`, `index`, `then` and the rest) with a call, as in `api.blog("post").get()`, so the suggested code reaches the route. Previously it suggested `api.blog.post.get()`, which the client cannot resolve.
|
|
1075
|
+
- 88178b4: `nifra upgrade`:
|
|
1076
|
+
|
|
1077
|
+
- Removing a dependency whose successor is already declared keeps `package.json` valid when the removed entry is the last one in its block. An edit that would leave a manifest unparseable is not written.
|
|
1078
|
+
- `dist/`, `build/` and `coverage/` directories at the workspace root are skipped like nested ones, so build output and coverage reports are no longer rewritten.
|
|
1079
|
+
|
|
1080
|
+
- 38cf032: `nifra build` for the `vercel` target writes to `.vercel/output`, where `vercel deploy --prebuilt`
|
|
1081
|
+
reads it, unless `--out` names another directory.
|
|
1082
|
+
- 19f1c8b: `nifra verify` and `nifra_verify` report a gate whose `package.json` script the project does not declare as `undeclared` instead of running it and failing. A project that declares `lint` and `test` gets those two gates run and the rest listed as not declared; the run passes when every gate that ran passed, and fails when none ran.
|
|
1083
|
+
- 3734451: The verification work graph behind `nifra prove` (`nifra_prove`):
|
|
1084
|
+
|
|
1085
|
+
- `.svelte`, `.vue`, `.mdx` and `.css` files are app source. An edit to one after the last build makes the build stale, and each file is a node of the graph.
|
|
1086
|
+
- A changed file under `routes/`, `frontend/`, `backend/` or `shared/` that the graph does not model, such as a deleted module, impacts every route and needs proof. Previously the plan was empty and the change was reported as done.
|
|
1087
|
+
|
|
1088
|
+
- 4801cac: `diffNifraManifests` and `nifra manifest diff` diff a route that is new in the candidate manifest against an empty route. The capabilities it declares are reported as added and breaking, and a `pii` or `secret` response classification as an increase that is breaking, the same as when an existing route makes that change. A new route that declares no capability and returns public data is still only an added route.
|
|
1089
|
+
- ef28ef9: CLI output that lists routes, files, findings or packages - `nifra routes`, `nifra doctor`, `nifra check`, `nifra port`, `nifra manifest`, `nifra sync-manifest`, `nifra graph`, `nifra types` and the generated SDK - is ordered by code unit, so it comes out the same on every machine and in every locale.
|
|
1090
|
+
- 9ccf198: `handleRpc` takes `exposeToolErrors`, which answers a throwing tool with `Tool execution failed: <message>` instead of the bare text. It is off by default, so a remote caller still sees nothing from an error message. `nifra mcp` turns it on for its stdio server, so the local agent sees why a project tool failed, for example the error that stopped the backend from loading.
|
|
1091
|
+
- 0d8d426: fix(cli): `nifra mcp` no longer answers for a different nifra release than the project installs. When
|
|
1092
|
+
the project has its own `@nifrajs/cli` at another version, the server hands the stdio session to the
|
|
1093
|
+
project's `node_modules/.bin/nifra mcp` (passing an explicit project dir through). When that is
|
|
1094
|
+
impossible - no project CLI, no linked bin, or a hand-off that still disagrees - `nifra_check`,
|
|
1095
|
+
`nifra_types`, `nifra_docs`, `nifra_example`, `nifra_assure` and `nifra_contracts` fail with the
|
|
1096
|
+
version split and the command that fixes it, while release-independent tools keep working.
|
|
1097
|
+
- ff87ed3: `nifra migrate layout` finds an SFC's script blocks however their closing tag is spaced (`</script >`).
|
|
1098
|
+
- ba5dd1c: feat(web): a directory's route middleware runs before every page in it and below.
|
|
1099
|
+
|
|
1100
|
+
```ts
|
|
1101
|
+
// routes/account/_layout.backend.ts
|
|
1102
|
+
import { type RouteMiddleware, redirect } from "@nifrajs/web";
|
|
1103
|
+
|
|
1104
|
+
export const middleware: RouteMiddleware = ({ request }) => {
|
|
1105
|
+
const signedIn =
|
|
1106
|
+
request.headers.get("cookie")?.includes("session=") ?? false;
|
|
1107
|
+
return signedIn ? undefined : redirect("/login");
|
|
1108
|
+
};
|
|
1109
|
+
```
|
|
1110
|
+
|
|
1111
|
+
Route middleware runs on the server, outermost first, before the layouts' loaders (gates included)
|
|
1112
|
+
and the page's loader or action, for document requests, client navigations and form posts alike, and
|
|
1113
|
+
before a nested `_404` in its directory. It returns nothing to let the request through, or returns or
|
|
1114
|
+
throws a `redirect()`, a status such as `notFound()`, or a `Response` to answer with it. `ctx.set` adds
|
|
1115
|
+
headers and cookies, and `ctx.params` holds the params of its directory's URL prefix. It never reaches
|
|
1116
|
+
the client bundle, and a directory may export it from `_layout.backend.ts` without a frontend layout.
|
|
1117
|
+
|
|
1118
|
+
- dc2d4d3: fix(cli): duplicate-install findings name a copy reached through a symlink out of its install
|
|
1119
|
+
|
|
1120
|
+
When an importer reaches a copy of an identity-sensitive package through a symlink that points
|
|
1121
|
+
outside its own install (another project's `node_modules` linked into a shared package, or a
|
|
1122
|
+
`bun link`), `nifra doctor` prints a `links:` line with each link and its target, and the
|
|
1123
|
+
`nifra check` duplicate-install diagnostic names the link on that copy and lists it ahead of both
|
|
1124
|
+
fixes. The identity preflight carries it as `copies[].links` and `provenance`. Package-manager store
|
|
1125
|
+
links inside an install are not reported.
|
|
1126
|
+
|
|
1127
|
+
- d1e2f50: feat: starters type their routes with the generated `./+types`
|
|
1128
|
+
|
|
1129
|
+
The site and ISR starters type the landing page as `import type { Route } from "./+types/index"`:
|
|
1130
|
+
`props: Route.ComponentProps` in the page, `Route.LoaderArgs` / `Route.ActionArgs` in its backend
|
|
1131
|
+
half. `data` is the `loaderOutput` schema's type, which is what reaches the browser. A scaffold
|
|
1132
|
+
ships its `.nifra/types`, so the types resolve right after `bun install`, before any nifra command
|
|
1133
|
+
has run. The Svelte starter types its `$props()` the same way, and the Vue starter types the props it
|
|
1134
|
+
declares from `Route`. Svelte and Vue scaffolds include their `.svelte` / `.vue` files in
|
|
1135
|
+
`tsconfig.json`, so svelte-check, vue-tsc and the editor type-check routes. `nifra_frontend`'s
|
|
1136
|
+
loader-typing guidance now points at the route types.
|
|
1137
|
+
|
|
1138
|
+
- 562b4af: fix(client): a `.` or `..` param value is refused instead of sent
|
|
1139
|
+
|
|
1140
|
+
A URL reads a `.` or `..` path segment as a step to another path, in every encoding, so
|
|
1141
|
+
`api.users({ id: ".." }).delete()` was a request for `DELETE /`, not for a user named `..`.
|
|
1142
|
+
|
|
1143
|
+
- A call whose path has a `.` or `..` segment sends nothing and resolves to
|
|
1144
|
+
`{ ok: false, status: 0, data: null, error: { error: "invalid_path" } }` - the shape a network
|
|
1145
|
+
failure takes. No `onRequest` hook runs and nothing is retried.
|
|
1146
|
+
- `.subscribe()` reports `invalid_path` through `onError`, then closes. `.ws()` throws before a
|
|
1147
|
+
socket is opened.
|
|
1148
|
+
- `inProcessClient` and `testClient` behave the same way.
|
|
1149
|
+
- Values that only contain dots (`a.b`, `...`, `.hidden`) and a wildcard value such as `a/../b`
|
|
1150
|
+
(sent as one encoded segment) are unaffected.
|
|
1151
|
+
- The Python and Go clients from `nifra sdk` refuse the same values: Python raises `ValueError`,
|
|
1152
|
+
Go returns an error.
|
|
1153
|
+
|
|
1154
|
+
Validate a param where it is read: a `.` or `..` sent by another client still reaches the route
|
|
1155
|
+
as the param's value.
|
|
1156
|
+
|
|
1157
|
+
- 81c720e: fix(client): a segment that is part literal, part param is callable through the typed client
|
|
1158
|
+
|
|
1159
|
+
A route such as `/files/:name.json`, `/post-:id` or `/v:major.:minor` could not be reached through
|
|
1160
|
+
the typed client: `:name.json` was typed as a param named `name.json` whose call sent the value
|
|
1161
|
+
without `.json`, and `post-:id` was typed as a property that sent the pattern text itself. Such a
|
|
1162
|
+
segment is now a call with the segment as the request carries it:
|
|
1163
|
+
|
|
1164
|
+
```ts
|
|
1165
|
+
await api.files("report.json").get(); // GET /files/:name.json, c.params.name === "report"
|
|
1166
|
+
await api("post-42").get(); // GET /post-:id
|
|
1167
|
+
await api("v1.2").get(); // GET /v:major.:minor
|
|
1168
|
+
```
|
|
1169
|
+
|
|
1170
|
+
- The argument is typed as the segment's literal text around any string (`` `${string}.json` ``), so
|
|
1171
|
+
`api.files("report.txt")` does not compile. A constraint is not part of the text:
|
|
1172
|
+
`/img/:id{[0-9]+}.png` takes `` `${string}.png` ``, and the server decides whether the value fits.
|
|
1173
|
+
- The value is sent as one encoded segment, as a param value is: a `/` in it never adds a path level.
|
|
1174
|
+
- A static segment at the same position keeps its exact text (`api.files("index.json")` is
|
|
1175
|
+
`/files/index.json` when that route exists, which is the route the server picks), and a
|
|
1176
|
+
whole-segment param keeps its call by name (`api.files({ id })`).
|
|
1177
|
+
- Two such segments at one position that accept the same text resolve to the types of the one
|
|
1178
|
+
registered first.
|
|
1179
|
+
- `@nifrajs/core` exports `RequestPath<Path>`, the same reading for a whole path:
|
|
1180
|
+
`RequestPath<"/files/:name.json">` is `` `/files/${string}.json` ``, a constraint reads as
|
|
1181
|
+
`${string}`, and a path ending in optional params is one template per form.
|
|
1182
|
+
- The cli's route listings and the generated `llms.txt` print the call the same way
|
|
1183
|
+
(`` api.files(`${name}.json`) ``), and print an unnamed wildcard as `({ "*": rest })`.
|
|
1184
|
+
|
|
1185
|
+
- af1e8af: Release verification takes `--shared-runner`, which leaves out the timing gates and names them for a local run, and a failed gate now shows the last lines its command printed.
|
|
1186
|
+
- 5a63dd4: feat(web): pages can carry a strict Content-Security-Policy and still be cached.
|
|
1187
|
+
A per-request nonce makes every document unique, so nifra marks a nonce-bearing page
|
|
1188
|
+
`private, no-store` and no shared cache (`withISR`, a CDN) may store it. `createCspPolicy({ header })`
|
|
1189
|
+
is the cacheable alternative: pass it to `createWebApp({ csp })` (or `renderPage({ csp })`) instead of
|
|
1190
|
+
`nonce`. A document then carries a nonce only when it has a script specific to this request (a
|
|
1191
|
+
deferred value, or `meta` naming the nonce in `unsafeInlineScript`). Every other document is
|
|
1192
|
+
nonce-free, its constant inline scripts are allowed by sha256 hash, and its CSP header is the same on
|
|
1193
|
+
every request. `header` receives `sources`, the `script-src` list the document needs.
|
|
1194
|
+
`nifraScriptHashes(adapter)` returns the hashes for a policy set at a proxy or CDN. Passing both `csp`
|
|
1195
|
+
and `nonce` throws.
|
|
1196
|
+
|
|
1197
|
+
The page-state handover is now one inert `<script type="application/json" id="__nifra-handover">`
|
|
1198
|
+
instead of an executable script that assigned `window.__NIFRA_DATA__` and its siblings, so page data
|
|
1199
|
+
needs no nonce or hash under any policy. The client entry assigns the same globals before anything
|
|
1200
|
+
reads them. Code that read those globals from an inline script running before the client entry must
|
|
1201
|
+
run after it, or read the handover element (`HANDOVER_ID`). `nifra assure --hydration` reads the new
|
|
1202
|
+
format. `RenderAssemblyCache` loses its `tailMid` and `tailData` slots.
|
|
1203
|
+
|
|
1204
|
+
`withISR` warns once when it wraps an app created with `nonce`, since it can never store one of its
|
|
1205
|
+
pages. It also remembers, for its revalidate window, keys whose page answered `private` or
|
|
1206
|
+
`no-store` and skips the store lookup for them. A remembered key that turns cacheable is stored again.
|
|
1207
|
+
|
|
1208
|
+
- f90bf81: On Windows, `nifra upgrade` leaves build output and coverage alone, `nifra_explain` shows a codeframe for project source under a short path, and `nifra i18n check` names its entry with `/`. `nifra check` reports findings in the same order on every platform, and `nifra mcp` keeps the variables a process has besides its `.env` files: the ones Windows copies into every subprocess and the ones a bunfig preload sets.
|
|
1209
|
+
- Updated dependencies [a8b33bc]
|
|
1210
|
+
- Updated dependencies [c3057ee]
|
|
1211
|
+
- Updated dependencies [dde125b]
|
|
1212
|
+
- Updated dependencies [22e2af8]
|
|
1213
|
+
- Updated dependencies [72b62fa]
|
|
1214
|
+
- Updated dependencies [aa44e93]
|
|
1215
|
+
- Updated dependencies [4a3ee60]
|
|
1216
|
+
- Updated dependencies [963694f]
|
|
1217
|
+
- Updated dependencies [57356c0]
|
|
1218
|
+
- Updated dependencies [682d8bf]
|
|
1219
|
+
- Updated dependencies [4ab5c6a]
|
|
1220
|
+
- Updated dependencies [bd6786e]
|
|
1221
|
+
- Updated dependencies [a0cfffa]
|
|
1222
|
+
- Updated dependencies [aad6297]
|
|
1223
|
+
- Updated dependencies [dad0d41]
|
|
1224
|
+
- Updated dependencies [538adc2]
|
|
1225
|
+
- Updated dependencies [f47edd1]
|
|
1226
|
+
- Updated dependencies [df9530a]
|
|
1227
|
+
- Updated dependencies [3e6973f]
|
|
1228
|
+
- Updated dependencies [25e8edf]
|
|
1229
|
+
- Updated dependencies [2b5e5fc]
|
|
1230
|
+
- Updated dependencies [3b090de]
|
|
1231
|
+
- Updated dependencies [da7d792]
|
|
1232
|
+
- Updated dependencies [612a296]
|
|
1233
|
+
- Updated dependencies [fb14dfa]
|
|
1234
|
+
- Updated dependencies [8ae97f6]
|
|
1235
|
+
- Updated dependencies [4af6f39]
|
|
1236
|
+
- Updated dependencies [ca8b50d]
|
|
1237
|
+
- Updated dependencies [b00a889]
|
|
1238
|
+
- Updated dependencies [b53d64f]
|
|
1239
|
+
- Updated dependencies [66fd712]
|
|
1240
|
+
- Updated dependencies [9c3d524]
|
|
1241
|
+
- Updated dependencies [738e7a1]
|
|
1242
|
+
- Updated dependencies [4801cac]
|
|
1243
|
+
- Updated dependencies [1b2d53a]
|
|
1244
|
+
- Updated dependencies [25fe13d]
|
|
1245
|
+
- Updated dependencies [0852290]
|
|
1246
|
+
- Updated dependencies [0589dbe]
|
|
1247
|
+
- Updated dependencies [2e2d8c0]
|
|
1248
|
+
- Updated dependencies [856f5ce]
|
|
1249
|
+
- Updated dependencies [18aa5aa]
|
|
1250
|
+
- Updated dependencies [cfd86b3]
|
|
1251
|
+
- Updated dependencies [8ff96c9]
|
|
1252
|
+
- Updated dependencies [4c46199]
|
|
1253
|
+
- Updated dependencies [eef4932]
|
|
1254
|
+
- Updated dependencies [6de8686]
|
|
1255
|
+
- Updated dependencies [9868241]
|
|
1256
|
+
- Updated dependencies [dd0d5c1]
|
|
1257
|
+
- Updated dependencies [6ce7975]
|
|
1258
|
+
- Updated dependencies [5f1f3d8]
|
|
1259
|
+
- Updated dependencies [6c978a1]
|
|
1260
|
+
- Updated dependencies [7669f56]
|
|
1261
|
+
- Updated dependencies [a77b341]
|
|
1262
|
+
- Updated dependencies [ce169a2]
|
|
1263
|
+
- Updated dependencies [b83d400]
|
|
1264
|
+
- Updated dependencies [214d674]
|
|
1265
|
+
- Updated dependencies [86e2d0f]
|
|
1266
|
+
- Updated dependencies [a0cfffa]
|
|
1267
|
+
- Updated dependencies [d7892ea]
|
|
1268
|
+
- Updated dependencies [93e5e7f]
|
|
1269
|
+
- Updated dependencies [214d674]
|
|
1270
|
+
- Updated dependencies [4936309]
|
|
1271
|
+
- Updated dependencies [ff5a779]
|
|
1272
|
+
- Updated dependencies [772249a]
|
|
1273
|
+
- Updated dependencies [f70f99b]
|
|
1274
|
+
- Updated dependencies [49f106f]
|
|
1275
|
+
- Updated dependencies [4936309]
|
|
1276
|
+
- Updated dependencies [0e9b167]
|
|
1277
|
+
- Updated dependencies [bbdc5a1]
|
|
1278
|
+
- Updated dependencies [10bc446]
|
|
1279
|
+
- Updated dependencies [e8270d9]
|
|
1280
|
+
- Updated dependencies [d942c33]
|
|
1281
|
+
- Updated dependencies [ef28ef9]
|
|
1282
|
+
- Updated dependencies [ef28ef9]
|
|
1283
|
+
- Updated dependencies [d4d40a5]
|
|
1284
|
+
- Updated dependencies [0f486f2]
|
|
1285
|
+
- Updated dependencies [37dff1d]
|
|
1286
|
+
- Updated dependencies [d4a79de]
|
|
1287
|
+
- Updated dependencies [9ccf198]
|
|
1288
|
+
- Updated dependencies [ff4a062]
|
|
1289
|
+
- Updated dependencies [29c6c94]
|
|
1290
|
+
- Updated dependencies [43ba944]
|
|
1291
|
+
- Updated dependencies [46c741a]
|
|
1292
|
+
- Updated dependencies [7bfa25e]
|
|
1293
|
+
- Updated dependencies [216fe27]
|
|
1294
|
+
- Updated dependencies [52bb49e]
|
|
1295
|
+
- Updated dependencies [4936309]
|
|
1296
|
+
- Updated dependencies [6e257a6]
|
|
1297
|
+
- Updated dependencies [4a03d30]
|
|
1298
|
+
- Updated dependencies [8e30090]
|
|
1299
|
+
- Updated dependencies [28f3aaf]
|
|
1300
|
+
- Updated dependencies [6d20355]
|
|
1301
|
+
- Updated dependencies [08250bf]
|
|
1302
|
+
- Updated dependencies [6907cbe]
|
|
1303
|
+
- Updated dependencies [4b8d8de]
|
|
1304
|
+
- Updated dependencies [ba5dd1c]
|
|
1305
|
+
- Updated dependencies [d50f73e]
|
|
1306
|
+
- Updated dependencies [031c33d]
|
|
1307
|
+
- Updated dependencies [4936309]
|
|
1308
|
+
- Updated dependencies [fb7c5b3]
|
|
1309
|
+
- Updated dependencies [715186c]
|
|
1310
|
+
- Updated dependencies [4b8d8de]
|
|
1311
|
+
- Updated dependencies [f56b6a8]
|
|
1312
|
+
- Updated dependencies [8fa902c]
|
|
1313
|
+
- Updated dependencies [085e852]
|
|
1314
|
+
- Updated dependencies [0dac7ec]
|
|
1315
|
+
- Updated dependencies [b64c3ee]
|
|
1316
|
+
- Updated dependencies [dc2d4d3]
|
|
1317
|
+
- Updated dependencies [d1e2f50]
|
|
1318
|
+
- Updated dependencies [784d772]
|
|
1319
|
+
- Updated dependencies [af7648c]
|
|
1320
|
+
- Updated dependencies [fab1d24]
|
|
1321
|
+
- Updated dependencies [1afbe9f]
|
|
1322
|
+
- Updated dependencies [bda9637]
|
|
1323
|
+
- Updated dependencies [562b4af]
|
|
1324
|
+
- Updated dependencies [81c720e]
|
|
1325
|
+
- Updated dependencies [ed60b23]
|
|
1326
|
+
- Updated dependencies [0150ed4]
|
|
1327
|
+
- Updated dependencies [ae815ab]
|
|
1328
|
+
- Updated dependencies [ea2ee87]
|
|
1329
|
+
- Updated dependencies [3442e1c]
|
|
1330
|
+
- Updated dependencies [85d636b]
|
|
1331
|
+
- Updated dependencies [6c978a1]
|
|
1332
|
+
- Updated dependencies [bfe29b6]
|
|
1333
|
+
- Updated dependencies [8b99424]
|
|
1334
|
+
- Updated dependencies [87783f0]
|
|
1335
|
+
- Updated dependencies [135aba4]
|
|
1336
|
+
- Updated dependencies [47b0d65]
|
|
1337
|
+
- Updated dependencies [e32268d]
|
|
1338
|
+
- Updated dependencies [432fec3]
|
|
1339
|
+
- Updated dependencies [0e14068]
|
|
1340
|
+
- Updated dependencies [8f1b780]
|
|
1341
|
+
- Updated dependencies [dcc9ff6]
|
|
1342
|
+
- Updated dependencies [5a63dd4]
|
|
1343
|
+
- Updated dependencies [c49882f]
|
|
1344
|
+
- Updated dependencies [dfd19d8]
|
|
1345
|
+
- Updated dependencies [28e091f]
|
|
1346
|
+
- Updated dependencies [046e79d]
|
|
1347
|
+
- Updated dependencies [6393b1e]
|
|
1348
|
+
- Updated dependencies [a158b74]
|
|
1349
|
+
- Updated dependencies [ee19d29]
|
|
1350
|
+
- Updated dependencies [293d3c8]
|
|
1351
|
+
- Updated dependencies [7e1e1c3]
|
|
1352
|
+
- Updated dependencies [0cd5f6e]
|
|
1353
|
+
- Updated dependencies [2245bee]
|
|
1354
|
+
- Updated dependencies [feeec4a]
|
|
1355
|
+
- Updated dependencies [3eb6339]
|
|
1356
|
+
- Updated dependencies [f784c32]
|
|
1357
|
+
- Updated dependencies [e3b2b97]
|
|
1358
|
+
- Updated dependencies [5934b5d]
|
|
1359
|
+
- Updated dependencies [03a3729]
|
|
1360
|
+
- Updated dependencies [bd11269]
|
|
1361
|
+
- Updated dependencies [579d9a9]
|
|
1362
|
+
- Updated dependencies [3554ad8]
|
|
1363
|
+
- Updated dependencies [64e7a42]
|
|
1364
|
+
- Updated dependencies [ee19d29]
|
|
1365
|
+
- Updated dependencies [d6f806f]
|
|
1366
|
+
- Updated dependencies [38cf032]
|
|
1367
|
+
- Updated dependencies [b94e5cb]
|
|
1368
|
+
- Updated dependencies [0f6babe]
|
|
1369
|
+
- Updated dependencies [00f18bf]
|
|
1370
|
+
- Updated dependencies [a84f546]
|
|
1371
|
+
- Updated dependencies [669b6a2]
|
|
1372
|
+
- Updated dependencies [ff25d68]
|
|
1373
|
+
- create-nifra@4.0.0
|
|
1374
|
+
- @nifrajs/core@4.0.0
|
|
1375
|
+
- @nifrajs/schema@4.0.0
|
|
1376
|
+
- @nifrajs/web@4.0.0
|
|
1377
|
+
- @nifrajs/client@4.0.0
|
|
1378
|
+
- @nifrajs/i18n@4.0.0
|
|
1379
|
+
- @nifrajs/testing@4.0.0
|
|
1380
|
+
- @nifrajs/mcp@4.0.0
|
|
1381
|
+
- @nifrajs/mcp-db@4.0.0
|
|
1382
|
+
- @nifrajs/runner@4.0.0
|
|
1383
|
+
- @nifrajs/agent-review@4.0.0
|
|
1384
|
+
|
|
1385
|
+
## 3.5.0
|
|
1386
|
+
|
|
1387
|
+
### Patch Changes
|
|
1388
|
+
|
|
1389
|
+
- 6430334: Add the provider-neutral, content-free review report contract and expose `nifra review` through the CLI, authenticated agent RPC, and Workbench-safe view projections.
|
|
1390
|
+
- Updated dependencies [6046984]
|
|
1391
|
+
- Updated dependencies [ac27343]
|
|
1392
|
+
- Updated dependencies [d5b7c22]
|
|
1393
|
+
- Updated dependencies [6430334]
|
|
1394
|
+
- Updated dependencies [82c3018]
|
|
1395
|
+
- @nifrajs/core@3.5.0
|
|
1396
|
+
- @nifrajs/web@3.5.0
|
|
1397
|
+
- @nifrajs/agent-review@3.5.0
|
|
1398
|
+
- @nifrajs/schema@3.5.0
|
|
1399
|
+
- @nifrajs/testing@3.5.0
|
|
1400
|
+
- @nifrajs/client@3.5.0
|
|
1401
|
+
- @nifrajs/mcp@3.5.0
|
|
1402
|
+
- @nifrajs/runner@3.5.0
|
|
1403
|
+
- create-nifra@3.5.0
|
|
1404
|
+
|
|
1405
|
+
## 3.4.0
|
|
1406
|
+
|
|
1407
|
+
### Patch Changes
|
|
1408
|
+
|
|
1409
|
+
- 8d23613: Add the opt-in `@nifrajs/webmcp` package: typed WebMCP registration, core-backed receipts, deterministic predictive-UI reconciliation, and host-independent conformance checks. Also tighten agent execution cancellation cleanup so aborted local work cannot leak into later turns.
|
|
1410
|
+
- 8d23613: Add an opt-in Vite aggregate-CSS and deferred stylesheet-loading path that prevents lazy-route prefetch from attaching additional stylesheets before hydration.
|
|
1411
|
+
- Harden MCP error responses and browser-origin defaults, confine scaffold writes to `routes/`, and
|
|
1412
|
+
make sanitized HTML require an explicit sanitizer function.
|
|
1413
|
+
- Updated dependencies [8d23613]
|
|
1414
|
+
- Updated dependencies [8d23613]
|
|
1415
|
+
- Updated dependencies
|
|
1416
|
+
- Updated dependencies [719d82e]
|
|
1417
|
+
- @nifrajs/mcp@3.4.0
|
|
1418
|
+
- @nifrajs/web@3.4.0
|
|
1419
|
+
- @nifrajs/core@3.4.0
|
|
1420
|
+
- @nifrajs/schema@3.4.0
|
|
1421
|
+
- @nifrajs/testing@3.4.0
|
|
1422
|
+
- @nifrajs/client@3.4.0
|
|
1423
|
+
- @nifrajs/runner@3.4.0
|
|
1424
|
+
- create-nifra@3.4.0
|
|
1425
|
+
|
|
1426
|
+
## 3.3.0
|
|
1427
|
+
|
|
1428
|
+
### Patch Changes
|
|
1429
|
+
|
|
1430
|
+
- @nifrajs/client@3.3.0
|
|
1431
|
+
- @nifrajs/core@3.3.0
|
|
1432
|
+
- @nifrajs/mcp@3.3.0
|
|
1433
|
+
- @nifrajs/runner@3.3.0
|
|
1434
|
+
- @nifrajs/schema@3.3.0
|
|
1435
|
+
- @nifrajs/testing@3.3.0
|
|
1436
|
+
- @nifrajs/web@3.3.0
|
|
1437
|
+
- create-nifra@3.3.0
|
|
1438
|
+
|
|
1439
|
+
## 3.2.0
|
|
1440
|
+
|
|
1441
|
+
### Minor Changes
|
|
1442
|
+
|
|
1443
|
+
- 652201a: Make islands the first-class interactivity lane for zero-runtime vanilla pages. `@nifrajs/web/islands`
|
|
1444
|
+
now exports `defineIsland` to type an enhancer's props and `createIslandBus` for typed pub/sub between
|
|
1445
|
+
islands that share no state. `nifra check` gains `NF-C020`, warning when an island enhancer wires an
|
|
1446
|
+
event listener but returns no cleanup, and `nifra scaffold` emits a golden vanilla route stub. New
|
|
1447
|
+
"Islands" cookbook documents the counter, cart-badge, and filter patterns.
|
|
1448
|
+
- 19a9f84: Add `nifra_frontend` (MCP) and `nifra frontend` (CLI): a symptom-indexed catalog of client-side
|
|
1449
|
+
footguns across every adapter (React, Preact, Solid, Vue, Svelte, vanilla). Each entry returns the
|
|
1450
|
+
cause, the concrete fix, and how to verify it. It splits along the seam `nifra_check` already owns: the
|
|
1451
|
+
adapter-independent boundary issues (a server-only import leaking into a client component, a hydration
|
|
1452
|
+
mismatch, a duplicated framework runtime, loader-data typing) point at the `nifra_*` tool that fixes
|
|
1453
|
+
and checks them, while the per-framework reactivity-loss idioms (Vue ref, Solid props, Svelte runes,
|
|
1454
|
+
React effect deps) point at that framework's own ESLint plugin rather than re-implementing it. Reach
|
|
1455
|
+
for it when a rendered page misbehaves and the static check is green. The tool is project-independent,
|
|
1456
|
+
so it is served on every transport (project stdio, `nifra docs-mcp`, and the site's `/mcp` worker), and
|
|
1457
|
+
the per-framework `nifra_scaffold` notes now route to it.
|
|
1458
|
+
- 25305bb: Add `@nifrajs/web/nano`, the explicit-reactivity lane for small apps that want local state without a
|
|
1459
|
+
framework runtime. It exports `signal`, `computed(fn, [deps])` with an explicit dependency array,
|
|
1460
|
+
`resource(fetcher, [deps])` - an async cell with a `pending`/`error`/`ready` value union that aborts a
|
|
1461
|
+
superseded fetch and drops its stale result - and `bind` / `bindList` / `bindResource` DOM edges, all
|
|
1462
|
+
with no virtual DOM and no auto-tracking. Because every reactive edge is a visible call, `nifra check`
|
|
1463
|
+
gains three static lints: `NF-C021` (a `bind`/`bindList`/`bindResource` whose disposer is discarded),
|
|
1464
|
+
`NF-C022` (a `bindList` keyed by the array index), and `NF-C023` (a `computed`/`resource` that reads a
|
|
1465
|
+
signal its deps omit). `nifra scaffold` accepts `variant: "stateful"` to emit the golden nano island
|
|
1466
|
+
pattern on a vanilla project, and a new "nano" cookbook documents signals, keyed lists, async state,
|
|
1467
|
+
and where the lane stops.
|
|
1468
|
+
|
|
1469
|
+
### Patch Changes
|
|
1470
|
+
|
|
1471
|
+
- e7d55cc: Centralize repository verification gates behind stable, ID-addressed plans and expose the same plan through the project MCP server, so default and release verification cannot drift when gates change.
|
|
1472
|
+
- e88c23a: Infer typed status responses across lifecycle hooks and contract-first routes, preserve precise
|
|
1473
|
+
success and error narrowing in the client, and optionally include supported response types in
|
|
1474
|
+
build-time OpenAPI output. Unsupported TypeScript types remain opaque and explicit runtime schemas
|
|
1475
|
+
remain authoritative.
|
|
1476
|
+
- 4c81384: Harden Windows Bun dev re-exec entry detection and TypeScript route navigation across short/long path aliases.
|
|
1477
|
+
- Updated dependencies [1a041a9]
|
|
1478
|
+
- Updated dependencies [652201a]
|
|
1479
|
+
- Updated dependencies [6aa39aa]
|
|
1480
|
+
- Updated dependencies [3aefb12]
|
|
1481
|
+
- Updated dependencies [8b58d1f]
|
|
1482
|
+
- Updated dependencies [c4ed8f7]
|
|
1483
|
+
- Updated dependencies [cefedc2]
|
|
1484
|
+
- Updated dependencies [25305bb]
|
|
1485
|
+
- Updated dependencies [095c320]
|
|
1486
|
+
- Updated dependencies [7504864]
|
|
1487
|
+
- Updated dependencies [e88c23a]
|
|
1488
|
+
- Updated dependencies [c39712e]
|
|
1489
|
+
- Updated dependencies [9010fd3]
|
|
1490
|
+
- Updated dependencies [7551709]
|
|
1491
|
+
- Updated dependencies [ea2356e]
|
|
1492
|
+
- Updated dependencies [a816b87]
|
|
1493
|
+
- @nifrajs/mcp@3.2.0
|
|
1494
|
+
- @nifrajs/testing@3.2.0
|
|
1495
|
+
- @nifrajs/web@3.2.0
|
|
1496
|
+
- @nifrajs/core@3.2.0
|
|
1497
|
+
- @nifrajs/client@3.2.0
|
|
1498
|
+
- @nifrajs/schema@3.2.0
|
|
1499
|
+
- @nifrajs/runner@3.2.0
|
|
1500
|
+
- create-nifra@3.2.0
|
|
1501
|
+
|
|
1502
|
+
## 3.1.0
|
|
1503
|
+
|
|
1504
|
+
### Patch Changes
|
|
1505
|
+
|
|
1506
|
+
- Updated dependencies [5b78473]
|
|
1507
|
+
- Updated dependencies [1400f6c]
|
|
1508
|
+
- Updated dependencies [8b136ee]
|
|
1509
|
+
- Updated dependencies [a7db515]
|
|
1510
|
+
- @nifrajs/core@3.1.0
|
|
1511
|
+
- @nifrajs/web@3.1.0
|
|
1512
|
+
- @nifrajs/client@3.1.0
|
|
1513
|
+
- @nifrajs/mcp@3.1.0
|
|
1514
|
+
- @nifrajs/schema@3.1.0
|
|
1515
|
+
- @nifrajs/testing@3.1.0
|
|
1516
|
+
- @nifrajs/runner@3.1.0
|
|
1517
|
+
- create-nifra@3.1.0
|
|
1518
|
+
|
|
1519
|
+
## 3.0.0
|
|
1520
|
+
|
|
1521
|
+
### Minor Changes
|
|
1522
|
+
|
|
1523
|
+
- 5a94db4: The reserved typed-client proxy keys are now a frozen, published contract with a migration path.
|
|
1524
|
+
|
|
1525
|
+
`nifra fix --code NF-C018` rewrites the call sites a reserved-named route segment breaks. It reads the sites from the compiler rather than from a text search, so it finds every one and never mistakes a real `.delete` verb call for a path segment; a site it cannot rewrite confidently (bracket access, a node held in a variable) is reported and left alone rather than guessed at.
|
|
1526
|
+
|
|
1527
|
+
`nifra routes` now annotates a colliding route with the reserved key and the spelling that reaches it, in both the table and `--json`, so the closed set is visible while the route is being written instead of when a build breaks. The typed-client call form printed by `nifra context` and the `nifra_routes` MCP tool is corrected for these routes too: a reserved segment is emitted as a call on the parent node, never as a property or bracket access, both of which the proxy intercepts.
|
|
1528
|
+
|
|
1529
|
+
`@nifrajs/client` exports the set itself - `RESERVED_VERB_KEYS`, `RESERVED_EXACT_KEYS`, `RESERVED_KEY_READOUT`, and `reservedKeyFor(segment)` - as the one place it is written down. The list is frozen: no name is ever added to it, because adding one breaks, at compile time, every consumer that happens to have a route segment with that name. Anything the client gains from here on is reached through a namespaced or symbol key, which no URL path segment can spell.
|
|
1530
|
+
|
|
1531
|
+
Client 2.12.0 should have been a major release: its reserved-segment types reject a property access that compiled in 2.11. Its changelog entry now says so, and `CONTRIBUTING.md` states the rule - a type that stops compiling is a breaking change, runtime behavior notwithstanding, and ships with a codemod.
|
|
1532
|
+
|
|
1533
|
+
### Patch Changes
|
|
1534
|
+
|
|
1535
|
+
- 5948f24: A new `check:changesets` gate fails when a package's source changed since the last release without a changeset naming it. Versioning is fixed across the workspace, so an undeclared package still bumps - it just ships with a changelog that says nothing about what moved, which is how a consumer upgrades into a change no release note mentions. The gate anchors on the last release commit in git history, so it needs no tag, base ref, or network, and it runs in `nifra check` release mode as well as CI.
|
|
1536
|
+
- 627b0ba: `nifra` now accepts `--env-file <path>` on every command, repeatable, with later files winning and a variable already set in the process environment never overwritten.
|
|
1537
|
+
|
|
1538
|
+
Commands that reflect a project (`check`, `assure`, `levels`, `routes`, `capabilities`, `manifest`, `contracts`, `openapi`, `types`) do so by importing it, and a production-grade app validates its environment at module scope. Without that environment the app aborted the process before nifra reached its first check, so the entire output was the app's own `FATAL: invalid environment` with nothing tying it to the command that was run - an app whose environment lives in an uncommitted `.env.local` simply could not be checked. A missing `--env-file` is a hard error rather than a silent no-op, so a command never looks like it verified an environment it did not load.
|
|
1539
|
+
|
|
1540
|
+
When a reflected import kills the process anyway, the CLI now names the cause on the way out instead of leaving the app's bare abort as the only output.
|
|
1541
|
+
|
|
1542
|
+
- 293a7fe: Identity-parity findings now state the install topology, and `nifra doctor` and the build guard now answer on the same basis.
|
|
1543
|
+
|
|
1544
|
+
Both tools already shared one walker, but they anchored it differently: doctor scanned the workspace that governs the project while the build guard scanned the app directory it was invoked in, so a duplicate that lives in a sibling workspace package could show up in one output and not the other. Since neither printed which directory it had scanned, that read as two tools contradicting each other about the same invariant. The scan is now always anchored on the governing workspace, both tools name the root they answered on, and a scan that stopped at the workspace-enumeration cap reports itself as partial instead of returning "no duplicates".
|
|
1545
|
+
|
|
1546
|
+
A finding whose copies lie outside the directory the command was run in now says why it is still fatal there: the gate is workspace-wide deliberately, because a copy reached through a workspace-linked dependency is not visible from the app directory - the exact case that once had the check report "none" against an already-broken dev server. Running a build inside one app can therefore fail on a copy held by a sibling app, and the message states that trade rather than leaving it to look like the tool checking the wrong project.
|
|
1547
|
+
|
|
1548
|
+
Each finding also carries a topology line: how many physical paths, how many install roots they fall under, and whether any of those roots sits outside the scanned root. That distinction is the whole fix decision - copies under one workspace collapse with a single reinstall from the root, while a copy under a linked checkout or a standalone sibling install belongs to another project and no reinstall here can remove it. Previously the error listed paths only, leaving that to be reverse-engineered.
|
|
1549
|
+
|
|
1550
|
+
The hard gate now fails closed on a truncated scan. A scan that stopped at any of its caps - workspace packages, linked packages, or link probes - and then found no duplicates has not shown there is none; the duplicate can be sitting in the part it never reached. `assertIdentityParity` treats that state as inconclusive and throws, rather than reading an incomplete scan as a pass. The reporting surfaces (`nifra doctor`, the dev warning) still print the partial result and name the limit that was hit.
|
|
1551
|
+
|
|
1552
|
+
- 36801ae: New: a static `singleCopy` declaration that collapses an identity-sensitive package to one physical copy, for the duplicate no install can remove.
|
|
1553
|
+
|
|
1554
|
+
An app that consumes a package by `link:` from a **separate checkout** cannot deduplicate React (or `@nifrajs/*`) by installing differently. The linked files live in the other repo, so their imports resolve from that repo's real path, and that repo's install owns its `node_modules`: peer dependencies are already satisfied there, `overrides` govern the consuming install only, and a deleted nested copy returns on the sibling's next install. The build's existing per-framework dedupe covers bundled output, but nothing covered `bun test`, `bun run`, or a preloaded script - and `nifra check` failed the app with remediation ("deduplicate the install") that the topology makes impossible.
|
|
1555
|
+
|
|
1556
|
+
An app now declares the packages in its own `package.json`:
|
|
1557
|
+
|
|
1558
|
+
```json
|
|
1559
|
+
{ "nifra": { "singleCopy": ["react", "react-dom", "@nifrajs/*"] } }
|
|
1560
|
+
```
|
|
1561
|
+
|
|
1562
|
+
Entries are exact names or `@scope/*` patterns; `true` expands to the built-in identity-sensitive set (`@nifrajs/*`, `react`, `react-dom`, `preact`, `solid-js`, `svelte`, `vue`). `@nifrajs/*` is in that set because two copies of `@nifrajs/core` are two distinct `Server` classes, so `.merge()` stops accepting an app built against the other one. The declaration is static so `nifra check` can read it without importing the app's config, which would mean executing app code inside a preflight.
|
|
1563
|
+
|
|
1564
|
+
`buildClient` and `buildServer` inject the resolver from the declaration, so bundled output needs no wiring. Unbundled phases are not covered automatically - Bun's runtime resolver never offers a bare specifier to a plugin - so an app preloads `@nifrajs/core/single-copy/register` from `bunfig.toml` (`preload` for `bun run`, `[test].preload` for `bun test`). `nifra check` now names the phase that is left uncovered when the declaration exists without the preload.
|
|
1565
|
+
|
|
1566
|
+
The redirect refuses to cross versions: two copies at different versions are skipped as `version-skew` and stay fatal, because collapsing them would turn a loud install problem into a quiet behavioural one. A declared duplicate is reported, not suppressed - `nifra check` keeps printing the copies as a warning and `nifra doctor` lists them under `deduplicatedInstalls` - so the topology stays visible without failing the gate.
|
|
1567
|
+
|
|
1568
|
+
New exports: `@nifrajs/core/single-copy` (`singleCopyPlugin`, `registerSingleCopy`, `planSingleCopy`, `readSingleCopyDeclaration`, `readSingleCopyRegistration`, `matchesSingleCopyDeclaration`, `IDENTITY_SENSITIVE_PACKAGES`) and the side-effect entry `@nifrajs/core/single-copy/register`.
|
|
1569
|
+
|
|
1570
|
+
The registration proof reads `preload` as entries rather than as text: an entry counts only when it **is** the register specifier, not when it merely contains it. A neighbouring path such as `"./vendor/@nifrajs/core/single-copy/register-shim.ts"` used to satisfy the check while Bun loaded that other module and the registrar never ran, so enforcement was reported as armed on a process still loading both copies. A `preload` this cannot read as quoted entries - a multi-line array, an interpolated value - now reports "not registered" instead of standing in for proof.
|
|
1571
|
+
|
|
1572
|
+
- 8895dca: `nifra check` picks up a TypeScript install that lands while a long-lived process is running, and refuses a "typescript" that is not the compiler.
|
|
1573
|
+
|
|
1574
|
+
The rule that parses source with the project's TypeScript resolved it through a resolver that memoizes a specifier for the life of the process and, when the project has none installed, falls back to the global download cache. In a long-lived process - the MCP server - the first lookup before `bun install` pinned that cache entry, so every later check in the same session kept using it: the typecheck went phantom until the server was restarted. Resolution is now a filesystem probe for `node_modules/typescript` from the project root upward, the same walk the typecheck gate uses to find `tsc`, so an install that lands mid-session is seen on the next run.
|
|
1575
|
+
|
|
1576
|
+
The cache entry it resolved to was also not a compiler, only a version stub, which crashed the scan with `undefined is not an object (evaluating 'ts.ScriptKind.TSX')` - a Nifra-looking stack trace for "no compiler is installed here". A module that does not expose the compiler API is now treated as a resolution miss, so the CLI falls back to its own copy or reports TypeScript as missing.
|
|
1577
|
+
|
|
1578
|
+
- 53fd454: Make `NF-C010` (workspace-linked dist older than its source) actually fixable.
|
|
1579
|
+
|
|
1580
|
+
The `workspace-dist.rebuild` recipe resolved the package through the project-contained path check, but a
|
|
1581
|
+
workspace link points outside the project by definition - the only kind of install that can go stale - so
|
|
1582
|
+
the check rejected every package the diagnostic can name and `nifra fix --code NF-C010` was a silent
|
|
1583
|
+
no-op. Resolution now goes through the same lookup the staleness scan uses (package name -> the project's
|
|
1584
|
+
own `node_modules` chain -> realpath), refuses with a stated reason (registry install, no `build` script,
|
|
1585
|
+
not installed) instead of reporting nothing, and surfaces the package's own build failure.
|
|
1586
|
+
|
|
1587
|
+
`nifra check` now names the directory and script in the warning (`cd ../pkg && bun run build`) instead of
|
|
1588
|
+
"usually `bun run build` in its directory", and `doctor --json` gained `packageDir` and `buildScript` on
|
|
1589
|
+
each stale-dist finding. `nifra fix` gained a `failed` array so one recipe that cannot act reports why
|
|
1590
|
+
without cancelling the rest of the run.
|
|
1591
|
+
|
|
1592
|
+
- Updated dependencies [f3d2a35]
|
|
1593
|
+
- Updated dependencies [6e43c15]
|
|
1594
|
+
- Updated dependencies [293a7fe]
|
|
1595
|
+
- Updated dependencies [485ae60]
|
|
1596
|
+
- Updated dependencies [627b0ba]
|
|
1597
|
+
- Updated dependencies [f0fd370]
|
|
1598
|
+
- Updated dependencies [004deee]
|
|
1599
|
+
- Updated dependencies [5a94db4]
|
|
1600
|
+
- Updated dependencies [86a555b]
|
|
1601
|
+
- Updated dependencies [8c5f4cf]
|
|
1602
|
+
- Updated dependencies [ee2744c]
|
|
1603
|
+
- Updated dependencies [f0fd370]
|
|
1604
|
+
- Updated dependencies [381bbf3]
|
|
1605
|
+
- Updated dependencies [36801ae]
|
|
1606
|
+
- Updated dependencies [9acadba]
|
|
1607
|
+
- Updated dependencies [99fc683]
|
|
1608
|
+
- Updated dependencies [73d894d]
|
|
1609
|
+
- @nifrajs/core@3.0.0
|
|
1610
|
+
- @nifrajs/web@3.0.0
|
|
1611
|
+
- @nifrajs/client@3.0.0
|
|
1612
|
+
- @nifrajs/runner@3.0.0
|
|
1613
|
+
- @nifrajs/mcp@3.0.0
|
|
1614
|
+
- @nifrajs/schema@3.0.0
|
|
1615
|
+
- @nifrajs/testing@3.0.0
|
|
1616
|
+
- create-nifra@3.0.0
|
|
1617
|
+
|
|
1618
|
+
## 2.14.1
|
|
1619
|
+
|
|
1620
|
+
### Patch Changes
|
|
1621
|
+
|
|
1622
|
+
- Updated dependencies [bf93902]
|
|
1623
|
+
- @nifrajs/core@2.14.1
|
|
1624
|
+
- @nifrajs/client@2.14.1
|
|
1625
|
+
- @nifrajs/mcp@2.14.1
|
|
1626
|
+
- @nifrajs/schema@2.14.1
|
|
1627
|
+
- @nifrajs/testing@2.14.1
|
|
1628
|
+
- @nifrajs/web@2.14.1
|
|
1629
|
+
- @nifrajs/runner@2.14.1
|
|
1630
|
+
- create-nifra@2.14.1
|
|
1631
|
+
|
|
1632
|
+
## 2.14.0
|
|
1633
|
+
|
|
1634
|
+
### Minor Changes
|
|
1635
|
+
|
|
1636
|
+
- 489c6b6: `nifra assure --json` again emits the route-assurance report `{ ok, routes, findings }`. A prior release
|
|
1637
|
+
had silently repurposed `--json` to print the structured `{ version, gates, verdict }` assurance bundle,
|
|
1638
|
+
so a consumer parsing the report shape saw its fields vanish with no version signal. The bundle is now
|
|
1639
|
+
opt-in behind an explicit `nifra assure --bundle` (always JSON); the bundle-only flags `--strict`,
|
|
1640
|
+
`--hydration`, `--interact`, and `--out` continue to imply it, and `--bundle --json` still yields the
|
|
1641
|
+
bundle. Plain `nifra assure` prints the human table as before. If you adopted `assure --json` for the
|
|
1642
|
+
bundle since it changed, switch to `assure --bundle`.
|
|
1643
|
+
- a8130aa: `nifra build` now fails when a workspace-linked dependency ships a `dist` artifact that is missing or
|
|
1644
|
+
older than its source. The `"bun": "./src"` / `"default": "./dist"` conditional-export split lets Bun
|
|
1645
|
+
(the build, the tests) read live source while the deployed app and any Node consumer read `dist`, so a
|
|
1646
|
+
green build could bundle stale or absent compiled output and nothing in a diff would show it. The check
|
|
1647
|
+
runs after the compile proves the source is buildable and names each offending package so the fix
|
|
1648
|
+
(rebuild it) is obvious. It is a no-op outside a workspace, since a tarball-installed dependency cannot
|
|
1649
|
+
drift. The doctor already surfaces the same skew as a development-time advisory; at build time it is now
|
|
1650
|
+
a hard failure, because that is the artifact that ships.
|
|
1651
|
+
- ea6b82a: `nifra --help` now lists a stable project command catalog, and the CLI, the `nifra mcp` project tools,
|
|
1652
|
+
and the generated `@nifrajs/cli` card all describe those commands - `check`, `assure`, `levels`,
|
|
1653
|
+
`capabilities`, `manifest`, `routes`, `context`, `doctor`, `fix`, `snapshot`, `diff`, `contracts`,
|
|
1654
|
+
`sync-manifest`, `sync-routes` - from one projection, so a command's name, one-line summary, and input
|
|
1655
|
+
schema can no longer drift between the three surfaces. A parity check fails the build if they do.
|
|
1656
|
+
`nifra verify` and `nifra prove` are intentionally excluded and stay hand-rolled.
|
|
1657
|
+
|
|
1658
|
+
`nifra fix` now prints a human summary by default and reserves JSON for `nifra fix --json`; the `--json`
|
|
1659
|
+
shape gains an `ok` field alongside `changed` and `diagnostics`. A script that parsed plain `nifra fix`
|
|
1660
|
+
output as JSON must pass `--json`.
|
|
1661
|
+
|
|
1662
|
+
Structured `--json` results carry a versioned envelope, and the reader still accepts the prior
|
|
1663
|
+
un-enveloped shape, so an existing consumer keeps working across the change.
|
|
1664
|
+
|
|
1665
|
+
- 489c6b6: `nifra dev` gains `--allow-duplicate-identity`, which downgrades the Vite dev server's startup
|
|
1666
|
+
identity-parity check from a hard failure to a loud warning. The check catches two physical copies of
|
|
1667
|
+
an identity-sensitive package (React, the framework adapter, `@nifrajs/core`) resolving in one process,
|
|
1668
|
+
which reliably breaks hydration and framework context - so it stays a hard stop by default, and
|
|
1669
|
+
`nifra build` never honors the flag. But when the duplicate originates in a linked sibling repo you
|
|
1670
|
+
cannot fix in the moment, the previous behavior took the dev server down with no way to keep working.
|
|
1671
|
+
With the flag, the server prints the same finding detail (packages, versions, resolved paths) and a
|
|
1672
|
+
reminder that duplicate identity can still corrupt hydration, then continues at exit 0. The web option
|
|
1673
|
+
`createViteDevServer({ allowDuplicateIdentity: true })` exposes the same escape programmatically.
|
|
1674
|
+
- a8130aa: The interpolated-SQL rule now resolves a query-call argument identifier to its same-file initializer
|
|
1675
|
+
before shaping it, so extracting a variable no longer launders a finding. Previously
|
|
1676
|
+
`` await c.query(`SELECT ... '${input}'`) `` was flagged but the identical hoisted form
|
|
1677
|
+
`` const q = `SELECT ... '${input}'`; await c.query(q) `` passed clean, because const-resolution
|
|
1678
|
+
reached consts referenced inside a template but never the argument identifier itself.
|
|
1679
|
+
|
|
1680
|
+
Resolution covers const and never-reassigned `let`, at both function-local and module scope, and
|
|
1681
|
+
follows a chain of identifier initializers transitively. The nearest enclosing binding wins, so a local
|
|
1682
|
+
never resolves through a shadowed outer name. A resolved dynamic statement is an error exactly as the
|
|
1683
|
+
inline form is; a static hoisted statement (including a const assembled from other static consts) stays
|
|
1684
|
+
green. Identifiers that cannot be resolved in-file - parameters, imports, reassigned bindings - are left
|
|
1685
|
+
unflagged rather than guessed at, so a helper that receives a prepared statement as a parameter is not
|
|
1686
|
+
falsely accused.
|
|
1687
|
+
|
|
1688
|
+
New per-statement escape hatch for the case where a dynamic-looking statement is provably safe (a
|
|
1689
|
+
generated placeholder list, say): a `// nifra-expect sql-dynamic: <reason>` comment on or directly above
|
|
1690
|
+
the flagged line silences that one statement. The reason is mandatory - a bare marker with no reason
|
|
1691
|
+
does not suppress.
|
|
1692
|
+
|
|
1693
|
+
### Patch Changes
|
|
1694
|
+
|
|
1695
|
+
- 8dd97c0: App load now rejects a `clientModule` that has no `./` prefix but names a real local file. Such a
|
|
1696
|
+
specifier is read as a bare package specifier and resolved against `node_modules`, not the project - so
|
|
1697
|
+
`src/client.tsx` (a forgotten `./`) is ignored, no package is found, and the bundle fails deep in the
|
|
1698
|
+
build with an opaque "cannot resolve". Load catches it up front and reports the one-character fix
|
|
1699
|
+
(`./src/client.tsx`), so `nifra dev` and `nifra build` resolve the same local entry. Scoped (`@…`),
|
|
1700
|
+
absolute, and genuine bare-package specifiers are unaffected.
|
|
1701
|
+
- a8130aa: `nifra doctor` now flags a running CLI whose feature version differs from the `@nifrajs/cli` (or
|
|
1702
|
+
`@nifrajs/core`) the project installs. A stale global or `bunx`-cached binary answering about a
|
|
1703
|
+
project it does not match returns types, checks, and docs that describe a surface the code does not
|
|
1704
|
+
have, and every answer still reads as authoritative. The finding is advisory - it names both versions
|
|
1705
|
+
and points at the project's own CLI, but never fails the gate on its own, since a version mismatch of
|
|
1706
|
+
the binary is an environment condition rather than a defect in the project. Reported only when the
|
|
1707
|
+
command supplies its own version, so callers that already annotate drift (the MCP server) do not
|
|
1708
|
+
double-report; the `--json` shape gains an optional `toolingDrift` field. Patch differences are
|
|
1709
|
+
ignored - they never change the described surface.
|
|
1710
|
+
- a8130aa: `nifra check` now prints an advisory when the contract lock is vacuous - every route hashes to the
|
|
1711
|
+
empty-schema digest because no route declares a `body`, `query`, `params`, or `response` schema. Such a
|
|
1712
|
+
lock passes drift detection unconditionally: it can only ever compare an empty schema to an empty
|
|
1713
|
+
schema, so it guards nothing. The advisory says so and points at declaring route schemas, so a first
|
|
1714
|
+
run on an unschematized app does not leave a lock that looks protective but is not. A lock with no
|
|
1715
|
+
routes at all is not treated as vacuous, since there is no unguarded contract to warn about.
|
|
1716
|
+
- Updated dependencies [489c6b6]
|
|
1717
|
+
- Updated dependencies [701961a]
|
|
1718
|
+
- Updated dependencies [62e22e2]
|
|
1719
|
+
- Updated dependencies [62e22e2]
|
|
1720
|
+
- Updated dependencies [62133bf]
|
|
1721
|
+
- Updated dependencies [8dffdf4]
|
|
1722
|
+
- Updated dependencies [489c6b6]
|
|
1723
|
+
- @nifrajs/web@2.14.0
|
|
1724
|
+
- @nifrajs/core@2.14.0
|
|
1725
|
+
- @nifrajs/client@2.14.0
|
|
1726
|
+
- @nifrajs/mcp@2.14.0
|
|
1727
|
+
- @nifrajs/schema@2.14.0
|
|
1728
|
+
- @nifrajs/testing@2.14.0
|
|
1729
|
+
- @nifrajs/runner@2.14.0
|
|
1730
|
+
- create-nifra@2.14.0
|
|
1731
|
+
|
|
1732
|
+
## 2.13.0
|
|
1733
|
+
|
|
1734
|
+
### Minor Changes
|
|
1735
|
+
|
|
1736
|
+
- 6510fdc: Add `nifra verify`, one command that runs the repository verification gate. `--release` runs the full
|
|
1737
|
+
build, test, coverage, corpus, consumer, and cross-runtime set; the default runs a fast lint,
|
|
1738
|
+
typecheck, and test pass. `--json` emits a machine-readable result carrying each gate's status and
|
|
1739
|
+
remediation, so the same gate serves humans, CI, and agents.
|
|
1740
|
+
|
|
1741
|
+
### Patch Changes
|
|
1742
|
+
|
|
1743
|
+
- Updated dependencies [e0b2dd6]
|
|
1744
|
+
- Updated dependencies [7535ce1]
|
|
1745
|
+
- Updated dependencies [1704308]
|
|
1746
|
+
- Updated dependencies [6510fdc]
|
|
1747
|
+
- @nifrajs/core@2.13.0
|
|
1748
|
+
- @nifrajs/web@2.13.0
|
|
1749
|
+
- @nifrajs/client@2.13.0
|
|
1750
|
+
- @nifrajs/mcp@2.13.0
|
|
1751
|
+
- @nifrajs/schema@2.13.0
|
|
1752
|
+
- @nifrajs/testing@2.13.0
|
|
1753
|
+
- @nifrajs/runner@2.13.0
|
|
1754
|
+
- create-nifra@2.13.0
|
|
1755
|
+
|
|
1756
|
+
## 2.12.1
|
|
1757
|
+
|
|
1758
|
+
### Patch Changes
|
|
1759
|
+
|
|
1760
|
+
- Updated dependencies [fba30c7]
|
|
1761
|
+
- @nifrajs/core@2.12.1
|
|
1762
|
+
- @nifrajs/client@2.12.1
|
|
1763
|
+
- @nifrajs/mcp@2.12.1
|
|
1764
|
+
- @nifrajs/schema@2.12.1
|
|
1765
|
+
- @nifrajs/testing@2.12.1
|
|
1766
|
+
- @nifrajs/web@2.12.1
|
|
1767
|
+
- @nifrajs/runner@2.12.1
|
|
1768
|
+
- create-nifra@2.12.1
|
|
1769
|
+
|
|
1770
|
+
## 2.12.0
|
|
1771
|
+
|
|
1772
|
+
### Minor Changes
|
|
1773
|
+
|
|
1774
|
+
- df100d3: Canonical project evidence: a single reflected snapshot of a project's routes, schemas, assurance,
|
|
1775
|
+
and capabilities, exported as `@nifrajs/core/evidence` (`snapshotProjectEvidence`). Tools that used
|
|
1776
|
+
to reflect the app a second time now project from the snapshot instead, so the manifest, the check
|
|
1777
|
+
report, and introspection cannot disagree about what the app declares.
|
|
1778
|
+
|
|
1779
|
+
`createManifest` accepts the snapshot as `evidence` and skips its own reflection when given one. It
|
|
1780
|
+
refuses to emit a manifest whose route-assurance or capability evidence is failing, so a manifest is
|
|
1781
|
+
never a record of a project that does not pass its own gates. The previous `source` input still
|
|
1782
|
+
works; one of the two is required.
|
|
1783
|
+
|
|
1784
|
+
- df100d3: `nifra check`'s text-scanning rules confirm their candidates against a parsed source model before
|
|
1785
|
+
reporting. A route path spelled inside an ordinary string, a `return new Response(` written in a
|
|
1786
|
+
comment or template text, and an erased inline `import { type X }` no longer produce findings that
|
|
1787
|
+
a reader has to dismiss by hand.
|
|
1788
|
+
|
|
1789
|
+
The parser is a refinement, never a relaxation: it is invoked lazily - only once a lexical scan
|
|
1790
|
+
finds something worth disambiguating - the parse is cached across rules for the run, and a file that
|
|
1791
|
+
fails to parse keeps its lexical finding so the security rules stay fail-closed.
|
|
1792
|
+
|
|
1793
|
+
- b5aa099: `nifra check` verdicts are now install- and cwd-invariant, fully visible in the text report, and configurable per rule:
|
|
1794
|
+
|
|
1795
|
+
- **Report parity.** Every diagnostic that affects the exit code now appears in the human text report, not only in `--json` - registry rules and application rule packs render under their code titles, and the trailer states the exact error/advisory counts behind the verdict.
|
|
1796
|
+
- **Typecheck can no longer skip silently.** A project with a `tsconfig.json` but no installed TypeScript now fails the check with an actionable diagnostic (`bun add -d typescript`) instead of a dim skip line, and the skip note names the reason.
|
|
1797
|
+
- **Project-resolved compiler.** `tsc` and the TypeScript API used by compiler-backed lints resolve upward from the project root (monorepo hoisting included), so verdicts no longer depend on the working directory or on how the CLI was installed. Security lints that cannot run without TypeScript emit an explicit "did NOT run" advisory instead of passing silently.
|
|
1798
|
+
- **`nifra.check.json` rule overrides.** A new `rules` map accepts per-rule `severity` (`error`/`warn`/`info`/`off`) and `ignore` globs, keyed by NF- code or legacy rule name; applied overrides are echoed in the report and the JSON result for auditability, and invalid entries warn instead of silently applying.
|
|
1799
|
+
- **NF-S002 severity by file role.** Non-constant-time secret comparisons in server-role files (`*.server.ts`, `server/`, `backend.ts`) stay errors; the same pattern in client-leaning files (`.tsx`/`.jsx`, `routes/`) reports as a warning. The `@nifra-gate-reviewed` marker now applies from anywhere inside the preceding comment block.
|
|
1800
|
+
|
|
1801
|
+
- 27e06a9: Typed collision escape for reserved-named route segments. The client proxy resolves the seven HTTP verbs (any casing) plus `subscribe`, `ws`, `index`, and `then` before path segments, so a route like `POST /api/delete` cannot be reached by dot access - `api.delete` is the DELETE verb. The typed spelling is now a call on the parent node: `api.api("delete").post()` sends `POST /api/delete`. The call signature accepts exactly the colliding segment names under that node (it is not a general string path builder), coexists with param calls on the same node (an object is a param bag, a string literal the segment), and covers all eleven reserved names including `then`. Purely additive - no runtime change, no existing call site affected.
|
|
1802
|
+
|
|
1803
|
+
`NF-C018` accordingly downgrades from error to warning and its message now spells out the escape call for the flagged route, alongside the existing rename and `nifra-expect reserved-segment` options.
|
|
1804
|
+
|
|
1805
|
+
- 9314567: `nifra doctor` follows linked dependencies when looking for duplicate installs. A package linked in
|
|
1806
|
+
from a sibling repo (`link:`, `npm link`, a local file dependency) resolves through a symlink that
|
|
1807
|
+
leaves the workspace, and the copies of `@nifrajs/*` installed inside that sibling were invisible to
|
|
1808
|
+
the duplicate check - the exact shape that produces two incompatible copies of core in one build.
|
|
1809
|
+
Doctor now resolves each linked dependency to its real path, probes it for identity-sensitive
|
|
1810
|
+
packages, and reports every copy with the path it was found at. The scan is bounded (linked roots
|
|
1811
|
+
and probes are capped) and stays inside the linked package's own repository.
|
|
1812
|
+
- 3d8d8e4: Add production-readiness checks to `nifra doctor`, including target-aware reporting and a `--strict` mode for failing when applicable guarantees are absent.
|
|
1813
|
+
- ce3128f: `nifra mcp` resolves the project it describes instead of trusting the directory it was spawned in.
|
|
1814
|
+
An MCP client configured with a different working directory used to get confident answers about
|
|
1815
|
+
whatever happened to be there - or about no project at all - with nothing in the response saying so.
|
|
1816
|
+
|
|
1817
|
+
- `nifra mcp <dir>` takes an explicit project directory; a human-named root always wins.
|
|
1818
|
+
- Without one, the spawn directory walks UP to the nearest nifra marker (a `package.json` depending
|
|
1819
|
+
on `@nifrajs/*`, or a `nifra.config.ts` monorepo root), so starting in a subdirectory still lands
|
|
1820
|
+
on the project.
|
|
1821
|
+
- After the handshake the server reads the client's MCP `roots`. When the guess found no project, or
|
|
1822
|
+
found one disjoint from every workspace root, and exactly ONE workspace root is a nifra project,
|
|
1823
|
+
that root is adopted. Ambiguity adopts nothing.
|
|
1824
|
+
- What cannot be resolved fails closed: project-scoped tools refuse with a remediation message that
|
|
1825
|
+
lists the candidate roots. When a root IS in effect, every project tool result carries a note
|
|
1826
|
+
naming it, and the `initialize` instructions announce it.
|
|
1827
|
+
|
|
1828
|
+
- ba85ce7: The MCP server says when it is answering from a different nifra than the project builds with. A
|
|
1829
|
+
client that launches a globally installed `nifra mcp` gets confident, authoritative answers about
|
|
1830
|
+
types, checks, and docs from whichever CLI version happens to be on the machine - the mismatch is
|
|
1831
|
+
invisible in every answer. The server now compares its own version against the `@nifrajs/cli` (or
|
|
1832
|
+
`@nifrajs/core`) installed in the resolved project root, and when the feature versions differ it
|
|
1833
|
+
stamps a warning naming both versions on the `initialize` instructions and on every project tool
|
|
1834
|
+
result, with the command that runs the project's own CLI instead. Patch-level differences are not
|
|
1835
|
+
reported.
|
|
1836
|
+
- 5a02c51: Route-table lints in `nifra check`: `NF-C018` (error) flags routes whose static path segments spell a reserved typed-client proxy key (get/post/put/patch/delete/head/options in any casing, plus `subscribe`, `ws`, `index`, `then`) - such routes are unreachable through the typed client; opt out for an intentionally non-typed-client route with `// nifra-expect reserved-segment` above the registration. `NF-C019` (error) flags the same method+path registered twice in one file, where which registration serves is undefined.
|
|
1837
|
+
- 0aadd62: Four new built-in security lints in `nifra check`: `NF-S004` warns when a `cors` origin predicate never reads the origin (it allows every origin), `NF-S005` warns on `redirect(..., { external: true })` call sites so open-redirect surfaces stay auditable, `NF-S006` warns when a security escape hatch (`allowLengthless`, `allowGlobalKey`, `allowInProduction`) is enabled and names the assurance claim it weakens, and `NF-S007` (info) nudges Secure cookies toward `__Host-`/`__Secure-` prefixes. All four honor the `@nifra-gate-reviewed` marker and share the existing one-parse-per-file pipeline.
|
|
1838
|
+
- 866d59f: `nifra check`'s interpolated-SQL rule follows a query fragment into the module that exports it. A project that keeps its column lists and order clauses in a `sql-fragments.ts` and imports them by name no longer gets an error on every query assembled from them, so the rule's errors stay the ones worth reading.
|
|
1839
|
+
|
|
1840
|
+
Resolution stops wherever proof does, because a wrong resolution here silences a real SQL injection rather than reporting a false one. It follows `export const NAME = "…"`, the two-statement `const NAME = …; export { NAME }`, and barrels (`export { NAME } from`, `export *`), reached by a named import from a relative specifier that lands on real source inside the project. Everything else still flags: a default or namespace import, an exported `let`, an initializer that is a call, a bare specifier (a dependency's exports are not the project's to prove), two `export *` sources offering the same name, a chain longer than three modules, a cyclic barrel, a file that does not parse, and a local binding that shadows the import. A resolved fragment still feeds the keyword scan, so hostile SQL parked in a shared constant is found rather than trusted, and the fragment's own identifiers are read in its own module - never in the file that imported it.
|
|
1841
|
+
|
|
1842
|
+
- a5d3f5b: Add stable diagnostic codes, application-supplied rule packs, fix recipes, assurance bundles, contract lock snapshots, hydration assurance hooks, replay metadata, security verification rules, and idempotency proofs.
|
|
1843
|
+
- e2d1939: Add typed tool contracts with shared fail-closed adapters, static verification work graphs, bounded provider-neutral agent turns, deterministic trajectory replay, and an explicit execution-policy seam with a non-isolating local process adapter.
|
|
1844
|
+
- e83e6eb: A capability provenance rule that matches nothing is now a finding. Seam specifiers in
|
|
1845
|
+
`provenance.imports` and `provenance.routeModules` are compared with the text the code imports, so a
|
|
1846
|
+
rule written as `src/db` when the module is imported as `./src/db.ts` silently governed zero
|
|
1847
|
+
modules - the policy looked satisfied because nothing was ever attributed to it. `nifra check` now
|
|
1848
|
+
reports `unmatched-provenance-seam` for every declared seam no scanned source matched, with the
|
|
1849
|
+
nearest specifiers that were actually seen ("did you mean ...?") and a fix that points at rewriting
|
|
1850
|
+
the rule to match the import, or deleting it.
|
|
1851
|
+
|
|
1852
|
+
`forbiddenImports` is deliberately excluded: zero matches there is the success state.
|
|
1853
|
+
|
|
1854
|
+
A rule that is genuinely absent in some projects sharing one policy can opt out with
|
|
1855
|
+
`optional: true`, which suppresses the finding for that seam only.
|
|
1856
|
+
|
|
1857
|
+
### Patch Changes
|
|
1858
|
+
|
|
1859
|
+
- 33548fe: The two CLI paths that bound a caller-supplied path to the project root now resolve it through the
|
|
1860
|
+
filesystem instead of comparing strings. `loadBackend`'s entry check and `resolveProjectDir` both
|
|
1861
|
+
compared the textual path, so a symlink inside the project pointed anywhere and still read as inside -
|
|
1862
|
+
and importing an entry executes it. Both now canonicalize with `realpath` before the containment test
|
|
1863
|
+
(`resolveProjectDir` walks up to the deepest existing ancestor, so a not-yet-created directory still
|
|
1864
|
+
resolves), and the test itself covers the Windows cross-drive case where `relative()` returns an
|
|
1865
|
+
absolute path that starts with neither `..` nor a separator.
|
|
1866
|
+
|
|
1867
|
+
`nifra init-agents` refuses to write through a symlink: a symlinked ancestor directory or a symlinked
|
|
1868
|
+
target file aborts with an error rather than landing the file wherever the link points. Writes are
|
|
1869
|
+
also atomic (temp file plus rename, `wx` so the temp cannot follow an existing name), so an
|
|
1870
|
+
interrupted run can no longer leave a half-written config behind.
|
|
1871
|
+
|
|
1872
|
+
- 0a91064: The docs, examples, and types MCP searches bound their own cost. A query is truncated to 256
|
|
1873
|
+
characters and 12 distinct terms before scoring (`MAX_QUERY_CHARS` / `MAX_QUERY_TERMS`), and the
|
|
1874
|
+
schemas advertise the same 256-character limit. Each bundled corpus is read once per process and its
|
|
1875
|
+
sections are parsed, tokenized, and lowercased once, instead of on every call - the corpus ships
|
|
1876
|
+
immutable in a published build, so there is nothing to invalidate.
|
|
1877
|
+
|
|
1878
|
+
Auto-fixes write only inside the project. A diagnostic path is rejected when it is absolute, when it
|
|
1879
|
+
escapes the root lexically, or when its real path lands outside after symlinks resolve; the fix is
|
|
1880
|
+
skipped rather than applied. Both the generic MCP edit path and the fix recipes share the one
|
|
1881
|
+
`resolveInsideProject` helper.
|
|
1882
|
+
|
|
1883
|
+
- Updated dependencies [df100d3]
|
|
1884
|
+
- Updated dependencies [0efacea]
|
|
1885
|
+
- Updated dependencies [cd1732c]
|
|
1886
|
+
- Updated dependencies [df100d3]
|
|
1887
|
+
- Updated dependencies [27e06a9]
|
|
1888
|
+
- Updated dependencies [9a9346e]
|
|
1889
|
+
- Updated dependencies [b5f47c0]
|
|
1890
|
+
- Updated dependencies [fc33c0f]
|
|
1891
|
+
- Updated dependencies [7dd3f28]
|
|
1892
|
+
- Updated dependencies [fa51aba]
|
|
1893
|
+
- Updated dependencies [c4e8bb0]
|
|
1894
|
+
- Updated dependencies [11d1658]
|
|
1895
|
+
- Updated dependencies [33ee9ff]
|
|
1896
|
+
- Updated dependencies [9a692a2]
|
|
1897
|
+
- Updated dependencies [5f71c23]
|
|
1898
|
+
- Updated dependencies [3788b36]
|
|
1899
|
+
- Updated dependencies [0863ef0]
|
|
1900
|
+
- Updated dependencies [ae5338f]
|
|
1901
|
+
- Updated dependencies [8847825]
|
|
1902
|
+
- Updated dependencies [cb04de8]
|
|
1903
|
+
- Updated dependencies [f3cc02e]
|
|
1904
|
+
- Updated dependencies [9a9346e]
|
|
1905
|
+
- Updated dependencies [4c2123d]
|
|
1906
|
+
- Updated dependencies [5e4e31a]
|
|
1907
|
+
- Updated dependencies [24f1787]
|
|
1908
|
+
- Updated dependencies [9a9346e]
|
|
1909
|
+
- Updated dependencies [b045f9e]
|
|
1910
|
+
- Updated dependencies [df07059]
|
|
1911
|
+
- Updated dependencies [9a9346e]
|
|
1912
|
+
- Updated dependencies [9a9346e]
|
|
1913
|
+
- Updated dependencies [dbc0b79]
|
|
1914
|
+
- Updated dependencies [bd5c624]
|
|
1915
|
+
- Updated dependencies [3868e1b]
|
|
1916
|
+
- Updated dependencies [a5d3f5b]
|
|
1917
|
+
- Updated dependencies [00819c5]
|
|
1918
|
+
- Updated dependencies [e2bdd4a]
|
|
1919
|
+
- Updated dependencies [e2d1939]
|
|
1920
|
+
- Updated dependencies [e83e6eb]
|
|
1921
|
+
- Updated dependencies [64d25db]
|
|
1922
|
+
- Updated dependencies [c55f7a3]
|
|
1923
|
+
- Updated dependencies [f8b0097]
|
|
1924
|
+
- @nifrajs/core@2.12.0
|
|
1925
|
+
- @nifrajs/client@2.12.0
|
|
1926
|
+
- create-nifra@2.12.0
|
|
1927
|
+
- @nifrajs/web@2.12.0
|
|
1928
|
+
- @nifrajs/mcp@2.12.0
|
|
1929
|
+
- @nifrajs/schema@2.12.0
|
|
1930
|
+
- @nifrajs/testing@2.12.0
|
|
1931
|
+
- @nifrajs/runner@2.12.0
|
|
1932
|
+
|
|
1933
|
+
## 2.11.0
|
|
1934
|
+
|
|
1935
|
+
### Minor Changes
|
|
1936
|
+
|
|
1937
|
+
- b80a1af: Every run says which bundler it is on. `nifra dev` and `nifra build` print a `bundler:` line under their banner - the pipeline, and how it was arrived at: the Bun default with the flag that switches away from it, a `--vite` / `--bun` the user asked for, or an automatic Vite selection with the config reason that forced it. An auto-selected Vite build no longer looks like the default.
|
|
1938
|
+
|
|
1939
|
+
`nifra check` and `nifra doctor` answer the same question without starting a server, and the `nifra_check`, `nifra_doctor` and `nifra_context` MCP tools return it in their results. They read the config as text, so the answer is available on a repo before its dependencies are installed.
|
|
1940
|
+
|
|
1941
|
+
They also report the hazards that exist only because there are two pipelines:
|
|
1942
|
+
|
|
1943
|
+
- a plugin in the slot the other bundler reads - accepted, never called, and the build still succeeds
|
|
1944
|
+
- a dev toolchain imported by the file `nifra build` bundles into the production server entry, which builds cleanly and then fails at startup on a bundler dependency
|
|
1945
|
+
- `conditions` under `nifra dev` on Bun, whose client bundler takes no resolve conditions
|
|
1946
|
+
|
|
1947
|
+
Slot mistakes and a toolchain in the server entry fail the check; the resolve-condition notice is advisory.
|
|
1948
|
+
|
|
1949
|
+
The dev-and-HMR guide gains a "Which pipeline runs, when" table covering every config and flag combination, and the terminal output that answers it for a given app.
|
|
1950
|
+
|
|
1951
|
+
### Patch Changes
|
|
1952
|
+
|
|
1953
|
+
- c29e0d0: Svelte runs on the Vite pipeline. `nifra dev` and `nifra build` now serve and build a Svelte app on either bundler, so a Svelte app is no longer the one framework pinned to a single pipeline, and pages render with routing context, typed search and layout data intact on both.
|
|
1954
|
+
|
|
1955
|
+
`@nifrajs/web` adds `setSsrModuleLoader` / `ssrModuleLoader`, the seam that makes it work. A dev server that owns SSR resolution publishes its module loader; a render adapter that has to load a compiled asset on the server reads it and loads through it, so that asset is compiled by the same toolchain as the app's routes and renders through the same copy of the framework runtime. Adapters that ship no compiled assets are unaffected.
|
|
1956
|
+
|
|
1957
|
+
`conditions` on the Bun dev pipeline reaches SSR, and says so when it cannot reach the client bundle Bun's dev server serves - a one-line startup notice instead of a package that quietly resolves to one file in dev and another in `nifra build`.
|
|
1958
|
+
|
|
1959
|
+
CSS Modules class names are now identical on both pipelines. The same class hashes to the same scoped name under `nifra dev`, `nifra dev --bun` and `nifra build`, so a selector written against a generated name behaves the same everywhere.
|
|
1960
|
+
|
|
1961
|
+
The dev-and-HMR guide gains a Gotchas section covering the config/adapter file split, plugin slots, resolve conditions, non-route SSR freshness, and the adapter loader.
|
|
1962
|
+
|
|
1963
|
+
- Updated dependencies [ed5e91c]
|
|
1964
|
+
- Updated dependencies [30f5ea3]
|
|
1965
|
+
- Updated dependencies [c29e0d0]
|
|
1966
|
+
- @nifrajs/web@2.11.0
|
|
1967
|
+
- @nifrajs/client@2.11.0
|
|
1968
|
+
- @nifrajs/core@2.11.0
|
|
1969
|
+
- @nifrajs/mcp@2.11.0
|
|
1970
|
+
- @nifrajs/runner@2.11.0
|
|
1971
|
+
- @nifrajs/schema@2.11.0
|
|
1972
|
+
- @nifrajs/testing@2.11.0
|
|
1973
|
+
- create-nifra@2.11.0
|
|
1974
|
+
|
|
1975
|
+
## 2.10.0
|
|
1976
|
+
|
|
1977
|
+
### Patch Changes
|
|
1978
|
+
|
|
1979
|
+
- 15bffdd: Add request-bound data capability evidence, resumable bounded channel subscriptions, ISR tag
|
|
1980
|
+
invalidation for memory and KV stores, and dependency-free Open Graph image responses with an
|
|
1981
|
+
optional rasterizer seam.
|
|
1982
|
+
- Updated dependencies [5263c4e]
|
|
1983
|
+
- Updated dependencies [15bffdd]
|
|
1984
|
+
- Updated dependencies [15bffdd]
|
|
1985
|
+
- Updated dependencies [15bffdd]
|
|
1986
|
+
- @nifrajs/web@2.10.0
|
|
1987
|
+
- @nifrajs/core@2.10.0
|
|
1988
|
+
- @nifrajs/client@2.10.0
|
|
1989
|
+
- @nifrajs/schema@2.10.0
|
|
1990
|
+
- @nifrajs/testing@2.10.0
|
|
1991
|
+
- @nifrajs/mcp@2.10.0
|
|
1992
|
+
- @nifrajs/runner@2.10.0
|
|
1993
|
+
- create-nifra@2.10.0
|
|
1994
|
+
|
|
1995
|
+
## 2.9.1
|
|
1996
|
+
|
|
1997
|
+
### Patch Changes
|
|
1998
|
+
|
|
1999
|
+
- Updated dependencies [01e36fb]
|
|
2000
|
+
- @nifrajs/core@2.9.1
|
|
2001
|
+
- @nifrajs/client@2.9.1
|
|
2002
|
+
- @nifrajs/schema@2.9.1
|
|
2003
|
+
- @nifrajs/testing@2.9.1
|
|
2004
|
+
- @nifrajs/web@2.9.1
|
|
2005
|
+
- @nifrajs/mcp@2.9.1
|
|
2006
|
+
- @nifrajs/runner@2.9.1
|
|
2007
|
+
- create-nifra@2.9.1
|
|
2008
|
+
|
|
2009
|
+
## 2.9.0
|
|
2010
|
+
|
|
2011
|
+
### Patch Changes
|
|
2012
|
+
|
|
2013
|
+
- Updated dependencies [b006d07]
|
|
2014
|
+
- Updated dependencies [e05e56d]
|
|
2015
|
+
- @nifrajs/client@2.9.0
|
|
2016
|
+
- @nifrajs/schema@2.9.0
|
|
2017
|
+
- @nifrajs/core@2.9.0
|
|
2018
|
+
- @nifrajs/web@2.9.0
|
|
2019
|
+
- @nifrajs/testing@2.9.0
|
|
2020
|
+
- @nifrajs/mcp@2.9.0
|
|
2021
|
+
- @nifrajs/runner@2.9.0
|
|
2022
|
+
- create-nifra@2.9.0
|
|
2023
|
+
|
|
2024
|
+
## 2.8.2
|
|
2025
|
+
|
|
2026
|
+
### Patch Changes
|
|
2027
|
+
|
|
2028
|
+
- f7d68e8: Numeric limit options (body/payload byte caps, TTLs, cache sizes, concurrency, ISR revalidate windows) are now validated at construction and throw a `RangeError` on non-finite or out-of-range values instead of silently disabling the bound - a `NaN` cap previously made `size > max` comparisons fail open. JWT `requiredClaims` now checks own properties only, so inherited names like `toString` no longer satisfy a required claim. `@nifrajs/mcp-db` gates multi-statement input with a real tokenizer, bounds `run_query` materialization to `maxRows + 1` via a wrapping subquery, and skips SQLite planner pseudo-nodes when verifying the table allowlist. `nifra scaffold` refuses to write through symlinked route directories.
|
|
2029
|
+
- Updated dependencies [f7d68e8]
|
|
2030
|
+
- @nifrajs/core@2.8.2
|
|
2031
|
+
- @nifrajs/mcp@2.8.2
|
|
2032
|
+
- @nifrajs/web@2.8.2
|
|
2033
|
+
- @nifrajs/client@2.8.2
|
|
2034
|
+
- @nifrajs/schema@2.8.2
|
|
2035
|
+
- @nifrajs/testing@2.8.2
|
|
2036
|
+
- @nifrajs/runner@2.8.2
|
|
2037
|
+
- create-nifra@2.8.2
|
|
2038
|
+
|
|
2039
|
+
## 2.8.1
|
|
2040
|
+
|
|
2041
|
+
### Patch Changes
|
|
2042
|
+
|
|
2043
|
+
- 93fdc89: `nifra doctor` now scans `*.test.ts`/`*.spec.ts` files for undeclared imports. Tests are part of the typechecked surface, so a package imported only by a test and declared nowhere still breaks a clean `bun install` build - doctor previously shared `nifra check`'s test exclusion and missed it. `nifra check`'s own scans still skip tests, which legitimately drive `fetch` and call routes directly.
|
|
2044
|
+
- Updated dependencies [78d66a4]
|
|
2045
|
+
- Updated dependencies [93fdc89]
|
|
2046
|
+
- @nifrajs/core@2.8.1
|
|
2047
|
+
- @nifrajs/client@2.8.1
|
|
2048
|
+
- @nifrajs/schema@2.8.1
|
|
2049
|
+
- @nifrajs/testing@2.8.1
|
|
2050
|
+
- @nifrajs/web@2.8.1
|
|
2051
|
+
- @nifrajs/mcp@2.8.1
|
|
2052
|
+
- @nifrajs/runner@2.8.1
|
|
2053
|
+
- create-nifra@2.8.1
|
|
2054
|
+
|
|
2055
|
+
## 2.8.0
|
|
2056
|
+
|
|
2057
|
+
### Minor Changes
|
|
2058
|
+
|
|
2059
|
+
- 118e4a5: `nifra dev --bun` now supports server functions and `*.server` modules. Bun's dev-server bundler accepts plugins only through bunfig's `[serve.static]` channel, so the CLI generates a config under `.nifra/dev-bun/` carrying the same production boundary plugins (server-fn RPC stubs, server-only emptying), merges the app's own bunfig `[serve.static] plugins` and `preload` entries, and re-launches itself once with `--config=` pointing at it - identical stubs across dev and build, and the old fail-closed refusal for those modules is gone. The relaunch is verified with a per-launch random token (matched against a file the parent just wrote, consumed on first read, constant-time compare), so no fixed environment value can make the server skip the boundary configuration; an unverifiable launch regenerates and re-launches instead of serving. The app's entire bunfig is carried into the generated config verbatim - jsx, defines, loaders, install settings - with path-bearing entries re-rooted; a bunfig field the generator cannot round-trip, or malformed TOML, fails loudly instead of being dropped. CSS Modules remain gated under `--bun`.
|
|
2060
|
+
|
|
2061
|
+
Also fixed in `@nifrajs/web`: `serverFn<Input, Output>(...)` with explicit type arguments is now recognized by the client-boundary scanner - it previously produced an exportless stub that failed the client build with a missing-export link error (a type argument containing parentheses still fails loudly with guidance, never silently). The dev loop's background leak guard now reports the underlying bundler errors instead of a bare "Bundle failed".
|
|
2062
|
+
|
|
2063
|
+
- 9a6b0c3: The docs MCP's example-browsing widget tool is now `nifra_gallery` (was `nifra_examples_app`), keeping every tool on the single-word `nifra_<noun>` pattern. Its description and `nifra_example`'s now state the split explicitly: `nifra_example` returns one verified snippet as text, `nifra_gallery` opens the browsable widget. The exported `examplesAppTool` API is unchanged.
|
|
2064
|
+
- ca60337: `nifra check`'s interpolated-SQL rule now resolves same-file constants. A module-scope `const` interpolated into a query - the shared column-projection idiom (`const COLS = "id, name"` ... `` `SELECT ${COLS} FROM ...` ``), a `const LIMIT = 50`, a const built from other consts, or a ternary whose branches are both literal - is compile-time text and no longer flags, with zero suppression config. Resolution is pure syntax with a depth cap: imported names, `let`, parameters, call results, member accesses, and shadowed names (including a hoisted `var` anywhere in the enclosing function) stay flagged exactly as before, and a resolved const still feeds the SQL-keyword scan, so hostile statement text in a const alongside a dynamic span is still caught. The named escape hatches (`unsafe`, `$queryRawUnsafe`) keep flagging statement-from-variable regardless.
|
|
2065
|
+
|
|
2066
|
+
### Patch Changes
|
|
2067
|
+
|
|
2068
|
+
- Updated dependencies [118e4a5]
|
|
2069
|
+
- @nifrajs/web@2.8.0
|
|
2070
|
+
- @nifrajs/client@2.8.0
|
|
2071
|
+
- @nifrajs/core@2.8.0
|
|
2072
|
+
- @nifrajs/mcp@2.8.0
|
|
2073
|
+
- @nifrajs/runner@2.8.0
|
|
2074
|
+
- @nifrajs/schema@2.8.0
|
|
2075
|
+
- @nifrajs/testing@2.8.0
|
|
2076
|
+
- create-nifra@2.8.0
|
|
2077
|
+
|
|
2078
|
+
## 2.7.1
|
|
2079
|
+
|
|
2080
|
+
### Patch Changes
|
|
2081
|
+
|
|
2082
|
+
- Updated dependencies [52c89e0]
|
|
2083
|
+
- @nifrajs/core@2.7.1
|
|
2084
|
+
- @nifrajs/client@2.7.1
|
|
2085
|
+
- @nifrajs/schema@2.7.1
|
|
2086
|
+
- @nifrajs/testing@2.7.1
|
|
2087
|
+
- @nifrajs/web@2.7.1
|
|
2088
|
+
- @nifrajs/mcp@2.7.1
|
|
2089
|
+
- @nifrajs/runner@2.7.1
|
|
2090
|
+
- create-nifra@2.7.1
|
|
2091
|
+
|
|
2092
|
+
## 2.7.0
|
|
2093
|
+
|
|
2094
|
+
### Patch Changes
|
|
2095
|
+
|
|
2096
|
+
- Updated dependencies [7fd0fc7]
|
|
2097
|
+
- create-nifra@2.7.0
|
|
2098
|
+
- @nifrajs/client@2.7.0
|
|
2099
|
+
- @nifrajs/core@2.7.0
|
|
2100
|
+
- @nifrajs/mcp@2.7.0
|
|
2101
|
+
- @nifrajs/runner@2.7.0
|
|
2102
|
+
- @nifrajs/schema@2.7.0
|
|
2103
|
+
- @nifrajs/testing@2.7.0
|
|
2104
|
+
- @nifrajs/web@2.7.0
|
|
2105
|
+
|
|
2106
|
+
## 2.6.1
|
|
2107
|
+
|
|
2108
|
+
### Patch Changes
|
|
2109
|
+
|
|
2110
|
+
- Updated dependencies [5840c98]
|
|
2111
|
+
- Updated dependencies [80419f5]
|
|
2112
|
+
- @nifrajs/core@2.6.1
|
|
2113
|
+
- @nifrajs/web@2.6.1
|
|
2114
|
+
- @nifrajs/client@2.6.1
|
|
2115
|
+
- @nifrajs/schema@2.6.1
|
|
2116
|
+
- @nifrajs/testing@2.6.1
|
|
2117
|
+
- @nifrajs/mcp@2.6.1
|
|
2118
|
+
- @nifrajs/runner@2.6.1
|
|
2119
|
+
- create-nifra@2.6.1
|
|
2120
|
+
|
|
2121
|
+
## 2.6.0
|
|
2122
|
+
|
|
2123
|
+
### Patch Changes
|
|
2124
|
+
|
|
2125
|
+
- e6349e5: Security hardening across input parsing and code generation. Every regex that runs on caller-influenced input (URL paths, route patterns, stylesheet and SVG sources, manifest text) is now linear - no polynomial backtracking on adversarial input. SVG preamble stripping and tag removal can no longer splice removed delimiters into new markers. Static file serving rejects `..` traversal in the request form outright and confines the resolved path with a `relative()` containment check. Generated code embeds strings through an escaper that neutralizes `</script>` breakout and the U+2028/U+2029 line separators, and HTML entity decoding resolves `&` last so double-encoded entities cannot double-unescape.
|
|
2126
|
+
- 10fb70c: `defineMcpTool` accepts `annotations` (the MCP tool safety hints - `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`, `title`), surfaced in `tools/list` and `tools/describe`. Hosts use these to pick confirmation UX, and connector directory reviews expect every tool to declare them. The hosted docs tools (`nifra_docs`, `nifra_example`, `nifra_types`, `nifra_learn`, `nifra_examples_app`) now all declare themselves read-only and closed-world.
|
|
2127
|
+
- Updated dependencies [e6349e5]
|
|
2128
|
+
- Updated dependencies [08fe221]
|
|
2129
|
+
- Updated dependencies [8383063]
|
|
2130
|
+
- Updated dependencies [10fb70c]
|
|
2131
|
+
- @nifrajs/web@2.6.0
|
|
2132
|
+
- @nifrajs/core@2.6.0
|
|
2133
|
+
- @nifrajs/mcp@2.6.0
|
|
2134
|
+
- @nifrajs/client@2.6.0
|
|
2135
|
+
- @nifrajs/schema@2.6.0
|
|
2136
|
+
- @nifrajs/testing@2.6.0
|
|
2137
|
+
- @nifrajs/runner@2.6.0
|
|
2138
|
+
- create-nifra@2.6.0
|
|
2139
|
+
|
|
2140
|
+
## 2.5.0
|
|
2141
|
+
|
|
2142
|
+
### Minor Changes
|
|
2143
|
+
|
|
2144
|
+
- 8251dfd: `nifra doctor` and `nifra check` now flag stale workspace dists. A workspace-linked dependency whose export map splits `bun` (source) from `default` (a `dist` artifact) serves live source to Bun but a build artifact to Vite's SSR runner and node consumers - and nothing in the dev loop rebuilds that artifact. Because `dist/` is gitignored, the drift never shows in a diff; it surfaces as a 500 inside the package's code and reads like an upstream regression. The new `stale-workspace-dist` rule compares each linked dependency's `default` target mtime against its newest source file and reports "rebuild <pkg>" with the lag (or "never built" when the artifact is missing). Advisory severity: it warns in the report and the `--json`/MCP diagnostics but never fails the gate, since a linked package's dist is legitimately behind while you are mid-edit. npm tarball installs are immutable and never flagged.
|
|
2145
|
+
|
|
2146
|
+
### Patch Changes
|
|
2147
|
+
|
|
2148
|
+
- Updated dependencies [3731c69]
|
|
2149
|
+
- Updated dependencies [31ccc27]
|
|
2150
|
+
- Updated dependencies [02d9aa8]
|
|
2151
|
+
- Updated dependencies [0740f77]
|
|
2152
|
+
- @nifrajs/mcp@2.5.0
|
|
2153
|
+
- @nifrajs/testing@2.5.0
|
|
2154
|
+
- @nifrajs/web@2.5.0
|
|
2155
|
+
- @nifrajs/client@2.5.0
|
|
2156
|
+
- @nifrajs/core@2.5.0
|
|
2157
|
+
- @nifrajs/runner@2.5.0
|
|
2158
|
+
- @nifrajs/schema@2.5.0
|
|
2159
|
+
- create-nifra@2.5.0
|
|
2160
|
+
|
|
2161
|
+
## 2.4.0
|
|
2162
|
+
|
|
2163
|
+
### Minor Changes
|
|
2164
|
+
|
|
2165
|
+
- 1c2bf5a: The self-hosted docs MCP (`nifra docs-mcp` / `handleMcpHttp`) now serves `nifra_examples_app`, an MCP Apps widget that renders the verified code examples as an interactive, filterable list in hosts that support it; text-only hosts still get the example names. It reads the same bundled examples corpus as `nifra_example`, so every self-host exposes it from one definition.
|
|
2166
|
+
- 335eb2a: A guided, ordered path to build a nifra app end to end.
|
|
2167
|
+
|
|
2168
|
+
`nifra_learn` (MCP) and `nifra learn` (CLI) walk the same sequence - create the app, add a page route, load data, add a typed API, call it through the typed client, protect a route, do background work, deploy. Each step names the tool that emits the correct artifact (`nifra_scaffold`, `nifra_example`, `nifra_run`) and how to verify it, so the path composes the existing tools instead of pasting code that can drift from the installed version. Random-access search stays `nifra_docs`/`nifra_example`; this is the sequence for building something new.
|
|
2169
|
+
|
|
2170
|
+
- 795357f: DevTools' request-trace buffer is now queryable, not just streamable.
|
|
2171
|
+
|
|
2172
|
+
Alongside the live SSE overlay, the plugin serves a one-shot JSON snapshot at `/_nifra/devtools/state` - the recent request traces (method, path, status, duration, ISR status, response bytes), filterable by a `path` prefix and a `limit`, and guarded exactly like the stream (loopback-only unless `allowRemote`, origin-checked, optional `authorize` hook). A new `filterDevToolsEvents` export defines that query once, shared by the endpoint and its consumers.
|
|
2173
|
+
|
|
2174
|
+
`nifra_inspect` (MCP) reads that snapshot for a running dev server, so an agent can SEE what its requests actually did - which route answered, the status, how long, ISR hit or miss - instead of inferring it from the response alone. It needs the app to mount the `devtools()` plugin (which auto-enables in development).
|
|
2175
|
+
|
|
2176
|
+
- 23e6eb1: Errors resolve to a structured diagnostic - one object a person reads in the overlay and an agent reads as JSON.
|
|
2177
|
+
|
|
2178
|
+
The dev error overlay now shows a source codeframe around the offending line and, for failures nifra recognises (a server-only module or a `node:` built-in reaching the client, a schema mismatch), a plain-language cause and fix with a docs anchor. A new `@nifrajs/web/diagnostic` export builds that `Diagnostic` - stable `code`, the top frame in your own source, the codeframe, and the cause/fix - from any thrown value, and the dev server serves the most recent one as JSON at `/__nifra/last-error`.
|
|
2179
|
+
|
|
2180
|
+
`nifra_explain` (MCP) turns an error - pasted from `nifra_run`/`nifra_test` output, or the dev server's last - into that same diagnostic, so an agent gets the code, the codeframe in your source, and the fix instead of eyeballing a stack trace.
|
|
2181
|
+
|
|
2182
|
+
- 06f4aaa: `nifra upgrade` refuses to roll a dependency backward, and duplicate-install diagnostics name the type-inference symptom.
|
|
2183
|
+
|
|
2184
|
+
`nifra upgrade <version>` now fails closed when a target would set any pin below the installed version (for example running an older recipe on a newer install), listing each pin that would roll back and writing nothing; pass `--allow-downgrade` to apply it intentionally. `nifra doctor` and `nifra check` additionally call out that a second `@nifrajs/core` copy is the usual cause of `typeof backend` collapsing to `any` at `.merge()`.
|
|
2185
|
+
|
|
2186
|
+
### Patch Changes
|
|
2187
|
+
|
|
2188
|
+
- 1c2bf5a: Harden the dev-only diagnostics endpoint and the agent-facing reads of it. The dev server now binds to `127.0.0.1`, answers `/__nifra/last-error` with an identity header, and resolves source paths so the codeframe stays inside the project. The Vite dev server serves that endpoint at parity with the Bun one. `nifra_explain` and `nifra_inspect` validate the target port, time out, cap the response size, and only return a body from a verified nifra endpoint - so pointing them at an unrelated local service returns a clear error instead of that service's response.
|
|
2189
|
+
- 1c2bf5a: `nifra upgrade`'s downgrade guard now respects prerelease precedence, so a target of `2.3.0-beta` is correctly treated as older than an installed `2.3.0` and blocked without `--allow-downgrade`. Previously only the numeric core was compared, so a release-to-prerelease step slipped past the guard.
|
|
2190
|
+
- Updated dependencies [06f4aaa]
|
|
2191
|
+
- Updated dependencies [1c2bf5a]
|
|
2192
|
+
- Updated dependencies [138bfba]
|
|
2193
|
+
- Updated dependencies [23e6eb1]
|
|
2194
|
+
- Updated dependencies [06f4aaa]
|
|
2195
|
+
- create-nifra@2.4.0
|
|
2196
|
+
- @nifrajs/web@2.4.0
|
|
2197
|
+
- @nifrajs/core@2.4.0
|
|
2198
|
+
- @nifrajs/testing@2.4.0
|
|
2199
|
+
- @nifrajs/client@2.4.0
|
|
2200
|
+
- @nifrajs/schema@2.4.0
|
|
2201
|
+
- @nifrajs/mcp@2.4.0
|
|
2202
|
+
- @nifrajs/runner@2.4.0
|
|
2203
|
+
|
|
2204
|
+
## 2.3.0
|
|
2205
|
+
|
|
2206
|
+
### Minor Changes
|
|
2207
|
+
|
|
2208
|
+
- 77715ca: `nifra check` fails on SQL built by interpolating a value into the statement text.
|
|
2209
|
+
|
|
2210
|
+
```ts
|
|
2211
|
+
db.query(`SELECT * FROM notes WHERE id = ${id}`); // fails the check
|
|
2212
|
+
db.query("SELECT * FROM notes WHERE id = ?").get(id); // bound
|
|
2213
|
+
db.execute(sql`SELECT * FROM notes WHERE id = ${id}`); // bound by the tag
|
|
2214
|
+
```
|
|
2215
|
+
|
|
2216
|
+
The interpolated value becomes statement rather than parameter, so anything the caller controls can end
|
|
2217
|
+
the literal and continue as SQL.
|
|
2218
|
+
|
|
2219
|
+
Two things it deliberately stays quiet about, because flagging a safe idiom is how a rule gets ignored:
|
|
2220
|
+
a TAGGED template (`` sql`… ${id} …` `` in postgres.js, drizzle and kysely binds its substitutions -
|
|
2221
|
+
that IS the parameterised form), and any literal without a substitution. A SQL keyword is required in
|
|
2222
|
+
the literal too, so `cache.query(`user:${id}`)` is left alone; the named escape hatches
|
|
2223
|
+
(`$queryRawUnsafe`, `sql.unsafe`) are flagged on the call alone, since taking a statement as text is
|
|
2224
|
+
their entire purpose.
|
|
2225
|
+
|
|
2226
|
+
- ea0a27f: Capability provenance says when it could not finish, instead of reporting a clean project.
|
|
2227
|
+
|
|
2228
|
+
The reachability walk stops at a module count and an import depth so a pathological graph cannot hang
|
|
2229
|
+
the check. Hitting either limit used to end the walk quietly, and the route came back covered - a
|
|
2230
|
+
passing report whose subject was partly unexamined, which is the shape of failure this whole gate
|
|
2231
|
+
exists to prevent.
|
|
2232
|
+
|
|
2233
|
+
Both limits now produce a `provenance-truncated` finding naming the route and the chain that reached
|
|
2234
|
+
it, the check fails, and the lockfile refuses to record a snapshot taken from a truncated walk.
|
|
2235
|
+
|
|
2236
|
+
- a4ecca9: The `.server` convention now holds in every client pipeline, not just one.
|
|
2237
|
+
|
|
2238
|
+
A `*.server.ts` module is server-only: the client build empties it so its import subtree - `node:`
|
|
2239
|
+
builtins, native modules, secrets - never reaches a browser. That was implemented once, as a
|
|
2240
|
+
`Bun.build` plugin, so it held in exactly one of the four client paths. `nifra build` emptied the
|
|
2241
|
+
module; `nifra dev` (Vite), a Vite production build, and `nifra dev --bun` all bundled it whole.
|
|
2242
|
+
|
|
2243
|
+
A guard that holds in one pipeline is worse than no guard, because the file NAME reads as protection
|
|
2244
|
+
everywhere it appears.
|
|
2245
|
+
|
|
2246
|
+
- `@nifrajs/web/plugins/vite-server-only` empties the module for Vite, registered in both the dev
|
|
2247
|
+
server and the production build. A parity test asserts it emits bytes identical to the Bun plugin.
|
|
2248
|
+
- `nifra dev --bun` refuses to start on an app containing one, naming the files - the same treatment
|
|
2249
|
+
`*.fn` already had, because Bun's dev bundler takes no plugins and cannot be fixed with one.
|
|
2250
|
+
|
|
2251
|
+
The three `nifra dev --bun` refusals (CSS Modules, `*.fn`, `*.server`) now have tests. Two of them
|
|
2252
|
+
guard secrets, and none of them had one.
|
|
2253
|
+
|
|
2254
|
+
- a92104e: The interpolated-SQL rule catches string concatenation, the oldest injection shape.
|
|
2255
|
+
|
|
2256
|
+
```ts
|
|
2257
|
+
db.query("SELECT * FROM users WHERE id = " + req.params.id); // now fails the check
|
|
2258
|
+
```
|
|
2259
|
+
|
|
2260
|
+
The rule inspected template literals only: a quoted string was skipped before the SQL-keyword test ever
|
|
2261
|
+
ran. So a codebase predating template literals - or an LLM emitting older-style JS - got a clean
|
|
2262
|
+
`nifra check` on textbook-injectable SQL, and `nifra check` reporting clean is a security claim that
|
|
2263
|
+
feeds the assurance ladder.
|
|
2264
|
+
|
|
2265
|
+
The same keyword requirement applies, so `cache.query("user:" + id)` stays quiet, and a statement built
|
|
2266
|
+
into a variable elsewhere still says nothing at the call site.
|
|
2267
|
+
|
|
2268
|
+
Also fixes the service-worker test suite, whose offline case never reached the code it claimed to test:
|
|
2269
|
+
the stub was assigned to `globalThis.fetch` after the worker had already captured `fetch` as a
|
|
2270
|
+
parameter, so the assertion was satisfied by a real network failure. A worker mutated to serve the
|
|
2271
|
+
offline page to every visitor passed all 19 tests; it now fails, and an online navigation is covered.
|
|
2272
|
+
|
|
2273
|
+
- ea0a27f: The interpolated-SQL rule reads the syntax tree, and TypeScript is an optional peer rather than a
|
|
2274
|
+
dependency.
|
|
2275
|
+
|
|
2276
|
+
The rule used to work on text, which meant guessing where strings and comments began and ending up
|
|
2277
|
+
lenient in the direction that matters: EVERY tagged template was treated as parameter binding, so
|
|
2278
|
+
`String.raw` or any no-op custom tag hid an interpolated statement from the check. It now parses with
|
|
2279
|
+
the compiler and trusts only `sql` and `Prisma.sql`. It also reads a concatenated statement built
|
|
2280
|
+
across `+`, and skips a file the parser could not read rather than turning recovery nodes into a second
|
|
2281
|
+
misleading diagnostic.
|
|
2282
|
+
|
|
2283
|
+
Trust is by NAME, and that is the honest limit of a scanner that reads syntax and runs no type checker:
|
|
2284
|
+
`sql` is what postgres.js, drizzle, slonik and Bun's driver all call theirs, and nothing here can prove
|
|
2285
|
+
a given `sql` binds anything. A no-op function with that name is trusted too. The rule finds mistakes,
|
|
2286
|
+
not an adversary who has read it - deciding otherwise needs a type checker, which is a different tool.
|
|
2287
|
+
Names earn their place on that list by being what drivers already call the thing.
|
|
2288
|
+
|
|
2289
|
+
The compiler is a ~25 MB install, and the CLI's own typecheck step already treats `tsc` as something
|
|
2290
|
+
the project provides. Forcing it on every install to run one rule was the wrong trade, so it is an
|
|
2291
|
+
optional peer resolved when the rule runs. Every Nifra project has TypeScript - the templates all ship
|
|
2292
|
+
a `typecheck` script - so this resolves in practice.
|
|
2293
|
+
|
|
2294
|
+
When it does not, `nifra check` says the rule did not run and how to enable it. That part is not
|
|
2295
|
+
cosmetic: an empty result is indistinguishable from a clean one, and for this rule a clean result means
|
|
2296
|
+
"no SQL injection was found". Silence there is the one answer it must never give.
|
|
2297
|
+
|
|
2298
|
+
- c823915: Typed, validated search params: a route declares a `searchSchema` and both its loader and its component read the parsed, validated query.
|
|
2299
|
+
|
|
2300
|
+
Export a Standard Schema as `searchSchema` from a route. The loader's `ctx.search` becomes the parsed URL query validated against it (typed via `LoaderArgs<typeof app, Env, typeof searchSchema>`), and the component reads the same value with `useSearch<typeof searchSchema>()`. Invalid or hostile input fails closed to the schema's defaults (never a 500); without a `searchSchema`, both are the raw parsed query. Validation runs at match time and the value is derived identically on the server and on client navigation, so a component never parses `window.location.search` by hand and the query it renders hydrates with no mismatch.
|
|
2301
|
+
|
|
2302
|
+
```tsx
|
|
2303
|
+
export const searchSchema = v.object({
|
|
2304
|
+
page: v.optional(v.fallback(v.number(), 1), 1),
|
|
2305
|
+
});
|
|
2306
|
+
|
|
2307
|
+
export async function loader({
|
|
2308
|
+
search,
|
|
2309
|
+
api,
|
|
2310
|
+
}: LoaderArgs<typeof backend, unknown, typeof searchSchema>) {
|
|
2311
|
+
return { rows: await api.reports.list(search).get() }; // search.page is a number
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
export default function Reports({ data }) {
|
|
2315
|
+
const { page } = useSearch<typeof searchSchema>(); // page: number, SSR-correct
|
|
2316
|
+
return <Pager page={page} />;
|
|
2317
|
+
}
|
|
2318
|
+
```
|
|
2319
|
+
|
|
2320
|
+
A `_layout` can declare its own `searchSchema` for keys shared across a section (`?org`, `?theme`); the route's effective search merges the layout chain's schemas with the page's, page-wins on a conflict, so both the layout and the page read their validated slice from one object.
|
|
2321
|
+
|
|
2322
|
+
A route can also list `searchClientKeys` - search keys that are purely client-side UI (`?tab`, a client-side `?sort`, `?modal`). When a client navigation changes only those keys, the URL updates (so `useSearch` re-renders) without re-running the loader; any other key change revalidates as before, so data is never stale.
|
|
2323
|
+
|
|
2324
|
+
`useSearch` ships on every adapter - React (a value), Preact (a value), Vue (a `Ref`), Solid (an `Accessor`), and Svelte (an accessor), each in that framework's own shape.
|
|
2325
|
+
|
|
2326
|
+
`navigate` gains an object form on every adapter: `navigate({ to, search, replace })` serializes `search` onto `to` (no hand-built query strings). Run `nifra sync-routes` to generate `nifra-routes.d.ts` (each static route mapped to its schema output) and include it in your tsconfig, and `search` is typed against the target route's `searchSchema` - a wrong shape for a known route is a compile error, while an unmapped path takes a loose `search`. Regenerated from the route files, so a stale shape becomes a `tsc` error. The string-path and history-delta forms are unchanged.
|
|
2327
|
+
|
|
2328
|
+
```ts
|
|
2329
|
+
navigate({ to: "/reports", search: { page: 2 } }); // search typed against /reports's schema
|
|
2330
|
+
```
|
|
2331
|
+
|
|
2332
|
+
### Patch Changes
|
|
2333
|
+
|
|
2334
|
+
- e88f36b: Two CI gates that could report success having measured nothing.
|
|
2335
|
+
|
|
2336
|
+
`@nifrajs/events` shipped with 17 passing tests CI had never executed. The two run scripts list their
|
|
2337
|
+
30-odd test directories by hand and nobody added the new one, so the package published untested and the
|
|
2338
|
+
coverage ratchet was blind to it. The dead suite was the fail-closed half of a durable event boundary.
|
|
2339
|
+
A completeness check now asserts every package with test files appears in both scripts, with an
|
|
2340
|
+
explicit, reasoned opt-out list.
|
|
2341
|
+
|
|
2342
|
+
`check:size` dropped any row that failed to build - logging to stderr, returning null - and then
|
|
2343
|
+
compared budgets only against rows that survived. Rename a `@nifrajs/core/*` subpath and its row
|
|
2344
|
+
vanishes with its budget, every remaining row passes, and the gate exits 0. It now reconciles measured
|
|
2345
|
+
rows against declared rows, and the budget table against the feature matrix, before comparing anything.
|
|
2346
|
+
|
|
2347
|
+
- b9f4525: `nifra build` and `nifra dev` now print the real cause of a failed bundle. When `Bun.build` throws, it raises an `AggregateError` whose own message is a generic "Bundle failed" and whose underlying errors - the unresolved import, the plugin that threw, each with a file and line - were dropped by the CLI's error output. Those causes are now unwrapped and printed, one per line, at every CLI error boundary.
|
|
2348
|
+
- 1fbfb62: A `clientModule` given as a relative path (a local client entry, e.g. `./src/client.tsx`) now works in both `nifra dev` and `nifra build`. It is resolved to an absolute path when the framework config loads, so the generated client entry - which dev and build write into different directories - resolves it identically in both phases instead of loading in one and breaking in the other. A bare or package specifier (`@nifrajs/web-react/client`) is location-independent and unchanged.
|
|
2349
|
+
- c42d777: Documents seven packages that shipped without a single reference.
|
|
2350
|
+
|
|
2351
|
+
`web-vanilla` (zero-framework adapter) joins the frameworks page and gains `examples/web-vanilla`;
|
|
2352
|
+
`devtools` joins dev; `mock` joins testing; `events` joins backends; `prompt`, `agent-telemetry` and
|
|
2353
|
+
`mcp-db` join the coding-agents page.
|
|
2354
|
+
|
|
2355
|
+
All were real - 185 to 381 lines each, 9 to 23 tests each - and none were findable. Every added sample
|
|
2356
|
+
is compiled by the docs gate against the live API.
|
|
2357
|
+
|
|
2358
|
+
- fc034c6: Documents server functions and effect provenance.
|
|
2359
|
+
|
|
2360
|
+
Two features shipped without a page. Server functions span seven packages and had none at all, and the
|
|
2361
|
+
effect provenance firewall - now armed in every template - emits a finding (`unconfined-write-reach`)
|
|
2362
|
+
whose fix is structural and was explained nowhere outside code comments.
|
|
2363
|
+
|
|
2364
|
+
Both pages join the docs corpus the MCP server and `nifra_docs` search read from, so an agent finds them
|
|
2365
|
+
too.
|
|
2366
|
+
|
|
2367
|
+
- 45b0733: `nifra dev --bun` no longer waves `.fn.mts` / `.fn.cts` / `.fn.mjs` / `.fn.cjs` into the browser.
|
|
2368
|
+
|
|
2369
|
+
The refusal that keeps a server function off the Bun dev pipeline matched a hand-written glob,
|
|
2370
|
+
`**/*.fn.{ts,tsx,js,jsx}`, while both build pipelines stub anything matching
|
|
2371
|
+
`/\.fn(\.[cm]?[jt]sx?)?$/`. So a `todos.fn.mts` was a server function everywhere except the one check
|
|
2372
|
+
that exists to stop it leaking - it started the dev server and shipped the function bodies, and
|
|
2373
|
+
whatever they close over, to the browser. Measured across all eight extensions, four leaked.
|
|
2374
|
+
|
|
2375
|
+
Both refusals now test against the same matchers the transforms use, exported as `SERVER_FN_MODULE`
|
|
2376
|
+
and `SERVER_ONLY_MODULE` from `@nifrajs/web`. `SERVER_ONLY_MODULE` had two definitions and now has one
|
|
2377
|
+
owner. A test drives every accepted extension through the guard, so widening a convention without
|
|
2378
|
+
widening the guard fails there rather than in someone's browser.
|
|
2379
|
+
|
|
2380
|
+
- ea0a27f: A scaffolded project's `check` script runs the assurance gate it ships with, and the dev refusals cover
|
|
2381
|
+
extensionless modules.
|
|
2382
|
+
|
|
2383
|
+
Every template ships an assurance config, and every template's `check` script ran `nifra check` only -
|
|
2384
|
+
so the policy was shipped, documented, and never executed by the command a project actually runs in CI.
|
|
2385
|
+
It now runs `nifra check && nifra assure`.
|
|
2386
|
+
|
|
2387
|
+
`nifra dev --bun` refuses `.server` and `.fn` modules because Bun's dev bundler takes no plugins and
|
|
2388
|
+
would ship them whole. The refusal missed a module with no extension at all, which is the one shape a
|
|
2389
|
+
directory import produces.
|
|
2390
|
+
|
|
2391
|
+
- 1ed58b8: The documentation site now holds the bar it sells: `nifra.assurance.ts` plus a capability lockfile, at
|
|
2392
|
+
L2.
|
|
2393
|
+
|
|
2394
|
+
It is also the first validation of the capability model on an app nobody designed around it. Two things
|
|
2395
|
+
that only a real app can answer:
|
|
2396
|
+
|
|
2397
|
+
- **No false positives.** 47 route files carry dozens of documentation samples containing
|
|
2398
|
+
`import { Database } from "bun:sqlite"` and friends inside template literals. None became capability
|
|
2399
|
+
evidence, because the scanner blanks template contents before reading imports.
|
|
2400
|
+
- **Real imports are still caught.** Adding one genuine `bun:sqlite` import to the backend immediately
|
|
2401
|
+
flagged all four routes, including the GET dead end with its structural message.
|
|
2402
|
+
|
|
2403
|
+
- 803ec9d: `nifra_types` answers for every published package.
|
|
2404
|
+
|
|
2405
|
+
`@nifrajs/deno`, `@nifrajs/content` and `@nifrajs/workers` contributed nothing to the type index the
|
|
2406
|
+
MCP tool reads. They ship `files: ["src"]` and point `types` at `./src/index.ts`, which is right for a
|
|
2407
|
+
package resolved by Deno, workerd or Bun, while the index only ever looked for a built `dist/*.d.ts`.
|
|
2408
|
+
Asked about `serve`, `defineCollection` or `createWebSocketHub`, an agent got nothing back and wrote
|
|
2409
|
+
the API it guessed instead.
|
|
2410
|
+
|
|
2411
|
+
Their declarations are now emitted from source, per file and without a type checker, so the index
|
|
2412
|
+
starts where a consumer's resolver starts either way. Signatures are declarations, not implementations
|
|
2413
|
+
pasted in; the 1,545 entries already there are byte-identical.
|
|
2414
|
+
|
|
2415
|
+
The `--check` gate could not have caught this - it compares the regenerated file against the committed
|
|
2416
|
+
one, and a package missing from both matches forever. So `gen:llms` now fails when a published package
|
|
2417
|
+
contributes no types at all, which also turns the quietest failure here into a loud one: run it without
|
|
2418
|
+
building first and the file used to be rewritten with almost nothing in it.
|
|
2419
|
+
|
|
2420
|
+
- 5177627: `nifra check`, `nifra assure` and `nifra levels` are three views of one project verification.
|
|
2421
|
+
|
|
2422
|
+
All three read the same reflected project: the typed-contract scan, the route-assurance evaluation,
|
|
2423
|
+
and the static capability provenance. Each had grown its own orchestration over those pieces, so which
|
|
2424
|
+
command ran which policy was something a caller had to keep in their head, and `nifra levels` paid for
|
|
2425
|
+
it twice. Its L0 rung runs the whole check, and then L1 and L2 re-derived the route-assurance and
|
|
2426
|
+
capability-provenance evidence that same check had just produced. On a project with a capabilities
|
|
2427
|
+
policy the provenance walk is the expensive part, and it ran on every `levels` invocation once for the
|
|
2428
|
+
check and again for the ladder.
|
|
2429
|
+
|
|
2430
|
+
They now derive from a single verification pass. Each command renders its own slice of it: `assure`
|
|
2431
|
+
still never triggers the typecheck it has no use for, and `levels` climbs the ladder from evidence
|
|
2432
|
+
gathered once rather than a second time per rung. The output of all three is unchanged down to the
|
|
2433
|
+
byte, and a golden test per command and per mode holds that line so it stays that way.
|
|
2434
|
+
|
|
2435
|
+
- 4eb4e15: The release's version script regenerates the llms corpora, so the "Version Packages" PR can pass CI.
|
|
2436
|
+
|
|
2437
|
+
`types.json` stores exported signatures verbatim, including core's `VERSION` as the literal type
|
|
2438
|
+
`export declare const VERSION: "2.2.0"`. Bumping the version rewrote that constant and regenerated
|
|
2439
|
+
`api-reference.md` and the LLM cards, but not the corpora - so every Version PR failed `check:llms` on a
|
|
2440
|
+
stale `types.json`, and since Release only publishes after CI concludes successfully, nothing could
|
|
2441
|
+
ship.
|
|
2442
|
+
|
|
2443
|
+
- Updated dependencies [6f5b3ad]
|
|
2444
|
+
- Updated dependencies [cee03d7]
|
|
2445
|
+
- Updated dependencies [85b354d]
|
|
2446
|
+
- Updated dependencies [9b110b9]
|
|
2447
|
+
- Updated dependencies [7293a1c]
|
|
2448
|
+
- Updated dependencies [c8b79d7]
|
|
2449
|
+
- Updated dependencies [8514caa]
|
|
2450
|
+
- Updated dependencies [ea0a27f]
|
|
2451
|
+
- Updated dependencies [ea0a27f]
|
|
2452
|
+
- Updated dependencies [45b0733]
|
|
2453
|
+
- Updated dependencies [c42d777]
|
|
2454
|
+
- Updated dependencies [ea0a27f]
|
|
2455
|
+
- Updated dependencies [82b2053]
|
|
2456
|
+
- Updated dependencies [b271164]
|
|
2457
|
+
- Updated dependencies [8c77d47]
|
|
2458
|
+
- Updated dependencies [ea0a27f]
|
|
2459
|
+
- Updated dependencies [26cec7d]
|
|
2460
|
+
- Updated dependencies [8807004]
|
|
2461
|
+
- Updated dependencies [ea0a27f]
|
|
2462
|
+
- Updated dependencies [35af9fe]
|
|
2463
|
+
- Updated dependencies [ea0a27f]
|
|
2464
|
+
- Updated dependencies [d190b1c]
|
|
2465
|
+
- Updated dependencies [a4ecca9]
|
|
2466
|
+
- Updated dependencies [de8d992]
|
|
2467
|
+
- Updated dependencies [a92104e]
|
|
2468
|
+
- Updated dependencies [7f55876]
|
|
2469
|
+
- Updated dependencies [5fe332a]
|
|
2470
|
+
- Updated dependencies [c823915]
|
|
2471
|
+
- Updated dependencies [d2840ac]
|
|
2472
|
+
- Updated dependencies [62a8d03]
|
|
2473
|
+
- Updated dependencies [dcacfe7]
|
|
2474
|
+
- Updated dependencies [28704d7]
|
|
2475
|
+
- Updated dependencies [ea0a27f]
|
|
2476
|
+
- Updated dependencies [0c2de22]
|
|
2477
|
+
- @nifrajs/core@2.3.0
|
|
2478
|
+
- create-nifra@2.3.0
|
|
2479
|
+
- @nifrajs/client@2.3.0
|
|
2480
|
+
- @nifrajs/web@2.3.0
|
|
2481
|
+
- @nifrajs/schema@2.3.0
|
|
2482
|
+
- @nifrajs/testing@2.3.0
|
|
2483
|
+
- @nifrajs/mcp@2.3.0
|
|
2484
|
+
- @nifrajs/runner@2.3.0
|
|
2485
|
+
|
|
2486
|
+
## 2.2.0
|
|
2487
|
+
|
|
2488
|
+
### Minor Changes
|
|
2489
|
+
|
|
2490
|
+
- 2441577: `nifra build` picks its bundler from your config instead of a fixed default, and `--bun` joins `--vite`.
|
|
2491
|
+
|
|
2492
|
+
The two phases default differently on purpose: `nifra dev` is Vite (for the plugin ecosystem, and because
|
|
2493
|
+
Bun's dev-server bundler cannot compile CSS Modules), `nifra build` is Bun (faster, Bun-native). For an app
|
|
2494
|
+
with no transforms that costs nothing - there is nothing for the two to disagree about. For an app whose
|
|
2495
|
+
only transforms are `vitePlugins` it cost a class of production-only bug: those plugins ran in dev, and the
|
|
2496
|
+
Bun build reads `clientPlugins`/`serverPlugins` and never `vitePlugins`, so it dropped them. The build
|
|
2497
|
+
succeeded, the output looked plausible, and the transform had simply not happened.
|
|
2498
|
+
|
|
2499
|
+
That is the failure the pipeline-separation guard already refuses to allow - a plugin whose pipeline never
|
|
2500
|
+
runs - reached by crossing phases instead of slots, where the slot check cannot see it because the plugins
|
|
2501
|
+
are correctly placed.
|
|
2502
|
+
|
|
2503
|
+
So the default now follows the app. Vite plugins with no Bun counterpart means exactly one pipeline can
|
|
2504
|
+
build it, and that is the one used; `nifra build` prints the reason so an auto-selected Vite build never
|
|
2505
|
+
looks like you got the default. An app declaring both slots has supplied the Bun equivalent deliberately -
|
|
2506
|
+
nothing is dropped - so the faster Bun default stands, unchanged. An app with no plugins is unaffected.
|
|
2507
|
+
|
|
2508
|
+
`--vite` and the new `--bun` force the choice, with one exception: `--bun` on an app whose only transforms
|
|
2509
|
+
are `vitePlugins` is refused, naming the plugins it would discard, rather than producing the silently
|
|
2510
|
+
incomplete build the flag would otherwise ask for. Passing both flags is an error.
|
|
2511
|
+
|
|
2512
|
+
- a7d740a: Mount sub-apps and standalone-shaped backends without a `Proxy`; bound the render worker; lint removed imports.
|
|
2513
|
+
|
|
2514
|
+
**`mounts` and `apiStrip` on `createWebApp`.** Two shapes previously needed a hand-written ~40-line
|
|
2515
|
+
`Proxy` around the backend. The auto-mount dispatches the full `/api/v1/forms`, but a backend that also
|
|
2516
|
+
runs standalone declares its routes without the prefix and lets its own shell supply it - so every
|
|
2517
|
+
request 404'd inside it. And better-auth is not a `backend` route, so `/api/auth/*` hit the backend and
|
|
2518
|
+
404'd silently. `apiStrip: true` removes the prefix before dispatch, and `mounts` takes any
|
|
2519
|
+
`{ path, app: { fetch } }` - so any library exposing its routes in that shape mounts directly, with no
|
|
2520
|
+
dependency from `@nifrajs/web` on it. Mounts are matched longest-path-first and before the `api`
|
|
2521
|
+
prefix, so `/api/auth` wins over `/api` regardless of declaration order.
|
|
2522
|
+
|
|
2523
|
+
**A layout that exports a `loader` now fails loudly.** Layouts do not run one - only route files do -
|
|
2524
|
+
and rendering while ignoring the export was the worst possible handling: it looks wired, the page
|
|
2525
|
+
renders, and the data is simply never there. The error names the file and says where the fetch should
|
|
2526
|
+
go instead. Running loaders in layouts is a real feature and is not this change.
|
|
2527
|
+
|
|
2528
|
+
**`nifra_render` and `nifra_run` can no longer hang.** The cold-path child wrote its result and then
|
|
2529
|
+
fell off the end of the module without exiting, unlike the warm-worker branch beside it. Loading an
|
|
2530
|
+
app runs its module side effects, so a database pool, a Redis client, or an interval kept the child's
|
|
2531
|
+
event loop alive forever while the parent waited on `proc.exited`. The child now exits explicitly, and
|
|
2532
|
+
both the cold and warm paths carry a 30s timeout as a backstop, reporting the likely cause rather than
|
|
2533
|
+
hanging.
|
|
2534
|
+
|
|
2535
|
+
**A `removed-import` lint in `nifra check`.** `@nifrajs/budget` folded into core in 2.x with no npm
|
|
2536
|
+
deprecation - `latest` is still 1.13.0, so a `^2` range resolves to nothing and `bun install` fails
|
|
2537
|
+
workspace-wide with an error naming neither cause nor replacement. The 2.0 WebSocket change has the
|
|
2538
|
+
same shape: `import "@nifrajs/core/ws"` no longer installs the runtime, and a consuming package kept
|
|
2539
|
+
it while its whole test suite stayed green and the app could not boot. Both are now caught before
|
|
2540
|
+
boot, with the replacement named. The WS rule flags only the bare side-effect form, since the module
|
|
2541
|
+
still exports `websocket` and a rule that fires on correct code gets ignored.
|
|
2542
|
+
|
|
2543
|
+
- 78e0b02: `nifra dev --bun` - the Bun pipeline is now selectable in dev, completing the pipeline matrix.
|
|
2544
|
+
|
|
2545
|
+
`nifra build --vite` already let an app choose its production bundler, but dev was Vite-only from the
|
|
2546
|
+
CLI: the Bun dev server existed solely as a library entry (`@nifrajs/web/dev`), so using it meant
|
|
2547
|
+
hand-writing a `dev.ts`. `nifra dev --bun` runs it directly - `Bun.serve`'s native HMR bundles and
|
|
2548
|
+
hot-reloads the client while Bun's runtime resolves SSR, with no Vite in the process. Both pipelines are
|
|
2549
|
+
now selectable in both phases, and neither ever runs inside the other.
|
|
2550
|
+
|
|
2551
|
+
It refuses one case rather than breaking quietly. Bun's DEV-server bundler and `Bun.build` are not the
|
|
2552
|
+
same bundler: `Bun.build` compiles `*.module.css` into a scoped class map (so the Bun production build of
|
|
2553
|
+
a CSS-Modules app is fine), but the dev server's bundler has no such transform - the import becomes a
|
|
2554
|
+
dangling reference and the browser throws `ReferenceError: import_X_module is not defined` from inside the
|
|
2555
|
+
component, naming neither CSS Modules nor the dev server. So `--bun` checks for CSS Modules up front and
|
|
2556
|
+
refuses with the offending files named and both ways forward. The check is deliberately narrow: only the
|
|
2557
|
+
transform proven missing is refused, so an app without CSS Modules gets the Bun dev loop.
|
|
2558
|
+
|
|
2559
|
+
Bun applies React Fast Refresh natively on this path - verified: editing a component-only module swaps its
|
|
2560
|
+
markup while a `useState` counter keeps its value, with no reload. The boundary rule is the same one Vite
|
|
2561
|
+
has (a route file that also exports `loader`/`meta` is not a refresh boundary, so saving it reloads). Plain
|
|
2562
|
+
CSS and Tailwind work; only `*.module.css` is refused.
|
|
2563
|
+
|
|
2564
|
+
Default is unchanged - `nifra dev` stays Vite, for its plugin ecosystem.
|
|
2565
|
+
|
|
2566
|
+
- 15ad6ca: Enforce pipeline separation, and make the client-leak guards bundler-neutral.
|
|
2567
|
+
|
|
2568
|
+
nifra supports both Vite and Bun, and the config already keeps them in separate slots - `vitePlugins`
|
|
2569
|
+
for the Vite pipeline, `clientPlugins` / `serverPlugins` for the Bun one. Nothing enforced the split,
|
|
2570
|
+
and the failure mode is silent: `Bun.build` has no `transform` hook and Vite never calls `setup`, so a
|
|
2571
|
+
plugin in the wrong slot is accepted, never invoked, and the build succeeds with the transform simply
|
|
2572
|
+
missing.
|
|
2573
|
+
|
|
2574
|
+
Loading an app now refuses that config, naming the plugin, the slot it is in, the pipeline that slot
|
|
2575
|
+
feeds, and where to move it. Checked at load rather than in `nifra check`, which holds a deliberate
|
|
2576
|
+
pre-`loadApp` invariant - reading plugins means importing the app's config. So `dev`, `build` and
|
|
2577
|
+
`start` are covered from one place, immediately before the plugins reach a bundler. Detection is by
|
|
2578
|
+
hook shape and deliberately conservative: a plugin matching neither shape is left alone, because a
|
|
2579
|
+
guard that fires on correct config is a guard people turn off.
|
|
2580
|
+
|
|
2581
|
+
The two client-leak guards - server-only code reaching the browser, `node:` builtins in client code -
|
|
2582
|
+
now take a bundler-neutral module graph instead of Bun's metafile, with a `fromBunMetafile` adapter
|
|
2583
|
+
behind it. Nothing changes today: Bun remains the only producer and the existing 19 tests pass
|
|
2584
|
+
unchanged, now routed through the adapter so it is covered too.
|
|
2585
|
+
|
|
2586
|
+
The point is what it makes possible. These are security guards - one stops secrets and database access
|
|
2587
|
+
shipping to a browser - so a second production pipeline must not arrive without them, and porting them
|
|
2588
|
+
under pressure beside a new bundler is how a guard ends up "mostly" ported. Introducing the seam while
|
|
2589
|
+
Bun is the only producer means the adapter can be verified against known-good behaviour, and adding
|
|
2590
|
+
Rollup later is one more adapter rather than a second copy of the detection logic.
|
|
2591
|
+
|
|
2592
|
+
- 6ba3173: `nifra routes --modes` - every route's render mode, hydration, and cache policy, gated against the target.
|
|
2593
|
+
|
|
2594
|
+
The facts were always in the route modules: `prerender`, `getStaticPaths`, `revalidate`, `hydrate`.
|
|
2595
|
+
Nowhere read them together. Answering "which pages are static?", "which revalidate, how often?", "which
|
|
2596
|
+
ship no JS?" meant opening every route file and holding the answer in your head - and the answer changes
|
|
2597
|
+
with the deploy target, which is nowhere near the route file.
|
|
2598
|
+
|
|
2599
|
+
The new `@nifrajs/web/route-manifest` derives one record per route - static | isr | ssr, hydration, cache
|
|
2600
|
+
policy - and resolves it against a target. `nifra routes --modes` prints the table; `--modes --target <t>`
|
|
2601
|
+
gates: a route the target cannot honour exits non-zero, so CI fails the build instead of production
|
|
2602
|
+
failing the request. The two cases that were previously silent are exactly the ones it catches: an ssr or
|
|
2603
|
+
isr route in a `static` build (no server, so the URL 404s in production while working in dev), and ISR
|
|
2604
|
+
where the target has no revalidation. Each conflict names the consequence, not the rule.
|
|
2605
|
+
|
|
2606
|
+
Two derivations are deliberate. `prerender` wins over `revalidate`, because a page rendered at build time
|
|
2607
|
+
is not revalidated at runtime - the build-time answer is the one that ships. And a dynamic route counts as
|
|
2608
|
+
static only once the build has actually emitted paths for it: `getStaticPaths` is the intent, the emitted
|
|
2609
|
+
paths are the evidence, and treating intent as sufficient is how a "static" build ships a page that 404s.
|
|
2610
|
+
Pass the paths `prerenderRoutes` produced via `buildRouteManifest`'s `prerendered` option to resolve those
|
|
2611
|
+
routes against what was really built.
|
|
2612
|
+
|
|
2613
|
+
- ca71a2e: `nifra_types` collapses oversized declarations in search results, and a bad `clientModule` says so.
|
|
2614
|
+
|
|
2615
|
+
**`nifra_types` query mode.** A search returned the complete declaration of every match, and the corpus
|
|
2616
|
+
is wildly uneven: the median symbol is small while `Server` alone is ~32,000 characters, five times the
|
|
2617
|
+
next largest. One broad query that happened to match it returned the entire class for near-zero value.
|
|
2618
|
+
|
|
2619
|
+
A `query` now returns a one-line summary plus the signature, collapsing an oversized body to its head
|
|
2620
|
+
and a member count, and saying which `name` call returns the rest. Measured on the real corpus:
|
|
2621
|
+
`"server"` drops from 36,355 to 1,739 characters (95%), `"route schema"` by 87%, `"rate limit"` by 69%.
|
|
2622
|
+
|
|
2623
|
+
An exact `name` lookup is **never** collapsed - there the caller asked for that symbol. Pass
|
|
2624
|
+
`full: true` to opt a query back into whole declarations.
|
|
2625
|
+
|
|
2626
|
+
**`clientModule`.** The option is a module specifier resolved by the bundler, so nothing type-checks
|
|
2627
|
+
that the module actually exports `mountRouter`. A self-executing client entry therefore built cleanly
|
|
2628
|
+
and failed at first paint with `mountRouter is not a function`, from inside a bundled chunk, naming
|
|
2629
|
+
neither the module nor the requirement - diagnosable only by reading `build.ts`.
|
|
2630
|
+
|
|
2631
|
+
The generated bootstrap now throws immediately, naming the offending specifier, the missing export, its
|
|
2632
|
+
call signature, and the specific trap that a self-executing entry will not work. The contract is also
|
|
2633
|
+
spelled out on the option's own type rather than in a parenthetical.
|
|
2634
|
+
|
|
2635
|
+
- 0fc215b: The Vite dev pipeline now resolves SSR too, which removes the dual-React class of bug.
|
|
2636
|
+
|
|
2637
|
+
`nifra dev` served the client through Vite while resolving route modules for SSR through Bun - two
|
|
2638
|
+
resolvers disagreeing about one specifier, inside one process. That is what made `resolve.dedupe`
|
|
2639
|
+
govern only half the app: an app added a hand-written React alias in `nifra.config.ts`, and it still
|
|
2640
|
+
crashed, because the alias reached Vite and SSR never asked Vite. The symptom named a React internal
|
|
2641
|
+
(`resolveDispatcher().useState` is null), so the actual cause - two copies at different paths - was
|
|
2642
|
+
hours of inference away.
|
|
2643
|
+
|
|
2644
|
+
`discoverRoutes` accepts a `load` option, and the Vite dev server passes `ssrLoadModule`. Both halves
|
|
2645
|
+
now resolve through the same toolchain, so an alias, a `dedupe`, or a condition configured for the
|
|
2646
|
+
client governs the server as well.
|
|
2647
|
+
|
|
2648
|
+
Two things follow from that and are removed rather than kept "just in case":
|
|
2649
|
+
|
|
2650
|
+
- **Bun's SFC plugins are no longer registered in `nifra dev`.** Vite compiles `.vue` / `.svelte` /
|
|
2651
|
+
Solid for SSR through the app's `vitePlugins`. Registering Bun's alongside was the intermix itself -
|
|
2652
|
+
two toolchains compiling one file, only one of them governed by Vite's resolution. `nifra start` and
|
|
2653
|
+
the build path keep theirs, which is correct: those are the Bun pipeline.
|
|
2654
|
+
- **The `importQuery` cache-buster is gone from the Vite path.** It existed to defeat Bun's import
|
|
2655
|
+
cache; Vite re-evaluates changed modules itself. `discoverRoutes` ignores `importQuery` when `load`
|
|
2656
|
+
is supplied, because appending one would mint a new module id per request and defeat that.
|
|
2657
|
+
|
|
2658
|
+
The dev server still re-creates the app on change, now only so a hard reload picks up a route add or
|
|
2659
|
+
remove - the manifest comes from a directory scan, which `ssrLoadModule` cannot invalidate.
|
|
2660
|
+
|
|
2661
|
+
- 2ff661f: The full Vite/Rollup production build: `buildClientVite`, `buildServerVite`, `buildTargetVite`, and `nifra build --vite`.
|
|
2662
|
+
|
|
2663
|
+
Production stays Bun by default - faster and Bun-native, the profile nifra is tuned for. This completes
|
|
2664
|
+
the escape hatch for the one case that default cannot serve: an app whose client needs a Vite-only
|
|
2665
|
+
transform with no Bun equivalent. It now has a real, full production path, not just the leak-guard plugin.
|
|
2666
|
+
|
|
2667
|
+
The design point is that this is NOT a second orchestrator. `buildTarget`'s deploy assembly - per-target
|
|
2668
|
+
server-entry codegen, `_worker.js` / `server.js` placement, `_routes.json`, prerender, size report - is
|
|
2669
|
+
bundler-agnostic and now lives behind `buildTargetWith(target, options, bundler)`, which takes a `Bundler`
|
|
2670
|
+
strategy (its two bundling steps). `buildTarget` passes the Bun strategy; `buildTargetVite` passes the
|
|
2671
|
+
Vite one. So the deploy-dir shape is produced in exactly one place and cannot drift between pipelines -
|
|
2672
|
+
`buildTargetVite` emits the identical directory for every target.
|
|
2673
|
+
|
|
2674
|
+
`buildClientVite` reconstructs the same `BuildManifest` the Bun `buildClient` does - content-hashed entry,
|
|
2675
|
+
per-route chunk lists, aggregate + per-route CSS, copied `public/` - from Vite's own `.vite/manifest.json`.
|
|
2676
|
+
It wires `viteLeakGuard()`, and it keeps `node:` builtins external so the guard names the offending builtin:
|
|
2677
|
+
left alone, rolldown-vite silently rewrites a `node:` import to a browser stub, which builds and ships and
|
|
2678
|
+
is a no-op at runtime - a worse footgun than Bun's polyfill, now a build failure. `buildServerVite`
|
|
2679
|
+
produces the same self-contained `ServerBuild`, tagging the bundle `NIFRA_SSR_BUNDLED` so the web-react
|
|
2680
|
+
adapter uses the bundled, deduped react-dom rather than re-rooting to a disk copy.
|
|
2681
|
+
|
|
2682
|
+
`nifra build --vite` selects the pipeline; the app's Vite plugins drive both halves. Verified end to end by
|
|
2683
|
+
building the React example for the `node` target, running the server, and confirming SSR plus live
|
|
2684
|
+
hydration in a real browser, alongside `cf-pages` (`_worker.js` + `_routes.json`) and `static` (prerender,
|
|
2685
|
+
no server) deploy shapes.
|
|
2686
|
+
|
|
2687
|
+
No change to the default Bun build: `buildTarget` now delegates to `buildTargetWith` with the Bun strategy,
|
|
2688
|
+
and its behaviour and output are identical.
|
|
2689
|
+
|
|
2690
|
+
### Patch Changes
|
|
2691
|
+
|
|
2692
|
+
- 135d0c6: Find duplicate installs when `nifra check` runs from an app subdirectory.
|
|
2693
|
+
|
|
2694
|
+
The duplicate-install check anchored its discovery at the directory it was run from. In a monorepo you
|
|
2695
|
+
run it from the app - `apps/web` - and that manifest declares no `workspaces`, so the scan collapsed to
|
|
2696
|
+
the app itself and the sibling package holding the second copy was never probed. It printed
|
|
2697
|
+
`✓ duplicate identity-sensitive dependency install: none` while the dev server returned 500 on every
|
|
2698
|
+
page using a shared-kit hook, from exactly the condition the check exists to detect. Running from an
|
|
2699
|
+
app subdirectory is the normal case, so that was the configuration it was blind in.
|
|
2700
|
+
|
|
2701
|
+
Discovery now walks up to the workspace root that actually governs the directory, and probes from
|
|
2702
|
+
there. An ancestor is adopted only when its `workspaces` patterns genuinely match - a parent that
|
|
2703
|
+
merely contains a manifest is not this project's root - and the walk stops at a `.git` boundary.
|
|
2704
|
+
Findings are still reported relative to where you ran the command.
|
|
2705
|
+
|
|
2706
|
+
**Expect this to start reporting real findings in monorepos that were previously green.** That is the
|
|
2707
|
+
point rather than a regression: the duplicate was always there, and the check simply never looked in
|
|
2708
|
+
the right place.
|
|
2709
|
+
|
|
2710
|
+
An SSR error carrying a duplicate-instance signature (`resolveDispatcher()`, `Invalid hook call`, a
|
|
2711
|
+
null hook read) now names the likely cause. Two copies at the same version still fail, because module
|
|
2712
|
+
identity is path-based, and the raw error points at a React internal - so the message now says two
|
|
2713
|
+
copies are installed at different paths, that matching versions do not fix it, and to run
|
|
2714
|
+
`nifra check` for the paths.
|
|
2715
|
+
|
|
2716
|
+
- 1857d39: Serve `public/` in production, not just in dev.
|
|
2717
|
+
|
|
2718
|
+
`nifra dev` served a project's `public/` directory; production did not. There was no `publicDir`
|
|
2719
|
+
concept anywhere - dev got the behaviour for free because the HMR path runs on Vite, and Vite serves
|
|
2720
|
+
`public/` by default. So a file worked all the way through development and 404'd the moment it was
|
|
2721
|
+
deployed, and every app had to notice this and hand-roll static serving in its own server entry.
|
|
2722
|
+
|
|
2723
|
+
The failure is inverted, which is what makes it expensive: it appears only in production, and only for
|
|
2724
|
+
the assets nobody smoke-tests. It has already shipped once as a self-hosted webfont that 404'd in prod
|
|
2725
|
+
and silently fell back to a system font. Nothing errored and nothing alerted.
|
|
2726
|
+
|
|
2727
|
+
`publicDir` (default `"public"`) is now a first-class option. The build copies the directory into the
|
|
2728
|
+
output and records the file list on the build manifest, and `servePublicDir` is exported for a server
|
|
2729
|
+
entry to mount. Dev routes through the **same** handler rather than inheriting Vite's - two code paths
|
|
2730
|
+
with different defaults was the whole bug, so there is now one owner.
|
|
2731
|
+
|
|
2732
|
+
Behaviour, matching what apps arrived at independently: only paths with a file extension are probed,
|
|
2733
|
+
so a page route never pays a filesystem stat; a miss falls through to routing, so no route is shadowed;
|
|
2734
|
+
and cache headers differ by subtree - content-hashed `/assets/*` immutable, `public/` a day, both
|
|
2735
|
+
overridable. Path traversal is confined by resolving and then verifying containment, rather than
|
|
2736
|
+
scanning the input for `..` - a blocklist over encodings is the version that gets bypassed - and
|
|
2737
|
+
percent-encoded and NUL-bearing paths have tests.
|
|
2738
|
+
|
|
2739
|
+
Note that `publicPath` is a different thing: the URL prefix for content-hashed bundle chunks. It never
|
|
2740
|
+
covered user-authored files, and the name similarity actively misleads.
|
|
2741
|
+
|
|
2742
|
+
`nifra check` now points out that an app with a `public/` directory can delete its hand-rolled static
|
|
2743
|
+
serving. A tip rather than a finding - an existing handler still works, since it runs first.
|
|
2744
|
+
|
|
2745
|
+
On Cloudflare Pages the copied files are named individually in `_routes.json` so the CDN serves them
|
|
2746
|
+
without invoking the worker, within Cloudflare's cap of 100 include+exclude rules of at most 100
|
|
2747
|
+
characters each. An ordinary `public/` of icons, fonts and share images clears that cap, and the
|
|
2748
|
+
rejection lands at `wrangler pages deploy` - after a build that reported success.
|
|
2749
|
+
|
|
2750
|
+
Past the cap a directory is compacted to one `/dir/*` rule, but only after checking it against the
|
|
2751
|
+
app's real route patterns. The glob does not merely describe today's files; it hands Pages every future
|
|
2752
|
+
path under that prefix, so a `public/blog/hero.png` beside a `/blog/:slug` route would send
|
|
2753
|
+
`/blog/my-post` to a CDN that has no such file and 404 the page in production only. A directory
|
|
2754
|
+
therefore collapses only when no route can be served beneath it, and a single route with a dynamic
|
|
2755
|
+
first segment (`/:locale/…`) disables collapsing everywhere, since it can match under any name. A
|
|
2756
|
+
collapsed directory does give up the app's 404 page for a missing file beneath it - the right trade for
|
|
2757
|
+
a directory of static files, where a missing image should fail as a fast CDN 404 rather than an HTML
|
|
2758
|
+
error page.
|
|
2759
|
+
|
|
2760
|
+
Whatever still does not fit is dropped rather than widened, which is safe because the list is only an
|
|
2761
|
+
optimization: the emitted worker serves any path it recognises through the `ASSETS` binding, so an
|
|
2762
|
+
omitted file costs one worker invocation rather than a 404, and nothing else reaches that binding. The
|
|
2763
|
+
build prints how many it left out, since a cap you cannot see reads as coverage you do not have.
|
|
2764
|
+
|
|
2765
|
+
- Updated dependencies [39b1670]
|
|
2766
|
+
- Updated dependencies [d428f52]
|
|
2767
|
+
- Updated dependencies [135d0c6]
|
|
2768
|
+
- Updated dependencies [5f460db]
|
|
2769
|
+
- Updated dependencies [1394641]
|
|
2770
|
+
- Updated dependencies [e713cab]
|
|
2771
|
+
- Updated dependencies [a4645e2]
|
|
2772
|
+
- Updated dependencies [a7d740a]
|
|
2773
|
+
- Updated dependencies [6e996a1]
|
|
2774
|
+
- Updated dependencies [15ad6ca]
|
|
2775
|
+
- Updated dependencies [6aa0aac]
|
|
2776
|
+
- Updated dependencies [1857d39]
|
|
2777
|
+
- Updated dependencies [6ba3173]
|
|
2778
|
+
- Updated dependencies [ca71a2e]
|
|
2779
|
+
- Updated dependencies [0fc215b]
|
|
2780
|
+
- Updated dependencies [2ff661f]
|
|
2781
|
+
- Updated dependencies [a1327a4]
|
|
2782
|
+
- Updated dependencies [2500705]
|
|
2783
|
+
- @nifrajs/web@2.2.0
|
|
2784
|
+
- create-nifra@2.2.0
|
|
2785
|
+
- @nifrajs/core@2.2.0
|
|
2786
|
+
- @nifrajs/client@2.2.0
|
|
2787
|
+
- @nifrajs/schema@2.2.0
|
|
2788
|
+
- @nifrajs/testing@2.2.0
|
|
2789
|
+
- @nifrajs/mcp@2.2.0
|
|
2790
|
+
- @nifrajs/runner@2.2.0
|
|
2791
|
+
|
|
2792
|
+
## 2.1.0
|
|
2793
|
+
|
|
2794
|
+
### Patch Changes
|
|
2795
|
+
|
|
2796
|
+
- Updated dependencies [bd294bb]
|
|
2797
|
+
- Updated dependencies [d3aac63]
|
|
2798
|
+
- @nifrajs/core@2.1.0
|
|
2799
|
+
- @nifrajs/client@2.1.0
|
|
2800
|
+
- @nifrajs/web@2.1.0
|
|
2801
|
+
- @nifrajs/schema@2.1.0
|
|
2802
|
+
- @nifrajs/testing@2.1.0
|
|
2803
|
+
- @nifrajs/mcp@2.1.0
|
|
2804
|
+
- @nifrajs/runner@2.1.0
|
|
2805
|
+
- create-nifra@2.1.0
|
|
2806
|
+
|
|
2807
|
+
## 2.0.0
|
|
2808
|
+
|
|
2809
|
+
### Major Changes
|
|
2810
|
+
|
|
2811
|
+
- d91a45b: Remove Nifra's remaining deprecated and compatibility-only public surfaces for the 2.0 cutover.
|
|
2812
|
+
|
|
2813
|
+
- `@nifrajs/core` and `nifra` now expose only the lean HTTP server API at their package roots. Import
|
|
2814
|
+
optional systems from their documented subpaths. The deprecated invariant runner and the
|
|
2815
|
+
`@nifrajs/budget` compatibility package are removed; use `@nifrajs/testing` and
|
|
2816
|
+
`@nifrajs/core/budget` respectively.
|
|
2817
|
+
- Web redirects accept only an options object as their second argument, the prerender enumeration
|
|
2818
|
+
wrapper is removed in favor of `enumerateStaticRoutes()`, and fragment navigation resolves IDs only.
|
|
2819
|
+
- MCP Apps metadata uses only `_meta.ui.resourceUri`; the deprecated flat `ui/resourceUri` key is gone.
|
|
2820
|
+
- Telemetry uses `ObservationAdapter` directly; the `AgentSpan`, `AgentSpanExporter`, and `SpanExporter`
|
|
2821
|
+
aliases are removed.
|
|
2822
|
+
- Invalid HTTP method overrides always fail closed with 400; the legacy ignore mode is removed.
|
|
2823
|
+
- `nifra build` always emits a complete target deploy directory and defaults to Bun. The old
|
|
2824
|
+
client-only build branch is removed; `nifra start` runs the generated Bun `server.js`.
|
|
2825
|
+
|
|
2826
|
+
### Minor Changes
|
|
2827
|
+
|
|
2828
|
+
- 6b0dbc3: Ship the executable 2.0 migration path and consolidated upgrade documentation.
|
|
2829
|
+
|
|
2830
|
+
- `nifra upgrade 2.0.0` updates the fixed Nifra package group while preserving range style, moves
|
|
2831
|
+
the removed `@nifrajs/budget` dependency to `@nifrajs/core`, rewrites its source imports to
|
|
2832
|
+
`@nifrajs/core/budget`, and prints the structural cutover notes it cannot safely infer.
|
|
2833
|
+
- Pin rules now treat bare package names as exact matches, so upgrading `nifra` cannot rewrite an
|
|
2834
|
+
unrelated dependency such as `nifra-plugin`.
|
|
2835
|
+
- The 1.x → 2.0 guide covers opt-in runtime plugins, lean subpath imports, backend mounts, typed
|
|
2836
|
+
client failures, web/protocol changes, release gates, and `nifra.check.json` external mounts for
|
|
2837
|
+
Better Auth-style route owners.
|
|
2838
|
+
- External-mount matching rejects percent-encoded parent traversal as well as literal `..`, so the
|
|
2839
|
+
lint exception cannot hide a fetch that URL normalization moves outside its declared prefix.
|
|
2840
|
+
|
|
2841
|
+
- 2324d38: `nifra check` can now reach green on an app that intentionally mounts a non-typed sub-app, and raw-Response routes have an explicit opt-out.
|
|
2842
|
+
|
|
2843
|
+
- **`nifra.check.json` external-mount allowlist.** A relative `fetch()` to a mounted handler that lives outside the typed contract (e.g. an auth plugin that owns `/auth/**`) was flagged as a hand-rolled own-API call - an error you could never clear. Declare those prefixes in `nifra.check.json` (`{ "externalMounts": ["/auth"] }`, segment-anchored: `/auth` blesses `/auth` and `/auth/**` but not `/authors`) and the typed-client scan skips them. The blessed prefixes are echoed on the result and printed in the report, so a suppressed mount stays auditable instead of silently hiding real drift. A malformed `nifra.check.json` is a non-fatal warning; the allowlist is simply ignored.
|
|
2844
|
+
- **`// nifra-expect raw-response` pragma.** A route that deliberately returns a raw `Response` (a file or redirect) raised the `response-route` advisory with no way to mark it intentional. A pragma comment on the return line, or the line above, now silences it for that route.
|
|
2845
|
+
- **Streaming guidance.** The `response-route` advisory now points streaming routes at the typed SSE route (`app.sse(...)`), which keeps typed events instead of collapsing the client to `data: never`.
|
|
2846
|
+
|
|
2847
|
+
- 5917e68: Add the `nifra_levels` MCP tool, so an agent can read the verification ladder it was already able to
|
|
2848
|
+
run from the CLI. It returns `{ achieved, levels[] }` across L0 typed contract, L1 route assurance,
|
|
2849
|
+
L2 capability lockfile, L3 route trust manifest, and L4 contract invariants, with the reasons a level
|
|
2850
|
+
does not hold. A project with no assurance config still answers, stopping at L0 rather than failing.
|
|
2851
|
+
- e97a92f: `nifra sync-manifest`, plus two toolchain guards that turn opaque failures into actionable ones.
|
|
2852
|
+
|
|
2853
|
+
- **`nifra sync-manifest`.** After adding/renaming/removing a page route, the committed `server-manifest.ts` drifts and `nifra check` flags it - and clearing that used to mean a full build (server + worker + migrate bundles). `nifra sync-manifest` re-scans `routes/` and rewrites just the manifest's route table in milliseconds, preserving the baked client-asset references. It does not rebuild the client bundle, so it prints a caveat: a brand-new hydrating route component still needs a full build for its client chunk. `@nifrajs/web/build` gains the pure `resyncServerManifestSource` (+ `parseManifestStyles` / `parseManifestRouteStyles`) it is built on.
|
|
2854
|
+
- **`nifra dev` peer preflight.** Run under `bunx @nifrajs/cli dev` (an isolated install where the project's peers do not resolve), the Vite import failed with an opaque `ERR_MODULE_NOT_FOUND`. It now checks `vite` resolves from the project first and, if not, says to run the workspace-local `bun run dev`.
|
|
2855
|
+
- **`nifra start` build-target guard.** Pointed at a Cloudflare Pages output (a `_worker.js` bundle, no `server.js`), `nifra start` now names the mismatch and the fix (`nifra build --target bun`, or serve with `wrangler pages`) instead of a bare "no server.js".
|
|
2856
|
+
|
|
2857
|
+
### Patch Changes
|
|
2858
|
+
|
|
2859
|
+
- 7791470: `nifra check` now prints a one-line tip when the project has no `.mcp.json`, pointing at `nifra init-agents` (which wires `.mcp.json` + `.cursor/mcp.json` + a CLAUDE.md preamble, no-clobber). The tip is non-fatal and only in the human report - the `--json` path is unchanged - so a coding agent discovers the MCP wiring instead of learning the framework from sibling-app source.
|
|
2860
|
+
- Updated dependencies [a7b1d60]
|
|
2861
|
+
- Updated dependencies [a7b1d60]
|
|
2862
|
+
- Updated dependencies [eaac3d7]
|
|
2863
|
+
- Updated dependencies [ade0c7a]
|
|
2864
|
+
- Updated dependencies [82676e0]
|
|
2865
|
+
- Updated dependencies [1522d06]
|
|
2866
|
+
- Updated dependencies [b7017b9]
|
|
2867
|
+
- Updated dependencies [d91a45b]
|
|
2868
|
+
- Updated dependencies [d91a45b]
|
|
2869
|
+
- Updated dependencies [e97a92f]
|
|
2870
|
+
- Updated dependencies [202e758]
|
|
2871
|
+
- Updated dependencies [a7b1d60]
|
|
2872
|
+
- Updated dependencies [e8e49d1]
|
|
2873
|
+
- Updated dependencies [a7d34e5]
|
|
2874
|
+
- Updated dependencies [a7b1d60]
|
|
2875
|
+
- @nifrajs/core@2.0.0
|
|
2876
|
+
- @nifrajs/client@2.0.0
|
|
2877
|
+
- @nifrajs/schema@2.0.0
|
|
2878
|
+
- @nifrajs/web@2.0.0
|
|
2879
|
+
- create-nifra@2.0.0
|
|
2880
|
+
- @nifrajs/testing@2.0.0
|
|
2881
|
+
- @nifrajs/mcp@2.0.0
|
|
2882
|
+
- @nifrajs/runner@2.0.0
|
|
2883
|
+
|
|
2884
|
+
## 1.13.0
|
|
2885
|
+
|
|
2886
|
+
### Patch Changes
|
|
2887
|
+
|
|
2888
|
+
- f644556: `nifra doctor` also probes the workspace root for identity-sensitive packages, so it reports the split
|
|
2889
|
+
where every declaring package resolves one physical copy and the root holds another. Consulting only
|
|
2890
|
+
the packages that declare the dependency saw a single copy and stayed quiet.
|
|
2891
|
+
- Updated dependencies [aae8614]
|
|
2892
|
+
- Updated dependencies [5b6127a]
|
|
2893
|
+
- @nifrajs/core@1.13.0
|
|
2894
|
+
- @nifrajs/client@1.13.0
|
|
2895
|
+
- @nifrajs/web@1.13.0
|
|
2896
|
+
- @nifrajs/schema@1.13.0
|
|
2897
|
+
- @nifrajs/testing@1.13.0
|
|
2898
|
+
- @nifrajs/mcp@1.13.0
|
|
2899
|
+
- @nifrajs/runner@1.13.0
|
|
2900
|
+
- create-nifra@1.13.0
|
|
2901
|
+
|
|
2902
|
+
## 1.12.0
|
|
2903
|
+
|
|
2904
|
+
### Minor Changes
|
|
2905
|
+
|
|
2906
|
+
- 63d3845: Add bounded execution-causality contracts and propagation, OpenTelemetry causal links, event-envelope lineage, and a deterministic durable failure laboratory. `nifra levels` L4 now uses the deep adversarial contract engine through its explicitly isolated executor. Also add hash-verifiable adapter certification profiles and duplicate physical Nifra/React install detection in `nifra doctor`/`nifra check`.
|
|
2907
|
+
|
|
2908
|
+
### Patch Changes
|
|
2909
|
+
|
|
2910
|
+
- Updated dependencies [63d3845]
|
|
2911
|
+
- Updated dependencies [246f498]
|
|
2912
|
+
- @nifrajs/core@1.12.0
|
|
2913
|
+
- @nifrajs/testing@1.12.0
|
|
2914
|
+
- @nifrajs/client@1.12.0
|
|
2915
|
+
- @nifrajs/schema@1.12.0
|
|
2916
|
+
- @nifrajs/web@1.12.0
|
|
2917
|
+
- @nifrajs/mcp@1.12.0
|
|
2918
|
+
- @nifrajs/runner@1.12.0
|
|
2919
|
+
- create-nifra@1.12.0
|
|
2920
|
+
|
|
2921
|
+
## 1.11.0
|
|
2922
|
+
|
|
2923
|
+
### Minor Changes
|
|
2924
|
+
|
|
2925
|
+
- 2dde7e5: Add the effect ledger, sandboxed contract-generated invariant tests, and the verification ladder.
|
|
2926
|
+
|
|
2927
|
+
**Effect ledger** - a per-request, append-only, ordered record of side-effect intents and outcomes.
|
|
2928
|
+
Routes that declare `schema.capabilities` get a bounded, token-only ledger when the server enables
|
|
2929
|
+
`server({ effectLedger })`; each `useCapability(c, id, { target, cost, digest })` beacon
|
|
2930
|
+
records an intent, `recordCapabilityOutcome` records its terminal result without double-debiting
|
|
2931
|
+
admission, and the sink receives the sealed ledger when the response settles - on success and
|
|
2932
|
+
error responses alike, so partial work is audited. Entries carry capability ids, phases, adapter
|
|
2933
|
+
tokens, dimensionless cost counters, an optional keyed-HMAC payload digest, and bounded error codes;
|
|
2934
|
+
the entry type has no payload field, and the sealed ledger names the route _pattern_ plus the declared
|
|
2935
|
+
capability set, never the concrete URL - redaction holds by construction. Includes an optional
|
|
2936
|
+
tamper-evident hash chain, a bounded in-memory sink,
|
|
2937
|
+
and `computeEffectDigest` (keyed HMAC-SHA-256, so low-entropy data cannot be brute-forced from a
|
|
2938
|
+
stored digest). The hash chain binds route identity, declarations, timestamps, and entries. Sink
|
|
2939
|
+
failures are logged without their potentially-sensitive message and do not turn a successful effect
|
|
2940
|
+
into a retryable 500; transactional audit belongs in the effect's owning transaction. Routes without
|
|
2941
|
+
capability declarations keep the existing fast path unchanged.
|
|
2942
|
+
|
|
2943
|
+
**Contract-generated invariant tests** - `runContractInvariants(app, { executor })` fuzzes each route from its
|
|
2944
|
+
declared JSON Schema with a deterministic seeded generator and verifies what the contract promises:
|
|
2945
|
+
valid inputs never crash, 2xx responses conform to the declared response schema, schema-violating
|
|
2946
|
+
bodies are rejected (never accepted, never a crash), and a route-level classification never
|
|
2947
|
+
understates its field-level tags. Findings carry the case seed for exact reproduction; ungeneratable
|
|
2948
|
+
routes are reported as skipped, never silently dropped.
|
|
2949
|
+
Dynamic execution requires an explicit `invariants.executor` backed by a disposable app/sandbox;
|
|
2950
|
+
verification never invokes a live app implicitly, and any skipped route prevents L4.
|
|
2951
|
+
|
|
2952
|
+
**Verification ladder** - `nifra levels` computes L0 typed contract → L1 route assurance → L2
|
|
2953
|
+
capability lockfile → L3 route manifest → L4 invariant-tested from the existing gates. Levels are
|
|
2954
|
+
cumulative and computed, never self-declared; `--min <n>` gates CI on a required floor.
|
|
2955
|
+
|
|
2956
|
+
- 279f80c: Add a deterministic versioned Nifra manifest that joins route schemas, assurance evidence,
|
|
2957
|
+
capabilities, and field-level response classification in one hash-verified artifact. Manifests can be
|
|
2958
|
+
signed through an operator-provided Ed25519 KMS/HSM callback; Nifra never handles private keys.
|
|
2959
|
+
|
|
2960
|
+
`nifra manifest emit` refuses failing assurance and writes byte-stable output, while
|
|
2961
|
+
`nifra manifest diff <before> <after>` hash-verifies both artifacts and fails deployment promotion on
|
|
2962
|
+
breaking contract, lost assurance, expanded effects, or increased data sensitivity.
|
|
2963
|
+
|
|
2964
|
+
### Patch Changes
|
|
2965
|
+
|
|
2966
|
+
- Updated dependencies [2dde7e5]
|
|
2967
|
+
- Updated dependencies [80ed7b8]
|
|
2968
|
+
- Updated dependencies [279f80c]
|
|
2969
|
+
- Updated dependencies [5638ada]
|
|
2970
|
+
- Updated dependencies [279f80c]
|
|
2971
|
+
- @nifrajs/core@1.11.0
|
|
2972
|
+
- create-nifra@1.11.0
|
|
2973
|
+
- @nifrajs/client@1.11.0
|
|
2974
|
+
- @nifrajs/web@1.11.0
|
|
2975
|
+
- @nifrajs/schema@1.11.0
|
|
2976
|
+
- @nifrajs/mcp@1.11.0
|
|
2977
|
+
- @nifrajs/runner@1.11.0
|
|
2978
|
+
|
|
2979
|
+
## 1.10.0
|
|
2980
|
+
|
|
2981
|
+
### Minor Changes
|
|
2982
|
+
|
|
2983
|
+
- 92181be: Add hardened effect and capability assurance: reflected route declarations, fail-closed runtime
|
|
2984
|
+
beacons, static effect-provenance analysis, deterministic capability lockfiles, HTTP safe-method
|
|
2985
|
+
guards, and effect-specific request or durable idempotency requirements.
|
|
2986
|
+
|
|
2987
|
+
Add `nifra capabilities snapshot` and `nifra capabilities check` so capability drift and raw
|
|
2988
|
+
provider bypasses can be enforced in CI without adding work to the default request path.
|
|
2989
|
+
|
|
2990
|
+
### Patch Changes
|
|
2991
|
+
|
|
2992
|
+
- Updated dependencies [92181be]
|
|
2993
|
+
- Updated dependencies [3773f0a]
|
|
2994
|
+
- Updated dependencies [92181be]
|
|
2995
|
+
- @nifrajs/core@1.10.0
|
|
2996
|
+
- @nifrajs/client@1.10.0
|
|
2997
|
+
- @nifrajs/schema@1.10.0
|
|
2998
|
+
- @nifrajs/web@1.10.0
|
|
2999
|
+
- @nifrajs/mcp@1.10.0
|
|
3000
|
+
- @nifrajs/runner@1.10.0
|
|
3001
|
+
- create-nifra@1.10.0
|
|
3002
|
+
|
|
3003
|
+
## 1.9.1
|
|
3004
|
+
|
|
3005
|
+
### Patch Changes
|
|
3006
|
+
|
|
3007
|
+
- 3eb27ae: Internal tidy - remove a dead local variable in the query engine and clean up example wording in doc comments. No API or behavior change.
|
|
3008
|
+
- Updated dependencies [3eb27ae]
|
|
3009
|
+
- @nifrajs/web@1.9.1
|
|
3010
|
+
- @nifrajs/mcp@1.9.1
|
|
3011
|
+
- @nifrajs/client@1.9.1
|
|
3012
|
+
- @nifrajs/core@1.9.1
|
|
3013
|
+
- @nifrajs/runner@1.9.1
|
|
3014
|
+
- @nifrajs/schema@1.9.1
|
|
3015
|
+
- create-nifra@1.9.1
|
|
3016
|
+
|
|
3017
|
+
## 1.9.0
|
|
3018
|
+
|
|
3019
|
+
### Patch Changes
|
|
3020
|
+
|
|
3021
|
+
- Updated dependencies [03cd76f]
|
|
3022
|
+
- Updated dependencies [0e1b4cc]
|
|
3023
|
+
- Updated dependencies [6b67833]
|
|
3024
|
+
- Updated dependencies [03cd76f]
|
|
3025
|
+
- @nifrajs/core@1.9.0
|
|
3026
|
+
- @nifrajs/web@1.9.0
|
|
3027
|
+
- @nifrajs/client@1.9.0
|
|
3028
|
+
- @nifrajs/schema@1.9.0
|
|
3029
|
+
- @nifrajs/mcp@1.9.0
|
|
3030
|
+
- @nifrajs/runner@1.9.0
|
|
3031
|
+
- create-nifra@1.9.0
|
|
3032
|
+
|
|
3033
|
+
## 1.8.0
|
|
3034
|
+
|
|
3035
|
+
### Minor Changes
|
|
3036
|
+
|
|
3037
|
+
- e47c4c5: Add reflection-time route assurance: middleware and plugins can publish lifecycle-accurate enforcement
|
|
3038
|
+
evidence, ordered policies fail closed on unclassified/missing/forbidden evidence, official hardening
|
|
3039
|
+
middleware emits canonical evidence, and `nifra assure` exposes a human/JSON CI gate.
|
|
3040
|
+
- 9433ad9: Add `nifra upgrade <version>`: an executable, per-release upgrade runner. A recipe declares the
|
|
3041
|
+
mechanical edits a target version needs - a dependency-pin sweep (sets every matching `@nifrajs/*`
|
|
3042
|
+
dependency to the target version across the workspace, preserving each spec's `^`/`~`/exact style and
|
|
3043
|
+
skipping `workspace:`/`link:` specs) and exact import-specifier moves - and the runner applies them
|
|
3044
|
+
`detect → transform → verify`, reusing the existing `nifra check` gate rather than adding a new one.
|
|
3045
|
+
Dry-run by default (`--write` applies, `--no-verify` skips the check, `--list` shows targets); fail-closed
|
|
3046
|
+
on an unknown version or a missing package.json; deterministic and idempotent. Ships the 1.8.0 recipe.
|
|
3047
|
+
Transforms are intentionally string/specifier-level - structural (AST) codemods are deferred until a
|
|
3048
|
+
recipe needs one.
|
|
3049
|
+
|
|
3050
|
+
### Patch Changes
|
|
3051
|
+
|
|
3052
|
+
- Updated dependencies [e47c4c5]
|
|
3053
|
+
- Updated dependencies [1ffd48b]
|
|
3054
|
+
- @nifrajs/core@1.8.0
|
|
3055
|
+
- @nifrajs/web@1.8.0
|
|
3056
|
+
- @nifrajs/client@1.8.0
|
|
3057
|
+
- @nifrajs/schema@1.8.0
|
|
3058
|
+
- @nifrajs/mcp@1.8.0
|
|
3059
|
+
- @nifrajs/runner@1.8.0
|
|
3060
|
+
- create-nifra@1.8.0
|
|
3061
|
+
|
|
3062
|
+
## 1.7.0
|
|
3063
|
+
|
|
3064
|
+
### Patch Changes
|
|
3065
|
+
|
|
3066
|
+
- 9f23e90: Fix `nifra build --target static` producing pages that render but never hydrate. The prerender pass hardcoded a placeholder client entry, but the real bundle is content-hashed - so the prerendered HTML's hydration `<script src>` 404'd and every control was inert. `BuildTargetOptions.prerenderApp` is now a factory `(client: BuildManifest) => app` invoked with the completed client build, so the emitted `<script src>` uses the real hashed entry (plus the same styles / route-preload the SSR targets use). A regression test asserts the static HTML references the emitted hashed entry and that the file exists under `/assets`. Breaking only for code calling `buildTarget("static", …)` directly (pass a factory instead of a prebuilt app); `nifra build --target static` users just get working hydration.
|
|
3067
|
+
- Updated dependencies [bd95181]
|
|
3068
|
+
- Updated dependencies [9f23e90]
|
|
3069
|
+
- @nifrajs/core@1.7.0
|
|
3070
|
+
- @nifrajs/web@1.7.0
|
|
3071
|
+
- @nifrajs/client@1.7.0
|
|
3072
|
+
- @nifrajs/schema@1.7.0
|
|
3073
|
+
- @nifrajs/mcp@1.7.0
|
|
3074
|
+
- @nifrajs/runner@1.7.0
|
|
3075
|
+
- create-nifra@1.7.0
|
|
3076
|
+
|
|
3077
|
+
## 1.6.0
|
|
3078
|
+
|
|
3079
|
+
### Patch Changes
|
|
3080
|
+
|
|
3081
|
+
- @nifrajs/client@1.6.0
|
|
3082
|
+
- @nifrajs/core@1.6.0
|
|
3083
|
+
- @nifrajs/mcp@1.6.0
|
|
3084
|
+
- @nifrajs/runner@1.6.0
|
|
3085
|
+
- @nifrajs/schema@1.6.0
|
|
3086
|
+
- @nifrajs/web@1.6.0
|
|
3087
|
+
- create-nifra@1.6.0
|
|
3088
|
+
|
|
3089
|
+
## 1.5.0
|
|
3090
|
+
|
|
3091
|
+
### Minor Changes
|
|
3092
|
+
|
|
3093
|
+
- 1ac2fde: API breaking-change gate: `snapshotRoutes` + `diffRouteSnapshots` in `@nifrajs/core/diff` (direction-aware - a new required request field or a removed response field breaks; widening a request enum or adding a response field doesn't; fails closed on anything unprovable), and `nifra snapshot` / `nifra diff <baseline>` CLI commands that exit non-zero on breaking changes for CI.
|
|
3094
|
+
|
|
3095
|
+
### Patch Changes
|
|
3096
|
+
|
|
3097
|
+
- Updated dependencies [1ac2fde]
|
|
3098
|
+
- Updated dependencies [bd3433f]
|
|
3099
|
+
- Updated dependencies [70aa836]
|
|
3100
|
+
- @nifrajs/core@1.5.0
|
|
3101
|
+
- @nifrajs/schema@1.5.0
|
|
3102
|
+
- @nifrajs/client@1.5.0
|
|
3103
|
+
- @nifrajs/web@1.5.0
|
|
3104
|
+
- @nifrajs/mcp@1.5.0
|
|
3105
|
+
- @nifrajs/runner@1.5.0
|
|
3106
|
+
- create-nifra@1.5.0
|
|
3107
|
+
|
|
3108
|
+
## 1.4.0
|
|
3109
|
+
|
|
3110
|
+
### Patch Changes
|
|
3111
|
+
|
|
3112
|
+
- 4d25970: Add one fail-open request-observation lifecycle shared by tracing, agent telemetry, and DevTools; secured development tooling; contract-based mock responses; validator-neutral schema/route reflection; executable render and storage adapter conformance modules; optional storage pagination/signing/copy capabilities; and metadata-preserving local file storage.
|
|
3113
|
+
- Updated dependencies [4d25970]
|
|
3114
|
+
- @nifrajs/core@1.4.0
|
|
3115
|
+
- @nifrajs/schema@1.4.0
|
|
3116
|
+
- @nifrajs/web@1.4.0
|
|
3117
|
+
- @nifrajs/client@1.4.0
|
|
3118
|
+
- @nifrajs/mcp@1.4.0
|
|
3119
|
+
- @nifrajs/runner@1.4.0
|
|
3120
|
+
- create-nifra@1.4.0
|
|
3121
|
+
|
|
3122
|
+
## 1.3.1
|
|
3123
|
+
|
|
3124
|
+
### Patch Changes
|
|
3125
|
+
|
|
3126
|
+
- 578da89: fix(cli): refresh the `nifra mcp` types/examples corpus for the 1.3.0 API + gate it
|
|
3127
|
+
|
|
3128
|
+
`@nifrajs/cli` bundles the MCP corpus (`docs/types.json` / `examples.json`) behind `nifra_types` and
|
|
3129
|
+
`nifra_context`. It shipped **stale in 1.3.0** - the release regenerated `api-reference.md` + the LLM cards
|
|
3130
|
+
but not this corpus - so agents couldn't see `server().tool()` / `.resource()` / `.prompt()`,
|
|
3131
|
+
`onValidationError`, `RouteSchema.errors`, `ToolAnnotations`, or `generateLlmsTxt` via MCP. Regenerated.
|
|
3132
|
+
|
|
3133
|
+
To prevent recurrence: `changeset:publish` now runs `gen:llms` after the build, so every published tarball
|
|
3134
|
+
carries a corpus regenerated from that exact build - the corpus can no longer ship stale regardless of what's
|
|
3135
|
+
committed.
|
|
3136
|
+
|
|
3137
|
+
- @nifrajs/client@1.3.1
|
|
3138
|
+
- @nifrajs/mcp@1.3.1
|
|
3139
|
+
- @nifrajs/runner@1.3.1
|
|
3140
|
+
- @nifrajs/schema@1.3.1
|
|
3141
|
+
- @nifrajs/web@1.3.1
|
|
3142
|
+
- create-nifra@1.3.1
|
|
3143
|
+
|
|
3144
|
+
## 1.3.0
|
|
3145
|
+
|
|
3146
|
+
### Minor Changes
|
|
3147
|
+
|
|
3148
|
+
- 9f8d2aa: feat(cli): `nifra_check` / `nifra_test` MCP tools accept a `dir` to scope a subdirectory
|
|
3149
|
+
|
|
3150
|
+
The MCP server runs at the project root, so `nifra check` / `nifra test` always ran from there - no way to
|
|
3151
|
+
target one app in a monorepo (a common pain: the root holds a builder + generated apps, but you want to
|
|
3152
|
+
check just `app/`). Both tools now take an optional `dir` (relative to the root, e.g. `"app"` or
|
|
3153
|
+
`"packages/api"`); the check/test runs against that subtree. Path-traversal-guarded - a `dir` that climbs
|
|
3154
|
+
out of the root (`../`, an absolute path elsewhere) is rejected, not run.
|
|
3155
|
+
|
|
3156
|
+
- 4a4b1c4: feat: `server().resource()` / `.prompt()` - app-declared MCP resources & prompts
|
|
3157
|
+
|
|
3158
|
+
Completing the MCP trio alongside `.tool()`: an app can now expose its own MCP **resources**
|
|
3159
|
+
(`.resource(uri, { name, description?, mimeType? }, read)`) and **prompts** (`.prompt(name, { description,
|
|
3160
|
+
arguments? }, handler)`). `nifra mcp` surfaces them in `resources/list` + `resources/read` and `prompts/list`
|
|
3161
|
+
|
|
3162
|
+
- `prompts/get` (namespaced per app in a monorepo). The `read`/`handler` closures run in the app process, so
|
|
3163
|
+
they capture whatever app state they need - no HTTP round-trip.
|
|
3164
|
+
|
|
3165
|
+
### Patch Changes
|
|
3166
|
+
|
|
3167
|
+
- Updated dependencies [4a4b1c4]
|
|
3168
|
+
- Updated dependencies [4a4b1c4]
|
|
3169
|
+
- @nifrajs/mcp@1.3.0
|
|
3170
|
+
- @nifrajs/schema@1.3.0
|
|
3171
|
+
- @nifrajs/web@1.3.0
|
|
3172
|
+
- @nifrajs/client@1.3.0
|
|
3173
|
+
- @nifrajs/runner@1.3.0
|
|
3174
|
+
- create-nifra@1.3.0
|
|
3175
|
+
|
|
3176
|
+
## 1.2.2
|
|
3177
|
+
|
|
3178
|
+
### Patch Changes
|
|
3179
|
+
|
|
3180
|
+
- 281844e: fix(cli): `nifra check` respects `.gitignore` and bounds the MCP result
|
|
3181
|
+
|
|
3182
|
+
Two fixes so `nifra check` (and the `nifra_check` MCP tool) can't drown in a repo full of generated apps:
|
|
3183
|
+
|
|
3184
|
+
- **Scanner honours `.gitignore`** - `walkSource` now filters candidates through one batched
|
|
3185
|
+
`git check-ignore`, so a gitignored generated/build tree isn't walked. A repo that gitignores, e.g., a
|
|
3186
|
+
238-app generated-output dir went from a **52 MB** check result to ~130 KB. Degrades to the built-in
|
|
3187
|
+
ignore list (node_modules/dist/…) when there's no git repo - never throws.
|
|
3188
|
+
- **`nifra_check` MCP tool caps its output** - `collectCheckResult` gains `maxDiagnostics` (the tool sets 100) and reports `truncated: { shown, total }`, so a huge project can't emit an MCP message large enough
|
|
3189
|
+
to break the stdio transport (`-32000: Connection closed`). `ok` still reflects the FULL set; the CLI
|
|
3190
|
+
terminal / `--json` output stays unbounded.
|
|
3191
|
+
- @nifrajs/client@1.2.2
|
|
3192
|
+
- @nifrajs/mcp@1.2.2
|
|
3193
|
+
- @nifrajs/runner@1.2.2
|
|
3194
|
+
- @nifrajs/schema@1.2.2
|
|
3195
|
+
- @nifrajs/web@1.2.2
|
|
3196
|
+
- create-nifra@1.2.2
|
|
3197
|
+
|
|
3198
|
+
## 1.2.1
|
|
3199
|
+
|
|
3200
|
+
### Patch Changes
|
|
3201
|
+
|
|
3202
|
+
- Updated dependencies [c3ebd73]
|
|
3203
|
+
- @nifrajs/web@1.2.1
|
|
3204
|
+
- @nifrajs/client@1.2.1
|
|
3205
|
+
- @nifrajs/mcp@1.2.1
|
|
3206
|
+
- @nifrajs/runner@1.2.1
|
|
3207
|
+
- @nifrajs/schema@1.2.1
|
|
3208
|
+
- create-nifra@1.2.1
|
|
3209
|
+
|
|
3210
|
+
## 1.2.0
|
|
3211
|
+
|
|
3212
|
+
### Patch Changes
|
|
3213
|
+
|
|
3214
|
+
- @nifrajs/client@1.2.0
|
|
3215
|
+
- @nifrajs/schema@1.2.0
|
|
3216
|
+
- @nifrajs/web@1.2.0
|
|
3217
|
+
- @nifrajs/mcp@1.2.0
|
|
3218
|
+
- @nifrajs/runner@1.2.0
|
|
3219
|
+
- create-nifra@1.2.0
|
|
3220
|
+
|
|
3221
|
+
## 1.1.0
|
|
3222
|
+
|
|
3223
|
+
### Patch Changes
|
|
3224
|
+
|
|
3225
|
+
- Updated dependencies [9905f7f]
|
|
3226
|
+
- Updated dependencies [17e57c4]
|
|
3227
|
+
- Updated dependencies [37d2383]
|
|
3228
|
+
- create-nifra@1.1.0
|
|
3229
|
+
- @nifrajs/schema@1.1.0
|
|
3230
|
+
- @nifrajs/web@1.1.0
|
|
3231
|
+
- @nifrajs/client@1.1.0
|
|
3232
|
+
- @nifrajs/mcp@1.1.0
|
|
3233
|
+
- @nifrajs/runner@1.1.0
|
|
3234
|
+
|
|
3235
|
+
## 1.0.0
|
|
3236
|
+
|
|
3237
|
+
### Minor Changes
|
|
3238
|
+
|
|
3239
|
+
- 5673ff1: `nifra_types` - a new MCP tool that returns the **exact TypeScript** of any exported `@nifrajs/*` symbol (interface, type, class, function, const). Each signature is generated at build time from the package's built `.d.ts` with the TS compiler - the literal declaration, complete and authoritative, never prose and never truncated - and shipped inside `@nifrajs/cli` (`docs/types.json`), so it works offline and on every transport (stdio, HTTP, the edge `/mcp`).
|
|
3240
|
+
|
|
3241
|
+
This closes the gap that made agents fall back to reading `.d.ts`: when an agent needs the precise shape of a type (`RateLimitStore`, `RouteSchema`, a function signature), `nifra_types({ name })` returns the literal block. The tool description makes the completeness explicit ("the source of truth - do NOT read `.d.ts`"), and `nifra_docs` now points at it for exact types. `nifra_examples_app` on the public docs MCP, and the `@nifrajs/cli/mcp` self-host surface, both expose it too (`TypeEntry` is re-exported).
|
|
3242
|
+
|
|
3243
|
+
### Patch Changes
|
|
3244
|
+
|
|
3245
|
+
- c099d5f: Add `@nifrajs/mcp` - build MCP servers, and **MCP Apps** (interactive `ui://` widgets, SEP-1865), for a nifra app.
|
|
3246
|
+
|
|
3247
|
+
MCP tools have only ever returned text. MCP Apps lets a tool return **interactive UI**: a tool links a `ui://` resource (MIME `text/html;profile=mcp-app`); the host renders it in a sandboxed iframe and bridges it to the server over MCP-JSON-RPC-on-`postMessage`. `@nifrajs/mcp` ships:
|
|
3248
|
+
|
|
3249
|
+
- The transport-agnostic JSON-RPC core (`handleRpc`, shared with `@nifrajs/cli`'s dev MCP) extended for MCP Apps - `structuredContent`, `_meta.ui.resourceUri`, and the `io.modelcontextprotocol/ui` capability.
|
|
3250
|
+
- `respondMcpHttp` - a Web `fetch` handler you mount at `POST /mcp`. nifra route handlers can return a raw `Response`, so mounting is one line per verb.
|
|
3251
|
+
- `defineMcpWidget` - author a `ui://` widget as one self-contained HTML doc with a tiny zero-dependency `postMessage` bridge inlined (`mcpApp.onData(render)` to render the host-pushed `structuredContent`; `mcpApp.callTool(...)` to re-invoke a tool through the host).
|
|
3252
|
+
- `defineMcpTool` + `createMcpServer` - wire tools to widgets and get a mountable server. See `examples/mcp-app/`.
|
|
3253
|
+
- `@nifrajs/mcp/react` - `reactWidget({ component })` authors a widget from a React component instead of an HTML string: the component is bundled for the browser (Bun.build) and re-renders on each `structuredContent` push over the bridge. `react`/`react-dom` resolve from the consumer; the core stays dependency-free.
|
|
3254
|
+
- **Host theming + render intent** (see `THEMING.md`). `defineMcpTool({ intent })` adds `_meta.ui.intent` (`table`/`list`/`form`/…) so a generative host renders `structuredContent` with its own themed component. For iframe widgets, the bridge handles a `ui/notifications/theme` push and auto-applies the host's shadcn/Tailwind semantic tokens (`--primary`, `--card`, `--border`, `--radius`, …) to the widget root - so a widget that styles with `hsl(var(--primary))` matches the embedding app with zero extra code.
|
|
3255
|
+
|
|
3256
|
+
`@nifrajs/cli`'s MCP protocol core moved into `@nifrajs/mcp` (the CLI re-exports it); behavior is unchanged - a tool whose handler returns a plain `string` behaves exactly as before. nifra's own public docs MCP (nifra.dev `/mcp`) now also dogfoods this - `nifra_examples_app` renders the examples as an interactive widget.
|
|
3257
|
+
|
|
3258
|
+
- bb31594: Surface `@nifrajs/middleware` where agents look. The `nifra_context` conventions (and a scaffolded app's `AGENTS.md`) now carry a one-line pointer: cross-cutting concerns - rate limiting (`429`), CORS, security headers, body limits, auth, CSRF, IP restriction, caching, compression - are `app.use(...)` plugins in `@nifrajs/middleware`; call `nifra_docs("middleware")` for the full list. So an agent setting up routes finds the built-in middleware (it already shipped) without having to think to search for it.
|
|
3259
|
+
- de9675b: Pre-1.0 security hardening pass. A framework-wide audit found no critical/high issues; these close the medium/low items it surfaced.
|
|
3260
|
+
|
|
3261
|
+
- **`cache()` - no cross-user leak by default.** A `200` to a request bearing `Authorization`/`Cookie` is no longer stored (and replayed to other users) unless the response is explicitly `Cache-Control: public`/`s-maxage` (RFC 9111 §3.5). Opt back in per cache with `cacheAuthenticated: true` for a route that's identical for every caller.
|
|
3262
|
+
- **`idempotency()` - route-scoped keys + a `key` hook.** The default store key is now scoped by method+path, so the same `Idempotency-Key` on a different endpoint can't collide and replay another resource's response. Added a `key(req, header)` option to scope by principal (e.g. user id). Method matching normalized to upper-case.
|
|
3263
|
+
- **`etag()` - a `304` no longer carries the `200`'s `Content-Length`/`Content-Type`.**
|
|
3264
|
+
- **`@nifrajs/core` - inbound WebSocket frames are capped** when serving on Bun (`listen()`): frames over `wsMaxPayloadBytes` (default `maxBodyBytes`, 1 MB) are rejected by the runtime before reaching a handler, so a huge frame can't be buffered/parsed into memory. New `ServerOptions.wsMaxPayloadBytes`.
|
|
3265
|
+
- **`@nifrajs/core` - WebSocket routes are same-origin by default (CSWSH).** A `ws()` route with no `allowedOrigins` now rejects a **cross-origin browser** handshake (an `Origin` whose host differs from the request's) with `403` - closing cross-site WebSocket hijacking, since browsers send cookies on WS handshakes and don't apply CORS. Non-browser clients (no `Origin`) and same-origin browsers are unaffected. **Breaking** for a route that served a cross-origin browser without declaring `allowedOrigins`: set `allowedOrigins` to the permitted origins (or `() => true` for a genuinely public socket).
|
|
3266
|
+
- **`@nifrajs/node` - static file handler** now adds `X-Content-Type-Options: nosniff` and re-checks the real path (symlink containment) before streaming, matching the image server.
|
|
3267
|
+
- **`@nifrajs/mcp` - widget bridge** now rejects `postMessage` events whose source isn't the parent window (including null-source synthetic events), closing a spoofing gap the previous guard left open.
|
|
3268
|
+
- **`@nifrajs/cli` - the MCP `nifra_run`/`nifra_ws` `entry` arg** is kept inside the project root, so a crafted `entry` can't import/execute a module outside the project.
|
|
3269
|
+
|
|
3270
|
+
- a001558: **MCP warm worker survives a single per-request cancel.** The warm `nifra_run`/`nifra_render` worker is shared across concurrent calls (its `pending` map is id-keyed so several requests can be outstanding at once). Cancelling one request used to kill the whole worker process, which rejected every other in-flight request and forced a cold rebuild - defeating the warm reuse + concurrency the tool is built for. A per-request cancel now drops only that request and leaves the worker hot; it's still replaced on file change as before.
|
|
3271
|
+
- Updated dependencies [f1f0e18]
|
|
3272
|
+
- Updated dependencies [c099d5f]
|
|
3273
|
+
- Updated dependencies [bb31594]
|
|
3274
|
+
- Updated dependencies [3efb7cd]
|
|
3275
|
+
- Updated dependencies [de9675b]
|
|
3276
|
+
- @nifrajs/client@1.0.0
|
|
3277
|
+
- @nifrajs/web@1.0.0
|
|
3278
|
+
- @nifrajs/mcp@1.0.0
|
|
3279
|
+
- create-nifra@1.0.0
|
|
3280
|
+
- @nifrajs/schema@1.0.0
|
|
3281
|
+
- @nifrajs/runner@1.0.0
|
|
3282
|
+
|
|
3283
|
+
## 1.0.0-beta.4
|
|
3284
|
+
|
|
3285
|
+
### Patch Changes
|
|
3286
|
+
|
|
3287
|
+
- Updated dependencies [5181a35]
|
|
3288
|
+
- create-nifra@1.0.0-beta.4
|
|
3289
|
+
- @nifrajs/client@1.0.0-beta.4
|
|
3290
|
+
- @nifrajs/runner@1.0.0-beta.4
|
|
3291
|
+
- @nifrajs/schema@1.0.0-beta.4
|
|
3292
|
+
- @nifrajs/web@1.0.0-beta.4
|
|
3293
|
+
|
|
3294
|
+
## 1.0.0-beta.3
|
|
3295
|
+
|
|
3296
|
+
### Patch Changes
|
|
3297
|
+
|
|
3298
|
+
- @nifrajs/client@1.0.0-beta.3
|
|
3299
|
+
- @nifrajs/runner@1.0.0-beta.3
|
|
3300
|
+
- @nifrajs/schema@1.0.0-beta.3
|
|
3301
|
+
- @nifrajs/web@1.0.0-beta.3
|
|
3302
|
+
- create-nifra@1.0.0-beta.3
|
|
3303
|
+
|
|
3304
|
+
## 0.1.0-beta.2
|
|
3305
|
+
|
|
3306
|
+
### Patch Changes
|
|
3307
|
+
|
|
3308
|
+
- Updated dependencies [5018546]
|
|
3309
|
+
- @nifrajs/web@0.1.0-beta.2
|
|
3310
|
+
- @nifrajs/client@0.1.0-beta.2
|
|
3311
|
+
- @nifrajs/runner@0.1.0-beta.2
|
|
3312
|
+
- @nifrajs/schema@0.1.0-beta.2
|
|
3313
|
+
- create-nifra@0.1.0-beta.2
|