@farm.js/core 0.1.78 → 0.1.81
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-handler-EDJNU224.mjs → agent-mcp-handler-GDY5CPPW.mjs} +5 -5
- package/dist/{agent-mcp-handler-LNBYLRTZ.cjs → agent-mcp-handler-IUL6OPC3.cjs} +6 -6
- package/dist/{agent-mcp.d-BErtnhV2.d.ts → agent-mcp.d-Cxi3214_.d.ts} +1 -1
- package/dist/{agent-mcp.d-CYHfcjur.d.mts → agent-mcp.d-DMqOqnOA.d.mts} +1 -1
- package/dist/agent-runtime.cjs +2 -2
- package/dist/agent-runtime.d.mts +5 -4
- package/dist/agent-runtime.d.ts +5 -4
- package/dist/agent-runtime.mjs +1 -1
- package/dist/analyzer-435DCIQ6.cjs +17 -0
- package/dist/{analyzer-M2BG6QYU.mjs → analyzer-IC66UJCU.mjs} +3 -2
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.mjs +1 -1
- package/dist/api/client.native.cjs +1 -1
- package/dist/api/client.native.mjs +1 -1
- package/dist/api/node.cjs +7 -7
- package/dist/api/node.d.mts +7 -6
- package/dist/api/node.d.ts +7 -6
- package/dist/api/node.mjs +6 -6
- package/dist/api/route-manager.cjs +10 -10
- package/dist/api/route-manager.d.mts +7 -6
- package/dist/api/route-manager.d.ts +7 -6
- package/dist/api/route-manager.mjs +9 -9
- package/dist/api/runtime.cjs +6 -6
- package/dist/api/runtime.d.mts +6 -5
- package/dist/api/runtime.d.ts +6 -5
- package/dist/api/runtime.mjs +5 -5
- package/dist/api.cjs +12 -12
- package/dist/api.d.mts +8 -7
- package/dist/api.d.ts +8 -7
- package/dist/api.mjs +11 -11
- package/dist/{app-manifest.d-6NCkLQ1y.d.mts → app-manifest.d-Bbxp5kes.d.mts} +1 -1
- package/dist/{app-manifest.d-DuqLBcmi.d.ts → app-manifest.d-C8Cswd31.d.ts} +1 -1
- package/dist/app-markdown.cjs +5 -5
- package/dist/app-markdown.d.mts +8 -7
- package/dist/app-markdown.d.ts +8 -7
- package/dist/app-markdown.mjs +4 -4
- package/dist/{app.d-Dk2HkvPh.d.mts → app.d-BJuSurgy.d.mts} +13 -4
- package/dist/{app.d-Bz6vYBFF.d.ts → app.d-DGIoFt5D.d.ts} +13 -4
- package/dist/cache.cjs +3 -3
- package/dist/cache.mjs +2 -2
- package/dist/{chunk-PG7J7XYT.cjs → chunk-26WP75W5.cjs} +38 -22
- package/dist/{chunk-QYOAGT3E.cjs → chunk-2BEGVSDF.cjs} +6 -5
- package/dist/{chunk-GCRT6GJG.mjs → chunk-2HMSSPCZ.mjs} +26 -0
- package/dist/{chunk-2YJ4DHTD.cjs → chunk-2NOHVIJ3.cjs} +2 -2
- package/dist/{chunk-GDM3ZD2O.cjs → chunk-2OFP3IVA.cjs} +5 -1
- package/dist/{chunk-7KDCVSTR.mjs → chunk-2PFGA6PB.mjs} +2 -2
- package/dist/chunk-2UYYXSUS.mjs +401 -0
- package/dist/{chunk-DD2ANOEF.cjs → chunk-2Y2HRZQY.cjs} +843 -627
- package/dist/{chunk-PL7MCYYD.mjs → chunk-3AV4DCXY.mjs} +58 -358
- package/dist/{chunk-3GNHJ3RN.cjs → chunk-3BTN3NP7.cjs} +2 -2
- package/dist/{chunk-XT2CHTDN.mjs → chunk-3RVLJTFZ.mjs} +6 -6
- package/dist/{chunk-VJ6L7TII.cjs → chunk-3SPECQXI.cjs} +31 -20
- package/dist/{chunk-ODYKCC6W.cjs → chunk-46UV2E7I.cjs} +156 -104
- package/dist/{chunk-F4ID7BGO.cjs → chunk-4OFWG4IK.cjs} +7 -7
- package/dist/{chunk-VRI43FDN.mjs → chunk-4WXNTAOM.mjs} +1 -1
- package/dist/{chunk-QMR2TUVZ.cjs → chunk-52Q4OB4A.cjs} +4 -4
- package/dist/chunk-5MMKNW7Q.cjs +54 -0
- package/dist/{chunk-RIMEFQYO.mjs → chunk-5N526T7Q.mjs} +116 -86
- package/dist/{chunk-CYNQPKA4.cjs → chunk-5ZHC6QGD.cjs} +2 -2
- package/dist/{chunk-ALEUMLJN.mjs → chunk-67JTJCAS.mjs} +3 -2
- package/dist/{chunk-CBP7AKZH.mjs → chunk-6GJZJAED.mjs} +1 -1
- package/dist/{chunk-5REIO5DT.mjs → chunk-6WVRVGKC.mjs} +6 -6
- package/dist/{chunk-GC5ROI3A.cjs → chunk-7U4XF76R.cjs} +1 -1
- package/dist/{chunk-FOULIN4S.cjs → chunk-ADQ2LATR.cjs} +2 -2
- package/dist/{chunk-K3ZELA6U.cjs → chunk-AHVF5GI2.cjs} +10 -10
- package/dist/{chunk-CSAIIMY3.mjs → chunk-ATISIC6G.mjs} +1 -1
- package/dist/{chunk-MGKWYPE3.mjs → chunk-AYDVUCXD.mjs} +1 -0
- package/dist/chunk-B7L24VPX.cjs +401 -0
- package/dist/{chunk-DPBQRDWW.cjs → chunk-BBVLOEND.cjs} +4 -4
- package/dist/{chunk-DASQJ5UD.mjs → chunk-BCQIXH7L.mjs} +1 -1
- package/dist/{chunk-BNCKXPCU.cjs → chunk-BIAGSYIZ.cjs} +30 -30
- package/dist/{chunk-R77D7TCZ.mjs → chunk-BJWJP5A4.mjs} +20 -13
- package/dist/{chunk-X2SEYK7I.mjs → chunk-BPWTSPK6.mjs} +3 -3
- package/dist/{chunk-CKNZJFK5.cjs → chunk-BSX5OGSD.cjs} +4 -4
- package/dist/{chunk-ERT6HQAI.mjs → chunk-BVJUFVCU.mjs} +2 -2
- package/dist/chunk-C5QHZ626.cjs +85 -0
- package/dist/{chunk-HVMQAVZK.cjs → chunk-CL7BUGVB.cjs} +656 -521
- package/dist/{chunk-TZ2YPXLB.cjs → chunk-CN2JOTRO.cjs} +7 -7
- package/dist/{chunk-ZCYGYIC2.cjs → chunk-CPZZBCPO.cjs} +22 -21
- package/dist/{chunk-RK4MGL6Q.mjs → chunk-CYRO3WP4.mjs} +4 -3
- package/dist/chunk-D2VAANBS.mjs +48 -0
- package/dist/{chunk-VRJAMU34.mjs → chunk-D77OGI6X.mjs} +1 -1
- package/dist/{chunk-6XDDE7M6.cjs → chunk-DJ3PVHTW.cjs} +3 -3
- package/dist/{chunk-XGS76V7L.cjs → chunk-E3HBD2K3.cjs} +22 -22
- package/dist/{chunk-F35C3TJZ.mjs → chunk-E4E4Y5FD.mjs} +1 -1
- package/dist/{chunk-KUXEII7V.mjs → chunk-ECVSRE4Y.mjs} +3 -2
- package/dist/{chunk-2DA7CLY7.mjs → chunk-EILUVBKS.mjs} +14 -0
- package/dist/chunk-EZYKV24V.mjs +385 -0
- package/dist/{chunk-TVCFY3KK.cjs → chunk-FB4CWSC2.cjs} +12 -12
- package/dist/{chunk-ZO6TOLHL.mjs → chunk-FS55CNTC.mjs} +1 -1
- package/dist/{chunk-IYFBLWXU.cjs → chunk-FULX5RYX.cjs} +61 -361
- package/dist/{chunk-5KISFWD2.cjs → chunk-FYZD7DUS.cjs} +12 -12
- package/dist/{chunk-H5OVJHXY.cjs → chunk-GAWSWJJ2.cjs} +27 -27
- package/dist/{chunk-A37D6LOS.mjs → chunk-GY63XD6K.mjs} +1 -1
- package/dist/{chunk-OVUU2RCQ.mjs → chunk-HD5FLXP2.mjs} +1 -1
- package/dist/{chunk-5QZT2EQN.cjs → chunk-HQEYZSF3.cjs} +4 -3
- package/dist/{chunk-JA6RML7C.mjs → chunk-HR4N2K4V.mjs} +2 -2
- package/dist/{chunk-6D3CJFNU.cjs → chunk-HR5GU4UU.cjs} +7 -7
- package/dist/{chunk-7RQ5KAK6.mjs → chunk-HTNJ7A4D.mjs} +88 -36
- package/dist/chunk-I4WZRG73.mjs +54 -0
- package/dist/{chunk-BGUTIQII.mjs → chunk-ICOJ2BC6.mjs} +24 -8
- package/dist/{chunk-SX535SU5.cjs → chunk-IJPRCQHW.cjs} +10 -10
- package/dist/{chunk-E7V2GYBP.mjs → chunk-IM3UINTZ.mjs} +67 -9
- package/dist/{chunk-MNIR7I7B.mjs → chunk-INKVDO42.mjs} +1 -1
- package/dist/{chunk-AHGOHPRN.mjs → chunk-IPG6B25T.mjs} +235 -100
- package/dist/{chunk-PE2LEWXA.mjs → chunk-J2VUPCCR.mjs} +4 -4
- package/dist/{chunk-Q2EKSSEG.cjs → chunk-JB4BHRFK.cjs} +17 -17
- package/dist/{chunk-YN7G22MP.cjs → chunk-JCYDWJVO.cjs} +3 -3
- package/dist/{chunk-LPXJEZJK.mjs → chunk-KCJBIWBM.mjs} +2 -2
- package/dist/{chunk-NSNQLBHR.cjs → chunk-KMGHXIDA.cjs} +2 -2
- package/dist/{chunk-SVCUSOEF.mjs → chunk-KR5DF7WK.mjs} +1 -1
- package/dist/{chunk-5DREJN4G.cjs → chunk-LKIG5SM6.cjs} +17 -17
- package/dist/{chunk-OGVOKAQU.mjs → chunk-LTOT5KVJ.mjs} +2 -2
- package/dist/{chunk-Z2FFLTF5.mjs → chunk-LTXKRIST.mjs} +2 -2
- package/dist/{chunk-67MZTLTF.cjs → chunk-M6DAIE4T.cjs} +27 -1
- package/dist/{chunk-IWGGRXD2.cjs → chunk-MHKPXX3J.cjs} +2 -2
- package/dist/{chunk-F7PKUP6P.cjs → chunk-MOGRRZMW.cjs} +38 -38
- package/dist/{chunk-DZZHTMWM.cjs → chunk-N3H7UPBM.cjs} +3 -2
- package/dist/{chunk-WGNGM6MJ.mjs → chunk-N3VMHPIY.mjs} +2 -2
- package/dist/{chunk-EBFTAVGD.mjs → chunk-NOYKBGUK.mjs} +672 -456
- package/dist/{chunk-LMXGCFAM.cjs → chunk-NSLRK5DK.cjs} +1 -1
- package/dist/{chunk-EVVV2XZ2.cjs → chunk-NW3DL2PM.cjs} +53 -7
- package/dist/{chunk-6ZFGWB75.cjs → chunk-OFVCWV2D.cjs} +5 -5
- package/dist/{chunk-NB2ZEBIS.cjs → chunk-OIWDEDUO.cjs} +540 -510
- package/dist/{chunk-WRWJ7IWT.cjs → chunk-OLKYHTLN.cjs} +5 -5
- package/dist/{chunk-QES76U42.mjs → chunk-ONSZP5JK.mjs} +4 -4
- package/dist/{chunk-H76C5AOU.mjs → chunk-OO4GVGM3.mjs} +4 -4
- package/dist/{chunk-BZJYPIFZ.cjs → chunk-OUDNUFVR.cjs} +12 -12
- package/dist/{chunk-EVIWKPJV.cjs → chunk-PLJMEUAN.cjs} +15 -1
- package/dist/{chunk-GFXKO4UW.mjs → chunk-PO5MZIWK.mjs} +49 -49
- package/dist/{chunk-VCW6BR6U.mjs → chunk-POL5RCVU.mjs} +2 -2
- package/dist/{chunk-EMTN5ABC.mjs → chunk-POVHO46S.mjs} +1 -1
- package/dist/{chunk-ASYOWPSR.cjs → chunk-PWDBWXQI.cjs} +2 -1
- package/dist/{chunk-X3Y6JWJG.cjs → chunk-PWMJBCAN.cjs} +3 -3
- package/dist/{chunk-IGE5BAWK.mjs → chunk-QBJ6N5MT.mjs} +53 -7
- package/dist/{chunk-62DZHPDK.cjs → chunk-QCKSYYXK.cjs} +10 -10
- package/dist/{chunk-PKXGFQZS.mjs → chunk-QD34VE4N.mjs} +1 -1
- package/dist/{chunk-57QAQU4F.mjs → chunk-QRNYSISP.mjs} +1 -1
- package/dist/{chunk-PRL7FXG4.cjs → chunk-RDNKQ5MK.cjs} +12 -13
- package/dist/{chunk-VJI2LWTL.cjs → chunk-RFNQTQ44.cjs} +2 -2
- package/dist/{chunk-IG2JE6WJ.mjs → chunk-RLEAVG6G.mjs} +1 -1
- package/dist/{chunk-VO5XDZHK.mjs → chunk-RPA45OQS.mjs} +2 -2
- package/dist/{chunk-PNWRH6TR.mjs → chunk-RZ6XUEQS.mjs} +4 -4
- package/dist/{chunk-S6RUJRWI.mjs → chunk-S3IWDDQ3.mjs} +1 -1
- package/dist/{chunk-EGHPFXPZ.cjs → chunk-SAPG45RA.cjs} +23 -23
- package/dist/{chunk-FE6KYDHC.cjs → chunk-SHDCKRP4.cjs} +3 -3
- package/dist/{chunk-DUSTJ6A5.mjs → chunk-SLEHAGGV.mjs} +2 -2
- package/dist/{chunk-26CNCIFI.cjs → chunk-T3SMMLSB.cjs} +2 -2
- package/dist/{chunk-K6DXKHFE.mjs → chunk-TE7AX6HB.mjs} +1 -1
- package/dist/{chunk-A7EJATEW.mjs → chunk-TLSGRK7E.mjs} +4 -4
- package/dist/{chunk-KHS3T3E5.mjs → chunk-TYHWZOA2.mjs} +1 -1
- package/dist/{chunk-Z3QXQN4U.mjs → chunk-U6GMCDRS.mjs} +1 -1
- package/dist/{chunk-URQW27KO.mjs → chunk-UBLKPREL.mjs} +1 -1
- package/dist/chunk-UDMBUTJD.mjs +85 -0
- package/dist/{chunk-WJ4NUY2H.mjs → chunk-UF4BNKKJ.mjs} +4 -4
- package/dist/{chunk-L7Y65BQU.cjs → chunk-UGD53SNO.cjs} +50 -50
- package/dist/{chunk-DD22NQFX.cjs → chunk-UGLTOLTJ.cjs} +2 -2
- package/dist/{chunk-G7B6NU4X.cjs → chunk-VFMHE5D3.cjs} +3 -3
- package/dist/{chunk-4SLHSODZ.cjs → chunk-VGHDPEPQ.cjs} +15 -15
- package/dist/{chunk-IXO6O2EL.cjs → chunk-VGVRGGP4.cjs} +2 -2
- package/dist/{chunk-47R7CX4A.mjs → chunk-VPGEYX5Y.mjs} +4 -4
- package/dist/chunk-VS7HLH4S.cjs +385 -0
- package/dist/{chunk-YRXPDKMM.cjs → chunk-W53Z4WDI.cjs} +8 -8
- package/dist/{chunk-NNGBTJCX.cjs → chunk-W6C3LEXX.cjs} +83 -25
- package/dist/{chunk-4VLXQ55O.cjs → chunk-WIZRYFB2.cjs} +3 -3
- package/dist/chunk-WMRGIQTA.cjs +48 -0
- package/dist/{chunk-52LTENRE.cjs → chunk-WOAXQ5MZ.cjs} +9 -9
- package/dist/{chunk-C6HGUTXB.mjs → chunk-XBSIGZ4J.mjs} +2 -3
- package/dist/{chunk-S7QEQCVV.mjs → chunk-XGL42MQ7.mjs} +1 -1
- package/dist/{chunk-JHZ6HULQ.cjs → chunk-XOFJUSWC.cjs} +4 -4
- package/dist/{chunk-LJKTJNOF.cjs → chunk-XOGCNKB7.cjs} +3 -3
- package/dist/{chunk-7JTVN6IJ.mjs → chunk-XOXCQGAF.mjs} +7 -6
- package/dist/{chunk-LIC6CMLB.mjs → chunk-YH7ENV3K.mjs} +18 -18
- package/dist/{chunk-ZJGFAW5U.mjs → chunk-YHHOTKUT.mjs} +5 -1
- package/dist/{chunk-B3IRRANH.mjs → chunk-YHM4PXJY.mjs} +1 -1
- package/dist/{chunk-PDACTAVX.mjs → chunk-YOVSWY2E.mjs} +1 -1
- package/dist/{chunk-ZEWIWAS2.mjs → chunk-YSU3WCW6.mjs} +2 -2
- package/dist/{chunk-R5X7FDOG.mjs → chunk-YU2MNIIY.mjs} +1 -1
- package/dist/{chunk-42EUEYW6.cjs → chunk-YUQUGVSV.cjs} +8 -8
- package/dist/{chunk-4STJ6LGR.mjs → chunk-Z3RM3VA2.mjs} +1 -1
- package/dist/{chunk-MBD34AS5.cjs → chunk-Z5BANEQD.cjs} +6 -6
- package/dist/{chunk-4PWGLPL6.mjs → chunk-ZIEO3DQ3.mjs} +26 -15
- package/dist/{chunk-2G6JPLSL.cjs → chunk-ZIYJWJV2.cjs} +27 -20
- package/dist/{chunk-KZ5BOWJS.cjs → chunk-ZKNXCRUQ.cjs} +28 -28
- package/dist/{cli-runtime.d-CGMGs1Zz.d.mts → cli-runtime.d-D8O1v2_X.d.mts} +7 -6
- package/dist/{cli-runtime.d-BG9q2_vC.d.ts → cli-runtime.d-hf4L1MNP.d.ts} +7 -6
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-component.d-B84GPb_u.d.ts → client-component.d-CX8UCQh-.d.ts} +1 -1
- package/dist/{client-component.d-CdsG1E7p.d.mts → client-component.d-DFwUHlOz.d.mts} +1 -1
- package/dist/{client-plugins.d-DX-iCJWE.d.mts → client-plugins.d-BflSNO-b.d.mts} +5 -16
- package/dist/{client-plugins.d-FptsHgls.d.ts → client-plugins.d-qWp8hNwd.d.ts} +5 -16
- package/dist/client-plugins.d.mts +5 -4
- package/dist/client-plugins.d.ts +5 -4
- package/dist/client.cjs +9 -8
- package/dist/client.d.mts +23 -154
- package/dist/client.d.ts +23 -154
- package/dist/client.mjs +8 -7
- package/dist/config.d.mts +5 -4
- package/dist/config.d.ts +5 -4
- package/dist/cron.cjs +3 -3
- package/dist/cron.mjs +2 -2
- package/dist/desktop.d.mts +6 -5
- package/dist/desktop.d.ts +6 -5
- package/dist/{devtools-TMATFNUY.cjs → devtools-EI5N366Z.cjs} +17 -17
- package/dist/{devtools-7P3OUNLV.mjs → devtools-XJHODO5H.mjs} +14 -14
- package/dist/docs.cjs +18 -18
- package/dist/docs.d.mts +7 -6
- package/dist/docs.d.ts +7 -6
- package/dist/docs.mjs +17 -17
- package/dist/environment/vite.cjs +8 -7
- package/dist/environment/vite.d.mts +9 -0
- package/dist/environment/vite.d.ts +9 -0
- package/dist/environment/vite.mjs +7 -6
- package/dist/{handler.d-Cy3XbY_W.d.ts → handler.d-C2oRihfa.d.ts} +1 -1
- package/dist/{handler.d-DSwLTpa5.d.mts → handler.d-DoH5Krkq.d.mts} +1 -1
- package/dist/{headers.d-DiL9YTH3.d.mts → headers.d-BrX53wFQ.d.mts} +1 -1
- package/dist/{headers.d-Qbjo38a0.d.ts → headers.d-Dj0mfYpb.d.ts} +1 -1
- package/dist/index.cjs +90 -82
- package/dist/{index.d-OccJoC6I.d.ts → index.d-Dhc2scRl.d.ts} +1 -1
- package/dist/{index.d-CqQKX3s6.d.mts → index.d-DzDHOttz.d.mts} +1 -1
- package/dist/index.d.mts +29 -27
- package/dist/index.d.ts +29 -27
- package/dist/index.mjs +92 -84
- package/dist/instrumentation.cjs +3 -3
- package/dist/instrumentation.mjs +2 -2
- package/dist/integrations/orm.cjs +3 -3
- package/dist/integrations/orm.d.mts +5 -4
- package/dist/integrations/orm.d.ts +5 -4
- package/dist/integrations/orm.mjs +2 -2
- package/dist/integrations.cjs +2 -2
- package/dist/integrations.d.mts +5 -4
- package/dist/integrations.d.ts +5 -4
- package/dist/integrations.mjs +1 -1
- package/dist/internal/app-markdown-runtime.cjs +4 -4
- package/dist/internal/app-markdown-runtime.d.mts +15 -8
- package/dist/internal/app-markdown-runtime.d.ts +15 -8
- package/dist/internal/app-markdown-runtime.mjs +3 -3
- package/dist/internal/build-runtime.cjs +63 -62
- package/dist/internal/build-runtime.d.mts +8 -7
- package/dist/internal/build-runtime.d.ts +8 -7
- package/dist/internal/build-runtime.mjs +62 -61
- package/dist/internal/cli-runtime.cjs +37 -34
- package/dist/internal/cli-runtime.d.mts +12 -11
- package/dist/internal/cli-runtime.d.ts +12 -11
- package/dist/internal/cli-runtime.mjs +39 -36
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +112 -14
- package/dist/internal/client-runtime.d.mts +29 -22
- package/dist/internal/client-runtime.d.ts +29 -22
- package/dist/internal/client-runtime.mjs +104 -6
- package/dist/internal/compression-runtime.d.mts +5 -4
- package/dist/internal/compression-runtime.d.ts +5 -4
- package/dist/internal/config-runtime.cjs +16 -16
- package/dist/internal/config-runtime.d.mts +7 -6
- package/dist/internal/config-runtime.d.ts +7 -6
- package/dist/internal/config-runtime.mjs +15 -15
- package/dist/internal/docs-precompiled-runtime.cjs +1 -1
- package/dist/internal/docs-precompiled-runtime.mjs +1 -1
- package/dist/internal/form-actions.cjs +3 -3
- package/dist/internal/form-actions.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +11 -11
- package/dist/internal/infra-analytics-runtime.mjs +9 -9
- package/dist/internal/island-codec.cjs +3 -3
- package/dist/internal/island-codec.mjs +2 -2
- package/dist/internal/island-value-store.d.mts +1 -1
- package/dist/internal/island-value-store.d.ts +1 -1
- package/dist/internal/islands-boot.cjs +39 -5
- package/dist/internal/islands-boot.d.mts +19 -1
- package/dist/internal/islands-boot.d.ts +19 -1
- package/dist/internal/islands-boot.mjs +38 -4
- package/dist/internal/islands-runtime.cjs +10 -56
- package/dist/internal/islands-runtime.mjs +6 -52
- package/dist/internal/islands-server.cjs +4 -4
- package/dist/internal/islands-server.mjs +3 -3
- package/dist/internal/islx-actions-client.cjs +36 -0
- package/dist/internal/islx-actions-client.d.mts +13 -0
- package/dist/internal/islx-actions-client.d.ts +13 -0
- package/dist/internal/islx-actions-client.mjs +36 -0
- package/dist/internal/islx-actions-server.cjs +8 -0
- package/dist/internal/islx-actions-server.d.mts +6 -0
- package/dist/internal/islx-actions-server.d.ts +6 -0
- package/dist/internal/islx-actions-server.mjs +8 -0
- package/dist/internal/islx-client.d.mts +0 -4
- package/dist/internal/islx-client.d.ts +0 -4
- package/dist/internal/isolated-boundary.cjs +3 -3
- package/dist/internal/isolated-boundary.d.mts +1 -1
- package/dist/internal/isolated-boundary.d.ts +1 -1
- package/dist/internal/isolated-boundary.mjs +2 -2
- package/dist/internal/metadata-image-runtime.cjs +4 -2
- package/dist/internal/metadata-image-runtime.d.mts +18 -2
- package/dist/internal/metadata-image-runtime.d.ts +18 -2
- package/dist/internal/metadata-image-runtime.mjs +5 -3
- package/dist/internal/native-server-fns.cjs +5 -4
- package/dist/internal/native-server-fns.mjs +4 -3
- package/dist/internal/navigation-neutral.cjs +36 -0
- package/dist/internal/navigation-neutral.d.mts +14 -0
- package/dist/internal/navigation-neutral.d.ts +14 -0
- package/dist/internal/navigation-neutral.mjs +36 -0
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +36 -36
- package/dist/internal/production-runtime.d.mts +15 -13
- package/dist/internal/production-runtime.d.ts +15 -13
- package/dist/internal/production-runtime.mjs +46 -46
- package/dist/internal/server-tree.cjs +5 -4
- package/dist/internal/server-tree.d.mts +3 -4
- package/dist/internal/server-tree.d.ts +3 -4
- package/dist/internal/server-tree.mjs +4 -3
- package/dist/internal/spa-router.cjs +44 -0
- package/dist/internal/spa-router.d.mts +42 -0
- package/dist/internal/spa-router.d.ts +42 -0
- package/dist/internal/spa-router.mjs +44 -0
- package/dist/internal/start-manifest.d.mts +5 -4
- package/dist/internal/start-manifest.d.ts +5 -4
- package/dist/internal/vercel-edge-middleware.cjs +4 -4
- package/dist/internal/vercel-edge-middleware.mjs +3 -3
- package/dist/island-value-protocol.d-fEoc1m8e.d.mts +27 -0
- package/dist/island-value-protocol.d-fEoc1m8e.d.ts +27 -0
- package/dist/{layers-5ZD4764G.mjs → layers-744BBUY5.mjs} +2 -2
- package/dist/layers-XLOMMQP7.cjs +21 -0
- package/dist/{lifecycle.d-VzcXyEyn.d.ts → lifecycle.d-OtGWAvJT.d.mts} +1 -1
- package/dist/{lifecycle.d-VzcXyEyn.d.mts → lifecycle.d-OtGWAvJT.d.ts} +1 -1
- package/dist/markdown.cjs +3 -3
- package/dist/markdown.d.mts +5 -4
- package/dist/markdown.d.ts +5 -4
- package/dist/markdown.mjs +2 -2
- package/dist/middleware.cjs +10 -10
- package/dist/middleware.d.mts +5 -4
- package/dist/middleware.d.ts +5 -4
- package/dist/middleware.mjs +9 -9
- package/dist/{mount.d-AcJaUtHF.d.mts → mount.d-DOaeUoWq.d.mts} +1 -1
- package/dist/{mount.d-CPzqOm-a.d.ts → mount.d-DwXjaOHY.d.ts} +1 -1
- package/dist/{native-server-fn-handler-XRTZR7SZ.cjs → native-server-fn-handler-57TCQPSM.cjs} +6 -6
- package/dist/{native-server-fn-handler-WYYY4YBN.mjs → native-server-fn-handler-PYK65A46.mjs} +5 -5
- package/dist/{native-tree-MNUFN5G6.cjs → native-tree-5TENEQ7Y.cjs} +4 -4
- package/dist/{native-tree-JDI3LJSH.mjs → native-tree-LNO7K6JR.mjs} +3 -3
- package/dist/{navigation-delegate.d-C4i5Y39E.d.mts → navigation-delegate.d-BElGUMgt.d.mts} +1 -1
- package/dist/{navigation-delegate.d-_Df9DnPY.d.ts → navigation-delegate.d-o3pPd9VI.d.ts} +1 -1
- package/dist/navigation-errors.d-DwHtoMyR.d.mts +13 -0
- package/dist/navigation-errors.d-DwHtoMyR.d.ts +13 -0
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +10 -9
- package/dist/navigation.d.ts +10 -9
- package/dist/navigation.mjs +5 -5
- package/dist/{nitro-NUCTYEKJ.cjs → nitro-XGIO6EQN.cjs} +7 -7
- package/dist/{nitro-VCJ6QQSI.mjs → nitro-YLTGVGK4.mjs} +3 -3
- package/dist/node-module-bundle-TNSY5PAC.cjs +15 -0
- package/dist/{node-module-bundle-XPLBMXRD.mjs → node-module-bundle-ZWCQJCKA.mjs} +3 -1
- package/dist/observability.cjs +8 -2
- package/dist/{observability.d-DdJRiaIX.d.mts → observability.d-mXSbp4jc.d.mts} +17 -1
- package/dist/{observability.d-DdJRiaIX.d.ts → observability.d-mXSbp4jc.d.ts} +17 -1
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/observability.mjs +7 -1
- package/dist/{plugin-TV6W7YNK.mjs → plugin-33I3V42N.mjs} +1 -1
- package/dist/{plugin-AGEFSU7K.cjs → plugin-LN3JBZRR.cjs} +2 -2
- package/dist/plugin.cjs +50 -48
- package/dist/plugin.d.mts +9 -8
- package/dist/plugin.d.ts +9 -8
- package/dist/plugin.mjs +49 -47
- package/dist/query/client.cjs +10 -10
- package/dist/query/client.mjs +5 -5
- package/dist/{render-plan.d-CslZE7o7.d.ts → render-plan.d-BD06tqFA.d.ts} +1 -1
- package/dist/{render-plan.d-4V_NmaA6.d.mts → render-plan.d-xWCRAJeR.d.mts} +1 -1
- package/dist/renderer/none/server.cjs +5 -1
- package/dist/renderer/none/server.d.mts +3 -1
- package/dist/renderer/none/server.d.ts +3 -1
- package/dist/renderer/none/server.mjs +4 -0
- package/dist/renderer/react/server.cjs +6 -6
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +34 -15
- package/dist/renderer-client.d.mts +16 -100
- package/dist/renderer-client.d.ts +16 -100
- package/dist/renderer-client.mjs +23 -4
- package/dist/renderer.cjs +4 -2
- package/dist/renderer.d.mts +49 -6
- package/dist/renderer.d.ts +49 -6
- package/dist/renderer.mjs +3 -1
- package/dist/{request.d-CbV3y7j3.d.ts → request.d-DUMuWxSN.d.ts} +1 -1
- package/dist/{request.d-CmLTxEgS.d.mts → request.d-Dx82V8bz.d.mts} +1 -1
- package/dist/request.d.mts +6 -5
- package/dist/request.d.ts +6 -5
- package/dist/{route-rendering.d-CETnXNez.d.ts → route-rendering.d-BwBVpLtD.d.ts} +1 -1
- package/dist/{route-rendering.d-CmoqfOmj.d.mts → route-rendering.d-DJh6GauM.d.mts} +1 -1
- package/dist/{router.d-ktz7pwYm.d.mts → router.d-BtkKDxUB.d.mts} +1 -1
- package/dist/{router.d-Dga3N5YO.d.ts → router.d-CJBSG5jr.d.ts} +1 -1
- package/dist/routes.cjs +5 -5
- package/dist/routes.d.mts +5 -4
- package/dist/routes.d.ts +5 -4
- package/dist/routes.mjs +4 -4
- package/dist/{rsc-pipeline-N7CWJW7T.mjs → rsc-pipeline-GD6KLOIG.mjs} +20 -20
- package/dist/{rsc-pipeline-JLYD26AR.cjs → rsc-pipeline-H5AXQA7A.cjs} +21 -21
- package/dist/{runtime-QXX2A4TS.mjs → runtime-OJ7FXFUI.mjs} +22 -22
- package/dist/{runtime-F5NSS4DD.cjs → runtime-YWQVBC3V.cjs} +32 -32
- package/dist/{runtime.d-BWLZUOfA.d.ts → runtime.d-BQnD0cfC.d.ts} +1 -1
- package/dist/{runtime.d-DuaXEM0p.d.mts → runtime.d-C4SuZXf6.d.mts} +1 -1
- package/dist/{schema-dev-notice-2GN5V7Y2.mjs → schema-dev-notice-EUPAUJVN.mjs} +2 -2
- package/dist/{schema-dev-notice-6VCOZGG2.cjs → schema-dev-notice-ZSCL47CT.cjs} +5 -5
- package/dist/search-client-A7YJT7JZ.cjs +15 -0
- package/dist/{search-client-W4PEFAQB.mjs → search-client-GIXIEU75.mjs} +1 -1
- package/dist/server-action-security.cjs +1 -1
- package/dist/server-action-security.mjs +1 -1
- package/dist/{server-components-status.d-CqxtJmqP.d.mts → server-components-status.d-9rH7ZoEq.d.mts} +1 -1
- package/dist/{server-components-status.d-C5JpC7_Y.d.ts → server-components-status.d-rfKOcE0N.d.ts} +1 -1
- package/dist/server-fn.cjs +5 -5
- package/dist/server-fn.mjs +4 -4
- package/dist/server-plugins.cjs +1 -1
- package/dist/server-plugins.d.mts +7 -6
- package/dist/server-plugins.d.ts +7 -6
- package/dist/server-plugins.mjs +1 -1
- package/dist/server-query.cjs +6 -6
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +95 -90
- package/dist/server.d.mts +16 -15
- package/dist/server.d.ts +16 -15
- package/dist/server.mjs +61 -56
- package/dist/{session-AK2OA5UZ.mjs → session-4IB34X35.mjs} +2 -2
- package/dist/session-MOYQJ7E6.cjs +24 -0
- package/dist/{spa-router.d-C3LzwTlY.d.ts → spa-router.d-DMKiBsHH.d.ts} +20 -4
- package/dist/{spa-router.d-BLE188EL.d.mts → spa-router.d-V6XLSTCy.d.mts} +20 -4
- package/dist/{ssg.d-QrFyU6T4.d.mts → ssg.d-BnCKPQL0.d.mts} +2 -2
- package/dist/{ssg.d-DisOfj0I.d.ts → ssg.d-MNedvvMB.d.ts} +2 -2
- package/dist/storage.cjs +2 -2
- package/dist/storage.d.mts +112 -96
- package/dist/storage.d.ts +112 -96
- package/dist/storage.mjs +1 -1
- package/dist/store-core.d-Ad5biajo.d.ts +301 -0
- package/dist/store-core.d-BqJI1-ix.d.mts +301 -0
- package/dist/testing.cjs +13 -13
- package/dist/testing.d.mts +5 -4
- package/dist/testing.d.ts +5 -4
- package/dist/testing.mjs +10 -10
- package/dist/{types.d-DW2vyaUq.d.mts → types.d-C5hlNbHa.d.mts} +8 -1
- package/dist/{types.d-DW2vyaUq.d.ts → types.d-C5hlNbHa.d.ts} +8 -1
- package/dist/{utils.d-BlWZFgdL.d.mts → utils.d-BEKLWa0Z.d.mts} +1 -1
- package/dist/{utils.d-7YcgfTCK.d.ts → utils.d-BdjHKDuT.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +55 -49
- package/dist/vite.d.mts +26 -10
- package/dist/vite.d.ts +26 -10
- package/dist/vite.mjs +54 -48
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.mjs +2 -2
- package/package.json +23 -2
- package/types/images.d.ts +9 -0
- package/dist/analyzer-KVTUYGTT.cjs +0 -16
- package/dist/chunk-CQL5ZGFU.cjs +0 -50
- package/dist/chunk-HONTCUK6.mjs +0 -203
- package/dist/chunk-K6PGK7DC.cjs +0 -203
- package/dist/chunk-NBIVGHAT.mjs +0 -50
- package/dist/island-value-protocol.d-BRayRghM.d.mts +0 -12
- package/dist/island-value-protocol.d-BRayRghM.d.ts +0 -12
- package/dist/layers-HMEGUEXM.cjs +0 -21
- package/dist/node-module-bundle-M6BISE2P.cjs +0 -13
- package/dist/search-client-6NVC6HM2.cjs +0 -15
- package/dist/session-H4TWP73H.cjs +0 -24
- package/dist/{chunk-JKFN3YVG.mjs → chunk-6JWXHPVR.mjs} +0 -0
- package/dist/{chunk-522K362I.mjs → chunk-C2OLXVUC.mjs} +0 -0
- package/dist/{chunk-MALGIHIC.cjs → chunk-HS4JPIGR.cjs} +0 -0
- package/dist/{chunk-PBJ7MEOV.cjs → chunk-OZUINP2P.cjs} +2 -2
- package/dist/{chunk-CUZT7474.cjs → chunk-TCMRLW3K.cjs} +0 -0
- package/dist/{chunk-Q3DO7MVK.mjs → chunk-URBP6DLH.mjs} +0 -0
- package/dist/{chunk-7FQFK3OA.mjs → chunk-V7HNYR76.mjs} +3 -3
- /package/dist/{chunk-AOTD2N5P.cjs → chunk-WGWWRV2M.cjs} +0 -0
|
@@ -1,15 +1,19 @@
|
|
|
1
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(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkZ5BANEQDcjs = require('./chunk-Z5BANEQD.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
8
7
|
|
|
9
8
|
|
|
9
|
+
var _chunkOUDNUFVRcjs = require('./chunk-OUDNUFVR.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkBBVLOENDcjs = require('./chunk-BBVLOEND.cjs');
|
|
10
13
|
|
|
11
14
|
|
|
12
|
-
var
|
|
15
|
+
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
16
|
+
|
|
13
17
|
|
|
14
18
|
|
|
15
19
|
|
|
@@ -44,31 +48,31 @@ var _chunkBZJYPIFZcjs = require('./chunk-BZJYPIFZ.cjs');
|
|
|
44
48
|
|
|
45
49
|
|
|
46
50
|
|
|
51
|
+
var _chunkOFVCWV2Dcjs = require('./chunk-OFVCWV2D.cjs');
|
|
47
52
|
|
|
48
|
-
var _chunk6ZFGWB75cjs = require('./chunk-6ZFGWB75.cjs');
|
|
49
53
|
|
|
50
54
|
|
|
51
|
-
var _chunk5KISFWD2cjs = require('./chunk-5KISFWD2.cjs');
|
|
52
55
|
|
|
56
|
+
var _chunkOZUINP2Pcjs = require('./chunk-OZUINP2P.cjs');
|
|
53
57
|
|
|
54
58
|
|
|
59
|
+
var _chunkFYZD7DUScjs = require('./chunk-FYZD7DUS.cjs');
|
|
55
60
|
|
|
56
61
|
|
|
57
62
|
|
|
58
63
|
|
|
59
|
-
var _chunkYRXPDKMMcjs = require('./chunk-YRXPDKMM.cjs');
|
|
60
64
|
|
|
61
65
|
|
|
62
|
-
var _chunkK6PGK7DCcjs = require('./chunk-K6PGK7DC.cjs');
|
|
63
66
|
|
|
67
|
+
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
64
68
|
|
|
65
69
|
|
|
66
70
|
|
|
67
|
-
var
|
|
71
|
+
var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
68
72
|
|
|
69
73
|
|
|
70
74
|
|
|
71
|
-
var
|
|
75
|
+
var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
72
76
|
|
|
73
77
|
|
|
74
78
|
|
|
@@ -95,7 +99,7 @@ var _chunk52LTENREcjs = require('./chunk-52LTENRE.cjs');
|
|
|
95
99
|
|
|
96
100
|
|
|
97
101
|
|
|
98
|
-
var
|
|
102
|
+
var _chunk46UV2E7Icjs = require('./chunk-46UV2E7I.cjs');
|
|
99
103
|
|
|
100
104
|
|
|
101
105
|
var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
|
|
@@ -122,7 +126,7 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
122
126
|
|
|
123
127
|
|
|
124
128
|
|
|
125
|
-
var
|
|
129
|
+
var _chunk4OFWG4IKcjs = require('./chunk-4OFWG4IK.cjs');
|
|
126
130
|
|
|
127
131
|
|
|
128
132
|
|
|
@@ -130,9 +134,9 @@ var _chunkF4ID7BGOcjs = require('./chunk-F4ID7BGO.cjs');
|
|
|
130
134
|
|
|
131
135
|
|
|
132
136
|
|
|
137
|
+
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
133
138
|
|
|
134
139
|
|
|
135
|
-
var _chunkWRWJ7IWTcjs = require('./chunk-WRWJ7IWT.cjs');
|
|
136
140
|
|
|
137
141
|
|
|
138
142
|
|
|
@@ -140,14 +144,14 @@ var _chunkWRWJ7IWTcjs = require('./chunk-WRWJ7IWT.cjs');
|
|
|
140
144
|
|
|
141
145
|
|
|
142
146
|
|
|
143
|
-
var
|
|
147
|
+
var _chunkOLKYHTLNcjs = require('./chunk-OLKYHTLN.cjs');
|
|
144
148
|
|
|
145
149
|
|
|
146
150
|
var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
|
|
147
151
|
|
|
148
152
|
|
|
149
153
|
|
|
150
|
-
var
|
|
154
|
+
var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
151
155
|
|
|
152
156
|
|
|
153
157
|
|
|
@@ -160,23 +164,24 @@ var _chunkQMR2TUVZcjs = require('./chunk-QMR2TUVZ.cjs');
|
|
|
160
164
|
|
|
161
165
|
|
|
162
166
|
|
|
163
|
-
|
|
167
|
+
|
|
168
|
+
var _chunkM6DAIE4Tcjs = require('./chunk-M6DAIE4T.cjs');
|
|
164
169
|
|
|
165
170
|
|
|
166
171
|
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
167
172
|
|
|
168
173
|
|
|
169
|
-
var
|
|
174
|
+
var _chunk5ZHC6QGDcjs = require('./chunk-5ZHC6QGD.cjs');
|
|
170
175
|
|
|
171
176
|
|
|
172
177
|
var _chunkXRFGOYXGcjs = require('./chunk-XRFGOYXG.cjs');
|
|
173
178
|
|
|
174
179
|
|
|
175
180
|
|
|
176
|
-
var
|
|
181
|
+
var _chunkHQEYZSF3cjs = require('./chunk-HQEYZSF3.cjs');
|
|
177
182
|
|
|
178
183
|
|
|
179
|
-
var
|
|
184
|
+
var _chunk26WP75W5cjs = require('./chunk-26WP75W5.cjs');
|
|
180
185
|
|
|
181
186
|
|
|
182
187
|
|
|
@@ -189,10 +194,13 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
|
189
194
|
|
|
190
195
|
|
|
191
196
|
|
|
192
|
-
var
|
|
197
|
+
var _chunk2NOHVIJ3cjs = require('./chunk-2NOHVIJ3.cjs');
|
|
198
|
+
|
|
193
199
|
|
|
200
|
+
var _chunkPWDBWXQIcjs = require('./chunk-PWDBWXQI.cjs');
|
|
194
201
|
|
|
195
|
-
|
|
202
|
+
|
|
203
|
+
var _chunkBSX5OGSDcjs = require('./chunk-BSX5OGSD.cjs');
|
|
196
204
|
|
|
197
205
|
|
|
198
206
|
var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
|
|
@@ -200,10 +208,10 @@ var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
|
|
|
200
208
|
|
|
201
209
|
|
|
202
210
|
|
|
203
|
-
var
|
|
211
|
+
var _chunkWGWWRV2Mcjs = require('./chunk-WGWWRV2M.cjs');
|
|
204
212
|
|
|
205
213
|
|
|
206
|
-
var
|
|
214
|
+
var _chunkNW3DL2PMcjs = require('./chunk-NW3DL2PM.cjs');
|
|
207
215
|
|
|
208
216
|
|
|
209
217
|
|
|
@@ -211,7 +219,7 @@ var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
|
|
|
211
219
|
|
|
212
220
|
|
|
213
221
|
|
|
214
|
-
var
|
|
222
|
+
var _chunk2BEGVSDFcjs = require('./chunk-2BEGVSDF.cjs');
|
|
215
223
|
|
|
216
224
|
|
|
217
225
|
|
|
@@ -221,7 +229,7 @@ var _chunkYDXLC4DWcjs = require('./chunk-YDXLC4DW.cjs');
|
|
|
221
229
|
|
|
222
230
|
|
|
223
231
|
|
|
224
|
-
var
|
|
232
|
+
var _chunkHS4JPIGRcjs = require('./chunk-HS4JPIGR.cjs');
|
|
225
233
|
|
|
226
234
|
|
|
227
235
|
|
|
@@ -250,16 +258,16 @@ var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
|
|
|
250
258
|
|
|
251
259
|
|
|
252
260
|
|
|
253
|
-
var
|
|
261
|
+
var _chunkBIAGSYIZcjs = require('./chunk-BIAGSYIZ.cjs');
|
|
254
262
|
|
|
255
263
|
|
|
256
264
|
var _chunkJRGR5Z4Kcjs = require('./chunk-JRGR5Z4K.cjs');
|
|
257
265
|
|
|
258
266
|
|
|
259
|
-
var
|
|
267
|
+
var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
|
|
260
268
|
|
|
261
269
|
|
|
262
|
-
var
|
|
270
|
+
var _chunk25JGHAGHcjs = require('./chunk-25JGHAGH.cjs');
|
|
263
271
|
|
|
264
272
|
|
|
265
273
|
var _chunkZMSVKVI3cjs = require('./chunk-ZMSVKVI3.cjs');
|
|
@@ -276,7 +284,7 @@ var _chunkZMSVKVI3cjs = require('./chunk-ZMSVKVI3.cjs');
|
|
|
276
284
|
|
|
277
285
|
|
|
278
286
|
|
|
279
|
-
var
|
|
287
|
+
var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
|
|
280
288
|
|
|
281
289
|
|
|
282
290
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
@@ -295,16 +303,16 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
295
303
|
|
|
296
304
|
|
|
297
305
|
|
|
298
|
-
var
|
|
306
|
+
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
299
307
|
|
|
300
308
|
|
|
301
|
-
var
|
|
309
|
+
var _chunkNSLRK5DKcjs = require('./chunk-NSLRK5DK.cjs');
|
|
302
310
|
|
|
303
311
|
|
|
304
|
-
var
|
|
312
|
+
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
305
313
|
|
|
306
314
|
|
|
307
|
-
var
|
|
315
|
+
var _chunkWKVYF2B5cjs = require('./chunk-WKVYF2B5.cjs');
|
|
308
316
|
|
|
309
317
|
|
|
310
318
|
var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
|
|
@@ -357,10 +365,6 @@ var _chunk2RSVYJT6cjs = require('./chunk-2RSVYJT6.cjs');
|
|
|
357
365
|
|
|
358
366
|
|
|
359
367
|
|
|
360
|
-
var _chunk3BIASUGRcjs = require('./chunk-3BIASUGR.cjs');
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
368
|
|
|
365
369
|
var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
366
370
|
|
|
@@ -383,6 +387,10 @@ var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
|
383
387
|
var _chunkML4TOUZPcjs = require('./chunk-ML4TOUZP.cjs');
|
|
384
388
|
|
|
385
389
|
|
|
390
|
+
|
|
391
|
+
var _chunk3BIASUGRcjs = require('./chunk-3BIASUGR.cjs');
|
|
392
|
+
|
|
393
|
+
|
|
386
394
|
var _chunkUZM3PDKKcjs = require('./chunk-UZM3PDKK.cjs');
|
|
387
395
|
|
|
388
396
|
// src/static-metadata-image.ts
|
|
@@ -499,7 +507,7 @@ var RouteManager = class _RouteManager {
|
|
|
499
507
|
this.redirects = /* @__PURE__ */ new Map();
|
|
500
508
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
501
509
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
502
|
-
this.programmaticClientRoutes =
|
|
510
|
+
this.programmaticClientRoutes = _chunk46UV2E7Icjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
503
511
|
this.discovery = Promise.resolve();
|
|
504
512
|
this.reportedIslandsErrors = /* @__PURE__ */ new Set();
|
|
505
513
|
// Each route module's hydration plan from the last plan, with the source files it read, so a dev
|
|
@@ -557,11 +565,11 @@ var RouteManager = class _RouteManager {
|
|
|
557
565
|
/** Fill this manager's empty route tables. Only a fresh manager made by discoverRoutes runs it. */
|
|
558
566
|
async discoverInto() {
|
|
559
567
|
const programmaticClientRoutes = [];
|
|
560
|
-
for (const source of
|
|
568
|
+
for (const source of _chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, this.config)) {
|
|
561
569
|
await this.discoverFileRoutes(source);
|
|
562
570
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
563
571
|
}
|
|
564
|
-
this.programmaticClientRoutes =
|
|
572
|
+
this.programmaticClientRoutes = _chunk46UV2E7Icjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
565
573
|
for (const slot of this.routeSlots.values()) {
|
|
566
574
|
if (slot.interception && !this.pageRouteShapes.has(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
567
575
|
throw new (0, _chunkML4TOUZPcjs.AmbiguousRouteError)(
|
|
@@ -580,18 +588,18 @@ var RouteManager = class _RouteManager {
|
|
|
580
588
|
)
|
|
581
589
|
);
|
|
582
590
|
this.orderedLayouts = Array.from(this.layouts.values()).sort(
|
|
583
|
-
(left, right) =>
|
|
584
|
-
).map((entry) => ({ entry, groupScope:
|
|
591
|
+
(left, right) => _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, right.pattern)
|
|
592
|
+
).map((entry) => ({ entry, groupScope: _chunkOFVCWV2Dcjs.getRouteGroupScope.call(void 0, entry.pattern) }));
|
|
585
593
|
for (const slot of this.routeSlots.values()) {
|
|
586
594
|
if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
|
|
587
595
|
this.routeSlotOwnerSegments.set(
|
|
588
596
|
slot.ownerPattern,
|
|
589
|
-
|
|
597
|
+
_chunk7U4XF76Rcjs.parseRoutePath.call(void 0, `${slot.ownerPattern}/page.tsx`).segments
|
|
590
598
|
);
|
|
591
599
|
}
|
|
592
600
|
}
|
|
593
601
|
if (process.env.FARM_VERBOSE) {
|
|
594
|
-
|
|
602
|
+
_chunk7U4XF76Rcjs.logger.info(
|
|
595
603
|
`Discovered ${this.routes.size} pages, ${this.layouts.size} layouts, and ${this.metadataRoutes.size} metadata routes`
|
|
596
604
|
);
|
|
597
605
|
}
|
|
@@ -605,7 +613,7 @@ var RouteManager = class _RouteManager {
|
|
|
605
613
|
matchRoute(pathname, options = {}) {
|
|
606
614
|
const routePathname = this.toRoutePathname(pathname);
|
|
607
615
|
const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
|
|
608
|
-
const pathParts =
|
|
616
|
+
const pathParts = _chunk7U4XF76Rcjs.splitRoutePath.call(void 0, normalizedPath);
|
|
609
617
|
const trimmedPathname = routePathname.replace(/\/+$/, "");
|
|
610
618
|
const hasEmptySegment = trimmedPathname.includes("//") || trimmedPathname === "" && routePathname.length > 1;
|
|
611
619
|
let matchedRoute = null;
|
|
@@ -614,7 +622,7 @@ var RouteManager = class _RouteManager {
|
|
|
614
622
|
if (hasEmptySegment && !routeEntry.route.segments.some((segment) => segment.isDynamic)) {
|
|
615
623
|
continue;
|
|
616
624
|
}
|
|
617
|
-
const match =
|
|
625
|
+
const match = _chunk7U4XF76Rcjs.matchRouteParts.call(void 0, pathParts, routeEntry.route.segments);
|
|
618
626
|
if (match.matches) {
|
|
619
627
|
matchedRoute = routeEntry;
|
|
620
628
|
params = match.params;
|
|
@@ -672,7 +680,7 @@ var RouteManager = class _RouteManager {
|
|
|
672
680
|
/** The layouts that wrap a registered page, root first. */
|
|
673
681
|
getRouteLayouts(pattern) {
|
|
674
682
|
const routeEntry = this.routes.get(pattern);
|
|
675
|
-
return routeEntry ? this.findMatchingLayouts(
|
|
683
|
+
return routeEntry ? this.findMatchingLayouts(_chunk7U4XF76Rcjs.splitRoutePath.call(void 0, pattern), routeEntry) : [];
|
|
676
684
|
}
|
|
677
685
|
/** Resolve route rules, inherited layouts, and the page export in precedence order. */
|
|
678
686
|
async resolveRouteRuntimeConfig(pattern) {
|
|
@@ -681,7 +689,7 @@ var RouteManager = class _RouteManager {
|
|
|
681
689
|
throw new Error(`Cannot resolve runtime configuration for unknown route "${pattern}"`);
|
|
682
690
|
}
|
|
683
691
|
const inherited = _chunkIUKBPBM7cjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
|
|
684
|
-
const layouts = this.findMatchingLayouts(
|
|
692
|
+
const layouts = this.findMatchingLayouts(_chunk7U4XF76Rcjs.splitRoutePath.call(void 0, pattern), routeEntry);
|
|
685
693
|
const layoutConfigs = [];
|
|
686
694
|
for (const layout of layouts) {
|
|
687
695
|
const layoutModule = await this.loadLayoutModule(layout.modulePath);
|
|
@@ -728,9 +736,9 @@ var RouteManager = class _RouteManager {
|
|
|
728
736
|
const localeMatch = i18n ? _chunkGYJT2U7Jcjs.resolveFarmLocalePath.call(void 0, pathname, i18n) : void 0;
|
|
729
737
|
const routePathname = _optionalChain([localeMatch, 'optionalAccess', _8 => _8.pathname]) || this.toRoutePathname(pathname);
|
|
730
738
|
const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
|
|
731
|
-
const urlParts =
|
|
739
|
+
const urlParts = _chunk7U4XF76Rcjs.splitRoutePath.call(void 0, normalizedPath);
|
|
732
740
|
for (const redirectEntry of this.redirects.values()) {
|
|
733
|
-
const match =
|
|
741
|
+
const match = _chunk7U4XF76Rcjs.matchRouteParts.call(void 0, urlParts, redirectEntry.route.segments);
|
|
734
742
|
if (!match.matches) continue;
|
|
735
743
|
const statusCode = redirectEntry.definition.statusCode || (redirectEntry.definition.permanent ? 308 : 307);
|
|
736
744
|
return {
|
|
@@ -775,7 +783,7 @@ var RouteManager = class _RouteManager {
|
|
|
775
783
|
const pagePath = normalizedPath.slice(0, -suffix.fileName.length - 1) || "/";
|
|
776
784
|
for (const imageEntry of this.metadataImages.values()) {
|
|
777
785
|
if (imageEntry.kind !== suffix.kind) continue;
|
|
778
|
-
const match =
|
|
786
|
+
const match = _chunk7U4XF76Rcjs.matchRoute.call(void 0, pagePath, imageEntry.route.segments);
|
|
779
787
|
if (!match.matches) continue;
|
|
780
788
|
return {
|
|
781
789
|
image: imageEntry,
|
|
@@ -793,7 +801,7 @@ var RouteManager = class _RouteManager {
|
|
|
793
801
|
const routePath = normalizedPath.slice(0, -suffix.outputName.length - 1) || "/";
|
|
794
802
|
for (const metadata of this.metadataRoutes.values()) {
|
|
795
803
|
if (metadata.kind !== suffix.kind) continue;
|
|
796
|
-
const match =
|
|
804
|
+
const match = _chunk7U4XF76Rcjs.matchRoute.call(void 0, routePath, metadata.route.segments);
|
|
797
805
|
if (!match.matches) continue;
|
|
798
806
|
return { metadata, params: match.params, routePath };
|
|
799
807
|
}
|
|
@@ -807,7 +815,7 @@ var RouteManager = class _RouteManager {
|
|
|
807
815
|
for (const metadata of this.metadataRoutes.values()) {
|
|
808
816
|
if (metadata.kind !== kind || metadata.route.segments.length > pathSegments.length) continue;
|
|
809
817
|
const routePath = metadata.route.segments.length === 0 ? "/" : `/${pathSegments.slice(0, metadata.route.segments.length).join("/")}`;
|
|
810
|
-
const match =
|
|
818
|
+
const match = _chunk7U4XF76Rcjs.matchRoute.call(void 0, routePath, metadata.route.segments);
|
|
811
819
|
if (!match.matches) continue;
|
|
812
820
|
if (!bestMatch || metadata.route.segments.length > bestMatch.metadata.route.segments.length) {
|
|
813
821
|
bestMatch = { metadata, params: match.params, routePath };
|
|
@@ -828,7 +836,7 @@ var RouteManager = class _RouteManager {
|
|
|
828
836
|
if (imageEntry.kind !== kind) continue;
|
|
829
837
|
if (imageEntry.route.segments.length > pathSegments.length) continue;
|
|
830
838
|
const candidatePath = imageEntry.route.segments.length === 0 ? "/" : `/${pathSegments.slice(0, imageEntry.route.segments.length).join("/")}`;
|
|
831
|
-
const match =
|
|
839
|
+
const match = _chunk7U4XF76Rcjs.matchRoute.call(void 0, candidatePath, imageEntry.route.segments);
|
|
832
840
|
if (!match.matches) continue;
|
|
833
841
|
if (!bestMatch || imageEntry.route.segments.length > bestMatch.image.route.segments.length) {
|
|
834
842
|
bestMatch = {
|
|
@@ -854,11 +862,11 @@ var RouteManager = class _RouteManager {
|
|
|
854
862
|
return this.clientManifestCache.manifest;
|
|
855
863
|
}
|
|
856
864
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
857
|
-
const compute = () =>
|
|
865
|
+
const compute = () => _chunk46UV2E7Icjs.withFarmSourceSnapshot.call(void 0,
|
|
858
866
|
() => this.computeClientManifest(normalizedProjectRoot),
|
|
859
867
|
this.sourceSnapshot
|
|
860
868
|
);
|
|
861
|
-
return cacheFile ?
|
|
869
|
+
return cacheFile ? _chunk46UV2E7Icjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
|
|
862
870
|
}
|
|
863
871
|
/**
|
|
864
872
|
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
@@ -867,7 +875,7 @@ var RouteManager = class _RouteManager {
|
|
|
867
875
|
*/
|
|
868
876
|
trackSourceChanges() {
|
|
869
877
|
this.sourceChangeTracking = true;
|
|
870
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
878
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunk46UV2E7Icjs.FarmSourceSnapshotStore)())));
|
|
871
879
|
}
|
|
872
880
|
/**
|
|
873
881
|
* @internal A production build edits no source while it runs, so what the plan reads, parses and
|
|
@@ -876,7 +884,7 @@ var RouteManager = class _RouteManager {
|
|
|
876
884
|
*/
|
|
877
885
|
keepBuildSourceSnapshot() {
|
|
878
886
|
if (this.sourceChangeTracking) return;
|
|
879
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
887
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunk46UV2E7Icjs.FarmSourceSnapshotStore)(false))));
|
|
880
888
|
}
|
|
881
889
|
/**
|
|
882
890
|
* @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
|
|
@@ -919,7 +927,7 @@ var RouteManager = class _RouteManager {
|
|
|
919
927
|
return false;
|
|
920
928
|
}
|
|
921
929
|
const previous = _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(path4.default.resolve(file))]);
|
|
922
|
-
return previous !== void 0 &&
|
|
930
|
+
return previous !== void 0 && _chunk46UV2E7Icjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
|
|
923
931
|
}
|
|
924
932
|
/**
|
|
925
933
|
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
@@ -930,7 +938,7 @@ var RouteManager = class _RouteManager {
|
|
|
930
938
|
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
931
939
|
return { ...previous.plan };
|
|
932
940
|
}
|
|
933
|
-
const { result, files } =
|
|
941
|
+
const { result, files } = _chunk46UV2E7Icjs.traceFarmSourceReads.call(void 0, compute);
|
|
934
942
|
const sources = /* @__PURE__ */ new Set();
|
|
935
943
|
for (const file of files) {
|
|
936
944
|
const source = this.planSourcePath(file);
|
|
@@ -938,7 +946,7 @@ var RouteManager = class _RouteManager {
|
|
|
938
946
|
}
|
|
939
947
|
if (!this.sourceChangeTracking) {
|
|
940
948
|
for (const source of sources) {
|
|
941
|
-
if (!this.planStamps.has(source)) this.planStamps.set(source,
|
|
949
|
+
if (!this.planStamps.has(source)) this.planStamps.set(source, _chunk46UV2E7Icjs.getFarmSourceStamp.call(void 0, source));
|
|
942
950
|
}
|
|
943
951
|
}
|
|
944
952
|
this.ownerPlans.set(key, { plan: result, files: sources, planKey });
|
|
@@ -958,7 +966,7 @@ var RouteManager = class _RouteManager {
|
|
|
958
966
|
const isUnchanged = (file) => {
|
|
959
967
|
let result = unchanged.get(file);
|
|
960
968
|
if (result === void 0) {
|
|
961
|
-
result = this.planStamps.get(file) ===
|
|
969
|
+
result = this.planStamps.get(file) === _chunk46UV2E7Icjs.getFarmSourceStamp.call(void 0, file);
|
|
962
970
|
unchanged.set(file, result);
|
|
963
971
|
}
|
|
964
972
|
return result;
|
|
@@ -1005,11 +1013,11 @@ var RouteManager = class _RouteManager {
|
|
|
1005
1013
|
*/
|
|
1006
1014
|
inspectPackages(operation) {
|
|
1007
1015
|
const file = this.packageClientBoundaryCacheFile;
|
|
1008
|
-
return file ?
|
|
1016
|
+
return file ? _chunk46UV2E7Icjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
|
|
1009
1017
|
}
|
|
1010
1018
|
computeClientManifest(normalizedProjectRoot) {
|
|
1011
1019
|
const toUrlPath = (absolutePath) => {
|
|
1012
|
-
const rootRelative =
|
|
1020
|
+
const rootRelative = _chunk7U4XF76Rcjs.toRootRelativeUrlPath.call(void 0, absolutePath, normalizedProjectRoot);
|
|
1013
1021
|
if (rootRelative !== void 0) return rootRelative;
|
|
1014
1022
|
if (path4.default.isAbsolute(absolutePath)) {
|
|
1015
1023
|
const normalized = absolutePath.replace(/\\/g, "/");
|
|
@@ -1017,25 +1025,25 @@ var RouteManager = class _RouteManager {
|
|
|
1017
1025
|
}
|
|
1018
1026
|
return absolutePath;
|
|
1019
1027
|
};
|
|
1020
|
-
const integrationProviders =
|
|
1028
|
+
const integrationProviders = _chunkWGWWRV2Mcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
|
|
1021
1029
|
(provider) => provider.component || provider.type === "clerk"
|
|
1022
1030
|
);
|
|
1023
1031
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
1024
1032
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
1025
1033
|
);
|
|
1026
1034
|
if (_optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _24 => _24.config, 'access', _25 => _25.experimental, 'optionalAccess', _26 => _26.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
1027
|
-
|
|
1035
|
+
_chunk7U4XF76Rcjs.logger.warn(
|
|
1028
1036
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
1029
1037
|
);
|
|
1030
1038
|
}
|
|
1031
|
-
const isolatedMode =
|
|
1039
|
+
const isolatedMode = _chunk46UV2E7Icjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1032
1040
|
_optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.isolatedClientHydration]),
|
|
1033
1041
|
{
|
|
1034
1042
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _30 => _30.config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents])) === "rsc",
|
|
1035
1043
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1036
1044
|
}
|
|
1037
1045
|
);
|
|
1038
|
-
const planOptions =
|
|
1046
|
+
const planOptions = _chunk46UV2E7Icjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1039
1047
|
this.config.renderer,
|
|
1040
1048
|
Boolean(unsupportedIntegrationProvider)
|
|
1041
1049
|
);
|
|
@@ -1045,7 +1053,7 @@ var RouteManager = class _RouteManager {
|
|
|
1045
1053
|
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
1046
1054
|
edited = /* @__PURE__ */ new Set();
|
|
1047
1055
|
for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
|
|
1048
|
-
if (
|
|
1056
|
+
if (_chunk46UV2E7Icjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
|
|
1049
1057
|
const source = this.planSourcePath(file);
|
|
1050
1058
|
if (source) edited.add(source);
|
|
1051
1059
|
}
|
|
@@ -1060,13 +1068,13 @@ var RouteManager = class _RouteManager {
|
|
|
1060
1068
|
metadata: this.planRouteModule(
|
|
1061
1069
|
`layout:${entry.modulePath}`,
|
|
1062
1070
|
edited,
|
|
1063
|
-
() =>
|
|
1071
|
+
() => _chunk46UV2E7Icjs.getClientModuleHydrationPlan.call(void 0,
|
|
1064
1072
|
entry.modulePath,
|
|
1065
1073
|
normalizedProjectRoot,
|
|
1066
1074
|
isolatedMode,
|
|
1067
1075
|
layoutPlanOptions
|
|
1068
1076
|
),
|
|
1069
|
-
|
|
1077
|
+
_chunk46UV2E7Icjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1070
1078
|
entry.modulePath,
|
|
1071
1079
|
normalizedProjectRoot,
|
|
1072
1080
|
isolatedMode,
|
|
@@ -1074,7 +1082,7 @@ var RouteManager = class _RouteManager {
|
|
|
1074
1082
|
)
|
|
1075
1083
|
)
|
|
1076
1084
|
}));
|
|
1077
|
-
const markdownComponentsPlan =
|
|
1085
|
+
const markdownComponentsPlan = _chunk46UV2E7Icjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1078
1086
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
1079
1087
|
normalizedProjectRoot,
|
|
1080
1088
|
isolatedMode,
|
|
@@ -1087,16 +1095,16 @@ var RouteManager = class _RouteManager {
|
|
|
1087
1095
|
const pagePlanOptions = { ...planOptions, serverOwners: islandsMode };
|
|
1088
1096
|
const routeEntries = Array.from(this.routes.values()).map((entry) => ({
|
|
1089
1097
|
entry,
|
|
1090
|
-
metadata:
|
|
1098
|
+
metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
1091
1099
|
`page:${entry.modulePath}`,
|
|
1092
1100
|
edited,
|
|
1093
|
-
() =>
|
|
1101
|
+
() => _chunk46UV2E7Icjs.getClientModuleHydrationPlan.call(void 0,
|
|
1094
1102
|
entry.modulePath,
|
|
1095
1103
|
normalizedProjectRoot,
|
|
1096
1104
|
isolatedMode,
|
|
1097
1105
|
pagePlanOptions
|
|
1098
1106
|
),
|
|
1099
|
-
|
|
1107
|
+
_chunk46UV2E7Icjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1100
1108
|
entry.modulePath,
|
|
1101
1109
|
normalizedProjectRoot,
|
|
1102
1110
|
isolatedMode,
|
|
@@ -1105,51 +1113,51 @@ var RouteManager = class _RouteManager {
|
|
|
1105
1113
|
)
|
|
1106
1114
|
}));
|
|
1107
1115
|
const markdownFallback = routeEntries.find(
|
|
1108
|
-
({ entry, metadata }) =>
|
|
1116
|
+
({ entry, metadata }) => _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
|
|
1109
1117
|
);
|
|
1110
1118
|
if (markdownFallback) {
|
|
1111
|
-
|
|
1119
|
+
_chunk7U4XF76Rcjs.logger.warn(
|
|
1112
1120
|
`[Farm.js] client components in Markdown pages stay static: ${markdownFallback.metadata.fallbackReason}.`
|
|
1113
1121
|
);
|
|
1114
1122
|
}
|
|
1115
1123
|
const markdownStaticPackages = _optionalChain([routeEntries, 'access', _39 => _39.find, 'call', _40 => _40(
|
|
1116
|
-
({ entry, metadata }) =>
|
|
1124
|
+
({ entry, metadata }) => _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
|
|
1117
1125
|
), 'optionalAccess', _41 => _41.metadata, 'access', _42 => _42.staticPackageBoundaries]);
|
|
1118
1126
|
if (markdownStaticPackages) {
|
|
1119
|
-
|
|
1127
|
+
_chunk7U4XF76Rcjs.logger.info(
|
|
1120
1128
|
`[Farm.js] Markdown pages render client components from ${markdownStaticPackages.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1121
1129
|
);
|
|
1122
1130
|
}
|
|
1123
1131
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
1124
|
-
if (
|
|
1125
|
-
|
|
1132
|
+
if (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
|
|
1133
|
+
_chunk7U4XF76Rcjs.logger.info(
|
|
1126
1134
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1127
1135
|
);
|
|
1128
1136
|
}
|
|
1129
|
-
|
|
1137
|
+
_chunk46UV2E7Icjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1130
1138
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1131
1139
|
pattern: entry.pattern,
|
|
1132
|
-
depth:
|
|
1140
|
+
depth: _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
1133
1141
|
metadata
|
|
1134
1142
|
})),
|
|
1135
1143
|
routeEntries.map(({ entry, metadata }) => ({
|
|
1136
1144
|
pattern: getRouteEntryDirectory(entry),
|
|
1137
|
-
depth:
|
|
1145
|
+
depth: _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
|
|
1138
1146
|
metadata
|
|
1139
1147
|
})),
|
|
1140
|
-
|
|
1148
|
+
_chunkOFVCWV2Dcjs.routeBoundaryCoversDirectory,
|
|
1141
1149
|
{ serverOwners: islandsMode }
|
|
1142
1150
|
);
|
|
1143
1151
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
1144
1152
|
if (!metadata.costGuardExceeded) continue;
|
|
1145
|
-
|
|
1153
|
+
_chunk7U4XF76Rcjs.logger.warn(
|
|
1146
1154
|
`[Farm.js] isolated hydration kept route-wide for ${entry.modulePath}: ${metadata.fallbackReason}.`
|
|
1147
1155
|
);
|
|
1148
1156
|
}
|
|
1149
1157
|
if (isolatedMode === "analyze") {
|
|
1150
1158
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
1151
1159
|
if (!metadata.isolatedHydrationEligible) continue;
|
|
1152
|
-
|
|
1160
|
+
_chunk7U4XF76Rcjs.logger.info(
|
|
1153
1161
|
`[Farm.js] isolated hydration analysis: ${entry.modulePath} can keep ${metadata.isolatedBoundaries.length} client ${metadata.isolatedBoundaries.length === 1 ? "boundary" : "boundaries"} while excluding its server owner from the browser graph.`
|
|
1154
1162
|
);
|
|
1155
1163
|
}
|
|
@@ -1157,7 +1165,7 @@ var RouteManager = class _RouteManager {
|
|
|
1157
1165
|
const routes = routeEntries.map(({ entry, metadata }) => {
|
|
1158
1166
|
const programmaticPage = this.programmaticPages.get(entry.modulePath);
|
|
1159
1167
|
const layoutShouldHydrate = layoutEntries.some(
|
|
1160
|
-
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate &&
|
|
1168
|
+
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkOFVCWV2Dcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
|
|
1161
1169
|
);
|
|
1162
1170
|
return {
|
|
1163
1171
|
pattern: entry.pattern,
|
|
@@ -1173,8 +1181,8 @@ var RouteManager = class _RouteManager {
|
|
|
1173
1181
|
modulePath: toUrlPath(boundary.modulePath)
|
|
1174
1182
|
}))
|
|
1175
1183
|
} : {},
|
|
1176
|
-
...
|
|
1177
|
-
renderPlan:
|
|
1184
|
+
..._chunk46UV2E7Icjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
1185
|
+
renderPlan: _chunkOFVCWV2Dcjs.createFarmRouteRenderPlan.call(void 0, {
|
|
1178
1186
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
1179
1187
|
layoutShouldHydrate,
|
|
1180
1188
|
islandStrategy: metadata.islandStrategy
|
|
@@ -1190,7 +1198,7 @@ var RouteManager = class _RouteManager {
|
|
|
1190
1198
|
}))
|
|
1191
1199
|
};
|
|
1192
1200
|
});
|
|
1193
|
-
const treeLayoutPatterns = islandsMode ?
|
|
1201
|
+
const treeLayoutPatterns = islandsMode ? _chunkOFVCWV2Dcjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
1194
1202
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1195
1203
|
pattern: entry.pattern,
|
|
1196
1204
|
shouldHydrate: metadata.shouldHydrate,
|
|
@@ -1215,7 +1223,7 @@ var RouteManager = class _RouteManager {
|
|
|
1215
1223
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
1216
1224
|
}));
|
|
1217
1225
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
1218
|
-
const metadata =
|
|
1226
|
+
const metadata = _chunk46UV2E7Icjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
1219
1227
|
return {
|
|
1220
1228
|
name: entry.name,
|
|
1221
1229
|
ownerPattern: entry.ownerPattern,
|
|
@@ -1231,7 +1239,7 @@ var RouteManager = class _RouteManager {
|
|
|
1231
1239
|
};
|
|
1232
1240
|
});
|
|
1233
1241
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
1234
|
-
metadata:
|
|
1242
|
+
metadata: _chunk46UV2E7Icjs.getClientModuleHydrationPlan.call(void 0,
|
|
1235
1243
|
entry.modulePath,
|
|
1236
1244
|
normalizedProjectRoot,
|
|
1237
1245
|
isolatedMode,
|
|
@@ -1256,7 +1264,7 @@ var RouteManager = class _RouteManager {
|
|
|
1256
1264
|
for (const error of islandsErrors) {
|
|
1257
1265
|
if (this.reportedIslandsErrors.has(error)) continue;
|
|
1258
1266
|
this.reportedIslandsErrors.add(error);
|
|
1259
|
-
|
|
1267
|
+
_chunk7U4XF76Rcjs.logger.error(`[Farm.js] islands mode cannot hydrate ${error}`);
|
|
1260
1268
|
}
|
|
1261
1269
|
const manifest = { routes, layouts, slots };
|
|
1262
1270
|
this.editedSources = this.sourceChangeTracking ? /* @__PURE__ */ new Set() : null;
|
|
@@ -1323,16 +1331,17 @@ var RouteManager = class _RouteManager {
|
|
|
1323
1331
|
const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
|
|
1324
1332
|
return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
|
|
1325
1333
|
}
|
|
1326
|
-
if (
|
|
1334
|
+
if (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
|
|
1327
1335
|
const mdxConfig = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx);
|
|
1328
1336
|
const viteServer = this.viteServer;
|
|
1329
|
-
return await
|
|
1337
|
+
return await _chunkHQEYZSF3cjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
|
|
1330
1338
|
// Loaded on render: the route runtime manifest only reads metadata and rendering config.
|
|
1331
|
-
components: () =>
|
|
1339
|
+
components: () => _chunkHQEYZSF3cjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
|
|
1332
1340
|
root: this.config.root,
|
|
1333
1341
|
loadModule: viteServer ? (componentModulePath) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1334
1342
|
}),
|
|
1335
|
-
config: mdxConfig
|
|
1343
|
+
config: mdxConfig,
|
|
1344
|
+
renderer: _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
|
|
1336
1345
|
});
|
|
1337
1346
|
}
|
|
1338
1347
|
if (this.viteServer) {
|
|
@@ -1346,7 +1355,7 @@ var RouteManager = class _RouteManager {
|
|
|
1346
1355
|
return module;
|
|
1347
1356
|
}
|
|
1348
1357
|
} catch (error) {
|
|
1349
|
-
|
|
1358
|
+
_chunk7U4XF76Rcjs.logger.error(`Failed to load route module: ${modulePath}`);
|
|
1350
1359
|
throw error;
|
|
1351
1360
|
}
|
|
1352
1361
|
}
|
|
@@ -1371,7 +1380,7 @@ var RouteManager = class _RouteManager {
|
|
|
1371
1380
|
return module;
|
|
1372
1381
|
}
|
|
1373
1382
|
} catch (error) {
|
|
1374
|
-
|
|
1383
|
+
_chunk7U4XF76Rcjs.logger.error(`Failed to load layout module: ${modulePath}`);
|
|
1375
1384
|
throw error;
|
|
1376
1385
|
}
|
|
1377
1386
|
}
|
|
@@ -1380,7 +1389,7 @@ var RouteManager = class _RouteManager {
|
|
|
1380
1389
|
*/
|
|
1381
1390
|
createRoutePattern(route) {
|
|
1382
1391
|
if (route.segments.length === 0) return "/";
|
|
1383
|
-
return "/" + route.segments.map(
|
|
1392
|
+
return "/" + route.segments.map(_chunkOFVCWV2Dcjs.formatRouteSegment).join("/");
|
|
1384
1393
|
}
|
|
1385
1394
|
registerPageRoute(entry) {
|
|
1386
1395
|
_chunkML4TOUZPcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
|
|
@@ -1398,8 +1407,8 @@ var RouteManager = class _RouteManager {
|
|
|
1398
1407
|
this.pageRouteShapes.set(shape, entry);
|
|
1399
1408
|
}
|
|
1400
1409
|
async discoverFileRoutes(source) {
|
|
1401
|
-
const appDir =
|
|
1402
|
-
const componentExtensions =
|
|
1410
|
+
const appDir = _chunk7U4XF76Rcjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
|
|
1411
|
+
const componentExtensions = _chunkM6DAIE4Tcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
|
|
1403
1412
|
(extension) => extension.slice(1)
|
|
1404
1413
|
);
|
|
1405
1414
|
const componentGlob = componentExtensions.join(",");
|
|
@@ -1417,8 +1426,8 @@ var RouteManager = class _RouteManager {
|
|
|
1417
1426
|
appDir
|
|
1418
1427
|
);
|
|
1419
1428
|
const canonicalPageGroups = /* @__PURE__ */ new Map();
|
|
1420
|
-
for (const file of pageFiles.filter((candidate) =>
|
|
1421
|
-
const route =
|
|
1429
|
+
for (const file of pageFiles.filter((candidate) => _chunk2BEGVSDFcjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
|
|
1430
|
+
const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
|
|
1422
1431
|
const pattern = this.createRoutePattern(route);
|
|
1423
1432
|
const group = canonicalPageGroups.get(pattern);
|
|
1424
1433
|
if (group) {
|
|
@@ -1431,8 +1440,8 @@ var RouteManager = class _RouteManager {
|
|
|
1431
1440
|
}
|
|
1432
1441
|
}
|
|
1433
1442
|
for (const [pattern, group] of canonicalPageGroups) {
|
|
1434
|
-
const componentFiles = group.files.filter((file) => !
|
|
1435
|
-
const markdownFiles = group.files.filter(
|
|
1443
|
+
const componentFiles = group.files.filter((file) => !_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, file));
|
|
1444
|
+
const markdownFiles = group.files.filter(_chunk26WP75W5cjs.isFarmMarkdownPageFile);
|
|
1436
1445
|
if (componentFiles.length > 1) {
|
|
1437
1446
|
throw new Error(
|
|
1438
1447
|
`Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path4.default.join(appDir, file)).join(" and ")}.`
|
|
@@ -1472,9 +1481,9 @@ var RouteManager = class _RouteManager {
|
|
|
1472
1481
|
["error", errorFiles, this.errors]
|
|
1473
1482
|
]) {
|
|
1474
1483
|
for (const file of files) {
|
|
1475
|
-
const route =
|
|
1484
|
+
const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
|
|
1476
1485
|
const modulePath = path4.default.join(appDir, file);
|
|
1477
|
-
const pattern =
|
|
1486
|
+
const pattern = _chunkOFVCWV2Dcjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1478
1487
|
const existing = target.get(pattern);
|
|
1479
1488
|
if (_optionalChain([existing, 'optionalAccess', _49 => _49.sourceRoot]) === source.root) {
|
|
1480
1489
|
throw new Error(
|
|
@@ -1491,12 +1500,12 @@ var RouteManager = class _RouteManager {
|
|
|
1491
1500
|
}
|
|
1492
1501
|
}
|
|
1493
1502
|
for (const file of [...pageFiles, ...slotDefaultFiles]) {
|
|
1494
|
-
const slot =
|
|
1503
|
+
const slot = _chunk2BEGVSDFcjs.parseRouteSlotFile.call(void 0, file);
|
|
1495
1504
|
if (!slot) continue;
|
|
1496
1505
|
const modulePath = path4.default.join(appDir, file);
|
|
1497
1506
|
const pattern = this.createRoutePattern(slot.route);
|
|
1498
1507
|
const ownerPattern = this.createRoutePattern(slot.ownerRoute);
|
|
1499
|
-
const ownerDirectory =
|
|
1508
|
+
const ownerDirectory = _chunkOFVCWV2Dcjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
|
|
1500
1509
|
const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
|
|
1501
1510
|
const existing = this.routeSlots.get(key);
|
|
1502
1511
|
if (_optionalChain([existing, 'optionalAccess', _50 => _50.sourceRoot]) === source.root) {
|
|
@@ -1515,14 +1524,14 @@ var RouteManager = class _RouteManager {
|
|
|
1515
1524
|
...ownerDirectory === ownerPattern ? {} : { ownerDirectory },
|
|
1516
1525
|
interception: slot.interception,
|
|
1517
1526
|
fallback: slot.fallback,
|
|
1518
|
-
containerId:
|
|
1527
|
+
containerId: _chunk2BEGVSDFcjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
|
|
1519
1528
|
});
|
|
1520
1529
|
}
|
|
1521
1530
|
for (const file of metadataImageFiles) {
|
|
1522
1531
|
const fileBase = path4.default.basename(file, path4.default.extname(file));
|
|
1523
1532
|
const kind = fileBase === "twitter-image" ? "twitter" : "opengraph";
|
|
1524
1533
|
const fileName = kind === "twitter" ? "twitter-image" : "opengraph-image";
|
|
1525
|
-
const route =
|
|
1534
|
+
const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
|
|
1526
1535
|
const modulePath = path4.default.join(appDir, file);
|
|
1527
1536
|
const pattern = this.createRoutePattern(route);
|
|
1528
1537
|
const key = `${kind}:${pattern}`;
|
|
@@ -1551,7 +1560,7 @@ var RouteManager = class _RouteManager {
|
|
|
1551
1560
|
path4.default.basename(file, path4.default.extname(file))
|
|
1552
1561
|
);
|
|
1553
1562
|
if (!descriptor) continue;
|
|
1554
|
-
const route =
|
|
1563
|
+
const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
|
|
1555
1564
|
const modulePath = path4.default.join(appDir, file);
|
|
1556
1565
|
const pattern = this.createRoutePattern(route);
|
|
1557
1566
|
const key = `${descriptor.kind}:${pattern}`;
|
|
@@ -1573,16 +1582,16 @@ var RouteManager = class _RouteManager {
|
|
|
1573
1582
|
}
|
|
1574
1583
|
async discoverProgrammaticRoutes(source, clientRoutes) {
|
|
1575
1584
|
if (this.viteServer) _chunkYUCU6XB4cjs.trackProgrammaticRouteSources.call(void 0, );
|
|
1576
|
-
const manifests = await
|
|
1585
|
+
const manifests = await _chunkHS4JPIGRcjs.loadProgrammaticRouteManifests.call(void 0, {
|
|
1577
1586
|
root: source.root,
|
|
1578
1587
|
srcDir: source.srcDir,
|
|
1579
1588
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1580
1589
|
});
|
|
1581
|
-
const graph = this.viteServer ?
|
|
1590
|
+
const graph = this.viteServer ? _chunk46UV2E7Icjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1582
1591
|
for (const { filePath, manifest } of manifests) {
|
|
1583
1592
|
if (graph) {
|
|
1584
1593
|
clientRoutes.push(
|
|
1585
|
-
|
|
1594
|
+
_chunk46UV2E7Icjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1586
1595
|
graph,
|
|
1587
1596
|
routesFile: toRealPath(filePath),
|
|
1588
1597
|
routes: manifest.routes,
|
|
@@ -1613,7 +1622,7 @@ var RouteManager = class _RouteManager {
|
|
|
1613
1622
|
}
|
|
1614
1623
|
if (definition.kind === "layout") {
|
|
1615
1624
|
const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
|
|
1616
|
-
const pattern =
|
|
1625
|
+
const pattern = _chunkOFVCWV2Dcjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1617
1626
|
const existing = this.layouts.get(pattern);
|
|
1618
1627
|
if (_optionalChain([existing, 'optionalAccess', _54 => _54.sourceRoot]) === source.root) {
|
|
1619
1628
|
throw new Error(
|
|
@@ -1645,7 +1654,7 @@ var RouteManager = class _RouteManager {
|
|
|
1645
1654
|
async loadProgrammaticRoutesModule(filePath) {
|
|
1646
1655
|
if (this.viteServer) {
|
|
1647
1656
|
const viteRoot = _optionalChain([this, 'access', _55 => _55.viteServer, 'access', _56 => _56.config, 'optionalAccess', _57 => _57.root]) || this.config.root || process.cwd();
|
|
1648
|
-
return await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer,
|
|
1657
|
+
return await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, filePath, viteRoot));
|
|
1649
1658
|
}
|
|
1650
1659
|
return await import(
|
|
1651
1660
|
/* @vite-ignore */
|
|
@@ -1659,8 +1668,8 @@ var RouteManager = class _RouteManager {
|
|
|
1659
1668
|
findMatchingLayouts(pathnameParts, route) {
|
|
1660
1669
|
const matchingLayouts = [];
|
|
1661
1670
|
for (const { entry, groupScope } of this.orderedLayouts) {
|
|
1662
|
-
if (!
|
|
1663
|
-
if (groupScope !== null && !
|
|
1671
|
+
if (!_chunk7U4XF76Rcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
|
|
1672
|
+
if (groupScope !== null && !_chunkOFVCWV2Dcjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
|
|
1664
1673
|
continue;
|
|
1665
1674
|
}
|
|
1666
1675
|
matchingLayouts.push(entry);
|
|
@@ -1669,7 +1678,7 @@ var RouteManager = class _RouteManager {
|
|
|
1669
1678
|
}
|
|
1670
1679
|
matchPageRoute(pathnameParts) {
|
|
1671
1680
|
for (const routeEntry of this.routes.values()) {
|
|
1672
|
-
if (
|
|
1681
|
+
if (_chunk7U4XF76Rcjs.matchRouteParts.call(void 0, pathnameParts, routeEntry.route.segments).matches) return routeEntry;
|
|
1673
1682
|
}
|
|
1674
1683
|
return null;
|
|
1675
1684
|
}
|
|
@@ -1683,14 +1692,14 @@ var RouteManager = class _RouteManager {
|
|
|
1683
1692
|
groups.set(key, entries);
|
|
1684
1693
|
}
|
|
1685
1694
|
const normalizedFrom = interceptFrom ? this.toRoutePathname(new URL(interceptFrom, "http://farm.local").pathname) : void 0;
|
|
1686
|
-
const normalizedFromParts = normalizedFrom ?
|
|
1695
|
+
const normalizedFromParts = normalizedFrom ? _chunk7U4XF76Rcjs.splitRoutePath.call(void 0, normalizedFrom) : void 0;
|
|
1687
1696
|
const matches = [];
|
|
1688
1697
|
for (const entries of groups.values()) {
|
|
1689
1698
|
const candidates = entries.filter((entry) => !entry.fallback).filter(
|
|
1690
1699
|
(entry) => !entry.interception || normalizedFrom !== void 0 && this.matchesRoutePrefix(normalizedFrom, entry.ownerPattern, normalizedFromParts)
|
|
1691
1700
|
).map((entry) => ({
|
|
1692
1701
|
entry,
|
|
1693
|
-
match:
|
|
1702
|
+
match: _chunk7U4XF76Rcjs.matchRouteParts.call(void 0, pathnameParts, entry.route.segments)
|
|
1694
1703
|
})).filter((candidate) => candidate.match.matches).sort((left, right) => {
|
|
1695
1704
|
if (left.entry.interception !== right.entry.interception) {
|
|
1696
1705
|
return left.entry.interception ? -1 : 1;
|
|
@@ -1730,25 +1739,25 @@ var RouteManager = class _RouteManager {
|
|
|
1730
1739
|
return ownerDifference || left.name.localeCompare(right.name);
|
|
1731
1740
|
});
|
|
1732
1741
|
}
|
|
1733
|
-
matchesRoutePrefix(pathname, pattern, pathnameParts =
|
|
1742
|
+
matchesRoutePrefix(pathname, pattern, pathnameParts = _chunk7U4XF76Rcjs.splitRoutePath.call(void 0, pathname)) {
|
|
1734
1743
|
if (pattern === "/") return true;
|
|
1735
|
-
const patternSegments = _nullishCoalesce(this.routeSlotOwnerSegments.get(pattern), () => (
|
|
1736
|
-
return
|
|
1744
|
+
const patternSegments = _nullishCoalesce(this.routeSlotOwnerSegments.get(pattern), () => ( _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, `${pattern}/page.tsx`).segments));
|
|
1745
|
+
return _chunk7U4XF76Rcjs.matchRoutePrefixParts.call(void 0, pathnameParts, patternSegments);
|
|
1737
1746
|
}
|
|
1738
1747
|
findNearestBoundary(pathname, boundaries, route) {
|
|
1739
1748
|
const normalizedPath = pathname === "/" ? "/" : pathname.replace(/\/$/, "");
|
|
1740
1749
|
let bestMatch = null;
|
|
1741
1750
|
let page = route;
|
|
1742
1751
|
for (const boundaryEntry of boundaries.values()) {
|
|
1743
|
-
if (!
|
|
1744
|
-
const groupScope =
|
|
1752
|
+
if (!_chunk7U4XF76Rcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
|
|
1753
|
+
const groupScope = _chunkOFVCWV2Dcjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
|
|
1745
1754
|
if (groupScope !== null) {
|
|
1746
|
-
if (page === void 0) page = this.matchPageRoute(
|
|
1747
|
-
if (!
|
|
1755
|
+
if (page === void 0) page = this.matchPageRoute(_chunk7U4XF76Rcjs.splitRoutePath.call(void 0, normalizedPath));
|
|
1756
|
+
if (!_chunkOFVCWV2Dcjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
|
|
1748
1757
|
}
|
|
1749
1758
|
const depth = boundaryEntry.route.segments.length;
|
|
1750
1759
|
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _58 => _58.route, 'access', _59 => _59.segments, 'access', _60 => _60.length]), () => ( -1));
|
|
1751
|
-
if (!bestMatch || depth > bestDepth || depth === bestDepth &&
|
|
1760
|
+
if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
|
|
1752
1761
|
bestMatch = boundaryEntry;
|
|
1753
1762
|
}
|
|
1754
1763
|
}
|
|
@@ -1759,13 +1768,13 @@ var RouteManager = class _RouteManager {
|
|
|
1759
1768
|
*/
|
|
1760
1769
|
logRoutes() {
|
|
1761
1770
|
if (this.routes.size > 0) {
|
|
1762
|
-
|
|
1771
|
+
_chunk7U4XF76Rcjs.logger.info("Registered routes:");
|
|
1763
1772
|
for (const [pattern, entry] of this.routes) {
|
|
1764
1773
|
console.log(` ${pattern} -> ${entry.modulePath}`);
|
|
1765
1774
|
}
|
|
1766
1775
|
}
|
|
1767
1776
|
if (this.layouts.size > 0) {
|
|
1768
|
-
|
|
1777
|
+
_chunk7U4XF76Rcjs.logger.info("Registered layouts:");
|
|
1769
1778
|
for (const [pattern, entry] of this.layouts) {
|
|
1770
1779
|
console.log(` ${pattern} -> ${entry.modulePath}`);
|
|
1771
1780
|
}
|
|
@@ -1776,7 +1785,7 @@ var RouteManager = class _RouteManager {
|
|
|
1776
1785
|
const docs = this.config.docs;
|
|
1777
1786
|
if (!docs || typeof docs !== "object" || !docs.enabled) return void 0;
|
|
1778
1787
|
const usesAdapter = Boolean(docs.adapter && docs.adapter.server && docs.adapter.react);
|
|
1779
|
-
if (usesAdapter && !
|
|
1788
|
+
if (usesAdapter && !_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, this.config.renderer)) return void 0;
|
|
1780
1789
|
const entry = `/${String(docs.entry || "docs").replace(/^\/+|\/+$/g, "")}`;
|
|
1781
1790
|
return {
|
|
1782
1791
|
owns: (routePath) => entry === "/" || routePath === entry || routePath.startsWith(`${entry}/`),
|
|
@@ -1798,7 +1807,7 @@ var RouteManager = class _RouteManager {
|
|
|
1798
1807
|
}));
|
|
1799
1808
|
const i18n = this.getI18nConfig();
|
|
1800
1809
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1801
|
-
const result = await
|
|
1810
|
+
const result = await _chunkOUDNUFVRcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1802
1811
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1803
1812
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1804
1813
|
});
|
|
@@ -1845,7 +1854,7 @@ var RouteManager = class _RouteManager {
|
|
|
1845
1854
|
async isRouteSSG(modulePath) {
|
|
1846
1855
|
try {
|
|
1847
1856
|
const mod = await this.loadRouteModule(modulePath);
|
|
1848
|
-
const rendering = await
|
|
1857
|
+
const rendering = await _chunkOUDNUFVRcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1849
1858
|
return rendering.ssg;
|
|
1850
1859
|
} catch (e2) {
|
|
1851
1860
|
return false;
|
|
@@ -1857,7 +1866,7 @@ var RouteManager = class _RouteManager {
|
|
|
1857
1866
|
async hasRouteISR(modulePath) {
|
|
1858
1867
|
try {
|
|
1859
1868
|
const mod = await this.loadRouteModule(modulePath);
|
|
1860
|
-
const rendering = await
|
|
1869
|
+
const rendering = await _chunkOUDNUFVRcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1861
1870
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1862
1871
|
} catch (e3) {
|
|
1863
1872
|
return false;
|
|
@@ -1869,7 +1878,7 @@ var RouteManager = class _RouteManager {
|
|
|
1869
1878
|
async getRouteRevalidateInterval(modulePath) {
|
|
1870
1879
|
try {
|
|
1871
1880
|
const mod = await this.loadRouteModule(modulePath);
|
|
1872
|
-
const rendering = await
|
|
1881
|
+
const rendering = await _chunkOUDNUFVRcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1873
1882
|
return rendering.revalidate;
|
|
1874
1883
|
} catch (e4) {
|
|
1875
1884
|
return void 0;
|
|
@@ -1877,7 +1886,7 @@ var RouteManager = class _RouteManager {
|
|
|
1877
1886
|
}
|
|
1878
1887
|
};
|
|
1879
1888
|
function getPageDirectoryField(route, pattern) {
|
|
1880
|
-
const directory =
|
|
1889
|
+
const directory = _chunkOFVCWV2Dcjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1881
1890
|
return directory === pattern ? {} : { directory };
|
|
1882
1891
|
}
|
|
1883
1892
|
function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
|
|
@@ -1956,7 +1965,7 @@ function replaceAll(input, search, replacement) {
|
|
|
1956
1965
|
}
|
|
1957
1966
|
async function safeGlobFiles(pattern, cwd) {
|
|
1958
1967
|
try {
|
|
1959
|
-
return await
|
|
1968
|
+
return await _chunk7U4XF76Rcjs.globFiles.call(void 0, pattern, cwd);
|
|
1960
1969
|
} catch (e5) {
|
|
1961
1970
|
return [];
|
|
1962
1971
|
}
|
|
@@ -2001,11 +2010,11 @@ function createFarmDevClientManifest(manifest, options) {
|
|
|
2001
2010
|
}
|
|
2002
2011
|
for (const layout of manifest.layouts) {
|
|
2003
2012
|
if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
|
|
2004
|
-
const groupScope =
|
|
2013
|
+
const groupScope = _chunkOFVCWV2Dcjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
2005
2014
|
clientManifest.layouts[layout.pattern] = {
|
|
2006
2015
|
modulePath: layout.modulePath,
|
|
2007
2016
|
pattern: layout.pattern,
|
|
2008
|
-
...groupScope ? { urlPattern:
|
|
2017
|
+
...groupScope ? { urlPattern: _chunkOFVCWV2Dcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
2009
2018
|
shouldHydrate: layout.shouldHydrate,
|
|
2010
2019
|
islandStrategy: layout.islandStrategy,
|
|
2011
2020
|
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
@@ -3080,7 +3089,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
|
|
|
3080
3089
|
let hasClerkProvider = false;
|
|
3081
3090
|
renderedProviders.forEach((provider, index) => {
|
|
3082
3091
|
let componentExpression = "null";
|
|
3083
|
-
if (
|
|
3092
|
+
if (_chunkWGWWRV2Mcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
3084
3093
|
const namespace = `FarmIntegrationProviderModule${index}`;
|
|
3085
3094
|
imports.push(
|
|
3086
3095
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -3137,7 +3146,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
|
|
|
3137
3146
|
const entries = [];
|
|
3138
3147
|
let needsMarkHelper = false;
|
|
3139
3148
|
providers.forEach((provider, index) => {
|
|
3140
|
-
if (!
|
|
3149
|
+
if (!_chunkWGWWRV2Mcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
|
|
3141
3150
|
const namespace = `FarmServerIntegrationProviderModule${index}`;
|
|
3142
3151
|
imports.push(
|
|
3143
3152
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -3162,7 +3171,22 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
|
|
|
3162
3171
|
}
|
|
3163
3172
|
function resolveProviderModule(moduleId, root) {
|
|
3164
3173
|
if (!moduleId.startsWith(".")) return moduleId;
|
|
3165
|
-
return
|
|
3174
|
+
return _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, path4.default.resolve(root, moduleId), root);
|
|
3175
|
+
}
|
|
3176
|
+
|
|
3177
|
+
// src/server-actions-mode.ts
|
|
3178
|
+
function resolveFarmIslxActionsMode(config) {
|
|
3179
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _66 => _66.experimental, 'optionalAccess', _67 => _67.serverComponents])) === "islands") {
|
|
3180
|
+
return "islands";
|
|
3181
|
+
}
|
|
3182
|
+
if (_optionalChain([config, 'access', _68 => _68.experimental, 'optionalAccess', _69 => _69.serverActions]) !== true) return null;
|
|
3183
|
+
const renderer = config.renderer;
|
|
3184
|
+
if (renderer === void 0 || renderer === false) return null;
|
|
3185
|
+
if (_chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, renderer) || _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer)) return null;
|
|
3186
|
+
return "renderer";
|
|
3187
|
+
}
|
|
3188
|
+
function farmBrowserServerFnsEnabled(config) {
|
|
3189
|
+
return _optionalChain([config, 'access', _70 => _70.experimental, 'optionalAccess', _71 => _71.serverActions]) === true && resolveFarmIslxActionsMode(config) !== null;
|
|
3166
3190
|
}
|
|
3167
3191
|
|
|
3168
3192
|
// src/island-inference.ts
|
|
@@ -3205,7 +3229,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
3205
3229
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
3206
3230
|
parse: parseFarmIslandSource,
|
|
3207
3231
|
resolve: (specifier, importer) => {
|
|
3208
|
-
const resolved =
|
|
3232
|
+
const resolved = _chunk46UV2E7Icjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
3209
3233
|
return resolved.local ? resolved.path : null;
|
|
3210
3234
|
}
|
|
3211
3235
|
});
|
|
@@ -3225,7 +3249,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
3225
3249
|
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3226
3250
|
return cached.result;
|
|
3227
3251
|
}
|
|
3228
|
-
const { result, files } =
|
|
3252
|
+
const { result, files } = _chunk46UV2E7Icjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
|
|
3229
3253
|
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3230
3254
|
routeRootInferences.set(key, {
|
|
3231
3255
|
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
@@ -3242,7 +3266,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3242
3266
|
const files = [];
|
|
3243
3267
|
const modules = [];
|
|
3244
3268
|
for (const owner of owners) {
|
|
3245
|
-
const rendered =
|
|
3269
|
+
const rendered = _chunk46UV2E7Icjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
3246
3270
|
if (!rendered) {
|
|
3247
3271
|
return {
|
|
3248
3272
|
strategy: null,
|
|
@@ -3258,7 +3282,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3258
3282
|
source = fs2.default.readFileSync(module, "utf8");
|
|
3259
3283
|
} catch (e11) {
|
|
3260
3284
|
}
|
|
3261
|
-
if (
|
|
3285
|
+
if (_chunk46UV2E7Icjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
3262
3286
|
}
|
|
3263
3287
|
for (const module of modules) {
|
|
3264
3288
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3270,7 +3294,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3270
3294
|
function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
|
|
3271
3295
|
const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3272
3296
|
const onRoute = layouts.filter(
|
|
3273
|
-
(layout) =>
|
|
3297
|
+
(layout) => _chunkOFVCWV2Dcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
|
|
3274
3298
|
);
|
|
3275
3299
|
const declared = [
|
|
3276
3300
|
...page.islandStrategy ? [page.islandStrategy] : [],
|
|
@@ -3302,8 +3326,8 @@ var _stream = require('stream');
|
|
|
3302
3326
|
|
|
3303
3327
|
|
|
3304
3328
|
function resolveFarmNotFoundComponentPath(config, appDirs) {
|
|
3305
|
-
const extensions =
|
|
3306
|
-
const configuredPath = _optionalChain([config, 'access',
|
|
3329
|
+
const extensions = _chunkM6DAIE4Tcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
|
|
3330
|
+
const configuredPath = _optionalChain([config, 'access', _72 => _72.notFound, 'optionalAccess', _73 => _73.component, 'optionalAccess', _74 => _74.trim, 'call', _75 => _75()]);
|
|
3307
3331
|
if (configuredPath) {
|
|
3308
3332
|
const componentPath = path4.default.isAbsolute(configuredPath) ? path4.default.normalize(configuredPath) : path4.default.resolve(config.root, configuredPath);
|
|
3309
3333
|
if (!extensions.some((extension) => componentPath.endsWith(extension))) {
|
|
@@ -3341,11 +3365,11 @@ function getFarmLayoutKey(pattern, params) {
|
|
|
3341
3365
|
);
|
|
3342
3366
|
}
|
|
3343
3367
|
function countFarmKeptLayouts(layoutsHeader, layouts, params) {
|
|
3344
|
-
const chain =
|
|
3368
|
+
const chain = _chunkOFVCWV2Dcjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
|
|
3345
3369
|
if (chain.length === 0) return 0;
|
|
3346
3370
|
const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
|
|
3347
|
-
if (chain[0] === keys[0]) return
|
|
3348
|
-
return keys.length > 1 ? 1 +
|
|
3371
|
+
if (chain[0] === keys[0]) return _chunkOFVCWV2Dcjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
|
|
3372
|
+
return keys.length > 1 ? 1 + _chunkOFVCWV2Dcjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
|
|
3349
3373
|
}
|
|
3350
3374
|
function createFarmFlushToken() {
|
|
3351
3375
|
const bytes = new Uint8Array(16);
|
|
@@ -3600,7 +3624,7 @@ function createDefaultErrorDiagnostics(error, root) {
|
|
|
3600
3624
|
function canBootFarmIslandsClient(config) {
|
|
3601
3625
|
const docs = config.docs;
|
|
3602
3626
|
const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
|
|
3603
|
-
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3627
|
+
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _76 => _76.experimental, 'optionalAccess', _77 => _77.serverComponents])) === "islands" && !docsEnabled && _chunkZ5BANEQDcjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkZ5BANEQDcjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
|
|
3604
3628
|
}
|
|
3605
3629
|
|
|
3606
3630
|
// src/islands-kept-layouts.ts
|
|
@@ -3648,7 +3672,7 @@ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
|
|
|
3648
3672
|
function parse(code, file) {
|
|
3649
3673
|
const extension = path4.default.extname(file).slice(1);
|
|
3650
3674
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
|
|
3651
|
-
return
|
|
3675
|
+
return _chunk46UV2E7Icjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
|
|
3652
3676
|
try {
|
|
3653
3677
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
3654
3678
|
} catch (e14) {
|
|
@@ -3738,11 +3762,11 @@ function findFarmRequestDecidingConstruct(code, file) {
|
|
|
3738
3762
|
reason = "import.meta";
|
|
3739
3763
|
return;
|
|
3740
3764
|
case "CallExpression":
|
|
3741
|
-
if (_optionalChain([current, 'access',
|
|
3765
|
+
if (_optionalChain([current, 'access', _78 => _78.callee, 'optionalAccess', _79 => _79.type]) === "Identifier" && current.callee.name === "use") {
|
|
3742
3766
|
reason = "a use() call";
|
|
3743
3767
|
return;
|
|
3744
3768
|
}
|
|
3745
|
-
if (_optionalChain([current, 'access',
|
|
3769
|
+
if (_optionalChain([current, 'access', _80 => _80.callee, 'optionalAccess', _81 => _81.type]) === "MemberExpression" && !current.callee.computed && _optionalChain([current, 'access', _82 => _82.callee, 'access', _83 => _83.object, 'optionalAccess', _84 => _84.type]) === "Identifier" && current.callee.object.name === "Math" && _optionalChain([current, 'access', _85 => _85.callee, 'access', _86 => _86.property, 'optionalAccess', _87 => _87.name]) === "random") {
|
|
3746
3770
|
reason = "Math.random()";
|
|
3747
3771
|
return;
|
|
3748
3772
|
}
|
|
@@ -3783,14 +3807,14 @@ function isReference(node, parent, key) {
|
|
|
3783
3807
|
}
|
|
3784
3808
|
function readSource(file) {
|
|
3785
3809
|
try {
|
|
3786
|
-
|
|
3810
|
+
_chunk46UV2E7Icjs.noteFarmSourceRead.call(void 0, file);
|
|
3787
3811
|
return fs2.default.readFileSync(file, "utf8");
|
|
3788
3812
|
} catch (e15) {
|
|
3789
3813
|
return null;
|
|
3790
3814
|
}
|
|
3791
3815
|
}
|
|
3792
3816
|
function explainFarmKeptLayoutRender(modulePath, root) {
|
|
3793
|
-
const entry =
|
|
3817
|
+
const entry = _chunk46UV2E7Icjs.resolveModuleSourcePath.call(void 0, modulePath, root);
|
|
3794
3818
|
if (!entry) return `${modulePath} does not resolve`;
|
|
3795
3819
|
const visited = /* @__PURE__ */ new Set();
|
|
3796
3820
|
const check = (file) => {
|
|
@@ -3800,7 +3824,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3800
3824
|
if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
|
|
3801
3825
|
const code = readSource(file);
|
|
3802
3826
|
if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
|
|
3803
|
-
const { reason, imports } =
|
|
3827
|
+
const { reason, imports } = _chunk46UV2E7Icjs.memoizeInFarmSourceSnapshot.call(void 0,
|
|
3804
3828
|
"kept-layout-module",
|
|
3805
3829
|
code,
|
|
3806
3830
|
() => findFarmRequestDecidingConstruct(code, file)
|
|
@@ -3813,7 +3837,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3813
3837
|
return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
|
|
3814
3838
|
}
|
|
3815
3839
|
if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
|
|
3816
|
-
const resolved =
|
|
3840
|
+
const resolved = _chunk46UV2E7Icjs.resolveImportedModule.call(void 0, file, imported.source, root);
|
|
3817
3841
|
if (!resolved.path || !resolved.local) {
|
|
3818
3842
|
return `${path4.default.relative(root, file)} imports ${imported.source}`;
|
|
3819
3843
|
}
|
|
@@ -3828,20 +3852,67 @@ var answers = /* @__PURE__ */ new Map();
|
|
|
3828
3852
|
function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
3829
3853
|
const key = `${root}\0${modulePath}`;
|
|
3830
3854
|
const known = answers.get(key);
|
|
3831
|
-
if (known && known.stamps.every(([file, stamp]) =>
|
|
3855
|
+
if (known && known.stamps.every(([file, stamp]) => _chunk46UV2E7Icjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
|
|
3832
3856
|
return known.skip;
|
|
3833
3857
|
}
|
|
3834
|
-
const { result, files } =
|
|
3858
|
+
const { result, files } = _chunk46UV2E7Icjs.traceFarmSourceReads.call(void 0,
|
|
3835
3859
|
() => explainFarmKeptLayoutRender(modulePath, root) === null
|
|
3836
3860
|
);
|
|
3837
3861
|
answers.set(key, {
|
|
3838
3862
|
skip: result,
|
|
3839
|
-
stamps: files.map((file) => [file,
|
|
3863
|
+
stamps: files.map((file) => [file, _chunk46UV2E7Icjs.getFarmSourceStamp.call(void 0, file)])
|
|
3840
3864
|
});
|
|
3841
3865
|
return result;
|
|
3842
3866
|
}
|
|
3843
3867
|
|
|
3844
3868
|
// src/server/renderer.ts
|
|
3869
|
+
function pipeFarmRendererWebStream(runtime) {
|
|
3870
|
+
return (element, callbacks) => {
|
|
3871
|
+
let source;
|
|
3872
|
+
let destination;
|
|
3873
|
+
let aborted = false;
|
|
3874
|
+
let shellSettled = false;
|
|
3875
|
+
const settleShell = (error) => {
|
|
3876
|
+
if (shellSettled) return false;
|
|
3877
|
+
shellSettled = true;
|
|
3878
|
+
if (error === void 0) callbacks.onShellReady();
|
|
3879
|
+
else callbacks.onShellError(error);
|
|
3880
|
+
return true;
|
|
3881
|
+
};
|
|
3882
|
+
Promise.resolve().then(
|
|
3883
|
+
() => runtime.renderToReadableStream(element, {
|
|
3884
|
+
...callbacks.nonce ? { nonce: callbacks.nonce } : {},
|
|
3885
|
+
onError: callbacks.onError
|
|
3886
|
+
})
|
|
3887
|
+
).then(
|
|
3888
|
+
(stream) => {
|
|
3889
|
+
source = _stream.Readable.fromWeb(stream);
|
|
3890
|
+
if (aborted) {
|
|
3891
|
+
source.destroy();
|
|
3892
|
+
return;
|
|
3893
|
+
}
|
|
3894
|
+
source.once("readable", () => settleShell());
|
|
3895
|
+
source.once("error", (error) => {
|
|
3896
|
+
if (settleShell(error)) return;
|
|
3897
|
+
callbacks.onError(error);
|
|
3898
|
+
_optionalChain([destination, 'optionalAccess', _88 => _88.end, 'call', _89 => _89()]);
|
|
3899
|
+
});
|
|
3900
|
+
},
|
|
3901
|
+
(error) => settleShell(error)
|
|
3902
|
+
);
|
|
3903
|
+
return {
|
|
3904
|
+
pipe(target) {
|
|
3905
|
+
destination = target;
|
|
3906
|
+
_optionalChain([source, 'optionalAccess', _90 => _90.pipe, 'call', _91 => _91(target)]);
|
|
3907
|
+
},
|
|
3908
|
+
abort() {
|
|
3909
|
+
aborted = true;
|
|
3910
|
+
_optionalChain([source, 'optionalAccess', _92 => _92.destroy, 'call', _93 => _93()]);
|
|
3911
|
+
_optionalChain([destination, 'optionalAccess', _94 => _94.end, 'call', _95 => _95()]);
|
|
3912
|
+
}
|
|
3913
|
+
};
|
|
3914
|
+
};
|
|
3915
|
+
}
|
|
3845
3916
|
var islands;
|
|
3846
3917
|
function withFarmIslandsRenders(runtime, islandsRuntime) {
|
|
3847
3918
|
const wrap = (element) => islandsRuntime.withFarmIslandsRender(
|
|
@@ -3917,7 +3988,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
3917
3988
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
3918
3989
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
3919
3990
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
3920
|
-
|
|
3991
|
+
_chunk7U4XF76Rcjs.logger.warn(_chunk46UV2E7Icjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
3921
3992
|
}
|
|
3922
3993
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
3923
3994
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -3925,7 +3996,7 @@ var reportedRenderErrors = /* @__PURE__ */ new WeakMap();
|
|
|
3925
3996
|
function emitFarmRenderError(req, route, error) {
|
|
3926
3997
|
if (reportedRenderErrors.has(req) && reportedRenderErrors.get(req) === error) return;
|
|
3927
3998
|
reportedRenderErrors.set(req, error);
|
|
3928
|
-
|
|
3999
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "render.error", route, error });
|
|
3929
4000
|
}
|
|
3930
4001
|
function hasRequestHeader(req, name) {
|
|
3931
4002
|
const value = req.headers[name.toLowerCase()];
|
|
@@ -3954,7 +4025,7 @@ function appendResponseHeader(res, name, value) {
|
|
|
3954
4025
|
}
|
|
3955
4026
|
}
|
|
3956
4027
|
function requestHeader(req, name) {
|
|
3957
|
-
const value = _optionalChain([req, 'access',
|
|
4028
|
+
const value = _optionalChain([req, 'access', _96 => _96.headers, 'optionalAccess', _97 => _97[name]]);
|
|
3958
4029
|
return Array.isArray(value) ? value[0] : value;
|
|
3959
4030
|
}
|
|
3960
4031
|
function appendResponseVary(res, value) {
|
|
@@ -3968,7 +4039,7 @@ function appendResponseVary(res, value) {
|
|
|
3968
4039
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
3969
4040
|
if (snapshot.routing === "none") return "";
|
|
3970
4041
|
const url = new URL(requestPath, "http://farm.local");
|
|
3971
|
-
return
|
|
4042
|
+
return _chunkOFVCWV2Dcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
3972
4043
|
}
|
|
3973
4044
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
3974
4045
|
function createPPRRefreshScript() {
|
|
@@ -4063,12 +4134,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4063
4134
|
}
|
|
4064
4135
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4065
4136
|
const params = parseRouteModuleSchema(
|
|
4066
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4137
|
+
_optionalChain([schemas, 'optionalAccess', _98 => _98.params]),
|
|
4067
4138
|
input.props.params,
|
|
4068
4139
|
"params",
|
|
4069
4140
|
input.routePath
|
|
4070
4141
|
);
|
|
4071
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4142
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _99 => _99.search]), input.search, "search", input.routePath);
|
|
4072
4143
|
return {
|
|
4073
4144
|
...input.props,
|
|
4074
4145
|
params,
|
|
@@ -4110,7 +4181,7 @@ var pageRequests = /* @__PURE__ */ new WeakMap();
|
|
|
4110
4181
|
var ServerRenderer = class {
|
|
4111
4182
|
constructor(config, routeManager, i18nRuntime, viteServer) {
|
|
4112
4183
|
this.ssgManifest = [];
|
|
4113
|
-
this.dataCache =
|
|
4184
|
+
this.dataCache = _chunkBIAGSYIZcjs.getFarmDataCache.call(void 0, );
|
|
4114
4185
|
this.config = config;
|
|
4115
4186
|
this.routeManager = routeManager;
|
|
4116
4187
|
this.i18nRuntime = i18nRuntime;
|
|
@@ -4121,38 +4192,31 @@ var ServerRenderer = class {
|
|
|
4121
4192
|
async initialize() {
|
|
4122
4193
|
if (this.rendererRuntime) return;
|
|
4123
4194
|
if (this.islandValues()) {
|
|
4124
|
-
|
|
4195
|
+
_chunkWOAXQ5MZcjs.installFarmIslandValues.call(void 0, );
|
|
4125
4196
|
(await import("./internal/islands-server.cjs")).installFarmIslandsServer();
|
|
4126
4197
|
await _asyncNullishCoalesce(islands, async () => ( (islands = await import("./internal/islands-runtime.cjs"))));
|
|
4127
4198
|
} else {
|
|
4128
|
-
|
|
4199
|
+
_chunkWOAXQ5MZcjs.uninstallFarmIslandValues.call(void 0, );
|
|
4129
4200
|
}
|
|
4130
|
-
if (_optionalChain([this, 'access',
|
|
4131
|
-
resolveFarmNotFoundComponentPath(this.config,
|
|
4201
|
+
if (_optionalChain([this, 'access', _100 => _100.config, 'access', _101 => _101.notFound, 'optionalAccess', _102 => _102.component, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()])) {
|
|
4202
|
+
resolveFarmNotFoundComponentPath(this.config, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config));
|
|
4132
4203
|
}
|
|
4133
|
-
const loaded =
|
|
4134
|
-
|
|
4204
|
+
const loaded = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? await import("./renderer/none/server.cjs") : this.viteServer ? await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
|
|
4205
|
+
_chunkM6DAIE4Tcjs.resolveFarmRendererModule.call(void 0,
|
|
4135
4206
|
this.config.root || process.cwd(),
|
|
4136
4207
|
this.config.renderer.server
|
|
4137
4208
|
)
|
|
4138
4209
|
).href);
|
|
4139
4210
|
const runtime = loaded;
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
if (typeof runtime[key] !== "function") {
|
|
4143
|
-
throw new Error(
|
|
4144
|
-
`Renderer \`${this.config.renderer.name}\` server module must export ${key}().`
|
|
4145
|
-
);
|
|
4146
|
-
}
|
|
4147
|
-
}
|
|
4148
|
-
_chunk67MZTLTFcjs.assertFarmRendererStreamingRuntime.call(void 0,
|
|
4211
|
+
_chunkM6DAIE4Tcjs.assertFarmRendererServerModule.call(void 0, runtime, this.config.renderer);
|
|
4212
|
+
_chunkM6DAIE4Tcjs.assertFarmRendererStreamingRuntime.call(void 0,
|
|
4149
4213
|
this.config.renderer.name,
|
|
4150
4214
|
this.config.renderer,
|
|
4151
4215
|
runtime,
|
|
4152
4216
|
"node"
|
|
4153
4217
|
);
|
|
4154
4218
|
this.rendererRuntime = islands && this.islandValues() ? withFarmIslandsRenders(runtime, islands) : runtime;
|
|
4155
|
-
_optionalChain([this, 'access',
|
|
4219
|
+
_optionalChain([this, 'access', _105 => _105.routeManager, 'access', _106 => _106.setRendererRuntime, 'optionalCall', _107 => _107(this.rendererRuntime)]);
|
|
4156
4220
|
await this.applyRendererAppSetup();
|
|
4157
4221
|
}
|
|
4158
4222
|
/**
|
|
@@ -4161,7 +4225,7 @@ var ServerRenderer = class {
|
|
|
4161
4225
|
* re-applied on the next request without restarting.
|
|
4162
4226
|
*/
|
|
4163
4227
|
async applyRendererAppSetup() {
|
|
4164
|
-
const appSetupPath =
|
|
4228
|
+
const appSetupPath = _chunkM6DAIE4Tcjs.resolveFarmRendererAppSetup.call(void 0,
|
|
4165
4229
|
this.config.root || process.cwd(),
|
|
4166
4230
|
this.config.renderer
|
|
4167
4231
|
);
|
|
@@ -4210,7 +4274,7 @@ var ServerRenderer = class {
|
|
|
4210
4274
|
/// Stylesheets the app imported through JS (fontsource packages, component
|
|
4211
4275
|
/// CSS) that the document must link alongside globals.css — see #658.
|
|
4212
4276
|
collectDevStyleHrefs() {
|
|
4213
|
-
const graph = _optionalChain([this, 'access',
|
|
4277
|
+
const graph = _optionalChain([this, 'access', _108 => _108.viteServer, 'optionalAccess', _109 => _109.moduleGraph]);
|
|
4214
4278
|
if (!graph) return [];
|
|
4215
4279
|
return collectDevStylesheetUrls(
|
|
4216
4280
|
graph.idToModuleMap.values(),
|
|
@@ -4261,7 +4325,7 @@ var ServerRenderer = class {
|
|
|
4261
4325
|
"data-farm-layout-boundary": "true",
|
|
4262
4326
|
"data-farm-layout-pattern": pattern,
|
|
4263
4327
|
...segment ? { "data-farm-layout-key": segment.key } : {},
|
|
4264
|
-
..._optionalChain([segment, 'optionalAccess',
|
|
4328
|
+
..._optionalChain([segment, 'optionalAccess', _110 => _110.kept]) ? { "data-farm-layout-kept": "true" } : {},
|
|
4265
4329
|
style: { display: "contents" }
|
|
4266
4330
|
},
|
|
4267
4331
|
layoutElement
|
|
@@ -4292,10 +4356,10 @@ var ServerRenderer = class {
|
|
|
4292
4356
|
return serverTree && this.rendererRuntime.renderServerTreePage ? this.rendererRuntime.renderServerTreePage(element, { values: false }) : this.rendererRuntime.isolateServerPageGraph(element);
|
|
4293
4357
|
}
|
|
4294
4358
|
async renderElementToCompleteHTML(element, options = {}) {
|
|
4295
|
-
const streaming =
|
|
4359
|
+
const streaming = _chunkM6DAIE4Tcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
|
|
4296
4360
|
const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
|
|
4297
4361
|
if (renderToPipeableStream) {
|
|
4298
|
-
const inlineBoundaries =
|
|
4362
|
+
const inlineBoundaries = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, this.config.renderer);
|
|
4299
4363
|
return await new Promise((resolve3, reject) => {
|
|
4300
4364
|
const chunks = [];
|
|
4301
4365
|
let shellReady = false;
|
|
@@ -4313,7 +4377,7 @@ var ServerRenderer = class {
|
|
|
4313
4377
|
writable.once("error", reject);
|
|
4314
4378
|
const stream = renderToPipeableStream(element, {
|
|
4315
4379
|
nonce: _chunk3BIASUGRcjs._resolveCurrentCspNonce.call(void 0, ),
|
|
4316
|
-
formState:
|
|
4380
|
+
formState: _chunkOZUINP2Pcjs.getFarmFormState.call(void 0, ),
|
|
4317
4381
|
...inlineBoundaries ? {
|
|
4318
4382
|
progressiveChunkSize: Number.MAX_SAFE_INTEGER,
|
|
4319
4383
|
onAllReady() {
|
|
@@ -4341,7 +4405,7 @@ var ServerRenderer = class {
|
|
|
4341
4405
|
element,
|
|
4342
4406
|
rendererRenderOptions()
|
|
4343
4407
|
);
|
|
4344
|
-
return await
|
|
4408
|
+
return await _chunkM6DAIE4Tcjs.readFarmRendererWebStream.call(void 0, stream);
|
|
4345
4409
|
}
|
|
4346
4410
|
return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
|
|
4347
4411
|
}
|
|
@@ -4357,7 +4421,7 @@ var ServerRenderer = class {
|
|
|
4357
4421
|
);
|
|
4358
4422
|
return { html: rendered.html, head: rendered.head || "" };
|
|
4359
4423
|
}
|
|
4360
|
-
const { head, body } =
|
|
4424
|
+
const { head, body } = _chunkOFVCWV2Dcjs.takeFarmHoistedHead.call(void 0,
|
|
4361
4425
|
await this.renderElementToCompleteHTML(element, options),
|
|
4362
4426
|
true
|
|
4363
4427
|
);
|
|
@@ -4365,7 +4429,20 @@ var ServerRenderer = class {
|
|
|
4365
4429
|
}
|
|
4366
4430
|
/** Islands mode sends large prop values once, keyed by content (RFC 0003). */
|
|
4367
4431
|
islandValues() {
|
|
4368
|
-
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access',
|
|
4432
|
+
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _111 => _111.config, 'access', _112 => _112.experimental, 'optionalAccess', _113 => _113.serverComponents])) === "islands";
|
|
4433
|
+
}
|
|
4434
|
+
/**
|
|
4435
|
+
* The page's element. Only React renders an async component, so for any other renderer Farm
|
|
4436
|
+
* awaits an async page itself and hands the renderer what it returned, as the production
|
|
4437
|
+
* server does. A `page.md` page is one: it compiles its Markdown on first render.
|
|
4438
|
+
*/
|
|
4439
|
+
async createPageElement(PageComponent, pageProps) {
|
|
4440
|
+
const runtime = this.rendererRuntime;
|
|
4441
|
+
if (_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, this.config.renderer) || typeof PageComponent !== "function" || _optionalChain([PageComponent, 'access', _114 => _114.constructor, 'optionalAccess', _115 => _115.name]) !== "AsyncFunction") {
|
|
4442
|
+
return runtime.createElement(PageComponent, pageProps);
|
|
4443
|
+
}
|
|
4444
|
+
const result = await PageComponent(pageProps);
|
|
4445
|
+
return runtime.isValidElement(result) ? result : runtime.createElement(runtime.Fragment, null, result);
|
|
4369
4446
|
}
|
|
4370
4447
|
/**
|
|
4371
4448
|
* Render the route tree used by client navigation without producing a second
|
|
@@ -4378,7 +4455,7 @@ var ServerRenderer = class {
|
|
|
4378
4455
|
_chunkD22BUQKWcjs.setFarmBasePath.call(void 0, this.config.basePath);
|
|
4379
4456
|
this.publishSearchPreserveRoutes();
|
|
4380
4457
|
_chunkDVJM55D2cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
|
|
4381
|
-
let element = this.
|
|
4458
|
+
let element = await this.createPageElement(input.PageComponent, input.pageProps);
|
|
4382
4459
|
if (input.LoadingComponent) {
|
|
4383
4460
|
element = this.rendererRuntime.createElement(
|
|
4384
4461
|
this.rendererRuntime.Suspense,
|
|
@@ -4456,7 +4533,7 @@ var ServerRenderer = class {
|
|
|
4456
4533
|
rejectLateRedirects: true
|
|
4457
4534
|
}
|
|
4458
4535
|
);
|
|
4459
|
-
return fragmentTag ?
|
|
4536
|
+
return fragmentTag ? _chunkOFVCWV2Dcjs.takeFarmNavigationOutlet.call(void 0, html, fragmentTag) : html;
|
|
4460
4537
|
}
|
|
4461
4538
|
/**
|
|
4462
4539
|
* A built-in docs runtime page (`docs.entry`, no adapter) under layouts that hydrate, or whose
|
|
@@ -4466,7 +4543,7 @@ var ServerRenderer = class {
|
|
|
4466
4543
|
* Any other docs response is sent as it is.
|
|
4467
4544
|
*/
|
|
4468
4545
|
async wrapDocsResponseWithLayouts(request2, response) {
|
|
4469
|
-
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
4546
|
+
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _116 => _116.headers, 'access', _117 => _117.get, 'call', _118 => _118("content-type"), 'optionalAccess', _119 => _119.toLowerCase, 'call', _120 => _120(), 'access', _121 => _121.includes, 'call', _122 => _122("text/html")])) {
|
|
4470
4547
|
return response;
|
|
4471
4548
|
}
|
|
4472
4549
|
await this.initialize();
|
|
@@ -4481,14 +4558,14 @@ var ServerRenderer = class {
|
|
|
4481
4558
|
return {
|
|
4482
4559
|
pattern: layout.pattern,
|
|
4483
4560
|
modulePath: layout.modulePath,
|
|
4484
|
-
shouldHydrate: _optionalChain([entry, 'optionalAccess',
|
|
4485
|
-
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
4486
|
-
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess',
|
|
4487
|
-
serverTree: _optionalChain([entry, 'optionalAccess',
|
|
4488
|
-
islands: _optionalChain([entry, 'optionalAccess',
|
|
4561
|
+
shouldHydrate: _optionalChain([entry, 'optionalAccess', _123 => _123.shouldHydrate]) === true,
|
|
4562
|
+
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _124 => _124.islandStrategy]), () => ( null)),
|
|
4563
|
+
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess', _125 => _125.hasIsolatedClientBoundaries]) === true,
|
|
4564
|
+
serverTree: _optionalChain([entry, 'optionalAccess', _126 => _126.serverTree]) === true,
|
|
4565
|
+
islands: _optionalChain([entry, 'optionalAccess', _127 => _127.hasIsolatedClientBoundaries]) === true
|
|
4489
4566
|
};
|
|
4490
4567
|
});
|
|
4491
|
-
if (!
|
|
4568
|
+
if (!_chunkOFVCWV2Dcjs.farmDocsLayoutsWrapPage.call(void 0, layouts)) return response;
|
|
4492
4569
|
const shouldHydrateLayout = layouts.some((layout) => layout.shouldHydrate);
|
|
4493
4570
|
const hasIsolatedClientBoundaries = layouts.some(
|
|
4494
4571
|
(layout) => layout.hasIsolatedClientBoundaries
|
|
@@ -4507,10 +4584,10 @@ var ServerRenderer = class {
|
|
|
4507
4584
|
);
|
|
4508
4585
|
const treeLayouts = layouts.map((layout, index) => ({
|
|
4509
4586
|
...layout,
|
|
4510
|
-
Component: _optionalChain([modules, 'access',
|
|
4587
|
+
Component: _optionalChain([modules, 'access', _128 => _128[index], 'optionalAccess', _129 => _129.default])
|
|
4511
4588
|
}));
|
|
4512
|
-
const islandStrategy =
|
|
4513
|
-
const tree = await
|
|
4589
|
+
const islandStrategy = _chunkOFVCWV2Dcjs.resolveFarmDocsLayoutIslandStrategy.call(void 0, treeLayouts);
|
|
4590
|
+
const tree = await _chunkOFVCWV2Dcjs.createFarmDocsLayoutTree.call(void 0, this.rendererRuntime, {
|
|
4514
4591
|
pageHtml: bodyMatch[2],
|
|
4515
4592
|
layouts: treeLayouts,
|
|
4516
4593
|
params: matched.params,
|
|
@@ -4531,10 +4608,10 @@ var ServerRenderer = class {
|
|
|
4531
4608
|
)
|
|
4532
4609
|
)
|
|
4533
4610
|
);
|
|
4534
|
-
const rootMarkup =
|
|
4611
|
+
const rootMarkup = _chunkOFVCWV2Dcjs.placeFarmDocsLayoutRoot.call(void 0, rendered.html);
|
|
4535
4612
|
const clientLayouts = layouts.map((layout) => ({
|
|
4536
4613
|
pattern: layout.pattern,
|
|
4537
|
-
modulePath:
|
|
4614
|
+
modulePath: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, layout.modulePath, root),
|
|
4538
4615
|
shouldHydrate: layout.shouldHydrate,
|
|
4539
4616
|
islandStrategy: layout.islandStrategy,
|
|
4540
4617
|
...layout.hasIsolatedClientBoundaries ? { hasIsolatedClientBoundaries: true } : {},
|
|
@@ -4567,13 +4644,13 @@ window.__FARM_ISLAND_STRATEGY__ = ${serializeInlineValue(islandStrategy)};
|
|
|
4567
4644
|
window.__FARM_PAGE_MODULE__ = "";
|
|
4568
4645
|
window.__FARM_LOADING_MODULE__ = null;
|
|
4569
4646
|
window.__FARM_MANIFEST__ = ${serializeInlineValue(clientManifest)};
|
|
4570
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${serializeInlineValue(
|
|
4647
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${serializeInlineValue(_chunkWGWWRV2Mcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
4571
4648
|
window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "null"};
|
|
4572
4649
|
</script>`;
|
|
4573
4650
|
const head = [
|
|
4574
4651
|
...this.collectDevStyleLinks(),
|
|
4575
4652
|
`<script type="module" src="/@vite/client"></script>`,
|
|
4576
|
-
source.includes("window._$HY") ? "" : _optionalChain([this, 'access',
|
|
4653
|
+
source.includes("window._$HY") ? "" : _optionalChain([this, 'access', _130 => _130.rendererRuntime, 'access', _131 => _131.generateHydrationScript, 'optionalCall', _132 => _132()]),
|
|
4577
4654
|
bootstrapScript
|
|
4578
4655
|
].filter(Boolean).map((markup) => _chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, markup)).concat(rendered.head || []).join("\n ");
|
|
4579
4656
|
const clientScript = source.includes('src="/@farm/client.js"') ? "" : `
|
|
@@ -4592,7 +4669,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4592
4669
|
async runWithRequestContext(request2, fn) {
|
|
4593
4670
|
return _chunk2RSVYJT6cjs._runWithCurrentRequest.call(void 0,
|
|
4594
4671
|
request2,
|
|
4595
|
-
() => _optionalChain([this, 'access',
|
|
4672
|
+
() => _optionalChain([this, 'access', _133 => _133.i18nRuntime, 'optionalAccess', _134 => _134.config, 'access', _135 => _135.enabled]) ? _chunkSXXSQVKKcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
|
|
4596
4673
|
redirect: false
|
|
4597
4674
|
}) : fn()
|
|
4598
4675
|
);
|
|
@@ -4617,13 +4694,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4617
4694
|
);
|
|
4618
4695
|
}
|
|
4619
4696
|
this.ssgManifest = parseSSGManifest(content, manifestPath);
|
|
4620
|
-
|
|
4697
|
+
_chunk7U4XF76Rcjs.logger.info(`Loaded SSG manifest: ${this.ssgManifest.length} pages`);
|
|
4621
4698
|
}
|
|
4622
4699
|
/**
|
|
4623
4700
|
* Check if a path should be served from SSG cache
|
|
4624
4701
|
*/
|
|
4625
4702
|
async shouldServeSSG(pathname) {
|
|
4626
|
-
const ssgPage =
|
|
4703
|
+
const ssgPage = _chunkOUDNUFVRcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
4627
4704
|
if (!ssgPage) return null;
|
|
4628
4705
|
const cached = await this.getCachedSSGPage(pathname);
|
|
4629
4706
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -4632,10 +4709,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4632
4709
|
return ssgPage;
|
|
4633
4710
|
}
|
|
4634
4711
|
getSSGCacheKey(urlPath) {
|
|
4635
|
-
return _chunkDXUXQP2Tcjs.createFarmCacheKey.call(void 0, ["ssg",
|
|
4712
|
+
return _chunkDXUXQP2Tcjs.createFarmCacheKey.call(void 0, ["ssg", _chunkBIAGSYIZcjs.normalizeRevalidatePath.call(void 0, urlPath)]);
|
|
4636
4713
|
}
|
|
4637
4714
|
getPPRCacheKey(pathname, search = "", locale = "", origin = "") {
|
|
4638
|
-
const key = ["ppr", locale,
|
|
4715
|
+
const key = ["ppr", locale, _chunkBIAGSYIZcjs.normalizeRevalidatePath.call(void 0, pathname), search, this.getDeploymentId()];
|
|
4639
4716
|
return _chunkDXUXQP2Tcjs.createFarmCacheKey.call(void 0, origin ? [...key, origin] : key);
|
|
4640
4717
|
}
|
|
4641
4718
|
getCachedSSGPage(urlPath) {
|
|
@@ -4677,7 +4754,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4677
4754
|
options.origin
|
|
4678
4755
|
);
|
|
4679
4756
|
await (await _asyncNullishCoalesce(write, async () => ( await this.dataCache.pprShellCache.startWriteAsync(this.getPPRShellWriteOptions(options))))).commit(key, { html, ...cookieIndependent ? { cookieIndependent: true } : {} });
|
|
4680
|
-
|
|
4757
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
4681
4758
|
type: "ppr.shell.cached",
|
|
4682
4759
|
route: options.pathname,
|
|
4683
4760
|
key,
|
|
@@ -4741,7 +4818,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4741
4818
|
setImmediate(async () => {
|
|
4742
4819
|
try {
|
|
4743
4820
|
const mod = await this.routeManager.loadRouteModule(page.filePath);
|
|
4744
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
4821
|
+
if (!_optionalChain([mod, 'optionalAccess', _136 => _136.default])) return;
|
|
4745
4822
|
const { route, layouts } = this.routeManager.matchRoute(page.urlPath);
|
|
4746
4823
|
const layoutModules = await Promise.all(
|
|
4747
4824
|
layouts.map((l) => this.routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -4753,9 +4830,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4753
4830
|
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, {}),
|
|
4754
4831
|
path: page.urlPath
|
|
4755
4832
|
};
|
|
4756
|
-
let pageElement = this.
|
|
4833
|
+
let pageElement = await this.createPageElement(PageComponent, pageProps);
|
|
4757
4834
|
const pageMetadata = _nullishCoalesce(routeManifest.routes.find(
|
|
4758
|
-
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess',
|
|
4835
|
+
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _137 => _137.pattern])
|
|
4759
4836
|
), () => ( {
|
|
4760
4837
|
shouldHydrate: false,
|
|
4761
4838
|
islandStrategy: null
|
|
@@ -4803,13 +4880,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4803
4880
|
{ metadata: mergedMetadata }
|
|
4804
4881
|
);
|
|
4805
4882
|
await this.cacheSSGPage(page, fullDocument, { document: true });
|
|
4806
|
-
|
|
4883
|
+
_chunk7U4XF76Rcjs.logger.info(`ISR: Regenerated ${page.urlPath}`);
|
|
4807
4884
|
} catch (error) {
|
|
4808
|
-
|
|
4885
|
+
_chunk7U4XF76Rcjs.logger.error(`ISR regeneration failed for ${page.urlPath}: ${error}`);
|
|
4809
4886
|
}
|
|
4810
4887
|
});
|
|
4811
4888
|
} catch (error) {
|
|
4812
|
-
|
|
4889
|
+
_chunk7U4XF76Rcjs.logger.error(`ISR trigger failed: ${error}`);
|
|
4813
4890
|
}
|
|
4814
4891
|
}
|
|
4815
4892
|
/**
|
|
@@ -4852,7 +4929,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4852
4929
|
return true;
|
|
4853
4930
|
}
|
|
4854
4931
|
} catch (error) {
|
|
4855
|
-
|
|
4932
|
+
_chunk7U4XF76Rcjs.logger.error(`Failed to serve SSG page ${page.urlPath}: ${error}`);
|
|
4856
4933
|
}
|
|
4857
4934
|
return false;
|
|
4858
4935
|
}
|
|
@@ -4862,7 +4939,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4862
4939
|
* such as a partial test double, has none.
|
|
4863
4940
|
*/
|
|
4864
4941
|
publishSearchPreserveRoutes() {
|
|
4865
|
-
_chunkWKVYF2B5cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access',
|
|
4942
|
+
_chunkWKVYF2B5cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access', _138 => _138.routeManager, 'access', _139 => _139.getSearchPreserveRoutes, 'optionalCall', _140 => _140()]), () => ( [])));
|
|
4866
4943
|
}
|
|
4867
4944
|
async renderPage(req, res) {
|
|
4868
4945
|
await this.initialize();
|
|
@@ -4878,7 +4955,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4878
4955
|
}
|
|
4879
4956
|
const request2 = this.createPageRequest(req, res);
|
|
4880
4957
|
const runtime = this.i18nRuntime;
|
|
4881
|
-
if (_optionalChain([runtime, 'optionalAccess',
|
|
4958
|
+
if (_optionalChain([runtime, 'optionalAccess', _141 => _141.config, 'access', _142 => _142.enabled])) {
|
|
4882
4959
|
const resolution = runtime.resolveRequest(request2);
|
|
4883
4960
|
const varyHeaders = _chunk7Q2YWZF7cjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
|
|
4884
4961
|
for (const header of varyHeaders) appendResponseVary(res, header);
|
|
@@ -4917,7 +4994,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4917
4994
|
createPageRequestOnce(req, res) {
|
|
4918
4995
|
const observable = typeof req.once === "function" && typeof res.once === "function";
|
|
4919
4996
|
return _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
4920
|
-
trustProxy: _optionalChain([this, 'access',
|
|
4997
|
+
trustProxy: _optionalChain([this, 'access', _143 => _143.config, 'access', _144 => _144.server, 'optionalAccess', _145 => _145.trustProxy]),
|
|
4921
4998
|
signal: observable ? _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0,
|
|
4922
4999
|
req,
|
|
4923
5000
|
res
|
|
@@ -4937,7 +5014,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4937
5014
|
let errorBoundaryEntry = null;
|
|
4938
5015
|
let pprRefreshRoute = null;
|
|
4939
5016
|
const completeRender = (status = res.statusCode || 200, route = pathname) => {
|
|
4940
|
-
|
|
5017
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
4941
5018
|
type: "render.complete",
|
|
4942
5019
|
route,
|
|
4943
5020
|
pathname,
|
|
@@ -4947,9 +5024,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4947
5024
|
};
|
|
4948
5025
|
let pprShellWrite;
|
|
4949
5026
|
try {
|
|
4950
|
-
const url = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
5027
|
+
const url = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _146 => _146.config, 'access', _147 => _147.server, 'optionalAccess', _148 => _148.trustProxy]) });
|
|
4951
5028
|
pathname = url.pathname;
|
|
4952
|
-
|
|
5029
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
|
|
4953
5030
|
searchParamsObject = _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
|
|
4954
5031
|
const metadataRouteMatch = this.routeManager.matchMetadataRoute(pathname);
|
|
4955
5032
|
if (metadataRouteMatch) {
|
|
@@ -5017,24 +5094,24 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5017
5094
|
layouts = match.layouts;
|
|
5018
5095
|
routeSlots = _nullishCoalesce(match.slots, () => ( []));
|
|
5019
5096
|
if (!route) {
|
|
5020
|
-
if (
|
|
5097
|
+
if (_chunkW53Z4WDIcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
|
|
5021
5098
|
await this.renderDefaultMCP(req, res);
|
|
5022
5099
|
completeRender(res.statusCode || 200, pathname);
|
|
5023
5100
|
return;
|
|
5024
5101
|
}
|
|
5025
|
-
|
|
5102
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "route.notFound", pathname });
|
|
5026
5103
|
await this.render404(req, res);
|
|
5027
5104
|
completeRender(res.statusCode);
|
|
5028
5105
|
return;
|
|
5029
5106
|
}
|
|
5030
|
-
|
|
5107
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5031
5108
|
type: "route.matched",
|
|
5032
5109
|
pathname,
|
|
5033
5110
|
route: route.pattern,
|
|
5034
5111
|
params
|
|
5035
5112
|
});
|
|
5036
5113
|
let actionRequest;
|
|
5037
|
-
if (req.method === "POST" &&
|
|
5114
|
+
if (req.method === "POST" && resolveFarmIslxActionsMode(this.config) !== null) {
|
|
5038
5115
|
await Promise.all([
|
|
5039
5116
|
this.routeManager.loadRouteModule(route.modulePath),
|
|
5040
5117
|
...layouts.map((layout) => this.routeManager.loadLayoutModule(layout.modulePath))
|
|
@@ -5045,7 +5122,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5045
5122
|
toMiddlewareMap(req.__FARM_MIDDLEWARE_DATA__),
|
|
5046
5123
|
() => _chunkYDXLC4DWcjs._runWithMiddlewareContext.call(void 0,
|
|
5047
5124
|
toMiddlewareMap(req.__FARM_MIDDLEWARE_CONTEXT__),
|
|
5048
|
-
() =>
|
|
5125
|
+
() => _chunkOZUINP2Pcjs.handleFarmFormActionRequest.call(void 0,
|
|
5049
5126
|
formActionRequest,
|
|
5050
5127
|
_chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, this.config.serverActions),
|
|
5051
5128
|
// Before a rewrite, the URL the browser posted to.
|
|
@@ -5110,11 +5187,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5110
5187
|
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
|
|
5111
5188
|
error
|
|
5112
5189
|
};
|
|
5113
|
-
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess',
|
|
5190
|
+
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _149 => _149.notFound])) {
|
|
5114
5191
|
res.statusCode = 404;
|
|
5115
5192
|
PageComponent = programmaticRouteComponents.notFound;
|
|
5116
5193
|
pageProps = routeStateProps;
|
|
5117
|
-
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess',
|
|
5194
|
+
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _150 => _150.error])) {
|
|
5118
5195
|
res.statusCode = 500;
|
|
5119
5196
|
PageComponent = programmaticRouteComponents.error;
|
|
5120
5197
|
pageProps = routeStateProps;
|
|
@@ -5122,10 +5199,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5122
5199
|
throw error;
|
|
5123
5200
|
}
|
|
5124
5201
|
}
|
|
5125
|
-
const renderingConfig = await
|
|
5202
|
+
const renderingConfig = await _chunkOUDNUFVRcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5126
5203
|
routeModule,
|
|
5127
5204
|
route.modulePath,
|
|
5128
|
-
{ experimentalPPR: _optionalChain([this, 'access',
|
|
5205
|
+
{ experimentalPPR: _optionalChain([this, 'access', _151 => _151.config, 'access', _152 => _152.experimental, 'optionalAccess', _153 => _153.ppr]) === true }
|
|
5129
5206
|
);
|
|
5130
5207
|
const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
|
|
5131
5208
|
const islandsNavigationRequest = Boolean(
|
|
@@ -5136,24 +5213,24 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5136
5213
|
let pprShellOptions = canCachePPRShell ? {
|
|
5137
5214
|
pathname,
|
|
5138
5215
|
search: url.search,
|
|
5139
|
-
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess',
|
|
5216
|
+
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _154 => _154.locale]), () => ( "")),
|
|
5140
5217
|
origin: pprI18nSnapshot && pprI18nSnapshot.routing !== "none" ? url.origin : "",
|
|
5141
5218
|
revalidate: renderingConfig.revalidate
|
|
5142
5219
|
} : void 0;
|
|
5143
5220
|
if (renderingConfig.ppr && pprBypassReason) {
|
|
5144
|
-
|
|
5221
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5145
5222
|
type: "ppr.shell.bypass",
|
|
5146
5223
|
route: pathname,
|
|
5147
5224
|
reason: pprBypassReason
|
|
5148
5225
|
});
|
|
5149
|
-
|
|
5226
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5150
5227
|
type: "cache.bypass",
|
|
5151
5228
|
route: pathname,
|
|
5152
5229
|
reason: pprBypassReason
|
|
5153
5230
|
});
|
|
5154
5231
|
if (pprBypassReason === "refresh") {
|
|
5155
5232
|
pprRefreshRoute = pathname;
|
|
5156
|
-
|
|
5233
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "ppr.refresh.start", route: pathname });
|
|
5157
5234
|
}
|
|
5158
5235
|
}
|
|
5159
5236
|
const pprVisitorCookies = Boolean(_chunkNLBHLPEOcjs.withoutFarmDeploymentCookie.call(void 0, req.headers.cookie));
|
|
@@ -5172,10 +5249,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5172
5249
|
);
|
|
5173
5250
|
if (cachedPPRShell && pprVisitorCookies && !cachedPPRShell.value.cookieIndependent) {
|
|
5174
5251
|
pprShellOptions = void 0;
|
|
5175
|
-
|
|
5176
|
-
|
|
5252
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "ppr.shell.bypass", route: pathname, reason: "cookie" });
|
|
5253
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "cache.bypass", route: pathname, reason: "cookie" });
|
|
5177
5254
|
} else if (cachedPPRShell) {
|
|
5178
|
-
|
|
5255
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5179
5256
|
type: "ppr.shell.hit",
|
|
5180
5257
|
route: pathname,
|
|
5181
5258
|
key: pprCacheKey
|
|
@@ -5184,7 +5261,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5184
5261
|
completeRender(res.statusCode || 200, pathname);
|
|
5185
5262
|
return;
|
|
5186
5263
|
} else {
|
|
5187
|
-
|
|
5264
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5188
5265
|
type: "ppr.shell.miss",
|
|
5189
5266
|
route: pathname,
|
|
5190
5267
|
key: pprCacheKey
|
|
@@ -5210,18 +5287,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5210
5287
|
LoadingFallbackComponent = loadingModule.default;
|
|
5211
5288
|
}
|
|
5212
5289
|
}
|
|
5213
|
-
let ErrorFallbackComponent = null;
|
|
5214
|
-
if (errorBoundaryEntry) {
|
|
5215
|
-
const errorModule = await this.routeManager.loadRouteModule(errorBoundaryEntry.modulePath);
|
|
5216
|
-
if (errorModule.default) {
|
|
5217
|
-
ErrorFallbackComponent = errorModule.default;
|
|
5218
|
-
}
|
|
5219
|
-
}
|
|
5220
5290
|
const routeManifest = this.routeManager.generateClientManifest(this.config.root);
|
|
5221
5291
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5222
5292
|
(entry) => entry.pattern === route.pattern
|
|
5223
5293
|
);
|
|
5224
|
-
const moduleMetadata = routeManifestEntry ||
|
|
5294
|
+
const moduleMetadata = routeManifestEntry || _chunk46UV2E7Icjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
5225
5295
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
5226
5296
|
const renderedRouteSlots = await Promise.all(
|
|
5227
5297
|
routeSlots.map(async (slot) => {
|
|
@@ -5272,20 +5342,20 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5272
5342
|
if (moduleMetadata.suppressedAsyncHydration) {
|
|
5273
5343
|
warnSuppressedAsyncHydrationOnce(
|
|
5274
5344
|
route.modulePath,
|
|
5275
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5345
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _155 => _155.suppressedAsyncHydrationReason])
|
|
5276
5346
|
);
|
|
5277
5347
|
}
|
|
5278
5348
|
const layoutHydrationMetadata = layouts.map((layout) => {
|
|
5279
5349
|
const manifestEntry = routeManifest.layouts.find(
|
|
5280
5350
|
(entry) => entry.pattern === layout.pattern
|
|
5281
5351
|
);
|
|
5282
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
5352
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _156 => _156.suppressedAsyncHydration])) {
|
|
5283
5353
|
warnSuppressedAsyncHydrationOnce(
|
|
5284
5354
|
layout.modulePath,
|
|
5285
5355
|
manifestEntry.suppressedAsyncHydrationReason
|
|
5286
5356
|
);
|
|
5287
5357
|
}
|
|
5288
|
-
if (typeof _optionalChain([manifestEntry, 'optionalAccess',
|
|
5358
|
+
if (typeof _optionalChain([manifestEntry, 'optionalAccess', _157 => _157.shouldHydrate]) === "boolean") {
|
|
5289
5359
|
return {
|
|
5290
5360
|
isClientComponent: manifestEntry.isClientComponent === true,
|
|
5291
5361
|
shouldHydrate: manifestEntry.shouldHydrate,
|
|
@@ -5305,12 +5375,12 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5305
5375
|
);
|
|
5306
5376
|
const clientLayouts = layouts.map((layout, index) => ({
|
|
5307
5377
|
pattern: layout.pattern,
|
|
5308
|
-
modulePath:
|
|
5309
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5310
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5311
|
-
..._optionalChain([layoutHydrationMetadata, 'access',
|
|
5378
|
+
modulePath: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, layout.modulePath, this.config.root),
|
|
5379
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _158 => _158[index], 'optionalAccess', _159 => _159.shouldHydrate]) === true,
|
|
5380
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _160 => _160[index], 'optionalAccess', _161 => _161.islandStrategy]), () => ( null)),
|
|
5381
|
+
..._optionalChain([layoutHydrationMetadata, 'access', _162 => _162[index], 'optionalAccess', _163 => _163.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
|
|
5312
5382
|
// Islands mode: the browser rebuilds this layout from its tree, not its module.
|
|
5313
|
-
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5383
|
+
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _164 => _164[index], 'optionalAccess', _165 => _165.serverTree]) === true ? { serverTree: true } : {}
|
|
5314
5384
|
}));
|
|
5315
5385
|
const hydrationStrategies = [
|
|
5316
5386
|
...shouldHydrate && moduleMetadata.islandStrategy ? [moduleMetadata.islandStrategy] : [],
|
|
@@ -5324,9 +5394,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5324
5394
|
layouts.map((layout, index) => ({
|
|
5325
5395
|
pattern: layout.pattern,
|
|
5326
5396
|
modulePath: layout.modulePath,
|
|
5327
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5328
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5329
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5397
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _166 => _166[index], 'optionalAccess', _167 => _167.shouldHydrate]) === true,
|
|
5398
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _168 => _168[index], 'optionalAccess', _169 => _169.hasIsolatedClientBoundaries]) === true,
|
|
5399
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _170 => _170[index], 'optionalAccess', _171 => _171.islandStrategy]), () => ( null))
|
|
5330
5400
|
})),
|
|
5331
5401
|
this.config.root || process.cwd(),
|
|
5332
5402
|
true
|
|
@@ -5334,10 +5404,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5334
5404
|
const hasHydratableRouteSlots = renderedRouteSlots.some(
|
|
5335
5405
|
(slot) => slot.isClientComponent || slot.shouldHydrate
|
|
5336
5406
|
);
|
|
5337
|
-
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5407
|
+
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _172 => _172.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
|
|
5338
5408
|
req.__FARM_PAGE_PATH__ = route.modulePath;
|
|
5339
5409
|
req.__FARM_ROUTE__ = pathname;
|
|
5340
|
-
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access',
|
|
5410
|
+
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access', _173 => _173[0], 'optionalAccess', _174 => _174.modulePath]);
|
|
5341
5411
|
req.__FARM_IS_CLIENT_COMPONENT__ = isClientComponent;
|
|
5342
5412
|
req.__FARM_PAGE_SHOULD_HYDRATE__ = shouldHydrate;
|
|
5343
5413
|
req.__FARM_LAYOUT_SHOULD_HYDRATE__ = shouldHydrateLayout;
|
|
@@ -5348,7 +5418,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5348
5418
|
req.__FARM_SHOULD_HYDRATE__ = shouldHydrate || shouldHydrateLayout || hasIsolatedClientBoundaries;
|
|
5349
5419
|
req.__FARM_ISLAND_STRATEGY__ = hydrationIslandStrategy;
|
|
5350
5420
|
req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ = hasHydratableRouteSlots;
|
|
5351
|
-
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess',
|
|
5421
|
+
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _175 => _175.modulePath]) ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
|
|
5352
5422
|
req.__FARM_ROUTE_SLOTS__ = renderedRouteSlots.map((slot) => ({
|
|
5353
5423
|
name: slot.name,
|
|
5354
5424
|
ownerPattern: slot.ownerPattern,
|
|
@@ -5398,7 +5468,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5398
5468
|
await _chunkYDXLC4DWcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
|
|
5399
5469
|
await _chunkYDXLC4DWcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
|
|
5400
5470
|
await _chunk2RSVYJT6cjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
|
|
5401
|
-
let pageElement = this.
|
|
5471
|
+
let pageElement = await this.createPageElement(PageComponent, pageProps);
|
|
5402
5472
|
if (LoadingFallbackComponent && !islandsNavigationRequest) {
|
|
5403
5473
|
const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
|
|
5404
5474
|
...createRouteStateProps({
|
|
@@ -5420,7 +5490,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5420
5490
|
} else if (shouldHydrateLayout && !(isClientComponent || shouldHydrate) && this.rendererRuntime.isolateServerPageGraph) {
|
|
5421
5491
|
pageElement = await this.isolateServerPage(
|
|
5422
5492
|
pageElement,
|
|
5423
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5493
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _176 => _176.serverTree]) === true
|
|
5424
5494
|
);
|
|
5425
5495
|
}
|
|
5426
5496
|
pageElement = this.createPageBoundary(pageElement, {
|
|
@@ -5435,7 +5505,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5435
5505
|
if (keptLayouts > 0 && !layouts.slice(0, keptLayouts).every((layout) => canFarmSkipKeptLayoutRender(layout.modulePath, keptRoot))) {
|
|
5436
5506
|
let keptElement = null;
|
|
5437
5507
|
for (let i = keptLayouts - 1; i >= 0; i--) {
|
|
5438
|
-
const KeptLayout = _optionalChain([layoutModules, 'access',
|
|
5508
|
+
const KeptLayout = _optionalChain([layoutModules, 'access', _177 => _177[i], 'optionalAccess', _178 => _178.default]);
|
|
5439
5509
|
if (KeptLayout) {
|
|
5440
5510
|
keptElement = this.rendererRuntime.createElement(KeptLayout, {
|
|
5441
5511
|
children: keptElement,
|
|
@@ -5484,7 +5554,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5484
5554
|
);
|
|
5485
5555
|
slotProps[slot.name] = slotElement;
|
|
5486
5556
|
}
|
|
5487
|
-
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5557
|
+
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _179 => _179[i], 'optionalAccess', _180 => _180.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
|
|
5488
5558
|
LayoutComponent,
|
|
5489
5559
|
{ params },
|
|
5490
5560
|
{ children: wrappedElement, ...slotProps },
|
|
@@ -5503,24 +5573,6 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5503
5573
|
if (shouldHydrateLayout) {
|
|
5504
5574
|
wrappedElement = this.wrapClientGraph(wrappedElement);
|
|
5505
5575
|
}
|
|
5506
|
-
if (ErrorFallbackComponent && this.rendererRuntime.ErrorBoundary) {
|
|
5507
|
-
wrappedElement = this.rendererRuntime.createElement(
|
|
5508
|
-
this.rendererRuntime.ErrorBoundary,
|
|
5509
|
-
{
|
|
5510
|
-
Fallback: ErrorFallbackComponent,
|
|
5511
|
-
fallbackProps: {
|
|
5512
|
-
...createRouteStateProps({
|
|
5513
|
-
params,
|
|
5514
|
-
searchParamsObject,
|
|
5515
|
-
path: pathname,
|
|
5516
|
-
middlewareMap,
|
|
5517
|
-
pluginExposedContext
|
|
5518
|
-
})
|
|
5519
|
-
}
|
|
5520
|
-
},
|
|
5521
|
-
wrappedElement
|
|
5522
|
-
);
|
|
5523
|
-
}
|
|
5524
5576
|
if ((isClientComponent || shouldHydrate) && !shouldHydrateLayout && this.reactRenderer) {
|
|
5525
5577
|
wrappedElement = this.reactRenderer.markLayoutPosition(wrappedElement);
|
|
5526
5578
|
}
|
|
@@ -5543,18 +5595,18 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5543
5595
|
clientRoutePattern: route.pattern,
|
|
5544
5596
|
captureStaticShell: Boolean(pprShellOptions),
|
|
5545
5597
|
observabilityRoute: pathname,
|
|
5546
|
-
onSuspenseHoleDetected: pprShellOptions ? () =>
|
|
5598
|
+
onSuspenseHoleDetected: pprShellOptions ? () => _chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5547
5599
|
type: "ppr.suspense.holeDetected",
|
|
5548
5600
|
route: pathname
|
|
5549
5601
|
}) : void 0,
|
|
5550
5602
|
onComplete: pprShellOptions && req.method !== "HEAD" ? (html) => {
|
|
5551
5603
|
if (countRequestReads() !== requestReadsBeforeRender) {
|
|
5552
|
-
|
|
5604
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5553
5605
|
type: "ppr.shell.bypass",
|
|
5554
5606
|
route: pathname,
|
|
5555
5607
|
reason: "request-read"
|
|
5556
5608
|
});
|
|
5557
|
-
|
|
5609
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5558
5610
|
type: "cache.bypass",
|
|
5559
5611
|
route: pathname,
|
|
5560
5612
|
reason: "request-read"
|
|
@@ -5563,12 +5615,12 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5563
5615
|
}
|
|
5564
5616
|
const renderReadCookies = countRequestCookieReads() !== requestCookieReadsBeforeRender;
|
|
5565
5617
|
if (renderReadCookies && pprVisitorCookies) {
|
|
5566
|
-
|
|
5618
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5567
5619
|
type: "ppr.shell.bypass",
|
|
5568
5620
|
route: pathname,
|
|
5569
5621
|
reason: "cookie"
|
|
5570
5622
|
});
|
|
5571
|
-
|
|
5623
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5572
5624
|
type: "cache.bypass",
|
|
5573
5625
|
route: pathname,
|
|
5574
5626
|
reason: "cookie"
|
|
@@ -5585,7 +5637,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5585
5637
|
}
|
|
5586
5638
|
);
|
|
5587
5639
|
if (pprRefreshRoute) {
|
|
5588
|
-
|
|
5640
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5589
5641
|
type: "ppr.refresh.complete",
|
|
5590
5642
|
route: pprRefreshRoute,
|
|
5591
5643
|
durationMs: Date.now() - renderStartTime
|
|
@@ -5610,7 +5662,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5610
5662
|
const redirect = _chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error);
|
|
5611
5663
|
const snapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
5612
5664
|
const redirectUrl = snapshot && redirect.url.startsWith("/") && !redirect.url.startsWith("//") ? _chunkGYJT2U7Jcjs.localizeFarmHref.call(void 0, redirect.url, snapshot.locale, snapshot) : redirect.url;
|
|
5613
|
-
|
|
5665
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5614
5666
|
type: "route.redirect",
|
|
5615
5667
|
from: pathname,
|
|
5616
5668
|
to: redirectUrl,
|
|
@@ -5627,7 +5679,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5627
5679
|
return;
|
|
5628
5680
|
}
|
|
5629
5681
|
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error)) {
|
|
5630
|
-
|
|
5682
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "route.notFound", pathname });
|
|
5631
5683
|
if (!res.headersSent && !res.writableEnded) {
|
|
5632
5684
|
try {
|
|
5633
5685
|
await this.render404(req, res);
|
|
@@ -5645,15 +5697,15 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5645
5697
|
}
|
|
5646
5698
|
}
|
|
5647
5699
|
emitFarmRenderError(req, pathname, error);
|
|
5648
|
-
const errorStatus =
|
|
5700
|
+
const errorStatus = _chunkOFVCWV2Dcjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
5649
5701
|
if (pprRefreshRoute) {
|
|
5650
|
-
|
|
5702
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5651
5703
|
type: "ppr.refresh.error",
|
|
5652
5704
|
route: pprRefreshRoute,
|
|
5653
5705
|
error
|
|
5654
5706
|
});
|
|
5655
5707
|
}
|
|
5656
|
-
|
|
5708
|
+
_chunk7U4XF76Rcjs.logger.error(`Error rendering page: ${error}`);
|
|
5657
5709
|
if (res.headersSent || res.writableEnded) {
|
|
5658
5710
|
if (!res.writableEnded) {
|
|
5659
5711
|
res.end();
|
|
@@ -5680,31 +5732,31 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5680
5732
|
}
|
|
5681
5733
|
await this.renderError(req, res, error, errorStatus);
|
|
5682
5734
|
} finally {
|
|
5683
|
-
_optionalChain([pprShellWrite, 'optionalAccess',
|
|
5735
|
+
_optionalChain([pprShellWrite, 'optionalAccess', _181 => _181.release, 'call', _182 => _182()]);
|
|
5684
5736
|
}
|
|
5685
5737
|
}
|
|
5686
5738
|
async wrapWithIntegrationProviders(element) {
|
|
5687
|
-
const providers =
|
|
5739
|
+
const providers = _chunkWGWWRV2Mcjs.getIntegrationProviders.call(void 0, this.config.integrations);
|
|
5688
5740
|
let wrapped = element;
|
|
5689
5741
|
for (let i = providers.length - 1; i >= 0; i--) {
|
|
5690
5742
|
const provider = providers[i];
|
|
5691
5743
|
if (provider.component || provider.type === "clerk") {
|
|
5692
|
-
const rendererCapabilities =
|
|
5744
|
+
const rendererCapabilities = _chunkM6DAIE4Tcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
|
|
5693
5745
|
if (!rendererCapabilities.functionComponents) {
|
|
5694
5746
|
throw new Error(
|
|
5695
|
-
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access',
|
|
5747
|
+
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _183 => _183.config, 'access', _184 => _184.renderer, 'optionalAccess', _185 => _185.name]), () => ( "the configured renderer"))}\` cannot.`
|
|
5696
5748
|
);
|
|
5697
5749
|
}
|
|
5698
|
-
if (provider.type === "clerk" && !
|
|
5750
|
+
if (provider.type === "clerk" && !_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, this.config.renderer)) {
|
|
5699
5751
|
throw new Error(
|
|
5700
5752
|
`Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
|
|
5701
5753
|
);
|
|
5702
5754
|
}
|
|
5703
5755
|
let ProviderComponent;
|
|
5704
5756
|
let providerSourceModule;
|
|
5705
|
-
if (
|
|
5757
|
+
if (_chunkWGWWRV2Mcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
5706
5758
|
providerSourceModule = provider.component.module;
|
|
5707
|
-
const providerModuleId = provider.component.module.startsWith(".") ?
|
|
5759
|
+
const providerModuleId = provider.component.module.startsWith(".") ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0,
|
|
5708
5760
|
path10.resolve(this.config.root, provider.component.module),
|
|
5709
5761
|
this.config.root
|
|
5710
5762
|
) : provider.component.module;
|
|
@@ -5731,7 +5783,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5731
5783
|
}
|
|
5732
5784
|
if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
|
|
5733
5785
|
_nullishCoalesce(providerSourceModule, () => ( "")),
|
|
5734
|
-
|
|
5786
|
+
_chunkM6DAIE4Tcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _186 => _186.config, 'access', _187 => _187.renderer, 'optionalAccess', _188 => _188.componentExtensions]))
|
|
5735
5787
|
)) {
|
|
5736
5788
|
ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
|
|
5737
5789
|
}
|
|
@@ -5800,7 +5852,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5800
5852
|
);
|
|
5801
5853
|
metadata = _chunkY3DO7BIJcjs.addMetadataMarkdownAlternate.call(void 0,
|
|
5802
5854
|
metadata,
|
|
5803
|
-
|
|
5855
|
+
_chunk2NOHVIJ3cjs.getFarmMarkdownAlternatePath.call(void 0, _chunk2NOHVIJ3cjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname, {
|
|
5804
5856
|
routePathname: (pathname) => this.routeManager.toRoutePathname(pathname)
|
|
5805
5857
|
})
|
|
5806
5858
|
);
|
|
@@ -5840,7 +5892,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5840
5892
|
reference.contentType = imageModule.contentType;
|
|
5841
5893
|
}
|
|
5842
5894
|
} catch (error) {
|
|
5843
|
-
|
|
5895
|
+
_chunk7U4XF76Rcjs.logger.warn(`Failed to read ${kind} image metadata for ${pathname}: ${error}`);
|
|
5844
5896
|
}
|
|
5845
5897
|
return reference;
|
|
5846
5898
|
}
|
|
@@ -5860,7 +5912,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5860
5912
|
);
|
|
5861
5913
|
}
|
|
5862
5914
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5863
|
-
trustProxy: _optionalChain([this, 'access',
|
|
5915
|
+
trustProxy: _optionalChain([this, 'access', _189 => _189.config, 'access', _190 => _190.server, 'optionalAccess', _191 => _191.trustProxy])
|
|
5864
5916
|
});
|
|
5865
5917
|
const url = new URL(request2.url);
|
|
5866
5918
|
const llmsContext = match.metadata.kind === "llms" || match.metadata.kind === "llms-full" ? await this.createLlmsTxtContext(request2, {
|
|
@@ -5874,17 +5926,17 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5874
5926
|
path: match.routePath,
|
|
5875
5927
|
...llmsContext
|
|
5876
5928
|
}) : routeModule.default;
|
|
5877
|
-
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await
|
|
5929
|
+
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkOLKYHTLNcjs.renderFarmLlmsFullTxt.call(void 0, value, {
|
|
5878
5930
|
origin: await this.getAgentOrigin(request2),
|
|
5879
5931
|
readMarkdown: llmsContext.markdown
|
|
5880
5932
|
}) : value;
|
|
5881
|
-
const response =
|
|
5933
|
+
const response = _chunkOFVCWV2Dcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
5882
5934
|
method,
|
|
5883
5935
|
request: request2
|
|
5884
5936
|
});
|
|
5885
5937
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
5886
5938
|
} catch (error) {
|
|
5887
|
-
|
|
5939
|
+
_chunk7U4XF76Rcjs.logger.error(`Metadata route render failed for ${match.metadata.modulePath}: ${error}`);
|
|
5888
5940
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5889
5941
|
res,
|
|
5890
5942
|
new Response("Internal Server Error", {
|
|
@@ -5896,7 +5948,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5896
5948
|
}
|
|
5897
5949
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
5898
5950
|
getGeneratedLlmsKind(pathname) {
|
|
5899
|
-
const config =
|
|
5951
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _192 => _192.config, 'access', _193 => _193.agent, 'optionalAccess', _194 => _194.llmsTxt]));
|
|
5900
5952
|
if (!config.enabled) return null;
|
|
5901
5953
|
if (pathname === "/llms.txt") return "llms";
|
|
5902
5954
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
@@ -5904,17 +5956,17 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5904
5956
|
async renderGeneratedLlmsTxt(req, res, kind) {
|
|
5905
5957
|
try {
|
|
5906
5958
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5907
|
-
trustProxy: _optionalChain([this, 'access',
|
|
5959
|
+
trustProxy: _optionalChain([this, 'access', _195 => _195.config, 'access', _196 => _196.server, 'optionalAccess', _197 => _197.trustProxy])
|
|
5908
5960
|
});
|
|
5909
|
-
const config =
|
|
5961
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _198 => _198.config, 'access', _199 => _199.agent, 'optionalAccess', _200 => _200.llmsTxt]));
|
|
5910
5962
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
5911
|
-
const body = kind === "llms-full" ? await
|
|
5963
|
+
const body = kind === "llms-full" ? await _chunkOLKYHTLNcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
5912
5964
|
origin: await this.getAgentOrigin(request2),
|
|
5913
5965
|
readMarkdown: context.markdown
|
|
5914
5966
|
}) : context.defaults;
|
|
5915
5967
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5916
5968
|
res,
|
|
5917
|
-
|
|
5969
|
+
_chunkOFVCWV2Dcjs.createFarmMetadataRouteResponse.call(void 0,
|
|
5918
5970
|
kind,
|
|
5919
5971
|
body,
|
|
5920
5972
|
{ revalidate: config.revalidate },
|
|
@@ -5922,7 +5974,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5922
5974
|
)
|
|
5923
5975
|
);
|
|
5924
5976
|
} catch (error) {
|
|
5925
|
-
|
|
5977
|
+
_chunk7U4XF76Rcjs.logger.error(`Generated ${kind}.txt failed: ${error}`);
|
|
5926
5978
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5927
5979
|
res,
|
|
5928
5980
|
new Response("Internal Server Error", {
|
|
@@ -5933,26 +5985,26 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5933
5985
|
}
|
|
5934
5986
|
}
|
|
5935
5987
|
getAgentCrawlers() {
|
|
5936
|
-
return
|
|
5988
|
+
return _chunk4OFWG4IKcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _201 => _201.config, 'access', _202 => _202.agent, 'optionalAccess', _203 => _203.crawlers]));
|
|
5937
5989
|
}
|
|
5938
5990
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
5939
5991
|
async renderGeneratedRobotsTxt(req, res) {
|
|
5940
5992
|
try {
|
|
5941
|
-
const sitemapPath = _optionalChain([this, 'access',
|
|
5993
|
+
const sitemapPath = _optionalChain([this, 'access', _204 => _204.routeManager, 'access', _205 => _205.matchMetadataRoute, 'call', _206 => _206("/sitemap.xml"), 'optionalAccess', _207 => _207.metadata, 'access', _208 => _208.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
|
|
5942
5994
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5943
5995
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5944
|
-
const robots =
|
|
5996
|
+
const robots = _chunk4OFWG4IKcjs.createFarmAgentRobots.call(void 0, {
|
|
5945
5997
|
crawlers: this.getAgentCrawlers(),
|
|
5946
5998
|
sitemapPath,
|
|
5947
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
5999
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _209 => _209.metadataBase]),
|
|
5948
6000
|
basePath: this.config.basePath
|
|
5949
6001
|
});
|
|
5950
6002
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5951
6003
|
res,
|
|
5952
|
-
|
|
6004
|
+
_chunkOFVCWV2Dcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
5953
6005
|
);
|
|
5954
6006
|
} catch (error) {
|
|
5955
|
-
|
|
6007
|
+
_chunk7U4XF76Rcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
5956
6008
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5957
6009
|
res,
|
|
5958
6010
|
new Response("Internal Server Error", {
|
|
@@ -5963,46 +6015,46 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5963
6015
|
}
|
|
5964
6016
|
}
|
|
5965
6017
|
getAgentSitemap() {
|
|
5966
|
-
return
|
|
6018
|
+
return _chunk4OFWG4IKcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _210 => _210.config, 'access', _211 => _211.agent, 'optionalAccess', _212 => _212.sitemap]));
|
|
5967
6019
|
}
|
|
5968
6020
|
/** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
|
|
5969
6021
|
async renderGeneratedSitemap(req, res) {
|
|
5970
6022
|
try {
|
|
5971
6023
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5972
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6024
|
+
trustProxy: _optionalChain([this, 'access', _213 => _213.config, 'access', _214 => _214.server, 'optionalAccess', _215 => _215.trustProxy])
|
|
5973
6025
|
});
|
|
5974
6026
|
const sources = await Promise.all(
|
|
5975
6027
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
5976
6028
|
const [module, stat] = await Promise.all([
|
|
5977
6029
|
this.routeManager.loadRouteModule(route.modulePath).catch((error) => {
|
|
5978
|
-
|
|
6030
|
+
_chunk7U4XF76Rcjs.logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
|
|
5979
6031
|
return void 0;
|
|
5980
6032
|
}),
|
|
5981
6033
|
fs7.promises.stat(route.modulePath).catch(() => void 0)
|
|
5982
6034
|
]);
|
|
5983
|
-
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess',
|
|
5984
|
-
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess',
|
|
6035
|
+
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _216 => _216.metadata]))) return null;
|
|
6036
|
+
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _217 => _217.mtime, 'access', _218 => _218.toISOString, 'call', _219 => _219()]) };
|
|
5985
6037
|
})
|
|
5986
6038
|
);
|
|
5987
6039
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5988
6040
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5989
|
-
const sitemap =
|
|
6041
|
+
const sitemap = _chunk4OFWG4IKcjs.createFarmDefaultSitemap.call(void 0,
|
|
5990
6042
|
sources.filter((source) => source !== null),
|
|
5991
6043
|
{
|
|
5992
6044
|
origin: new URL(request2.url).origin,
|
|
5993
6045
|
config: this.getAgentSitemap(),
|
|
5994
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
6046
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _220 => _220.metadataBase]),
|
|
5995
6047
|
basePath: this.config.basePath,
|
|
5996
6048
|
trailingSlash: this.config.trailingSlash,
|
|
5997
|
-
i18n: _optionalChain([this, 'access',
|
|
6049
|
+
i18n: _optionalChain([this, 'access', _221 => _221.i18nRuntime, 'optionalAccess', _222 => _222.config])
|
|
5998
6050
|
}
|
|
5999
6051
|
);
|
|
6000
6052
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6001
6053
|
res,
|
|
6002
|
-
|
|
6054
|
+
_chunkOFVCWV2Dcjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
|
|
6003
6055
|
);
|
|
6004
6056
|
} catch (error) {
|
|
6005
|
-
|
|
6057
|
+
_chunk7U4XF76Rcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
|
|
6006
6058
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6007
6059
|
res,
|
|
6008
6060
|
new Response("Internal Server Error", {
|
|
@@ -6026,9 +6078,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6026
6078
|
* matcher) covers, as the production build decides.
|
|
6027
6079
|
*/
|
|
6028
6080
|
getAgentListedRoutes() {
|
|
6029
|
-
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access',
|
|
6081
|
+
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _223 => _223.middlewareRoutes, 'optionalCall', _224 => _224()]), () => ( [])) };
|
|
6030
6082
|
return [...this.routeManager.getRoutes()].filter(
|
|
6031
|
-
([pattern]) => !pattern.includes("[") && !
|
|
6083
|
+
([pattern]) => !pattern.includes("[") && !_chunkOFVCWV2Dcjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
|
|
6032
6084
|
);
|
|
6033
6085
|
}
|
|
6034
6086
|
/**
|
|
@@ -6044,7 +6096,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6044
6096
|
)
|
|
6045
6097
|
)
|
|
6046
6098
|
);
|
|
6047
|
-
return
|
|
6099
|
+
return _chunkOLKYHTLNcjs.isFarmPageNoIndex.call(void 0, metadata, layoutMetadata);
|
|
6048
6100
|
}
|
|
6049
6101
|
/**
|
|
6050
6102
|
* The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
|
|
@@ -6052,22 +6104,22 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6052
6104
|
* or a registered server such as the docs engine's. Production applies the same rules.
|
|
6053
6105
|
*/
|
|
6054
6106
|
getDefaultMCPServer() {
|
|
6055
|
-
if (_optionalChain([this, 'access',
|
|
6056
|
-
if (_optionalChain([this, 'access',
|
|
6057
|
-
if (this.routeManager.matchRoute(
|
|
6058
|
-
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer =
|
|
6107
|
+
if (_optionalChain([this, 'access', _225 => _225.config, 'access', _226 => _226.agent, 'optionalAccess', _227 => _227.mcp]) !== true || _chunkW53Z4WDIcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
|
|
6108
|
+
if (_optionalChain([this, 'access', _228 => _228.apiRouteExists, 'optionalCall', _229 => _229("/api/mcp")])) return void 0;
|
|
6109
|
+
if (this.routeManager.matchRoute(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6110
|
+
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0,
|
|
6059
6111
|
readAppPackageIdentity(this.config.root),
|
|
6060
|
-
|
|
6112
|
+
_chunkNSLRK5DKcjs.FARM_VERSION
|
|
6061
6113
|
))));
|
|
6062
|
-
return
|
|
6114
|
+
return _chunkW53Z4WDIcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
6063
6115
|
}
|
|
6064
6116
|
async renderDefaultMCP(req, res) {
|
|
6065
6117
|
const server = this.getDefaultMCPServer();
|
|
6066
|
-
const request2 = _nullishCoalesce(_chunk2RSVYJT6cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
6118
|
+
const request2 = _nullishCoalesce(_chunk2RSVYJT6cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _230 => _230.config, 'access', _231 => _231.server, 'optionalAccess', _232 => _232.trustProxy]) })));
|
|
6067
6119
|
try {
|
|
6068
|
-
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-
|
|
6120
|
+
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-IUL6OPC3.cjs");
|
|
6069
6121
|
const origin = new URL(request2.url).origin;
|
|
6070
|
-
const i18n = _optionalChain([this, 'access',
|
|
6122
|
+
const i18n = _optionalChain([this, 'access', _233 => _233.i18nRuntime, 'optionalAccess', _234 => _234.config]);
|
|
6071
6123
|
const metadataBase = await this.getRootMetadataBase();
|
|
6072
6124
|
const response = await handleFarmDefaultMCPRequest(request2, {
|
|
6073
6125
|
server,
|
|
@@ -6082,13 +6134,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6082
6134
|
return await this.isAgentPageNoIndex(pattern, metadata) ? null : { pattern, module };
|
|
6083
6135
|
})
|
|
6084
6136
|
);
|
|
6085
|
-
return
|
|
6137
|
+
return _chunkW53Z4WDIcjs.collectFarmDefaultMCPPages.call(void 0,
|
|
6086
6138
|
sources.filter((source) => source !== null),
|
|
6087
6139
|
{
|
|
6088
6140
|
origin,
|
|
6089
6141
|
metadataBase,
|
|
6090
6142
|
basePath: this.config.basePath,
|
|
6091
|
-
markdown:
|
|
6143
|
+
markdown: _chunk2NOHVIJ3cjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
6092
6144
|
trailingSlash: this.config.trailingSlash,
|
|
6093
6145
|
i18n
|
|
6094
6146
|
}
|
|
@@ -6099,7 +6151,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6099
6151
|
});
|
|
6100
6152
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
6101
6153
|
} catch (error) {
|
|
6102
|
-
|
|
6154
|
+
_chunk7U4XF76Rcjs.logger.error(`Default MCP server failed: ${error}`);
|
|
6103
6155
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6104
6156
|
res,
|
|
6105
6157
|
new Response(
|
|
@@ -6115,7 +6167,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6115
6167
|
}
|
|
6116
6168
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6117
6169
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6118
|
-
const config =
|
|
6170
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _235 => _235.config, 'access', _236 => _236.agent, 'optionalAccess', _237 => _237.llmsTxt]));
|
|
6119
6171
|
const origin = await this.getAgentOrigin(request2);
|
|
6120
6172
|
const sources = await Promise.all(
|
|
6121
6173
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -6125,33 +6177,33 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6125
6177
|
if (await this.isAgentPageNoIndex(pattern, module.metadata)) return null;
|
|
6126
6178
|
return { pattern, metadata: module.metadata };
|
|
6127
6179
|
} catch (error) {
|
|
6128
|
-
|
|
6180
|
+
_chunk7U4XF76Rcjs.logger.warn(`Could not read metadata for ${pattern} in llms.txt: ${error}`);
|
|
6129
6181
|
return { pattern };
|
|
6130
6182
|
}
|
|
6131
6183
|
})
|
|
6132
6184
|
);
|
|
6133
6185
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6134
6186
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6135
|
-
const pages =
|
|
6187
|
+
const pages = _chunkOLKYHTLNcjs.collectFarmLlmsTxtPages.call(void 0,
|
|
6136
6188
|
sources.filter((source) => source !== null),
|
|
6137
6189
|
{
|
|
6138
6190
|
origin,
|
|
6139
6191
|
basePath: this.config.basePath,
|
|
6140
|
-
markdown:
|
|
6192
|
+
markdown: _chunk2NOHVIJ3cjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
6141
6193
|
include: config.include,
|
|
6142
6194
|
exclude: config.exclude,
|
|
6143
6195
|
trailingSlash: this.config.trailingSlash,
|
|
6144
|
-
i18n: _optionalChain([this, 'access',
|
|
6196
|
+
i18n: _optionalChain([this, 'access', _238 => _238.i18nRuntime, 'optionalAccess', _239 => _239.config])
|
|
6145
6197
|
}
|
|
6146
6198
|
);
|
|
6147
6199
|
return {
|
|
6148
6200
|
pages,
|
|
6149
|
-
defaults:
|
|
6201
|
+
defaults: _chunkOLKYHTLNcjs.createFarmDefaultLlmsTxt.call(void 0, {
|
|
6150
6202
|
origin,
|
|
6151
6203
|
pages,
|
|
6152
6204
|
config,
|
|
6153
6205
|
rootMetadata,
|
|
6154
|
-
mcp: _optionalChain([this, 'access',
|
|
6206
|
+
mcp: _optionalChain([this, 'access', _240 => _240.config, 'access', _241 => _241.agent, 'optionalAccess', _242 => _242.aiCatalog]) === false ? [] : _chunkFYZD7DUScjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
6155
6207
|
basePath: this.config.basePath,
|
|
6156
6208
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
6157
6209
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -6162,7 +6214,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6162
6214
|
})
|
|
6163
6215
|
}),
|
|
6164
6216
|
...options.full ? {
|
|
6165
|
-
markdown:
|
|
6217
|
+
markdown: _chunkOLKYHTLNcjs.readFarmLlmsMarkdownFrom.call(void 0,
|
|
6166
6218
|
new URL(request2.url).origin,
|
|
6167
6219
|
origin,
|
|
6168
6220
|
this.createDevMarkdownReader(options.req)
|
|
@@ -6175,13 +6227,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6175
6227
|
* `metadataBase`, else the request's origin, as for the sitemap and the production server.
|
|
6176
6228
|
*/
|
|
6177
6229
|
async getAgentOrigin(request2) {
|
|
6178
|
-
return
|
|
6230
|
+
return _chunkOLKYHTLNcjs.resolveFarmAgentOrigin.call(void 0, await this.getRootMetadataBase(), new URL(request2.url).origin);
|
|
6179
6231
|
}
|
|
6180
6232
|
/** The root layout's `metadataBase`, which generated agent files and list_pages link to. */
|
|
6181
6233
|
async getRootMetadataBase() {
|
|
6182
6234
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6183
6235
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6184
|
-
return _optionalChain([rootMetadata, 'optionalAccess',
|
|
6236
|
+
return _optionalChain([rootMetadata, 'optionalAccess', _243 => _243.metadataBase]);
|
|
6185
6237
|
}
|
|
6186
6238
|
/**
|
|
6187
6239
|
* Reads page mirrors back through this dev server, the way its .md handler
|
|
@@ -6193,17 +6245,17 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6193
6245
|
* body is discarded.
|
|
6194
6246
|
*/
|
|
6195
6247
|
createDevMarkdownReader(req) {
|
|
6196
|
-
const socket = _optionalChain([req, 'optionalAccess',
|
|
6197
|
-
if (_optionalChain([req, 'optionalAccess',
|
|
6248
|
+
const socket = _optionalChain([req, 'optionalAccess', _244 => _244.socket]);
|
|
6249
|
+
if (_optionalChain([req, 'optionalAccess', _245 => _245.method, 'optionalAccess', _246 => _246.toUpperCase, 'call', _247 => _247()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _248 => _248.localAddress]) || !socket.localPort) {
|
|
6198
6250
|
return async () => null;
|
|
6199
6251
|
}
|
|
6200
6252
|
if (socket.encrypted) {
|
|
6201
6253
|
const address = { host: socket.localAddress, port: socket.localPort };
|
|
6202
|
-
return
|
|
6254
|
+
return _chunkOLKYHTLNcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
|
|
6203
6255
|
}
|
|
6204
6256
|
const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
|
|
6205
6257
|
const localOrigin = `http://${host}:${socket.localPort}`;
|
|
6206
|
-
const read =
|
|
6258
|
+
const read = _chunkOLKYHTLNcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
|
|
6207
6259
|
return (url) => {
|
|
6208
6260
|
const target = new URL(url);
|
|
6209
6261
|
return read(`${localOrigin}${target.pathname}${target.search}`);
|
|
@@ -6238,18 +6290,28 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6238
6290
|
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, options.searchParamsObject),
|
|
6239
6291
|
path: options.pagePath
|
|
6240
6292
|
};
|
|
6241
|
-
const handlerResult =
|
|
6293
|
+
const handlerResult = await _chunkVS7HLH4Scjs.resolveFarmMetadataImageValue.call(void 0, imageModule, imageProps, {
|
|
6294
|
+
renderer: this.getMetadataImageRenderer(),
|
|
6295
|
+
component: isRendererCompiledComponent(
|
|
6296
|
+
options.image.modulePath,
|
|
6297
|
+
_nullishCoalesce(_optionalChain([this, 'access', _249 => _249.config, 'access', _250 => _250.renderer, 'optionalAccess', _251 => _251.componentExtensions]), () => ( []))
|
|
6298
|
+
)
|
|
6299
|
+
});
|
|
6242
6300
|
await this.writeMetadataImageResponse(req, res, handlerResult, imageModule);
|
|
6243
6301
|
}
|
|
6244
6302
|
async writeMetadataImageResponse(req, res, value, imageModule) {
|
|
6245
6303
|
const ifNoneMatch = req.headers["if-none-match"];
|
|
6246
|
-
const response = await
|
|
6304
|
+
const response = await _chunkVS7HLH4Scjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
|
|
6247
6305
|
method: req.method,
|
|
6248
6306
|
ifNoneMatch: Array.isArray(ifNoneMatch) ? ifNoneMatch[0] : ifNoneMatch,
|
|
6249
|
-
renderer:
|
|
6307
|
+
renderer: this.getMetadataImageRenderer()
|
|
6250
6308
|
});
|
|
6251
6309
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
6252
6310
|
}
|
|
6311
|
+
/** The renderer that draws a metadata image: none for React, whose elements Satori reads directly. */
|
|
6312
|
+
getMetadataImageRenderer() {
|
|
6313
|
+
return _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime;
|
|
6314
|
+
}
|
|
6253
6315
|
async writeStaticMetadataImageResponse(req, res, image) {
|
|
6254
6316
|
const method = (req.method || "GET").toUpperCase();
|
|
6255
6317
|
if (method !== "GET" && method !== "HEAD") {
|
|
@@ -6260,7 +6322,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6260
6322
|
}
|
|
6261
6323
|
const etag = `"${image.staticInfo.hash}"`;
|
|
6262
6324
|
const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6263
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6325
|
+
trustProxy: _optionalChain([this, 'access', _252 => _252.config, 'access', _253 => _253.server, 'optionalAccess', _254 => _254.trustProxy])
|
|
6264
6326
|
});
|
|
6265
6327
|
const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
|
|
6266
6328
|
res.setHeader("Content-Type", image.staticInfo.contentType);
|
|
@@ -6311,7 +6373,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6311
6373
|
});
|
|
6312
6374
|
let wrapped = errorElement;
|
|
6313
6375
|
const boundaryLayouts = options.errorPattern === void 0 ? options.layouts : options.layouts.filter(
|
|
6314
|
-
(layout) => !("pattern" in layout) ||
|
|
6376
|
+
(layout) => !("pattern" in layout) || _chunkOFVCWV2Dcjs.routeBoundaryCoversDirectory.call(void 0,
|
|
6315
6377
|
layout.pattern,
|
|
6316
6378
|
options.errorPattern
|
|
6317
6379
|
)
|
|
@@ -6350,14 +6412,14 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6350
6412
|
res.end();
|
|
6351
6413
|
return true;
|
|
6352
6414
|
} catch (renderError) {
|
|
6353
|
-
|
|
6415
|
+
_chunk7U4XF76Rcjs.logger.warn(`Failed to render route-level error boundary: ${renderError}`);
|
|
6354
6416
|
return false;
|
|
6355
6417
|
}
|
|
6356
6418
|
}
|
|
6357
6419
|
async renderBufferedSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6358
6420
|
const startedAt = Date.now();
|
|
6359
6421
|
const route = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6360
|
-
|
|
6422
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "render.stream.start", route });
|
|
6361
6423
|
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
6362
6424
|
for (const [key, value] of Object.entries(options.responseHeaders || {})) {
|
|
6363
6425
|
res.setHeader(key, value);
|
|
@@ -6367,7 +6429,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6367
6429
|
const routeSlots = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
6368
6430
|
(slot) => ({
|
|
6369
6431
|
...slot,
|
|
6370
|
-
modulePath: typeof slot.modulePath === "string" ?
|
|
6432
|
+
modulePath: typeof slot.modulePath === "string" ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
|
|
6371
6433
|
})
|
|
6372
6434
|
);
|
|
6373
6435
|
const deferredProps = _chunkDBYNZIIQcjs.prepareDeferredData.call(void 0, {
|
|
@@ -6375,7 +6437,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6375
6437
|
slots: routeSlots
|
|
6376
6438
|
});
|
|
6377
6439
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
6378
|
-
const relativePath = pagePath ?
|
|
6440
|
+
const relativePath = pagePath ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
|
|
6379
6441
|
const deploymentId = this.getDeploymentId();
|
|
6380
6442
|
const farmScripts = (markup) => this.stampFarmScripts(req, markup);
|
|
6381
6443
|
const bootstrapScript = farmScripts(`<script data-farm-refresh-state>
|
|
@@ -6395,12 +6457,12 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
|
|
|
6395
6457
|
window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
|
|
6396
6458
|
window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
|
|
6397
6459
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6398
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6460
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkWGWWRV2Mcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6399
6461
|
window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6400
6462
|
</script>`);
|
|
6401
6463
|
const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
|
|
6402
6464
|
const rendererHydrationScript = farmScripts(
|
|
6403
|
-
_optionalChain([this, 'access',
|
|
6465
|
+
_optionalChain([this, 'access', _255 => _255.rendererRuntime, 'access', _256 => _256.generateHydrationScript, 'optionalCall', _257 => _257()]) || ""
|
|
6404
6466
|
);
|
|
6405
6467
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
6406
6468
|
const farmClientScript = farmScripts(
|
|
@@ -6409,8 +6471,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6409
6471
|
const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
|
|
6410
6472
|
element,
|
|
6411
6473
|
{
|
|
6412
|
-
rejectLateNavigation:
|
|
6413
|
-
_optionalChain([req, 'access',
|
|
6474
|
+
rejectLateNavigation: _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0,
|
|
6475
|
+
_optionalChain([req, 'access', _258 => _258.headers, 'optionalAccess', _259 => _259[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
|
|
6414
6476
|
)
|
|
6415
6477
|
}
|
|
6416
6478
|
);
|
|
@@ -6422,7 +6484,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6422
6484
|
viewport: viewportTags
|
|
6423
6485
|
} = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6424
6486
|
pathname: getFarmMetadataPathname(req),
|
|
6425
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6487
|
+
jsonLd: _optionalChain([this, 'access', _260 => _260.config, 'access', _261 => _261.agent, 'optionalAccess', _262 => _262.jsonLd])
|
|
6426
6488
|
});
|
|
6427
6489
|
const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
6428
6490
|
const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
|
|
@@ -6432,19 +6494,19 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6432
6494
|
i18nSnapshot,
|
|
6433
6495
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6434
6496
|
) : "";
|
|
6435
|
-
const themeDocument =
|
|
6497
|
+
const themeDocument = _chunkOFVCWV2Dcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6436
6498
|
this.config.theme,
|
|
6437
6499
|
this.config.basePath,
|
|
6438
6500
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
6439
6501
|
);
|
|
6440
6502
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
6441
|
-
const fullDocument =
|
|
6503
|
+
const fullDocument = _chunkOFVCWV2Dcjs.extractFarmFullDocument.call(void 0, _chunkOFVCWV2Dcjs.markFarmDocumentLayouts.call(void 0, content));
|
|
6442
6504
|
let html;
|
|
6443
6505
|
if (fullDocument) {
|
|
6444
6506
|
const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
|
|
6445
|
-
const documentHtml = shouldReplaceLayoutTitle ?
|
|
6446
|
-
const effectiveRendererHead = hasExplicitTitle ?
|
|
6447
|
-
html =
|
|
6507
|
+
const documentHtml = shouldReplaceLayoutTitle ? _chunkOFVCWV2Dcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
|
|
6508
|
+
const effectiveRendererHead = hasExplicitTitle ? _chunkOFVCWV2Dcjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
|
|
6509
|
+
html = _chunkOFVCWV2Dcjs.composeFarmFullDocument.call(void 0, documentHtml, {
|
|
6448
6510
|
fallbackIcon: !hasFavicon,
|
|
6449
6511
|
viewport: viewportTags,
|
|
6450
6512
|
htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
|
|
@@ -6470,7 +6532,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6470
6532
|
});
|
|
6471
6533
|
} else {
|
|
6472
6534
|
html = `<!DOCTYPE html>
|
|
6473
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6535
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _263 => _263.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6474
6536
|
<head>
|
|
6475
6537
|
${themeDocument.head}
|
|
6476
6538
|
<meta charset="utf-8">
|
|
@@ -6493,7 +6555,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6493
6555
|
</body>
|
|
6494
6556
|
</html>`;
|
|
6495
6557
|
}
|
|
6496
|
-
|
|
6558
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
6497
6559
|
type: "render.stream.shellReady",
|
|
6498
6560
|
route,
|
|
6499
6561
|
durationMs: Date.now() - startedAt
|
|
@@ -6501,8 +6563,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6501
6563
|
const securedHtml = this.secureDocumentHTML(req, html);
|
|
6502
6564
|
if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
|
|
6503
6565
|
res.end();
|
|
6504
|
-
if (!options.captureStaticShell) await _optionalChain([options, 'access',
|
|
6505
|
-
|
|
6566
|
+
if (!options.captureStaticShell) await _optionalChain([options, 'access', _264 => _264.onComplete, 'optionalCall', _265 => _265(securedHtml)]);
|
|
6567
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
6506
6568
|
type: "render.stream.complete",
|
|
6507
6569
|
route,
|
|
6508
6570
|
durationMs: Date.now() - startedAt
|
|
@@ -6511,7 +6573,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6511
6573
|
emitFarmRenderError(req, route, error);
|
|
6512
6574
|
throw error;
|
|
6513
6575
|
} finally {
|
|
6514
|
-
_optionalChain([clearMiddlewareData, 'optionalCall',
|
|
6576
|
+
_optionalChain([clearMiddlewareData, 'optionalCall', _266 => _266()]);
|
|
6515
6577
|
}
|
|
6516
6578
|
}
|
|
6517
6579
|
/**
|
|
@@ -6521,11 +6583,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6521
6583
|
* call (async, a class, or one using hooks) falls back to detection from the stream.
|
|
6522
6584
|
*/
|
|
6523
6585
|
async rootLayoutRendersDocument(req) {
|
|
6524
|
-
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access',
|
|
6586
|
+
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access', _267 => _267.routeManager, 'access', _268 => _268.getLayouts, 'call', _269 => _269(), 'access', _270 => _270.get, 'call', _271 => _271("/"), 'optionalAccess', _272 => _272.modulePath]) : void 0)));
|
|
6525
6587
|
if (!modulePath) return false;
|
|
6526
6588
|
try {
|
|
6527
6589
|
const Layout = (await this.routeManager.loadLayoutModule(modulePath)).default;
|
|
6528
|
-
if (typeof Layout !== "function" || _optionalChain([Layout, 'access',
|
|
6590
|
+
if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _273 => _273.prototype, 'optionalAccess', _274 => _274.isReactComponent]) || _optionalChain([Layout, 'access', _275 => _275.constructor, 'optionalAccess', _276 => _276.name]) === "AsyncFunction") {
|
|
6529
6591
|
return false;
|
|
6530
6592
|
}
|
|
6531
6593
|
const cached = documentLayouts.get(Layout);
|
|
@@ -6547,17 +6609,18 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6547
6609
|
}
|
|
6548
6610
|
}
|
|
6549
6611
|
async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6550
|
-
const
|
|
6612
|
+
const runtime = this.rendererRuntime;
|
|
6613
|
+
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (_chunkM6DAIE4Tcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node").web && runtime.renderToReadableStream ? pipeFarmRendererWebStream(runtime) : void 0)));
|
|
6551
6614
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6552
6615
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
|
|
6553
|
-
if (!renderToPipeableStream ||
|
|
6616
|
+
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _277 => _277.headers, 'optionalAccess', _278 => _278[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, this.config.renderer))) {
|
|
6554
6617
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6555
6618
|
}
|
|
6556
6619
|
return new Promise((resolve3, reject) => {
|
|
6557
6620
|
const streamStartTime = Date.now();
|
|
6558
6621
|
const observabilityRoute = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6559
6622
|
const deploymentId = this.getDeploymentId();
|
|
6560
|
-
|
|
6623
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "render.stream.start", route: observabilityRoute });
|
|
6561
6624
|
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
6562
6625
|
for (const [key, value] of Object.entries(options.responseHeaders || {})) {
|
|
6563
6626
|
res.setHeader(key, value);
|
|
@@ -6585,12 +6648,12 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6585
6648
|
let lateNavigationError = null;
|
|
6586
6649
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
6587
6650
|
const isClientComponent = req.__FARM_IS_CLIENT_COMPONENT__ === true;
|
|
6588
|
-
const relativePath = pagePath ?
|
|
6651
|
+
const relativePath = pagePath ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
|
|
6589
6652
|
const clientManifest = this.createDevBootClientManifest(req, options);
|
|
6590
6653
|
const routeSlotPayload = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
6591
6654
|
(slot) => ({
|
|
6592
6655
|
...slot,
|
|
6593
|
-
modulePath: typeof slot.modulePath === "string" ?
|
|
6656
|
+
modulePath: typeof slot.modulePath === "string" ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
|
|
6594
6657
|
})
|
|
6595
6658
|
);
|
|
6596
6659
|
const deferredProps = _chunkDBYNZIIQcjs.prepareDeferredData.call(void 0, {
|
|
@@ -6620,9 +6683,9 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
|
|
|
6620
6683
|
req.__FARM_LOADING_MODULE_PATH__ || null
|
|
6621
6684
|
)};
|
|
6622
6685
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6623
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6686
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkWGWWRV2Mcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6624
6687
|
window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6625
|
-
</script>${
|
|
6688
|
+
</script>${_chunkOZUINP2Pcjs.renderFarmFormStateScript.call(void 0, )}`;
|
|
6626
6689
|
const islandsOnlyPage = this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
|
|
6627
6690
|
const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
|
|
6628
6691
|
const waitingRoot = this.islandValues() && !islandsOnlyPage && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true && rootStrategy !== void 0 && rootStrategy !== "load" ? req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? "root" : "__farm_page__" : null;
|
|
@@ -6636,7 +6699,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6636
6699
|
viewport: viewportTags
|
|
6637
6700
|
} = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6638
6701
|
pathname: getFarmMetadataPathname(req),
|
|
6639
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6702
|
+
jsonLd: _optionalChain([this, 'access', _279 => _279.config, 'access', _280 => _280.agent, 'optionalAccess', _281 => _281.jsonLd])
|
|
6640
6703
|
});
|
|
6641
6704
|
const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6642
6705
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -6645,7 +6708,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6645
6708
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6646
6709
|
) : "";
|
|
6647
6710
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6648
|
-
const themeDocument =
|
|
6711
|
+
const themeDocument = _chunkOFVCWV2Dcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6649
6712
|
this.config.theme,
|
|
6650
6713
|
this.config.basePath,
|
|
6651
6714
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
@@ -6661,10 +6724,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6661
6724
|
const earlyClientScript = bootClient ? createFarmDevBootScript(waitingRoot, rootStrategy) : FARM_DEV_EARLY_CLIENT_SCRIPT;
|
|
6662
6725
|
const { pipe, abort } = renderToPipeableStream(streamRoot, {
|
|
6663
6726
|
nonce: cspNonce,
|
|
6664
|
-
formState:
|
|
6727
|
+
formState: _chunkOZUINP2Pcjs.getFarmFormState.call(void 0, ),
|
|
6665
6728
|
onShellReady() {
|
|
6666
6729
|
if (pendingNavigationError) {
|
|
6667
|
-
_optionalChain([abort, 'optionalCall',
|
|
6730
|
+
_optionalChain([abort, 'optionalCall', _282 => _282(pendingNavigationError)]);
|
|
6668
6731
|
if (clearMiddlewareData) {
|
|
6669
6732
|
clearMiddlewareData();
|
|
6670
6733
|
}
|
|
@@ -6673,7 +6736,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6673
6736
|
}
|
|
6674
6737
|
shellFlushed = true;
|
|
6675
6738
|
const shellReadyMs = Date.now() - streamStartTime;
|
|
6676
|
-
|
|
6739
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
6677
6740
|
type: "render.stream.shellReady",
|
|
6678
6741
|
route: observabilityRoute,
|
|
6679
6742
|
durationMs: shellReadyMs
|
|
@@ -6682,7 +6745,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6682
6745
|
console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
|
|
6683
6746
|
}
|
|
6684
6747
|
const shell = `<!DOCTYPE html>
|
|
6685
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6748
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _283 => _283.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6686
6749
|
<head>
|
|
6687
6750
|
${themeDocument.head}
|
|
6688
6751
|
<meta charset="utf-8">
|
|
@@ -6703,14 +6766,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6703
6766
|
let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
|
|
6704
6767
|
let heldHead = "";
|
|
6705
6768
|
const releaseShell = (complete) => {
|
|
6706
|
-
const split =
|
|
6769
|
+
const split = _chunkOFVCWV2Dcjs.takeFarmHoistedHead.call(void 0, heldHead, complete);
|
|
6707
6770
|
if (!split) return null;
|
|
6708
|
-
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ?
|
|
6709
|
-
const opened =
|
|
6771
|
+
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? _chunkOFVCWV2Dcjs.removeFarmDocumentTitles.call(void 0, pendingShell) : pendingShell;
|
|
6772
|
+
const opened = _chunkOFVCWV2Dcjs.appendFarmHead.call(void 0, shellHead, split.head);
|
|
6710
6773
|
pendingShell = "";
|
|
6711
6774
|
heldHead = "";
|
|
6712
6775
|
htmlParts.push(opened);
|
|
6713
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
6776
|
+
_optionalChain([staticShellParts, 'optionalAccess', _284 => _284.push, 'call', _285 => _285(opened)]);
|
|
6714
6777
|
res.write(opened);
|
|
6715
6778
|
return split.body;
|
|
6716
6779
|
};
|
|
@@ -6722,11 +6785,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6722
6785
|
${stampDocumentHTML(earlyClientScript)}`
|
|
6723
6786
|
)
|
|
6724
6787
|
} : document;
|
|
6725
|
-
const documentTransform = streamDocument ?
|
|
6788
|
+
const documentTransform = streamDocument ? _chunkOFVCWV2Dcjs.createFarmStreamedDocumentTransform.call(void 0,
|
|
6726
6789
|
(opening) => withEarlyClient(
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
hasExplicitTitle ?
|
|
6790
|
+
_chunkOFVCWV2Dcjs.openFarmStreamedDocument.call(void 0,
|
|
6791
|
+
_chunkOFVCWV2Dcjs.markFarmDocumentLayouts.call(void 0,
|
|
6792
|
+
hasExplicitTitle ? _chunkOFVCWV2Dcjs.removeFarmDocumentTitles.call(void 0, opening) : opening
|
|
6730
6793
|
),
|
|
6731
6794
|
{
|
|
6732
6795
|
fallbackIcon: !hasFavicon,
|
|
@@ -6766,7 +6829,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6766
6829
|
const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
|
|
6767
6830
|
if (!checkedFullDocument && renderedText) {
|
|
6768
6831
|
documentPrefix += renderedText;
|
|
6769
|
-
const prefix =
|
|
6832
|
+
const prefix = _chunkOFVCWV2Dcjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
|
|
6770
6833
|
if (prefix !== "pending") {
|
|
6771
6834
|
checkedFullDocument = true;
|
|
6772
6835
|
documentPrefix = "";
|
|
@@ -6785,7 +6848,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6785
6848
|
staticShellClosed = true;
|
|
6786
6849
|
if (!suspenseHoleEmitted) {
|
|
6787
6850
|
suspenseHoleEmitted = true;
|
|
6788
|
-
_optionalChain([options, 'access',
|
|
6851
|
+
_optionalChain([options, 'access', _286 => _286.onSuspenseHoleDetected, 'optionalCall', _287 => _287()]);
|
|
6789
6852
|
}
|
|
6790
6853
|
} else {
|
|
6791
6854
|
staticShellParts.push(chunkText);
|
|
@@ -6837,7 +6900,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6837
6900
|
const body = releaseShell(true);
|
|
6838
6901
|
if (body) {
|
|
6839
6902
|
htmlParts.push(body);
|
|
6840
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
6903
|
+
_optionalChain([staticShellParts, 'optionalAccess', _288 => _288.push, 'call', _289 => _289(body)]);
|
|
6841
6904
|
res.write(body);
|
|
6842
6905
|
}
|
|
6843
6906
|
}
|
|
@@ -6853,7 +6916,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6853
6916
|
finishStream(callback);
|
|
6854
6917
|
},
|
|
6855
6918
|
(error) => {
|
|
6856
|
-
|
|
6919
|
+
_chunk7U4XF76Rcjs.logger.error(`Could not recover from a late navigation error: ${error}`);
|
|
6857
6920
|
finishStream(callback);
|
|
6858
6921
|
}
|
|
6859
6922
|
);
|
|
@@ -6869,8 +6932,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6869
6932
|
recordRenderedChunk(tail, rewritten);
|
|
6870
6933
|
if (tail) res.write(tail);
|
|
6871
6934
|
}
|
|
6872
|
-
const documentEnd = _optionalChain([documentTransform, 'optionalAccess',
|
|
6873
|
-
if (_optionalChain([documentEnd, 'optionalAccess',
|
|
6935
|
+
const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _290 => _290.end, 'call', _291 => _291()]);
|
|
6936
|
+
if (_optionalChain([documentEnd, 'optionalAccess', _292 => _292.text])) {
|
|
6874
6937
|
recordRenderedChunk(documentEnd.text, "");
|
|
6875
6938
|
res.write(documentEnd.text);
|
|
6876
6939
|
}
|
|
@@ -6881,7 +6944,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6881
6944
|
deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
|
|
6882
6945
|
earlyClient,
|
|
6883
6946
|
// A full document: Farm's #root closes only where Farm opened it.
|
|
6884
|
-
..._optionalChain([documentEnd, 'optionalAccess',
|
|
6947
|
+
..._optionalChain([documentEnd, 'optionalAccess', _293 => _293.document]) ? { closeRoot: documentEnd.rootOpened } : {}
|
|
6885
6948
|
})
|
|
6886
6949
|
);
|
|
6887
6950
|
htmlParts.push(footer);
|
|
@@ -6903,10 +6966,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6903
6966
|
}
|
|
6904
6967
|
const cachedHtml = staticShellParts ? staticShellParts.join("") : htmlParts.join("");
|
|
6905
6968
|
Promise.resolve(options.onComplete(cachedHtml)).catch((error) => {
|
|
6906
|
-
|
|
6969
|
+
_chunk7U4XF76Rcjs.logger.warn(`Failed to cache PPR shell: ${error}`);
|
|
6907
6970
|
});
|
|
6908
6971
|
}
|
|
6909
|
-
|
|
6972
|
+
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
6910
6973
|
type: "render.stream.complete",
|
|
6911
6974
|
route: observabilityRoute,
|
|
6912
6975
|
durationMs: Date.now() - streamStartTime
|
|
@@ -6922,7 +6985,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6922
6985
|
onShellError(error) {
|
|
6923
6986
|
didError = true;
|
|
6924
6987
|
if (!isWebResponse(error) && !_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error) && !_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error)) {
|
|
6925
|
-
|
|
6988
|
+
_chunk7U4XF76Rcjs.logger.error(`SSR shell error: ${error}`);
|
|
6926
6989
|
emitFarmRenderError(req, observabilityRoute, error);
|
|
6927
6990
|
}
|
|
6928
6991
|
if (clearMiddlewareData) {
|
|
@@ -6938,7 +7001,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6938
7001
|
return;
|
|
6939
7002
|
}
|
|
6940
7003
|
if (!isWebResponse(error)) {
|
|
6941
|
-
|
|
7004
|
+
_chunk7U4XF76Rcjs.logger.error(`SSR streaming error: ${error}`);
|
|
6942
7005
|
emitFarmRenderError(req, observabilityRoute, error);
|
|
6943
7006
|
}
|
|
6944
7007
|
}
|
|
@@ -6987,13 +7050,13 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6987
7050
|
async loadNotFoundModule() {
|
|
6988
7051
|
const notFoundPath = resolveFarmNotFoundComponentPath(
|
|
6989
7052
|
this.config,
|
|
6990
|
-
|
|
7053
|
+
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config)
|
|
6991
7054
|
);
|
|
6992
7055
|
if (!notFoundPath) return null;
|
|
6993
7056
|
return await this.routeManager.loadRouteModule(notFoundPath);
|
|
6994
7057
|
}
|
|
6995
7058
|
async loadNotFoundComponent() {
|
|
6996
|
-
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async
|
|
7059
|
+
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _294 => _294.default]), async () => ( null));
|
|
6997
7060
|
}
|
|
6998
7061
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
6999
7062
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
@@ -7016,13 +7079,13 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7016
7079
|
*/
|
|
7017
7080
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7018
7081
|
if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
|
|
7019
|
-
return
|
|
7082
|
+
return _chunkOFVCWV2Dcjs.createLateRedirectRecovery.call(void 0,
|
|
7020
7083
|
this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
|
|
7021
7084
|
this.getCspNonce(req) || ""
|
|
7022
7085
|
);
|
|
7023
7086
|
}
|
|
7024
7087
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7025
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7088
|
+
trustProxy: _optionalChain([this, 'access', _295 => _295.config, 'access', _296 => _296.server, 'optionalAccess', _297 => _297.trustProxy])
|
|
7026
7089
|
}).pathname;
|
|
7027
7090
|
let content = this.defaultNotFoundContent();
|
|
7028
7091
|
const NotFoundComponent = await this.loadNotFoundComponent();
|
|
@@ -7034,17 +7097,17 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7034
7097
|
)
|
|
7035
7098
|
);
|
|
7036
7099
|
} catch (error2) {
|
|
7037
|
-
|
|
7100
|
+
_chunk7U4XF76Rcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7038
7101
|
}
|
|
7039
7102
|
}
|
|
7040
|
-
return
|
|
7103
|
+
return _chunkOFVCWV2Dcjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
|
|
7041
7104
|
}
|
|
7042
7105
|
async render404(req, res) {
|
|
7043
7106
|
res.statusCode = 404;
|
|
7044
7107
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7045
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7108
|
+
trustProxy: _optionalChain([this, 'access', _298 => _298.config, 'access', _299 => _299.server, 'optionalAccess', _300 => _300.trustProxy])
|
|
7046
7109
|
}).pathname;
|
|
7047
|
-
if (
|
|
7110
|
+
if (_chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7048
7111
|
res.setHeader("Content-Type", "application/json");
|
|
7049
7112
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
7050
7113
|
return;
|
|
@@ -7059,15 +7122,15 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7059
7122
|
}
|
|
7060
7123
|
const acceptHeader = req.headers.accept;
|
|
7061
7124
|
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
7062
|
-
if (
|
|
7063
|
-
res.setHeader("Content-Type",
|
|
7125
|
+
if (_chunk2NOHVIJ3cjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
|
|
7126
|
+
res.setHeader("Content-Type", _chunk2NOHVIJ3cjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
7064
7127
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
7065
7128
|
res.setHeader("Cache-Control", "no-store");
|
|
7066
|
-
res.end(
|
|
7129
|
+
res.end(_chunk2NOHVIJ3cjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
|
|
7067
7130
|
return;
|
|
7068
7131
|
}
|
|
7069
7132
|
const appDir = path10.join(this.config.root, this.config.srcDir, "app");
|
|
7070
|
-
const notFoundExtensions =
|
|
7133
|
+
const notFoundExtensions = _chunkM6DAIE4Tcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7071
7134
|
let layoutModule = null;
|
|
7072
7135
|
try {
|
|
7073
7136
|
for (const ext of notFoundExtensions) {
|
|
@@ -7079,13 +7142,13 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7079
7142
|
}
|
|
7080
7143
|
const notFoundPath = resolveFarmNotFoundComponentPath(
|
|
7081
7144
|
this.config,
|
|
7082
|
-
|
|
7145
|
+
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config)
|
|
7083
7146
|
);
|
|
7084
7147
|
if (notFoundPath) {
|
|
7085
7148
|
const notFoundModule = await this.loadNotFoundModule();
|
|
7086
|
-
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess',
|
|
7149
|
+
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _301 => _301.default]), () => ( null));
|
|
7087
7150
|
if (NotFoundComponent) {
|
|
7088
|
-
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess',
|
|
7151
|
+
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _302 => _302.default]), () => ( null));
|
|
7089
7152
|
let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
|
|
7090
7153
|
if (LayoutComponent) {
|
|
7091
7154
|
element = this.rendererRuntime.createElement(LayoutComponent, {
|
|
@@ -7122,23 +7185,23 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7122
7185
|
res.statusCode = statusCode;
|
|
7123
7186
|
const isDev = process.env.NODE_ENV === "development";
|
|
7124
7187
|
const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7125
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7188
|
+
trustProxy: _optionalChain([this, 'access', _303 => _303.config, 'access', _304 => _304.server, 'optionalAccess', _305 => _305.trustProxy])
|
|
7126
7189
|
});
|
|
7127
7190
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7128
|
-
const statusText =
|
|
7191
|
+
const statusText = _chunkOFVCWV2Dcjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7129
7192
|
const content = this.stampFarmScripts(
|
|
7130
7193
|
req,
|
|
7131
|
-
|
|
7194
|
+
_chunkOFVCWV2Dcjs.createDefaultErrorMarkup.call(void 0, {
|
|
7132
7195
|
statusCode,
|
|
7133
7196
|
statusText,
|
|
7134
7197
|
requestPath: requestUrl.pathname,
|
|
7135
7198
|
method: req.method || "GET",
|
|
7136
|
-
message: _optionalChain([diagnostics, 'optionalAccess',
|
|
7137
|
-
errorName: _optionalChain([diagnostics, 'optionalAccess',
|
|
7138
|
-
stack: _optionalChain([diagnostics, 'optionalAccess',
|
|
7139
|
-
sourceFrame: _optionalChain([diagnostics, 'optionalAccess',
|
|
7199
|
+
message: _optionalChain([diagnostics, 'optionalAccess', _306 => _306.message]),
|
|
7200
|
+
errorName: _optionalChain([diagnostics, 'optionalAccess', _307 => _307.name]),
|
|
7201
|
+
stack: _optionalChain([diagnostics, 'optionalAccess', _308 => _308.stack]),
|
|
7202
|
+
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _309 => _309.sourceFrame]),
|
|
7140
7203
|
development: isDev,
|
|
7141
|
-
farmVersion:
|
|
7204
|
+
farmVersion: _chunkNSLRK5DKcjs.FARM_VERSION,
|
|
7142
7205
|
nodeVersion: process.version,
|
|
7143
7206
|
mode: isDev ? "development" : "production"
|
|
7144
7207
|
})
|
|
@@ -7164,9 +7227,9 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7164
7227
|
*/
|
|
7165
7228
|
getI18nAlternateOptions(req, metadata) {
|
|
7166
7229
|
return {
|
|
7167
|
-
metadataBase: _optionalChain([metadata, 'optionalAccess',
|
|
7168
|
-
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7169
|
-
languages: _optionalChain([metadata, 'optionalAccess',
|
|
7230
|
+
metadataBase: _optionalChain([metadata, 'optionalAccess', _310 => _310.metadataBase]),
|
|
7231
|
+
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _311 => _311.config, 'access', _312 => _312.server, 'optionalAccess', _313 => _313.trustProxy]) }).origin : void 0,
|
|
7232
|
+
languages: _optionalChain([metadata, 'optionalAccess', _314 => _314.alternates, 'optionalAccess', _315 => _315.languages])
|
|
7170
7233
|
};
|
|
7171
7234
|
}
|
|
7172
7235
|
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
|
|
@@ -7176,7 +7239,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7176
7239
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
7177
7240
|
const integrationManifestScript = farmScripts(`<script>
|
|
7178
7241
|
window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
|
|
7179
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
7242
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkWGWWRV2Mcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
7180
7243
|
${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
|
|
7181
7244
|
</script>`);
|
|
7182
7245
|
const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -7185,20 +7248,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7185
7248
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7186
7249
|
) : "";
|
|
7187
7250
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7188
|
-
const themeDocument =
|
|
7251
|
+
const themeDocument = _chunkOFVCWV2Dcjs.createFarmThemeDocumentParts.call(void 0,
|
|
7189
7252
|
this.config.theme,
|
|
7190
7253
|
this.config.basePath,
|
|
7191
7254
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
7192
7255
|
);
|
|
7193
7256
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
7194
7257
|
const rendererHydrationScript = farmScripts(
|
|
7195
|
-
_optionalChain([this, 'access',
|
|
7258
|
+
_optionalChain([this, 'access', _316 => _316.rendererRuntime, 'access', _317 => _317.generateHydrationScript, 'optionalCall', _318 => _318()]) || ""
|
|
7196
7259
|
);
|
|
7197
|
-
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access',
|
|
7198
|
-
const fullDocument =
|
|
7260
|
+
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _319 => _319.metadata, 'optionalAccess', _320 => _320.viewport]));
|
|
7261
|
+
const fullDocument = _chunkOFVCWV2Dcjs.extractFarmFullDocument.call(void 0, _chunkOFVCWV2Dcjs.markFarmDocumentLayouts.call(void 0, content));
|
|
7199
7262
|
if (fullDocument) {
|
|
7200
|
-
return
|
|
7201
|
-
metadataHead ?
|
|
7263
|
+
return _chunkOFVCWV2Dcjs.composeFarmFullDocument.call(void 0,
|
|
7264
|
+
metadataHead ? _chunkOFVCWV2Dcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
|
|
7202
7265
|
{
|
|
7203
7266
|
fallbackIcon: !metadataHead,
|
|
7204
7267
|
viewport: viewportTags,
|
|
@@ -7224,7 +7287,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7224
7287
|
);
|
|
7225
7288
|
}
|
|
7226
7289
|
return `<!DOCTYPE html>
|
|
7227
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
7290
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _321 => _321.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
7228
7291
|
<head>
|
|
7229
7292
|
${themeDocument.head}
|
|
7230
7293
|
<meta charset="utf-8">
|
|
@@ -7265,7 +7328,7 @@ ${clientScript}
|
|
|
7265
7328
|
const deploymentId = this.getDeploymentId();
|
|
7266
7329
|
res.setHeader(_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
|
|
7267
7330
|
if ((req.method || "GET").toUpperCase() !== "GET") return;
|
|
7268
|
-
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7331
|
+
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _322 => _322.config, 'access', _323 => _323.server, 'optionalAccess', _324 => _324.trustProxy]) }).protocol === "https:";
|
|
7269
7332
|
const cookie = _chunkNLBHLPEOcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
|
|
7270
7333
|
const existing = res.getHeader("Set-Cookie");
|
|
7271
7334
|
if (Array.isArray(existing)) {
|
|
@@ -7305,7 +7368,7 @@ function isResolvedDocsConfig(value) {
|
|
|
7305
7368
|
var FarmApp = class {
|
|
7306
7369
|
constructor(config = {}, viteServer) {
|
|
7307
7370
|
this.config = this.normalizeConfig(config);
|
|
7308
|
-
|
|
7371
|
+
_chunkPLJMEUANcjs.configureFarmObservability.call(void 0, this.config.observability);
|
|
7309
7372
|
_chunk5AMH6AFAcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
|
|
7310
7373
|
this.i18nRuntime = _chunkSXXSQVKKcjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
|
|
7311
7374
|
_chunkSXXSQVKKcjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
|
|
@@ -7320,18 +7383,18 @@ var FarmApp = class {
|
|
|
7320
7383
|
}
|
|
7321
7384
|
async initialize() {
|
|
7322
7385
|
if (process.env.FARM_VERBOSE) {
|
|
7323
|
-
|
|
7386
|
+
_chunk7U4XF76Rcjs.logger.info("Initializing Farm.js application...");
|
|
7324
7387
|
}
|
|
7325
|
-
await
|
|
7326
|
-
await
|
|
7388
|
+
await _chunkNW3DL2PMcjs.initStorage.call(void 0, this.config.storage);
|
|
7389
|
+
await _chunkBIAGSYIZcjs.configureFarmCache.call(void 0, this.config.cache);
|
|
7327
7390
|
await this.i18nRuntime.initialize();
|
|
7328
7391
|
await this.serverRenderer.initialize();
|
|
7329
7392
|
await this.verifyAppStructure();
|
|
7330
7393
|
await this.routeManager.discoverRoutes();
|
|
7331
|
-
if (
|
|
7394
|
+
if (_chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
|
|
7332
7395
|
this.routeManager.generateClientManifest(this.config.root);
|
|
7333
7396
|
if (process.env.FARM_VERBOSE) {
|
|
7334
|
-
|
|
7397
|
+
_chunk7U4XF76Rcjs.logger.success("Farm.js application initialized successfully!");
|
|
7335
7398
|
}
|
|
7336
7399
|
}
|
|
7337
7400
|
getRouteManager() {
|
|
@@ -7357,7 +7420,7 @@ var FarmApp = class {
|
|
|
7357
7420
|
outDir: config.outDir || "dist",
|
|
7358
7421
|
basePath,
|
|
7359
7422
|
trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
|
|
7360
|
-
renderer:
|
|
7423
|
+
renderer: _chunkM6DAIE4Tcjs.resolveFarmRenderer.call(void 0, config.renderer),
|
|
7361
7424
|
preset: _nullishCoalesce(config.preset, () => ( "node-server")),
|
|
7362
7425
|
deploy: config.deploy || {},
|
|
7363
7426
|
storage: config.storage || {},
|
|
@@ -7367,8 +7430,8 @@ var FarmApp = class {
|
|
|
7367
7430
|
integrations: config.integrations || {},
|
|
7368
7431
|
plugins: config.plugins || [],
|
|
7369
7432
|
migrations: config.migrations || { commands: [] },
|
|
7370
|
-
cron:
|
|
7371
|
-
workflows:
|
|
7433
|
+
cron: _chunk5ZHC6QGDcjs.resolveCronConfig.call(void 0, config.cron),
|
|
7434
|
+
workflows: _chunkBSX5OGSDcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
|
|
7372
7435
|
api: normalizeFarmAppAPIConfig(config.api),
|
|
7373
7436
|
middleware: config.middleware || {},
|
|
7374
7437
|
routeRules: _chunkIIHZ2BEEcjs.normalizeRouteRules.call(void 0, config.routeRules),
|
|
@@ -7378,9 +7441,9 @@ var FarmApp = class {
|
|
|
7378
7441
|
security: _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7379
7442
|
images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
|
|
7380
7443
|
config.images,
|
|
7381
|
-
|
|
7444
|
+
_chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
7382
7445
|
),
|
|
7383
|
-
performance:
|
|
7446
|
+
performance: _chunk4OFWG4IKcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7384
7447
|
theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
7385
7448
|
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkZMSVKVI3cjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
|
|
7386
7449
|
root,
|
|
@@ -7392,7 +7455,7 @@ var FarmApp = class {
|
|
|
7392
7455
|
serverRuntimeConfig: config.serverRuntimeConfig || {},
|
|
7393
7456
|
publicRuntimeConfig: config.publicRuntimeConfig || {},
|
|
7394
7457
|
docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
|
|
7395
|
-
md:
|
|
7458
|
+
md: _chunk2NOHVIJ3cjs.resolveMarkdownConfig.call(void 0, config.md),
|
|
7396
7459
|
mdx: _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx),
|
|
7397
7460
|
observability: _nullishCoalesce(config.observability, () => ( false)),
|
|
7398
7461
|
telemetry: config.telemetry !== false,
|
|
@@ -7408,10 +7471,10 @@ var FarmApp = class {
|
|
|
7408
7471
|
env: config.env || { server: {}, public: {} },
|
|
7409
7472
|
suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
|
|
7410
7473
|
experimental: {
|
|
7411
|
-
serverComponents: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7412
|
-
serverActions: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7413
|
-
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7414
|
-
ppr: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7474
|
+
serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _325 => _325.experimental, 'optionalAccess', _326 => _326.serverComponents]), () => ( false)),
|
|
7475
|
+
serverActions: _nullishCoalesce(_optionalChain([config, 'access', _327 => _327.experimental, 'optionalAccess', _328 => _328.serverActions]), () => ( false)),
|
|
7476
|
+
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _329 => _329.experimental, 'optionalAccess', _330 => _330.isolatedClientHydration]), () => ( "off")),
|
|
7477
|
+
ppr: _nullishCoalesce(_optionalChain([config, 'access', _331 => _331.experimental, 'optionalAccess', _332 => _332.ppr]), () => ( false)),
|
|
7415
7478
|
...config.experimental
|
|
7416
7479
|
},
|
|
7417
7480
|
agent: _nullishCoalesce(config.agent, () => ( {})),
|
|
@@ -7431,31 +7494,31 @@ var FarmApp = class {
|
|
|
7431
7494
|
);
|
|
7432
7495
|
}
|
|
7433
7496
|
async verifyAppStructure() {
|
|
7434
|
-
const appDirs =
|
|
7435
|
-
const hasAppDirectory = (await Promise.all(appDirs.map((appDir) =>
|
|
7497
|
+
const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config);
|
|
7498
|
+
const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunk7U4XF76Rcjs.fileExists.call(void 0, appDir)))).some(
|
|
7436
7499
|
Boolean
|
|
7437
7500
|
);
|
|
7438
7501
|
if (!hasAppDirectory) {
|
|
7439
|
-
const routeFiles =
|
|
7440
|
-
(source) =>
|
|
7502
|
+
const routeFiles = _chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
|
|
7503
|
+
(source) => _chunkHS4JPIGRcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
|
|
7441
7504
|
);
|
|
7442
7505
|
if (routeFiles.length > 0) {
|
|
7443
7506
|
return;
|
|
7444
7507
|
}
|
|
7445
|
-
const appDir =
|
|
7508
|
+
const appDir = _chunk7U4XF76Rcjs.resolveAppPath.call(void 0, this.config.root, this.config.srcDir, "app");
|
|
7446
7509
|
throw new Error(
|
|
7447
7510
|
`App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
|
|
7448
7511
|
);
|
|
7449
7512
|
}
|
|
7450
|
-
const componentExtensions =
|
|
7513
|
+
const componentExtensions = _chunkM6DAIE4Tcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7451
7514
|
const rootLayoutPaths = appDirs.flatMap(
|
|
7452
7515
|
(appDir) => componentExtensions.map((extension) => path4.default.join(appDir, `layout${extension}`))
|
|
7453
7516
|
);
|
|
7454
|
-
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) =>
|
|
7517
|
+
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunk7U4XF76Rcjs.fileExists.call(void 0, p))).then(
|
|
7455
7518
|
(results) => results.some(Boolean)
|
|
7456
7519
|
);
|
|
7457
|
-
if (!hasRootLayout && !
|
|
7458
|
-
|
|
7520
|
+
if (!hasRootLayout && !_chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7521
|
+
_chunk7U4XF76Rcjs.logger.warn(
|
|
7459
7522
|
`No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
|
|
7460
7523
|
);
|
|
7461
7524
|
}
|
|
@@ -7470,7 +7533,7 @@ function isResolvedAuthConfig(value) {
|
|
|
7470
7533
|
);
|
|
7471
7534
|
}
|
|
7472
7535
|
function normalizeFarmAppAPIConfig(config) {
|
|
7473
|
-
if (typeof _optionalChain([config, 'optionalAccess',
|
|
7536
|
+
if (typeof _optionalChain([config, 'optionalAccess', _333 => _333.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _334 => _334.basePath]) === "function") {
|
|
7474
7537
|
throw new Error(
|
|
7475
7538
|
"Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
|
|
7476
7539
|
);
|
|
@@ -7485,7 +7548,7 @@ function createFarmApp(config, viteServer) {
|
|
|
7485
7548
|
var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
|
|
7486
7549
|
var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
|
|
7487
7550
|
function resolveFarmImageProviderForRuntime(images, options) {
|
|
7488
|
-
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess',
|
|
7551
|
+
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _335 => _335.provider]), () => ( "auto"));
|
|
7489
7552
|
if (provider === "none") return images;
|
|
7490
7553
|
const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
|
|
7491
7554
|
if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
|
|
@@ -7494,7 +7557,7 @@ function resolveFarmImageProviderForRuntime(images, options) {
|
|
|
7494
7557
|
`images.provider "node" optimizes images with sharp, which is not installed. ${SHARP_INSTALL_HINT}`
|
|
7495
7558
|
);
|
|
7496
7559
|
}
|
|
7497
|
-
|
|
7560
|
+
_chunk7U4XF76Rcjs.logger.info(
|
|
7498
7561
|
`Image optimization is off because sharp is not installed; images use their original URLs. ${SHARP_INSTALL_HINT}, or set images.provider to "none".`
|
|
7499
7562
|
);
|
|
7500
7563
|
return Object.freeze({ ...images, provider: "none" });
|
|
@@ -7626,9 +7689,9 @@ function staticValue(node) {
|
|
|
7626
7689
|
}
|
|
7627
7690
|
}
|
|
7628
7691
|
function property(object, name) {
|
|
7629
|
-
return _optionalChain([object, 'access',
|
|
7692
|
+
return _optionalChain([object, 'access', _336 => _336.properties, 'access', _337 => _337.find, 'call', _338 => _338(
|
|
7630
7693
|
(entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
|
|
7631
|
-
), 'optionalAccess',
|
|
7694
|
+
), 'optionalAccess', _339 => _339.value]);
|
|
7632
7695
|
}
|
|
7633
7696
|
function toolFromObject(object) {
|
|
7634
7697
|
const name = staticValue(property(object, "name"));
|
|
@@ -7674,7 +7737,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7674
7737
|
if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
|
|
7675
7738
|
continue;
|
|
7676
7739
|
for (const specifier of statement.specifiers) {
|
|
7677
|
-
const imported = _nullishCoalesce(_optionalChain([specifier, 'access',
|
|
7740
|
+
const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _340 => _340.imported, 'optionalAccess', _341 => _341.name]), () => ( _optionalChain([specifier, 'access', _342 => _342.imported, 'optionalAccess', _343 => _343.value])));
|
|
7678
7741
|
if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
|
|
7679
7742
|
locals.set(specifier.local.name, imported);
|
|
7680
7743
|
}
|
|
@@ -7690,7 +7753,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7690
7753
|
const [argument] = current.arguments;
|
|
7691
7754
|
if (definer && argument) {
|
|
7692
7755
|
const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
|
|
7693
|
-
(element) => _optionalChain([element, 'optionalAccess',
|
|
7756
|
+
(element) => _optionalChain([element, 'optionalAccess', _344 => _344.type]) === "ObjectExpression"
|
|
7694
7757
|
) : [] : argument.type === "ObjectExpression" ? [argument] : [];
|
|
7695
7758
|
for (const object of objects) {
|
|
7696
7759
|
const tool = toolFromObject(object);
|
|
@@ -7751,8 +7814,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
7751
7814
|
|
|
7752
7815
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
7753
7816
|
function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
7754
|
-
const client = _optionalChain([cache2, 'optionalAccess',
|
|
7755
|
-
const adapter = _optionalChain([client, 'optionalAccess',
|
|
7817
|
+
const client = _optionalChain([cache2, 'optionalAccess', _345 => _345.client]);
|
|
7818
|
+
const adapter = _optionalChain([client, 'optionalAccess', _346 => _346.adapter]);
|
|
7756
7819
|
if (adapter === void 0) return void 0;
|
|
7757
7820
|
if (typeof adapter !== "string" || adapter.trim().length === 0) {
|
|
7758
7821
|
throw new Error(
|
|
@@ -7767,8 +7830,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
|
7767
7830
|
);
|
|
7768
7831
|
}
|
|
7769
7832
|
const options = {};
|
|
7770
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
7771
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
7833
|
+
if (_optionalChain([client, 'optionalAccess', _347 => _347.version]) !== void 0) options.version = client.version;
|
|
7834
|
+
if (_optionalChain([client, 'optionalAccess', _348 => _348.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
|
|
7772
7835
|
return { importPath: found.replace(/\\/g, "/"), options };
|
|
7773
7836
|
}
|
|
7774
7837
|
function resolveAdapterFile(resolved) {
|
|
@@ -8071,6 +8134,35 @@ async function readFarmNavigationStream(body, flushToken) {
|
|
|
8071
8134
|
cancel: function() { reader.cancel().catch(function() {}); },
|
|
8072
8135
|
};
|
|
8073
8136
|
}`;
|
|
8137
|
+
var FARM_EARLY_NAVIGATION_SOURCE = `// The request the boot script sent for a link clicked before the router ran (islands-boot.ts).
|
|
8138
|
+
// The next navigation request takes its response when it is the same request, and aborts it
|
|
8139
|
+
// otherwise. The held island values may differ: a response for fewer of them carries more values,
|
|
8140
|
+
// which fits any page. As with a prefetched page, a response sent over 30 seconds ago is not used.
|
|
8141
|
+
function takeFarmEarlyNavigation(url, headers, signal) {
|
|
8142
|
+
const early = window.__FARM_EARLY_NAVIGATION__;
|
|
8143
|
+
if (!early) return null;
|
|
8144
|
+
window.__FARM_EARLY_NAVIGATION__ = undefined;
|
|
8145
|
+
const target = new URL(url, window.location.href);
|
|
8146
|
+
const requested = new URL(early.url, window.location.href);
|
|
8147
|
+
target.hash = "";
|
|
8148
|
+
requested.hash = "";
|
|
8149
|
+
let same = target.href === requested.href && Date.now() - early.at <= 30000 && !(signal && signal.aborted);
|
|
8150
|
+
const names = new Set(Object.keys(early.headers));
|
|
8151
|
+
headers.forEach(function(value, name) { names.add(name); });
|
|
8152
|
+
names.forEach(function(name) {
|
|
8153
|
+
const sent = Object.prototype.hasOwnProperty.call(early.headers, name) ? early.headers[name] : null;
|
|
8154
|
+
// A whole page answers a request for a streamed one, as a response without flush markers is
|
|
8155
|
+
// all shell. The boot asks for it whole from under a layout that hydrates as one root.
|
|
8156
|
+
if (name === "f-values" || (name === "f-stream" && sent === null)) return;
|
|
8157
|
+
if (sent !== headers.get(name)) same = false;
|
|
8158
|
+
});
|
|
8159
|
+
if (!same) {
|
|
8160
|
+
early.controller.abort();
|
|
8161
|
+
return null;
|
|
8162
|
+
}
|
|
8163
|
+
if (signal) signal.addEventListener("abort", function() { early.controller.abort(); }, { once: true });
|
|
8164
|
+
return early.response;
|
|
8165
|
+
}`;
|
|
8074
8166
|
|
|
8075
8167
|
// src/client/refresh-fields.ts
|
|
8076
8168
|
var FARM_REFRESH_FIELDS_SOURCE = `// The server-rendered fields of a tree: islands keep their own.
|
|
@@ -8187,7 +8279,7 @@ function redactFarmDocsClientConfig(code, filename) {
|
|
|
8187
8279
|
const current = node;
|
|
8188
8280
|
if (current.type === "Property") {
|
|
8189
8281
|
const name = propertyKeyName(current);
|
|
8190
|
-
const valueType = _optionalChain([current, 'access',
|
|
8282
|
+
const valueType = _optionalChain([current, 'access', _349 => _349.value, 'optionalAccess', _350 => _350.type]);
|
|
8191
8283
|
const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkSM2SYWARcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
|
|
8192
8284
|
if (name && credential) {
|
|
8193
8285
|
edits.push(
|
|
@@ -8230,7 +8322,7 @@ function farmDocsClientConfigPlugin(configModule) {
|
|
|
8230
8322
|
// Never matches without a docs config module, so the bundler never calls the handler.
|
|
8231
8323
|
filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
|
|
8232
8324
|
handler(code, id, options) {
|
|
8233
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
8325
|
+
if (_optionalChain([options, 'optionalAccess', _351 => _351.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
|
|
8234
8326
|
const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
|
|
8235
8327
|
return redacted === null ? null : { code: redacted, map: null };
|
|
8236
8328
|
}
|
|
@@ -8304,14 +8396,43 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
|
8304
8396
|
"@farm.js/core/query/client",
|
|
8305
8397
|
"@farm.js/core/server-fn/client",
|
|
8306
8398
|
"@farm.js/core/server-query/client",
|
|
8399
|
+
// Farm's browser entry imports these and no app file does, so Vite's scan cannot see them. In an
|
|
8400
|
+
// app that installs Farm from the registry, Vite found them on the first page request, bundled
|
|
8401
|
+
// again, and reloaded the page while it loaded.
|
|
8402
|
+
"@farm.js/core/internal/client-runtime",
|
|
8403
|
+
"@farm.js/core/internal/spa-router",
|
|
8404
|
+
"@farm.js/core/router",
|
|
8405
|
+
// The typed API client. The development server excludes the server-only `@farm.js/core/api`,
|
|
8406
|
+
// and Vite's scan skips every subpath of an excluded package, so an app's import of the client
|
|
8407
|
+
// was also found only on the first request.
|
|
8408
|
+
"@farm.js/core/api/client",
|
|
8307
8409
|
// Islands mode's browser runtime: Farm imports islx, which the app reaches only through Farm.
|
|
8308
8410
|
"@farm.js/core > @farm.js/islx/client",
|
|
8309
8411
|
"@farm.js/core > @farm.js/islx/react",
|
|
8310
|
-
"@farm.js/core > @farm.js/islx/react/client"
|
|
8412
|
+
"@farm.js/core > @farm.js/islx/react/client",
|
|
8413
|
+
// What a browser module's import of a server function compiles to on other renderers (see
|
|
8414
|
+
// `resolveFarmIslxActionsMode`). Found only when that module is first requested, it made Vite
|
|
8415
|
+
// bundle again and reload the page while it loaded.
|
|
8416
|
+
"@farm.js/core/internal/islx-actions-client"
|
|
8311
8417
|
];
|
|
8312
|
-
function
|
|
8418
|
+
function isInstalledPackage(root, specifier) {
|
|
8419
|
+
const parts = specifier.split("/");
|
|
8420
|
+
const name = specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
|
|
8421
|
+
const directory = _chunkBBVLOENDcjs.findFarmAppPackageDir.call(void 0, root, name);
|
|
8422
|
+
return directory !== void 0 && directory.split(path4.default.sep).includes("node_modules");
|
|
8423
|
+
}
|
|
8424
|
+
function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
8313
8425
|
return Array.from(
|
|
8314
|
-
/* @__PURE__ */ new Set([
|
|
8426
|
+
/* @__PURE__ */ new Set([
|
|
8427
|
+
...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE,
|
|
8428
|
+
..._optionalChain([renderer, 'optionalAccess', _352 => _352.optimizeDeps]) || [],
|
|
8429
|
+
// Farm's browser entry imports a renderer's client module, and no app file does, so Vite's
|
|
8430
|
+
// scan never sees it and finds it only on the first page request, then bundles again. The
|
|
8431
|
+
// React entry imports `react-dom/client` instead, which is already listed. A linked
|
|
8432
|
+
// renderer stays source: pre-bundling it would copy the packages it shares with the app's
|
|
8433
|
+
// components into the bundle, so a hook would read a different copy than the renderer set.
|
|
8434
|
+
...renderer && root && !_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) && _chunkPWDBWXQIcjs.isPackageSpecifier.call(void 0, renderer.client) && isInstalledPackage(root, renderer.client) ? [renderer.client] : []
|
|
8435
|
+
])
|
|
8315
8436
|
);
|
|
8316
8437
|
}
|
|
8317
8438
|
function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
@@ -8322,8 +8443,9 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
|
8322
8443
|
return `${prefix}/${FARM_CLIENT_ENTRY_PATTERN}`;
|
|
8323
8444
|
});
|
|
8324
8445
|
}
|
|
8325
|
-
function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
8326
|
-
if (
|
|
8446
|
+
function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
8447
|
+
if (_chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, renderer)) return { noDiscovery: true, include: [] };
|
|
8448
|
+
const jsxImportSource = renderer ? renderer.jsxImportSource : void 0;
|
|
8327
8449
|
return {
|
|
8328
8450
|
// Keep normal application dependency discovery for CJS-only packages, but
|
|
8329
8451
|
// seed every Farm browser runtime so React is present in the first crawl.
|
|
@@ -8331,11 +8453,20 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
|
8331
8453
|
// Waiting for the crawl avoids serving a partial optimizer generation and
|
|
8332
8454
|
// then changing browser hashes while hydration is already in progress.
|
|
8333
8455
|
holdUntilCrawlEnd: true,
|
|
8334
|
-
include: getFarmClientOptimizeDepsInclude(renderer || void 0),
|
|
8456
|
+
include: getFarmClientOptimizeDepsInclude(renderer || void 0, root),
|
|
8335
8457
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
8336
8458
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
8337
8459
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
8338
|
-
..._optionalChain([entries, 'optionalAccess',
|
|
8460
|
+
..._optionalChain([entries, 'optionalAccess', _353 => _353.length]) ? { entries: [...entries] } : {},
|
|
8461
|
+
// Vite's dependency scan compiles JSX on its own: with the app tsconfig's `jsxImportSource`
|
|
8462
|
+
// when there is one, otherwise as React, whatever the renderer's plugin set for its own
|
|
8463
|
+
// transforms. React is the default already, and naming it here would override a tsconfig
|
|
8464
|
+
// source such as Emotion's. A renderer plugin's own scan setting is merged over this one.
|
|
8465
|
+
...jsxImportSource && jsxImportSource !== "react" ? {
|
|
8466
|
+
rolldownOptions: {
|
|
8467
|
+
transform: { jsx: { runtime: "automatic", importSource: jsxImportSource } }
|
|
8468
|
+
}
|
|
8469
|
+
} : {}
|
|
8339
8470
|
};
|
|
8340
8471
|
}
|
|
8341
8472
|
function createFarmSourceAlias(projectRoot, srcDir = "src") {
|
|
@@ -8367,8 +8498,8 @@ function mergeFarmViteAlias(farmValue, userValue) {
|
|
|
8367
8498
|
return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
|
|
8368
8499
|
}
|
|
8369
8500
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
8370
|
-
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8371
|
-
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8501
|
+
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _354 => _354.optimizeDeps, 'optionalAccess', _355 => _355.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _356 => _356.optimizeDeps, 'optionalAccess', _357 => _357.noDiscovery])));
|
|
8502
|
+
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _358 => _358.optimizeDeps, 'optionalAccess', _359 => _359.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _360 => _360.optimizeDeps, 'optionalAccess', _361 => _361.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _362 => _362.optimizeDeps, 'optionalAccess', _363 => _363.holdUntilCrawlEnd]))));
|
|
8372
8503
|
return {
|
|
8373
8504
|
...farmConfig,
|
|
8374
8505
|
...userConfig,
|
|
@@ -8380,9 +8511,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8380
8511
|
resolve: {
|
|
8381
8512
|
...farmConfig.resolve,
|
|
8382
8513
|
...userConfig.resolve,
|
|
8383
|
-
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access',
|
|
8514
|
+
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _364 => _364.resolve, 'optionalAccess', _365 => _365.alias]), _optionalChain([userConfig, 'access', _366 => _366.resolve, 'optionalAccess', _367 => _367.alias])),
|
|
8384
8515
|
dedupe: Array.from(
|
|
8385
|
-
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access',
|
|
8516
|
+
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _368 => _368.resolve, 'optionalAccess', _369 => _369.dedupe]) || [], ..._optionalChain([userConfig, 'access', _370 => _370.resolve, 'optionalAccess', _371 => _371.dedupe]) || []])
|
|
8386
8517
|
)
|
|
8387
8518
|
},
|
|
8388
8519
|
optimizeDeps: {
|
|
@@ -8392,21 +8523,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8392
8523
|
holdUntilCrawlEnd,
|
|
8393
8524
|
include: Array.from(
|
|
8394
8525
|
/* @__PURE__ */ new Set([
|
|
8395
|
-
..._optionalChain([farmConfig, 'access',
|
|
8396
|
-
..._optionalChain([userConfig, 'access',
|
|
8526
|
+
..._optionalChain([farmConfig, 'access', _372 => _372.optimizeDeps, 'optionalAccess', _373 => _373.include]) || [],
|
|
8527
|
+
..._optionalChain([userConfig, 'access', _374 => _374.optimizeDeps, 'optionalAccess', _375 => _375.include]) || []
|
|
8397
8528
|
])
|
|
8398
8529
|
),
|
|
8399
8530
|
exclude: Array.from(
|
|
8400
8531
|
/* @__PURE__ */ new Set([
|
|
8401
|
-
..._optionalChain([farmConfig, 'access',
|
|
8402
|
-
..._optionalChain([userConfig, 'access',
|
|
8532
|
+
..._optionalChain([farmConfig, 'access', _376 => _376.optimizeDeps, 'optionalAccess', _377 => _377.exclude]) || [],
|
|
8533
|
+
..._optionalChain([userConfig, 'access', _378 => _378.optimizeDeps, 'optionalAccess', _379 => _379.exclude]) || []
|
|
8403
8534
|
])
|
|
8404
8535
|
)
|
|
8405
8536
|
},
|
|
8406
8537
|
ssr: {
|
|
8407
8538
|
...farmConfig.ssr,
|
|
8408
8539
|
...userConfig.ssr,
|
|
8409
|
-
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access',
|
|
8540
|
+
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _380 => _380.ssr, 'optionalAccess', _381 => _381.noExternal]), _optionalChain([userConfig, 'access', _382 => _382.ssr, 'optionalAccess', _383 => _383.noExternal]))
|
|
8410
8541
|
}
|
|
8411
8542
|
};
|
|
8412
8543
|
}
|
|
@@ -8477,8 +8608,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8477
8608
|
...userRolldownOptions
|
|
8478
8609
|
};
|
|
8479
8610
|
const merged = mergeFarmViteConfig(farmConfig, shared);
|
|
8480
|
-
const farmBundlerOptions = _optionalChain([farmConfig, 'access',
|
|
8481
|
-
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess',
|
|
8611
|
+
const farmBundlerOptions = _optionalChain([farmConfig, 'access', _384 => _384.build, 'optionalAccess', _385 => _385.rollupOptions]);
|
|
8612
|
+
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _386 => _386.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _387 => _387.output]);
|
|
8482
8613
|
return {
|
|
8483
8614
|
...merged,
|
|
8484
8615
|
build: {
|
|
@@ -8495,7 +8626,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8495
8626
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
8496
8627
|
ssr: {
|
|
8497
8628
|
...merged.ssr,
|
|
8498
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
8629
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _388 => _388.ssr, 'optionalAccess', _389 => _389.external]), _optionalChain([userConfig, 'access', _390 => _390.ssr, 'optionalAccess', _391 => _391.external]))
|
|
8499
8630
|
}
|
|
8500
8631
|
};
|
|
8501
8632
|
}
|
|
@@ -8572,4 +8703,8 @@ ${FARM_DARK_VARIANT}
|
|
|
8572
8703
|
|
|
8573
8704
|
|
|
8574
8705
|
|
|
8575
|
-
|
|
8706
|
+
|
|
8707
|
+
|
|
8708
|
+
|
|
8709
|
+
|
|
8710
|
+
exports.inspectStaticMetadataImage = inspectStaticMetadataImage; exports.RouteManager = RouteManager; exports.createFarmDevClientManifest = createFarmDevClientManifest; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.farmDevServerStylesheetsPlugin = farmDevServerStylesheetsPlugin; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.isRendererCompiledComponent = isRendererCompiledComponent; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.resolveFarmIslxActionsMode = resolveFarmIslxActionsMode; exports.farmBrowserServerFnsEnabled = farmBrowserServerFnsEnabled; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.invalidateFarmRouteRootInferences = invalidateFarmRouteRootInferences; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.canFarmSkipKeptLayoutRender = canFarmSkipKeptLayoutRender; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.toBakedMarkdownSourcePath = toBakedMarkdownSourcePath; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_SCRIPT_SOURCE = FARM_NAVIGATION_SCRIPT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.FARM_EARLY_NAVIGATION_SOURCE = FARM_EARLY_NAVIGATION_SOURCE; exports.FARM_REFRESH_FIELDS_SOURCE = FARM_REFRESH_FIELDS_SOURCE; exports.exactIdPattern = exactIdPattern; exports.fileNamePattern = fileNamePattern; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.FARM_VIDEO_PLAYER_HTML = FARM_VIDEO_PLAYER_HTML; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteAlias = mergeFarmViteAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;
|