@nifrajs/cli 5.3.0 → 5.5.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 +95 -0
- package/README.md +2 -1
- package/dist/check-scan.d.ts +6 -0
- package/dist/check-scan.d.ts.map +1 -1
- package/dist/check-scan.js +10 -10
- package/dist/check-scan.js.map +1 -1
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +1 -0
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -5
- package/dist/cli.js.map +1 -1
- package/dist/docs-search.d.ts +10 -1
- package/dist/docs-search.d.ts.map +1 -1
- package/dist/docs-search.js +86 -9
- package/dist/docs-search.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +49 -4
- package/dist/doctor.js.map +1 -1
- package/dist/load.d.ts +4 -1
- package/dist/load.d.ts.map +1 -1
- package/dist/load.js +8 -0
- package/dist/load.js.map +1 -1
- package/dist/lock-links.d.ts.map +1 -1
- package/dist/lock-links.js +3 -1
- package/dist/lock-links.js.map +1 -1
- package/dist/mcp-http.js +1 -1
- package/dist/recipes/5.4.0.d.ts +10 -0
- package/dist/recipes/5.4.0.d.ts.map +1 -0
- package/dist/recipes/5.4.0.js +27 -0
- package/dist/recipes/5.4.0.js.map +1 -0
- package/dist/recipes/5.5.0.d.ts +9 -0
- package/dist/recipes/5.5.0.d.ts.map +1 -0
- package/dist/recipes/5.5.0.js +31 -0
- package/dist/recipes/5.5.0.js.map +1 -0
- package/dist/recipes/index.d.ts +7 -0
- package/dist/recipes/index.d.ts.map +1 -1
- package/dist/recipes/index.js +4 -0
- package/dist/recipes/index.js.map +1 -1
- package/dist/release-verification.d.ts +20 -0
- package/dist/release-verification.d.ts.map +1 -1
- package/dist/release-verification.js +62 -13
- package/dist/release-verification.js.map +1 -1
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +2 -0
- package/dist/review.js.map +1 -1
- package/dist/rules/codes.d.ts +2 -0
- package/dist/rules/codes.d.ts.map +1 -1
- package/dist/rules/codes.js +2 -0
- package/dist/rules/codes.js.map +1 -1
- package/dist/rules/explanations.d.ts.map +1 -1
- package/dist/rules/explanations.js +12 -2
- package/dist/rules/explanations.js.map +1 -1
- package/dist/rules/legacy.d.ts.map +1 -1
- package/dist/rules/legacy.js +63 -19
- package/dist/rules/legacy.js.map +1 -1
- package/dist/rules/security.d.ts +6 -0
- package/dist/rules/security.d.ts.map +1 -1
- package/dist/rules/security.js +152 -2
- package/dist/rules/security.js.map +1 -1
- package/dist/rules/zones.d.ts.map +1 -1
- package/dist/rules/zones.js +43 -1
- package/dist/rules/zones.js.map +1 -1
- package/dist/smoke.d.ts +17 -1
- package/dist/smoke.d.ts.map +1 -1
- package/dist/smoke.js +49 -0
- package/dist/smoke.js.map +1 -1
- package/dist/upgrade.d.ts +40 -12
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +182 -17
- package/dist/upgrade.js.map +1 -1
- package/dist/verification-plan.d.ts +4 -0
- package/dist/verification-plan.d.ts.map +1 -1
- package/dist/verification-plan.js +48 -0
- package/dist/verification-plan.js.map +1 -1
- package/dist/version-drift.d.ts +2 -1
- package/dist/version-drift.d.ts.map +1 -1
- package/dist/version-drift.js +11 -26
- 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 +14 -2
- package/docs/llms-full.txt +759 -199
- package/docs/types.json +258 -44
- package/package.json +11 -11
- package/src/check-scan.ts +10 -12
- package/src/check.ts +1 -0
- package/src/cli.ts +6 -5
- package/src/docs-search.ts +90 -10
- package/src/doctor.ts +60 -4
- package/src/load.ts +13 -0
- package/src/lock-links.ts +3 -1
- package/src/mcp-http.ts +1 -1
- package/src/recipes/5.4.0.ts +28 -0
- package/src/recipes/5.5.0.ts +32 -0
- package/src/recipes/index.ts +11 -0
- package/src/release-verification.ts +88 -12
- package/src/review.ts +2 -0
- package/src/rules/codes.ts +2 -0
- package/src/rules/explanations.ts +12 -2
- package/src/rules/legacy.ts +75 -20
- package/src/rules/security.ts +171 -2
- package/src/rules/zones.ts +44 -1
- package/src/smoke.ts +70 -0
- package/src/upgrade.ts +199 -21
- package/src/verification-plan.ts +51 -0
- package/src/version-drift.ts +18 -26
- package/src/web-app-options.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,100 @@
|
|
|
1
1
|
# @nifrajs/cli
|
|
2
2
|
|
|
3
|
+
## 5.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9e6a0a5: An app that serves only some of its pages on some hosts can say so with `createHostPolicy()` from `@nifrajs/web`, and the build's own files stay reachable on those hosts. A rule names the hosts (a list or a predicate), the page routes they get, any other paths (`paths`), and whether they get the build's files (`buildAssets`, on by default). A host no rule names is not restricted. A refused request answers `404` with `cache-control: no-store`, or what `refuse` returns.
|
|
8
|
+
|
|
9
|
+
- `createWebApp({ hostPolicy, buildAssets })` runs the policy before `use()` middleware, mounts and pages, on Bun and on Node's direct lane.
|
|
10
|
+
- `hostPolicy` in `nifra.config.ts` is applied by `nifra build` to every target's generated server entry, static files included: the Bun, Deno and Cloudflare entries check it before serving a file, and `@nifrajs/node`'s `static` reader takes a new `allow(host, pathname)` option the Node entry sets. Cloudflare's `_routes.json` then sends every file, the client bundle included, through the worker. Vercel serves the client bundle and `public/` files from its CDN before the function runs, so there the policy covers pages and other routes only.
|
|
11
|
+
- The server manifest exports `buildAssets` (every file the client build emitted and every public file) and `isBuildAsset(pathname)`. `buildServer` takes the manifest `buildClient` returned as `client`, which sets the entry, styles and this set from it; `clientEntry` stays and wins when both are given.
|
|
12
|
+
- `checkHostReach()` from `@nifrajs/web/build` renders pages on a host and fetches every same-origin file they reference (scripts and their imports, stylesheets and their `url()`s, preloads, icons, images), expecting `200`, then expects each `refused` path to answer `404`. `nifra smoke` runs it for each entry of a fixture's new `hosts` list.
|
|
13
|
+
|
|
14
|
+
Apps without a host policy are unchanged.
|
|
15
|
+
- 9e6a0a5: `nifra doctor` (and `nifra check`, as `NF-D002`) counts the nifra a `link:` or `file:` repository outside the workspace installs in its own `node_modules`. That repository loads its own copy whatever the workspace installs, so two live-linked repositories that each pin one version, at different versions, are now reported as mixed versions.
|
|
16
|
+
|
|
17
|
+
`nifra upgrade` and `--list` mark a release that announces no behaviour change for the packages a project loads: a release recipe may name the packages its notes change (`affects`), and a project that loads none of them sees that beside the release. 5.4.0 names `@nifrajs/node`, `@nifrajs/web` and `@nifrajs/cli`.
|
|
18
|
+
- 9e6a0a5: One module inside `frontend/` or `backend/` can be declared shared where it is: name it `*.shared.ts` (any script extension), or list its path under `"nifra": { "zones": { "shared": [...] } }`. It is then held to the shared zone's rules, so it may import only shared code and packages, and `nifra check` reports each import that breaks them. A `shared` entry inside one of those folders was refused before; entries for other zones still are, and the refusal now says which entry may name such a path. A file listed under another zone keeps that zone whatever its name.
|
|
19
|
+
|
|
20
|
+
NF-C028 now says which remedy applies when server code imports a frontend module: when the module imports only shared code and packages, it names the rename and the config entry that share it in place; otherwise it names the first import that keeps it from being shared, and says to move what both sides need into `shared/`.
|
|
21
|
+
- 9e6a0a5: `.ws()` on the typed client takes `validateReceive`: the route's `sendSchema`, checked against every received frame. A frame that fails is not delivered, and `onError` gets a `TypeError` naming the issues with the frame as its `cause`. Frames keep their arrival order with an async schema too. Without the option nothing changes.
|
|
22
|
+
|
|
23
|
+
`nifra check` reports `NF-S009` (info) for an `app.ws()` route whose inline `message()` calls `JSON.parse` with no `messageSchema`.
|
|
24
|
+
|
|
25
|
+
`nifra_docs` answers a query that matches a long page with that page's lead, the `###` subsections the query matches, and the headings of the rest, where it returned the page's first 2,800 characters. The WebSockets guide gains a typechecked example (`nifra_example`) with discriminated-union `messageSchema` and `sendSchema`, the client's `.ws()` handle, an exhaustive `switch` with a `never` check, and a heartbeat the client answers.
|
|
26
|
+
- ed55d22: `nifra check` reports an identity-sensitive package installed at more than one version as NF-C046, an error, instead of NF-C009. NF-C009 now covers only copies of one version, the duplicates a `singleCopy` declaration collapses, so a severity override on NF-C009 no longer changes how a version skew is reported. Its fix names the one version to install (`nifra upgrade <version>` in each install root for nifra's own packages) and no longer suggests a `singleCopy` declaration, which never covers a skew.
|
|
27
|
+
|
|
28
|
+
`nifra upgrade` finds a linked package that loads another nifra version when its workspace hoists nifra to the workspace root, and through the workspace packages it depends on. It resolves each package from the linked package's real path, walking up through every `node_modules` as Node and Bun do, instead of reading only the linked package's own folder, and prints one upgrade command per install root.
|
|
29
|
+
|
|
30
|
+
NF-D003 compares a `file:` package's `devDependencies` with what bun.lock recorded. Bun installs a `file:` package's devDependencies and never refreshes them, so a stale entry there installed an old version unreported.
|
|
31
|
+
|
|
32
|
+
`nifra doctor`'s production-readiness table reads the source of `file:`, `link:` and workspace packages the app imports, and of those they import, so a setting a shared server factory applies counts as configured. The evidence names the package it came from. Registry installs and nifra's own packages are not read.
|
|
33
|
+
|
|
34
|
+
NF-S002 no longer reports a comparison between two `const`s initialized from configuration reads (`const a = process.env.A_KEY`), such as a startup check that two keys differ. It reports names ending in `serviceKey`, `privateKey`, `signingKey`, `masterKey` and `encryptionKey` as secrets, which it missed before.
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- aed4a76: `QUERY` is a known method label in metrics and span names instead of `_OTHER`, and `nifra check` counts the QUERY route `all()` registers.
|
|
39
|
+
- c5755cf: Source scans honor Git ignores for Unicode and special filenames. Git input/output uses NUL separators and exact paths, preserving literal POSIX backslashes and leading/trailing whitespace.
|
|
40
|
+
|
|
41
|
+
- 9e6a0a5: `nifra build`, `nifra dev` and `buildClient`/`buildServer` print each bundler error with its file, line and column and the source line, where they printed the message alone. The message that `buildServer` throws without a client entry now names the `client` option.
|
|
42
|
+
- 9dbb277: `nifra upgrade 5.5.0` pins every Nifra package to 5.5.0 and an app's `react-server-dom-webpack` to 19.3.1, and its notes list what an app or a client sees differently after the upgrade.
|
|
43
|
+
- 10a7854: `nifra verify` prints a line on stderr as each gate starts and finishes, with the gate's time, and the summary shows each gate's time and the total. A long run shows which gate it is on, and a slow gate can be found. The JSON result (`--json`, the `nifra_verify` MCP tool) gains `durationMs` on each gate that ran and on the result.
|
|
44
|
+
- Updated dependencies [9e6a0a5]
|
|
45
|
+
- Updated dependencies [c3ba1cb]
|
|
46
|
+
- Updated dependencies [df7ef2e]
|
|
47
|
+
- Updated dependencies [b8595b1]
|
|
48
|
+
- Updated dependencies [c37575c]
|
|
49
|
+
- Updated dependencies [6cc9e11]
|
|
50
|
+
- Updated dependencies [9e6a0a5]
|
|
51
|
+
- Updated dependencies [28dd544]
|
|
52
|
+
- Updated dependencies [662afb0]
|
|
53
|
+
- Updated dependencies [662afb0]
|
|
54
|
+
- Updated dependencies [98347c2]
|
|
55
|
+
- Updated dependencies [9fd49ec]
|
|
56
|
+
- Updated dependencies [61113d8]
|
|
57
|
+
- Updated dependencies [506a387]
|
|
58
|
+
- Updated dependencies [9e6a0a5]
|
|
59
|
+
- Updated dependencies [389e1b6]
|
|
60
|
+
- Updated dependencies [662afb0]
|
|
61
|
+
- Updated dependencies [a11fe77]
|
|
62
|
+
- Updated dependencies [fa5b67c]
|
|
63
|
+
- Updated dependencies [9e6a0a5]
|
|
64
|
+
- @nifrajs/web@5.5.0
|
|
65
|
+
- @nifrajs/core@5.5.0
|
|
66
|
+
- @nifrajs/mcp-db@5.5.0
|
|
67
|
+
- @nifrajs/client@5.5.0
|
|
68
|
+
- @nifrajs/i18n@5.5.0
|
|
69
|
+
- @nifrajs/mcp@5.5.0
|
|
70
|
+
- @nifrajs/schema@5.5.0
|
|
71
|
+
- @nifrajs/testing@5.5.0
|
|
72
|
+
- @nifrajs/agent-review@5.5.0
|
|
73
|
+
- @nifrajs/runner@5.5.0
|
|
74
|
+
|
|
75
|
+
## 5.4.0
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- 19e16be: `nifra upgrade 5.4.0` prints what changes for a 5.3 app: a `node` build needs the adapter of the same release, static files carry content `ETag`s and drop `Last-Modified` for copied mtimes, the Deno entry answers validators, and `@nifrajs/node`'s `static` reader changes its types, ranges and link answers.
|
|
80
|
+
- Updated dependencies [e7d43ca]
|
|
81
|
+
- Updated dependencies [5183c00]
|
|
82
|
+
- Updated dependencies [01b97ec]
|
|
83
|
+
- Updated dependencies [e589893]
|
|
84
|
+
- Updated dependencies [ff66db6]
|
|
85
|
+
- Updated dependencies [02ac072]
|
|
86
|
+
- Updated dependencies [529f8d2]
|
|
87
|
+
- @nifrajs/web@5.4.0
|
|
88
|
+
- @nifrajs/core@5.4.0
|
|
89
|
+
- @nifrajs/client@5.4.0
|
|
90
|
+
- @nifrajs/i18n@5.4.0
|
|
91
|
+
- @nifrajs/mcp@5.4.0
|
|
92
|
+
- @nifrajs/schema@5.4.0
|
|
93
|
+
- @nifrajs/testing@5.4.0
|
|
94
|
+
- @nifrajs/agent-review@5.4.0
|
|
95
|
+
- @nifrajs/mcp-db@5.4.0
|
|
96
|
+
- @nifrajs/runner@5.4.0
|
|
97
|
+
|
|
3
98
|
## 5.3.0
|
|
4
99
|
|
|
5
100
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -66,7 +66,8 @@ is the feedback plan and reports which release gates it omits. CI and release au
|
|
|
66
66
|
consumer, publish, and cross-runtime gates. Each gate runs a `package.json` script (`bun run lint`,
|
|
67
67
|
`bun run check:docs`, ...); a gate whose script the project does not declare is reported as
|
|
68
68
|
`undeclared` and does not fail the run. The nifra repository's own `bun run verify` and
|
|
69
|
-
`bun run check:release` fail that gate instead, so a renamed script cannot drop it.
|
|
69
|
+
`bun run check:release` fail that gate instead, so a renamed script cannot drop it. A line on stderr
|
|
70
|
+
marks each gate as it starts and finishes, with its time. Run `nifra port --ci --target <target>` for an app's
|
|
70
71
|
resolved deployment target; CI never guesses a target when none is configured.
|
|
71
72
|
|
|
72
73
|
## `nifra check` - the drift gate (run as "done")
|
package/dist/check-scan.d.ts
CHANGED
|
@@ -33,6 +33,12 @@ export interface TypedClientFinding extends SourceFinding {
|
|
|
33
33
|
export declare const SIMPLE_REWRITE_METHODS: Set<string>;
|
|
34
34
|
/** Whether a project file is browser code: a route's frontend half, `frontend/` or `shared/`. Pure. */
|
|
35
35
|
export declare function isBrowserSource(file: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether a specifier names server-only code by name, so the chain ends there: a `node:`/`bun:`
|
|
38
|
+
* module, a bare builtin with no browser counterpart, or a package the browser build refuses
|
|
39
|
+
* (`SERVER_PACKAGES` and the driver entries of `@nifrajs/web/zones`).
|
|
40
|
+
*/
|
|
41
|
+
export declare function isServerOnlySink(specifier: string): boolean;
|
|
36
42
|
export declare const IDENT: RegExp;
|
|
37
43
|
export interface StaticRouteFinding extends SourceFinding {
|
|
38
44
|
readonly method: string;
|
package/dist/check-scan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-scan.d.ts","sourceRoot":"","sources":["../src/check-scan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAGxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,iCAAiC,CAAA;AAGxC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AACD,yGAAyG;AACzG,MAAM,WAAW,UAAW,SAAQ,aAAa;IAC/C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AACD;6GAC6G;AAC7G,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,oGAAoG;IACp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 -105,7 +105,7 @@ const DB_MODULE = /^(?:\.\.?\/)+db(?:\.[cm]?[jt]sx?)?$/;
|
|
|
105
105
|
* module, a bare builtin with no browser counterpart, or a package the browser build refuses
|
|
106
106
|
* (`SERVER_PACKAGES` and the driver entries of `@nifrajs/web/zones`).
|
|
107
107
|
*/
|
|
108
|
-
function isServerOnlySink(specifier) {
|
|
108
|
+
export function isServerOnlySink(specifier) {
|
|
109
109
|
return (/^(?:node:|bun:)/.test(specifier) ||
|
|
110
110
|
SERVER_BUILTINS.has(specifier) ||
|
|
111
111
|
isServerPackageSpecifier(specifier));
|
|
@@ -914,7 +914,8 @@ function scanMethodRoutes(file, content, code, facts) {
|
|
|
914
914
|
ALL_ROUTES.lastIndex = 0;
|
|
915
915
|
for (let m = ALL_ROUTES.exec(code); m !== null; m = ALL_ROUTES.exec(code)) {
|
|
916
916
|
const double = m[1] !== undefined;
|
|
917
|
-
|
|
917
|
+
// all() also registers QUERY, which has no builder of its own and so is not in HTTP_VERBS.
|
|
918
|
+
collect(m.index, "all", 0, double ? m[1] : m[2], double ? '"' : "'", [...HTTP_VERBS, "QUERY"]);
|
|
918
919
|
}
|
|
919
920
|
METHOD_ROUTES.lastIndex = 0;
|
|
920
921
|
for (let m = METHOD_ROUTES.exec(code); m !== null; m = METHOD_ROUTES.exec(code)) {
|
|
@@ -2951,21 +2952,19 @@ async function gitIgnored(cwd, rels) {
|
|
|
2951
2952
|
if (rels.length === 0)
|
|
2952
2953
|
return new Set();
|
|
2953
2954
|
try {
|
|
2954
|
-
const proc = Bun.spawn(["git", "check-ignore", "--stdin"], {
|
|
2955
|
+
const proc = Bun.spawn(["git", "check-ignore", "--stdin", "-z"], {
|
|
2955
2956
|
cwd,
|
|
2956
2957
|
stdin: "pipe",
|
|
2957
2958
|
stdout: "pipe",
|
|
2958
2959
|
stderr: "ignore",
|
|
2959
2960
|
});
|
|
2960
|
-
proc.stdin.write(`${rels.join("\
|
|
2961
|
+
proc.stdin.write(`${rels.join("\0")}\0`);
|
|
2961
2962
|
await proc.stdin.end();
|
|
2962
|
-
//
|
|
2963
|
+
// -z keeps both directions literal: Git otherwise C-quotes Unicode/escapes on output and
|
|
2964
|
+
// interprets quoted input. Only matching paths are emitted; exit 1 means none matched.
|
|
2963
2965
|
const out = await new Response(proc.stdout).text();
|
|
2964
2966
|
await proc.exited;
|
|
2965
|
-
return new Set(out
|
|
2966
|
-
.split("\n")
|
|
2967
|
-
.map((s) => s.trim())
|
|
2968
|
-
.filter(Boolean));
|
|
2967
|
+
return new Set(out.split("\0").filter((path) => path !== ""));
|
|
2969
2968
|
}
|
|
2970
2969
|
catch {
|
|
2971
2970
|
return new Set();
|
|
@@ -2980,7 +2979,8 @@ export async function walkSource(cwd, visit, opts = {}) {
|
|
|
2980
2979
|
// one batch before the (expensive) reads. So a gitignored generated/build tree is never read or scanned.
|
|
2981
2980
|
const rels = [];
|
|
2982
2981
|
for await (const rawRel of new Glob(pattern).scan({ cwd, dot: false })) {
|
|
2983
|
-
|
|
2982
|
+
// A backslash is a filename character on POSIX; only Windows separators need normalizing.
|
|
2983
|
+
const rel = sep === "\\" ? normalizeProjectPath(rawRel) : rawRel;
|
|
2984
2984
|
// A `.js` file outside a zone is tooling (a bundler config, a script, a vendored asset), not app code.
|
|
2985
2985
|
if (PLAIN_SCRIPT_FILE.test(rel) && !ZONED_PATH.test(rel))
|
|
2986
2986
|
continue;
|