@farm.js/core 0.1.82 → 0.1.84

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 (253) hide show
  1. package/dist/{agent-mcp.d-C2Su3x4D.d.ts → agent-mcp.d-7uKdOttc.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-Yak-LqRd.d.mts → agent-mcp.d-LChlR2au.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +2 -1
  4. package/dist/agent-runtime.d.ts +2 -1
  5. package/dist/{analyzer-RPU2KG4J.mjs → analyzer-7RNO3XKC.mjs} +2 -2
  6. package/dist/analyzer-PFKA5NI6.cjs +17 -0
  7. package/dist/api/node.d.mts +4 -3
  8. package/dist/api/node.d.ts +4 -3
  9. package/dist/api/route-manager.d.mts +4 -3
  10. package/dist/api/route-manager.d.ts +4 -3
  11. package/dist/api/runtime.d.mts +3 -2
  12. package/dist/api/runtime.d.ts +3 -2
  13. package/dist/api.d.mts +5 -4
  14. package/dist/api.d.ts +5 -4
  15. package/dist/{app-manifest.d-DZyXaICz.d.ts → app-manifest.d-CRp21oAz.d.ts} +1 -1
  16. package/dist/{app-manifest.d-BcyOFMrg.d.mts → app-manifest.d-QMdmqqCr.d.mts} +1 -1
  17. package/dist/app-markdown.d.mts +3 -2
  18. package/dist/app-markdown.d.ts +3 -2
  19. package/dist/{app.d-CIoXsAbN.d.ts → app.d-CVPu_hoD.d.ts} +34 -4
  20. package/dist/{app.d-C0ePpuaG.d.mts → app.d-eSm7jgoc.d.mts} +34 -4
  21. package/dist/{chunk-B2PGVHBG.cjs → chunk-22BTYPIX.cjs} +4 -4
  22. package/dist/{chunk-BCTHOQPP.cjs → chunk-3OKSEJ33.cjs} +98 -10
  23. package/dist/{chunk-QSMUMK7Y.mjs → chunk-3WM7VBGW.mjs} +2 -2
  24. package/dist/{chunk-XMHERKSE.mjs → chunk-42IBGQTN.mjs} +5 -12
  25. package/dist/{chunk-RMPUEH5T.cjs → chunk-57EEWWUS.cjs} +2 -2
  26. package/dist/{chunk-Q2VOT3K2.cjs → chunk-5I4ZGKP2.cjs} +395 -333
  27. package/dist/{chunk-TPA2PV5J.mjs → chunk-5V6HSJFG.mjs} +24 -1
  28. package/dist/{chunk-RMLR5RMH.mjs → chunk-BCCCPFHQ.mjs} +92 -4
  29. package/dist/{chunk-LM2ZDNDD.cjs → chunk-BOEDYXAX.cjs} +30 -25
  30. package/dist/{chunk-NRCKBDYP.mjs → chunk-BRDGINBB.mjs} +153 -47
  31. package/dist/chunk-BUQR7KKO.mjs +17 -0
  32. package/dist/{chunk-63ZE6B6M.mjs → chunk-BZY3SRRD.mjs} +1 -1
  33. package/dist/{chunk-724WT3NI.mjs → chunk-CRE642TW.mjs} +1 -1
  34. package/dist/{chunk-JK26IMT7.cjs → chunk-CVZY4TLW.cjs} +1 -1
  35. package/dist/{chunk-ZIZRIZLP.mjs → chunk-CWUQBECF.mjs} +3 -1
  36. package/dist/{chunk-DAXU2NBE.mjs → chunk-DFDQGHPU.mjs} +104 -42
  37. package/dist/{chunk-AIPZDBP6.cjs → chunk-DSWSDDP2.cjs} +844 -553
  38. package/dist/{chunk-DRO3NXA3.cjs → chunk-EBSL5TW7.cjs} +203 -93
  39. package/dist/{chunk-CJDBTTLB.mjs → chunk-EDBIBO67.mjs} +18 -13
  40. package/dist/{chunk-BBVLOEND.cjs → chunk-F7JVO3OZ.cjs} +4 -4
  41. package/dist/chunk-FZ7OUN5M.cjs +30 -0
  42. package/dist/chunk-GLNVLCUH.cjs +426 -0
  43. package/dist/{chunk-5MMKNW7Q.cjs → chunk-H7REG7OX.cjs} +15 -8
  44. package/dist/{chunk-N2EFMN2K.cjs → chunk-HOQ2MYBJ.cjs} +10 -10
  45. package/dist/{chunk-OP5VI4TP.mjs → chunk-I5CVJ24H.mjs} +1 -1
  46. package/dist/{chunk-I4DR3HCH.mjs → chunk-INU4K4U4.mjs} +5 -5
  47. package/dist/{chunk-4X7LSGM6.mjs → chunk-IRJSZAJB.mjs} +1 -1
  48. package/dist/{chunk-EX6ZSN5P.cjs → chunk-IZYFP7IN.cjs} +17 -24
  49. package/dist/chunk-J6RFB324.cjs +17 -0
  50. package/dist/{chunk-47I2MYIR.mjs → chunk-KXVMWLTC.mjs} +484 -193
  51. package/dist/{chunk-UVV3I5QA.cjs → chunk-L2GUEYHR.cjs} +29 -6
  52. package/dist/{chunk-VMBIKDKW.cjs → chunk-L3BSHASB.cjs} +6 -4
  53. package/dist/chunk-L5HDCDFT.mjs +426 -0
  54. package/dist/{chunk-GXLNARPO.mjs → chunk-M5XU22PQ.mjs} +1 -1
  55. package/dist/chunk-M6AJZ4XR.mjs +30 -0
  56. package/dist/chunk-MAPHNGTF.cjs +98 -0
  57. package/dist/{chunk-RE5E2G5S.cjs → chunk-MNUYXZV7.cjs} +2 -18
  58. package/dist/{chunk-C3VCYOU4.mjs → chunk-MUUDHWQZ.mjs} +1 -1
  59. package/dist/{chunk-YSU3WCW6.mjs → chunk-MYSH5Y4E.mjs} +1 -1
  60. package/dist/{chunk-OMB7UGVW.mjs → chunk-NLHSKKTT.mjs} +14 -9
  61. package/dist/{chunk-ARORZ3MH.cjs → chunk-OFVBMS6I.cjs} +439 -333
  62. package/dist/{chunk-5MUFW5UU.cjs → chunk-OP7BIEUW.cjs} +2 -2
  63. package/dist/{chunk-I4WZRG73.mjs → chunk-RB5IGN3N.mjs} +13 -6
  64. package/dist/chunk-RJBUI5AN.mjs +18 -0
  65. package/dist/chunk-RQ6XX5IN.mjs +98 -0
  66. package/dist/{chunk-EJCVG25Z.mjs → chunk-S3R4JDRO.mjs} +17 -9
  67. package/dist/{chunk-WFVSAT7Y.cjs → chunk-T7HGXF7D.cjs} +3 -3
  68. package/dist/{chunk-HHQEKLZL.cjs → chunk-USMRAC72.cjs} +36 -31
  69. package/dist/{chunk-SM2SYWAR.cjs → chunk-XJDB564A.cjs} +18 -10
  70. package/dist/{chunk-EL2Z6YFZ.mjs → chunk-XLULEFRW.mjs} +180 -70
  71. package/dist/{chunk-6BPFIYGY.cjs → chunk-YU6VL7H5.cjs} +3 -3
  72. package/dist/{chunk-CD5Z7RR5.cjs → chunk-Z37PDUJR.cjs} +4 -4
  73. package/dist/{cli-runtime.d-Hnvvadz7.d.mts → cli-runtime.d-C7aMfoTq.d.mts} +8 -6
  74. package/dist/{cli-runtime.d-I0MphTbc.d.ts → cli-runtime.d-DaElKjaL.d.ts} +8 -6
  75. package/dist/{client-component.d-DapRqtSC.d.mts → client-component.d-DLMCzmUx.d.mts} +1 -1
  76. package/dist/{client-component.d-5QEvtJsg.d.ts → client-component.d-DLknFP8l.d.ts} +1 -1
  77. package/dist/{client-plugins.d-DcmDzcSC.d.ts → client-plugins.d-BVXjyIkY.d.ts} +14 -0
  78. package/dist/{client-plugins.d-C1WM3ieD.d.mts → client-plugins.d-BwKwuO_0.d.mts} +14 -0
  79. package/dist/client-plugins.d.mts +2 -1
  80. package/dist/client-plugins.d.ts +2 -1
  81. package/dist/client.cjs +4 -3
  82. package/dist/client.d.mts +10 -9
  83. package/dist/client.d.ts +10 -9
  84. package/dist/client.mjs +3 -2
  85. package/dist/config.d.mts +2 -1
  86. package/dist/config.d.ts +2 -1
  87. package/dist/desktop.d.mts +3 -2
  88. package/dist/desktop.d.ts +3 -2
  89. package/dist/{devtools-5B7NZE6F.cjs → devtools-4SVIRV4P.cjs} +7 -7
  90. package/dist/{devtools-C5GXZZ7E.mjs → devtools-MWQA5LVN.mjs} +5 -5
  91. package/dist/docs.cjs +10 -9
  92. package/dist/docs.d.mts +15 -6
  93. package/dist/docs.d.ts +15 -6
  94. package/dist/docs.mjs +9 -8
  95. package/dist/environment/vite.cjs +5 -5
  96. package/dist/environment/vite.d.mts +1 -0
  97. package/dist/environment/vite.d.ts +1 -0
  98. package/dist/environment/vite.mjs +4 -4
  99. package/dist/{generate-route-types.d-CaGMIaNI.d.mts → generate-route-types.d-BFOMM8Ef.d.mts} +3 -0
  100. package/dist/{generate-route-types.d-B76M5R11.d.ts → generate-route-types.d-C2m8myHb.d.ts} +3 -0
  101. package/dist/{handler.d-B8bPCBzl.d.mts → handler.d-BKTWzzNA.d.mts} +1 -1
  102. package/dist/{handler.d-Cliwo6Nu.d.ts → handler.d-Dzpyg3-N.d.ts} +1 -1
  103. package/dist/{headers.d-CVwSpSGX.d.mts → headers.d-5opjyhXw.d.mts} +1 -1
  104. package/dist/{headers.d-C_btqjV6.d.ts → headers.d-PZyXcDAH.d.ts} +1 -1
  105. package/dist/index.cjs +32 -29
  106. package/dist/{index.d-DFuMZk9-.d.mts → index.d-C0Mie66f.d.mts} +1 -1
  107. package/dist/{index.d-hOEbMcLk.d.ts → index.d-DV2q-0mE.d.ts} +1 -1
  108. package/dist/index.d.mts +26 -25
  109. package/dist/index.d.ts +26 -25
  110. package/dist/index.mjs +32 -29
  111. package/dist/integrations/orm.d.mts +2 -1
  112. package/dist/integrations/orm.d.ts +2 -1
  113. package/dist/integrations.d.mts +2 -1
  114. package/dist/integrations.d.ts +2 -1
  115. package/dist/internal/app-markdown-runtime.d.mts +3 -2
  116. package/dist/internal/app-markdown-runtime.d.ts +3 -2
  117. package/dist/internal/build-runtime.cjs +28 -27
  118. package/dist/internal/build-runtime.d.mts +5 -4
  119. package/dist/internal/build-runtime.d.ts +5 -4
  120. package/dist/internal/build-runtime.mjs +27 -26
  121. package/dist/internal/cli-runtime.cjs +9 -9
  122. package/dist/internal/cli-runtime.d.mts +8 -7
  123. package/dist/internal/cli-runtime.d.ts +8 -7
  124. package/dist/internal/cli-runtime.mjs +8 -8
  125. package/dist/internal/client-error-overlay.cjs +4 -4
  126. package/dist/internal/client-error-overlay.mjs +1 -1
  127. package/dist/internal/client-runtime.d.mts +8 -42
  128. package/dist/internal/client-runtime.d.ts +8 -42
  129. package/dist/internal/compression-runtime.d.mts +2 -1
  130. package/dist/internal/compression-runtime.d.ts +2 -1
  131. package/dist/internal/config-runtime.cjs +7 -7
  132. package/dist/internal/config-runtime.d.mts +6 -5
  133. package/dist/internal/config-runtime.d.ts +6 -5
  134. package/dist/internal/config-runtime.mjs +6 -6
  135. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  136. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  137. package/dist/internal/islands-action-client.cjs +18 -0
  138. package/dist/internal/islands-action-client.d.mts +18 -0
  139. package/dist/internal/islands-action-client.d.ts +18 -0
  140. package/dist/internal/islands-action-client.mjs +18 -0
  141. package/dist/internal/islands-runtime.cjs +3 -8
  142. package/dist/internal/islands-runtime.mjs +4 -9
  143. package/dist/internal/islx-actions-client.cjs +4 -3
  144. package/dist/internal/islx-actions-client.mjs +3 -2
  145. package/dist/internal/islx-actions-server.d.mts +0 -2
  146. package/dist/internal/islx-actions-server.d.ts +0 -2
  147. package/dist/internal/islx-client.cjs +13 -1
  148. package/dist/internal/islx-client.d.mts +11 -0
  149. package/dist/internal/islx-client.d.ts +11 -0
  150. package/dist/internal/islx-client.mjs +14 -0
  151. package/dist/internal/metadata-image-runtime.d.mts +1 -0
  152. package/dist/internal/metadata-image-runtime.d.ts +1 -0
  153. package/dist/internal/native-server-fns.cjs +4 -4
  154. package/dist/internal/native-server-fns.mjs +3 -3
  155. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  156. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  157. package/dist/internal/production-runtime.cjs +13 -13
  158. package/dist/internal/production-runtime.d.mts +11 -11
  159. package/dist/internal/production-runtime.d.ts +11 -11
  160. package/dist/internal/production-runtime.mjs +19 -19
  161. package/dist/internal/renderer-islands.cjs +47 -0
  162. package/dist/internal/renderer-islands.d.mts +32 -0
  163. package/dist/internal/renderer-islands.d.ts +32 -0
  164. package/dist/internal/renderer-islands.mjs +47 -0
  165. package/dist/internal/spa-router.d.mts +3 -3
  166. package/dist/internal/spa-router.d.ts +3 -3
  167. package/dist/internal/start-manifest.d.mts +2 -1
  168. package/dist/internal/start-manifest.d.ts +2 -1
  169. package/dist/island-runtime.d-BA7EPo1v.d.ts +38 -0
  170. package/dist/island-runtime.d-BBS_YUSX.d.mts +38 -0
  171. package/dist/markdown.d.mts +2 -1
  172. package/dist/markdown.d.ts +2 -1
  173. package/dist/middleware.d.mts +2 -1
  174. package/dist/middleware.d.ts +2 -1
  175. package/dist/mobile.d.mts +6 -3
  176. package/dist/mobile.d.ts +6 -3
  177. package/dist/{mount.d-DLeYxeRR.d.mts → mount.d-CZ_qL1iS.d.mts} +1 -1
  178. package/dist/{mount.d-CAovYKfs.d.ts → mount.d-gWul1GA1.d.ts} +1 -1
  179. package/dist/{navigation-delegate.d-Chv93QS6.d.mts → navigation-delegate.d-BBTzhJLj.d.mts} +1 -1
  180. package/dist/{navigation-delegate.d-BLM-8Q3Z.d.ts → navigation-delegate.d-BZsYEAet.d.ts} +1 -1
  181. package/dist/navigation.d.mts +5 -5
  182. package/dist/navigation.d.ts +5 -5
  183. package/dist/plugin.cjs +23 -22
  184. package/dist/plugin.d.mts +6 -6
  185. package/dist/plugin.d.ts +6 -6
  186. package/dist/plugin.mjs +22 -21
  187. package/dist/{render-plan.d-BSTjTH8h.d.ts → render-plan.d-AaJsYPX-.d.ts} +1 -1
  188. package/dist/{render-plan.d-CK5Lggyb.d.mts → render-plan.d-bnWxS12w.d.mts} +1 -1
  189. package/dist/renderer-client.cjs +6 -5
  190. package/dist/renderer-client.d.mts +8 -7
  191. package/dist/renderer-client.d.ts +8 -7
  192. package/dist/renderer-client.mjs +2 -1
  193. package/dist/renderer.cjs +12 -2
  194. package/dist/renderer.d.mts +167 -4
  195. package/dist/renderer.d.ts +167 -4
  196. package/dist/renderer.mjs +11 -1
  197. package/dist/{request.d-BhggxQf3.d.mts → request.d-C2HOn3Hi.d.mts} +1 -1
  198. package/dist/{request.d-CyJS9bjm.d.ts → request.d-CAeitOG1.d.ts} +1 -1
  199. package/dist/request.d.mts +3 -2
  200. package/dist/request.d.ts +3 -2
  201. package/dist/{route-rendering.d-BLPPmI5I.d.ts → route-rendering.d-A1dIkUK5.d.ts} +1 -1
  202. package/dist/{route-rendering.d-CUpG2mZJ.d.mts → route-rendering.d-CYA-ulnX.d.mts} +1 -1
  203. package/dist/{router.d-2NQM1Kgw.d.mts → router.d-8lxnzlkr.d.mts} +1 -1
  204. package/dist/{router.d-0X2Ki6rf.d.ts → router.d-A_Yt6jYz.d.ts} +1 -1
  205. package/dist/{routes.d-CCccJRrp.d.mts → routes.d-BWvpUoYu.d.mts} +1 -1
  206. package/dist/{routes.d-b7khoRoU.d.ts → routes.d-D7RWvfqL.d.ts} +1 -1
  207. package/dist/routes.d.mts +2 -1
  208. package/dist/routes.d.ts +2 -1
  209. package/dist/{rsc-pipeline-5AOF64FL.cjs → rsc-pipeline-OWBEZ7HB.cjs} +10 -10
  210. package/dist/{rsc-pipeline-DNRLYOJ7.mjs → rsc-pipeline-UT3Z2GDO.mjs} +9 -9
  211. package/dist/{runtime-EHG2FRXZ.mjs → runtime-F5I3WY3B.mjs} +12 -12
  212. package/dist/{runtime-ZVHG5SRB.cjs → runtime-SRMQ46SK.cjs} +15 -15
  213. package/dist/{runtime.d-CXuwkUgr.d.ts → runtime.d-BPyvWrgQ.d.ts} +1 -1
  214. package/dist/{runtime.d-CaFXcu_Q.d.mts → runtime.d-C_rZ9_DD.d.mts} +1 -1
  215. package/dist/{server-components-status.d-Cp7zvBm5.d.mts → server-components-status.d-BpxiEMQE.d.mts} +1 -1
  216. package/dist/{server-components-status.d-BdeFD8ZH.d.ts → server-components-status.d-C2UEKJn7.d.ts} +1 -1
  217. package/dist/server-plugins.d.mts +4 -3
  218. package/dist/server-plugins.d.ts +4 -3
  219. package/dist/server-query-call.d-rVM_lsYk.d.mts +15 -0
  220. package/dist/server-query-call.d-rVM_lsYk.d.ts +15 -0
  221. package/dist/server-query-client.cjs +5 -3
  222. package/dist/server-query-client.d.mts +3 -2
  223. package/dist/server-query-client.d.ts +3 -2
  224. package/dist/server-query-client.mjs +5 -3
  225. package/dist/{server-query-runtime.d-DXRNhX_3.d.ts → server-query-runtime.d-BlHd90D0.d.ts} +2 -8
  226. package/dist/{server-query-runtime.d-aP52iuL5.d.mts → server-query-runtime.d-CCLGkQtE.d.mts} +2 -8
  227. package/dist/server.cjs +52 -52
  228. package/dist/server.d.mts +12 -12
  229. package/dist/server.d.ts +12 -12
  230. package/dist/server.mjs +30 -30
  231. package/dist/{spa-router.d-l3G38xHa.d.mts → spa-router.d-BD-6WX1R.d.mts} +2 -2
  232. package/dist/{spa-router.d-Bjgl-Osi.d.ts → spa-router.d-Cw5i_15e.d.ts} +2 -2
  233. package/dist/{ssg.d-DDca17Lc.d.ts → ssg.d-Bifiq0EL.d.ts} +2 -2
  234. package/dist/{ssg.d-RnlHOqUL.d.mts → ssg.d-CCE9aob5.d.mts} +2 -2
  235. package/dist/{store-core.d-BaOUOPf7.d.ts → store-core.d-5tVn5vi1.d.ts} +3 -3
  236. package/dist/{store-core.d-BZjuC6Zc.d.mts → store-core.d-BN2MxSG9.d.mts} +3 -3
  237. package/dist/testing.d.mts +2 -1
  238. package/dist/testing.d.ts +2 -1
  239. package/dist/{utils.d-D8TWmpWo.d.ts → utils.d-BUjpSNIO.d.ts} +1 -1
  240. package/dist/{utils.d-tdzw0_zQ.d.mts → utils.d-wGPLeVbq.d.mts} +1 -1
  241. package/dist/version.cjs +2 -2
  242. package/dist/version.mjs +1 -1
  243. package/dist/vite.cjs +23 -22
  244. package/dist/vite.d.mts +12 -6
  245. package/dist/vite.d.ts +12 -6
  246. package/dist/vite.mjs +22 -21
  247. package/package.json +13 -3
  248. package/dist/analyzer-LV23T6QN.cjs +0 -17
  249. package/dist/chunk-4QENVMG7.mjs +0 -34
  250. package/dist/chunk-AUFEM3FB.mjs +0 -229
  251. package/dist/chunk-S7WZUK3B.cjs +0 -229
  252. package/dist/{chunk-NEKO3HM2.cjs → chunk-4B6YJ5DS.cjs} +2 -2
  253. package/dist/{chunk-CA2HBLXP.mjs → chunk-4EEAPBNV.mjs} +3 -3
package/dist/vite.mjs CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  shouldEmitFarmClientRootHmr,
14
14
  transformIsolatedClientBoundaryModule,
15
15
  withFarmRequestTracing
16
- } from "./chunk-DAXU2NBE.mjs";
16
+ } from "./chunk-DFDQGHPU.mjs";
17
17
  import "./chunk-7V5M43ND.mjs";
