@farm.js/core 0.2.2 → 0.2.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 (199) hide show
  1. package/dist/{agent-mcp.d-gI3ahrF6.d.mts → agent-mcp.d-CaJJsAVy.d.mts} +1 -1
  2. package/dist/{agent-mcp.d-DuZjglYX.d.ts → agent-mcp.d-klsG_XKS.d.ts} +1 -1
  3. package/dist/agent-runtime.d.mts +1 -1
  4. package/dist/agent-runtime.d.ts +1 -1
  5. package/dist/{analyzer-UXWYUTBK.mjs → analyzer-CY7BS4GB.mjs} +2 -2
  6. package/dist/analyzer-KHCOL6JF.cjs +17 -0
  7. package/dist/api/node.d.mts +3 -3
  8. package/dist/api/node.d.ts +3 -3
  9. package/dist/api/route-manager.cjs +4 -4
  10. package/dist/api/route-manager.d.mts +3 -3
  11. package/dist/api/route-manager.d.ts +3 -3
  12. package/dist/api/route-manager.mjs +3 -3
  13. package/dist/api/runtime.d.mts +2 -2
  14. package/dist/api/runtime.d.ts +2 -2
  15. package/dist/api.cjs +5 -5
  16. package/dist/api.d.mts +4 -4
  17. package/dist/api.d.ts +4 -4
  18. package/dist/api.mjs +4 -4
  19. package/dist/{app-manifest.d-bHK9EGPI.d.mts → app-manifest.d-BIdn8Whr.d.mts} +1 -1
  20. package/dist/{app-manifest.d-B3h89j6a.d.ts → app-manifest.d-DkIbmExG.d.ts} +1 -1
  21. package/dist/app-markdown.d.mts +2 -2
  22. package/dist/app-markdown.d.ts +2 -2
  23. package/dist/{app.d-C3uyET_L.d.ts → app.d-DhZ61V9X.d.ts} +8 -5
  24. package/dist/{app.d-Cr7fXGvJ.d.mts → app.d-DnqxbvCI.d.mts} +8 -5
  25. package/dist/{chunk-YOVSWY2E.mjs → chunk-2XDRRAAD.mjs} +1 -1
  26. package/dist/{chunk-2T4GGCQT.cjs → chunk-6UBGXEIH.cjs} +2 -2
  27. package/dist/{chunk-BEAQVRMQ.cjs → chunk-76ES7BCO.cjs} +80 -75
  28. package/dist/{chunk-TK2JJCP5.mjs → chunk-7FNKBP3J.mjs} +186 -29
  29. package/dist/{chunk-ST3U7XVO.mjs → chunk-7IM2MKRK.mjs} +1 -1
  30. package/dist/{chunk-GL4SPJTE.cjs → chunk-7Q6KUXH6.cjs} +58 -27
  31. package/dist/{chunk-5CG2UD6B.cjs → chunk-AMSX2U4D.cjs} +304 -7
  32. package/dist/{chunk-NPR6SCEV.mjs → chunk-AOSZIHL7.mjs} +1 -1
  33. package/dist/chunk-APVJJCMB.mjs +547 -0
  34. package/dist/{chunk-LQZXCSYG.mjs → chunk-B6K2ZM3C.mjs} +5 -3
  35. package/dist/{chunk-IEXZMDF4.mjs → chunk-BCIUG6EQ.mjs} +2 -2
  36. package/dist/{chunk-JCERO6YF.mjs → chunk-BUIZTM3Q.mjs} +1 -1
  37. package/dist/{chunk-SJQ24IB5.cjs → chunk-BY5VQ57W.cjs} +11 -11
  38. package/dist/{chunk-GKDOKES3.mjs → chunk-CQ5LVPBL.mjs} +1 -1
  39. package/dist/{chunk-Q4FHYBFT.cjs → chunk-CSCORWIQ.cjs} +11 -11
  40. package/dist/{chunk-6VMBLDWY.mjs → chunk-CV7C75LN.mjs} +1 -1
  41. package/dist/{chunk-CZMMU3FP.mjs → chunk-D4DAL7KK.mjs} +35 -4
  42. package/dist/{chunk-ZVT2F3JU.mjs → chunk-DR65XXXD.mjs} +2 -2
  43. package/dist/{chunk-PRKFECGT.cjs → chunk-DZWX7FDX.cjs} +6 -4
  44. package/dist/{chunk-A4AYTO2E.cjs → chunk-EZRB5N6S.cjs} +1 -1
  45. package/dist/{chunk-B7CZ7T2I.cjs → chunk-JEJXSTYR.cjs} +2 -2
  46. package/dist/{chunk-56F4CDKE.cjs → chunk-JRPCCBGL.cjs} +449 -291
  47. package/dist/{chunk-JM5VSEYC.cjs → chunk-KHTDVXXR.cjs} +2 -2
  48. package/dist/{chunk-PYPHM7AS.cjs → chunk-LH7S7FI3.cjs} +5 -1
  49. package/dist/{chunk-ZND5D4IC.cjs → chunk-LJZZDRD5.cjs} +363 -326
  50. package/dist/{chunk-WXPY5FRF.cjs → chunk-P2PF5FUW.cjs} +2 -2
  51. package/dist/{chunk-CPL7WIMP.mjs → chunk-P3UT3OLV.mjs} +2 -2
  52. package/dist/{chunk-PZ5ZJAAO.mjs → chunk-POCWXRXW.mjs} +1 -1
  53. package/dist/{chunk-L7Z6OAE2.cjs → chunk-PVR63WHW.cjs} +4 -4
  54. package/dist/{chunk-Z23OCU33.cjs → chunk-RF3VCNV7.cjs} +6 -6
  55. package/dist/{chunk-5AOARZJT.cjs → chunk-T2VXOAC3.cjs} +4 -4
  56. package/dist/{chunk-FEWGKBMM.mjs → chunk-UIBCPZFO.mjs} +85 -48
  57. package/dist/{chunk-MYJPW4XN.mjs → chunk-UKGAP2OK.mjs} +3 -3
  58. package/dist/{chunk-DZXD6CYJ.mjs → chunk-V2RXBDV6.mjs} +4 -0
  59. package/dist/{chunk-ALGAGXWB.mjs → chunk-XEOIZ4QC.mjs} +1 -1
  60. package/dist/{chunk-D2VLHRBN.cjs → chunk-Y3MTKPLN.cjs} +4 -4
  61. package/dist/{chunk-FDS6U2NT.cjs → chunk-Y7FLPQSL.cjs} +3 -3
  62. package/dist/{chunk-MEXGQE4T.mjs → chunk-YR7ZI57S.mjs} +17 -12
  63. package/dist/{client-component.d-BavTzqsn.d.ts → client-component.d-BHE9Ns8s.d.ts} +1 -1
  64. package/dist/{client-component.d-X3j9FOZ2.d.mts → client-component.d-uya-qDZu.d.mts} +1 -1
  65. package/dist/{client-plugins.d-DnnAopKG.d.mts → client-plugins.d-CqFAvu-W.d.mts} +38 -1
  66. package/dist/{client-plugins.d-CqTr5IrQ.d.ts → client-plugins.d-Dp89a9Gf.d.ts} +38 -1
  67. package/dist/client-plugins.d.mts +1 -1
  68. package/dist/client-plugins.d.ts +1 -1
  69. package/dist/client.d.mts +7 -7
  70. package/dist/client.d.ts +7 -7
  71. package/dist/config.d.mts +1 -1
  72. package/dist/config.d.ts +1 -1
  73. package/dist/desktop.d.mts +2 -2
  74. package/dist/desktop.d.ts +2 -2
  75. package/dist/{devtools-RFVGDHXH.mjs → devtools-CRZCFRRL.mjs} +1 -1
  76. package/dist/{devtools-4LMM3DDJ.cjs → devtools-ZHYYPMZ3.cjs} +2 -2
  77. package/dist/docs.cjs +3 -3
  78. package/dist/docs.d.mts +3 -3
  79. package/dist/docs.d.ts +3 -3
  80. package/dist/docs.mjs +2 -2
  81. package/dist/environment/vite.cjs +4 -4
  82. package/dist/environment/vite.mjs +3 -3
  83. package/dist/{handler.d-BSlpYCDB.d.mts → handler.d-BgJGywnq.d.mts} +1 -1
  84. package/dist/{handler.d-DgX7gPO6.d.ts → handler.d-DHxaRQr7.d.ts} +1 -1
  85. package/dist/{headers.d-CmxW42R2.d.ts → headers.d-DVm2BMtR.d.ts} +1 -1
  86. package/dist/{headers.d-Cf8l5LMo.d.mts → headers.d-QrzpChrN.d.mts} +1 -1
  87. package/dist/index.cjs +19 -19
  88. package/dist/{index.d-BZZt7kxO.d.ts → index.d-B8lXhfTs.d.ts} +1 -1
  89. package/dist/{index.d-7xoJqKRZ.d.mts → index.d-Bpu1TV0-.d.mts} +1 -1
  90. package/dist/index.d.mts +22 -22
  91. package/dist/index.d.ts +22 -22
  92. package/dist/index.mjs +18 -18
  93. package/dist/integrations/orm.d.mts +1 -1
  94. package/dist/integrations/orm.d.ts +1 -1
  95. package/dist/integrations.d.mts +1 -1
  96. package/dist/integrations.d.ts +1 -1
  97. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  98. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  99. package/dist/internal/build-runtime.cjs +18 -18
  100. package/dist/internal/build-runtime.d.mts +4 -4
  101. package/dist/internal/build-runtime.d.ts +4 -4
  102. package/dist/internal/build-runtime.mjs +17 -17
  103. package/dist/internal/cli-runtime.cjs +7 -7
  104. package/dist/internal/cli-runtime.d.mts +7 -7
  105. package/dist/internal/cli-runtime.d.ts +7 -7
  106. package/dist/internal/cli-runtime.mjs +6 -6
  107. package/dist/internal/client-error-overlay.cjs +4 -4
  108. package/dist/internal/client-error-overlay.mjs +1 -1
  109. package/dist/internal/client-runtime.d.mts +5 -5
  110. package/dist/internal/client-runtime.d.ts +5 -5
  111. package/dist/internal/compression-runtime.d.mts +1 -1
  112. package/dist/internal/compression-runtime.d.ts +1 -1
  113. package/dist/internal/config-runtime.cjs +3 -3
  114. package/dist/internal/config-runtime.d.mts +3 -3
  115. package/dist/internal/config-runtime.d.ts +3 -3
  116. package/dist/internal/config-runtime.mjs +2 -2
  117. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  118. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  119. package/dist/internal/native-server-fns.cjs +4 -4
  120. package/dist/internal/native-server-fns.mjs +3 -3
  121. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  122. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  123. package/dist/internal/production-runtime.cjs +4 -4
  124. package/dist/internal/production-runtime.d.mts +10 -10
  125. package/dist/internal/production-runtime.d.ts +10 -10
  126. package/dist/internal/production-runtime.mjs +3 -3
  127. package/dist/internal/spa-router.d.mts +3 -3
  128. package/dist/internal/spa-router.d.ts +3 -3
  129. package/dist/internal/start-manifest.d.mts +1 -1
  130. package/dist/internal/start-manifest.d.ts +1 -1
  131. package/dist/markdown.d.mts +1 -1
  132. package/dist/markdown.d.ts +1 -1
  133. package/dist/middleware.d.mts +1 -1
  134. package/dist/middleware.d.ts +1 -1
  135. package/dist/{mount.d-CD-xVBu7.d.ts → mount.d-Cw_75kb9.d.ts} +1 -1
  136. package/dist/{mount.d-Dd0xeRMl.d.mts → mount.d-CyfNKOHK.d.mts} +1 -1
  137. package/dist/{navigation-delegate.d-Bses_F-y.d.ts → navigation-delegate.d--imR0rY7.d.ts} +1 -1
  138. package/dist/{navigation-delegate.d-dBNg976E.d.mts → navigation-delegate.d-DVEtyGYw.d.mts} +1 -1
  139. package/dist/navigation.d.mts +4 -4
  140. package/dist/navigation.d.ts +4 -4
  141. package/dist/plugin.cjs +13 -13
  142. package/dist/plugin.d.mts +5 -5
  143. package/dist/plugin.d.ts +5 -5
  144. package/dist/plugin.mjs +12 -12
  145. package/dist/{render-plan.d-vOdZHHLI.d.mts → render-plan.d-CTehM6y8.d.mts} +1 -1
  146. package/dist/{render-plan.d-DaIwnRK2.d.ts → render-plan.d-DpxLd_1i.d.ts} +1 -1
  147. package/dist/renderer-client.d.mts +5 -5
  148. package/dist/renderer-client.d.ts +5 -5
  149. package/dist/{request.d-CgXp3EEc.d.ts → request.d-BFXzOr32.d.ts} +1 -1
  150. package/dist/{request.d-B8U4pVFP.d.mts → request.d-BmQzlKtT.d.mts} +1 -1
  151. package/dist/request.d.mts +2 -2
  152. package/dist/request.d.ts +2 -2
  153. package/dist/{route-rendering.d-Di0AxFix.d.ts → route-rendering.d-bEil1VkF.d.ts} +1 -1
  154. package/dist/{route-rendering.d-BQvNYQqu.d.mts → route-rendering.d-geg68qd0.d.mts} +1 -1
  155. package/dist/{router.d-BJVGhSAJ.d.ts → router.d-4OCT2ak5.d.ts} +1 -1
  156. package/dist/{router.d-hNedVdoB.d.mts → router.d-CQjEcNih.d.mts} +1 -1
  157. package/dist/routes.cjs +3 -3
  158. package/dist/routes.d.mts +1 -1
  159. package/dist/routes.d.ts +1 -1
  160. package/dist/routes.mjs +2 -2
  161. package/dist/{rsc-pipeline-NCJ3NIE5.mjs → rsc-pipeline-JISGZS6G.mjs} +2 -2
  162. package/dist/{rsc-pipeline-HT4G3QGT.cjs → rsc-pipeline-R5W3PAAL.cjs} +3 -3
  163. package/dist/{runtime-6UF5XKUP.cjs → runtime-HSTND4FF.cjs} +8 -8
  164. package/dist/{runtime-VHXIEXL7.mjs → runtime-I2SBIB2Q.mjs} +5 -5
  165. package/dist/{runtime.d-0R8nHCM6.d.ts → runtime.d-BKoa6J55.d.ts} +1 -1
  166. package/dist/{runtime.d-DpeuF_T-.d.mts → runtime.d-DjYo5E1n.d.mts} +1 -1
  167. package/dist/{schema-dependencies.d-_Wyey4Wv.d.mts → schema-dependencies.d-CGNgsyKS.d.mts} +1 -1
  168. package/dist/{schema-dependencies.d-tkUHREqz.d.ts → schema-dependencies.d-CRoN2Q9N.d.ts} +1 -1
  169. package/dist/{server-components-status.d-sN7ju-ie.d.mts → server-components-status.d-Crl3IonP.d.mts} +1 -1
  170. package/dist/{server-components-status.d-B2Z5WvO5.d.ts → server-components-status.d-CwfcQD6n.d.ts} +1 -1
  171. package/dist/server-plugins.d.mts +3 -3
  172. package/dist/server-plugins.d.ts +3 -3
  173. package/dist/server.cjs +34 -34
  174. package/dist/server.d.mts +11 -11
  175. package/dist/server.d.ts +11 -11
  176. package/dist/server.mjs +14 -14
  177. package/dist/{spa-router.d-MjT6sGb9.d.ts → spa-router.d-Bv-r3AAK.d.ts} +2 -2
  178. package/dist/{spa-router.d-D3AtR2Bc.d.mts → spa-router.d-DhO_PJHP.d.mts} +2 -2
  179. package/dist/{ssg.d-C1SNuPz5.d.ts → ssg.d-CzFOAkqy.d.mts} +13 -2
  180. package/dist/{ssg.d-B32Cp_XW.d.mts → ssg.d-SfEQfMsA.d.ts} +13 -2
  181. package/dist/{store-core.d-BZ3YXs70.d.ts → store-core.d-Ch0N8dni.d.ts} +2 -2
  182. package/dist/{store-core.d-BbVdaoA0.d.mts → store-core.d-pKJCUdTR.d.mts} +2 -2
  183. package/dist/testing.cjs +5 -5
  184. package/dist/testing.d.mts +1 -1
  185. package/dist/testing.d.ts +1 -1
  186. package/dist/testing.mjs +4 -4
  187. package/dist/{utils.d-Bjbm44fP.d.ts → utils.d-BaLODLrK.d.ts} +1 -1
  188. package/dist/{utils.d-CoLozp7-.d.mts → utils.d-TPjb_Q7w.d.mts} +1 -1
  189. package/dist/version.cjs +2 -2
  190. package/dist/version.mjs +1 -1
  191. package/dist/vite.cjs +13 -13
  192. package/dist/vite.d.mts +6 -6
  193. package/dist/vite.d.ts +6 -6
  194. package/dist/vite.mjs +12 -12
  195. package/package.json +2 -2
  196. package/dist/analyzer-ENHO4SA5.cjs +0 -17
  197. package/dist/chunk-Q4CPBKPT.mjs +0 -251
  198. /package/dist/{chunk-JL2HNLMC.mjs → chunk-3QC2XTCN.mjs} +0 -0
  199. /package/dist/{chunk-COXMHCIV.cjs → chunk-GDKJGL7D.cjs} +0 -0
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  collectFarmNativeServerFns,
34
34
  findFarmNativeScreenFiles
