@pyreon/zero 0.12.2 → 0.12.4

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 (145) hide show
  1. package/lib/actions.js +97 -0
  2. package/lib/actions.js.map +1 -0
  3. package/lib/ai.js +503 -0
  4. package/lib/ai.js.map +1 -0
  5. package/lib/api-routes.js +137 -0
  6. package/lib/api-routes.js.map +1 -0
  7. package/lib/compression.js +80 -0
  8. package/lib/compression.js.map +1 -0
  9. package/lib/cors.js +57 -0
  10. package/lib/cors.js.map +1 -0
  11. package/lib/csp.js +119 -0
  12. package/lib/csp.js.map +1 -0
  13. package/lib/env.js +217 -0
  14. package/lib/env.js.map +1 -0
  15. package/lib/favicon.js +424 -0
  16. package/lib/favicon.js.map +1 -0
  17. package/lib/i18n-routing.js +167 -0
  18. package/lib/i18n-routing.js.map +1 -0
  19. package/lib/index.js +340 -4015
  20. package/lib/index.js.map +1 -1
  21. package/lib/link.js +5 -0
  22. package/lib/link.js.map +1 -1
  23. package/lib/logger.js +78 -0
  24. package/lib/logger.js.map +1 -0
  25. package/lib/meta.js +310 -0
  26. package/lib/meta.js.map +1 -0
  27. package/lib/middleware.js +53 -0
  28. package/lib/middleware.js.map +1 -0
  29. package/lib/og-image.js +233 -0
  30. package/lib/og-image.js.map +1 -0
  31. package/lib/rate-limit.js +76 -0
  32. package/lib/rate-limit.js.map +1 -0
  33. package/lib/server.js +1534 -0
  34. package/lib/server.js.map +1 -0
  35. package/lib/testing.js +179 -0
  36. package/lib/testing.js.map +1 -0
  37. package/lib/theme.js +11 -2
  38. package/lib/theme.js.map +1 -1
  39. package/lib/types/actions.d.ts +27 -24
  40. package/lib/types/actions.d.ts.map +1 -1
  41. package/lib/types/ai.d.ts +76 -95
  42. package/lib/types/ai.d.ts.map +1 -1
  43. package/lib/types/api-routes.d.ts +37 -33
  44. package/lib/types/api-routes.d.ts.map +1 -1
  45. package/lib/types/cache.d.ts +26 -22
  46. package/lib/types/cache.d.ts.map +1 -1
  47. package/lib/types/client.d.ts +13 -9
  48. package/lib/types/client.d.ts.map +1 -1
  49. package/lib/types/compression.d.ts +14 -10
  50. package/lib/types/compression.d.ts.map +1 -1
  51. package/lib/types/config.d.ts +39 -4
  52. package/lib/types/config.d.ts.map +1 -1
  53. package/lib/types/cors.d.ts +20 -16
  54. package/lib/types/cors.d.ts.map +1 -1
  55. package/lib/types/csp.d.ts +42 -61
  56. package/lib/types/csp.d.ts.map +1 -1
  57. package/lib/types/env.d.ts +26 -26
  58. package/lib/types/env.d.ts.map +1 -1
  59. package/lib/types/favicon.d.ts +58 -54
  60. package/lib/types/favicon.d.ts.map +1 -1
  61. package/lib/types/font.d.ts +68 -65
  62. package/lib/types/font.d.ts.map +1 -1
  63. package/lib/types/i18n-routing.d.ts +43 -37
  64. package/lib/types/i18n-routing.d.ts.map +1 -1
  65. package/lib/types/image-plugin.d.ts +49 -45
  66. package/lib/types/image-plugin.d.ts.map +1 -1
  67. package/lib/types/image.d.ts +47 -36
  68. package/lib/types/image.d.ts.map +1 -1
  69. package/lib/types/index.d.ts +594 -56
  70. package/lib/types/index.d.ts.map +1 -1
  71. package/lib/types/link.d.ts +61 -56
  72. package/lib/types/link.d.ts.map +1 -1
  73. package/lib/types/logger.d.ts +37 -48
  74. package/lib/types/logger.d.ts.map +1 -1
  75. package/lib/types/meta.d.ts +145 -105
  76. package/lib/types/meta.d.ts.map +1 -1
  77. package/lib/types/middleware.d.ts +8 -4
  78. package/lib/types/middleware.d.ts.map +1 -1
  79. package/lib/types/og-image.d.ts +63 -59
  80. package/lib/types/og-image.d.ts.map +1 -1
  81. package/lib/types/rate-limit.d.ts +20 -16
  82. package/lib/types/rate-limit.d.ts.map +1 -1
  83. package/lib/types/script.d.ts +23 -19
  84. package/lib/types/script.d.ts.map +1 -1
  85. package/lib/types/seo.d.ts +47 -43
  86. package/lib/types/seo.d.ts.map +1 -1
  87. package/lib/types/server.d.ts +455 -0
  88. package/lib/types/server.d.ts.map +1 -0
  89. package/lib/types/testing.d.ts +64 -27
  90. package/lib/types/testing.d.ts.map +1 -1
  91. package/lib/types/theme.d.ts +22 -12
  92. package/lib/types/theme.d.ts.map +1 -1
  93. package/package.json +17 -12
  94. package/src/actions.ts +1 -3
  95. package/src/adapters/bun.ts +2 -0
  96. package/src/adapters/cloudflare.ts +2 -0
  97. package/src/adapters/netlify.ts +2 -0
  98. package/src/adapters/node.ts +2 -0
  99. package/src/adapters/validate.ts +16 -0
  100. package/src/adapters/vercel.ts +2 -0
  101. package/src/compression.ts +19 -3
  102. package/src/entry-server.ts +28 -5
  103. package/src/index.ts +20 -182
  104. package/src/link.tsx +6 -0
  105. package/src/meta.tsx +78 -16
  106. package/src/rate-limit.ts +11 -9
  107. package/src/server.ts +70 -0
  108. package/src/theme.tsx +12 -1
  109. package/src/vite-plugin.ts +5 -1
  110. package/lib/fs-router-Dil4IKZR.js +0 -290
  111. package/lib/fs-router-Dil4IKZR.js.map +0 -1
  112. package/lib/types/adapters/bun.d.ts +0 -6
  113. package/lib/types/adapters/bun.d.ts.map +0 -1
  114. package/lib/types/adapters/cloudflare.d.ts +0 -26
  115. package/lib/types/adapters/cloudflare.d.ts.map +0 -1
  116. package/lib/types/adapters/index.d.ts +0 -13
  117. package/lib/types/adapters/index.d.ts.map +0 -1
  118. package/lib/types/adapters/netlify.d.ts +0 -21
  119. package/lib/types/adapters/netlify.d.ts.map +0 -1
  120. package/lib/types/adapters/node.d.ts +0 -6
  121. package/lib/types/adapters/node.d.ts.map +0 -1
  122. package/lib/types/adapters/static.d.ts +0 -7
  123. package/lib/types/adapters/static.d.ts.map +0 -1
  124. package/lib/types/adapters/vercel.d.ts +0 -21
  125. package/lib/types/adapters/vercel.d.ts.map +0 -1
  126. package/lib/types/app.d.ts +0 -24
  127. package/lib/types/app.d.ts.map +0 -1
  128. package/lib/types/entry-server.d.ts +0 -37
  129. package/lib/types/entry-server.d.ts.map +0 -1
  130. package/lib/types/error-overlay.d.ts +0 -6
  131. package/lib/types/error-overlay.d.ts.map +0 -1
  132. package/lib/types/fs-router.d.ts +0 -47
  133. package/lib/types/fs-router.d.ts.map +0 -1
  134. package/lib/types/isr.d.ts +0 -9
  135. package/lib/types/isr.d.ts.map +0 -1
  136. package/lib/types/not-found.d.ts +0 -7
  137. package/lib/types/not-found.d.ts.map +0 -1
  138. package/lib/types/types.d.ts +0 -111
  139. package/lib/types/types.d.ts.map +0 -1
  140. package/lib/types/utils/use-intersection-observer.d.ts +0 -10
  141. package/lib/types/utils/use-intersection-observer.d.ts.map +0 -1
  142. package/lib/types/utils/with-headers.d.ts +0 -6
  143. package/lib/types/utils/with-headers.d.ts.map +0 -1
  144. package/lib/types/vite-plugin.d.ts +0 -17
  145. package/lib/types/vite-plugin.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAIvD,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,+CAA+C;IAC/C,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IACzB,+CAA+C;IAC/C,IAAI,EAAE,OAAO,CAAA;IACb,uBAAuB;IACvB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wCAAwC;AACxC,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,GAAG,EAAE,aAAa,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAE/E,mDAAmD;AACnD,UAAU,gBAAgB;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,aAAa,CAAA;CACvB;AAED,4DAA4D;AAC5D,MAAM,WAAW,MAAM,CAAC,CAAC,GAAG,OAAO;IACjC,sCAAsC;IACtC,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,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GED