18
18
  import "./chunk-ZIEO3DQ3.mjs";
19
19
  import "./chunk-UD6KTSJS.mjs";
@@ -25,58 +25,59 @@ import {
25
25
  resolveFarmClientCacheAdapterEntry,
26
26
  resolveFarmImageProviderForRuntime,
27
27
  resolveFarmImageServerRuntime
28
- } from "./chunk-NRCKBDYP.mjs";
28
+ } from "./chunk-BRDGINBB.mjs";
29
29
  import "./chunk-MO4UTDQ6.mjs";
30
30
  import "./chunk-IVP5Q4BX.mjs";
31
+ import "./chunk-SMUW7UST.mjs";
32
+ import "./chunk-UB7RVEMX.mjs";
31
33
  import {
32
34
  readRouteRenderingDirectiveFromFile
33
- } from "./chunk-ZIZRIZLP.mjs";
34
- import "./chunk-YSU3WCW6.mjs";
35
+ } from "./chunk-CWUQBECF.mjs";
36
+ import "./chunk-MYSH5Y4E.mjs";
35
37
  import "./chunk-YHHOTKUT.mjs";
36
- import "./chunk-AUFEM3FB.mjs";
38
+ import "./chunk-L5HDCDFT.mjs";
37
39
  import "./chunk-HQ2VAJLW.mjs";
