@stratal/inertia 0.0.22 → 0.0.23

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.
@@ -0,0 +1,123 @@
1
+ //#region src/seo/build-seo-tags.ts
2
+ /**
3
+ * Marker attribute stamped on every SEO-managed head element. The server emits
4
+ * it on injected tags and the client head-sync runtime uses it to find and
5
+ * reconcile the same tags across SPA navigations.
6
+ */
7
+ const DATA_SEO_ATTR = "data-seo";
8
+ /**
9
+ * Maps resolved {@link SeoData} into a flat list of {@link SeoTagDescriptor}s.
10
+ *
11
+ * Pure and framework-free: used server-side to render HTML strings and
12
+ * client-side to build DOM nodes, so the two never drift. Every descriptor
13
+ * carries the {@link DATA_SEO_ATTR} marker.
14
+ */
15
+ function buildSeoTags(data) {
16
+ const tags = [];
17
+ if (data.title != null) tags.push({
18
+ tag: "title",
19
+ attrs: {},
20
+ content: data.title
21
+ });
22
+ meta(tags, { name: "description" }, data.description);
23
+ meta(tags, { name: "keywords" }, Array.isArray(data.keywords) ? data.keywords.join(", ") : data.keywords);
24
+ meta(tags, { name: "author" }, data.author);
25
+ meta(tags, { name: "robots" }, data.robots);
26
+ if (data.canonical != null) tags.push({
27
+ tag: "link",
28
+ attrs: {
29
+ rel: "canonical",
30
+ href: data.canonical
31
+ }
32
+ });
33
+ const og = data.openGraph;
34
+ if (og) {
35
+ metaProp(tags, "og:title", og.title);
36
+ metaProp(tags, "og:description", og.description);
37
+ metaProp(tags, "og:image", og.image);
38
+ metaProp(tags, "og:type", og.type);
39
+ metaProp(tags, "og:url", og.url);
40
+ metaProp(tags, "og:site_name", og.siteName);
41
+ }
42
+ const tw = data.twitter;
43
+ if (tw) {
44
+ meta(tags, { name: "twitter:card" }, tw.card);
45
+ meta(tags, { name: "twitter:title" }, tw.title);
46
+ meta(tags, { name: "twitter:description" }, tw.description);
47
+ meta(tags, { name: "twitter:image" }, tw.image);
48
+ meta(tags, { name: "twitter:site" }, tw.site);
49
+ meta(tags, { name: "twitter:creator" }, tw.creator);
50
+ }
51
+ if (data.meta) for (const entry of data.meta) {
52
+ const attrs = {};
53
+ if (entry.name != null) attrs.name = entry.name;
54
+ if (entry.property != null) attrs.property = entry.property;
55
+ attrs.content = entry.content;
56
+ tags.push({
57
+ tag: "meta",
58
+ attrs
59
+ });
60
+ }
61
+ if (data.link) for (const entry of data.link) {
62
+ const attrs = {};
63
+ for (const [key, value] of Object.entries(entry)) if (isSafeAttrName(key)) attrs[key] = value;
64
+ tags.push({
65
+ tag: "link",
66
+ attrs
67
+ });
68
+ }
69
+ for (const t of tags) t.attrs[DATA_SEO_ATTR] = "";
70
+ return tags;
71
+ }
72
+ /**
73
+ * Valid HTML attribute name. Used to drop any attribute whose name (e.g. a key
74
+ * spread from a user-supplied custom `meta`/`link` entry) could otherwise break
75
+ * out of the tag and inject markup — attribute values are escaped, but names are
76
+ * emitted verbatim, so an unsafe name like `x onload=…` must be rejected.
77
+ */
78
+ const VALID_ATTR_NAME = /^[A-Za-z_:][\w.:-]*$/;
79
+ /**
80
+ * A valid attribute name that is also not an inline event handler. Even with a
81
+ * well-formed name and an escaped value, `on*` attributes execute JS, so a
82
+ * user-supplied `onload`/`onerror`/… key must never be emitted.
83
+ */
84
+ function isSafeAttrName(name) {
85
+ return VALID_ATTR_NAME.test(name) && !/^on/i.test(name);
86
+ }
87
+ /** Renders a descriptor to an HTML string with attribute/text escaping (server-side). */
88
+ function descriptorToHtml(d) {
89
+ const attrs = Object.entries(d.attrs).filter(([key]) => isSafeAttrName(key)).map(([key, value]) => value === "" ? key : `${key}="${escapeAttr(value)}"`).join(" ");
90
+ const open = attrs ? `${d.tag} ${attrs}` : d.tag;
91
+ if (d.tag === "title") return `<title ${attrs}>${escapeText(d.content ?? "")}</title>`;
92
+ return `<${open} />`;
93
+ }
94
+ function meta(tags, attrs, content) {
95
+ if (content == null) return;
96
+ tags.push({
97
+ tag: "meta",
98
+ attrs: {
99
+ ...attrs,
100
+ content
101
+ }
102
+ });
103
+ }
104
+ function metaProp(tags, property, content) {
105
+ if (content == null) return;
106
+ tags.push({
107
+ tag: "meta",
108
+ attrs: {
109
+ property,
110
+ content
111
+ }
112
+ });
113
+ }
114
+ function escapeAttr(value) {
115
+ return value.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
116
+ }
117
+ function escapeText(value) {
118
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
119
+ }
120
+ //#endregion
121
+ export { buildSeoTags as n, descriptorToHtml as r, DATA_SEO_ATTR as t };
122
+
123
+ //# sourceMappingURL=build-seo-tags-DBsHKxX9.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-seo-tags-DBsHKxX9.mjs","names":[],"sources":["../src/seo/build-seo-tags.ts"],"sourcesContent":["import type { SeoData, SeoTagDescriptor } from './types'\n\n/**\n * Marker attribute stamped on every SEO-managed head element. The server emits\n * it on injected tags and the client head-sync runtime uses it to find and\n * reconcile the same tags across SPA navigations.\n */\nexport const DATA_SEO_ATTR = 'data-seo'\n\n/**\n * Maps resolved {@link SeoData} into a flat list of {@link SeoTagDescriptor}s.\n *\n * Pure and framework-free: used server-side to render HTML strings and\n * client-side to build DOM nodes, so the two never drift. Every descriptor\n * carries the {@link DATA_SEO_ATTR} marker.\n */\nexport function buildSeoTags(data: SeoData): SeoTagDescriptor[] {\n const tags: SeoTagDescriptor[] = []\n\n if (data.title != null) {\n tags.push({ tag: 'title', attrs: {}, content: data.title })\n }\n\n meta(tags, { name: 'description' }, data.description)\n meta(tags, { name: 'keywords' }, Array.isArray(data.keywords) ? data.keywords.join(', ') : data.keywords)\n meta(tags, { name: 'author' }, data.author)\n meta(tags, { name: 'robots' }, data.robots)\n\n if (data.canonical != null) {\n tags.push({ tag: 'link', attrs: { rel: 'canonical', href: data.canonical } })\n }\n\n const og = data.openGraph\n if (og) {\n metaProp(tags, 'og:title', og.title)\n metaProp(tags, 'og:description', og.description)\n metaProp(tags, 'og:image', og.image)\n metaProp(tags, 'og:type', og.type)\n metaProp(tags, 'og:url', og.url)\n metaProp(tags, 'og:site_name', og.siteName)\n }\n\n const tw = data.twitter\n if (tw) {\n meta(tags, { name: 'twitter:card' }, tw.card)\n meta(tags, { name: 'twitter:title' }, tw.title)\n meta(tags, { name: 'twitter:description' }, tw.description)\n meta(tags, { name: 'twitter:image' }, tw.image)\n meta(tags, { name: 'twitter:site' }, tw.site)\n meta(tags, { name: 'twitter:creator' }, tw.creator)\n }\n\n if (data.meta) {\n for (const entry of data.meta) {\n const attrs: Record<string, string> = {}\n if (entry.name != null) attrs.name = entry.name\n if (entry.property != null) attrs.property = entry.property\n attrs.content = entry.content\n tags.push({ tag: 'meta', attrs })\n }\n }\n\n if (data.link) {\n for (const entry of data.link) {\n const attrs: Record<string, string> = {}\n // Custom link entries carry arbitrary keys; drop any whose name isn't a\n // safe attribute so a crafted key can't break out of the tag (server),\n // throw from `setAttribute` (client head-sync), or smuggle in an inline\n // event handler (`<link rel=… onload=…>` fires for some rel values).\n for (const [key, value] of Object.entries(entry)) {\n if (isSafeAttrName(key)) attrs[key] = value\n }\n tags.push({ tag: 'link', attrs })\n }\n }\n\n // Stamp the marker on every descriptor.\n for (const t of tags) {\n t.attrs[DATA_SEO_ATTR] = ''\n }\n\n return tags\n}\n\n/**\n * Valid HTML attribute name. Used to drop any attribute whose name (e.g. a key\n * spread from a user-supplied custom `meta`/`link` entry) could otherwise break\n * out of the tag and inject markup — attribute values are escaped, but names are\n * emitted verbatim, so an unsafe name like `x onload=…` must be rejected.\n */\nconst VALID_ATTR_NAME = /^[A-Za-z_:][\\w.:-]*$/\n\n/**\n * A valid attribute name that is also not an inline event handler. Even with a\n * well-formed name and an escaped value, `on*` attributes execute JS, so a\n * user-supplied `onload`/`onerror`/… key must never be emitted.\n */\nfunction isSafeAttrName(name: string): boolean {\n return VALID_ATTR_NAME.test(name) && !/^on/i.test(name)\n}\n\n/** Renders a descriptor to an HTML string with attribute/text escaping (server-side). */\nexport function descriptorToHtml(d: SeoTagDescriptor): string {\n const attrs = Object.entries(d.attrs)\n .filter(([key]) => isSafeAttrName(key))\n .map(([key, value]) => (value === '' ? key : `${key}=\"${escapeAttr(value)}\"`))\n .join(' ')\n const open = attrs ? `${d.tag} ${attrs}` : d.tag\n\n if (d.tag === 'title') {\n return `<title ${attrs}>${escapeText(d.content ?? '')}</title>`\n }\n return `<${open} />`\n}\n\nfunction meta(tags: SeoTagDescriptor[], attrs: Record<string, string>, content: string | undefined): void {\n if (content == null) return\n tags.push({ tag: 'meta', attrs: { ...attrs, content } })\n}\n\nfunction metaProp(tags: SeoTagDescriptor[], property: string, content: string | undefined): void {\n if (content == null) return\n tags.push({ tag: 'meta', attrs: { property, content } })\n}\n\nfunction escapeAttr(value: string): string {\n return value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;')\n}\n\nfunction escapeText(value: string): string {\n return value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')\n}\n"],"mappings":";;;;;;AAOA,MAAa,gBAAgB;;;;;;;;AAS7B,SAAgB,aAAa,MAAmC;CAC9D,MAAM,OAA2B,CAAC;CAElC,IAAI,KAAK,SAAS,MAChB,KAAK,KAAK;EAAE,KAAK;EAAS,OAAO,CAAC;EAAG,SAAS,KAAK;CAAM,CAAC;CAG5D,KAAK,MAAM,EAAE,MAAM,cAAc,GAAG,KAAK,WAAW;CACpD,KAAK,MAAM,EAAE,MAAM,WAAW,GAAG,MAAM,QAAQ,KAAK,QAAQ,IAAI,KAAK,SAAS,KAAK,IAAI,IAAI,KAAK,QAAQ;CACxG,KAAK,MAAM,EAAE,MAAM,SAAS,GAAG,KAAK,MAAM;CAC1C,KAAK,MAAM,EAAE,MAAM,SAAS,GAAG,KAAK,MAAM;CAE1C,IAAI,KAAK,aAAa,MACpB,KAAK,KAAK;EAAE,KAAK;EAAQ,OAAO;GAAE,KAAK;GAAa,MA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decorate(decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,4 +1,4 @@
1
- import { n as runTypeGeneration } from "../type-generator-bfo14BJI.mjs";
1
+ import { n as runTypeGeneration } from "../type-generator-DFpha_Fp.mjs";
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
  //#region src/generator/type-generator.worker.ts
