@farm.js/core 0.1.49 → 0.1.50

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 (310) hide show
  1. package/dist/{agent-mcp-Bb8hnnqd.d.ts → agent-mcp-9BMbRgg_.d.ts} +1 -1
  2. package/dist/{agent-mcp-ir3v4fHf.d.mts → agent-mcp-CIMH324y.d.mts} +1 -1
  3. package/dist/agent-runtime.cjs +3 -3
  4. package/dist/agent-runtime.d.mts +6 -6
  5. package/dist/agent-runtime.d.ts +6 -6
  6. package/dist/agent-runtime.mjs +2 -2
  7. package/dist/analyzer-CN7C74WX.cjs +1066 -0
  8. package/dist/analyzer-DDW34OMC.mjs +1066 -0
  9. package/dist/api/client.d.mts +0 -1
  10. package/dist/api/client.d.ts +0 -1
  11. package/dist/api/route-manager.cjs +5 -5
  12. package/dist/api/route-manager.d.mts +10 -10
  13. package/dist/api/route-manager.d.ts +10 -10
  14. package/dist/api/route-manager.mjs +4 -4
  15. package/dist/api/runtime.cjs +3 -3
  16. package/dist/api/runtime.d.mts +7 -7
  17. package/dist/api/runtime.d.ts +7 -7
  18. package/dist/api/runtime.mjs +2 -2
  19. package/dist/api.cjs +6 -6
  20. package/dist/api.d.mts +10 -10
  21. package/dist/api.d.ts +10 -10
  22. package/dist/api.mjs +5 -5
  23. package/dist/{app-y649szYm.d.ts → app-BWibTHVT.d.ts} +7 -7
  24. package/dist/{app-DLzz02du.d.mts → app-DVJ13FPA.d.mts} +7 -7
  25. package/dist/{app-manifest-Crn8Qd3U.d.mts → app-manifest-CQDJOKL2.d.mts} +1 -1
  26. package/dist/{app-manifest-DNeTKMRL.d.ts → app-manifest-D0kaXdwu.d.ts} +1 -1
  27. package/dist/app-markdown.d.mts +7 -7
  28. package/dist/app-markdown.d.ts +7 -7
  29. package/dist/cache.d.mts +4 -3
  30. package/dist/cache.d.ts +4 -3
  31. package/dist/{chunk-VJXLUTBM.mjs → chunk-2DEPNLXK.mjs} +7 -7
  32. package/dist/chunk-2G63BIRL.mjs +227 -0
  33. package/dist/chunk-2GLQSIZD.mjs +55 -0
  34. package/dist/{chunk-ACI52TCN.mjs → chunk-2VCC3GVC.mjs} +1 -1
  35. package/dist/chunk-3ATXWZPH.cjs +227 -0
  36. package/dist/{chunk-C5S457CK.cjs → chunk-474FO3UE.cjs} +68 -54
  37. package/dist/{chunk-QNQEK3OF.cjs → chunk-4T25YCZ5.cjs} +14 -14
  38. package/dist/{chunk-ATHPRVP2.mjs → chunk-5V4KZOZO.mjs} +1 -1
  39. package/dist/{chunk-FGJQS4EC.cjs → chunk-6QA2SXVH.cjs} +2 -2
  40. package/dist/{chunk-XLYXG73A.mjs → chunk-75WWOZ5C.mjs} +22 -0
  41. package/dist/{chunk-QFQDRJKJ.mjs → chunk-76R5GJER.mjs} +2 -2
  42. package/dist/{chunk-NG44F7AH.mjs → chunk-7ONZDKVY.mjs} +2 -2
  43. package/dist/{chunk-4IICUBQX.cjs → chunk-A5BJKSZE.cjs} +2 -2
  44. package/dist/{chunk-TTYXOAB7.mjs → chunk-ANHZ6SUL.mjs} +1 -1
  45. package/dist/{chunk-ZBS3GOQZ.cjs → chunk-AQLHD6HZ.cjs} +35 -61
  46. package/dist/{chunk-4HM5B5RR.cjs → chunk-B5S2JS6M.cjs} +117 -115
  47. package/dist/{chunk-AXRNEVCS.cjs → chunk-B6PREBN6.cjs} +8 -8
  48. package/dist/{chunk-JOHXK4BB.mjs → chunk-BW6SCVYX.mjs} +1 -1
  49. package/dist/{chunk-LZBM35DH.mjs → chunk-C73RIAEF.mjs} +4 -4
  50. package/dist/chunk-CGCJ2TJU.cjs +55 -0
  51. package/dist/{chunk-UYQOIPXE.mjs → chunk-CPXDDWGL.mjs} +1 -1
  52. package/dist/{chunk-JPAVNDZH.cjs → chunk-CY7H5KS4.cjs} +25 -25
  53. package/dist/{chunk-4S7M63WX.cjs → chunk-DGOLAZLV.cjs} +22 -1
  54. package/dist/{chunk-73XBJRZW.cjs → chunk-E2BMCNMJ.cjs} +2 -2
  55. package/dist/{chunk-FR4HJDI6.cjs → chunk-F5LERVY3.cjs} +21 -24
  56. package/dist/{chunk-A7DK663W.cjs → chunk-FACTMUPI.cjs} +27 -27
  57. package/dist/chunk-G2KTRMWA.mjs +40 -0
  58. package/dist/{chunk-C6U66WWF.mjs → chunk-GFT5AHAT.mjs} +13 -0
  59. package/dist/{chunk-NPPT4RWF.cjs → chunk-GOOK2J2W.cjs} +7 -7
  60. package/dist/{chunk-NW2BKDVT.mjs → chunk-HHFMECFO.mjs} +1 -1
  61. package/dist/{chunk-J27BZO67.mjs → chunk-HWCHIBJZ.mjs} +21 -24
  62. package/dist/{chunk-HTLCLOXQ.cjs → chunk-HYN3LLG7.cjs} +3 -3
  63. package/dist/{chunk-HELQXYVI.cjs → chunk-I2DQGS56.cjs} +11 -9
  64. package/dist/{chunk-SSNN55Q6.cjs → chunk-IQXGHGZF.cjs} +5 -5
  65. package/dist/{chunk-ZSIGEHSE.cjs → chunk-IUBDMDZZ.cjs} +21 -180
  66. package/dist/{chunk-Z3BXMMFF.mjs → chunk-IWJKJDNW.mjs} +38 -24
  67. package/dist/{chunk-DGVVVYKD.mjs → chunk-JJOWY3XD.mjs} +2 -2
  68. package/dist/{chunk-6XFGJBYX.cjs → chunk-JYNNIGQO.cjs} +16 -7
  69. package/dist/{chunk-XO6WL6NL.mjs → chunk-KGP76FSV.mjs} +1 -1
  70. package/dist/{chunk-GXSMF7UR.mjs → chunk-KO2NWUKN.mjs} +1 -1
  71. package/dist/{chunk-AIHD6VME.cjs → chunk-KZH6YLND.cjs} +154 -126
  72. package/dist/{chunk-5566GNEG.cjs → chunk-LIFUPCXW.cjs} +13 -0
  73. package/dist/{chunk-I2SWKWO7.mjs → chunk-LJDIFIJ2.mjs} +1 -1
  74. package/dist/{chunk-KZT2VHRQ.cjs → chunk-LYWAGXXW.cjs} +11 -11
  75. package/dist/{chunk-RYDDUCNJ.mjs → chunk-M7LKA632.mjs} +1 -1
  76. package/dist/{chunk-6LH33DLL.cjs → chunk-NJVFPJ2Y.cjs} +2 -2
  77. package/dist/{chunk-JWP56HCP.mjs → chunk-OD6WM3I7.mjs} +2 -2
  78. package/dist/{chunk-MJ6IC4K2.mjs → chunk-OTOOJIUB.mjs} +1 -1
  79. package/dist/{chunk-R2SEZEBC.cjs → chunk-OYNNA4DD.cjs} +4 -4
  80. package/dist/{chunk-GBPDSUFE.mjs → chunk-OZK2DS44.mjs} +1 -1
  81. package/dist/chunk-QXJADAQB.cjs +40 -0
  82. package/dist/{chunk-J5VCA45K.cjs → chunk-RHOR2J6V.cjs} +1 -1
  83. package/dist/{chunk-YQGZLCT4.cjs → chunk-RWT2BTJT.cjs} +6 -6
  84. package/dist/{chunk-3HBFI373.cjs → chunk-S5AQ7CAC.cjs} +14 -14
  85. package/dist/{chunk-HNAUK3SC.mjs → chunk-SHJJM6OG.mjs} +40 -199
  86. package/dist/{chunk-LL7TDMOM.mjs → chunk-SMUW7UST.mjs} +33 -59
  87. package/dist/{chunk-VCFBQFOV.mjs → chunk-SN5VSO3Q.mjs} +9 -7
  88. package/dist/{chunk-DM3TFCC2.cjs → chunk-SUV6YO4Q.cjs} +5 -5
  89. package/dist/{chunk-JUMPFVMK.mjs → chunk-TUOO6IK3.mjs} +9 -0
  90. package/dist/chunk-UB7RVEMX.mjs +73 -0
  91. package/dist/{chunk-CDTIXBKN.mjs → chunk-UN6N623E.mjs} +2 -2
  92. package/dist/{chunk-BEXYFR2R.cjs → chunk-UY6HS5PF.cjs} +2 -2
  93. package/dist/{chunk-HAH4FBTA.mjs → chunk-VAHBCI6X.mjs} +1 -1
  94. package/dist/{chunk-N25RPPO5.cjs → chunk-WAPQWAE6.cjs} +10 -10
  95. package/dist/{chunk-Z4LTSH7D.mjs → chunk-WVBUXNBX.mjs} +71 -43
  96. package/dist/{chunk-ALD2WMLA.mjs → chunk-WXHDVXJE.mjs} +2 -2
  97. package/dist/{chunk-EVCQX243.cjs → chunk-X2EL3BLH.cjs} +2 -2
  98. package/dist/{chunk-EA5PMJDU.mjs → chunk-X3HOVNHI.mjs} +1 -1
  99. package/dist/{chunk-XXB37YET.cjs → chunk-XLRLSTJ6.cjs} +7 -7
  100. package/dist/{chunk-DRFADSKY.mjs → chunk-XXXRRVY6.mjs} +4 -4
  101. package/dist/{chunk-EXHEPWFJ.cjs → chunk-YAXOEAND.cjs} +10 -10
  102. package/dist/{chunk-PEHL3IZL.cjs → chunk-YB44NKC2.cjs} +2 -2
  103. package/dist/chunk-YKHRCY4T.cjs +73 -0
  104. package/dist/{chunk-IVHPRF4W.mjs → chunk-ZLOQQ2UF.mjs} +32 -30
  105. package/dist/client/lifecycle.d.mts +1 -1
  106. package/dist/client/lifecycle.d.ts +1 -1
  107. package/dist/{client-plugins-DFDQUI9Q.d.ts → client-plugins-BPfltM5m.d.ts} +15 -8
  108. package/dist/{client-plugins-BNBeyLMi.d.mts → client-plugins-D4RO59f0.d.mts} +15 -8
  109. package/dist/client-plugins.d.mts +6 -6
  110. package/dist/client-plugins.d.ts +6 -6
  111. package/dist/client.cjs +11 -8
  112. package/dist/client.d.mts +11 -10
  113. package/dist/client.d.ts +11 -10
  114. package/dist/client.mjs +12 -9
  115. package/dist/client.react-server.mjs +1 -1
  116. package/dist/config-CnhyvvmT.d.mts +188 -0
  117. package/dist/config-CnhyvvmT.d.ts +188 -0
  118. package/dist/config.d.mts +6 -6
  119. package/dist/config.d.ts +6 -6
  120. package/dist/desktop.d.mts +7 -7
  121. package/dist/desktop.d.ts +7 -7
  122. package/dist/{dev-guard-YO6KPIOQ.mjs → dev-guard-4PFQNXQX.mjs} +2 -1
  123. package/dist/{dev-guard-PLHL6OTJ.cjs → dev-guard-YLO5DE3H.cjs} +4 -3
  124. package/dist/{devtools-A37WWJZL.cjs → devtools-N5XTOECL.cjs} +8 -8
  125. package/dist/{devtools-BLKHPY3C.mjs → devtools-STG7HPRV.mjs} +7 -7
  126. package/dist/docs.cjs +10 -10
  127. package/dist/docs.d.mts +7 -7
  128. package/dist/docs.d.ts +7 -7
  129. package/dist/docs.mjs +9 -9
  130. package/dist/environment/vite.d.mts +1 -1
  131. package/dist/environment/vite.d.ts +1 -1
  132. package/dist/generate-route-types-DQP0cUzk.d.ts +33 -0
  133. package/dist/generate-route-types-TF5Wwtvz.d.mts +33 -0
  134. package/dist/i18n/client.d.mts +2 -2
  135. package/dist/i18n/client.d.ts +2 -2
  136. package/dist/i18n/index.d.mts +3 -3
  137. package/dist/i18n/index.d.ts +3 -3
  138. package/dist/i18n/server.d.mts +5 -5
  139. package/dist/i18n/server.d.ts +5 -5
  140. package/dist/image/server.cjs +3 -3
  141. package/dist/image/server.mjs +2 -2
  142. package/dist/image/sharp.cjs +10 -10
  143. package/dist/image/sharp.mjs +2 -2
  144. package/dist/{index-CeJ9_s9p.d.mts → index-C-N3Pwg-.d.ts} +2 -2
  145. package/dist/{index-MocnSP3a.d.ts → index-D3l4tREW.d.ts} +2 -2
  146. package/dist/{index-Cl3akY5U.d.mts → index-DPUAPho_.d.mts} +2 -2
  147. package/dist/{index-DBdiTkNc.d.ts → index-k8o8eUOd.d.mts} +2 -2
  148. package/dist/index.cjs +72 -65
  149. package/dist/index.d.mts +29 -45
  150. package/dist/index.d.ts +29 -45
  151. package/dist/index.mjs +77 -70
  152. package/dist/integrations.cjs +3 -3
  153. package/dist/integrations.d.mts +6 -6
  154. package/dist/integrations.d.ts +6 -6
  155. package/dist/integrations.mjs +2 -2
  156. package/dist/internal/app-markdown-runtime.d.mts +7 -7
  157. package/dist/internal/app-markdown-runtime.d.ts +7 -7
  158. package/dist/internal/build-runtime.cjs +35 -32
  159. package/dist/internal/build-runtime.d.mts +9 -9
  160. package/dist/internal/build-runtime.d.ts +9 -9
  161. package/dist/internal/build-runtime.mjs +34 -31
  162. package/dist/internal/cli-runtime.cjs +16 -15
  163. package/dist/internal/cli-runtime.mjs +16 -15
  164. package/dist/internal/client-error-overlay.cjs +4 -4
  165. package/dist/internal/client-error-overlay.mjs +1 -1
  166. package/dist/internal/client-runtime.cjs +19 -2
  167. package/dist/internal/client-runtime.d.mts +45 -3
  168. package/dist/internal/client-runtime.d.ts +45 -3
  169. package/dist/internal/client-runtime.mjs +19 -2
  170. package/dist/internal/compression-runtime.d.mts +6 -6
  171. package/dist/internal/compression-runtime.d.ts +6 -6
  172. package/dist/internal/config-runtime.cjs +17 -10
  173. package/dist/internal/config-runtime.d.mts +259 -18
  174. package/dist/internal/config-runtime.d.ts +259 -18
  175. package/dist/internal/config-runtime.mjs +15 -8
  176. package/dist/internal/form-actions.cjs +4 -4
  177. package/dist/internal/form-actions.mjs +3 -3
  178. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  179. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  180. package/dist/internal/metadata-image-runtime.cjs +3 -3
  181. package/dist/internal/metadata-image-runtime.mjs +2 -2
  182. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  183. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  184. package/dist/internal/production-runtime.cjs +12 -12
  185. package/dist/internal/production-runtime.d.mts +19 -19
  186. package/dist/internal/production-runtime.d.ts +19 -19
  187. package/dist/internal/production-runtime.mjs +14 -14
  188. package/dist/{layers-D9fbe-rz.d.ts → layers-CcS42OGR.d.mts} +1 -1
  189. package/dist/{layers-D9fbe-rz.d.mts → layers-CcS42OGR.d.ts} +1 -1
  190. package/dist/{lifecycle-DK06VuKP.d.ts → lifecycle-C2aLBOwu.d.mts} +1 -1
  191. package/dist/{lifecycle-DK06VuKP.d.mts → lifecycle-C2aLBOwu.d.ts} +1 -1
  192. package/dist/markdown.d.mts +6 -6
  193. package/dist/markdown.d.ts +6 -6
  194. package/dist/middleware.cjs +7 -7
  195. package/dist/middleware.d.mts +8 -8
  196. package/dist/middleware.d.ts +8 -8
  197. package/dist/middleware.mjs +6 -6
  198. package/dist/mobile.cjs +9 -0
  199. package/dist/mobile.d.mts +67 -0
  200. package/dist/mobile.d.ts +67 -0
  201. package/dist/mobile.mjs +9 -0
  202. package/dist/navigation-delegate-8xg3Zvp4.d.ts +29 -0
  203. package/dist/navigation-delegate-ji6elCKy.d.mts +29 -0
  204. package/dist/navigation.cjs +5 -5
  205. package/dist/navigation.d.mts +9 -9
  206. package/dist/navigation.d.ts +9 -9
  207. package/dist/navigation.mjs +4 -4
  208. package/dist/{nitro-UT2J5A5D.mjs → nitro-2Q5NVY7L.mjs} +2 -2
  209. package/dist/{nitro-BIXIKJZS.cjs → nitro-YPSZBYDK.cjs} +3 -3
  210. package/dist/platform.cjs +2 -1
  211. package/dist/platform.d.mts +4 -3
  212. package/dist/platform.d.ts +4 -3
  213. package/dist/platform.mjs +2 -1
  214. package/dist/{plugin-4KYXV7BB.mjs → plugin-53SY5YBS.mjs} +1 -1
  215. package/dist/{plugin-WBANOZQM.cjs → plugin-HZIBL3DW.cjs} +2 -2
  216. package/dist/plugin.cjs +30 -28
  217. package/dist/plugin.d.mts +13 -8
  218. package/dist/plugin.d.ts +13 -8
  219. package/dist/plugin.mjs +29 -27
  220. package/dist/{production-runtime-DcD-GRAv.d.mts → production-runtime-DXnQQkQf.d.mts} +3 -3
  221. package/dist/{production-runtime-B3qFFtKF.d.ts → production-runtime-TdKaYRj0.d.ts} +3 -3
  222. package/dist/production-vite-BQFAlG7n.d.mts +13 -0
  223. package/dist/production-vite-BQFAlG7n.d.ts +13 -0
  224. package/dist/{programmatic-routes-client-fD9f4XqU.d.ts → programmatic-routes-client-BwiTndEC.d.ts} +2 -2
  225. package/dist/{programmatic-routes-client-DzbYGiZQ.d.mts → programmatic-routes-client-Dh1SDLSM.d.mts} +2 -2
  226. package/dist/query/client.cjs +6 -6
  227. package/dist/query/client.mjs +2 -2
  228. package/dist/{render-plan-B6cfssrr.d.ts → render-plan-BPbwRbuN.d.ts} +1 -1
  229. package/dist/{render-plan-DqJ51ufr.d.mts → render-plan-BvCGXF6K.d.mts} +1 -1
  230. package/dist/renderer-client.cjs +9 -6
  231. package/dist/renderer-client.d.mts +9 -8
  232. package/dist/renderer-client.d.ts +9 -8
  233. package/dist/renderer-client.mjs +6 -3
  234. package/dist/{request-jhvUMXRx.d.ts → request-B8PGTZNR.d.ts} +1 -1
  235. package/dist/{request-UuAxHn8h.d.mts → request-C_xTkJib.d.mts} +1 -1
  236. package/dist/request.d.mts +7 -7
  237. package/dist/request.d.ts +7 -7
  238. package/dist/{resolver-DC57A4vz.d.ts → resolver-CJ-D9nP-.d.ts} +1 -1
  239. package/dist/{resolver-C2G-3Tm6.d.mts → resolver-TDyZKgKI.d.mts} +1 -1
  240. package/dist/{route-rendering-Cou00t1X.d.mts → route-rendering-DlddURL1.d.mts} +1 -1
  241. package/dist/{route-rendering-Sn50cYZf.d.ts → route-rendering-RNtcj607.d.ts} +1 -1
  242. package/dist/{router-0X9DCTcm.d.mts → router-B97eB0Mq.d.mts} +1 -1
  243. package/dist/{router-xwLvi48p.d.ts → router-qUVaoEN8.d.ts} +1 -1
  244. package/dist/routes-8PT9cl60.d.ts +121 -0
  245. package/dist/routes-kEUsXHx3.d.mts +121 -0
  246. package/dist/routes.d.mts +6 -6
  247. package/dist/routes.d.ts +6 -6
  248. package/dist/{rsc-pipeline-VKHMABDJ.cjs → rsc-pipeline-L4XOZ2TE.cjs} +13 -11
  249. package/dist/{rsc-pipeline-F6ZPH5MU.mjs → rsc-pipeline-T3775JUA.mjs} +12 -10
  250. package/dist/runtime-BIBGJO7V.cjs +1005 -0
  251. package/dist/{runtime-B9HmxiZc.d.ts → runtime-C4CmlOOh.d.ts} +2 -2
  252. package/dist/{runtime-tkSXZiqO.d.ts → runtime-C8GUnNeP.d.ts} +1 -1
  253. package/dist/{runtime-CMrsyChI.d.mts → runtime-CaDswfWi.d.mts} +1 -1
  254. package/dist/{runtime-CCxTmGuf.d.mts → runtime-CihDZ2Rn.d.mts} +2 -2
  255. package/dist/runtime-HRSFC4ZC.mjs +1005 -0
  256. package/dist/{schema-dev-notice-O3I5HLXK.mjs → schema-dev-notice-LZ5NXGLN.mjs} +2 -2
  257. package/dist/{schema-dev-notice-Z73J3NJ6.cjs → schema-dev-notice-XV7GZ3QJ.cjs} +4 -4
  258. package/dist/server-action-security.cjs +3 -3
  259. package/dist/server-action-security.mjs +2 -2
  260. package/dist/server-fn-client.d.mts +0 -1
  261. package/dist/server-fn-client.d.ts +0 -1
  262. package/dist/server-fn.cjs +4 -4
  263. package/dist/server-fn.d.mts +0 -1
  264. package/dist/server-fn.d.ts +0 -1
  265. package/dist/server-fn.mjs +3 -3
  266. package/dist/server-plugins.cjs +1 -1
  267. package/dist/server-plugins.d.mts +7 -7
  268. package/dist/server-plugins.d.ts +7 -7
  269. package/dist/server-plugins.mjs +1 -1
  270. package/dist/server-query-client.d.mts +0 -1
  271. package/dist/server-query-client.d.ts +0 -1
  272. package/dist/server-query.cjs +5 -5
  273. package/dist/server-query.d.mts +0 -1
  274. package/dist/server-query.d.ts +0 -1
  275. package/dist/server-query.mjs +4 -4
  276. package/dist/server.cjs +88 -65
  277. package/dist/server.d.mts +22 -17
  278. package/dist/server.d.ts +22 -17
  279. package/dist/server.mjs +63 -40
  280. package/dist/{spa-router-B48EjsS1.d.mts → spa-router-Dlv5ofg0.d.mts} +4 -4
  281. package/dist/{spa-router-B06APnGK.d.ts → spa-router-qapSboKz.d.ts} +4 -4
  282. package/dist/testing.cjs +7 -7
  283. package/dist/testing.d.mts +6 -6
  284. package/dist/testing.d.ts +6 -6
  285. package/dist/testing.mjs +5 -5
  286. package/dist/{types--Wh02r5_.d.mts → types-C41ePjvP.d.mts} +1 -1
  287. package/dist/{types--Wh02r5_.d.ts → types-C41ePjvP.d.ts} +1 -1
  288. package/dist/{utils-C5fyK2tE.d.ts → utils-A-cYF81u.d.ts} +1 -1
  289. package/dist/{utils-hyAwmcN6.d.mts → utils-DyvlSxFk.d.mts} +1 -1
  290. package/dist/version.cjs +2 -2
  291. package/dist/version.mjs +1 -1
  292. package/dist/vite.cjs +30 -28
  293. package/dist/vite.d.mts +9 -9
  294. package/dist/vite.d.ts +9 -9
  295. package/dist/vite.mjs +29 -27
  296. package/dist/{workflows-Df1C_7OG.d.mts → workflows-CRMzQZ3k.d.mts} +2 -1
  297. package/dist/{workflows-Df1C_7OG.d.ts → workflows-CRMzQZ3k.d.ts} +2 -1
  298. package/dist/workflows.cjs +3 -3
  299. package/dist/workflows.d.mts +1 -1
  300. package/dist/workflows.d.ts +1 -1
  301. package/dist/workflows.mjs +2 -2
  302. package/package.json +10 -2
  303. package/dist/cache-invalidation-BD0z_lfu.d.mts +0 -4
  304. package/dist/cache-invalidation-BD0z_lfu.d.ts +0 -4
  305. package/dist/chunk-45EUIICW.mjs +0 -15
  306. package/dist/chunk-V7KTQR4C.cjs +0 -15
  307. package/dist/{chunk-BR5FSKZ5.cjs → chunk-EQWWOQTK.cjs} +0 -0
  308. package/dist/{chunk-5OJVKXFV.cjs → chunk-N7JQXQAV.cjs} +2 -2
  309. package/dist/{chunk-VR4SEDEM.mjs → chunk-VOZ5DI7D.mjs} +0 -0
  310. package/dist/{chunk-72KABRWN.mjs → chunk-WSDKXV4E.mjs} +4 -4
