@farm.js/core 0.1.48 → 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 (322) hide show
  1. package/dist/{agent-mcp-DAjB8Eyu.d.ts → agent-mcp-9BMbRgg_.d.ts} +1 -1
  2. package/dist/{agent-mcp-CXN3g0eX.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-VK9sHDn5.d.ts → app-BWibTHVT.d.ts} +7 -7
  24. package/dist/{app-DytgRPjJ.d.mts → app-DVJ13FPA.d.mts} +7 -7
  25. package/dist/{app-manifest-DPgW5ke5.d.mts → app-manifest-CQDJOKL2.d.mts} +1 -1
  26. package/dist/{app-manifest-BUu7YGAx.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-HRLYO2XJ.mjs → chunk-2VCC3GVC.mjs} +1 -1
  35. package/dist/chunk-3ATXWZPH.cjs +227 -0
  36. package/dist/{chunk-YSPMY4B7.cjs → chunk-474FO3UE.cjs} +233 -157
  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-MZZA6ZQV.mjs → chunk-7PZVXMWG.mjs} +4 -4
  44. package/dist/{chunk-4IICUBQX.cjs → chunk-A5BJKSZE.cjs} +2 -2
  45. package/dist/{chunk-TTYXOAB7.mjs → chunk-ANHZ6SUL.mjs} +1 -1
  46. package/dist/{chunk-ZBS3GOQZ.cjs → chunk-AQLHD6HZ.cjs} +35 -61
  47. package/dist/{chunk-Q2ZKQ6GD.cjs → chunk-B5S2JS6M.cjs} +127 -125
  48. package/dist/{chunk-AXRNEVCS.cjs → chunk-B6PREBN6.cjs} +8 -8
  49. package/dist/{chunk-JOHXK4BB.mjs → chunk-BW6SCVYX.mjs} +1 -1
  50. package/dist/{chunk-LZBM35DH.mjs → chunk-C73RIAEF.mjs} +4 -4
  51. package/dist/chunk-CGCJ2TJU.cjs +55 -0
  52. package/dist/{chunk-UYQOIPXE.mjs → chunk-CPXDDWGL.mjs} +1 -1
  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-73XBJRZW.cjs → chunk-E2BMCNMJ.cjs} +2 -2
  56. package/dist/{chunk-WUEDTW6E.cjs → chunk-F5LERVY3.cjs} +23 -5
  57. package/dist/{chunk-A7DK663W.cjs → chunk-FACTMUPI.cjs} +27 -27
  58. package/dist/chunk-G2KTRMWA.mjs +40 -0
  59. package/dist/{chunk-C6U66WWF.mjs → chunk-GFT5AHAT.mjs} +13 -0
  60. package/dist/{chunk-ZGS3ZDF7.cjs → chunk-GOOK2J2W.cjs} +7 -7
  61. package/dist/{chunk-NW2BKDVT.mjs → chunk-HHFMECFO.mjs} +1 -1
  62. package/dist/{chunk-6M3HXUBQ.mjs → chunk-HWCHIBJZ.mjs} +21 -3
  63. package/dist/{chunk-HUL4LTC6.cjs → chunk-HYN3LLG7.cjs} +63 -20
  64. package/dist/{chunk-HELQXYVI.cjs → chunk-I2DQGS56.cjs} +11 -9
  65. package/dist/{chunk-SSNN55Q6.cjs → chunk-IQXGHGZF.cjs} +5 -5
  66. package/dist/{chunk-ZSIGEHSE.cjs → chunk-IUBDMDZZ.cjs} +21 -180
  67. package/dist/{chunk-TQWGOQ7O.mjs → chunk-IWJKJDNW.mjs} +116 -40
  68. package/dist/{chunk-NRFUVDTH.mjs → chunk-JJOWY3XD.mjs} +2 -2
  69. package/dist/{chunk-6XFGJBYX.cjs → chunk-JYNNIGQO.cjs} +16 -7
  70. package/dist/{chunk-XO6WL6NL.mjs → chunk-KGP76FSV.mjs} +1 -1
  71. package/dist/{chunk-GXSMF7UR.mjs → chunk-KO2NWUKN.mjs} +1 -1
  72. package/dist/{chunk-VDLF2DJA.cjs → chunk-KZH6YLND.cjs} +375 -162
  73. package/dist/{chunk-5566GNEG.cjs → chunk-LIFUPCXW.cjs} +13 -0
  74. package/dist/{chunk-I2SWKWO7.mjs → chunk-LJDIFIJ2.mjs} +1 -1
  75. package/dist/{chunk-KZT2VHRQ.cjs → chunk-LYWAGXXW.cjs} +11 -11
  76. package/dist/{chunk-N6SIQJEJ.mjs → chunk-M7LKA632.mjs} +54 -11
  77. package/dist/{chunk-6LH33DLL.cjs → chunk-NJVFPJ2Y.cjs} +2 -2
  78. package/dist/{chunk-JWP56HCP.mjs → chunk-OD6WM3I7.mjs} +2 -2
  79. package/dist/{chunk-MJ6IC4K2.mjs → chunk-OTOOJIUB.mjs} +1 -1
  80. package/dist/{chunk-TFA6BUAE.cjs → chunk-OY5XDG24.cjs} +4 -4
  81. package/dist/{chunk-R2SEZEBC.cjs → chunk-OYNNA4DD.cjs} +4 -4
  82. package/dist/{chunk-GBPDSUFE.mjs → chunk-OZK2DS44.mjs} +1 -1
  83. package/dist/chunk-QXJADAQB.cjs +40 -0
  84. package/dist/{chunk-JLS6ZLFM.cjs → chunk-RHOR2J6V.cjs} +1 -1
  85. package/dist/{chunk-YQGZLCT4.cjs → chunk-RWT2BTJT.cjs} +6 -6
  86. package/dist/{chunk-3HBFI373.cjs → chunk-S5AQ7CAC.cjs} +14 -14
  87. package/dist/{chunk-HNAUK3SC.mjs → chunk-SHJJM6OG.mjs} +40 -199
  88. package/dist/{chunk-LL7TDMOM.mjs → chunk-SMUW7UST.mjs} +33 -59
  89. package/dist/{chunk-VCFBQFOV.mjs → chunk-SN5VSO3Q.mjs} +9 -7
  90. package/dist/{chunk-DM3TFCC2.cjs → chunk-SUV6YO4Q.cjs} +5 -5
  91. package/dist/{chunk-JUMPFVMK.mjs → chunk-TUOO6IK3.mjs} +9 -0
  92. package/dist/chunk-UB7RVEMX.mjs +73 -0
  93. package/dist/{chunk-CDTIXBKN.mjs → chunk-UN6N623E.mjs} +2 -2
  94. package/dist/{chunk-BEXYFR2R.cjs → chunk-UY6HS5PF.cjs} +2 -2
  95. package/dist/{chunk-HAH4FBTA.mjs → chunk-VAHBCI6X.mjs} +1 -1
  96. package/dist/{chunk-C2R5RVLA.cjs → chunk-VCKGOXFI.cjs} +73 -1
  97. package/dist/{chunk-N25RPPO5.cjs → chunk-WAPQWAE6.cjs} +10 -10
  98. package/dist/{chunk-NE33FRQ5.mjs → chunk-WVBUXNBX.mjs} +274 -61
  99. package/dist/{chunk-ALD2WMLA.mjs → chunk-WXHDVXJE.mjs} +2 -2
  100. package/dist/{chunk-EVCQX243.cjs → chunk-X2EL3BLH.cjs} +2 -2
  101. package/dist/{chunk-EA5PMJDU.mjs → chunk-X3HOVNHI.mjs} +1 -1
  102. package/dist/{chunk-XXB37YET.cjs → chunk-XLRLSTJ6.cjs} +7 -7
  103. package/dist/{chunk-DRFADSKY.mjs → chunk-XXXRRVY6.mjs} +4 -4
  104. package/dist/{chunk-EXHEPWFJ.cjs → chunk-YAXOEAND.cjs} +10 -10
  105. package/dist/{chunk-PEHL3IZL.cjs → chunk-YB44NKC2.cjs} +2 -2
  106. package/dist/chunk-YKHRCY4T.cjs +73 -0
  107. package/dist/{chunk-NIPKC4DA.mjs → chunk-ZIBIE7AH.mjs} +72 -0
  108. package/dist/{chunk-N7SPZJLY.mjs → chunk-ZLOQQ2UF.mjs} +33 -31
  109. package/dist/client/lifecycle.d.mts +1 -1
  110. package/dist/client/lifecycle.d.ts +1 -1
  111. package/dist/{client-plugins-DqjCsKMN.d.ts → client-plugins-BPfltM5m.d.ts} +19 -10
  112. package/dist/{client-plugins-BlEzV5FO.d.mts → client-plugins-D4RO59f0.d.mts} +19 -10
  113. package/dist/client-plugins.d.mts +6 -6
  114. package/dist/client-plugins.d.ts +6 -6
  115. package/dist/client.cjs +11 -8
  116. package/dist/client.d.mts +11 -10
  117. package/dist/client.d.ts +11 -10
  118. package/dist/client.mjs +12 -9
  119. package/dist/client.react-server.mjs +1 -1
  120. package/dist/config-CnhyvvmT.d.mts +188 -0
  121. package/dist/config-CnhyvvmT.d.ts +188 -0
  122. package/dist/config.d.mts +6 -6
  123. package/dist/config.d.ts +6 -6
  124. package/dist/desktop.d.mts +7 -7
  125. package/dist/desktop.d.ts +7 -7
  126. package/dist/{dev-guard-MPZUJFIV.mjs → dev-guard-4PFQNXQX.mjs} +4 -2
  127. package/dist/{dev-guard-4NQ3LFO5.cjs → dev-guard-YLO5DE3H.cjs} +7 -5
  128. package/dist/{devtools-A37WWJZL.cjs → devtools-N5XTOECL.cjs} +8 -8
  129. package/dist/{devtools-BLKHPY3C.mjs → devtools-STG7HPRV.mjs} +7 -7
  130. package/dist/docs.cjs +10 -10
  131. package/dist/docs.d.mts +7 -7
  132. package/dist/docs.d.ts +7 -7
  133. package/dist/docs.mjs +9 -9
  134. package/dist/environment/vite.d.mts +1 -1
  135. package/dist/environment/vite.d.ts +1 -1
  136. package/dist/generate-route-types-DQP0cUzk.d.ts +33 -0
  137. package/dist/generate-route-types-TF5Wwtvz.d.mts +33 -0
  138. package/dist/i18n/client.d.mts +2 -2
  139. package/dist/i18n/client.d.ts +2 -2
  140. package/dist/i18n/index.d.mts +3 -3
  141. package/dist/i18n/index.d.ts +3 -3
  142. package/dist/i18n/server.d.mts +5 -5
  143. package/dist/i18n/server.d.ts +5 -5
  144. package/dist/image/server.cjs +3 -3
  145. package/dist/image/server.mjs +2 -2
  146. package/dist/image/sharp.cjs +10 -10
  147. package/dist/image/sharp.mjs +2 -2
  148. package/dist/{index-CMigAr9f.d.mts → index-C-N3Pwg-.d.ts} +2 -2
  149. package/dist/{index-MocnSP3a.d.ts → index-D3l4tREW.d.ts} +2 -2
  150. package/dist/{index-Cl3akY5U.d.mts → index-DPUAPho_.d.mts} +2 -2
  151. package/dist/{index-n3hjOvVC.d.ts → index-k8o8eUOd.d.mts} +2 -2
  152. package/dist/index.cjs +73 -66
  153. package/dist/index.d.mts +29 -45
  154. package/dist/index.d.ts +29 -45
  155. package/dist/index.mjs +78 -71
  156. package/dist/integrations.cjs +3 -3
  157. package/dist/integrations.d.mts +6 -6
  158. package/dist/integrations.d.ts +6 -6
  159. package/dist/integrations.mjs +2 -2
  160. package/dist/internal/app-markdown-runtime.d.mts +7 -7
  161. package/dist/internal/app-markdown-runtime.d.ts +7 -7
  162. package/dist/internal/build-runtime.cjs +36 -32
  163. package/dist/internal/build-runtime.d.mts +9 -9
  164. package/dist/internal/build-runtime.d.ts +9 -9
  165. package/dist/internal/build-runtime.mjs +35 -31
  166. package/dist/internal/cli-runtime.cjs +16 -15
  167. package/dist/internal/cli-runtime.mjs +16 -15
  168. package/dist/internal/client-error-overlay.cjs +4 -4
  169. package/dist/internal/client-error-overlay.mjs +1 -1
  170. package/dist/internal/client-runtime.cjs +19 -2
  171. package/dist/internal/client-runtime.d.mts +45 -3
  172. package/dist/internal/client-runtime.d.ts +45 -3
  173. package/dist/internal/client-runtime.mjs +19 -2
  174. package/dist/internal/compression-runtime.d.mts +6 -6
  175. package/dist/internal/compression-runtime.d.ts +6 -6
  176. package/dist/internal/config-runtime.cjs +17 -10
  177. package/dist/internal/config-runtime.d.mts +259 -18
  178. package/dist/internal/config-runtime.d.ts +259 -18
  179. package/dist/internal/config-runtime.mjs +15 -8
  180. package/dist/internal/desktop-guard.cjs +2 -2
  181. package/dist/internal/desktop-guard.d.mts +7 -0
  182. package/dist/internal/desktop-guard.d.ts +7 -0
  183. package/dist/internal/desktop-guard.mjs +1 -1
  184. package/dist/internal/form-actions.cjs +4 -4
  185. package/dist/internal/form-actions.mjs +3 -3
  186. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  187. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  188. package/dist/internal/islands-runtime.cjs +4 -1
  189. package/dist/internal/islands-runtime.d.mts +9 -12
  190. package/dist/internal/islands-runtime.d.ts +9 -12
  191. package/dist/internal/islands-runtime.mjs +5 -2
  192. package/dist/internal/metadata-image-runtime.cjs +3 -3
  193. package/dist/internal/metadata-image-runtime.mjs +2 -2
  194. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  195. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  196. package/dist/internal/production-runtime.cjs +13 -13
  197. package/dist/internal/production-runtime.d.mts +19 -19
  198. package/dist/internal/production-runtime.d.ts +19 -19
  199. package/dist/internal/production-runtime.mjs +15 -15
  200. package/dist/{layers-D9fbe-rz.d.ts → layers-CcS42OGR.d.mts} +1 -1
  201. package/dist/{layers-D9fbe-rz.d.mts → layers-CcS42OGR.d.ts} +1 -1
  202. package/dist/{lifecycle-DK06VuKP.d.ts → lifecycle-C2aLBOwu.d.mts} +1 -1
  203. package/dist/{lifecycle-DK06VuKP.d.mts → lifecycle-C2aLBOwu.d.ts} +1 -1
  204. package/dist/markdown.d.mts +6 -6
  205. package/dist/markdown.d.ts +6 -6
  206. package/dist/middleware.cjs +7 -7
  207. package/dist/middleware.d.mts +8 -8
  208. package/dist/middleware.d.ts +8 -8
  209. package/dist/middleware.mjs +6 -6
  210. package/dist/mobile.cjs +9 -0
  211. package/dist/mobile.d.mts +67 -0
  212. package/dist/mobile.d.ts +67 -0
  213. package/dist/mobile.mjs +9 -0
  214. package/dist/navigation-delegate-8xg3Zvp4.d.ts +29 -0
  215. package/dist/navigation-delegate-ji6elCKy.d.mts +29 -0
  216. package/dist/navigation.cjs +5 -5
  217. package/dist/navigation.d.mts +9 -9
  218. package/dist/navigation.d.ts +9 -9
  219. package/dist/navigation.mjs +4 -4
  220. package/dist/{nitro-UT2J5A5D.mjs → nitro-2Q5NVY7L.mjs} +2 -2
  221. package/dist/{nitro-BIXIKJZS.cjs → nitro-YPSZBYDK.cjs} +3 -3
  222. package/dist/platform.cjs +2 -1
  223. package/dist/platform.d.mts +4 -3
  224. package/dist/platform.d.ts +4 -3
  225. package/dist/platform.mjs +2 -1
  226. package/dist/{plugin-4KYXV7BB.mjs → plugin-53SY5YBS.mjs} +1 -1
  227. package/dist/{plugin-WBANOZQM.cjs → plugin-HZIBL3DW.cjs} +2 -2
  228. package/dist/plugin.cjs +31 -29
  229. package/dist/plugin.d.mts +13 -8
  230. package/dist/plugin.d.ts +13 -8
  231. package/dist/plugin.mjs +30 -28
  232. package/dist/{production-runtime-bWZJMcQb.d.mts → production-runtime-DXnQQkQf.d.mts} +3 -3
  233. package/dist/{production-runtime-YVDGYWBG.d.ts → production-runtime-TdKaYRj0.d.ts} +3 -3
  234. package/dist/production-vite-BQFAlG7n.d.mts +13 -0
  235. package/dist/production-vite-BQFAlG7n.d.ts +13 -0
  236. package/dist/{programmatic-routes-client-DviwGeAv.d.ts → programmatic-routes-client-BwiTndEC.d.ts} +2 -2
  237. package/dist/{programmatic-routes-client-BFKOTEXN.d.mts → programmatic-routes-client-Dh1SDLSM.d.mts} +2 -2
  238. package/dist/query/client.cjs +6 -6
  239. package/dist/query/client.mjs +2 -2
  240. package/dist/{render-plan-DqWXo3-B.d.ts → render-plan-BPbwRbuN.d.ts} +1 -1
  241. package/dist/{render-plan-CS8l0zaK.d.mts → render-plan-BvCGXF6K.d.mts} +1 -1
  242. package/dist/renderer-client.cjs +9 -6
  243. package/dist/renderer-client.d.mts +9 -8
  244. package/dist/renderer-client.d.ts +9 -8
  245. package/dist/renderer-client.mjs +6 -3
  246. package/dist/{request-CBrHpaCC.d.ts → request-B8PGTZNR.d.ts} +1 -1
  247. package/dist/{request-D4XqmnJF.d.mts → request-C_xTkJib.d.mts} +1 -1
  248. package/dist/request.d.mts +7 -7
  249. package/dist/request.d.ts +7 -7
  250. package/dist/{resolver-DC57A4vz.d.ts → resolver-CJ-D9nP-.d.ts} +1 -1
  251. package/dist/{resolver-C2G-3Tm6.d.mts → resolver-TDyZKgKI.d.mts} +1 -1
  252. package/dist/{route-rendering-3pRPtyO2.d.mts → route-rendering-DlddURL1.d.mts} +1 -1
  253. package/dist/{route-rendering-Bltnu8a3.d.ts → route-rendering-RNtcj607.d.ts} +1 -1
  254. package/dist/{router-BFSmKGtI.d.mts → router-B97eB0Mq.d.mts} +1 -1
  255. package/dist/{router-DDT7bkg7.d.ts → router-qUVaoEN8.d.ts} +1 -1
  256. package/dist/routes-8PT9cl60.d.ts +121 -0
  257. package/dist/routes-kEUsXHx3.d.mts +121 -0
  258. package/dist/routes.d.mts +6 -6
  259. package/dist/routes.d.ts +6 -6
  260. package/dist/{rsc-pipeline-4KOITP64.cjs → rsc-pipeline-L4XOZ2TE.cjs} +13 -10
  261. package/dist/{rsc-pipeline-ULFIB3UT.mjs → rsc-pipeline-T3775JUA.mjs} +12 -9
  262. package/dist/runtime-BIBGJO7V.cjs +1005 -0
  263. package/dist/{runtime-B9HmxiZc.d.ts → runtime-C4CmlOOh.d.ts} +2 -2
  264. package/dist/{runtime-C6yG64je.d.ts → runtime-C8GUnNeP.d.ts} +1 -1
  265. package/dist/{runtime-Cpylaypt.d.mts → runtime-CaDswfWi.d.mts} +1 -1
  266. package/dist/{runtime-CCxTmGuf.d.mts → runtime-CihDZ2Rn.d.mts} +2 -2
  267. package/dist/runtime-HRSFC4ZC.mjs +1005 -0
  268. package/dist/{schema-dev-notice-O3I5HLXK.mjs → schema-dev-notice-LZ5NXGLN.mjs} +2 -2
  269. package/dist/{schema-dev-notice-Z73J3NJ6.cjs → schema-dev-notice-XV7GZ3QJ.cjs} +4 -4
  270. package/dist/server-action-security.cjs +3 -3
  271. package/dist/server-action-security.mjs +2 -2
  272. package/dist/server-fn-client.d.mts +0 -1
  273. package/dist/server-fn-client.d.ts +0 -1
  274. package/dist/server-fn.cjs +4 -4
  275. package/dist/server-fn.d.mts +0 -1
  276. package/dist/server-fn.d.ts +0 -1
  277. package/dist/server-fn.mjs +3 -3
  278. package/dist/server-plugins.cjs +1 -1
  279. package/dist/server-plugins.d.mts +7 -7
  280. package/dist/server-plugins.d.ts +7 -7
  281. package/dist/server-plugins.mjs +1 -1
  282. package/dist/server-query-client.d.mts +0 -1
  283. package/dist/server-query-client.d.ts +0 -1
  284. package/dist/server-query.cjs +5 -5
  285. package/dist/server-query.d.mts +0 -1
  286. package/dist/server-query.d.ts +0 -1
  287. package/dist/server-query.mjs +4 -4
  288. package/dist/server.cjs +89 -66
  289. package/dist/server.d.mts +22 -17
  290. package/dist/server.d.ts +22 -17
  291. package/dist/server.mjs +64 -41
  292. package/dist/{spa-router-CkTPnA4L.d.mts → spa-router-Dlv5ofg0.d.mts} +4 -4
  293. package/dist/{spa-router-CKuS81mi.d.ts → spa-router-qapSboKz.d.ts} +4 -4
  294. package/dist/testing.cjs +7 -7
  295. package/dist/testing.d.mts +6 -6
  296. package/dist/testing.d.ts +6 -6
  297. package/dist/testing.mjs +5 -5
  298. package/dist/{types--Wh02r5_.d.mts → types-C41ePjvP.d.mts} +1 -1
  299. package/dist/{types--Wh02r5_.d.ts → types-C41ePjvP.d.ts} +1 -1
  300. package/dist/{utils-C0ORLYXc.d.ts → utils-A-cYF81u.d.ts} +1 -1
  301. package/dist/{utils-IA9wVkef.d.mts → utils-DyvlSxFk.d.mts} +1 -1
  302. package/dist/version.cjs +2 -2
  303. package/dist/version.mjs +1 -1
  304. package/dist/vite.cjs +31 -29
  305. package/dist/vite.d.mts +9 -9
  306. package/dist/vite.d.ts +9 -9
  307. package/dist/vite.mjs +30 -28
  308. package/dist/{workflows-Df1C_7OG.d.mts → workflows-CRMzQZ3k.d.mts} +2 -1
  309. package/dist/{workflows-Df1C_7OG.d.ts → workflows-CRMzQZ3k.d.ts} +2 -1
  310. package/dist/workflows.cjs +3 -3
  311. package/dist/workflows.d.mts +1 -1
  312. package/dist/workflows.d.ts +1 -1
  313. package/dist/workflows.mjs +2 -2
  314. package/package.json +10 -2
  315. package/dist/cache-invalidation-BD0z_lfu.d.mts +0 -4
  316. package/dist/cache-invalidation-BD0z_lfu.d.ts +0 -4
  317. package/dist/chunk-45EUIICW.mjs +0 -15
  318. package/dist/chunk-V7KTQR4C.cjs +0 -15
  319. package/dist/{chunk-BR5FSKZ5.cjs → chunk-EQWWOQTK.cjs} +0 -0
  320. package/dist/{chunk-5OJVKXFV.cjs → chunk-N7JQXQAV.cjs} +2 -2
  321. package/dist/{chunk-VR4SEDEM.mjs → chunk-VOZ5DI7D.mjs} +0 -0
  322. package/dist/{chunk-72KABRWN.mjs → chunk-WSDKXV4E.mjs} +4 -4