38
40
  import "./chunk-UTUS6JUH.mjs";
39
- import "./chunk-SMUW7UST.mjs";
40
- import "./chunk-UB7RVEMX.mjs";
41
- import "./chunk-CA2HBLXP.mjs";
41
+ import "./chunk-RQ6XX5IN.mjs";
42
+ import "./chunk-M5XU22PQ.mjs";
43
+ import "./chunk-EZYKV24V.mjs";
44
+ import "./chunk-4EEAPBNV.mjs";
42
45
  import "./chunk-LLZSYFOM.mjs";
43
46
  import "./chunk-UUMKLGUU.mjs";
44
47
  import "./chunk-ZXDX7VYZ.mjs";
45
- import "./chunk-V7HNYR76.mjs";
46
- import "./chunk-GXLNARPO.mjs";
47
- import "./chunk-QSMUMK7Y.mjs";
48
+ import "./chunk-3WM7VBGW.mjs";
48
49
  import "./chunk-HR4N2K4V.mjs";
49
- import "./chunk-4X7LSGM6.mjs";
50
- import "./chunk-EZYKV24V.mjs";
50
+ import "./chunk-V7HNYR76.mjs";
51
+ import "./chunk-IRJSZAJB.mjs";
52
+ import "./chunk-X3EFRVXY.mjs";
51
53
  import "./chunk-2PFGA6PB.mjs";