@@ -1,11 +1,10 @@
1
- import { g as FarmMdxComponents, h as FarmMdxResolvedConfig, i as RouteModule } from './client-plugins-DFDQUI9Q.js';
2
- export { j as FARM_MARKDOWN_CONTENT_TYPE, m as FarmMdxComponent, n as FarmMdxUserConfig, k as createFarmMarkdownErrorBody, l as farmRequestWantsMarkdown, r as resolveFarmMdxComponentsModulePath, o as resolveMdxConfig } from './client-plugins-DFDQUI9Q.js';
1
+ import { g as FarmMdxComponents, h as FarmMdxResolvedConfig, i as RouteModule } from './client-plugins-BPfltM5m.js';
2
+ export { j as FARM_MARKDOWN_CONTENT_TYPE, m as FarmMdxComponent, n as FarmMdxUserConfig, k as createFarmMarkdownErrorBody, l as farmRequestWantsMarkdown, r as resolveFarmMdxComponentsModulePath, o as resolveMdxConfig } from './client-plugins-BPfltM5m.js';
3
3
  export { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, FarmMarkdownPageModuleInput, FarmMarkdownPageSource, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, createMarkdownMetadata, isFarmMarkdownPageFile, isFarmMarkdownPublicSourceResponse, normalizeFarmMarkdownRoutePath, parseMarkdownFrontmatter, titleFromMarkdown } from './internal/app-markdown-runtime.js';
