singularity-core 0.14.1 → 0.15.3

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.
@@ -29,8 +29,20 @@ export type ContentSecurityPolicyOptions = {
29
29
  */
30
30
  export declare function buildContentSecurityPolicy({ nonce, dev, extraSources, }: ContentSecurityPolicyOptions): string;
31
31
  /**
32
- * Response headers every page should send: HSTS, framing, sniffing, referrer
33
- * and permissions, plus the CSP when one is given.
32
+ * Response headers every page should send: HSTS, framing, sniffing,
33
+ * referrer, permissions and cross-origin isolation, plus the CSP when one
34
+ * is given.
35
+ *
36
+ * `X-XSS-Protection: 0` is for security scanners that flag the header as
37
+ * missing. Browsers have dropped the XSS auditor it controlled (the CSP does
38
+ * that job), and `0` is the safe value: `1; mode=block` let old browsers
39
+ * leak data across sites.
40
+ *
41
+ * COOP `same-origin` keeps cross-origin windows out of the page's browsing
42
+ * context group. COEP is `credentialless`, not `require-corp`: the maps'
43
+ * OpenStreetMap tiles and the QR code images send no
44
+ * Cross-Origin-Resource-Policy, so `require-corp` would block them, while
45
+ * `credentialless` loads them without cookies and still isolates the page.
34
46
  */
35
47
  export declare function securityHeaders(contentSecurityPolicy?: string): Record<string, string>;
36
48
  /** A fresh nonce for one request's CSP: 16 random bytes, base64. */
@@ -44,7 +56,11 @@ export declare function generateCspNonce(): string;
44
56
  export declare function getCspNonce(): string | undefined;
45
57
  /**
46
58
  * `securityHeaders` for the current request, with a nonce CSP when the
47
- * request has a nonce. For a root route's `headers`.
59
+ * request has a nonce. For a root route's `headers`. Also `Cache-Control:
60
+ * private, no-cache`: the page carries this request's nonce (and often the
61
+ * visitor's session or settings), so no shared cache may keep it and the
62
+ * browser asks again each time. An app that wants `no-store` spreads this
63
+ * and sets its own.
48
64
  */
49
65
  export declare function requestSecurityHeaders(options: Omit<ContentSecurityPolicyOptions, "nonce">): Record<string, string>;
50
66
  export {};
@@ -51,16 +51,57 @@ export function buildContentSecurityPolicy({ nonce, dev, extraSources = {}, }) {
51
51
  ].join("; ");
52
52
  }
53
53
  /**
54
- * Response headers every page should send: HSTS, framing, sniffing, referrer
55
- * and permissions, plus the CSP when one is given.
54
+ * Browser features no Filion page uses, each switched off for the page and
55
+ * every frame in it, so injected script or a compromised frame cannot ask
56
+ * for them. Left on: clipboard (the tools' copy buttons), fullscreen (the
57
+ * games), autoplay (game sound, admin speech) and passkeys. Only names
58
+ * Chrome knows, since it reports unknown ones as console errors.
59
+ * `browsing-topics` opts the pages out of Chrome's Topics ad API.
60
+ */
61
+ const DISABLED_FEATURES = [
62
+ "accelerometer",
63
+ "browsing-topics",
64
+ "camera",
65
+ "display-capture",
66
+ "geolocation",
67
+ "gyroscope",
68
+ "hid",
69
+ "idle-detection",
70
+ "magnetometer",
71
+ "microphone",
72
+ "midi",
73
+ "payment",
74
+ "screen-wake-lock",
75
+ "serial",
76
+ "usb",
77
+ "xr-spatial-tracking",
78
+ ];
79
+ /**
80
+ * Response headers every page should send: HSTS, framing, sniffing,
81
+ * referrer, permissions and cross-origin isolation, plus the CSP when one
82
+ * is given.
83
+ *
84
+ * `X-XSS-Protection: 0` is for security scanners that flag the header as
85
+ * missing. Browsers have dropped the XSS auditor it controlled (the CSP does
86
+ * that job), and `0` is the safe value: `1; mode=block` let old browsers
87
+ * leak data across sites.
88
+ *
89
+ * COOP `same-origin` keeps cross-origin windows out of the page's browsing
90
+ * context group. COEP is `credentialless`, not `require-corp`: the maps'
91
+ * OpenStreetMap tiles and the QR code images send no
92
+ * Cross-Origin-Resource-Policy, so `require-corp` would block them, while
93
+ * `credentialless` loads them without cookies and still isolates the page.
56
94
  */
