@farm.js/core 0.1.49 → 0.1.51-beta.0

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 (363) hide show
  1. package/README.md +163 -3
  2. package/dist/{agent-mcp-Bb8hnnqd.d.ts → agent-mcp-BBMfNpsC.d.ts} +1 -1
  3. package/dist/{agent-mcp-ir3v4fHf.d.mts → agent-mcp-D44ip11f.d.mts} +1 -1
  4. package/dist/agent-runtime.cjs +3 -3
  5. package/dist/agent-runtime.d.mts +6 -6
  6. package/dist/agent-runtime.d.ts +6 -6
  7. package/dist/agent-runtime.mjs +2 -2
  8. package/dist/analyzer-HOUCQR3K.mjs +1066 -0
  9. package/dist/analyzer-VKUDHNDF.cjs +1066 -0
  10. package/dist/api/client.d.mts +0 -1
  11. package/dist/api/client.d.ts +0 -1
  12. package/dist/api/route-manager.cjs +8 -8
  13. package/dist/api/route-manager.d.mts +10 -10
  14. package/dist/api/route-manager.d.ts +10 -10
  15. package/dist/api/route-manager.mjs +7 -7
  16. package/dist/api/runtime.cjs +3 -3
  17. package/dist/api/runtime.d.mts +7 -7
  18. package/dist/api/runtime.d.ts +7 -7
  19. package/dist/api/runtime.mjs +2 -2
  20. package/dist/api.cjs +9 -9
  21. package/dist/api.d.mts +10 -10
  22. package/dist/api.d.ts +10 -10
  23. package/dist/api.mjs +8 -8
  24. package/dist/{app-y649szYm.d.ts → app-CourU3rQ.d.ts} +7 -7
  25. package/dist/{app-DLzz02du.d.mts → app-aeD4s_mg.d.mts} +7 -7
  26. package/dist/{app-manifest-Crn8Qd3U.d.mts → app-manifest-BC6mFn5A.d.mts} +1 -1
  27. package/dist/{app-manifest-DNeTKMRL.d.ts → app-manifest-LzjoNPeq.d.ts} +1 -1
  28. package/dist/app-markdown.d.mts +7 -7
  29. package/dist/app-markdown.d.ts +7 -7
  30. package/dist/base-path-BOUV5ozD.d.mts +10 -0
  31. package/dist/base-path-BOUV5ozD.d.ts +10 -0
  32. package/dist/cache.d.mts +4 -3
  33. package/dist/cache.d.ts +4 -3
  34. package/dist/{chunk-YQGZLCT4.cjs → chunk-2IAPKPEB.cjs} +6 -6
  35. package/dist/chunk-2KVDHNQS.mjs +224 -0
  36. package/dist/{chunk-QFQDRJKJ.mjs → chunk-3HA7PP72.mjs} +2 -2
  37. package/dist/{chunk-6LH33DLL.cjs → chunk-3OWVWZ6R.cjs} +28 -2
  38. package/dist/{chunk-GXSMF7UR.mjs → chunk-4GJJ65RB.mjs} +10 -2
  39. package/dist/{chunk-GERUXONA.cjs → chunk-5A77OEIG.cjs} +4 -1
  40. package/dist/{chunk-4HBKBHVP.mjs → chunk-5ENW27SL.mjs} +1 -1
  41. package/dist/{chunk-MTB57GOK.mjs → chunk-724WT3NI.mjs} +4 -2
  42. package/dist/{chunk-XLYXG73A.mjs → chunk-75WWOZ5C.mjs} +22 -0
  43. package/dist/{chunk-VCKGOXFI.cjs → chunk-76GHW3WI.cjs} +7 -1
  44. package/dist/{chunk-ZIBIE7AH.mjs → chunk-7UPCJDB5.mjs} +7 -1
  45. package/dist/{chunk-4IICUBQX.cjs → chunk-A5BJKSZE.cjs} +2 -2
  46. package/dist/{chunk-UYQOIPXE.mjs → chunk-AER5I65K.mjs} +1 -1
  47. package/dist/{chunk-WB6XES4V.mjs → chunk-ALEUMLJN.mjs} +34 -5
  48. package/dist/{chunk-Z4LTSH7D.mjs → chunk-AMRK3P6W.mjs} +175 -71
  49. package/dist/{chunk-TTYXOAB7.mjs → chunk-ANHZ6SUL.mjs} +1 -1
  50. package/dist/{chunk-ZBS3GOQZ.cjs → chunk-AQLHD6HZ.cjs} +35 -61
  51. package/dist/{chunk-L6QDME5Z.cjs → chunk-B3GZAQSC.cjs} +3 -3
  52. package/dist/chunk-CKPTIEDX.cjs +12 -0
  53. package/dist/{chunk-JPAVNDZH.cjs → chunk-CY7H5KS4.cjs} +25 -25
  54. package/dist/{chunk-4S7M63WX.cjs → chunk-DGOLAZLV.cjs} +22 -1
  55. package/dist/{chunk-4HM5B5RR.cjs → chunk-DWW3AMJX.cjs} +343 -308
  56. package/dist/{chunk-EQMTJBB7.cjs → chunk-DZZHTMWM.cjs} +35 -6
  57. package/dist/chunk-E36C43IX.cjs +224 -0
  58. package/dist/{chunk-J2ZEVDEK.cjs → chunk-EHB77D5U.cjs} +3 -3
  59. package/dist/{chunk-WQGRD5BJ.cjs → chunk-EX6ZSN5P.cjs} +1 -16
  60. package/dist/{chunk-C5S457CK.cjs → chunk-F42U3R4F.cjs} +214 -193
  61. package/dist/{chunk-FGJQS4EC.cjs → chunk-FK25QSVC.cjs} +4 -3
  62. package/dist/{chunk-JOHXK4BB.mjs → chunk-FSQMN2MQ.mjs} +2 -1
  63. package/dist/{chunk-2H3FJYY6.mjs → chunk-FSXSQQTV.mjs} +3 -2
  64. package/dist/chunk-G2KTRMWA.mjs +40 -0
  65. package/dist/{chunk-C6U66WWF.mjs → chunk-GFT5AHAT.mjs} +13 -0
  66. package/dist/chunk-GNZIAJGB.mjs +358 -0
  67. package/dist/{chunk-TXK4D46O.mjs → chunk-H3ASZDT7.mjs} +21 -1
  68. package/dist/{chunk-AXRNEVCS.cjs → chunk-HASX6DC7.cjs} +8 -8
  69. package/dist/{chunk-NW2BKDVT.mjs → chunk-HHFMECFO.mjs} +1 -1
  70. package/dist/{chunk-HELQXYVI.cjs → chunk-I2DQGS56.cjs} +11 -9
  71. package/dist/{chunk-IVHPRF4W.mjs → chunk-I2ZA5SXS.mjs} +81 -46
  72. package/dist/{chunk-EVCQX243.cjs → chunk-IOUOGRDX.cjs} +13 -5
  73. package/dist/{chunk-CBJKDB6F.mjs → chunk-IRSS4HS4.mjs} +1 -1
  74. package/dist/{chunk-NPPT4RWF.cjs → chunk-J22JD5YJ.cjs} +7 -7
  75. package/dist/{chunk-VJXLUTBM.mjs → chunk-JF5CNHHF.mjs} +9 -9
  76. package/dist/{chunk-VR4SEDEM.mjs → chunk-JWI5PUO2.mjs} +6 -2
  77. package/dist/{chunk-6XFGJBYX.cjs → chunk-JYNNIGQO.cjs} +16 -7
  78. package/dist/{chunk-EXHEPWFJ.cjs → chunk-KHXAJ2KA.cjs} +16 -16
  79. package/dist/{chunk-ALD2WMLA.mjs → chunk-KY32FWK7.mjs} +4 -4
  80. package/dist/{chunk-BR5FSKZ5.cjs → chunk-LEIXUFJN.cjs} +6 -2
  81. package/dist/{chunk-5566GNEG.cjs → chunk-LIFUPCXW.cjs} +13 -0
  82. package/dist/{chunk-I2SWKWO7.mjs → chunk-LJDIFIJ2.mjs} +1 -1
  83. package/dist/chunk-LMFJCXDD.mjs +55 -0
  84. package/dist/{chunk-IXSMFKZ2.cjs → chunk-LNM57D3H.cjs} +4 -4
  85. package/dist/{chunk-ATHPRVP2.mjs → chunk-LZ4SB57H.mjs} +3 -3
  86. package/dist/{chunk-73XBJRZW.cjs → chunk-MMEEXMUQ.cjs} +2 -2
  87. package/dist/chunk-N4AQNEXR.cjs +17 -0
  88. package/dist/{chunk-JZMZKABS.cjs → chunk-NWUHS6GV.cjs} +3 -2
  89. package/dist/{chunk-KZT2VHRQ.cjs → chunk-O3MMJPC2.cjs} +19 -19
  90. package/dist/{chunk-JWP56HCP.mjs → chunk-OD6WM3I7.mjs} +2 -2
  91. package/dist/{chunk-R2SEZEBC.cjs → chunk-OYNNA4DD.cjs} +4 -4
  92. package/dist/{chunk-GBPDSUFE.mjs → chunk-OZK2DS44.mjs} +1 -1
  93. package/dist/{chunk-A7DK663W.cjs → chunk-PDJSL7PL.cjs} +50 -39
  94. package/dist/{chunk-XLLVWLWO.mjs → chunk-PIHKO25G.mjs} +1 -1
  95. package/dist/chunk-PIUTGRDI.cjs +358 -0
  96. package/dist/{chunk-XO6WL6NL.mjs → chunk-PPDHCRTC.mjs} +1 -1
  97. package/dist/{chunk-LZBM35DH.mjs → chunk-QI5AQMEE.mjs} +20 -9
  98. package/dist/{chunk-FR4HJDI6.cjs → chunk-QK3HBOTG.cjs} +27 -30
  99. package/dist/{chunk-Q3UU2KXC.mjs → chunk-QMDU6QHN.mjs} +4 -1
  100. package/dist/chunk-QXJADAQB.cjs +40 -0
  101. package/dist/{chunk-DGVVVYKD.mjs → chunk-R5P4KFPM.mjs} +2 -2
  102. package/dist/{chunk-3HBFI373.cjs → chunk-S5AQ7CAC.cjs} +14 -14
  103. package/dist/{chunk-Z3BXMMFF.mjs → chunk-S5ZA2T2W.mjs} +63 -42
  104. package/dist/{chunk-PXEXOQ5R.mjs → chunk-SHS6KXOZ.mjs} +1 -1
  105. package/dist/{chunk-ETF5C6HR.cjs → chunk-SJ23LJ3N.cjs} +3 -3
  106. package/dist/{chunk-LL7TDMOM.mjs → chunk-SMUW7UST.mjs} +33 -59
  107. package/dist/{chunk-VCFBQFOV.mjs → chunk-SN5VSO3Q.mjs} +9 -7
  108. package/dist/{chunk-AIHD6VME.cjs → chunk-SO3T6T4I.cjs} +482 -378
  109. package/dist/{chunk-JHXJBNLY.cjs → chunk-SUCDVKUB.cjs} +21 -1
  110. package/dist/{chunk-DM3TFCC2.cjs → chunk-SUV6YO4Q.cjs} +5 -5
  111. package/dist/{chunk-NG44F7AH.mjs → chunk-T4EW7AAD.mjs} +2 -2
  112. package/dist/{chunk-JUMPFVMK.mjs → chunk-TUOO6IK3.mjs} +9 -0
  113. package/dist/chunk-UB7RVEMX.mjs +73 -0
  114. package/dist/{chunk-CDTIXBKN.mjs → chunk-UN6N623E.mjs} +2 -2
  115. package/dist/{chunk-BEXYFR2R.cjs → chunk-USL2ANCB.cjs} +10 -10
  116. package/dist/{chunk-HAH4FBTA.mjs → chunk-VAHBCI6X.mjs} +1 -1
  117. package/dist/{chunk-QNQEK3OF.cjs → chunk-VIFPE5RG.cjs} +14 -14
  118. package/dist/{chunk-HTLCLOXQ.cjs → chunk-VO6NLTV4.cjs} +3 -3
  119. package/dist/{chunk-XN2MB4QZ.cjs → chunk-VQJYGZNX.cjs} +4 -4
  120. package/dist/{chunk-N25RPPO5.cjs → chunk-WAPQWAE6.cjs} +10 -10
  121. package/dist/{chunk-5PKDHKQP.cjs → chunk-WFVSAT7Y.cjs} +6 -4
  122. package/dist/{chunk-EA5PMJDU.mjs → chunk-WSY2JD7O.mjs} +7 -7
  123. package/dist/{chunk-HNAUK3SC.mjs → chunk-WVX3BUNJ.mjs} +40 -199
  124. package/dist/chunk-X3EFRVXY.mjs +12 -0
  125. package/dist/{chunk-UCQ52TJY.mjs → chunk-X3JNB2TB.mjs} +1 -1
  126. package/dist/{chunk-J5VCA45K.cjs → chunk-X5BCMLGP.cjs} +1 -1
  127. package/dist/{chunk-SSNN55Q6.cjs → chunk-XB24LZWI.cjs} +10 -10
  128. package/dist/{chunk-XXB37YET.cjs → chunk-XLRLSTJ6.cjs} +7 -7
  129. package/dist/{chunk-BNMHXVLL.mjs → chunk-XMHERKSE.mjs} +0 -15
  130. package/dist/chunk-XPMC4E2G.cjs +55 -0
  131. package/dist/{chunk-J27BZO67.mjs → chunk-XWC5NAHV.mjs} +23 -26
  132. package/dist/{chunk-DRFADSKY.mjs → chunk-XXXRRVY6.mjs} +4 -4
  133. package/dist/{chunk-C7425KDG.cjs → chunk-XYL4HSVC.cjs} +2 -2
  134. package/dist/{chunk-2SVJGOAX.mjs → chunk-Y3N5BFRJ.mjs} +3 -3
  135. package/dist/{chunk-ZSIGEHSE.cjs → chunk-Y7TLL65B.cjs} +21 -180
  136. package/dist/{chunk-PEHL3IZL.cjs → chunk-YB44NKC2.cjs} +2 -2
  137. package/dist/chunk-YKHRCY4T.cjs +73 -0
  138. package/dist/{chunk-RYDDUCNJ.mjs → chunk-YLNBWUVS.mjs} +1 -1
  139. package/dist/chunk-Z5A6CNV2.mjs +60 -0
  140. package/dist/chunk-Z64V4WZI.mjs +17 -0
  141. package/dist/{chunk-ACI52TCN.mjs → chunk-ZF3GX4O7.mjs} +1 -1
  142. package/dist/client/lifecycle.d.mts +1 -1
  143. package/dist/client/lifecycle.d.ts +1 -1
  144. package/dist/{client-plugins-DFDQUI9Q.d.ts → client-plugins-CFBEfVPO.d.ts} +34 -10
  145. package/dist/{client-plugins-BNBeyLMi.d.mts → client-plugins-cqy_dQd0.d.mts} +34 -10
  146. package/dist/client-plugins.d.mts +6 -6
  147. package/dist/client-plugins.d.ts +6 -6
  148. package/dist/client.cjs +13 -9
  149. package/dist/client.d.mts +11 -10
  150. package/dist/client.d.ts +11 -10
  151. package/dist/client.mjs +15 -11
  152. package/dist/client.react-server.mjs +1 -1
  153. package/dist/config-CnhyvvmT.d.mts +188 -0
  154. package/dist/config-CnhyvvmT.d.ts +188 -0
  155. package/dist/config.d.mts +6 -6
  156. package/dist/config.d.ts +6 -6
  157. package/dist/cron.cjs +4 -4
  158. package/dist/cron.mjs +3 -3
  159. package/dist/desktop.d.mts +7 -7
  160. package/dist/desktop.d.ts +7 -7
  161. package/dist/{dev-guard-YO6KPIOQ.mjs → dev-guard-4PFQNXQX.mjs} +2 -1
  162. package/dist/{dev-guard-PLHL6OTJ.cjs → dev-guard-YLO5DE3H.cjs} +4 -3
  163. package/dist/{devtools-BLKHPY3C.mjs → devtools-4MLL3RAL.mjs} +10 -10
  164. package/dist/{devtools-A37WWJZL.cjs → devtools-4ZLMD454.cjs} +12 -12
  165. package/dist/docs.cjs +14 -14
  166. package/dist/docs.d.mts +7 -7
  167. package/dist/docs.d.ts +7 -7
  168. package/dist/docs.mjs +13 -13
  169. package/dist/environment/vite.d.mts +1 -1
  170. package/dist/environment/vite.d.ts +1 -1
  171. package/dist/generate-route-types-DQP0cUzk.d.ts +33 -0
  172. package/dist/generate-route-types-TF5Wwtvz.d.mts +33 -0
  173. package/dist/i18n/client.d.mts +2 -2
  174. package/dist/i18n/client.d.ts +2 -2
  175. package/dist/i18n/index.d.mts +3 -3
  176. package/dist/i18n/index.d.ts +3 -3
  177. package/dist/i18n/server.d.mts +5 -5
  178. package/dist/i18n/server.d.ts +5 -5
  179. package/dist/image/server.cjs +3 -3
  180. package/dist/image/server.mjs +2 -2
  181. package/dist/image/sharp.cjs +10 -10
  182. package/dist/image/sharp.mjs +2 -2
  183. package/dist/{index-DBdiTkNc.d.ts → index-BYkNbeQV.d.mts} +2 -2
  184. package/dist/{index-CeJ9_s9p.d.mts → index-BxjN_UDZ.d.ts} +2 -2
  185. package/dist/{index-MocnSP3a.d.ts → index-D3l4tREW.d.ts} +2 -2
  186. package/dist/{index-Cl3akY5U.d.mts → index-DPUAPho_.d.mts} +2 -2
  187. package/dist/index.cjs +88 -79
  188. package/dist/index.d.mts +29 -45
  189. package/dist/index.d.ts +29 -45
  190. package/dist/index.mjs +92 -83
  191. package/dist/integrations.cjs +3 -3
  192. package/dist/integrations.d.mts +6 -6
  193. package/dist/integrations.d.ts +6 -6
  194. package/dist/integrations.mjs +2 -2
  195. package/dist/internal/app-markdown-runtime.d.mts +7 -7
  196. package/dist/internal/app-markdown-runtime.d.ts +7 -7
  197. package/dist/internal/build-runtime.cjs +47 -43
  198. package/dist/internal/build-runtime.d.mts +9 -9
  199. package/dist/internal/build-runtime.d.ts +9 -9
  200. package/dist/internal/build-runtime.mjs +46 -42
  201. package/dist/internal/cli-runtime.cjs +24 -23
  202. package/dist/internal/cli-runtime.mjs +24 -23
  203. package/dist/internal/client-error-overlay.cjs +4 -4
  204. package/dist/internal/client-error-overlay.mjs +1 -1
  205. package/dist/internal/client-runtime.cjs +22 -3
  206. package/dist/internal/client-runtime.d.mts +46 -4
  207. package/dist/internal/client-runtime.d.ts +46 -4
  208. package/dist/internal/client-runtime.mjs +22 -3
  209. package/dist/internal/compression-runtime.d.mts +6 -6
  210. package/dist/internal/compression-runtime.d.ts +6 -6
  211. package/dist/internal/config-runtime.cjs +20 -13
  212. package/dist/internal/config-runtime.d.mts +259 -18
  213. package/dist/internal/config-runtime.d.ts +259 -18
  214. package/dist/internal/config-runtime.mjs +18 -11
  215. package/dist/internal/form-actions.cjs +5 -4
  216. package/dist/internal/form-actions.mjs +4 -3
  217. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  218. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  219. package/dist/internal/islands-runtime.cjs +56 -0
  220. package/dist/internal/islands-runtime.mjs +57 -1
  221. package/dist/internal/metadata-image-runtime.cjs +3 -3
  222. package/dist/internal/metadata-image-runtime.mjs +2 -2
  223. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  224. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  225. package/dist/internal/production-runtime.cjs +18 -15
  226. package/dist/internal/production-runtime.d.mts +33 -20
  227. package/dist/internal/production-runtime.d.ts +33 -20
  228. package/dist/internal/production-runtime.mjs +20 -17
  229. package/dist/internal/server-fn-transform.cjs +13 -0
  230. package/dist/internal/server-fn-transform.d.mts +24 -0
  231. package/dist/internal/server-fn-transform.d.ts +24 -0
  232. package/dist/internal/server-fn-transform.mjs +13 -0
  233. package/dist/{layers-D9fbe-rz.d.ts → layers-CcS42OGR.d.mts} +1 -1
  234. package/dist/{layers-D9fbe-rz.d.mts → layers-CcS42OGR.d.ts} +1 -1
  235. package/dist/{lifecycle-DK06VuKP.d.ts → lifecycle-C2aLBOwu.d.mts} +1 -1
  236. package/dist/{lifecycle-DK06VuKP.d.mts → lifecycle-C2aLBOwu.d.ts} +1 -1
  237. package/dist/markdown.d.mts +6 -6
  238. package/dist/markdown.d.ts +6 -6
  239. package/dist/middleware.cjs +11 -11
  240. package/dist/middleware.d.mts +8 -8
  241. package/dist/middleware.d.ts +8 -8
  242. package/dist/middleware.mjs +10 -10
  243. package/dist/mobile.cjs +9 -0
  244. package/dist/mobile.d.mts +94 -0
  245. package/dist/mobile.d.ts +94 -0
  246. package/dist/mobile.mjs +9 -0
  247. package/dist/navigation-delegate-BU4xqdnw.d.ts +29 -0
  248. package/dist/navigation-delegate-DLhbfEN4.d.mts +29 -0
  249. package/dist/navigation.cjs +5 -5
  250. package/dist/navigation.d.mts +9 -9
  251. package/dist/navigation.d.ts +9 -9
  252. package/dist/navigation.mjs +4 -4
  253. package/dist/{nitro-BIXIKJZS.cjs → nitro-CK7M4RMY.cjs} +12 -12
  254. package/dist/{nitro-UT2J5A5D.mjs → nitro-R444AF3O.mjs} +8 -8
  255. package/dist/platform.cjs +2 -1
  256. package/dist/platform.d.mts +4 -3
  257. package/dist/platform.d.ts +4 -3
  258. package/dist/platform.mjs +2 -1
  259. package/dist/{plugin-4KYXV7BB.mjs → plugin-53SY5YBS.mjs} +1 -1
  260. package/dist/{plugin-WBANOZQM.cjs → plugin-HZIBL3DW.cjs} +2 -2
  261. package/dist/plugin.cjs +40 -36
  262. package/dist/plugin.d.mts +13 -8
  263. package/dist/plugin.d.ts +13 -8
  264. package/dist/plugin.mjs +39 -35
  265. package/dist/{production-runtime-B3qFFtKF.d.ts → production-runtime-C78A8YgK.d.ts} +3 -3
  266. package/dist/{production-runtime-DcD-GRAv.d.mts → production-runtime-DLA4J5WG.d.mts} +3 -3
  267. package/dist/production-vite-BQFAlG7n.d.mts +13 -0
  268. package/dist/production-vite-BQFAlG7n.d.ts +13 -0
  269. package/dist/{programmatic-routes-client-fD9f4XqU.d.ts → programmatic-routes-client-CBqkNhBy.d.ts} +2 -2
  270. package/dist/{programmatic-routes-client-DzbYGiZQ.d.mts → programmatic-routes-client-NpqGBn-i.d.mts} +2 -2
  271. package/dist/query/client.cjs +6 -6
  272. package/dist/query/client.mjs +2 -2
  273. package/dist/{render-plan-DqJ51ufr.d.mts → render-plan-C9sWvDTv.d.mts} +1 -1
  274. package/dist/{render-plan-B6cfssrr.d.ts → render-plan-CrqcBbnV.d.ts} +1 -1
  275. package/dist/renderer-client.cjs +17 -12
  276. package/dist/renderer-client.d.mts +9 -8
  277. package/dist/renderer-client.d.ts +9 -8
  278. package/dist/renderer-client.mjs +10 -5
  279. package/dist/{request-jhvUMXRx.d.ts → request-BizeuqD7.d.ts} +1 -1
  280. package/dist/{request-UuAxHn8h.d.mts → request-WwB1-Uim.d.mts} +1 -1
  281. package/dist/request.d.mts +7 -7
  282. package/dist/request.d.ts +7 -7
  283. package/dist/{resolver-DC57A4vz.d.ts → resolver-CJ-D9nP-.d.ts} +1 -1
  284. package/dist/{resolver-C2G-3Tm6.d.mts → resolver-TDyZKgKI.d.mts} +1 -1
  285. package/dist/{route-rendering-Sn50cYZf.d.ts → route-rendering-BGhJN64l.d.ts} +1 -1
  286. package/dist/{route-rendering-Cou00t1X.d.mts → route-rendering-S6NFjnx4.d.mts} +1 -1
  287. package/dist/{router-0X9DCTcm.d.mts → router-BIheIy9G.d.mts} +1 -1
  288. package/dist/{router-xwLvi48p.d.ts → router-BUD_j2EL.d.ts} +1 -1
  289. package/dist/routes-8PT9cl60.d.ts +121 -0
  290. package/dist/routes-kEUsXHx3.d.mts +121 -0
  291. package/dist/routes.cjs +3 -2
  292. package/dist/routes.d.mts +7 -7
  293. package/dist/routes.d.ts +7 -7
  294. package/dist/routes.mjs +2 -1
  295. package/dist/{rsc-pipeline-VKHMABDJ.cjs → rsc-pipeline-JRGUZBYM.cjs} +18 -16
  296. package/dist/{rsc-pipeline-F6ZPH5MU.mjs → rsc-pipeline-OLAVIKI3.mjs} +17 -15
  297. package/dist/{runtime-B9HmxiZc.d.ts → runtime-C4CmlOOh.d.ts} +2 -2
  298. package/dist/{runtime-tkSXZiqO.d.ts → runtime-CWP-21hP.d.ts} +1 -1
  299. package/dist/{runtime-CMrsyChI.d.mts → runtime-CgJwe6H_.d.mts} +1 -1
  300. package/dist/{runtime-CCxTmGuf.d.mts → runtime-CihDZ2Rn.d.mts} +2 -2
  301. package/dist/runtime-G23RSLEK.cjs +1005 -0
  302. package/dist/runtime-OGCHDACZ.mjs +1005 -0
  303. package/dist/{schema-dev-notice-O3I5HLXK.mjs → schema-dev-notice-F6QYSOAI.mjs} +4 -4
  304. package/dist/{schema-dev-notice-Z73J3NJ6.cjs → schema-dev-notice-UU7DMZEU.cjs} +7 -7
  305. package/dist/{search-client-BTXL5XWD.mjs → search-client-OXH6GBNO.mjs} +5 -3
  306. package/dist/search-client-ZZLKVO5R.cjs +15 -0
  307. package/dist/server-action-security.cjs +3 -3
  308. package/dist/server-action-security.mjs +2 -2
  309. package/dist/server-fn-client.d.mts +0 -1
  310. package/dist/server-fn-client.d.ts +0 -1
  311. package/dist/server-fn.cjs +4 -4
  312. package/dist/server-fn.d.mts +0 -1
  313. package/dist/server-fn.d.ts +0 -1
  314. package/dist/server-fn.mjs +3 -3
  315. package/dist/server-plugins.cjs +1 -1
  316. package/dist/server-plugins.d.mts +7 -7
  317. package/dist/server-plugins.d.ts +7 -7
  318. package/dist/server-plugins.mjs +1 -1
  319. package/dist/server-query-client.cjs +4 -3
  320. package/dist/server-query-client.d.mts +0 -1
  321. package/dist/server-query-client.d.ts +0 -1
  322. package/dist/server-query-client.mjs +3 -2
  323. package/dist/server-query.cjs +5 -5
  324. package/dist/server-query.d.mts +0 -1
  325. package/dist/server-query.d.ts +0 -1
  326. package/dist/server-query.mjs +4 -4
  327. package/dist/server.cjs +104 -79
  328. package/dist/server.d.mts +22 -17
  329. package/dist/server.d.ts +22 -17
  330. package/dist/server.mjs +73 -48
  331. package/dist/{spa-router-B48EjsS1.d.mts → spa-router-CVOL0Vrq.d.mts} +4 -4
  332. package/dist/{spa-router-B06APnGK.d.ts → spa-router-Kytv4jSB.d.ts} +4 -4
  333. package/dist/testing.cjs +16 -15
  334. package/dist/testing.d.mts +6 -6
  335. package/dist/testing.d.ts +6 -6
  336. package/dist/testing.mjs +12 -11
  337. package/dist/{types--Wh02r5_.d.mts → types-C41ePjvP.d.mts} +1 -1
  338. package/dist/{types--Wh02r5_.d.ts → types-C41ePjvP.d.ts} +1 -1
  339. package/dist/{utils-C5fyK2tE.d.ts → utils-DbyXlzaj.d.ts} +1 -1
  340. package/dist/{utils-hyAwmcN6.d.mts → utils-Dsa1HZ7X.d.mts} +1 -1
  341. package/dist/version.cjs +2 -2
  342. package/dist/version.mjs +1 -1
  343. package/dist/vite.cjs +40 -36
  344. package/dist/vite.d.mts +9 -9
  345. package/dist/vite.d.ts +9 -9
  346. package/dist/vite.mjs +39 -35
  347. package/dist/{workflows-Df1C_7OG.d.mts → workflows-CRMzQZ3k.d.mts} +2 -1
  348. package/dist/{workflows-Df1C_7OG.d.ts → workflows-CRMzQZ3k.d.ts} +2 -1
  349. package/dist/workflows.cjs +5 -5
  350. package/dist/workflows.d.mts +1 -1
  351. package/dist/workflows.d.ts +1 -1
  352. package/dist/workflows.mjs +4 -4
  353. package/package.json +16 -3
  354. package/dist/base-path-leyrqXbX.d.mts +0 -19
  355. package/dist/base-path-leyrqXbX.d.ts +0 -19
  356. package/dist/cache-invalidation-BD0z_lfu.d.mts +0 -4
  357. package/dist/cache-invalidation-BD0z_lfu.d.ts +0 -4
  358. package/dist/chunk-45EUIICW.mjs +0 -15
  359. package/dist/chunk-MJ6IC4K2.mjs +0 -34
  360. package/dist/chunk-V7KTQR4C.cjs +0 -15
  361. package/dist/search-client-QCYAL6AY.cjs +0 -13
  362. package/dist/{chunk-5OJVKXFV.cjs → chunk-N7JQXQAV.cjs} +2 -2
  363. package/dist/{chunk-72KABRWN.mjs → chunk-WSDKXV4E.mjs} +4 -4
