@farm.js/core 0.1.80 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-BPa5n0ld.d.ts → agent-mcp.d-C2Su3x4D.d.ts} +1 -1
- package/dist/{agent-mcp.d-DOP95Jxm.d.mts → agent-mcp.d-Yak-LqRd.d.mts} +1 -1
- package/dist/agent-runtime.cjs +4 -3
- package/dist/agent-runtime.d.mts +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/agent-runtime.mjs +3 -2
- package/dist/analyzer-LV23T6QN.cjs +17 -0
- package/dist/{analyzer-F7CWE5VA.mjs → analyzer-RPU2KG4J.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 +6 -5
- package/dist/api/node.d.mts +4 -3
- package/dist/api/node.d.ts +4 -3
- package/dist/api/node.mjs +5 -4
- package/dist/api/route-manager.cjs +7 -6
- package/dist/api/route-manager.d.mts +4 -3
- package/dist/api/route-manager.d.ts +4 -3
- package/dist/api/route-manager.mjs +6 -5
- package/dist/api/runtime.cjs +5 -4
- package/dist/api/runtime.d.mts +3 -2
- package/dist/api/runtime.d.ts +3 -2
- package/dist/api/runtime.mjs +4 -3
- package/dist/api.cjs +9 -8
- package/dist/api.d.mts +5 -4
- package/dist/api.d.ts +5 -4
- package/dist/api.mjs +8 -7
- package/dist/{app-manifest.d-9UD6BznX.d.mts → app-manifest.d-BcyOFMrg.d.mts} +1 -1
- package/dist/{app-manifest.d-CO6Iu0Hx.d.ts → app-manifest.d-DZyXaICz.d.ts} +1 -1
- package/dist/app-markdown.cjs +3 -3
- package/dist/app-markdown.d.mts +5 -4
- package/dist/app-markdown.d.ts +5 -4
- package/dist/app-markdown.mjs +2 -2
- package/dist/{app.d-DXeRWZK7.d.mts → app.d-C0ePpuaG.d.mts} +30 -4
- package/dist/{app.d-DwX1ePhs.d.ts → app.d-CIoXsAbN.d.ts} +30 -4
- package/dist/{chunk-Q4TRGTO7.cjs → chunk-26WP75W5.cjs} +32 -16
- package/dist/{chunk-7KDCVSTR.mjs → chunk-2PFGA6PB.mjs} +2 -2
- package/dist/chunk-2UYYXSUS.mjs +401 -0
- package/dist/{chunk-PL7MCYYD.mjs → chunk-3AV4DCXY.mjs} +58 -358
- package/dist/{chunk-3GNHJ3RN.cjs → chunk-3BTN3NP7.cjs} +2 -2
- package/dist/chunk-3DE6RK7K.cjs +36 -0
- package/dist/{chunk-GBW5DU7V.mjs → chunk-47I2MYIR.mjs} +487 -304
- package/dist/{chunk-RQBGHHOQ.mjs → chunk-4X7LSGM6.mjs} +1 -1
- package/dist/{chunk-QMR2TUVZ.cjs → chunk-52Q4OB4A.cjs} +4 -4
- package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
- package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
- package/dist/chunk-5MMKNW7Q.cjs +54 -0
- package/dist/{chunk-AXA2BSX3.cjs → chunk-5MUFW5UU.cjs} +22 -21
- package/dist/{chunk-MQOHYV6L.cjs → chunk-5P65LXGU.cjs} +11 -11
- package/dist/{chunk-KEU55O2D.mjs → chunk-63ZE6B6M.mjs} +7 -6
- package/dist/{chunk-TS3ZHJN5.cjs → chunk-6BPFIYGY.cjs} +3 -3
- package/dist/{chunk-NJ4OASLP.mjs → chunk-6QYPP5KC.mjs} +2 -2
- package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
- package/dist/{chunk-G4SZC2WH.cjs → chunk-AIPZDBP6.cjs} +557 -374
- package/dist/{chunk-X4TSMQWF.cjs → chunk-ARORZ3MH.cjs} +548 -397
- package/dist/{chunk-K3XKEZR6.mjs → chunk-AUFEM3FB.mjs} +1 -1
- package/dist/{chunk-MGKWYPE3.mjs → chunk-AYDVUCXD.mjs} +1 -0
- package/dist/{chunk-5OAN7BG5.cjs → chunk-B2PGVHBG.cjs} +4 -4
- package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
- package/dist/chunk-B7L24VPX.cjs +401 -0
- package/dist/{chunk-5VDJEKGK.cjs → chunk-BBVLOEND.cjs} +1 -1
- package/dist/{chunk-XF7MJSUS.mjs → chunk-BCQIXH7L.mjs} +1 -1
- package/dist/{chunk-67MZTLTF.cjs → chunk-BCTHOQPP.cjs} +37 -9
- package/dist/{chunk-GBESKA76.cjs → chunk-BSX5OGSD.cjs} +1 -1
- package/dist/{chunk-CNDBLUKI.mjs → chunk-BVJUFVCU.mjs} +1 -1
- package/dist/{chunk-QHAISITM.mjs → chunk-C3VCYOU4.mjs} +1 -1
- package/dist/chunk-C5QHZ626.cjs +85 -0
- package/dist/{chunk-3K2E55BJ.mjs → chunk-CA2HBLXP.mjs} +13 -3
- package/dist/{chunk-ANZLZNNX.cjs → chunk-CD5Z7RR5.cjs} +155 -20
- package/dist/{chunk-4MIDUSIX.mjs → chunk-CJDBTTLB.mjs} +17 -17
- package/dist/{chunk-RLCOWWE5.cjs → chunk-CN2JOTRO.cjs} +7 -7
- package/dist/chunk-D2VAANBS.mjs +48 -0
- package/dist/{chunk-XZBBKZGW.mjs → chunk-DAXU2NBE.mjs} +128 -41
- package/dist/{chunk-4H4ZXUNB.cjs → chunk-DJ3PVHTW.cjs} +3 -3
- package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
- package/dist/{chunk-ZVSQN7NC.cjs → chunk-DRO3NXA3.cjs} +40 -43
- package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
- package/dist/{chunk-Q4YEAWUK.mjs → chunk-ECVSRE4Y.mjs} +3 -2
- package/dist/{chunk-MDEFTF63.mjs → chunk-EL2Z6YFZ.mjs} +25 -28
- package/dist/chunk-EZYKV24V.mjs +385 -0
- package/dist/{chunk-TVCFY3KK.cjs → chunk-FB4CWSC2.cjs} +12 -12
- package/dist/{chunk-IYFBLWXU.cjs → chunk-FULX5RYX.cjs} +61 -361
- package/dist/{chunk-V73Y4UBL.mjs → chunk-GXLNARPO.mjs} +151 -16
- package/dist/{chunk-ZPEZXQTM.cjs → chunk-HHQEKLZL.cjs} +2 -2
- package/dist/{chunk-HNUBRUFQ.cjs → chunk-HQEYZSF3.cjs} +4 -3
- package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
- package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
- package/dist/{chunk-44G4XHEL.mjs → chunk-I4DR3HCH.mjs} +11 -11
- package/dist/chunk-I4WZRG73.mjs +54 -0
- package/dist/{chunk-MUZHULW2.mjs → chunk-ICOJ2BC6.mjs} +23 -7
- package/dist/{chunk-MNIR7I7B.mjs → chunk-INKVDO42.mjs} +1 -1
- package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
- package/dist/{chunk-HEDGTXXB.cjs → chunk-JB4BHRFK.cjs} +17 -17
- package/dist/{chunk-XKUKWMGX.cjs → chunk-JCYDWJVO.cjs} +3 -3
- package/dist/{chunk-CCMP4JD2.cjs → chunk-JK26IMT7.cjs} +1 -1
- package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
- package/dist/{chunk-SVCUSOEF.mjs → chunk-KR5DF7WK.mjs} +1 -1
- package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
- package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
- package/dist/{chunk-LVGB5PYK.cjs → chunk-LM2ZDNDD.cjs} +28 -28
- package/dist/{chunk-COTFX4GT.mjs → chunk-LTOT5KVJ.mjs} +1 -1
- package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
- package/dist/{chunk-DVHFIETW.cjs → chunk-N2EFMN2K.cjs} +18 -18
- package/dist/{chunk-MZ5QGWRW.mjs → chunk-N3VMHPIY.mjs} +2 -2
- package/dist/{chunk-KKVRWNDH.mjs → chunk-NAHDG6UX.mjs} +4 -4
- package/dist/{chunk-UWOCYINY.cjs → chunk-NEKO3HM2.cjs} +12 -2
- package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
- package/dist/{chunk-ZDYYZX73.mjs → chunk-NRCKBDYP.mjs} +266 -115
- package/dist/{chunk-EG5YBYHO.mjs → chunk-OMB7UGVW.mjs} +1 -1
- package/dist/{chunk-JGEN2FIT.mjs → chunk-OP5VI4TP.mjs} +1 -1
- package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
- package/dist/{chunk-3XTRT3MB.mjs → chunk-PO5MZIWK.mjs} +1 -1
- package/dist/{chunk-ASYOWPSR.cjs → chunk-PWDBWXQI.cjs} +2 -1
- package/dist/{chunk-WJ2O2MPP.cjs → chunk-Q2VOT3K2.cjs} +494 -407
- package/dist/{chunk-7YLDUB4R.cjs → chunk-QCKSYYXK.cjs} +7 -7
- package/dist/{chunk-57QAQU4F.mjs → chunk-QRNYSISP.mjs} +1 -1
- package/dist/{chunk-3JQBQG7K.mjs → chunk-QSMUMK7Y.mjs} +2 -2
- package/dist/{chunk-PRL7FXG4.cjs → chunk-RDNKQ5MK.cjs} +12 -13
- package/dist/{chunk-GCRT6GJG.mjs → chunk-RMLR5RMH.mjs} +30 -2
- package/dist/{chunk-XY5OZQF6.cjs → chunk-RMPUEH5T.cjs} +2 -2
- package/dist/{chunk-7DD5TNPS.cjs → chunk-S7WZUK3B.cjs} +2 -2
- package/dist/{chunk-EGHPFXPZ.cjs → chunk-SAPG45RA.cjs} +23 -23
- package/dist/{chunk-Z4SMFUZ7.cjs → chunk-U54REWMJ.cjs} +23 -23
- package/dist/chunk-U6XYBTUT.mjs +36 -0
- package/dist/chunk-UDMBUTJD.mjs +85 -0
- package/dist/{chunk-WHEQJN4G.cjs → chunk-UGD53SNO.cjs} +2 -2
- package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
- package/dist/{chunk-SDICLSQU.cjs → chunk-VMBIKDKW.cjs} +10 -10
- package/dist/{chunk-WBPVLCNE.mjs → chunk-VPGEYX5Y.mjs} +4 -4
- package/dist/chunk-VS7HLH4S.cjs +385 -0
- package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
- 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-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
- package/dist/{chunk-2RRTOKRZ.mjs → chunk-YHM4PXJY.mjs} +1 -1
- package/dist/{chunk-A5D3UMLJ.mjs → chunk-YSU3WCW6.mjs} +1 -1
- package/dist/{chunk-4STJ6LGR.mjs → chunk-Z3RM3VA2.mjs} +1 -1
- package/dist/{chunk-YN3YMSKD.mjs → chunk-ZIZRIZLP.mjs} +3 -3
- package/dist/{cli-runtime.d-DPNTN-JV.d.mts → cli-runtime.d-Hnvvadz7.d.mts} +5 -5
- package/dist/{cli-runtime.d-8BhZy_wr.d.ts → cli-runtime.d-I0MphTbc.d.ts} +5 -5
- package/dist/{client-component.d-CkDcob6D.d.ts → client-component.d-5QEvtJsg.d.ts} +1 -1
- package/dist/{client-component.d-CMCdyAr8.d.mts → client-component.d-DapRqtSC.d.mts} +1 -1
- package/dist/{client-plugins.d-WcMwOZGZ.d.mts → client-plugins.d-C1WM3ieD.d.mts} +7 -13
- package/dist/{client-plugins.d-BYIovYqX.d.ts → client-plugins.d-DcmDzcSC.d.ts} +7 -13
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +9 -8
- package/dist/client.d.mts +20 -151
- package/dist/client.d.ts +20 -151
- package/dist/client.mjs +8 -7
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/desktop.d.mts +3 -2
- package/dist/desktop.d.ts +3 -2
- package/dist/{devtools-JJOYTIMS.cjs → devtools-5B7NZE6F.cjs} +15 -14
- package/dist/{devtools-F3FDFV26.mjs → devtools-C5GXZZ7E.mjs} +12 -11
- package/dist/docs.cjs +14 -13
- package/dist/docs.d.mts +4 -3
- package/dist/docs.d.ts +4 -3
- package/dist/docs.mjs +13 -12
- package/dist/environment/vite.cjs +7 -6
- package/dist/environment/vite.mjs +6 -5
- package/dist/{handler.d-s3IM6pbJ.d.mts → handler.d-B8bPCBzl.d.mts} +1 -1
- package/dist/{handler.d-BwdOyc9x.d.ts → handler.d-Cliwo6Nu.d.ts} +1 -1
- package/dist/{headers.d-BR-OXrqQ.d.mts → headers.d-CVwSpSGX.d.mts} +1 -1
- package/dist/{headers.d-CAW4wPey.d.ts → headers.d-C_btqjV6.d.ts} +1 -1
- package/dist/index.cjs +68 -65
- package/dist/{index.d-BEVK61zS.d.mts → index.d-DFuMZk9-.d.mts} +1 -1
- package/dist/{index.d-ah2c89Wu.d.ts → index.d-hOEbMcLk.d.ts} +1 -1
- package/dist/index.d.mts +25 -23
- package/dist/index.d.ts +25 -23
- package/dist/index.mjs +72 -69
- package/dist/instrumentation.cjs +3 -3
- package/dist/instrumentation.mjs +2 -2
- package/dist/integrations/orm.d.mts +2 -1
- package/dist/integrations/orm.d.ts +2 -1
- package/dist/integrations.cjs +4 -3
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/integrations.mjs +3 -2
- package/dist/internal/app-markdown-runtime.cjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +12 -5
- package/dist/internal/app-markdown-runtime.d.ts +12 -5
- package/dist/internal/app-markdown-runtime.mjs +1 -1
- package/dist/internal/build-runtime.cjs +49 -47
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +48 -46
- package/dist/internal/cli-runtime.cjs +25 -24
- package/dist/internal/cli-runtime.d.mts +8 -7
- package/dist/internal/cli-runtime.d.ts +8 -7
- package/dist/internal/cli-runtime.mjs +26 -25
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +76 -15
- package/dist/internal/client-runtime.d.mts +18 -7
- package/dist/internal/client-runtime.d.ts +18 -7
- package/dist/internal/client-runtime.mjs +67 -6
- package/dist/internal/compression-runtime.d.mts +2 -1
- package/dist/internal/compression-runtime.d.ts +2 -1
- package/dist/internal/config-runtime.cjs +14 -13
- package/dist/internal/config-runtime.d.mts +4 -3
- package/dist/internal/config-runtime.d.ts +4 -3
- package/dist/internal/config-runtime.mjs +13 -12
- 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 +9 -7
- package/dist/internal/infra-analytics-runtime.d.mts +8 -2
- package/dist/internal/infra-analytics-runtime.d.ts +8 -2
- package/dist/internal/infra-analytics-runtime.mjs +9 -7
- 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 +63 -23
- package/dist/internal/islands-boot.d.mts +5 -3
- package/dist/internal/islands-boot.d.ts +5 -3
- package/dist/internal/islands-boot.mjs +58 -18
- 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 +30 -25
- package/dist/internal/production-runtime.d.mts +14 -11
- package/dist/internal/production-runtime.d.ts +14 -11
- package/dist/internal/production-runtime.mjs +35 -30
- 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 +3 -3
- package/dist/internal/spa-router.d.mts +4 -3
- package/dist/internal/spa-router.d.ts +4 -3
- package/dist/internal/spa-router.mjs +2 -2
- package/dist/internal/start-manifest.d.mts +2 -1
- package/dist/internal/start-manifest.d.ts +2 -1
- package/dist/internal/vercel-edge-middleware.cjs +1 -1
- package/dist/internal/vercel-edge-middleware.mjs +1 -1
- 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/markdown.d.mts +2 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/middleware.cjs +5 -5
- package/dist/middleware.d.mts +2 -1
- package/dist/middleware.d.ts +2 -1
- package/dist/middleware.mjs +4 -4
- package/dist/{mount.d-DcoPFqv5.d.ts → mount.d-CAovYKfs.d.ts} +1 -1
- package/dist/{mount.d-Ylo-CmzK.d.mts → mount.d-DLeYxeRR.d.mts} +1 -1
- package/dist/{native-server-fn-handler-TNVFEQW3.cjs → native-server-fn-handler-57TCQPSM.cjs} +4 -4
- package/dist/{native-server-fn-handler-OXFTI6V5.mjs → native-server-fn-handler-PYK65A46.mjs} +3 -3
- package/dist/{navigation-delegate.d-2MK4YSlL.d.ts → navigation-delegate.d-BLM-8Q3Z.d.ts} +1 -1
- package/dist/{navigation-delegate.d-BA5h0fbE.d.mts → navigation-delegate.d-Chv93QS6.d.mts} +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 +7 -6
- package/dist/navigation.d.ts +7 -6
- package/dist/navigation.mjs +5 -5
- package/dist/{nitro-C3MYDX7V.mjs → nitro-FK3SZM4H.mjs} +2 -2
- package/dist/{nitro-6UOJXJZ6.cjs → nitro-YDFMH5PY.cjs} +6 -6
- 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/{plugin-LN3JBZRR.cjs → plugin-3PT7I26P.cjs} +2 -2
- package/dist/{plugin-33I3V42N.mjs → plugin-QOTAPTVV.mjs} +1 -1
- package/dist/plugin.cjs +41 -37
- package/dist/plugin.d.mts +6 -5
- package/dist/plugin.d.ts +6 -5
- package/dist/plugin.mjs +40 -36
- package/dist/query/client.cjs +10 -10
- package/dist/query/client.mjs +5 -5
- package/dist/{render-plan.d-2o-AG-ot.d.ts → render-plan.d-BSTjTH8h.d.ts} +1 -1
- package/dist/{render-plan.d-ChYBMhLu.d.mts → render-plan.d-CK5Lggyb.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 +79 -17
- package/dist/renderer-client.d.mts +13 -97
- package/dist/renderer-client.d.ts +13 -97
- package/dist/renderer-client.mjs +69 -7
- package/dist/renderer.cjs +4 -2
- package/dist/renderer.d.mts +43 -5
- package/dist/renderer.d.ts +43 -5
- package/dist/renderer.mjs +3 -1
- package/dist/{request.d-RCnCBuWq.d.mts → request.d-BhggxQf3.d.mts} +1 -1
- package/dist/{request.d-CE0FIkiM.d.ts → request.d-CyJS9bjm.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/{route-rendering.d-BTPOM2nU.d.ts → route-rendering.d-BLPPmI5I.d.ts} +1 -1
- package/dist/{route-rendering.d-BZJnfKsp.d.mts → route-rendering.d-CUpG2mZJ.d.mts} +1 -1
- package/dist/{router.d-BU_WE6Ol.d.ts → router.d-0X2Ki6rf.d.ts} +1 -1
- package/dist/{router.d-D8Vvwl4i.d.mts → router.d-2NQM1Kgw.d.mts} +1 -1
- package/dist/routes.cjs +1 -1
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/routes.mjs +1 -1
- package/dist/{rsc-pipeline-A3R4U26C.cjs → rsc-pipeline-5AOF64FL.cjs} +19 -18
- package/dist/{rsc-pipeline-JZWVSHOR.mjs → rsc-pipeline-DNRLYOJ7.mjs} +18 -17
- package/dist/{runtime-SQFRHRGJ.mjs → runtime-EHG2FRXZ.mjs} +18 -17
- package/dist/{runtime-WZ3CHHGJ.cjs → runtime-ZVHG5SRB.cjs} +20 -19
- package/dist/{runtime.d-DJ6IIKcF.d.ts → runtime.d-CXuwkUgr.d.ts} +1 -1
- package/dist/{runtime.d-BnmuOXVD.d.mts → runtime.d-CaFXcu_Q.d.mts} +1 -1
- package/dist/server-action-security.cjs +1 -1
- package/dist/server-action-security.mjs +1 -1
- package/dist/{server-components-status.d-BeqSXcjM.d.ts → server-components-status.d-BdeFD8ZH.d.ts} +1 -1
- package/dist/{server-components-status.d-BzOg9M8g.d.mts → server-components-status.d-Cp7zvBm5.d.mts} +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +1 -1
- package/dist/server-plugins.d.mts +4 -3
- package/dist/server-plugins.d.ts +4 -3
- package/dist/server-plugins.mjs +1 -1
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +82 -71
- package/dist/server.d.mts +12 -11
- package/dist/server.d.ts +12 -11
- package/dist/server.mjs +61 -50
- package/dist/{spa-router.d-BOwuVkMl.d.ts → spa-router.d-Bjgl-Osi.d.ts} +3 -3
- package/dist/{spa-router.d-CDpftSsk.d.mts → spa-router.d-l3G38xHa.d.mts} +3 -3
- package/dist/{ssg.d-BTVqyq8T.d.ts → ssg.d-DDca17Lc.d.ts} +2 -2
- package/dist/{ssg.d-Bx_WFuwg.d.mts → ssg.d-RnlHOqUL.d.mts} +2 -2
- package/dist/store-core.d-BZjuC6Zc.d.mts +309 -0
- package/dist/store-core.d-BaOUOPf7.d.ts +309 -0
- package/dist/testing.cjs +7 -6
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/testing.mjs +6 -5
- package/dist/{utils.d-_dvevm5s.d.ts → utils.d-D8TWmpWo.d.ts} +1 -1
- package/dist/{utils.d-JkrpS-NJ.d.mts → utils.d-tdzw0_zQ.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +43 -37
- package/dist/vite.d.mts +18 -7
- package/dist/vite.d.ts +18 -7
- package/dist/vite.mjs +42 -36
- package/dist/workflows.cjs +2 -2
- package/dist/workflows.mjs +1 -1
- package/package.json +17 -2
- package/dist/analyzer-I7RBBQ65.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/{chunk-EY7ED5UW.mjs → chunk-3RVLJTFZ.mjs} +3 -3
- package/dist/{chunk-UJPE75GF.mjs → chunk-J2VUPCCR.mjs} +3 -3
- package/dist/{chunk-PBJ7MEOV.cjs → chunk-OZUINP2P.cjs} +2 -2
- package/dist/{chunk-7FQFK3OA.mjs → chunk-V7HNYR76.mjs} +3 -3
- package/dist/{chunk-2FK47RRZ.cjs → chunk-VGHDPEPQ.cjs} +2 -2
- package/dist/{chunk-CGIVCGH5.cjs → chunk-XOFJUSWC.cjs} +2 -2
|
@@ -32,7 +32,7 @@ var _chunkMHKPXX3Jcjs = require('./chunk-MHKPXX3J.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunk6BPFIYGYcjs = require('./chunk-6BPFIYGY.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -41,7 +41,7 @@ var _chunkTS3ZHJN5cjs = require('./chunk-TS3ZHJN5.cjs');
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _chunkHHQEKLZLcjs = require('./chunk-HHQEKLZL.cjs');
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
@@ -65,19 +65,16 @@ var _chunkN3H7UPBMcjs = require('./chunk-N3H7UPBM.cjs');
|
|
|
65
65
|
var _chunkYUQUGVSVcjs = require('./chunk-YUQUGVSV.cjs');
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
var _chunkANZLZNNXcjs = require('./chunk-ANZLZNNX.cjs');
|
|
69
|
-
|
|
70
|
-
|
|
71
68
|
var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
|
|
72
69
|
|
|
73
70
|
|
|
74
71
|
|
|
75
72
|
|
|
76
73
|
|
|
77
|
-
var
|
|
74
|
+
var _chunkLM2ZDNDDcjs = require('./chunk-LM2ZDNDD.cjs');
|
|
78
75
|
|
|
79
76
|
|
|
80
|
-
var
|
|
77
|
+
var _chunk3BTN3NP7cjs = require('./chunk-3BTN3NP7.cjs');
|
|
81
78
|
|
|
82
79
|
|
|
83
80
|
var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
|
|
@@ -117,23 +114,25 @@ var _chunkO4JYMU5Ncjs = require('./chunk-O4JYMU5N.cjs');
|
|
|
117
114
|
|
|
118
115
|
|
|
119
116
|
|
|
120
|
-
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
var _chunkARORZ3MHcjs = require('./chunk-ARORZ3MH.cjs');
|
|
121
120
|
|
|
122
121
|
|
|
123
122
|
|
|
124
123
|
|
|
125
124
|
|
|
126
125
|
|
|
127
|
-
var
|
|
126
|
+
var _chunkDMSXZNQRcjs = require('./chunk-DMSXZNQR.cjs');
|
|
128
127
|
|
|
129
128
|
|
|
130
|
-
var
|
|
129
|
+
var _chunkVACYUMXWcjs = require('./chunk-VACYUMXW.cjs');
|
|
131
130
|
|
|
132
131
|
|
|
133
132
|
|
|
134
133
|
|
|
135
134
|
|
|
136
|
-
var
|
|
135
|
+
var _chunkVMBIKDKWcjs = require('./chunk-VMBIKDKW.cjs');
|
|
137
136
|
|
|
138
137
|
|
|
139
138
|
|
|
@@ -146,7 +145,7 @@ var _chunkSDICLSQUcjs = require('./chunk-SDICLSQU.cjs');
|
|
|
146
145
|
|
|
147
146
|
|
|
148
147
|
|
|
149
|
-
var
|
|
148
|
+
var _chunkNEKO3HM2cjs = require('./chunk-NEKO3HM2.cjs');
|
|
150
149
|
|
|
151
150
|
|
|
152
151
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
@@ -156,11 +155,15 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
|
156
155
|
|
|
157
156
|
|
|
158
157
|
|
|
158
|
+
var _chunkCD5Z7RR5cjs = require('./chunk-CD5Z7RR5.cjs');
|
|
159
159
|
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
var _chunkB2PGVHBGcjs = require('./chunk-B2PGVHBG.cjs');
|
|
164
167
|
|
|
165
168
|
|
|
166
169
|
|
|
@@ -168,7 +171,7 @@ var _chunk5OAN7BG5cjs = require('./chunk-5OAN7BG5.cjs');
|
|
|
168
171
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
169
172
|
|
|
170
173
|
|
|
171
|
-
var
|
|
174
|
+
var _chunkRMPUEH5Tcjs = require('./chunk-RMPUEH5T.cjs');
|
|
172
175
|
|
|
173
176
|
|
|
174
177
|
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
@@ -189,7 +192,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
|
189
192
|
|
|
190
193
|
|
|
191
194
|
|
|
192
|
-
var
|
|
195
|
+
var _chunkDRO3NXA3cjs = require('./chunk-DRO3NXA3.cjs');
|
|
193
196
|
|
|
194
197
|
|
|
195
198
|
|
|
@@ -211,6 +214,7 @@ var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
|
211
214
|
var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
|
|
212
215
|
|
|
213
216
|
|
|
217
|
+
var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
214
218
|
|
|
215
219
|
|
|
216
220
|
|
|
@@ -218,17 +222,16 @@ var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
|
|
|
218
222
|
|
|
219
223
|
|
|
220
224
|
|
|
221
|
-
var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
|
|
222
225
|
|
|
223
226
|
|
|
224
|
-
var
|
|
227
|
+
var _chunkBCTHOQPPcjs = require('./chunk-BCTHOQPP.cjs');
|
|
225
228
|
|
|
226
229
|
|
|
227
230
|
|
|
228
231
|
|
|
229
232
|
|
|
230
233
|
|
|
231
|
-
var
|
|
234
|
+
var _chunkHQKCSJEHcjs = require('./chunk-HQKCSJEH.cjs');
|
|
232
235
|
|
|
233
236
|
|
|
234
237
|
var _chunkXRFGOYXGcjs = require('./chunk-XRFGOYXG.cjs');
|
|
@@ -240,7 +243,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
|
240
243
|
|
|
241
244
|
|
|
242
245
|
|
|
243
|
-
var
|
|
246
|
+
var _chunk26WP75W5cjs = require('./chunk-26WP75W5.cjs');
|
|
244
247
|
|
|
245
248
|
|
|
246
249
|
|
|
@@ -250,15 +253,15 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
|
250
253
|
var _chunk2NOHVIJ3cjs = require('./chunk-2NOHVIJ3.cjs');
|
|
251
254
|
|
|
252
255
|
|
|
253
|
-
var
|
|
256
|
+
var _chunkPWDBWXQIcjs = require('./chunk-PWDBWXQI.cjs');
|
|
254
257
|
|
|
255
258
|
|
|
256
259
|
|
|
257
|
-
var
|
|
260
|
+
var _chunkBSX5OGSDcjs = require('./chunk-BSX5OGSD.cjs');
|
|
258
261
|
|
|
259
262
|
|
|
260
263
|
|
|
261
|
-
var
|
|
264
|
+
var _chunkB3HQTGXScjs = require('./chunk-B3HQTGXS.cjs');
|
|
262
265
|
|
|
263
266
|
|
|
264
267
|
var _chunkQKW6DLDTcjs = require('./chunk-QKW6DLDT.cjs');
|
|
@@ -272,7 +275,7 @@ var _chunkNW3DL2PMcjs = require('./chunk-NW3DL2PM.cjs');
|
|
|
272
275
|
var _chunkSHDCKRP4cjs = require('./chunk-SHDCKRP4.cjs');
|
|
273
276
|
|
|
274
277
|
|
|
275
|
-
var
|
|
278
|
+
var _chunk5P65LXGUcjs = require('./chunk-5P65LXGU.cjs');
|
|
276
279
|
|
|
277
280
|
|
|
278
281
|
var _chunkCYOTNHDFcjs = require('./chunk-CYOTNHDF.cjs');
|
|
@@ -300,7 +303,7 @@ var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
|
|
|
300
303
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
301
304
|
|
|
302
305
|
|
|
303
|
-
var
|
|
306
|
+
var _chunkJK26IMT7cjs = require('./chunk-JK26IMT7.cjs');
|
|
304
307
|
|
|
305
308
|
|
|
306
309
|
var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
|
|
@@ -643,7 +646,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
643
646
|
isPathGuarded: options.isPathGuarded,
|
|
644
647
|
basePath
|
|
645
648
|
});
|
|
646
|
-
const apiHandler =
|
|
649
|
+
const apiHandler = _chunkHHQEKLZLcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
647
650
|
rootDir: options.root,
|
|
648
651
|
srcDir: options.srcDir,
|
|
649
652
|
docs,
|
|
@@ -1020,7 +1023,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
1020
1023
|
const routes = [];
|
|
1021
1024
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
1022
1025
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
1023
|
-
const rendering = await
|
|
1026
|
+
const rendering = await _chunkVMBIKDKWcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
1024
1027
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
1025
1028
|
routes.push({
|
|
1026
1029
|
kind: "page",
|
|
@@ -1633,7 +1636,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1633
1636
|
// removed block used (`readFileSync` for a version, say).
|
|
1634
1637
|
enforce: "pre",
|
|
1635
1638
|
transform: {
|
|
1636
|
-
filter: { id:
|
|
1639
|
+
filter: { id: _chunkARORZ3MHcjs.fileNamePattern.call(void 0, configFiles) },
|
|
1637
1640
|
async handler(code, id) {
|
|
1638
1641
|
const file = id.split("?", 1)[0];
|
|
1639
1642
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -1734,6 +1737,42 @@ function createFarmPrivateClientSourcemapsPlugin(options) {
|
|
|
1734
1737
|
};
|
|
1735
1738
|
}
|
|
1736
1739
|
|
|
1740
|
+
// src/nitro/client-brotli-assets.ts
|
|
1741
|
+
|
|
1742
|
+
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
var _zlib = require('zlib');
|
|
1746
|
+
var compress = _util.promisify.call(void 0, _zlib.brotliCompress);
|
|
1747
|
+
var SCRIPT_OR_STYLESHEET = /\.(?:m?js|css)$/;
|
|
1748
|
+
var MIN_COMPRESSED_BYTES = 1024;
|
|
1749
|
+
async function writeFarmClientBrotliAssets(clientOutputDir) {
|
|
1750
|
+
const entries = await _promises.readdir.call(void 0, clientOutputDir, { recursive: true, withFileTypes: true });
|
|
1751
|
+
const files = new Set(
|
|
1752
|
+
entries.filter((entry) => entry.isFile()).map((entry) => _path2.default.join(entry.parentPath, entry.name))
|
|
1753
|
+
);
|
|
1754
|
+
const pending = [...files].filter(
|
|
1755
|
+
(file) => SCRIPT_OR_STYLESHEET.test(file) && !files.has(`${file}.br`)
|
|
1756
|
+
);
|
|
1757
|
+
const next = async () => {
|
|
1758
|
+
const file = pending.pop();
|
|
1759
|
+
if (file === void 0) return;
|
|
1760
|
+
const source = await _promises.readFile.call(void 0, file);
|
|
1761
|
+
if (source.length >= MIN_COMPRESSED_BYTES) {
|
|
1762
|
+
const compressed = await compress(source, {
|
|
1763
|
+
params: {
|
|
1764
|
+
[_zlib.constants.BROTLI_PARAM_MODE]: _zlib.constants.BROTLI_MODE_TEXT,
|
|
1765
|
+
[_zlib.constants.BROTLI_PARAM_QUALITY]: _zlib.constants.BROTLI_MAX_QUALITY,
|
|
1766
|
+
[_zlib.constants.BROTLI_PARAM_SIZE_HINT]: source.length
|
|
1767
|
+
}
|
|
1768
|
+
});
|
|
1769
|
+
await _promises.writeFile.call(void 0, `${file}.br`, compressed);
|
|
1770
|
+
}
|
|
1771
|
+
return next();
|
|
1772
|
+
};
|
|
1773
|
+
await Promise.all(Array.from({ length: _os.availableParallelism.call(void 0, ) }, next));
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1737
1776
|
// src/middleware/static-config.ts
|
|
1738
1777
|
function literalMatcher(node) {
|
|
1739
1778
|
if (!node) return void 0;
|
|
@@ -1799,8 +1838,8 @@ function readStaticMiddlewareConfig(program) {
|
|
|
1799
1838
|
}
|
|
1800
1839
|
async function readMiddlewareFileConfig(filePath) {
|
|
1801
1840
|
try {
|
|
1802
|
-
const [{ readFile }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
|
|
1803
|
-
const parsed = vite.parseSync(filePath, await
|
|
1841
|
+
const [{ readFile: readFile2 }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
|
|
1842
|
+
const parsed = vite.parseSync(filePath, await readFile2(filePath, "utf8"));
|
|
1804
1843
|
if (_optionalChain([parsed, 'access', _45 => _45.errors, 'optionalAccess', _46 => _46.length])) return "unknown";
|
|
1805
1844
|
return readStaticMiddlewareConfig(parsed.program);
|
|
1806
1845
|
} catch (e13) {
|
|
@@ -1811,7 +1850,7 @@ async function readMiddlewareFileConfig(filePath) {
|
|
|
1811
1850
|
// src/nitro/vercel-edge-middleware.ts
|
|
1812
1851
|
|
|
1813
1852
|
|
|
1814
|
-
|
|
1853
|
+
|
|
1815
1854
|
var FARM_VERCEL_EDGE_MIDDLEWARE_FUNCTION = "_farm_middleware";
|
|
1816
1855
|
var FARM_VERCEL_EDGE_NOT_FOUND_PATH = "/__farm/not-found";
|
|
1817
1856
|
var EDGE_NODE_MODULES = /* @__PURE__ */ new Set(["async_hooks", "events", "buffer", "assert", "util"]);
|
|
@@ -1916,7 +1955,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
1916
1955
|
logLevel: "silent",
|
|
1917
1956
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
1918
1957
|
resolve: {
|
|
1919
|
-
alias:
|
|
1958
|
+
alias: _chunkARORZ3MHcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
1920
1959
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
1921
1960
|
},
|
|
1922
1961
|
transform: {
|
|
@@ -1935,7 +1974,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
1935
1974
|
await bundle.close();
|
|
1936
1975
|
}
|
|
1937
1976
|
} catch (error) {
|
|
1938
|
-
throw
|
|
1977
|
+
throw _chunkPWDBWXQIcjs.withPlainDiagnostics.call(void 0, error);
|
|
1939
1978
|
} finally {
|
|
1940
1979
|
await fs5.rm(entryPath, { force: true });
|
|
1941
1980
|
}
|
|
@@ -2138,7 +2177,7 @@ function createPrerenderMarkdownPagesPlugin(pages) {
|
|
|
2138
2177
|
const compiled = await pages;
|
|
2139
2178
|
if (compiled.size === 0) return "";
|
|
2140
2179
|
return `globalThis[Symbol.for(${JSON.stringify(
|
|
2141
|
-
|
|
2180
|
+
_chunk26WP75W5cjs.FARM_MARKDOWN_PRECOMPILED_PAGES.description
|
|
2142
2181
|
)})] = new Map(${JSON.stringify([...compiled])});`;
|
|
2143
2182
|
}
|
|
2144
2183
|
};
|
|
@@ -2276,7 +2315,7 @@ function hasReactDomEdgeServerBuild(root) {
|
|
|
2276
2315
|
}
|
|
2277
2316
|
}
|
|
2278
2317
|
function shouldAliasReactServerToWebBuild(renderer, preset) {
|
|
2279
|
-
return
|
|
2318
|
+
return _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
|
|
2280
2319
|
}
|
|
2281
2320
|
function isCloudflareImagePreset(preset) {
|
|
2282
2321
|
return preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module";
|
|
@@ -2318,7 +2357,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2318
2357
|
return {
|
|
2319
2358
|
name: "farm-omitted-metadata-image-runtime",
|
|
2320
2359
|
resolveId: {
|
|
2321
|
-
filter: { id:
|
|
2360
|
+
filter: { id: _chunkARORZ3MHcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
2322
2361
|
handler(source, importer) {
|
|
2323
2362
|
if (source !== "@vercel/og") return null;
|
|
2324
2363
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -2327,7 +2366,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2327
2366
|
}
|
|
2328
2367
|
},
|
|
2329
2368
|
load: {
|
|
2330
|
-
filter: { id:
|
|
2369
|
+
filter: { id: _chunkARORZ3MHcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
2331
2370
|
handler(id) {
|
|
2332
2371
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
2333
2372
|
return `
|
|
@@ -2656,7 +2695,7 @@ function hasFarmPluginRoutes(config) {
|
|
|
2656
2695
|
}
|
|
2657
2696
|
function farmServerRuntimePluginsMayHandlePath(config, pathname) {
|
|
2658
2697
|
return (config.plugins || []).some(
|
|
2659
|
-
(plugin) =>
|
|
2698
|
+
(plugin) => _chunkB3HQTGXScjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && // Mobile session tokens change only bearer requests and cookie-clearing responses, which a
|
|
2660
2699
|
// prerendered file never answers or sends; its endpoints live under /__farm/.
|
|
2661
2700
|
plugin.name !== _chunkMHKPXX3Jcjs.FARM_MOBILE_SESSION_PLUGIN && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
|
|
2662
2701
|
);
|
|
@@ -2739,7 +2778,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
2739
2778
|
routeManager.getSearchPreserveRoutes().map((route) => [route.pattern, route])
|
|
2740
2779
|
);
|
|
2741
2780
|
for (const [pattern, entry] of routeManager.getRoutes()) {
|
|
2742
|
-
const markdownSourcePath = entry.markdownSourcePath || (
|
|
2781
|
+
const markdownSourcePath = entry.markdownSourcePath || (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
|
|
2743
2782
|
const searchPreserve = searchPreserveRoutes.get(entry.pattern);
|
|
2744
2783
|
pageRoutes.push({
|
|
2745
2784
|
pattern,
|
|
@@ -2796,7 +2835,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2796
2835
|
const productionVite = productionViteResult.value;
|
|
2797
2836
|
_chunk7U4XF76Rcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
|
|
2798
2837
|
const mobileClient = shouldBuildFarmMobileClient(config);
|
|
2799
|
-
const rendererDisabled =
|
|
2838
|
+
const rendererDisabled = _chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
2800
2839
|
const buildClientBundle = async () => {
|
|
2801
2840
|
if (rendererDisabled) {
|
|
2802
2841
|
await fs5.rm(clientOutputDir, { recursive: true, force: true });
|
|
@@ -2945,10 +2984,10 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2945
2984
|
function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
2946
2985
|
const bodies = [];
|
|
2947
2986
|
for (const route of pageRoutes) {
|
|
2948
|
-
if (route.source === void 0 || !
|
|
2949
|
-
const { body } =
|
|
2950
|
-
const rendering =
|
|
2951
|
-
|
|
2987
|
+
if (route.source === void 0 || !_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
|
|
2988
|
+
const { body } = _chunk26WP75W5cjs.parseMarkdownFrontmatter.call(void 0, route.source);
|
|
2989
|
+
const rendering = _chunkVMBIKDKWcjs.resolveRouteRenderingConfig.call(void 0,
|
|
2990
|
+
_chunk26WP75W5cjs.readFarmMarkdownRouteConfig.call(void 0, body),
|
|
2952
2991
|
route.source
|
|
2953
2992
|
);
|
|
2954
2993
|
if (rendering.ssg && rendering.revalidate === void 0) bodies.push(body);
|
|
@@ -2991,7 +3030,7 @@ async function writeFarmVideoPlayerToClient(outputDir) {
|
|
|
2991
3030
|
const filePath = _path2.default.join(outputDir, _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH.slice(1));
|
|
2992
3031
|
await fs5.mkdir(_path2.default.dirname(filePath), { recursive: true });
|
|
2993
3032
|
try {
|
|
2994
|
-
await fs5.writeFile(filePath,
|
|
3033
|
+
await fs5.writeFile(filePath, _chunkARORZ3MHcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
|
|
2995
3034
|
} catch (error) {
|
|
2996
3035
|
if (error.code !== "EEXIST") throw error;
|
|
2997
3036
|
}
|
|
@@ -3025,7 +3064,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
3025
3064
|
}
|
|
3026
3065
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
3027
3066
|
await fs5.writeFile(fontCssPath, normalizedFontCss);
|
|
3028
|
-
await fs5.writeFile(clientCssPath,
|
|
3067
|
+
await fs5.writeFile(clientCssPath, _chunkARORZ3MHcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
3029
3068
|
}
|
|
3030
3069
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
3031
3070
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -3075,10 +3114,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
3075
3114
|
}
|
|
3076
3115
|
}
|
|
3077
3116
|
function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
|
|
3078
|
-
const key =
|
|
3117
|
+
const key = _chunkDRO3NXA3cjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
|
|
3079
3118
|
let plan = cache.get(key);
|
|
3080
3119
|
if (!plan) {
|
|
3081
|
-
plan =
|
|
3120
|
+
plan = _chunkDRO3NXA3cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
3082
3121
|
cache.set(key, plan);
|
|
3083
3122
|
}
|
|
3084
3123
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -3086,8 +3125,13 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
3086
3125
|
async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime, programmaticClientRoutes, mobile = false, sourceSnapshot) {
|
|
3087
3126
|
if (!mobile) await _chunkE5UN4OWXcjs.removeFarmMobileClientManifest.call(void 0, _path2.default.dirname(outputDir));
|
|
3088
3127
|
const viteBuild = productionVite.build;
|
|
3089
|
-
const {
|
|
3090
|
-
|
|
3128
|
+
const {
|
|
3129
|
+
farmIslandContainersPlugin,
|
|
3130
|
+
farmNavigationPlugin,
|
|
3131
|
+
farmPlugin,
|
|
3132
|
+
farmServerOnlyEntriesPlugin
|
|
3133
|
+
} = await import("./vite.cjs");
|
|
3134
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-3PT7I26P.cjs");
|
|
3091
3135
|
const fs5 = await import("fs/promises");
|
|
3092
3136
|
const pluginManager = new PluginManager2({
|
|
3093
3137
|
config,
|
|
@@ -3096,7 +3140,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3096
3140
|
});
|
|
3097
3141
|
pluginManager.addPlugins(config.plugins || []);
|
|
3098
3142
|
const clientPages = [];
|
|
3099
|
-
const integrationProviders =
|
|
3143
|
+
const integrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations).filter(
|
|
3100
3144
|
(provider) => provider.component || provider.type === "clerk"
|
|
3101
3145
|
);
|
|
3102
3146
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
@@ -3107,14 +3151,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3107
3151
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
3108
3152
|
);
|
|
3109
3153
|
}
|
|
3110
|
-
const isolatedMode =
|
|
3154
|
+
const isolatedMode = _chunkDRO3NXA3cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3111
3155
|
_optionalChain([config, 'access', _95 => _95.experimental, 'optionalAccess', _96 => _96.isolatedClientHydration]),
|
|
3112
3156
|
{
|
|
3113
3157
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _97 => _97.experimental, 'optionalAccess', _98 => _98.serverComponents])) === "rsc",
|
|
3114
3158
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
3115
3159
|
}
|
|
3116
3160
|
);
|
|
3117
|
-
const planOptions =
|
|
3161
|
+
const planOptions = _chunkDRO3NXA3cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
3118
3162
|
config.renderer,
|
|
3119
3163
|
Boolean(unsupportedIntegrationProvider)
|
|
3120
3164
|
);
|
|
@@ -3126,11 +3170,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3126
3170
|
...planOptions,
|
|
3127
3171
|
serverTreeLayouts: pagePlanOptions.serverOwners
|
|
3128
3172
|
};
|
|
3129
|
-
const layoutAppliesToRoute =
|
|
3173
|
+
const layoutAppliesToRoute = _chunkNEKO3HM2cjs.routeBoundaryCoversDirectory;
|
|
3130
3174
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3131
3175
|
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _101 => _101.experimental, 'optionalAccess', _102 => _102.serverComponents])) === "islands";
|
|
3132
3176
|
const adapterOwnsDocsRuntime = Boolean(
|
|
3133
|
-
|
|
3177
|
+
_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled]) && _optionalChain([config, 'access', _105 => _105.docs, 'access', _106 => _106.adapter, 'optionalAccess', _107 => _107.server]) && config.docs.adapter.react
|
|
3134
3178
|
);
|
|
3135
3179
|
const docsEntries = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) ? _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).map(
|
|
3136
3180
|
(docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
|
|
@@ -3141,7 +3185,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3141
3185
|
);
|
|
3142
3186
|
const syntheticDocsEntry = _optionalChain([config, 'access', _110 => _110.docs, 'optionalAccess', _111 => _111.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
3143
3187
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
3144
|
-
const plan = (operation) => sourceSnapshot ?
|
|
3188
|
+
const plan = (operation) => sourceSnapshot ? _chunkDRO3NXA3cjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunkDRO3NXA3cjs.withFarmSourceSnapshot.call(void 0, operation);
|
|
3145
3189
|
const { clientLayouts, clientRouteSlots } = plan(() => {
|
|
3146
3190
|
const clientLayouts2 = layoutRoutes.map((layout) => {
|
|
3147
3191
|
try {
|
|
@@ -3188,7 +3232,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3188
3232
|
};
|
|
3189
3233
|
}
|
|
3190
3234
|
});
|
|
3191
|
-
const markdownPagePlan =
|
|
3235
|
+
const markdownPagePlan = _chunkDRO3NXA3cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
3192
3236
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
3193
3237
|
root,
|
|
3194
3238
|
isolatedMode,
|
|
@@ -3196,7 +3240,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3196
3240
|
);
|
|
3197
3241
|
const routePlans = pageRoutes.map((route) => ({
|
|
3198
3242
|
route,
|
|
3199
|
-
metadata:
|
|
3243
|
+
metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
3200
3244
|
route.modulePath,
|
|
3201
3245
|
root,
|
|
3202
3246
|
isolatedMode,
|
|
@@ -3204,7 +3248,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3204
3248
|
pagePlanOptions
|
|
3205
3249
|
)
|
|
3206
3250
|
}));
|
|
3207
|
-
|
|
3251
|
+
_chunkDRO3NXA3cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
3208
3252
|
clientLayouts2.map((layout) => ({
|
|
3209
3253
|
pattern: layout.pattern,
|
|
3210
3254
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -3213,7 +3257,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3213
3257
|
[
|
|
3214
3258
|
...routePlans.map(({ route, metadata }) => ({
|
|
3215
3259
|
pattern: routeDirectory(route),
|
|
3216
|
-
depth:
|
|
3260
|
+
depth: _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
3217
3261
|
metadata
|
|
3218
3262
|
})),
|
|
3219
3263
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -3238,7 +3282,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3238
3282
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
3239
3283
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
3240
3284
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3241
|
-
`\u26A0\uFE0F ${
|
|
3285
|
+
`\u26A0\uFE0F ${_chunkDRO3NXA3cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
|
|
3242
3286
|
);
|
|
3243
3287
|
}
|
|
3244
3288
|
}
|
|
@@ -3273,7 +3317,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3273
3317
|
);
|
|
3274
3318
|
if (metadata.suppressedAsyncHydration) {
|
|
3275
3319
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3276
|
-
`\u26A0\uFE0F ${
|
|
3320
|
+
`\u26A0\uFE0F ${_chunkDRO3NXA3cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
3277
3321
|
);
|
|
3278
3322
|
}
|
|
3279
3323
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -3281,7 +3325,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3281
3325
|
).flatMap(({ plan: plan2 }) => plan2.isolatedBoundaries);
|
|
3282
3326
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
3283
3327
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
3284
|
-
const islandStrategy =
|
|
3328
|
+
const islandStrategy = _chunkARORZ3MHcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3285
3329
|
route,
|
|
3286
3330
|
metadata,
|
|
3287
3331
|
clientLayouts2,
|
|
@@ -3300,7 +3344,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3300
3344
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
3301
3345
|
],
|
|
3302
3346
|
// The server renders a server tree only below a hydrating layout.
|
|
3303
|
-
...
|
|
3347
|
+
..._chunkDRO3NXA3cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
3304
3348
|
});
|
|
3305
3349
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
3306
3350
|
}
|
|
@@ -3337,7 +3381,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3337
3381
|
}
|
|
3338
3382
|
const clientRouteSlots2 = routeSlots.filter((slot) => {
|
|
3339
3383
|
try {
|
|
3340
|
-
const metadata =
|
|
3384
|
+
const metadata = _chunkDRO3NXA3cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
3341
3385
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
3342
3386
|
} catch (error) {
|
|
3343
3387
|
_chunk7U4XF76Rcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
@@ -3388,13 +3432,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3388
3432
|
config.renderer,
|
|
3389
3433
|
config.publicRuntimeConfig,
|
|
3390
3434
|
config.trailingSlash,
|
|
3391
|
-
|
|
3435
|
+
_chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
3392
3436
|
config.basePath,
|
|
3393
|
-
|
|
3437
|
+
_chunkARORZ3MHcjs.generateClientCachePersistenceCode.call(void 0, _chunkARORZ3MHcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
3394
3438
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
3395
3439
|
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _117 => _117.experimental, 'optionalAccess', _118 => _118.serverComponents])) === "islands",
|
|
3396
3440
|
platform,
|
|
3397
|
-
islandsMode ?
|
|
3441
|
+
islandsMode ? _chunkDRO3NXA3cjs.collectFarmServerStylesheets.call(void 0,
|
|
3398
3442
|
[
|
|
3399
3443
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
3400
3444
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -3413,7 +3457,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3413
3457
|
await fs5.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
|
|
3414
3458
|
}
|
|
3415
3459
|
const clientInput = { [entryName]: clientEntryPath };
|
|
3416
|
-
if (platform === "web" &&
|
|
3460
|
+
if (platform === "web" && _chunkARORZ3MHcjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
3417
3461
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
3418
3462
|
await fs5.writeFile(
|
|
3419
3463
|
clientBootPath,
|
|
@@ -3424,7 +3468,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3424
3468
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
3425
3469
|
let postcssSearchPath;
|
|
3426
3470
|
let tailwindVitePlugin = void 0;
|
|
3427
|
-
const rendererVitePlugins = await
|
|
3471
|
+
const rendererVitePlugins = await _chunkBCTHOQPPcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
|
|
3428
3472
|
ssr: false,
|
|
3429
3473
|
buildLifetime: rendererBuildLifetime
|
|
3430
3474
|
});
|
|
@@ -3434,7 +3478,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3434
3478
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
3435
3479
|
await fs5.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
3436
3480
|
postcssSearchPath = clientEntryDir;
|
|
3437
|
-
tailwindVitePlugin = await
|
|
3481
|
+
tailwindVitePlugin = await _chunkDMSXZNQRcjs.loadTailwindVitePlugin.call(void 0, {
|
|
3438
3482
|
builder: productionVite.builder,
|
|
3439
3483
|
announce: true
|
|
3440
3484
|
});
|
|
@@ -3455,7 +3499,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3455
3499
|
target: FARM_CLIENT_BUILD_TARGET,
|
|
3456
3500
|
// Tailwind CSS 4 already requires newer browsers than that baseline. An app's own
|
|
3457
3501
|
// `build.target` or `build.cssTarget` still decides, as Vite derives one from the other.
|
|
3458
|
-
..._optionalChain([config, 'access', _119 => _119.vite, 'optionalAccess', _120 => _120.build, 'optionalAccess', _121 => _121.target]) === void 0 && _optionalChain([config, 'access', _122 => _122.vite, 'optionalAccess', _123 => _123.build, 'optionalAccess', _124 => _124.cssTarget]) === void 0 && (
|
|
3502
|
+
..._optionalChain([config, 'access', _119 => _119.vite, 'optionalAccess', _120 => _120.build, 'optionalAccess', _121 => _121.target]) === void 0 && _optionalChain([config, 'access', _122 => _122.vite, 'optionalAccess', _123 => _123.build, 'optionalAccess', _124 => _124.cssTarget]) === void 0 && (_chunkDMSXZNQRcjs.includesTailwindVitePlugin.call(void 0, tailwindVitePlugin) || _chunkDMSXZNQRcjs.includesTailwindVitePlugin.call(void 0, _optionalChain([config, 'access', _125 => _125.vite, 'optionalAccess', _126 => _126.plugins]))) ? { cssTarget: _chunkDMSXZNQRcjs.TAILWIND_CSS_BROWSER_TARGET } : {},
|
|
3459
3503
|
outDir: outputDir,
|
|
3460
3504
|
emptyOutDir: platform === "web",
|
|
3461
3505
|
// Never public: see resolveFarmClientSourcemap.
|
|
@@ -3488,7 +3532,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3488
3532
|
}
|
|
3489
3533
|
},
|
|
3490
3534
|
plugins: [
|
|
3491
|
-
|
|
3535
|
+
_chunkARORZ3MHcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
3492
3536
|
createFarmPrivateClientSourcemapsPlugin({
|
|
3493
3537
|
outDir: _path2.default.join(
|
|
3494
3538
|
_path2.default.dirname(outputDir),
|
|
@@ -3508,8 +3552,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3508
3552
|
_path2.default.join(clientEntryDir, `${FARM_CLIENT_ROUTE_TABLE_MODULE}.tsx`)
|
|
3509
3553
|
],
|
|
3510
3554
|
// What the islands entry loads with its first render or hydration (RFC 0010).
|
|
3511
|
-
...islandsMode &&
|
|
3555
|
+
...islandsMode && _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? {
|
|
3512
3556
|
rendererImports: [
|
|
3557
|
+
"react",
|
|
3513
3558
|
"react-dom/client",
|
|
3514
3559
|
"@farm.js/core/internal/islands-runtime"
|
|
3515
3560
|
],
|
|
@@ -3532,7 +3577,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3532
3577
|
...rendererVitePlugins,
|
|
3533
3578
|
...config.vite.plugins || [],
|
|
3534
3579
|
farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
|
|
3535
|
-
|
|
3580
|
+
farmNavigationPlugin(config.renderer),
|
|
3581
|
+
_chunkARORZ3MHcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3536
3582
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3537
3583
|
),
|
|
3538
3584
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3565,7 +3611,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3565
3611
|
},
|
|
3566
3612
|
load: {
|
|
3567
3613
|
filter: {
|
|
3568
|
-
id:
|
|
3614
|
+
id: _chunkARORZ3MHcjs.exactIdPattern.call(void 0, [
|
|
3569
3615
|
"\0empty-module",
|
|
3570
3616
|
"\0empty-api-route",
|
|
3571
3617
|
"\0farm-i18n-client-bridge",
|
|
@@ -3603,7 +3649,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3603
3649
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes, sourceSnapshot },
|
|
3604
3650
|
pluginManager
|
|
3605
3651
|
),
|
|
3606
|
-
|
|
3652
|
+
_chunkDRO3NXA3cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
3607
3653
|
],
|
|
3608
3654
|
mode: "production",
|
|
3609
3655
|
css: postcssSearchPath ? {
|
|
@@ -3611,7 +3657,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3611
3657
|
} : void 0,
|
|
3612
3658
|
// Ensure React is bundled for client
|
|
3613
3659
|
resolve: {
|
|
3614
|
-
alias:
|
|
3660
|
+
alias: _chunkARORZ3MHcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
3615
3661
|
dedupe: [...config.renderer.dedupe || []]
|
|
3616
3662
|
},
|
|
3617
3663
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -3625,7 +3671,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3625
3671
|
}
|
|
3626
3672
|
};
|
|
3627
3673
|
await viteBuild(
|
|
3628
|
-
|
|
3674
|
+
_chunkARORZ3MHcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
|
|
3629
3675
|
);
|
|
3630
3676
|
if (platform === "mobile") {
|
|
3631
3677
|
await fs5.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
@@ -3719,9 +3765,9 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
3719
3765
|
return response;
|
|
3720
3766
|
}
|
|
3721
3767
|
|
|
3722
|
-
${streamNavigations ? `${
|
|
3768
|
+
${streamNavigations ? `${_chunkARORZ3MHcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
3723
3769
|
|
|
3724
|
-
${
|
|
3770
|
+
${_chunkARORZ3MHcjs.FARM_EARLY_NAVIGATION_SOURCE}` : ""}
|
|
3725
3771
|
|
|
3726
3772
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
3727
3773
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -4450,9 +4496,9 @@ ${streamNavigations ? ` // A streamed navigation swaps in the page's shell; its
|
|
|
4450
4496
|
const response = await fetchFarmNavigationDocument(url, {
|
|
4451
4497
|
"Accept": "text/html",
|
|
4452
4498
|
...(interceptFrom ? { "X-Farm-Intercept-From": interceptFrom } : {}),
|
|
4453
|
-
// Islands mode: the server leaves out island values this browser holds
|
|
4454
|
-
// layouts it shows.
|
|
4455
|
-
...getFarmIslandValueHeaders(),
|
|
4499
|
+
// Islands mode: the server leaves out island values this browser holds (the swap keeps
|
|
4500
|
+
// the ones only the page holds, keepFarmIslandValues), and the layouts it shows.
|
|
4501
|
+
...getFarmIslandValueHeaders(${streamNavigations ? 'document.getElementById("root") || document.body' : ""}),
|
|
4456
4502
|
...partialHeaders,
|
|
4457
4503
|
...(streamShell ? { "F-Stream": "flush" } : {}),
|
|
4458
4504
|
}, recover, signal);
|
|
@@ -4872,19 +4918,18 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
4872
4918
|
secure: false
|
|
4873
4919
|
},
|
|
4874
4920
|
direction: {}
|
|
4875
|
-
}, plugins = [], renderer =
|
|
4921
|
+
}, plugins = [], renderer = _chunkBCTHOQPPcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
|
|
4876
4922
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
4877
|
-
const clientPluginEntry =
|
|
4923
|
+
const clientPluginEntry = _chunkDMSXZNQRcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4878
4924
|
plugins,
|
|
4879
4925
|
root,
|
|
4880
4926
|
srcDir,
|
|
4881
4927
|
publicRuntimeConfig,
|
|
4882
4928
|
platform
|
|
4883
4929
|
);
|
|
4884
|
-
const appSetupPath =
|
|
4885
|
-
const lazyRenderer = islandValues && platform !== "mobile" &&
|
|
4886
|
-
const rendererClientImports = lazyRenderer ? `import React from "react";
|
|
4887
|
-
import { holdFarmIslandInteractions, restorePagePosition } from "@farm.js/core/internal/client-runtime";` : _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
|
|
4930
|
+
const appSetupPath = _chunkBCTHOQPPcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
4931
|
+
const lazyRenderer = islandValues && platform !== "mobile" && _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) && clientRouteSlots.length === 0;
|
|
4932
|
+
const rendererClientImports = lazyRenderer ? `import { holdFarmIslandInteractions, restorePagePosition, watchFarmIslandTriggers } from "@farm.js/core/internal/client-runtime";` : _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
|
|
4888
4933
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
4889
4934
|
import { restorePagePosition } from "@farm.js/core/internal/client-runtime";` : (
|
|
4890
4935
|
// Named exports only, as the server entry and the development client read them. A copy
|
|
@@ -4897,7 +4942,8 @@ __farmConfigureApp(__farmAppSetup);` : `import * as __farmRendererClient from ${
|
|
|
4897
4942
|
import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
|
|
4898
4943
|
const React = { ...__farmRendererClient };`
|
|
4899
4944
|
);
|
|
4900
|
-
const
|
|
4945
|
+
const hydrateFarmRouteCall = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);";
|
|
4946
|
+
const providerClientCode = _chunkARORZ3MHcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4901
4947
|
integrationProviders,
|
|
4902
4948
|
root,
|
|
4903
4949
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -4920,18 +4966,18 @@ const React = { ...__farmRendererClient };`
|
|
|
4920
4966
|
const layoutImportStatements = [];
|
|
4921
4967
|
const layoutRegistrations = [];
|
|
4922
4968
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
4923
|
-
const treeLayoutPatterns = islandValues ?
|
|
4969
|
+
const treeLayoutPatterns = islandValues ? _chunkNEKO3HM2cjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
|
|
4924
4970
|
layoutRoutes.forEach((layout, index) => {
|
|
4925
4971
|
const relativePath = toImportPath(layout.modulePath);
|
|
4926
4972
|
const treeLayout = treeLayoutPatterns.has(layout.pattern);
|
|
4927
4973
|
const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
|
|
4928
|
-
(pattern) =>
|
|
4974
|
+
(pattern) => _chunkNEKO3HM2cjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
|
|
4929
4975
|
);
|
|
4930
4976
|
if (rendersOnClient && !treeLayout) {
|
|
4931
4977
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
4932
4978
|
}
|
|
4933
|
-
const groupScope =
|
|
4934
|
-
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(
|
|
4979
|
+
const groupScope = _chunkNEKO3HM2cjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
4980
|
+
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkNEKO3HM2cjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
|
|
4935
4981
|
layoutRegistrations.push(
|
|
4936
4982
|
` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? treeLayout ? `getFarmTreeLayoutComponent(${JSON.stringify(layout.pattern)})` : `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)}${treeLayout ? ", serverTree: true" : ""} }`
|
|
4937
4983
|
);
|
|
@@ -5018,7 +5064,7 @@ mountFarmDocsSearch();
|
|
|
5018
5064
|
|
|
5019
5065
|
${generateUniversalRouterStateRuntime()}
|
|
5020
5066
|
|
|
5021
|
-
${
|
|
5067
|
+
${_chunkARORZ3MHcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5022
5068
|
|
|
5023
5069
|
// SPA Router for server-rendered pages (HTML swap)
|
|
5024
5070
|
const spaRouter = {
|
|
@@ -5171,11 +5217,12 @@ ${generateUniversalRouterStateProperties()}
|
|
|
5171
5217
|
|
|
5172
5218
|
reconcileFarmDocumentHead(doc);
|
|
5173
5219
|
|
|
5174
|
-
// Swap root content
|
|
5220
|
+
// Swap root content: the parsed nodes themselves, not markup the page parses again.
|
|
5175
5221
|
const newRoot = doc.getElementById("root");
|
|
5176
5222
|
const currentRoot = document.getElementById("root");
|
|
5177
5223
|
if (!newRoot || !currentRoot) return this.swapDocument(doc);
|
|
5178
|
-
|
|
5224
|
+
adoptFarmParsedNodes(newRoot);
|
|
5225
|
+
currentRoot.replaceChildren(...newRoot.childNodes);
|
|
5179
5226
|
return true;
|
|
5180
5227
|
},
|
|
5181
5228
|
|
|
@@ -5192,7 +5239,8 @@ ${generateUniversalRouterStateProperties()}
|
|
|
5192
5239
|
});
|
|
5193
5240
|
|
|
5194
5241
|
document.head.innerHTML = doc.head ? doc.head.innerHTML : "";
|
|
5195
|
-
|
|
5242
|
+
adoptFarmParsedNodes(doc.body);
|
|
5243
|
+
document.body.replaceChildren(...doc.body.childNodes);
|
|
5196
5244
|
delete window.__farmDocsRuntime;
|
|
5197
5245
|
delete window.__farmDocsPageActionsRuntime;
|
|
5198
5246
|
|
|
@@ -5327,7 +5375,8 @@ installFarmLinkPrefetch();
|
|
|
5327
5375
|
...serverTreeEnabled ? ["createFarmServerTreeElement"] : [],
|
|
5328
5376
|
...hasServerTreeLayouts ? ["createFarmServerTreeLayout"] : []
|
|
5329
5377
|
].join(", ");
|
|
5330
|
-
const lazyRendererRuntime = lazyRenderer ? `// React DOM${isolatedHydrationEnabled ? " and islx" : ""} load with the first render or hydration (RFC 0010).
|
|
5378
|
+
const lazyRendererRuntime = lazyRenderer ? `// React, React DOM${isolatedHydrationEnabled ? " and islx" : ""} load with the first render or hydration (RFC 0010).
|
|
5379
|
+
let React;
|
|
5331
5380
|
let createRoot;
|
|
5332
5381
|
let hydrateRoot;
|
|
5333
5382
|
let farmRendererLoading = null;
|
|
@@ -5337,14 +5386,16 @@ let farmRendererLoaded = false;${isolatedHydrationEnabled ? `
|
|
|
5337
5386
|
const releaseFarmIslandInteractions = holdFarmIslandInteractions("f-island");` : ""}
|
|
5338
5387
|
function loadFarmRenderer() {
|
|
5339
5388
|
return farmRendererLoading || (farmRendererLoading = Promise.all([
|
|
5389
|
+
import("react"),
|
|
5340
5390
|
import("react-dom/client"),${isolatedHydrationEnabled ? `
|
|
5341
5391
|
// Named here, so the build keeps only these of islx's exports.
|
|
5342
5392
|
import("@farm.js/core/internal/islands-runtime").then(function({ ${islandsRuntimeExports} }) {
|
|
5343
5393
|
return { ${islandsRuntimeExports} };
|
|
5344
5394
|
}),` : ""}
|
|
5345
5395
|
]).then(function(modules) {
|
|
5346
|
-
|
|
5347
|
-
|
|
5396
|
+
React = modules[0].default;
|
|
5397
|
+
createRoot = modules[1].createRoot;
|
|
5398
|
+
hydrateRoot = modules[1].hydrateRoot;${isolatedHydrationEnabled ? "\n startFarmIslandsRuntime(modules[2]);\n releaseFarmIslandInteractions();\n runFarmIslandsWaiting();" : ""}
|
|
5348
5399
|
farmRendererLoaded = true;
|
|
5349
5400
|
}, function(error) {${isolatedHydrationEnabled ? `
|
|
5350
5401
|
// Without islx a held click would never replay: the page acts natively again.
|
|
@@ -5381,26 +5432,55 @@ function startFarmIslandsRuntime(islands) {
|
|
|
5381
5432
|
// A hydrating layout keeps a non-hydrating page as server HTML; this wrapper runs its islands.
|
|
5382
5433
|
FarmServerPage = islands.createFarmServerPageBoundary(React, farmIslandsRuntime);
|
|
5383
5434
|
}
|
|
5384
|
-
//
|
|
5385
|
-
//
|
|
5386
|
-
|
|
5435
|
+
// islx loads with the first island that is due, as the boot decides on a first load: at once for
|
|
5436
|
+
// one that hydrates at load, else on its trigger. A page or navigation of islands that wait loads
|
|
5437
|
+
// none of it. Until it loads, calls wait here in the order they were made and run with it.
|
|
5438
|
+
const farmIslandsWaiting = [];
|
|
5439
|
+
function runFarmIslandsWaiting() {
|
|
5440
|
+
for (const entry of farmIslandsWaiting.splice(0)) {
|
|
5441
|
+
if (entry.stop) entry.stop();
|
|
5442
|
+
entry.run(farmIslandsRuntime);
|
|
5443
|
+
}
|
|
5444
|
+
}
|
|
5445
|
+
// Behind a load under way, calls wait for it; one that fails reports itself to whoever awaited it.
|
|
5446
|
+
function whenFarmIslandsRuntime(scope, call) {
|
|
5387
5447
|
if (farmIslandsRuntime) call(farmIslandsRuntime);
|
|
5388
5448
|
else if (farmRendererLoading) farmRendererLoading.then(function() { call(farmIslandsRuntime); }, function() {});
|
|
5449
|
+
else farmIslandsWaiting.push({ scope: scope, run: call });
|
|
5389
5450
|
}
|
|
5390
5451
|
const farmIsolatedHydrationRuntime = {
|
|
5391
5452
|
hydrate: function(scope, signal) {
|
|
5392
5453
|
if (farmIslandsRuntime) return farmIslandsRuntime.hydrate(scope, signal);
|
|
5393
|
-
|
|
5454
|
+
const stop = farmRendererLoading
|
|
5455
|
+
? null
|
|
5456
|
+
: watchFarmIslandTriggers(scope, "f-island", function() { void loadFarmRenderer(); });
|
|
5457
|
+
if (!stop) return loadFarmRenderer().then(function() { return farmIslandsRuntime.hydrate(scope, signal); });
|
|
5458
|
+
farmIslandsWaiting.push({
|
|
5459
|
+
scope: scope,
|
|
5460
|
+
stop: stop,
|
|
5461
|
+
run: function(runtime) {
|
|
5462
|
+
if (!signal || !signal.aborted) void runtime.hydrate(scope, signal);
|
|
5463
|
+
},
|
|
5464
|
+
});
|
|
5465
|
+
return Promise.resolve();
|
|
5394
5466
|
},
|
|
5395
5467
|
dispose: function(scope) {
|
|
5396
|
-
|
|
5468
|
+
if (farmIslandsRuntime) return farmIslandsRuntime.dispose(scope);
|
|
5469
|
+
// Nothing has hydrated yet: what removed DOM waits for goes with it.
|
|
5470
|
+
for (let index = farmIslandsWaiting.length - 1; index >= 0; index--) {
|
|
5471
|
+
const entry = farmIslandsWaiting[index];
|
|
5472
|
+
if (!scope.contains(entry.scope)) continue;
|
|
5473
|
+
farmIslandsWaiting.splice(index, 1);
|
|
5474
|
+
if (entry.stop) entry.stop();
|
|
5475
|
+
}
|
|
5476
|
+
if (farmRendererLoading) farmRendererLoading.then(function() { farmIslandsRuntime.dispose(scope); }, function() {});
|
|
5397
5477
|
},
|
|
5398
5478
|
// Only a hydrated island has state to carry over.
|
|
5399
5479
|
carryOver: function(from, to) {
|
|
5400
5480
|
if (farmIslandsRuntime) farmIslandsRuntime.carryOver(from, to);
|
|
5401
5481
|
},
|
|
5402
5482
|
endStream: function(root) {
|
|
5403
|
-
whenFarmIslandsRuntime(function(runtime) { runtime.endStream(root); });
|
|
5483
|
+
whenFarmIslandsRuntime(root, function(runtime) { runtime.endStream(root); });
|
|
5404
5484
|
},
|
|
5405
5485
|
};` : `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
|
|
5406
5486
|
ReactRuntime: React,
|
|
@@ -5458,7 +5538,7 @@ ${layoutImports}
|
|
|
5458
5538
|
${rendererClientImports}
|
|
5459
5539
|
${isolatedHydrationImport}
|
|
5460
5540
|
${providerClientCode.imports}
|
|
5461
|
-
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5541
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, replayFarmQueuedInteraction, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5462
5542
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
5463
5543
|
import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
|
|
5464
5544
|
${clientPluginEntry.imports}
|
|
@@ -5537,7 +5617,7 @@ function hasHydratableLayout(pathname) {
|
|
|
5537
5617
|
});
|
|
5538
5618
|
}
|
|
5539
5619
|
|
|
5540
|
-
${
|
|
5620
|
+
${_chunkARORZ3MHcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5541
5621
|
// Wrap a page element with applicable layouts
|
|
5542
5622
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
5543
5623
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -5572,7 +5652,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
5572
5652
|
return React.createElement("div", props, pageElement);
|
|
5573
5653
|
}
|
|
5574
5654
|
let farmLastRouteState = null;
|
|
5575
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
5655
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkARORZ3MHcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
5576
5656
|
function farmTreeLayoutsOf(pathname) {
|
|
5577
5657
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
5578
5658
|
return layout.serverTree === true;
|
|
@@ -5693,7 +5773,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, navi
|
|
|
5693
5773
|
|
|
5694
5774
|
if (!pageElement) return null;
|
|
5695
5775
|
if (!hydrateLayouts) {
|
|
5696
|
-
${
|
|
5776
|
+
${_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) ? "if (hydrationContainer) pageElement = restorePagePosition(React, hydrationContainer, pageElement);" : ""}
|
|
5697
5777
|
return createFarmRouteState(pageElement, pathname, params, false);
|
|
5698
5778
|
}
|
|
5699
5779
|
if (matched.route.pageShouldHydrate) {
|
|
@@ -5722,7 +5802,16 @@ function createFarmRouteState(page, pathname, params, includeLayouts) {
|
|
|
5722
5802
|
|
|
5723
5803
|
function hydrateFarmRoute(container, route) {
|
|
5724
5804
|
farmLastRouteState = route;
|
|
5725
|
-
${
|
|
5805
|
+
${_chunkBCTHOQPPcjs.getFarmRendererCapabilities.call(void 0, renderer).hydrationFallback ? `try {
|
|
5806
|
+
${hydrateFarmRouteCall}
|
|
5807
|
+
} catch (error) {
|
|
5808
|
+
// The renderer opted in with capabilities.hydrationFallback, as development always does. The
|
|
5809
|
+
// page still works, but the server's DOM, focus, and typed input are gone, so say so.
|
|
5810
|
+
console.error("[Farm.js] Hydration error; rendering the page on the client instead:", error);
|
|
5811
|
+
const root = createRoot(container);
|
|
5812
|
+
renderFarmRoute(root, route);
|
|
5813
|
+
return root;
|
|
5814
|
+
}` : hydrateFarmRouteCall}
|
|
5726
5815
|
}
|
|
5727
5816
|
|
|
5728
5817
|
function renderFarmRoute(root, route) {
|
|
@@ -5880,6 +5969,26 @@ function renderClientRouteSlot(slot, registration, mode) {
|
|
|
5880
5969
|
return true;
|
|
5881
5970
|
}
|
|
5882
5971
|
|
|
5972
|
+
// The document's pre-hydration hold keeps clicks and submits until what they target hydrates, as in
|
|
5973
|
+
// development. A hydrated route slot stops holding its own and replays what it held, as the page's
|
|
5974
|
+
// scheduler does for the page.
|
|
5975
|
+
function replayPreHydrationClicks(container) {
|
|
5976
|
+
container.dataset.farmIslandHydrated = "true";
|
|
5977
|
+
const queue = Array.isArray(window.__FARM_PREHYDRATION_CLICK_QUEUE__)
|
|
5978
|
+
? window.__FARM_PREHYDRATION_CLICK_QUEUE__
|
|
5979
|
+
: [];
|
|
5980
|
+
const held = queue.filter(function(item) {
|
|
5981
|
+
return item && item.target instanceof Element && container.contains(item.target);
|
|
5982
|
+
});
|
|
5983
|
+
if (held.length === 0) return;
|
|
5984
|
+
queue.splice(0, queue.length, ...queue.filter(function(item) { return held.indexOf(item) === -1; }));
|
|
5985
|
+
for (const item of held) {
|
|
5986
|
+
setTimeout(function() {
|
|
5987
|
+
if (item.target.isConnected) replayFarmQueuedInteraction(item.target, item.kind);
|
|
5988
|
+
}, 0);
|
|
5989
|
+
}
|
|
5990
|
+
}
|
|
5991
|
+
|
|
5883
5992
|
function hydrateInitialRouteSlots() {
|
|
5884
5993
|
const slots = Array.isArray(window.__FARM_ROUTE_SLOTS__)
|
|
5885
5994
|
? window.__FARM_ROUTE_SLOTS__
|
|
@@ -5888,7 +5997,9 @@ function hydrateInitialRouteSlots() {
|
|
|
5888
5997
|
const registration = findClientRouteSlot(slot);
|
|
5889
5998
|
if (!registration) continue;
|
|
5890
5999
|
try {
|
|
5891
|
-
renderClientRouteSlot(slot, registration, "hydrate")
|
|
6000
|
+
if (renderClientRouteSlot(slot, registration, "hydrate")) {
|
|
6001
|
+
replayPreHydrationClicks(document.getElementById(slot.containerId));
|
|
6002
|
+
}
|
|
5892
6003
|
} catch (error) {
|
|
5893
6004
|
console.warn("[Farm.js] Could not hydrate route slot:", slot.name, error);
|
|
5894
6005
|
}
|
|
@@ -5957,6 +6068,15 @@ function setFarmHydrated() {
|
|
|
5957
6068
|
isHydrated = true;
|
|
5958
6069
|
}
|
|
5959
6070
|
|
|
6071
|
+
// The document's head script holds clicks and submits until the page hydrates. Once the first
|
|
6072
|
+
// hydration settles it holds nothing more, as in development: each root that hydrated replayed
|
|
6073
|
+
// what it held, and a navigation's page renders in a React root that takes its own clicks.
|
|
6074
|
+
function markFarmHydrated() {
|
|
6075
|
+
if (window.__FARM_HYDRATED__ !== false) return;
|
|
6076
|
+
window.__FARM_HYDRATED__ = true;
|
|
6077
|
+
document.documentElement.dataset.farmHydrated = "true";
|
|
6078
|
+
}
|
|
6079
|
+
|
|
5960
6080
|
${generateUniversalRouterStateRuntime(islandValues)}
|
|
5961
6081
|
|
|
5962
6082
|
function cancelPendingPageHydration() {
|
|
@@ -6161,7 +6281,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
6161
6281
|
return true;
|
|
6162
6282
|
}` : ""}
|
|
6163
6283
|
|
|
6164
|
-
${
|
|
6284
|
+
${_chunkARORZ3MHcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
6165
6285
|
|
|
6166
6286
|
function activateNavigationScripts(root) {
|
|
6167
6287
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -6198,9 +6318,12 @@ async function streamFarmNavigation(stream, root, isCurrent) {
|
|
|
6198
6318
|
for (let flush = await stream.next(); flush !== null; flush = await stream.next()) {
|
|
6199
6319
|
if (!isCurrent()) return stream.cancel();
|
|
6200
6320
|
html += flush;
|
|
6201
|
-
const parsed = new DOMParser()
|
|
6321
|
+
const parsed = new DOMParser()
|
|
6322
|
+
.parseFromString('<div id="root">' + flush, "text/html")
|
|
6323
|
+
.getElementById("root");
|
|
6324
|
+
adoptFarmParsedNodes(parsed);
|
|
6202
6325
|
const fragment = document.createDocumentFragment();
|
|
6203
|
-
for (const node of Array.from(parsed.
|
|
6326
|
+
for (const node of Array.from(parsed.childNodes)) fragment.appendChild(node);
|
|
6204
6327
|
activateNavigationScripts(fragment);
|
|
6205
6328
|
root.appendChild(fragment);
|
|
6206
6329
|
}
|
|
@@ -6264,7 +6387,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
6264
6387
|
return shell.innerHTML;
|
|
6265
6388
|
}
|
|
6266
6389
|
|
|
6267
|
-
${islandValues ?
|
|
6390
|
+
${islandValues ? _chunkARORZ3MHcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
6268
6391
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
6269
6392
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
6270
6393
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -6296,6 +6419,8 @@ ${islandValues ? _chunkX4TSMQWFcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function repl
|
|
|
6296
6419
|
${isolatedHydrationEnabled ? `${islandValues ? `// A refresh keeps the islands still on the page, with their state and new props.
|
|
6297
6420
|
if (refresh) farmIsolatedHydrationRuntime.carryOver(currentTarget, nextTarget);
|
|
6298
6421
|
` : ""}disposeFarmIsolatedClientBoundaries(currentTarget);` : ""}
|
|
6422
|
+
// After the comparison: a noscript turned to text serializes escaped in the parsed document.
|
|
6423
|
+
adoptFarmParsedNodes(nextRoot);
|
|
6299
6424
|
currentTarget.replaceWith(nextTarget);${islandValues ? "\n if (fields) restoreFarmServerFields(fields, nextTarget);" : ""}
|
|
6300
6425
|
activateNavigationScripts(nextTarget);
|
|
6301
6426
|
if (nextTreeRoot && nextTreeRoot !== nextTarget) nextTreeRoot.remove();
|
|
@@ -6695,6 +6820,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6695
6820
|
|
|
6696
6821
|
${islandValues ? `// A payload-only page renders only in a React root that rebuilds it.
|
|
6697
6822
|
if (nextPage?.querySelector('script[type="f/tree"][partial]')) return "segment-mismatch";` : ""}
|
|
6823
|
+
${islandValues ? "const keepValues = keepFarmIslandValues(currentRoot);" : ""}
|
|
6698
6824
|
const rootWasReactOwned = reactRootContainer === currentRoot;
|
|
6699
6825
|
resetReactRoot();
|
|
6700
6826
|
resetRouteSlotRoots();
|
|
@@ -6707,10 +6833,13 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6707
6833
|
${islandValues ? 'if (!replacedSharedBoundary && isSegment) return "segment-mismatch";' : ""}
|
|
6708
6834
|
if (!replacedSharedBoundary) {
|
|
6709
6835
|
${isolatedHydrationEnabled ? "disposeFarmIsolatedClientBoundaries(currentRoot);" : ""}
|
|
6710
|
-
|
|
6836
|
+
// The parsed nodes themselves, not markup the page parses again.
|
|
6837
|
+
adoptFarmParsedNodes(newRoot);
|
|
6838
|
+
currentRoot.replaceChildren(...newRoot.childNodes);
|
|
6711
6839
|
activateNavigationScripts(currentRoot);
|
|
6712
6840
|
isolatedHydrationScope = currentRoot;
|
|
6713
6841
|
}
|
|
6842
|
+
${islandValues ? "keepValues();" : ""}
|
|
6714
6843
|
window.__FARM_ROUTE_SLOTS__ = nextRouteSlots;
|
|
6715
6844
|
hydrateInitialRouteSlots();
|
|
6716
6845
|
|
|
@@ -6788,7 +6917,8 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6788
6917
|
});
|
|
6789
6918
|
|
|
6790
6919
|
document.head.innerHTML = doc.head ? doc.head.innerHTML : "";
|
|
6791
|
-
|
|
6920
|
+
adoptFarmParsedNodes(doc.body);
|
|
6921
|
+
document.body.replaceChildren(...doc.body.childNodes);
|
|
6792
6922
|
delete window.__farmDocsRuntime;
|
|
6793
6923
|
delete window.__farmDocsPageActionsRuntime;
|
|
6794
6924
|
|
|
@@ -6907,13 +7037,18 @@ document.addEventListener("click", function(e) {
|
|
|
6907
7037
|
if (isFarmDocsSearchPage()) {
|
|
6908
7038
|
mountFarmDocsSearch();
|
|
6909
7039
|
}
|
|
6910
|
-
void hydrate();
|
|
7040
|
+
void hydrate().finally(markFarmHydrated);
|
|
6911
7041
|
`.trim();
|
|
6912
7042
|
}
|
|
6913
7043
|
async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime, sourceSnapshot) {
|
|
6914
7044
|
const viteBuild = productionVite.build;
|
|
6915
|
-
const {
|
|
6916
|
-
|
|
7045
|
+
const {
|
|
7046
|
+
farmIslandContainersPlugin,
|
|
7047
|
+
farmNavigationPlugin,
|
|
7048
|
+
farmPlugin,
|
|
7049
|
+
farmServerOnlyEntriesPlugin
|
|
7050
|
+
} = await import("./vite.cjs");
|
|
7051
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-3PT7I26P.cjs");
|
|
6917
7052
|
const fs5 = await import("fs/promises");
|
|
6918
7053
|
const pluginManager = new PluginManager2({
|
|
6919
7054
|
config,
|
|
@@ -6924,7 +7059,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6924
7059
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
6925
7060
|
let postcssConfigDir;
|
|
6926
7061
|
let tailwindVitePlugin = void 0;
|
|
6927
|
-
const rendererVitePlugins = await
|
|
7062
|
+
const rendererVitePlugins = await _chunkBCTHOQPPcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
|
|
6928
7063
|
ssr: true,
|
|
6929
7064
|
buildLifetime: rendererBuildLifetime
|
|
6930
7065
|
});
|
|
@@ -6934,7 +7069,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6934
7069
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
6935
7070
|
"module.exports = { plugins: [] };\n"
|
|
6936
7071
|
);
|
|
6937
|
-
tailwindVitePlugin = await
|
|
7072
|
+
tailwindVitePlugin = await _chunkDMSXZNQRcjs.loadTailwindVitePlugin.call(void 0, {
|
|
6938
7073
|
builder: productionVite.builder,
|
|
6939
7074
|
label: "for SSR"
|
|
6940
7075
|
});
|
|
@@ -7013,7 +7148,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7013
7148
|
modulePath: entry.modulePath
|
|
7014
7149
|
})) : [];
|
|
7015
7150
|
const i18nCatalogs = config.i18n.enabled ? (await _chunkCYOTNHDFcjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
|
|
7016
|
-
const appDirs =
|
|
7151
|
+
const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config);
|
|
7017
7152
|
let openAPIReference = null;
|
|
7018
7153
|
if (config.openapi.enabled && config.openapi.route) {
|
|
7019
7154
|
const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-PX4QN4HK.cjs");
|
|
@@ -7040,8 +7175,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7040
7175
|
config: await readMiddlewareFileConfig(route.filePath)
|
|
7041
7176
|
}))
|
|
7042
7177
|
);
|
|
7043
|
-
const instrumentationPath =
|
|
7044
|
-
const notFoundPath =
|
|
7178
|
+
const instrumentationPath = _chunk3BTN3NP7cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
7179
|
+
const notFoundPath = _chunkARORZ3MHcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
7045
7180
|
if (notFoundPath) _chunk7U4XF76Rcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
7046
7181
|
layoutRoutes.sort((a, b) => {
|
|
7047
7182
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -7058,14 +7193,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7058
7193
|
const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
|
|
7059
7194
|
(integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
|
|
7060
7195
|
);
|
|
7061
|
-
const hasIntegrationProviders =
|
|
7196
|
+
const hasIntegrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations).some(
|
|
7062
7197
|
(provider) => provider.component || provider.type === "clerk"
|
|
7063
7198
|
);
|
|
7064
7199
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
7065
7200
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _136 => _136.mdx, 'optionalAccess', _137 => _137.components]));
|
|
7066
|
-
const hasMiddlewareConfig =
|
|
7067
|
-
const hasRouteContextConfig =
|
|
7068
|
-
const hasServerRuntimePlugins =
|
|
7201
|
+
const hasMiddlewareConfig = _chunkNEKO3HM2cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
7202
|
+
const hasRouteContextConfig = _chunkLM2ZDNDDcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
7203
|
+
const hasServerRuntimePlugins = _chunkDMSXZNQRcjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
|
|
7069
7204
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
7070
7205
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
7071
7206
|
const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasFarmServerStorageConfig(config.storage) || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
|
|
@@ -7074,9 +7209,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7074
7209
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
7075
7210
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
7076
7211
|
);
|
|
7077
|
-
if (
|
|
7212
|
+
if (_chunkHHQEKLZLcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
7078
7213
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
7079
|
-
|
|
7214
|
+
_chunkHHQEKLZLcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
7080
7215
|
config.docs,
|
|
7081
7216
|
{ root, srcDir: config.srcDir },
|
|
7082
7217
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
@@ -7086,7 +7221,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7086
7221
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
7087
7222
|
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _138 => _138.docs, 'optionalAccess', _139 => _139.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunk2RSVYJT6cjs._runWithFarmCspNonce.call(void 0,
|
|
7088
7223
|
farmDocsCspNonceMarker,
|
|
7089
|
-
async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await
|
|
7224
|
+
async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await _chunkHHQEKLZLcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
7090
7225
|
root,
|
|
7091
7226
|
srcDir: config.srcDir,
|
|
7092
7227
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -7146,7 +7281,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7146
7281
|
(image) => image.sourceType === "module"
|
|
7147
7282
|
);
|
|
7148
7283
|
const externalMetadataImageRuntime = useExternalMetadataImageRuntime && !omitCoreMetadataImageRuntime ? ["@vercel/og"] : [];
|
|
7149
|
-
const rendererOptionalExternals =
|
|
7284
|
+
const rendererOptionalExternals = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
|
|
7150
7285
|
"react",
|
|
7151
7286
|
"react/jsx-runtime",
|
|
7152
7287
|
"react/jsx-dev-runtime",
|
|
@@ -7253,7 +7388,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7253
7388
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _148 => _148.env, 'optionalAccess', _149 => _149.public]) || {})
|
|
7254
7389
|
},
|
|
7255
7390
|
plugins: [
|
|
7256
|
-
|
|
7391
|
+
_chunkARORZ3MHcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
7257
7392
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
7258
7393
|
...rendererVitePlugins,
|
|
7259
7394
|
...config.vite.plugins || [],
|
|
@@ -7275,6 +7410,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7275
7410
|
] : [],
|
|
7276
7411
|
{ ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
|
|
7277
7412
|
farmServerOnlyEntriesPlugin({ distDir: config.distDir || ".farm" }),
|
|
7413
|
+
farmNavigationPlugin(config.renderer),
|
|
7278
7414
|
farmIslandContainersPlugin(config),
|
|
7279
7415
|
farmPlugin(
|
|
7280
7416
|
{
|
|
@@ -7284,7 +7420,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7284
7420
|
},
|
|
7285
7421
|
pluginManager
|
|
7286
7422
|
),
|
|
7287
|
-
|
|
7423
|
+
_chunkDRO3NXA3cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
7288
7424
|
...hasRuntimeConfigModule ? [
|
|
7289
7425
|
farmStripPlatformConfigPlugin(
|
|
7290
7426
|
[
|
|
@@ -7296,7 +7432,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7296
7432
|
{
|
|
7297
7433
|
name: "farm-virtual-ssr-entry",
|
|
7298
7434
|
resolveId: {
|
|
7299
|
-
filter: { id:
|
|
7435
|
+
filter: { id: _chunkARORZ3MHcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
7300
7436
|
handler(id) {
|
|
7301
7437
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
7302
7438
|
return virtualEntryId;
|
|
@@ -7305,7 +7441,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7305
7441
|
}
|
|
7306
7442
|
},
|
|
7307
7443
|
load: {
|
|
7308
|
-
filter: { id:
|
|
7444
|
+
filter: { id: _chunkARORZ3MHcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
7309
7445
|
handler(id) {
|
|
7310
7446
|
if (id === virtualEntryId) {
|
|
7311
7447
|
return virtualEntryCode;
|
|
@@ -7337,7 +7473,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7337
7473
|
resolve: {
|
|
7338
7474
|
alias: [
|
|
7339
7475
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
7340
|
-
...Object.entries(
|
|
7476
|
+
...Object.entries(_chunkARORZ3MHcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
7341
7477
|
([find, replacement]) => ({ find, replacement })
|
|
7342
7478
|
)
|
|
7343
7479
|
],
|
|
@@ -7345,7 +7481,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7345
7481
|
dedupe: [...config.renderer.dedupe || []]
|
|
7346
7482
|
}
|
|
7347
7483
|
};
|
|
7348
|
-
await viteBuild(
|
|
7484
|
+
await viteBuild(_chunkARORZ3MHcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
7349
7485
|
} finally {
|
|
7350
7486
|
if (postcssConfigDir) {
|
|
7351
7487
|
try {
|
|
@@ -7389,7 +7525,7 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
7389
7525
|
};
|
|
7390
7526
|
return _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
|
|
7391
7527
|
(docsRoot) => _chunkHR5GU4UUcjs.discoverFarmDocsPages.call(void 0, _chunkHR5GU4UUcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
|
|
7392
|
-
).flatMap((page) => [page.href, _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) =>
|
|
7528
|
+
).flatMap((page) => [page.href, _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkNEKO3HM2cjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
7393
7529
|
}
|
|
7394
7530
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
7395
7531
|
const llmsTxt = _optionalChain([agent, 'optionalAccess', _152 => _152.llmsTxt]);
|
|
@@ -7707,7 +7843,7 @@ function getFarmBufferedPreloadMarker(html) {
|
|
|
7707
7843
|
// Prove eligibility while Farm still owns the complete document string.
|
|
7708
7844
|
// Candidate-bearing or unknown bodies must retain the full parser path.
|
|
7709
7845
|
// Response.text() strips a leading UTF-8 BOM; retain that legacy behavior.
|
|
7710
|
-
return typeof html === "string" && html.charCodeAt(0) !== 0xfeff &&
|
|
7846
|
+
return typeof html === "string" && html.charCodeAt(0) !== 0xfeff && !hasFarmHtmlPreloadToken(html) ? "none" : "1";
|
|
7711
7847
|
}
|
|
7712
7848
|
|
|
7713
7849
|
async function applyFarmPreloadBudget(response, pathname, request) {
|
|
@@ -7779,7 +7915,7 @@ async function applyFarmPreloadBudget(response, pathname, request) {
|
|
|
7779
7915
|
`.trim();
|
|
7780
7916
|
}
|
|
7781
7917
|
function generateFarmRendererAppSetupServerCode(config) {
|
|
7782
|
-
const appSetupPath =
|
|
7918
|
+
const appSetupPath = _chunkBCTHOQPPcjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
|
|
7783
7919
|
if (!appSetupPath) return "";
|
|
7784
7920
|
return `
|
|
7785
7921
|
import __farmAppSetup from ${JSON.stringify(_chunk7U4XF76Rcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
@@ -7789,16 +7925,17 @@ if (typeof ReactDOMServer.configureApp !== "function") {
|
|
|
7789
7925
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
7790
7926
|
}
|
|
7791
7927
|
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
|
|
7792
|
-
const farmRendererDisabled =
|
|
7928
|
+
const farmRendererDisabled = _chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
7793
7929
|
const searchPreserveRoutes = pageRoutes.flatMap(
|
|
7794
7930
|
(route) => route.searchPreserve ? [route.searchPreserve] : []
|
|
7795
7931
|
);
|
|
7796
7932
|
const searchPreserveRoutesSource = searchPreserveRoutes.length > 0 ? JSON.stringify(searchPreserveRoutes) : "";
|
|
7797
7933
|
const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _166 => _166.experimental, 'optionalAccess', _167 => _167.serverComponents])) === "islands";
|
|
7798
|
-
const
|
|
7934
|
+
const farmRendererActions = _chunkARORZ3MHcjs.resolveFarmIslxActionsMode.call(void 0, config) === "renderer";
|
|
7935
|
+
const farmClientBoot = _chunkARORZ3MHcjs.canBootFarmIslandsClient.call(void 0, config);
|
|
7799
7936
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
7800
7937
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
7801
|
-
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset)
|
|
7938
|
+
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "edge";
|
|
7802
7939
|
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _168 => _168.agent, 'optionalAccess', _169 => _169.crawlers, 'optionalAccess', _170 => _170.enabled])) && !applicationMetadataRoutes.some(
|
|
7803
7940
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
7804
7941
|
);
|
|
@@ -7809,9 +7946,10 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
7809
7946
|
const servesAiCatalog = _optionalChain([config, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.aiCatalog]) !== false;
|
|
7810
7947
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
7811
7948
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
7949
|
+
const reportsWebMCPCalls = hasInfraAnalyticsRuntime && _chunkCD5Z7RR5cjs._farmWebMCPReportsEnabled.call(void 0, config.plugins);
|
|
7812
7950
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
7813
7951
|
const adapterOwnsDocsRuntime = Boolean(
|
|
7814
|
-
|
|
7952
|
+
_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) && _optionalChain([config, 'access', _180 => _180.docs, 'access', _181 => _181.adapter, 'optionalAccess', _182 => _182.server]) && config.docs.adapter.react
|
|
7815
7953
|
);
|
|
7816
7954
|
if (_optionalChain([config, 'access', _183 => _183.docs, 'optionalAccess', _184 => _184.enabled]) && _optionalChain([config, 'access', _185 => _185.docs, 'access', _186 => _186.roots, 'optionalAccess', _187 => _187.length]) && !adapterOwnsDocsRuntime) {
|
|
7817
7955
|
throw new Error(
|
|
@@ -7820,13 +7958,13 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
7820
7958
|
}
|
|
7821
7959
|
const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
|
|
7822
7960
|
const adapterHandler = generateFarmDocsAdapterHandlerArguments(config.docs, docsConfigModulePath);
|
|
7823
|
-
const hasIsolatedClientGraphRuntime =
|
|
7824
|
-
const rendererStreamingCapabilities =
|
|
7961
|
+
const hasIsolatedClientGraphRuntime = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
7962
|
+
const rendererStreamingCapabilities = _chunkBCTHOQPPcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
|
|
7825
7963
|
config.renderer,
|
|
7826
7964
|
_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset)
|
|
7827
7965
|
);
|
|
7828
|
-
const hasReactSyncRender =
|
|
7829
|
-
const rendererServerImports =
|
|
7966
|
+
const hasReactSyncRender = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer);
|
|
7967
|
+
const rendererServerImports = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
|
|
7830
7968
|
import * as ReactDOMServer from "react-dom/server";
|
|
7831
7969
|
import { markPagePosition, markLayoutPosition } from "@farm.js/core/internal/production-runtime";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage, renderFarmServerTreeLayout, withFarmIslandsRender } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : (
|
|
7832
7970
|
// The renderer contract is the server module's named exports, which the development
|
|
@@ -7872,18 +8010,18 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7872
8010
|
(image) => image.sourceType === "module"
|
|
7873
8011
|
);
|
|
7874
8012
|
const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
|
|
7875
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
8013
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkNEKO3HM2cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
7876
8014
|
const farmDocsFontAssets = _optionalChain([config, 'access', _188 => _188.docs, 'optionalAccess', _189 => _189.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
7877
|
-
const integrationProviders =
|
|
8015
|
+
const integrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
7878
8016
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
7879
8017
|
(provider) => provider.component || provider.type === "clerk"
|
|
7880
8018
|
);
|
|
7881
|
-
if (renderedIntegrationProviders.length > 0 && !
|
|
8019
|
+
if (renderedIntegrationProviders.length > 0 && !_chunkBCTHOQPPcjs.getFarmRendererCapabilities.call(void 0, config.renderer).functionComponents) {
|
|
7882
8020
|
throw new Error(
|
|
7883
8021
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
7884
8022
|
);
|
|
7885
8023
|
}
|
|
7886
|
-
const providerServerModules =
|
|
8024
|
+
const providerServerModules = _chunkARORZ3MHcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
7887
8025
|
renderedIntegrationProviders,
|
|
7888
8026
|
config.root,
|
|
7889
8027
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -7903,14 +8041,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7903
8041
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
7904
8042
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
7905
8043
|
);
|
|
7906
|
-
const isolatedHydrationMode =
|
|
8044
|
+
const isolatedHydrationMode = _chunkDRO3NXA3cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
7907
8045
|
_optionalChain([config, 'access', _192 => _192.experimental, 'optionalAccess', _193 => _193.isolatedClientHydration]),
|
|
7908
8046
|
{
|
|
7909
8047
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _194 => _194.experimental, 'optionalAccess', _195 => _195.serverComponents])) === "rsc",
|
|
7910
8048
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
7911
8049
|
}
|
|
7912
8050
|
);
|
|
7913
|
-
const hydrationPlanOptions =
|
|
8051
|
+
const hydrationPlanOptions = _chunkDRO3NXA3cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
7914
8052
|
config.renderer,
|
|
7915
8053
|
Boolean(unsupportedIntegrationProvider)
|
|
7916
8054
|
);
|
|
@@ -7918,7 +8056,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7918
8056
|
...hydrationPlanOptions,
|
|
7919
8057
|
serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _196 => _196.experimental, 'optionalAccess', _197 => _197.serverComponents])) === "islands"
|
|
7920
8058
|
};
|
|
7921
|
-
const { layoutHydrationPlans, pageHydrationPlans } =
|
|
8059
|
+
const { layoutHydrationPlans, pageHydrationPlans } = _chunkDRO3NXA3cjs.withFarmSourceSnapshot.call(void 0, () => {
|
|
7922
8060
|
const layoutHydrationPlans2 = layoutRoutes.map((layout) => ({
|
|
7923
8061
|
...layout,
|
|
7924
8062
|
hydration: getCachedClientModuleHydrationPlan(
|
|
@@ -7929,7 +8067,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7929
8067
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
7930
8068
|
)
|
|
7931
8069
|
}));
|
|
7932
|
-
const markdownPagePlan =
|
|
8070
|
+
const markdownPagePlan = _chunkDRO3NXA3cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
7933
8071
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
7934
8072
|
config.root,
|
|
7935
8073
|
isolatedHydrationMode,
|
|
@@ -7938,7 +8076,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7938
8076
|
const pageHydrationPlans2 = new Map(
|
|
7939
8077
|
pageRoutes.map((route) => [
|
|
7940
8078
|
route.modulePath,
|
|
7941
|
-
|
|
8079
|
+
_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
7942
8080
|
route.modulePath,
|
|
7943
8081
|
config.root,
|
|
7944
8082
|
isolatedHydrationMode,
|
|
@@ -7949,7 +8087,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7949
8087
|
);
|
|
7950
8088
|
return { layoutHydrationPlans: layoutHydrationPlans2, pageHydrationPlans: pageHydrationPlans2 };
|
|
7951
8089
|
});
|
|
7952
|
-
|
|
8090
|
+
_chunkDRO3NXA3cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
7953
8091
|
layoutHydrationPlans.map((layout) => ({
|
|
7954
8092
|
pattern: layout.pattern,
|
|
7955
8093
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -7958,10 +8096,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7958
8096
|
pageRoutes.map((route) => ({
|
|
7959
8097
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
7960
8098
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
7961
|
-
depth:
|
|
8099
|
+
depth: _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
7962
8100
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
7963
8101
|
})),
|
|
7964
|
-
|
|
8102
|
+
_chunkNEKO3HM2cjs.routeBoundaryCoversDirectory,
|
|
7965
8103
|
{ serverOwners: pageHydrationPlanOptions.serverOwners }
|
|
7966
8104
|
);
|
|
7967
8105
|
const providerServerImports = [
|
|
@@ -7992,9 +8130,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7992
8130
|
}).map(({ route }) => route);
|
|
7993
8131
|
orderedPageRoutes.forEach((route, index) => {
|
|
7994
8132
|
const varName = `pageRoute${index}`;
|
|
7995
|
-
if (
|
|
7996
|
-
const renderingDirective2 =
|
|
7997
|
-
const markdownServerTree = pageHydrationPlanOptions.serverOwners &&
|
|
8133
|
+
if (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
8134
|
+
const renderingDirective2 = _chunkVMBIKDKWcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8135
|
+
const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkDRO3NXA3cjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
|
|
7998
8136
|
pageRegistrations.push(`
|
|
7999
8137
|
{
|
|
8000
8138
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8002,14 +8140,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8002
8140
|
rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
|
|
8003
8141
|
module: createFarmMarkdownRouteModule({
|
|
8004
8142
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8005
|
-
filePath: ${JSON.stringify(
|
|
8143
|
+
filePath: ${JSON.stringify(_chunkARORZ3MHcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
|
|
8006
8144
|
components: farmMdxComponents,
|
|
8007
|
-
config: farmMdxConfig,
|
|
8145
|
+
config: farmMdxConfig,${_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: React,"}
|
|
8008
8146
|
}),
|
|
8009
8147
|
markdownSource: {
|
|
8010
8148
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8011
8149
|
filePath: ${JSON.stringify(
|
|
8012
|
-
|
|
8150
|
+
_chunkARORZ3MHcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
|
|
8013
8151
|
)},
|
|
8014
8152
|
},
|
|
8015
8153
|
}`);
|
|
@@ -8019,7 +8157,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8019
8157
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
8020
8158
|
);
|
|
8021
8159
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
8022
|
-
const renderingDirective =
|
|
8160
|
+
const renderingDirective = _chunkVMBIKDKWcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8023
8161
|
pageRegistrations.push(`
|
|
8024
8162
|
{
|
|
8025
8163
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8027,8 +8165,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8027
8165
|
module: ${varName},
|
|
8028
8166
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
8029
8167
|
clientModule: ${JSON.stringify(_chunk7U4XF76Rcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
8030
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
8031
|
-
const rootStrategy =
|
|
8168
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkDRO3NXA3cjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
8169
|
+
const rootStrategy = _chunkARORZ3MHcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
8032
8170
|
route,
|
|
8033
8171
|
clientMetadata,
|
|
8034
8172
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -8041,13 +8179,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8041
8179
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
8042
8180
|
${route.source !== void 0 ? `markdownSource: {
|
|
8043
8181
|
source: ${JSON.stringify(route.source)},
|
|
8044
|
-
filePath: ${JSON.stringify(
|
|
8182
|
+
filePath: ${JSON.stringify(_chunkARORZ3MHcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
|
|
8045
8183
|
},` : ""}
|
|
8046
8184
|
}`);
|
|
8047
8185
|
});
|
|
8048
8186
|
const layoutImports = [];
|
|
8049
8187
|
const layoutRegistrations = [];
|
|
8050
|
-
const treeLayoutPatterns = farmIslandsMode ?
|
|
8188
|
+
const treeLayoutPatterns = farmIslandsMode ? _chunkNEKO3HM2cjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
8051
8189
|
layoutHydrationPlans.map((layout) => ({
|
|
8052
8190
|
pattern: layout.pattern,
|
|
8053
8191
|
shouldHydrate: layout.hydration.shouldHydrate,
|
|
@@ -8065,7 +8203,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8065
8203
|
pattern: ${JSON.stringify(layout.pattern)},
|
|
8066
8204
|
module: ${varName},
|
|
8067
8205
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
|
|
8068
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode &&
|
|
8206
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkARORZ3MHcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
|
|
8069
8207
|
// isolatedClientHydration, or an async layout): it wraps a docs page as an app page.
|
|
8070
8208
|
clientMetadata.hasIsolatedClientBoundaries ? "\n islands: true," : ""}
|
|
8071
8209
|
}`);
|
|
@@ -8093,7 +8231,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8093
8231
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
8094
8232
|
interception: ${JSON.stringify(slot.interception)},
|
|
8095
8233
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
8096
|
-
hydrates: ${!farmIslandsMode ||
|
|
8234
|
+
hydrates: ${!farmIslandsMode || _chunkDRO3NXA3cjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
8097
8235
|
module: ${varName},
|
|
8098
8236
|
}`);
|
|
8099
8237
|
});
|
|
@@ -8104,12 +8242,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8104
8242
|
errorImports.push(
|
|
8105
8243
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
8106
8244
|
);
|
|
8107
|
-
const groupScope =
|
|
8245
|
+
const groupScope = _chunkNEKO3HM2cjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
8108
8246
|
errorRegistrations.push(`
|
|
8109
8247
|
{
|
|
8110
|
-
pattern: ${JSON.stringify(
|
|
8248
|
+
pattern: ${JSON.stringify(_chunkNEKO3HM2cjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
8111
8249
|
groupScope: ${JSON.stringify(groupScope)},
|
|
8112
|
-
directoryDepth: ${
|
|
8250
|
+
directoryDepth: ${_chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
8113
8251
|
module: ${varName},
|
|
8114
8252
|
}`);
|
|
8115
8253
|
});
|
|
@@ -8121,12 +8259,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8121
8259
|
loadingImports.push(
|
|
8122
8260
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
|
|
8123
8261
|
);
|
|
8124
|
-
const groupScope =
|
|
8262
|
+
const groupScope = _chunkNEKO3HM2cjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
|
|
8125
8263
|
loadingRegistrations.push(`
|
|
8126
8264
|
{
|
|
8127
|
-
pattern: ${JSON.stringify(
|
|
8265
|
+
pattern: ${JSON.stringify(_chunkNEKO3HM2cjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
|
|
8128
8266
|
groupScope: ${JSON.stringify(groupScope)},
|
|
8129
|
-
directoryDepth: ${
|
|
8267
|
+
directoryDepth: ${_chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
|
|
8130
8268
|
module: ${varName},
|
|
8131
8269
|
}`);
|
|
8132
8270
|
});
|
|
@@ -8139,12 +8277,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8139
8277
|
metadataImageImports.push(
|
|
8140
8278
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(image.modulePath)};`
|
|
8141
8279
|
);
|
|
8280
|
+
const component = !_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) && _chunkARORZ3MHcjs.isRendererCompiledComponent.call(void 0, image.modulePath, _nullishCoalesce(_optionalChain([config, 'access', _201 => _201.renderer, 'optionalAccess', _202 => _202.componentExtensions]), () => ( [])));
|
|
8142
8281
|
metadataImageRegistrations.push(`
|
|
8143
8282
|
{
|
|
8144
8283
|
pattern: ${JSON.stringify(image.pattern)},
|
|
8145
8284
|
kind: ${JSON.stringify(image.kind)},
|
|
8146
8285
|
fileName: ${JSON.stringify(image.fileName)},
|
|
8147
|
-
sourceType: "module",
|
|
8286
|
+
sourceType: "module",${component ? "\n component: true," : ""}
|
|
8148
8287
|
module: ${varName},
|
|
8149
8288
|
}`);
|
|
8150
8289
|
return;
|
|
@@ -8199,6 +8338,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8199
8338
|
applyFarmBasePath,
|
|
8200
8339
|
applyFarmCspNonceToResponse,
|
|
8201
8340
|
createFarmCspNonce,
|
|
8341
|
+
createPreHydrationClickQueueScript,
|
|
8202
8342
|
stampFarmCspNonce,
|
|
8203
8343
|
isDeferred,
|
|
8204
8344
|
prepareDeferredData,
|
|
@@ -8213,7 +8353,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8213
8353
|
createDefaultErrorMarkup,
|
|
8214
8354
|
createFarmInstrumentationLifecycle,
|
|
8215
8355
|
createFarmLayoutSelector,
|
|
8216
|
-
createFarmLayoutBoundary,${_optionalChain([config, 'access',
|
|
8356
|
+
createFarmLayoutBoundary,${_optionalChain([config, 'access', _203 => _203.docs, 'optionalAccess', _204 => _204.enabled]) ? "\n createFarmDocsLayoutTree,\n farmDocsLayoutsWrapPage,\n placeFarmDocsLayoutRoot," : ""}
|
|
8217
8357
|
isInFarmRouteGroupScope,
|
|
8218
8358
|
routeBoundaryCoversDirectory,
|
|
8219
8359
|
createFarmCacheKey,
|
|
@@ -8258,6 +8398,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8258
8398
|
isFarmNotFoundError,
|
|
8259
8399
|
isFarmRedirectError,
|
|
8260
8400
|
localizeFarmHref,
|
|
8401
|
+
hasFarmHtmlPreloadToken,
|
|
8261
8402
|
manageFarmDocumentPreloads,
|
|
8262
8403
|
mergeRouteRenderingDirectiveConfig,
|
|
8263
8404
|
resolveRouteSharedCacheControl,
|
|
@@ -8296,7 +8437,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8296
8437
|
createFarmDeploymentMismatchResponse,
|
|
8297
8438
|
FARM_DEPLOYMENT_ID_HEADER,
|
|
8298
8439
|
getFarmDeploymentMismatch,
|
|
8299
|
-
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access',
|
|
8440
|
+
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _205 => _205.md, 'optionalAccess', _206 => _206.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}${searchPreserveRoutesSource ? "\n _setFarmSearchPreserveRoutes," : ""}
|
|
8300
8441
|
} from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
|
|
8301
8442
|
import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
|
|
8302
8443
|
// The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
|
|
@@ -8355,35 +8496,38 @@ import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server"
|
|
|
8355
8496
|
installFarmIslandsServer();
|
|
8356
8497
|
const farmFormActionsConfig = ${JSON.stringify(_chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
|
|
8357
8498
|
installFarmIslandValues();
|
|
8358
|
-
${islandsActionKeyCode()}
|
|
8359
|
-
${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : `
|
|
8499
|
+
${islandsActionKeyCode("@farm.js/core/internal/islx-server")}
|
|
8500
|
+
${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : `${farmRendererActions ? `
|
|
8501
|
+
import { handleFarmFormActionRequest } from "@farm.js/core/internal/production-runtime";
|
|
8502
|
+
const farmFormActionsConfig = ${JSON.stringify(_chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
|
|
8503
|
+
${islandsActionKeyCode("@farm.js/core/internal/islx-actions-server")}` : ""}
|
|
8360
8504
|
function farmFormState() { return undefined; }
|
|
8361
8505
|
function farmFormStateScript() { return ""; }`}`;
|
|
8362
8506
|
const productionSiteTelemetryImport = config.telemetry ? `import { createFarmProductionSiteReporter } from "@farm.js/core/internal/product-telemetry-runtime";` : "";
|
|
8363
|
-
const metadataImageRuntimeImport = hasGeneratedMetadataImages ? `import { createFarmMetadataImageResponse } from "@farm.js/core/internal/metadata-image-runtime";` : "";
|
|
8507
|
+
const metadataImageRuntimeImport = hasGeneratedMetadataImages ? `import { createFarmMetadataImageResponse, resolveFarmMetadataImageValue } from "@farm.js/core/internal/metadata-image-runtime";` : "";
|
|
8364
8508
|
const pluginRuntimeImport = hasPluginRuntime ? `import { PluginManager } from "@farm.js/core/plugin";` : "";
|
|
8365
8509
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
8366
8510
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
8367
8511
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
8368
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
8512
|
+
const docsHandlerImport = _optionalChain([config, 'access', _207 => _207.docs, 'optionalAccess', _208 => _208.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
8369
8513
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
8370
8514
|
const pathname = typeof requestOrPathname === "string"
|
|
8371
8515
|
? requestOrPathname
|
|
8372
8516
|
: new URL(requestOrPathname.url).pathname;
|
|
8373
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
8517
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _209 => _209.apiPath]) || "/api/docs")};
|
|
8374
8518
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
8375
8519
|
};` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
8376
|
-
import { ${_optionalChain([config, 'access',
|
|
8520
|
+
import { ${_optionalChain([config, 'access', _210 => _210.docs, 'access', _211 => _211.roots, 'optionalAccess', _212 => _212.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
|
|
8377
8521
|
import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
|
|
8378
8522
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
8379
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
8380
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
8523
|
+
const docsFontImport = _optionalChain([config, 'access', _213 => _213.docs, 'optionalAccess', _214 => _214.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
8524
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _215 => _215.docs, 'optionalAccess', _216 => _216.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
8381
8525
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
8382
8526
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
8383
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
8527
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _217 => _217.md, 'optionalAccess', _218 => _218.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
8384
8528
|
const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
|
|
8385
8529
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
8386
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
8530
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _219 => _219.mdx, 'optionalAccess', _220 => _220.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
8387
8531
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
8388
8532
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
8389
8533
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -8403,14 +8547,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
8403
8547
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
8404
8548
|
const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
8405
8549
|
const mobileSession = (config.plugins || []).some(
|
|
8406
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
8550
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _221 => _221.name]) === _chunkMHKPXX3Jcjs.FARM_MOBILE_SESSION_PLUGIN
|
|
8407
8551
|
);
|
|
8408
8552
|
const nativeServerFns = (config.plugins || []).some(
|
|
8409
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
8410
|
-
) ?
|
|
8553
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _222 => _222.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
8554
|
+
) ? _chunk6BPFIYGYcjs.collectFarmNativeServerFns.call(void 0, {
|
|
8411
8555
|
root: config.root,
|
|
8412
8556
|
srcDir: config.srcDir,
|
|
8413
|
-
entries:
|
|
8557
|
+
entries: _chunk6BPFIYGYcjs.findFarmNativeScreenFiles.call(void 0, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config))
|
|
8414
8558
|
}) : void 0;
|
|
8415
8559
|
const integrationImports = `
|
|
8416
8560
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -8425,7 +8569,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
8425
8569
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
8426
8570
|
});` : ""}
|
|
8427
8571
|
`;
|
|
8428
|
-
const imageRuntime =
|
|
8572
|
+
const imageRuntime = _chunkARORZ3MHcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
8429
8573
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
8430
8574
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
8431
8575
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -8607,7 +8751,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
8607
8751
|
|
|
8608
8752
|
function renderFarmDefault404Page() {
|
|
8609
8753
|
return React.createElement(React.Fragment, null,
|
|
8610
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
8754
|
+
React.createElement("style", null, ${JSON.stringify(_chunkARORZ3MHcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
8611
8755
|
React.createElement("main", {
|
|
8612
8756
|
className: "farm-default-not-found",
|
|
8613
8757
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -8699,6 +8843,12 @@ function wrapWithFarmIntegrationProviders(element) {
|
|
|
8699
8843
|
}
|
|
8700
8844
|
return wrapped;
|
|
8701
8845
|
}
|
|
8846
|
+
// The browser hydrates a page island or a route slot as its own root, inside the integration
|
|
8847
|
+
// providers, so the server renders them inside it too. React lines an island up with its tree
|
|
8848
|
+
// position instead, and its providers render no markup.
|
|
8849
|
+
function wrapFarmIslandIntegrationProviders(element) {
|
|
8850
|
+
return ${_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? "element" : "wrapWithFarmIntegrationProviders(element)"};
|
|
8851
|
+
}
|
|
8702
8852
|
const serverRuntimeIntegrations = Object.fromEntries(
|
|
8703
8853
|
Object.entries(configuredIntegrations).filter(([, integration]) =>
|
|
8704
8854
|
integration && typeof integration === "object" && integration.serverRuntime !== false
|
|
@@ -8708,7 +8858,14 @@ const integrationRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs, {
|
|
|
8708
8858
|
integrations: configuredIntegrations,
|
|
8709
8859
|
${JSON.stringify(_chunkQKW6DLDTcjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
|
|
8710
8860
|
});
|
|
8711
|
-
const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? hasPluginRuntime ? "createFarmInfraAnalyticsPlugin
|
|
8861
|
+
const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? `${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"}(${reportsWebMCPCalls ? "{ webmcp: { route: farmWebMCPCallRoute } }" : ""})` : "null"};${reportsWebMCPCalls ? `
|
|
8862
|
+
// A WebMCP tool call a page reports goes under that page's route, matched and labeled as a
|
|
8863
|
+
// request for the page is.
|
|
8864
|
+
function farmWebMCPCallRoute(pathname) {
|
|
8865
|
+
return labelFarmRequestOptions(
|
|
8866
|
+
getFarmPluginRequestOptions(new Request(new URL(pathname, "http://farm.invalid"))),
|
|
8867
|
+
).route;
|
|
8868
|
+
}` : ""}
|
|
8712
8869
|
const configuredPlugins = [
|
|
8713
8870
|
${hasCompressionRuntime && hasPluginRuntime ? "createCompressionPlugin()," : ""}
|
|
8714
8871
|
${hasRuntimeIntegrationConfig ? "...resolveIntegrationPlugins(serverRuntimeIntegrations)," : ""}
|
|
@@ -8750,24 +8907,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
8750
8907
|
validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
|
|
8751
8908
|
onError(error) { console.error("[Farm Image]", error); },
|
|
8752
8909
|
})`};
|
|
8753
|
-
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access',
|
|
8910
|
+
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _223 => _223.md, 'optionalAccess', _224 => _224.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
|
|
8754
8911
|
// A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
|
|
8755
8912
|
// ('/about/'), so the trailing-slash 308 never answers in its place.
|
|
8756
8913
|
const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
|
|
8757
8914
|
const toFarmMarkdownPageRequest = (request) => request;` : ""}
|
|
8758
|
-
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
8759
|
-
${_optionalChain([config, 'access',
|
|
8915
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
8916
|
+
${_optionalChain([config, 'access', _227 => _227.agent, 'optionalAccess', _228 => _228.llmsTxt, 'optionalAccess', _229 => _229.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
8760
8917
|
const farmMdxConfig = ${JSON.stringify({
|
|
8761
8918
|
...config.mdx,
|
|
8762
|
-
components: typeof _optionalChain([config, 'access',
|
|
8919
|
+
components: typeof _optionalChain([config, 'access', _230 => _230.mdx, 'optionalAccess', _231 => _231.components]) === "string" ? config.mdx.components : void 0
|
|
8763
8920
|
})};
|
|
8764
8921
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
8765
|
-
${_optionalChain([config, 'access',
|
|
8922
|
+
${_optionalChain([config, 'access', _232 => _232.agent, 'optionalAccess', _233 => _233.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
8766
8923
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
8767
8924
|
// to the build.
|
|
8768
8925
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
8769
8926
|
globalThis.process?.env,
|
|
8770
|
-
${JSON.stringify(
|
|
8927
|
+
${JSON.stringify(_chunkRMPUEH5Tcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
8771
8928
|
);` : ""}
|
|
8772
8929
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
8773
8930
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -8813,7 +8970,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
8813
8970
|
});
|
|
8814
8971
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
8815
8972
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
8816
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
8973
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _234 => _234.docs, 'optionalAccess', _235 => _235.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
8817
8974
|
try {
|
|
8818
8975
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
8819
8976
|
const candidates = [
|
|
@@ -8825,7 +8982,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _232 => _2
|
|
|
8825
8982
|
} catch {
|
|
8826
8983
|
return null;
|
|
8827
8984
|
}
|
|
8828
|
-
})()` : "null"};${_optionalChain([config, 'access',
|
|
8985
|
+
})()` : "null"};${_optionalChain([config, 'access', _236 => _236.docs, 'optionalAccess', _237 => _237.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _238 => _238.docs, 'access', _239 => _239.roots, 'optionalAccess', _240 => _240.length]) ? `
|
|
8829
8986
|
const farmDocsBundledRootsDir = (() => {
|
|
8830
8987
|
try {
|
|
8831
8988
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
@@ -8877,7 +9034,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
8877
9034
|
),
|
|
8878
9035
|
}
|
|
8879
9036
|
: undefined;
|
|
8880
|
-
const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
9037
|
+
const farmDocsHandler = ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
|
|
8881
9038
|
rootDir: farmDocsRuntimeRoot,
|
|
8882
9039
|
// A production build's content cannot change, so the adapter reads its
|
|
8883
9040
|
// navigation once instead of scanning the content directory per request.
|
|
@@ -8898,7 +9055,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, '
|
|
|
8898
9055
|
registerMCPServer: registerFarmMCPServer,
|
|
8899
9056
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
8900
9057
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
8901
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
9058
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunkHHQEKLZLcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
8902
9059
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
8903
9060
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
8904
9061
|
isPathGuarded: (pathname) =>
|
|
@@ -8924,11 +9081,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, '
|
|
|
8924
9081
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
8925
9082
|
basePath: ${JSON.stringify(config.basePath)},
|
|
8926
9083
|
})` : "null"};
|
|
8927
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
9084
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _243 => _243.docs, 'optionalAccess', _244 => _244.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
|
|
8928
9085
|
|
|
8929
9086
|
// API routes bundled at build time
|
|
8930
9087
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
8931
|
-
]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path:
|
|
9088
|
+
]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path19, methods }) => ({ path: path19, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
|
|
8932
9089
|
// A plugin calling an app endpoint (an MCP tool, say) goes through the whole
|
|
8933
9090
|
// pipeline, so the endpoint's middleware and integration guards run for it.
|
|
8934
9091
|
function dispatchFarmPluginAPIRequest(request) {
|
|
@@ -8959,12 +9116,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
|
|
|
8959
9116
|
// runtime request.
|
|
8960
9117
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
8961
9118
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
8962
|
-
${_optionalChain([config, 'access',
|
|
8963
|
-
` : ""}${_optionalChain([config, 'access',
|
|
8964
|
-
|
|
9119
|
+
${_optionalChain([config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkB2PGVHBGcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
9120
|
+
` : ""}${_optionalChain([config, 'access', _247 => _247.agent, 'optionalAccess', _248 => _248.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
9121
|
+
_chunkB2PGVHBGcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
8965
9122
|
build: config.deploymentId,
|
|
8966
|
-
packages:
|
|
8967
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
9123
|
+
packages: _chunkARORZ3MHcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
9124
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkARORZ3MHcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
8968
9125
|
})
|
|
8969
9126
|
)};
|
|
8970
9127
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -8977,7 +9134,7 @@ farmAppManifestInput.guardCoversPath = (path) =>
|
|
|
8977
9134
|
path,
|
|
8978
9135
|
farmLocalAPIBasePath,
|
|
8979
9136
|
);
|
|
8980
|
-
${_optionalChain([config, 'access',
|
|
9137
|
+
${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `// A docs runtime's MCP server lists its tools when asked over MCP, in process. A build
|
|
8981
9138
|
// can't change them, so they are read once.
|
|
8982
9139
|
if (farmDocsHandler) {
|
|
8983
9140
|
farmAppManifestInput.registeredMCP = (request) =>
|
|
@@ -9071,7 +9228,10 @@ function serializeFarmInlineValue(value) {
|
|
|
9071
9228
|
.replace(/\\u2029/g, "\\\\u2029");
|
|
9072
9229
|
}
|
|
9073
9230
|
|
|
9074
|
-
|
|
9231
|
+
// \`statusDocument\`: the not-found or error page, which renders without the route's layout
|
|
9232
|
+
// boundaries and page segment. It names no route for its URL, so the client hydrates none over it
|
|
9233
|
+
// (development writes no hydration flags for it either); its links still navigate.
|
|
9234
|
+
function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, pageProps, routePathname, statusDocument) {
|
|
9075
9235
|
const integrationManifest = ${hasRuntimeIntegrationConfig ? "getRegisteredIntegrationAPIManifest()" : "{}"};
|
|
9076
9236
|
const serializedRouteSlots = serializeFarmInlineValue(selectedRouteSlots || []);
|
|
9077
9237
|
const serializedPageProps = serializeFarmInlineValue(pageProps || {});
|
|
@@ -9082,11 +9242,13 @@ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, page
|
|
|
9082
9242
|
';window.__FARM_DEPLOYMENT_ID__=' + serializeFarmInlineValue(farmDeploymentId) + ';'${searchPreserveRoutesSource ? ` +
|
|
9083
9243
|
'window[Symbol.for("farm.searchPreserveRoutes")]=' + serializeFarmInlineValue(farmSearchPreserveRoutes) + ';'` : ""};
|
|
9084
9244
|
// The client boots at the canonical path when the script below moves it there.
|
|
9085
|
-
const bootRoutes =
|
|
9086
|
-
typeof
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9245
|
+
const bootRoutes = statusDocument
|
|
9246
|
+
? typeof routePathname === "string" ? { path: routePathname, routes: [] } : undefined
|
|
9247
|
+
: getFarmClientBootRoutes(
|
|
9248
|
+
typeof canonicalPath === "string" && canonicalPath.startsWith("/")
|
|
9249
|
+
? getFarmRoutePathname(canonicalPath.split(/[?#]/)[0])
|
|
9250
|
+
: routePathname
|
|
9251
|
+
);
|
|
9090
9252
|
if (bootRoutes) source += 'window.__FARM_CLIENT_ROUTES__=' + serializeFarmInlineValue(bootRoutes) + ';';
|
|
9091
9253
|
if (typeof canonicalPath === "string" && canonicalPath.startsWith("/")) {
|
|
9092
9254
|
const serializedPath = serializeFarmInlineValue(canonicalPath);
|
|
@@ -9747,7 +9909,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
9747
9909
|
let inner = markup.replace(/^\\s+/, "");
|
|
9748
9910
|
let hoisted = "";
|
|
9749
9911
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
9750
|
-
const hoistable = /${
|
|
9912
|
+
const hoistable = /${_chunkNEKO3HM2cjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
9751
9913
|
let match;
|
|
9752
9914
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
9753
9915
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -9776,7 +9938,7 @@ function opensFarmFullDocument(markup) {
|
|
|
9776
9938
|
// them: its own head takes them. Matches the dev renderer's takeFarmHoistedHead.
|
|
9777
9939
|
function takeFarmHoistedHead(markup) {
|
|
9778
9940
|
if (opensFarmFullDocument(markup)) return { head: "", body: markup };
|
|
9779
|
-
const hoistable = /${
|
|
9941
|
+
const hoistable = /${_chunkNEKO3HM2cjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
9780
9942
|
let head = "";
|
|
9781
9943
|
let body = markup;
|
|
9782
9944
|
let match;
|
|
@@ -9874,7 +10036,7 @@ function addFarmFallbackIcon(markup, hasFavicon) {
|
|
|
9874
10036
|
return markup.replace(/<\\/head>/i, function() { return ' <link rel="icon" href="data:,">\\n</head>'; });
|
|
9875
10037
|
}
|
|
9876
10038
|
|
|
9877
|
-
function createFarmErrorDocument(html, title) {
|
|
10039
|
+
function createFarmErrorDocument(html, title, routePathname) {
|
|
9878
10040
|
const escapedTitle = escapeFarmHtmlAttribute(title || "Application Error");
|
|
9879
10041
|
const fullDocument = extractFarmFullDocument(html);
|
|
9880
10042
|
const hasFullDocument = fullDocument !== null;
|
|
@@ -9889,7 +10051,7 @@ function createFarmErrorDocument(html, title) {
|
|
|
9889
10051
|
renderFarmRendererHydrationScript() + '\\n' +
|
|
9890
10052
|
'</head>\\n<body>\\n' +
|
|
9891
10053
|
' <div id="root">' + html + '</div>\\n' +
|
|
9892
|
-
' ' + renderFarmClientBootstrapScript() + '\\n' +
|
|
10054
|
+
' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true) + '\\n' +
|
|
9893
10055
|
' ' + renderFarmClientEntryScript() + '\\n' +
|
|
9894
10056
|
'</body>\\n</html>';
|
|
9895
10057
|
}
|
|
@@ -9908,7 +10070,7 @@ function createFarmErrorDocument(html, title) {
|
|
|
9908
10070
|
.replace(
|
|
9909
10071
|
/<\\/body>/i,
|
|
9910
10072
|
function() {
|
|
9911
|
-
return ' ' + renderFarmClientBootstrapScript() + '\\n' +
|
|
10073
|
+
return ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true) + '\\n' +
|
|
9912
10074
|
' ' + renderFarmClientEntryScript() + '\\n</body>';
|
|
9913
10075
|
},
|
|
9914
10076
|
);
|
|
@@ -10261,13 +10423,11 @@ async function handleMetadataImageRequest(request, routePathname) {
|
|
|
10261
10423
|
searchParams: createFarmSearchParams(searchParams),
|
|
10262
10424
|
path: match.pagePath,
|
|
10263
10425
|
};
|
|
10264
|
-
const value = typeof imageModule.default === "function"
|
|
10265
|
-
? await imageModule.default(props)
|
|
10266
|
-
: imageModule.default;
|
|
10267
10426
|
|
|
10268
|
-
${hasGeneratedMetadataImages ? `
|
|
10427
|
+
${hasGeneratedMetadataImages ? `const value = await resolveFarmMetadataImageValue(imageModule, props${_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? "" : ", {\n renderer: ReactDOMServer,\n component: image.component === true,\n }"});
|
|
10428
|
+
return createFarmMetadataImageResponse(value, imageModule, {
|
|
10269
10429
|
method,
|
|
10270
|
-
ifNoneMatch: request.headers.get("if-none-match"),${
|
|
10430
|
+
ifNoneMatch: request.headers.get("if-none-match"),${_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: ReactDOMServer,"}
|
|
10271
10431
|
});` : 'throw new Error("Generated metadata image runtime is unavailable");'}
|
|
10272
10432
|
} catch (error) {
|
|
10273
10433
|
console.error("Metadata image render failed:", error);
|
|
@@ -10346,7 +10506,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
10346
10506
|
// its nearest layout's.
|
|
10347
10507
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
10348
10508
|
pageRoutes.map((route) => route.pattern).filter(
|
|
10349
|
-
(pattern) => !pattern.includes("[") &&
|
|
10509
|
+
(pattern) => !pattern.includes("[") && _chunkNEKO3HM2cjs.farmPathGuardCoversPage.call(void 0,
|
|
10350
10510
|
{
|
|
10351
10511
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
10352
10512
|
middlewareRoutes
|
|
@@ -10401,7 +10561,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
10401
10561
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
10402
10562
|
// registered at runtime, such as the docs engine's.
|
|
10403
10563
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
10404
|
-
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
10564
|
+
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkJK26IMT7cjs.FARM_VERSION)
|
|
10405
10565
|
)};
|
|
10406
10566
|
let farmDefaultMCPRouteFree;
|
|
10407
10567
|
function getFarmDefaultMCPServer() {
|
|
@@ -10595,7 +10755,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
10595
10755
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
10596
10756
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
10597
10757
|
const farmPrerendering =
|
|
10598
|
-
typeof process !== "undefined" && process.env?.${
|
|
10758
|
+
typeof process !== "undefined" && process.env?.${_chunkCD5Z7RR5cjs.FARM_PRERENDER_ENV} === "1";
|
|
10599
10759
|
` : ""}
|
|
10600
10760
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
10601
10761
|
config: farmMiddlewareConfig,
|
|
@@ -10739,7 +10899,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
10739
10899
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
10740
10900
|
return true;
|
|
10741
10901
|
}
|
|
10742
|
-
${_optionalChain([config, 'access',
|
|
10902
|
+
${_optionalChain([config, 'access', _251 => _251.docs, 'optionalAccess', _252 => _252.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
10743
10903
|
// The docs answer below the basePath; their API stays at /api/docs, as API routes do.
|
|
10744
10904
|
const docsRoutePathname = stripFarmBasePath(pathname);
|
|
10745
10905
|
if (
|
|
@@ -10767,7 +10927,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
10767
10927
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
10768
10928
|
};
|
|
10769
10929
|
}
|
|
10770
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
10930
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
10771
10931
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
10772
10932
|
pathname,
|
|
10773
10933
|
method: request.method,
|
|
@@ -10851,7 +11011,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
10851
11011
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
10852
11012
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
10853
11013
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
10854
|
-
|
|
11014
|
+
_chunkB2PGVHBGcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
10855
11015
|
agent: {
|
|
10856
11016
|
...config.agent,
|
|
10857
11017
|
aiCatalog: servesAiCatalog,
|
|
@@ -10862,9 +11022,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
10862
11022
|
openapi: openAPIReference
|
|
10863
11023
|
})
|
|
10864
11024
|
)});
|
|
10865
|
-
${_optionalChain([config, 'access',
|
|
11025
|
+
${_optionalChain([config, 'access', _255 => _255.docs, 'optionalAccess', _256 => _256.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
10866
11026
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
10867
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
11027
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _257 => _257.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _258 => _258.docs, 'access', _259 => _259.roots, 'optionalAccess', _260 => _260.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
|
|
10868
11028
|
pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
|
|
10869
11029
|
};
|
|
10870
11030
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
@@ -10880,11 +11040,11 @@ function labelFarmRequestOptions(options) {
|
|
|
10880
11040
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
10881
11041
|
return options;
|
|
10882
11042
|
}
|
|
10883
|
-
${_optionalChain([config, 'access',
|
|
11043
|
+
${_optionalChain([config, 'access', _261 => _261.docs, 'optionalAccess', _262 => _262.enabled]) ? `if (options.kind === "docs") {
|
|
10884
11044
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
10885
11045
|
return options;
|
|
10886
11046
|
}` : ""}
|
|
10887
|
-
${_optionalChain([config, 'access',
|
|
11047
|
+
${_optionalChain([config, 'access', _263 => _263.md, 'optionalAccess', _264 => _264.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
10888
11048
|
routePathname,
|
|
10889
11049
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
10890
11050
|
);
|
|
@@ -10919,7 +11079,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
10919
11079
|
return applicable;
|
|
10920
11080
|
}
|
|
10921
11081
|
|
|
10922
|
-
${_optionalChain([config, 'access',
|
|
11082
|
+
${_optionalChain([config, 'access', _265 => _265.docs, 'optionalAccess', _266 => _266.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
10923
11083
|
if (request.method === "HEAD") return response;
|
|
10924
11084
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
10925
11085
|
|
|
@@ -11025,7 +11185,7 @@ ${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 =>
|
|
|
11025
11185
|
|
|
11026
11186
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
11027
11187
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
11028
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
11188
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _267 => _267.experimental, 'optionalAccess', _268 => _268.ppr]) === true)};
|
|
11029
11189
|
|
|
11030
11190
|
function resolveRouteRenderingView(route) {
|
|
11031
11191
|
// The same merge development uses: baked directive config under the
|
|
@@ -11145,7 +11305,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
11145
11305
|
},
|
|
11146
11306
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
11147
11307
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
11148
|
-
${_optionalChain([config, 'access',
|
|
11308
|
+
${_optionalChain([config, 'access', _269 => _269.md, 'optionalAccess', _270 => _270.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
11149
11309
|
if (matchPageRoute(pathname)) {
|
|
11150
11310
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
11151
11311
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -11362,7 +11522,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11362
11522
|
return renderFarmErrorJSONResponse();` : `
|
|
11363
11523
|
if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
|
|
11364
11524
|
// No page was selected, so only the root error boundary and layouts apply.
|
|
11365
|
-
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access',
|
|
11525
|
+
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _271 => _271.md, 'optionalAccess', _272 => _272.enabled]) ? `
|
|
11366
11526
|
// An agent asking for Markdown reads the error document as Markdown, as it
|
|
11367
11527
|
// does when a page throws. The helper answers null when Markdown is off.
|
|
11368
11528
|
const markdownErrorResponse = await createMarkdownMirrorResponse({
|
|
@@ -11404,7 +11564,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11404
11564
|
}
|
|
11405
11565
|
` : ""}
|
|
11406
11566
|
|
|
11407
|
-
${_optionalChain([config, 'access',
|
|
11567
|
+
${_optionalChain([config, 'access', _273 => _273.docs, 'optionalAccess', _274 => _274.enabled]) ? `
|
|
11408
11568
|
// Docs responses are served after app middleware so route guards and
|
|
11409
11569
|
// middleware headers apply to the docs engine like any other page content.
|
|
11410
11570
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -11520,7 +11680,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11520
11680
|
}
|
|
11521
11681
|
` : ""}
|
|
11522
11682
|
|
|
11523
|
-
${_optionalChain([config, 'access',
|
|
11683
|
+
${_optionalChain([config, 'access', _275 => _275.md, 'optionalAccess', _276 => _276.enabled]) ? `
|
|
11524
11684
|
if (farmMarkdownConfig?.enabled) {
|
|
11525
11685
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
11526
11686
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -11624,11 +11784,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11624
11784
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
11625
11785
|
}
|
|
11626
11786
|
` : ""}
|
|
11627
|
-
${_optionalChain([config, 'access',
|
|
11787
|
+
${_optionalChain([config, 'access', _277 => _277.agent, 'optionalAccess', _278 => _278.manifest]) !== false ? `
|
|
11628
11788
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
11629
11789
|
// public manifest, the same document for every request.
|
|
11630
11790
|
if (
|
|
11631
|
-
[${JSON.stringify(
|
|
11791
|
+
[${JSON.stringify(_chunkB2PGVHBGcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkB2PGVHBGcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
11632
11792
|
normalizeRuntimePath(routePathname),
|
|
11633
11793
|
)
|
|
11634
11794
|
) {
|
|
@@ -11638,9 +11798,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11638
11798
|
);
|
|
11639
11799
|
}
|
|
11640
11800
|
` : ""}
|
|
11641
|
-
${_optionalChain([config, 'access',
|
|
11801
|
+
${_optionalChain([config, 'access', _279 => _279.agent, 'optionalAccess', _280 => _280.apiCatalog]) ? `
|
|
11642
11802
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
11643
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
11803
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkB2PGVHBGcjs.FARM_API_CATALOG_PATH)}) {
|
|
11644
11804
|
return applyProductionMiddlewareHeaders(
|
|
11645
11805
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
11646
11806
|
middlewareHeaders,
|
|
@@ -11665,11 +11825,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11665
11825
|
);
|
|
11666
11826
|
}
|
|
11667
11827
|
` : ""}
|
|
11668
|
-
${_optionalChain([config, 'access',
|
|
11828
|
+
${_optionalChain([config, 'access', _281 => _281.agent, 'optionalAccess', _282 => _282.llmsTxt, 'optionalAccess', _283 => _283.enabled]) ? `
|
|
11669
11829
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
11670
11830
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
11671
11831
|
? "llms"
|
|
11672
|
-
: ${_optionalChain([config, 'access',
|
|
11832
|
+
: ${_optionalChain([config, 'access', _284 => _284.agent, 'optionalAccess', _285 => _285.llmsTxt, 'optionalAccess', _286 => _286.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
11673
11833
|
if (farmGeneratedLlmsKind) {
|
|
11674
11834
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
11675
11835
|
// Renders are shared per origin the request reached, which is where pages are read.
|
|
@@ -11705,7 +11865,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11705
11865
|
}
|
|
11706
11866
|
` : ""}
|
|
11707
11867
|
|
|
11708
|
-
${_optionalChain([config, 'access',
|
|
11868
|
+
${_optionalChain([config, 'access', _287 => _287.docs, 'optionalAccess', _288 => _288.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
11709
11869
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
11710
11870
|
if (docsAPIResponse) {
|
|
11711
11871
|
return applyProductionMiddlewareHeaders(
|
|
@@ -11734,7 +11894,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11734
11894
|
if (farmDeploymentMismatch) return createFarmDeploymentMismatchResponse(farmDeploymentMismatch);
|
|
11735
11895
|
farmCacheGuard.deploymentPage = true;
|
|
11736
11896
|
}
|
|
11737
|
-
${farmIslandsMode ? `//
|
|
11897
|
+
${farmIslandsMode || farmRendererActions ? `// A form or client component posting a server action to this page.
|
|
11738
11898
|
if (matchedRoute && request.method === "POST") {
|
|
11739
11899
|
const actionResponse = await _runWithMiddlewareData(middlewareData || {}, () =>
|
|
11740
11900
|
_runWithMiddlewareContext(middlewareContext || {}, () =>
|
|
@@ -12164,18 +12324,18 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12164
12324
|
// outer request handler exactly like sync render errors.
|
|
12165
12325
|
if (typeof PageComponent === "function" && PageComponent.constructor.name === "AsyncFunction") {
|
|
12166
12326
|
const result = await PageComponent(pageProps);
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12327
|
+
// Anything else (text, a number, null) renders as the renderer renders a child,
|
|
12328
|
+
// as in development.
|
|
12329
|
+
pageElement = React.isValidElement(result)
|
|
12330
|
+
? result
|
|
12331
|
+
: React.createElement(React.Fragment, null, result);
|
|
12172
12332
|
} else {
|
|
12173
12333
|
// Sync component - create element directly
|
|
12174
12334
|
pageElement = React.createElement(PageComponent, pageProps);
|
|
12175
12335
|
}
|
|
12176
12336
|
|
|
12177
12337
|
if (route.shouldHydrate && !shouldHydrateLayout) {
|
|
12178
|
-
pageElement = wrapFarmRouteClientGraph(pageElement);
|
|
12338
|
+
pageElement = wrapFarmRouteClientGraph(wrapFarmIslandIntegrationProviders(pageElement));
|
|
12179
12339
|
} else if (shouldHydrateLayout && !route.shouldHydrate) {
|
|
12180
12340
|
pageElement = route.serverTree
|
|
12181
12341
|
? await renderFarmRouteServerTree(
|
|
@@ -12200,7 +12360,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12200
12360
|
pageElement,
|
|
12201
12361
|
);
|
|
12202
12362
|
|
|
12203
|
-
${
|
|
12363
|
+
${_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) pageElement = markPagePosition(React, pageElement);" : ""}
|
|
12204
12364
|
// Wrap with layouts (from innermost to outermost)
|
|
12205
12365
|
// Layouts are sorted by depth (root first), so we process in reverse
|
|
12206
12366
|
let wrappedElement = pageElement;
|
|
@@ -12236,7 +12396,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12236
12396
|
},
|
|
12237
12397
|
slot.hydrates
|
|
12238
12398
|
? wrapFarmRouteClientGraph(
|
|
12239
|
-
|
|
12399
|
+
wrapFarmIslandIntegrationProviders(
|
|
12400
|
+
React.createElement(slot.module.default, slot.props),
|
|
12401
|
+
),
|
|
12240
12402
|
)
|
|
12241
12403
|
: React.createElement(slot.module.default, slot.props),
|
|
12242
12404
|
);
|
|
@@ -12272,7 +12434,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12272
12434
|
wrappedElement = wrapFarmRouteClientGraph(wrappedElement);
|
|
12273
12435
|
}
|
|
12274
12436
|
|
|
12275
|
-
${
|
|
12437
|
+
${_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) wrappedElement = markLayoutPosition(React, wrappedElement);" : ""}
|
|
12276
12438
|
wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
|
|
12277
12439
|
return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushToken);
|
|
12278
12440
|
};
|
|
@@ -12343,7 +12505,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12343
12505
|
);
|
|
12344
12506
|
}
|
|
12345
12507
|
}
|
|
12346
|
-
${_optionalChain([config, 'access',
|
|
12508
|
+
${_optionalChain([config, 'access', _289 => _289.md, 'optionalAccess', _290 => _290.enabled]) ? `
|
|
12347
12509
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
12348
12510
|
// using the public path the .md request will be resolved against.
|
|
12349
12511
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -12372,7 +12534,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12372
12534
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "cookie" });
|
|
12373
12535
|
}
|
|
12374
12536
|
|
|
12375
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
12537
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _291 => _291.agent, 'optionalAccess', _292 => _292.jsonLd]), () => ( false)))} });
|
|
12376
12538
|
const title = renderedMetadata.title;
|
|
12377
12539
|
const metaTags = renderedMetadata.tags;
|
|
12378
12540
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -12450,6 +12612,18 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12450
12612
|
// Set once the whole document is rendered: whether it starts with the boot entry, which
|
|
12451
12613
|
// preloads nothing.
|
|
12452
12614
|
let farmBootsClient = false;
|
|
12615
|
+
// A document something hydrates over holds the clicks and submits made before it hydrates,
|
|
12616
|
+
// for the client entry to replay, as development does. One that starts with the boot entry
|
|
12617
|
+
// holds its own.
|
|
12618
|
+
const farmHoldsInteractions =
|
|
12619
|
+
route.shouldHydrate ||
|
|
12620
|
+
shouldHydrateLayout ||
|
|
12621
|
+
renderedRouteSlots.some(function(slot) { return slot.hydrates; });
|
|
12622
|
+
const renderFarmPreHydrationHoldScript = function() {
|
|
12623
|
+
return farmHoldsInteractions && !farmBootsClient
|
|
12624
|
+
? stampFarmCspNonce(createPreHydrationClickQueueScript()) + '\\n'
|
|
12625
|
+
: '';
|
|
12626
|
+
};
|
|
12453
12627
|
// A client navigation swaps this document in without running its scripts. A route a
|
|
12454
12628
|
// shared cache stores renders the same for every request.
|
|
12455
12629
|
const farmNavigationRequest = ${farmIslandsMode ? `!farmSharedCacheableRoute &&
|
|
@@ -12464,7 +12638,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12464
12638
|
composed = composed
|
|
12465
12639
|
// Inject CSS link after opening head tag or first meta tag
|
|
12466
12640
|
.replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + (farmBootsClient ? "" : renderFarmClientModulePreloads(composed, route.clientModule, farmNavigationRequest)); })
|
|
12467
|
-
.replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
|
|
12641
|
+
.replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n' + renderFarmPreHydrationHoldScript() + '</head>')
|
|
12468
12642
|
// Explicit metadata wins over renderer and layout titles. Without
|
|
12469
12643
|
// explicit metadata, a renderer title wins over the layout title.
|
|
12470
12644
|
.replace(/<head([^>]*)>([\\s\\S]*?)<\\/head>/i, (match, attrs, headContent) => {
|
|
@@ -12539,6 +12713,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12539
12713
|
' <link rel="stylesheet" href="/__farm_client_css_href__">\\n' +
|
|
12540
12714
|
' <link rel="modulepreload" href="/__farm_client_js_src__">' + renderFarmClientModulePreloads(null, route.clientModule) + '\\n' +
|
|
12541
12715
|
renderFarmRendererHydrationScript() + '\\n' +
|
|
12716
|
+
renderFarmPreHydrationHoldScript() +
|
|
12542
12717
|
'</head>\\n<body>\\n' + farmEarlyClientScripts + ' <div id="root">';
|
|
12543
12718
|
const streamClientScripts = farmEarlyClientScripts ? '' : farmClientScripts();
|
|
12544
12719
|
const streamSuffix = function() {
|
|
@@ -12695,7 +12870,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12695
12870
|
\${suppressDefaultTitle ? "" : "<title>" + title + "</title>"}\${metaTags}\${rendererHead ? "\\n " + rendererHead : ""}
|
|
12696
12871
|
<link rel="stylesheet" href="/__farm_client_css_href__">\${farmBootsClient ? "" : renderFarmClientModulePreloads(html, route.clientModule, farmNavigationRequest)}
|
|
12697
12872
|
\${renderFarmRendererHydrationScript()}
|
|
12698
|
-
</head>
|
|
12873
|
+
\${renderFarmPreHydrationHoldScript()}</head>
|
|
12699
12874
|
<body>
|
|
12700
12875
|
<div id="root">\${html}</div>
|
|
12701
12876
|
\${renderFarmClientBootstrapScript(pageProps.__farmCanonicalPath, farmDeferredData.data.slots, farmDeferredData.data.page, routePathname)}\${renderFarmDeferredDataScript(farmDeferredData.records)}
|
|
@@ -12893,7 +13068,7 @@ ${servesDefaultMCP ? `
|
|
|
12893
13068
|
)` : "await renderErrorElement()"};
|
|
12894
13069
|
const errorDocument = applyFarmThemeDocument(
|
|
12895
13070
|
applyFarmI18nDocument(
|
|
12896
|
-
createFarmErrorDocument(errorHtml, "Application Error"),
|
|
13071
|
+
createFarmErrorDocument(errorHtml, "Application Error", routePathname),
|
|
12897
13072
|
pathname,
|
|
12898
13073
|
getFarmI18nSnapshot(),
|
|
12899
13074
|
request
|
|
@@ -12934,7 +13109,8 @@ ${servesDefaultMCP ? `
|
|
|
12934
13109
|
applyFarmI18nDocument(
|
|
12935
13110
|
createFarmErrorDocument(
|
|
12936
13111
|
fallbackHtml,
|
|
12937
|
-
errorStatus + " - " + errorStatusText
|
|
13112
|
+
errorStatus + " - " + errorStatusText,
|
|
13113
|
+
routePathname
|
|
12938
13114
|
),
|
|
12939
13115
|
pathname,
|
|
12940
13116
|
getFarmI18nSnapshot(),
|
|
@@ -13057,7 +13233,7 @@ ${farmRendererDisabled ? `
|
|
|
13057
13233
|
.replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
|
|
13058
13234
|
.replace(
|
|
13059
13235
|
/<\\/body>/i,
|
|
13060
|
-
() => ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname) + '\\n' +
|
|
13236
|
+
() => ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true) + '\\n' +
|
|
13061
13237
|
' ' + renderFarmClientEntryScript() + '\\n</body>',
|
|
13062
13238
|
);
|
|
13063
13239
|
fullHtml = ensureFarmDocumentMeta(fullHtml, notFoundMetadata.viewport);
|
|
@@ -13077,7 +13253,7 @@ ${farmRendererDisabled ? `
|
|
|
13077
13253
|
</head>
|
|
13078
13254
|
<body>
|
|
13079
13255
|
<div id="root">\${html}</div>
|
|
13080
|
-
\${renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname)}
|
|
13256
|
+
\${renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true)}
|
|
13081
13257
|
\${renderFarmClientEntryScript()}
|
|
13082
13258
|
</body>
|
|
13083
13259
|
</html>\`;
|
|
@@ -13205,11 +13381,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
|
|
|
13205
13381
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
13206
13382
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
13207
13383
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
13208
|
-
${_optionalChain([config, 'access',
|
|
13384
|
+
${_optionalChain([config, 'access', _293 => _293.agent, 'optionalAccess', _294 => _294.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
13209
13385
|
basePath: farmLocalAPIBasePath,
|
|
13210
13386
|
dispatch: async (localRequest) =>
|
|
13211
13387
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
13212
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
13388
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _295 => _295.agent, 'optionalAccess', _296 => _296.noindexPreviews]) ? `
|
|
13213
13389
|
// Keep every response of a preview deployment out of search indexes.
|
|
13214
13390
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
13215
13391
|
}
|
|
@@ -13419,7 +13595,7 @@ function getManifestPageEntry(manifest, pathname) {
|
|
|
13419
13595
|
})).sort((left, right) => _chunkML4TOUZPcjs.compareRouteSpecificity.call(void 0, left.specificity, right.specificity)).map(({ entry, matches }) => ({ entry, matches }));
|
|
13420
13596
|
manifestPageMatchers.set(manifest.routes, pages);
|
|
13421
13597
|
}
|
|
13422
|
-
return _optionalChain([pages, 'access',
|
|
13598
|
+
return _optionalChain([pages, 'access', _297 => _297.find, 'call', _298 => _298((page) => page.matches(pathname)), 'optionalAccess', _299 => _299.entry]);
|
|
13423
13599
|
}
|
|
13424
13600
|
function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
13425
13601
|
if (!edgeGuarded) return headers;
|
|
@@ -13456,13 +13632,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
13456
13632
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
13457
13633
|
return "rewrite";
|
|
13458
13634
|
}
|
|
13459
|
-
if (
|
|
13460
|
-
if (
|
|
13461
|
-
if (
|
|
13635
|
+
if (_chunkNEKO3HM2cjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
13636
|
+
if (_chunkNEKO3HM2cjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
13637
|
+
if (_chunkLM2ZDNDDcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
13462
13638
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
13463
13639
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
13464
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
13465
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
13640
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _300 => _300.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
13641
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _301 => _301.regions, 'optionalAccess', _302 => _302.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
13466
13642
|
return "route runtime controls";
|
|
13467
13643
|
}
|
|
13468
13644
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -13475,14 +13651,14 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
13475
13651
|
return void 0;
|
|
13476
13652
|
}
|
|
13477
13653
|
async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
13478
|
-
if (!_optionalChain([config, 'access',
|
|
13654
|
+
if (!_optionalChain([config, 'access', _303 => _303.docs, 'optionalAccess', _304 => _304.enabled]) || !config.docs.prerender) return [];
|
|
13479
13655
|
if (_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
|
|
13480
13656
|
_chunk7U4XF76Rcjs.logger.info(
|
|
13481
13657
|
`\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
|
|
13482
13658
|
);
|
|
13483
13659
|
return [];
|
|
13484
13660
|
}
|
|
13485
|
-
if (!
|
|
13661
|
+
if (!_chunkHHQEKLZLcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
13486
13662
|
const { pages: pages2, originDependent } = _chunkHR5GU4UUcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
|
|
13487
13663
|
root,
|
|
13488
13664
|
srcDir: config.srcDir
|
|
@@ -13494,13 +13670,13 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
13494
13670
|
}
|
|
13495
13671
|
return pages2;
|
|
13496
13672
|
}
|
|
13497
|
-
if (!
|
|
13673
|
+
if (!_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer)) {
|
|
13498
13674
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
13499
13675
|
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} renders with React; docs.prerender keeps its pages rendering on request with the "${config.renderer.name}" renderer.`
|
|
13500
13676
|
);
|
|
13501
13677
|
return [];
|
|
13502
13678
|
}
|
|
13503
|
-
const pages = await
|
|
13679
|
+
const pages = await _chunkHHQEKLZLcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
13504
13680
|
if (!pages) {
|
|
13505
13681
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
13506
13682
|
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
|
|
@@ -13510,14 +13686,14 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
13510
13686
|
return pages;
|
|
13511
13687
|
}
|
|
13512
13688
|
async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
13513
|
-
if (!_optionalChain([config, 'access',
|
|
13689
|
+
if (!_optionalChain([config, 'access', _305 => _305.docs, 'optionalAccess', _306 => _306.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
|
|
13514
13690
|
return [];
|
|
13515
13691
|
}
|
|
13516
13692
|
try {
|
|
13517
|
-
return await
|
|
13693
|
+
return await _chunkHHQEKLZLcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
13518
13694
|
root,
|
|
13519
13695
|
srcDir: config.srcDir,
|
|
13520
|
-
adapter:
|
|
13696
|
+
adapter: _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) && _chunkHHQEKLZLcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
13521
13697
|
});
|
|
13522
13698
|
} catch (error) {
|
|
13523
13699
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
@@ -13528,9 +13704,9 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
|
13528
13704
|
}
|
|
13529
13705
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
13530
13706
|
return Object.values(routeRules || {}).some((rule) => {
|
|
13531
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
13532
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
13533
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
13707
|
+
const swr = _optionalChain([rule, 'optionalAccess', _307 => _307.swr]);
|
|
13708
|
+
const cache = _optionalChain([rule, 'optionalAccess', _308 => _308.cache]);
|
|
13709
|
+
const headers = _optionalChain([rule, 'optionalAccess', _309 => _309.headers]);
|
|
13534
13710
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
13535
13711
|
});
|
|
13536
13712
|
}
|
|
@@ -13543,10 +13719,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
13543
13719
|
const nitroBuilder = nitroBuilderResult.value;
|
|
13544
13720
|
const isVercel = preset === "vercel";
|
|
13545
13721
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
13546
|
-
const outputDir =
|
|
13722
|
+
const outputDir = _chunkLM2ZDNDDcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
13547
13723
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
13548
13724
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
13549
|
-
const imageRuntime =
|
|
13725
|
+
const imageRuntime = _chunkARORZ3MHcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
13550
13726
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
13551
13727
|
(image) => image.sourceType === "module"
|
|
13552
13728
|
);
|
|
@@ -13568,11 +13744,11 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
13568
13744
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
|
|
13569
13745
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
|
|
13570
13746
|
const ssgCollectionPromise = routeManager.collectSSGPages();
|
|
13571
|
-
const middlewareRoutesPromise = discoverMiddlewareRoutes(
|
|
13747
|
+
const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config));
|
|
13572
13748
|
const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
|
|
13573
13749
|
const docsPrerenderPagesPromise = getFarmDocsPrerenderPages(config, root, preset);
|
|
13574
|
-
const farmWorkflows = await
|
|
13575
|
-
const farmCron = await
|
|
13750
|
+
const farmWorkflows = await _chunkBSX5OGSDcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
|
|
13751
|
+
const farmCron = await _chunkHQKCSJEHcjs.prepareFarmCronForNitro.call(void 0, config);
|
|
13576
13752
|
const [
|
|
13577
13753
|
{ ssg: ssgPages },
|
|
13578
13754
|
middlewareRoutes,
|
|
@@ -13602,7 +13778,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
13602
13778
|
const edgeGuardedPrerenderRoutes = [];
|
|
13603
13779
|
const addPrerenderRoute = (pathname) => {
|
|
13604
13780
|
prerenderRoutes.push(pathname);
|
|
13605
|
-
if (
|
|
13781
|
+
if (_chunkNEKO3HM2cjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
|
|
13606
13782
|
edgeGuardedPrerenderRoutes.push(pathname);
|
|
13607
13783
|
}
|
|
13608
13784
|
};
|
|
@@ -13661,12 +13837,12 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
13661
13837
|
"Cloudflare Pages does not install Cron Triggers. Use the cloudflare-module preset or an external scheduler with .farm/cron-manifest.json."
|
|
13662
13838
|
);
|
|
13663
13839
|
}
|
|
13664
|
-
const portableScheduledTasks =
|
|
13840
|
+
const portableScheduledTasks = _chunkHQKCSJEHcjs.mergeScheduledTasks.call(void 0,
|
|
13665
13841
|
farmWorkflows.scheduledTasks,
|
|
13666
13842
|
farmCron.scheduledTasks
|
|
13667
13843
|
);
|
|
13668
|
-
const scheduledTasks = preset.startsWith("cloudflare") ?
|
|
13669
|
-
const cloudflareCronConfig = farmCron.provider === "host" ?
|
|
13844
|
+
const scheduledTasks = preset.startsWith("cloudflare") ? _chunkHQKCSJEHcjs.toFarmCronCloudflareScheduledTasks.call(void 0, portableScheduledTasks) : portableScheduledTasks;
|
|
13845
|
+
const cloudflareCronConfig = farmCron.provider === "host" ? _chunkHQKCSJEHcjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs) : void 0;
|
|
13670
13846
|
const [
|
|
13671
13847
|
clientCssHref,
|
|
13672
13848
|
clientJsSrc,
|
|
@@ -13693,7 +13869,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
13693
13869
|
webEntry: clientJsSrc,
|
|
13694
13870
|
webBoot: clientBootSrc,
|
|
13695
13871
|
stylesheet: clientCssHref,
|
|
13696
|
-
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess',
|
|
13872
|
+
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _310 => _310.files]), () => ( []))
|
|
13697
13873
|
})
|
|
13698
13874
|
) : null;
|
|
13699
13875
|
for (const output of Object.values(ssrBundle)) {
|
|
@@ -14016,7 +14192,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14016
14192
|
varyFarmNitroCacheRules(_chunkIIHZ2BEEcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
|
|
14017
14193
|
...config.md.enabled ? ["accept"] : [],
|
|
14018
14194
|
...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : [],
|
|
14019
|
-
..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
14195
|
+
..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _311 => _311.experimental, 'optionalAccess', _312 => _312.serverComponents])) === "islands" ? ["f-layouts"] : []
|
|
14020
14196
|
]),
|
|
14021
14197
|
config.basePath,
|
|
14022
14198
|
_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
|
|
@@ -14044,6 +14220,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
14044
14220
|
];
|
|
14045
14221
|
})
|
|
14046
14222
|
);
|
|
14223
|
+
if (preset === "node-server" || preset === "bun") {
|
|
14224
|
+
await writeFarmClientBrotliAssets(clientOutputDir);
|
|
14225
|
+
}
|
|
14047
14226
|
const immutableAssets = isVercel ? { publicAssets: [], routeRules: {} } : planFarmImmutableAssets({
|
|
14048
14227
|
clientOutputDir,
|
|
14049
14228
|
files: await listFarmClientOutputFiles(clientOutputDir),
|
|
@@ -14077,11 +14256,12 @@ function toFarmNodeResponse(request, response) {
|
|
|
14077
14256
|
// Nitro gives the root directory no Cache-Control on any preset (it falls through to the
|
|
14078
14257
|
// app), so public files keep revalidating; the hashed directories carry their own maxAge.
|
|
14079
14258
|
publicAssets: [{ dir: clientOutputDir, baseURL: "/" }, ...immutableAssets.publicAssets],
|
|
14080
|
-
// A self-hosted Node server sends static files itself, so precompress
|
|
14081
|
-
// with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
|
|
14082
|
-
// fixed top quality cost a docs app ~20 s of build CPU
|
|
14083
|
-
//
|
|
14084
|
-
|
|
14259
|
+
// A self-hosted Node or Bun server sends static files itself, so precompress
|
|
14260
|
+
// them with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
|
|
14261
|
+
// fixed top quality on every file cost a docs app ~20 s of build CPU, so only
|
|
14262
|
+
// client scripts and stylesheets get a brotli copy (writeFarmClientBrotliAssets).
|
|
14263
|
+
// Serverless and edge targets sit behind a CDN that compresses.
|
|
14264
|
+
...preset === "node-server" || preset === "bun" ? { compressPublicAssets: { gzip: true } } : {},
|
|
14085
14265
|
// Nitro gzips every server output file at level 9, node_modules included, to
|
|
14086
14266
|
// print sizes after the build. A self-hosted server is never shipped compressed,
|
|
14087
14267
|
// so list plain sizes; zipped serverless and edge bundles keep the gzip column.
|
|
@@ -14177,22 +14357,22 @@ function toFarmNodeResponse(request, response) {
|
|
|
14177
14357
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
14178
14358
|
);
|
|
14179
14359
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
14180
|
-
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
14181
|
-
_optionalChain([nitroConfig, 'access',
|
|
14182
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
14360
|
+
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _315 => _315.rollupConfig, 'optionalAccess', _316 => _316.plugins])) && customRollupKeys.length === 0 && Boolean(
|
|
14361
|
+
_optionalChain([nitroConfig, 'access', _317 => _317.handlers, 'optionalAccess', _318 => _318.some, 'call', _319 => _319(
|
|
14362
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _320 => _320.handler]) || "") === nitroEntryPath
|
|
14183
14363
|
)])
|
|
14184
14364
|
);
|
|
14185
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access',
|
|
14365
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _321 => _321.output, 'optionalAccess', _322 => _322.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
|
|
14186
14366
|
const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
|
|
14187
14367
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
14188
14368
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
14189
14369
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
14190
14370
|
const shouldMinify = nitroConfig.minify !== false;
|
|
14191
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
14371
|
+
const keepServerNames = !(_optionalChain([config, 'access', _323 => _323.docs, 'optionalAccess', _324 => _324.enabled]) && _optionalChain([config, 'access', _325 => _325.docs, 'access', _326 => _326.adapter, 'optionalAccess', _327 => _327.server]));
|
|
14192
14372
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
14193
14373
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
14194
14374
|
const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
|
|
14195
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
14375
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _328 => _328.rollupConfig, 'optionalAccess', _329 => _329.plugins]);
|
|
14196
14376
|
nitroConfig.rollupConfig = {
|
|
14197
14377
|
...nitroConfig.rollupConfig,
|
|
14198
14378
|
plugins: [
|
|
@@ -14231,7 +14411,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14231
14411
|
let skippedNonHtmlPrerenderRoute = false;
|
|
14232
14412
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
14233
14413
|
if (route.error || !prerenderPagePaths.has(route.route)) return;
|
|
14234
|
-
if (_optionalChain([route, 'access',
|
|
14414
|
+
if (_optionalChain([route, 'access', _330 => _330.contentType, 'optionalAccess', _331 => _331.toLowerCase, 'call', _332 => _332(), 'access', _333 => _333.includes, 'call', _334 => _334("html")])) return;
|
|
14235
14415
|
route.skip = true;
|
|
14236
14416
|
skippedNonHtmlPrerenderRoute = true;
|
|
14237
14417
|
const configuredRule = configuredNitroRouteRules[route.route];
|
|
@@ -14242,9 +14422,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
14242
14422
|
nitroInstance.hooks.hook("prerender:done", () => {
|
|
14243
14423
|
if (skippedNonHtmlPrerenderRoute) nitroInstance.routing.sync();
|
|
14244
14424
|
});
|
|
14245
|
-
if (_optionalChain([config, 'access',
|
|
14425
|
+
if (_optionalChain([config, 'access', _335 => _335.md, 'optionalAccess', _336 => _336.enabled])) {
|
|
14246
14426
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
14247
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
14427
|
+
if (!route.contents || !_optionalChain([route, 'access', _337 => _337.contentType, 'optionalAccess', _338 => _338.toLowerCase, 'call', _339 => _339(), 'access', _340 => _340.includes, 'call', _341 => _341("html")])) return;
|
|
14248
14428
|
const alternatePath = _chunk2NOHVIJ3cjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
|
|
14249
14429
|
routePathname: (pathname) => routeManager.toRoutePathname(pathname)
|
|
14250
14430
|
});
|
|
@@ -14267,7 +14447,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14267
14447
|
}
|
|
14268
14448
|
if (config.security.csp && config.security.csp.nonce) {
|
|
14269
14449
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
14270
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
14450
|
+
if (!route.contents || !_optionalChain([route, 'access', _342 => _342.contentType, 'optionalAccess', _343 => _343.toLowerCase, 'call', _344 => _344(), 'access', _345 => _345.includes, 'call', _346 => _346("html")])) return;
|
|
14271
14451
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
14272
14452
|
if (!staticCsp) return;
|
|
14273
14453
|
route.contents = staticCsp.html;
|
|
@@ -14303,7 +14483,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14303
14483
|
await nitroBuilder.copyPublicAssets(nitroInstance);
|
|
14304
14484
|
if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
|
|
14305
14485
|
nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
|
|
14306
|
-
const configuredPlugins = _optionalChain([prerendererConfig, 'access',
|
|
14486
|
+
const configuredPlugins = _optionalChain([prerendererConfig, 'access', _347 => _347.rollupConfig, 'optionalAccess', _348 => _348.plugins]);
|
|
14307
14487
|
const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
|
|
14308
14488
|
prerendererConfig.rollupConfig = {
|
|
14309
14489
|
...prerendererConfig.rollupConfig,
|
|
@@ -14360,13 +14540,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
14360
14540
|
}
|
|
14361
14541
|
if (prerenderRoutes.length > 0) {
|
|
14362
14542
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
14363
|
-
const previousPrerender = process.env[
|
|
14364
|
-
process.env[
|
|
14543
|
+
const previousPrerender = process.env[_chunkCD5Z7RR5cjs.FARM_PRERENDER_ENV];
|
|
14544
|
+
process.env[_chunkCD5Z7RR5cjs.FARM_PRERENDER_ENV] = "1";
|
|
14365
14545
|
try {
|
|
14366
14546
|
await nitroBuilder.prerender(nitroInstance);
|
|
14367
14547
|
} finally {
|
|
14368
|
-
if (previousPrerender === void 0) delete process.env[
|
|
14369
|
-
else process.env[
|
|
14548
|
+
if (previousPrerender === void 0) delete process.env[_chunkCD5Z7RR5cjs.FARM_PRERENDER_ENV];
|
|
14549
|
+
else process.env[_chunkCD5Z7RR5cjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
14370
14550
|
}
|
|
14371
14551
|
}
|
|
14372
14552
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
|
|
@@ -14543,7 +14723,7 @@ async function moveVercelOutputPath(src, dest, fs5) {
|
|
|
14543
14723
|
await fs5.rename(src, dest);
|
|
14544
14724
|
return;
|
|
14545
14725
|
} catch (error) {
|
|
14546
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
14726
|
+
const code = _optionalChain([error, 'optionalAccess', _349 => _349.code]);
|
|
14547
14727
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
14548
14728
|
throw error;
|
|
14549
14729
|
}
|
|
@@ -14569,7 +14749,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
14569
14749
|
try {
|
|
14570
14750
|
await moveVercelOutputPath(publicDir, staticDir, fs5);
|
|
14571
14751
|
} catch (error) {
|
|
14572
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
14752
|
+
if (_optionalChain([error, 'optionalAccess', _350 => _350.code]) !== "ENOENT") throw error;
|
|
14573
14753
|
}
|
|
14574
14754
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5);
|
|
14575
14755
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs5);
|
|
@@ -14583,7 +14763,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
14583
14763
|
config.basePath
|
|
14584
14764
|
);
|
|
14585
14765
|
const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
|
|
14586
|
-
(route) => edgeMiddleware.guardedPages.some((pathname) =>
|
|
14766
|
+
(route) => edgeMiddleware.guardedPages.some((pathname) => _chunkNEKO3HM2cjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
|
|
14587
14767
|
);
|
|
14588
14768
|
if (edgeMiddlewareRoutes.length > 0) {
|
|
14589
14769
|
await writeFarmVercelEdgeMiddlewareFunction({
|
|
@@ -14602,16 +14782,16 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
14602
14782
|
middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? createFarmVercelEdgeMiddlewareRoutes(edgeMiddleware.guardedPages, config.basePath) : [],
|
|
14603
14783
|
canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
|
|
14604
14784
|
});
|
|
14605
|
-
const vercelConfigWithWorkflowCrons =
|
|
14785
|
+
const vercelConfigWithWorkflowCrons = _chunkBSX5OGSDcjs.applyFarmWorkflowVercelCrons.call(void 0,
|
|
14606
14786
|
vercelConfig,
|
|
14607
14787
|
farmWorkflows.workflows
|
|
14608
14788
|
);
|
|
14609
|
-
const vercelConfigWithCrons =
|
|
14789
|
+
const vercelConfigWithCrons = _chunkHQKCSJEHcjs.applyFarmCronVercelCrons.call(void 0, vercelConfigWithWorkflowCrons, cronJobs);
|
|
14610
14790
|
await fs5.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
|
|
14611
14791
|
_chunk7U4XF76Rcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
14612
14792
|
}
|
|
14613
14793
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
|
|
14614
|
-
if (!_optionalChain([config, 'access',
|
|
14794
|
+
if (!_optionalChain([config, 'access', _351 => _351.docs, 'optionalAccess', _352 => _352.enabled])) return;
|
|
14615
14795
|
const [mainRoot, ...extraRoots] = _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs);
|
|
14616
14796
|
await copyFarmDocsRootContent(
|
|
14617
14797
|
mainRoot,
|
|
@@ -14636,7 +14816,7 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
|
|
|
14636
14816
|
const lastModifiedManifest = _chunkHR5GU4UUcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
14637
14817
|
fallback: "now"
|
|
14638
14818
|
});
|
|
14639
|
-
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access',
|
|
14819
|
+
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _353 => _353.unknown, 'optionalAccess', _354 => _354.length]), () => ( 0));
|
|
14640
14820
|
if (undatedPages > 0) {
|
|
14641
14821
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
14642
14822
|
`${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
|
|
@@ -14721,7 +14901,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
|
|
|
14721
14901
|
try {
|
|
14722
14902
|
await copyPackage("sharp", sharpRequire);
|
|
14723
14903
|
if (!copiedPackages.has("sharp")) {
|
|
14724
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
14904
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkARORZ3MHcjs.SHARP_INSTALL_HINT}`);
|
|
14725
14905
|
}
|
|
14726
14906
|
} catch (error) {
|
|
14727
14907
|
await fs5.rm(stageDir, { recursive: true, force: true });
|
|
@@ -14922,9 +15102,9 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs5) {
|
|
|
14922
15102
|
};
|
|
14923
15103
|
await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs5);
|
|
14924
15104
|
}
|
|
14925
|
-
function islandsActionKeyCode() {
|
|
15105
|
+
function islandsActionKeyCode(runtimeModule) {
|
|
14926
15106
|
const key = _crypto.randomBytes.call(void 0, 32).toString("base64url");
|
|
14927
|
-
return `import { setBuildDefaults as __farmIslxBuildDefaults } from
|
|
15107
|
+
return `import { setBuildDefaults as __farmIslxBuildDefaults } from ${JSON.stringify(runtimeModule)};
|
|
14928
15108
|
__farmIslxBuildDefaults({ key: ${JSON.stringify(key)} });`;
|
|
14929
15109
|
}
|
|
14930
15110
|
|
|
@@ -14954,7 +15134,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
14954
15134
|
// src/build/index.ts
|
|
14955
15135
|
async function build(config, options = {}) {
|
|
14956
15136
|
return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
|
|
14957
|
-
() =>
|
|
15137
|
+
() => _chunkDRO3NXA3cjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
14958
15138
|
);
|
|
14959
15139
|
}
|
|
14960
15140
|
function createBuildTargetBaseline(config) {
|
|
@@ -14965,7 +15145,7 @@ function createBuildTargetBaseline(config) {
|
|
|
14965
15145
|
preset,
|
|
14966
15146
|
distDir,
|
|
14967
15147
|
outputDir,
|
|
14968
|
-
outputWasDerived: outputDir ===
|
|
15148
|
+
outputWasDerived: outputDir === _chunkLM2ZDNDDcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
14969
15149
|
};
|
|
14970
15150
|
}
|
|
14971
15151
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -14974,8 +15154,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
14974
15154
|
const distDir = config.distDir || ".farm";
|
|
14975
15155
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
14976
15156
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
14977
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
14978
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
15157
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkLM2ZDNDDcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
15158
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkLM2ZDNDDcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
14979
15159
|
return {
|
|
14980
15160
|
root,
|
|
14981
15161
|
preset,
|
|
@@ -14983,7 +15163,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
14983
15163
|
distDir,
|
|
14984
15164
|
deployTarget,
|
|
14985
15165
|
outputDir,
|
|
14986
|
-
deployOutputDir:
|
|
15166
|
+
deployOutputDir: _chunkLM2ZDNDDcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
14987
15167
|
};
|
|
14988
15168
|
}
|
|
14989
15169
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -14991,7 +15171,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
14991
15171
|
const targetBaseline = createBuildTargetBaseline(config);
|
|
14992
15172
|
let targets;
|
|
14993
15173
|
const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))]);
|
|
14994
|
-
const pluginManager = new (0,
|
|
15174
|
+
const pluginManager = new (0, _chunkVACYUMXWcjs.PluginManager)({
|
|
14995
15175
|
config,
|
|
14996
15176
|
isDev: false,
|
|
14997
15177
|
isProd: true
|
|
@@ -15020,15 +15200,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15020
15200
|
};
|
|
15021
15201
|
config = {
|
|
15022
15202
|
...config,
|
|
15023
|
-
images:
|
|
15203
|
+
images: _chunkARORZ3MHcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
15024
15204
|
root: targets.root,
|
|
15025
15205
|
preset: targets.preset
|
|
15026
15206
|
})
|
|
15027
15207
|
};
|
|
15028
|
-
if (_optionalChain([config, 'access',
|
|
15208
|
+
if (_optionalChain([config, 'access', _355 => _355.docs, 'optionalAccess', _356 => _356.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
|
|
15029
15209
|
pluginManager.updateContext({ config });
|
|
15030
15210
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
15031
|
-
|
|
15211
|
+
_chunkDRO3NXA3cjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkDRO3NXA3cjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
15032
15212
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
15033
15213
|
await pluginManager.setupPlugins();
|
|
15034
15214
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
@@ -15040,8 +15220,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15040
15220
|
});
|
|
15041
15221
|
_chunk7U4XF76Rcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
15042
15222
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
15043
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
15044
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
15223
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _357 => _357.status]) === "rejected") throw productionViteResult.reason;
|
|
15224
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _358 => _358.value]);
|
|
15045
15225
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
15046
15226
|
projectModuleServer = await createProjectModuleServer(
|
|
15047
15227
|
createViteServer,
|
|
@@ -15049,19 +15229,19 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15049
15229
|
root,
|
|
15050
15230
|
rendererBuild.signal
|
|
15051
15231
|
);
|
|
15052
|
-
const farmApp =
|
|
15232
|
+
const farmApp = _chunkARORZ3MHcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
15053
15233
|
if (options.universal !== false) farmApp.getRouteManager().keepBuildSourceSnapshot();
|
|
15054
15234
|
await farmApp.initialize();
|
|
15055
15235
|
const routeManager = farmApp.getRouteManager();
|
|
15056
15236
|
const serverRenderer = farmApp.getServerRenderer();
|
|
15057
|
-
const typeArtifacts =
|
|
15237
|
+
const typeArtifacts = _chunkVMBIKDKWcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
15058
15238
|
root,
|
|
15059
15239
|
srcDir,
|
|
15060
15240
|
layers: config.layers,
|
|
15061
15241
|
storage: config.storage,
|
|
15062
15242
|
plugins: config.plugins,
|
|
15063
15243
|
extraRoutes: [
|
|
15064
|
-
..._optionalChain([config, 'access',
|
|
15244
|
+
..._optionalChain([config, 'access', _359 => _359.openapi, 'optionalAccess', _360 => _360.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
15065
15245
|
..._chunkHR5GU4UUcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
15066
15246
|
],
|
|
15067
15247
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
@@ -15071,8 +15251,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15071
15251
|
const message = error instanceof Error ? error.message : String(error);
|
|
15072
15252
|
_chunk7U4XF76Rcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
15073
15253
|
});
|
|
15074
|
-
const apiRouteManager = new (0,
|
|
15075
|
-
|
|
15254
|
+
const apiRouteManager = new (0, _chunk5P65LXGUcjs.APIRouteManager)(
|
|
15255
|
+
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config),
|
|
15076
15256
|
projectModuleServer,
|
|
15077
15257
|
{
|
|
15078
15258
|
throwOnLoadError: true,
|
|
@@ -15146,19 +15326,19 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15146
15326
|
throw error;
|
|
15147
15327
|
} finally {
|
|
15148
15328
|
try {
|
|
15149
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
15329
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _361 => _361.close, 'call', _362 => _362()]);
|
|
15150
15330
|
} finally {
|
|
15151
15331
|
rendererBuild.abort();
|
|
15152
15332
|
}
|
|
15153
15333
|
}
|
|
15154
15334
|
}
|
|
15155
15335
|
async function createProjectModuleServer(createViteServer, config, root, buildLifetime) {
|
|
15156
|
-
const { farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
15157
|
-
const rendererVitePlugins = await
|
|
15336
|
+
const { farmNavigationPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
15337
|
+
const rendererVitePlugins = await _chunkBCTHOQPPcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
|
|
15158
15338
|
ssr: true,
|
|
15159
15339
|
buildLifetime
|
|
15160
15340
|
});
|
|
15161
|
-
const viteConfig =
|
|
15341
|
+
const viteConfig = _chunkARORZ3MHcjs.mergeFarmViteConfig.call(void 0,
|
|
15162
15342
|
{
|
|
15163
15343
|
root,
|
|
15164
15344
|
appType: "custom",
|
|
@@ -15170,12 +15350,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15170
15350
|
},
|
|
15171
15351
|
plugins: [
|
|
15172
15352
|
...rendererVitePlugins,
|
|
15173
|
-
|
|
15353
|
+
_chunkARORZ3MHcjs.farmFontImportsPlugin.call(void 0, {
|
|
15174
15354
|
root,
|
|
15175
15355
|
basePath: config.basePath,
|
|
15176
15356
|
publicDir: config.publicDir
|
|
15177
15357
|
}),
|
|
15178
|
-
|
|
15358
|
+
_chunkDRO3NXA3cjs.farmEnvironmentFunctionsPlugin.call(void 0, { renderer: config.renderer }),
|
|
15179
15359
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
15180
15360
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
15181
15361
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
@@ -15183,14 +15363,15 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15183
15363
|
farmServerOnlyEntriesPlugin({
|
|
15184
15364
|
prebundleServerPackages: true,
|
|
15185
15365
|
distDir: config.distDir || ".farm"
|
|
15186
|
-
})
|
|
15366
|
+
}),
|
|
15367
|
+
farmNavigationPlugin(config.renderer)
|
|
15187
15368
|
],
|
|
15188
15369
|
server: {
|
|
15189
15370
|
middlewareMode: true,
|
|
15190
15371
|
hmr: false
|
|
15191
15372
|
},
|
|
15192
15373
|
resolve: {
|
|
15193
|
-
alias:
|
|
15374
|
+
alias: _chunkARORZ3MHcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
15194
15375
|
dedupe: [...config.renderer.dedupe || []]
|
|
15195
15376
|
},
|
|
15196
15377
|
optimizeDeps: {
|
|
@@ -15229,10 +15410,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15229
15410
|
noDiscovery: true
|
|
15230
15411
|
},
|
|
15231
15412
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
15232
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
15413
|
+
environments: _optionalChain([viteConfig, 'access', _363 => _363.environments, 'optionalAccess', _364 => _364.ssr, 'optionalAccess', _365 => _365.dev, 'optionalAccess', _366 => _366.createEnvironment]) ? viteConfig.environments : {
|
|
15233
15414
|
...viteConfig.environments,
|
|
15234
15415
|
ssr: {
|
|
15235
|
-
..._optionalChain([viteConfig, 'access',
|
|
15416
|
+
..._optionalChain([viteConfig, 'access', _367 => _367.environments, 'optionalAccess', _368 => _368.ssr]),
|
|
15236
15417
|
...await createFarmProjectModuleSsrEnvironment()
|
|
15237
15418
|
}
|
|
15238
15419
|
}
|
|
@@ -15242,10 +15423,11 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15242
15423
|
const {
|
|
15243
15424
|
farmI18nClientBridgePlugin,
|
|
15244
15425
|
farmIslandContainersPlugin,
|
|
15426
|
+
farmNavigationPlugin,
|
|
15245
15427
|
farmPlugin,
|
|
15246
15428
|
farmServerOnlyEntriesPlugin
|
|
15247
15429
|
} = await import("./vite.cjs");
|
|
15248
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15430
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-3PT7I26P.cjs");
|
|
15249
15431
|
const pluginManager = new PluginManager2({
|
|
15250
15432
|
config,
|
|
15251
15433
|
isDev: false,
|
|
@@ -15264,16 +15446,17 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15264
15446
|
plugins: [
|
|
15265
15447
|
farmI18nClientBridgePlugin(),
|
|
15266
15448
|
farmServerOnlyEntriesPlugin({ distDir: config.distDir || ".farm" }),
|
|
15449
|
+
farmNavigationPlugin(config.renderer),
|
|
15267
15450
|
farmIslandContainersPlugin(config),
|
|
15268
15451
|
farmPlugin(config, pluginManager),
|
|
15269
|
-
|
|
15452
|
+
_chunkDRO3NXA3cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15270
15453
|
],
|
|
15271
15454
|
mode: "production"
|
|
15272
15455
|
});
|
|
15273
15456
|
}
|
|
15274
15457
|
async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
15275
15458
|
const { farmI18nClientBridgePlugin, farmIslandContainersPlugin, farmPlugin } = await import("./vite.cjs");
|
|
15276
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15459
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-3PT7I26P.cjs");
|
|
15277
15460
|
const pluginManager = new PluginManager2({
|
|
15278
15461
|
config,
|
|
15279
15462
|
isDev: false,
|
|
@@ -15294,20 +15477,20 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15294
15477
|
define: {
|
|
15295
15478
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
15296
15479
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
15297
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
15480
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _369 => _369.env, 'optionalAccess', _370 => _370.public]) || {})
|
|
15298
15481
|
},
|
|
15299
15482
|
plugins: [
|
|
15300
15483
|
farmI18nClientBridgePlugin(),
|
|
15301
15484
|
farmIslandContainersPlugin(config),
|
|
15302
15485
|
farmPlugin(config, pluginManager),
|
|
15303
|
-
|
|
15486
|
+
_chunkDRO3NXA3cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15304
15487
|
],
|
|
15305
15488
|
mode: "production"
|
|
15306
15489
|
});
|
|
15307
15490
|
}
|
|
15308
15491
|
function resolveLegacyPageEntry(config, root, srcDir) {
|
|
15309
15492
|
const appDir = _path2.default.join(root, srcDir, "app");
|
|
15310
|
-
for (const extension of
|
|
15493
|
+
for (const extension of _chunkBCTHOQPPcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer)) {
|
|
15311
15494
|
const candidate = _path2.default.join(appDir, `page${extension}`);
|
|
15312
15495
|
if (_fs.existsSync.call(void 0, candidate)) return candidate;
|
|
15313
15496
|
}
|
|
@@ -15315,7 +15498,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
|
|
|
15315
15498
|
}
|
|
15316
15499
|
async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
|
|
15317
15500
|
const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
|
|
15318
|
-
import("./nitro-
|
|
15501
|
+
import("./nitro-YDFMH5PY.cjs"),
|
|
15319
15502
|
import("nitro/builder")
|
|
15320
15503
|
]);
|
|
15321
15504
|
let nitroConfig = await createNitroConfig(
|
|
@@ -15328,7 +15511,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15328
15511
|
if (pluginManager) {
|
|
15329
15512
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
15330
15513
|
}
|
|
15331
|
-
const outputDir =
|
|
15514
|
+
const outputDir = _chunkLM2ZDNDDcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
15332
15515
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
15333
15516
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
15334
15517
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -15384,8 +15567,8 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15384
15567
|
farmRegistry.routePaths = routePaths;
|
|
15385
15568
|
try {
|
|
15386
15569
|
const clientManifestPath = _path2.default.join(root, distDir, "client", "farm-client-manifest.json");
|
|
15387
|
-
const { readFile } = await import("fs/promises");
|
|
15388
|
-
const manifestContent = await
|
|
15570
|
+
const { readFile: readFile2 } = await import("fs/promises");
|
|
15571
|
+
const manifestContent = await readFile2(clientManifestPath, "utf-8");
|
|
15389
15572
|
farmRegistry.clientManifest = JSON.parse(manifestContent);
|
|
15390
15573
|
} catch (e47) {
|
|
15391
15574
|
farmRegistry.clientManifest = {};
|
|
@@ -15399,7 +15582,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15399
15582
|
root,
|
|
15400
15583
|
preset,
|
|
15401
15584
|
distDir,
|
|
15402
|
-
outputDir:
|
|
15585
|
+
outputDir: _chunkLM2ZDNDDcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
15403
15586
|
});
|
|
15404
15587
|
}
|
|
15405
15588
|
}
|