4
- import './lifecycle-DK06VuKP.js';
4
+ import './lifecycle-C2aLBOwu.js';
5
5
  import './route-DFhZj6jN.js';
6
6
  import './endpoint-BgHn0lhl.js';
7
7
  import './cache.js';
8
- import './cache-invalidation-BD0z_lfu.js';
9
8
  import './renderer.js';
10
9
  import './deployment.js';
11
10
  import 'http';
@@ -22,15 +21,16 @@ import '@farming-labs/docs';
22
21
  import './observability-B2363jB6.js';
23
22
  import '@opentelemetry/api';
24
23
  import 'vite';
25
- import './workflows-Df1C_7OG.js';
24
+ import './workflows-CRMzQZ3k.js';
26
25
  import './cron.js';
27
26
  import './env.js';
28
27
  import './server-action-security.js';
29
- import './layers-D9fbe-rz.js';
28
+ import './layers-CcS42OGR.js';
30
29
  import 'rolldown/utils';
31
30
  import 'rolldown';
32
31
  import './image-config-CeDgNyX4.js';
33
- import './types--Wh02r5_.js';
32
+ import './types-C41ePjvP.js';
33
+ import './config-CnhyvvmT.js';
34
34
  import './types-DQnyD3VD.js';
35
35
  import './font.js';