@@ -1,12 +1,16 @@
1
+ import {
2
+ createRouteTypeDeclarations,
3
+ generateRouteTypes
4
+ } from "./chunk-2KVDHNQS.mjs";
1
5
  import {
2
6
  readSchemaTables
3
7
  } from "./chunk-2DLGV2ZG.mjs";
4
- import {
5
- APITypeGenerator
6
- } from "./chunk-HPP2II4Z.mjs";
7
8
  import {
8
9
  resolveSchemaModels
9
10
  } from "./chunk-F3N52U7S.mjs";
11
+ import {
12
+ APITypeGenerator
13
+ } from "./chunk-HPP2II4Z.mjs";
10
14
  import {
11
15
  getOptionalCatchAllParameterNames,
12
16
  materializeSSGRoutePath,
@@ -20,28 +24,16 @@ import {
20
24
  import {
21
25
  writeFileIfChanged
22
26
  } from "./chunk-Q5B4LNON.mjs";
23
- import {
24
- resolveFarmComponentExtensions
25
- } from "./chunk-ES2LD2YD.mjs";
26
27
  import {
27
28
  getFarmAppDirectories,
28
29
  getFarmSourceRoots
29
30
  } from "./chunk-52Y3C3HG.mjs";
30
- import {
31
- parseRouteSlotFile
32
- } from "./chunk-CBJKDB6F.mjs";
33
- import {
34
- discoverProgrammaticRoutePaths
35
- } from "./chunk-2H3FJYY6.mjs";
36
31
  import {
37
32
  readFarmI18nCatalogs
38
33
  } from "./chunk-DU4VHHPJ.mjs";
39
34
  import {
40
35
  resolvePluginRoutes
41
36
  } from "./chunk-R62SF5R4.mjs";
42
- import {
43
- parseRoutePath
44
- } from "./chunk-2SVJGOAX.mjs";
45
37
 
46
38
  // src/ssg.ts
47
39
  import { readFileSync } from "fs";
@@ -511,163 +503,13 @@ function matchSSGPage(urlPath, ssgPages) {
511
503
  return ssgPages.find((page) => page.urlPath === normalizedPath);
512
504
  }
513
505
 
514
- // src/routing/generate-route-types.ts
515
- import * as path from "path";
516
- import * as fs from "fs";
517
- function routeSegmentsToTsTypeLiteral(segments) {
518
- if (segments.length === 0) return '"/"';
519
- const hasDynamic = segments.some((s) => s.startsWith("["));
520
- if (!hasDynamic) return JSON.stringify("/" + segments.join("/"));
521
- const parts = segments.map((s) => {
522
- if (s.startsWith("[[...") || s.startsWith("[...")) return "${string}";
523
- if (s.startsWith("[")) return "${string}";
524
- return s;
525
- });
526
- return "`/" + parts.join("/") + "`";
527
- }
528
- function routePatternToTsTypeLiterals(pattern) {
529
- if (pattern === "/") return ['"/"'];
530
- let variants = [[]];
531
- for (const segment of pattern.slice(1).split("/").filter(Boolean)) {
532
- if (segment.startsWith("[[...") && segment.endsWith("]]")) {
533
- variants = variants.flatMap((parts) => [parts, [...parts, segment]]);
534
- } else {
535
- variants = variants.map((parts) => [...parts, segment]);
536
- }
537
- }
538
- return variants.map(routeSegmentsToTsTypeLiteral);
539
- }
540
- function routePatternToRouteLiteral(pattern) {
541
- return JSON.stringify(pattern);
542
- }
543
- function renderTypeUnion(values) {
544
- return values.length <= 1 ? values[0] || "never" : `
545
- | ${values.join("\n | ")}`;
546
- }
547
- function renderTypeAlias(name, value) {
548
- return `export type ${name} =${value.startsWith("\n") ? "" : " "}${value};`;
549
- }
550
- function createRoutePattern(route) {
551
- if (route.segments.length === 0) return "/";
552
- return "/" + route.segments.map((seg) => {
553
- if (!seg.isDynamic) return seg.segment;
554
- if (seg.isCatchAll) return seg.isOptional ? `[[...${seg.segment}]]` : `[...${seg.segment}]`;
555
- return `[${seg.segment}]`;
556
- }).join("/");
557
- }
558
- var DEFAULT_OUT_FILE = "farm-routes.d.ts";
559
- async function generateRouteTypes(options) {
560
- const root = path.resolve(options.root);
561
- const srcDir = options.srcDir || "src";
562
- const outFile = options.outFile || DEFAULT_OUT_FILE;
563
- const outPath = path.isAbsolute(outFile) ? outFile : path.join(root, srcDir, outFile);
564
- const content = await createRouteTypeDeclarations(options, outPath);
565
- fs.mkdirSync(path.dirname(outPath), { recursive: true });
566
- writeFileIfChanged(outPath, content);
567
- return outPath;
568
- }
569
- async function createRouteTypeDeclarations(options, outPath) {
570
- const { root, srcDir = "src", extraRoutes = [], suppressLintOnLink = false } = options;
571
- const sourceRoots = options.sourceRoots ?? [{ name: "project", root, srcDir, layer: false }];
572
- const componentExtensions = resolveFarmComponentExtensions(options.componentExtensions).map(
573
- (extension) => extension.slice(1)
574
- );
575
- const patterns = /* @__PURE__ */ new Set();
576
- const routeModulePatterns = /* @__PURE__ */ new Set();
577
- const glob = await import("fast-glob");
578
- for (const source of sourceRoots) {
579
- const appDir = path.join(source.root, source.srcDir, "app");
580
- if (fs.existsSync(appDir)) {
581
- const routeModuleFiles = await glob.default(
582
- `**/{page,layout,loading,error}.{${componentExtensions.join(",")},md,mdx}`,
583
- {
584
- cwd: appDir,
585
- absolute: false
586
- }
587
- );
588
- for (const file of routeModuleFiles) {
589
- if (parseRouteSlotFile(file)) continue;
590
- const route = parseRoutePath(file);
591
- const pattern = createRoutePattern(route);
592
- routeModulePatterns.add(pattern);
593
- if (route.type === "page") {
594
- patterns.add(pattern);
595
- }
596
- }
597
- }
598
- for (const route of await discoverProgrammaticRoutePaths(source.root, source.srcDir)) {
599
- patterns.add(route);
600
- routeModulePatterns.add(route);
601
- }
602
- }
603
- for (const route of extraRoutes) {
604
- if (route.startsWith("/")) {
605
- patterns.add(route);
606
- routeModulePatterns.add(route);
607
- }
608
- }
609
- const sortedPatterns = Array.from(patterns).sort();
610
- const typeLiterals = Array.from(new Set(sortedPatterns.flatMap(routePatternToTsTypeLiterals)));
611
- const patternLiterals = sortedPatterns.map(routePatternToRouteLiteral);
612
- const routeModulePatternLiterals = Array.from(routeModulePatterns).sort().map(routePatternToRouteLiteral);
613
- const routePathType = suppressLintOnLink ? "string" : renderTypeUnion(typeLiterals);
614
- const routePatternType = suppressLintOnLink ? "string" : renderTypeUnion(patternLiterals);
615
- const routeModulePatternType = renderTypeUnion(routeModulePatternLiterals);
616
- const routeTypesImportPath = `./${path.basename(outPath).replace(/\.d\.ts$/, "")}`;
617
- const linkAugmentationBlock = suppressLintOnLink ? "" : `
618
- declare module "@farm.js/core/client" {
619
- interface LinkDefaultRoute {
620
- _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
621
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
622
- }
623
- }
624
-
625
- declare module "@farm.js/core" {
626
- interface LinkDefaultRoute {
627
- _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
628
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
629
- }
630
- // Ensure root import ("@farm.js/core") uses the same typed Link signature as client entry.
631
- const Link: typeof import("@farm.js/core/client").Link;
632
- }
633
-
634
- // Internal declaration path used by @farm.js/core root type re-exports.
635
- declare module "@farm.js/core/dist/client.js" {
636
- interface LinkDefaultRoute {
637
- _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
638
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
639
- }
640
- }
641
- `;
642
- const routeModuleAugmentationBlock = `
643
- declare global {
644
- namespace FarmJS {
645
- interface RouteRegistry {
646
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RouteModulePattern;
647
- }
648
- }
649
- }
650
- `;
651
- const content = `/**
652
- * Auto-generated route types from src/app.
653
- * Link href and route component props are typed automatically from generated declarations.
654
- * Regenerated on dev start and when routes change.
655
- * Set suppressLintOnLink: true in farm.config.ts to accept any string on Link href.
656
- */
657
- ${renderTypeAlias("RoutePath", routePathType)}
658
- ${renderTypeAlias("RoutePattern", routePatternType)}
659
- ${renderTypeAlias("RouteModulePattern", routeModulePatternType)}${linkAugmentationBlock}${routeModuleAugmentationBlock}
660
- `;
661
- return content;
662
- }
663
-
664
506
  // src/image-types.ts
665
- import { mkdirSync as mkdirSync2 } from "fs";
666
- import path2 from "path";
507
+ import { mkdirSync } from "fs";
508
+ import path from "path";
667
509
  var FARM_STATIC_IMAGE_EXTENSIONS = ["avif", "gif", "jpeg", "jpg", "png", "webp"];
668
510
  function generateFarmImageTypes(options) {
669
- const outputPath = options.outFile ? path2.resolve(options.root, options.outFile) : path2.join(options.root, options.srcDir || "src", "farm-images.d.ts");
670
- mkdirSync2(path2.dirname(outputPath), { recursive: true });
511
+ const outputPath = options.outFile ? path.resolve(options.root, options.outFile) : path.join(options.root, options.srcDir || "src", "farm-images.d.ts");
512
+ mkdirSync(path.dirname(outputPath), { recursive: true });
671
513
  writeFileIfChanged(outputPath, createFarmImageTypeDeclarations());
672
514
  return outputPath;
673
515
  }
@@ -693,14 +535,14 @@ declare module "*?url" {
693
535
  }
694
536
 
695
537
  // src/i18n/type-generator.ts
696
- import { mkdirSync as mkdirSync3 } from "fs";
697
- import { dirname as dirname2, join as join2, resolve as resolve2 } from "path";
538
+ import { mkdirSync as mkdirSync2 } from "fs";
539
+ import { dirname, join, resolve } from "path";
698
540
  async function generateFarmI18nTypes(options) {
699
541
  if (!options.config.enabled) return void 0;
700
542
  const { signatures } = await readFarmI18nCatalogs(options.config);
701
- const outFile = options.outFile ? resolve2(options.root, options.outFile) : join2(resolve2(options.root), options.srcDir || "src", "farm-i18n.d.ts");
543
+ const outFile = options.outFile ? resolve(options.root, options.outFile) : join(resolve(options.root), options.srcDir || "src", "farm-i18n.d.ts");
702
544
  const content = renderFarmI18nTypes(options.config.locales, signatures);
703
- mkdirSync3(dirname2(outFile), { recursive: true });
545
+ mkdirSync2(dirname(outFile), { recursive: true });
704
546
  writeFileIfChanged(outFile, content);
705
547
  return outFile;
706
548
  }
@@ -743,12 +585,12 @@ function argumentType(kind) {
743
585
  }
744
586
 
745
587
  // src/type-artifacts.ts
746
- import { existsSync as existsSync3, mkdirSync as mkdirSync4, readFileSync as readFileSync2, unlinkSync } from "fs";
747
- import { dirname as dirname4, isAbsolute as isAbsolute3, join as join4, resolve as resolve4 } from "path";
588
+ import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync2, unlinkSync } from "fs";
589
+ import { dirname as dirname3, isAbsolute as isAbsolute2, join as join3, resolve as resolve3 } from "path";
748
590
 
749
591
  // src/content-types.ts
750
- import * as fs2 from "fs";
751
- import * as path3 from "path";
592
+ import * as fs from "fs";
593
+ import * as path2 from "path";
752
594
  var CONFIG_FILENAMES = [
753
595
  "farm.config.ts",
754
596
  "farm.config.tsx",
@@ -768,10 +610,10 @@ var CONFIG_FILENAMES = [
768
610
  "config.cjs"
769
611
  ];
770
612
  function createContentTypeDeclarations(options, outPath) {
771
- const root = path3.resolve(options.root);
613
+ const root = path2.resolve(options.root);
772
614
  const projectConfig = findConfigPath(root, options.configPath);
773
615
  const configPaths = [
774
- ...(options.layerConfigPaths ?? []).filter((value) => fs2.existsSync(value)),
616
+ ...(options.layerConfigPaths ?? []).filter((value) => fs.existsSync(value)),
775
617
  ...projectConfig ? [projectConfig] : []
776
618
  ];
777
619
  if (configPaths.length === 0) return createEmptyContentTypes();
@@ -839,17 +681,17 @@ export {};
839
681
  }
840
682
  function findConfigPath(root, configPath) {
841
683
  if (configPath) {
842
- const resolvedPath = path3.isAbsolute(configPath) ? configPath : path3.join(root, configPath);
843
- return fs2.existsSync(resolvedPath) ? resolvedPath : null;
684
+ const resolvedPath = path2.isAbsolute(configPath) ? configPath : path2.join(root, configPath);
685
+ return fs.existsSync(resolvedPath) ? resolvedPath : null;
844
686
  }
845
687
  for (const filename of CONFIG_FILENAMES) {
846
- const resolvedPath = path3.join(root, filename);
847
- if (fs2.existsSync(resolvedPath)) return resolvedPath;
688
+ const resolvedPath = path2.join(root, filename);
689
+ if (fs.existsSync(resolvedPath)) return resolvedPath;
848
690
  }
849
691
  return null;
850
692
  }
851
693
  function toTypeImportPath(outPath, targetPath) {
852
- const relativePath = path3.relative(path3.dirname(outPath), targetPath).replace(/\\/g, "/").replace(/\.(tsx?|jsx?|mjs|cjs|mts|cts)$/, "");
694
+ const relativePath = path2.relative(path2.dirname(outPath), targetPath).replace(/\\/g, "/").replace(/\.(tsx?|jsx?|mjs|cjs|mts|cts)$/, "");
853
695
  return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
854
696
  }
855
697
 
@@ -925,7 +767,7 @@ function propertyName(key) {
925
767
 
926
768
  // src/type-artifacts.ts
927
769
  async function generateFarmTypeArtifacts(options) {
928
- const root = resolve4(options.root);
770
+ const root = resolve3(options.root);
929
771
  const srcDir = options.srcDir || "src";
930
772
  const shouldGenerateRoutes = options.routes !== false;
931
773
  const shouldGenerateApi = options.api !== false;
@@ -938,7 +780,7 @@ async function generateFarmTypeArtifacts(options) {
938
780
  apiRoutes: [],
939
781
  stalePaths: []
940
782
  };
941
- const unifiedTypesPath = join4(root, srcDir, "farm.d.ts");
783
+ const unifiedTypesPath = join3(root, srcDir, "farm.d.ts");
942
784
  const shouldRefreshUnifiedTypes = shouldGenerateRoutes && !options.routeTypesOutFile || shouldGenerateEnv && !options.envTypesOutFile || shouldGenerateI18n && !options.i18nTypesOutFile;
943
785
  const unifiedSections = [];
944
786
  if (shouldRefreshUnifiedTypes && !options.routeTypesOutFile) {
@@ -974,11 +816,11 @@ async function generateFarmTypeArtifacts(options) {
974
816
  if (shouldGenerateApi) {
975
817
  const generator = new APITypeGenerator(appDirs);
976
818
  const apiRoutes = generator.scanAPIRoutes();
977
- const apiTypesPath = options.apiTypesOutFile ? resolve4(root, options.apiTypesOutFile) : join4(root, srcDir, "lib", "api.generated.ts");
819
+ const apiTypesPath = options.apiTypesOutFile ? resolve3(root, options.apiTypesOutFile) : join3(root, srcDir, "lib", "api.generated.ts");
978
820
  const pluginRoutes = resolvePluginRoutes(options.plugins);
979
821
  const configFiles = [
980
822
  ...(options.layers ?? []).map((layer) => layer.configFile).filter((file) => Boolean(file)),
981
- options.configPath ? resolve4(root, options.configPath) : [
823
+ options.configPath ? resolve3(root, options.configPath) : [
982
824
  "farm.config.ts",
983
825
  "farm.config.mts",
984
826
  "farm.config.js",
@@ -987,14 +829,14 @@ async function generateFarmTypeArtifacts(options) {
987
829
  "farm.config.cjs",
988
830
  "config.ts",
989
831
  "config.js"
990
- ].map((name) => join4(root, name)).find((file) => existsSync3(file))
832
+ ].map((name) => join3(root, name)).find((file) => existsSync2(file))
991
833
  ].filter((file) => Boolean(file));
992
834
  if (pluginRoutes.length && !configFiles.length) {
993
835
  throw new Error(
994
836
  "Cannot generate plugin API types without a Farm config file. Pass configPath."
995
837
  );
996
838
  }
997
- if (apiRoutes.length > 0 || pluginRoutes.length > 0 || existsSync3(apiTypesPath)) {
839
+ if (apiRoutes.length > 0 || pluginRoutes.length > 0 || existsSync2(apiTypesPath)) {
998
840
  const content = generator.generateAPIRouter(apiRoutes, {
999
841
  outFile: apiTypesPath,
1000
842
  pluginConfigs: pluginRoutes.length ? [...new Set(configFiles)] : [],
@@ -1119,19 +961,19 @@ function normalizeUnifiedTypeSection(section) {
1119
961
  return section.trimEnd().replace(/\n+export \{\};$/, "");
1120
962
  }
1121
963
  function resolveGeneratedPath(root, srcDir, outFile, relativeToSrc = true) {
1122
- if (isAbsolute3(outFile)) return resolve4(outFile);
1123
- return resolve4(root, relativeToSrc ? join4(srcDir, outFile) : outFile);
964
+ if (isAbsolute2(outFile)) return resolve3(outFile);
965
+ return resolve3(root, relativeToSrc ? join3(srcDir, outFile) : outFile);
1124
966
  }
1125
967
  function writeOrCheckGeneratedFile(filePath, content, check, stalePaths) {
1126
968
  if (check) {
1127
969
  checkGeneratedFile(filePath, content, stalePaths);
1128
970
  return;
1129
971
  }
1130
- mkdirSync4(dirname4(filePath), { recursive: true });
972
+ mkdirSync3(dirname3(filePath), { recursive: true });
1131
973
  writeFileIfChanged(filePath, content);
1132
974
  }
1133
975
  function checkGeneratedFile(filePath, content, stalePaths) {
1134
- if (!existsSync3(filePath) || readFileSync2(filePath, "utf8") !== content) {
976
+ if (!existsSync2(filePath) || readFileSync2(filePath, "utf8") !== content) {
1135
977
  stalePaths.push(filePath);
1136
978
  }
1137
979
  }
@@ -1143,8 +985,8 @@ var LEGACY_TYPE_ARTIFACTS = [
1143
985
  ];
1144
986
  function removeLegacyTypeArtifacts(root, srcDir) {
1145
987
  for (const [fileName, marker] of LEGACY_TYPE_ARTIFACTS) {
1146
- const filePath = join4(root, srcDir, fileName);
1147
- if (!existsSync3(filePath)) continue;
988
+ const filePath = join3(root, srcDir, fileName);
989
+ if (!existsSync2(filePath)) continue;
1148
990
  const source = readFileSync2(filePath, "utf8");
1149
991
  if (source.includes(marker)) {
1150
992
  unlinkSync(filePath);
@@ -1153,8 +995,8 @@ function removeLegacyTypeArtifacts(root, srcDir) {
1153
995
  }
1154
996
  function collectLegacyTypeArtifacts(root, srcDir, stalePaths) {
1155
997
  for (const [fileName, marker] of LEGACY_TYPE_ARTIFACTS) {
1156
- const filePath = join4(root, srcDir, fileName);
1157
- if (!existsSync3(filePath)) continue;
998
+ const filePath = join3(root, srcDir, fileName);
999
+ if (!existsSync2(filePath)) continue;
1158
1000
  if (readFileSync2(filePath, "utf8").includes(marker)) stalePaths.push(filePath);
1159
1001
  }
1160
1002
  }
@@ -1173,7 +1015,6 @@ export {
1173
1015
  hasPPR,
1174
1016
  generateSSGManifest,
1175
1017
  matchSSGPage,
1176
- generateRouteTypes,
1177
1018
  generateFarmImageTypes,
1178
1019
  createFarmImageTypeDeclarations,
1179
1020
  generateFarmI18nTypes,
@@ -0,0 +1,12 @@
1
+ // src/islands-action-protocol.ts
2
+ var FARM_ACTION_RESULT_KEY = "__farmAction";
3
+ function isFarmIslandsActionResult(value) {
4
+ if (!value || typeof value !== "object") return false;
5
+ const meta = value[FARM_ACTION_RESULT_KEY];
6
+ return !!meta && typeof meta === "object" && Array.isArray(meta.invalidations);
7
+ }
8
+
9
+ export {
10
+ FARM_ACTION_RESULT_KEY,
11
+ isFarmIslandsActionResult
12
+ };
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-YP7YO3S3.mjs";
8
8
  import {
9
9
  toPosixPath
10
- } from "./chunk-2SVJGOAX.mjs";
10
+ } from "./chunk-Y3N5BFRJ.mjs";
11
11
 
12
12
  // src/cron.ts
13
13
  var DEFAULT_FARM_CRON_SECRET_ENV = "CRON_SECRET";
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
2
- var version = "0.1.49";
2
+ var version = "0.1.51-beta.0";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -7,15 +7,15 @@ var _chunk2KMIJDY6cjs = require('./chunk-2KMIJDY6.cjs');
7
7
  var _chunkSHIWRBFIcjs = require('./chunk-SHIWRBFI.cjs');
8
8
 
9
9
 
10
- var _chunkXN2MB4QZcjs = require('./chunk-XN2MB4QZ.cjs');
10
+ var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
11
11
 
12
12
 
13
- var _chunkJHXJBNLYcjs = require('./chunk-JHXJBNLY.cjs');
13
+ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
14
14
 
15
15
 
16
16
 
17
17
 
18
- var _chunk5566GNEGcjs = require('./chunk-5566GNEG.cjs');
18
+ var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
19
19
 
20
20
 
21
21
  var _chunk6XQSPIN6cjs = require('./chunk-6XQSPIN6.cjs');
@@ -128,10 +128,10 @@ function createFarmWorkflowRequestHandler(options) {
128
128
  try {
129
129
  payload = await readWorkflowPayload(
130
130
  request,
131
- _chunk5566GNEGcjs.resolveFarmServerConfig.call(void 0, options.server).bodySizeLimit
131
+ _chunkLIFUPCXWcjs.resolveFarmServerConfig.call(void 0, options.server).bodySizeLimit
132
132
  );
133
133
  } catch (error) {
134
- const response = _chunk5566GNEGcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
134
+ const response = _chunkLIFUPCXWcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
135
135
  if (response) return response;
136
136
  if (error instanceof SyntaxError) {
137
137
  return Response.json({ error: "Invalid workflow request body." }, { status: 400 });
@@ -195,7 +195,7 @@ async function prepareFarmWorkflowsForNitro(config) {
195
195
  const scheduledTasks = createScheduledTasks(workflows);
196
196
  const wrapperNames = resolveWorkflowWrapperFileNames(workflows.map((workflow) => workflow.id));
197
197
  for (const workflow of workflows) {
198
- const wrapperPath = _chunkXN2MB4QZcjs.toPosixPath.call(void 0,
198
+ const wrapperPath = _chunkVQJYGZNXcjs.toPosixPath.call(void 0,
199
199
  path.join(generatedDir, `${wrapperNames.get(workflow.id)}.mjs`)
200
200
  );
201
201
  await fs.writeFile(wrapperPath, createNitroTaskWrapper(workflow), "utf8");
@@ -204,13 +204,13 @@ async function prepareFarmWorkflowsForNitro(config) {
204
204
  description: workflow.description || `Farm workflow ${workflow.id}`
205
205
  };
206
206
  }
207
- const handlerPath = _chunkXN2MB4QZcjs.toPosixPath.call(void 0, path.join(generatedDir, "http-handler.mjs"));
207
+ const handlerPath = _chunkVQJYGZNXcjs.toPosixPath.call(void 0, path.join(generatedDir, "http-handler.mjs"));
208
208
  await fs.writeFile(
209
209
  handlerPath,
210
210
  createNitroWorkflowHTTPHandler(
211
211
  workflowConfig,
212
212
  workflows,
213
- _chunk5566GNEGcjs.resolveFarmServerConfig.call(void 0, config.server)
213
+ _chunkLIFUPCXWcjs.resolveFarmServerConfig.call(void 0, config.server)
214
214
  ),
215
215
  "utf8"
216
216
  );
@@ -559,9 +559,9 @@ function toWorkflowMetadata(workflow) {
559
559
  async function readWorkflowPayload(request, bodySizeLimit) {
560
560
  const url = new URL(request.url);
561
561
  if (request.method === "GET" || request.method === "HEAD") {
562
- return _chunkJHXJBNLYcjs.searchParamsToObject.call(void 0, url.searchParams);
562
+ return _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
563
563
  }
564
- const bytes = await _chunk5566GNEGcjs.readFarmRequestBody.call(void 0, request, bodySizeLimit);
564
+ const bytes = await _chunkLIFUPCXWcjs.readFarmRequestBody.call(void 0, request, bodySizeLimit);
565
565
  const text = new TextDecoder().decode(bytes);
566
566
  if (!text) return {};
567
567
  const contentType = (request.headers.get("content-type") || "").split(";", 1)[0].trim().toLowerCase();
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3HBFI373cjs = require('./chunk-3HBFI373.cjs');
3
+ var _chunkS5AQ7CACcjs = require('./chunk-S5AQ7CAC.cjs');
4
4
 
5
5
 
6
- var _chunkHELQXYVIcjs = require('./chunk-HELQXYVI.cjs');
6
+ var _chunkI2DQGS56cjs = require('./chunk-I2DQGS56.cjs');
7
7
 
8
8
 
9
9
  var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
10
10
 
11
11
  // src/navigation.ts
12
12
  function useRouter2() {
13
- const router = _chunk3HBFI373cjs.useRouter.call(void 0, );
13
+ const router = _chunkS5AQ7CACcjs.useRouter.call(void 0, );
14
14
  return {
15
15
  push: router.push,
16
16
  replace: router.replace,
@@ -18,19 +18,19 @@ function useRouter2() {
18
18
  forward: router.forward,
19
19
  refresh() {
20
20
  if (typeof window === "undefined") return Promise.resolve();
21
- return _chunkHELQXYVIcjs.getRouter.call(void 0, ).refresh();
21
+ return _chunkI2DQGS56cjs.getRouter.call(void 0, ).refresh();
22
22
  },
23
23
  prefetch(href) {
24
24
  if (typeof window === "undefined") return Promise.resolve();
25
- return _chunkHELQXYVIcjs.getRouter.call(void 0, ).prefetch(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href));
25
+ return _chunkI2DQGS56cjs.getRouter.call(void 0, ).prefetch(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href));
26
26
  }
27
27
  };
28
28
  }
29
29
  function usePathname() {
30
- return _chunk3HBFI373cjs.useRouter.call(void 0, ).pathname;
30
+ return _chunkS5AQ7CACcjs.useRouter.call(void 0, ).pathname;
31
31
  }
32
32
  function useSearchParams() {
33
- return _chunk3HBFI373cjs.useRouter.call(void 0, ).searchParams;
33
+ return _chunkS5AQ7CACcjs.useRouter.call(void 0, ).searchParams;
34
34
  }
35
35
 
36
36
 
@@ -9,20 +9,6 @@ import {
9
9
  createFarmCacheKey
10
10
  } from "./chunk-GLOICKDO.mjs";
11
11
 
12
- // src/client-revalidation.ts
13
- function attachRevalidationListeners(refresh, options = {}) {
14
- if (typeof window === "undefined") return () => {
15
- };
16
- const onFocus = options.refetchOnWindowFocus === false ? void 0 : refresh;
17
- const onOnline = options.refetchOnReconnect === false ? void 0 : refresh;
18
- if (onFocus) window.addEventListener("focus", onFocus);
19
- if (onOnline) window.addEventListener("online", onOnline);
20
- return () => {
21
- if (onFocus) window.removeEventListener("focus", onFocus);
22
- if (onOnline) window.removeEventListener("online", onOnline);
23
- };
24
- }
25
-
26
12
  // src/server-query-runtime.ts
27
13
  var FARM_SERVER_QUERY_CLIENT_STATE = /* @__PURE__ */ Symbol.for("farm.serverQueryClientState");
28
14
  var serverQueryClientGlobal = globalThis;
@@ -228,7 +214,6 @@ function normalizeServerQueryError(cause) {
228
214
  }
229
215
 
230
216
  export {
231
- attachRevalidationListeners,
232
217
  isFarmServerQueryBrowserRuntime,
233
218
  beginFarmServerQueryAction,
234
219
  completeFarmServerQueryAction,
@@ -0,0 +1,55 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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
+
3
+ var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
4
+
5
+ // src/server/dev-loopback.ts
6
+ var _net = require('net'); var _net2 = _interopRequireDefault(_net);
7
+ var OTHER_LOOPBACK = { "::1": "127.0.0.1", "127.0.0.1": "::1" };
8
+ function createFarmDevLoopbackPlugin() {
9
+ return {
10
+ name: "farm:dev-loopback",
11
+ configureServer(server) {
12
+ const listen = server.listen.bind(server);
13
+ server.listen = async (...args) => {
14
+ const result = await listen(...args);
15
+ await listenOnOtherLoopback(server);
16
+ return result;
17
+ };
18
+ }
19
+ };
20
+ }
21
+ async function listenOnOtherLoopback(server) {
22
+ const host = server.config.server.host;
23
+ if (host !== void 0 && host !== false && host !== "localhost") return;
24
+ const httpServer = server.httpServer;
25
+ const address = _optionalChain([httpServer, 'optionalAccess', _ => _.address, 'call', _2 => _2()]);
26
+ if (!httpServer || !address || typeof address !== "object") return;
27
+ const other = OTHER_LOOPBACK[address.address];
28
+ if (!other) return;
29
+ const loopback = _net2.default.createServer((socket) => httpServer.emit("connection", socket));
30
+ const listening = await new Promise((resolve) => {
31
+ const onError = (error) => {
32
+ if (error.code === "EADDRINUSE") {
33
+ _chunkVQJYGZNXcjs.logger.warn(
34
+ `Another process is listening on ${formatHost(other)}:${address.port}; the dev server answers on ${formatHost(address.address)}:${address.port} only.`
35
+ );
36
+ }
37
+ resolve(false);
38
+ };
39
+ loopback.once("error", onError);
40
+ loopback.listen({ port: address.port, host: other, ipv6Only: other === "::1" }, () => {
41
+ loopback.off("error", onError);
42
+ resolve(true);
43
+ });
44
+ });
45
+ if (!listening) return;
46
+ loopback.on("error", (error) => _chunkVQJYGZNXcjs.logger.warn(`Dev loopback listener failed: ${String(error)}`));
47
+ httpServer.once("close", () => loopback.close());
48
+ }
49
+ function formatHost(address) {
50
+ return address.includes(":") ? `[${address}]` : address;
51
+ }
52
+
53
+
54
+
55
+ exports.createFarmDevLoopbackPlugin = createFarmDevLoopbackPlugin;