@pyreon/zero 0.11.8 → 0.11.10

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 (95) hide show
  1. package/lib/font.js +20 -7
  2. package/lib/font.js.map +1 -1
  3. package/lib/fs-router-BkbIWqek.js.map +1 -1
  4. package/lib/{fs-router-n4VA4lxu.js → fs-router-Dil4IKZR.js} +23 -19
  5. package/lib/fs-router-Dil4IKZR.js.map +1 -0
  6. package/lib/image-plugin.js.map +1 -1
  7. package/lib/index.js +893 -24
  8. package/lib/index.js.map +1 -1
  9. package/lib/link.js +13 -1
  10. package/lib/link.js.map +1 -1
  11. package/lib/types/actions.d.ts +57 -0
  12. package/lib/types/actions.d.ts.map +1 -0
  13. package/lib/types/adapters/bun.d.ts +6 -0
  14. package/lib/types/adapters/bun.d.ts.map +1 -0
  15. package/lib/types/adapters/index.d.ts +10 -0
  16. package/lib/types/adapters/index.d.ts.map +1 -0
  17. package/lib/types/adapters/node.d.ts +6 -0
  18. package/lib/types/adapters/node.d.ts.map +1 -0
  19. package/lib/types/adapters/static.d.ts +7 -0
  20. package/lib/types/adapters/static.d.ts.map +1 -0
  21. package/lib/types/api-routes.d.ts +66 -0
  22. package/lib/types/api-routes.d.ts.map +1 -0
  23. package/lib/types/app.d.ts +24 -0
  24. package/lib/types/app.d.ts.map +1 -0
  25. package/lib/types/cache.d.ts +54 -0
  26. package/lib/types/cache.d.ts.map +1 -0
  27. package/lib/types/client.d.ts +19 -0
  28. package/lib/types/client.d.ts.map +1 -0
  29. package/lib/types/compression.d.ts +33 -0
  30. package/lib/types/compression.d.ts.map +1 -0
  31. package/lib/types/config.d.ts +18 -0
  32. package/lib/types/config.d.ts.map +1 -0
  33. package/lib/types/cors.d.ts +32 -0
  34. package/lib/types/cors.d.ts.map +1 -0
  35. package/lib/types/entry-server.d.ts +37 -0
  36. package/lib/types/entry-server.d.ts.map +1 -0
  37. package/lib/types/error-overlay.d.ts +6 -0
  38. package/lib/types/error-overlay.d.ts.map +1 -0
  39. package/lib/types/favicon.d.ts +43 -0
  40. package/lib/types/favicon.d.ts.map +1 -0
  41. package/lib/types/font.d.ts +119 -0
  42. package/lib/types/font.d.ts.map +1 -0
  43. package/lib/types/fs-router.d.ts +47 -0
  44. package/lib/types/fs-router.d.ts.map +1 -0
  45. package/lib/types/i18n-routing.d.ts +98 -0
  46. package/lib/types/i18n-routing.d.ts.map +1 -0
  47. package/lib/types/image-plugin.d.ts +79 -0
  48. package/lib/types/image-plugin.d.ts.map +1 -0
  49. package/lib/types/image.d.ts +51 -0
  50. package/lib/types/image.d.ts.map +1 -0
  51. package/lib/types/index.d.ts +46 -0
  52. package/lib/types/index.d.ts.map +1 -0
  53. package/lib/types/isr.d.ts +9 -0
  54. package/lib/types/isr.d.ts.map +1 -0
  55. package/lib/types/link.d.ts +127 -0
  56. package/lib/types/link.d.ts.map +1 -0
  57. package/lib/types/meta.d.ts +91 -0
  58. package/lib/types/meta.d.ts.map +1 -0
  59. package/lib/types/middleware.d.ts +35 -0
  60. package/lib/types/middleware.d.ts.map +1 -0
  61. package/lib/types/not-found.d.ts +7 -0
  62. package/lib/types/not-found.d.ts.map +1 -0
  63. package/lib/types/rate-limit.d.ts +34 -0
  64. package/lib/types/rate-limit.d.ts.map +1 -0
  65. package/lib/types/script.d.ts +35 -0
  66. package/lib/types/script.d.ts.map +1 -0
  67. package/lib/types/seo.d.ts +88 -0
  68. package/lib/types/seo.d.ts.map +1 -0
  69. package/lib/types/testing.d.ts +85 -0
  70. package/lib/types/testing.d.ts.map +1 -0
  71. package/lib/types/theme.d.ts +39 -0
  72. package/lib/types/theme.d.ts.map +1 -0
  73. package/lib/types/types.d.ts +111 -0
  74. package/lib/types/types.d.ts.map +1 -0
  75. package/lib/types/utils/use-intersection-observer.d.ts +10 -0
  76. package/lib/types/utils/use-intersection-observer.d.ts.map +1 -0
  77. package/lib/types/utils/with-headers.d.ts +6 -0
  78. package/lib/types/utils/with-headers.d.ts.map +1 -0
  79. package/lib/types/vite-plugin.d.ts +17 -0
  80. package/lib/types/vite-plugin.d.ts.map +1 -0
  81. package/package.json +10 -10
  82. package/src/entry-server.ts +124 -76
  83. package/src/favicon.ts +380 -0
  84. package/src/font.ts +32 -8
  85. package/src/fs-router.ts +54 -13
  86. package/src/i18n-routing.ts +299 -0
  87. package/src/image-plugin.ts +1 -1
  88. package/src/index.ts +125 -76
  89. package/src/link.tsx +19 -0
  90. package/src/meta.tsx +210 -0
  91. package/src/middleware.ts +65 -0
  92. package/src/not-found.ts +44 -0
  93. package/src/types.ts +2 -0
  94. package/src/vite-plugin.ts +258 -127
  95. package/lib/fs-router-n4VA4lxu.js.map +0 -1