36
36
 
package/dist/cache.d.mts CHANGED
@@ -1,5 +1,3 @@
1
- export { a as applyFarmCacheInvalidations } from './cache-invalidation-BD0z_lfu.mjs';
2
-
3
1
  /**
4
2
  * Cache key serialization, kept free of server imports: browser code such as
5
3
  * the client data cache builds the same keys, and importing `./cache` would
@@ -9,6 +7,9 @@ type RouteDataCacheKey = string | readonly unknown[];
9
7
  declare function createRouteDataCacheKey(key: RouteDataCacheKey): string;
10
8
  declare function createFarmCacheKey(parts: readonly unknown[]): string;
11
9
 
10
+ type FarmCacheInvalidationSource = "local" | "broadcast" | "live";
11
+ declare function applyFarmCacheInvalidations(keys: unknown, source?: FarmCacheInvalidationSource): void;
12
+
12
13
  interface FarmCacheInvalidationStreamOptions {
13
14
  /** Stop the stream when the owning request is aborted. */
14
15
  signal?: AbortSignal;
@@ -329,4 +330,4 @@ declare function createPathCacheTag(routePath: string): string;
329
330
  declare function createRouteDataCacheTag(key: RouteDataCacheKey): string;
330
331
  declare function normalizeRevalidatePath(routePath: string): string;
