@farm.js/core 0.1.67 → 0.1.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/{agent-mcp.d-BFu9xHAi.d.ts → agent-mcp.d-Uh5xr7aX.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-DWyWkTSy.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +5 -3
  4. package/dist/agent-runtime.d.ts +5 -3
  5. package/dist/{analyzer-TTIIXXMQ.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
  6. package/dist/analyzer-PPAHM4AW.cjs +16 -0
  7. package/dist/api/node.d.mts +7 -5
  8. package/dist/api/node.d.ts +7 -5
  9. package/dist/api/route-manager.d.mts +7 -5
  10. package/dist/api/route-manager.d.ts +7 -5
  11. package/dist/api/runtime.d.mts +6 -4
  12. package/dist/api/runtime.d.ts +6 -4
  13. package/dist/api.d.mts +8 -6
  14. package/dist/api.d.ts +8 -6
  15. package/dist/{app-manifest.d-CwfhGrVR.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
  16. package/dist/{app-manifest.d-CRmjN5j9.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
  17. package/dist/app-markdown.cjs +3 -3
  18. package/dist/app-markdown.d.mts +10 -10
  19. package/dist/app-markdown.d.ts +10 -10
  20. package/dist/app-markdown.mjs +2 -2
  21. package/dist/{app.d-BX9LVTiP.d.ts → app.d-BVOpL_f2.d.ts} +6 -6
  22. package/dist/{app.d-uBBUxwyV.d.mts → app.d-BhiDXex_.d.mts} +6 -6
  23. package/dist/{chunk-23PVOIPT.cjs → chunk-225APHKC.cjs} +3 -3
  24. package/dist/{chunk-4JX3M4C6.cjs → chunk-23VJEGKC.cjs} +2 -1
  25. package/dist/{chunk-Q37INCXG.cjs → chunk-3EEINK7G.cjs} +11 -2
  26. package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
  27. package/dist/{chunk-QJVW76JG.mjs → chunk-3Y52TWYU.mjs} +2 -2
  28. package/dist/{chunk-OB3IFUK6.cjs → chunk-437QZIC2.cjs} +4 -4
  29. package/dist/{chunk-WGHY3OL5.mjs → chunk-4UAQB5LB.mjs} +232 -49
  30. package/dist/{chunk-JWSI5WO4.mjs → chunk-4ZXKYCYK.mjs} +1 -1
  31. package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
  32. package/dist/{chunk-AQDLVHNF.mjs → chunk-5FBZJJGA.mjs} +17 -0
  33. package/dist/{chunk-PL6RTBDE.cjs → chunk-5JKDFRTK.cjs} +2 -2
  34. package/dist/{chunk-CO3YMZFD.mjs → chunk-6OFOIMNS.mjs} +1 -1
  35. package/dist/{chunk-556H7JCE.cjs → chunk-7LK5CTUM.cjs} +14 -14
  36. package/dist/{chunk-E6CD45JK.mjs → chunk-A3T445WK.mjs} +19 -5
  37. package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
  38. package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
  39. package/dist/{chunk-IRA2CZAY.mjs → chunk-CRVSYDHV.mjs} +2 -2
  40. package/dist/{chunk-XNZWMXCF.mjs → chunk-DIXFKAPM.mjs} +183 -76
  41. package/dist/{chunk-QGQP6QKO.cjs → chunk-DWLNLU55.cjs} +2 -2
  42. package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
  43. package/dist/{chunk-N5DQMOAG.cjs → chunk-F36LS2C7.cjs} +273 -90
  44. package/dist/{chunk-H37MDCPR.mjs → chunk-F6CMGWAL.mjs} +1 -1
  45. package/dist/{chunk-HNVAZGQD.cjs → chunk-FJMC24KG.cjs} +2 -2
  46. package/dist/{chunk-KCY52OUQ.cjs → chunk-FSODPZRT.cjs} +1 -1
  47. package/dist/{chunk-PPX7UOFY.cjs → chunk-FVYBEMOD.cjs} +55 -38
  48. package/dist/{chunk-6YBYX4K4.mjs → chunk-G7NBPP7H.mjs} +1 -1
  49. package/dist/{chunk-HFHJJXSV.mjs → chunk-GFPS7MNE.mjs} +1 -1
  50. package/dist/{chunk-3T5TLFCQ.mjs → chunk-HEJM46HQ.mjs} +11 -2
  51. package/dist/chunk-HHLEYA4B.cjs +17 -0
  52. package/dist/{chunk-F43OG25P.cjs → chunk-I7J5RLGO.cjs} +15 -1
  53. package/dist/chunk-ICFPTHXM.mjs +97 -0
  54. package/dist/{chunk-6V5YWI4W.cjs → chunk-IGDYL2IA.cjs} +2 -2
  55. package/dist/{chunk-TEG6HJVF.mjs → chunk-JL2YW5KX.mjs} +1 -0
  56. package/dist/{chunk-JVM3DKZE.mjs → chunk-KDO6T6OB.mjs} +1 -1
  57. package/dist/{chunk-QITSS4TD.cjs → chunk-KWCZKJYU.cjs} +352 -245
  58. package/dist/{chunk-DCXSIEFE.cjs → chunk-LDEXTX4I.cjs} +51 -37
  59. package/dist/{chunk-3T7ALZJF.cjs → chunk-LR4KP3I7.cjs} +2 -2
  60. package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
  61. package/dist/{chunk-5TA63JD3.mjs → chunk-MGZVDX4R.mjs} +1 -1
  62. package/dist/{chunk-6SQZXRJ2.cjs → chunk-MMDKYJ5V.cjs} +7 -7
  63. package/dist/{chunk-HP2DQGQH.mjs → chunk-MNJDNTGO.mjs} +1 -1
  64. package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
  65. package/dist/{chunk-XUES6OET.mjs → chunk-MV7NWU23.mjs} +1 -1
  66. package/dist/{chunk-4DRINDGN.cjs → chunk-MZ4CRSY7.cjs} +254 -125
  67. package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
  68. package/dist/{chunk-WDD5CTZW.mjs → chunk-NT4W4H52.mjs} +6 -6
  69. package/dist/{chunk-F7JKVHU2.mjs → chunk-NVOMQLI2.mjs} +15 -1
  70. package/dist/{chunk-22IWL4YD.cjs → chunk-OCNV4CI2.cjs} +21 -2
  71. package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
  72. package/dist/{chunk-YVTS3S3F.cjs → chunk-QOGIZKSO.cjs} +3 -3
  73. package/dist/{chunk-DB2HSHQA.cjs → chunk-QSUYB3RH.cjs} +14 -14
  74. package/dist/chunk-QYNZ3CTI.mjs +17 -0
  75. package/dist/{chunk-724MGMIL.mjs → chunk-R2ZHU37O.mjs} +19 -0
  76. package/dist/{chunk-YQYTQJZN.mjs → chunk-RLH5AH2M.mjs} +1 -1
  77. package/dist/{chunk-HM7AGSKU.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
  78. package/dist/{chunk-V5MQMQ2P.mjs → chunk-T5XFZQCL.mjs} +1 -1
  79. package/dist/{chunk-Q5UX55YA.cjs → chunk-TNK2TVRS.cjs} +831 -470
  80. package/dist/{chunk-J7JHVCWA.cjs → chunk-UKZ6AWKZ.cjs} +2 -1
  81. package/dist/{chunk-V5RTHYJB.cjs → chunk-URN7VFO7.cjs} +91 -22
  82. package/dist/{chunk-HRPTMX5C.mjs → chunk-VFNAK6A5.mjs} +2 -2
  83. package/dist/{chunk-VK54PDQ6.mjs → chunk-VRGY3X2I.mjs} +86 -17
  84. package/dist/chunk-W44X6IC2.cjs +97 -0
  85. package/dist/{chunk-GTV2ABO7.mjs → chunk-WPB67LE5.mjs} +162 -33
  86. package/dist/{chunk-UHE5JUKB.mjs → chunk-XCAQTCGK.mjs} +1 -1
  87. package/dist/{chunk-DGOFR7D5.cjs → chunk-Y6KHPJDB.cjs} +2 -2
  88. package/dist/{chunk-LPIZMU7D.cjs → chunk-YTNBCXCW.cjs} +4 -4
  89. package/dist/{chunk-KWFNUODD.mjs → chunk-YVPX5PI5.mjs} +1 -0
  90. package/dist/{chunk-6R53ZWX2.cjs → chunk-Z3PW3DIR.cjs} +3 -3
  91. package/dist/{chunk-UHNSY2PQ.mjs → chunk-Z6SOXHAD.mjs} +772 -411
  92. package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
  93. package/dist/{client-component.d-CDRvRmbU.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
  94. package/dist/{client-component.d-DWRKyAp5.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
  95. package/dist/{client-plugins.d-BNILjfX3.d.mts → client-plugins.d-CE1lVK2R.d.mts} +23 -234
  96. package/dist/{client-plugins.d-CrKZiNSN.d.ts → client-plugins.d-CNDqcAuf.d.ts} +23 -234
  97. package/dist/client-plugins.d.mts +5 -3
  98. package/dist/client-plugins.d.ts +5 -3
  99. package/dist/client.cjs +6 -6
  100. package/dist/client.d.mts +10 -8
  101. package/dist/client.d.ts +10 -8
  102. package/dist/client.mjs +5 -5
  103. package/dist/config.d.mts +5 -3
  104. package/dist/config.d.ts +5 -3
  105. package/dist/deployment.cjs +4 -2
  106. package/dist/deployment.d.mts +15 -1
  107. package/dist/deployment.d.ts +15 -1
  108. package/dist/deployment.mjs +3 -1
  109. package/dist/desktop.d.mts +6 -4
  110. package/dist/desktop.d.ts +6 -4
  111. package/dist/{devtools-UFQYT3VA.mjs → devtools-2A2GPC7B.mjs} +6 -6
  112. package/dist/{devtools-RZVT4JVN.cjs → devtools-R27T3BRY.cjs} +7 -7
  113. package/dist/docs.cjs +9 -9
  114. package/dist/docs.d.mts +6 -4
  115. package/dist/docs.d.ts +6 -4
  116. package/dist/docs.mjs +8 -8
  117. package/dist/environment/vite.cjs +5 -5
  118. package/dist/environment/vite.d.mts +1 -1
  119. package/dist/environment/vite.d.ts +1 -1
  120. package/dist/environment/vite.mjs +4 -4
  121. package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
  122. package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
  123. package/dist/index.cjs +41 -36
  124. package/dist/{index.d-Bdm6866n.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
  125. package/dist/{index.d-Dey5T14f.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
  126. package/dist/index.d.mts +25 -22
  127. package/dist/index.d.ts +25 -22
  128. package/dist/index.mjs +43 -38
  129. package/dist/instrumentation.cjs +3 -3
  130. package/dist/instrumentation.mjs +2 -2
  131. package/dist/integrations/orm.d.mts +5 -3
  132. package/dist/integrations/orm.d.ts +5 -3
  133. package/dist/integrations.d.mts +5 -3
  134. package/dist/integrations.d.ts +5 -3
  135. package/dist/internal/app-markdown-runtime.cjs +2 -2
  136. package/dist/internal/app-markdown-runtime.d.mts +12 -5
  137. package/dist/internal/app-markdown-runtime.d.ts +12 -5
  138. package/dist/internal/app-markdown-runtime.mjs +1 -1
  139. package/dist/internal/build-runtime.cjs +33 -30
  140. package/dist/internal/build-runtime.d.mts +7 -5
  141. package/dist/internal/build-runtime.d.ts +7 -5
  142. package/dist/internal/build-runtime.mjs +32 -29
  143. package/dist/internal/cli-runtime.cjs +10 -10
  144. package/dist/internal/cli-runtime.mjs +9 -9
  145. package/dist/internal/client-error-overlay.cjs +4 -4
  146. package/dist/internal/client-error-overlay.mjs +1 -1
  147. package/dist/internal/client-runtime.cjs +31 -36
  148. package/dist/internal/client-runtime.d.mts +8 -6
  149. package/dist/internal/client-runtime.d.ts +8 -6
  150. package/dist/internal/client-runtime.mjs +22 -27
  151. package/dist/internal/compression-runtime.d.mts +5 -3
  152. package/dist/internal/compression-runtime.d.ts +5 -3
  153. package/dist/internal/config-runtime.cjs +8 -8
  154. package/dist/internal/config-runtime.d.mts +9 -7
  155. package/dist/internal/config-runtime.d.ts +9 -7
  156. package/dist/internal/config-runtime.mjs +7 -7
  157. package/dist/internal/form-actions.cjs +7 -2
  158. package/dist/internal/form-actions.d.mts +10 -3
  159. package/dist/internal/form-actions.d.ts +10 -3
  160. package/dist/internal/form-actions.mjs +8 -3
  161. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  162. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  163. package/dist/internal/islands-boot.cjs +6 -1
  164. package/dist/internal/islands-boot.mjs +6 -1
  165. package/dist/internal/native-server-fns.cjs +4 -4
  166. package/dist/internal/native-server-fns.mjs +3 -3
  167. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  168. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  169. package/dist/internal/production-node-env.cjs +4 -2
  170. package/dist/internal/production-node-env.d.mts +22 -1
  171. package/dist/internal/production-node-env.d.ts +22 -1
  172. package/dist/internal/production-node-env.mjs +3 -1
  173. package/dist/internal/production-runtime.cjs +13 -9
  174. package/dist/internal/production-runtime.d.mts +21 -16
  175. package/dist/internal/production-runtime.d.ts +21 -16
  176. package/dist/internal/production-runtime.mjs +13 -9
  177. package/dist/internal/server-tree.cjs +2 -2
  178. package/dist/internal/server-tree.d.mts +0 -5
  179. package/dist/internal/server-tree.d.ts +0 -5
  180. package/dist/internal/server-tree.mjs +1 -1
  181. package/dist/internal/vercel-edge-middleware.cjs +87 -0
  182. package/dist/internal/vercel-edge-middleware.d.mts +39 -0
  183. package/dist/internal/vercel-edge-middleware.d.ts +39 -0
  184. package/dist/internal/vercel-edge-middleware.mjs +87 -0
  185. package/dist/layers-7P4RLKVX.cjs +20 -0
  186. package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
  187. package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
  188. package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
  189. package/dist/markdown.d.mts +5 -3
  190. package/dist/markdown.d.ts +5 -3
  191. package/dist/middleware.cjs +4 -4
  192. package/dist/middleware.d.mts +8 -5
  193. package/dist/middleware.d.ts +8 -5
  194. package/dist/middleware.mjs +6 -6
  195. package/dist/mobile.d.mts +4 -4
  196. package/dist/mobile.d.ts +4 -4
  197. package/dist/{mount.d-BP0nLYQO.d.mts → mount.d-Bki4pOaJ.d.mts} +1 -1
  198. package/dist/{mount.d-CkiPky_F.d.ts → mount.d-DjR5aerM.d.ts} +1 -1
  199. package/dist/{navigation-delegate.d-DchcGzAQ.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
  200. package/dist/{navigation-delegate.d-CdBP-hkZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
  201. package/dist/navigation.cjs +5 -5
  202. package/dist/navigation.d.mts +8 -6
  203. package/dist/navigation.d.ts +8 -6
  204. package/dist/navigation.mjs +4 -4
  205. package/dist/{nitro-55YOZWRA.mjs → nitro-NSTXT7LB.mjs} +2 -2
  206. package/dist/{nitro-EEX2J3KB.cjs → nitro-Y3LGITW3.cjs} +4 -4
  207. package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
  208. package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
  209. package/dist/plugin.cjs +20 -20
  210. package/dist/plugin.d.mts +7 -5
  211. package/dist/plugin.d.ts +7 -5
  212. package/dist/plugin.mjs +19 -19
  213. package/dist/{production-runtime.d-Dou_Htas.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
  214. package/dist/{production-runtime.d-VwsBzIee.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
  215. package/dist/query/client.cjs +6 -6
  216. package/dist/query/client.mjs +2 -2
  217. package/dist/{render-plan.d-LKymStDJ.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
  218. package/dist/{render-plan.d-D8UakAIk.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
  219. package/dist/renderer/react/server.cjs +2 -2
  220. package/dist/renderer/react/server.mjs +1 -1
  221. package/dist/renderer-client.cjs +5 -5
  222. package/dist/renderer-client.d.mts +8 -6
  223. package/dist/renderer-client.d.ts +8 -6
  224. package/dist/renderer-client.mjs +2 -2
  225. package/dist/renderer.d.mts +5 -0
  226. package/dist/renderer.d.ts +5 -0
  227. package/dist/{request.d-KG-4d2eG.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
  228. package/dist/{request.d-B928QjWy.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
  229. package/dist/request.d.mts +6 -4
  230. package/dist/request.d.ts +6 -4
  231. package/dist/{route-rendering.d-DoEe_w9t.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
  232. package/dist/{route-rendering.d-NIHQeb4m.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
  233. package/dist/{router.d-DYnRHQwz.d.ts → router.d-B56rMOFm.d.ts} +1 -1
  234. package/dist/{router.d-B8PkJSGp.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
  235. package/dist/{routes.d-uUBZyWoK.d.ts → routes.d-9GFFNioh.d.ts} +1 -1
  236. package/dist/{routes.d-DgZ_jgGG.d.mts → routes.d-CrEy0lJS.d.mts} +1 -1
  237. package/dist/routes.d.mts +5 -3
  238. package/dist/routes.d.ts +5 -3
  239. package/dist/{rsc-pipeline-7K5H2RPH.cjs → rsc-pipeline-3T7V6OUT.cjs} +10 -9
  240. package/dist/{rsc-pipeline-4OJ5ZQNZ.mjs → rsc-pipeline-GA4AQWZI.mjs} +9 -8
  241. package/dist/{runtime-X52Q7JFR.cjs → runtime-REUTNTI5.cjs} +20 -20
  242. package/dist/{runtime-U7O3HZOZ.mjs → runtime-ZYCKKY7L.mjs} +12 -12
  243. package/dist/{runtime.d-BxQIzwfy.d.mts → runtime.d-DLRO-ExG.d.mts} +1 -1
  244. package/dist/{runtime.d-DP7mEkEF.d.ts → runtime.d-H7k9hOQE.d.ts} +1 -1
  245. package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
  246. package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
  247. package/dist/server-plugins.d.mts +6 -4
  248. package/dist/server-plugins.d.ts +6 -4
  249. package/dist/server.cjs +46 -44
  250. package/dist/server.d-C5FFrZAo.d.ts +57 -0
  251. package/dist/server.d-DgC8xew5.d.mts +57 -0
  252. package/dist/server.d.mts +13 -11
  253. package/dist/server.d.ts +13 -11
  254. package/dist/server.mjs +28 -26
  255. package/dist/{spa-router.d-DsFDHTsv.d.ts → spa-router.d-Dr7oanhl.d.ts} +2 -2
  256. package/dist/{spa-router.d-BgHPVMhz.d.mts → spa-router.d-g4CzhEH1.d.mts} +2 -2
  257. package/dist/testing.d.mts +5 -3
  258. package/dist/testing.d.ts +5 -3
  259. package/dist/types.d-xCIhyjOq.d.mts +233 -0
  260. package/dist/types.d-xCIhyjOq.d.ts +233 -0
  261. package/dist/{utils.d-zxAVcf_V.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
  262. package/dist/{utils.d-BKyKDBR1.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
  263. package/dist/version.cjs +2 -2
  264. package/dist/version.mjs +1 -1
  265. package/dist/vite.cjs +20 -20
  266. package/dist/vite.d.mts +10 -8
  267. package/dist/vite.d.ts +10 -8
  268. package/dist/vite.mjs +19 -19
  269. package/dist/workflows.cjs +2 -2
  270. package/dist/workflows.d.mts +121 -1
  271. package/dist/workflows.d.ts +121 -1
  272. package/dist/workflows.mjs +1 -1
  273. package/package.json +7 -2
  274. package/dist/analyzer-KVZGVY5Q.cjs +0 -16
  275. package/dist/chunk-CLFEQGET.cjs +0 -60
  276. package/dist/chunk-MK5E44WP.mjs +0 -60
  277. package/dist/layers-DMRXRL7F.cjs +0 -18
  278. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  279. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  280. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  281. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
@@ -7,7 +7,7 @@ var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
7
7
  var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
8
8
 
9
9
 
10
- var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
10
+ var _chunkMTBDJ326cjs = require('./chunk-MTBDJ326.cjs');
11
11
 
12
12
 
13
13
  var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
@@ -21,7 +21,7 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
21
21
  var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
22
22
 
23
23
 
24
- var _chunkHM7AGSKUcjs = require('./chunk-HM7AGSKU.cjs');
24
+ var _chunkSQ6IWJ3Hcjs = require('./chunk-SQ6IWJ3H.cjs');
25
25
 
26
26
  // src/environment-vite.ts
27
27
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
@@ -1217,6 +1217,10 @@ var _crypto = require('crypto');
1217
1217
 
1218
1218
 
1219
1219
  var IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
1220
+ var moduleName = (node) => {
1221
+ const name = _optionalChain([node, 'optionalAccess', _60 => _60.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _61 => _61.value]);
1222
+ return typeof name === "string" ? name : null;
1223
+ };
1220
1224
  function parse(code, file) {
1221
1225
  const extension = _path2.default.extname(file).slice(1);
1222
1226
  const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
@@ -1247,8 +1251,8 @@ function namespaceMembers2(program, local, declaration) {
1247
1251
  if (opaque || node === declaration) return;
1248
1252
  const name = node.type === "Identifier" || node.type === "JSXIdentifier" ? node.name : null;
1249
1253
  if (name !== local) return;
1250
- if (_optionalChain([parent, 'optionalAccess', _60 => _60.type]) === "ImportNamespaceSpecifier") return;
1251
- const member = (_optionalChain([parent, 'optionalAccess', _61 => _61.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _62 => _62.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
1254
+ if (_optionalChain([parent, 'optionalAccess', _62 => _62.type]) === "ImportNamespaceSpecifier") return;
1255
+ const member = (_optionalChain([parent, 'optionalAccess', _63 => _63.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _64 => _64.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
1252
1256
  const property = member && !parent.computed && (member.type === "Identifier" || member.type === "JSXIdentifier") ? member.name : null;
1253
1257
  if (property) members.add(property);
1254
1258
  else opaque = true;
@@ -1256,17 +1260,19 @@ function namespaceMembers2(program, local, declaration) {
1256
1260
  return opaque ? null : [...members];
1257
1261
  }
1258
1262
  function findFarmPackageClientImports(code, file, isClientPackage) {
1259
- if (!code.includes("import")) return [];
1263
+ if (!code.includes("import") && !code.includes("export")) return [];
1260
1264
  const program = parse(code, file);
1261
1265
  if (!program) return [];
1262
1266
  const found = [];
1263
1267
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
1264
- if (node.type !== "ImportDeclaration" || node.importKind === "type") continue;
1265
- const specifier = _optionalChain([node, 'access', _63 => _63.source, 'optionalAccess', _64 => _64.value]);
1268
+ const reexport = node.type === "ExportNamedDeclaration" && node.source != null;
1269
+ if (node.type !== "ImportDeclaration" && !reexport) continue;
1270
+ if (node.importKind === "type" || node.exportKind === "type") continue;
1271
+ const specifier = _optionalChain([node, 'access', _65 => _65.source, 'optionalAccess', _66 => _66.value]);
1266
1272
  if (typeof specifier !== "string" || specifier.startsWith(".") || specifier.startsWith("/"))
1267
1273
  continue;
1268
1274
  const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
1269
- (entry2) => entry2.importKind !== "type"
1275
+ (entry2) => entry2.importKind !== "type" && entry2.exportKind !== "type"
1270
1276
  );
1271
1277
  if (specifiers.length === 0 || !isClientPackage(specifier)) continue;
1272
1278
  const entry = {
@@ -1274,12 +1280,20 @@ function findFarmPackageClientImports(code, file, isClientPackage) {
1274
1280
  end: node.end,
1275
1281
  specifier,
1276
1282
  named: [],
1277
- kept: []
1283
+ kept: [],
1284
+ ...reexport ? { reexport: true } : {}
1278
1285
  };
1279
1286
  const client = (name) => isFarmPackageClientExport(file, specifier, name);
1280
1287
  let supported = true;
1281
1288
  for (const binding of specifiers) {
1282
- if (binding.type === "ImportDefaultSpecifier") {
1289
+ if (binding.type === "ExportSpecifier") {
1290
+ const imported = moduleName(binding.local);
1291
+ const exported = moduleName(binding.exported);
1292
+ if (!imported || !exported || !IDENTIFIER.test(imported) || !IDENTIFIER.test(exported))
1293
+ supported = false;
1294
+ else if (client(imported)) entry.named.push({ imported, local: exported });
1295
+ else entry.kept.push({ imported, local: exported });
1296
+ } else if (binding.type === "ImportDefaultSpecifier") {
1283
1297
  if (client("default")) entry.defaultLocal = binding.local.name;
1284
1298
  else entry.kept.push({ imported: "default", local: binding.local.name });
1285
1299
  } else if (binding.type === "ImportNamespaceSpecifier") {
@@ -1297,8 +1311,8 @@ function findFarmPackageClientImports(code, file, isClientPackage) {
1297
1311
  ...values.length > 0 ? { values } : {}
1298
1312
  };
1299
1313
  } else {
1300
- const imported = _optionalChain([binding, 'access', _65 => _65.imported, 'optionalAccess', _66 => _66.type]) === "Identifier" ? binding.imported.name : _optionalChain([binding, 'access', _67 => _67.imported, 'optionalAccess', _68 => _68.value]);
1301
- if (typeof imported !== "string" || !IDENTIFIER.test(imported)) supported = false;
1314
+ const imported = moduleName(binding.imported);
1315
+ if (!imported || !IDENTIFIER.test(imported)) supported = false;
1302
1316
  else if (client(imported)) entry.named.push({ imported, local: binding.local.name });
1303
1317
  else entry.kept.push({ imported, local: binding.local.name });
1304
1318
  }
@@ -1311,31 +1325,88 @@ function farmPackageClientImportExports(entry) {
1311
1325
  return [
1312
1326
  ...entry.defaultLocal ? ["default"] : [],
1313
1327
  ...entry.named.map((binding) => binding.imported),
1314
- ..._nullishCoalesce(_optionalChain([entry, 'access', _69 => _69.namespace, 'optionalAccess', _70 => _70.members]), () => ( []))
1328
+ ..._nullishCoalesce(_optionalChain([entry, 'access', _67 => _67.namespace, 'optionalAccess', _68 => _68.members]), () => ( []))
1315
1329
  ];
1316
1330
  }
1317
1331
  var FARM_CLIENT_REFERENCE_PRAGMA = "// @farm-client-reference";
1318
1332
  var FARM_CLIENT_REFERENCE_DIRECTORY = "/.farm/client-references/";
1319
- function farmPackageClientReferencePath(root, specifier, exportName) {
1333
+ var FARM_RESOLVE_FROM_PREFIX = "farm:resolve-from:";
1334
+ function parseFarmResolveFrom(id, importer) {
1335
+ if (!id.startsWith(FARM_RESOLVE_FROM_PREFIX)) return null;
1336
+ const rest = id.slice(FARM_RESOLVE_FROM_PREFIX.length);
1337
+ const separator = rest.indexOf(":");
1338
+ if (separator <= 0) return null;
1339
+ const directory = _path2.default.resolve(
1340
+ _path2.default.dirname(importer),
1341
+ decodeURIComponent(rest.slice(0, separator))
1342
+ );
1343
+ return {
1344
+ specifier: rest.slice(separator + 1),
1345
+ importer: _path2.default.join(directory, "__farm_client_reference__.js")
1346
+ };
1347
+ }
1348
+ function farmPackageClientReferencePath(root, specifier, exportName, scope) {
1320
1349
  const directory = specifier.replace(/^@/, "").replace(/[^A-Za-z0-9._-]/g, "+");
1321
- return _path2.default.join(root, ".farm", "client-references", directory, `${exportName}.tsx`);
1350
+ return _path2.default.join(
1351
+ root,
1352
+ ".farm",
1353
+ "client-references",
1354
+ directory,
1355
+ ...scope ? [scope] : [],
1356
+ `${exportName}.tsx`
1357
+ );
1358
+ }
1359
+ function specifierPackage(specifier) {
1360
+ const parts = specifier.split("/");
1361
+ return specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
1322
1362
  }
1323
- function ensureFarmPackageClientReference(root, specifier, exportName) {
1324
- const file = farmPackageClientReferencePath(root, specifier, exportName);
1363
+ function packageLookup(directory, packageName) {
1364
+ for (let current = directory; ; current = _path2.default.dirname(current)) {
1365
+ if (_path2.default.basename(current) !== "node_modules") {
1366
+ const candidate = _path2.default.join(current, "node_modules", packageName);
1367
+ try {
1368
+ return { from: current, real: _fs2.default.realpathSync(candidate) };
1369
+ } catch (e17) {
1370
+ }
1371
+ }
1372
+ if (_path2.default.dirname(current) === current) return null;
1373
+ }
1374
+ }
1375
+ function referenceResolveFrom(root, specifier, importer) {
1376
+ const packageName = specifierPackage(specifier);
1377
+ const own = packageLookup(_path2.default.dirname(importer), packageName);
1378
+ if (!own) return null;
1379
+ const app = packageLookup(_path2.default.join(root, ".farm", "client-references"), packageName);
1380
+ if (_optionalChain([app, 'optionalAccess', _69 => _69.real]) === own.real) return null;
1381
+ try {
1382
+ return _fs2.default.realpathSync(own.from);
1383
+ } catch (e18) {
1384
+ return own.from;
1385
+ }
1386
+ }
1387
+ function ensureFarmPackageClientReference(root, specifier, exportName, importer) {
1388
+ const resolveFrom = importer ? referenceResolveFrom(root, specifier, importer) : null;
1389
+ const scope = resolveFrom ? `__from__${_crypto.createHash.call(void 0, "sha256").update(_path2.default.relative(root, resolveFrom).split(_path2.default.sep).join("/")).digest("hex").slice(0, 8)}` : void 0;
1390
+ const file = farmPackageClientReferencePath(root, specifier, exportName, scope);
1391
+ const target = JSON.stringify(
1392
+ resolveFrom ? `${FARM_RESOLVE_FROM_PREFIX}${encodeURIComponent(
1393
+ _path2.default.relative(_path2.default.dirname(file), resolveFrom).split(_path2.default.sep).join("/")
1394
+ )}:${specifier}` : specifier
1395
+ );
1325
1396
  const source = [
1326
1397
  `// Generated by Farm: ${specifier}'s ${exportName} export, as a client reference for server components.`,
1327
1398
  FARM_CLIENT_REFERENCE_PRAGMA,
1328
1399
  '"use client";',
1329
1400
  // An import, not `export { name } from`: a server graph applies CommonJS interop to imports
1330
1401
  // (react-wrap-balancer's `main` is CommonJS), not to re-exports.
1331
- exportName === "default" ? `import __farm_reference__ from ${JSON.stringify(specifier)};` : `import { ${exportName} as __farm_reference__ } from ${JSON.stringify(specifier)};`,
1402
+ exportName === "default" ? `import __farm_reference__ from ${target};` : `import { ${exportName} as __farm_reference__ } from ${target};`,
1332
1403
  `export { __farm_reference__ as ${exportName} };`,
1333
1404
  ""
1334
1405
  ].join("\n");
1335
1406
  let current = null;
1336
1407
  try {
1337
1408
  current = _fs2.default.readFileSync(file, "utf8");
1338
- } catch (e17) {
1409
+ } catch (e19) {
1339
1410
  }
1340
1411
  if (current !== source) {
1341
1412
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
@@ -1347,7 +1418,7 @@ function writeIfChanged(file, source) {
1347
1418
  let current = null;
1348
1419
  try {
1349
1420
  current = _fs2.default.readFileSync(file, "utf8");
1350
- } catch (e18) {
1421
+ } catch (e20) {
1351
1422
  }
1352
1423
  if (current !== source) {
1353
1424
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
@@ -1359,7 +1430,7 @@ function owningPackage(file) {
1359
1430
  try {
1360
1431
  const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(current, "package.json"), "utf8"));
1361
1432
  if (typeof manifest.name === "string") return { directory: current, name: manifest.name };
1362
- } catch (e19) {
1433
+ } catch (e21) {
1363
1434
  }
1364
1435
  if (_path2.default.dirname(current) === current) return null;
1365
1436
  }
@@ -1400,24 +1471,27 @@ function ensureFarmInternalClientReference(root, clientFile) {
1400
1471
  function rewriteFarmPackageClientImports(options) {
1401
1472
  const imports = findFarmPackageClientImports(options.code, options.file, options.isClientPackage);
1402
1473
  if (imports.length === 0) return null;
1403
- const reference = (specifier, exportName) => JSON.stringify(ensureFarmPackageClientReference(options.root, specifier, exportName));
1474
+ const reference = (specifier, exportName) => JSON.stringify(
1475
+ ensureFarmPackageClientReference(options.root, specifier, exportName, options.file)
1476
+ );
1404
1477
  let output = options.code;
1405
1478
  let next = 0;
1406
1479
  let changed = false;
1407
1480
  for (const entry of [...imports].sort((left, right) => right.start - left.start)) {
1408
1481
  if (farmPackageClientImportExports(entry).length === 0) continue;
1409
1482
  changed = true;
1483
+ const keyword = entry.reexport ? "export" : "import";
1410
1484
  const lines = [];
1411
1485
  if (entry.kept.length > 0) {
1412
1486
  const bindings = entry.kept.map((binding) => `${binding.imported} as ${binding.local}`);
1413
- lines.push(`import { ${bindings.join(", ")} } from ${JSON.stringify(entry.specifier)};`);
1487
+ lines.push(`${keyword} { ${bindings.join(", ")} } from ${JSON.stringify(entry.specifier)};`);
1414
1488
  }
1415
1489
  if (entry.defaultLocal) {
1416
1490
  lines.push(`import ${entry.defaultLocal} from ${reference(entry.specifier, "default")};`);
1417
1491
  }
1418
1492
  for (const binding of entry.named) {
1419
1493
  lines.push(
1420
- `import { ${binding.imported} as ${binding.local} } from ${reference(entry.specifier, binding.imported)};`
1494
+ `${keyword} { ${binding.imported} as ${binding.local} } from ${reference(entry.specifier, binding.imported)};`
1421
1495
  );
1422
1496
  }
1423
1497
  if (entry.namespace) {
@@ -1427,7 +1501,7 @@ function rewriteFarmPackageClientImports(options) {
1427
1501
  lines.push(`import { ${member} as ${local} } from ${reference(entry.specifier, member)};`);
1428
1502
  fields.push(`${member}: ${local}`);
1429
1503
  }
1430
- if (_optionalChain([entry, 'access', _71 => _71.namespace, 'access', _72 => _72.values, 'optionalAccess', _73 => _73.length])) {
1504
+ if (_optionalChain([entry, 'access', _70 => _70.namespace, 'access', _71 => _71.values, 'optionalAccess', _72 => _72.length])) {
1431
1505
  const local = `__farm_package_values_${next++}__`;
1432
1506
  lines.push(`import * as ${local} from ${JSON.stringify(entry.specifier)};`);
1433
1507
  for (const value of entry.namespace.values) fields.push(`${value}: ${local}.${value}`);
@@ -1486,7 +1560,7 @@ function stampPackagePath(target, kind) {
1486
1560
  const stat = _fs2.default.statSync(target, { throwIfNoEntry: false });
1487
1561
  if (!stat || (kind === "file" ? !stat.isFile() : !stat.isDirectory())) return void 0;
1488
1562
  return [target, stat.size, stat.mtimeMs, stat.ctimeMs];
1489
- } catch (e20) {
1563
+ } catch (e22) {
1490
1564
  return void 0;
1491
1565
  }
1492
1566
  }
@@ -1522,7 +1596,7 @@ var PackageClientBoundaryCache = class {
1522
1596
  else this.dirty = true;
1523
1597
  }
1524
1598
  }
1525
- return _optionalChain([entries, 'optionalAccess', _74 => _74.find, 'call', _75 => _75(
1599
+ return _optionalChain([entries, 'optionalAccess', _73 => _73.find, 'call', _74 => _74(
1526
1600
  (entry) => entry.stops.every((file) => visited.has(file)) && !entry.files.some((file) => visited.has(file))
1527
1601
  )]);
1528
1602
  }
@@ -1541,7 +1615,7 @@ var PackageClientBoundaryCache = class {
1541
1615
  await _fs2.default.promises.mkdir(_path2.default.dirname(file), { recursive: true });
1542
1616
  await _fs2.default.promises.writeFile(temporary, contents);
1543
1617
  await _fs2.default.promises.rename(temporary, file);
1544
- } catch (e21) {
1618
+ } catch (e23) {
1545
1619
  await _fs2.default.promises.rm(temporary, { force: true }).catch(() => {
1546
1620
  });
1547
1621
  }
@@ -1556,10 +1630,10 @@ var PackageClientBoundaryCache = class {
1556
1630
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
1557
1631
  _fs2.default.writeFileSync(temporary, contents);
1558
1632
  _fs2.default.renameSync(temporary, file);
1559
- } catch (e22) {
1633
+ } catch (e24) {
1560
1634
  try {
1561
1635
  _fs2.default.rmSync(temporary, { force: true });
1562
- } catch (e23) {
1636
+ } catch (e25) {
1563
1637
  }
1564
1638
  }
1565
1639
  }
@@ -1593,7 +1667,7 @@ var PackageClientBoundaryCache = class {
1593
1667
  }
1594
1668
  const contents = JSON.stringify({
1595
1669
  schema: SCHEMA_VERSION,
1596
- farm: _chunkHM7AGSKUcjs.FARM_VERSION,
1670
+ farm: _chunkSQ6IWJ3Hcjs.FARM_VERSION,
1597
1671
  paths,
1598
1672
  entries
1599
1673
  });
@@ -1630,10 +1704,10 @@ function readStoredCache(file) {
1630
1704
  let value;
1631
1705
  try {
1632
1706
  value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
1633
- } catch (e24) {
1707
+ } catch (e26) {
1634
1708
  return null;
1635
1709
  }
1636
- if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkHM7AGSKUcjs.FARM_VERSION) {
1710
+ if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkSQ6IWJ3Hcjs.FARM_VERSION) {
1637
1711
  return null;
1638
1712
  }
1639
1713
  const { paths, entries } = value;
@@ -1644,7 +1718,7 @@ function readStoredCache(file) {
1644
1718
  const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
1645
1719
  if (usable.length > 0) valid[key] = usable;
1646
1720
  }
1647
- return { schema: SCHEMA_VERSION, farm: _chunkHM7AGSKUcjs.FARM_VERSION, paths, entries: valid };
1721
+ return { schema: SCHEMA_VERSION, farm: _chunkSQ6IWJ3Hcjs.FARM_VERSION, paths, entries: valid };
1648
1722
  }
1649
1723
  function isRecord(value) {
1650
1724
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -1683,7 +1757,7 @@ async function withPackageClientBoundaryCache(operation) {
1683
1757
  }
1684
1758
  }
1685
1759
  function usePackageClientBoundaryCacheFile(file) {
1686
- _optionalChain([getPackageClientBoundaryCache, 'call', _76 => _76(), 'optionalAccess', _77 => _77.load, 'call', _78 => _78(file)]);
1760
+ _optionalChain([getPackageClientBoundaryCache, 'call', _75 => _75(), 'optionalAccess', _76 => _76.load, 'call', _77 => _77(file)]);
1687
1761
  }
1688
1762
  function resolvePackageClientBoundaryCacheFile(root, distDir) {
1689
1763
  return _path2.default.resolve(root, distDir, "cache", "client-boundaries.json");
@@ -1704,7 +1778,7 @@ function readIfExists(filePath) {
1704
1778
  return null;
1705
1779
  }
1706
1780
  return _fs2.default.readFileSync(filePath, "utf-8");
1707
- } catch (e25) {
1781
+ } catch (e27) {
1708
1782
  return null;
1709
1783
  }
1710
1784
  }
@@ -1717,7 +1791,7 @@ function resolveModuleSourcePath(modulePath, root) {
1717
1791
  if (modulePath.startsWith("file://")) {
1718
1792
  try {
1719
1793
  candidates.add(_url.fileURLToPath.call(void 0, modulePath));
1720
- } catch (e26) {
1794
+ } catch (e28) {
1721
1795
  }
1722
1796
  }
1723
1797
  if (modulePath.startsWith("/@fs/")) {
@@ -1730,7 +1804,7 @@ function resolveModuleSourcePath(modulePath, root) {
1730
1804
  candidates.add(_path2.default.join(root, normalized));
1731
1805
  candidates.add(_path2.default.resolve(root, normalized));
1732
1806
  }
1733
- if (_optionalChain([withoutQuery, 'optionalAccess', _79 => _79.startsWith, 'call', _80 => _80("/src/")])) {
1807
+ if (_optionalChain([withoutQuery, 'optionalAccess', _78 => _78.startsWith, 'call', _79 => _79("/src/")])) {
1734
1808
  const normalized = withoutQuery.replace(/^\/+/, "");
1735
1809
  candidates.add(_path2.default.join(process.cwd(), normalized));
1736
1810
  candidates.add(_path2.default.resolve(process.cwd(), normalized));
@@ -1809,7 +1883,7 @@ function hasHydrateExport(content) {
1809
1883
  for (const match of content.matchAll(/\bexport\s*\{([^}]*)\}/g)) {
1810
1884
  for (const specifier of match[1].split(",")) {
1811
1885
  const parts = specifier.trim().split(/\s+as\s+/);
1812
- const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _81 => _81.trim, 'call', _82 => _82()]);
1886
+ const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _80 => _80.trim, 'call', _81 => _81()]);
1813
1887
  if (exportedName2 === "hydrate") {
1814
1888
  return true;
1815
1889
  }
@@ -1886,13 +1960,35 @@ function skipRegularExpression(content, startIndex) {
1886
1960
  }
1887
1961
  return null;
1888
1962
  }
1963
+ var tokenizedModules = /* @__PURE__ */ new Map();
1964
+ var TOKENIZED_MODULE_CACHE_SIZE = 32;
1889
1965
  function tokenizeModuleSource(content) {
1966
+ const cached = tokenizedModules.get(content);
1967
+ if (cached) return cached;
1968
+ const tokens = scanModuleSourceTokens(content);
1969
+ if (tokenizedModules.size >= TOKENIZED_MODULE_CACHE_SIZE) {
1970
+ tokenizedModules.delete(tokenizedModules.keys().next().value);
1971
+ }
1972
+ tokenizedModules.set(content, tokens);
1973
+ return tokens;
1974
+ }
1975
+ function isWhitespaceCode(code) {
1976
+ if (code < 128) return code === 32 || code >= 9 && code <= 13;
1977
+ return /\s/.test(String.fromCharCode(code));
1978
+ }
1979
+ function isIdentifierStartCode(code) {
1980
+ return code >= 97 && code <= 122 || code >= 65 && code <= 90 || code === 95 || code === 36;
1981
+ }
1982
+ function isIdentifierPartCode(code) {
1983
+ return isIdentifierStartCode(code) || code >= 48 && code <= 57;
1984
+ }
1985
+ function scanModuleSourceTokens(content) {
1890
1986
  const tokens = [];
1891
1987
  let index = 0;
1892
1988
  let line = 1;
1893
1989
  while (index < content.length) {
1894
1990
  const character = content[index];
1895
- if (/\s/.test(character)) {
1991
+ if (isWhitespaceCode(content.charCodeAt(index))) {
1896
1992
  if (character === "\n") line++;
1897
1993
  index++;
1898
1994
  continue;
@@ -1962,9 +2058,9 @@ function tokenizeModuleSource(content) {
1962
2058
  }
1963
2059
  continue;
1964
2060
  }
1965
- if (/[A-Za-z_$]/.test(character)) {
2061
+ if (isIdentifierStartCode(content.charCodeAt(index))) {
1966
2062
  const start = index++;
1967
- while (index < content.length && /[\w$]/.test(content[index])) index++;
2063
+ while (index < content.length && isIdentifierPartCode(content.charCodeAt(index))) index++;
1968
2064
  tokens.push({ kind: "identifier", value: content.slice(start, index), line });
1969
2065
  continue;
1970
2066
  }
@@ -1977,7 +2073,7 @@ function isIslandExportStart(tokens, index) {
1977
2073
  const token = tokens[index];
1978
2074
  const previous = tokens[index - 1];
1979
2075
  const startsStatement = !previous || previous.value === ";" || previous.value === "{" || previous.value === "}" || token.line > previous.line;
1980
- return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _83 => _83[index + 1], 'optionalAccess', _84 => _84.value]) === "const" && _optionalChain([tokens, 'access', _85 => _85[index + 2], 'optionalAccess', _86 => _86.value]) === "island";
2076
+ return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _82 => _82[index + 1], 'optionalAccess', _83 => _83.value]) === "const" && _optionalChain([tokens, 'access', _84 => _84[index + 2], 'optionalAccess', _85 => _85.value]) === "island";
1981
2077
  }
1982
2078
  function getIslandStrategyExport(content) {
1983
2079
  if (!content) return null;
@@ -1985,15 +2081,15 @@ function getIslandStrategyExport(content) {
1985
2081
  for (let index = 0; index < tokens.length - 2; index++) {
1986
2082
  if (!isIslandExportStart(tokens, index)) continue;
1987
2083
  let valueIndex = index + 3;
1988
- if (_optionalChain([tokens, 'access', _87 => _87[valueIndex], 'optionalAccess', _88 => _88.value]) === ":") {
2084
+ if (_optionalChain([tokens, 'access', _86 => _86[valueIndex], 'optionalAccess', _87 => _87.value]) === ":") {
1989
2085
  while (valueIndex < tokens.length && tokens[valueIndex].value !== "=") valueIndex++;
1990
2086
  }
1991
- if (_optionalChain([tokens, 'access', _89 => _89[valueIndex], 'optionalAccess', _90 => _90.value]) !== "=") break;
2087
+ if (_optionalChain([tokens, 'access', _88 => _88[valueIndex], 'optionalAccess', _89 => _89.value]) !== "=") break;
1992
2088
  valueIndex++;
1993
2089
  const literal = tokens[valueIndex];
1994
2090
  if (!literal || literal.kind !== "string" || !_chunk7KJJ4SBScjs.isFarmIslandStrategy.call(void 0, literal.value)) break;
1995
2091
  let trailingIndex = valueIndex + 1;
1996
- if (_optionalChain([tokens, 'access', _91 => _91[trailingIndex], 'optionalAccess', _92 => _92.value]) === "as" && _optionalChain([tokens, 'access', _93 => _93[trailingIndex + 1], 'optionalAccess', _94 => _94.value]) === "const") {
2092
+ if (_optionalChain([tokens, 'access', _90 => _90[trailingIndex], 'optionalAccess', _91 => _91.value]) === "as" && _optionalChain([tokens, 'access', _92 => _92[trailingIndex + 1], 'optionalAccess', _93 => _93.value]) === "const") {
1997
2093
  trailingIndex += 2;
1998
2094
  }
1999
2095
  const trailing = tokens[trailingIndex];
@@ -2019,13 +2115,13 @@ function hasAsyncDefaultExport(content) {
2019
2115
  for (let index = 0; index < tokens.length - 2; index++) {
2020
2116
  const token = tokens[index];
2021
2117
  if (token.kind !== "identifier" || token.value !== "export") continue;
2022
- if (_optionalChain([tokens, 'access', _95 => _95[index - 1], 'optionalAccess', _96 => _96.value]) === ".") continue;
2023
- if (_optionalChain([tokens, 'access', _97 => _97[index + 1], 'optionalAccess', _98 => _98.value]) !== "default") continue;
2118
+ if (_optionalChain([tokens, 'access', _94 => _94[index - 1], 'optionalAccess', _95 => _95.value]) === ".") continue;
2119
+ if (_optionalChain([tokens, 'access', _96 => _96[index + 1], 'optionalAccess', _97 => _97.value]) !== "default") continue;
2024
2120
  const exported = tokens[index + 2];
2025
2121
  if (exported.kind === "identifier" && exported.value === "async") {
2026
2122
  return true;
2027
2123
  }
2028
- if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _99 => _99[index + 3], 'optionalAccess', _100 => _100.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
2124
+ if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _98 => _98[index + 3], 'optionalAccess', _99 => _99.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
2029
2125
  return true;
2030
2126
  }
2031
2127
  }
@@ -2033,10 +2129,10 @@ function hasAsyncDefaultExport(content) {
2033
2129
  }
2034
2130
  function isAsyncLocalDeclaration(tokens, name) {
2035
2131
  for (let index = 0; index < tokens.length - 2; index++) {
2036
- if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _101 => _101[index + 1], 'optionalAccess', _102 => _102.value]) === "function" && _optionalChain([tokens, 'access', _103 => _103[index + 2], 'optionalAccess', _104 => _104.value]) === name) {
2132
+ if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _100 => _100[index + 1], 'optionalAccess', _101 => _101.value]) === "function" && _optionalChain([tokens, 'access', _102 => _102[index + 2], 'optionalAccess', _103 => _103.value]) === name) {
2037
2133
  return true;
2038
2134
  }
2039
- if (tokens[index].value === name && _optionalChain([tokens, 'access', _105 => _105[index + 1], 'optionalAccess', _106 => _106.value]) === "=" && _optionalChain([tokens, 'access', _107 => _107[index + 2], 'optionalAccess', _108 => _108.value]) === "async") {
2135
+ if (tokens[index].value === name && _optionalChain([tokens, 'access', _104 => _104[index + 1], 'optionalAccess', _105 => _105.value]) === "=" && _optionalChain([tokens, 'access', _106 => _106[index + 2], 'optionalAccess', _107 => _107.value]) === "async") {
2040
2136
  return true;
2041
2137
  }
2042
2138
  }
@@ -2237,7 +2333,7 @@ function planClientModuleHydration(modulePath, root, mode, options) {
2237
2333
  return plan;
2238
2334
  }
2239
2335
  function usesFarmServerTree(plan) {
2240
- return _optionalChain([plan, 'optionalAccess', _109 => _109.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0 && plan.isolatedBoundaries.every((boundary) => boundary.islandStrategy === "load");
2336
+ return _optionalChain([plan, 'optionalAccess', _108 => _108.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0 && plan.isolatedBoundaries.every((boundary) => boundary.islandStrategy === "load");
2241
2337
  }
2242
2338
  function getMarkdownPageHydrationPlan(componentsModulePath, root, mode = "off", options = {}) {
2243
2339
  const plan = {
@@ -2368,7 +2464,7 @@ function getStaticImportBindings(content) {
2368
2464
  if (!content) return bindings;
2369
2465
  const tokens = tokenizeModuleSource(content);
2370
2466
  for (let index = 0; index < tokens.length; index++) {
2371
- if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _110 => _110[index - 1], 'optionalAccess', _111 => _111.value]) === ".") continue;
2467
+ if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _109 => _109[index - 1], 'optionalAccess', _110 => _110.value]) === ".") continue;
2372
2468
  const first = tokens[index + 1];
2373
2469
  if (!first || first.value === "type" || first.value === "(" || first.kind === "string") {
2374
2470
  continue;
@@ -2376,7 +2472,7 @@ function getStaticImportBindings(content) {
2376
2472
  let fromIndex = -1;
2377
2473
  for (let cursor = index + 1; cursor < tokens.length; cursor++) {
2378
2474
  if (tokens[cursor].value === ";") break;
2379
- if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _112 => _112[cursor + 1], 'optionalAccess', _113 => _113.kind]) === "string") {
2475
+ if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _111 => _111[cursor + 1], 'optionalAccess', _112 => _112.kind]) === "string") {
2380
2476
  fromIndex = cursor;
2381
2477
  break;
2382
2478
  }
@@ -2385,13 +2481,13 @@ function getStaticImportBindings(content) {
2385
2481
  const specifier = tokens[fromIndex + 1].value;
2386
2482
  const clause = tokens.slice(index + 1, fromIndex);
2387
2483
  const localNames = [];
2388
- if (_optionalChain([clause, 'access', _114 => _114[0], 'optionalAccess', _115 => _115.kind]) === "identifier" && clause[0].value !== "type") {
2484
+ if (_optionalChain([clause, 'access', _113 => _113[0], 'optionalAccess', _114 => _114.kind]) === "identifier" && clause[0].value !== "type") {
2389
2485
  localNames.push(clause[0].value);
2390
2486
  }
2391
2487
  const namespaceAs = clause.findIndex(
2392
- (token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _116 => _116[clauseIndex + 1], 'optionalAccess', _117 => _117.value]) === "as"
2488
+ (token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _115 => _115[clauseIndex + 1], 'optionalAccess', _116 => _116.value]) === "as"
2393
2489
  );
2394
- if (namespaceAs !== -1 && _optionalChain([clause, 'access', _118 => _118[namespaceAs + 2], 'optionalAccess', _119 => _119.kind]) === "identifier") {
2490
+ if (namespaceAs !== -1 && _optionalChain([clause, 'access', _117 => _117[namespaceAs + 2], 'optionalAccess', _118 => _118.kind]) === "identifier") {
2395
2491
  localNames.push(clause[namespaceAs + 2].value);
2396
2492
  }
2397
2493
  const openingBrace = clause.findIndex((token) => token.value === "{");
@@ -2401,11 +2497,11 @@ function getStaticImportBindings(content) {
2401
2497
  if (openingBrace !== -1 && closingBrace !== -1) {
2402
2498
  let entryStart = openingBrace + 1;
2403
2499
  for (let cursor = entryStart; cursor <= closingBrace; cursor++) {
2404
- if (cursor !== closingBrace && _optionalChain([clause, 'access', _120 => _120[cursor], 'optionalAccess', _121 => _121.value]) !== ",") continue;
2500
+ if (cursor !== closingBrace && _optionalChain([clause, 'access', _119 => _119[cursor], 'optionalAccess', _120 => _120.value]) !== ",") continue;
2405
2501
  const entry = clause.slice(entryStart, cursor).filter((token) => token.value !== "type");
2406
2502
  const asIndex = entry.findIndex((token) => token.value === "as");
2407
2503
  const local = asIndex === -1 ? entry[0] : entry[asIndex + 1];
2408
- if (_optionalChain([local, 'optionalAccess', _122 => _122.kind]) === "identifier") localNames.push(local.value);
2504
+ if (_optionalChain([local, 'optionalAccess', _121 => _121.kind]) === "identifier") localNames.push(local.value);
2409
2505
  entryStart = cursor + 1;
2410
2506
  }
2411
2507
  }
@@ -2442,14 +2538,14 @@ function findParserSensitiveJsxContainer(content, localBindings) {
2442
2538
  const open = [];
2443
2539
  const isSelfClosing = (openingIndex) => {
2444
2540
  for (let index = openingIndex; index < tokens.length; index++) {
2445
- if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _123 => _123[index - 1], 'optionalAccess', _124 => _124.value]) === "/";
2541
+ if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _122 => _122[index - 1], 'optionalAccess', _123 => _123.value]) === "/";
2446
2542
  }
2447
2543
  return false;
2448
2544
  };
2449
2545
  for (let index = 0; index < tokens.length - 1; index++) {
2450
2546
  if (tokens[index].value !== "<") continue;
2451
2547
  if (tokens[index + 1].value === "/") {
2452
- const closing = _optionalChain([tokens, 'access', _125 => _125[index + 2], 'optionalAccess', _126 => _126.value]);
2548
+ const closing = _optionalChain([tokens, 'access', _124 => _124[index + 2], 'optionalAccess', _125 => _125.value]);
2453
2549
  const at = closing ? open.lastIndexOf(closing) : -1;
2454
2550
  if (at !== -1) open.length = at;
2455
2551
  continue;
@@ -2492,7 +2588,7 @@ function findMatchingToken(tokens, openingIndex, opening, closing) {
2492
2588
  }
2493
2589
  function containsClientJsx(tokens, start, end, clientBindings) {
2494
2590
  for (let index = start; index < end; index++) {
2495
- if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _127 => _127[index + 1], 'optionalAccess', _128 => _128.value]))) return true;
2591
+ if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _126 => _126[index + 1], 'optionalAccess', _127 => _127.value]))) return true;
2496
2592
  }
2497
2593
  return false;
2498
2594
  }
@@ -2530,7 +2626,7 @@ function getClientRenderingHelpers(tokens, clientBindings) {
2530
2626
  let helperName;
2531
2627
  let bodyStart = -1;
2532
2628
  let bodyEnd = -1;
2533
- if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _129 => _129[index + 1], 'optionalAccess', _130 => _130.kind]) === "identifier") {
2629
+ if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _128 => _128[index + 1], 'optionalAccess', _129 => _129.kind]) === "identifier") {
2534
2630
  helperName = tokens[index + 1].value;
2535
2631
  const parametersStart = tokens.findIndex(
2536
2632
  (token, tokenIndex) => tokenIndex > index + 1 && token.value === "("
@@ -2540,21 +2636,21 @@ function getClientRenderingHelpers(tokens, clientBindings) {
2540
2636
  (token, tokenIndex) => tokenIndex > parametersEnd && token.value === "{"
2541
2637
  );
2542
2638
  if (bodyStart !== -1) bodyEnd = findMatchingToken(tokens, bodyStart, "{", "}");
2543
- } else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _131 => _131[index + 1], 'optionalAccess', _132 => _132.kind]) === "identifier") {
2639
+ } else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _130 => _130[index + 1], 'optionalAccess', _131 => _131.kind]) === "identifier") {
2544
2640
  helperName = tokens[index + 1].value;
2545
2641
  let assignmentIndex = -1;
2546
2642
  let arrowIndex = -1;
2547
2643
  for (let cursor = index + 2; cursor < tokens.length; cursor++) {
2548
2644
  if (tokens[cursor].value === ";") break;
2549
2645
  if (assignmentIndex === -1 && tokens[cursor].value === "=") assignmentIndex = cursor;
2550
- if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _133 => _133[cursor + 1], 'optionalAccess', _134 => _134.value]) === ">") {
2646
+ if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _132 => _132[cursor + 1], 'optionalAccess', _133 => _133.value]) === ">") {
2551
2647
  arrowIndex = cursor;
2552
2648
  break;
2553
2649
  }
2554
2650
  }
2555
2651
  if (arrowIndex !== -1) {
2556
2652
  bodyStart = arrowIndex + 2;
2557
- bodyEnd = _optionalChain([tokens, 'access', _135 => _135[bodyStart], 'optionalAccess', _136 => _136.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
2653
+ bodyEnd = _optionalChain([tokens, 'access', _134 => _134[bodyStart], 'optionalAccess', _135 => _135.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
2558
2654
  } else if (assignmentIndex !== -1) {
2559
2655
  bodyStart = assignmentIndex + 1;
2560
2656
  bodyEnd = findStatementEnd(tokens, bodyStart);
@@ -2594,14 +2690,14 @@ function passesElementValuedProps(content, localBindings) {
2594
2690
  else if (value === "}") braceDepth--;
2595
2691
  else if (value === "<" && braceDepth > 0) return true;
2596
2692
  else if (value === ">" && braceDepth === 0) {
2597
- selfClosing = _optionalChain([tokens, 'access', _137 => _137[cursor - 1], 'optionalAccess', _138 => _138.value]) === "/";
2693
+ selfClosing = _optionalChain([tokens, 'access', _136 => _136[cursor - 1], 'optionalAccess', _137 => _137.value]) === "/";
2598
2694
  break;
2599
2695
  }
2600
2696
  }
2601
2697
  if (selfClosing || cursor >= tokens.length) continue;
2602
2698
  for (let child = cursor + 1; child < tokens.length; child++) {
2603
2699
  if (tokens[child].value !== "<") continue;
2604
- const closesBoundary = _optionalChain([tokens, 'access', _139 => _139[child + 1], 'optionalAccess', _140 => _140.value]) === "/" && _optionalChain([tokens, 'access', _141 => _141[child + 2], 'optionalAccess', _142 => _142.value]) === name;
2700
+ const closesBoundary = _optionalChain([tokens, 'access', _138 => _138[child + 1], 'optionalAccess', _139 => _139.value]) === "/" && _optionalChain([tokens, 'access', _140 => _140[child + 2], 'optionalAccess', _141 => _141.value]) === name;
2605
2701
  if (!closesBoundary) return true;
2606
2702
  break;
2607
2703
  }
@@ -2623,7 +2719,7 @@ function rendersOnlyLeafElements(content, localBindings) {
2623
2719
  else if (value === "<" && braceDepth > 0) return false;
2624
2720
  else if (value === ">" && braceDepth === 0) break;
2625
2721
  }
2626
- if (cursor >= tokens.length || _optionalChain([tokens, 'access', _143 => _143[cursor - 1], 'optionalAccess', _144 => _144.value]) !== "/") return false;
2722
+ if (cursor >= tokens.length || _optionalChain([tokens, 'access', _142 => _142[cursor - 1], 'optionalAccess', _143 => _143.value]) !== "/") return false;
2627
2723
  }
2628
2724
  return true;
2629
2725
  }
@@ -2635,9 +2731,9 @@ function hasDynamicJsxCardinality(content, localBindings) {
2635
2731
  const containsDynamicRenderer = (start, end) => containsClientJsx(tokens, start, end, clientBindings) || tokens.slice(start, end).some((token) => renderingHelpers.has(token.value));
2636
2732
  for (let index = 0; index < tokens.length; index++) {
2637
2733
  let callStart = -1;
2638
- if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _145 => _145[index + 1], 'optionalAccess', _146 => _146.value]) === "map" || _optionalChain([tokens, 'access', _147 => _147[index + 1], 'optionalAccess', _148 => _148.value]) === "flatMap") && _optionalChain([tokens, 'access', _149 => _149[index + 2], 'optionalAccess', _150 => _150.value]) === "(") {
2734
+ if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _144 => _144[index + 1], 'optionalAccess', _145 => _145.value]) === "map" || _optionalChain([tokens, 'access', _146 => _146[index + 1], 'optionalAccess', _147 => _147.value]) === "flatMap") && _optionalChain([tokens, 'access', _148 => _148[index + 2], 'optionalAccess', _149 => _149.value]) === "(") {
2639
2735
  callStart = index + 2;
2640
- } else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _151 => _151[index + 1], 'optionalAccess', _152 => _152.value]) === "." && _optionalChain([tokens, 'access', _153 => _153[index + 2], 'optionalAccess', _154 => _154.value]) === "from" && _optionalChain([tokens, 'access', _155 => _155[index + 3], 'optionalAccess', _156 => _156.value]) === "(") {
2736
+ } else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _150 => _150[index + 1], 'optionalAccess', _151 => _151.value]) === "." && _optionalChain([tokens, 'access', _152 => _152[index + 2], 'optionalAccess', _153 => _153.value]) === "from" && _optionalChain([tokens, 'access', _154 => _154[index + 3], 'optionalAccess', _155 => _155.value]) === "(") {
2641
2737
  callStart = index + 3;
2642
2738
  }
2643
2739
  if (callStart !== -1) {
@@ -2646,10 +2742,10 @@ function hasDynamicJsxCardinality(content, localBindings) {
2646
2742
  index = callEnd;
2647
2743
  continue;
2648
2744
  }
2649
- if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _157 => _157[index + 1], 'optionalAccess', _158 => _158.value]) === "(") {
2745
+ if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _156 => _156[index + 1], 'optionalAccess', _157 => _157.value]) === "(") {
2650
2746
  const conditionEnd = findMatchingToken(tokens, index + 1, "(", ")");
2651
2747
  const bodyStart = conditionEnd + 1;
2652
- const bodyEnd = _optionalChain([tokens, 'access', _159 => _159[bodyStart], 'optionalAccess', _160 => _160.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
2748
+ const bodyEnd = _optionalChain([tokens, 'access', _158 => _158[bodyStart], 'optionalAccess', _159 => _159.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
2653
2749
  if (containsDynamicRenderer(bodyStart, bodyEnd === -1 ? tokens.length : bodyEnd)) return true;
2654
2750
  }
2655
2751
  }
@@ -2673,11 +2769,6 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
2673
2769
  const content = readIfExists(moduleSourcePath);
2674
2770
  const parsed = parseClientModuleMetadata(content, false);
2675
2771
  if (parsed.isClientComponent) {
2676
- if (projectRoot && !_path2.default.resolve(moduleSourcePath).startsWith(`${projectRoot}${_path2.default.sep}`)) {
2677
- fallbackReason = `client boundary ${moduleSourcePath} is outside the application root`;
2678
- fallbackHint = "Move the component into the application, or publish it as a package (package client components render as static HTML)";
2679
- return 0;
2680
- }
2681
2772
  if (!isIsolatableClientBoundarySource(content)) {
2682
2773
  fallbackReason = `client boundary ${moduleSourcePath} uses an unsupported export shape`;
2683
2774
  fallbackHint = "Export each component by name (`export function Name`, `export { Name }`, or `export default`) instead of `export *`";
@@ -2703,15 +2794,23 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
2703
2794
  const importedPath = imported.path;
2704
2795
  if (!importedPath) continue;
2705
2796
  let importedBoundaryCount;
2797
+ const workspaceEntry = !imported.local && options.packageReferences ? farmWorkspaceServerEntry(importedPath) : null;
2706
2798
  if (imported.local) {
2707
2799
  importedBoundaryCount = visit(importedPath);
2800
+ } else if (workspaceEntry) {
2801
+ importedBoundaryCount = visit(workspaceEntry);
2708
2802
  } else {
2709
2803
  const reactServerClientNames = options.packageReferences && projectRoot ? findFarmReactServerClientNames(_nullishCoalesce(content, () => ( "")), moduleSourcePath, specifier) : null;
2710
2804
  if (reactServerClientNames) {
2711
2805
  importedBoundaryCount = 0;
2712
2806
  for (const exportName of reactServerClientNames) {
2713
2807
  importedBoundaryCount += visit(
2714
- ensureFarmPackageClientReference(projectRoot, specifier, exportName)
2808
+ ensureFarmPackageClientReference(
2809
+ projectRoot,
2810
+ specifier,
2811
+ exportName,
2812
+ moduleSourcePath
2813
+ )
2715
2814
  );
2716
2815
  }
2717
2816
  for (const clientFile of _nullishCoalesce(findFarmReactServerClientModules(
@@ -2735,7 +2834,12 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
2735
2834
  for (const reference of references) {
2736
2835
  for (const exportName of farmPackageClientImportExports(reference)) {
2737
2836
  importedBoundaryCount += visit(
2738
- ensureFarmPackageClientReference(projectRoot, specifier, exportName)
2837
+ ensureFarmPackageClientReference(
2838
+ projectRoot,
2839
+ specifier,
2840
+ exportName,
2841
+ moduleSourcePath
2842
+ )
2739
2843
  );
2740
2844
  }
2741
2845
  }
@@ -2838,10 +2942,16 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
2838
2942
  islandStrategy: shouldHydrate ? _nullishCoalesce(_nullishCoalesce(parsed.islandStrategy, () => ( importedIslandStrategy)), () => ( "load")) : null
2839
2943
  };
2840
2944
  }
2945
+ function farmWorkspaceServerEntry(entry) {
2946
+ const real = realpathOrSelf(entry);
2947
+ if (real.split(_path2.default.sep).includes("node_modules")) return null;
2948
+ if (parseClientModuleMetadata(readIfExists(real), false).isClientComponent) return null;
2949
+ return real;
2950
+ }
2841
2951
  function realpathOrSelf(file) {
2842
2952
  try {
2843
2953
  return _fs2.default.realpathSync(file);
2844
- } catch (e27) {
2954
+ } catch (e29) {
2845
2955
  return file;
2846
2956
  }
2847
2957
  }
@@ -2868,7 +2978,7 @@ function inspectPackageClientBoundary(resolvedPath, root, visited) {
2868
2978
  }
2869
2979
  function traversePackageClientBoundary(resolvedPath, root, visited, trace) {
2870
2980
  if (!resolvedPath || visited.has(resolvedPath)) {
2871
- if (resolvedPath) _optionalChain([trace, 'optionalAccess', _161 => _161.stop, 'call', _162 => _162(resolvedPath)]);
2981
+ if (resolvedPath) _optionalChain([trace, 'optionalAccess', _160 => _160.stop, 'call', _161 => _161(resolvedPath)]);
2872
2982
  return {
2873
2983
  isClientComponent: false,
2874
2984
  shouldHydrate: false,
@@ -2876,7 +2986,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace) {
2876
2986
  };
2877
2987
  }
2878
2988
  visited.add(resolvedPath);
2879
- _optionalChain([trace, 'optionalAccess', _163 => _163.visit, 'call', _164 => _164(resolvedPath)]);
2989
+ _optionalChain([trace, 'optionalAccess', _162 => _162.visit, 'call', _163 => _163(resolvedPath)]);
2880
2990
  const content = readIfExists(resolvedPath);
2881
2991
  const parsed = parseClientModuleMetadata(content, false);
2882
2992
  let importsClientBoundary = false;
@@ -2926,7 +3036,7 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
2926
3036
  braceDepth = Math.max(0, braceDepth - 1);
2927
3037
  continue;
2928
3038
  }
2929
- if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _165 => _165[index - 1], 'optionalAccess', _166 => _166.value]) !== "." && _optionalChain([tokens, 'access', _167 => _167[index + 1], 'optionalAccess', _168 => _168.value]) === "(" && _optionalChain([tokens, 'access', _169 => _169[index + 2], 'optionalAccess', _170 => _170.kind]) === "string") {
3039
+ if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _164 => _164[index - 1], 'optionalAccess', _165 => _165.value]) !== "." && _optionalChain([tokens, 'access', _166 => _166[index + 1], 'optionalAccess', _167 => _167.value]) === "(" && _optionalChain([tokens, 'access', _168 => _168[index + 2], 'optionalAccess', _169 => _169.kind]) === "string") {
2930
3040
  matches.add(tokens[index + 2].value);
2931
3041
  continue;
2932
3042
  }
@@ -2936,7 +3046,7 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
2936
3046
  }
2937
3047
  if (reexportsOnly && keyword.value !== "export") continue;
2938
3048
  const previous = tokens[index - 1];
2939
- if (_optionalChain([previous, 'optionalAccess', _171 => _171.value]) === ".") continue;
3049
+ if (_optionalChain([previous, 'optionalAccess', _170 => _170.value]) === ".") continue;
2940
3050
  const first = tokens[index + 1];
2941
3051
  if (!first || first.value === "type" || first.value === "(" || first.value === ".") {
2942
3052
  continue;
@@ -2952,7 +3062,7 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
2952
3062
  for (let cursor = index + 1; cursor < tokens.length; cursor++) {
2953
3063
  const token = tokens[cursor];
2954
3064
  if (token.value === ";") break;
2955
- if (token.value === "from" && _optionalChain([tokens, 'access', _172 => _172[cursor + 1], 'optionalAccess', _173 => _173.kind]) === "string") {
3065
+ if (token.value === "from" && _optionalChain([tokens, 'access', _171 => _171[cursor + 1], 'optionalAccess', _172 => _172.kind]) === "string") {
2956
3066
  fromIndex = cursor;
2957
3067
  break;
2958
3068
  }
@@ -2970,14 +3080,14 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
2970
3080
  return Array.from(matches);
2971
3081
  }
2972
3082
  function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
2973
- if (_optionalChain([tokens, 'access', _174 => _174[startIndex], 'optionalAccess', _175 => _175.value]) !== "{") return false;
3083
+ if (_optionalChain([tokens, 'access', _173 => _173[startIndex], 'optionalAccess', _174 => _174.value]) !== "{") return false;
2974
3084
  const closingBraceIndex = tokens.findIndex(
2975
3085
  (token, index) => index > startIndex && index < endIndex && token.value === "}"
2976
3086
  );
2977
3087
  if (closingBraceIndex === -1) return false;
2978
3088
  let entryStartsAt = startIndex + 1;
2979
3089
  for (let index = entryStartsAt; index <= closingBraceIndex; index++) {
2980
- if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _176 => _176[index], 'optionalAccess', _177 => _177.value]) !== ",") continue;
3090
+ if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _175 => _175[index], 'optionalAccess', _176 => _176.value]) !== ",") continue;
2981
3091
  const entry = tokens.slice(entryStartsAt, index);
2982
3092
  if (entry.length > 0 && entry[0].value !== "type") return false;
2983
3093
  entryStartsAt = index + 1;
@@ -2988,6 +3098,13 @@ function resolveImportedModule(importerPath, specifier, root) {
2988
3098
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
2989
3099
  return { path: resolveImportedModuleSourcePath(importerPath, specifier, root), local: true };
2990
3100
  }
3101
+ const resolveFrom = parseFarmResolveFrom(specifier, importerPath);
3102
+ if (resolveFrom) {
3103
+ return {
3104
+ path: resolvePackageModuleSourcePath(resolveFrom.importer, resolveFrom.specifier),
3105
+ local: false
3106
+ };
3107
+ }
2991
3108
  const aliased = resolveProjectAliasSourcePath(specifier, root);
2992
3109
  if (aliased) return { path: aliased, local: true };
2993
3110
  const packagePath = resolvePackageModuleSourcePath(importerPath, specifier, root);
@@ -3034,14 +3151,14 @@ function getProjectImportAliases(projectRoot) {
3034
3151
  const stamp = PROJECT_ALIAS_FILES.map((file) => {
3035
3152
  try {
3036
3153
  return String(_fs2.default.statSync(_path2.default.join(projectRoot, file)).mtimeMs);
3037
- } catch (e28) {
3154
+ } catch (e30) {
3038
3155
  return "-";
3039
3156
  }
3040
3157
  }).join(":");
3041
3158
  const sourceDir = _chunkRE5E2G5Scjs.getFarmProjectSourceDir.call(void 0, projectRoot);
3042
3159
  const cacheStamp = `${stamp}:${sourceDir}`;
3043
3160
  const cached = projectImportAliasCache.get(projectRoot);
3044
- if (_optionalChain([cached, 'optionalAccess', _178 => _178.stamp]) === cacheStamp) return cached.aliases;
3161
+ if (_optionalChain([cached, 'optionalAccess', _177 => _177.stamp]) === cacheStamp) return cached.aliases;
3045
3162
  const aliases = [
3046
3163
  ...readTsconfigPathAliases(projectRoot),
3047
3164
  ...readPackageImportAliases(projectRoot)
@@ -3062,7 +3179,7 @@ function readTsconfigPathAliases(projectRoot) {
3062
3179
  const configPath = _path2.default.join(projectRoot, name);
3063
3180
  if (!_fs2.default.existsSync(configPath)) continue;
3064
3181
  const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
3065
- if (!_optionalChain([resolved, 'optionalAccess', _179 => _179.paths])) return [];
3182
+ if (!_optionalChain([resolved, 'optionalAccess', _178 => _178.paths])) return [];
3066
3183
  const base = _nullishCoalesce(resolved.baseUrl, () => ( resolved.pathsDirectory));
3067
3184
  return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
3068
3185
  if (!Array.isArray(targets)) return [];
@@ -3097,18 +3214,18 @@ function readTsconfigPaths(configPath, visited) {
3097
3214
  inherited = _nullishCoalesce(readTsconfigPaths(parentPath, visited), () => ( inherited));
3098
3215
  }
3099
3216
  const options = _nullishCoalesce(config.compilerOptions, () => ( {}));
3100
- const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _180 => _180.baseUrl]);
3217
+ const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _179 => _179.baseUrl]);
3101
3218
  if (options.paths && typeof options.paths === "object") {
3102
3219
  return { paths: options.paths, pathsDirectory: directory, baseUrl };
3103
3220
  }
3104
3221
  return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
3105
3222
  }
3106
3223
  function readPackageImportAliases(projectRoot) {
3107
- const imports = _optionalChain([readPackageJson, 'call', _181 => _181(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _182 => _182.imports]);
3224
+ const imports = _optionalChain([readPackageJson, 'call', _180 => _180(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _181 => _181.imports]);
3108
3225
  if (!imports || typeof imports !== "object") return [];
3109
3226
  return Object.entries(imports).flatMap(([pattern, value]) => {
3110
3227
  const target = resolveConditionalExportTarget(value);
3111
- if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _183 => _183.startsWith, 'call', _184 => _184("./")])) return [];
3228
+ if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _182 => _182.startsWith, 'call', _183 => _183("./")])) return [];
3112
3229
  const wildcardIndex = pattern.indexOf("*");
3113
3230
  return [
3114
3231
  {
@@ -3124,7 +3241,7 @@ function readJsonWithComments(filePath) {
3124
3241
  let source;
3125
3242
  try {
3126
3243
  source = _fs2.default.readFileSync(filePath, "utf8");
3127
- } catch (e29) {
3244
+ } catch (e31) {
3128
3245
  return null;
3129
3246
  }
3130
3247
  let output = "";
@@ -3152,7 +3269,7 @@ function readJsonWithComments(filePath) {
3152
3269
  }
3153
3270
  try {
3154
3271
  return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
3155
- } catch (e30) {
3272
+ } catch (e32) {
3156
3273
  return null;
3157
3274
  }
3158
3275
  }
@@ -3174,15 +3291,15 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
3174
3291
  const packageJsonPath = _path2.default.join(packageDirectory, "package.json");
3175
3292
  const packageJson = readPackageJson(packageJsonPath);
3176
3293
  const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
3177
- const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _185 => _185.exports]), exportKey);
3294
+ const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _184 => _184.exports]), exportKey);
3178
3295
  const candidates = /* @__PURE__ */ new Set();
3179
- if (_optionalChain([exportTarget, 'optionalAccess', _186 => _186.startsWith, 'call', _187 => _187("./")])) {
3296
+ if (_optionalChain([exportTarget, 'optionalAccess', _185 => _185.startsWith, 'call', _186 => _186("./")])) {
3180
3297
  candidates.add(_path2.default.resolve(packageDirectory, exportTarget));
3181
3298
  }
3182
3299
  if (packageSubpath) {
3183
3300
  candidates.add(_path2.default.join(packageDirectory, packageSubpath));
3184
3301
  } else {
3185
- for (const entry of [_optionalChain([packageJson, 'optionalAccess', _188 => _188.browser]), _optionalChain([packageJson, 'optionalAccess', _189 => _189.module]), _optionalChain([packageJson, 'optionalAccess', _190 => _190.main])]) {
3302
+ for (const entry of [_optionalChain([packageJson, 'optionalAccess', _187 => _187.browser]), _optionalChain([packageJson, 'optionalAccess', _188 => _188.module]), _optionalChain([packageJson, 'optionalAccess', _189 => _189.main])]) {
3186
3303
  if (typeof entry === "string") candidates.add(_path2.default.resolve(packageDirectory, entry));
3187
3304
  }
3188
3305
  candidates.add(_path2.default.join(packageDirectory, "index"));
@@ -3218,7 +3335,7 @@ function findPackageDirectory2(importerPath, packageName, root) {
3218
3335
  function readPackageJson(packageJsonPath) {
3219
3336
  try {
3220
3337
  return JSON.parse(_fs2.default.readFileSync(packageJsonPath, "utf8"));
3221
- } catch (e31) {
3338
+ } catch (e33) {
3222
3339
  return null;
3223
3340
  }
3224
3341
  }
@@ -3247,7 +3364,7 @@ function resolvePackageExport(exportsField, exportKey) {
3247
3364
  if (!exportKey.startsWith(prefix) || !exportKey.endsWith(suffix)) continue;
3248
3365
  const wildcard = exportKey.slice(prefix.length, exportKey.length - suffix.length);
3249
3366
  const target = resolveConditionalExportTarget(value);
3250
- return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _191 => _191.replace, 'call', _192 => _192("*", wildcard)]), () => ( null));
3367
+ return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _190 => _190.replace, 'call', _191 => _191("*", wildcard)]), () => ( null));
3251
3368
  }
3252
3369
  return null;
3253
3370
  }
