@farm.js/core 0.1.0-beta.11 → 0.1.0-beta.14

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 (238) hide show
  1. package/dist/chunk-53MVSX3R.mjs +168 -0
  2. package/dist/chunk-53MVSX3R.mjs.map +1 -0
  3. package/dist/{chunk-AW6I64AP.mjs → chunk-6ZXIQSXE.mjs} +16 -1
  4. package/dist/chunk-6ZXIQSXE.mjs.map +1 -0
  5. package/dist/chunk-7ZVN3YZI.mjs +333 -0
  6. package/dist/chunk-7ZVN3YZI.mjs.map +1 -0
  7. package/dist/{chunk-5EVQFRL2.mjs → chunk-ARCGE2VT.mjs} +2 -2
  8. package/dist/chunk-ARCGE2VT.mjs.map +1 -0
  9. package/dist/{chunk-7N62DNSO.mjs → chunk-H3TE3LOV.mjs} +2 -2
  10. package/dist/{chunk-QTZZ2ISQ.mjs → chunk-KLA67WKG.mjs} +1 -1
  11. package/dist/chunk-KLA67WKG.mjs.map +1 -0
  12. package/dist/{chunk-K5ZTUF22.mjs → chunk-L2PE36GQ.mjs} +7 -3
  13. package/dist/chunk-L2PE36GQ.mjs.map +1 -0
  14. package/dist/{chunk-4LND3PXF.mjs → chunk-OPHK6OJN.mjs} +513 -48
  15. package/dist/chunk-OPHK6OJN.mjs.map +1 -0
  16. package/dist/{chunk-77BOAQHI.mjs → chunk-PNFQQSRA.mjs} +754 -156
  17. package/dist/chunk-PNFQQSRA.mjs.map +1 -0
  18. package/dist/chunk-USLFXFFH.mjs +46 -0
  19. package/dist/chunk-USLFXFFH.mjs.map +1 -0
  20. package/dist/{chunk-4677KXB7.mjs → chunk-VUL55IAX.mjs} +368 -103
  21. package/dist/chunk-VUL55IAX.mjs.map +1 -0
  22. package/dist/client.cjs.map +1 -1
  23. package/dist/client.mjs +1 -1
  24. package/dist/{devtools-A22KUJZT.mjs → devtools-GAZ7F3KL.mjs} +4 -3
  25. package/dist/{devtools-A22KUJZT.mjs.map → devtools-GAZ7F3KL.mjs.map} +1 -1
  26. package/dist/docs.cjs +622 -124
  27. package/dist/docs.cjs.map +1 -1
  28. package/dist/docs.mjs +5 -3
  29. package/dist/font.cjs +19 -2
  30. package/dist/font.cjs.map +1 -1
  31. package/dist/font.mjs +7 -3
  32. package/dist/index.cjs +2235 -689
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.mjs +27 -19
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/internal/build-runtime.cjs +2062 -525
  37. package/dist/internal/build-runtime.cjs.map +1 -1
  38. package/dist/internal/build-runtime.mjs +13 -10
  39. package/dist/internal/client-runtime.cjs +169 -2
  40. package/dist/internal/client-runtime.cjs.map +1 -1
  41. package/dist/internal/client-runtime.mjs +170 -2
  42. package/dist/internal/client-runtime.mjs.map +1 -1
  43. package/dist/internal/config-runtime.cjs +22 -0
  44. package/dist/internal/config-runtime.cjs.map +1 -1
  45. package/dist/internal/config-runtime.mjs +3 -2
  46. package/dist/internal/metadata-image-runtime.cjs +199 -0
  47. package/dist/internal/metadata-image-runtime.cjs.map +1 -0
  48. package/dist/internal/metadata-image-runtime.mjs +8 -0
  49. package/dist/internal/metadata-image-runtime.mjs.map +1 -0
  50. package/dist/internal/production-runtime.cjs +310 -0
  51. package/dist/internal/production-runtime.cjs.map +1 -1
  52. package/dist/internal/production-runtime.mjs +10 -0
  53. package/dist/internal/production-runtime.mjs.map +1 -1
  54. package/dist/navigation.cjs.map +1 -1
  55. package/dist/navigation.mjs +2 -2
  56. package/dist/plugin.cjs +1550 -348
  57. package/dist/plugin.cjs.map +1 -1
  58. package/dist/plugin.mjs +9 -5
  59. package/dist/server.cjs +1663 -419
  60. package/dist/server.cjs.map +1 -1
  61. package/dist/server.mjs +17 -19
  62. package/dist/server.mjs.map +1 -1
  63. package/dist/version.cjs +1 -1
  64. package/dist/version.cjs.map +1 -1
  65. package/dist/version.mjs +1 -1
  66. package/dist/vite.cjs +1604 -358
  67. package/dist/vite.cjs.map +1 -1
  68. package/dist/vite.mjs +9 -5
  69. package/package.json +10 -1
  70. package/types/client.d.ts +115 -4
  71. package/dist/after.d.mts +0 -25
  72. package/dist/after.d.ts +0 -25
  73. package/dist/agent-runtime.d.mts +0 -94
  74. package/dist/agent-runtime.d.ts +0 -94
  75. package/dist/api/route-manager.d.mts +0 -66
  76. package/dist/api/route-manager.d.ts +0 -66
  77. package/dist/api/runtime.d.mts +0 -3
  78. package/dist/api/runtime.d.ts +0 -3
  79. package/dist/api.d.mts +0 -48
  80. package/dist/api.d.ts +0 -48
  81. package/dist/app-BNE2FoZ4.d.mts +0 -302
  82. package/dist/app-DRGUmJ3s.d.ts +0 -302
  83. package/dist/app-markdown.d.mts +0 -22
  84. package/dist/app-markdown.d.ts +0 -22
  85. package/dist/cache.d.mts +0 -192
  86. package/dist/cache.d.ts +0 -192
  87. package/dist/chunk-4677KXB7.mjs.map +0 -1
  88. package/dist/chunk-4LND3PXF.mjs.map +0 -1
  89. package/dist/chunk-5EVQFRL2.mjs.map +0 -1
  90. package/dist/chunk-77BOAQHI.mjs.map +0 -1
  91. package/dist/chunk-AW6I64AP.mjs.map +0 -1
  92. package/dist/chunk-K5ZTUF22.mjs.map +0 -1
  93. package/dist/chunk-QM746KUO.mjs +0 -56
  94. package/dist/chunk-QM746KUO.mjs.map +0 -1
  95. package/dist/chunk-QTZZ2ISQ.mjs.map +0 -1
  96. package/dist/client-BT1mFQas.d.mts +0 -447
  97. package/dist/client-Nn0q4eO4.d.ts +0 -447
  98. package/dist/client-cache-CIlyBlmx.d.ts +0 -6
  99. package/dist/client-cache-D-EZ7XVW.d.mts +0 -6
  100. package/dist/client-plugins-Bc5jHcNr.d.ts +0 -1927
  101. package/dist/client-plugins-jsk-ZLzJ.d.mts +0 -1927
  102. package/dist/client-plugins.d.mts +0 -22
  103. package/dist/client-plugins.d.ts +0 -22
  104. package/dist/client.d.mts +0 -447
  105. package/dist/client.d.ts +0 -447
  106. package/dist/config.d.mts +0 -29
  107. package/dist/config.d.ts +0 -29
  108. package/dist/cron.d.mts +0 -78
  109. package/dist/cron.d.ts +0 -78
  110. package/dist/deferred.d.mts +0 -42
  111. package/dist/deferred.d.ts +0 -42
  112. package/dist/deployment.d.mts +0 -34
  113. package/dist/deployment.d.ts +0 -34
  114. package/dist/docs.d.mts +0 -69
  115. package/dist/docs.d.ts +0 -69
  116. package/dist/env-types.d.mts +0 -12
  117. package/dist/env-types.d.ts +0 -12
  118. package/dist/env.d.mts +0 -45
  119. package/dist/env.d.ts +0 -45
  120. package/dist/environment/vite.d.mts +0 -22
  121. package/dist/environment/vite.d.ts +0 -22
  122. package/dist/environment.d.mts +0 -18
  123. package/dist/environment.d.ts +0 -18
  124. package/dist/font.d.mts +0 -70
  125. package/dist/font.d.ts +0 -70
  126. package/dist/headers.d.mts +0 -22
  127. package/dist/headers.d.ts +0 -22
  128. package/dist/i18n/client.d.mts +0 -32
  129. package/dist/i18n/client.d.ts +0 -32
  130. package/dist/i18n/index.d.mts +0 -20
  131. package/dist/i18n/index.d.ts +0 -20
  132. package/dist/i18n/server.d.mts +0 -30
  133. package/dist/i18n/server.d.ts +0 -30
  134. package/dist/image/server.d.mts +0 -37
  135. package/dist/image/server.d.ts +0 -37
  136. package/dist/image/sharp.d.mts +0 -7
  137. package/dist/image/sharp.d.ts +0 -7
  138. package/dist/image-config-Duob7wER.d.mts +0 -50
  139. package/dist/image-config-Duob7wER.d.ts +0 -50
  140. package/dist/image.d.mts +0 -39
  141. package/dist/image.d.ts +0 -39
  142. package/dist/index.d.mts +0 -455
  143. package/dist/index.d.ts +0 -455
  144. package/dist/integration-api-CHT2OKAf.d.mts +0 -93
  145. package/dist/integration-api-CHT2OKAf.d.ts +0 -93
  146. package/dist/integrations.d.mts +0 -22
  147. package/dist/integrations.d.ts +0 -22
  148. package/dist/internal/build-runtime.d.mts +0 -39
  149. package/dist/internal/build-runtime.d.ts +0 -39
  150. package/dist/internal/client-runtime.d.mts +0 -2
  151. package/dist/internal/client-runtime.d.ts +0 -2
  152. package/dist/internal/config-runtime.d.mts +0 -39
  153. package/dist/internal/config-runtime.d.ts +0 -39
  154. package/dist/internal/production-node-env.d.mts +0 -12
  155. package/dist/internal/production-node-env.d.ts +0 -12
  156. package/dist/internal/production-runtime.d.mts +0 -41
  157. package/dist/internal/production-runtime.d.ts +0 -41
  158. package/dist/markdown.d.mts +0 -60
  159. package/dist/markdown.d.ts +0 -60
  160. package/dist/metadata-7ffpT3jr.d.mts +0 -22
  161. package/dist/metadata-JHn-8eht.d.ts +0 -22
  162. package/dist/middleware.d.mts +0 -164
  163. package/dist/middleware.d.ts +0 -164
  164. package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
  165. package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
  166. package/dist/navigation.d.mts +0 -14
  167. package/dist/navigation.d.ts +0 -14
  168. package/dist/observability.d.mts +0 -335
  169. package/dist/observability.d.ts +0 -335
  170. package/dist/params-BALtrRim.d.ts +0 -15
  171. package/dist/params-ry-lxqmy.d.mts +0 -15
  172. package/dist/plugin-BJDf43dc.d.mts +0 -165
  173. package/dist/plugin-BJDf43dc.d.ts +0 -165
  174. package/dist/plugin.d.mts +0 -22
  175. package/dist/plugin.d.ts +0 -22
  176. package/dist/production-runtime-9KG7GuvW.d.ts +0 -79
  177. package/dist/production-runtime-B-fweKts.d.mts +0 -79
  178. package/dist/production-runtime-C_B79w2P.d.mts +0 -28
  179. package/dist/production-runtime-DDEM1D2q.d.ts +0 -28
  180. package/dist/query/client.d.mts +0 -61
  181. package/dist/query/client.d.ts +0 -61
  182. package/dist/query/index.d.mts +0 -90
  183. package/dist/query/index.d.ts +0 -90
  184. package/dist/query/parsers.d.mts +0 -25
  185. package/dist/query/parsers.d.ts +0 -25
  186. package/dist/query/server.d.mts +0 -55
  187. package/dist/query/server.d.ts +0 -55
  188. package/dist/request-Dsq4kGW0.d.mts +0 -6
  189. package/dist/request-udtobOLv.d.ts +0 -6
  190. package/dist/request.d.mts +0 -2
  191. package/dist/request.d.ts +0 -2
  192. package/dist/resolver-DJqjLMg_.d.mts +0 -14
  193. package/dist/resolver-IH4RmPEl.d.ts +0 -14
  194. package/dist/route-runtime-DoOHzCAD.d.mts +0 -38
  195. package/dist/route-runtime-DoOHzCAD.d.ts +0 -38
  196. package/dist/router.d.mts +0 -36
  197. package/dist/router.d.ts +0 -36
  198. package/dist/routes.d.mts +0 -224
  199. package/dist/routes.d.ts +0 -224
  200. package/dist/runtime-9nQjVM7X.d.mts +0 -206
  201. package/dist/runtime-Cxpq6xZN.d.mts +0 -27
  202. package/dist/runtime-DgeS2skB.d.ts +0 -206
  203. package/dist/runtime-bv63eUiO.d.ts +0 -27
  204. package/dist/server-action-security.d.mts +0 -43
  205. package/dist/server-action-security.d.ts +0 -43
  206. package/dist/server-fn-client.d.mts +0 -32
  207. package/dist/server-fn-client.d.ts +0 -32
  208. package/dist/server-fn.d.mts +0 -93
  209. package/dist/server-fn.d.ts +0 -93
  210. package/dist/server-plugins.d.mts +0 -55
  211. package/dist/server-plugins.d.ts +0 -55
  212. package/dist/server-query-client.d.mts +0 -50
  213. package/dist/server-query-client.d.ts +0 -50
  214. package/dist/server-query.d.mts +0 -36
  215. package/dist/server-query.d.ts +0 -36
  216. package/dist/server.d.mts +0 -48
  217. package/dist/server.d.ts +0 -48
  218. package/dist/storage.d.mts +0 -52
  219. package/dist/storage.d.ts +0 -52
  220. package/dist/testing.d.mts +0 -101
  221. package/dist/testing.d.ts +0 -101
  222. package/dist/transport-BmbGTXA5.d.mts +0 -49
  223. package/dist/transport-BmbGTXA5.d.ts +0 -49
  224. package/dist/types-BMxWr97v.d.mts +0 -81
  225. package/dist/types-BMxWr97v.d.ts +0 -81
  226. package/dist/types-C9N-nk5R.d.mts +0 -53
  227. package/dist/types-C9N-nk5R.d.ts +0 -53
  228. package/dist/types-D1A6-XvH.d.mts +0 -73
  229. package/dist/types-D1A6-XvH.d.ts +0 -73
  230. package/dist/utils-CA0z0c-2.d.ts +0 -23
  231. package/dist/utils-mYVkSOt2.d.mts +0 -23
  232. package/dist/version.d.mts +0 -3
  233. package/dist/version.d.ts +0 -3
  234. package/dist/vite.d.mts +0 -22
  235. package/dist/vite.d.ts +0 -22
  236. package/dist/workflows.d.mts +0 -110
  237. package/dist/workflows.d.ts +0 -110
  238. /package/dist/{chunk-7N62DNSO.mjs.map → chunk-H3TE3LOV.mjs.map} +0 -0