331
332
 
332
- export { type CacheKeyFactory, type DefinedCacheKey, type FarmCacheAdapter, type FarmCacheEntry, type FarmCacheInvalidationStreamOptions, type FarmCacheInvalidationTarget, type FarmCacheOptions, type FarmCacheSetOptions, type FarmCacheStorage, type FarmCacheUserConfig, type FarmClientCacheUserConfig, FarmDataCache, type GetFarmCacheEntryOptions, type InferCacheKeyData, PPR_SHELL_ADAPTER_TTL_SECONDS, type RevalidateTagProfile, type RouteDataCacheKey, type StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, configureFarmCache, createFarmCacheInvalidationStream, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag };
333
+ export { type CacheKeyFactory, type DefinedCacheKey, type FarmCacheAdapter, type FarmCacheEntry, type FarmCacheInvalidationStreamOptions, type FarmCacheInvalidationTarget, type FarmCacheOptions, type FarmCacheSetOptions, type FarmCacheStorage, type FarmCacheUserConfig, type FarmClientCacheUserConfig, FarmDataCache, type GetFarmCacheEntryOptions, type InferCacheKeyData, PPR_SHELL_ADAPTER_TTL_SECONDS, type RevalidateTagProfile, type RouteDataCacheKey, type StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, applyFarmCacheInvalidations, configureFarmCache, createFarmCacheInvalidationStream, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag };
package/dist/cache.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export { a as applyFarmCacheInvalidations } from './cache-invalidation-BD0z_lfu.js';
2
-
3
1
  /**
4
2
  * Cache key serialization, kept free of server imports: browser code such as
5
3
  * the client data cache builds the same keys, and importing `./cache` would
@@ -9,6 +7,9 @@ type RouteDataCacheKey = string | readonly unknown[];
9
7
  declare function createRouteDataCacheKey(key: RouteDataCacheKey): string;
10
8
  declare function createFarmCacheKey(parts: readonly unknown[]): string;
11
9
 
10
+ type FarmCacheInvalidationSource = "local" | "broadcast" | "live";
11
+ declare function applyFarmCacheInvalidations(keys: unknown, source?: FarmCacheInvalidationSource): void;
12
+
12
13
  interface FarmCacheInvalidationStreamOptions {
13
14
  /** Stop the stream when the owning request is aborted. */
14
15
  signal?: AbortSignal;
@@ -329,4 +330,4 @@ declare function createPathCacheTag(routePath: string): string;
329
330
  declare function createRouteDataCacheTag(key: RouteDataCacheKey): string;
330
331
  declare function normalizeRevalidatePath(routePath: string): string;
331
332
 
332
- export { type CacheKeyFactory, type DefinedCacheKey, type FarmCacheAdapter, type FarmCacheEntry, type FarmCacheInvalidationStreamOptions, type FarmCacheInvalidationTarget, type FarmCacheOptions, type FarmCacheSetOptions, type FarmCacheStorage, type FarmCacheUserConfig, type FarmClientCacheUserConfig, FarmDataCache, type GetFarmCacheEntryOptions, type InferCacheKeyData, PPR_SHELL_ADAPTER_TTL_SECONDS, type RevalidateTagProfile, type RouteDataCacheKey, type StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, configureFarmCache, createFarmCacheInvalidationStream, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag };
333
+ export { type CacheKeyFactory, type DefinedCacheKey, type FarmCacheAdapter, type FarmCacheEntry, type FarmCacheInvalidationStreamOptions, type FarmCacheInvalidationTarget, type FarmCacheOptions, type FarmCacheSetOptions, type FarmCacheStorage, type FarmCacheUserConfig, type FarmClientCacheUserConfig, FarmDataCache, type GetFarmCacheEntryOptions, type InferCacheKeyData, PPR_SHELL_ADAPTER_TTL_SECONDS, type RevalidateTagProfile, type RouteDataCacheKey, type StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, applyFarmCacheInvalidations, configureFarmCache, createFarmCacheInvalidationStream, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag };
@@ -48,30 +48,30 @@ import {
48
48
  loadFarmConfigFile,
49
49
  resolveFarmLayers
50
50
  } from "./chunk-52Y3C3HG.mjs";
51
+ import {
52
+ resolveMdxConfig
53
+ } from "./chunk-UIJOLBUL.mjs";
51
54
  import {
52
55
  bundleNodeModule
53
56
  } from "./chunk-VFXE6NWR.mjs";
54
57
  import {
55
58
  resolveWorkflowsConfig
56
- } from "./chunk-ATHPRVP2.mjs";
59
+ } from "./chunk-5V4KZOZO.mjs";
57
60
  import {
58
61
  resolveCronConfig
59
62
  } from "./chunk-UCQ52TJY.mjs";
60
63
  import {
61
64
  resolveServerActionsConfig
62
- } from "./chunk-JOHXK4BB.mjs";
65
+ } from "./chunk-BW6SCVYX.mjs";
63
66
  import {
64
67
  resolveFarmThemeConfig
65
68
  } from "./chunk-YWPNIYUP.mjs";
66
- import {
67
- resolveMdxConfig
68
- } from "./chunk-UIJOLBUL.mjs";
69
69
  import {
70
70
  resolveMarkdownConfig
71
71
  } from "./chunk-N77JBPLC.mjs";
72
72
  import {
73
73
  resolveIntegrationPlugins
74
- } from "./chunk-NW2BKDVT.mjs";
74
+ } from "./chunk-HHFMECFO.mjs";
75
75
  import {
76
76
  compileMiddlewareConfig
77
77
  } from "./chunk-EDPENAVO.mjs";
@@ -83,7 +83,7 @@ import {
83
83
  } from "./chunk-2SVJGOAX.mjs";
84
84
  import {
85
85
  resolveFarmServerConfig
86
- } from "./chunk-C6U66WWF.mjs";
86
+ } from "./chunk-GFT5AHAT.mjs";
87
87
  import {
88
88
  resolveFarmAPIConfig
89
89
  } from "./chunk-BLD5GVCG.mjs";