52
54
  import "./chunk-L4RTTTVE.mjs";
53
55
  import "./chunk-GNZIAJGB.mjs";
54
56
  import "./chunk-XAXTTBUT.mjs";
55
57
  import "./chunk-INKVDO42.mjs";
56
- import "./chunk-X3EFRVXY.mjs";
57
58
  import "./chunk-K6HIIWUB.mjs";
58
59
  import "./chunk-YFTGIHNC.mjs";
59
60
  import "./chunk-HZOMT5DY.mjs";
60
61
  import {
61
62
  collectFarmClientPackageImports,
62
63
  resolveFarmClientOptimizeDeps
63
- } from "./chunk-EL2Z6YFZ.mjs";
64
+ } from "./chunk-XLULEFRW.mjs";
64
65
  import "./chunk-D2VAANBS.mjs";
65
66
  import "./chunk-S32PDOLO.mjs";
66
67
  import "./chunk-ZEWWZJPZ.mjs";
67
- import "./chunk-EJCVG25Z.mjs";
68
+ import "./chunk-S3R4JDRO.mjs";
68
69
  import "./chunk-NRNAHZ57.mjs";
69
- import "./chunk-TPA2PV5J.mjs";
70
+ import "./chunk-5V6HSJFG.mjs";
70
71
  import "./chunk-YVVY276M.mjs";
71
72
  import "./chunk-XR2ZIBQK.mjs";
72
73
  import "./chunk-CU5SYTJG.mjs";
73
74
  import "./chunk-NQ3Y6E2T.mjs";
74
- import "./chunk-22W4FNTG.mjs";
75
75
  import "./chunk-SQ5O7I3L.mjs";
76
76
  import "./chunk-XGL42MQ7.mjs";
77
- import "./chunk-4QENVMG7.mjs";
77
+ import "./chunk-22W4FNTG.mjs";
78
+ import "./chunk-RJBUI5AN.mjs";
78
79
  import "./chunk-Z3RM3VA2.mjs";
