@farm.js/core 0.2.0-beta.1 → 0.2.0-beta.2

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 (244) hide show
  1. package/dist/{agent-mcp-handler-IUL6OPC3.cjs → agent-mcp-handler-EXOG55M4.cjs} +5 -5
  2. package/dist/{agent-mcp-handler-GDY5CPPW.mjs → agent-mcp-handler-VX4NDDHR.mjs} +4 -4
  3. package/dist/{agent-mcp.d-BdM0pIrD.d.ts → agent-mcp.d-DBaonhLg.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CMGqpUbk.d.mts → agent-mcp.d-DhCEzIfu.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +2 -2
  6. package/dist/agent-runtime.d.mts +1 -1
  7. package/dist/agent-runtime.d.ts +1 -1
  8. package/dist/agent-runtime.mjs +1 -1
  9. package/dist/analyzer-OWIHFO5M.cjs +17 -0
  10. package/dist/{analyzer-RYSF2BM3.mjs → analyzer-T2U345WL.mjs} +2 -2
  11. package/dist/api/node.d.mts +3 -3
  12. package/dist/api/node.d.ts +3 -3
  13. package/dist/api/route-manager.d.mts +3 -3
  14. package/dist/api/route-manager.d.ts +3 -3
  15. package/dist/api/runtime.d.mts +2 -2
  16. package/dist/api/runtime.d.ts +2 -2
  17. package/dist/api.d.mts +4 -4
  18. package/dist/api.d.ts +4 -4
  19. package/dist/{app-manifest.d-COhjPgHn.d.ts → app-manifest.d-nLVFFd7N.d.ts} +1 -1
  20. package/dist/{app-manifest.d-BeDB2OVm.d.mts → app-manifest.d-uE0JGZKN.d.mts} +1 -1
  21. package/dist/app-markdown.cjs +6 -4
  22. package/dist/app-markdown.d.mts +3 -3
  23. package/dist/app-markdown.d.ts +3 -3
  24. package/dist/app-markdown.mjs +7 -5
  25. package/dist/{app.d-CoY-zsJt.d.ts → app.d-CwVkAUEU.d.ts} +13 -7
  26. package/dist/{app.d-DE5KNbmf.d.mts → app.d-DGGcNXV7.d.mts} +13 -7
  27. package/dist/{chunk-AG27TI6Q.mjs → chunk-23NBOP43.mjs} +3 -0
  28. package/dist/{chunk-OOOUYA6L.mjs → chunk-26ZTI2ZO.mjs} +4 -4
  29. package/dist/{chunk-CPMK7EFR.mjs → chunk-4Q263EQI.mjs} +2 -2
  30. package/dist/{chunk-2NOHVIJ3.cjs → chunk-5LJF4KUZ.cjs} +17 -4
  31. package/dist/{chunk-5AL2GXAU.mjs → chunk-7MMDEIVC.mjs} +1 -1
  32. package/dist/{chunk-QBXS4TNG.mjs → chunk-BL54BTVJ.mjs} +1 -1
  33. package/dist/{chunk-VZWAXQME.mjs → chunk-BW563VZZ.mjs} +34 -2
  34. package/dist/{chunk-ZPQY7O64.cjs → chunk-CBB7I6HW.cjs} +3 -3
  35. package/dist/{chunk-KMGHXIDA.cjs → chunk-CHOOBTDD.cjs} +2 -2
  36. package/dist/{chunk-ISSFWEPY.mjs → chunk-COK4IXOO.mjs} +35 -18
  37. package/dist/{chunk-YU2MNIIY.mjs → chunk-CRF5MOLO.mjs} +17 -4
  38. package/dist/{chunk-NQ3Y6E2T.mjs → chunk-CV4MOEMO.mjs} +2 -2
  39. package/dist/{chunk-OLKYHTLN.cjs → chunk-DA432P2F.cjs} +5 -5
  40. package/dist/{chunk-B3HQTGXS.cjs → chunk-DVAZ53X6.cjs} +6 -1
  41. package/dist/{chunk-XRSNW4IU.mjs → chunk-E72GG355.mjs} +5 -0
  42. package/dist/{chunk-FJGA3XWL.cjs → chunk-EA5HVG45.cjs} +2 -2
  43. package/dist/{chunk-NG2EZ6QS.cjs → chunk-EODGIFI7.cjs} +4 -2
  44. package/dist/{chunk-Y3DO7BIJ.cjs → chunk-EUZFBHPP.cjs} +3 -0
  45. package/dist/{chunk-KRU3XPOW.cjs → chunk-EXPVSFAG.cjs} +14 -11
  46. package/dist/{chunk-EACD6ND7.cjs → chunk-EZUTDTFM.cjs} +7 -7
  47. package/dist/{chunk-KCJBIWBM.mjs → chunk-GVORDLLV.mjs} +1 -1
  48. package/dist/{chunk-XGL42MQ7.mjs → chunk-HIDZM23B.mjs} +1 -1
  49. package/dist/{chunk-23BZ7ZH6.mjs → chunk-HNB5JHBO.mjs} +5 -2
  50. package/dist/{chunk-DZC2XGK4.mjs → chunk-HVGINJTO.mjs} +81 -28
  51. package/dist/{chunk-EBKYRP2P.mjs → chunk-I5KPOXUE.mjs} +1 -1
  52. package/dist/{chunk-HR5GU4UU.cjs → chunk-ILQSRLKK.cjs} +4 -4
  53. package/dist/{chunk-L4B7PB3H.cjs → chunk-J2EKGR6E.cjs} +1025 -480
  54. package/dist/{chunk-26WP75W5.cjs → chunk-JDT733EW.cjs} +41 -27
  55. package/dist/{chunk-W53Z4WDI.cjs → chunk-JH4CDG4G.cjs} +8 -8
  56. package/dist/{chunk-KQ6TYQU7.cjs → chunk-KDQKTX3Q.cjs} +4 -4
  57. package/dist/{chunk-PEQJ4UUT.mjs → chunk-LP6DIYGA.mjs} +2 -2
  58. package/dist/{chunk-Z7ZRBCAB.mjs → chunk-LQ3FISSD.mjs} +58 -37
  59. package/dist/{chunk-KBIM7PFQ.cjs → chunk-M4YXD6MD.cjs} +272 -219
  60. package/dist/{chunk-6ETHVRFO.cjs → chunk-MWAWMFG3.cjs} +407 -386
  61. package/dist/{chunk-ECVSRE4Y.mjs → chunk-N2BRIN7I.mjs} +1 -1
  62. package/dist/{chunk-MO4UTDQ6.mjs → chunk-NNNMFSXG.mjs} +1 -1
  63. package/dist/{chunk-V3Y3R3JJ.cjs → chunk-NOSLIDSG.cjs} +1 -1
  64. package/dist/{chunk-ICOJ2BC6.mjs → chunk-NWF2FTFV.mjs} +24 -10
  65. package/dist/{chunk-M3JYBZO2.cjs → chunk-OLIWLN4I.cjs} +2 -2
  66. package/dist/{chunk-YPAOC3FO.mjs → chunk-P2TGLGRR.mjs} +4 -4
  67. package/dist/{chunk-THGSPDFD.cjs → chunk-PAKB6JHX.cjs} +7 -7
  68. package/dist/{chunk-NVXU5BEG.mjs → chunk-Q637AXGZ.mjs} +172 -47
  69. package/dist/{chunk-ZZGQD3LL.mjs → chunk-QO24II6C.mjs} +4 -2
  70. package/dist/{chunk-HENPVGZC.cjs → chunk-RBSGFS5X.cjs} +66 -34
  71. package/dist/{chunk-IJPRCQHW.cjs → chunk-RGMUS3HO.cjs} +10 -10
  72. package/dist/{chunk-OIPPISQ6.cjs → chunk-RTAWQXME.cjs} +273 -148
  73. package/dist/{chunk-DMSXZNQR.cjs → chunk-RZI6436F.cjs} +2 -2
  74. package/dist/{chunk-HZY63K5C.mjs → chunk-S6MGFULY.mjs} +2 -2
  75. package/dist/{chunk-5GFTMTX3.cjs → chunk-SAUGKNCF.cjs} +2 -2
  76. package/dist/{chunk-6BMAGVDI.cjs → chunk-SCE7VWPN.cjs} +12 -12
  77. package/dist/{chunk-PKV3JGMS.mjs → chunk-SSFAPTRD.mjs} +1 -1
  78. package/dist/{chunk-ND65INFS.cjs → chunk-SWPLGPYF.cjs} +7 -7
  79. package/dist/{chunk-WP77JDKI.cjs → chunk-UCJCU2IL.cjs} +14 -14
  80. package/dist/{chunk-WX752VMN.mjs → chunk-UCRNNDNS.mjs} +1 -1
  81. package/dist/{chunk-27ESPHQA.cjs → chunk-UGWKNZ4U.cjs} +44 -27
  82. package/dist/{chunk-FLKG2PYH.cjs → chunk-UOMSGJHK.cjs} +11 -11
  83. package/dist/{chunk-2U2GRXP5.mjs → chunk-UWDFH3ZV.mjs} +1 -1
  84. package/dist/{chunk-AMMFRXFW.mjs → chunk-V5FEFFHV.mjs} +1 -1
  85. package/dist/{chunk-HR4N2K4V.mjs → chunk-WABOJXAA.mjs} +2 -2
  86. package/dist/{chunk-LTXKRIST.mjs → chunk-WANLI3ZC.mjs} +2 -2
  87. package/dist/{chunk-HQEYZSF3.cjs → chunk-WPURVYXT.cjs} +2 -2
  88. package/dist/{chunk-TE7AX6HB.mjs → chunk-WV63R4GE.mjs} +1 -1
  89. package/dist/{chunk-CIQCJ72N.mjs → chunk-XOLYZZDX.mjs} +693 -148
  90. package/dist/{chunk-4ZVKDHS6.cjs → chunk-YSRZSKQB.cjs} +4 -4
  91. package/dist/{cli-runtime.d-jqZ7YCsm.d.ts → cli-runtime.d-Dbl-gIoz.d.ts} +5 -5
  92. package/dist/{cli-runtime.d-qL44rqYO.d.mts → cli-runtime.d-oUiNuspW.d.mts} +5 -5
  93. package/dist/{client-component.d-BDD5aiUb.d.ts → client-component.d-CT4q7tmy.d.ts} +1 -1
  94. package/dist/{client-component.d-B2L2LyAr.d.mts → client-component.d-DaUqOhZT.d.mts} +1 -1
  95. package/dist/{client-plugins.d-Crct3m_r.d.ts → client-plugins.d-24qhjX8c.d.ts} +30 -4
  96. package/dist/{client-plugins.d-Dzc3vOw_.d.mts → client-plugins.d-BfGTqbAH.d.mts} +30 -4
  97. package/dist/client-plugins.d.mts +1 -1
  98. package/dist/client-plugins.d.ts +1 -1
  99. package/dist/client.cjs +4 -4
  100. package/dist/client.d.mts +7 -7
  101. package/dist/client.d.ts +7 -7
  102. package/dist/client.mjs +3 -3
  103. package/dist/config.d.mts +1 -1
  104. package/dist/config.d.ts +1 -1
  105. package/dist/desktop.d.mts +2 -2
  106. package/dist/desktop.d.ts +2 -2
  107. package/dist/{devtools-JTJA2KIZ.cjs → devtools-5WDQQDTA.cjs} +6 -6
  108. package/dist/{devtools-5DBTT2DI.mjs → devtools-DPYIYHTI.mjs} +5 -5
  109. package/dist/docs.cjs +8 -8
  110. package/dist/docs.d.mts +3 -3
  111. package/dist/docs.d.ts +3 -3
  112. package/dist/docs.mjs +7 -7
  113. package/dist/environment/vite.cjs +3 -3
  114. package/dist/environment/vite.mjs +2 -2
  115. package/dist/{handler.d-B1S1ZBqS.d.mts → handler.d-GfNuz57p.d.mts} +1 -1
  116. package/dist/{handler.d-ZweCBJD4.d.ts → handler.d-Oca5kNSz.d.ts} +1 -1
  117. package/dist/{headers.d-C-yGl_f6.d.mts → headers.d-C_lsQIWA.d.mts} +1 -1
  118. package/dist/{headers.d-BgBdQN8x.d.ts → headers.d-b8gHJDvu.d.ts} +1 -1
  119. package/dist/index.cjs +33 -29
  120. package/dist/{index.d-13h3oDu7.d.mts → index.d-BLtjh1aS.d.mts} +1 -1
  121. package/dist/{index.d-CtoniAXT.d.ts → index.d-Ckv6kHFm.d.ts} +1 -1
  122. package/dist/index.d.mts +23 -23
  123. package/dist/index.d.ts +23 -23
  124. package/dist/index.mjs +34 -30
  125. package/dist/integrations/orm.d.mts +1 -1
  126. package/dist/integrations/orm.d.ts +1 -1
  127. package/dist/integrations.cjs +4 -2
  128. package/dist/integrations.d.mts +1 -1
  129. package/dist/integrations.d.ts +1 -1
  130. package/dist/integrations.mjs +3 -1
  131. package/dist/internal/app-markdown-runtime.cjs +5 -3
  132. package/dist/internal/app-markdown-runtime.d.mts +10 -5
  133. package/dist/internal/app-markdown-runtime.d.ts +10 -5
  134. package/dist/internal/app-markdown-runtime.mjs +6 -4
  135. package/dist/internal/build-runtime.cjs +26 -26
  136. package/dist/internal/build-runtime.d.mts +4 -4
  137. package/dist/internal/build-runtime.d.ts +4 -4
  138. package/dist/internal/build-runtime.mjs +25 -25
  139. package/dist/internal/cli-runtime.cjs +10 -10
  140. package/dist/internal/cli-runtime.d.mts +7 -7
  141. package/dist/internal/cli-runtime.d.ts +7 -7
  142. package/dist/internal/cli-runtime.mjs +9 -9
  143. package/dist/internal/client-error-overlay.cjs +4 -4
  144. package/dist/internal/client-error-overlay.mjs +1 -1
  145. package/dist/internal/client-runtime.d.mts +5 -5
  146. package/dist/internal/client-runtime.d.ts +5 -5
  147. package/dist/internal/compression-runtime.d.mts +1 -1
  148. package/dist/internal/compression-runtime.d.ts +1 -1
  149. package/dist/internal/config-runtime.cjs +7 -7
  150. package/dist/internal/config-runtime.d.mts +3 -3
  151. package/dist/internal/config-runtime.d.ts +3 -3
  152. package/dist/internal/config-runtime.mjs +6 -6
  153. package/dist/internal/infra-analytics-runtime.cjs +9 -9
  154. package/dist/internal/infra-analytics-runtime.mjs +7 -7
  155. package/dist/internal/metadata-image-runtime.d.mts +2 -2
  156. package/dist/internal/metadata-image-runtime.d.ts +2 -2
  157. package/dist/internal/native-server-fns.cjs +4 -4
  158. package/dist/internal/native-server-fns.mjs +3 -3
  159. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  160. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  161. package/dist/internal/production-node-env.cjs +2 -2
  162. package/dist/internal/production-node-env.mjs +1 -1
  163. package/dist/internal/production-runtime.cjs +12 -12
  164. package/dist/internal/production-runtime.d.mts +10 -10
  165. package/dist/internal/production-runtime.d.ts +10 -10
  166. package/dist/internal/production-runtime.mjs +11 -11
  167. package/dist/internal/spa-router.cjs +3 -3
  168. package/dist/internal/spa-router.d.mts +3 -3
  169. package/dist/internal/spa-router.d.ts +3 -3
  170. package/dist/internal/spa-router.mjs +2 -2
  171. package/dist/internal/start-manifest.d.mts +1 -1
  172. package/dist/internal/start-manifest.d.ts +1 -1
  173. package/dist/markdown.cjs +2 -2
  174. package/dist/markdown.d.mts +1 -1
  175. package/dist/markdown.d.ts +1 -1
  176. package/dist/markdown.mjs +1 -1
  177. package/dist/middleware.d.mts +1 -1
  178. package/dist/middleware.d.ts +1 -1
  179. package/dist/{mount.d-_6Un9wdK.d.mts → mount.d-BCS8mD4E.d.mts} +1 -1
  180. package/dist/{mount.d-DyKlRR6z.d.ts → mount.d-DEX8eref.d.ts} +1 -1
  181. package/dist/{native-tree-5TENEQ7Y.cjs → native-tree-52CUAP3N.cjs} +3 -3
  182. package/dist/{native-tree-LNO7K6JR.mjs → native-tree-AO7PQ7FR.mjs} +2 -2
  183. package/dist/{navigation-delegate.d-BbW1_pf_.d.ts → navigation-delegate.d-Cgi28e5Q.d.ts} +1 -1
  184. package/dist/{navigation-delegate.d-B9GjWbov.d.mts → navigation-delegate.d-F83ugsZW.d.mts} +1 -1
  185. package/dist/navigation.cjs +5 -5
  186. package/dist/navigation.d.mts +4 -4
  187. package/dist/navigation.d.ts +4 -4
  188. package/dist/navigation.mjs +4 -4
  189. package/dist/plugin.cjs +19 -19
  190. package/dist/plugin.d.mts +5 -5
  191. package/dist/plugin.d.ts +5 -5
  192. package/dist/plugin.mjs +18 -18
  193. package/dist/query/client.cjs +7 -7
  194. package/dist/query/client.mjs +2 -2
  195. package/dist/{render-plan.d-DaM1NPnm.d.mts → render-plan.d-BkVY4aFb.d.mts} +1 -1
  196. package/dist/{render-plan.d-D0FV9lDT.d.ts → render-plan.d-DCF2GZdD.d.ts} +1 -1
  197. package/dist/renderer-client.cjs +5 -5
  198. package/dist/renderer-client.d.mts +5 -5
  199. package/dist/renderer-client.d.ts +5 -5
  200. package/dist/renderer-client.mjs +2 -2
  201. package/dist/renderer.d.mts +22 -11
  202. package/dist/renderer.d.ts +22 -11
  203. package/dist/{request.d-CrXC7voZ.d.ts → request.d-C5o-4dU2.d.ts} +1 -1
  204. package/dist/{request.d-DVSLilGx.d.mts → request.d-DMPB53-i.d.mts} +1 -1
  205. package/dist/request.d.mts +2 -2
  206. package/dist/request.d.ts +2 -2
  207. package/dist/{route-rendering.d-CWi3UYtR.d.mts → route-rendering.d-DDvArvik.d.mts} +1 -1
  208. package/dist/{route-rendering.d-OfbM_rj8.d.ts → route-rendering.d-DfP6zRP7.d.ts} +1 -1
  209. package/dist/{router.d-YKVirmj4.d.mts → router.d-1Skf2XCO.d.mts} +1 -1
  210. package/dist/{router.d-Bm9FNSu3.d.ts → router.d-s40h7aoS.d.ts} +1 -1
  211. package/dist/routes.d.mts +3 -3
  212. package/dist/routes.d.ts +3 -3
  213. package/dist/{rsc-pipeline-W5DSWDHD.mjs → rsc-pipeline-O2YMVHUF.mjs} +7 -7
  214. package/dist/{rsc-pipeline-LGXJGGMW.cjs → rsc-pipeline-SFQSMVI7.cjs} +8 -8
  215. package/dist/{runtime-UOZKSM5S.mjs → runtime-K2X3IZAF.mjs} +6 -6
  216. package/dist/{runtime-YV4X5FAK.cjs → runtime-WOTVFYQY.cjs} +8 -8
  217. package/dist/{runtime.d-BVj6apd0.d.mts → runtime.d-Bykc5Qfg.d.mts} +1 -1
  218. package/dist/{runtime.d-D7QYVJGO.d.ts → runtime.d-k-9kFUsM.d.ts} +1 -1
  219. package/dist/{server-components-status.d-BDVcxi0z.d.mts → server-components-status.d-D-HixBe0.d.mts} +1 -1
  220. package/dist/{server-components-status.d-CfKDpmCH.d.ts → server-components-status.d-DLNd1C5j.d.ts} +1 -1
  221. package/dist/server-plugins.d.mts +3 -3
  222. package/dist/server-plugins.d.ts +3 -3
  223. package/dist/server.cjs +41 -41
  224. package/dist/server.d.mts +11 -11
  225. package/dist/server.d.ts +11 -11
  226. package/dist/server.mjs +20 -20
  227. package/dist/{spa-router.d-DGmropfK.d.mts → spa-router.d-DIlXwm00.d.mts} +2 -2
  228. package/dist/{spa-router.d-nE1jHNGt.d.ts → spa-router.d-Dl-EJeJT.d.ts} +2 -2
  229. package/dist/{ssg.d-DS-gXUbf.d.mts → ssg.d-D2ZV0bhs.d.mts} +2 -2
  230. package/dist/{ssg.d-jXlUAKzg.d.ts → ssg.d-bE-ylg0e.d.ts} +2 -2
  231. package/dist/{store-core.d-B5cwOd8g.d.ts → store-core.d-BmdnMopD.d.ts} +2 -2
  232. package/dist/{store-core.d-C-gATBwd.d.mts → store-core.d-DPsCYzV7.d.mts} +2 -2
  233. package/dist/testing.d.mts +1 -1
  234. package/dist/testing.d.ts +1 -1
  235. package/dist/{utils.d-BODwBtkz.d.ts → utils.d-BFZQcBZV.d.ts} +1 -1
  236. package/dist/{utils.d-Cmj-fzds.d.mts → utils.d-nM3OHKq5.d.mts} +1 -1
  237. package/dist/version.cjs +2 -2
  238. package/dist/version.mjs +1 -1
  239. package/dist/vite.cjs +19 -19
  240. package/dist/vite.d.mts +6 -6
  241. package/dist/vite.d.ts +6 -6
  242. package/dist/vite.mjs +18 -18
  243. package/package.json +1 -1
  244. package/dist/analyzer-IIWSUXSQ.cjs +0 -17
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createFarmMarkdownRouteModule
3
- } from "./chunk-ICOJ2BC6.mjs";
3
+ } from "./chunk-NWF2FTFV.mjs";
4
4
 