35
- } from "./chunk-GKDOKES3.mjs";
35
+ } from "./chunk-CQ5LVPBL.mjs";
36
36
  import {
37
37
  assertFarmDocsAdapterServesNoGuardedPages,
38
38
  compileFarmDocsAdapterEdgeManifest,
@@ -41,7 +41,7 @@ import {
41
41
  listFarmDocsAdapterPages,
42
42
  listFarmDocsAdapterRoutes,
43
43
  listFarmDocsPagePaths
44
- } from "./chunk-JCERO6YF.mjs";
44
+ } from "./chunk-BUIZTM3Q.mjs";
45
45
  import {
46
46
  FARM_DOCS_LAST_MODIFIED_MANIFEST,
47
47
  createFarmDocsHandler,
@@ -71,7 +71,7 @@ import {
71
71
  getDeployTargetForPreset,
72
72
  hasCustomFarmRouteContext,
73
73
  resolveDeployOutputPath
74
- } from "./chunk-JL2HNLMC.mjs";
74
+ } from "./chunk-3QC2XTCN.mjs";
75
75
  import {
76
76
  resolveFarmInstrumentationFile
77
77
  } from "./chunk-QRNYSISP.mjs";
@@ -117,7 +117,7 @@ import {
117
117
  resolveFarmNotFoundComponentPath,
118
118
  resolveFarmRouteRootStrategy,
119
119
  toBakedMarkdownSourcePath
120
- } from "./chunk-MEXGQE4T.mjs";
120
+ } from "./chunk-YR7ZI57S.mjs";
121
121
  import {
122
122
  TAILWIND_CSS_BROWSER_TARGET,
123
123
  generateFarmClientPluginEntryCode,
@@ -133,11 +133,11 @@ import {
133
133
  readRouteRenderingDirectiveFromFile,
134
134
  resolveRouteRenderingConfig,
135
135
  resolveRouteRenderingConfigFromFile
136
- } from "./chunk-CZMMU3FP.mjs";
136
+ } from "./chunk-D4DAL7KK.mjs";
137
137
  import {
138
138
  FARM_PRERENDER_ENV,
139
139
  _farmWebMCPReportsEnabled
140
- } from "./chunk-ST3U7XVO.mjs";
140
+ } from "./chunk-7IM2MKRK.mjs";
141
141
  import {
142
142
  HOISTED_HEAD_ELEMENT,
143
143
  appMiddlewareMayHandlePath,
@@ -165,7 +165,7 @@ import {
165
165
  listFarmBuiltInRoutePaths,
166
166
  resolveFarmApiCatalogInput,
167
167
  resolveFarmAppManifestInput
168
- } from "./chunk-IEXZMDF4.mjs";
168
+ } from "./chunk-BCIUG6EQ.mjs";
169
169
  import {
170
170
  FARM_DEFAULT_MCP_PATH,
171
171
  createFarmDefaultMCPServer,
@@ -173,7 +173,7 @@ import {
173
173
  } from "./chunk-WABOJXAA.mjs";
174
174
  import {
175
175
  isFarmPreviewDeploymentEnvironment
176
- } from "./chunk-NPR6SCEV.mjs";
176
+ } from "./chunk-AOSZIHL7.mjs";
177
177
  import {
178
178
  FARM_NATIVE_SERVER_FN_PLUGIN
179
179
  } from "./chunk-L4RTTTVE.mjs";
