@nifrajs/web 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-vite.d.ts +68 -0
- package/dist/build-vite.d.ts.map +1 -0
- package/dist/build-vite.js +487 -0
- package/dist/build-vite.js.map +1 -0
- package/dist/build.d.ts +112 -25
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +283 -64
- package/dist/build.js.map +1 -1
- package/dist/bun-dev-entry.d.ts +83 -0
- package/dist/bun-dev-entry.d.ts.map +1 -0
- package/dist/bun-dev-entry.js +136 -0
- package/dist/bun-dev-entry.js.map +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -0
- package/dist/client.js.map +1 -1
- package/dist/deferred.d.ts +3 -2
- package/dist/deferred.d.ts.map +1 -1
- package/dist/deferred.js +11 -8
- package/dist/deferred.js.map +1 -1
- package/dist/dev-port.d.ts +36 -0
- package/dist/dev-port.d.ts.map +1 -0
- package/dist/dev-port.js +48 -0
- package/dist/dev-port.js.map +1 -0
- package/dist/dev.d.ts +61 -4
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +419 -60
- package/dist/dev.js.map +1 -1
- package/dist/draft.d.ts +37 -0
- package/dist/draft.d.ts.map +1 -1
- package/dist/draft.js +87 -4
- package/dist/draft.js.map +1 -1
- package/dist/fs.d.ts +14 -1
- package/dist/fs.d.ts.map +1 -1
- package/dist/fs.js +7 -1
- package/dist/fs.js.map +1 -1
- package/dist/index.d.ts +116 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +565 -53
- package/dist/index.js.map +1 -1
- package/dist/internal/timing-safe-equal.d.ts +16 -0
- package/dist/internal/timing-safe-equal.d.ts.map +1 -0
- package/dist/internal/timing-safe-equal.js +26 -0
- package/dist/internal/timing-safe-equal.js.map +1 -0
- package/dist/isr.d.ts.map +1 -1
- package/dist/isr.js +1 -14
- package/dist/isr.js.map +1 -1
- package/dist/llms-txt.d.ts.map +1 -1
- package/dist/llms-txt.js +12 -6
- package/dist/llms-txt.js.map +1 -1
- package/dist/manifest.d.ts +51 -8
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +130 -14
- package/dist/manifest.js.map +1 -1
- package/dist/module-graph.d.ts +91 -0
- package/dist/module-graph.d.ts.map +1 -0
- package/dist/module-graph.js +92 -0
- package/dist/module-graph.js.map +1 -0
- package/dist/plugins/css-modules.d.ts.map +1 -1
- package/dist/plugins/css-modules.js +0 -0
- package/dist/plugins/css-modules.js.map +1 -1
- package/dist/plugins/vite-leak-guard.d.ts +45 -0
- package/dist/plugins/vite-leak-guard.d.ts.map +1 -0
- package/dist/plugins/vite-leak-guard.js +67 -0
- package/dist/plugins/vite-leak-guard.js.map +1 -0
- package/dist/public-dir.d.ts +36 -0
- package/dist/public-dir.d.ts.map +1 -0
- package/dist/public-dir.js +89 -0
- package/dist/public-dir.js.map +1 -0
- package/dist/route-manifest.d.ts +91 -0
- package/dist/route-manifest.d.ts.map +1 -0
- package/dist/route-manifest.js +128 -0
- package/dist/route-manifest.js.map +1 -0
- package/dist/router.d.ts +64 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +114 -31
- package/dist/router.js.map +1 -1
- package/dist/vite.d.ts +10 -4
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +44 -12
- package/dist/vite.js.map +1 -1
- package/package.json +17 -2
- package/src/build-vite.ts +606 -0
- package/src/build.ts +432 -73
- package/src/bun-dev-entry.ts +184 -0
- package/src/client.ts +8 -0
- package/src/deferred.ts +13 -6
- package/src/dev-port.ts +63 -0
- package/src/dev.ts +467 -65
- package/src/draft.ts +116 -4
- package/src/fs.ts +22 -4
- package/src/index.ts +727 -57
- package/src/internal/timing-safe-equal.ts +24 -0
- package/src/isr.ts +1 -13
- package/src/llms-txt.ts +13 -5
- package/src/manifest.ts +188 -13
- package/src/module-graph.ts +146 -0
- package/src/plugins/css-modules.ts +0 -0
- package/src/plugins/vite-leak-guard.ts +110 -0
- package/src/public-dir.ts +108 -0
- package/src/route-manifest.ts +240 -0
- package/src/router.ts +198 -34
- package/src/vite.ts +62 -20
package/dist/draft.js
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* createWebApp({ ..., draftSecret: env.DRAFT_SECRET }) // → loaders get ctx.draft
|
|
15
15
|
* withISR(app, { ..., draftSecret: env.DRAFT_SECRET }) // → editors bypass the cache
|
|
16
16
|
*/
|
|
17
|
-
import { parseCookies, signValue, unsignValue } from "@nifrajs/core/server";
|
|
17
|
+
import { parseCookies, serializeCookie, signValue, unsignValue, } from "@nifrajs/core/server";
|
|
18
|
+
import { timingSafeEqual } from "./internal/timing-safe-equal.js";
|
|
18
19
|
/** The cookie name nifra uses for draft/preview mode. */
|
|
19
20
|
export const DRAFT_COOKIE = "__nifra_draft";
|
|
20
21
|
// The signed cookie's payload is a fixed marker — a *valid signature* (not the value) is the signal
|
|
@@ -27,15 +28,27 @@ const DRAFT_MARKER = "1";
|
|
|
27
28
|
*/
|
|
28
29
|
export async function enableDraft(c, secret, options = {}) {
|
|
29
30
|
const signed = await signValue(DRAFT_MARKER, secret);
|
|
31
|
+
c.set.cookie(DRAFT_COOKIE, signed, draftCookieOptions(options));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The attributes draft mode always sets. Shared by {@link enableDraft} (which writes through
|
|
35
|
+
* `c.set.cookie`) and {@link previewEndpoint} (which serializes its own `Set-Cookie`), so the two
|
|
36
|
+
* can't drift on the properties that make the cookie unforgeable and unreadable from JS.
|
|
37
|
+
*
|
|
38
|
+
* `secure` is resolved here rather than left to the caller: `serializeCookie` is pure and applies
|
|
39
|
+
* **no** security defaults, so the `previewEndpoint` path would silently emit a cookie without
|
|
40
|
+
* `Secure` — over plain HTTP that hands the draft cookie to any network observer. Passing it
|
|
41
|
+
* explicitly makes both paths identical instead of one inheriting a default the other never sees.
|
|
42
|
+
*/
|
|
43
|
+
function draftCookieOptions(options) {
|
|
30
44
|
// Explicit security attributes (don't lean on the context default): signed + HttpOnly + SameSite=Lax.
|
|
31
|
-
|
|
45
|
+
return {
|
|
32
46
|
httpOnly: true,
|
|
33
47
|
sameSite: "lax",
|
|
34
48
|
path: options.path ?? "/",
|
|
35
49
|
maxAge: options.maxAgeSeconds ?? 3600,
|
|
36
|
-
|
|
50
|
+
secure: options.secure ?? true,
|
|
37
51
|
};
|
|
38
|
-
c.set.cookie(DRAFT_COOKIE, signed, cookieOptions);
|
|
39
52
|
}
|
|
40
53
|
/** Turn draft mode **off**: clear the `__nifra_draft` cookie. Match the `path` used in `enableDraft`. */
|
|
41
54
|
export function disableDraft(c, options = {}) {
|
|
@@ -52,4 +65,74 @@ export async function isDraftEnabled(request, secret) {
|
|
|
52
65
|
return false;
|
|
53
66
|
return (await unsignValue(cookie, secret)) !== null;
|
|
54
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Accept only a same-site destination, or `null`.
|
|
70
|
+
*
|
|
71
|
+
* A redirect target that arrives in the query string is attacker-controlled: anyone can mint a link
|
|
72
|
+
* to your own preview route and choose where the editor lands. "Starts with `/`" is the check people
|
|
73
|
+
* write and it is not enough — `//evil.com` is a protocol-relative URL and `/\evil.com` is normalized
|
|
74
|
+
* to one by browsers, so both start with a slash and navigate off-site. Control characters are refused
|
|
75
|
+
* as well, since a newline in a `Location` header splits the response.
|
|
76
|
+
*/
|
|
77
|
+
function safeRedirectPath(value) {
|
|
78
|
+
if (!value.startsWith("/"))
|
|
79
|
+
return null;
|
|
80
|
+
if (value.startsWith("//") || value.startsWith("/\\"))
|
|
81
|
+
return null;
|
|
82
|
+
// Escaped rather than written literally: raw control bytes in source make the file read as binary
|
|
83
|
+
// to ordinary tooling (grep, diffs) and are one reformat away from being silently mangled.
|
|
84
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the point - this IS the check that refuses them.
|
|
85
|
+
if (/[\u0000-\u001f\u007f]/u.test(value))
|
|
86
|
+
return null;
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* A **preview / draft-mode entry point** — a `fetch` handler that checks a preview token, turns draft
|
|
91
|
+
* mode on, and redirects the editor to the page they wanted. `GET` with `?token=<secret>&to=/some/path`;
|
|
92
|
+
* mount it on a nifra route, e.g. `app.get("/api/preview", (c) => handler(c.req))`.
|
|
93
|
+
*
|
|
94
|
+
* This is the link-borne sibling of `revalidateEndpoint`. It exists because the alternative — telling
|
|
95
|
+
* you to gate the route yourself — means hand-rolling two checks that are easy to get subtly wrong and
|
|
96
|
+
* that fail silently when you do: the token compare must not exit early on the first wrong character,
|
|
97
|
+
* and the `?to=` destination must not be allowed to point off-site. Both are handled here.
|
|
98
|
+
*
|
|
99
|
+
* A CMS "Preview" button is a plain link, so the token has to ride the query string. That has a cost
|
|
100
|
+
* no endpoint can remove — the secret lands in server logs, the `Referer` header, and browser history.
|
|
101
|
+
* Use a preview token minted for that purpose, rotate it, and never reuse a token that grants anything
|
|
102
|
+
* beyond draft mode.
|
|
103
|
+
*
|
|
104
|
+
* Wrong or missing token → `401`; an off-site `to` → `400`; success → `302` with the signed cookie and
|
|
105
|
+
* `Cache-Control: no-store`, so no shared cache can ever replay one editor's draft session to a visitor.
|
|
106
|
+
*/
|
|
107
|
+
export function previewEndpoint(options) {
|
|
108
|
+
const tokenParam = options.tokenParam ?? "token";
|
|
109
|
+
const redirectParam = options.redirectParam ?? "to";
|
|
110
|
+
const fallbackPath = options.fallbackPath ?? "/";
|
|
111
|
+
// Fail at construction, not on the request that happens to omit `?to=`: a misconfigured fallback is
|
|
112
|
+
// a deploy-time mistake and should surface at boot rather than as a rare 400 in production.
|
|
113
|
+
if (safeRedirectPath(fallbackPath) === null) {
|
|
114
|
+
throw new Error(`[nifra] previewEndpoint fallbackPath must be a site-relative path, got ${JSON.stringify(fallbackPath)}`);
|
|
115
|
+
}
|
|
116
|
+
const cookieOptions = draftCookieOptions(options.cookie ?? {});
|
|
117
|
+
return async (request) => {
|
|
118
|
+
const url = new URL(request.url);
|
|
119
|
+
if (!timingSafeEqual(url.searchParams.get(tokenParam) ?? "", options.secret)) {
|
|
120
|
+
return Response.json({ ok: false, error: "unauthorized" }, { status: 401 });
|
|
121
|
+
}
|
|
122
|
+
const requested = url.searchParams.get(redirectParam);
|
|
123
|
+
const destination = requested === null ? fallbackPath : safeRedirectPath(requested);
|
|
124
|
+
if (destination === null) {
|
|
125
|
+
return Response.json({ ok: false, error: "invalid_redirect" }, { status: 400 });
|
|
126
|
+
}
|
|
127
|
+
const signed = await signValue(DRAFT_MARKER, options.draftSecret);
|
|
128
|
+
return new Response(null, {
|
|
129
|
+
status: 302,
|
|
130
|
+
headers: {
|
|
131
|
+
location: destination,
|
|
132
|
+
"set-cookie": serializeCookie(DRAFT_COOKIE, signed, cookieOptions),
|
|
133
|
+
"cache-control": "no-store",
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
}
|
|
55
138
|
//# sourceMappingURL=draft.js.map
|
package/dist/draft.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draft.js","sourceRoot":"","sources":["../src/draft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"draft.js","sourceRoot":"","sources":["../src/draft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAEL,YAAY,EACZ,eAAe,EACf,SAAS,EACT,WAAW,GACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEjE,yDAAyD;AACzD,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAA;AAE3C,oGAAoG;AACpG,iFAAiF;AACjF,MAAM,YAAY,GAAG,GAAG,CAAA;AAmBxB;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,CAAwC,EACxC,MAAc,EACd,UAA8B,EAAE;IAE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,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;QACnF,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;YACzB,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;QACjF,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;QACjE,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;YACxB,MAAM,EAAE,GAAG;YACX,OAAO,EAAE;gBACP,QAAQ,EAAE,WAAW;gBACrB,YAAY,EAAE,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,CAAC;gBAClE,eAAe,EAAE,UAAU;aAC5B;SACF,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC"}
|
package/dist/fs.d.ts
CHANGED
|
@@ -2,8 +2,21 @@ import { type Manifest } from "./manifest.js";
|
|
|
2
2
|
/** Options for {@link discoverRoutes}. */
|
|
3
3
|
export interface DiscoverRoutesOptions {
|
|
4
4
|
/** Appended (as `?<importQuery>`) to each route's dynamic import — the dev server sets a
|
|
5
|
-
* changing value to bust Bun's module cache so SSR picks up edited route files.
|
|
5
|
+
* changing value to bust Bun's module cache so SSR picks up edited route files. Ignored when
|
|
6
|
+
* {@link load} is supplied, which does its own cache handling. */
|
|
6
7
|
readonly importQuery?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Load a route module by its absolute path, instead of a bare dynamic `import()`.
|
|
10
|
+
*
|
|
11
|
+
* This is what lets a pipeline own SSR resolution. A bare `import()` always resolves through the
|
|
12
|
+
* RUNTIME - Bun - so the Vite dev server ended up serving the client while Bun resolved the server,
|
|
13
|
+
* two resolvers disagreeing about one specifier in a single process. That is the dual-React bug and
|
|
14
|
+
* the reason `resolve.dedupe` never reached SSR: the alias governs Vite, and SSR never asked Vite.
|
|
15
|
+
*
|
|
16
|
+
* Pass `vite.ssrLoadModule` here and the Vite pipeline resolves both halves. Omit it and Bun does,
|
|
17
|
+
* which is correct for the Bun pipeline. Either way one toolchain owns the phase.
|
|
18
|
+
*/
|
|
19
|
+
readonly load?: (absolutePath: string) => Promise<unknown>;
|
|
7
20
|
}
|
|
8
21
|
/** Scan a `routes/` directory (recursively) and build the route manifest. */
|
|
9
22
|
export declare function discoverRoutes(dir: string, options?: DiscoverRoutesOptions): Manifest;
|
package/dist/fs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"AAMA,OAAO,EAAiB,KAAK,QAAQ,EAAoB,MAAM,eAAe,CAAA;AAE9E,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC;
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"AAMA,OAAO,EAAiB,KAAK,QAAQ,EAAoB,MAAM,eAAe,CAAA;AAE9E,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC;;sEAEkE;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC3D;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,QAAQ,CAczF"}
|
package/dist/fs.js
CHANGED
|
@@ -19,6 +19,12 @@ export function discoverRoutes(dir, options = {}) {
|
|
|
19
19
|
.map((file) => file.replaceAll("\\", "/")) // normalize Windows separators
|
|
20
20
|
.filter((file) => /\.(tsx|jsx|svelte|vue|mdx)$/.test(file));
|
|
21
21
|
const query = options.importQuery ? `?${options.importQuery}` : "";
|
|
22
|
-
|
|
22
|
+
const load = options.load;
|
|
23
|
+
return buildManifest(files, (file) => load === undefined
|
|
24
|
+
? () => import(__rewriteRelativeImportExtension(`${dir}/${file}${query}`))
|
|
25
|
+
: // No `importQuery` here: an injected loader owns its own invalidation (Vite's module graph
|
|
26
|
+
// re-evaluates on change), and appending a cache-buster would defeat it by minting a new
|
|
27
|
+
// module id per request.
|
|
28
|
+
() => load(`${dir}/${file}`));
|
|
23
29
|
}
|
|
24
30
|
//# sourceMappingURL=fs.js.map
|
package/dist/fs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,aAAa,EAAmC,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,aAAa,EAAmC,MAAM,eAAe,CAAA;AAsB9E,6EAA6E;AAC7E,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,UAAiC,EAAE;IAC7E,MAAM,KAAK,GAAI,WAAW,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAc;SAC9D,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,+BAA+B;SACzE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC7D,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAClE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IACzB,OAAO,aAAa,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CACnC,IAAI,KAAK,SAAS;QAChB,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,kCAAC,GAAG,GAAG,IAAI,IAAI,GAAG,KAAK,EAAE,EAAyB;QAChE,CAAC,CAAC,2FAA2F;YAC3F,yFAAyF;YACzF,yBAAyB;YACzB,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE,CAAyB,CACzD,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,13 +11,14 @@ import { server } from "@nifrajs/core/server";
|
|
|
11
11
|
import { type Deferred, defer } from "./deferred.js";
|
|
12
12
|
import type { LinkDescriptor, Manifest, Meta, MetaArgs, MetaInput, ScriptDescriptor } from "./manifest.js";
|
|
13
13
|
import { type Submission } from "./router.js";
|
|
14
|
-
export { DRAFT_COOKIE, type DraftCookieControls, disableDraft, type EnableDraftOptions, enableDraft, isDraftEnabled, } from "./draft.js";
|
|
14
|
+
export { DRAFT_COOKIE, type DraftCookieControls, disableDraft, type EnableDraftOptions, enableDraft, isDraftEnabled, type PreviewEndpointOptions, previewEndpoint, } from "./draft.js";
|
|
15
15
|
export { type FontDisplay, type FontFace, type FontPreloadInput, type FontSource, fontFace, fontPreload, } from "./fonts.js";
|
|
16
16
|
export { type CachedResponse, type CacheStore, ISR_REVALIDATE_HEADER, ISR_STATUS_HEADER, type ISRApp, type ISROptions, type ISRPlatform, KVCacheStore, type KVCacheStoreOptions, type KVNamespaceLike, MemoryCacheStore, type MemoryCacheStoreOptions, type RevalidateEndpointOptions, revalidateEndpoint, withISR, } from "./isr.js";
|
|
17
17
|
export { type Action, buildManifest, enumerateStaticRoutes, filePathToPattern, filePathToPatterns, type GetStaticPaths, type LayoutEntry, type LinkDescriptor, type Loader, type LoaderContext, type Manifest, type Meta, type MetaArgs, type MetaInput, type RouteEntry, type RouteModule, type ScriptDescriptor, type StaticPath, type StaticPaths, type StaticRoutes, } from "./manifest.js";
|
|
18
18
|
export { type BrowserNavigate, getBrowserNavigate, type NavigateOptions, setBrowserNavigate, } from "./navigation.js";
|
|
19
|
+
export { type PublicDirCache, resolvePublicPath, type ServePublicDirOptions, servePublicDir, } from "./public-dir.js";
|
|
19
20
|
export { createMutation, createQueryClient, type DehydratedState, hashQueryKey, type InfiniteData, type InfiniteQueryHandle, type InfiniteQueryOptions, type MutationCallbacks, type MutationHandle, type MutationState, type MutationStatus, type QueryClient, type QueryClientOptions, type QueryHandle, type QueryOptions, type QueryState, type QueryStatus, } from "./query.js";
|
|
20
|
-
export { type ClientRouter, type ClientRouterOptions, createClientRouter, createMatcher, DATA_HEADER, type Fetcher, type FetcherState, type FetchRouteData, type MountRouterOptions, REDIRECT_HEADER, REVALIDATE_HEADER, type RouteMatch, type RoutePattern, type RouterState, type Submission, type SubmitOptions, } from "./router.js";
|
|
21
|
+
export { type ClientRouter, type ClientRouterOptions, createClientRouter, createMatcher, DATA_HEADER, type Fetcher, type FetcherState, type FetchRouteData, type MountRouterOptions, NAV_FROM_HEADER, REDIRECT_HEADER, RETAIN_HEADER, REVALIDATE_HEADER, type RouteMatch, type RoutePattern, type RouterState, STATUS_HEADER, type Submission, type SubmitOptions, } from "./router.js";
|
|
21
22
|
export { type Deferred, defer };
|
|
22
23
|
/** Phantom brand key for {@link ServerOnly}. A unique symbol so the brand can't be forged by a plain
|
|
23
24
|
* object literal; `unique symbol` keys never appear in the emitted JS, so the brand is purely
|
|
@@ -54,6 +55,14 @@ export { assertRenderAdapterConformance, RenderAdapterConformanceError, type Ren
|
|
|
54
55
|
* (absent on SSR): they drive **optimistic UI** — render from `submission.formData` while `pending`. */
|
|
55
56
|
export interface RenderProps {
|
|
56
57
|
readonly data: unknown;
|
|
58
|
+
/**
|
|
59
|
+
* Per-layout loader data, aligned index-for-index with the layout prefix of `chain`.
|
|
60
|
+
*
|
|
61
|
+
* Absent when no layout in the chain exports a `loader`, so a page-only app is byte-identical to
|
|
62
|
+
* before. An adapter that does not read it renders exactly as it did; one that does passes
|
|
63
|
+
* `layoutData[i]` to `chain[i]`.
|
|
64
|
+
*/
|
|
65
|
+
readonly layoutData?: readonly unknown[];
|
|
57
66
|
readonly actionData?: unknown;
|
|
58
67
|
/** True while a client navigation or submit is in flight (client-only; absent/false on SSR). */
|
|
59
68
|
readonly pending?: boolean;
|
|
@@ -106,6 +115,9 @@ export interface RenderAdapter {
|
|
|
106
115
|
}
|
|
107
116
|
/** Global the server serializes loader data into; the client reads it to hydrate. */
|
|
108
117
|
export declare const DATA_GLOBAL = "__NIFRA_DATA__";
|
|
118
|
+
/** Per-layout loader data for hydration. Emitted ONLY when some layout in the chain has a loader, so
|
|
119
|
+
* a page-only app's HTML is byte-identical to before layout loaders existed. */
|
|
120
|
+
export declare const LAYOUT_DATA_GLOBAL = "__NIFRA_LAYOUT_DATA__";
|
|
109
121
|
/** Global the server writes the matched route id into; the client uses it to pick the chain. */
|
|
110
122
|
export declare const ROUTE_GLOBAL = "__NIFRA_ROUTE__";
|
|
111
123
|
/** Global the server serializes an action's data return into (absent on GETs); the client
|
|
@@ -177,8 +189,15 @@ export interface RenderPageOptions {
|
|
|
177
189
|
* `useLocation`/`useSearchParams` render the right URL server-side and hydrate without drift. Omit ⇒
|
|
178
190
|
* `""`. */
|
|
179
191
|
readonly path?: string;
|
|
192
|
+
/** Per-layout loader data, forwarded to the adapter as `RenderProps.layoutData`. Aligned with the
|
|
193
|
+
* chain's layout prefix; omitted when no layout in the chain has a loader. */
|
|
194
|
+
readonly layoutData?: readonly unknown[];
|
|
180
195
|
/** HTTP status for the response (default 200; e.g. 404 for a not-found page). */
|
|
181
196
|
readonly status?: number;
|
|
197
|
+
/** Extra response headers - e.g. the `cache-control` a terminal status page wants. `content-type`
|
|
198
|
+
* is ignored (the document is always HTML) and the ISR freshness header is applied after these,
|
|
199
|
+
* so neither can be overridden from here. */
|
|
200
|
+
readonly headers?: HeadersLike;
|
|
182
201
|
/** Document title (fallback when `head.title` is unset). */
|
|
183
202
|
readonly title?: string;
|
|
184
203
|
/** Resolved route head — `title` overrides `title` above; `meta`/`link` render as managed
|
|
@@ -237,6 +256,61 @@ export interface RedirectOptions {
|
|
|
237
256
|
* @param options redirect status and whether an off-origin destination is intentional.
|
|
238
257
|
*/
|
|
239
258
|
export declare function redirect(location: string, options?: RedirectOptions): Response;
|
|
259
|
+
/**
|
|
260
|
+
* Brand marking a `Response` as a **terminal-status signal** rather than a response to serve verbatim.
|
|
261
|
+
*
|
|
262
|
+
* A loader that throws a bare `Response` has always been passed straight through - that is how
|
|
263
|
+
* `throw redirect(...)` works, and apps rely on it. So "render the `_404` boundary at 404" cannot be
|
|
264
|
+
* expressed by throwing a plain `Response`: the framework would have no way to tell it apart from a
|
|
265
|
+
* hand-rolled body the app wants served exactly as written. The brand is that distinction, and
|
|
266
|
+
* checking it *before* the pass-through is what keeps every existing throw working unchanged.
|
|
267
|
+
*
|
|
268
|
+
* `Symbol.for` matches `RESPONSE_RESULT` above: a registry symbol survives two copies of this module,
|
|
269
|
+
* which a `unique symbol` would not - and a duplicate-install turning a 404 into a raw 404 body would
|
|
270
|
+
* be a maddening bug to trace.
|
|
271
|
+
*/
|
|
272
|
+
/** Derived from the `Headers` constructor rather than the DOM lib's `HeadersInit`: `@nifrajs/web`
|
|
273
|
+
* is consumed from DOM-free programs (the root tsconfig runs `types: ["bun"]`), and naming the DOM
|
|
274
|
+
* type here would break their build. Same workaround as `SSEInit.headers` in core. */
|
|
275
|
+
type HeadersLike = ConstructorParameters<typeof Headers>[0];
|
|
276
|
+
/** Options shared by {@link notFound}, {@link gone}, and {@link statusPage}. */
|
|
277
|
+
export interface StatusPageOptions {
|
|
278
|
+
/**
|
|
279
|
+
* Extra headers for the rendered response - `cache-control` above all.
|
|
280
|
+
*
|
|
281
|
+
* The defaults differ by status for a reason: a 404 may be a race with publication, so it wants a
|
|
282
|
+
* short TTL, while a 410 is a promise that the URL is permanently gone and can be cached hard.
|
|
283
|
+
* Getting this wrong is the difference between a crawler dropping a dead URL and re-fetching it
|
|
284
|
+
* for weeks.
|
|
285
|
+
*/
|
|
286
|
+
readonly headers?: HeadersLike;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Render the nearest `_404` page at status **404**. `throw` it from a loader when the record does not
|
|
290
|
+
* exist.
|
|
291
|
+
*
|
|
292
|
+
* This is the fix for the soft 404: a matched route whose loader finds nothing has otherwise no way to
|
|
293
|
+
* answer 404, so the path of least resistance is to return empty data and render "not found" inside a
|
|
294
|
+
* **200**. That looks correct in a browser and is invisible in review, which is why it ships and stays
|
|
295
|
+
* shipped - while search engines penalise it and keep the dead URL indexed.
|
|
296
|
+
*
|
|
297
|
+
* Returns `never`: these throw, so a loader narrows without a redundant `return`, and the type states
|
|
298
|
+
* the thing the "loaders `throw` redirect, actions `return` it" rule already trips people on.
|
|
299
|
+
*/
|
|
300
|
+
export declare function notFound(options?: StatusPageOptions): never;
|
|
301
|
+
/**
|
|
302
|
+
* Render a terminal page at status **410 Gone**. `throw` it from a loader for a record that existed and
|
|
303
|
+
* was deliberately removed - a withdrawn listing, a deleted post.
|
|
304
|
+
*
|
|
305
|
+
* 410 is not a pedantic 404: it tells a crawler to **drop** the URL rather than re-fetch it for weeks
|
|
306
|
+
* on the assumption the 404 was transient. Uses `_410.tsx` if the app has one, otherwise `_404`.
|
|
307
|
+
*/
|
|
308
|
+
export declare function gone(options?: StatusPageOptions): never;
|
|
309
|
+
/**
|
|
310
|
+
* Render a terminal page at any 4xx/5xx status - the escape hatch behind {@link notFound} and
|
|
311
|
+
* {@link gone} (402, 451, …). Uses `_<status>.tsx` if present, otherwise `_404`.
|
|
312
|
+
*/
|
|
313
|
+
export declare function statusPage(status: number, options?: StatusPageOptions): never;
|
|
240
314
|
/** The wrapper `revalidate()` returns: the action's `data` plus the paths it changed. A plain tagged
|
|
241
315
|
* shape (not a class) so `@nifrajs/client`'s `ActionData` can unwrap it structurally without importing
|
|
242
316
|
* from `@nifrajs/web`. `createWebApp` strips the wrapper — the client receives `data` as the body and
|
|
@@ -347,6 +421,35 @@ export interface CreateWebAppOptions {
|
|
|
347
421
|
* auto-mount entirely (the app serves pages only and `api` stays a loader-only `ctx.api`). Mounting
|
|
348
422
|
* is also a no-op when `api` does not expose the symbol mount. */
|
|
349
423
|
readonly apiPrefix?: string;
|
|
424
|
+
/**
|
|
425
|
+
* Strip {@link apiPrefix} from the pathname before dispatching to `api` (default `false`).
|
|
426
|
+
*
|
|
427
|
+
* The default suits a backend that declares FULL paths (`server().post("/api/sync", …)`), which is
|
|
428
|
+
* right when it is only ever mounted here. Set this when the backend declares its routes WITHOUT the
|
|
429
|
+
* prefix because it also runs standalone behind its own shell, so its paths cannot carry a prefix that
|
|
430
|
+
* only exists when it is mounted. Without it every request 404s inside the backend, and the workaround
|
|
431
|
+
* is a `Proxy` that rewrites each URL.
|
|
432
|
+
*/
|
|
433
|
+
readonly apiStrip?: boolean;
|
|
434
|
+
/**
|
|
435
|
+
* Sub-apps mounted ahead of page routing - an auth handler, a webhook receiver, a stack's routes.
|
|
436
|
+
*
|
|
437
|
+
* Structural on purpose: anything with `{ path, app: { fetch } }` fits, so a library that exposes its
|
|
438
|
+
* routes as such a list mounts as `mounts: theirRoutes` without `@nifrajs/web` taking a dependency on
|
|
439
|
+
* it. `better-auth` is the motivating case - it is not a `backend` route, so `/api/auth/*` used to 404
|
|
440
|
+
* silently.
|
|
441
|
+
*
|
|
442
|
+
* Tried longest-path-first and BEFORE the `api` mount, so a mount at `/api/auth` wins over a backend
|
|
443
|
+
* at `/api` no matter which was declared first. `stripPrefix` is the per-mount form of {@link apiStrip}:
|
|
444
|
+
* leave it off to pass the full path through.
|
|
445
|
+
*/
|
|
446
|
+
readonly mounts?: ReadonlyArray<{
|
|
447
|
+
readonly path: string;
|
|
448
|
+
readonly app: {
|
|
449
|
+
fetch(request: Request): Response | Promise<Response>;
|
|
450
|
+
};
|
|
451
|
+
readonly stripPrefix?: boolean;
|
|
452
|
+
}>;
|
|
350
453
|
/** Secret for **draft / preview mode** (see `enableDraft`). When set, a request carrying a valid
|
|
351
454
|
* signed `__nifra_draft` cookie gets `ctx.draft === true` in loaders/actions (else always `false`).
|
|
352
455
|
* Pair with `withISR({ draftSecret })` so editors bypass the cache. Omit to disable draft mode. */
|
|
@@ -401,8 +504,16 @@ export interface CreateWebAppOptions {
|
|
|
401
504
|
*/
|
|
402
505
|
export declare function createWebApp<Env = unknown>(options: CreateWebAppOptions): ReturnType<typeof server<Env>>;
|
|
403
506
|
export interface GenerateClientEntryOptions {
|
|
404
|
-
/**
|
|
405
|
-
* `"@nifrajs/web-solid/client"`.
|
|
507
|
+
/**
|
|
508
|
+
* Module specifier for the adapter's client runtime, e.g. `"@nifrajs/web-solid/client"`.
|
|
509
|
+
*
|
|
510
|
+
* **Contract:** the module MUST export `mountRouter({ router, routes, container })`. The generated
|
|
511
|
+
* bootstrap imports the specifier and calls it — so a self-executing entry that mounts on import
|
|
512
|
+
* builds cleanly and then does nothing, which is the trap this contract exists to name. The type is
|
|
513
|
+
* a bare `string` because a specifier is resolved by the bundler, not the type system, so the
|
|
514
|
+
* requirement is enforced by the bootstrap instead: it throws immediately, naming this module and
|
|
515
|
+
* the missing export, rather than failing later as `mountRouter is not a function`.
|
|
516
|
+
*/
|
|
406
517
|
readonly clientModule: string;
|
|
407
518
|
/** Turn a route/layout source file (relative to the routes dir) into an import specifier. */
|
|
408
519
|
readonly resolve: (file: string) => string;
|
|
@@ -442,7 +553,7 @@ export interface GenerateServerManifestOptions {
|
|
|
442
553
|
* Codegen: emit a **server manifest** module (as source) for disk-less edge runtimes (Cloudflare
|
|
443
554
|
* Workers, …) — and, with a `target`, any portable server bundle. `discoverRoutes` scans `node:fs`
|
|
444
555
|
* and dynamic-imports each route by a *runtime* path — neither exists on workerd. This instead emits
|
|
445
|
-
* **statically-analyzable** imports of every route/layout/`_error
|
|
556
|
+
* **statically-analyzable** imports of every route/layout/`_error`/terminal status page (so the bundler includes them) and
|
|
446
557
|
* rebuilds the manifest with `buildManifest` — the SAME pure logic `discoverRoutes` feeds, so patterns
|
|
447
558
|
* + layout chains are identical. Eager (`import * as`) by default; `lazy` emits `() => import(...)` so
|
|
448
559
|
* a code-splitting bundler chunks per route. The emitted module exports `manifest` (consumed by
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,EAIN,MAAM,eAAe,CAAA;AAItB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,EAIN,MAAM,eAAe,CAAA;AAItB,OAAO,KAAK,EAGV,cAAc,EAEd,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,SAAS,EAGT,gBAAgB,EACjB,MAAM,eAAe,CAAA;AACtB,OAAO,EASL,KAAK,UAAU,EAChB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,YAAY,EACZ,KAAK,kBAAkB,EACvB,WAAW,EACX,cAAc,EACd,KAAK,sBAAsB,EAC3B,eAAe,GAChB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,QAAQ,EACR,WAAW,GACZ,MAAM,YAAY,CAAA;A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