@@ -3280,7 +3397,7 @@ function resolveSourceCandidate(candidates) {
3280
3397
  for (const sourcePath of paths) {
3281
3398
  try {
3282
3399
  if (_fs2.default.statSync(sourcePath).isFile()) return sourcePath;
3283
- } catch (e32) {
3400
+ } catch (e34) {
3284
3401
  }
3285
3402
  }
3286
3403
  }
@@ -3292,7 +3409,18 @@ function isFarmPackageClientBoundary(importerPath, specifier, root) {
3292
3409
  return inspectPackageClientBoundary(imported.path, root, /* @__PURE__ */ new Set()).shouldHydrate;
3293
3410
  }
3294
3411
  var CLIENT_PACKAGE_SCAN_EXTENSIONS = /\.(?:[cm]?[jt]sx?)$/;
3295
- var CLIENT_PACKAGE_SCAN_SKIP = /* @__PURE__ */ new Set(["node_modules", ".farm", ".git", "dist", ".output"]);
3412
+ var CLIENT_PACKAGE_SCAN_SKIP = /* @__PURE__ */ new Set([
3413
+ "node_modules",
3414
+ ".farm",
3415
+ ".git",
3416
+ "dist",
3417
+ ".output",
3418
+ "__tests__"
3419
+ ]);
3420
+ var TEST_FILE = /\.(?:test|spec)\.[cm]?[jt]sx?$/;
3421
+ function isScannedSourceFile(name) {
3422
+ return CLIENT_PACKAGE_SCAN_EXTENSIONS.test(name) && !name.endsWith(".d.ts") && !TEST_FILE.test(name);
3423
+ }
3296
3424
  function bareSpecifierPackage(specifier) {
3297
3425
  if (specifier.startsWith(".") || specifier.startsWith("/") || specifier.startsWith("#") || specifier.startsWith("node:") || specifier.startsWith("virtual:") || specifier.includes("\0") || // A package's stylesheet or asset is not a module for the optimizer.
3298
3426
  /\.(?:css|scss|sass|less|styl|svg|png|jpe?g|gif|webp|avif|ico|woff2?|ttf|json|wasm)$/.test(
@@ -3312,7 +3440,7 @@ function scanFarmPackageImports(directory, root) {
3312
3440
  let entries;
3313
3441
  try {
3314
3442
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3315
- } catch (e33) {
3443
+ } catch (e35) {
3316
3444
  return;
3317
3445
  }
3318
3446
  for (const entry of entries) {
@@ -3322,8 +3450,7 @@ function scanFarmPackageImports(directory, root) {
3322
3450
  if (!CLIENT_PACKAGE_SCAN_SKIP.has(entry.name)) walk2(file);
3323
3451
  continue;
3324
3452
  }
3325
- if (!CLIENT_PACKAGE_SCAN_EXTENSIONS.test(entry.name) || entry.name.endsWith(".d.ts"))
3326
- continue;
3453
+ if (!isScannedSourceFile(entry.name)) continue;
3327
3454
  const content = readIfExists(file);
3328
3455
  if (!content) continue;
3329
3456
  const client = hasUseClientDirective(content);
@@ -3346,7 +3473,7 @@ function collectFarmServerBundledPackageInfo(directory) {
3346
3473
  let entries;
3347
3474
  try {
3348
3475
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3349
- } catch (e34) {
3476
+ } catch (e36) {
3350
3477
  return;
3351
3478
  }
3352
3479
  for (const entry of entries) {
@@ -3356,8 +3483,7 @@ function collectFarmServerBundledPackageInfo(directory) {
3356
3483
  if (!CLIENT_PACKAGE_SCAN_SKIP.has(entry.name)) walk2(file);
3357
3484
  continue;
3358
3485
  }
3359
- if (!CLIENT_PACKAGE_SCAN_EXTENSIONS.test(entry.name) || entry.name.endsWith(".d.ts"))
3360
- continue;
3486
+ if (!isScannedSourceFile(entry.name)) continue;
3361
3487
  const content = readIfExists(file);
3362
3488
  if (!content) continue;
3363
3489
  for (const specifier of new Set(getImportSpecifiers(content))) {
@@ -3386,14 +3512,14 @@ function getFarmClientReachableModules(directory, root) {
3386
3512
  let entries;
3387
3513
  try {
3388
3514
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3389
- } catch (e35) {
3515
+ } catch (e37) {
3390
3516
  return;
3391
3517
  }
3392
3518
  for (const entry of entries) {
3393
3519
  const file = _path2.default.join(current, entry.name);
3394
3520
  if (entry.isDirectory()) {
3395
3521
  if (!entry.name.startsWith(".") && !CLIENT_PACKAGE_SCAN_SKIP.has(entry.name)) walk2(file);
3396
- } else if (CLIENT_PACKAGE_SCAN_EXTENSIONS.test(entry.name) && !entry.name.endsWith(".d.ts")) {
3522
+ } else if (isScannedSourceFile(entry.name)) {
3397
3523
  const content = readIfExists(file);
3398
3524
  if (hasUseClientDirective(content) || hasHydrateExport(content)) queue.push(file);
3399
3525
  }
@@ -3489,13 +3615,13 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3489
3615
  let projectRoot = process.cwd();
3490
3616
  let sources;
3491
3617
  const routeSourceFiles = () => {
3492
- const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _193 => _193.getProgrammaticClientRoutes, 'call', _194 => _194()]);
3493
- if (_optionalChain([sources, 'optionalAccess', _195 => _195.for]) !== clientRoutes || !sources) {
3618
+ const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _192 => _192.getProgrammaticClientRoutes, 'call', _193 => _193()]);
3619
+ if (_optionalChain([sources, 'optionalAccess', _194 => _194.for]) !== clientRoutes || !sources) {
3494
3620
  sources = {
3495
3621
  for: clientRoutes,
3496
3622
  files: /* @__PURE__ */ new Set([
3497
3623
  ...routesFiles,
3498
- ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _196 => _196.routeSourceFiles]), () => ( []))].map(resolvedFile)
3624
+ ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _195 => _195.routeSourceFiles]), () => ( []))].map(resolvedFile)
3499
3625
  ])
3500
3626
  };
3501
3627
  }