@@ -194,7 +194,7 @@ import {
194
194
  withFarmSourceSnapshot,
195
195
  withFarmSourceSnapshotOf,
196
196
  withPackageClientBoundaryCache
197
- } from "./chunk-ZVT2F3JU.mjs";
197
+ } from "./chunk-DR65XXXD.mjs";
198
198
  import {
199
199
  generateFarmDocsAdapterClientRuntime,
200
200
  getFarmDocsAdapterConfigModule
@@ -288,7 +288,7 @@ import {
288
288
  } from "./chunk-QD34VE4N.mjs";
289
289
  import {
290
290
  APIRouteManager
291
- } from "./chunk-CPL7WIMP.mjs";
291
+ } from "./chunk-P3UT3OLV.mjs";
292
292
  import {
293
293
  hasPolyroutePlugin,
294
294
  isPolyrouteRouteFileName
@@ -320,7 +320,7 @@ import {
320
320
  } from "./chunk-2I6PUKWJ.mjs";
321
321
  import {
322
322
  FARM_VERSION
323
- } from "./chunk-6VMBLDWY.mjs";
323
+ } from "./chunk-CV7C75LN.mjs";
324
324
  import {
325
325
  FARM_VIDEO_PLAYER_PATH
326
326
  } from "./chunk-23NBOP43.mjs";
@@ -1563,6 +1563,29 @@ function escapeRegExp3(value) {
1563
1563
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1564
1564
  }
1565
1565
 
1566
+ // src/nitro/static-pages.ts
1567
+ var FARM_STATIC_PAGE_REFUSAL_TYPE = "application/x-farm-static-page-refusal";
1568
+ function resolveFarmStaticPagesMode(value) {
1569
+ if (value === void 0 || value === "off") return "off";
1570
+ if (value === "analyze" || value === "enabled") return value;
1571
+ throw new TypeError(
1572
+ `\`experimental.staticPages\` must be "off", "analyze" or "enabled", got ${JSON.stringify(
1573
+ value
1574
+ )}. Use "analyze" to see which pages would be written as files.`
1575
+ );
1576
+ }
1577
+ function getFarmStaticPageRefusal(route) {
1578
+ if (route.error) {
1579
+ return route.error.status ? `its build-time render answered ${route.error.status}` : `its build-time render failed: ${route.error.message ?? "unknown error"}`;
1580
+ }
1581
+ const contentType = route.contentType?.toLowerCase() ?? "";
1582
+ if (contentType.includes(FARM_STATIC_PAGE_REFUSAL_TYPE)) {
1583
+ return route.contents || "its render read request state";
1584
+ }
1585
+ if (!contentType.includes("html")) return "it does not render HTML";
1586
+ return null;
1587
+ }
1588
+
1566
1589
  // src/nitro/ssr-public-assets.ts