4
4
  async function main() {
@@ -1 +1 @@
1
- {"version":3,"file":"type-generator.worker.mjs","names":[],"sources":["../../src/generator/type-generator.worker.ts"],"sourcesContent":["import { parentPort, workerData } from 'node:worker_threads'\nimport { runTypeGeneration } from './type-generator'\n\ninterface WorkerInput {\n cwd: string\n}\n\nasync function main() {\n if (!parentPort) {\n throw new Error('[stratal:inertia-types] worker spawned without a parent port')\n }\n\n const { cwd } = workerData as WorkerInput\n\n try {\n const { outputPath, pageCount } = await runTypeGeneration(cwd)\n parentPort.postMessage({ ok: true, outputPath, pageCount })\n } catch (error) {\n parentPort.postMessage({\n ok: false,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n}\n\nvoid main()\n"],"mappings":";;;AAOA,eAAe,OAAO;CACpB,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,+DAA+D;CAGjF,MAAM,EAAE,QAAQ;CAEhB,IAAI;EACF,MAAM,EAAE,YAAY,cAAc,MAAM,kBAAkB,IAAI;EAC9D,WAAW,YAAY;GAAE,IAAI;GAAM;GAAY;GAAW,CAAC;UACpD,OAAO;EACd,WAAW,YAAY;GACrB,IAAI;GACJ,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;GAC9D,CAAC;;;AAID,MAAM"}
1
+ {"version":3,"file":"type-generator.worker.mjs","names":[],"sources":["../../src/generator/type-generator.worker.ts"],"sourcesContent":["import { parentPort, workerData } from 'node:worker_threads'\nimport { runTypeGeneration } from './type-generator'\n\ninterface WorkerInput {\n cwd: string\n}\n\nasync function main() {\n if (!parentPort) {\n throw new Error('[stratal:inertia-types] worker spawned without a parent port')\n }\n\n const { cwd } = workerData as WorkerInput\n\n try {\n const { outputPath, pageCount } = await runTypeGeneration(cwd)\n parentPort.postMessage({ ok: true, outputPath, pageCount })\n } catch (error) {\n parentPort.postMessage({\n ok: false,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n}\n\nvoid main()\n"],"mappings":";;;AAOA,eAAe,OAAO;CACpB,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,8DAA8D;CAGhF,MAAM,EAAE,QAAQ;CAEhB,IAAI;EACF,MAAM,EAAE,YAAY,cAAc,MAAM,kBAAkB,GAAG;EAC7D,WAAW,YAAY;GAAE,IAAI;GAAM;GAAY;EAAU,CAAC;CAC5D,SAAS,OAAO;EACd,WAAW,YAAY;GACrB,IAAI;GACJ,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAC9D,CAAC;CACH;AACF;AAEK,KAAK"}
package/dist/index.d.mts CHANGED
@@ -1,12 +1,13 @@
1
1
  /// <reference path="../global.d.ts" />
2
+ import { C as SeoMetaTag, E as SeoTwitter, S as SeoLinkTag, T as SeoTagDescriptor, _ as ResolvedInertiaPageProps, a as InertiaMergeProp, b as ViteManifestEntry, c as InertiaOptionalProp, d as InertiaPageRegistry, f as InertiaRenderOptions, g as InertiaTranslationKeys, h as InertiaSsrResult, i as InertiaI18nConfig, l as InertiaPage, m as InertiaSsrBundle, n as InertiaDeferredProp, o as InertiaMergeStrategy, p as InertiaSharedProps, r as InertiaFullPageProps, s as InertiaOnceProp, t as InertiaAlwaysProp, u as InertiaPageComponent, v as SharedDataResolver, w as SeoOpenGraph, x as SeoData, y as ViteManifest } from "./types--_iJ04lT.mjs";
2
3
  import { ExceptionHandler } from "stratal/errors";
3
4
  import { AsyncModuleOptions, DynamicModule, OnException, OnInitialize } from "stratal/module";
4
5
  import { Middleware, Next, RouteConfig, RouteConfigurable, Router, RouterContext } from "stratal/router";
6
+ import { Container } from "stratal/di";
5
7
  import { MessageKeyPrefix } from "stratal/i18n";
6
8
  import { LoggerService } from "stratal/logger";
7
9
  import { z } from "stratal/validation";
8
- import { InertiaAppSSRResponse, Page, Page as InertiaPage, SharedPageProps } from "@inertiajs/core";
9
- import { ContentfulStatusCode } from "hono/utils/http-status";
10
+ import { InertiaAppSSRResponse, Page } from "@inertiajs/core";
10
11
  import { CookieOptions } from "hono/utils/cookie";
11
12
 
12
13
  //#region src/flash/flash-store.d.ts
@@ -67,6 +68,56 @@ interface InertiaI18nOptions {
67
68
  interface InertiaFlashOptions {
68
69
  store: FlashStore;
69
70
  }
71
+ /**
72
+ * Configuration for backend-driven SEO metadata.
73
+ *
74
+ * Set on {@link InertiaModuleOptions.seo}. Controllers contribute per-page
75
+ * metadata via `ctx.seo()`; the module merges it over these defaults, applies
76
+ * the title template, injects the resulting tags into `<head>`, and shares the
77
+ * resolved data as the `seo` prop. The client head stays in sync automatically
78
+ * via the runtime the `stratalInertia()` Vite plugin injects; read the data in a
79
+ * component with `useSeo()` from `@stratal/inertia/react`.
80
+ *
81
+ * Both `defaults` and `titleTemplate` accept a static value or a `ctx`-aware
82
+ * resolver function (optionally async), so they can pull from the database or
83
+ * elsewhere for personalization — mirroring {@link InertiaModuleOptions.sharedData}.
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * InertiaModule.forRoot({
88
+ * rootView,
89
+ * seo: {
90
+ * defaults: { openGraph: { siteName: 'Acme' }, twitter: { card: 'summary_large_image' } },
91
+ * titleTemplate: '%s — Acme',
92
+ * },
93
+ * })
94
+ *
95
+ * // Dynamic / personalized:
96
+ * InertiaModule.forRoot({
97
+ * rootView,
98
+ * seo: {
99
+ * titleTemplate: async (title, ctx) => `${title} — ${(await ctx.user()).name}'s Workspace`,
100
+ * },
101
+ * })
102
+ * ```
103
+ */
104
+ interface InertiaSeoOptions {
105
+ /**
106
+ * App-wide default SEO metadata, merged under each page's `ctx.seo()` values.
107
+ * Provide a static object or a (possibly async) resolver receiving the request `ctx`.
108
+ */
109
+ defaults?: SeoData | ((ctx: RouterContext) => SeoData | Promise<SeoData>);
110
+ /**
111
+ * Template applied to a page-provided title. The string form replaces `%s`
112
+ * with the page title (e.g. `'%s — Acme'`); a bare default title is used as-is.
113
+ * The function form receives the resolved title (possibly `undefined` when no
114
+ * page or default title is set) and the request `ctx`, and returns the final
115
+ * title (full control, may be async). Return `undefined` to leave the title
116
+ * unset — useful for conditionally skipping the template (e.g. for a subset of
117
+ * routes that build their own title).
118
+ */
119
+ titleTemplate?: string | ((title: string | undefined, ctx: RouterContext) => string | undefined | Promise<string | undefined>);
120
+ }
70
121
  interface InertiaModuleOptions {
71
122
  rootView: string;
72
123
  version?: string;
@@ -104,6 +155,12 @@ interface InertiaModuleOptions {
104
155
  * ```
105
156
  */
106
157
  routes?: boolean;
158
+ /**
159
+ * SEO configuration: app-wide defaults and a title template for backend-driven
160
+ * page metadata. Pages set their metadata via `ctx.seo()`; the frontend reads
161
+ * it with `<Seo/>` / `useSeo()` from `@stratal/inertia/react`.
162
+ */
163
+ seo?: InertiaSeoOptions;
107
164
  /**
108
165
  * Client entry path relative to project root (default: `src/inertia/app.tsx`).
109
166
  * Used in dev mode to inject the entry script tag.
@@ -119,6 +176,20 @@ declare class InertiaModule implements RouteConfigurable, OnInitialize, OnExcept
119
176
  onException(handler: ExceptionHandler): void;
120
177
  onInitialize(): void;
121
178
  private isInertiaRequest;
179
+ /**
180
+ * GET/HEAD requests are idempotent navigations — including Inertia deferred
181
+ * partial reloads, which fetch deferred props over a follow-up XHR that still
182
+ * carries `X-Inertia: true`.
183
+ *
184
+ * Such requests must NOT use the flash-errors + redirect-back convention: the
185
+ * redirect points back at the very URL that just threw, so an error raised
186
+ * while resolving a deferred prop would redirect → re-request → throw again
187
+ * in an infinite loop (`ERR_TOO_MANY_REDIRECTS`). For these we fall through to
188
+ * the errorPage pipeline, which renders `Errors/${status}` in place as an
189
+ * Inertia response. Redirect-back stays for mutations (POST/PUT/PATCH/DELETE),
190
+ * where it drives the post-submit form-error flow.
191
+ */
192
+ private isReadRequest;
122
193
  private isPrecognitionRequest;
123
194
  private handlePrecognitionValidationError;
124
195
  private createPrecognitionErrorResponse;
@@ -132,70 +203,27 @@ declare const INERTIA_TOKENS: {
132
203
  readonly TemplateService: symbol;
133
204
  readonly ManifestService: symbol;
134
205
  readonly SsrRenderer: symbol;
206
+ readonly HreflangService: symbol;
207
+ readonly SeoService: symbol;
135
208
  };
136
209
  //#endregion
137
- //#region src/types.d.ts
138
- interface InertiaPageRegistry {}
139
- type InertiaSharedProps = SharedPageProps;
140
- type InertiaPageComponent = keyof InertiaPageRegistry extends never ? string : Extract<keyof InertiaPageRegistry, string>;
141
- type AllowInertiaWrappers<T> = { [K in keyof T]: T[K] | InertiaDeferredProp | InertiaMergeProp | InertiaOptionalProp | InertiaOnceProp | InertiaAlwaysProp };
142
- type ResolvedInertiaPageProps<C extends InertiaPageComponent> = C extends keyof InertiaPageRegistry ? AllowInertiaWrappers<InertiaPageRegistry[C]> : Record<string, unknown>;
143
- type InertiaFullPageProps<C extends InertiaPageComponent> = (C extends keyof InertiaPageRegistry ? InertiaPageRegistry[C] : Record<string, unknown>) & InertiaSharedProps;
144
- interface InertiaRenderOptions {
145
- encryptHistory?: boolean;
146
- clearHistory?: boolean;
147
- preserveFragment?: boolean;
148
- /**
149
- * HTTP status code to use for the rendered response. Defaults to `200`.
150
- * Useful for rendering Inertia error pages (e.g. `Errors/404` with status 404).
151
- */
152
- status?: ContentfulStatusCode;
153
- }
154
- type InertiaSsrResult = InertiaAppSSRResponse;
155
- interface InertiaSsrBundle {
156
- render(page: Page): Promise<InertiaSsrResult>;
157
- }
158
- type SharedDataResolver = (ctx: RouterContext) => any;
159
- interface ViteManifestEntry {
160
- file: string;
161
- css?: string[];
162
- isEntry?: boolean;
163
- imports?: string[];
164
- dynamicImports?: string[];
165
- src?: string;
166
- }
167
- type ViteManifest = Record<string, ViteManifestEntry>;
168
- declare const INERTIA_PROP_OPTIONAL: unique symbol;
169
- declare const INERTIA_PROP_DEFERRED: unique symbol;
170
- declare const INERTIA_PROP_MERGE: unique symbol;
171
- declare const INERTIA_PROP_ONCE: unique symbol;
172
- declare const INERTIA_PROP_ALWAYS: unique symbol;
173
- interface InertiaOptionalProp<T = unknown> {
174
- [INERTIA_PROP_OPTIONAL]: true;
175
- callback: () => T;
176
- }
177
- interface InertiaDeferredProp<T = unknown> {
178
- [INERTIA_PROP_DEFERRED]: true;
179
- callback: () => T;
180
- group: string;
181
- }
182
- type InertiaMergeStrategy = 'append' | 'prepend' | 'deep';
183
- interface InertiaMergeProp<T = unknown> {
184
- [INERTIA_PROP_MERGE]: true;
185
- callback: () => T;
186
- strategy: InertiaMergeStrategy;
187
- matchOn?: string;
188
- }
189
- interface InertiaOnceProp<T = unknown> {
190
- [INERTIA_PROP_ONCE]: true;
191
- callback: () => T;
192
- expiresAt?: number | null;
193
- key?: string;
194
- }
195
- interface InertiaAlwaysProp<T = unknown> {
196
- [INERTIA_PROP_ALWAYS]: true;
197
- callback: () => T;
198
- }
210
+ //#region src/seo/build-seo-tags.d.ts
211
+ /**
212
+ * Marker attribute stamped on every SEO-managed head element. The server emits
213
+ * it on injected tags and the client head-sync runtime uses it to find and
214
+ * reconcile the same tags across SPA navigations.
215
+ */
216
+ declare const DATA_SEO_ATTR = "data-seo";
217
+ /**
218
+ * Maps resolved {@link SeoData} into a flat list of {@link SeoTagDescriptor}s.
219
+ *
220
+ * Pure and framework-free: used server-side to render HTML strings and
221
+ * client-side to build DOM nodes, so the two never drift. Every descriptor
222
+ * carries the {@link DATA_SEO_ATTR} marker.
223
+ */
224
+ declare function buildSeoTags(data: SeoData): SeoTagDescriptor[];
225
+ /** Renders a descriptor to an HTML string with attribute/text escaping (server-side). */
226
+ declare function descriptorToHtml(d: SeoTagDescriptor): string;
199
227
  //#endregion
200
228
  //#region src/flash/cookie-flash-store.d.ts
201
229
  interface CookieFlashStoreOptions {
@@ -238,11 +266,90 @@ declare module 'stratal/router' {
238
266
  always<T>(callback: () => T): InertiaAlwaysProp<T>;
239
267
  /** Sets a flash data entry that will be available on the next page visit. */
240
268
  flash(key: string, value: unknown): void;
269
+ /**
270
+ * Adds a shared prop to the current request, available on every Inertia page
271
+ * rendered during this request. Useful for middleware and packages that want
272
+ * to contribute data to the frontend without a controller passing it through.
273
+ */
274
+ share(key: string, value: unknown): void;
275
+ /**
276
+ * Sets SEO metadata (title, description, Open Graph, Twitter, etc.) for the
277
+ * page rendered in this request. Merges with module-level defaults and any
278
+ * earlier `seo()` calls. The resolved tags are injected into `<head>` and
279
+ * shared as the `seo` prop; the client head is kept in sync automatically
280
+ * by the runtime the `stratalInertia()` Vite plugin injects.
281
+ */
282
+ seo(data: SeoData): void;
241
283
  /** Disables server-side rendering for the current request. */
242
284
  withoutSsr(): void;
243
285
  }
244
286
  }
245
287
  //#endregion
288
+ //#region src/services/hreflang.service.d.ts
289
+ /**
290
+ * Produces `rel="alternate" hreflang="…"` link descriptors for the SEO pipeline.
291
+ *
292
+ * Activated when i18n detection produces URL-distinct locale variants:
293
+ * - `path` strategy with ≥2 locales → locale-prefixed pathname variants
294
+ * - `querystring` strategy with ≥2 locales → `?locale=xx` variants
295
+ *
296
+ * Returns `[]` for cookie/header strategies (no URL distinction) and for
297
+ * single-locale apps. Emits an additional `x-default` link pointing at the
298
+ * default-locale URL.
299
+ *
300
+ * The descriptors are merged into the resolved {@link SeoData} by
301
+ * {@link import('./seo.service').SeoService}, so hreflang rides the same
302
+ * `<head>` injection (initial render) and client reconciliation (SPA
303
+ * navigation) as the rest of the SEO tags — no separate head path.
304
+ *
305
+ * Every generated `href` runs through {@link applyTrailingSlash} with the
306
+ * app-wide mode so hreflang URLs match the canonical form the rest of the
307
+ * router emits.
308
+ */
309
+ declare class HreflangService {
310
+ private readonly container;
311
+ constructor(container: Container);
312
+ buildLinks(currentUrl: URL): SeoLinkTag[];
313
+ private buildPathLinks;
314
+ private buildQuerystringLinks;
315
+ private compose;
316
+ private composeQuery;
317
+ private linkTag;
318
+ }
319
+ //#endregion
320
+ //#region src/services/seo.service.d.ts
321
+ /**
322
+ * Request-scoped accumulator for page SEO metadata.
323
+ *
324
+ * Controllers (and middleware) call `ctx.seo()` to contribute metadata; at
325
+ * render time {@link InertiaService} resolves it against the module-level
326
+ * defaults and title template, shares the result as the `seo` prop, and injects
327
+ * the rendered tags into `<head>`.
328
+ */
329
+ declare class SeoService {
330
+ private readonly options;
331
+ private readonly hreflang;
332
+ private accumulated;
333
+ constructor(options: InertiaModuleOptions, hreflang: HreflangService);
334
+ /** Merges the given metadata into the request's accumulated SEO data. */
335
+ set(data: SeoData): void;
336
+ /**
337
+ * Resolves the final SEO data: module defaults (base) merged with the
338
+ * request's accumulated data, then the title template applied. Resolver
339
+ * functions for `defaults`/`titleTemplate` are awaited with the request `ctx`.
340
+ * Locale-aware `hreflang` alternates are appended last so they ride the same
341
+ * head injection and SPA reconciliation as the rest of the SEO tags.
342
+ *
343
+ * The resolved `title` is ALWAYS a string (falling back to `''`). This makes
344
+ * the `<title>` descriptor deterministic: every navigation — including to a
345
+ * page with no SEO — produces a title, so the client head-sync sets
346
+ * `document.title` rather than leaving the previous page's title stale.
347
+ */
348
+ resolve(ctx: RouterContext): Promise<SeoData>;
349
+ /** Renders resolved SEO data into a list of head-tag HTML strings. */
350
+ tagsFor(resolved: SeoData): string[];
351
+ }
352
+ //#endregion
246
353
  //#region src/services/ssr-renderer.service.d.ts
247
354
  declare class SsrRendererService {
248
355
  private readonly options;
@@ -279,9 +386,11 @@ declare class InertiaService {
279
386
  private readonly options;
280
387
  private readonly template;
281
388
  private readonly ssr;
389
+ private readonly seoService;
282
390
  private sharedData;
283
- constructor(options: InertiaModuleOptions, template: TemplateService, ssr: SsrRendererService);
391
+ constructor(options: InertiaModuleOptions, template: TemplateService, ssr: SsrRendererService, seoService: SeoService);
284
392
  share(key: string, value: unknown): void;
393
+ seo(data: SeoData): void;
285
394
  location(url: string): Response;
286
395
  optional<T>(callback: () => T): InertiaOptionalProp<T>;
287
396
  defer<T>(callback: () => T, group?: string): InertiaDeferredProp<T>;
@@ -431,5 +540,5 @@ declare module 'stratal/router' {
431
540
  }
432
541
  }
433
542
  //#endregion
434
- export { CookieFlashStore, type FlashStore, HandlePrecognitiveRequests, INERTIA_TOKENS, type InertiaAlwaysProp, type InertiaDeferredProp, InertiaDelete, type InertiaFlashOptions, type InertiaFullPageProps, InertiaGet, type InertiaI18nOptions, type InertiaMergeProp, type InertiaMergeStrategy, InertiaMiddleware, InertiaModule, type InertiaModuleOptions, type InertiaOnceProp, type InertiaOptionalProp, type InertiaPage, type InertiaPageComponent, type InertiaPageRegistry, InertiaPatch, InertiaPost, InertiaPut, type InertiaRenderOptions, InertiaRoute, type InertiaRouteConfig, InertiaService, type InertiaSharedProps, type InertiaSsrBundle, type InertiaSsrOptions, type InertiaSsrResult, ManifestService, type ResolvedInertiaPageProps, type SharedDataResolver, SsrRendererService, TemplateService, type ViteManifest, type ViteManifestEntry };
543
+ export { CookieFlashStore, DATA_SEO_ATTR, type FlashStore, HandlePrecognitiveRequests, INERTIA_TOKENS, type InertiaAlwaysProp, type InertiaDeferredProp, InertiaDelete, type InertiaFlashOptions, type InertiaFullPageProps, InertiaGet, type InertiaI18nConfig, type InertiaI18nOptions, type InertiaMergeProp, type InertiaMergeStrategy, InertiaMiddleware, InertiaModule, type InertiaModuleOptions, type InertiaOnceProp, type InertiaOptionalProp, type InertiaPage, type InertiaPageComponent, type InertiaPageRegistry, InertiaPatch, InertiaPost, InertiaPut, type InertiaRenderOptions, InertiaRoute, type InertiaRouteConfig, type InertiaSeoOptions, InertiaService, type InertiaSharedProps, type InertiaSsrBundle, type InertiaSsrOptions, type InertiaSsrResult, type InertiaTranslationKeys, ManifestService, type ResolvedInertiaPageProps, type SeoData, type SeoLinkTag, type SeoMetaTag, type SeoOpenGraph, SeoService, type SeoTagDescriptor, type SeoTwitter, type SharedDataResolver, SsrRendererService, TemplateService, type ViteManifest, type ViteManifestEntry, buildSeoTags, descriptorToHtml };
435
544
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/flash/flash-store.ts","../src/inertia.options.ts","../src/inertia.module.ts","../src/inertia.tokens.ts","../src/types.ts","../src/flash/cookie-flash-store.ts","../src/augment/router-context.ts","../src/services/ssr-renderer.service.ts","../src/services/manifest.service.ts","../src/services/template.service.ts","../src/services/inertia.service.ts","../src/decorators/inertia.decorators.ts","../src/middleware/handle-precognitive-requests.middleware.ts","../src/middleware/inertia.middleware.ts","../src/augment/router-variables.ts"],"mappings":";;;;;;;;;;;UAEiB,UAAA;EACf,IAAA,CAAK,GAAA,EAAK,aAAA,GAAgB,OAAA,CAAQ,MAAA;EAClC,KAAA,CAAM,GAAA,EAAK,aAAA,EAAe,IAAA,EAAM,MAAA,oBAA0B,OAAA;EAC1D,KAAA,CAAM,GAAA,EAAK,aAAA,GAAgB,OAAA;AAAA;;;UCDnB,eAAA;EACR,MAAA,CAAO,IAAA,EAAM,IAAA,GAAO,OAAA,CAAQ,qBAAA;AAAA;AAAA,UAGb,iBAAA;EACf,MAAA,QAAc,OAAA,CAAQ,eAAA;IAAoB,OAAA,EAAS,eAAA;EAAA;;ADPrD;;;ECYE,QAAA;AAAA;;;;;;;;;;;;;;;;;UAmBe,kBAAA;ED7BW;;;;;;;;;;;ACFyB;;;;EA+CnD,IAAA,GAAO,gBAAA;AAAA;AAAA,UAGQ,mBAAA;EACf,KAAA,EAAO,UAAA;AAAA;AAAA,UAGQ,oBAAA;EACf,QAAA;EACA,OAAA;EACA,GAAA,GAAM,iBAAA;EACN,KAAA,GAAQ,mBAAA;EACR,UAAA,GAAa,MAAA;EArDE;;;;;;;;;;;;;;EAoEf,IAAA,GAAO,kBAAA;EA9DC;AAmBV;;;;;AAmBA;;;;;AAIA;;;;EAoCE,MAAA;EA/Ba;;;;EAoCb,eAAA;AAAA;;;c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AAA,UAAA,UAAA,EAAA,kBAAA,KAAA,kBAAA;;;;;;;;AV1D5D;;;;;;;;;;;;;;;;AAyBA;;iBU8DgB,UAAA,CAAW,IAAA,UAAc,MAAA,GAAQ,kBAAA,IAAuB,MAAA,UAAA,WAAA,UAAA,UAAA,EAAA,kBAAA,KAAA,kBAAA;;;AV3CxE;;;;;AAIA;;iBUoDgB,WAAA,CAAY,IAAA,UAAc,MAAA,GAAQ,kBAAA,IAAuB,MAAA,UAAA,WAAA,UAAA,UAAA,EAAA,kBAAA,KAAA,kBAAA;;;;;;;;;;iBAazD,UAAA,CAAW,IAAA,UAAc,MAAA,GAAQ,kBAAA,IAAuB,MAAA,UAAA,WAAA,UAAA,UAAA,EAAA,kBAAA,KAAA,kBAAA;;;;;;;;;;iBAaxD,YAAA,CAAa,IAAA,UAAc,MAAA,GAAQ,kBAAA,IAAuB,MAAA,UAAA,WAAA,UAAA,UAAA,EAAA,kBAAA,KAAA,kBAAA;;;;ATzH1E;;;;;;iBSsIgB,aAAA,CAAc,IAAA,UAAc,MAAA,GAAQ,kBAAA,IAAuB,MAAA,UAAA,WAAA,UAAA,UAAA,EAAA,kBAAA,KAAA,kBAAA;;;cC/I9D,0BAAA,YAAsC,UAAA;EAC3C,MAAA,CAAO,GAAA,EAAK,aAAA,EAAe,IAAA,EAAM,IAAA,GAAO,OAAA;AAAA;;;cCCnC,iBAAA,YAA6B,UAAA;EAAA,iBAEW,OAAA;cAAA,OAAA,EAAS,oBAAA;EAGtD,MAAA,CAAO,GAAA,EAAK,aAAA,EAAe,IAAA,EAAM,IAAA,GAAO,OAAA;AAAA;;;;YCVpC,eAAA;IACR,OAAA;IACA,eAAA;IACA,YAAA;IACA,UAAA;IACA,YAAA,EAAc,MAAA;IACd,eAAA,EAAiB,MAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/flash/flash-store.ts","../src/inertia.options.ts","../src/inertia.module.ts","../src/inertia.tokens.ts","../src/seo/build-seo-tags.ts","../src/flash/cookie-flash-store.ts","../src/augment/router-context.ts","../src/services/hreflang.service.ts","../src/services/seo.service.ts","../src/services/ssr-renderer.service.ts","../src/services/manifest.service.ts","../src/services/template.service.ts","../src/services/inertia.service.ts","../src/decorators/inertia.decorators.ts","../src/middleware/handle-precognitive-requests.middleware.ts","../src/middleware/inertia.middleware.ts","../src/augment/router-variables.ts"],"mappings":";;;;;;;;;;;;UAEiB,UAAA;EACf,IAAA,CAAK,GAAA,EAAK,aAAA,GAAgB,OAAA,CAAQ,MAAA;EAClC,KAAA,CAAM,GAAA,EAAK,aAAA,EAAe,IAAA,EAAM,MAAA,oBAA0B,OAAA;EAC1D,KAAA,CAAM,GAAA,EAAK,aAAA,GAAgB,OAAA;AAAA;;;UCCnB,eAAA;EACR,MAAA,CAAO,IAAA,EAAM,IAAA,GAAO,OAAA,CAAQ,qBAAA;AAAA;AAAA,UAGb,iBAAA;EACf,MAAA,QAAc,OAAA,CAAQ,eAAA;IAAoB,OAAA,EAAS,eAAA;EAAA;EDTpC;;;;ECcf,QAAA;AAAA;;;;;;;;;;;;;;;;;UAmBe,kBAAA;ED/B2C;;;;;;AACxB;;;;ACDM;;;;;EA+CxC,IAAA,GAAO,gBAAgB;AAAA;AAAA,UAGR,mBAAA;EACf,KAAA,EAAO,UAAU;AAAA;;;;;AAhDgC;AAGnD;;;;;;;;;;;;;;;AAMU;AAmBV;;;;AAgByB;AAGzB;;;;AACmB;AAoCnB;;UAAiB,iBAAA;EAKJ;;;;EAAX,QAAA,GAAW,OAAA,KAAY,GAAA,EAAK,aAAA,KAAkB,OAAA,GAAU,OAAA,CAAQ,OAAA;EAY1B;;;;;;;;;EAFtC,aAAA,cAEM,KAAA,sBAA2B,GAAA,EAAK,aAAA,0BAAuC,OAAA;AAAA;AAAA,UAG9D,oBAAA;EACf,QAAA;EACA,OAAA;EACA,GAAA,GAAM,iBAAA;EACN,KAAA,GAAQ,mBAAA;EACR,UAAA,GAAa,MAAA;EARuE;AAGtF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