@@ -3508,10 +3634,10 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3508
3634
  configResolved(config) {
3509
3635
  isBuild = config.command === "build";
3510
3636
  projectRoot = config.root;
3511
- farmApi = _optionalChain([config, 'access', _197 => _197.plugins, 'access', _198 => _198.find, 'call', _199 => _199((plugin) => plugin.name === "farm"), 'optionalAccess', _200 => _200.api]);
3637
+ farmApi = _optionalChain([config, 'access', _196 => _196.plugins, 'access', _197 => _197.find, 'call', _198 => _198((plugin) => plugin.name === "farm"), 'optionalAccess', _199 => _199.api]);
3512
3638
  sources = void 0;
3513
3639
  routesFiles = new Set(
3514
- _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
3640
+ _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
3515
3641
  (source) => _chunkE7QOEV5Zcjs.PROGRAMMATIC_ROUTE_FILE_NAMES.map(
3516
3642
  (name) => resolvedFile(_path2.default.resolve(source.root, source.srcDir, name))
3517
3643
  )
@@ -3521,14 +3647,14 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3521
3647
  transform(code, id, transformOptions) {
3522
3648
  const environment = resolveBuildEnvironment(
3523
3649
  this,
3524
- _optionalChain([transformOptions, 'optionalAccess', _201 => _201.ssr])
3650
+ _optionalChain([transformOptions, 'optionalAccess', _200 => _200.ssr])
3525
3651
  );
3526
3652
  const parse2 = (source) => this.parse(source);
3527
3653
  const result = transformEnvironmentFunctions({ code, id, environment, parse: parse2 });
3528
3654
  if (environment === "client" && !isBuild && !_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
3529
3655
  this.error(routeSourceError(moduleFile(id)));
3530
3656
  }
3531
- if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _202 => _202.experimental, 'optionalAccess', _203 => _203.serverComponents])) === "islands" && isApplicationScript(id)) {
3657
+ if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _201 => _201.experimental, 'optionalAccess', _202 => _202.serverComponents])) === "islands" && isApplicationScript(id)) {
3532
3658
  const file = id.split("?", 1)[0];
3533
3659
  const root = _fs.realpathSync.call(void 0, _nullishCoalesce(options.root, () => ( projectRoot)));
3534
3660
  const clientCode = getFarmClientReachableModules(root, root).has(_path2.default.resolve(file)) || _fs.existsSync.call(void 0, file) && hasUseClientDirective(_fs.readFileSync.call(void 0, file, "utf8"));
@@ -3549,7 +3675,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3549
3675
  for (const id of this.getModuleIds()) {
3550
3676
  if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
3551
3677
  const chain = findClientNodeBuiltinChain(id, (moduleId) => {
3552
- return _optionalChain([this, 'access', _204 => _204.getModuleInfo, 'call', _205 => _205(moduleId), 'optionalAccess', _206 => _206.importedIds]);
3678
+ return _optionalChain([this, 'access', _203 => _203.getModuleInfo, 'call', _204 => _204(moduleId), 'optionalAccess', _205 => _205.importedIds]);
3553
3679
  });
3554
3680
  if (chain) {
3555
3681
  this.error(
@@ -3560,8 +3686,8 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3560
3686
  }
3561
3687
  if (!forbidden.has(moduleFile(id))) continue;
3562
3688
  const info = this.getModuleInfo(id);
3563
- if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _207 => _207.code]))) continue;
3564
- this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _208 => _208.importers, 'access', _209 => _209.map, 'call', _210 => _210(moduleFile)])));
3689
+ if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _206 => _206.code]))) continue;
3690
+ this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _207 => _207.importers, 'access', _208 => _208.map, 'call', _209 => _209(moduleFile)])));
3565
3691
  }