@@ -0,0 +1,227 @@
1
+ import {
2
+ writeFileIfChanged
3
+ } from "./chunk-Q5B4LNON.mjs";
4
+ import {
5
+ resolveFarmComponentExtensions
6
+ } from "./chunk-ES2LD2YD.mjs";
7
+ import {
8
+ parseRouteSlotFile
9
+ } from "./chunk-CBJKDB6F.mjs";
10
+ import {
11
+ discoverProgrammaticRoutePaths
12
+ } from "./chunk-2H3FJYY6.mjs";
13
+ import {
14
+ parseRoutePath
15
+ } from "./chunk-2SVJGOAX.mjs";
16
+
17
+ // src/routing/generate-route-types.ts
18
+ import * as path from "path";
19
+ import * as fs from "fs";
20
+ function routeSegmentsToTsTypeLiteral(segments) {
21
+ if (segments.length === 0) return '"/"';
22
+ const hasDynamic = segments.some((s) => s.startsWith("["));
23
+ if (!hasDynamic) return JSON.stringify("/" + segments.join("/"));
24
+ const parts = segments.map((s) => {
25
+ if (s.startsWith("[[...") || s.startsWith("[...")) return "${string}";
26
+ if (s.startsWith("[")) return "${string}";
27
+ return s;
28
+ });
29
+ return "`/" + parts.join("/") + "`";
30
+ }
31
+ function routePatternToTsTypeLiterals(pattern) {
32
+ if (pattern === "/") return ['"/"'];
33
+ let variants = [[]];
34
+ for (const segment of pattern.slice(1).split("/").filter(Boolean)) {
35
+ if (segment.startsWith("[[...") && segment.endsWith("]]")) {
36
+ variants = variants.flatMap((parts) => [parts, [...parts, segment]]);
37
+ } else {
38
+ variants = variants.map((parts) => [...parts, segment]);
39
+ }
40
+ }
41
+ return variants.map(routeSegmentsToTsTypeLiteral);
42
+ }
43
+ function routePatternToRouteLiteral(pattern) {
44
+ return JSON.stringify(pattern);
45
+ }
46
+ function renderTypeUnion(values) {
47
+ return values.length <= 1 ? values[0] || "never" : `
48
+ | ${values.join("\n | ")}`;
49
+ }
50
+ function renderTypeAlias(name, value) {
51
+ return `export type ${name} =${value.startsWith("\n") ? "" : " "}${value};`;
52
+ }
53
+ function createRoutePattern(route) {
54
+ if (route.segments.length === 0) return "/";
55
+ return "/" + route.segments.map((seg) => {
56
+ if (!seg.isDynamic) return seg.segment;
57
+ if (seg.isCatchAll) return seg.isOptional ? `[[...${seg.segment}]]` : `[...${seg.segment}]`;
58
+ return `[${seg.segment}]`;
59
+ }).join("/");
60
+ }
61
+ var DEFAULT_OUT_FILE = "farm-routes.d.ts";
62
+ async function generateRouteTypes(options) {
63
+ const root = path.resolve(options.root);
64
+ const srcDir = options.srcDir || "src";
65
+ const outFile = options.outFile || DEFAULT_OUT_FILE;
66
+ const outPath = path.isAbsolute(outFile) ? outFile : path.join(root, srcDir, outFile);
67
+ const content = await createRouteTypeDeclarations(options, outPath);
68
+ fs.mkdirSync(path.dirname(outPath), { recursive: true });
69
+ writeFileIfChanged(outPath, content);
70
+ return outPath;
71
+ }
72
+ async function createRouteTypeDeclarations(options, outPath) {
73
+ const { extraRoutes = [], suppressLintOnLink = false } = options;
74
+ const { pages: patterns, modules: routeModulePatterns } = await scanRoutePatterns(options);
75
+ for (const route of extraRoutes) {
76
+ if (route.startsWith("/")) {
77
+ patterns.add(route);
78
+ routeModulePatterns.add(route);
79
+ }
80
+ }
81
+ const sortedPatterns = Array.from(patterns).sort();
82
+ const typeLiterals = Array.from(new Set(sortedPatterns.flatMap(routePatternToTsTypeLiterals)));
83
+ const patternLiterals = sortedPatterns.map(routePatternToRouteLiteral);
84
+ const routeModulePatternLiterals = Array.from(routeModulePatterns).sort().map(routePatternToRouteLiteral);
85
+ const routePathType = suppressLintOnLink ? "string" : renderTypeUnion(typeLiterals);
86
+ const routePatternType = suppressLintOnLink ? "string" : renderTypeUnion(patternLiterals);
87
+ const routeModulePatternType = renderTypeUnion(routeModulePatternLiterals);
88
+ const routeTypesImportPath = `./${path.basename(outPath).replace(/\.d\.ts$/, "")}`;
89
+ const linkAugmentationBlock = suppressLintOnLink ? "" : `
90
+ declare module "@farm.js/core/client" {
91
+ interface LinkDefaultRoute {
92
+ _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
93
+ pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
94
+ }
95
+ }
96
+
97
+ declare module "@farm.js/core" {
98
+ interface LinkDefaultRoute {
99
+ _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
100
+ pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
101
+ }
102
+ // Ensure root import ("@farm.js/core") uses the same typed Link signature as client entry.
103
+ const Link: typeof import("@farm.js/core/client").Link;
104
+ }
105
+
106
+ // Internal declaration path used by @farm.js/core root type re-exports.
107
+ declare module "@farm.js/core/dist/client.js" {
108
+ interface LinkDefaultRoute {
109
+ _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
110
+ pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
111
+ }
112
+ }
113
+ `;
114
+ const routeModuleAugmentationBlock = `
115
+ declare global {
116
+ namespace FarmJS {
117
+ interface RouteRegistry {
118
+ pattern: import(${JSON.stringify(routeTypesImportPath)}).RouteModulePattern;
119
+ }
120
+ }
121
+ }
122
+ `;
123
+ const content = `/**
124
+ * Auto-generated route types from src/app.
125
+ * Link href and route component props are typed automatically from generated declarations.
126
+ * Regenerated on dev start and when routes change.
127
+ * Set suppressLintOnLink: true in farm.config.ts to accept any string on Link href.
128
+ */
129
+ ${renderTypeAlias("RoutePath", routePathType)}
130
+ ${renderTypeAlias("RoutePattern", routePatternType)}
131
+ ${renderTypeAlias("RouteModulePattern", routeModulePatternType)}${linkAugmentationBlock}${routeModuleAugmentationBlock}
132
+ `;
133
+ return content;
134
+ }
135
+ var PLATFORM_FILE = /^(?:(page|layout)\.(native|ios|android)\.(?:tsx|ts|jsx|js)|page\.(kt|swift))$/;
136
+ async function scanRoutePatterns(options) {
137
+ const { root, srcDir = "src" } = options;
138
+ const sourceRoots = options.sourceRoots ?? [{ name: "project", root, srcDir, layer: false }];
139
+ const componentExtensions = resolveFarmComponentExtensions(options.componentExtensions).map(
140
+ (extension) => extension.slice(1)
141
+ );
142
+ const pages = /* @__PURE__ */ new Set();
143
+ const modules = /* @__PURE__ */ new Set();
144
+ const pageFiles = /* @__PURE__ */ new Map();
145
+ const nativePages = /* @__PURE__ */ new Map();
146
+ const nativeLayouts = /* @__PURE__ */ new Map();
147
+ const glob = await import("fast-glob");
148
+ for (const source of sourceRoots) {
149
+ const appDir = path.join(source.root, source.srcDir, "app");
150
+ if (fs.existsSync(appDir)) {
151
+ const routeModuleFiles = await glob.default(
152
+ `**/{page,layout,loading,error}.{${componentExtensions.join(",")},md,mdx}`,
153
+ {
154
+ cwd: appDir,
155
+ absolute: false
156
+ }
157
+ );
158
+ for (const file of routeModuleFiles) {
159
+ if (parseRouteSlotFile(file)) continue;
160
+ const route = parseRoutePath(file);
161
+ const pattern = createRoutePattern(route);
162
+ modules.add(pattern);
163
+ if (route.type === "page") {
164
+ pages.add(pattern);
165
+ if (options.platformFiles) pageFiles.set(pattern, path.join(appDir, file));
166
+ }
167
+ }
168
+ if (options.platformFiles) {
169
+ scanPlatformRouteFiles(
170
+ appDir,
171
+ await glob.default(
172
+ ["**/{page,layout}.{native,ios,android}.{tsx,ts,jsx,js}", "**/page.{kt,swift}"],
173
+ { cwd: appDir, absolute: false }
174
+ ),
175
+ nativePages,
176
+ nativeLayouts
177
+ );
178
+ }
179
+ }
180
+ for (const route of await discoverProgrammaticRoutePaths(source.root, source.srcDir)) {
181
+ pages.add(route);
182
+ modules.add(route);
183
+ }
184
+ }
185
+ if (!options.platformFiles) return { pages, modules };
186
+ for (const [pattern, files] of nativePages) {
187
+ if (!pages.has(pattern)) {
188
+ const file = path.relative(root, Object.values(files)[0]);
189
+ throw new Error(
190
+ `${file.replace(/\\/g, "/")} has no web page next to it. Add ${path.join(path.dirname(file), "page.tsx").replace(/\\/g, "/")}: it is the route's web screen and the fallback on every platform.`
191
+ );
192
+ }
193
+ }
194
+ return { pages, modules, pageFiles, nativePages, nativeLayouts };
195
+ }
196
+ function scanPlatformRouteFiles(appDir, files, nativePages, nativeLayouts) {
197
+ const seen = /* @__PURE__ */ new Map();
198
+ for (const file of [...files].sort()) {
199
+ const normalized = file.replace(/\\/g, "/");
200
+ const match = PLATFORM_FILE.exec(path.posix.basename(normalized));
201
+ if (!match) continue;
202
+ const kind = match[1] ?? "page";
203
+ const platform = match[2] ?? match[3];
204
+ const twin = path.posix.join(path.posix.dirname(normalized), `${kind}.tsx`);
205
+ if (kind === "page" && parseRouteSlotFile(twin)) continue;
206
+ const dir = path.posix.dirname(normalized);
207
+ const pattern = kind === "page" ? createRoutePattern(parseRoutePath(twin)) : dir === "." ? "/" : `/${dir}`;
208
+ const key = `${kind}\0${pattern}\0${platform}`;
209
+ const previous = seen.get(key);
210
+ if (previous) {
211
+ throw new Error(
212
+ `Duplicate ${platform} ${kind} for "${pattern}": found ${previous} and ${normalized} in ${appDir}. Keep one.`
213
+ );
214
+ }
215
+ seen.set(key, normalized);
216
+ const target = kind === "page" ? nativePages : nativeLayouts;
217
+ const entry = { ...target.get(pattern) };
218
+ entry[platform] = path.join(appDir, normalized);
219
+ target.set(pattern, entry);
220
+ }
221
+ }
222
+
223
+ export {
224
+ generateRouteTypes,
225
+ createRouteTypeDeclarations,
226
+ scanRoutePatterns
227
+ };
@@ -0,0 +1,55 @@
1
+ import {
2
+ logger
3
+ } from "./chunk-2SVJGOAX.mjs";
4
+
5
+ // src/server/dev-loopback.ts
6
+ import net from "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 = httpServer?.address();
26
+ if (!httpServer || !address || typeof address !== "object") return;
27
+ const other = OTHER_LOOPBACK[address.address];
28
+ if (!other) return;
29
+ const loopback = net.createServer((socket) => httpServer.emit("connection", socket));
30
+ const listening = await new Promise((resolve) => {
31
+ const onError = (error) => {
32
+ if (error.code === "EADDRINUSE") {
33
+ 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) => 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
+ export {
54
+ createFarmDevLoopbackPlugin
55
+ };
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.1.49";
2
+ var version = "0.1.50";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -0,0 +1,227 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+ var _chunk5YPBFMBNcjs = require('./chunk-5YPBFMBN.cjs');
4
+
5
+
6
+ var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
7
+
8
+
9
+ var _chunkJ2ZEVDEKcjs = require('./chunk-J2ZEVDEK.cjs');
10
+
11
+
12
+ var _chunkJZMZKABScjs = require('./chunk-JZMZKABS.cjs');
13
+
14
+
15
+ var _chunkXN2MB4QZcjs = require('./chunk-XN2MB4QZ.cjs');
16
+
17
+ // src/routing/generate-route-types.ts
18
+ var _path = require('path'); var path = _interopRequireWildcard(_path);
19
+ var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
20
+ function routeSegmentsToTsTypeLiteral(segments) {
21
+ if (segments.length === 0) return '"/"';
22
+ const hasDynamic = segments.some((s) => s.startsWith("["));
23
+ if (!hasDynamic) return JSON.stringify("/" + segments.join("/"));
24
+ const parts = segments.map((s) => {
25
+ if (s.startsWith("[[...") || s.startsWith("[...")) return "${string}";
26
+ if (s.startsWith("[")) return "${string}";
27
+ return s;
28
+ });
29
+ return "`/" + parts.join("/") + "`";
30
+ }
31
+ function routePatternToTsTypeLiterals(pattern) {
32
+ if (pattern === "/") return ['"/"'];
33
+ let variants = [[]];
34
+ for (const segment of pattern.slice(1).split("/").filter(Boolean)) {
35
+ if (segment.startsWith("[[...") && segment.endsWith("]]")) {
36
+ variants = variants.flatMap((parts) => [parts, [...parts, segment]]);
37
+ } else {
38
+ variants = variants.map((parts) => [...parts, segment]);
39
+ }
40
+ }
41
+ return variants.map(routeSegmentsToTsTypeLiteral);
42
+ }
43
+ function routePatternToRouteLiteral(pattern) {
44
+ return JSON.stringify(pattern);
45
+ }
46
+ function renderTypeUnion(values) {
47
+ return values.length <= 1 ? values[0] || "never" : `
48
+ | ${values.join("\n | ")}`;
49
+ }
50
+ function renderTypeAlias(name, value) {
51
+ return `export type ${name} =${value.startsWith("\n") ? "" : " "}${value};`;
52
+ }
53
+ function createRoutePattern(route) {
54
+ if (route.segments.length === 0) return "/";
55
+ return "/" + route.segments.map((seg) => {
56
+ if (!seg.isDynamic) return seg.segment;
57
+ if (seg.isCatchAll) return seg.isOptional ? `[[...${seg.segment}]]` : `[...${seg.segment}]`;
58
+ return `[${seg.segment}]`;
59
+ }).join("/");
60
+ }
61
+ var DEFAULT_OUT_FILE = "farm-routes.d.ts";
62
+ async function generateRouteTypes(options) {
63
+ const root = path.resolve(options.root);
64
+ const srcDir = options.srcDir || "src";
65
+ const outFile = options.outFile || DEFAULT_OUT_FILE;
66
+ const outPath = path.isAbsolute(outFile) ? outFile : path.join(root, srcDir, outFile);
67
+ const content = await createRouteTypeDeclarations(options, outPath);
68
+ fs.mkdirSync(path.dirname(outPath), { recursive: true });
69
+ _chunk5YPBFMBNcjs.writeFileIfChanged.call(void 0, outPath, content);
70
+ return outPath;
71
+ }
72
+ async function createRouteTypeDeclarations(options, outPath) {
73
+ const { extraRoutes = [], suppressLintOnLink = false } = options;
74
+ const { pages: patterns, modules: routeModulePatterns } = await scanRoutePatterns(options);
75
+ for (const route of extraRoutes) {
76
+ if (route.startsWith("/")) {
77
+ patterns.add(route);
78
+ routeModulePatterns.add(route);
79
+ }
80
+ }
81
+ const sortedPatterns = Array.from(patterns).sort();
82
+ const typeLiterals = Array.from(new Set(sortedPatterns.flatMap(routePatternToTsTypeLiterals)));
83
+ const patternLiterals = sortedPatterns.map(routePatternToRouteLiteral);
84
+ const routeModulePatternLiterals = Array.from(routeModulePatterns).sort().map(routePatternToRouteLiteral);
85
+ const routePathType = suppressLintOnLink ? "string" : renderTypeUnion(typeLiterals);
86
+ const routePatternType = suppressLintOnLink ? "string" : renderTypeUnion(patternLiterals);
87
+ const routeModulePatternType = renderTypeUnion(routeModulePatternLiterals);
88
+ const routeTypesImportPath = `./${path.basename(outPath).replace(/\.d\.ts$/, "")}`;
89
+ const linkAugmentationBlock = suppressLintOnLink ? "" : `
90
+ declare module "@farm.js/core/client" {
91
+ interface LinkDefaultRoute {
92
+ _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
93
+ pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
94
+ }
95
+ }
96
+
97
+ declare module "@farm.js/core" {
98
+ interface LinkDefaultRoute {
99
+ _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
100
+ pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
101
+ }
102
+ // Ensure root import ("@farm.js/core") uses the same typed Link signature as client entry.
103
+ const Link: typeof import("@farm.js/core/client").Link;
104
+ }
105
+
106
+ // Internal declaration path used by @farm.js/core root type re-exports.
107
+ declare module "@farm.js/core/dist/client.js" {
108
+ interface LinkDefaultRoute {
109
+ _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
110
+ pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
111
+ }
112
+ }
113
+ `;
114
+ const routeModuleAugmentationBlock = `
115
+ declare global {
116
+ namespace FarmJS {
117
+ interface RouteRegistry {
118
+ pattern: import(${JSON.stringify(routeTypesImportPath)}).RouteModulePattern;
119
+ }
120
+ }
121
+ }
122
+ `;
123
+ const content = `/**
124
+ * Auto-generated route types from src/app.
125
+ * Link href and route component props are typed automatically from generated declarations.
126
+ * Regenerated on dev start and when routes change.
127
+ * Set suppressLintOnLink: true in farm.config.ts to accept any string on Link href.
128
+ */
129
+ ${renderTypeAlias("RoutePath", routePathType)}
130
+ ${renderTypeAlias("RoutePattern", routePatternType)}
131
+ ${renderTypeAlias("RouteModulePattern", routeModulePatternType)}${linkAugmentationBlock}${routeModuleAugmentationBlock}
132
+ `;
133
+ return content;
134
+ }
135
+ var PLATFORM_FILE = /^(?:(page|layout)\.(native|ios|android)\.(?:tsx|ts|jsx|js)|page\.(kt|swift))$/;
136
+ async function scanRoutePatterns(options) {
137
+ const { root, srcDir = "src" } = options;
138
+ const sourceRoots = _nullishCoalesce(options.sourceRoots, () => ( [{ name: "project", root, srcDir, layer: false }]));
139
+ const componentExtensions = _chunkRD623KW4cjs.resolveFarmComponentExtensions.call(void 0, options.componentExtensions).map(
140
+ (extension) => extension.slice(1)
141
+ );
142
+ const pages = /* @__PURE__ */ new Set();
143
+ const modules = /* @__PURE__ */ new Set();
144
+ const pageFiles = /* @__PURE__ */ new Map();
145
+ const nativePages = /* @__PURE__ */ new Map();
146
+ const nativeLayouts = /* @__PURE__ */ new Map();
147
+ const glob = await import("fast-glob");
148
+ for (const source of sourceRoots) {
149
+ const appDir = path.join(source.root, source.srcDir, "app");
150
+ if (fs.existsSync(appDir)) {
151
+ const routeModuleFiles = await glob.default(
152
+ `**/{page,layout,loading,error}.{${componentExtensions.join(",")},md,mdx}`,
153
+ {
154
+ cwd: appDir,
155
+ absolute: false
156
+ }
157
+ );
158
+ for (const file of routeModuleFiles) {
159
+ if (_chunkJ2ZEVDEKcjs.parseRouteSlotFile.call(void 0, file)) continue;
160
+ const route = _chunkXN2MB4QZcjs.parseRoutePath.call(void 0, file);
161
+ const pattern = createRoutePattern(route);
162
+ modules.add(pattern);
163
+ if (route.type === "page") {
164
+ pages.add(pattern);
165
+ if (options.platformFiles) pageFiles.set(pattern, path.join(appDir, file));
166
+ }
167
+ }
168
+ if (options.platformFiles) {
169
+ scanPlatformRouteFiles(
170
+ appDir,
171
+ await glob.default(
172
+ ["**/{page,layout}.{native,ios,android}.{tsx,ts,jsx,js}", "**/page.{kt,swift}"],
173
+ { cwd: appDir, absolute: false }
174
+ ),
175
+ nativePages,
176
+ nativeLayouts
177
+ );
178
+ }
179
+ }
180
+ for (const route of await _chunkJZMZKABScjs.discoverProgrammaticRoutePaths.call(void 0, source.root, source.srcDir)) {
181
+ pages.add(route);
182
+ modules.add(route);
183
+ }
184
+ }
185
+ if (!options.platformFiles) return { pages, modules };
186
+ for (const [pattern, files] of nativePages) {
187
+ if (!pages.has(pattern)) {
188
+ const file = path.relative(root, Object.values(files)[0]);
189
+ throw new Error(
190
+ `${file.replace(/\\/g, "/")} has no web page next to it. Add ${path.join(path.dirname(file), "page.tsx").replace(/\\/g, "/")}: it is the route's web screen and the fallback on every platform.`
191
+ );
192
+ }
193
+ }
194
+ return { pages, modules, pageFiles, nativePages, nativeLayouts };
195
+ }
196
+ function scanPlatformRouteFiles(appDir, files, nativePages, nativeLayouts) {
197
+ const seen = /* @__PURE__ */ new Map();
198
+ for (const file of [...files].sort()) {
199
+ const normalized = file.replace(/\\/g, "/");
200
+ const match = PLATFORM_FILE.exec(path.posix.basename(normalized));
201
+ if (!match) continue;
202
+ const kind = _nullishCoalesce(match[1], () => ( "page"));
203
+ const platform = _nullishCoalesce(match[2], () => ( match[3]));
204
+ const twin = path.posix.join(path.posix.dirname(normalized), `${kind}.tsx`);
205
+ if (kind === "page" && _chunkJ2ZEVDEKcjs.parseRouteSlotFile.call(void 0, twin)) continue;
206
+ const dir = path.posix.dirname(normalized);
207
+ const pattern = kind === "page" ? createRoutePattern(_chunkXN2MB4QZcjs.parseRoutePath.call(void 0, twin)) : dir === "." ? "/" : `/${dir}`;
208
+ const key = `${kind}\0${pattern}\0${platform}`;
209
+ const previous = seen.get(key);
210
+ if (previous) {
211
+ throw new Error(
212
+ `Duplicate ${platform} ${kind} for "${pattern}": found ${previous} and ${normalized} in ${appDir}. Keep one.`
213
+ );
214
+ }
215
+ seen.set(key, normalized);
216
+ const target = kind === "page" ? nativePages : nativeLayouts;
217
+ const entry = { ...target.get(pattern) };
218
+ entry[platform] = path.join(appDir, normalized);
219
+ target.set(pattern, entry);
220
+ }
221
+ }
222
+
223
+
224
+
225
+
226
+
227
+ exports.generateRouteTypes = generateRouteTypes; exports.createRouteTypeDeclarations = createRouteTypeDeclarations; exports.scanRoutePatterns = scanRoutePatterns;