@farm.js/core 0.1.67 → 0.1.68

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 (281) hide show
  1. package/dist/{agent-mcp.d-BFu9xHAi.d.ts → agent-mcp.d-Uh5xr7aX.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-DWyWkTSy.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +5 -3
  4. package/dist/agent-runtime.d.ts +5 -3
  5. package/dist/{analyzer-TTIIXXMQ.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
  6. package/dist/analyzer-PPAHM4AW.cjs +16 -0
  7. package/dist/api/node.d.mts +7 -5
  8. package/dist/api/node.d.ts +7 -5
  9. package/dist/api/route-manager.d.mts +7 -5
  10. package/dist/api/route-manager.d.ts +7 -5
  11. package/dist/api/runtime.d.mts +6 -4
  12. package/dist/api/runtime.d.ts +6 -4
  13. package/dist/api.d.mts +8 -6
  14. package/dist/api.d.ts +8 -6
  15. package/dist/{app-manifest.d-CwfhGrVR.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
  16. package/dist/{app-manifest.d-CRmjN5j9.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
  17. package/dist/app-markdown.cjs +3 -3
  18. package/dist/app-markdown.d.mts +10 -10
  19. package/dist/app-markdown.d.ts +10 -10
  20. package/dist/app-markdown.mjs +2 -2
  21. package/dist/{app.d-BX9LVTiP.d.ts → app.d-BVOpL_f2.d.ts} +6 -6
  22. package/dist/{app.d-uBBUxwyV.d.mts → app.d-BhiDXex_.d.mts} +6 -6
  23. package/dist/{chunk-23PVOIPT.cjs → chunk-225APHKC.cjs} +3 -3
  24. package/dist/{chunk-4JX3M4C6.cjs → chunk-23VJEGKC.cjs} +2 -1
  25. package/dist/{chunk-Q37INCXG.cjs → chunk-3EEINK7G.cjs} +11 -2
  26. package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
  27. package/dist/{chunk-QJVW76JG.mjs → chunk-3Y52TWYU.mjs} +2 -2
  28. package/dist/{chunk-OB3IFUK6.cjs → chunk-437QZIC2.cjs} +4 -4
  29. package/dist/{chunk-WGHY3OL5.mjs → chunk-4UAQB5LB.mjs} +232 -49
  30. package/dist/{chunk-JWSI5WO4.mjs → chunk-4ZXKYCYK.mjs} +1 -1
  31. package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
  32. package/dist/{chunk-AQDLVHNF.mjs → chunk-5FBZJJGA.mjs} +17 -0
  33. package/dist/{chunk-PL6RTBDE.cjs → chunk-5JKDFRTK.cjs} +2 -2
  34. package/dist/{chunk-CO3YMZFD.mjs → chunk-6OFOIMNS.mjs} +1 -1
  35. package/dist/{chunk-556H7JCE.cjs → chunk-7LK5CTUM.cjs} +14 -14
  36. package/dist/{chunk-E6CD45JK.mjs → chunk-A3T445WK.mjs} +19 -5
  37. package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
  38. package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
  39. package/dist/{chunk-IRA2CZAY.mjs → chunk-CRVSYDHV.mjs} +2 -2
  40. package/dist/{chunk-XNZWMXCF.mjs → chunk-DIXFKAPM.mjs} +183 -76
  41. package/dist/{chunk-QGQP6QKO.cjs → chunk-DWLNLU55.cjs} +2 -2
  42. package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
  43. package/dist/{chunk-N5DQMOAG.cjs → chunk-F36LS2C7.cjs} +273 -90
  44. package/dist/{chunk-H37MDCPR.mjs → chunk-F6CMGWAL.mjs} +1 -1
  45. package/dist/{chunk-HNVAZGQD.cjs → chunk-FJMC24KG.cjs} +2 -2
  46. package/dist/{chunk-KCY52OUQ.cjs → chunk-FSODPZRT.cjs} +1 -1
  47. package/dist/{chunk-PPX7UOFY.cjs → chunk-FVYBEMOD.cjs} +55 -38
  48. package/dist/{chunk-6YBYX4K4.mjs → chunk-G7NBPP7H.mjs} +1 -1
  49. package/dist/{chunk-HFHJJXSV.mjs → chunk-GFPS7MNE.mjs} +1 -1
  50. package/dist/{chunk-3T5TLFCQ.mjs → chunk-HEJM46HQ.mjs} +11 -2
  51. package/dist/chunk-HHLEYA4B.cjs +17 -0
  52. package/dist/{chunk-F43OG25P.cjs → chunk-I7J5RLGO.cjs} +15 -1
  53. package/dist/chunk-ICFPTHXM.mjs +97 -0
  54. package/dist/{chunk-6V5YWI4W.cjs → chunk-IGDYL2IA.cjs} +2 -2
  55. package/dist/{chunk-TEG6HJVF.mjs → chunk-JL2YW5KX.mjs} +1 -0
  56. package/dist/{chunk-JVM3DKZE.mjs → chunk-KDO6T6OB.mjs} +1 -1
  57. package/dist/{chunk-QITSS4TD.cjs → chunk-KWCZKJYU.cjs} +352 -245
  58. package/dist/{chunk-DCXSIEFE.cjs → chunk-LDEXTX4I.cjs} +51 -37
  59. package/dist/{chunk-3T7ALZJF.cjs → chunk-LR4KP3I7.cjs} +2 -2
  60. package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
  61. package/dist/{chunk-5TA63JD3.mjs → chunk-MGZVDX4R.mjs} +1 -1
  62. package/dist/{chunk-6SQZXRJ2.cjs → chunk-MMDKYJ5V.cjs} +7 -7
  63. package/dist/{chunk-HP2DQGQH.mjs → chunk-MNJDNTGO.mjs} +1 -1
  64. package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
  65. package/dist/{chunk-XUES6OET.mjs → chunk-MV7NWU23.mjs} +1 -1
  66. package/dist/{chunk-4DRINDGN.cjs → chunk-MZ4CRSY7.cjs} +254 -125
  67. package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
  68. package/dist/{chunk-WDD5CTZW.mjs → chunk-NT4W4H52.mjs} +6 -6
  69. package/dist/{chunk-F7JKVHU2.mjs → chunk-NVOMQLI2.mjs} +15 -1
  70. package/dist/{chunk-22IWL4YD.cjs → chunk-OCNV4CI2.cjs} +21 -2
  71. package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
  72. package/dist/{chunk-YVTS3S3F.cjs → chunk-QOGIZKSO.cjs} +3 -3
  73. package/dist/{chunk-DB2HSHQA.cjs → chunk-QSUYB3RH.cjs} +14 -14
  74. package/dist/chunk-QYNZ3CTI.mjs +17 -0
  75. package/dist/{chunk-724MGMIL.mjs → chunk-R2ZHU37O.mjs} +19 -0
  76. package/dist/{chunk-YQYTQJZN.mjs → chunk-RLH5AH2M.mjs} +1 -1
  77. package/dist/{chunk-HM7AGSKU.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
  78. package/dist/{chunk-V5MQMQ2P.mjs → chunk-T5XFZQCL.mjs} +1 -1
  79. package/dist/{chunk-Q5UX55YA.cjs → chunk-TNK2TVRS.cjs} +831 -470
  80. package/dist/{chunk-J7JHVCWA.cjs → chunk-UKZ6AWKZ.cjs} +2 -1
  81. package/dist/{chunk-V5RTHYJB.cjs → chunk-URN7VFO7.cjs} +91 -22
  82. package/dist/{chunk-HRPTMX5C.mjs → chunk-VFNAK6A5.mjs} +2 -2
  83. package/dist/{chunk-VK54PDQ6.mjs → chunk-VRGY3X2I.mjs} +86 -17
  84. package/dist/chunk-W44X6IC2.cjs +97 -0
  85. package/dist/{chunk-GTV2ABO7.mjs → chunk-WPB67LE5.mjs} +162 -33
  86. package/dist/{chunk-UHE5JUKB.mjs → chunk-XCAQTCGK.mjs} +1 -1
  87. package/dist/{chunk-DGOFR7D5.cjs → chunk-Y6KHPJDB.cjs} +2 -2
  88. package/dist/{chunk-LPIZMU7D.cjs → chunk-YTNBCXCW.cjs} +4 -4
  89. package/dist/{chunk-KWFNUODD.mjs → chunk-YVPX5PI5.mjs} +1 -0
  90. package/dist/{chunk-6R53ZWX2.cjs → chunk-Z3PW3DIR.cjs} +3 -3
  91. package/dist/{chunk-UHNSY2PQ.mjs → chunk-Z6SOXHAD.mjs} +772 -411
  92. package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
  93. package/dist/{client-component.d-CDRvRmbU.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
  94. package/dist/{client-component.d-DWRKyAp5.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
  95. package/dist/{client-plugins.d-BNILjfX3.d.mts → client-plugins.d-CE1lVK2R.d.mts} +23 -234
  96. package/dist/{client-plugins.d-CrKZiNSN.d.ts → client-plugins.d-CNDqcAuf.d.ts} +23 -234
  97. package/dist/client-plugins.d.mts +5 -3
  98. package/dist/client-plugins.d.ts +5 -3
  99. package/dist/client.cjs +6 -6
  100. package/dist/client.d.mts +10 -8
  101. package/dist/client.d.ts +10 -8
  102. package/dist/client.mjs +5 -5
  103. package/dist/config.d.mts +5 -3
  104. package/dist/config.d.ts +5 -3
  105. package/dist/deployment.cjs +4 -2
  106. package/dist/deployment.d.mts +15 -1
  107. package/dist/deployment.d.ts +15 -1
  108. package/dist/deployment.mjs +3 -1
  109. package/dist/desktop.d.mts +6 -4
  110. package/dist/desktop.d.ts +6 -4
  111. package/dist/{devtools-UFQYT3VA.mjs → devtools-2A2GPC7B.mjs} +6 -6
  112. package/dist/{devtools-RZVT4JVN.cjs → devtools-R27T3BRY.cjs} +7 -7
  113. package/dist/docs.cjs +9 -9
  114. package/dist/docs.d.mts +6 -4
  115. package/dist/docs.d.ts +6 -4
  116. package/dist/docs.mjs +8 -8
  117. package/dist/environment/vite.cjs +5 -5
  118. package/dist/environment/vite.d.mts +1 -1
  119. package/dist/environment/vite.d.ts +1 -1
  120. package/dist/environment/vite.mjs +4 -4
  121. package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
  122. package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
  123. package/dist/index.cjs +41 -36
  124. package/dist/{index.d-Bdm6866n.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
  125. package/dist/{index.d-Dey5T14f.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
  126. package/dist/index.d.mts +25 -22
  127. package/dist/index.d.ts +25 -22
  128. package/dist/index.mjs +43 -38
  129. package/dist/instrumentation.cjs +3 -3
  130. package/dist/instrumentation.mjs +2 -2
  131. package/dist/integrations/orm.d.mts +5 -3
  132. package/dist/integrations/orm.d.ts +5 -3
  133. package/dist/integrations.d.mts +5 -3
  134. package/dist/integrations.d.ts +5 -3
  135. package/dist/internal/app-markdown-runtime.cjs +2 -2
  136. package/dist/internal/app-markdown-runtime.d.mts +12 -5
  137. package/dist/internal/app-markdown-runtime.d.ts +12 -5
  138. package/dist/internal/app-markdown-runtime.mjs +1 -1
  139. package/dist/internal/build-runtime.cjs +33 -30
  140. package/dist/internal/build-runtime.d.mts +7 -5
  141. package/dist/internal/build-runtime.d.ts +7 -5
  142. package/dist/internal/build-runtime.mjs +32 -29
  143. package/dist/internal/cli-runtime.cjs +10 -10
  144. package/dist/internal/cli-runtime.mjs +9 -9
  145. package/dist/internal/client-error-overlay.cjs +4 -4
  146. package/dist/internal/client-error-overlay.mjs +1 -1
  147. package/dist/internal/client-runtime.cjs +31 -36
  148. package/dist/internal/client-runtime.d.mts +8 -6
  149. package/dist/internal/client-runtime.d.ts +8 -6
  150. package/dist/internal/client-runtime.mjs +22 -27
  151. package/dist/internal/compression-runtime.d.mts +5 -3
  152. package/dist/internal/compression-runtime.d.ts +5 -3
  153. package/dist/internal/config-runtime.cjs +8 -8
  154. package/dist/internal/config-runtime.d.mts +9 -7
  155. package/dist/internal/config-runtime.d.ts +9 -7
  156. package/dist/internal/config-runtime.mjs +7 -7
  157. package/dist/internal/form-actions.cjs +7 -2
  158. package/dist/internal/form-actions.d.mts +10 -3
  159. package/dist/internal/form-actions.d.ts +10 -3
  160. package/dist/internal/form-actions.mjs +8 -3
  161. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  162. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  163. package/dist/internal/islands-boot.cjs +6 -1
  164. package/dist/internal/islands-boot.mjs +6 -1
  165. package/dist/internal/native-server-fns.cjs +4 -4
  166. package/dist/internal/native-server-fns.mjs +3 -3
  167. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  168. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  169. package/dist/internal/production-node-env.cjs +4 -2
  170. package/dist/internal/production-node-env.d.mts +22 -1
  171. package/dist/internal/production-node-env.d.ts +22 -1
  172. package/dist/internal/production-node-env.mjs +3 -1
  173. package/dist/internal/production-runtime.cjs +13 -9
  174. package/dist/internal/production-runtime.d.mts +21 -16
  175. package/dist/internal/production-runtime.d.ts +21 -16
  176. package/dist/internal/production-runtime.mjs +13 -9
  177. package/dist/internal/server-tree.cjs +2 -2
  178. package/dist/internal/server-tree.d.mts +0 -5
  179. package/dist/internal/server-tree.d.ts +0 -5
  180. package/dist/internal/server-tree.mjs +1 -1
  181. package/dist/internal/vercel-edge-middleware.cjs +87 -0
  182. package/dist/internal/vercel-edge-middleware.d.mts +39 -0
  183. package/dist/internal/vercel-edge-middleware.d.ts +39 -0
  184. package/dist/internal/vercel-edge-middleware.mjs +87 -0
  185. package/dist/layers-7P4RLKVX.cjs +20 -0
  186. package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
  187. package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
  188. package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
  189. package/dist/markdown.d.mts +5 -3
  190. package/dist/markdown.d.ts +5 -3
  191. package/dist/middleware.cjs +4 -4
  192. package/dist/middleware.d.mts +8 -5
  193. package/dist/middleware.d.ts +8 -5
  194. package/dist/middleware.mjs +6 -6
  195. package/dist/mobile.d.mts +4 -4
  196. package/dist/mobile.d.ts +4 -4
  197. package/dist/{mount.d-BP0nLYQO.d.mts → mount.d-Bki4pOaJ.d.mts} +1 -1
  198. package/dist/{mount.d-CkiPky_F.d.ts → mount.d-DjR5aerM.d.ts} +1 -1
  199. package/dist/{navigation-delegate.d-DchcGzAQ.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
  200. package/dist/{navigation-delegate.d-CdBP-hkZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
  201. package/dist/navigation.cjs +5 -5
  202. package/dist/navigation.d.mts +8 -6
  203. package/dist/navigation.d.ts +8 -6
  204. package/dist/navigation.mjs +4 -4
  205. package/dist/{nitro-55YOZWRA.mjs → nitro-NSTXT7LB.mjs} +2 -2
  206. package/dist/{nitro-EEX2J3KB.cjs → nitro-Y3LGITW3.cjs} +4 -4
  207. package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
  208. package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
  209. package/dist/plugin.cjs +20 -20
  210. package/dist/plugin.d.mts +7 -5
  211. package/dist/plugin.d.ts +7 -5
  212. package/dist/plugin.mjs +19 -19
  213. package/dist/{production-runtime.d-Dou_Htas.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
  214. package/dist/{production-runtime.d-VwsBzIee.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
  215. package/dist/query/client.cjs +6 -6
  216. package/dist/query/client.mjs +2 -2
  217. package/dist/{render-plan.d-LKymStDJ.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
  218. package/dist/{render-plan.d-D8UakAIk.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
  219. package/dist/renderer/react/server.cjs +2 -2
  220. package/dist/renderer/react/server.mjs +1 -1
  221. package/dist/renderer-client.cjs +5 -5
  222. package/dist/renderer-client.d.mts +8 -6
  223. package/dist/renderer-client.d.ts +8 -6
  224. package/dist/renderer-client.mjs +2 -2
  225. package/dist/renderer.d.mts +5 -0
  226. package/dist/renderer.d.ts +5 -0
  227. package/dist/{request.d-KG-4d2eG.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
  228. package/dist/{request.d-B928QjWy.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
  229. package/dist/request.d.mts +6 -4
  230. package/dist/request.d.ts +6 -4
  231. package/dist/{route-rendering.d-DoEe_w9t.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
  232. package/dist/{route-rendering.d-NIHQeb4m.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
  233. package/dist/{router.d-DYnRHQwz.d.ts → router.d-B56rMOFm.d.ts} +1 -1
  234. package/dist/{router.d-B8PkJSGp.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
  235. package/dist/{routes.d-uUBZyWoK.d.ts → routes.d-9GFFNioh.d.ts} +1 -1
  236. package/dist/{routes.d-DgZ_jgGG.d.mts → routes.d-CrEy0lJS.d.mts} +1 -1
  237. package/dist/routes.d.mts +5 -3
  238. package/dist/routes.d.ts +5 -3
  239. package/dist/{rsc-pipeline-7K5H2RPH.cjs → rsc-pipeline-3T7V6OUT.cjs} +10 -9
  240. package/dist/{rsc-pipeline-4OJ5ZQNZ.mjs → rsc-pipeline-GA4AQWZI.mjs} +9 -8
  241. package/dist/{runtime-X52Q7JFR.cjs → runtime-REUTNTI5.cjs} +20 -20
  242. package/dist/{runtime-U7O3HZOZ.mjs → runtime-ZYCKKY7L.mjs} +12 -12
  243. package/dist/{runtime.d-BxQIzwfy.d.mts → runtime.d-DLRO-ExG.d.mts} +1 -1
  244. package/dist/{runtime.d-DP7mEkEF.d.ts → runtime.d-H7k9hOQE.d.ts} +1 -1
  245. package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
  246. package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
  247. package/dist/server-plugins.d.mts +6 -4
  248. package/dist/server-plugins.d.ts +6 -4
  249. package/dist/server.cjs +46 -44
  250. package/dist/server.d-C5FFrZAo.d.ts +57 -0
  251. package/dist/server.d-DgC8xew5.d.mts +57 -0
  252. package/dist/server.d.mts +13 -11
  253. package/dist/server.d.ts +13 -11
  254. package/dist/server.mjs +28 -26
  255. package/dist/{spa-router.d-DsFDHTsv.d.ts → spa-router.d-Dr7oanhl.d.ts} +2 -2
  256. package/dist/{spa-router.d-BgHPVMhz.d.mts → spa-router.d-g4CzhEH1.d.mts} +2 -2
  257. package/dist/testing.d.mts +5 -3
  258. package/dist/testing.d.ts +5 -3
  259. package/dist/types.d-xCIhyjOq.d.mts +233 -0
  260. package/dist/types.d-xCIhyjOq.d.ts +233 -0
  261. package/dist/{utils.d-zxAVcf_V.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
  262. package/dist/{utils.d-BKyKDBR1.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
  263. package/dist/version.cjs +2 -2
  264. package/dist/version.mjs +1 -1
  265. package/dist/vite.cjs +20 -20
  266. package/dist/vite.d.mts +10 -8
  267. package/dist/vite.d.ts +10 -8
  268. package/dist/vite.mjs +19 -19
  269. package/dist/workflows.cjs +2 -2
  270. package/dist/workflows.d.mts +121 -1
  271. package/dist/workflows.d.ts +121 -1
  272. package/dist/workflows.mjs +1 -1
  273. package/package.json +7 -2
  274. package/dist/analyzer-KVZGVY5Q.cjs +0 -16
  275. package/dist/chunk-CLFEQGET.cjs +0 -60
  276. package/dist/chunk-MK5E44WP.mjs +0 -60
  277. package/dist/layers-DMRXRL7F.cjs +0 -18
  278. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  279. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  280. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  281. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
@@ -443,6 +443,33 @@ async function withProductionNodeEnv(operation) {
443
443
  }
444
444
  }
445
445
  }
446
+ var REACT_RUNTIME_DIRECTORIES = [
447
+ "/node_modules/react/",
448
+ "/node_modules/react-dom/",
449
+ "/node_modules/react-server-dom-webpack/",
450
+ "/node_modules/@vitejs/plugin-rsc/dist/vendor/react-server-dom/"
451
+ ];
452
+ function createReactProductionModePlugin() {
453
+ const nodeEnvExpression = ["process", "env", "NODE_ENV"].join(".");
454
+ return {
455
+ name: "farm-react-production-mode",
456
+ transform: {
457
+ filter: {
458
+ id: /\/node_modules\/(?:react(?:-dom|-server-dom-webpack)?|@vitejs\/plugin-rsc\/dist\/vendor\/react-server-dom)\//,
459
+ code: new RegExp(nodeEnvExpression.replace(/\./g, "\\."))
460
+ },
461
+ handler(code, id) {
462
+ const normalizedId = id.replace(/\\/g, "/");
463
+ const isReactRuntime = REACT_RUNTIME_DIRECTORIES.some(
464
+ (directory) => normalizedId.includes(directory)
465
+ );
466
+ if (!isReactRuntime || !code.includes(nodeEnvExpression)) return null;
467
+ return { code: code.split(nodeEnvExpression).join('"production"'), map: null };
468
+ }
469
+ }
470
+ };
471
+ }
472
+
446
473
 
447
474
 
448
475
 
@@ -455,4 +482,4 @@ async function withProductionNodeEnv(operation) {
455
482
 
456
483
 
457
484
 
458
- exports.FARM_NODE_ENV_MODULE_FILE = FARM_NODE_ENV_MODULE_FILE; exports.FARM_NODE_ENV_MODULE_SOURCE = FARM_NODE_ENV_MODULE_SOURCE; exports.FARM_DESKTOP_ENV_MODULE_FILE = FARM_DESKTOP_ENV_MODULE_FILE; exports.FARM_DESKTOP_ENV_MODULE_SOURCE = FARM_DESKTOP_ENV_MODULE_SOURCE; exports.FARM_SERVER_MODULE_FILE = FARM_SERVER_MODULE_FILE; exports.FARM_COMPILE_CACHE_DIR = FARM_COMPILE_CACHE_DIR; exports.createFarmCompileCacheLauncher = createFarmCompileCacheLauncher; exports.createFarmNodeServerEntry = createFarmNodeServerEntry; exports.createFarmBunServerEntry = createFarmBunServerEntry; exports.withProductionNodeEnv = withProductionNodeEnv;
485
+ exports.FARM_NODE_ENV_MODULE_FILE = FARM_NODE_ENV_MODULE_FILE; exports.FARM_NODE_ENV_MODULE_SOURCE = FARM_NODE_ENV_MODULE_SOURCE; exports.FARM_DESKTOP_ENV_MODULE_FILE = FARM_DESKTOP_ENV_MODULE_FILE; exports.FARM_DESKTOP_ENV_MODULE_SOURCE = FARM_DESKTOP_ENV_MODULE_SOURCE; exports.FARM_SERVER_MODULE_FILE = FARM_SERVER_MODULE_FILE; exports.FARM_COMPILE_CACHE_DIR = FARM_COMPILE_CACHE_DIR; exports.createFarmCompileCacheLauncher = createFarmCompileCacheLauncher; exports.createFarmNodeServerEntry = createFarmNodeServerEntry; exports.createFarmBunServerEntry = createFarmBunServerEntry; exports.withProductionNodeEnv = withProductionNodeEnv; exports.createReactProductionModePlugin = createReactProductionModePlugin;
@@ -7,7 +7,7 @@ import {
7
7
  normalizeRouteRules,
8
8
  routeRulesToHeaders,
9
9
  routeRulesToRedirects
10
- } from "./chunk-724MGMIL.mjs";
10
+ } from "./chunk-R2ZHU37O.mjs";
11
11
  import {
12
12
  assertPluginDependencies
13
13
  } from "./chunk-XR2ZIBQK.mjs";
@@ -38,7 +38,7 @@ import {
38
38
  import {
39
39
  loadFarmConfigFile,
40
40
  resolveFarmLayers
41
- } from "./chunk-52Y3C3HG.mjs";
41
+ } from "./chunk-E7VF3LQ5.mjs";
42
42
  import {
43
43
  isFarmRendererDisabled,
44
44
  isReactRenderer,
@@ -67,10 +67,10 @@ import {
67
67
  } from "./chunk-IFR74W6S.mjs";
68
68
  import {
69
69
  bundleNodeModule
70
- } from "./chunk-VFXE6NWR.mjs";
70
+ } from "./chunk-MGKWYPE3.mjs";
71
71
  import {
72
72
  resolveWorkflowsConfig
73
- } from "./chunk-5TA63JD3.mjs";
73
+ } from "./chunk-MGZVDX4R.mjs";
74
74
  import {
75
75
  resolveFarmThemeConfig
76
76
  } from "./chunk-YWPNIYUP.mjs";
@@ -94,7 +94,7 @@ import {
94
94
  } from "./chunk-W6QLRQ3V.mjs";
95
95
  import {
96
96
  normalizeFarmDeploymentId
97
- } from "./chunk-F7JKVHU2.mjs";
97
+ } from "./chunk-NVOMQLI2.mjs";
98
98
  import {
99
99
  validateConfigRouteSource
100
100
  } from "./chunk-JZGL2PIH.mjs";
@@ -1223,7 +1223,7 @@ async function resolveConfig(userConfig, mode) {
1223
1223
  };
1224
1224
  assertPluginDependencies(resolved.plugins, resolved.integrations);
1225
1225
  if (nativeServerFnPlugin) {
1226
- nativeServerFnAppDirs = (await import("./layers-T55SA47E.mjs")).getFarmAppDirectories(resolved);
1226
+ nativeServerFnAppDirs = (await import("./layers-XQ7VFMWO.mjs")).getFarmAppDirectories(resolved);
1227
1227
  }
1228
1228
  return resolved;
1229
1229
  }
@@ -132,6 +132,19 @@ function readCookie(cookieHeader, name) {
132
132
  function isSafeRequestMethod(method) {
133
133
  return ["GET", "HEAD", "OPTIONS", "QUERY"].includes(method.toUpperCase());
134
134
  }
135
+ var CLOUDFLARE_POPULATE_PROCESS_ENV_FLAG = "nodejs_compat_populate_process_env";
136
+ var CLOUDFLARE_DO_NOT_POPULATE_PROCESS_ENV_FLAG = "nodejs_compat_do_not_populate_process_env";
137
+ var CLOUDFLARE_POPULATE_PROCESS_ENV_DATE = "2025-04-01";
138
+ function resolveCloudflareProcessEnvFlags(wrangler) {
139
+ const date = wrangler.compatibility_date;
140
+ const flags = wrangler.compatibility_flags;
141
+ if (typeof date !== "string" || date >= CLOUDFLARE_POPULATE_PROCESS_ENV_DATE) return void 0;
142
+ if (!Array.isArray(flags) || !flags.includes("nodejs_compat")) return void 0;
143
+ if (flags.includes(CLOUDFLARE_POPULATE_PROCESS_ENV_FLAG) || flags.includes(CLOUDFLARE_DO_NOT_POPULATE_PROCESS_ENV_FLAG)) {
144
+ return void 0;
145
+ }
146
+ return [...flags, CLOUDFLARE_POPULATE_PROCESS_ENV_FLAG];
147
+ }
135
148
 
136
149
  export {
137
150
  FARM_DEPLOYMENT_ID_HEADER,
@@ -150,5 +163,6 @@ export {
150
163
  getFarmResponseDeploymentId,
151
164
  isFarmDeploymentMismatchResponse,
152
165
  createFarmDeploymentMismatchError,
153
- createFarmDeploymentCookie
166
+ createFarmDeploymentCookie,
167
+ resolveCloudflareProcessEnvFlags
154
168
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
4
  var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
@@ -10,6 +10,10 @@ var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
10
10
 
11
11
  var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
12
12
 
13
+
14
+
15
+ var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
16
+
13
17
  // src/route-rules.ts
14
18
  function normalizeRouteRules(routeRules) {
15
19
  if (!routeRules) return {};
@@ -102,6 +106,20 @@ function routeRulesToNitroRouteRules(routeRules) {
102
106
  }
103
107
  return nitroRules;
104
108
  }
109
+ function nitroRouteRulesBelowBasePath(nitroRules, basePath, apiServerBasePath) {
110
+ const prefix = _chunkD22BUQKWcjs.normalizeFarmBasePath.call(void 0, basePath);
111
+ if (!prefix) return nitroRules;
112
+ const isAPISource = (source) => source === apiServerBasePath || source.startsWith(`${apiServerBasePath}/`);
113
+ const rules = { ...nitroRules };
114
+ for (const [source, rule] of Object.entries(nitroRules)) {
115
+ if (isAPISource(source)) continue;
116
+ const publicSource = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, source, prefix);
117
+ if (publicSource in nitroRules) continue;
118
+ const to = _optionalChain([rule, 'access', _ => _.redirect, 'optionalAccess', _2 => _2.to]);
119
+ rules[publicSource] = typeof to === "string" && to.startsWith("/") && !to.startsWith("//") ? { ...rule, redirect: { ...rule.redirect, to: _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, to, prefix) } } : rule;
120
+ }
121
+ return rules;
122
+ }
105
123
  function resolveRouteRuleCorsPreflightHeaders(routeRules, pathname) {
106
124
  if (!routeRules) return void 0;
107
125
  let cors;
@@ -152,4 +170,5 @@ function hasExplicitQuery(destination) {
152
170
 
153
171
 
154
172
 
155
- exports.normalizeRouteRules = normalizeRouteRules; exports.routeRulesToRedirects = routeRulesToRedirects; exports.routeRulesToHeaders = routeRulesToHeaders; exports.routeRulesToNitroRouteRules = routeRulesToNitroRouteRules; exports.resolveRouteRuleCorsPreflightHeaders = resolveRouteRuleCorsPreflightHeaders;
173
+
174
+ exports.normalizeRouteRules = normalizeRouteRules; exports.routeRulesToRedirects = routeRulesToRedirects; exports.routeRulesToHeaders = routeRulesToHeaders; exports.routeRulesToNitroRouteRules = routeRulesToNitroRouteRules; exports.nitroRouteRulesBelowBasePath = nitroRouteRulesBelowBasePath; exports.resolveRouteRuleCorsPreflightHeaders = resolveRouteRuleCorsPreflightHeaders;
@@ -14,6 +14,7 @@ var _chunkCQL5ZGFUcjs = require('./chunk-CQL5ZGFU.cjs');
14
14
  var MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
15
15
  var FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
16
16
  var SERVER_HTML_TAG = "f-html";
17
+ var SERVER_HTML_TEMPLATE_TAG = "template";
17
18
  var FARM_SERVER_TREE_SCRIPT_TYPE = "f/tree";
18
19
  var FARM_NOT_A_MARKER = /* @__PURE__ */ Symbol.for("farm.codec.not-a-marker");
19
20
  var SERVER_TREE_CHUNK_SCRIPT_TYPE = "f/chunk";
@@ -312,52 +313,79 @@ function fulfilledThenable(value) {
312
313
  promise.value = value;
313
314
  return promise;
314
315
  }
315
- function createTreeChildren(ReactRuntime, children, resolver) {
316
+ function createTreeChildren(ReactRuntime, children, resolver, inClient) {
316
317
  if (children === void 0) return [];
317
- const node = createTreeValue(ReactRuntime, children, resolver);
318
+ const node = createTreeValue(ReactRuntime, children, resolver, inClient);
318
319
  return Array.isArray(children) ? node : [node];
319
320
  }
320
- function createTreeProps(ReactRuntime, props, resolver, key) {
321
+ function createTreeProps(ReactRuntime, props, resolver, key, inClient) {
321
322
  const { children, ...rest } = props;
322
323
  const created = {};
323
324
  for (const [name, value] of Object.entries(rest)) {
324
- created[name] = createTreeValue(ReactRuntime, value, resolver);
325
+ created[name] = createTreeValue(ReactRuntime, value, resolver, inClient);
325
326
  }
326
327
  if (typeof key === "string") created.key = key;
327
- return { props: created, children: createTreeChildren(ReactRuntime, children, resolver) };
328
+ return {
329
+ props: created,
330
+ children: createTreeChildren(ReactRuntime, children, resolver, inClient)
331
+ };
332
+ }
333
+ function collectServerHtml(value, ids) {
334
+ if (value === null || typeof value !== "object") return ids;
335
+ if (Array.isArray(value)) {
336
+ for (const entry of value) collectServerHtml(entry, ids);
337
+ return ids;
338
+ }
339
+ if (value.$ === "x") {
340
+ ids.push(value.i);
341
+ return ids;
342
+ }
343
+ const object = value.$ === "o" ? value.v : value;
344
+ for (const entry of Object.values(object)) collectServerHtml(entry, ids);
345
+ return ids;
328
346
  }
329
- function createTreeValue(ReactRuntime, value, resolver) {
347
+ function createTreeValue(ReactRuntime, value, resolver, inClient = false) {
330
348
  if (value === null || typeof value !== "object") return value;
331
349
  if (Array.isArray(value))
332
- return value.map((entry) => createTreeValue(ReactRuntime, entry, resolver));
350
+ return value.map((entry) => createTreeValue(ReactRuntime, entry, resolver, inClient));
333
351
  switch (value.$) {
334
352
  case "h": {
335
353
  const { props, children } = createTreeProps(
336
354
  ReactRuntime,
337
355
  value.p,
338
356
  resolver,
339
- value.k
357
+ value.k,
358
+ inClient
340
359
  );
341
360
  return ReactRuntime.createElement(value.t, props, ...children);
342
361
  }
343
362
  case "c": {
363
+ const ids = inClient ? [] : collectServerHtml(value.p, []);
344
364
  const { props, children } = createTreeProps(
345
365
  ReactRuntime,
346
366
  value.p,
347
367
  resolver,
348
- value.k
368
+ ids.length > 0 ? void 0 : value.k,
369
+ true
349
370
  );
350
- return ReactRuntime.createElement(
371
+ const element = ReactRuntime.createElement(
351
372
  resolver.component(value.r, value.e),
352
373
  props,
353
374
  ...children
354
375
  );
376
+ if (ids.length === 0) return element;
377
+ return ReactRuntime.createElement(
378
+ ReactRuntime.Fragment,
379
+ typeof value.k === "string" ? { key: value.k } : null,
380
+ element,
381
+ resolver.unrendered(ids)
382
+ );
355
383
  }
356
384
  case "f":
357
385
  return ReactRuntime.createElement(
358
386
  ReactRuntime.Fragment,
359
387
  typeof value.k === "string" ? { key: value.k } : null,
360
- ...createTreeChildren(ReactRuntime, value.c, resolver)
388
+ ...createTreeChildren(ReactRuntime, value.c, resolver, inClient)
361
389
  );
362
390
  case "p":
363
391
  return ReactRuntime.createElement(
@@ -367,7 +395,8 @@ function createTreeValue(ReactRuntime, value, resolver) {
367
395
  fallback: createTreeValue(
368
396
  ReactRuntime,
369
397
  value.f,
370
- resolver
398
+ resolver,
399
+ inClient
371
400
  )
372
401
  },
373
402
  ReactRuntime.createElement(getChunkComponent(ReactRuntime), {
@@ -381,13 +410,15 @@ function createTreeValue(ReactRuntime, value, resolver) {
381
410
  case "a":
382
411
  return resolver.action(value.v);
383
412
  case "P":
384
- return fulfilledThenable(createTreeValue(ReactRuntime, value.v, resolver));
413
+ return fulfilledThenable(
414
+ createTreeValue(ReactRuntime, value.v, resolver, inClient)
415
+ );
385
416
  case "o": {
386
417
  const object = value.v;
387
418
  return Object.fromEntries(
388
419
  Object.entries(object).map(([name, entry]) => [
389
420
  name,
390
- createTreeValue(ReactRuntime, entry, resolver)
421
+ createTreeValue(ReactRuntime, entry, resolver, inClient)
391
422
  ])
392
423
  );
393
424
  }
@@ -396,14 +427,14 @@ function createTreeValue(ReactRuntime, value, resolver) {
396
427
  if (!resolver.decode) throw new Error("typed props need islands mode");
397
428
  const decoded = resolver.decode(
398
429
  value,
399
- (child) => createTreeValue(ReactRuntime, child, resolver)
430
+ (child) => createTreeValue(ReactRuntime, child, resolver, inClient)
400
431
  );
401
432
  if (decoded !== FARM_NOT_A_MARKER) return decoded;
402
433
  }
403
434
  return Object.fromEntries(
404
435
  Object.entries(value).map(([name, entry]) => [
405
436
  name,
406
- createTreeValue(ReactRuntime, entry, resolver)
437
+ createTreeValue(ReactRuntime, entry, resolver, inClient)
407
438
  ])
408
439
  );
409
440
  }
@@ -493,6 +524,49 @@ async function createPayloadOnlyPage(state, payload, encode, resolver) {
493
524
  })
494
525
  );
495
526
  }
527
+ function RenderedServerHtml({
528
+ id,
529
+ rendered,
530
+ children
531
+ }) {
532
+ rendered.add(id);
533
+ return children;
534
+ }
535
+ function UnrenderedServerHtml({
536
+ ReactRuntime,
537
+ ids,
538
+ rendered,
539
+ part
540
+ }) {
541
+ const unrendered = ids.filter((id) => !rendered.has(id));
542
+ if (unrendered.length === 0) return null;
543
+ return ReactRuntime.createElement(
544
+ SERVER_HTML_TEMPLATE_TAG,
545
+ { [SERVER_HTML_ATTRIBUTE]: String(unrendered[0]) },
546
+ unrendered.map((id) => part(id, `h${id}`))
547
+ );
548
+ }
549
+ function createServerHtmlParts(state, isolate) {
550
+ const ReactRuntime = state.ReactRuntime;
551
+ const rendered = /* @__PURE__ */ new Set();
552
+ const part = (id, key) => ReactRuntime.createElement(
553
+ SERVER_HTML_TAG,
554
+ {
555
+ ...key === null ? {} : { key },
556
+ [SERVER_HTML_ATTRIBUTE]: String(id),
557
+ style: { display: "contents" }
558
+ },
559
+ isolate(state.serverHtml.get(id))
560
+ );
561
+ return {
562
+ serverHtml: (id, key) => ReactRuntime.createElement(
563
+ RenderedServerHtml,
564
+ { ...key === null ? {} : { key }, id, rendered },
565
+ part(id, null)
566
+ ),
567
+ unrendered: (ids) => ReactRuntime.createElement(UnrenderedServerHtml, { ReactRuntime, ids, rendered, part })
568
+ };
569
+ }
496
570
  async function renderFarmServerTreePage(ReactRuntime, element, options) {
497
571
  const state = {
498
572
  ReactRuntime,
@@ -558,17 +632,7 @@ async function renderFarmServerTreePage(ReactRuntime, element, options) {
558
632
  entry.chunk = chunk;
559
633
  return chunk;
560
634
  },
561
- serverHtml(id, key) {
562
- return ReactRuntime.createElement(
563
- SERVER_HTML_TAG,
564
- {
565
- ...key === null ? {} : { key },
566
- [SERVER_HTML_ATTRIBUTE]: String(id),
567
- style: { display: "contents" }
568
- },
569
- options.isolate(state.serverHtml.get(id))
570
- );
571
- },
635
+ ...createServerHtmlParts(state, options.isolate),
572
636
  action(id) {
573
637
  return state.actions.get(id);
574
638
  },
@@ -645,8 +709,19 @@ async function createFarmServerTreeElement(ReactRuntime, source, options) {
645
709
  })
646
710
  );
647
711
  const serverHtml = /* @__PURE__ */ new Map();
648
- for (const container of root.querySelectorAll(`${SERVER_HTML_TAG}[${SERVER_HTML_ATTRIBUTE}]`)) {
649
- serverHtml.set(Number(container.getAttribute(SERVER_HTML_ATTRIBUTE)), container.innerHTML);
712
+ const readParts = (parts) => {
713
+ for (const container of parts) {
714
+ if (container.localName !== SERVER_HTML_TAG) continue;
715
+ serverHtml.set(Number(container.getAttribute(SERVER_HTML_ATTRIBUTE)), container.innerHTML);
716
+ }
717
+ };
718
+ readParts(root.querySelectorAll(`${SERVER_HTML_TAG}[${SERVER_HTML_ATTRIBUTE}]`));
719
+ const templates = /* @__PURE__ */ new Map();
720
+ for (const template of root.querySelectorAll(
721
+ `${SERVER_HTML_TEMPLATE_TAG}[${SERVER_HTML_ATTRIBUTE}]`
722
+ )) {
723
+ templates.set(Number(template.getAttribute(SERVER_HTML_ATTRIBUTE)), template.innerHTML);
724
+ readParts(template.content.children);
650
725
  }
651
726
  const resolver = {
652
727
  component(reference, exportName) {
@@ -683,6 +758,15 @@ async function createFarmServerTreeElement(ReactRuntime, source, options) {
683
758
  dangerouslySetInnerHTML: { __html: html }
684
759
  });
685
760
  },
761
+ unrendered(ids) {
762
+ const id = ids.find((candidate) => templates.has(candidate));
763
+ if (id === void 0) return null;
764
+ return ReactRuntime.createElement(SERVER_HTML_TEMPLATE_TAG, {
765
+ [SERVER_HTML_ATTRIBUTE]: String(id),
766
+ suppressHydrationWarning: true,
767
+ dangerouslySetInnerHTML: { __html: templates.get(id) }
768
+ });
769
+ },
686
770
  action(id) {
687
771
  if (!options.actions) throw new Error("server action props need islands mode");
688
772
  return options.actions(id);
@@ -25,7 +25,7 @@ var _chunkAQIRXBBYcjs = require('./chunk-AQIRXBBY.cjs');
25
25
 
26
26
 
27
27
 
28
- var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
28
+ var _chunkMTBDJ326cjs = require('./chunk-MTBDJ326.cjs');
29
29
 
30
30
 
31
31
  var _chunkGBMWLDCCcjs = require('./chunk-GBMWLDCC.cjs');
@@ -785,8 +785,8 @@ async function generateFarmTypeArtifacts(options) {
785
785
  const shouldGenerateEnv = options.env !== false;
786
786
  const shouldGenerateImages = options.images !== false;
787
787
  const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access', _48 => _48.i18nConfig, 'optionalAccess', _49 => _49.enabled]);
788
- const sourceRoots = _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, { root, srcDir, layers: options.layers });
789
- const appDirs = _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, { root, srcDir, layers: options.layers });
788
+ const sourceRoots = _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, { root, srcDir, layers: options.layers });
789
+ const appDirs = _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, { root, srcDir, layers: options.layers });
790
790
  const result = {
791
791
  apiRoutes: [],
792
792
  stalePaths: []
@@ -7,7 +7,7 @@ var _chunk53EHWHT2cjs = require('./chunk-53EHWHT2.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkOB3IFUK6cjs = require('./chunk-OB3IFUK6.cjs');
10
+ var _chunk437QZIC2cjs = require('./chunk-437QZIC2.cjs');
11
11
 
12
12
 
13
13
  var _chunkRI3EVPKDcjs = require('./chunk-RI3EVPKD.cjs');
@@ -52,7 +52,7 @@ function shouldBlockUnload(options) {
52
52
  function navigateViaRouter(href, basePath, replace, options = {}) {
53
53
  if (typeof window === "undefined") return;
54
54
  const url = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href, basePath);
55
- const spaRouter = _chunkOB3IFUK6cjs.getInstalledFarmSPARouter.call(void 0, );
55
+ const spaRouter = _chunk437QZIC2cjs.getInstalledFarmSPARouter.call(void 0, );
56
56
  if (spaRouter) {
57
57
  void spaRouter.navigate(url, {
58
58
  replace,
@@ -72,7 +72,7 @@ function writeHistory(url, replace) {
72
72
  } else {
73
73
  window.history.pushState(null, "", url);
74
74
  }
75
- _chunkOB3IFUK6cjs.notifyHistoryChange.call(void 0, "url-search");
75
+ _chunk437QZIC2cjs.notifyHistoryChange.call(void 0, "url-search");
76
76
  }
77
77
  async function writeHistoryUnlessDelegated(url, replace) {
78
78
  const target = new URL(url, window.location.href);
@@ -105,7 +105,7 @@ function useRouter(options = {}) {
105
105
  setState(readRouterState(basePath, routeMatcher));
106
106
  };
107
107
  handlePopState();
108
- const unsubscribe = _chunkOB3IFUK6cjs.subscribeHistoryChange.call(void 0, handlePopState);
108
+ const unsubscribe = _chunk437QZIC2cjs.subscribeHistoryChange.call(void 0, handlePopState);
109
109
  return unsubscribe;
110
110
  }, [basePath, routeMatcher]);
111
111
  const push = (href, navigateOptions) => {
@@ -116,11 +116,11 @@ function useRouter(options = {}) {
116
116
  };
117
117
  const pushState = (pageState, href) => {
118
118
  if (typeof window === "undefined") return;
119
- _chunkOB3IFUK6cjs.getRouter.call(void 0, ).pushState(pageState, resolveClientHref(href, basePath));
119
+ _chunk437QZIC2cjs.getRouter.call(void 0, ).pushState(pageState, resolveClientHref(href, basePath));
120
120
  };
121
121
  const replaceState = (pageState, href) => {
122
122
  if (typeof window === "undefined") return;
123
- _chunkOB3IFUK6cjs.getRouter.call(void 0, ).replaceState(pageState, resolveClientHref(href, basePath));
123
+ _chunk437QZIC2cjs.getRouter.call(void 0, ).replaceState(pageState, resolveClientHref(href, basePath));
124
124
  };
125
125
  const back = () => {
126
126
  if (typeof window !== "undefined") {
@@ -143,24 +143,24 @@ function useRouter(options = {}) {
143
143
  };
144
144
  }
145
145
  function usePageState() {
146
- const [state, setState] = _react.useState.call(void 0, () => _chunkOB3IFUK6cjs.readPageState.call(void 0, ));
146
+ const [state, setState] = _react.useState.call(void 0, () => _chunk437QZIC2cjs.readPageState.call(void 0, ));
147
147
  _react.useEffect.call(void 0, () => {
148
148
  if (typeof window === "undefined") return;
149
149
  const handlePopState = () => {
150
- setState(_chunkOB3IFUK6cjs.readPageState.call(void 0, ));
150
+ setState(_chunk437QZIC2cjs.readPageState.call(void 0, ));
151
151
  };
152
152
  handlePopState();
153
- return _chunkOB3IFUK6cjs.subscribeHistoryChange.call(void 0, handlePopState);
153
+ return _chunk437QZIC2cjs.subscribeHistoryChange.call(void 0, handlePopState);
154
154
  }, []);
155
155
  return state;
156
156
  }
157
157
  function useNavigation() {
158
158
  const [state, setState] = _react.useState.call(void 0,
159
- () => _chunkOB3IFUK6cjs.getRouter.call(void 0, ).getNavigationState()
159
+ () => _chunk437QZIC2cjs.getRouter.call(void 0, ).getNavigationState()
160
160
  );
161
161
  _react.useEffect.call(void 0, () => {
162
162
  if (typeof window === "undefined") return;
163
- return _chunkOB3IFUK6cjs.getRouter.call(void 0, ).subscribeNavigation(setState);
163
+ return _chunk437QZIC2cjs.getRouter.call(void 0, ).subscribeNavigation(setState);
164
164
  }, []);
165
165
  return state;
166
166
  }
@@ -172,7 +172,7 @@ function useBlocker(options) {
172
172
  if (typeof window === "undefined" || !active) {
173
173
  return;
174
174
  }
175
- return _chunkOB3IFUK6cjs.getRouter.call(void 0, ).addBlocker(
175
+ return _chunk437QZIC2cjs.getRouter.call(void 0, ).addBlocker(
176
176
  async (context) => {
177
177
  const current = optionsRef.current;
178
178
  const when = typeof current.when === "function" ? current.when(context) : current.when;
@@ -195,7 +195,7 @@ function useScrollRestoration(key) {
195
195
  _react.useEffect.call(void 0, () => {
196
196
  const element = ref.current;
197
197
  if (!element) return;
198
- return _chunkOB3IFUK6cjs.getRouter.call(void 0, ).registerScrollElement(key, element);
198
+ return _chunk437QZIC2cjs.getRouter.call(void 0, ).registerScrollElement(key, element);
199
199
  }, [key]);
200
200
  return ref;
201
201
  }
@@ -216,7 +216,7 @@ function readRouterState(basePath, routeMatcher) {
216
216
  pathname,
217
217
  searchParams: url.searchParams,
218
218
  params: _optionalChain([routeMatcher, 'optionalAccess', _5 => _5.match, 'call', _6 => _6(routePathname), 'optionalAccess', _7 => _7.params]) || {},
219
- pageState: typeof window === "undefined" ? null : _chunkOB3IFUK6cjs.readPageState.call(void 0, )
219
+ pageState: typeof window === "undefined" ? null : _chunk437QZIC2cjs.readPageState.call(void 0, )
220
220
  };
221
221
  }
222
222
  function readCurrentUrl() {
@@ -0,0 +1,17 @@
1
+ import {
2
+ getFarmIntegrationPluginServerRuntime
3
+ } from "./chunk-AJNBTOVQ.mjs";
4
+
5
+ // src/plugin-server-runtime.ts
6
+ function hasFarmServerRuntimePlugins(plugins) {
7
+ return (plugins || []).some((plugin) => {
8
+ if (getFarmIntegrationPluginServerRuntime(plugin) === false) return false;
9
+ return Boolean(
10
+ plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
11
+ );
12
+ });
13
+ }
14
+
15
+ export {
16
+ hasFarmServerRuntimePlugins
17
+ };
@@ -9,6 +9,10 @@ import {
9
9
  import {
10
10
  isFarmRedirectStatus
11
11
  } from "./chunk-JNYFXL7X.mjs";
12
+ import {
13
+ applyFarmBasePath,
14
+ normalizeFarmBasePath
15
+ } from "./chunk-SF3JB56B.mjs";
12
16
 
13
17
  // src/route-rules.ts
14
18
  function normalizeRouteRules(routeRules) {
@@ -102,6 +106,20 @@ function routeRulesToNitroRouteRules(routeRules) {
102
106
  }
103
107
  return nitroRules;
104
108
  }
109
+ function nitroRouteRulesBelowBasePath(nitroRules, basePath, apiServerBasePath) {
110
+ const prefix = normalizeFarmBasePath(basePath);
111
+ if (!prefix) return nitroRules;
112
+ const isAPISource = (source) => source === apiServerBasePath || source.startsWith(`${apiServerBasePath}/`);
113
+ const rules = { ...nitroRules };
114
+ for (const [source, rule] of Object.entries(nitroRules)) {
115
+ if (isAPISource(source)) continue;
116
+ const publicSource = applyFarmBasePath(source, prefix);
117
+ if (publicSource in nitroRules) continue;
118
+ const to = rule.redirect?.to;
119
+ rules[publicSource] = typeof to === "string" && to.startsWith("/") && !to.startsWith("//") ? { ...rule, redirect: { ...rule.redirect, to: applyFarmBasePath(to, prefix) } } : rule;
120
+ }
121
+ return rules;
122
+ }
105
123
  function resolveRouteRuleCorsPreflightHeaders(routeRules, pathname) {
106
124
  if (!routeRules) return void 0;
107
125
  let cors;
@@ -151,5 +169,6 @@ export {
151
169
  routeRulesToRedirects,
152
170
  routeRulesToHeaders,
153
171
  routeRulesToNitroRouteRules,
172
+ nitroRouteRulesBelowBasePath,
154
173
  resolveRouteRuleCorsPreflightHeaders
155
174
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  _withFarmGuardedResponseCache
3
- } from "./chunk-TEG6HJVF.mjs";
3
+ } from "./chunk-JL2YW5KX.mjs";
4
4
  import {
5
5
  _markFarmOwnedResponse,
6
6
  _withFarmResponseHeaders
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
2
- var version = "0.1.67";
2
+ var version = "0.1.68";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FARM_VERSION
3
- } from "./chunk-H37MDCPR.mjs";
3
+ } from "./chunk-F6CMGWAL.mjs";
4
4
 
5
5
  // src/deployment-environment.ts
6
6
  function isFarmProductionDeploymentEnvironment(env = process.env) {