3566
3692
  }
3567
3693
  };
@@ -3575,13 +3701,13 @@ function moduleFile(id) {
3575
3701
  function resolvedFile(filePath) {
3576
3702
  try {
3577
3703
  return moduleFile(_fs.realpathSync.call(void 0, filePath));
3578
- } catch (e36) {
3704
+ } catch (e38) {
3579
3705
  return moduleFile(filePath);
3580
3706
  }
3581
3707
  }
3582
3708
  function resolveBuildEnvironment(context, ssr) {
3583
- if (_optionalChain([context, 'access', _211 => _211.environment, 'optionalAccess', _212 => _212.name]) === "client") return "client";
3584
- if (_optionalChain([context, 'access', _213 => _213.environment, 'optionalAccess', _214 => _214.name]) === "rsc" || _optionalChain([context, 'access', _215 => _215.environment, 'optionalAccess', _216 => _216.name]) === "ssr") {
3709
+ if (_optionalChain([context, 'access', _210 => _210.environment, 'optionalAccess', _211 => _211.name]) === "client") return "client";
3710
+ if (_optionalChain([context, 'access', _212 => _212.environment, 'optionalAccess', _213 => _213.name]) === "rsc" || _optionalChain([context, 'access', _214 => _214.environment, 'optionalAccess', _215 => _215.name]) === "ssr") {
3585
3711
  return "server";
3586
3712
  }
3587
3713
  return ssr ? "server" : "client";
@@ -3882,4 +4008,7 @@ function transformError(id, message) {
3882
4008
 
3883
4009
 
3884
4010
 
3885
- exports.resolveFarmBrowserBuiltin = resolveFarmBrowserBuiltin; exports.loadFarmBrowserBuiltin = loadFarmBrowserBuiltin; exports.farmBrowserBuiltinsOptimizerPlugin = farmBrowserBuiltinsOptimizerPlugin; exports.programmaticClientRouteKey = programmaticClientRouteKey; exports.resolveProgrammaticClientRoutes = resolveProgrammaticClientRoutes; exports.createEvaluatedRouteGraph = createEvaluatedRouteGraph; exports.mergeProgrammaticClientRoutes = mergeProgrammaticClientRoutes; exports.generateProgrammaticClientRouteModule = generateProgrammaticClientRouteModule; exports.rewriteFarmReactServerClientModuleImports = rewriteFarmReactServerClientModuleImports; exports.rewriteFarmReactServerImports = rewriteFarmReactServerImports; exports.invalidateFarmClientOnlyScan = invalidateFarmClientOnlyScan; exports.farmRelativeImportFiles = farmRelativeImportFiles; exports.FARM_CLIENT_REFERENCE_PRAGMA = FARM_CLIENT_REFERENCE_PRAGMA; exports.FARM_CLIENT_REFERENCE_DIRECTORY = FARM_CLIENT_REFERENCE_DIRECTORY; exports.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; exports.collectFarmRenderedClientModules = collectFarmRenderedClientModules; exports.collectFarmServerStylesheets = collectFarmServerStylesheets; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.usesFarmServerTree = usesFarmServerTree; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.isIsolatableClientBoundarySource = isIsolatableClientBoundarySource; exports.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackageInfo = collectFarmServerBundledPackageInfo; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;
4011
+
4012
+
4013
+
4014
+ exports.FARM_BROWSER_BUILTIN_PREFIX = FARM_BROWSER_BUILTIN_PREFIX; exports.resolveFarmBrowserBuiltin = resolveFarmBrowserBuiltin; exports.loadFarmBrowserBuiltin = loadFarmBrowserBuiltin; exports.farmBrowserBuiltinsOptimizerPlugin = farmBrowserBuiltinsOptimizerPlugin; exports.programmaticClientRouteKey = programmaticClientRouteKey; exports.resolveProgrammaticClientRoutes = resolveProgrammaticClientRoutes; exports.createEvaluatedRouteGraph = createEvaluatedRouteGraph; exports.mergeProgrammaticClientRoutes = mergeProgrammaticClientRoutes; exports.generateProgrammaticClientRouteModule = generateProgrammaticClientRouteModule; exports.rewriteFarmReactServerClientModuleImports = rewriteFarmReactServerClientModuleImports; exports.rewriteFarmReactServerImports = rewriteFarmReactServerImports; exports.invalidateFarmClientOnlyScan = invalidateFarmClientOnlyScan; exports.farmRelativeImportFiles = farmRelativeImportFiles; exports.FARM_CLIENT_REFERENCE_PRAGMA = FARM_CLIENT_REFERENCE_PRAGMA; exports.FARM_CLIENT_REFERENCE_DIRECTORY = FARM_CLIENT_REFERENCE_DIRECTORY; exports.FARM_RESOLVE_FROM_PREFIX = FARM_RESOLVE_FROM_PREFIX; exports.parseFarmResolveFrom = parseFarmResolveFrom; exports.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; exports.collectFarmRenderedClientModules = collectFarmRenderedClientModules; exports.collectFarmServerStylesheets = collectFarmServerStylesheets; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.usesFarmServerTree = usesFarmServerTree; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.isIsolatableClientBoundarySource = isIsolatableClientBoundarySource; exports.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackageInfo = collectFarmServerBundledPackageInfo; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;