57
95
  export function securityHeaders(contentSecurityPolicy) {
58
96
  return {
59
97
  "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
60
98
  "X-Frame-Options": "SAMEORIGIN",
61
99
  "X-Content-Type-Options": "nosniff",
100
+ "X-XSS-Protection": "0",
62
101
  "Referrer-Policy": "strict-origin-when-cross-origin",
63
- "Permissions-Policy": "geolocation=(), camera=(), microphone=()",
102
+ "Permissions-Policy": DISABLED_FEATURES.map((feature) => `${feature}=()`).join(", "),
103
+ "Cross-Origin-Opener-Policy": "same-origin",
104
+ "Cross-Origin-Embedder-Policy": "credentialless",
64
105
  ...(contentSecurityPolicy
65
106
  ? { "Content-Security-Policy": contentSecurityPolicy }
66
107
  : {}),
@@ -93,9 +134,16 @@ export function getCspNonce() {
93
134
  }
94
135
  /**
95
136
  * `securityHeaders` for the current request, with a nonce CSP when the
96
- * request has a nonce. For a root route's `headers`.
137
+ * request has a nonce. For a root route's `headers`. Also `Cache-Control:
138
+ * private, no-cache`: the page carries this request's nonce (and often the
139
+ * visitor's session or settings), so no shared cache may keep it and the
140
+ * browser asks again each time. An app that wants `no-store` spreads this
141
+ * and sets its own.
97
142
  */
98
143
  export function requestSecurityHeaders(options) {
99
144
  const nonce = getCspNonce();
100
- return securityHeaders(nonce ? buildContentSecurityPolicy({ nonce, ...options }) : undefined);
145
+ return {
146
+ ...securityHeaders(nonce ? buildContentSecurityPolicy({ nonce, ...options }) : undefined),
147
+ "Cache-Control": "private, no-cache",
148
+ };
101
149
  }
@@ -11,6 +11,15 @@ export type SeoOptions = {
11
11
  twitterHandle?: string;
12
12
  /** `robots` meta, e.g. "noindex, nofollow" for an app behind a login. */
13
13
  robots?: string;
14
+ /** `author` meta: who wrote the page, or who publishes the site. */
15
+ author?: string;
16
+ /** `og:site_name`, the site's name as social cards show it. */
17
+ siteName?: string;
18
+ /** Alt text for `image`, as `og:image:alt` and `twitter:image:alt`. */
19
+ imageAlt?: string;
20
+ /** Pixel size of `image`, so a card can be laid out before it loads. */
21
+ imageWidth?: number;
22
+ imageHeight?: number;
14
23
  };
15
24
  export type SeoTag = {
16
25
  title: string;
@@ -24,9 +33,55 @@ export type SeoTag = {
24
33
  /**
25
34
  * Title, description and social card tags for a page's `head.meta`.
26
35
  * Open Graph tags use `property`, as the protocol expects; Twitter uses `name`.
27
- * Tags without content are left out.
36
+ * Tags without content are left out, and the image's alt text and size only
37
+ * come with an image.
28
38
  */
29
- export declare function seo({ title, description, keywords, image, type, url, twitterHandle, robots, }: SeoOptions): SeoTag[];
39
+ export declare function seo({ title, description, keywords, image, type, url, twitterHandle, robots, author, siteName, imageAlt, imageWidth, imageHeight, }: SeoOptions): SeoTag[];
40
+ /**
41
+ * A JSON-LD block for a route's `head.scripts`. The router writes `children`
42
+ * into the page as is, so `<` is escaped and no value can close the tag.
43
+ */
44
+ export declare function jsonLdScript(data: Record<string, unknown>): {
45
+ type: "application/ld+json";
46
+ children: string;
47
+ };
48
+ /**
49
+ * A page's canonical URL: `base` (the origin, plus the app's base path if it
50
+ * has one) and the path without query or trailing slash, so `/x/` points at
51
+ * `/x`. The app's own root keeps its slash: `https://filion.se/blog/`.
52
+ */
53
+ export declare function canonicalUrl(base: string, pathname: string): string;
54
+ /** The parts of a router match that decide a page's canonical URL. */
55
+ export type CanonicalMatch = {
56
+ routeId: string;
57
+ pathname: string;
58
+ status: string;
59
+ };
60
+ /**
61
+ * The canonical URL for a root route's `head`, from its `matches`: the
62
+ * deepest match's path under `base` (see `canonicalUrl`), or undefined for a
63
+ * 404 (only the root matched, or a route threw `notFound`). The root's
64
+ * `head` runs again on every navigation, so the link follows the page.
65
+ */
66
+ export declare function pageCanonicalUrl(base: string, matches: readonly CanonicalMatch[]): string | undefined;
67
+ /** One language version of a page: its BCP 47 tag ("en", "sv") and URL. */
68
+ export type LanguageAlternate = {
69
+ hrefLang: string;
70
+ /** Absolute URL of the page in that language. */
71
+ href: string;
72
+ };
73
+ /** An `hreflang` link for a route's `head.links`. */
74
+ export type HreflangLink = LanguageAlternate & {
75
+ rel: "alternate";
76
+ };
77
+ /**
78
+ * `hreflang` links for a page: one per language version, the page's own
79
+ * among them as search engines expect, plus `x-default` for visitors whose
80
+ * language none matches (`defaultHref`, else the first version). A
81
+ * single-language site passes one version, its canonical URL. No versions
82
+ * gives no links, as for a 404.
83
+ */
84
+ export declare function hreflangLinks(alternates: readonly LanguageAlternate[], defaultHref?: string | undefined): HreflangLink[];
30
85
  export type RobotsTxtOptions = {
31
86
  userAgent?: string;
32
87
  allow?: string[];
@@ -36,9 +91,19 @@ export type RobotsTxtOptions = {
36
91
  };
37
92
  /** robots.txt for one user agent. Serve with `plainTextResponse`. */
38
93
  export declare function buildRobotsTxt({ userAgent, allow, disallow, sitemap, }: RobotsTxtOptions): string;
94
+ /** One sitemap entry: an absolute URL, and when the page last changed. */
95
+ export type SitemapEntry = {
96
+ url: string;
97
+ /**
98
+ * The page's real last change, as an ISO 8601 date or date-time. Leave it
99
+ * out when there is none to give: a date that is not the page's real last
100
+ * change is worse than none.
101
+ */
102
+ lastmod?: string;
103
+ };
39
104
  /**
40
- * sitemap.xml listing each absolute URL once, in the order given. Serve with
41
- * `xmlResponse`. It has no `lastmod`: a date that is not the page's real last
42
- * change is worse than none.
105
+ * sitemap.xml listing each URL once, in the order given (the first entry for
106
+ * a URL wins). An entry is an absolute URL, or one with its `lastmod`. Serve
107
+ * with `xmlResponse`.
43
108
  */
44
- export declare function buildSitemapXml(urls: string[]): string;
109
+ export declare function buildSitemapXml(entries: Array<string | SitemapEntry>): string;
package/dist/seo/index.js CHANGED
@@ -1,14 +1,16 @@
1
1
  /**
2
2
  * Title, description and social card tags for a page's `head.meta`.
3
3
  * Open Graph tags use `property`, as the protocol expects; Twitter uses `name`.
4
- * Tags without content are left out.
4
+ * Tags without content are left out, and the image's alt text and size only
5
+ * come with an image.
5
6
  */
6
- export function seo({ title, description, keywords, image, type = "website", url, twitterHandle, robots, }) {
7
+ export function seo({ title, description, keywords, image, type = "website", url, twitterHandle, robots, author, siteName, imageAlt, imageWidth, imageHeight, }) {
7
8
  const tags = [
8
9
  { title },
9
10
  { name: "description", content: description },
10
11
  { name: "keywords", content: keywords },
11
12
  { name: "robots", content: robots },
13
+ { name: "author", content: author },
12
14
  { name: "twitter:title", content: title },
13
15
  { name: "twitter:description", content: description },
14
16
  { name: "twitter:creator", content: twitterHandle },
@@ -17,16 +19,74 @@ export function seo({ title, description, keywords, image, type = "website", url
17
19
  { property: "og:title", content: title },
18
20
  { property: "og:description", content: description },
19
21
  { property: "og:url", content: url },
22
+ { property: "og:site_name", content: siteName },
20
23
  ...(image
21
24
  ? [
22
25
  { name: "twitter:image", content: image },
26
+ { name: "twitter:image:alt", content: imageAlt },
23
27
  { name: "twitter:card", content: "summary_large_image" },
24
28
  { property: "og:image", content: image },
29
+ { property: "og:image:alt", content: imageAlt },
30
+ { property: "og:image:width", content: imageWidth?.toString() },
31
+ { property: "og:image:height", content: imageHeight?.toString() },
25
32
  ]
26
33
  : []),
27
34
  ];
28
35
  return tags.filter((tag) => !("content" in tag) || tag.content);
29
36
  }
37
+ /**
38
+ * A JSON-LD block for a route's `head.scripts`. The router writes `children`
39
+ * into the page as is, so `<` is escaped and no value can close the tag.
40
+ */
41
+ export function jsonLdScript(data) {
42
+ return {
43
+ type: "application/ld+json",
44
+ children: JSON.stringify(data).replace(/</g, "\\u003c"),
45
+ };
46
+ }
47
+ /**
48
+ * A page's canonical URL: `base` (the origin, plus the app's base path if it
49
+ * has one) and the path without query or trailing slash, so `/x/` points at
50
+ * `/x`. The app's own root keeps its slash: `https://filion.se/blog/`.
51
+ */
52
+ export function canonicalUrl(base, pathname) {
53
+ const root = base.replace(/\/+$/, "");
54
+ const path = pathname.replace(/\/+$/, "");
55
+ return path ? `${root}${path}` : `${root}/`;
56
+ }
57
+ /**
58
+ * The canonical URL for a root route's `head`, from its `matches`: the
59
+ * deepest match's path under `base` (see `canonicalUrl`), or undefined for a
60
+ * 404 (only the root matched, or a route threw `notFound`). The root's
61
+ * `head` runs again on every navigation, so the link follows the page.
62
+ */
63
+ export function pageCanonicalUrl(base, matches) {
64
+ const page = matches.at(-1);
65
+ if (!page || page.routeId === "__root__")
66
+ return undefined;
67
+ if (matches.some((match) => match.status === "notFound"))
68
+ return undefined;
69
+ return canonicalUrl(base, page.pathname);
70
+ }
71
+ /**
72
+ * `hreflang` links for a page: one per language version, the page's own
73
+ * among them as search engines expect, plus `x-default` for visitors whose
74
+ * language none matches (`defaultHref`, else the first version). A
75
+ * single-language site passes one version, its canonical URL. No versions
76
+ * gives no links, as for a 404.
77
+ */
78
+ export function hreflangLinks(alternates, defaultHref = alternates[0]?.href) {
79
+ if (!defaultHref)
80
+ return [];
81
+ return [
82
+ ...alternates.map(({ hrefLang, href }) => ({
83
+ rel: "alternate",
84
+ hrefLang,
85
+ href,
86
+ })),
87
+ { rel: "alternate", hrefLang: "x-default", href: defaultHref },
88
+ ];
89
+ }
30
90
  /** robots.txt for one user agent. Serve with `plainTextResponse`. */
31
91
  export function buildRobotsTxt({ userAgent = "*", allow = [], disallow = [], sitemap, }) {
32
92
  return [
@@ -44,16 +104,23 @@ const xmlEntities = {
44
104
  '"': "&quot;",
45
105
  "'": "&apos;",
46
106
  };
107
+ const escapeXml = (value) => value.replace(/[&<>"']/g, (char) => xmlEntities[char] ?? char);
47
108
  /**
48
- * sitemap.xml listing each absolute URL once, in the order given. Serve with
49
- * `xmlResponse`. It has no `lastmod`: a date that is not the page's real last
50
- * change is worse than none.
109
+ * sitemap.xml listing each URL once, in the order given (the first entry for
110
+ * a URL wins). An entry is an absolute URL, or one with its `lastmod`. Serve
111
+ * with `xmlResponse`.
51
112
  */
52
- export function buildSitemapXml(urls) {
113
+ export function buildSitemapXml(entries) {
114
+ const byUrl = new Map();
115
+ for (const entry of entries) {
116
+ const item = typeof entry === "string" ? { url: entry } : entry;
117
+ if (!byUrl.has(item.url))
118
+ byUrl.set(item.url, item);
119
+ }
53
120
  return [
54
121
  '<?xml version="1.0" encoding="UTF-8"?>',
55
122
  '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
56
- ...[...new Set(urls)].map((url) => `\t<url><loc>${url.replace(/[&<>"']/g, (char) => xmlEntities[char] ?? char)}</loc></url>`),
123
+ ...[...byUrl.values()].map(({ url, lastmod }) => `\t<url><loc>${escapeXml(url)}</loc>${lastmod ? `<lastmod>${escapeXml(lastmod)}</lastmod>` : ""}</url>`),
57
124
  "</urlset>",
58
125
  "",
59
126
  ].join("\n");
package/package.json CHANGED
@@ -1,156 +1,154 @@
1
1
  {
2
- "name": "singularity-core",
3
- "version": "0.14.1",
4
- "description": "Shared non-UI code for Singularity TanStack Start apps: auth sessions, API client middleware, API schemas, paging, route data, images, formatting, HTTP helpers, theme, cookie notice, SEO, security headers and telemetry.",
5
- "type": "module",
6
- "author": "Filip",
7
- "license": "MIT",
8
- "files": [
9
- "dist",
10
- "config"
11
- ],
12
- "sideEffects": [
13
- "./dist/security/zod-jitless.js"
14
- ],
15
- "packageManager": "pnpm@12.3.4",
16
- "engines": {
17
- "node": ">=26.0.0 <27.0.0",
18
- "pnpm": ">=12.0.0 <13.0.0"
19
- },
20
- "exports": {
21
- "./auth": {
22
- "types": "./dist/auth/index.d.ts",
23
- "import": "./dist/auth/index.js"
24
- },
25
- "./auth/server": {
26
- "types": "./dist/auth/server.d.ts",
27
- "import": "./dist/auth/server.js"
28
- },
29
- "./api": {
30
- "types": "./dist/api/index.d.ts",
31
- "import": "./dist/api/index.js"
32
- },
33
- "./api/server": {
34
- "types": "./dist/api/server.d.ts",
35
- "import": "./dist/api/server.js"
36
- },
37
- "./paging": {
38
- "types": "./dist/paging/index.d.ts",
39
- "import": "./dist/paging/index.js"
40
- },
41
- "./paging/react": {
42
- "types": "./dist/paging/react.d.ts",
43
- "import": "./dist/paging/react.js"
44
- },
45
- "./router/react": {
46
- "types": "./dist/router/react.d.ts",
47
- "import": "./dist/router/react.js"
48
- },
49
- "./cookie-notice/server": {
50
- "types": "./dist/cookie-notice/server.d.ts",
51
- "import": "./dist/cookie-notice/server.js"
52
- },
53
- "./theme": {
54
- "types": "./dist/theme/index.d.ts",
55
- "import": "./dist/theme/index.js"
56
- },
57
- "./theme/server": {
58
- "types": "./dist/theme/server.d.ts",
59
- "import": "./dist/theme/server.js"
60
- },
61
- "./theme/react": {
62
- "types": "./dist/theme/react.d.ts",
63
- "import": "./dist/theme/react.js"
64
- },
65
- "./schema": {
66
- "types": "./dist/schema/index.d.ts",
67
- "import": "./dist/schema/index.js"
68
- },
69
- "./seo": {
70
- "types": "./dist/seo/index.d.ts",
71
- "import": "./dist/seo/index.js"
72
- },
73
- "./security": {
74
- "types": "./dist/security/index.d.ts",
75
- "import": "./dist/security/index.js"
76
- },
77
- "./security/zod-jitless": {
78
- "types": "./dist/security/zod-jitless.d.ts",
79
- "import": "./dist/security/zod-jitless.js"
80
- },
81
- "./telemetry": {
82
- "types": "./dist/telemetry/index.d.ts",
83
- "import": "./dist/telemetry/index.js"
84
- },
85
- "./images": {
86
- "types": "./dist/images/index.d.ts",
87
- "import": "./dist/images/index.js"
88
- },
89
- "./format": {
90
- "types": "./dist/format/index.d.ts",
91
- "import": "./dist/format/index.js"
92
- },
93
- "./http": {
94
- "types": "./dist/http/index.d.ts",
95
- "import": "./dist/http/index.js"
96
- },
97
- "./biome": "./config/biome-app.json",
98
- "./package.json": "./package.json"
99
- },
100
- "scripts": {
101
- "build": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json",
102
- "typecheck": "tsc --noEmit",
103
- "test": "vitest run",
104
- "test:watch": "vitest",
105
- "openapi-dev-types": "openapi-typescript http://localhost:5268/swagger/v1/swagger.json -o ./src/api/v1.ts --alphabetize --default-non-nullable --enum-values",
106
- "openapi-types": "openapi-typescript https://api.filion.se/swagger/v1/swagger.json -o ./src/api/v1.ts --alphabetize --default-non-nullable --enum-values",
107
- "prepack": "pnpm build",
108
- "check": "biome check",
109
- "verify": "pnpm run typecheck && pnpm run check && pnpm run test",
110
- "biome:check": "biome check --write",
111
- "biome:lint": "biome lint --fix",
112
- "biome:format": "biome format --write"
113
- },
114
- "peerDependencies": {
115
- "@tanstack/react-router": "^1.170.0",
116
- "@tanstack/react-start": "^1.168.0",
117
- "jose": "^6.0.0",
118
- "openapi-fetch": "^0.17.0",
119
- "react": "^19.0.0",
120
- "zod": "^4.0.0"
121
- },
122
- "peerDependenciesMeta": {
123
- "@tanstack/react-router": {
124
- "optional": true
125
- },
126
- "@tanstack/react-start": {
127
- "optional": true
128
- },
129
- "jose": {
130
- "optional": true
131
- },
132
- "openapi-fetch": {
133
- "optional": true
134
- },
135
- "react": {
136
- "optional": true
137
- }
138
- },
139
- "devDependencies": {
140
- "@biomejs/biome": "2.5.15",
141
- "@tanstack/react-router": "1.170.46",
142
- "@tanstack/react-start": "1.169.4",
143
- "@types/node": "26.6.6",
144
- "@types/react": "19.3.0",
145
- "@types/react-dom": "19.3.0",
146
- "happy-dom": "20.14.6",
147
- "jose": "6.2.13",
148
- "openapi-fetch": "0.17.0",
149
- "openapi-typescript": "7.13.0",
150
- "react": "19.3.1",
151
- "react-dom": "19.3.1",
152
- "typescript": "6.0.3",
153
- "vitest": "5.0.5",
154
- "zod": "4.6.7"
155
- }
156
- }
2
+ "name": "singularity-core",
3
+ "version": "0.15.3",
4
+ "description": "Shared non-UI code for Singularity TanStack Start apps: auth sessions, API client middleware, API schemas, paging, route data, images, formatting, HTTP helpers, theme, cookie notice, SEO, security headers and telemetry.",
5
+ "type": "module",
6
+ "author": "Filip",
7
+ "license": "MIT",
8
+ "files": [
9
+ "dist",
10
+ "config"
11
+ ],
12
+ "sideEffects": [
13
+ "./dist/security/zod-jitless.js"
14
+ ],
15
+ "engines": {
16
+ "node": ">=26.0.0 <27.0.0",
17
+ "pnpm": ">=12.0.0 <13.0.0"
18
+ },
19
+ "exports": {
20
+ "./auth": {
21
+ "types": "./dist/auth/index.d.ts",
22
+ "import": "./dist/auth/index.js"
23
+ },
24
+ "./auth/server": {
25
+ "types": "./dist/auth/server.d.ts",
26
+ "import": "./dist/auth/server.js"
27
+ },
28
+ "./api": {
29
+ "types": "./dist/api/index.d.ts",
30
+ "import": "./dist/api/index.js"
31
+ },
32
+ "./api/server": {
33
+ "types": "./dist/api/server.d.ts",
34
+ "import": "./dist/api/server.js"
35
+ },
36
+ "./paging": {
37
+ "types": "./dist/paging/index.d.ts",
38
+ "import": "./dist/paging/index.js"
39
+ },
40
+ "./paging/react": {
41
+ "types": "./dist/paging/react.d.ts",
42
+ "import": "./dist/paging/react.js"
43
+ },
44
+ "./router/react": {
45
+ "types": "./dist/router/react.d.ts",
46
+ "import": "./dist/router/react.js"
47
+ },
48
+ "./cookie-notice/server": {
49
+ "types": "./dist/cookie-notice/server.d.ts",
50
+ "import": "./dist/cookie-notice/server.js"
51
+ },
52
+ "./theme": {
53
+ "types": "./dist/theme/index.d.ts",
54
+ "import": "./dist/theme/index.js"
55
+ },
56
+ "./theme/server": {
57
+ "types": "./dist/theme/server.d.ts",
58
+ "import": "./dist/theme/server.js"
59
+ },
60
+ "./theme/react": {
61
+ "types": "./dist/theme/react.d.ts",
62
+ "import": "./dist/theme/react.js"
63
+ },
64
+ "./schema": {
65
+ "types": "./dist/schema/index.d.ts",
66
+ "import": "./dist/schema/index.js"
67
+ },
68
+ "./seo": {
69
+ "types": "./dist/seo/index.d.ts",
70
+ "import": "./dist/seo/index.js"
71
+ },
72
+ "./security": {
73
+ "types": "./dist/security/index.d.ts",
74
+ "import": "./dist/security/index.js"
75
+ },
76
+ "./security/zod-jitless": {
77
+ "types": "./dist/security/zod-jitless.d.ts",
78
+ "import": "./dist/security/zod-jitless.js"
79
+ },
80
+ "./telemetry": {
81
+ "types": "./dist/telemetry/index.d.ts",
82
+ "import": "./dist/telemetry/index.js"
83
+ },
84
+ "./images": {
85
+ "types": "./dist/images/index.d.ts",
86
+ "import": "./dist/images/index.js"
87
+ },
88
+ "./format": {
89
+ "types": "./dist/format/index.d.ts",
90
+ "import": "./dist/format/index.js"
91
+ },
92
+ "./http": {
93
+ "types": "./dist/http/index.d.ts",
94
+ "import": "./dist/http/index.js"
95
+ },
96
+ "./biome": "./config/biome-app.json",
97
+ "./package.json": "./package.json"
98
+ },
99
+ "peerDependencies": {
100
+ "@tanstack/react-router": "^1.170.0",
101
+ "@tanstack/react-start": "^1.168.0",
102
+ "jose": "^6.0.0",
103
+ "openapi-fetch": "^0.17.0",
104
+ "react": "^19.0.0",
105
+ "zod": "^4.0.0"
106
+ },
107
+ "peerDependenciesMeta": {
108
+ "@tanstack/react-router": {
109
+ "optional": true
110
+ },
111
+ "@tanstack/react-start": {
112
+ "optional": true
113
+ },
114
+ "jose": {
115
+ "optional": true
116
+ },
117
+ "openapi-fetch": {
118
+ "optional": true
119
+ },
120
+ "react": {
121
+ "optional": true
122
+ }
123
+ },
124
+ "devDependencies": {
125
+ "@biomejs/biome": "2.5.15",
126
+ "@tanstack/react-router": "1.170.46",
127
+ "@tanstack/react-start": "1.169.4",
128
+ "@types/node": "26.6.6",
129
+ "@types/react": "19.3.0",
130
+ "@types/react-dom": "19.3.0",
131
+ "happy-dom": "20.14.6",
132
+ "jose": "6.2.13",
133
+ "openapi-fetch": "0.17.0",
134
+ "openapi-typescript": "7.13.0",
135
+ "react": "19.3.1",
136
+ "react-dom": "19.3.1",
137
+ "typescript": "6.0.3",
138
+ "vitest": "5.0.5",
139
+ "zod": "4.6.7"
140
+ },
141
+ "scripts": {
142
+ "build": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json",
143
+ "typecheck": "tsc --noEmit",
144
+ "test": "vitest run",
145
+ "test:watch": "vitest",
146
+ "openapi-dev-types": "openapi-typescript http://localhost:5268/swagger/v1/swagger.json -o ./src/api/v1.ts --alphabetize --default-non-nullable --enum-values",
147
+ "openapi-types": "openapi-typescript https://api.filion.se/swagger/v1/swagger.json -o ./src/api/v1.ts --alphabetize --default-non-nullable --enum-values",
148
+ "check": "biome check",
149
+ "verify": "pnpm run typecheck && pnpm run check && pnpm run test",
150
+ "biome:check": "biome check --write",
151
+ "biome:lint": "biome lint --fix",
152
+ "biome:format": "biome format --write"
153
+ }
154
+ }