5
5
  // src/app-markdown.ts
6
6
  import { readFile } from "fs/promises";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SMUW7UST.mjs";
4
4
  import {
5
5
  getFarmIntegrationPluginServerRuntime
6
- } from "./chunk-XRSNW4IU.mjs";
6
+ } from "./chunk-E72GG355.mjs";
7
7
  import {
8
8
  formatOptionalPeerInstallHint,
9
9
  isMissingPackageError
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
2
- var version = "0.2.0-beta.1";
2
+ var version = "0.2.0-beta.2";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -8,7 +8,7 @@ import {
8
8
  _resolveFarmMarkdownIndexAlias,
9
9
  createFarmMarkdownViewResponse,
10
10
  requestAcceptsMarkdown
11
- } from "./chunk-YU2MNIIY.mjs";
11
+ } from "./chunk-CRF5MOLO.mjs";
12
12
  import {
13
13
  withoutFarmDeploymentCookie
14
14
  } from "./chunk-IWJONXPF.mjs";
@@ -107,23 +107,36 @@ async function evaluateMdxSource(body, filePath, renderer) {
107
107
  var MARKDOWN_ROUTE_CONFIG_EXPORT = /^export\s+const\s+(dynamic|revalidate|ssg)\s*=\s*("[^"\\]*"|'[^'\\]*'|\d+(?:\.\d+)?|true|false)\s*;?\s*$/;
108
108
  function readFarmMarkdownRouteConfig(body) {
109
109
  const config = {};
110
+ for (const match of findFarmMarkdownRouteConfigExports(body.split("\n")).values()) {
111
+ const literal = match[2];
112
+ config[match[1]] = literal === "true" ? true : literal === "false" ? false : /^\d/.test(literal) ? Number(literal) : literal.slice(1, -1);
113
+ }
114
+ return config;
115
+ }
116
+ function findFarmMarkdownRouteConfigExports(lines) {
117
+ const exports = /* @__PURE__ */ new Map();
110
118
  let fence;
111
- for (const line of body.split(/\r?\n/)) {
119
+ lines.forEach((raw, index) => {
120
+ const line = raw.endsWith("\r") ? raw.slice(0, -1) : raw;
112
121
  const marker = line.match(/^ {0,3}(`{3,}|~{3,})/)?.[1];
113
122
  if (fence) {
114
123
  if (marker && marker[0] === fence[0] && marker.length >= fence.length) fence = void 0;
115
- continue;
124
+ return;
116
125
  }
117
126
  if (marker) {
118
127
  fence = marker;
119
- continue;
128
+ return;
120
129
  }
121
130
  const match = line.match(MARKDOWN_ROUTE_CONFIG_EXPORT);
122
- if (!match) continue;
123
- const literal = match[2];
124
- config[match[1]] = literal === "true" ? true : literal === "false" ? false : /^\d/.test(literal) ? Number(literal) : literal.slice(1, -1);
125
- }
126
- return config;
131
+ if (match) exports.set(index, match);
132
+ });
133
+ return exports;
134
+ }
135
+ function withoutFarmMarkdownRouteConfig(source) {
136
+ const lines = source.split("\n");
137
+ const exports = findFarmMarkdownRouteConfigExports(lines);
138
+ if (exports.size === 0) return source;
139
+ return lines.filter((_, index) => !exports.has(index)).join("\n");
127
140
  }
128
141
  function createFarmMarkdownRouteModule(input) {
129
142
  const { body } = parseMarkdownFrontmatter(input.source);
@@ -325,7 +338,7 @@ async function createFarmMarkdownSourceResponse(options) {
325
338
  return createFarmMarkdownViewResponse({
326
339
  request: options.request,
327
340
  requestUrl: url,
328
- markdown: source.source,
341
+ markdown: withoutFarmMarkdownRouteConfig(source.source),
329
342
  status: 200,
330
343
  headers,
331
344
  markdownPath: headers.get("Content-Location")
@@ -341,6 +354,7 @@ export {
341
354
  compileFarmMarkdownPage,
342
355
  FARM_MARKDOWN_PRECOMPILED_PAGES,
343
356
  readFarmMarkdownRouteConfig,
357
+ withoutFarmMarkdownRouteConfig,
344
358
  createFarmMarkdownRouteModule,
345
359
  isFarmMarkdownPublicSourceResponse,
346
360
  FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS,
@@ -18,14 +18,14 @@ var _chunkCCAUIBIScjs = require('./chunk-CCAUIBIS.cjs');
18
18
  var _chunkWMRGIQTAcjs = require('./chunk-WMRGIQTA.cjs');
19
19
 
20
20
 
21
- var _chunkV3Y3R3JJcjs = require('./chunk-V3Y3R3JJ.cjs');
21
+ var _chunkNOSLIDSGcjs = require('./chunk-NOSLIDSG.cjs');
22
22
 
23
23
  // src/mobile/analyzer.ts
24
24
  var _crypto = require('crypto');
25
25
  var _fs = require('fs');
26
26
  var _promises = require('fs/promises');
27
27
  var _path = require('path'); var path = _interopRequireWildcard(_path);
28
- var ANALYZER_VERSION = `8:${_chunkV3Y3R3JJcjs.FARM_VERSION}`;
28
+ var ANALYZER_VERSION = `8:${_chunkNOSLIDSGcjs.FARM_VERSION}`;
29
29
  var INTRINSIC_KINDS = {};
30
30
  for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
31
31
  INTRINSIC_KINDS[tag] = "View";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  FARM_DEFAULT_MCP_PATH,
3
3
  FARM_DEFAULT_MCP_TOOLS
4
- } from "./chunk-HR4N2K4V.mjs";
4
+ } from "./chunk-WABOJXAA.mjs";
5
5
  import {
6
6
  normalizeFarmProductionSiteOrigin
7
- } from "./chunk-PKV3JGMS.mjs";
7
+ } from "./chunk-SSFAPTRD.mjs";
8
8
  import {
9
9
  resolveFarmAppManifestConfig
10
10
  } from "./chunk-SQ5O7I3L.mjs";
11
11
  import {
12
12
  emitFarmAgentRead,
13
13
  getFarmMarkdownMirrorPath
14
- } from "./chunk-YU2MNIIY.mjs";
14
+ } from "./chunk-CRF5MOLO.mjs";
15
15
  import {
16
16
  readFarmEnvironmentValue
17
17
  } from "./chunk-WXFY5JIY.mjs";
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-YT2ZMLXK.mjs";
30
30
  import {
31
31
  FARM_VERSION
32
- } from "./chunk-EBKYRP2P.mjs";
32
+ } from "./chunk-I5KPOXUE.mjs";
33
33
  import {
34
34
  applyFarmBasePath
35
35
  } from "./chunk-SF3JB56B.mjs";
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkWP77JDKIcjs = require('./chunk-WP77JDKI.cjs');
3
+ var _chunkUCJCU2ILcjs = require('./chunk-UCJCU2IL.cjs');
4
4
 
5
5
 
6
- var _chunkKQ6TYQU7cjs = require('./chunk-KQ6TYQU7.cjs');
6
+ var _chunkKDQKTX3Qcjs = require('./chunk-KDQKTX3Q.cjs');
7
7
 
8
8
 
9
9
  var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
10
10
 
11
11
  // src/navigation.ts
12
12
  function useRouter2() {
13
- const router = _chunkWP77JDKIcjs.useRouter.call(void 0, );
13
+ const router = _chunkUCJCU2ILcjs.useRouter.call(void 0, );
14
14
  return {
15
15
  push: router.push,
16
16
  replace: router.replace,
@@ -18,19 +18,19 @@ function useRouter2() {
18
18
  forward: router.forward,
19
19
  refresh() {
20
20
  if (typeof window === "undefined") return Promise.resolve();
21
- return _chunkKQ6TYQU7cjs.getRouter.call(void 0, ).refresh();
21
+ return _chunkKDQKTX3Qcjs.getRouter.call(void 0, ).refresh();
22
22
  },
23
23
  prefetch(href) {
24
24
  if (typeof window === "undefined") return Promise.resolve();
25
- return _chunkKQ6TYQU7cjs.getRouter.call(void 0, ).prefetch(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href));
25
+ return _chunkKDQKTX3Qcjs.getRouter.call(void 0, ).prefetch(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href));
26
26
  }
27
27
  };
28
28
  }
29
29
  function usePathname() {
30
- return _chunkWP77JDKIcjs.useRouter.call(void 0, ).pathname;
30
+ return _chunkUCJCU2ILcjs.useRouter.call(void 0, ).pathname;
31
31
  }
32
32
  function useSearchParams() {
33
- return _chunkWP77JDKIcjs.useRouter.call(void 0, ).searchParams;
33
+ return _chunkUCJCU2ILcjs.useRouter.call(void 0, ).searchParams;
34
34
  }
35
35
 
36
36
 
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-U6GMCDRS.mjs";
29
29
  import {
30
30
  FARM_VERSION
31
- } from "./chunk-EBKYRP2P.mjs";
31
+ } from "./chunk-I5KPOXUE.mjs";
32
32
 
33
33
  // src/environment-vite.ts
34
34
  import { existsSync, readFileSync, realpathSync } from "fs";
@@ -158,9 +158,16 @@ var snapshot;
158
158
  var base;
159
159
  var volatile;
160
160
  var trace;
161
+ var traceGroups;
161
162
  function farmSourceSnapshotPathKey(file, paths = path2) {
163
+ if (paths === path2 && path2.sep === "/" && isNormalizedPosixPath(file)) return file;
162
164
  return paths.resolve(file);
163
165
  }
166
+ function isNormalizedPosixPath(file) {
167
+ if (file.charCodeAt(0) !== 47) return false;
168
+ if (file.length === 1) return true;
169
+ return !file.endsWith("/") && !file.endsWith("/.") && !file.endsWith("/..") && !file.includes("//") && !file.includes("/./") && !file.includes("/../");
170
+ }
164
171
  function getFarmSourceStamp(file) {
165
172
  try {
166
173
  const stat = fs.statSync(file);
@@ -268,15 +275,34 @@ function memoizeInFarmSourceSnapshot(scope, key, compute, lasting) {
268
275
  function noteFarmSourceRead(file) {
269
276
  trace?.add(file);
270
277
  }
278
+ function noteFarmSourceReads(files) {
279
+ if (traceGroups) traceGroups.add(files);
280
+ else if (trace) for (const file of files) trace.add(file);
281
+ }
271
282
  function traceFarmSourceReads(operation) {
283
+ const { result, files } = traceReads(operation, false);
284
+ return { result, files: [...files] };
285
+ }
286
+ function traceFarmSourceReadGroups(operation) {
287
+ const { result, files, groups } = traceReads(operation, true);
288
+ return { result, files: [...files], groups: [...groups] };
289
+ }
290
+ function traceReads(operation, grouped) {
272
291
  const outer = trace;
292
+ const outerGroups = traceGroups;
273
293
  const files = /* @__PURE__ */ new Set();
294
+ const groups = grouped ? /* @__PURE__ */ new Set() : void 0;
274
295
  trace = files;
296
+ traceGroups = groups;
275
297
  try {
276
- return { result: operation(), files: [...files] };
298
+ return { result: operation(), files, groups };
277
299
  } finally {
278
300
  trace = outer;
279
- if (outer) for (const file of files) outer.add(file);
301
+ traceGroups = outerGroups;
302
+ if (outer) {
303
+ for (const file of files) outer.add(file);
304
+ if (groups) for (const group of groups) noteFarmSourceReads(group);
305
+ }
280
306
  }
281
307
  }
282
308
 
@@ -304,11 +330,19 @@ function packageNameOf(specifier) {
304
330
  return { name, subpath: parts.slice(name.startsWith("@") ? 2 : 1).join("/") };
305
331
  }
306
332
  function findPackageDirectory(importer, name) {
307
- for (let current = path3.dirname(importer); ; current = path3.dirname(current)) {
308
- const directory = path3.join(current, "node_modules", name);
309
- if (fs2.existsSync(path3.join(directory, "package.json"))) return fs2.realpathSync(directory);
310
- if (path3.dirname(current) === current) return null;
311
- }
333
+ const start = path3.dirname(importer);
334
+ return memoizeInFarmSourceSnapshot(
335
+ "package-directory",
336
+ `${farmSourceSnapshotPathKey(start)}\0${name}`,
337
+ () => {
338
+ for (let current = start; ; current = path3.dirname(current)) {
339
+ const directory = path3.join(current, "node_modules", name);
340
+ if (fs2.existsSync(path3.join(directory, "package.json"))) return fs2.realpathSync(directory);
341
+ if (path3.dirname(current) === current) return null;
342
+ }
343
+ },
344
+ (directory) => directory !== null
345
+ );
312
346
  }
313
347
  function pickTarget(value, conditions) {
314
348
  if (typeof value === "string") return value;
@@ -505,7 +539,11 @@ function traceExport(file, name, depth) {
505
539
  return void 0;
506
540
  }
507
541
  function traceFarmExport(file, name) {
508
- return traceExport(file, name, 0)?.kind;
542
+ return memoizeInFarmSourceSnapshot(
543
+ "export-kind",
544
+ `${farmSourceSnapshotPathKey(file)}\0${name}`,
545
+ () => traceExport(file, name, 0)?.kind
546
+ );
509
547
  }
510
548
  function isFarmClientExport(file, name) {
511
549
  return traceFarmExport(file, name) === "client";
@@ -785,9 +823,21 @@ function readModuleImports(file) {
785
823
  return imports;
786
824
  }
787
825
  var clientOnlyFreeFiles = /* @__PURE__ */ new Set();
788
- function invalidateFarmClientOnlyScan() {
826
+ function invalidateFarmClientOnlyScan(file, event) {
827
+ if (file && event === "update" && path3.basename(file) !== "package.json" && !isClientOnlyScanned(file)) {
828
+ return;
829
+ }
789
830
  clientOnlyFreeFiles.clear();
790
831
  }
832
+ function isClientOnlyScanned(file) {
833
+ const resolved = path3.resolve(file);
834
+ if (clientOnlyFreeFiles.has(resolved)) return true;
835
+ try {
836
+ return clientOnlyFreeFiles.has(fs2.realpathSync(resolved));
837
+ } catch {
838
+ return true;
839
+ }
840
+ }
791
841
  function resolveServerEntry(importer, specifier) {
792
842
  const parsed = packageNameOf(specifier);
793
843
  if (!parsed || REACT_PACKAGES.has(parsed.name) || parsed.name.startsWith("@farm.js/")) {
@@ -1818,15 +1868,12 @@ function ensureFarmPackageClientReference(root, specifier, exportName, importer)
1818
1868
  `export { __farm_reference__ as ${exportName} };`,
1819
1869
  ""
1820
1870
  ].join("\n");
1821
- let current = null;
1822
- try {
1823
- current = fs3.readFileSync(file, "utf8");
1824
- } catch {
1825
- }
1826
- if (current !== source) {
1827
- fs3.mkdirSync(path4.dirname(file), { recursive: true });
1828
- fs3.writeFileSync(file, source);
1829
- }
1871
+ memoizeInFarmSourceSnapshot(
1872
+ "client-reference-file",
1873
+ `${file}\0${source}`,
1874
+ () => writeIfChanged(file, source),
1875
+ () => false
1876
+ );
1830
1877
  return file;
1831
1878
  }
1832
1879
  function writeIfChanged(file, source) {
@@ -2154,6 +2201,7 @@ var PackageClientBoundaryCache = class {
2154
2201
  else this.dirty = true;
2155
2202
  }
2156
2203
  }
2204
+ if (visited.size === 0) return entries?.find((entry) => entry.stops.length === 0);
2157
2205
  return entries?.find(
2158
2206
  (entry) => entry.stops.every((file) => visited.has(file)) && !entry.files.some((file) => visited.has(file))
2159
2207
  );
@@ -2314,6 +2362,11 @@ async function withPackageClientBoundaryCache(operation) {
2314
2362
  await cache2.persist();
2315
2363
  }
2316
2364
  }
2365
+ function bindPackageClientBoundaryCache() {
2366
+ const cache2 = getPackageClientBoundaryCache();
2367
+ if (!cache2) return (operation) => operation();
2368
+ return (operation) => getPackageClientBoundaryCache() ? operation() : getStorage().run(cache2, operation);
2369
+ }
2317
2370
  function usePackageClientBoundaryCacheFile(file) {
2318
2371
  getPackageClientBoundaryCache()?.load(file);
2319
2372
  }
@@ -2888,6 +2941,14 @@ function isAsyncLocalDeclaration(tokens, name) {
2888
2941
  }
2889
2942
  return false;
2890
2943
  }
2944
+ function parseImportedModuleMetadata(content) {
2945
+ if (!content) return parseClientModuleMetadata(content, false);
2946
+ return memoizeInFarmSourceSnapshot(
2947
+ "imported-module-metadata",
2948
+ content,
2949
+ () => parseClientModuleMetadata(content, false)
2950
+ );
2951
+ }
2891
2952
  function parseClientModuleMetadata(content, inspectIslandExport, sourcePath) {
2892
2953
  if (!content) {
2893
2954
  return {
@@ -2950,7 +3011,7 @@ function getFarmClientRenderingBindings(code, file, root) {
2950
3011
  for (const [specifier, locals] of getStaticImportBindings(code)) {
2951
3012
  const imported = resolveImportedModule(file, specifier, root);
2952
3013
  if (!imported.path) continue;
2953
- const metadata = imported.local ? inspectClientModuleMetadata(imported.path, root, /* @__PURE__ */ new Set([path8.resolve(file)]), false) : inspectPackageClientBoundary(imported.path, root, /* @__PURE__ */ new Set());
3014
+ const metadata = imported.local ? inspectClientModuleMetadata(imported.path, root, /* @__PURE__ */ new Set([path8.resolve(file)]), false) : inspectPackageClientBoundary(imported.path, root);
2954
3015
  if (metadata.isClientComponent || metadata.shouldHydrate) bindings.push(...locals);
2955
3016
  }
2956
3017
  return bindings;
@@ -3273,9 +3334,17 @@ function exportListNames(content) {
3273
3334
  }
3274
3335
  return names;
3275
3336
  }
3337
+ var NO_IMPORT_BINDINGS = /* @__PURE__ */ new Map();
3276
3338
  function getStaticImportBindings(content) {
3339
+ if (!content) return NO_IMPORT_BINDINGS;
3340
+ return memoizeInFarmSourceSnapshot(
3341
+ "import-bindings",
3342
+ content,
3343
+ () => scanStaticImportBindings(content)
3344
+ );
3345
+ }
3346
+ function scanStaticImportBindings(content) {
3277
3347
  const bindings = /* @__PURE__ */ new Map();
3278
- if (!content) return bindings;
3279
3348
  const tokens = tokenizeModuleSource(content);
3280
3349
  for (let index = 0; index < tokens.length; index++) {
3281
3350
  if (tokens[index].value !== "import" || tokens[index - 1]?.value === ".") continue;
@@ -3582,7 +3651,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
3582
3651
  if (visiting.has(moduleSourcePath)) return 0;
3583
3652
  visiting.add(moduleSourcePath);
3584
3653
  const content = readModuleCode(moduleSourcePath);
3585
- const parsed = parseClientModuleMetadata(content, false);
3654
+ const parsed = parseImportedModuleMetadata(content);
3586
3655
  if (parsed.isClientComponent) {
3587
3656
  if (!isIsolatableClientBoundarySource(content)) {
3588
3657
  fallbackReason = `client boundary ${moduleSourcePath} uses an unsupported export shape`;
@@ -3644,7 +3713,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
3644
3713
  if (reference) importedBoundaryCount += visit(reference);
3645
3714
  }
3646
3715
  } else {
3647
- const packageMetadata = inspectPackageClientBoundary(importedPath, root, /* @__PURE__ */ new Set());
3716
+ const packageMetadata = inspectPackageClientBoundary(importedPath, root);
3648
3717
  if (!packageMetadata.shouldHydrate) continue;
3649
3718
  const references = options.packageReferences && projectRoot ? findFarmPackageClientImports(
3650
3719
  content ?? "",
@@ -3769,37 +3838,59 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
3769
3838
  function farmWorkspaceServerEntry(entry) {
3770
3839
  const real = realpathOrSelf(entry);
3771
3840
  if (real.split(path8.sep).includes("node_modules")) return null;
3772
- if (parseClientModuleMetadata(readIfExists(real), false).isClientComponent) return null;
3841
+ if (parseImportedModuleMetadata(readIfExists(real)).isClientComponent) return null;
3773
3842
  return real;
3774
3843
  }
3775
3844
  function realpathOrSelf(file) {
3776
- try {
3777
- return fs7.realpathSync(file);
3778
- } catch {
3779
- return file;
3780
- }
3781
- }
3845
+ const real = memoizeInFarmSourceSnapshot(
3846
+ "realpath",
3847
+ farmSourceSnapshotPathKey(file),
3848
+ () => {
3849
+ try {
3850
+ return fs7.realpathSync(file);
3851
+ } catch {
3852
+ return null;
3853
+ }
3854
+ },
3855
+ (resolved) => resolved !== null
3856
+ );
3857
+ return real ?? file;
3858
+ }
3859
+ var NODE_MODULES_SEGMENT2 = `${path8.sep}node_modules${path8.sep}`;
3860
+ function getInstalledPackageDirectory(file, start) {
3861
+ let end = file.indexOf(path8.sep, start);
3862
+ if (end !== -1 && file[start] === "@") end = file.indexOf(path8.sep, end + 1);
3863
+ return end === -1 ? file : file.slice(0, end);
3864
+ }
3865
+ function installedRealPath(file) {
3866
+ const segment = file.lastIndexOf(NODE_MODULES_SEGMENT2);
3867
+ if (segment === -1) return file;
3868
+ const directory = getInstalledPackageDirectory(file, segment + NODE_MODULES_SEGMENT2.length);
3869
+ const real = realpathOrSelf(directory);
3870
+ if (real === directory || !real.includes(NODE_MODULES_SEGMENT2)) return file;
3871
+ return real + file.slice(directory.length);
3872
+ }
3873
+ var NO_VISITED_FILES = /* @__PURE__ */ new Set();
3782
3874
  function getBarePackageReexports(content) {
3783
3875
  return getImportSpecifiers(content, { reexportsOnly: true }).filter(
3784
3876
  (specifier) => bareSpecifierPackage(specifier)
3785
3877
  );
3786
3878
  }
3787
- function inspectPackageClientBoundary(resolvedPath, root, visited) {
3879
+ function inspectPackageClientBoundary(importedPath, root, visited) {
3880
+ const resolvedPath = importedPath && installedRealPath(importedPath);
3788
3881
  const cache2 = getPackageClientBoundaryCache();
3789
- if (!cache2 || !resolvedPath || visited.has(resolvedPath)) {
3790
- return traversePackageClientBoundary(resolvedPath, root, visited);
3882
+ if (!cache2 || !resolvedPath || visited?.has(resolvedPath)) {
3883
+ return traversePackageClientBoundary(resolvedPath, root, visited ?? /* @__PURE__ */ new Set());
3791
3884
  }
3792
3885
  const key = `${root ?? ""}\0${resolvedPath}`;
3793
- const cached = cache2.find(key, visited);
3886
+ const cached = cache2.find(key, visited ?? NO_VISITED_FILES);
3794
3887
  if (cached) {
3795
- for (const file of cached.files) {
3796
- visited.add(file);
3797
- noteFarmSourceRead(file);
3798
- }
3888
+ if (visited) for (const file of cached.files) visited.add(file);
3889
+ noteFarmSourceReads(cached.files);
3799
3890
  return { ...cached.result };
3800
3891
  }
3801
3892
  const trace2 = new PackageInspectionTrace();
3802
- const result = traversePackageClientBoundary(resolvedPath, root, visited, trace2);
3893
+ const result = traversePackageClientBoundary(resolvedPath, root, visited ?? /* @__PURE__ */ new Set(), trace2);
3803
3894
  cache2.add(key, trace2.toEntry(result));
3804
3895
  return result;
3805
3896
  }
@@ -3815,7 +3906,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
3815
3906
  visited.add(resolvedPath);
3816
3907
  trace2?.visit(resolvedPath);
3817
3908
  const content = readIfExists(resolvedPath);
3818
- const parsed = parseClientModuleMetadata(content, false);
3909
+ const parsed = parseImportedModuleMetadata(content);
3819
3910
  let importsClientBoundary = false;
3820
3911
  let importedIslandStrategy = null;
3821
3912
  const reexports = getBarePackageReexports(content);
@@ -4273,7 +4364,7 @@ function resolveSourceCandidatePath(candidate) {
4273
4364
  function isFarmPackageClientBoundary(importerPath, specifier, root) {
4274
4365
  const imported = resolveImportedModule(importerPath, specifier, root);
4275
4366
  if (imported.local || !imported.path) return false;
4276
- return inspectPackageClientBoundary(imported.path, root, /* @__PURE__ */ new Set()).shouldHydrate;
4367
+ return inspectPackageClientBoundary(imported.path, root).shouldHydrate;
4277
4368
  }
4278
4369
  var CLIENT_PACKAGE_SCAN_EXTENSIONS = /\.(?:[cm]?[jt]sx?)$/;
4279
4370
  var CLIENT_PACKAGE_SCAN_SKIP = /* @__PURE__ */ new Set([
@@ -4369,11 +4460,37 @@ var clientReachableModules = /* @__PURE__ */ new Map();
4369
4460
  function invalidateFarmClientReachableModules() {
4370
4461
  clientReachableModules.clear();
4371
4462
  }
4463
+ function isClientEntrySource(content) {
4464
+ return hasUseClientDirective(content) || hasHydrateExport(content);
4465
+ }
4466
+ function getClientReachableImports(content) {
4467
+ return getImportSpecifiers(content, { dynamic: true });
4468
+ }
4469
+ function noteFarmClientReachableModuleChange(file, event, options) {
4470
+ if (event !== "update") {
4471
+ invalidateFarmClientReachableModules();
4472
+ return;
4473
+ }
4474
+ const resolved = path8.resolve(file);
4475
+ let content;
4476
+ for (const [key, scan] of clientReachableModules) {
4477
+ const read = scan.reads.get(resolved);
4478
+ if (!read) {
4479
+ if (options.appSource) clientReachableModules.delete(key);
4480
+ continue;
4481
+ }
4482
+ if (content === void 0) content = readIfExists(resolved);
4483
+ if (read.entry !== void 0 && read.entry !== isClientEntrySource(content) || read.imports !== void 0 && read.imports !== getClientReachableImports(content).join("\0")) {
4484
+ clientReachableModules.delete(key);
4485
+ }
4486
+ }
4487
+ }
4372
4488
  function getFarmClientReachableModules(directory, root) {
4373
4489
  const key = `${path8.resolve(root)}\0${path8.resolve(directory)}`;
4374
4490
  const cached = clientReachableModules.get(key);
4375
- if (cached) return cached;
4491
+ if (cached) return cached.modules;
4376
4492
  const reachable = /* @__PURE__ */ new Set();
4493
+ const reads = /* @__PURE__ */ new Map();
4377
4494
  const queue = [];
4378
4495
  const walk2 = (current) => {
4379
4496
  let entries;
@@ -4387,8 +4504,9 @@ function getFarmClientReachableModules(directory, root) {
4387
4504
  if (entry.isDirectory()) {
4388
4505
  if (!entry.name.startsWith(".") && !CLIENT_PACKAGE_SCAN_SKIP.has(entry.name)) walk2(file);
4389
4506
  } else if (isScannedSourceFile(entry.name)) {
4390
- const content = readIfExists(file);
4391
- if (hasUseClientDirective(content) || hasHydrateExport(content)) queue.push(file);
4507
+ const clientEntry = isClientEntrySource(readIfExists(file));
4508
+ reads.set(path8.resolve(file), { entry: clientEntry });
4509
+ if (clientEntry) queue.push(file);
4392
4510
  }
4393
4511
  }
4394
4512
  };
@@ -4397,14 +4515,18 @@ function getFarmClientReachableModules(directory, root) {
4397
4515
  const file = path8.resolve(queue.pop());
4398
4516
  if (reachable.has(file)) continue;
4399
4517
  reachable.add(file);
4400
- for (const specifier of getImportSpecifiers(readIfExists(file), { dynamic: true })) {
4518
+ const imports = getClientReachableImports(readIfExists(file));
4519
+ const read = reads.get(file);
4520
+ if (read) read.imports = imports.join("\0");
4521
+ else reads.set(file, { imports: imports.join("\0") });
4522
+ for (const specifier of imports) {
4401
4523
  const imported = resolveImportedModule(file, specifier, root);
4402
4524
  if (imported.local && imported.path && !reachable.has(path8.resolve(imported.path))) {
4403
4525
  queue.push(imported.path);
4404
4526
  }
4405
4527
  }
4406
4528
  }
4407
- clientReachableModules.set(key, reachable);
4529
+ clientReachableModules.set(key, { modules: reachable, reads });
4408
4530
  return reachable;
4409
4531
  }
4410
4532
  function resolveFarmClientOptimizeDeps(directory, root) {
@@ -4890,6 +5012,7 @@ export {
4890
5012
  memoizeInFarmSourceSnapshot,
4891
5013
  noteFarmSourceRead,
4892
5014
  traceFarmSourceReads,
5015
+ traceFarmSourceReadGroups,
4893
5016
  rewriteFarmReactServerClientModuleImports,
4894
5017
  rewriteFarmReactServerImports,
4895
5018
  invalidateFarmClientOnlyScan,
@@ -4907,6 +5030,7 @@ export {
4907
5030
  ensureFarmIslandContainerReference,
4908
5031
  wrapFarmIslandContainers,
4909
5032
  withPackageClientBoundaryCache,
5033
+ bindPackageClientBoundaryCache,
4910
5034
  usePackageClientBoundaryCacheFile,
4911
5035
  resolvePackageClientBoundaryCacheFile,
4912
5036
  runWithPackageClientBoundaryCacheFile,
@@ -4931,11 +5055,12 @@ export {
4931
5055
  enforceFarmIsolatedHydrationRouteBudget,
4932
5056
  isIsolatableClientBoundarySource,
4933
5057
  isFarmClientModulePlanUnchanged,
5058
+ getInstalledPackageDirectory,
4934
5059
  resolveImportedModule,
4935
5060
  isFarmPackageClientBoundary,
4936
5061
  collectFarmClientPackageImports,
4937
5062
  collectFarmServerBundledPackageInfo,
4938
- invalidateFarmClientReachableModules,
5063
+ noteFarmClientReachableModuleChange,
4939
5064
  getFarmClientReachableModules,
4940
5065
  resolveFarmClientOptimizeDeps,
4941
5066
  createFarmDiagnostic,
@@ -132,7 +132,7 @@ import { trapUnhandledErrors } from "#nitro/runtime/error/hooks";
132
132
  import { setupCloseHooks } from "#nitro/runtime/shutdown";
133
133
  import { startScheduleRunner } from "#nitro/runtime/task";
134
134
  import { tracingSrvxPlugins } from "#nitro/virtual/tracing";
135
- import { farmProductionLifecycle } from ${JSON.stringify(nitroEntryImport)};${desktop ? `
135
+ import { farmPrepareNativeRoutes, farmProductionLifecycle } from ${JSON.stringify(nitroEntryImport)};${desktop ? `
136
136
  import { realpathSync } from "node:fs";
137
137
  import { pathToFileURL } from "node:url";
138
138
  import { createFarmDesktopGuard } from ${JSON.stringify(desktop.guardModule)};
@@ -196,7 +196,9 @@ if (!shutdownConfig.disabled) {
196
196
 
197
197
  try {
198
198
  await Promise.race([
199
- Promise.resolve().then(() => farmProductionLifecycle.start()),
199
+ Promise.resolve()
200
+ .then(() => farmProductionLifecycle.start())
201
+ .then(() => farmPrepareNativeRoutes()),
200
202
  startupSignalPromise,
201
203
  ]);
202
204
  } catch (error) {