@@ -1,12 +1,16 @@
1
+ import {
2
+ createRouteTypeDeclarations,
3
+ generateRouteTypes
4
+ } from "./chunk-2G63BIRL.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,
@@ -1,5 +1,14 @@
1
+ import {
2
+ createPlatformBlockChecker,
3
+ isPlainObject,
4
+ readAppPackageJson,
5
+ resolveAppPackageName,
6
+ resolvePlatformBlock,
7
+ resolvePlatformProfile
8
+ } from "./chunk-UB7RVEMX.mjs";
9
+
1
10
  // src/desktop/config.ts
2
- import { existsSync, readFileSync } from "fs";
11
+ import { existsSync } from "fs";
3
12
  import * as path from "path";
4
13
  var FARM_PLATFORM_ENV = "FARM_PLATFORM";
5
14
  var FARM_DESKTOP_DEV_SESSION = /* @__PURE__ */ Symbol.for("@farm.js/core/desktop-dev-session");
@@ -9,33 +18,18 @@ function setFarmDesktopDevSession(session) {
9
18
  else delete store[FARM_DESKTOP_DEV_SESSION];
10
19
  }
11
20
  function resolveFarmPlatform(env = process.env) {
12
- return env[FARM_PLATFORM_ENV] === "desktop" ? "desktop" : "web";
21
+ const value = env[FARM_PLATFORM_ENV];
22
+ return value === "desktop" || value === "mobile" ? value : "web";
13
23
  }