1567
1590
  import path10 from "path";
1568
1591
  var SERVER_FILE_URL_RE = /new\s+URL\(\s*(["'`])([^"'`\\]+)\1\s*,\s*import\.meta\.url\s*\)/g;
@@ -8445,6 +8468,7 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
8445
8468
  function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
8446
8469
  const farmRendererDisabled = isFarmRendererDisabled(config.renderer);
8447
8470
  const farmStaticNotFoundBuild = preset === "vercel" && config.experimental?.staticNotFound === true && !farmRendererDisabled;
8471
+ const farmStaticPagesBuild = resolveFarmStaticPagesMode(config.experimental?.staticPages) !== "off" && !farmRendererDisabled;
8448
8472
  const searchPreserveRoutes = pageRoutes.flatMap(
8449
8473
  (route) => route.searchPreserve ? [route.searchPreserve] : []
8450
8474
  );
@@ -9336,7 +9360,12 @@ function createFarmStaticNotFoundRefusal(reason) {
9336
9360
  status: 404,
9337
9361
  headers: { "Content-Type": ${JSON.stringify(FARM_STATIC_NOT_FOUND_REFUSAL_TYPE)} },
9338
9362
  });
9339
- }` : ""}
9363
+ }` : ""}${farmStaticPagesBuild ? `
9364
+
9365
+ // experimental.staticPages: set while the build prerenders, never for a visitor. Read once: Nitro's
9366
+ // prerender worker sets the variable before it loads the server.
9367
+ const farmStaticPagesPrerendering =
9368
+ typeof process !== "undefined" && process.env?.${FARM_PRERENDER_ENV} === "1";` : ""}
9340
9369
  ${nativeMCP.registerSource}
9341
9370
  // Config middleware from layers is appended in layer order ahead of the
9342
9371
  // project's, the same merge development applies (mergeFarmLayerConfig).
@@ -11467,18 +11496,23 @@ function matchRouteSlots(pathname, interceptFrom) {
11467
11496
  }
11468
11497
  return matched;
11469
11498
  }` : ""}
11499
+ const normalizedFrom =
11500
+ typeof interceptFrom === "string" && interceptFrom.startsWith("/")
11501
+ ? new URL(interceptFrom, "http://farm.local").pathname
11502
+ : null;
11470
11503
  for (const slot of routeSlots) {
11471
- if (!${sharedSlotOwners.size > 0 ? "matchesSlotOwner(slot.ownerPattern)" : "matchesRoutePrefix(pathname, slot.ownerPattern)"}) continue;
11504
+ if (
11505
+ !${sharedSlotOwners.size > 0 ? "matchesSlotOwner(slot.ownerPattern)" : "matchesRoutePrefix(pathname, slot.ownerPattern)"} &&
11506
+ !(slot.interception && normalizedFrom && matchesRoutePrefix(normalizedFrom, slot.ownerPattern))
11507
+ ) {
11508
+ continue;
11509
+ }
11472
11510
  const key = slot.ownerPattern + ":" + slot.name;
11473
11511
  const entries = groups.get(key) || [];
11474
11512
  entries.push(slot);
11475
11513
  groups.set(key, entries);
11476
11514
  }
11477
11515
 
11478
- const normalizedFrom =
11479
- typeof interceptFrom === "string" && interceptFrom.startsWith("/")
11480
- ? new URL(interceptFrom, "http://farm.local").pathname
11481
- : null;
11482
11516
  const matches = [];
11483
11517
  // Leave empty, fallback-only and ineligible requests unparsed.
11484
11518
  let pathnameSegments;
@@ -13204,7 +13238,28 @@ ${hasServerRuntimeIntegrations ? `
13204
13238
  hasConfiguredRouteContext ||
13205
13239
  middlewareData?.size ||
13206
13240
  middlewareContext?.size
