@pyreon/zero 0.1.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.
Files changed (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +53 -0
  3. package/lib/cache.js +80 -0
  4. package/lib/cache.js.map +1 -0
  5. package/lib/client.js +58 -0
  6. package/lib/client.js.map +1 -0
  7. package/lib/config.js +35 -0
  8. package/lib/config.js.map +1 -0
  9. package/lib/font.js +251 -0
  10. package/lib/font.js.map +1 -0
  11. package/lib/fs-router-BkbIWqek.js +30 -0
  12. package/lib/fs-router-BkbIWqek.js.map +1 -0
  13. package/lib/fs-router-jfd1QGLB.js +261 -0
  14. package/lib/fs-router-jfd1QGLB.js.map +1 -0
  15. package/lib/image-plugin.js +289 -0
  16. package/lib/image-plugin.js.map +1 -0
  17. package/lib/image.js +113 -0
  18. package/lib/image.js.map +1 -0
  19. package/lib/index.js +1665 -0
  20. package/lib/index.js.map +1 -0
  21. package/lib/link.js +186 -0
  22. package/lib/link.js.map +1 -0
  23. package/lib/script.js +102 -0
  24. package/lib/script.js.map +1 -0
  25. package/lib/seo.js +136 -0
  26. package/lib/seo.js.map +1 -0
  27. package/lib/theme.js +165 -0
  28. package/lib/theme.js.map +1 -0
  29. package/lib/types/adapters/bun.d.ts +6 -0
  30. package/lib/types/adapters/bun.d.ts.map +1 -0
  31. package/lib/types/adapters/index.d.ts +10 -0
  32. package/lib/types/adapters/index.d.ts.map +1 -0
  33. package/lib/types/adapters/node.d.ts +6 -0
  34. package/lib/types/adapters/node.d.ts.map +1 -0
  35. package/lib/types/adapters/static.d.ts +7 -0
  36. package/lib/types/adapters/static.d.ts.map +1 -0
  37. package/lib/types/app.d.ts +24 -0
  38. package/lib/types/app.d.ts.map +1 -0
  39. package/lib/types/cache.d.ts +54 -0
  40. package/lib/types/cache.d.ts.map +1 -0
  41. package/lib/types/client.d.ts +19 -0
  42. package/lib/types/client.d.ts.map +1 -0
  43. package/lib/types/config.d.ts +18 -0
  44. package/lib/types/config.d.ts.map +1 -0
  45. package/lib/types/entry-server.d.ts +26 -0
  46. package/lib/types/entry-server.d.ts.map +1 -0
  47. package/lib/types/font.d.ts +119 -0
  48. package/lib/types/font.d.ts.map +1 -0
  49. package/lib/types/fs-router.d.ts +33 -0
  50. package/lib/types/fs-router.d.ts.map +1 -0
  51. package/lib/types/image-plugin.d.ts +79 -0
  52. package/lib/types/image-plugin.d.ts.map +1 -0
  53. package/lib/types/image.d.ts +50 -0
  54. package/lib/types/image.d.ts.map +1 -0
  55. package/lib/types/index.d.ts +27 -0
  56. package/lib/types/index.d.ts.map +1 -0
  57. package/lib/types/isr.d.ts +9 -0
  58. package/lib/types/isr.d.ts.map +1 -0
  59. package/lib/types/link.d.ts +116 -0
  60. package/lib/types/link.d.ts.map +1 -0
  61. package/lib/types/script.d.ts +34 -0
  62. package/lib/types/script.d.ts.map +1 -0
  63. package/lib/types/seo.d.ts +88 -0
  64. package/lib/types/seo.d.ts.map +1 -0
  65. package/lib/types/theme.d.ts +38 -0
  66. package/lib/types/theme.d.ts.map +1 -0
  67. package/lib/types/types.d.ts +104 -0
  68. package/lib/types/types.d.ts.map +1 -0
  69. package/lib/types/utils/use-intersection-observer.d.ts +10 -0
  70. package/lib/types/utils/use-intersection-observer.d.ts.map +1 -0
  71. package/lib/types/utils/with-headers.d.ts +6 -0
  72. package/lib/types/utils/with-headers.d.ts.map +1 -0
  73. package/lib/types/vite-plugin.d.ts +17 -0
  74. package/lib/types/vite-plugin.d.ts.map +1 -0
  75. package/package.json +100 -0
  76. package/src/adapters/bun.ts +65 -0
  77. package/src/adapters/index.ts +29 -0
  78. package/src/adapters/node.ts +113 -0
  79. package/src/adapters/static.ts +17 -0
  80. package/src/app.ts +62 -0
  81. package/src/cache.ts +149 -0
  82. package/src/client.ts +43 -0
  83. package/src/config.ts +36 -0
  84. package/src/entry-server.ts +51 -0
  85. package/src/font.ts +461 -0
  86. package/src/fs-router.ts +380 -0
  87. package/src/image-plugin.ts +452 -0
  88. package/src/image.tsx +167 -0
  89. package/src/index.ts +119 -0
  90. package/src/isr.ts +95 -0
  91. package/src/link.tsx +266 -0
  92. package/src/script.tsx +133 -0
  93. package/src/seo.ts +281 -0
  94. package/src/sharp.d.ts +20 -0
  95. package/src/theme.tsx +162 -0
  96. package/src/types.ts +130 -0
  97. package/src/utils/use-intersection-observer.ts +36 -0
  98. package/src/utils/with-headers.ts +16 -0
  99. package/src/vite-plugin.ts +92 -0
@@ -0,0 +1,119 @@
1
+ import type { Plugin } from 'vite';
2
+ export interface FontConfig {
3
+ /**
4
+ * Google Fonts families.
5
+ *
6
+ * Accepts both string shorthand and structured objects:
7
+ * - String: "Inter:wght@400;500;700" or "Inter:wght@100..900"
8
+ * - Object: { family: "Inter", weights: [400, 500, 700] }
9
+ * - Variable: { family: "Inter", variable: true, weightRange: [100, 900] }
10
+ */
11
+ google?: GoogleFontInput[];
12
+ /** Local font files. */
13
+ local?: LocalFont[];
14
+ /** Default font-display strategy. Default: "swap" */
15
+ display?: FontDisplay;
16
+ /** Preload critical fonts. Default: true */
17
+ preload?: boolean;
18
+ /** Self-host Google Fonts at build time. Default: true */
19
+ selfHost?: boolean;
20
+ /** Fallback font metrics for reducing CLS. */
21
+ fallbacks?: Record<string, FallbackMetrics>;
22
+ }
23
+ /** Static Google Font config. */
24
+ export interface GoogleFontStatic {
25
+ family: string;
26
+ weights: number[];
27
+ italic?: boolean;
28
+ variable?: false;
29
+ }
30
+ /** Variable Google Font config. */
31
+ export interface GoogleFontVariable {
32
+ family: string;
33
+ /** Weight range as [min, max] tuple. e.g. [100, 900] */
34
+ weightRange: [number, number];
35
+ italic?: boolean;
36
+ variable: true;
37
+ }
38
+ /** Google font input: structured object or string shorthand. */
39
+ export type GoogleFontInput = GoogleFontStatic | GoogleFontVariable | string;
40
+ export interface LocalFont {
41
+ family: string;
42
+ src: string;
43
+ /** Single weight (400) or variable range ("100 900"). */
44
+ weight?: number | `${number} ${number}`;
45
+ style?: 'normal' | 'italic';
46
+ display?: FontDisplay;
47
+ }
48
+ export type FontDisplay = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
49
+ /** Metrics for generating size-adjusted fallback fonts to reduce CLS. */
50
+ export interface FallbackMetrics {
51
+ /** The fallback font to adjust. e.g. "Arial", "Georgia" */
52
+ fallback: string;
53
+ /** Size adjustment factor. e.g. 1.05 */
54
+ sizeAdjust?: number;
55
+ /** Ascent override percentage. e.g. 90 */
56
+ ascentOverride?: number;
57
+ /** Descent override percentage. e.g. 22 */
58
+ descentOverride?: number;
59
+ /** Line gap override percentage. e.g. 0 */
60
+ lineGapOverride?: number;
61
+ }
62
+ interface ResolvedFontBase {
63
+ family: string;
64
+ italic: boolean;
65
+ }
66
+ interface StaticFont extends ResolvedFontBase {
67
+ variable: false;
68
+ weights: number[];
69
+ }
70
+ interface VariableFont extends ResolvedFontBase {
71
+ variable: true;
72
+ weightRange: [number, number];
73
+ }
74
+ type ResolvedFont = StaticFont | VariableFont;
75
+ /**
76
+ * Normalize a GoogleFontInput (string or object) into a ResolvedFont.
77
+ */
78
+ export declare function resolveGoogleFont(input: GoogleFontInput): ResolvedFont;
79
+ /**
80
+ * Parse Google Fonts family string shorthand.
81
+ *
82
+ * Static weights: "Inter:wght@400;500;700"
83
+ * Variable range: "Inter:wght@100..900"
84
+ * Variable with italic: "Inter:ital,wght@100..900"
85
+ */
86
+ export declare function parseGoogleFamily(input: string): ResolvedFont;
87
+ /**
88
+ * Generate a Google Fonts CSS URL.
89
+ */
90
+ export declare function googleFontsUrl(families: ResolvedFont[], display?: FontDisplay): string;
91
+ /**
92
+ * Zero font optimization Vite plugin.
93
+ *
94
+ * Dev mode: injects Google Fonts CDN link for fast startup.
95
+ * Build mode: downloads and self-hosts fonts for maximum performance + privacy.
96
+ *
97
+ * @example
98
+ * import { fontPlugin } from "@pyreon/zero/font"
99
+ *
100
+ * export default {
101
+ * plugins: [
102
+ * pyreon(),
103
+ * zero(),
104
+ * fontPlugin({
105
+ * google: ["Inter:wght@400;500;600;700", "JetBrains Mono:wght@400"],
106
+ * fallbacks: {
107
+ * "Inter": { fallback: "Arial", sizeAdjust: 1.07, ascentOverride: 90 },
108
+ * },
109
+ * }),
110
+ * ],
111
+ * }
112
+ */
113
+ export declare function fontPlugin(config?: FontConfig): Plugin;
114
+ /**
115
+ * Generate CSS variables for font families.
116
+ */
117
+ export declare function fontVariables(families: Record<string, string>): string;
118
+ export {};
119
+ //# sourceMappingURL=font.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/font.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAYlC,MAAM,WAAW,UAAU;IACzB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,eAAe,EAAE,CAAA;IAC1B,wBAAwB;IACxB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;IACnB,qDAAqD;IACrD,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;CAC5C;AAED,iCAAiC;AACjC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;AAED,mCAAmC;AACnC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,IAAI,CAAA;CACf;AAED,gE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M,GAAG,YAAY,CAgC7D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,YAAY,EAAE,EACxB,OAAO,GAAE,WAAoB,GAC5B,MAAM,CAoBR;AAkID;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,MAAM,GAAE,UAAe,GAAG,MAAM,CA0D1D;AAsDD;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAKtE"}
@@ -0,0 +1,33 @@
1
+ import type { FileRoute, RenderMode } from './types';
2
+ /**
3
+ * Parse a set of file paths (relative to routes dir) into FileRoute objects.
4
+ *
5
+ * @param files Array of file paths like ["index.tsx", "users/[id].tsx"]
6
+ * @param defaultMode Default rendering mode from config
7
+ */
8
+ export declare function parseFileRoutes(files: string[], defaultMode?: RenderMode): FileRoute[];
9
+ /**
10
+ * Convert a file path (without extension) to a URL path pattern.
11
+ *
12
+ * Examples:
13
+ * "index" → "/"
14
+ * "about" → "/about"
15
+ * "users/index" → "/users"
16
+ * "users/[id]" → "/users/:id"
17
+ * "blog/[...slug]" → "/blog/:slug*"
18
+ * "(auth)/login" → "/login" (group stripped)
19
+ * "_layout" → "/" (layout marker)
20
+ */
21
+ export declare function filePathToUrlPath(filePath: string): string;
22
+ /**
23
+ * Generate a virtual module that exports a nested route tree.
24
+ * Wires up layouts as parent routes with children, loaders, guards,
25
+ * error/loading components, middleware, and meta from route module exports.
26
+ */
27
+ export declare function generateRouteModule(files: string[], routesDir: string): string;
28
+ /**
29
+ * Scan a directory for route files.
30
+ * Returns paths relative to the routes directory.
31
+ */
32
+ export declare function scanRouteFiles(routesDir: string): Promise<string[]>;
33
+ //# sourceMappingURL=fs-router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs-router.d.ts","sourceRoot":"","sources":["../../src/fs-router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AA6BpD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EAAE,EACf,WAAW,GAAE,UAAkB,GAC9B,SAAS,EAAE,CAKb;AA0CD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiC1D;AA0ED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,SAAS,EAAE,MAAM,GAChB,MAAM,CA6IR;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoBzE"}
@@ -0,0 +1,79 @@
1
+ import type { Plugin } from 'vite';
2
+ export interface ImagePluginConfig {
3
+ /** Output directory for processed images. Default: "assets/img" */
4
+ outDir?: string;
5
+ /** Default widths for responsive images. Default: [640, 1024, 1920] */
6
+ widths?: number[];
7
+ /** Output formats. Default: ["webp"] */
8
+ formats?: ImageFormat[];
9
+ /** Quality for lossy formats (1-100). Default: 80 */
10
+ quality?: number;
11
+ /** Blur placeholder size in px. Default: 16 */
12
+ placeholderSize?: number;
13
+ /** File patterns to process. Default: /\.(jpe?g|png|webp|avif)$/i */
14
+ include?: RegExp;
15
+ }
16
+ export type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png';
17
+ /** Per-format source set for <picture> <source> elements. */
18
+ export interface FormatSource {
19
+ /** MIME type. e.g. "image/webp", "image/avif" */
20
+ type: string;
21
+ /** srcset string for this format. e.g. "/img-640.webp 640w, /img-1920.webp 1920w" */
22
+ srcset: string;
23
+ }
24
+ export interface ProcessedImage {
25
+ /** Fallback source path (last format, largest width). */
26
+ src: string;
27
+ /** Fallback srcset string (last format). */
28
+ srcset: string;
29
+ /** Intrinsic width. */
30
+ width: number;
31
+ /** Intrinsic height. */
32
+ height: number;
33
+ /** Base64 blur placeholder data URI. */
34
+ placeholder: string;
35
+ /** Per-format source sets for <picture> element. Ordered by priority (best format first). */
36
+ formats: FormatSource[];
37
+ /** Flat list of all sources. */
38
+ sources: Array<{
39
+ src: string;
40
+ width: number;
41
+ format: string;
42
+ }>;
43
+ }
44
+ /**
45
+ * Zero image processing Vite plugin.
46
+ *
47
+ * Transforms image imports with query params into optimized responsive images:
48
+ *
49
+ * @example
50
+ * // vite.config.ts
51
+ * import { imagePlugin } from "@pyreon/zero/image-plugin"
52
+ *
53
+ * export default {
54
+ * plugins: [
55
+ * pyreon(),
56
+ * zero(),
57
+ * imagePlugin({ widths: [480, 960, 1440], quality: 85 }),
58
+ * ],
59
+ * }
60
+ *
61
+ * @example
62
+ * // In a component — import with ?optimize
63
+ * import hero from "./images/hero.jpg?optimize"
64
+ * // hero = { src, srcset, width, height, placeholder }
65
+ *
66
+ * <Image {...hero} alt="Hero" priority />
67
+ */
68
+ export declare function imagePlugin(config?: ImagePluginConfig): Plugin;
69
+ /** @internal Exported for testing */
70
+ export declare function parseJpegDimensions(buffer: Buffer): {
71
+ width: number;
72
+ height: number;
73
+ };
74
+ /** @internal Exported for testing */
75
+ export declare function parseWebPDimensions(buffer: Buffer): {
76
+ width: number;
77
+ height: number;
78
+ };
79
+ //# sourceMappingURL=image-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-plugin.d.ts","sourceRoot":"","sources":["../../src/image-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AA4BlC,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,wCAAwC;IACxC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;AAE1D,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAA;IACX,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,6FAA6F;IAC7F,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,gCAAgC;IAChC,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/D;AAID;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,MAAM,GAAE,iBAAsB,GAAG,MAAM,CA2DlE;AA+KD,qCAAqC;AACrC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAqBA;AAED,qCAAqC;AACrC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAyBA"}
@@ -0,0 +1,50 @@
1
+ import type { FormatSource } from './image-plugin';
2
+ export interface ImageProps {
3
+ /** Image source URL. */
4
+ src: string;
5
+ /** Alt text (required for accessibility). */
6
+ alt: string;
7
+ /** Intrinsic width of the image. */
8
+ width: number;
9
+ /** Intrinsic height of the image. */
10
+ height: number;
11
+ /** Responsive sizes attribute. Default: "100vw" */
12
+ sizes?: string;
13
+ /** Responsive srcset string or source array. */
14
+ srcset?: string | ImageSource[];
15
+ /** Per-format source sets for <picture>. Provided automatically by imagePlugin. */
16
+ formats?: FormatSource[];
17
+ /** Loading strategy. "lazy" uses IntersectionObserver, "eager" loads immediately. Default: "lazy" */
18
+ loading?: 'lazy' | 'eager';
19
+ /** Mark as priority (LCP image). Disables lazy loading, adds fetchpriority="high". */
20
+ priority?: boolean;
21
+ /** Low-quality placeholder image URL or base64 data URI for blur-up effect. */
22
+ placeholder?: string;
23
+ /** CSS class name. */
24
+ class?: string;
25
+ /** Inline styles. */
26
+ style?: string;
27
+ /** CSS object-fit. Default: "cover" */
28
+ fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
29
+ /** Decode async. Default: true */
30
+ decoding?: 'sync' | 'async' | 'auto';
31
+ }
32
+ export interface ImageSource {
33
+ src: string;
34
+ width: number;
35
+ }
36
+ /**
37
+ * Optimized image component with lazy loading, responsive images,
38
+ * multi-format <picture> support, and blur-up placeholders.
39
+ *
40
+ * @example
41
+ * // With imagePlugin — spread the import directly
42
+ * import hero from "./hero.jpg?optimize"
43
+ * <Image {...hero} alt="Hero" priority />
44
+ *
45
+ * @example
46
+ * // Manual usage
47
+ * <Image src="/hero.jpg" alt="Hero" width={1200} height={630} />
48
+ */
49
+ export declare function Image(props: ImageProps): any;
50
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAalD,MAAM,WAAW,UAAU;IACzB,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAA;IACX,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,CAAA;IAC/B,mFAAmF;IACnF,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,qGAAqG;IACrG,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC1B,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uCAAuC;IACvC,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAA;IAC1D,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;CACrC;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,OAsGtC"}
@@ -0,0 +1,27 @@
1
+ export type { CreateAppOptions } from './app';
2
+ export { createApp } from './app';
3
+ export type { CreateServerOptions } from './entry-server';
4
+ export { createServer } from './entry-server';
5
+ export { zeroPlugin as default } from './vite-plugin';
6
+ export { filePathToUrlPath, generateRouteModule, parseFileRoutes, scanRouteFiles, } from './fs-router';
7
+ export { defineConfig, resolveConfig } from './config';
8
+ export { createISRHandler } from './isr';
9
+ export { bunAdapter, nodeAdapter, resolveAdapter, staticAdapter, } from './adapters';
10
+ export type { ImageProps, ImageSource } from './image';
11
+ export { Image } from './image';
12
+ export type { LinkProps, LinkRenderProps, UseLinkReturn } from './link';
13
+ export { createLink, Link, useLink } from './link';
14
+ export type { ScriptProps, ScriptStrategy } from './script';
15
+ export { Script } from './script';
16
+ export type { CacheConfig, CacheRule } from './cache';
17
+ export { cacheMiddleware, securityHeaders, varyEncoding } from './cache';
18
+ export type { FallbackMetrics, FontConfig, FontDisplay, GoogleFontInput, GoogleFontStatic, GoogleFontVariable, LocalFont, } from './font';
19
+ export { fontPlugin, fontVariables } from './font';
20
+ export type { FormatSource, ImageFormat, ImagePluginConfig, ProcessedImage, } from './image-plugin';
21
+ export { imagePlugin } from './image-plugin';
22
+ export type { Theme } from './theme';
23
+ export { initTheme, resolvedTheme, setTheme, ThemeToggle, theme, themeScript, toggleTheme, } from './theme';
24
+ export type { ChangeFreq, JsonLdType, RobotsConfig, RobotsRule, SeoPluginConfig, SitemapConfig, SitemapEntry, } from './seo';
25
+ export { generateRobots, generateSitemap, jsonLd, seoMiddleware, seoPlugin, } from './seo';
26
+ export type { Adapter, AdapterBuildOptions, FileRoute, ISRConfig, LoaderContext, RenderMode, RouteMeta, RouteModule, ZeroConfig, } from './types';
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAI7C,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA;AAIrD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,cAAc,GACf,MAAM,aAAa,CAAA;AAIpB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU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d,OAAO,EACL,cAAc,EACd,eAAe,EACf,MAAM,EACN,aAAa,EACb,SAAS,GACV,MAAM,OAAO,CAAA;AAId,YAAY,EACV,OAAO,EACP,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,GACX,MAAM,SAAS,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { ISRConfig } from './types';
2
+ /**
3
+ * In-memory ISR cache with stale-while-revalidate semantics.
4
+ *
5
+ * Wraps an SSR handler and caches responses per URL path.
6
+ * Serves stale content immediately while revalidating in the background.
7
+ */
8
+ export declare function createISRHandler(handler: (req: Request) => Promise<Response>, config: ISRConfig): (req: Request) => Promise<Response>;
9
+ //# sourceMappingURL=isr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isr.d.ts","sourceRoot":"","sources":["../../src/isr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAUxC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,EAC5C,MAAM,EAAE,SAAS,GAChB,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CA2ErC"}
@@ -0,0 +1,116 @@
1
+ export interface LinkProps {
2
+ /** Target URL path. */
3
+ href: string;
4
+ /** Link content. */
5
+ children?: any;
6
+ /** CSS class name. */
7
+ class?: string;
8
+ /** Class applied when this link matches the current route. */
9
+ activeClass?: string;
10
+ /** Class applied when this link exactly matches the current route. */
11
+ exactActiveClass?: string;
12
+ /** Prefetch strategy. Default: "hover" */
13
+ prefetch?: 'hover' | 'viewport' | 'none';
14
+ /** Open in new tab. */
15
+ external?: boolean;
16
+ /** Inline styles. */
17
+ style?: string;
18
+ /** ARIA label. */
19
+ 'aria-label'?: string;
20
+ }
21
+ /** Props passed to a custom component via createLink. */
22
+ export interface LinkRenderProps {
23
+ href: string;
24
+ ref: import('@pyreon/core').Ref<HTMLElement>;
25
+ onClick: (e: MouseEvent) => void;
26
+ onMouseEnter: () => void;
27
+ onTouchStart: () => void;
28
+ isActive: () => boolean;
29
+ isExactActive: () => boolean;
30
+ /** Reactive class string — pass directly to element for auto-updates on route change. */
31
+ class: (() => string) | string | undefined;
32
+ style?: string;
33
+ target?: string;
34
+ rel?: string;
35
+ 'aria-label'?: string;
36
+ children?: any;
37
+ }
38
+ /** Return type of useLink. */
39
+ export interface UseLinkReturn {
40
+ /** Ref object — attach to the root element for viewport-based prefetch. */
41
+ ref: import('@pyreon/core').Ref<HTMLElement>;
42
+ /** Click handler — performs client-side navigation. */
43
+ handleClick: (e: MouseEvent) => void;
44
+ /** Mouse enter handler — triggers hover prefetch. */
45
+ handleMouseEnter: () => void;
46
+ /** Touch start handler — triggers prefetch on mobile. */
47
+ handleTouchStart: () => void;
48
+ /** Whether the link partially matches the current route. */
49
+ isActive: () => boolean;
50
+ /** Whether the link exactly matches the current route. */
51
+ isExactActive: () => boolean;
52
+ /** Resolved class string including active classes. */
53
+ classes: () => string;
54
+ }
55
+ /**
56
+ * Composable that provides all link behavior — navigation, prefetching,
57
+ * active state, and viewport observation.
58
+ *
59
+ * Use this for full control when `createLink` is too opinionated.
60
+ *
61
+ * @example
62
+ * function MyLink(props: LinkProps) {
63
+ * const link = useLink(props)
64
+ * return (
65
+ * <button ref={link.ref} class={link.classes()} onclick={link.handleClick}>
66
+ * {props.children}
67
+ * </button>
68
+ * )
69
+ * }
70
+ */
71
+ export declare function useLink(props: LinkProps): UseLinkReturn;
72
+ /**
73
+ * Higher-order component that wraps any component with link behavior.
74
+ *
75
+ * The wrapped component receives {@link LinkRenderProps} with all handlers,
76
+ * active state, and accessibility attributes pre-wired.
77
+ *
78
+ * @example
79
+ * // Custom button link
80
+ * const ButtonLink = createLink((props) => (
81
+ * <button
82
+ * ref={props.ref}
83
+ * class={props.class}
84
+ * onclick={props.onClick}
85
+ * onmouseenter={props.onMouseEnter}
86
+ * >
87
+ * {props.children}
88
+ * </button>
89
+ * ))
90
+ *
91
+ * // Custom styled component
92
+ * const CardLink = createLink((props) => (
93
+ * <div
94
+ * ref={props.ref}
95
+ * class={`card ${props.isActive() ? "card--active" : ""}`}
96
+ * onclick={props.onClick}
97
+ * onmouseenter={props.onMouseEnter}
98
+ * >
99
+ * {props.children}
100
+ * </div>
101
+ * ))
102
+ *
103
+ * // Usage
104
+ * <ButtonLink href="/about">About</ButtonLink>
105
+ * <CardLink href="/posts" prefetch="viewport">Posts</CardLink>
106
+ */
107
+ export declare function createLink(Component: (props: LinkRenderProps) => any): (props: LinkProps) => any;
108
+ /**
109
+ * Default navigation link built on an `<a>` tag.
110
+ *
111
+ * @example
112
+ * <Link href="/about" prefetch="viewport">About</Link>
113
+ * <Link href="/posts" activeClass="nav-active">Posts</Link>
114
+ */
115
+ export declare const Link: (props: LinkProps) => any;
116
+ //# sourceMappingURL=link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/link.tsx"],"names":[],"mappings":"AAaA,MAAM,WAAW,SAAS;IACxB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,oBAAoB;IACpB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,CAAA;IACxC,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kBAAkB;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,yDAAyD;AACz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ACxB,SAAS,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,GAAG,GACzC,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAsB3B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,UA/BN,SAAS,KAAK,GA+CvB,CAAA"}
@@ -0,0 +1,34 @@
1
+ export interface ScriptProps {
2
+ /** Script source URL. */
3
+ src: string;
4
+ /** Loading strategy. Default: "afterHydration" */
5
+ strategy?: ScriptStrategy;
6
+ /** Inline script content (alternative to src). */
7
+ children?: string;
8
+ /** Script id for deduplication. */
9
+ id?: string;
10
+ /** Async attribute. Default: true */
11
+ async?: boolean;
12
+ /** onLoad callback. */
13
+ onLoad?: () => void;
14
+ /** onError callback. */
15
+ onError?: (error: Error) => void;
16
+ }
17
+ export type ScriptStrategy = 'beforeHydration' | 'afterHydration' | 'onIdle' | 'onInteraction' | 'onViewport';
18
+ /**
19
+ * Optimized script loading component.
20
+ *
21
+ * @example
22
+ * // Load analytics after page is interactive
23
+ * <Script src="https://analytics.example.com/script.js" strategy="onIdle" />
24
+ *
25
+ * // Load chat widget when user scrolls
26
+ * <Script src="/chat-widget.js" strategy="onViewport" />
27
+ *
28
+ * // Inline script with deferred execution
29
+ * <Script strategy="afterHydration">
30
+ * {`console.log("App hydrated!")`}
31
+ * </Script>
32
+ */
33
+ export declare function Script(props: ScriptProps): any;
34
+ //# sourceMappingURL=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../src/script.tsx"],"names":[],"mappings":"AAYA,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,kDAAkD;IAClD,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mCAAmC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,wBAAwB;IACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACjC;AAED,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,gBAAgB,GAChB,QAAQ,GACR,eAAe,GACf,YAAY,CAAA;AAEhB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,OAiFxC"}
@@ -0,0 +1,88 @@
1
+ import type { Middleware } from '@pyreon/server';
2
+ import type { Plugin } from 'vite';
3
+ export interface SitemapConfig {
4
+ /** Base URL of the site (required). e.g. "https://example.com" */
5
+ origin: string;
6
+ /** Paths to exclude from the sitemap. */
7
+ exclude?: string[];
8
+ /** Default change frequency. Default: "weekly" */
9
+ changefreq?: ChangeFreq;
10
+ /** Default priority. Default: 0.7 */
11
+ priority?: number;
12
+ /** Additional URLs to include (for dynamic routes). */
13
+ additionalPaths?: SitemapEntry[];
14
+ }
15
+ export interface SitemapEntry {
16
+ path: string;
17
+ changefreq?: ChangeFreq;
18
+ priority?: number;
19
+ lastmod?: string;
20
+ }
21
+ export type ChangeFreq = 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
22
+ /**
23
+ * Generate a sitemap.xml string from route file paths.
24
+ */
25
+ export declare function generateSitemap(routeFiles: string[], config: SitemapConfig): string;
26
+ export interface RobotsConfig {
27
+ /** Rules per user-agent. */
28
+ rules?: RobotsRule[];
29
+ /** Sitemap URL. */
30
+ sitemap?: string;
31
+ /** Host directive. */
32
+ host?: string;
33
+ }
34
+ export interface RobotsRule {
35
+ userAgent: string;
36
+ allow?: string[];
37
+ disallow?: string[];
38
+ crawlDelay?: number;
39
+ }
40
+ /**
41
+ * Generate a robots.txt string.
42
+ */
43
+ export declare function generateRobots(config?: RobotsConfig): string;
44
+ export type JsonLdType = 'WebSite' | 'WebPage' | 'Article' | 'BlogPosting' | 'Product' | 'Organization' | 'Person' | 'BreadcrumbList' | 'FAQPage' | (string & {});
45
+ /**
46
+ * Generate a JSON-LD script tag string for structured data.
47
+ *
48
+ * @example
49
+ * useHead({
50
+ * script: [jsonLd({
51
+ * "@type": "WebSite",
52
+ * name: "My Site",
53
+ * url: "https://example.com",
54
+ * })],
55
+ * })
56
+ */
57
+ export declare function jsonLd(data: Record<string, unknown>): string;
58
+ export interface SeoPluginConfig {
59
+ /** Sitemap configuration. */
60
+ sitemap?: SitemapConfig;
61
+ /** Robots.txt configuration. */
62
+ robots?: RobotsConfig;
63
+ }
64
+ /**
65
+ * Zero SEO Vite plugin.
66
+ * Generates sitemap.xml and robots.txt at build time.
67
+ *
68
+ * @example
69
+ * import { seoPlugin } from "@pyreon/zero/seo"
70
+ *
71
+ * export default {
72
+ * plugins: [
73
+ * pyreon(),
74
+ * zero(),
75
+ * seoPlugin({
76
+ * sitemap: { origin: "https://example.com" },
77
+ * robots: { sitemap: "https://example.com/sitemap.xml" },
78
+ * }),
79
+ * ],
80
+ * }
81
+ */
82
+ export declare function seoPlugin(config?: SeoPluginConfig): Plugin;
83
+ /**
84
+ * SEO middleware for dev server.
85
+ * Serves sitemap.xml and robots.txt dynamically during development.
86
+ */
87
+ export declare function seoMiddleware(config?: SeoPluginConfig): Middleware;
88
+ //# sourceMappingURL=seo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seo.d.ts","sourceRoot":"","sources":["../../src/seo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAUlC,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAA;IACd,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,kDAAkD;IAClD,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,qCAA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,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,gCAAgC;IAChC,MAAM,CAAC,EAAE,YAAY,CAAA;CACtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,MAAM,GAAE,eAAoB,GAAG,MAAM,CAqC9D;AAID;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,eAAoB,GAAG,UAAU,CAuBtE"}
@@ -0,0 +1,38 @@
1
+ export type Theme = 'light' | 'dark' | 'system';
2
+ /** Reactive theme signal. */
3
+ export declare const theme: import("@pyreon/reactivity").Signal<Theme>;
4
+ /** Computed resolved theme (what's actually applied). */
5
+ export declare function resolvedTheme(): 'light' | 'dark';
6
+ /** Toggle between light and dark. */
7
+ export declare function toggleTheme(): void;
8
+ /** Set theme explicitly. */
9
+ export declare function setTheme(t: Theme): void;
10
+ /**
11
+ * Initialize the theme system. Call once in your app entry or layout.
12
+ * Reads from localStorage, listens for system preference changes.
13
+ */
14
+ export declare function initTheme(): void;
15
+ /**
16
+ * Theme toggle button component.
17
+ *
18
+ * @example
19
+ * import { ThemeToggle } from "@pyreon/zero/theme"
20
+ * <ThemeToggle />
21
+ */
22
+ export declare function ThemeToggle(props: {
23
+ class?: string;
24
+ style?: string;
25
+ }): any;
26
+ /**
27
+ * Inline script to prevent flash of wrong theme.
28
+ * Include this in your index.html <head> BEFORE any stylesheets.
29
+ *
30
+ * @example
31
+ * // index.html
32
+ * <head>
33
+ * <script>{themeScript}</script>
34
+ * ...
35
+ * </head>
36
+ */
37
+ export declare const themeScript = "(function(){try{var t=localStorage.getItem(\"zero-theme\");var r=t===\"light\"?\"light\":t===\"dark\"?\"dark\":window.matchMedia(\"(prefers-color-scheme:dark)\").matches?\"dark\":\"light\";document.documentElement.dataset.theme=r}catch(e){}})()";
38
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.tsx"],"names":[],"mappings":"AAWA,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;AAI/C,6BAA6B;AAC7B,eAAO,MAAM,KAAK,4CAA0B,CAAA;AAE5C,yDAAyD;AACzD,wBAAgB,aAAa,IAAI,OAAO,GAAG,MAAM,CAShD;AAED,qCAAqC;AACrC,wBAAgB,WAAW,SAG1B;AAED,4BAA4B;AAC5B,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,QAUhC;AAED;;;GAGG;AACH,wBAAgB,SAAS,SAiCxB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,OAqDpE;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,yPAA6O,CAAA"}