14
24
  var DESKTOP_KEYS = /* @__PURE__ */ new Set(["name", "id", "version", "icon", "window", "shell"]);
15
25
  var WINDOW_KEYS = /* @__PURE__ */ new Set(["width", "height", "title"]);
16
26
  var APP_ID = /^[A-Za-z][A-Za-z0-9-]*(?:\.[A-Za-z0-9][A-Za-z0-9-]*)+$/;
17
27
  var SHELL_NAME = /^[a-z][a-z0-9-]*$/;
18
28
  var SHELL_PACKAGE = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*(?:\/[a-z0-9][a-z0-9._-]*)*$/;
19
- var failPrefix = "desktop";
20
- function fail(message) {
21
- throw new TypeError(`${failPrefix}: ${message}`);
22
- }
23
- function isPlainObject(value) {
24
- return !!value && typeof value === "object" && !Array.isArray(value);
25
- }
26
- function checkKeys(value, allowed, where) {
27
- for (const key of Object.keys(value)) {
28
- if (!allowed.has(key)) {
29
- fail(`unknown option ${where}${key}. Supported: ${[...allowed].join(", ")}.`);
30
- }
31
- }
32
- }
33
- function optionalString(value, key) {
34
- if (value === void 0) return void 0;
35
- if (typeof value !== "string" || !value.trim()) fail(`${key} must be a non-empty string.`);
36
- return value.trim();
29
+ function desktopChecker(context) {
30
+ return createPlatformBlockChecker(context ? `desktop (os: ${context.os})` : "desktop");
37
31
  }
38
- function optionalSize(value, key) {
32
+ function optionalSize({ fail }, value, key) {
39
33
  if (value === void 0) return void 0;
40
34
  if (typeof value !== "number" || !Number.isInteger(value) || value < 100 || value > 16384) {
41
35
  fail(`${key} must be a whole number of points between 100 and 16384.`);
@@ -43,7 +37,11 @@ function optionalSize(value, key) {
43
37
  return value;
44
38
  }
45
39
  function validateFarmDesktopConfig(input, context) {
46
- failPrefix = context ? `desktop (os: ${context.os})` : "desktop";
40
+ const check = desktopChecker(context);
41
+ const { checkKeys, optionalString } = check;
42
+ function fail(message) {
43
+ return check.fail(message);
44
+ }
47
45
  if (input === void 0) return void 0;
48
46
  if (!isPlainObject(input)) {
49
47
  fail(
@@ -64,8 +62,8 @@ function validateFarmDesktopConfig(input, context) {
64
62
  if (input.window !== void 0) {
65
63
  if (!isPlainObject(input.window)) fail("window must be an object, such as { width: 1024 }.");
66
64
  checkKeys(input.window, WINDOW_KEYS, "window.");
67
- optionalSize(input.window.width, "window.width");
68
- optionalSize(input.window.height, "window.height");
65
+ optionalSize(check, input.window.width, "window.width");
66
+ optionalSize(check, input.window.height, "window.height");
69
67
  optionalString(input.window.title, "window.title");
70
68
  }
71
69
  const shell = optionalString(input.shell, "shell");
@@ -77,14 +75,6 @@ function validateFarmDesktopConfig(input, context) {
77
75
  }
78
76
  return input;
79
77
  }
80
- function readPackageJson(root) {
81
- try {
82
- const parsed = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8"));
83
- return isPlainObject(parsed) ? parsed : {};
84
- } catch {
85
- return {};
86
- }
87
- }
88
78
  function slug(value) {
89
79
  return value.replace(/^@[^/]+\//, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "app";
90
80
  }
@@ -93,12 +83,13 @@ function resolveFarmDesktopShellPackage(shell) {
93
83
  }
94
84
  function resolveFarmDesktopConfig(input, root, context) {
95
85
  const config = validateFarmDesktopConfig(input, context) ?? {};
96
- const pkg = readPackageJson(root);
97
- const packageName = typeof pkg.productName === "string" && pkg.productName.trim() || typeof pkg.name === "string" && pkg.name.replace(/^@[^/]+\//, "").trim() || path.basename(root);
86
+ const pkg = readAppPackageJson(root);
87
+ const packageName = resolveAppPackageName(root, pkg);
98
88
  const name = config.name?.trim() || packageName || "Farm App";
99
89
  const shell = config.shell?.trim() || "electrobun";
100
90
  const icon = config.icon ? path.resolve(root, config.icon.trim()) : void 0;
101
- if (icon && !existsSync(icon)) fail(`icon ${config.icon} was not found in ${root}.`);
91
+ if (icon && !existsSync(icon))
92
+ desktopChecker(context).fail(`icon ${config.icon} was not found in ${root}.`);
102
93
  return {
103
94
  name,
104
95
  id: config.id?.trim() || `local.farm.${slug(name)}`,
@@ -132,10 +123,7 @@ function createFarmDesktopContext(options) {
132
123
  if (!DESKTOP_OS.has(os)) {
133
124
  throw new TypeError(`--os must be macos, windows, or linux, got "${os}".`);
134
125
  }
135
- const profile = options.profile ?? "production";
136
- if (typeof profile !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(profile)) {
137
- throw new TypeError(`--profile must be a name such as "beta", got "${String(profile)}".`);
138
- }
126
+ const profile = resolvePlatformProfile(options.profile);
139
127
  return Object.freeze({
140
128
  os,
141
129
  mode: options.mode,
@@ -146,26 +134,12 @@ function createFarmDesktopContext(options) {
146
134
  });
147
135
  }
148
136
  async function resolveFarmDesktopBlock(input, context, cache) {
149
- if (typeof input !== "function") {
150
- return validateFarmDesktopConfig(input, context) ?? {};
151
- }
152
- const call = () => Promise.resolve().then(() => input(context)).then((value) => validateFarmDesktopConfig(value, context) ?? {});
153
- if (!cache) return call();
154
- const key = [
155
- context.os,
156
- context.mode,
157
- context.command,
158
- context.profile,
159
- context.root,
160
- String(input)
161
- ].join("\0");
162
- let resolved = cache.get(key);
163
- if (!resolved) {
164
- resolved = call();
165
- cache.set(key, resolved);
166
- resolved.catch(() => cache.delete(key));
167
- }
168
- return resolved;
137
+ return resolvePlatformBlock(
138
+ input,
139
+ context,
140
+ (value, ctx) => validateFarmDesktopConfig(value, ctx) ?? {},
141
+ cache
142
+ );
169
143
  }
170
144
  var FARM_DESKTOP_SETUP = /* @__PURE__ */ Symbol.for("@farm.js/core/desktop-setup");
171
145
  async function createFarmDesktopSetup(userConfig, root, mode, options, cache) {
@@ -3,8 +3,9 @@ import {
3
3
  isFarmLocaleChangeHref
4
4
  } from "./chunk-PTLXHRJZ.mjs";
5
5
  import {
6
- getHashTargetElement
7
- } from "./chunk-45EUIICW.mjs";
6
+ getHashTargetElement,
7
+ runFarmNavigationDelegates
8
+ } from "./chunk-G2KTRMWA.mjs";
8
9
  import {
9
10
  isFarmBlockedNavigationURL,
10
11
  isFarmExternalNavigationURL,
@@ -252,11 +253,12 @@ var SPARouter = class {
252
253
  return;
253
254
  }
254
255
  const from = window.location.pathname + window.location.search;
255
- if (await this.shouldBlockNavigation({
256
- from,
257
- to: fullPath,
258
- action: replace ? "replace" : "push"
259
- })) {
256
+ const action = replace ? "replace" : "push";
257
+ if (await this.shouldBlockNavigation({ from, to: fullPath, action })) {
258
+ return;
259
+ }
260
+ if (!(refresh && fullPath === from) && await runFarmNavigationDelegates({ url: url.href, from, to: fullPath, action })) {
261
+ this.cancelActiveNavigation();
260
262
  return;
261
263
  }
262
264
  if (this.options.scrollRestoration) {
@@ -17,18 +17,18 @@ var _chunk5DX3O6TTcjs = require('./chunk-5DX3O6TT.cjs');
17
17
  var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
18
18
 
19
19
 
20
- var _chunk5566GNEGcjs = require('./chunk-5566GNEG.cjs');
20
+ var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
21
21
 
22
22
 
23
23
  var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
24
24
 
25
25
 
26
- var _chunkA25FXJ7Dcjs = require('./chunk-A25FXJ7D.cjs');
27
26
 
28
27
 
28
+ var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
29
29
 
30
30
 
31
- var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
31
+ var _chunkA25FXJ7Dcjs = require('./chunk-A25FXJ7D.cjs');
32
32
 
33
33
 
34
34
  var _chunkOWQV6MLMcjs = require('./chunk-OWQV6MLM.cjs');
@@ -240,7 +240,7 @@ function createHandledResponse(body, init, headers) {
240
240
  return new Response(body, { ...init, headers: responseHeaders });
241
241
  }
242
242
  function createWebMiddlewareContext(request, parent, trustProxy = false, clientAddress, toRoutePathname) {
243
- let currentRequest = _chunk5566GNEGcjs.withFarmRequestClientAddress.call(void 0, request, trustProxy, clientAddress);
243
+ let currentRequest = _chunkLIFUPCXWcjs.withFarmRequestClientAddress.call(void 0, request, trustProxy, clientAddress);
244
244
  let handledResponse = null;
245
245
  const url = new URL(currentRequest.url);
246
246
  const data = _optionalChain([parent, 'optionalAccess', _3 => _3.data]) ? new Map(parent.data) : /* @__PURE__ */ new Map();
@@ -295,7 +295,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
295
295
  rewrite(rewriteUrl) {
296
296
  ctx._rewriteUrl = rewriteUrl;
297
297
  const nextUrl = new URL(rewriteUrl, currentRequest.url);
298
- currentRequest = _chunk5566GNEGcjs.withFarmRequestClientAddress.call(void 0,
298
+ currentRequest = _chunkLIFUPCXWcjs.withFarmRequestClientAddress.call(void 0,
299
299
  new Request(nextUrl, currentRequest),
300
300
  trustProxy,
301
301
  clientAddress
@@ -1,5 +1,13 @@
1
1
  // src/dev-module.ts
2
2
  var failedModules = /* @__PURE__ */ new WeakMap();
3
+ var startedContainers = /* @__PURE__ */ new WeakSet();
4
+ async function startPluginContainer(server) {
5
+ if (server.config?.experimental?.bundledDev) return;
6
+ const container = server.environments.client?.pluginContainer;
7
+ if (!container || startedContainers.has(container)) return;
8
+ await container.buildStart?.();
9
+ startedContainers.add(container);
10
+ }
3
11
  var FarmDevEnvironmentError = class extends Error {
4
12
  };
5
13
  async function loadFarmDevModule(server, id, environmentName = "ssr") {
@@ -11,6 +19,7 @@ async function loadFarmDevModule(server, id, environmentName = "ssr") {
11
19
  );
12
20
  }
13
21
  try {
22
+ await startPluginContainer(server);
14
23
  return await runner.import(id);
15
24
  } catch (error) {
16
25
  const failures = failedModules.get(environment) ?? /* @__PURE__ */ new Map();