79
- import "./chunk-RMLR5RMH.mjs";
80
+ import "./chunk-BCCCPFHQ.mjs";
80
81
  import {
81
82
  getPublicFarmImageConfig,
82
83
  resolveFarmImageConfig
@@ -145,7 +146,7 @@ import {
145
146
  import "./chunk-D2LCAV6L.mjs";
146
147
  import "./chunk-H3ASZDT7.mjs";
147
148
  import "./chunk-EILUVBKS.mjs";
148
- import "./chunk-OP5VI4TP.mjs";
149
+ import "./chunk-I5CVJ24H.mjs";
149
150
  import "./chunk-QPNVDSFZ.mjs";
150
151
  import "./chunk-GYMGK467.mjs";
151
152
  import "./chunk-5Y4GYKKH.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm.js/core",
3
- "version": "0.1.82",
3
+ "version": "0.1.84",
4
4
  "description": "The core of Farm.js, the framework for the web and agents",
5
5
  "keywords": [
6
6
  "@farm.js/core",
@@ -759,6 +759,11 @@
759
759
  "import": "./dist/internal/islands-runtime.mjs",
760
760
  "require": "./dist/internal/islands-runtime.cjs"
761
761
  },
762
+ "./internal/islands-action-client": {
763
+ "types": "./dist/internal/islands-action-client.d.ts",
764
+ "import": "./dist/internal/islands-action-client.mjs",
765
+ "require": "./dist/internal/islands-action-client.cjs"
766
+ },
762
767
  "./internal/islands-boot": {
763
768
  "types": "./dist/internal/islands-boot.d.ts",
764
769
  "import": "./dist/internal/islands-boot.mjs",
@@ -769,6 +774,11 @@
769
774
  "import": "./dist/internal/islands-server.mjs",
770
775
  "require": "./dist/internal/islands-server.cjs"
771
776
  },
777
+ "./internal/renderer-islands": {
778
+ "types": "./dist/internal/renderer-islands.d.ts",
779
+ "import": "./dist/internal/renderer-islands.mjs",
780
+ "require": "./dist/internal/renderer-islands.cjs"
781
+ },
772
782
  "./internal/islx-client": {
773
783
  "types": "./dist/internal/islx-client.d.ts",
774
784
  "import": "./dist/internal/islx-client.mjs",
@@ -854,7 +864,7 @@
854
864
  "access": "public"
855
865
  },
856
866
  "dependencies": {
857
- "@farm.js/islx": "0.0.25",
867
+ "@farm.js/islx": "0.0.30",
858
868
  "@farming-labs/orm": "0.0.66",
859
869
  "@farming-labs/orm-runtime": "0.0.66",
860
870
  "@farming-labs/orm-sql": "0.0.66",
@@ -919,7 +929,7 @@
919
929
  "tsup": "^8.3.5",
920
930
  "typescript": "^5.3.3",
921
931
  "vitest": "5.0.5",
922
- "@farm.js/renderer-tests": "0.1.0-beta.2"
932
+ "@farm.js/renderer-tests": "0.1.0-beta.3"
923
933
  },
924
934
  "peerDependencies": {
925
935
  "@farming-labs/docs": "^0.2.118",
@@ -1,17 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
- var _chunk5MUFW5UUcjs = require('./chunk-5MUFW5UU.cjs');
7
- require('./chunk-WBTHHTBO.cjs');
8
- require('./chunk-CCAUIBIS.cjs');
9
- require('./chunk-WMRGIQTA.cjs');
10
- require('./chunk-JK26IMT7.cjs');
11
- require('./chunk-UZM3PDKK.cjs');
12
-
13
-
14
-
15
-
16
-
17
- exports.CORE_PORTABLE = _chunk5MUFW5UUcjs.CORE_PORTABLE; exports.analyzeFarmMobileRoutes = _chunk5MUFW5UUcjs.analyzeFarmMobileRoutes; exports.readAliases = _chunk5MUFW5UUcjs.readAliases; exports.resolveFile = _chunk5MUFW5UUcjs.resolveFile;
@@ -1,34 +0,0 @@
1
- // src/server-components-mode.ts
2
- function resolveFarmServerComponentsMode(value) {
3
- if (value === void 0 || value === null || value === false) return void 0;
4
- if (value === true) return "islands";
5
- const mode = typeof value === "object" ? value.mode : void 0;
6
- if (mode === "rsc" || mode === "islands") return mode;
7
- throw new TypeError(
8
- 'experimental.serverComponents must be true, false, { mode: "rsc" } or { mode: "islands" }.'
9
- );
10
- }
11
- function isExplicitFarmServerComponentsMode(value) {
12
- return typeof value === "object" && value !== null;
13
- }
14
-
15
- // src/utils/source-dir.ts
16
- import path from "path";
17
- var FARM_PROJECT_SOURCE_DIRS = /* @__PURE__ */ Symbol.for("farm.projectSourceDirs");
18
- function getProjectSourceDirs() {
19
- const globalState = globalThis;
20
- return globalState[FARM_PROJECT_SOURCE_DIRS] ?? (globalState[FARM_PROJECT_SOURCE_DIRS] = /* @__PURE__ */ new Map());
21
- }
22
- function setFarmProjectSourceDir(root, srcDir) {
23
- getProjectSourceDirs().set(path.resolve(root), srcDir);
24
- }
25
- function getFarmProjectSourceDir(root) {
26
- return getProjectSourceDirs().get(path.resolve(root)) ?? "src";
27
- }
28
-
29
- export {
30
- resolveFarmServerComponentsMode,
31
- isExplicitFarmServerComponentsMode,
32
- setFarmProjectSourceDir,
33
- getFarmProjectSourceDir
34
- };
@@ -1,229 +0,0 @@
1
- import {
2
- writeFileIfChanged
3
- } from "./chunk-YFTGIHNC.mjs";
4
- import {
5
- resolveFarmComponentExtensions
6
- } from "./chunk-RMLR5RMH.mjs";
7
- import {
8
- parseRouteSlotFile
9
- } from "./chunk-CYRO3WP4.mjs";
10
- import {
11
- discoverProgrammaticRoutePaths
12
- } from "./chunk-URBP6DLH.mjs";
13
- import {
14
- parseRoutePath
15
- } from "./chunk-U6GMCDRS.mjs";
16
-
17
- // src/routing/generate-route-types.ts
18
- import * as path from "path";
19
- import * as fs from "fs";
20
- function routeSegmentsToTsTypeLiteral(segments) {
21
- if (segments.length === 0) return '"/"';
22
- const hasDynamic = segments.some((s) => s.startsWith("["));
23
- if (!hasDynamic) return JSON.stringify("/" + segments.join("/"));
24
- const parts = segments.map((s) => {
25
- if (s.startsWith("[[...") || s.startsWith("[...")) return "${string}";
26
- if (s.startsWith("[")) return "${string}";
27
- return s;
28
- });
29
- return "`/" + parts.join("/") + "`";
30
- }
31
- function routePatternToTsTypeLiterals(pattern) {
32
- if (pattern === "/") return ['"/"'];
33
- let variants = [[]];
34
- for (const segment of pattern.slice(1).split("/").filter(Boolean)) {
35
- if (segment.startsWith("[[...") && segment.endsWith("]]")) {
36
- variants = variants.flatMap((parts) => [parts, [...parts, segment]]);
37
- } else {
38
- variants = variants.map((parts) => [...parts, segment]);
39
- }
40
- }
41
- return variants.map(routeSegmentsToTsTypeLiteral);
42
- }
43
- function routePatternToRouteLiteral(pattern) {
44
- return JSON.stringify(pattern);
45
- }
46
- function renderTypeUnion(values) {
47
- return values.length <= 1 ? values[0] || "never" : `
48
- | ${values.join("\n | ")}`;
49
- }
50
- function renderTypeAlias(name, value) {
51
- return `export type ${name} =${value.startsWith("\n") ? "" : " "}${value};`;
52
- }
53
- function createRoutePattern(route) {
54
- if (route.segments.length === 0) return "/";
55
- return "/" + route.segments.map((seg) => {
56
- if (!seg.isDynamic) return seg.segment;
57
- if (seg.isCatchAll) return seg.isOptional ? `[[...${seg.segment}]]` : `[...${seg.segment}]`;
58
- return `[${seg.segment}]`;
59
- }).join("/");
60
- }
61
- var DEFAULT_OUT_FILE = "farm-routes.d.ts";
62
- async function generateRouteTypes(options) {
63
- const root = path.resolve(options.root);
64
- const srcDir = options.srcDir || "src";
65
- const outFile = options.outFile || DEFAULT_OUT_FILE;
66
- const outPath = path.isAbsolute(outFile) ? outFile : path.join(root, srcDir, outFile);
67
- const content = await createRouteTypeDeclarations(options, outPath);
68
- fs.mkdirSync(path.dirname(outPath), { recursive: true });
69
- writeFileIfChanged(outPath, content);
70
- return outPath;
71
- }
72
- async function createRouteTypeDeclarations(options, outPath) {
73
- const { extraRoutes = [], suppressLintOnLink = false } = options;
74
- const { pages: patterns, modules: routeModulePatterns } = await scanRoutePatterns(options);
75
- for (const route of extraRoutes) {
76
- if (route.startsWith("/")) {
77
- patterns.add(route);
78
- routeModulePatterns.add(route);
79
- }
80
- }
81
- const sortedPatterns = Array.from(patterns).sort();
82
- const typeLiterals = Array.from(new Set(sortedPatterns.flatMap(routePatternToTsTypeLiterals)));
83
- const patternLiterals = sortedPatterns.map(routePatternToRouteLiteral);
84
- const routeModulePatternLiterals = Array.from(routeModulePatterns).sort().map(routePatternToRouteLiteral);
85
- const routePathType = suppressLintOnLink ? "string" : renderTypeUnion(typeLiterals);
86
- const routePatternType = suppressLintOnLink ? "string" : renderTypeUnion(patternLiterals);
87
- const routeModulePatternType = renderTypeUnion(routeModulePatternLiterals);
88
- const routeTypesImportPath = `./${path.basename(outPath).replace(/\.d\.ts$/, "")}`;
89
- const linkAugmentationBlock = suppressLintOnLink ? "" : `
90
- declare module "@farm.js/core/client" {
91
- interface LinkDefaultRoute {
92
- _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
93
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
94
- }
95
- }
96
-
97
- declare module "@farm.js/core" {
98
- interface LinkDefaultRoute {
99
- _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
100
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
101
- }
102
- // Ensure root import ("@farm.js/core") uses the same typed Link signature as client entry.
103
- const Link: typeof import("@farm.js/core/client").Link;
104
- }
105
-
106
- // Internal declaration path used by @farm.js/core root type re-exports.
107
- declare module "@farm.js/core/dist/client.js" {
108
- interface LinkDefaultRoute {
109
- _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
110
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
111
- }
112
- }
113
- `;
114
- const routeModuleAugmentationBlock = `
115
- declare global {
116
- namespace FarmJS {
117
- interface RouteRegistry {
118
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RouteModulePattern;
119
- }
120
- }
121
- }
122
- `;
123
- const content = `/**
124
- * Auto-generated route types from src/app.
125
- * Link href and route component props are typed automatically from generated declarations.
126
- * Regenerated on dev start and when routes change.
127
- * Set suppressLintOnLink: true in farm.config.ts to accept any string on Link href.
128
- */
129
- ${renderTypeAlias("RoutePath", routePathType)}
130
- ${renderTypeAlias("RoutePattern", routePatternType)}
131
- ${renderTypeAlias("RouteModulePattern", routeModulePatternType)}${linkAugmentationBlock}${routeModuleAugmentationBlock}
132
- `;
133
- return content;
134
- }
135
- var PLATFORM_FILE = /^(?:(page|layout)\.(native|ios|android)\.(?:tsx|ts|jsx|js)|page\.(kt|swift))$/;
136
- async function scanRoutePatterns(options) {
137
- const { root, srcDir = "src" } = options;
138
- const sourceRoots = options.sourceRoots ?? [{ name: "project", root, srcDir, layer: false }];
139
- const componentExtensions = resolveFarmComponentExtensions(options.componentExtensions).map(
140
- (extension) => extension.slice(1)
141
- );
142
- const pages = /* @__PURE__ */ new Set();
143
- const modules = /* @__PURE__ */ new Set();
144
- const pageFiles = /* @__PURE__ */ new Map();
145
- const nativePages = /* @__PURE__ */ new Map();
146
- const nativeLayouts = /* @__PURE__ */ new Map();
147
- const { glob } = await import("tinyglobby");
148
- for (const source of sourceRoots) {
149
- const appDir = path.join(source.root, source.srcDir, "app");
150
- if (fs.existsSync(appDir)) {
151
- const routeModuleFiles = await glob(
152
- `**/{page,layout,loading,error}.{${componentExtensions.join(",")},md,mdx}`,
153
- { cwd: appDir, expandDirectories: false }
154
- );
155
- for (const file of routeModuleFiles) {
156
- if (parseRouteSlotFile(file)) continue;
157
- const route = parseRoutePath(file);
158
- const pattern = createRoutePattern(route);
159
- modules.add(pattern);
160
- if (route.type === "page") {
161
- pages.add(pattern);
162
- if (options.platformFiles) pageFiles.set(pattern, path.join(appDir, file));
163
- }
164
- }
165
- if (options.platformFiles) {
166
- scanPlatformRouteFiles(
167
- appDir,
168
- await glob(
169
- ["**/{page,layout}.{native,ios,android}.{tsx,ts,jsx,js}", "**/page.{kt,swift}"],
170
- { cwd: appDir, expandDirectories: false }
171
- ),
172
- nativePages,
173
- nativeLayouts
174
- );
175
- }
176
- }
177
- for (const route of await discoverProgrammaticRoutePaths(source.root, source.srcDir)) {
178
- pages.add(route);
179
- modules.add(route);
180
- }
181
- }
182
- if (!options.platformFiles) return { pages, modules };
183
- const nativeOnlyPages = /* @__PURE__ */ new Set();
184
- for (const [pattern, files] of nativePages) {
185
- if (pages.has(pattern)) continue;
186
- if (files.native) {
187
- nativeOnlyPages.add(pattern);
188
- continue;
189
- }
190
- const file = path.relative(root, Object.values(files)[0]);
191
- const dir = path.dirname(file);
192
- throw new Error(
193
- `${file.replace(/\\/g, "/")} has no web page next to it. Add ${path.join(dir, "page.tsx").replace(/\\/g, "/")} (the route's web screen and fallback), or ${path.join(dir, "page.native.tsx").replace(/\\/g, "/")} to make the route native-only on both OSes.`
194
- );
195
- }
196
- return { pages, modules, pageFiles, nativePages, nativeLayouts, nativeOnlyPages };
197
- }
198
- function scanPlatformRouteFiles(appDir, files, nativePages, nativeLayouts) {
199
- const seen = /* @__PURE__ */ new Map();
200
- for (const file of [...files].sort()) {
201
- const normalized = file.replace(/\\/g, "/");
202
- const match = PLATFORM_FILE.exec(path.posix.basename(normalized));
203
- if (!match) continue;
204
- const kind = match[1] ?? "page";
205
- const platform = match[2] ?? match[3];
206
- const twin = path.posix.join(path.posix.dirname(normalized), `${kind}.tsx`);
207
- if (kind === "page" && parseRouteSlotFile(twin)) continue;
208
- const dir = path.posix.dirname(normalized);
209
- const pattern = kind === "page" ? createRoutePattern(parseRoutePath(twin)) : dir === "." ? "/" : `/${dir}`;
210
- const key = `${kind}\0${pattern}\0${platform}`;
211
- const previous = seen.get(key);
212
- if (previous) {
213
- throw new Error(
214
- `Duplicate ${platform} ${kind} for "${pattern}": found ${previous} and ${normalized} in ${appDir}. Keep one.`
215
- );
216
- }
217
- seen.set(key, normalized);
218
- const target = kind === "page" ? nativePages : nativeLayouts;
219
- const entry = { ...target.get(pattern) };
220
- entry[platform] = path.join(appDir, normalized);
221
- target.set(pattern, entry);
222
- }
223
- }
224
-
225
- export {
226
- generateRouteTypes,
227
- createRouteTypeDeclarations,
228
- scanRoutePatterns
229
- };
@@ -1,229 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
-
3
- var _chunkAQIRXBBYcjs = require('./chunk-AQIRXBBY.cjs');
4
-
5
-
6
- var _chunkBCTHOQPPcjs = require('./chunk-BCTHOQPP.cjs');
7
-
8
-
9
- var _chunk2BEGVSDFcjs = require('./chunk-2BEGVSDF.cjs');
10
-
11
-
12
- var _chunkHS4JPIGRcjs = require('./chunk-HS4JPIGR.cjs');
13
-
14
-
15
- var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
16
-
17
- // src/routing/generate-route-types.ts
18
- var _path = require('path'); var path = _interopRequireWildcard(_path);
19
- var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
20
- function routeSegmentsToTsTypeLiteral(segments) {
21
- if (segments.length === 0) return '"/"';
22
- const hasDynamic = segments.some((s) => s.startsWith("["));
23
- if (!hasDynamic) return JSON.stringify("/" + segments.join("/"));
24
- const parts = segments.map((s) => {
25
- if (s.startsWith("[[...") || s.startsWith("[...")) return "${string}";
26
- if (s.startsWith("[")) return "${string}";
27
- return s;
28
- });
29
- return "`/" + parts.join("/") + "`";
30
- }
31
- function routePatternToTsTypeLiterals(pattern) {
32
- if (pattern === "/") return ['"/"'];
33
- let variants = [[]];
34
- for (const segment of pattern.slice(1).split("/").filter(Boolean)) {
35
- if (segment.startsWith("[[...") && segment.endsWith("]]")) {
36
- variants = variants.flatMap((parts) => [parts, [...parts, segment]]);
37
- } else {
38
- variants = variants.map((parts) => [...parts, segment]);
39
- }
40
- }
41
- return variants.map(routeSegmentsToTsTypeLiteral);
42
- }
43
- function routePatternToRouteLiteral(pattern) {
44
- return JSON.stringify(pattern);
45
- }
46
- function renderTypeUnion(values) {
47
- return values.length <= 1 ? values[0] || "never" : `
48
- | ${values.join("\n | ")}`;
49
- }
50
- function renderTypeAlias(name, value) {
51
- return `export type ${name} =${value.startsWith("\n") ? "" : " "}${value};`;
52
- }
53
- function createRoutePattern(route) {
54
- if (route.segments.length === 0) return "/";
55
- return "/" + route.segments.map((seg) => {
56
- if (!seg.isDynamic) return seg.segment;
57
- if (seg.isCatchAll) return seg.isOptional ? `[[...${seg.segment}]]` : `[...${seg.segment}]`;
58
- return `[${seg.segment}]`;
59
- }).join("/");
60
- }
61
- var DEFAULT_OUT_FILE = "farm-routes.d.ts";
62
- async function generateRouteTypes(options) {
63
- const root = path.resolve(options.root);
64
- const srcDir = options.srcDir || "src";
65
- const outFile = options.outFile || DEFAULT_OUT_FILE;
66
- const outPath = path.isAbsolute(outFile) ? outFile : path.join(root, srcDir, outFile);
67
- const content = await createRouteTypeDeclarations(options, outPath);
68
- fs.mkdirSync(path.dirname(outPath), { recursive: true });
69
- _chunkAQIRXBBYcjs.writeFileIfChanged.call(void 0, outPath, content);
70
- return outPath;
71
- }
72
- async function createRouteTypeDeclarations(options, outPath) {
73
- const { extraRoutes = [], suppressLintOnLink = false } = options;
74
- const { pages: patterns, modules: routeModulePatterns } = await scanRoutePatterns(options);
75
- for (const route of extraRoutes) {
76
- if (route.startsWith("/")) {
77
- patterns.add(route);
78
- routeModulePatterns.add(route);
79
- }
80
- }
81
- const sortedPatterns = Array.from(patterns).sort();
82
- const typeLiterals = Array.from(new Set(sortedPatterns.flatMap(routePatternToTsTypeLiterals)));
83
- const patternLiterals = sortedPatterns.map(routePatternToRouteLiteral);
84
- const routeModulePatternLiterals = Array.from(routeModulePatterns).sort().map(routePatternToRouteLiteral);
85
- const routePathType = suppressLintOnLink ? "string" : renderTypeUnion(typeLiterals);
86
- const routePatternType = suppressLintOnLink ? "string" : renderTypeUnion(patternLiterals);
87
- const routeModulePatternType = renderTypeUnion(routeModulePatternLiterals);
88
- const routeTypesImportPath = `./${path.basename(outPath).replace(/\.d\.ts$/, "")}`;
89
- const linkAugmentationBlock = suppressLintOnLink ? "" : `
90
- declare module "@farm.js/core/client" {
91
- interface LinkDefaultRoute {
92
- _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
93
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
94
- }
95
- }
96
-
97
- declare module "@farm.js/core" {
98
- interface LinkDefaultRoute {
99
- _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
100
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
101
- }
102
- // Ensure root import ("@farm.js/core") uses the same typed Link signature as client entry.
103
- const Link: typeof import("@farm.js/core/client").Link;
104
- }
105
-
106
- // Internal declaration path used by @farm.js/core root type re-exports.
107
- declare module "@farm.js/core/dist/client.js" {
108
- interface LinkDefaultRoute {
109
- _: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
110
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
111
- }
112
- }
113
- `;
114
- const routeModuleAugmentationBlock = `
115
- declare global {
116
- namespace FarmJS {
117
- interface RouteRegistry {
118
- pattern: import(${JSON.stringify(routeTypesImportPath)}).RouteModulePattern;
119
- }
120
- }
121
- }
122
- `;
123
- const content = `/**
124
- * Auto-generated route types from src/app.
125
- * Link href and route component props are typed automatically from generated declarations.
126
- * Regenerated on dev start and when routes change.
127
- * Set suppressLintOnLink: true in farm.config.ts to accept any string on Link href.
128
- */
129
- ${renderTypeAlias("RoutePath", routePathType)}
130
- ${renderTypeAlias("RoutePattern", routePatternType)}
131
- ${renderTypeAlias("RouteModulePattern", routeModulePatternType)}${linkAugmentationBlock}${routeModuleAugmentationBlock}
132
- `;
133
- return content;
134
- }
135
- var PLATFORM_FILE = /^(?:(page|layout)\.(native|ios|android)\.(?:tsx|ts|jsx|js)|page\.(kt|swift))$/;
136
- async function scanRoutePatterns(options) {
137
- const { root, srcDir = "src" } = options;
138
- const sourceRoots = _nullishCoalesce(options.sourceRoots, () => ( [{ name: "project", root, srcDir, layer: false }]));
139
- const componentExtensions = _chunkBCTHOQPPcjs.resolveFarmComponentExtensions.call(void 0, options.componentExtensions).map(
140
- (extension) => extension.slice(1)
141
- );
142
- const pages = /* @__PURE__ */ new Set();
143
- const modules = /* @__PURE__ */ new Set();
144
- const pageFiles = /* @__PURE__ */ new Map();
145
- const nativePages = /* @__PURE__ */ new Map();
146
- const nativeLayouts = /* @__PURE__ */ new Map();
147
- const { glob } = await import("tinyglobby");
148
- for (const source of sourceRoots) {
149
- const appDir = path.join(source.root, source.srcDir, "app");
150
- if (fs.existsSync(appDir)) {
151
- const routeModuleFiles = await glob(
152
- `**/{page,layout,loading,error}.{${componentExtensions.join(",")},md,mdx}`,
153
- { cwd: appDir, expandDirectories: false }
154
- );
155
- for (const file of routeModuleFiles) {
156
- if (_chunk2BEGVSDFcjs.parseRouteSlotFile.call(void 0, file)) continue;
157
- const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
158
- const pattern = createRoutePattern(route);
159
- modules.add(pattern);
160
- if (route.type === "page") {
161
- pages.add(pattern);
162
- if (options.platformFiles) pageFiles.set(pattern, path.join(appDir, file));
163
- }
164
- }
165
- if (options.platformFiles) {
166
- scanPlatformRouteFiles(
167
- appDir,
168
- await glob(
169
- ["**/{page,layout}.{native,ios,android}.{tsx,ts,jsx,js}", "**/page.{kt,swift}"],
170
- { cwd: appDir, expandDirectories: false }
171
- ),
172
- nativePages,
173
- nativeLayouts
174
- );
175
- }
176
- }
177
- for (const route of await _chunkHS4JPIGRcjs.discoverProgrammaticRoutePaths.call(void 0, source.root, source.srcDir)) {
178
- pages.add(route);
179
- modules.add(route);
180
- }
181
- }
182
- if (!options.platformFiles) return { pages, modules };
183
- const nativeOnlyPages = /* @__PURE__ */ new Set();
184
- for (const [pattern, files] of nativePages) {
185
- if (pages.has(pattern)) continue;
186
- if (files.native) {
187
- nativeOnlyPages.add(pattern);
188
- continue;
189
- }
190
- const file = path.relative(root, Object.values(files)[0]);
191
- const dir = path.dirname(file);
192
- throw new Error(
193
- `${file.replace(/\\/g, "/")} has no web page next to it. Add ${path.join(dir, "page.tsx").replace(/\\/g, "/")} (the route's web screen and fallback), or ${path.join(dir, "page.native.tsx").replace(/\\/g, "/")} to make the route native-only on both OSes.`
194
- );
195
- }
196
- return { pages, modules, pageFiles, nativePages, nativeLayouts, nativeOnlyPages };
197
- }
198
- function scanPlatformRouteFiles(appDir, files, nativePages, nativeLayouts) {
199
- const seen = /* @__PURE__ */ new Map();
200
- for (const file of [...files].sort()) {
201
- const normalized = file.replace(/\\/g, "/");
202
- const match = PLATFORM_FILE.exec(path.posix.basename(normalized));
203
- if (!match) continue;
204
- const kind = _nullishCoalesce(match[1], () => ( "page"));
205
- const platform = _nullishCoalesce(match[2], () => ( match[3]));
206
- const twin = path.posix.join(path.posix.dirname(normalized), `${kind}.tsx`);
207
- if (kind === "page" && _chunk2BEGVSDFcjs.parseRouteSlotFile.call(void 0, twin)) continue;
208
- const dir = path.posix.dirname(normalized);
209
- const pattern = kind === "page" ? createRoutePattern(_chunk7U4XF76Rcjs.parseRoutePath.call(void 0, twin)) : dir === "." ? "/" : `/${dir}`;
210
- const key = `${kind}\0${pattern}\0${platform}`;
211
- const previous = seen.get(key);
212
- if (previous) {
213
- throw new Error(
214
- `Duplicate ${platform} ${kind} for "${pattern}": found ${previous} and ${normalized} in ${appDir}. Keep one.`
215
- );
216
- }
217
- seen.set(key, normalized);
218
- const target = kind === "page" ? nativePages : nativeLayouts;
219
- const entry = { ...target.get(pattern) };
220
- entry[platform] = path.join(appDir, normalized);
221
- target.set(pattern, entry);
222
- }
223
- }
224
-
225
-
226
-
227
-
228
-
229
- exports.generateRouteTypes = generateRouteTypes; exports.createRouteTypeDeclarations = createRouteTypeDeclarations; exports.scanRoutePatterns = scanRoutePatterns;
@@ -6,10 +6,10 @@ var _chunkOWOUTKIJcjs = require('./chunk-OWOUTKIJ.cjs');
6
6
  var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
7
7
 
8
8
 
9
- var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
9
+ var _chunkOLKYHTLNcjs = require('./chunk-OLKYHTLN.cjs');
10
10
 
11
11
 
12
- var _chunkOLKYHTLNcjs = require('./chunk-OLKYHTLN.cjs');
12
+ var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
13
13
 
14
14
 
15
15
  var _chunk2NOHVIJ3cjs = require('./chunk-2NOHVIJ3.cjs');