13207
- );
13241
+ );${farmStaticPagesBuild ? `
13242
+ // experimental.staticPages: the build prerenders a page that sets no rendering mode (any
13243
+ // prerendered page without static config is one) and writes it only if this render read
13244
+ // nothing of the request. Otherwise it answers why, in a type only the build reads.
13245
+ if (farmStaticPagesPrerendering && !resolveRouteRenderingView(route).ssg) {
13246
+ const farmStaticPageRefusal = pageStatus >= 400
13247
+ ? "it answered " + pageStatus
13248
+ : renderReadRequest
13249
+ ? "the render read the request's headers or cookies"
13250
+ : renderReadCookies()
13251
+ ? "the render read cookies through a helper, such as an auth or api client"
13252
+ : middlewareData?.size || middlewareContext?.size
13253
+ ? "middleware passed it data"
13254
+ : hasConfiguredRouteContext
13255
+ ? "the app defines a route context"
13256
+ : "";
13257
+ if (farmStaticPageRefusal) {
13258
+ return new Response(farmStaticPageRefusal, {
13259
+ headers: { "Content-Type": ${JSON.stringify(FARM_STATIC_PAGE_REFUSAL_TYPE)} },
13260
+ });
13261
+ }
13262
+ }` : ""}
13208
13263
  if (farmRouteRuleCached && (renderedPage.stream || hasRequestScopedRender)) {
13209
13264
  // The route rule's cache refuses a private page: say why it renders on every request.
13210
13265
  emitFarmEvent({
@@ -14278,6 +14333,34 @@ function prerenderWouldChangePageUrl(pathname) {
14278
14333
  return true;
14279
14334
  }
14280
14335
  }
14336
+ var comparePathnames = (a, b) => a < b ? -1 : a > b ? 1 : 0;
14337
+ function reportFarmStaticPages(mode, candidates, verdicts, bypasses) {
14338
+ const written = candidates.filter((pathname) => verdicts.get(pathname) === null);
14339
+ if (mode === "enabled") {
14340
+ if (written.length > 0) {
14341
+ logger.info(
14342
+ `\u{1F4C4} Prerendered ${written.length} page(s) that read no request state (experimental.staticPages)`
14343
+ );
14344
+ }
14345
+ return;
14346
+ }
14347
+ const kept = [
14348
+ ...bypasses,
14349
+ ...candidates.flatMap((pathname) => {
14350
+ const reason = verdicts.get(pathname);
14351
+ return reason ? [{ pathname, reason }] : [];
14352
+ })
14353
+ ].sort((a, b) => comparePathnames(a.pathname, b.pathname));
14354
+ written.sort(comparePathnames);
14355
+ const lines = [
14356
+ `experimental.staticPages ("analyze") wrote no files. With "enabled":`,
14357
+ ` ${written.length} page(s) would be written as files${written.length ? ":" : ""}`,
14358
+ ...written.map((pathname) => ` ${pathname}`),
14359
+ ` ${kept.length} page(s) would stay server-handled${kept.length ? ":" : ""}`,
14360
+ ...kept.map(({ pathname, reason }) => ` ${pathname} (${reason})`)
14361
+ ];
14362
+ logger.info(lines.join("\n"));
14363
+ }
14281
14364
  function getPhysicalPrerenderBypassReason(options) {
14282
14365
  const {
14283
14366
  config,
@@ -14285,7 +14368,8 @@ function getPhysicalPrerenderBypassReason(options) {
14285
14368
  routeRuntimeManifest,
14286
14369
  redirectSources,
14287
14370
  rewriteSources,
14288
- pathname
14371
+ pathname,
14372
+ renderingDecidedByBuild
14289
14373
  } = options;
14290
14374
  if (prerenderWouldChangePageUrl(pathname)) return "an escaped character in its URL";
14291
14375
  if (config.i18n.enabled) return "request-sensitive i18n";
@@ -14300,7 +14384,9 @@ function getPhysicalPrerenderBypassReason(options) {
14300
14384
  if (hasCustomFarmRouteContext(config)) return "request context";
14301
14385
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
14302
14386
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
14303
- if (manifestEntry?.rendering === "dynamic") return "dynamic runtime manifest";
14387
+ if (manifestEntry?.rendering === "dynamic" && !renderingDecidedByBuild) {
14388
+ return "dynamic runtime manifest";
14389
+ }
14304
14390
  if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(manifestEntry.regions?.length) || manifestEntry.maxDuration !== void 0)) {
14305
14391
  return "route runtime controls";
14306
14392
  }
@@ -14592,14 +14678,17 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
14592
14678
  logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
14593
14679
  logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
14594
14680
  logger.info(`\u{1F4E6} Preset: ${preset}`);
14595
- const ssgCollectionPromise = routeManager.collectSSGPages();
14681
+ const staticPagesMode = isFarmRendererDisabled(config.renderer) ? "off" : resolveFarmStaticPagesMode(config.experimental?.staticPages);
14682
+ const ssgCollectionPromise = routeManager.collectSSGPages(
14683
+ staticPagesMode === "off" ? {} : { staticCandidates: true }
14684
+ );
14596
14685
  const middlewareRoutesPromise = discoverMiddlewareRoutes(getFarmAppDirectories(config));
14597
14686
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
14598
14687
  const docsPrerenderPagesPromise = getFarmDocsPrerenderPages(config, root, preset);
14599
14688
  const farmWorkflows = await prepareFarmWorkflowsForNitro(config);
14600
14689
  const farmCron = await prepareFarmCronForNitro(config);
14601
14690
  const [
14602
- { ssg: ssgPages },
14691
+ { ssg: ssgPages, staticCandidates: staticPageCandidates = [] },
14603
14692
  middlewareRoutes,
14604
14693
  [configuredRedirects, configuredRewrites],
14605
14694
  docsPrerenderPages
@@ -14616,7 +14705,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
14616
14705
  const rewriteSources = configuredRewrites.map((route) => route.source);
14617
14706
  const prerenderRoutes = [];
14618
14707
  const skippedPrerenderRoutes = [];
14619
- const middlewareRoutesWithConfig = ssgPages.length > 0 || docsPrerenderPages.length > 0 ? await Promise.all(
14708
+ const middlewareRoutesWithConfig = ssgPages.length > 0 || docsPrerenderPages.length > 0 || staticPageCandidates.length > 0 ? await Promise.all(
14620
14709
  middlewareRoutes.map(async (route) => ({
14621
14710
  ...route,
14622
14711
  config: await readMiddlewareFileConfig(route.filePath)
@@ -14671,6 +14760,31 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
14671
14760
  for (const skipped of skippedPrerenderRoutes) {
14672
14761
  logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
14673
14762
  }
14763
+ const staticPageCandidatePaths = [];
14764
+ const staticPageBypasses = [];
14765
+ for (const page of staticPageCandidates) {
14766
+ if (prerenderRoutes.includes(page.urlPath)) continue;
14767
+ const reason = getPhysicalPrerenderBypassReason({
14768
+ config,
14769
+ middlewareRoutes: middlewareRoutesWithConfig,
14770
+ routeRuntimeManifest,
14771
+ redirectSources,
14772
+ rewriteSources,
14773
+ pathname: page.urlPath,
14774
+ renderingDecidedByBuild: true
14775
+ });
14776
+ if (reason) {
14777
+ staticPageBypasses.push({ pathname: page.urlPath, reason });
14778
+ continue;
14779
+ }
14780
+ addPrerenderRoute(page.urlPath);
14781
+ staticPageCandidatePaths.push(page.urlPath);
14782
+ }
14783
+ if (staticPagesMode === "enabled") {
14784
+ for (const bypass of staticPageBypasses) {
14785
+ logger.info(`\u21AA Keeping ${bypass.pathname} server-handled (${bypass.reason})`);
14786
+ }
14787
+ }
14674
14788
  const staticNotFoundPlan = await resolveFarmStaticNotFoundPlan({
14675
14789
  config,
14676
14790
  root,
@@ -15329,14 +15443,40 @@ function toFarmNodeResponse(request, response) {
15329
15443
  });
15330
15444
  const prerenderPagePaths = new Set(prerenderRoutes.map(toPrerenderPublicPath));
15331
15445
  let skippedNonHtmlPrerenderRoute = false;
15332
- nitroInstance.hooks.hook("prerender:generate", (route) => {
15333
- if (route.error || !prerenderPagePaths.has(route.route)) return;
15334
- if (route.contentType?.toLowerCase().includes("html")) return;
15446
+ const keepPrerenderRouteServerHandled = (route) => {
15335
15447
  route.skip = true;
15336
15448
  skippedNonHtmlPrerenderRoute = true;
15337
15449
  const configuredRule = configuredNitroRouteRules[route.route];
15338
15450
  if (configuredRule) nitroInstance.options.routeRules[route.route] = configuredRule;
15339
15451
  else delete nitroInstance.options.routeRules[route.route];
15452
+ };
15453
+ const staticPageCandidatePublicPaths = new Map(
15454
+ staticPageCandidatePaths.map((pathname) => [toPrerenderPublicPath(pathname), pathname])
15455
+ );
15456
+ const staticPageVerdicts = /* @__PURE__ */ new Map();
15457
+ if (staticPageCandidatePublicPaths.size > 0) {
15458
+ nitroInstance.hooks.hook("prerender:generate", (route) => {
15459
+ const pathname = staticPageCandidatePublicPaths.get(route.route);
15460
+ if (pathname === void 0) return;
15461
+ const refusal = getFarmStaticPageRefusal(route);
15462
+ staticPageVerdicts.set(pathname, refusal);
15463
+ if (route.error) {
15464
+ route.error = void 0;
15465
+ if (staticPagesMode === "enabled") {
15466
+ logger.warn(
15467
+ `\u21AA Keeping ${pathname} server-handled: ${refusal}. Fix the page, or export \`dynamic = "force-dynamic"\` to render it on each request.`
15468
+ );
15469
+ }
15470
+ } else if (refusal && staticPagesMode === "enabled") {
15471
+ logger.info(`\u21AA Keeping ${pathname} server-handled (${refusal})`);
15472
+ }
15473
+ if (refusal || staticPagesMode === "analyze") keepPrerenderRouteServerHandled(route);
15474
+ });
15475
+ }
15476
+ nitroInstance.hooks.hook("prerender:generate", (route) => {
15477
+ if (route.error || route.skip || !prerenderPagePaths.has(route.route)) return;
15478
+ if (route.contentType?.toLowerCase().includes("html")) return;
15479
+ keepPrerenderRouteServerHandled(route);
15340
15480
  logger.info(`\u21AA Keeping SSG route ${route.route} server-handled (it does not render HTML)`);
15341
15481
  });
15342
15482
  nitroInstance.hooks.hook("prerender:done", () => {
@@ -15484,8 +15624,14 @@ function toFarmNodeResponse(request, response) {
15484
15624
  });
15485
15625
  }
15486
15626
  if (prerenderRoutes.length > 0 || staticNotFoundPrerenderPath) {
15487
- if (prerenderRoutes.length > 0) {
15488
- logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
15627
+ const ssgPageCount = prerenderRoutes.length - staticPageCandidatePaths.length;
15628
+ if (ssgPageCount > 0) {
15629
+ logger.info(`\u{1F4C4} Pre-rendering ${ssgPageCount} SSG page(s)`);
15630
+ }
15631
+ if (staticPageCandidatePaths.length > 0) {
15632
+ logger.info(
15633
+ `\u{1F4C4} Rendering ${staticPageCandidatePaths.length} page(s) that set no rendering mode (experimental.staticPages: "${staticPagesMode}")`
15634
+ );
15489
15635
  }
15490
15636
  const previousPrerender = process.env[FARM_PRERENDER_ENV];
15491
15637
  process.env[FARM_PRERENDER_ENV] = "1";
@@ -15496,6 +15642,14 @@ function toFarmNodeResponse(request, response) {
15496
15642
  else process.env[FARM_PRERENDER_ENV] = previousPrerender;
15497
15643
  }
15498
15644
  }
15645
+ if (staticPagesMode !== "off") {
15646
+ reportFarmStaticPages(
15647
+ staticPagesMode,
15648
+ staticPageCandidatePaths,
15649
+ staticPageVerdicts,
15650
+ staticPageBypasses
15651
+ );
15652
+ }
15499
15653
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
15500
15654
  const prebuiltSSRFilesPromise = canReusePrebuiltSSR ? prepareSSRBundleFiles(
15501
15655
  ssrBundle,
@@ -15614,7 +15768,10 @@ function toFarmNodeResponse(request, response) {
15614
15768
  middlewareRoutes: edgeMiddlewareRoutes,
15615
15769
  guardedPages: edgeGuardedPrerenderRoutes
15616
15770
  },
15617
- prerenderRoutes.map(toPrerenderPublicPath),
15771
+ // A candidate page the build kept on the server has no file to redirect to or negotiate.
15772
+ prerenderRoutes.filter(
15773
+ (pathname) => !staticPageVerdicts.has(pathname) || staticPagesMode === "enabled" && staticPageVerdicts.get(pathname) === null
15774
+ ).map(toPrerenderPublicPath),
15618
15775
  staticNotFoundRoutes
15619
15776
  );
15620
15777
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFarmRouteLabel
3
- } from "./chunk-IEXZMDF4.mjs";
3
+ } from "./chunk-BCIUG6EQ.mjs";
4
4
  import {
5
5
  _classifyFarmMCPClient,
6
6
  _farmMCPClientSession,
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkWXPY5FRFcjs = require('./chunk-WXPY5FRF.cjs');
4
+ var _chunkP2PF5FUWcjs = require('./chunk-P2PF5FUW.cjs');
5
5
 
6
6
 
7
7
  var _chunkCS6GXE42cjs = require('./chunk-CS6GXE42.cjs');
@@ -99,7 +99,10 @@ function analyzeStaticRouteCandidate(mod, source, options = {}) {
99
99
  if (options.isDynamic && !listsStaticPaths(mod)) {
100
100
  blockers.push("the route has dynamic path segments");
101
101
  }
102
- if (hasExplicitRenderingConfig(mod, source)) {
102
+ if (hasExplicitRenderingConfig(
103
+ options.dynamicAutoIsUnset && _optionalChain([mod, 'optionalAccess', _ => _.dynamic]) === "auto" ? { ...mod, dynamic: void 0 } : mod,
104
+ source
105
+ )) {
103
106
  blockers.push("the route already has explicit rendering config");
104
107
  }
105
108
  if (source) {
@@ -135,7 +138,7 @@ function findRequestBoundSourceBlockers(source) {
135
138
  blockers.add(`the route reads ${label}`);
136
139
  }
137
140
  }
138
- const propsName = _optionalChain([params, 'access', _ => _.match, 'call', _2 => _2(/^\s*([A-Za-z_$][\w$]*)\s*(?::|,|$)/), 'optionalAccess', _3 => _3[1]]);
141
+ const propsName = _optionalChain([params, 'access', _2 => _2.match, 'call', _3 => _3(/^\s*([A-Za-z_$][\w$]*)\s*(?::|,|$)/), 'optionalAccess', _4 => _4[1]]);
139
142
  if (propsName) {
140
143
  for (const [name, label] of ROUTE_PROP_LABELS) {
141
144
  if (new RegExp(`\\b${escapeRegExp(propsName)}\\s*\\.\\s*${name}\\b`).test(code)) {
@@ -154,15 +157,15 @@ function findRequestBoundSourceBlockers(source) {
154
157
  function readRequestApiImportBindings(source) {
155
158
  const bindings = [];
156
159
  for (const clause of readStaticImportClauses(source)) {
157
- const namedGroup = _optionalChain([clause, 'access', _4 => _4.match, 'call', _5 => _5(/\{([\s\S]*?)\}/), 'optionalAccess', _6 => _6[1]]);
160
+ const namedGroup = _optionalChain([clause, 'access', _5 => _5.match, 'call', _6 => _6(/\{([\s\S]*?)\}/), 'optionalAccess', _7 => _7[1]]);
158
161
  for (const rawSpecifier of (_nullishCoalesce(namedGroup, () => ( ""))).split(",")) {
159
162
  const specifier = rawSpecifier.trim().replace(/^type\s+/, "");
160
163
  const imported = specifier.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);
161
- if (!_optionalChain([imported, 'optionalAccess', _7 => _7[1]])) continue;
164
+ if (!_optionalChain([imported, 'optionalAccess', _8 => _8[1]])) continue;
162
165
  const label = REQUEST_API_LABELS.get(imported[1]);
163
166
  if (label) bindings.push({ local: _nullishCoalesce(imported[2], () => ( imported[1])), label });
164
167
  }
165
- const local = _optionalChain([clause, 'access', _8 => _8.match, 'call', _9 => _9(/^\s*([A-Za-z_$][\w$]*)\s*(?:,|$)/), 'optionalAccess', _10 => _10[1]]);
168
+ const local = _optionalChain([clause, 'access', _9 => _9.match, 'call', _10 => _10(/^\s*([A-Za-z_$][\w$]*)\s*(?:,|$)/), 'optionalAccess', _11 => _11[1]]);
166
169
  if (local) {
167
170
  const label = REQUEST_API_LABELS.get(local);
168
171
  if (label) bindings.push({ local, label });
@@ -171,24 +174,24 @@ function readRequestApiImportBindings(source) {
171
174
  return bindings;
172
175
  }
173
176
  function readNamespaceImportBindings(source) {
174
- return readStaticImportClauses(source).map((clause) => _optionalChain([clause, 'access', _11 => _11.match, 'call', _12 => _12(/\*\s*as\s*([A-Za-z_$][\w$]*)/), 'optionalAccess', _13 => _13[1]])).filter((binding) => Boolean(binding));
177
+ return readStaticImportClauses(source).map((clause) => _optionalChain([clause, 'access', _12 => _12.match, 'call', _13 => _13(/\*\s*as\s*([A-Za-z_$][\w$]*)/), 'optionalAccess', _14 => _14[1]])).filter((binding) => Boolean(binding));
175
178
  }
176
179
  function readStaticImportClauses(source) {
177
180
  return [...source.matchAll(/\bimport\s+(?!\()([\s\S]*?)\s+from\s*["'][^"']+["']/g)].map((match) => match[1]).filter((clause) => Boolean(clause));
178
181
  }
179
182
  function readDefaultRouteParameters(code) {
180
- const inlineParams = _nullishCoalesce(_optionalChain([code, 'access', _14 => _14.match, 'call', _15 => _15(/\bexport\s+default\s+(?:async\s+)?function\b[^(]*\(([^)]*)\)/), 'optionalAccess', _16 => _16[1]]), () => ( _optionalChain([code, 'access', _17 => _17.match, 'call', _18 => _18(/\bexport\s+default\s+(?:async\s+)?\(([^)]*)\)\s*=>/), 'optionalAccess', _19 => _19[1]])));
183
+ const inlineParams = _nullishCoalesce(_optionalChain([code, 'access', _15 => _15.match, 'call', _16 => _16(/\bexport\s+default\s+(?:async\s+)?function\b[^(]*\(([^)]*)\)/), 'optionalAccess', _17 => _17[1]]), () => ( _optionalChain([code, 'access', _18 => _18.match, 'call', _19 => _19(/\bexport\s+default\s+(?:async\s+)?\(([^)]*)\)\s*=>/), 'optionalAccess', _20 => _20[1]])));
181
184
  if (inlineParams !== void 0) return inlineParams;
182
- const binding = _nullishCoalesce(_optionalChain([code, 'access', _20 => _20.match, 'call', _21 => _21(/\bexport\s+default\s+([A-Za-z_$][\w$]*)\s*;?/), 'optionalAccess', _22 => _22[1]]), () => ( _optionalChain([code, 'access', _23 => _23.match, 'call', _24 => _24(/\bexport\s*\{\s*([A-Za-z_$][\w$]*)\s+as\s+default\s*\}/), 'optionalAccess', _25 => _25[1]])));
185
+ const binding = _nullishCoalesce(_optionalChain([code, 'access', _21 => _21.match, 'call', _22 => _22(/\bexport\s+default\s+([A-Za-z_$][\w$]*)\s*;?/), 'optionalAccess', _23 => _23[1]]), () => ( _optionalChain([code, 'access', _24 => _24.match, 'call', _25 => _25(/\bexport\s*\{\s*([A-Za-z_$][\w$]*)\s+as\s+default\s*\}/), 'optionalAccess', _26 => _26[1]])));
183
186
  if (!binding) return void 0;
184
187
  const escapedBinding = escapeRegExp(binding);
185
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([code, 'access', _26 => _26.match, 'call', _27 => _27(new RegExp(`\\bfunction\\s+${escapedBinding}\\s*\\(([^)]*)\\)`)), 'optionalAccess', _28 => _28[1]]), () => ( _optionalChain([code, 'access', _29 => _29.match, 'call', _30 => _30(
188
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([code, 'access', _27 => _27.match, 'call', _28 => _28(new RegExp(`\\bfunction\\s+${escapedBinding}\\s*\\(([^)]*)\\)`)), 'optionalAccess', _29 => _29[1]]), () => ( _optionalChain([code, 'access', _30 => _30.match, 'call', _31 => _31(
186
189
  new RegExp(
187
190
  `\\b(?:const|let|var)\\s+${escapedBinding}\\s*=\\s*(?:async\\s+)?\\(([^)]*)\\)\\s*=>`
188
191
  )
189
- ), 'optionalAccess', _31 => _31[1]]))), () => ( _optionalChain([code, 'access', _32 => _32.match, 'call', _33 => _33(
192
+ ), 'optionalAccess', _32 => _32[1]]))), () => ( _optionalChain([code, 'access', _33 => _33.match, 'call', _34 => _34(
190
193
  new RegExp(`\\b(?:const|let|var)\\s+${escapedBinding}\\s*=\\s*function\\s*\\(([^)]*)\\)`)
191
- ), 'optionalAccess', _34 => _34[1]])));
194
+ ), 'optionalAccess', _35 => _35[1]])));
192
195
  }
193
196
  function stripCommentsAndLiteralContents(source) {
194
197
  return sanitizeSource(source, true);
@@ -290,10 +293,10 @@ function escapeRegExp(value) {
290
293
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
291
294
  }
292
295
  function listsStaticPaths(mod) {
293
- return typeof _optionalChain([mod, 'optionalAccess', _35 => _35.getStaticPaths]) === "function" || typeof _optionalChain([mod, 'optionalAccess', _36 => _36.generateStaticParams]) === "function";
296
+ return typeof _optionalChain([mod, 'optionalAccess', _36 => _36.getStaticPaths]) === "function" || typeof _optionalChain([mod, 'optionalAccess', _37 => _37.generateStaticParams]) === "function";
294
297
  }
295
298
  function hasExplicitRenderingConfig(mod, source) {
296
- return typeof _optionalChain([mod, 'optionalAccess', _37 => _37.ssg]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _38 => _38.ppr]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _39 => _39.experimental_ppr]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _40 => _40.revalidate]) !== "undefined" || typeof _optionalChain([mod, 'optionalAccess', _41 => _41.dynamic]) !== "undefined" || typeof parseRouteRenderingDirective(source) !== "undefined";
299
+ return typeof _optionalChain([mod, 'optionalAccess', _38 => _38.ssg]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _39 => _39.ppr]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _40 => _40.experimental_ppr]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _41 => _41.revalidate]) !== "undefined" || typeof _optionalChain([mod, 'optionalAccess', _42 => _42.dynamic]) !== "undefined" || typeof parseRouteRenderingDirective(source) !== "undefined";
297
300
  }
298
301
  function parseRouteRenderingDirective(source) {
299
302
  if (!source) {
@@ -322,7 +325,7 @@ function parseKnownRenderingDirective(directive) {
322
325
  const match = normalized.match(
323
326
  /^use\s+(ssg|static|isr|ssr|dynamic|ppr)(?:\s*[;:]\s*(\d+))?\s*;?$/
324
327
  );
325
- if (!_optionalChain([match, 'optionalAccess', _42 => _42[1]])) {
328
+ if (!_optionalChain([match, 'optionalAccess', _43 => _43[1]])) {
326
329
  return void 0;
327
330
  }
328
331
  const mode = match[1];
@@ -421,6 +424,7 @@ function skipHorizontalWhitespace(source, start) {
421
424
  async function collectSSGPages(routes, loadModule, options = {}) {
422
425
  const ssgPages = [];
423
426
  const ssrRoutes = [];
427
+ const staticCandidates = [];
424
428
  const staticCandidateRoutes = [];
425
429
  let staticCandidateDocsPages = 0;
426
430
  for (const route of routes) {
@@ -431,7 +435,7 @@ async function collectSSGPages(routes, loadModule, options = {}) {
431
435
  continue;
432
436
  }
433
437
  const source = await _promises.readFile.call(void 0, route.filePath, "utf8").catch(() => void 0);
434
- if (_optionalChain([options, 'access', _43 => _43.docsAdapterRoutes, 'optionalAccess', _44 => _44.owns, 'call', _45 => _45(route.path)]) && _chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, route.filePath)) {
438
+ if (_optionalChain([options, 'access', _44 => _44.docsAdapterRoutes, 'optionalAccess', _45 => _45.owns, 'call', _46 => _46(route.path)]) && _chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, route.filePath)) {
435
439
  ssrRoutes.push(route.path);
436
440
  if (options.suggestStaticRendering !== false && analyzeStaticRouteCandidate(null, source, { isDynamic: route.isDynamic }).candidate) {
437
441
  staticCandidateDocsPages += 1;
@@ -475,8 +479,13 @@ async function collectSSGPages(routes, loadModule, options = {}) {
475
479
  }
476
480
  } else {
477
481
  ssrRoutes.push(route.path);
478
- if (options.suggestStaticRendering !== false && analyzeStaticRouteCandidate(mod, source, { isDynamic: route.isDynamic }).candidate) {
479
- if (_optionalChain([options, 'access', _46 => _46.docsAdapterRoutes, 'optionalAccess', _47 => _47.owns, 'call', _48 => _48(route.path)])) staticCandidateDocsPages += 1;
482
+ if (options.staticCandidates && !_optionalChain([options, 'access', _47 => _47.docsAdapterRoutes, 'optionalAccess', _48 => _48.owns, 'call', _49 => _49(route.path)]) && analyzeStaticRouteCandidate(mod, source, {
483
+ isDynamic: route.isDynamic,
484
+ dynamicAutoIsUnset: true
485
+ }).candidate) {
486
+ staticCandidates.push(...await listStaticCandidatePages(route, mod));
487
+ } else if (options.suggestStaticRendering !== false && analyzeStaticRouteCandidate(mod, source, { isDynamic: route.isDynamic }).candidate) {
488
+ if (_optionalChain([options, 'access', _50 => _50.docsAdapterRoutes, 'optionalAccess', _51 => _51.owns, 'call', _52 => _52(route.path)])) staticCandidateDocsPages += 1;
480
489
  else staticCandidateRoutes.push(route.path);
481
490
  }
482
491
  }
@@ -496,12 +505,34 @@ async function collectSSGPages(routes, loadModule, options = {}) {
496
505
  Add \`export const dynamic = "force-static";\` after verifying that imported code does not read cookies, headers, authentication, or other request data.`
497
506
  );
498
507
  }
499
- if (staticCandidateDocsPages > 0 && !_optionalChain([options, 'access', _49 => _49.docsAdapterRoutes, 'optionalAccess', _50 => _50.prerender])) {
508
+ if (staticCandidateDocsPages > 0 && !_optionalChain([options, 'access', _53 => _53.docsAdapterRoutes, 'optionalAccess', _54 => _54.prerender])) {
500
509
  console.warn(
501
510
  `[Farm.js] ${staticCandidateDocsPages} docs page${staticCandidateDocsPages === 1 ? " renders" : "s render"} on each request. Set \`docs.prerender: true\` in farm.config.ts to prerender docs pages on Node and serverless targets.`
502
511
  );
503
512
  }
504
- return { ssg: ssgPages, ssr: ssrRoutes };
513
+ return {
514
+ ssg: ssgPages,
515
+ ssr: ssrRoutes,
516
+ ...options.staticCandidates ? { staticCandidates } : {}
517
+ };
518
+ }
519
+ async function listStaticCandidatePages(route, mod) {
520
+ if (!route.isDynamic) return [{ urlPath: route.path, filePath: route.filePath, params: {} }];
521
+ try {
522
+ const getStaticPaths = mod.getStaticPaths || mod.generateStaticParams;
523
+ const paths = getStaticPaths ? await getStaticPaths() : [];
524
+ const optionalCatchAllParams = _chunk66WIOZXXcjs.getOptionalCatchAllParameterNames.call(void 0, route.path);
525
+ return paths.map((params) => ({
526
+ urlPath: _chunk66WIOZXXcjs.materializeSSGRoutePath.call(void 0, route.path, params),
527
+ filePath: route.filePath,
528
+ params: _chunk66WIOZXXcjs.normalizeStaticPathParams.call(void 0, params, optionalCatchAllParams)
529
+ }));
530
+ } catch (error) {
531
+ console.warn(
532
+ `[Farm.js] experimental.staticPages: keeping "${route.path}" server-handled because listing its params failed: ${error instanceof Error ? error.message : String(error)}`
533
+ );
534
+ return [];
535
+ }
505
536
  }
506
537
  function isSSGModule(mod) {
507
538
  return resolveRouteRenderingConfig(mod).ssg;
@@ -783,7 +814,7 @@ function fieldTsType(field) {
783
814
  case "json":
784
815
  return "unknown";
785
816
  case "enum":
786
- return _optionalChain([field, 'access', _51 => _51.values, 'optionalAccess', _52 => _52.length]) ? field.values.map((value) => JSON.stringify(value)).join(" | ") : "string";
817
+ return _optionalChain([field, 'access', _55 => _55.values, 'optionalAccess', _56 => _56.length]) ? field.values.map((value) => JSON.stringify(value)).join(" | ") : "string";
787
818
  // id, uuid, string, text, datetime all travel as strings over JSON.
788
819
  default:
789
820
  return "string";
@@ -807,7 +838,7 @@ async function generateFarmTypeArtifacts(options) {
807
838
  const shouldGenerateApi = options.api !== false;
808
839
  const shouldGenerateEnv = options.env !== false;
809
840
  const shouldGenerateImages = options.images !== false;
810
- const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access', _53 => _53.i18nConfig, 'optionalAccess', _54 => _54.enabled]);
841
+ const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access', _57 => _57.i18nConfig, 'optionalAccess', _58 => _58.enabled]);
811
842
  const sourceRoots = _chunkPFVNPOKNcjs.getFarmSourceRoots.call(void 0, { root, srcDir, layers: options.layers });
812
843
  const appDirs = _chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, { root, srcDir, layers: options.layers });
813
844
  const result = {
@@ -827,7 +858,7 @@ async function generateFarmTypeArtifacts(options) {
827
858
  renderer: options.renderer,
828
859
  sourceRoots
829
860
  };
830
- unifiedSections.push(await _chunkWXPY5FRFcjs.createRouteTypeDeclarations.call(void 0, routeOptions, unifiedTypesPath));
861
+ unifiedSections.push(await _chunkP2PF5FUWcjs.createRouteTypeDeclarations.call(void 0, routeOptions, unifiedTypesPath));
831
862
  result.routeTypesPath = unifiedTypesPath;
832
863
  } else if (shouldGenerateRoutes) {
833
864
  const routeOptions = {
@@ -842,11 +873,11 @@ async function generateFarmTypeArtifacts(options) {
842
873
  };
843
874
  if (options.check) {
844
875
  const routeTypesPath = resolveGeneratedPath(root, srcDir, options.routeTypesOutFile);
845
- const content = await _chunkWXPY5FRFcjs.createRouteTypeDeclarations.call(void 0, routeOptions, routeTypesPath);
876
+ const content = await _chunkP2PF5FUWcjs.createRouteTypeDeclarations.call(void 0, routeOptions, routeTypesPath);
846
877
  checkGeneratedFile(routeTypesPath, content, result.stalePaths);
847
878
  result.routeTypesPath = routeTypesPath;
848
879
  } else {
849
- result.routeTypesPath = await _chunkWXPY5FRFcjs.generateRouteTypes.call(void 0, routeOptions);
880
+ result.routeTypesPath = await _chunkP2PF5FUWcjs.generateRouteTypes.call(void 0, routeOptions);
850
881
  }
851
882
  }
852
883
  if (shouldGenerateApi) {
@@ -854,7 +885,7 @@ async function generateFarmTypeArtifacts(options) {
854
885
  const apiRoutes = generator.scanAPIRoutes();
855
886
  const apiTypesPath = options.apiTypesOutFile ? _path.resolve.call(void 0, root, options.apiTypesOutFile) : _path.join.call(void 0, root, srcDir, "lib", "api.generated.ts");
856
887
  const pluginRoutes = _chunk4JCX33RZcjs.resolvePluginRoutes.call(void 0,
857
- _optionalChain([options, 'access', _55 => _55.plugins, 'optionalAccess', _56 => _56.filter, 'call', _57 => _57((plugin) => plugin.name !== _chunk323JTLXRcjs.FARM_NATIVE_SERVER_FN_PLUGIN)])
888
+ _optionalChain([options, 'access', _59 => _59.plugins, 'optionalAccess', _60 => _60.filter, 'call', _61 => _61((plugin) => plugin.name !== _chunk323JTLXRcjs.FARM_NATIVE_SERVER_FN_PLUGIN)])
858
889
  );
859
890
  const configFiles = [
860
891
  ...(_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.configFile).filter((file) => Boolean(file)),
@@ -931,7 +962,7 @@ async function generateFarmTypeArtifacts(options) {
931
962
  });
932
963
  }
933
964
  }
934
- if (shouldRefreshUnifiedTypes && _optionalChain([options, 'access', _58 => _58.i18nConfig, 'optionalAccess', _59 => _59.enabled]) && !options.i18nTypesOutFile) {
965
+ if (shouldRefreshUnifiedTypes && _optionalChain([options, 'access', _62 => _62.i18nConfig, 'optionalAccess', _63 => _63.enabled]) && !options.i18nTypesOutFile) {
935
966
  const { signatures } = await _chunkYHALJBYTcjs.readFarmI18nCatalogs.call(void 0, options.i18nConfig);
936
967
  unifiedSections.push(renderFarmI18nTypes(options.i18nConfig.locales, signatures));
937
968
  result.i18nTypesPath = unifiedTypesPath;