package/dist/api.d.ts DELETED
@@ -1,48 +0,0 @@
1
- export { A as APIRouteMatch, c as APIRouteParamValue, b as APIRouteParams, q as AnyEndpointMiddleware, D as DELETE, e as EndpointErrorContracts, E as EndpointErrorDefinition, d as EndpointErrorDefinitions, f as EndpointFail, g as EndpointFailure, v as EndpointHandler, s as EndpointInvalidationContext, r as EndpointInvalidationTarget, t as EndpointInvalidations, p as EndpointMiddleware, l as EndpointMiddlewareContext, o as EndpointMiddlewareResult, u as EndpointOptions, j as EndpointParamValue, k as EndpointParams, G as GET, H as HEAD, I as InferEndpointMiddlewareContext, O as OPTIONS, y as PATCH, P as POST, x as PUT, T as TypedEndpoint, w as createEndpoint, i as invokeAPIRouteEndpoint, h as isEndpointFailure, a as isWebResponse, m as matchAPIRoute, n as normalizeRouteResponse } from './runtime-DgeS2skB.js';
2
- export { APIRoute, APIRouteManager, APIRouteManagerOptions, API_ROUTE_METHODS } from './api/route-manager.js';
3
- export { r as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, g as APIResult, A as APIRouteRefMetadata, C as CacheKey, l as CacheOptions, k as CachePolicy, p as ClientOptions, a as FARM_API_ROUTE_META_SYMBOL, F as FARM_API_ROUTE_REF_SYMBOL, n as InvalidateOptions, I as InvalidateTarget, o as OptimisticOptions, O as OptimisticUpdate, R as RequestEvent, j as ResponseEvent, m as RetryOptions, q as RouteAPIClient, s as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, f as StatusEvent, e as StatusPhase, t as createAPIClient, w as createServerAPIClient, v as getAPIRouteRefMetadata, u as isAPIRouteRef } from './client-Nn0q4eO4.js';
4
- export { F as FarmAPIStream, c as FarmStreamResponse, a as MultipartField, M as MultipartSchema, b as MultipartValues, T as TypedFormData, e as isFarmAPIStream, d as isJSONStreamResponse, i as isMultipartSchema, j as jsonStream, m as multipart, r as readJSONStream, t as toFormData } from './transport-BmbGTXA5.js';
5
- import { Plugin } from 'vite';
6
- import './cache.js';
7
- import './route-runtime-DoOHzCAD.js';
8
- import './types-BMxWr97v.js';
9
- import './runtime-bv63eUiO.js';
10
- import './resolver-IH4RmPEl.js';
11
- import './integration-api-CHT2OKAf.js';
12
- import './client-cache-CIlyBlmx.js';
13
-
14
- /**
15
- * Farm.js API Routes Vite Plugin
16
- *
17
- * Standalone API route support that works with any Vite setup.
18
- * Discovers and handles route.ts files in the api directory.
19
- * Also supports root routes.ts for custom route definitions.
20
- *
21
- * @example
22
- * ```ts
23
- * import { farmApiPlugin } from '@farm.js/core'
24
- *
25
- * export default defineConfig({
26
- * plugins: [farmApiPlugin({ srcDir: 'src' })],
27
- * })
28
- * ```
29
- */
30
-
31
- interface FarmApiPluginOptions {
32
- /** Source directory containing the api folder (default: 'src') */
33
- srcDir?: string;
34
- /** Enable debug logging */
35
- debug?: boolean;
36
- }
37
- interface ApiRoute {
38
- path: string;
39
- filePath: string;
40
- methods: string[];
41
- endpoints: Record<string, any>;
42
- }
43
- /**
44
- * Farm.js API Routes Vite Plugin
45
- */
46
- declare function farmApiPlugin(options?: FarmApiPluginOptions): Plugin;
47
-
48
- export { type ApiRoute, type FarmApiPluginOptions, farmApiPlugin };
@@ -1,302 +0,0 @@
1
- import { F as FarmConfig, x as ParsedRoute, p as RouteModule, r as LayoutModule, z as SSGCollectionResult, t as FarmRequest, u as FarmResponse, _ as FarmMdxResolvedConfig, $ as ResolvedFarmDevtoolsConfig, a0 as ResolvedFarmAuthConfig } from './client-plugins-jsk-ZLzJ.mjs';
2
- import { F as FarmDocsResolvedConfig } from './types-C9N-nk5R.mjs';
3
- import { FarmMarkdownResolvedConfig } from './markdown.mjs';
4
- import { FarmWorkflowsResolvedConfig } from './workflows.mjs';
5
- import { FarmCronResolvedConfig } from './cron.mjs';
6
- import { R as ResolvedFarmImageConfig } from './image-config-Duob7wER.mjs';
7
- import { ProgrammaticRedirectRoute, ProgrammaticRouteSearchClientOptions } from './routes.mjs';
8
- import { ViteDevServer } from 'vite';
9
- import { M as MetadataImageKind } from './metadata-7ffpT3jr.mjs';
10
- import { R as ResolvedFarmRouteRuntimeConfig } from './route-runtime-DoOHzCAD.mjs';
11
- import { R as ResolvedFarmI18nConfig } from './types-BMxWr97v.mjs';
12
- import { F as FarmI18nRuntime } from './runtime-Cxpq6xZN.mjs';
13
-
14
- declare const STATIC_METADATA_IMAGE_EXTENSIONS: readonly ["png", "jpg", "jpeg", "gif", "webp"];
15
- type StaticMetadataImageExtension = (typeof STATIC_METADATA_IMAGE_EXTENSIONS)[number];
16
- interface StaticMetadataImageInfo {
17
- extension: StaticMetadataImageExtension;
18
- contentType: string;
19
- width: number;
20
- height: number;
21
- alt?: string;
22
- hash: string;
23
- byteLength: number;
24
- }
25
-
26
- interface RouteEntry {
27
- route: ParsedRoute;
28
- modulePath: string;
29
- markdownSourcePath?: string;
30
- pattern: string;
31
- source?: "file" | "programmatic";
32
- sourceRoot: string;
33
- }
34
- interface RouteSlotEntry extends RouteEntry {
35
- name: string;
36
- ownerPattern: string;
37
- interception: boolean;
38
- fallback: boolean;
39
- containerId: string;
40
- }
41
- interface MatchedRouteSlot {
42
- name: string;
43
- ownerPattern: string;
44
- containerId: string;
45
- interception: boolean;
46
- fallback: boolean;
47
- route: RouteSlotEntry;
48
- params: Record<string, string>;
49
- }
50
- interface MetadataImageEntry extends RouteEntry {
51
- kind: MetadataImageKind;
52
- fileName: "opengraph-image" | "twitter-image";
53
- sourceType: "module" | "static";
54
- staticInfo?: StaticMetadataImageInfo;
55
- }
56
- /**
57
- * Manages route discovery and matching for the Farm.js application
58
- */
59
- declare class RouteManager {
60
- private config;
61
- private routes;
62
- private layouts;
63
- private routeSlots;
64
- private loadings;
65
- private errors;
66
- private metadataImages;
67
- private redirects;
68
- private programmaticPages;
69
- private programmaticLayouts;
70
- private viteServer?;
71
- constructor(config: Required<FarmConfig>, viteServer?: ViteDevServer);
72
- /**
73
- * Discover all routes in the app directory
74
- */
75
- discoverRoutes(): Promise<void>;
76
- /**
77
- * Find matching route for a given URL path
78
- */
79
- matchRoute(pathname: string, options?: {
80
- interceptFrom?: string;
81
- }): {
82
- route: RouteEntry | null;
83
- params: Record<string, string>;
84
- layouts: RouteEntry[];
85
- slots: MatchedRouteSlot[];
86
- };
87
- /**
88
- * Get all registered routes
89
- */
90
- getRoutes(): Map<string, RouteEntry>;
91
- /**
92
- * Get all registered layouts
93
- */
94
- getLayouts(): Map<string, RouteEntry>;
95
- getRouteSlots(): Map<string, RouteSlotEntry>;
96
- /** Resolve route rules, inherited layouts, and the page export in precedence order. */
97
- resolveRouteRuntimeConfig(pattern: string): Promise<ResolvedFarmRouteRuntimeConfig>;
98
- /**
99
- * Get all route-level loading boundaries.
100
- */
101
- getLoadings(): Map<string, RouteEntry>;
102
- /**
103
- * Get all route-level error boundaries.
104
- */
105
- getErrors(): Map<string, RouteEntry>;
106
- getMetadataImages(): Map<string, MetadataImageEntry>;
107
- getRedirects(): ProgrammaticRedirectRoute[];
108
- matchRedirect(pathname: string): {
109
- redirect: ProgrammaticRedirectRoute;
110
- destination: string;
111
- statusCode: number;
112
- params: Record<string, string>;
113
- } | null;
114
- /**
115
- * Return the nearest matching loading boundary for a pathname.
116
- */
117
- getMatchingLoading(pathname: string): RouteEntry | null;
118
- /**
119
- * Return the nearest matching error boundary for a pathname.
120
- */
121
- getMatchingError(pathname: string): RouteEntry | null;
122
- matchMetadataImage(pathname: string): {
123
- image: MetadataImageEntry;
124
- params: Record<string, string>;
125
- pagePath: string;
126
- } | null;
127
- getMatchingMetadataImage(pathname: string, kind: MetadataImageKind): {
128
- image: MetadataImageEntry;
129
- params: Record<string, string>;
130
- } | null;
131
- resolveMetadataImagePath(image: MetadataImageEntry, params?: Record<string, string>): string;
132
- /**
133
- * Generate a client-side route manifest for SPA navigation
134
- * This eliminates the need for server requests during navigation
135
- */
136
- generateClientManifest(projectRoot: string): {
137
- routes: Array<{
138
- pattern: string;
139
- modulePath: string;
140
- shouldHydrate: boolean;
141
- isClientComponent: boolean;
142
- search?: ProgrammaticRouteSearchClientOptions;
143
- segments: Array<{
144
- segment: string;
145
- isDynamic: boolean;
146
- isCatchAll?: boolean;
147
- isOptional?: boolean;
148
- }>;
149
- }>;
150
- layouts: Array<{
151
- pattern: string;
152
- modulePath: string;
153
- }>;
154
- slots: Array<{
155
- name: string;
156
- ownerPattern: string;
157
- pattern: string;
158
- modulePath: string;
159
- containerId: string;
160
- interception: boolean;
161
- fallback: boolean;
162
- shouldHydrate: boolean;
163
- isClientComponent: boolean;
164
- segments: RouteEntry["route"]["segments"];
165
- }>;
166
- };
167
- /**
168
- * Load a route module dynamically
169
- */
170
- loadRouteModule(modulePath: string): Promise<RouteModule>;
171
- /**
172
- * Load a layout module dynamically
173
- */
174
- loadLayoutModule(modulePath: string): Promise<LayoutModule>;
175
- /**
176
- * Create a route pattern from parsed route
177
- */
178
- private createRoutePattern;
179
- private discoverFileRoutes;
180
- private discoverProgrammaticRoutes;
181
- private loadProgrammaticRoutesModule;
182
- /**
183
- * Find all layouts that should wrap a given path
184
- */
185
- private findMatchingLayouts;
186
- private findMatchingRouteSlots;
187
- private matchesRoutePrefix;
188
- private findNearestBoundary;
189
- /**
190
- * Log discovered routes for debugging
191
- */
192
- private logRoutes;
193
- /**
194
- * Collect SSG pages for static generation
195
- *
196
- * Returns all pages marked with `export const ssg = true` along with
197
- * their pre-computed paths (for dynamic routes using getStaticPaths)
198
- */
199
- collectSSGPages(): Promise<SSGCollectionResult>;
200
- private toRoutePathname;
201
- private localizeRedirectDestination;
202
- private getI18nConfig;
203
- /**
204
- * Check if a route is SSG
205
- */
206
- isRouteSSG(modulePath: string): Promise<boolean>;
207
- /**
208
- * Check if a route has ISR (Incremental Static Regeneration)
209
- */
210
- hasRouteISR(modulePath: string): Promise<boolean>;
211
- /**
212
- * Get revalidation interval for a route
213
- */
214
- getRouteRevalidateInterval(modulePath: string): Promise<number | undefined>;
215
- }
216
-
217
- declare class ServerRenderer {
218
- private config;
219
- private routeManager;
220
- private ssgManifest;
221
- private dataCache;
222
- private i18nRuntime?;
223
- constructor(config: Required<FarmConfig>, routeManager: RouteManager, i18nRuntime?: FarmI18nRuntime);
224
- runWithRequestContext<T>(request: Request, fn: () => T | Promise<T>): Promise<T>;
225
- resolveRouteContext(input: {
226
- request: Request;
227
- rawRequest?: FarmRequest;
228
- params: Record<string, string>;
229
- search: Record<string, string | string[] | undefined>;
230
- path: string;
231
- }): Promise<unknown>;
232
- /**
233
- * Load SSG manifest from build output
234
- */
235
- private loadSSGManifest;
236
- /**
237
- * Check if a path should be served from SSG cache
238
- */
239
- private shouldServeSSG;
240
- private getSSGCacheKey;
241
- private getPPRCacheKey;
242
- private getCachedSSGPage;
243
- private cacheSSGPage;
244
- private getCachedPPRShell;
245
- private cachePPRShell;
246
- private getPPRShellBypassReason;
247
- private getPPRHeaders;
248
- private serveCachedPPRShell;
249
- /**
250
- * Regenerate an SSG page in the background (ISR)
251
- */
252
- private regenerateSSGPage;
253
- /**
254
- * Serve a pre-rendered SSG page
255
- */
256
- private serveSSGPage;
257
- renderPage(req: FarmRequest, res: FarmResponse): Promise<void>;
258
- private renderPageInContext;
259
- private wrapWithIntegrationProviders;
260
- private resolveRouteMetadata;
261
- private resolveMetadataImageReference;
262
- private renderMetadataImage;
263
- private writeMetadataImageResponse;
264
- private writeStaticMetadataImageResponse;
265
- private renderRouteErrorBoundary;
266
- private renderWithSSR;
267
- private render404;
268
- private render500;
269
- private createFullHTML;
270
- private applyDeploymentHeaders;
271
- private getDeploymentId;
272
- }
273
-
274
- type NormalizedFarmConfig = Omit<Required<FarmConfig>, "devtools" | "images" | "i18n"> & {
275
- docs: FarmDocsResolvedConfig;
276
- md: FarmMarkdownResolvedConfig;
277
- mdx: FarmMdxResolvedConfig;
278
- cron: FarmCronResolvedConfig;
279
- workflows: FarmWorkflowsResolvedConfig;
280
- devtools: ResolvedFarmDevtoolsConfig;
281
- images: ResolvedFarmImageConfig;
282
- i18n: ResolvedFarmI18nConfig;
283
- auth: ResolvedFarmAuthConfig;
284
- };
285
- declare class FarmApp {
286
- private config;
287
- private routeManager;
288
- private serverRenderer;
289
- private i18nRuntime;
290
- private viteServer?;
291
- constructor(config?: FarmConfig, viteServer?: ViteDevServer);
292
- initialize(): Promise<void>;
293
- getRouteManager(): RouteManager;
294
- getServerRenderer(): ServerRenderer;
295
- getI18nRuntime(): FarmI18nRuntime;
296
- getConfig(): NormalizedFarmConfig;
297
- private normalizeConfig;
298
- private verifyAppStructure;
299
- }
300
- declare function createFarmApp(config?: FarmConfig, viteServer?: ViteDevServer): FarmApp;
301
-
302
- export { FarmApp as F, RouteManager as R, ServerRenderer as S, createFarmApp as c };
@@ -1,302 +0,0 @@
1
- import { F as FarmConfig, x as ParsedRoute, p as RouteModule, r as LayoutModule, z as SSGCollectionResult, t as FarmRequest, u as FarmResponse, _ as FarmMdxResolvedConfig, $ as ResolvedFarmDevtoolsConfig, a0 as ResolvedFarmAuthConfig } from './client-plugins-Bc5jHcNr.js';
2
- import { F as FarmDocsResolvedConfig } from './types-C9N-nk5R.js';
3
- import { FarmMarkdownResolvedConfig } from './markdown.js';
4
- import { FarmWorkflowsResolvedConfig } from './workflows.js';
5
- import { FarmCronResolvedConfig } from './cron.js';
6
- import { R as ResolvedFarmImageConfig } from './image-config-Duob7wER.js';
7
- import { ProgrammaticRedirectRoute, ProgrammaticRouteSearchClientOptions } from './routes.js';
8
- import { ViteDevServer } from 'vite';
9
- import { M as MetadataImageKind } from './metadata-JHn-8eht.js';
10
- import { R as ResolvedFarmRouteRuntimeConfig } from './route-runtime-DoOHzCAD.js';
11
- import { R as ResolvedFarmI18nConfig } from './types-BMxWr97v.js';
12
- import { F as FarmI18nRuntime } from './runtime-bv63eUiO.js';
13
-
14
- declare const STATIC_METADATA_IMAGE_EXTENSIONS: readonly ["png", "jpg", "jpeg", "gif", "webp"];
15
- type StaticMetadataImageExtension = (typeof STATIC_METADATA_IMAGE_EXTENSIONS)[number];
16
- interface StaticMetadataImageInfo {
17
- extension: StaticMetadataImageExtension;
18
- contentType: string;
19
- width: number;
20
- height: number;
21
- alt?: string;
22
- hash: string;
23
- byteLength: number;
24
- }
25
-
26
- interface RouteEntry {
27
- route: ParsedRoute;
28
- modulePath: string;
29
- markdownSourcePath?: string;
30
- pattern: string;
31
- source?: "file" | "programmatic";
32
- sourceRoot: string;
33
- }
34
- interface RouteSlotEntry extends RouteEntry {
35
- name: string;
36
- ownerPattern: string;
37
- interception: boolean;
38
- fallback: boolean;
39
- containerId: string;
40
- }
41
- interface MatchedRouteSlot {
42
- name: string;
43
- ownerPattern: string;
44
- containerId: string;
45
- interception: boolean;
46
- fallback: boolean;
47
- route: RouteSlotEntry;
48
- params: Record<string, string>;
49
- }
50
- interface MetadataImageEntry extends RouteEntry {
51
- kind: MetadataImageKind;
52
- fileName: "opengraph-image" | "twitter-image";
53
- sourceType: "module" | "static";
54
- staticInfo?: StaticMetadataImageInfo;
55
- }
56
- /**
57
- * Manages route discovery and matching for the Farm.js application
58
- */
59
- declare class RouteManager {
60
- private config;
61
- private routes;
62
- private layouts;
63
- private routeSlots;
64
- private loadings;
65
- private errors;
66
- private metadataImages;
67
- private redirects;
68
- private programmaticPages;
69
- private programmaticLayouts;
70
- private viteServer?;
71
- constructor(config: Required<FarmConfig>, viteServer?: ViteDevServer);
72
- /**
73
- * Discover all routes in the app directory
74
- */
75
- discoverRoutes(): Promise<void>;
76
- /**
77
- * Find matching route for a given URL path
78
- */
79
- matchRoute(pathname: string, options?: {
80
- interceptFrom?: string;
81
- }): {
82
- route: RouteEntry | null;
83
- params: Record<string, string>;
84
- layouts: RouteEntry[];
85
- slots: MatchedRouteSlot[];
86
- };
87
- /**
88
- * Get all registered routes
89
- */
90
- getRoutes(): Map<string, RouteEntry>;
91
- /**
92
- * Get all registered layouts
93
- */
94
- getLayouts(): Map<string, RouteEntry>;
95
- getRouteSlots(): Map<string, RouteSlotEntry>;
96
- /** Resolve route rules, inherited layouts, and the page export in precedence order. */
97
- resolveRouteRuntimeConfig(pattern: string): Promise<ResolvedFarmRouteRuntimeConfig>;
98
- /**
99
- * Get all route-level loading boundaries.
100
- */
101
- getLoadings(): Map<string, RouteEntry>;
102
- /**
103
- * Get all route-level error boundaries.
104
- */
105
- getErrors(): Map<string, RouteEntry>;
106
- getMetadataImages(): Map<string, MetadataImageEntry>;
107
- getRedirects(): ProgrammaticRedirectRoute[];
108
- matchRedirect(pathname: string): {
109
- redirect: ProgrammaticRedirectRoute;
110
- destination: string;
111
- statusCode: number;
112
- params: Record<string, string>;
113
- } | null;
114
- /**
115
- * Return the nearest matching loading boundary for a pathname.
116
- */
117
- getMatchingLoading(pathname: string): RouteEntry | null;
118
- /**
119
- * Return the nearest matching error boundary for a pathname.
120
- */
121
- getMatchingError(pathname: string): RouteEntry | null;
122
- matchMetadataImage(pathname: string): {
123
- image: MetadataImageEntry;
124
- params: Record<string, string>;
125
- pagePath: string;
126
- } | null;
127
- getMatchingMetadataImage(pathname: string, kind: MetadataImageKind): {
128
- image: MetadataImageEntry;
129
- params: Record<string, string>;
130
- } | null;
131
- resolveMetadataImagePath(image: MetadataImageEntry, params?: Record<string, string>): string;
132
- /**
133
- * Generate a client-side route manifest for SPA navigation
134
- * This eliminates the need for server requests during navigation
135
- */
136
- generateClientManifest(projectRoot: string): {
137
- routes: Array<{
138
- pattern: string;
139
- modulePath: string;
140
- shouldHydrate: boolean;
141
- isClientComponent: boolean;
142
- search?: ProgrammaticRouteSearchClientOptions;
143
- segments: Array<{
144
- segment: string;
145
- isDynamic: boolean;
146
- isCatchAll?: boolean;
147
- isOptional?: boolean;
148
- }>;
149
- }>;
150
- layouts: Array<{
151
- pattern: string;
152
- modulePath: string;
153
- }>;
154
- slots: Array<{
155
- name: string;
156
- ownerPattern: string;
157
- pattern: string;
158
- modulePath: string;
159
- containerId: string;
160
- interception: boolean;
161
- fallback: boolean;
162
- shouldHydrate: boolean;
163
- isClientComponent: boolean;
164
- segments: RouteEntry["route"]["segments"];
165
- }>;
166
- };
167
- /**
168
- * Load a route module dynamically
169
- */
170
- loadRouteModule(modulePath: string): Promise<RouteModule>;
171
- /**
172
- * Load a layout module dynamically
173
- */
174
- loadLayoutModule(modulePath: string): Promise<LayoutModule>;
175
- /**
176
- * Create a route pattern from parsed route
177
- */
178
- private createRoutePattern;
179
- private discoverFileRoutes;
180
- private discoverProgrammaticRoutes;
181
- private loadProgrammaticRoutesModule;
182
- /**
183
- * Find all layouts that should wrap a given path
184
- */
185
- private findMatchingLayouts;
186
- private findMatchingRouteSlots;
187
- private matchesRoutePrefix;
188
- private findNearestBoundary;
189
- /**
190
- * Log discovered routes for debugging
191
- */
192
- private logRoutes;
193
- /**
194
- * Collect SSG pages for static generation
195
- *
196
- * Returns all pages marked with `export const ssg = true` along with
197
- * their pre-computed paths (for dynamic routes using getStaticPaths)
198
- */
199
- collectSSGPages(): Promise<SSGCollectionResult>;
200
- private toRoutePathname;
201
- private localizeRedirectDestination;
202
- private getI18nConfig;
203
- /**
204
- * Check if a route is SSG
205
- */
206
- isRouteSSG(modulePath: string): Promise<boolean>;
207
- /**
208
- * Check if a route has ISR (Incremental Static Regeneration)
209
- */
210
- hasRouteISR(modulePath: string): Promise<boolean>;
211
- /**
212
- * Get revalidation interval for a route
213
- */
214
- getRouteRevalidateInterval(modulePath: string): Promise<number | undefined>;
215
- }
216
-
217
- declare class ServerRenderer {
218
- private config;
219
- private routeManager;
220
- private ssgManifest;
221
- private dataCache;
222
- private i18nRuntime?;
223
- constructor(config: Required<FarmConfig>, routeManager: RouteManager, i18nRuntime?: FarmI18nRuntime);
224
- runWithRequestContext<T>(request: Request, fn: () => T | Promise<T>): Promise<T>;
225
- resolveRouteContext(input: {
226
- request: Request;
227
- rawRequest?: FarmRequest;
228
- params: Record<string, string>;
229
- search: Record<string, string | string[] | undefined>;
230
- path: string;
231
- }): Promise<unknown>;
232
- /**
233
- * Load SSG manifest from build output
234
- */
235
- private loadSSGManifest;
236
- /**
237
- * Check if a path should be served from SSG cache
238
- */
239
- private shouldServeSSG;
240
- private getSSGCacheKey;
241
- private getPPRCacheKey;
242
- private getCachedSSGPage;
243
- private cacheSSGPage;
244
- private getCachedPPRShell;
245
- private cachePPRShell;
246
- private getPPRShellBypassReason;
247
- private getPPRHeaders;
248
- private serveCachedPPRShell;
249
- /**
250
- * Regenerate an SSG page in the background (ISR)
251
- */
252
- private regenerateSSGPage;
253
- /**
254
- * Serve a pre-rendered SSG page
255
- */
256
- private serveSSGPage;
257
- renderPage(req: FarmRequest, res: FarmResponse): Promise<void>;
258
- private renderPageInContext;
259
- private wrapWithIntegrationProviders;
260
- private resolveRouteMetadata;
261
- private resolveMetadataImageReference;
262
- private renderMetadataImage;
263
- private writeMetadataImageResponse;
264
- private writeStaticMetadataImageResponse;
265
- private renderRouteErrorBoundary;
266
- private renderWithSSR;
267
- private render404;
268
- private render500;
269
- private createFullHTML;
270
- private applyDeploymentHeaders;
271
- private getDeploymentId;
272
- }
273
-
274
- type NormalizedFarmConfig = Omit<Required<FarmConfig>, "devtools" | "images" | "i18n"> & {
275
- docs: FarmDocsResolvedConfig;
276
- md: FarmMarkdownResolvedConfig;
277
- mdx: FarmMdxResolvedConfig;
278
- cron: FarmCronResolvedConfig;
279
- workflows: FarmWorkflowsResolvedConfig;
280
- devtools: ResolvedFarmDevtoolsConfig;
281
- images: ResolvedFarmImageConfig;
282
- i18n: ResolvedFarmI18nConfig;
283
- auth: ResolvedFarmAuthConfig;
284
- };
285
- declare class FarmApp {
286
- private config;
287
- private routeManager;
288
- private serverRenderer;
289
- private i18nRuntime;
290
- private viteServer?;
291
- constructor(config?: FarmConfig, viteServer?: ViteDevServer);
292
- initialize(): Promise<void>;
293
- getRouteManager(): RouteManager;
294
- getServerRenderer(): ServerRenderer;
295
- getI18nRuntime(): FarmI18nRuntime;
296
- getConfig(): NormalizedFarmConfig;
297
- private normalizeConfig;
298
- private verifyAppStructure;
299
- }
300
- declare function createFarmApp(config?: FarmConfig, viteServer?: ViteDevServer): FarmApp;
301
-
302
- export { FarmApp as F, RouteManager as R, ServerRenderer as S, createFarmApp as c };
@@ -1,22 +0,0 @@
1
- import 'react';
2
- export { cN as FarmMarkdownPageModuleInput, cM as FarmMarkdownPageSource, cJ as FarmMdxComponent, cK as FarmMdxComponents, _ as FarmMdxResolvedConfig, cL as FarmMdxUserConfig, cU as createFarmMarkdownRouteModule, cV as createFarmMarkdownRouteModuleFromFile, cX as createFarmMarkdownSourceResponse, cT as createMarkdownMetadata, cP as isFarmMarkdownPageFile, cW as loadFarmMdxComponents, cQ as normalizeFarmMarkdownRoutePath, cR as parseMarkdownFrontmatter, cO as resolveMdxConfig, cS as titleFromMarkdown } from './client-plugins-jsk-ZLzJ.mjs';
3
- import './plugin-BJDf43dc.mjs';
4
- import 'http';
5
- import './types-D1A6-XvH.mjs';
6
- import 'db0';
7
- import 'unstorage';
8
- import './integration-api-CHT2OKAf.mjs';
9
- import '@farming-labs/orm';
10
- import './types-C9N-nk5R.mjs';
11
- import '@farming-labs/docs';
12
- import './markdown.mjs';
13
- import './observability.mjs';
14
- import 'vite';
15
- import './workflows.mjs';
16
- import './cron.mjs';
17
- import './env.mjs';
18
- import './server-action-security.mjs';
19
- import './image-config-Duob7wER.mjs';
20
- import './types-BMxWr97v.mjs';
21
- import './cache.mjs';
22
- import './route-runtime-DoOHzCAD.mjs';
@@ -1,22 +0,0 @@
1
- import 'react';
2
- export { cN as FarmMarkdownPageModuleInput, cM as FarmMarkdownPageSource, cJ as FarmMdxComponent, cK as FarmMdxComponents, _ as FarmMdxResolvedConfig, cL as FarmMdxUserConfig, cU as createFarmMarkdownRouteModule, cV as createFarmMarkdownRouteModuleFromFile, cX as createFarmMarkdownSourceResponse, cT as createMarkdownMetadata, cP as isFarmMarkdownPageFile, cW as loadFarmMdxComponents, cQ as normalizeFarmMarkdownRoutePath, cR as parseMarkdownFrontmatter, cO as resolveMdxConfig, cS as titleFromMarkdown } from './client-plugins-Bc5jHcNr.js';
3
- import './plugin-BJDf43dc.js';
4
- import 'http';
5
- import './types-D1A6-XvH.js';
6
- import 'db0';
7
- import 'unstorage';
8
- import './integration-api-CHT2OKAf.js';
9
- import '@farming-labs/orm';
10
- import './types-C9N-nk5R.js';
11
- import '@farming-labs/docs';
12
- import './markdown.js';
13
- import './observability.js';
14
- import 'vite';
15
- import './workflows.js';
16
- import './cron.js';
17
- import './env.js';
18
- import './server-action-security.js';
19
- import './image-config-Duob7wER.js';
20
- import './types-BMxWr97v.js';
21
- import './cache.js';
22
- import './route-runtime-DoOHzCAD.js';