@@ -1,68 +1,47 @@
1
- /**
2
- * AI integration utilities for Zero.
3
- *
4
- * - llms.txt auto-generation from routes and API routes
5
- * - JSON-LD auto-inference from route meta + Meta props
6
- * - AI plugin manifest (/.well-known/ai-plugin.json) from API routes
7
- *
8
- * @example
9
- * ```ts
10
- * // vite.config.ts
11
- * import { aiPlugin } from "@pyreon/zero/ai"
12
- *
13
- * export default {
14
- * plugins: [
15
- * aiPlugin({
16
- * name: "My App",
17
- * origin: "https://example.com",
18
- * description: "A modern web application",
19
- * }),
20
- * ],
21
- * }
22
- * ```
23
- */
24
- import type { Plugin } from 'vite';
25
- export interface AiPluginConfig {
26
- /** App/API name. */
27
- name: string;
28
- /** App description for AI agents. */
29
- description: string;
30
- /** Base URL. e.g. "https://example.com" */
31
- origin: string;
32
- /** Contact email (required by OpenAI plugin spec). */
33
- contactEmail?: string;
34
- /** Legal info URL. */
35
- legalUrl?: string;
36
- /** Logo URL for the plugin. */
37
- logoUrl?: string;
38
- /** Routes directory relative to project root. Default: "src/routes" */
39
- routesDir?: string;
40
- /** API routes directory relative to project root. Default: "src/api" */
41
- apiDir?: string;
42
- /**
43
- * API route descriptions — map of pattern to description.
44
- * Used for llms.txt and ai-plugin.json.
45
- *
46
- * @example
47
- * ```ts
48
- * apiDescriptions: {
49
- * "GET /api/posts": "List all blog posts, supports ?page=N&limit=N",
50
- * "GET /api/posts/:id": "Get a single post by ID",
51
- * "POST /api/posts": "Create a new post (requires auth)",
52
- * }
53
- * ```
54
- */
55
- apiDescriptions?: Record<string, string>;
56
- /**
57
- * Page descriptions — map of URL path to description.
58
- * Used for llms.txt. Falls back to route meta.title/description.
59
- */
60
- pageDescriptions?: Record<string, string>;
61
- /**
62
- * Additional content to append to llms.txt.
63
- * Useful for authentication instructions, rate limits, etc.
64
- */
65
- llmsExtra?: string;
1
+ import { Plugin } from "vite";
2
+
3
+ //#region src/ai.d.ts
4
+ interface AiPluginConfig {
5
+ /** App/API name. */
6
+ name: string;
7
+ /** App description for AI agents. */
8
+ description: string;
9
+ /** Base URL. e.g. "https://example.com" */
10
+ origin: string;
11
+ /** Contact email (required by OpenAI plugin spec). */
12
+ contactEmail?: string;
13
+ /** Legal info URL. */
14
+ legalUrl?: string;
15
+ /** Logo URL for the plugin. */
16
+ logoUrl?: string;
17
+ /** Routes directory relative to project root. Default: "src/routes" */
18
+ routesDir?: string;
19
+ /** API routes directory relative to project root. Default: "src/api" */
20
+ apiDir?: string;
21
+ /**
22
+ * API route descriptions — map of pattern to description.
23
+ * Used for llms.txt and ai-plugin.json.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * apiDescriptions: {
28
+ * "GET /api/posts": "List all blog posts, supports ?page=N&limit=N",
29
+ * "GET /api/posts/:id": "Get a single post by ID",
30
+ * "POST /api/posts": "Create a new post (requires auth)",
31
+ * }
32
+ * ```
33
+ */
34
+ apiDescriptions?: Record<string, string>;
35
+ /**
36
+ * Page descriptions — map of URL path to description.
37
+ * Used for llms.txt. Falls back to route meta.title/description.
38
+ */
39
+ pageDescriptions?: Record<string, string>;
40
+ /**
41
+ * Additional content to append to llms.txt.
42
+ * Useful for authentication instructions, rate limits, etc.
43
+ */
44
+ llmsExtra?: string;
66
45
  }
67
46
  /**
68
47
  * Generate llms.txt content from route files and config.
@@ -81,38 +60,38 @@ export interface AiPluginConfig {
81
60
  *
82
61
  * @internal Exported for testing.
83
62
  */
84
- export declare function generateLlmsTxt(routeFiles: string[], apiFiles: string[], config: AiPluginConfig): string;
63
+ declare function generateLlmsTxt(routeFiles: string[], apiFiles: string[], config: AiPluginConfig): string;
85
64
  /**
86
65
  * Generate llms-full.txt — expanded version with more detail.
87
66
  * Includes all route metadata and API descriptions.
88
67
  *
89
68
  * @internal Exported for testing.
90
69
  */
91
- export declare function generateLlmsFullTxt(routeFiles: string[], apiFiles: string[], config: AiPluginConfig): string;
92
- export interface InferJsonLdOptions {
93
- /** Page URL. */
70
+ declare function generateLlmsFullTxt(routeFiles: string[], apiFiles: string[], config: AiPluginConfig): string;
71
+ interface InferJsonLdOptions {
72
+ /** Page URL. */
73
+ url: string;
74
+ /** Page title. */
75
+ title?: string;
76
+ /** Page description. */
77
+ description?: string;
78
+ /** Page image. */
79
+ image?: string;
80
+ /** Site name. */
81
+ siteName?: string;
82
+ /** Page type hint. */
83
+ type?: 'website' | 'article' | 'product' | 'profile';
84
+ /** Article metadata. */
85
+ publishedTime?: string;
86
+ /** Article author. */
87
+ author?: string;
88
+ /** Article tags. */
89
+ tags?: string[];
90
+ /** Breadcrumb path segments. */
91
+ breadcrumbs?: Array<{
92
+ name: string;
94
93
  url: string;
95
- /** Page title. */
96
- title?: string;
97
- /** Page description. */
98
- description?: string;
99
- /** Page image. */
100
- image?: string;
101
- /** Site name. */
102
- siteName?: string;
103
- /** Page type hint. */
104
- type?: 'website' | 'article' | 'product' | 'profile';
105
- /** Article metadata. */
106
- publishedTime?: string;
107
- /** Article author. */
108
- author?: string;
109
- /** Article tags. */
110
- tags?: string[];
111
- /** Breadcrumb path segments. */
112
- breadcrumbs?: Array<{
113
- name: string;
114
- url: string;
115
- }>;
94
+ }>;
116
95
  }
117
96
  /**
118
97
  * Auto-infer JSON-LD structured data from page metadata.
@@ -133,7 +112,7 @@ export interface InferJsonLdOptions {
133
112
  * // → [Article schema, BreadcrumbList schema]
134
113
  * ```
135
114
  */
136
- export declare function inferJsonLd(options: InferJsonLdOptions): Record<string, unknown>[];
115
+ declare function inferJsonLd(options: InferJsonLdOptions): Record<string, unknown>[];
137
116
  /**
138
117
  * Generate an OpenAI-compatible AI plugin manifest.
139
118
  *
@@ -141,13 +120,13 @@ export declare function inferJsonLd(options: InferJsonLdOptions): Record<string,
141
120
  *
142
121
  * @internal Exported for testing.
143
122
  */
144
- export declare function generateAiPluginManifest(config: AiPluginConfig): Record<string, unknown>;
123
+ declare function generateAiPluginManifest(config: AiPluginConfig): Record<string, unknown>;
145
124
  /**
146
125
  * Generate a minimal OpenAPI 3.0 spec from API route descriptions.
147
126
  *
148
127
  * @internal Exported for testing.
149
128
  */
150
- export declare function generateOpenApiSpec(apiFiles: string[], config: AiPluginConfig): Record<string, unknown>;
129
+ declare function generateOpenApiSpec(apiFiles: string[], config: AiPluginConfig): Record<string, unknown>;
151
130
  /**
152
131
  * AI integration Vite plugin.
153
132
  *
@@ -178,5 +157,7 @@ export declare function generateOpenApiSpec(apiFiles: string[], config: AiPlugin
178
157
  * }
179
158
  * ```
180
159
  */
181
- export declare function aiPlugin(config: AiPluginConfig): Plugin;
182
- //# sourceMappingURL=ai.d.ts.map
160
+ declare function aiPlugin(config: AiPluginConfig): Plugin;
161
+ //#endregion
162
+ export { AiPluginConfig, InferJsonLdOptions, aiPlugin, generateAiPluginManifest, generateLlmsFullTxt, generateLlmsTxt, generateOpenApiSpec, inferJsonLd };
163
+ //# sourceMappingURL=ai2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/ai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAKlC,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MA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A;;;;;;iBAuBlD,mBAAA,CACd,QAAA,YACA,MAAA,EAAQ,cAAA,GACP,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8Ea,QAAA,CAAS,MAAA,EAAQ,cAAA,GAAiB,MAAA"}
@@ -1,53 +1,55 @@
1
- import type { Middleware } from '@pyreon/server';
1
+ import { Middleware } from "@pyreon/server";
2
+
3
+ //#region src/api-routes.d.ts
2
4
  /** HTTP methods supported by API routes. */
3
- export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
5
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
4
6
  /** Context passed to API route handlers. */
5
- export interface ApiContext {
6
- /** The incoming request. */
7
- request: Request;
8
- /** Parsed URL. */
9
- url: URL;
10
- /** URL path. */
11
- path: string;
12
- /** Dynamic route parameters (e.g., { id: "123" }). */
13
- params: Record<string, string>;
14
- /** Request headers. */
15
- headers: Headers;
7
+ interface ApiContext {
8
+ /** The incoming request. */
9
+ request: Request;
10
+ /** Parsed URL. */
11
+ url: URL;
12
+ /** URL path. */
13
+ path: string;
14
+ /** Dynamic route parameters (e.g., { id: "123" }). */
15
+ params: Record<string, string>;
16
+ /** Request headers. */
17
+ headers: Headers;
16
18
  }
17
19
  /** An API route handler function. */
18
- export type ApiHandler = (ctx: ApiContext) => Response | Promise<Response>;
20
+ type ApiHandler = (ctx: ApiContext) => Response | Promise<Response>;
19
21
  /** An API route module — exports named HTTP method handlers. */
20
- export interface ApiRouteModule {
21
- GET?: ApiHandler;
22
- POST?: ApiHandler;
23
- PUT?: ApiHandler;
24
- PATCH?: ApiHandler;
25
- DELETE?: ApiHandler;
26
- HEAD?: ApiHandler;
27
- OPTIONS?: ApiHandler;
22
+ interface ApiRouteModule {
23
+ GET?: ApiHandler;
24
+ POST?: ApiHandler;
25
+ PUT?: ApiHandler;
26
+ PATCH?: ApiHandler;
27
+ DELETE?: ApiHandler;
28
+ HEAD?: ApiHandler;
29
+ OPTIONS?: ApiHandler;
28
30
  }
29
31
  /** A registered API route entry. */
30
- export interface ApiRouteEntry {
31
- /** URL pattern (e.g., "/api/posts/:id"). */
32
- pattern: string;
33
- /** The route module with method handlers. */
34
- module: ApiRouteModule;
32
+ interface ApiRouteEntry {
33
+ /** URL pattern (e.g., "/api/posts/:id"). */
34
+ pattern: string;
35
+ /** The route module with method handlers. */
36
+ module: ApiRouteModule;
35
37
  }
36
38
  /**
37
39
  * Match a URL path against an API route pattern.
38
40
  * Returns extracted params or null if no match.
39
41
  */
40
- export declare function matchApiRoute(pattern: string, path: string): Record<string, string> | null;
42
+ declare function matchApiRoute(pattern: string, path: string): Record<string, string> | null;
41
43
  /**
42
44
  * Create a middleware that dispatches API route requests.
43
45
  * API routes are matched by URL pattern and HTTP method.
44
46
  */
45
- export declare function createApiMiddleware(routes: ApiRouteEntry[]): Middleware;
47
+ declare function createApiMiddleware(routes: ApiRouteEntry[]): Middleware;
46
48
  /**
47
49
  * Detect whether a route file is an API route.
48
50
  * API routes are `.ts` or `.js` files inside an `api/` directory.
49
51
  */
50
- export declare function isApiRoute(filePath: string): boolean;
52
+ declare function isApiRoute(filePath: string): boolean;
51
53
  /**
52
54
  * Convert an API route file path to a URL pattern.
53
55
  *
@@ -57,10 +59,12 @@ export declare function isApiRoute(filePath: string): boolean;
57
59
  * "api/posts/[id].ts" → "/api/posts/:id"
58
60
  * "api/[...path].ts" → "/api/:path*"
59
61
  */
60
- export declare function apiFilePathToPattern(filePath: string): string;
62
+ declare function apiFilePathToPattern(filePath: string): string;
61
63
  /**
62
64
  * Generate a virtual module that exports API route entries.
63
65
  * Each entry maps a URL pattern to a module with HTTP method handlers.
64
66
  */
65
- export declare function generateApiRouteModule(files: string[], routesDir: string): string;
66
- //# sourceMappingURL=api-routes.d.ts.map
67
+ declare function generateApiRouteModule(files: string[], routesDir: string): string;
68
+ //#endregion
69
+ export { ApiContext, ApiHandler, ApiRouteEntry, ApiRouteModule, HttpMethod, apiFilePathToPattern, createApiMiddleware, generateApiRouteModule, isApiRoute, matchApiRoute };
70
+ //# sourceMappingURL=api-routes2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-routes.d.ts","sourceRoot":"","sources":["../../src/api-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAA;AAInE,4CAA4C;AAC5C,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAA;AAEzF,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IACzB,4BAA4B;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,kBAAkB;IAClB,GAAG,EAAE,GAAG,CAAA;IACR,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,uBAAuB;IACvB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,qCAAqC;AACrC,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,UAAU,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAE1E,gEAAgE;AAChE,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,UAAU,CAAA;IAChB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,GAAG,CAAC,EAAE,UAAU,CAAA;IAChB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,OAAO,CAAC,EAAE,UAAU,CAAA;CACrB;AAED,oCAAoC;AACpC,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAA;IACf,6CAA6C;IAC7C,MAAM,EAA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iBAsC9C,UAAA,CAAW,QAAA;;;;;;;;;;iBAmBX,oBAAA,CAAqB,QAAA;;;;;iBAwCrB,sBAAA,CAAuB,KAAA,YAAiB,SAAA"}
@@ -1,24 +1,26 @@
1
- import type { Middleware } from '@pyreon/server';
2
- export interface CacheConfig {
3
- /** Cache duration for immutable hashed assets (seconds). Default: 31536000 (1 year) */
4
- immutable?: number;
5
- /** Cache duration for static assets like images/fonts (seconds). Default: 86400 (1 day) */
6
- static?: number;
7
- /** Cache duration for pages (seconds). Default: 0 (no cache) */
8
- pages?: number;
9
- /** Stale-while-revalidate window for pages (seconds). Default: 60 */
10
- staleWhileRevalidate?: number;
11
- /** Custom rules by URL pattern. */
12
- rules?: CacheRule[];
1
+ import { Middleware } from "@pyreon/server";
2
+
3
+ //#region src/cache.d.ts
4
+ interface CacheConfig {
5
+ /** Cache duration for immutable hashed assets (seconds). Default: 31536000 (1 year) */
6
+ immutable?: number;
7
+ /** Cache duration for static assets like images/fonts (seconds). Default: 86400 (1 day) */
8
+ static?: number;
9
+ /** Cache duration for pages (seconds). Default: 0 (no cache) */
10
+ pages?: number;
11
+ /** Stale-while-revalidate window for pages (seconds). Default: 60 */
12
+ staleWhileRevalidate?: number;
13
+ /** Custom rules by URL pattern. */
14
+ rules?: CacheRule[];
13
15
  }
14
- export interface CacheRule {
15
- /** URL pattern to match (glob-style). e.g. "/api/*" */
16
- match: string;
17
- /** Cache-Control header value. */
18
- control: string;
16
+ interface CacheRule {
17
+ /** URL pattern to match (glob-style). e.g. "/api/*" */
18
+ match: string;
19
+ /** Cache-Control header value. */
20
+ control: string;
19
21
  }
20
22
  /** @internal Exported for testing */
21
- export declare function matchGlob(pattern: string, path: string): boolean;
23
+ declare function matchGlob(pattern: string, path: string): boolean;
22
24
  /**
23
25
  * Cache control middleware for Zero.
24
26
  * Sets Cache-Control headers on the response based on asset type.
@@ -39,16 +41,18 @@ export declare function matchGlob(pattern: string, path: string): boolean;
39
41
  * ],
40
42
  * })
41
43
  */
42
- export declare function cacheMiddleware(config?: CacheConfig): Middleware;
44
+ declare function cacheMiddleware(config?: CacheConfig): Middleware;
43
45
  /**
44
46
  * Security headers middleware.
45
47
  * Adds common security headers to all responses.
46
48
  */
47
- export declare function securityHeaders(): Middleware;
49
+ declare function securityHeaders(): Middleware;
48
50
  /**
49
51
  * Compression detection middleware.
50
52
  * Sets Vary: Accept-Encoding header so caches can serve compressed variants.
51
53
  * Actual compression is handled by the runtime (Bun/Node) or reverse proxy.
52
54
  */
53
- export declare function varyEncoding(): Middleware;
54
- //# sourceMappingURL=cache.d.ts.map
55
+ declare function varyEncoding(): Middleware;
56
+ //#endregion
57
+ export { CacheConfig, CacheRule, cacheMiddleware, matchGlob, securityHeaders, varyEncoding };
58
+ //# sourceMappingURL=cache2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAA;AAanE,MAAM,WAAW,WAAW;IAC1B,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAA;CAChB;AAMD,qCAAqC;AACrC,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKhE;AAwBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,MAAM,GAAE,WAAgB,GAAG,UAAU,CAoBpE;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,UAAU,CAQ5C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,UAAU,CAOzC"}
1
+ {"version":3,"file":"cache2.d.ts","names":[],"sources":["../../../src/cache.ts"],"mappings":";;;UAaiB,WAAA;;EAEf,SAAA;EAF0B;EAI1B,MAAA;EAMiB;EAJjB,KAAA;EAFA;EAIA,oBAAA;EAAA;EAEA,KAAA,GAAQ,SAAA;AAAA;AAAA,UAGO,SAAA;EAHE;EAKjB,KAAA;EAFwB;EAIxB,OAAA;AAAA;;iBAQc,SAAA,CAAU,OAAA,UAAiB,IAAA;;;;;AAiD3C;;;;;;;;;AA0BA;;;;;AAeA;;iBAzCgB,eAAA,CAAgB,MAAA,GAAQ,WAAA,GAAmB,UAAA;;;;;iBA0B3C,eAAA,CAAA,GAAmB,UAAA;;;;;;iBAenB,YAAA,CAAA,GAAgB,UAAA"}
@@ -1,10 +1,12 @@
1
- import type { ComponentFn } from '@pyreon/core';
2
- import type { RouteRecord } from '@pyreon/router';
3
- export interface StartClientOptions {
4
- /** Route definitions. */
5
- routes: RouteRecord[];
6
- /** Root layout component. */
7
- layout?: ComponentFn;
1
+ import { ComponentFn } from "@pyreon/core";
2
+ import { RouteRecord } from "@pyreon/router";
3
+
4
+ //#region src/client.d.ts
5
+ interface StartClientOptions {
6
+ /** Route definitions. */
7
+ routes: RouteRecord[];
8
+ /** Root layout component. */
9
+ layout?: ComponentFn;
8
10
  }
9
11
  /**
10
12
  * Start the client-side app — hydrates SSR content or mounts fresh for SPA.
@@ -15,5 +17,7 @@ export interface StartClientOptions {
15
17
  *
16
18
  * startClient({ routes })
17
19
  */
18
- export declare function startClient(options: StartClientOptions): () => void;
19
- //# sourceMappingURL=client.d.ts.map
20
+ declare function startClient(options: StartClientOptions): () => void;
21
+ //#endregion
22
+ export { StartClientOptions, startClient };
23
+ //# sourceMappingURL=client2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAMjD,MAAM,WAAW,kBAAkB;IACjC,yBAAyB;IACzB,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,cAkBtD"}
1
+ {"version":3,"file":"client2.d.ts","names":[],"sources":["../../../src/client.ts"],"mappings":";;;;UAQiB,kBAAA;;EAEf,MAAA,EAAQ,WAAA;EAFyB;EAIjC,MAAA,GAAS,WAAA;AAAA;;;;;;;AAYX;;;iBAAgB,WAAA,CAAY,OAAA,EAAS,kBAAA"}
@@ -1,9 +1,11 @@
1
- import type { Middleware } from '@pyreon/server';
2
- export interface CompressionConfig {
3
- /** Minimum response size in bytes to compress. Default: `1024` (1KB) */
4
- threshold?: number;
5
- /** Encoding preference order. Default: `["gzip", "deflate"]` */
6
- encodings?: ('gzip' | 'deflate')[];
1
+ import { Middleware } from "@pyreon/server";
2
+
3
+ //#region src/compression.d.ts
4
+ interface CompressionConfig {
5
+ /** Minimum response size in bytes to compress. Default: `1024` (1KB) */
6
+ threshold?: number;
7
+ /** Encoding preference order. Default: `["gzip", "deflate"]` */
8
+ encodings?: ('gzip' | 'deflate')[];
7
9
  }
8
10
  /**
9
11
  * Compression middleware — compresses responses using gzip or deflate
@@ -18,7 +20,7 @@ export interface CompressionConfig {
18
20
  * compressionMiddleware() // gzip with 1KB threshold
19
21
  * compressionMiddleware({ threshold: 512, encodings: ["gzip"] })
20
22
  */
21
- export declare function compressionMiddleware(config?: CompressionConfig): Middleware;
23
+ declare function compressionMiddleware(config?: CompressionConfig): Middleware;
22
24
  /**
23
25
  * Compress a Response body if it meets the criteria.
24
26
  * Use this to post-process responses after the handler runs.
@@ -27,7 +29,9 @@ export declare function compressionMiddleware(config?: CompressionConfig): Middl
27
29
  * const response = await handler(request)
28
30
  * const compressed = await compressResponse(response, 'gzip', 1024)
29
31
  */
30
- export declare function compressResponse(response: Response, encoding: 'gzip' | 'deflate', threshold: number): Promise<Response>;
32
+ declare function compressResponse(response: Response, encoding: 'gzip' | 'deflate', threshold: number): Promise<Response>;
31
33
  /** Check if a content type is compressible. Exported for testing. */
32
- export declare function isCompressible(contentType: string): boolean;
33
- //# sourceMappingURL=compression.d.ts.map
34
+ declare function isCompressible(contentType: string): boolean;
35
+ //#endregion
36
+ export { CompressionConfig, compressResponse, compressionMiddleware, isCompressible };
37
+ //# sourceMappingURL=compression2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compression.d.ts","sourceRoot":"","sources":["../../src/compression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAA;AAInE,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gEAAgE;IAChE,SAAS,CAAC,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;CACnC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,iBAAsB,GAAG,UAAU,CAehF;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,QAAQ,CAAC,CA0BnB;AAWD,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE3D"}
1
+ {"version":3,"file":"compression2.d.ts","names":[],"sources":["../../../src/compression.ts"],"mappings":";;;UAIiB,iBAAA;;EAEf,SAAA;EAFgC;EAIhC,SAAA;AAAA;;AAgBF;;;;;;;;;AAyBA;;;iBAzBgB,qBAAA,CAAsB,MAAA,GAAQ,iBAAA,GAAyB,UAAA;;;;;;;;;iBAyBjD,gBAAA,CACpB,QAAA,EAAU,QAAA,EACV,QAAA,sBACA,SAAA,WACC,OAAA,CAAQ,QAAA;;iBAsCK,cAAA,CAAe,WAAA"}
@@ -1,4 +1,37 @@
1
- import type { ZeroConfig } from './types';
1
+ import { Middleware } from "@pyreon/server";
2
+
3
+ //#region src/types.d.ts
4
+ type RenderMode = 'ssr' | 'ssg' | 'spa' | 'isr';
5
+ interface ISRConfig {
6
+ /** Revalidation interval in seconds. */
7
+ revalidate: number;
8
+ }
9
+ interface ZeroConfig {
10
+ /** Default rendering mode. Default: "ssr" */
11
+ mode?: RenderMode;
12
+ /** Vite config overrides. */
13
+ vite?: Record<string, unknown>;
14
+ /** SSR options. */
15
+ ssr?: {
16
+ /** Streaming mode. Default: "string" */mode?: 'string' | 'stream';
17
+ };
18
+ /** SSG options — only used when mode is "ssg". */
19
+ ssg?: {
20
+ /** Paths to prerender (or function returning paths). */paths?: string[] | (() => string[] | Promise<string[]>);
21
+ };
22
+ /** ISR config — only used when mode is "isr". */
23
+ isr?: ISRConfig;
24
+ /** Deploy adapter. Default: "node" */
25
+ adapter?: 'node' | 'bun' | 'static' | 'vercel' | 'cloudflare' | 'netlify';
26
+ /** Base URL path. Default: "/" */
27
+ base?: string;
28
+ /** App-level middleware applied to all routes. */
29
+ middleware?: Middleware[];
30
+ /** Server port for dev/preview. Default: 3000 */
31
+ port?: number;
32
+ }
33
+ //#endregion
34
+ //#region src/config.d.ts
2
35
  /**
3
36
  * Define a Zero configuration.
4
37
  * Used in `zero.config.ts` at the project root.
@@ -12,7 +45,9 @@ import type { ZeroConfig } from './types';
12
45
  * port: 3000,
13
46
  * })
14
47
  */
15
- export declare function defineConfig(config: ZeroConfig): ZeroConfig;
48
+ declare function defineConfig(config: ZeroConfig): ZeroConfig;
16
49
  /** Merge user config with defaults. */
17
- export declare function resolveConfig(userConfig?: ZeroConfig): Required<Pick<ZeroConfig, 'mode' | 'base' | 'port' | 'adapter'>> & ZeroConfig;
18
- //# sourceMappingURL=config.d.ts.map
50
+ declare function resolveConfig(userConfig?: ZeroConfig): Required<Pick<ZeroConfig, 'mode' | 'base' | 'port' | 'adapter'>> & ZeroConfig;
51
+ //#endregion
52
+ export { defineConfig, resolveConfig };
53
+ //# sourceMappingURL=config2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAE3D;AAED,uCAAuC;AACvC,wBAAgB,aAAa,CAC3B,UAAU,GAAE,UAAe,GAC1B,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,UAAU,CAY/E"}
1
+ {"version":3,"file":"config2.d.ts","names":[],"sources":["../../../src/types.ts","../../../src/config.ts"],"mappings":";;;KA6CY,UAAA;AAAA,UAEK,SAAA;EAoCF;EAlCb,UAAA;AAAA;AAAA,UAKe,UAAA;;EAEf,IAAA,GAAO,UAAA;;EAGP,IAAA,GAAO,MAAA;EC5CmB;ED+C1B,GAAA;IC/C0D,wCDiDxD,IAAA;EAAA;ECjD8C;EDqDhD,GAAA;ICrD0D,wDDuDxD,KAAA,gCAAqC,OAAA;EAAA;;EAIvC,GAAA,GAAM,SAAA;ECpDS;EDuDf,OAAA;ECvDC;ED0DD,IAAA;EC1D8E;ED6D9E,UAAA,GAAa,UAAA;EC9DD;EDiEZ,IAAA;AAAA;;;;;;;AAzCF;;;;;AAEA;;;;iBChCgB,YAAA,CAAa,MAAA,EAAQ,UAAA,GAAa,UAAA;ADuClD;AAAA,iBClCgB,aAAA,CACd,UAAA,GAAY,UAAA,GACX,QAAA,CAAS,IAAA,CAAK,UAAA,2CAAqD,UAAA"}
@@ -1,17 +1,19 @@
1
- import type { Middleware } from '@pyreon/server';
2
- export interface CorsConfig {
3
- /** Allowed origins. Use `"*"` for any origin. Default: `"*"` */
4
- origin?: string | string[] | ((origin: string) => boolean);
5
- /** Allowed HTTP methods. Default: `["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]` */
6
- methods?: string[];
7
- /** Allowed request headers. Default: `["Content-Type", "Authorization"]` */
8
- allowedHeaders?: string[];
9
- /** Headers exposed to the client. Default: `[]` */
10
- exposedHeaders?: string[];
11
- /** Allow credentials (cookies, auth headers). Default: `false` */
12
- credentials?: boolean;
13
- /** Preflight cache duration in seconds. Default: `86400` (24 hours) */
14
- maxAge?: number;
1
+ import { Middleware } from "@pyreon/server";
2
+
3
+ //#region src/cors.d.ts
4
+ interface CorsConfig {
5
+ /** Allowed origins. Use `"*"` for any origin. Default: `"*"` */
6
+ origin?: string | string[] | ((origin: string) => boolean);
7
+ /** Allowed HTTP methods. Default: `["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]` */
8
+ methods?: string[];
9
+ /** Allowed request headers. Default: `["Content-Type", "Authorization"]` */
10
+ allowedHeaders?: string[];
11
+ /** Headers exposed to the client. Default: `[]` */
12
+ exposedHeaders?: string[];
13
+ /** Allow credentials (cookies, auth headers). Default: `false` */
14
+ credentials?: boolean;
15
+ /** Preflight cache duration in seconds. Default: `86400` (24 hours) */
16
+ maxAge?: number;
15
17
  }
16
18
  /**
17
19
  * CORS middleware — handles preflight requests and sets appropriate
@@ -28,5 +30,7 @@ export interface CorsConfig {
28
30
  * // Multiple origins
29
31
  * corsMiddleware({ origin: ["https://app.com", "https://admin.com"] })
30
32
  */
31
- export declare function corsMiddleware(config?: CorsConfig): Middleware;
32
- //# sourceMappingURL=cors.d.ts.map
33
+ declare function corsMiddleware(config?: CorsConfig): Middleware;
34
+ //#endregion
35
+ export { CorsConfig, corsMiddleware };
36
+ //# sourceMappingURL=cors2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../src/cors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAA;AAInE,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,CAAA;IAC1D,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAKD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,MAAM,GAAE,UAAe,GAAG,UAAU,CA0ClE"}
1
+ {"version":3,"file":"cors2.d.ts","names":[],"sources":["../../../src/cors.ts"],"mappings":";;;UAIiB,UAAA;;EAEf,MAAA,yBAA+B,MAAA;EAFN;EAIzB,OAAA;EAJyB;EAMzB,cAAA;EAJ+B;EAM/B,cAAA;EAFA;EAIA,WAAA;EAAA;EAEA,MAAA;AAAA;;AAqBF;;;;;;;;;;;;;;iBAAgB,cAAA,CAAe,MAAA,GAAQ,UAAA,GAAkB,UAAA"}