@farm.js/core 0.1.81 → 0.1.83
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.
- package/dist/{agent-mcp.d-Cxi3214_.d.ts → agent-mcp.d-7uKdOttc.d.ts} +1 -1
- package/dist/{agent-mcp.d-DMqOqnOA.d.mts → agent-mcp.d-LChlR2au.d.mts} +1 -1
- package/dist/agent-runtime.cjs +4 -3
- package/dist/agent-runtime.d.mts +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/agent-runtime.mjs +3 -2
- package/dist/analyzer-WGH6J2HN.cjs +17 -0
- package/dist/{analyzer-IC66UJCU.mjs → analyzer-Y6IY26HI.mjs} +2 -2
- package/dist/api/node.cjs +5 -4
- package/dist/api/node.d.mts +4 -3
- package/dist/api/node.d.ts +4 -3
- package/dist/api/node.mjs +4 -3
- package/dist/api/route-manager.cjs +5 -4
- package/dist/api/route-manager.d.mts +4 -3
- package/dist/api/route-manager.d.ts +4 -3
- package/dist/api/route-manager.mjs +4 -3
- package/dist/api/runtime.cjs +4 -3
- package/dist/api/runtime.d.mts +3 -2
- package/dist/api/runtime.d.ts +3 -2
- package/dist/api/runtime.mjs +3 -2
- package/dist/api.cjs +7 -6
- package/dist/api.d.mts +5 -4
- package/dist/api.d.ts +5 -4
- package/dist/api.mjs +6 -5
- package/dist/{app-manifest.d-C8Cswd31.d.ts → app-manifest.d-CRp21oAz.d.ts} +1 -1
- package/dist/{app-manifest.d-Bbxp5kes.d.mts → app-manifest.d-QMdmqqCr.d.mts} +1 -1
- package/dist/app-markdown.d.mts +3 -2
- package/dist/app-markdown.d.ts +3 -2
- package/dist/{app.d-DGIoFt5D.d.ts → app.d-CVPu_hoD.d.ts} +51 -4
- package/dist/{app.d-BJuSurgy.d.mts → app.d-eSm7jgoc.d.mts} +51 -4
- package/dist/{chunk-NSLRK5DK.cjs → chunk-3CZ4MJHW.cjs} +1 -1
- package/dist/{chunk-CPZZBCPO.cjs → chunk-3DAJXBSL.cjs} +2 -2
- package/dist/chunk-3DE6RK7K.cjs +36 -0
- package/dist/{chunk-XMHERKSE.mjs → chunk-42IBGQTN.mjs} +5 -12
- package/dist/{chunk-GY63XD6K.mjs → chunk-43N3X6OO.mjs} +1 -1
- package/dist/{chunk-MOGRRZMW.cjs → chunk-55UJGUBP.cjs} +35 -30
- package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
- package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
- package/dist/{chunk-LKIG5SM6.cjs → chunk-5P65LXGU.cjs} +9 -9
- package/dist/{chunk-TPA2PV5J.mjs → chunk-5V6HSJFG.mjs} +24 -1
- package/dist/chunk-5X5GJU5A.cjs +426 -0
- package/dist/{chunk-UF4BNKKJ.mjs → chunk-6QYPP5KC.mjs} +2 -2
- package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
- package/dist/{chunk-OIWDEDUO.cjs → chunk-7X2CYE66.cjs} +419 -357
- package/dist/{chunk-XOGCNKB7.cjs → chunk-A5BHJHDF.cjs} +3 -3
- package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
- package/dist/{chunk-HTNJ7A4D.mjs → chunk-B5SJYXJK.mjs} +177 -67
- package/dist/chunk-BUQR7KKO.mjs +17 -0
- package/dist/{chunk-OO4GVGM3.mjs → chunk-CA2HBLXP.mjs} +11 -1
- package/dist/{chunk-724WT3NI.mjs → chunk-CRE642TW.mjs} +1 -1
- package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
- package/dist/{chunk-IPG6B25T.mjs → chunk-DPUZVGXH.mjs} +203 -54
- package/dist/{chunk-ZIYJWJV2.cjs → chunk-DZTWUEBB.cjs} +8 -8
- package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
- package/dist/{chunk-46UV2E7I.cjs → chunk-EFI6QWBQ.cjs} +200 -90
- package/dist/chunk-ELNRKD4V.mjs +426 -0
- package/dist/{chunk-XOXCQGAF.mjs → chunk-FFWSER54.mjs} +1 -1
- package/dist/chunk-FZ7OUN5M.cjs +30 -0
- package/dist/{chunk-5MMKNW7Q.cjs → chunk-H7REG7OX.cjs} +15 -8
- package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
- package/dist/{chunk-OUDNUFVR.cjs → chunk-HRH7OKBQ.cjs} +6 -4
- package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
- package/dist/{chunk-ADQ2LATR.cjs → chunk-IABI62FH.cjs} +2 -2
- package/dist/{chunk-TLSGRK7E.mjs → chunk-IAIRQAHA.mjs} +3 -1
- package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
- package/dist/{chunk-EX6ZSN5P.cjs → chunk-IZYFP7IN.cjs} +17 -24
- package/dist/chunk-J6RFB324.cjs +17 -0
- package/dist/{chunk-CL7BUGVB.cjs → chunk-JHRJ5V2F.cjs} +509 -360
- package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
- package/dist/{chunk-POL5RCVU.mjs → chunk-K3GHY7GY.mjs} +14 -9
- package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
- package/dist/{chunk-UVV3I5QA.cjs → chunk-L2GUEYHR.cjs} +29 -6
- package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
- package/dist/{chunk-E3HBD2K3.cjs → chunk-LN6FAYNB.cjs} +36 -31
- package/dist/chunk-M6AJZ4XR.mjs +30 -0
- package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
- package/dist/{chunk-6WVRVGKC.mjs → chunk-NAHDG6UX.mjs} +1 -1
- package/dist/{chunk-NOYKBGUK.mjs → chunk-NDWI6FDH.mjs} +558 -212
- package/dist/{chunk-OFVCWV2D.cjs → chunk-NEKO3HM2.cjs} +11 -1
- package/dist/{chunk-M6DAIE4T.cjs → chunk-NGTZHWBG.cjs} +78 -9
- package/dist/{chunk-D77OGI6X.mjs → chunk-NKVBWPXR.mjs} +1 -1
- package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
- package/dist/{chunk-W6C3LEXX.cjs → chunk-OM6JIIJU.cjs} +155 -20
- package/dist/{chunk-S3IWDDQ3.mjs → chunk-ORBBAA7B.mjs} +1 -1
- package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
- package/dist/{chunk-BJWJP5A4.mjs → chunk-R3VLM2MW.mjs} +3 -3
- package/dist/{chunk-I4WZRG73.mjs → chunk-RB5IGN3N.mjs} +13 -6
- package/dist/{chunk-2HMSSPCZ.mjs → chunk-RGTZAM6Y.mjs} +71 -2
- package/dist/{chunk-IM3UINTZ.mjs → chunk-RNJX3MD6.mjs} +151 -16
- package/dist/{chunk-EJCVG25Z.mjs → chunk-S3R4JDRO.mjs} +17 -9
- package/dist/{chunk-2Y2HRZQY.cjs → chunk-SLIXHUMS.cjs} +931 -585
- package/dist/{chunk-WFVSAT7Y.cjs → chunk-T7HGXF7D.cjs} +3 -3
- package/dist/{chunk-ZKNXCRUQ.cjs → chunk-U54REWMJ.cjs} +23 -23
- package/dist/{chunk-YH7ENV3K.mjs → chunk-U56Z3755.mjs} +13 -8
- package/dist/chunk-U6XYBTUT.mjs +36 -0
- package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
- package/dist/{chunk-RZ6XUEQS.mjs → chunk-VQ6IXALL.mjs} +2 -2
- package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
- package/dist/{chunk-FYZD7DUS.cjs → chunk-WCSBYQOT.cjs} +4 -4
- package/dist/{chunk-5N526T7Q.mjs → chunk-WZV2G2A6.mjs} +95 -33
- package/dist/{chunk-SM2SYWAR.cjs → chunk-XJDB564A.cjs} +18 -10
- package/dist/{chunk-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
- package/dist/{cli-runtime.d-D8O1v2_X.d.mts → cli-runtime.d-C7aMfoTq.d.mts} +8 -6
- package/dist/{cli-runtime.d-hf4L1MNP.d.ts → cli-runtime.d-DaElKjaL.d.ts} +8 -6
- package/dist/{client-component.d-DFwUHlOz.d.mts → client-component.d-DLMCzmUx.d.mts} +1 -1
- package/dist/{client-component.d-CX8UCQh-.d.ts → client-component.d-DLknFP8l.d.ts} +1 -1
- package/dist/{client-plugins.d-qWp8hNwd.d.ts → client-plugins.d-BVXjyIkY.d.ts} +20 -1
- package/dist/{client-plugins.d-BflSNO-b.d.mts → client-plugins.d-BwKwuO_0.d.mts} +20 -1
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +4 -3
- package/dist/client.d.mts +10 -9
- package/dist/client.d.ts +10 -9
- package/dist/client.mjs +3 -2
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/desktop.d.mts +3 -2
- package/dist/desktop.d.ts +3 -2
- package/dist/{devtools-XJHODO5H.mjs → devtools-OI52TCSD.mjs} +8 -7
- package/dist/{devtools-EI5N366Z.cjs → devtools-ZM2AR36W.cjs} +11 -10
- package/dist/docs.cjs +13 -11
- package/dist/docs.d.mts +15 -6
- package/dist/docs.d.ts +15 -6
- package/dist/docs.mjs +12 -10
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.d.mts +1 -0
- package/dist/environment/vite.d.ts +1 -0
- package/dist/environment/vite.mjs +3 -3
- package/dist/{generate-route-types.d-CaGMIaNI.d.mts → generate-route-types.d-BFOMM8Ef.d.mts} +3 -0
- package/dist/{generate-route-types.d-B76M5R11.d.ts → generate-route-types.d-C2m8myHb.d.ts} +3 -0
- package/dist/{handler.d-DoH5Krkq.d.mts → handler.d-BKTWzzNA.d.mts} +1 -1
- package/dist/{handler.d-C2oRihfa.d.ts → handler.d-Dzpyg3-N.d.ts} +1 -1
- package/dist/{headers.d-BrX53wFQ.d.mts → headers.d-5opjyhXw.d.mts} +1 -1
- package/dist/{headers.d-Dj0mfYpb.d.ts → headers.d-PZyXcDAH.d.ts} +1 -1
- package/dist/index.cjs +38 -35
- package/dist/{index.d-DzDHOttz.d.mts → index.d-C0Mie66f.d.mts} +1 -1
- package/dist/{index.d-Dhc2scRl.d.ts → index.d-DV2q-0mE.d.ts} +1 -1
- package/dist/index.d.mts +26 -25
- package/dist/index.d.ts +26 -25
- package/dist/index.mjs +38 -35
- package/dist/integrations/orm.d.mts +2 -1
- package/dist/integrations/orm.d.ts +2 -1
- package/dist/integrations.cjs +4 -3
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/integrations.mjs +3 -2
- package/dist/internal/app-markdown-runtime.d.mts +3 -2
- package/dist/internal/app-markdown-runtime.d.ts +3 -2
- package/dist/internal/build-runtime.cjs +31 -30
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +30 -29
- package/dist/internal/cli-runtime.cjs +12 -11
- package/dist/internal/cli-runtime.d.mts +8 -7
- package/dist/internal/cli-runtime.d.ts +8 -7
- package/dist/internal/cli-runtime.mjs +11 -10
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +2 -1
- package/dist/internal/compression-runtime.d.ts +2 -1
- package/dist/internal/config-runtime.cjs +10 -9
- package/dist/internal/config-runtime.d.mts +6 -5
- package/dist/internal/config-runtime.d.ts +6 -5
- package/dist/internal/config-runtime.mjs +9 -8
- package/dist/internal/infra-analytics-runtime.cjs +8 -6
- package/dist/internal/infra-analytics-runtime.d.mts +8 -2
- package/dist/internal/infra-analytics-runtime.d.ts +8 -2
- package/dist/internal/infra-analytics-runtime.mjs +8 -6
- package/dist/internal/islands-action-client.cjs +18 -0
- package/dist/internal/islands-action-client.d.mts +18 -0
- package/dist/internal/islands-action-client.d.ts +18 -0
- package/dist/internal/islands-action-client.mjs +18 -0
- package/dist/internal/islands-boot.cjs +54 -20
- package/dist/internal/islands-boot.d.mts +5 -3
- package/dist/internal/islands-boot.d.ts +5 -3
- package/dist/internal/islands-boot.mjs +49 -15
- package/dist/internal/islands-runtime.cjs +3 -8
- package/dist/internal/islands-runtime.mjs +4 -9
- package/dist/internal/islx-actions-client.cjs +4 -3
- package/dist/internal/islx-actions-client.mjs +3 -2
- package/dist/internal/islx-actions-server.d.mts +0 -2
- package/dist/internal/islx-actions-server.d.ts +0 -2
- package/dist/internal/islx-client.cjs +13 -1
- package/dist/internal/islx-client.d.mts +11 -0
- package/dist/internal/islx-client.d.ts +11 -0
- package/dist/internal/islx-client.mjs +14 -0
- package/dist/internal/metadata-image-runtime.d.mts +1 -0
- package/dist/internal/metadata-image-runtime.d.ts +1 -0
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +12 -7
- package/dist/internal/production-runtime.d.mts +14 -12
- package/dist/internal/production-runtime.d.ts +14 -12
- package/dist/internal/production-runtime.mjs +11 -6
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +2 -1
- package/dist/internal/start-manifest.d.ts +2 -1
- package/dist/markdown.d.mts +2 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/middleware.d.mts +2 -1
- package/dist/middleware.d.ts +2 -1
- package/dist/mobile.d.mts +6 -3
- package/dist/mobile.d.ts +6 -3
- package/dist/{mount.d-DOaeUoWq.d.mts → mount.d-CZ_qL1iS.d.mts} +1 -1
- package/dist/{mount.d-DwXjaOHY.d.ts → mount.d-gWul1GA1.d.ts} +1 -1
- package/dist/{navigation-delegate.d-BElGUMgt.d.mts → navigation-delegate.d-BBTzhJLj.d.mts} +1 -1
- package/dist/{navigation-delegate.d-o3pPd9VI.d.ts → navigation-delegate.d-BZsYEAet.d.ts} +1 -1
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/{nitro-YLTGVGK4.mjs → nitro-FK3SZM4H.mjs} +1 -1
- package/dist/{nitro-XGIO6EQN.cjs → nitro-YDFMH5PY.cjs} +4 -4
- package/dist/{plugin-LN3JBZRR.cjs → plugin-3PT7I26P.cjs} +2 -2
- package/dist/{plugin-33I3V42N.mjs → plugin-QOTAPTVV.mjs} +1 -1
- package/dist/plugin.cjs +25 -23
- package/dist/plugin.d.mts +6 -6
- package/dist/plugin.d.ts +6 -6
- package/dist/plugin.mjs +24 -22
- package/dist/{render-plan.d-BD06tqFA.d.ts → render-plan.d-AaJsYPX-.d.ts} +1 -1
- package/dist/{render-plan.d-xWCRAJeR.d.mts → render-plan.d-bnWxS12w.d.mts} +1 -1
- package/dist/renderer-client.cjs +54 -10
- package/dist/renderer-client.d.mts +8 -7
- package/dist/renderer-client.d.ts +8 -7
- package/dist/renderer-client.mjs +50 -6
- package/dist/renderer.cjs +6 -2
- package/dist/renderer.d.mts +97 -4
- package/dist/renderer.d.ts +97 -4
- package/dist/renderer.mjs +5 -1
- package/dist/{request.d-Dx82V8bz.d.mts → request.d-C2HOn3Hi.d.mts} +1 -1
- package/dist/{request.d-DUMuWxSN.d.ts → request.d-CAeitOG1.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/{route-rendering.d-BwBVpLtD.d.ts → route-rendering.d-A1dIkUK5.d.ts} +1 -1
- package/dist/{route-rendering.d-DJh6GauM.d.mts → route-rendering.d-CYA-ulnX.d.mts} +1 -1
- package/dist/{router.d-BtkKDxUB.d.mts → router.d-8lxnzlkr.d.mts} +1 -1
- package/dist/{router.d-CJBSG5jr.d.ts → router.d-A_Yt6jYz.d.ts} +1 -1
- package/dist/{routes.d-CCccJRrp.d.mts → routes.d-BWvpUoYu.d.mts} +1 -1
- package/dist/{routes.d-b7khoRoU.d.ts → routes.d-D7RWvfqL.d.ts} +1 -1
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/{rsc-pipeline-H5AXQA7A.cjs → rsc-pipeline-MFJZGDPE.cjs} +11 -10
- package/dist/{rsc-pipeline-GD6KLOIG.mjs → rsc-pipeline-TRZVFCBX.mjs} +10 -9
- package/dist/{runtime-YWQVBC3V.cjs → runtime-MJUG2HGR.cjs} +15 -13
- package/dist/{runtime-OJ7FXFUI.mjs → runtime-O4Y3Z6V3.mjs} +11 -9
- package/dist/{runtime.d-BQnD0cfC.d.ts → runtime.d-BPyvWrgQ.d.ts} +1 -1
- package/dist/{runtime.d-C4SuZXf6.d.mts → runtime.d-C_rZ9_DD.d.mts} +1 -1
- package/dist/{server-components-status.d-9rH7ZoEq.d.mts → server-components-status.d-BpxiEMQE.d.mts} +1 -1
- package/dist/{server-components-status.d-rfKOcE0N.d.ts → server-components-status.d-C2UEKJn7.d.ts} +1 -1
- package/dist/server-plugins.d.mts +4 -3
- package/dist/server-plugins.d.ts +4 -3
- package/dist/server-query-call.d-rVM_lsYk.d.mts +15 -0
- package/dist/server-query-call.d-rVM_lsYk.d.ts +15 -0
- package/dist/server-query-client.cjs +5 -3
- package/dist/server-query-client.d.mts +3 -2
- package/dist/server-query-client.d.ts +3 -2
- package/dist/server-query-client.mjs +5 -3
- package/dist/{server-query-runtime.d-DXRNhX_3.d.ts → server-query-runtime.d-BlHd90D0.d.ts} +2 -8
- package/dist/{server-query-runtime.d-aP52iuL5.d.mts → server-query-runtime.d-CCLGkQtE.d.mts} +2 -8
- package/dist/server.cjs +58 -52
- package/dist/server.d.mts +12 -12
- package/dist/server.d.ts +12 -12
- package/dist/server.mjs +34 -28
- package/dist/{spa-router.d-V6XLSTCy.d.mts → spa-router.d-BD-6WX1R.d.mts} +2 -2
- package/dist/{spa-router.d-DMKiBsHH.d.ts → spa-router.d-Cw5i_15e.d.ts} +2 -2
- package/dist/{ssg.d-MNedvvMB.d.ts → ssg.d-Bifiq0EL.d.ts} +2 -2
- package/dist/{ssg.d-BnCKPQL0.d.mts → ssg.d-CCE9aob5.d.mts} +2 -2
- package/dist/{store-core.d-Ad5biajo.d.ts → store-core.d-5tVn5vi1.d.ts} +12 -4
- package/dist/{store-core.d-BqJI1-ix.d.mts → store-core.d-BN2MxSG9.d.mts} +12 -4
- package/dist/testing.cjs +5 -4
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/testing.mjs +4 -3
- package/dist/{utils.d-BdjHKDuT.d.ts → utils.d-BUjpSNIO.d.ts} +1 -1
- package/dist/{utils.d-BEKLWa0Z.d.mts → utils.d-wGPLeVbq.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +25 -23
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +24 -22
- package/package.json +7 -2
- package/dist/analyzer-435DCIQ6.cjs +0 -17
- package/dist/chunk-AHVF5GI2.cjs +0 -229
- package/dist/chunk-ONSZP5JK.mjs +0 -229
package/dist/chunk-ONSZP5JK.mjs
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
writeFileIfChanged
|
|
3
|
-
} from "./chunk-YFTGIHNC.mjs";
|
|
4
|
-
import {
|
|
5
|
-
resolveFarmComponentExtensions
|
|
6
|
-
} from "./chunk-2HMSSPCZ.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
|
-
};
|