@@ -0,0 +1,91 @@
1
+ import type { VNodeChild } from '@pyreon/core';
2
+ import type { I18nRoutingConfig } from './i18n-routing';
3
+ export interface MetaProps {
4
+ /** Page title. Accepts reactive accessor `() => string`. */
5
+ title?: string | (() => string);
6
+ /** Page description. Accepts reactive accessor. */
7
+ description?: string | (() => string);
8
+ /** Canonical URL. Also sets og:url. */
9
+ canonical?: string;
10
+ /** Open Graph image URL. Also sets twitter:image. */
11
+ image?: string;
12
+ /** Image alt text for accessibility. */
13
+ imageAlt?: string;
14
+ /** Open Graph type. Default: "website" */
15
+ type?: 'website' | 'article' | 'product' | 'profile';
16
+ /** Site name for og:site_name. */
17
+ siteName?: string;
18
+ /** Twitter card type. Default: "summary_large_image" */
19
+ twitterCard?: 'summary' | 'summary_large_image' | 'app' | 'player';
20
+ /** Twitter @handle. */
21
+ twitterSite?: string;
22
+ /** Twitter creator @handle. */
23
+ twitterCreator?: string;
24
+ /** Locale. Default: "en_US" */
25
+ locale?: string;
26
+ /** Alternate locales for hreflang. */
27
+ alternateLocales?: Array<{
28
+ locale: string;
29
+ url: string;
30
+ }>;
31
+ /** Robots directives. Default: "index, follow" */
32
+ robots?: string;
33
+ /** Published time (ISO 8601) for article type. */
34
+ publishedTime?: string;
35
+ /** Modified time (ISO 8601) for article type. */
36
+ modifiedTime?: string;
37
+ /** Article author. */
38
+ author?: string;
39
+ /** Article tags. */
40
+ tags?: string[];
41
+ /** JSON-LD structured data object. */
42
+ jsonLd?: Record<string, unknown>;
43
+ /** Additional custom meta tags. */
44
+ extra?: Array<{
45
+ name?: string;
46
+ property?: string;
47
+ content: string;
48
+ }>;
49
+ /**
50
+ * I18n routing config — when provided, auto-generates hreflang alternate
51
+ * links for all locales based on the current path.
52
+ * Also sets og:locale and og:locale:alternate.
53
+ */
54
+ i18n?: I18nRoutingConfig;
55
+ /** Base URL for building absolute hreflang URLs. e.g. "https://example.com" */
56
+ origin?: string;
57
+ children?: VNodeChild;
58
+ }
59
+ /**
60
+ * Declarative meta component for SSR-compatible page metadata.
61
+ *
62
+ * Supports reactive title/description — when passed as `() => string` accessors,
63
+ * they are forwarded to `useHead()` as a reactive getter so updates propagate
64
+ * automatically via signal tracking.
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * <Meta title="My Page" description="..." image="/og.jpg" canonical="https://..." />
69
+ * ```
70
+ *
71
+ * @example Reactive title
72
+ * ```tsx
73
+ * const count = signal(0)
74
+ * <Meta title={() => `${count()} items`} />
75
+ * ```
76
+ */
77
+ export declare function Meta(props: MetaProps): VNodeChild;
78
+ interface MetaTags {
79
+ meta: Array<Record<string, string>>;
80
+ link: Array<Record<string, string>>;
81
+ script: Array<{
82
+ type: string;
83
+ children: string;
84
+ }>;
85
+ }
86
+ export declare function buildMetaTags(props: Omit<MetaProps, 'title' | 'description' | 'children'> & {
87
+ title?: string;
88
+ description?: string;
89
+ }): MetaTags;
90
+ export {};
91
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/meta.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAKvD,MAAM,WAA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AI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpE;;;;OAIG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACxB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,UAAU,CAAA;CACtB;AAKD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAqBjD;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACnC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACnC,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAClD;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,aAAa,GAAG,UAAU,CAAC,GAAG;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GACA,QAAQ,CAiGV"}
@@ -0,0 +1,35 @@
1
+ import type { Middleware, MiddlewareContext } from '@pyreon/server';
2
+ /**
3
+ * Compose multiple middleware into a single middleware function.
4
+ * Middleware runs sequentially — if any returns a Response, the chain stops.
5
+ *
6
+ * @example
7
+ * import { compose } from "@pyreon/zero/middleware"
8
+ * import { corsMiddleware } from "@pyreon/zero/cors"
9
+ * import { rateLimitMiddleware } from "@pyreon/zero/rate-limit"
10
+ *
11
+ * const combined = compose(
12
+ * corsMiddleware({ origin: "*" }),
13
+ * rateLimitMiddleware({ max: 100 }),
14
+ * cacheMiddleware(),
15
+ * )
16
+ */
17
+ export declare function compose(...middlewares: Middleware[]): Middleware;
18
+ /**
19
+ * Get the shared Zero context from a middleware context.
20
+ * Creates one if it doesn't exist. Middleware can use this to
21
+ * pass data to downstream middleware without polluting `ctx.locals`.
22
+ *
23
+ * @example
24
+ * const authMiddleware: Middleware = (ctx) => {
25
+ * const zctx = getContext(ctx)
26
+ * zctx.userId = "user_123"
27
+ * }
28
+ *
29
+ * const loggingMiddleware: Middleware = (ctx) => {
30
+ * const zctx = getContext(ctx)
31
+ * console.log("User:", zctx.userId)
32
+ * }
33
+ */
34
+ export declare function getContext(ctx: MiddlewareContext): Record<string, unknown>;
35
+ //# sourceMappingURL=middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AASnE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,GAAG,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAOhE;AAUD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAO1E"}
@@ -0,0 +1,7 @@
1
+ import type { ComponentFn } from "@pyreon/core";
2
+ /**
3
+ * Render a 404 component to a full HTML string.
4
+ * If no component is provided, returns a default 404 page.
5
+ */
6
+ export declare function render404Page(component: ComponentFn | undefined, template?: string): Promise<string>;
7
+ //# sourceMappingURL=not-found.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../src/not-found.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAahD;;;GAGG;AACH,wBAAsB,aAAa,CAClC,SAAS,EAAE,WAAW,GAAG,SAAS,EAClC,QAAQ,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAuBjB"}
@@ -0,0 +1,34 @@
1
+ import type { Middleware, MiddlewareContext } from '@pyreon/server';
2
+ export interface RateLimitConfig {
3
+ /** Maximum requests per window. Default: `100` */
4
+ max?: number;
5
+ /** Time window in seconds. Default: `60` */
6
+ window?: number;
7
+ /** Function to extract the client identifier. Default: IP from headers. */
8
+ keyFn?: (ctx: MiddlewareContext) => string;
9
+ /** Custom response when rate limited. */
10
+ onLimit?: (ctx: MiddlewareContext) => Response;
11
+ /** URL patterns to rate limit (glob-style). Default: all paths. */
12
+ include?: string[];
13
+ /** URL patterns to exclude from rate limiting. */
14
+ exclude?: string[];
15
+ }
16
+ /**
17
+ * Rate limiting middleware — limits requests per client within a time window.
18
+ * Uses an in-memory store (suitable for single-instance deployments).
19
+ *
20
+ * @example
21
+ * import { rateLimitMiddleware } from "@pyreon/zero/rate-limit"
22
+ *
23
+ * // 100 requests per minute (default)
24
+ * rateLimitMiddleware()
25
+ *
26
+ * // Strict API rate limiting
27
+ * rateLimitMiddleware({
28
+ * max: 20,
29
+ * window: 60,
30
+ * include: ["/api/*"],
31
+ * })
32
+ */
33
+ export declare function rateLimitMiddleware(config?: RateLimitConfig): Middleware;
34
+ //# sourceMappingURL=rate-limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../src/rate-limit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAInE,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2EAA2E;IAC3E,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,MAAM,CAAA;IAC1C,yCAAyC;IACzC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,QAAQ,CAAA;IAC9C,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAOD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,GAAE,eAAoB,GAAG,UAAU,CAgE5E"}
@@ -0,0 +1,35 @@
1
+ import type { VNodeChild } from '@pyreon/core';
2
+ export interface ScriptProps {
3
+ /** Script source URL. */
4
+ src: string;
5
+ /** Loading strategy. Default: "afterHydration" */
6
+ strategy?: ScriptStrategy;
7
+ /** Inline script content (alternative to src). */
8
+ children?: string;
9
+ /** Script id for deduplication. */
10
+ id?: string;
11
+ /** Async attribute. Default: true */
12
+ async?: boolean;
13
+ /** onLoad callback. */
14
+ onLoad?: () => void;
15
+ /** onError callback. */
16
+ onError?: (error: Error) => void;
17
+ }
18
+ export type ScriptStrategy = 'beforeHydration' | 'afterHydration' | 'onIdle' | 'onInteraction' | 'onViewport';
19
+ /**
20
+ * Optimized script loading component.
21
+ *
22
+ * @example
23
+ * // Load analytics after page is interactive
24
+ * <Script src="https://analytics.example.com/script.js" strategy="onIdle" />
25
+ *
26
+ * // Load chat widget when user scrolls
27
+ * <Script src="/chat-widget.js" strategy="onViewport" />
28
+ *
29
+ * // Inline script with deferred execution
30
+ * <Script strategy="afterHydration">
31
+ * {`console.log("App hydrated!")`}
32
+ * </Script>
33
+ */
34
+ export declare function Script(props: ScriptProps): VNodeChild;
35
+ //# sourceMappingURL=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../src/script.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAa9C,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,GAAG,UAAU,CAgFrD"}
@@ -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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B,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEjB;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAM5D;AAID,MAAM,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,85 @@
1
+ import type { Middleware, MiddlewareContext } from '@pyreon/server';
2
+ import type { ApiHandler, ApiRouteEntry } from './api-routes';
3
+ /**
4
+ * Create a mock MiddlewareContext for testing middleware.
5
+ *
6
+ * @example
7
+ * import { createTestContext } from "@pyreon/zero/testing"
8
+ *
9
+ * const ctx = createTestContext("/api/posts", { method: "POST", body: { title: "Hello" } })
10
+ * const result = await myMiddleware(ctx)
11
+ */
12
+ export declare function createTestContext(path: string, options?: {
13
+ method?: string;
14
+ headers?: Record<string, string>;
15
+ body?: unknown;
16
+ }): MiddlewareContext;
17
+ /**
18
+ * Test a middleware by running it with a mock context and returning
19
+ * the result along with the response headers it set.
20
+ *
21
+ * @example
22
+ * import { testMiddleware } from "@pyreon/zero/testing"
23
+ *
24
+ * const { response, headers } = await testMiddleware(
25
+ * corsMiddleware({ origin: "*" }),
26
+ * "/api/posts"
27
+ * )
28
+ * expect(headers.get("Access-Control-Allow-Origin")).toBe("*")
29
+ */
30
+ export declare function testMiddleware(middleware: Middleware, path: string, options?: {
31
+ method?: string;
32
+ headers?: Record<string, string>;
33
+ body?: unknown;
34
+ }): Promise<{
35
+ response: Response | undefined;
36
+ headers: Headers;
37
+ }>;
38
+ /**
39
+ * Create a test server for API routes. Returns a function that
40
+ * accepts Request objects and dispatches to the correct handler.
41
+ *
42
+ * @example
43
+ * import { createTestApiServer } from "@pyreon/zero/testing"
44
+ *
45
+ * const server = createTestApiServer([
46
+ * { pattern: "/api/posts", module: postsApi },
47
+ * { pattern: "/api/posts/:id", module: postByIdApi },
48
+ * ])
49
+ *
50
+ * const response = await server.request("/api/posts")
51
+ * expect(response.status).toBe(200)
52
+ *
53
+ * const data = await server.request("/api/posts", { method: "POST", body: { title: "Hi" } })
54
+ * expect(data.status).toBe(201)
55
+ */
56
+ export declare function createTestApiServer(routes: ApiRouteEntry[]): {
57
+ request(path: string, options?: {
58
+ method?: string;
59
+ headers?: Record<string, string>;
60
+ body?: unknown;
61
+ }): Promise<Response>;
62
+ };
63
+ /**
64
+ * Create a mock API handler for testing.
65
+ * Records all calls and returns a configurable response.
66
+ *
67
+ * @example
68
+ * import { createMockHandler } from "@pyreon/zero/testing"
69
+ *
70
+ * const handler = createMockHandler({ status: 200, body: { ok: true } })
71
+ * // ... use handler in your API route module
72
+ * expect(handler.calls).toHaveLength(1)
73
+ * expect(handler.calls[0].params).toEqual({ id: "123" })
74
+ */
75
+ export declare function createMockHandler(responseConfig?: {
76
+ status?: number;
77
+ body?: unknown;
78
+ headers?: Record<string, string>;
79
+ }): ApiHandler & {
80
+ calls: Array<{
81
+ path: string;
82
+ params: Record<string, string>;
83
+ }>;
84
+ };
85
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAK7D;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACP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export type Theme = 'light' | 'dark' | 'system';
3
+ /** Reactive theme signal. */
4
+ export declare const theme: import("@pyreon/reactivity").Signal<Theme>;
5
+ /** Computed resolved theme (what's actually applied). */
6
+ export declare function resolvedTheme(): 'light' | 'dark';
7
+ /** Toggle between light and dark. */
8
+ export declare function toggleTheme(): void;
9
+ /** Set theme explicitly. */
10
+ export declare function setTheme(t: Theme): void;
11
+ /**
12
+ * Initialize the theme system. Call once in your app entry or layout.
13
+ * Reads from localStorage, listens for system preference changes.
14
+ */
15
+ export declare function initTheme(): void;
16
+ /**
17
+ * Theme toggle button component.
18
+ *
19
+ * @example
20
+ * import { ThemeToggle } from "@pyreon/zero/theme"
21
+ * <ThemeToggle />
22
+ */
23
+ export declare function ThemeToggle(props: {
24
+ class?: string;
25
+ style?: string;
26
+ }): VNodeChild;
27
+ /**
28
+ * Inline script to prevent flash of wrong theme.
29
+ * Include this in your index.html <head> BEFORE any stylesheets.
30
+ *
31
+ * @example
32
+ * // index.html
33
+ * <head>
34
+ * <script>{themeScript}</script>
35
+ * ...
36
+ * </head>
37
+ */
38
+ 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){}})()";
39
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAY9C,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,CAOhD;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,GAAG,UAAU,CAqDjF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,yPAA6O,CAAA"}
@@ -0,0 +1,111 @@
1
+ import type { ComponentFn } from '@pyreon/core';
2
+ import type { NavigationGuard } from '@pyreon/router';
3
+ import type { Middleware } from '@pyreon/server';
4
+ /** What a route file (e.g. `src/routes/index.tsx`) can export. */
5
+ export interface RouteModule {
6
+ /** Default export is the page component. */
7
+ default?: ComponentFn;
8
+ /** Layout wrapper — wraps this route and all children. */
9
+ layout?: ComponentFn;
10
+ /** Loading component shown while lazy-loading or during Suspense. */
11
+ loading?: ComponentFn;
12
+ /** Error component shown when the route errors. */
13
+ error?: ComponentFn;
14
+ /** Server-side data loader. */
15
+ loader?: (ctx: LoaderContext) => Promise<unknown>;
16
+ /** Per-route middleware. */
17
+ middleware?: Middleware | Middleware[];
18
+ /** Navigation guard — can redirect or block navigation. */
19
+ guard?: NavigationGuard;
20
+ /** Route metadata. */
21
+ meta?: RouteMeta;
22
+ /** Rendering mode override for this route. */
23
+ renderMode?: RenderMode;
24
+ }
25
+ /** Context passed to route loaders. */
26
+ export interface LoaderContext {
27
+ params: Record<string, string>;
28
+ query: Record<string, string>;
29
+ signal: AbortSignal;
30
+ request: Request;
31
+ }
32
+ /** Per-route metadata. */
33
+ export interface RouteMeta {
34
+ title?: string;
35
+ description?: string;
36
+ [key: string]: unknown;
37
+ }
38
+ export type RenderMode = 'ssr' | 'ssg' | 'spa' | 'isr';
39
+ export interface ISRConfig {
40
+ /** Revalidation interval in seconds. */
41
+ revalidate: number;
42
+ }
43
+ export interface ZeroConfig {
44
+ /** Default rendering mode. Default: "ssr" */
45
+ mode?: RenderMode;
46
+ /** Vite config overrides. */
47
+ vite?: Record<string, unknown>;
48
+ /** SSR options. */
49
+ ssr?: {
50
+ /** Streaming mode. Default: "string" */
51
+ mode?: 'string' | 'stream';
52
+ };
53
+ /** SSG options — only used when mode is "ssg". */
54
+ ssg?: {
55
+ /** Paths to prerender (or function returning paths). */
56
+ paths?: string[] | (() => string[] | Promise<string[]>);
57
+ };
58
+ /** ISR config — only used when mode is "isr". */
59
+ isr?: ISRConfig;
60
+ /** Deploy adapter. Default: "node" */
61
+ adapter?: 'node' | 'bun' | 'static';
62
+ /** Base URL path. Default: "/" */
63
+ base?: string;
64
+ /** App-level middleware applied to all routes. */
65
+ middleware?: Middleware[];
66
+ /** Server port for dev/preview. Default: 3000 */
67
+ port?: number;
68
+ }
69
+ /** Internal representation of a file-system route before conversion to RouteRecord. */
70
+ export interface FileRoute {
71
+ /** File path relative to routes dir (e.g. "users/[id].tsx") */
72
+ filePath: string;
73
+ /** Parsed URL path pattern (e.g. "/users/:id") */
74
+ urlPath: string;
75
+ /** Directory path for grouping (e.g. "users" or "" for root) */
76
+ dirPath: string;
77
+ /** Route segment depth for nesting. */
78
+ depth: number;
79
+ /** Whether this is a layout file. */
80
+ isLayout: boolean;
81
+ /** Whether this is an error boundary file. */
82
+ isError: boolean;
83
+ /** Whether this is a loading fallback file. */
84
+ isLoading: boolean;
85
+ /** Whether this is a not-found (404) file. */
86
+ isNotFound: boolean;
87
+ /** Whether this is a catch-all route. */
88
+ isCatchAll: boolean;
89
+ /** Resolved rendering mode. */
90
+ renderMode: RenderMode;
91
+ }
92
+ /** Entry mapping a URL pattern to its route-level middleware. */
93
+ export interface RouteMiddlewareEntry {
94
+ pattern: string;
95
+ middleware: Middleware | Middleware[];
96
+ }
97
+ export interface Adapter {
98
+ name: string;
99
+ /** Build the production server/output for this adapter. */
100
+ build(options: AdapterBuildOptions): Promise<void>;
101
+ }
102
+ export interface AdapterBuildOptions {
103
+ /** Path to the built server entry. */
104
+ serverEntry: string;
105
+ /** Path to the client build output. */
106
+ clientOutDir: string;
107
+ /** Final output directory. */
108
+ outDir: string;
109
+ config: ZeroConfig;
110
+ }
111
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAIhD,kEAAkE;AAClE,MAAM,WAAW,WAAW;IAC1B,4CAA4C;IAC5C,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,qEAAqE;IACrE,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,mDAAmD;IACnD,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACjD,4BAA4B;IAC5B,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAA;IACtC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,sBAAsB;IACtB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAED,uCAAuC;AACvC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,MAAM,EAAE,WAAW,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,0BAA0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C;IACvC,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAA;IAClB,8CAA8C;IAC9C,UAAU,EAAE,OAAO,CAAA;IACnB,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAA;IACnB,+BAA+B;IAC/B,UAAU,EAAE,UAAU,CAAA;CACvB;AAID,iEAAiE;AACjE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,GAAG,UAAU,EAAE,CAAA;CACtC;AAID,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,2DAA2D;IAC3D,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnD;AAED,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAA;IACpB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,UAAU,CAAA;CACnB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Observes an element and calls `onIntersect` once it enters the viewport.
3
+ * Automatically disconnects after the first intersection.
4
+ *
5
+ * @param getElement - Getter for the target element (may be undefined before mount).
6
+ * @param onIntersect - Callback fired when the element becomes visible.
7
+ * @param rootMargin - IntersectionObserver rootMargin. Default: "200px".
8
+ */
9
+ export declare function useIntersectionObserver(getElement: () => HTMLElement | undefined, onIntersect: () => void, rootMargin?: string): void;
10
+ //# sourceMappingURL=use-intersection-observer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-intersection-observer.d.ts","sourceRoot":"","sources":["../../../src/utils/use-intersection-observer.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,WAAW,GAAG,SAAS,EACzC,WAAW,EAAE,MAAM,IAAI,EACvB,UAAU,SAAU,QAsBrB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Clone a Response with modified headers.
3
+ * Avoids repeating the `new Response(body, { status, statusText, headers })` pattern.
4
+ */
5
+ export declare function withHeaders(response: Response, modify: (headers: Headers) => void): Response;
6
+ //# sourceMappingURL=with-headers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-headers.d.ts","sourceRoot":"","sources":["../../../src/utils/with-headers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,QAAQ,CAQ5F"}
@@ -0,0 +1,17 @@
1
+ import type { Plugin } from 'vite';
2
+ import type { ZeroConfig } from "./types";
3
+ /**
4
+ * Zero Vite plugin — adds file-based routing and zero-config conventions
5
+ * on top of @pyreon/vite-plugin.
6
+ *
7
+ * @example
8
+ * // vite.config.ts
9
+ * import pyreon from "@pyreon/vite-plugin"
10
+ * import zero from "@pyreon/zero"
11
+ *
12
+ * export default {
13
+ * plugins: [pyreon(), zero()],
14
+ * }
15
+ */
16
+ export declare function zeroPlugin(userConfig?: ZeroConfig): Plugin;
17
+ //# sourceMappingURL=vite-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AA4BlC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAW1C;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,UAAU,GAAE,UAAe,GAAG,MAAM,CAuK9D"}