@farm.js/core 0.1.68 → 0.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-handler-FER4MQDF.cjs → agent-mcp-handler-6T2Z7TB6.cjs} +8 -5
- package/dist/{agent-mcp-handler-AZ7QW4UP.mjs → agent-mcp-handler-CPU354QQ.mjs} +7 -4
- package/dist/{agent-mcp.d-Uh5xr7aX.d.ts → agent-mcp.d-DulgFLBt.d.ts} +13 -4
- package/dist/{agent-mcp.d-wkVPK1GA.d.mts → agent-mcp.d-TAs1ES2F.d.mts} +13 -4
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +3 -2
- package/dist/agent-runtime.d.ts +3 -2
- package/dist/agent-runtime.mjs +2 -2
- package/dist/analyzer-GUIRJWZH.cjs +16 -0
- package/dist/{analyzer-CQDU7E3Y.mjs → analyzer-QGRBLETM.mjs} +2 -2
- package/dist/api/node.d.mts +5 -4
- package/dist/api/node.d.ts +5 -4
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +16 -7
- package/dist/api/route-manager.d.ts +16 -7
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.d.mts +4 -3
- package/dist/api/runtime.d.ts +4 -3
- package/dist/api.cjs +6 -6
- package/dist/api.d.mts +8 -24
- package/dist/api.d.ts +8 -24
- package/dist/api.mjs +5 -5
- package/dist/{app-manifest.d-Dd4q5CFx.d.mts → app-manifest.d-6zXb90o6.d.mts} +1 -1
- package/dist/{app-manifest.d-BT5i2F-o.d.ts → app-manifest.d-C-nf3Vmm.d.ts} +1 -1
- package/dist/app-markdown.cjs +5 -4
- package/dist/app-markdown.d.mts +4 -3
- package/dist/app-markdown.d.ts +4 -3
- package/dist/app-markdown.mjs +4 -3
- package/dist/{app.d-BVOpL_f2.d.ts → app.d-C2xeMIYT.d.ts} +18 -8
- package/dist/{app.d-BhiDXex_.d.mts → app.d-DF0aundc.d.mts} +18 -8
- package/dist/{base-path.d-BOUV5ozD.d.mts → base-path.d-BJ3SYpB8.d.mts} +7 -1
- package/dist/{base-path.d-BOUV5ozD.d.ts → base-path.d-BJ3SYpB8.d.ts} +7 -1
- package/dist/{chunk-4ZXKYCYK.mjs → chunk-255J7K4X.mjs} +1 -1
- package/dist/{chunk-RVGLYMJM.cjs → chunk-2AM26UGI.cjs} +2 -2
- package/dist/{chunk-UPOYKX4S.cjs → chunk-2MR4MABG.cjs} +4 -4
- package/dist/chunk-2RCCFB2Y.cjs +129 -0
- package/dist/{chunk-K6VFYFOY.cjs → chunk-2W4GNXGX.cjs} +2 -2
- package/dist/{chunk-URN7VFO7.cjs → chunk-32SYRIQ7.cjs} +21 -22
- package/dist/{chunk-CV6MFQ4Y.mjs → chunk-3AUINHFG.mjs} +1 -1
- package/dist/{chunk-KDO6T6OB.mjs → chunk-3EXCZJEN.mjs} +2 -2
- package/dist/{chunk-MMDKYJ5V.cjs → chunk-3GNVIYPO.cjs} +7 -7
- package/dist/{chunk-65Y5SIBH.cjs → chunk-3QM74STY.cjs} +1 -1
- package/dist/{chunk-NT4W4H52.mjs → chunk-3WS5AZ3R.mjs} +23 -18
- package/dist/{chunk-FJMC24KG.cjs → chunk-42KMUIWZ.cjs} +0 -3
- package/dist/{chunk-LR4KP3I7.cjs → chunk-4AC4PXZO.cjs} +2 -2
- package/dist/{chunk-YVPX5PI5.mjs → chunk-4O26BPUY.mjs} +8 -0
- package/dist/{chunk-LENKRGBV.mjs → chunk-5CFHQ7HM.mjs} +1 -1
- package/dist/{chunk-G7NBPP7H.mjs → chunk-5IJRJWJS.mjs} +1 -1
- package/dist/{chunk-MV7NWU23.mjs → chunk-5R3JQPWD.mjs} +1 -1
- package/dist/{chunk-3Y52TWYU.mjs → chunk-62ZRA7XU.mjs} +0 -3
- package/dist/{chunk-5JKDFRTK.cjs → chunk-65FPDDT4.cjs} +2 -2
- package/dist/{chunk-K6SXMVXO.mjs → chunk-75E5FDX2.mjs} +22 -7
- package/dist/{chunk-K76CBYQM.mjs → chunk-7A3URI2F.mjs} +20 -0
- package/dist/{chunk-VFNAK6A5.mjs → chunk-A2TH5MKE.mjs} +9 -5
- package/dist/{chunk-225APHKC.cjs → chunk-A7HCBHMC.cjs} +3 -3
- package/dist/{chunk-VX2HZGC7.cjs → chunk-ACGBXN3U.cjs} +2 -2
- package/dist/{chunk-Z3PW3DIR.cjs → chunk-BPUVDCGG.cjs} +5 -5
- package/dist/{chunk-FT6KJHS3.cjs → chunk-C2JOS77Z.cjs} +4 -1
- package/dist/{chunk-DIXFKAPM.mjs → chunk-CCHJWJGP.mjs} +297 -148
- package/dist/{chunk-CRVSYDHV.mjs → chunk-CKQAQFF6.mjs} +2 -2
- package/dist/chunk-DC2AXGNZ.mjs +129 -0
- package/dist/{chunk-TNK2TVRS.cjs → chunk-DIHBWZDZ.cjs} +449 -352
- package/dist/{chunk-JSOCDYER.cjs → chunk-DMXMIE2C.cjs} +15 -1
- package/dist/{chunk-23VJEGKC.cjs → chunk-DVJM55D2.cjs} +9 -1
- package/dist/{chunk-QSUYB3RH.cjs → chunk-DZHTNSQ5.cjs} +14 -14
- package/dist/{chunk-OIOPQ25L.mjs → chunk-E77IA5IF.mjs} +46 -33
- package/dist/{chunk-VRGY3X2I.mjs → chunk-EDZU7YRK.mjs} +8 -9
- package/dist/{chunk-EZTKXD6P.cjs → chunk-FDGYDQGL.cjs} +8 -1
- package/dist/{chunk-PLJKJJ2H.mjs → chunk-FETMUBIA.mjs} +27 -82
- package/dist/{chunk-HJZZSBVK.cjs → chunk-FILXOEWD.cjs} +2 -2
- package/dist/{chunk-KWCZKJYU.cjs → chunk-FJ5YCERM.cjs} +581 -432
- package/dist/{chunk-PDFFYZAT.cjs → chunk-GF22VGMS.cjs} +2 -2
- package/dist/{chunk-OOJBBHYW.cjs → chunk-GVYZCJZH.cjs} +30 -1
- package/dist/{chunk-MNJDNTGO.mjs → chunk-HAXFV2CD.mjs} +1 -1
- package/dist/{chunk-DXZ57EPE.mjs → chunk-I4KPA2C6.mjs} +14 -0
- package/dist/{chunk-LDEXTX4I.cjs → chunk-I7NUT24Z.cjs} +29 -22
- package/dist/{chunk-MZ4CRSY7.cjs → chunk-IEN2EFE5.cjs} +4 -4
- package/dist/{chunk-NVOMQLI2.mjs → chunk-IWJONXPF.mjs} +11 -0
- package/dist/{chunk-RLH5AH2M.mjs → chunk-JDO346NV.mjs} +1 -1
- package/dist/{chunk-WUTFJOV7.cjs → chunk-JFPKARWM.cjs} +16 -8
- package/dist/{chunk-A3T445WK.mjs → chunk-JFVT5ZZV.mjs} +9 -2
- package/dist/{chunk-WPB67LE5.mjs → chunk-JRF2SKCD.mjs} +1 -1
- package/dist/{chunk-YIHRZBD7.cjs → chunk-JRGR5Z4K.cjs} +1 -1
- package/dist/{chunk-UKZ6AWKZ.cjs → chunk-JWY66PID.cjs} +44 -1
- package/dist/{chunk-BDYM2TN3.cjs → chunk-JX5VOLAV.cjs} +8 -8
- package/dist/{chunk-WMLSZAKN.mjs → chunk-JZQS3ZOI.mjs} +1 -1
- package/dist/{chunk-YTNBCXCW.cjs → chunk-K4UGCUXX.cjs} +17 -13
- package/dist/{chunk-OFBLGH6V.cjs → chunk-K66JILV3.cjs} +47 -34
- package/dist/{chunk-QOGIZKSO.cjs → chunk-K7JMTAFH.cjs} +5 -5
- package/dist/{chunk-IFR74W6S.mjs → chunk-KPJYBSHL.mjs} +4 -1
- package/dist/{chunk-Z6SOXHAD.mjs → chunk-KPMLDT3B.mjs} +208 -111
- package/dist/{chunk-KI3MU7B5.mjs → chunk-LDVJIBGN.mjs} +1 -1
- package/dist/{chunk-IGDYL2IA.cjs → chunk-LECZ5DPZ.cjs} +2 -2
- package/dist/{chunk-5FBZJJGA.mjs → chunk-LXEJNWF5.mjs} +2 -2
- package/dist/{chunk-F36LS2C7.cjs → chunk-M6U6E4F7.cjs} +335 -285
- package/dist/{chunk-AKIQ54FK.cjs → chunk-MBCRWU3P.cjs} +26 -81
- package/dist/{chunk-P2NBQ5JI.mjs → chunk-MWUDEYBI.mjs} +1 -1
- package/dist/{chunk-SQ6IWJ3H.cjs → chunk-MZLJFNMH.cjs} +1 -1
- package/dist/{chunk-6OFOIMNS.mjs → chunk-N62IYXYD.mjs} +1 -1
- package/dist/{chunk-ZPKJPM7K.mjs → chunk-NA77GEIU.mjs} +2 -2
- package/dist/{chunk-FVYBEMOD.cjs → chunk-NAXKOTPP.cjs} +6 -6
- package/dist/{chunk-I7J5RLGO.cjs → chunk-NLBHLPEO.cjs} +12 -1
- package/dist/{chunk-3EEINK7G.cjs → chunk-NSZY3EWG.cjs} +10 -7
- package/dist/{chunk-F6CMGWAL.mjs → chunk-NYF7A4UW.mjs} +1 -1
- package/dist/{chunk-QO43L7Z4.cjs → chunk-O32QPFVV.cjs} +25 -7
- package/dist/{chunk-5IQ2ERQA.cjs → chunk-O47W53D3.cjs} +1 -1
- package/dist/{chunk-CO6UYM2D.mjs → chunk-O5QUJEWT.mjs} +1 -1
- package/dist/{chunk-JL2YW5KX.mjs → chunk-OAEDVXVE.mjs} +44 -1
- package/dist/{chunk-3TXKFRSO.mjs → chunk-OEL5EPOJ.mjs} +1 -1
- package/dist/{chunk-KSZK34HU.mjs → chunk-PJQ5W356.mjs} +16 -8
- package/dist/{chunk-BZWTBELF.cjs → chunk-Q5HMVGR5.cjs} +87 -17
- package/dist/{chunk-5NFQ6AZI.cjs → chunk-QEWWKYDL.cjs} +25 -10
- package/dist/{chunk-QOSDWGKT.mjs → chunk-QVBXTSIZ.mjs} +1 -1
- package/dist/{chunk-T5XFZQCL.mjs → chunk-QZHTDVH4.mjs} +1 -1
- package/dist/{chunk-HEJM46HQ.mjs → chunk-R7254L3R.mjs} +5 -2
- package/dist/{chunk-OGVTUGMU.mjs → chunk-REP6HWJN.mjs} +13 -3
- package/dist/{chunk-4UAQB5LB.mjs → chunk-RMOU3PR4.mjs} +112 -62
- package/dist/{chunk-WYL4ODZ4.mjs → chunk-SE7HPBYK.mjs} +30 -1
- package/dist/{chunk-2ZOYOYEE.mjs → chunk-THG2TVDH.mjs} +73 -3
- package/dist/{chunk-TEJ67GD2.mjs → chunk-TLSSIYAL.mjs} +20 -5
- package/dist/{chunk-DWLNLU55.cjs → chunk-TPYAYFMF.cjs} +2 -2
- package/dist/{chunk-Y6KHPJDB.cjs → chunk-U7VH3Q5E.cjs} +2 -2
- package/dist/{chunk-X3MHKLCO.cjs → chunk-VG6HYT5K.cjs} +26 -11
- package/dist/{chunk-437QZIC2.cjs → chunk-VNBDN5W2.cjs} +5 -5
- package/dist/{chunk-AJNBTOVQ.mjs → chunk-WW3LRNQV.mjs} +1 -1
- package/dist/{chunk-GFPS7MNE.mjs → chunk-WX63N6C5.mjs} +4 -4
- package/dist/{chunk-7LK5CTUM.cjs → chunk-XYVPTTUT.cjs} +31 -26
- package/dist/{chunk-VOQ7XZZT.cjs → chunk-Y2SZVIVH.cjs} +20 -0
- package/dist/{chunk-XCAQTCGK.mjs → chunk-YBY34UHB.mjs} +1 -1
- package/dist/{chunk-YGJ5P3TJ.mjs → chunk-Z3GPAFIA.mjs} +21 -3
- package/dist/{chunk-4E57QHPW.cjs → chunk-ZUVAGMQ5.cjs} +17 -7
- package/dist/{chunk-23LVFSID.mjs → chunk-ZXDX7VYZ.mjs} +7 -0
- package/dist/{client-component.d-BvQOxSqh.d.mts → client-component.d-Bk5qKJM-.d.mts} +2 -2
- package/dist/{client-component.d-DNVSLEPi.d.ts → client-component.d-DNbC4oWI.d.ts} +2 -2
- package/dist/{client-plugins.d-CNDqcAuf.d.ts → client-plugins.d-DwUqh4gp.d.ts} +50 -5
- package/dist/{client-plugins.d-CE1lVK2R.d.mts → client-plugins.d-Pi9nG0W0.d.mts} +50 -5
- package/dist/client-plugins.d.mts +3 -2
- package/dist/client-plugins.d.ts +3 -2
- package/dist/client.cjs +6 -6
- package/dist/client.d.mts +8 -7
- package/dist/client.d.ts +8 -7
- package/dist/client.mjs +5 -5
- package/dist/config.d.mts +3 -2
- package/dist/config.d.ts +3 -2
- package/dist/deployment.cjs +4 -2
- package/dist/deployment.d.mts +7 -1
- package/dist/deployment.d.ts +7 -1
- package/dist/deployment.mjs +5 -3
- package/dist/desktop.d.mts +4 -3
- package/dist/desktop.d.ts +4 -3
- package/dist/{dev-guard-ONNMVQUN.mjs → dev-guard-ZDIELV6Q.mjs} +1 -1
- package/dist/{dev-guard-2UW2KERP.cjs → dev-guard-ZLLKVO5T.cjs} +2 -2
- package/dist/{devtools-2A2GPC7B.mjs → devtools-CB43AHEP.mjs} +8 -7
- package/dist/{devtools-R27T3BRY.cjs → devtools-L5DUNDF3.cjs} +9 -8
- package/dist/docs.cjs +14 -11
- package/dist/docs.d.mts +17 -4
- package/dist/docs.d.ts +17 -4
- package/dist/docs.mjs +14 -11
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/headers.d-CE6OWB-n.d.ts +18 -0
- package/dist/headers.d-DED1hHh4.d.mts +18 -0
- package/dist/i18n/client.cjs +2 -2
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/client.mjs +1 -1
- package/dist/i18n/index.cjs +2 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.mjs +1 -1
- package/dist/i18n/server.cjs +3 -3
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/i18n/server.mjs +2 -2
- package/dist/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +49 -45
- package/dist/{index.d-Bt3kl19W.d.mts → index.d-CbvOjJcp.d.mts} +1 -1
- package/dist/{index.d-Cx_-DaKV.d.ts → index.d-c9UwIqDy.d.ts} +1 -1
- package/dist/index.d.mts +26 -24
- package/dist/index.d.ts +26 -24
- package/dist/index.mjs +63 -59
- package/dist/integrations/orm.d.mts +3 -2
- package/dist/integrations/orm.d.ts +3 -2
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +3 -2
- package/dist/integrations.d.ts +3 -2
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.cjs +4 -3
- package/dist/internal/app-markdown-runtime.d.mts +4 -3
- package/dist/internal/app-markdown-runtime.d.ts +4 -3
- package/dist/internal/app-markdown-runtime.mjs +3 -2
- package/dist/internal/build-runtime.cjs +36 -37
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +35 -36
- package/dist/internal/cli-runtime.cjs +15 -14
- package/dist/internal/cli-runtime.mjs +14 -13
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +5 -3
- package/dist/internal/client-runtime.d.mts +17 -7
- package/dist/internal/client-runtime.d.ts +17 -7
- package/dist/internal/client-runtime.mjs +4 -2
- package/dist/internal/compression-runtime.d.mts +3 -2
- package/dist/internal/compression-runtime.d.ts +3 -2
- package/dist/internal/config-runtime.cjs +10 -9
- package/dist/internal/config-runtime.d.mts +6 -5
- package/dist/internal/config-runtime.d.ts +6 -5
- package/dist/internal/config-runtime.mjs +9 -8
- package/dist/internal/infra-analytics-runtime.cjs +12 -9
- package/dist/internal/infra-analytics-runtime.mjs +10 -7
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +52 -17
- package/dist/internal/production-runtime.d.mts +57 -20
- package/dist/internal/production-runtime.d.ts +57 -20
- package/dist/internal/production-runtime.mjs +55 -20
- package/dist/internal/vercel-edge-middleware.cjs +3 -2
- package/dist/internal/vercel-edge-middleware.d.mts +2 -2
- package/dist/internal/vercel-edge-middleware.d.ts +2 -2
- package/dist/internal/vercel-edge-middleware.mjs +2 -1
- package/dist/markdown.cjs +3 -2
- package/dist/markdown.d.mts +3 -2
- package/dist/markdown.d.ts +3 -2
- package/dist/markdown.mjs +2 -1
- package/dist/middleware.cjs +6 -5
- package/dist/middleware.d.mts +4 -3
- package/dist/middleware.d.ts +4 -3
- package/dist/middleware.mjs +5 -4
- package/dist/mobile.d.mts +3 -3
- package/dist/mobile.d.ts +3 -3
- package/dist/{mount.d-Bki4pOaJ.d.mts → mount.d-BvWxf8ZE.d.mts} +1 -1
- package/dist/{mount.d-DjR5aerM.d.ts → mount.d-DngLY7NL.d.ts} +1 -1
- package/dist/{native-tree-W2SSJB3Y.cjs → native-tree-GF4BH33L.cjs} +4 -3
- package/dist/{native-tree-Y5YQANW7.mjs → native-tree-L2IIEBXH.mjs} +3 -2
- package/dist/{navigation-delegate.d-VDkziXTK.d.mts → navigation-delegate.d-CMyl1h2l.d.mts} +1 -1
- package/dist/{navigation-delegate.d-CtghaSP3.d.ts → navigation-delegate.d-zZogiDfa.d.ts} +1 -1
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +6 -5
- package/dist/navigation.d.ts +6 -5
- package/dist/navigation.mjs +4 -4
- package/dist/{plugin-WIU4GDD4.cjs → plugin-F2O4BFTK.cjs} +2 -2
- package/dist/{plugin-SAS22JL7.mjs → plugin-VEBRN7A3.mjs} +1 -1
- package/dist/plugin.cjs +30 -29
- package/dist/plugin.d.mts +6 -4
- package/dist/plugin.d.ts +6 -4
- package/dist/plugin.mjs +29 -28
- package/dist/{production-runtime.d-DMZY3OgV.d.mts → production-runtime.d-B0IeWWyO.d.mts} +23 -2
- package/dist/{production-runtime.d-BMyyLGBB.d.ts → production-runtime.d-q3aHIv5Y.d.ts} +23 -2
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan.d-i9sI4tc9.d.ts → render-plan.d-DQj2bzd2.d.ts} +1 -1
- package/dist/{render-plan.d-BSwV8PE4.d.mts → render-plan.d-Di1znBDW.d.mts} +1 -1
- package/dist/renderer-client.cjs +7 -7
- package/dist/renderer-client.d.mts +6 -5
- package/dist/renderer-client.d.ts +6 -5
- package/dist/renderer-client.mjs +3 -3
- package/dist/{request.d-Dgln8tuI.d.ts → request.d-C5vyoYeL.d.ts} +1 -1
- package/dist/{request.d-C24FNQ_7.d.mts → request.d-CJWzfDYJ.d.mts} +1 -1
- package/dist/request.d.mts +4 -3
- package/dist/request.d.ts +4 -3
- package/dist/{resolver.d-JnZKKsc5.d.mts → resolver.d-9iKC79CU.d.mts} +1 -1
- package/dist/{resolver.d-BHyZgpa7.d.ts → resolver.d-CY6mEa_F.d.ts} +1 -1
- package/dist/response.d-B_MtBCnF.d.mts +12 -0
- package/dist/response.d-B_MtBCnF.d.ts +12 -0
- package/dist/{route-rendering.d-Ds0BfwQi.d.mts → route-rendering.d-C-et2TZ1.d.mts} +9 -2
- package/dist/{route-rendering.d-CUylZKJA.d.ts → route-rendering.d-DhsY5M2I.d.ts} +9 -2
- package/dist/{router.d-CFPcbqzc.d.mts → router.d-BMDS5s5X.d.mts} +1 -1
- package/dist/{router.d-B56rMOFm.d.ts → router.d-CJB-Ntni.d.ts} +1 -1
- package/dist/{routes.d-CrEy0lJS.d.mts → routes.d-D3aJw1H5.d.mts} +1 -1
- package/dist/{routes.d-9GFFNioh.d.ts → routes.d-K-Qg79AA.d.ts} +1 -1
- package/dist/routes.d.mts +3 -2
- package/dist/routes.d.ts +3 -2
- package/dist/{index.d-BNNDpql4.d.ts → routing.d-BxOZ2YWc.d.ts} +1 -2
- package/dist/{index.d-BqcfqJvt.d.mts → routing.d-DwSUVZbF.d.mts} +1 -2
- package/dist/{rsc-pipeline-GA4AQWZI.mjs → rsc-pipeline-AXQJCCHI.mjs} +12 -12
- package/dist/{rsc-pipeline-3T7V6OUT.cjs → rsc-pipeline-NJKLZ3YE.cjs} +13 -13
- package/dist/{runtime-REUTNTI5.cjs → runtime-DMW6DDOI.cjs} +19 -18
- package/dist/{runtime-ZYCKKY7L.mjs → runtime-JXNEKOSE.mjs} +11 -10
- package/dist/{runtime.d-BtL3PCL3.d.ts → runtime.d-B_uPfMjA.d.ts} +2 -2
- package/dist/{runtime.d-DLRO-ExG.d.mts → runtime.d-BonodRI9.d.mts} +1 -1
- package/dist/{runtime.d-3iJAKptR.d.mts → runtime.d-nUz0HAL4.d.mts} +2 -2
- package/dist/{runtime.d-H7k9hOQE.d.ts → runtime.d-uw4123iI.d.ts} +1 -1
- package/dist/server-plugins.cjs +3 -2
- package/dist/server-plugins.d.mts +6 -12
- package/dist/server-plugins.d.ts +6 -12
- package/dist/server-plugins.mjs +2 -1
- package/dist/server.cjs +64 -56
- package/dist/server.d.mts +23 -14
- package/dist/server.d.ts +23 -14
- package/dist/server.mjs +40 -32
- package/dist/{spa-router.d-Dr7oanhl.d.ts → spa-router.d-l0d9pPZj.d.ts} +3 -3
- package/dist/{spa-router.d-g4CzhEH1.d.mts → spa-router.d-rha3M95y.d.mts} +3 -3
- package/dist/testing.cjs +3 -3
- package/dist/testing.d.mts +3 -2
- package/dist/testing.d.ts +3 -2
- package/dist/testing.mjs +3 -3
- package/dist/{types.d-C41ePjvP.d.ts → types.d-wVRlLtBf.d.mts} +1 -1
- package/dist/{types.d-C41ePjvP.d.mts → types.d-wVRlLtBf.d.ts} +1 -1
- package/dist/{utils.d-BxxyDEb8.d.ts → utils.d-BK-PTOF8.d.ts} +1 -1
- package/dist/{utils.d-HIla3pD_.d.mts → utils.d-BzuTobEc.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +37 -29
- package/dist/vite.d.mts +26 -6
- package/dist/vite.d.ts +26 -6
- package/dist/vite.mjs +36 -28
- package/package.json +3 -3
- package/dist/analyzer-PPAHM4AW.cjs +0 -16
- package/dist/chunk-HHLEYA4B.cjs +0 -17
- package/dist/chunk-QYNZ3CTI.mjs +0 -17
- package/dist/response.d-BolW0Vx_.d.mts +0 -10
- package/dist/response.d-BolW0Vx_.d.ts +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkDMXMIE2Ccjs = require('./chunk-DMXMIE2C.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
@@ -9,7 +9,7 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkK7JMTAFHcjs = require('./chunk-K7JMTAFH.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
|
|
@@ -39,10 +39,10 @@ var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunk2MR4MABGcjs = require('./chunk-2MR4MABG.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
var
|
|
45
|
+
var _chunkK4UGCUXXcjs = require('./chunk-K4UGCUXX.cjs');
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ var _chunkYTNBCXCWcjs = require('./chunk-YTNBCXCW.cjs');
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
var
|
|
53
|
+
var _chunkVG6HYT5Kcjs = require('./chunk-VG6HYT5K.cjs');
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
@@ -76,7 +76,7 @@ var _chunkXGJVRPYLcjs = require('./chunk-XGJVRPYL.cjs');
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
var
|
|
79
|
+
var _chunkIEN2EFE5cjs = require('./chunk-IEN2EFE5.cjs');
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
|
|
@@ -103,7 +103,7 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
|
|
106
|
-
var
|
|
106
|
+
var _chunkZUVAGMQ5cjs = require('./chunk-ZUVAGMQ5.cjs');
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
|
|
@@ -113,7 +113,7 @@ var _chunk4E57QHPWcjs = require('./chunk-4E57QHPW.cjs');
|
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
var
|
|
116
|
+
var _chunkO32QPFVVcjs = require('./chunk-O32QPFVV.cjs');
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
|
|
@@ -154,10 +154,10 @@ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
|
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
var
|
|
157
|
+
var _chunk4AC4PXZOcjs = require('./chunk-4AC4PXZO.cjs');
|
|
158
158
|
|
|
159
159
|
|
|
160
|
-
var
|
|
160
|
+
var _chunkNSZY3EWGcjs = require('./chunk-NSZY3EWG.cjs');
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
|
|
@@ -170,7 +170,7 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
var
|
|
173
|
+
var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
var _chunkFSODPZRTcjs = require('./chunk-FSODPZRT.cjs');
|
|
@@ -181,7 +181,7 @@ var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
|
|
|
181
181
|
|
|
182
182
|
|
|
183
183
|
|
|
184
|
-
var
|
|
184
|
+
var _chunkJX5VOLAVcjs = require('./chunk-JX5VOLAV.cjs');
|
|
185
185
|
|
|
186
186
|
|
|
187
187
|
var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
|
|
@@ -208,7 +208,7 @@ var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
|
|
211
|
-
var
|
|
211
|
+
var _chunk2AM26UGIcjs = require('./chunk-2AM26UGI.cjs');
|
|
212
212
|
|
|
213
213
|
|
|
214
214
|
|
|
@@ -234,7 +234,7 @@ var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
|
|
|
234
234
|
var _chunkDMAP4RNDcjs = require('./chunk-DMAP4RND.cjs');
|
|
235
235
|
|
|
236
236
|
|
|
237
|
-
var
|
|
237
|
+
var _chunkJRGR5Z4Kcjs = require('./chunk-JRGR5Z4K.cjs');
|
|
238
238
|
|
|
239
239
|
|
|
240
240
|
var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
|
|
@@ -278,18 +278,18 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
278
278
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
279
279
|
|
|
280
280
|
|
|
281
|
-
var
|
|
281
|
+
var _chunkMZLJFNMHcjs = require('./chunk-MZLJFNMH.cjs');
|
|
282
282
|
|
|
283
283
|
|
|
284
284
|
|
|
285
|
-
var
|
|
285
|
+
var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
286
286
|
|
|
287
287
|
|
|
288
288
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
289
289
|
|
|
290
290
|
|
|
291
291
|
|
|
292
|
-
var
|
|
292
|
+
var _chunkY2SZVIVHcjs = require('./chunk-Y2SZVIVH.cjs');
|
|
293
293
|
|
|
294
294
|
|
|
295
295
|
var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
|
|
@@ -305,11 +305,14 @@ var _chunk6IOZPJ3Icjs = require('./chunk-6IOZPJ3I.cjs');
|
|
|
305
305
|
|
|
306
306
|
|
|
307
307
|
|
|
308
|
-
var
|
|
308
|
+
var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
|
|
309
309
|
|
|
310
310
|
|
|
311
311
|
|
|
312
|
-
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
|
|
313
316
|
|
|
314
317
|
|
|
315
318
|
var _chunkDXUXQP2Tcjs = require('./chunk-DXUXQP2T.cjs');
|
|
@@ -358,14 +361,10 @@ var _chunkYTVSWXEZcjs = require('./chunk-YTVSWXEZ.cjs');
|
|
|
358
361
|
|
|
359
362
|
var _chunkBTZ5O6VMcjs = require('./chunk-BTZ5O6VM.cjs');
|
|
360
363
|
|
|
361
|
-
// src/routing/route-manager.ts
|
|
362
|
-
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs5 = _interopRequireWildcard(_fs); var fs4 = _interopRequireWildcard(_fs);
|
|
363
|
-
var _path = require('path'); var path3 = _interopRequireWildcard(_path); var path9 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path);
|
|
364
|
-
|
|
365
364
|
// src/static-metadata-image.ts
|
|
366
365
|
var _crypto = require('crypto');
|
|
367
366
|
var _promises = require('fs/promises');
|
|
368
|
-
|
|
367
|
+
var _path = require('path'); var path3 = _interopRequireWildcard(_path); var path9 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path);
|
|
369
368
|
var _imagesize = require('image-size');
|
|
370
369
|
var STATIC_METADATA_IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "gif", "webp"];
|
|
371
370
|
var CONTENT_TYPES = {
|
|
@@ -428,6 +427,8 @@ async function readAltText(filePath) {
|
|
|
428
427
|
}
|
|
429
428
|
|
|
430
429
|
// src/routing/route-manager.ts
|
|
430
|
+
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs5 = _interopRequireWildcard(_fs); var fs4 = _interopRequireWildcard(_fs);
|
|
431
|
+
|
|
431
432
|
function getRouteEntryDirectory(entry) {
|
|
432
433
|
return _nullishCoalesce(entry.directory, () => ( entry.pattern));
|
|
433
434
|
}
|
|
@@ -444,7 +445,7 @@ function getRouteSpecificity(entry) {
|
|
|
444
445
|
function compareRouteEntries(left, right) {
|
|
445
446
|
return _chunkYTVSWXEZcjs.compareRouteSpecificity.call(void 0, getRouteSpecificity(left), getRouteSpecificity(right));
|
|
446
447
|
}
|
|
447
|
-
var RouteManager = class {
|
|
448
|
+
var RouteManager = class _RouteManager {
|
|
448
449
|
constructor(config, viteServer) {
|
|
449
450
|
this.routes = /* @__PURE__ */ new Map();
|
|
450
451
|
this.pageRouteShapes = /* @__PURE__ */ new Map();
|
|
@@ -459,7 +460,8 @@ var RouteManager = class {
|
|
|
459
460
|
this.redirects = /* @__PURE__ */ new Map();
|
|
460
461
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
461
462
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
462
|
-
this.programmaticClientRoutes =
|
|
463
|
+
this.programmaticClientRoutes = _chunkIEN2EFE5cjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
464
|
+
this.discovery = Promise.resolve();
|
|
463
465
|
this.reportedIslandsErrors = /* @__PURE__ */ new Set();
|
|
464
466
|
this.config = config;
|
|
465
467
|
this.viteServer = viteServer;
|
|
@@ -469,29 +471,45 @@ var RouteManager = class {
|
|
|
469
471
|
this.rendererRuntime = rendererRuntime;
|
|
470
472
|
}
|
|
471
473
|
/**
|
|
472
|
-
* Discover all routes in the app directory
|
|
474
|
+
* Discover all routes in the app directory.
|
|
475
|
+
*
|
|
476
|
+
* Requests keep matching the current routes until discovery finishes. Discovery awaits file and
|
|
477
|
+
* module reads, and a dev server runs it again for each page or layout a watcher reports, so
|
|
478
|
+
* clearing the tables first answered any request in between with a 404. Discoveries run one at
|
|
479
|
+
* a time, so an older scan never replaces a newer one.
|
|
473
480
|
*/
|
|
474
|
-
|
|
475
|
-
this.
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
481
|
+
discoverRoutes() {
|
|
482
|
+
const discovery = this.discovery.catch(() => {
|
|
483
|
+
}).then(async () => {
|
|
484
|
+
const next = new _RouteManager(this.config, this.viteServer);
|
|
485
|
+
await next.discoverInto();
|
|
486
|
+
this.invalidateClientManifest();
|
|
487
|
+
this.routes = next.routes;
|
|
488
|
+
this.pageRouteShapes = next.pageRouteShapes;
|
|
489
|
+
this.layouts = next.layouts;
|
|
490
|
+
this.orderedLayouts = next.orderedLayouts;
|
|
491
|
+
this.routeSlots = next.routeSlots;
|
|
492
|
+
this.routeSlotOwnerSegments = next.routeSlotOwnerSegments;
|
|
493
|
+
this.loadings = next.loadings;
|
|
494
|
+
this.errors = next.errors;
|
|
495
|
+
this.metadataImages = next.metadataImages;
|
|
496
|
+
this.metadataRoutes = next.metadataRoutes;
|
|
497
|
+
this.redirects = next.redirects;
|
|
498
|
+
this.programmaticPages = next.programmaticPages;
|
|
499
|
+
this.programmaticLayouts = next.programmaticLayouts;
|
|
500
|
+
this.programmaticClientRoutes = next.programmaticClientRoutes;
|
|
501
|
+
});
|
|
502
|
+
this.discovery = discovery;
|
|
503
|
+
return discovery;
|
|
504
|
+
}
|
|
505
|
+
/** Fill this manager's empty route tables. Only a fresh manager made by discoverRoutes runs it. */
|
|
506
|
+
async discoverInto() {
|
|
489
507
|
const programmaticClientRoutes = [];
|
|
490
508
|
for (const source of _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, this.config)) {
|
|
491
509
|
await this.discoverFileRoutes(source);
|
|
492
510
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
493
511
|
}
|
|
494
|
-
this.programmaticClientRoutes =
|
|
512
|
+
this.programmaticClientRoutes = _chunkIEN2EFE5cjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
495
513
|
for (const slot of this.routeSlots.values()) {
|
|
496
514
|
if (slot.interception && !this.pageRouteShapes.has(_chunkYTVSWXEZcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
497
515
|
throw new (0, _chunkYTVSWXEZcjs.AmbiguousRouteError)(
|
|
@@ -510,8 +528,8 @@ var RouteManager = class {
|
|
|
510
528
|
)
|
|
511
529
|
);
|
|
512
530
|
this.orderedLayouts = Array.from(this.layouts.values()).sort(
|
|
513
|
-
(left, right) =>
|
|
514
|
-
).map((entry) => ({ entry, groupScope:
|
|
531
|
+
(left, right) => _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, right.pattern)
|
|
532
|
+
).map((entry) => ({ entry, groupScope: _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, entry.pattern) }));
|
|
515
533
|
for (const slot of this.routeSlots.values()) {
|
|
516
534
|
if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
|
|
517
535
|
this.routeSlotOwnerSegments.set(
|
|
@@ -760,7 +778,7 @@ var RouteManager = class {
|
|
|
760
778
|
return this.clientManifestCache.manifest;
|
|
761
779
|
}
|
|
762
780
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
763
|
-
return cacheFile ?
|
|
781
|
+
return cacheFile ? _chunkIEN2EFE5cjs.runWithPackageClientBoundaryCacheFile.call(void 0,
|
|
764
782
|
cacheFile,
|
|
765
783
|
() => this.computeClientManifest(normalizedProjectRoot)
|
|
766
784
|
) : this.computeClientManifest(normalizedProjectRoot);
|
|
@@ -782,7 +800,7 @@ var RouteManager = class {
|
|
|
782
800
|
}
|
|
783
801
|
return absolutePath;
|
|
784
802
|
};
|
|
785
|
-
const integrationProviders =
|
|
803
|
+
const integrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
|
|
786
804
|
(provider) => provider.component || provider.type === "clerk"
|
|
787
805
|
);
|
|
788
806
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
@@ -793,28 +811,28 @@ var RouteManager = class {
|
|
|
793
811
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
794
812
|
);
|
|
795
813
|
}
|
|
796
|
-
const isolatedMode =
|
|
814
|
+
const isolatedMode = _chunkIEN2EFE5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
797
815
|
_optionalChain([this, 'access', _12 => _12.config, 'access', _13 => _13.experimental, 'optionalAccess', _14 => _14.isolatedClientHydration]),
|
|
798
816
|
{
|
|
799
817
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _15 => _15.config, 'access', _16 => _16.experimental, 'optionalAccess', _17 => _17.serverComponents])) === "rsc",
|
|
800
818
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
801
819
|
}
|
|
802
820
|
);
|
|
803
|
-
const planOptions =
|
|
821
|
+
const planOptions = _chunkIEN2EFE5cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
804
822
|
this.config.renderer,
|
|
805
823
|
Boolean(unsupportedIntegrationProvider)
|
|
806
824
|
);
|
|
807
825
|
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _18 => _18.config, 'access', _19 => _19.experimental, 'optionalAccess', _20 => _20.serverComponents])) === "islands";
|
|
808
826
|
const layoutEntries = Array.from(this.layouts.values()).map((entry) => ({
|
|
809
827
|
entry,
|
|
810
|
-
metadata:
|
|
828
|
+
metadata: _chunkIEN2EFE5cjs.getClientModuleHydrationPlan.call(void 0,
|
|
811
829
|
entry.modulePath,
|
|
812
830
|
normalizedProjectRoot,
|
|
813
831
|
isolatedMode,
|
|
814
832
|
islandsMode ? { ...planOptions, serverTreeLayouts: true } : planOptions
|
|
815
833
|
)
|
|
816
834
|
}));
|
|
817
|
-
const markdownPagePlan =
|
|
835
|
+
const markdownPagePlan = _chunkIEN2EFE5cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
818
836
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
819
837
|
normalizedProjectRoot,
|
|
820
838
|
isolatedMode,
|
|
@@ -822,13 +840,13 @@ var RouteManager = class {
|
|
|
822
840
|
);
|
|
823
841
|
const routeEntries = Array.from(this.routes.values()).map((entry) => ({
|
|
824
842
|
entry,
|
|
825
|
-
metadata:
|
|
843
|
+
metadata: _chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : _chunkIEN2EFE5cjs.getClientModuleHydrationPlan.call(void 0, entry.modulePath, normalizedProjectRoot, isolatedMode, {
|
|
826
844
|
...planOptions,
|
|
827
845
|
serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.serverComponents])) === "islands"
|
|
828
846
|
})
|
|
829
847
|
}));
|
|
830
848
|
const markdownFallback = routeEntries.find(
|
|
831
|
-
({ entry, metadata }) =>
|
|
849
|
+
({ entry, metadata }) => _chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
|
|
832
850
|
);
|
|
833
851
|
if (markdownFallback) {
|
|
834
852
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
@@ -836,7 +854,7 @@ var RouteManager = class {
|
|
|
836
854
|
);
|
|
837
855
|
}
|
|
838
856
|
const markdownStaticPackages = _optionalChain([routeEntries, 'access', _24 => _24.find, 'call', _25 => _25(
|
|
839
|
-
({ entry, metadata }) =>
|
|
857
|
+
({ entry, metadata }) => _chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
|
|
840
858
|
), 'optionalAccess', _26 => _26.metadata, 'access', _27 => _27.staticPackageBoundaries]);
|
|
841
859
|
if (markdownStaticPackages) {
|
|
842
860
|
_chunkQMNWKQL4cjs.logger.info(
|
|
@@ -844,23 +862,23 @@ var RouteManager = class {
|
|
|
844
862
|
);
|
|
845
863
|
}
|
|
846
864
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
847
|
-
if (
|
|
865
|
+
if (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
|
|
848
866
|
_chunkQMNWKQL4cjs.logger.info(
|
|
849
867
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
850
868
|
);
|
|
851
869
|
}
|
|
852
|
-
|
|
870
|
+
_chunkIEN2EFE5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
853
871
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
854
872
|
pattern: entry.pattern,
|
|
855
|
-
depth:
|
|
873
|
+
depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
856
874
|
metadata
|
|
857
875
|
})),
|
|
858
876
|
routeEntries.map(({ entry, metadata }) => ({
|
|
859
877
|
pattern: getRouteEntryDirectory(entry),
|
|
860
|
-
depth:
|
|
878
|
+
depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
|
|
861
879
|
metadata
|
|
862
880
|
})),
|
|
863
|
-
|
|
881
|
+
_chunk2MR4MABGcjs.routeBoundaryCoversDirectory,
|
|
864
882
|
{ serverOwners: islandsMode }
|
|
865
883
|
);
|
|
866
884
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
@@ -880,7 +898,7 @@ var RouteManager = class {
|
|
|
880
898
|
const routes = routeEntries.map(({ entry, metadata }) => {
|
|
881
899
|
const programmaticPage = this.programmaticPages.get(entry.modulePath);
|
|
882
900
|
const layoutShouldHydrate = layoutEntries.some(
|
|
883
|
-
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate &&
|
|
901
|
+
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunk2MR4MABGcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
|
|
884
902
|
);
|
|
885
903
|
return {
|
|
886
904
|
pattern: entry.pattern,
|
|
@@ -896,8 +914,8 @@ var RouteManager = class {
|
|
|
896
914
|
modulePath: toUrlPath(boundary.modulePath)
|
|
897
915
|
}))
|
|
898
916
|
} : {},
|
|
899
|
-
...
|
|
900
|
-
renderPlan:
|
|
917
|
+
..._chunkIEN2EFE5cjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
918
|
+
renderPlan: _chunk2MR4MABGcjs.createFarmRouteRenderPlan.call(void 0, {
|
|
901
919
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
902
920
|
layoutShouldHydrate,
|
|
903
921
|
islandStrategy: metadata.islandStrategy
|
|
@@ -913,7 +931,7 @@ var RouteManager = class {
|
|
|
913
931
|
}))
|
|
914
932
|
};
|
|
915
933
|
});
|
|
916
|
-
const treeLayoutPatterns = islandsMode ?
|
|
934
|
+
const treeLayoutPatterns = islandsMode ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
917
935
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
918
936
|
pattern: entry.pattern,
|
|
919
937
|
shouldHydrate: metadata.shouldHydrate,
|
|
@@ -938,7 +956,7 @@ var RouteManager = class {
|
|
|
938
956
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
939
957
|
}));
|
|
940
958
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
941
|
-
const metadata =
|
|
959
|
+
const metadata = _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
942
960
|
return {
|
|
943
961
|
name: entry.name,
|
|
944
962
|
ownerPattern: entry.ownerPattern,
|
|
@@ -954,7 +972,7 @@ var RouteManager = class {
|
|
|
954
972
|
};
|
|
955
973
|
});
|
|
956
974
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
957
|
-
metadata:
|
|
975
|
+
metadata: _chunkIEN2EFE5cjs.getClientModuleHydrationPlan.call(void 0,
|
|
958
976
|
entry.modulePath,
|
|
959
977
|
normalizedProjectRoot,
|
|
960
978
|
isolatedMode,
|
|
@@ -1045,12 +1063,12 @@ var RouteManager = class {
|
|
|
1045
1063
|
const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
|
|
1046
1064
|
return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
|
|
1047
1065
|
}
|
|
1048
|
-
if (
|
|
1066
|
+
if (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
|
|
1049
1067
|
const mdxConfig = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx);
|
|
1050
1068
|
const viteServer = this.viteServer;
|
|
1051
|
-
return await
|
|
1069
|
+
return await _chunk4AC4PXZOcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
|
|
1052
1070
|
// Loaded on render: the route runtime manifest only reads metadata and rendering config.
|
|
1053
|
-
components: () =>
|
|
1071
|
+
components: () => _chunk4AC4PXZOcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
|
|
1054
1072
|
root: this.config.root,
|
|
1055
1073
|
loadModule: viteServer ? (componentModulePath) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1056
1074
|
}),
|
|
@@ -1102,7 +1120,7 @@ var RouteManager = class {
|
|
|
1102
1120
|
*/
|
|
1103
1121
|
createRoutePattern(route) {
|
|
1104
1122
|
if (route.segments.length === 0) return "/";
|
|
1105
|
-
return "/" + route.segments.map(
|
|
1123
|
+
return "/" + route.segments.map(_chunk2MR4MABGcjs.formatRouteSegment).join("/");
|
|
1106
1124
|
}
|
|
1107
1125
|
registerPageRoute(entry) {
|
|
1108
1126
|
_chunkYTVSWXEZcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
|
|
@@ -1153,8 +1171,8 @@ var RouteManager = class {
|
|
|
1153
1171
|
}
|
|
1154
1172
|
}
|
|
1155
1173
|
for (const [pattern, group] of canonicalPageGroups) {
|
|
1156
|
-
const componentFiles = group.files.filter((file) => !
|
|
1157
|
-
const markdownFiles = group.files.filter(
|
|
1174
|
+
const componentFiles = group.files.filter((file) => !_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, file));
|
|
1175
|
+
const markdownFiles = group.files.filter(_chunkNSZY3EWGcjs.isFarmMarkdownPageFile);
|
|
1158
1176
|
if (componentFiles.length > 1) {
|
|
1159
1177
|
throw new Error(
|
|
1160
1178
|
`Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path3.default.join(appDir, file)).join(" and ")}.`
|
|
@@ -1196,7 +1214,7 @@ var RouteManager = class {
|
|
|
1196
1214
|
for (const file of files) {
|
|
1197
1215
|
const route = _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, file);
|
|
1198
1216
|
const modulePath = path3.default.join(appDir, file);
|
|
1199
|
-
const pattern =
|
|
1217
|
+
const pattern = _chunk2MR4MABGcjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1200
1218
|
const existing = target.get(pattern);
|
|
1201
1219
|
if (_optionalChain([existing, 'optionalAccess', _34 => _34.sourceRoot]) === source.root) {
|
|
1202
1220
|
throw new Error(
|
|
@@ -1218,7 +1236,7 @@ var RouteManager = class {
|
|
|
1218
1236
|
const modulePath = path3.default.join(appDir, file);
|
|
1219
1237
|
const pattern = this.createRoutePattern(slot.route);
|
|
1220
1238
|
const ownerPattern = this.createRoutePattern(slot.ownerRoute);
|
|
1221
|
-
const ownerDirectory =
|
|
1239
|
+
const ownerDirectory = _chunk2MR4MABGcjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
|
|
1222
1240
|
const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
|
|
1223
1241
|
const existing = this.routeSlots.get(key);
|
|
1224
1242
|
if (_optionalChain([existing, 'optionalAccess', _35 => _35.sourceRoot]) === source.root) {
|
|
@@ -1300,11 +1318,11 @@ var RouteManager = class {
|
|
|
1300
1318
|
srcDir: source.srcDir,
|
|
1301
1319
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1302
1320
|
});
|
|
1303
|
-
const graph = this.viteServer ?
|
|
1321
|
+
const graph = this.viteServer ? _chunkIEN2EFE5cjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1304
1322
|
for (const { filePath, manifest } of manifests) {
|
|
1305
1323
|
if (graph) {
|
|
1306
1324
|
clientRoutes.push(
|
|
1307
|
-
|
|
1325
|
+
_chunkIEN2EFE5cjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1308
1326
|
graph,
|
|
1309
1327
|
routesFile: toRealPath(filePath),
|
|
1310
1328
|
routes: manifest.routes,
|
|
@@ -1335,7 +1353,7 @@ var RouteManager = class {
|
|
|
1335
1353
|
}
|
|
1336
1354
|
if (definition.kind === "layout") {
|
|
1337
1355
|
const route = _chunkE7QOEV5Zcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
|
|
1338
|
-
const pattern =
|
|
1356
|
+
const pattern = _chunk2MR4MABGcjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1339
1357
|
const existing = this.layouts.get(pattern);
|
|
1340
1358
|
if (_optionalChain([existing, 'optionalAccess', _39 => _39.sourceRoot]) === source.root) {
|
|
1341
1359
|
throw new Error(
|
|
@@ -1382,7 +1400,7 @@ var RouteManager = class {
|
|
|
1382
1400
|
const matchingLayouts = [];
|
|
1383
1401
|
for (const { entry, groupScope } of this.orderedLayouts) {
|
|
1384
1402
|
if (!_chunkQMNWKQL4cjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
|
|
1385
|
-
if (groupScope !== null && !
|
|
1403
|
+
if (groupScope !== null && !_chunk2MR4MABGcjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
|
|
1386
1404
|
continue;
|
|
1387
1405
|
}
|
|
1388
1406
|
matchingLayouts.push(entry);
|
|
@@ -1463,14 +1481,14 @@ var RouteManager = class {
|
|
|
1463
1481
|
let page = route;
|
|
1464
1482
|
for (const boundaryEntry of boundaries.values()) {
|
|
1465
1483
|
if (!_chunkQMNWKQL4cjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
|
|
1466
|
-
const groupScope =
|
|
1484
|
+
const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
|
|
1467
1485
|
if (groupScope !== null) {
|
|
1468
1486
|
if (page === void 0) page = this.matchPageRoute(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath));
|
|
1469
|
-
if (!
|
|
1487
|
+
if (!_chunk2MR4MABGcjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
|
|
1470
1488
|
}
|
|
1471
1489
|
const depth = boundaryEntry.route.segments.length;
|
|
1472
1490
|
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _43 => _43.route, 'access', _44 => _44.segments, 'access', _45 => _45.length]), () => ( -1));
|
|
1473
|
-
if (!bestMatch || depth > bestDepth || depth === bestDepth &&
|
|
1491
|
+
if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
|
|
1474
1492
|
bestMatch = boundaryEntry;
|
|
1475
1493
|
}
|
|
1476
1494
|
}
|
|
@@ -1520,7 +1538,7 @@ var RouteManager = class {
|
|
|
1520
1538
|
}));
|
|
1521
1539
|
const i18n = this.getI18nConfig();
|
|
1522
1540
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1523
|
-
const result = await
|
|
1541
|
+
const result = await _chunkK7JMTAFHcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1524
1542
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1525
1543
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1526
1544
|
});
|
|
@@ -1567,7 +1585,7 @@ var RouteManager = class {
|
|
|
1567
1585
|
async isRouteSSG(modulePath) {
|
|
1568
1586
|
try {
|
|
1569
1587
|
const mod = await this.loadRouteModule(modulePath);
|
|
1570
|
-
const rendering = await
|
|
1588
|
+
const rendering = await _chunkK7JMTAFHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1571
1589
|
return rendering.ssg;
|
|
1572
1590
|
} catch (e) {
|
|
1573
1591
|
return false;
|
|
@@ -1579,7 +1597,7 @@ var RouteManager = class {
|
|
|
1579
1597
|
async hasRouteISR(modulePath) {
|
|
1580
1598
|
try {
|
|
1581
1599
|
const mod = await this.loadRouteModule(modulePath);
|
|
1582
|
-
const rendering = await
|
|
1600
|
+
const rendering = await _chunkK7JMTAFHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1583
1601
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1584
1602
|
} catch (e2) {
|
|
1585
1603
|
return false;
|
|
@@ -1591,7 +1609,7 @@ var RouteManager = class {
|
|
|
1591
1609
|
async getRouteRevalidateInterval(modulePath) {
|
|
1592
1610
|
try {
|
|
1593
1611
|
const mod = await this.loadRouteModule(modulePath);
|
|
1594
|
-
const rendering = await
|
|
1612
|
+
const rendering = await _chunkK7JMTAFHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1595
1613
|
return rendering.revalidate;
|
|
1596
1614
|
} catch (e3) {
|
|
1597
1615
|
return void 0;
|
|
@@ -1599,7 +1617,7 @@ var RouteManager = class {
|
|
|
1599
1617
|
}
|
|
1600
1618
|
};
|
|
1601
1619
|
function getPageDirectoryField(route, pattern) {
|
|
1602
|
-
const directory =
|
|
1620
|
+
const directory = _chunk2MR4MABGcjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1603
1621
|
return directory === pattern ? {} : { directory };
|
|
1604
1622
|
}
|
|
1605
1623
|
function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
|
|
@@ -2732,7 +2750,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
|
|
|
2732
2750
|
let hasClerkProvider = false;
|
|
2733
2751
|
renderedProviders.forEach((provider, index) => {
|
|
2734
2752
|
let componentExpression = "null";
|
|
2735
|
-
if (
|
|
2753
|
+
if (_chunkJX5VOLAVcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
2736
2754
|
const namespace = `FarmIntegrationProviderModule${index}`;
|
|
2737
2755
|
imports.push(
|
|
2738
2756
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -2789,7 +2807,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
|
|
|
2789
2807
|
const entries = [];
|
|
2790
2808
|
let needsMarkHelper = false;
|
|
2791
2809
|
providers.forEach((provider, index) => {
|
|
2792
|
-
if (!
|
|
2810
|
+
if (!_chunkJX5VOLAVcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
|
|
2793
2811
|
const namespace = `FarmServerIntegrationProviderModule${index}`;
|
|
2794
2812
|
imports.push(
|
|
2795
2813
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -2857,7 +2875,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
2857
2875
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
2858
2876
|
parse: parseFarmIslandSource,
|
|
2859
2877
|
resolve: (specifier, importer) => {
|
|
2860
|
-
const resolved =
|
|
2878
|
+
const resolved = _chunkIEN2EFE5cjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
2861
2879
|
return resolved.local ? resolved.path : null;
|
|
2862
2880
|
}
|
|
2863
2881
|
});
|
|
@@ -2871,7 +2889,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
2871
2889
|
const files = [];
|
|
2872
2890
|
const modules = [];
|
|
2873
2891
|
for (const owner of owners) {
|
|
2874
|
-
const rendered =
|
|
2892
|
+
const rendered = _chunkIEN2EFE5cjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
2875
2893
|
if (!rendered) {
|
|
2876
2894
|
return {
|
|
2877
2895
|
strategy: null,
|
|
@@ -2887,7 +2905,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
2887
2905
|
source = fs.default.readFileSync(module, "utf8");
|
|
2888
2906
|
} catch (e10) {
|
|
2889
2907
|
}
|
|
2890
|
-
if (
|
|
2908
|
+
if (_chunkIEN2EFE5cjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
2891
2909
|
}
|
|
2892
2910
|
for (const module of modules) {
|
|
2893
2911
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -2899,7 +2917,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
2899
2917
|
function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
|
|
2900
2918
|
const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
2901
2919
|
const onRoute = layouts.filter(
|
|
2902
|
-
(layout) =>
|
|
2920
|
+
(layout) => _chunk2MR4MABGcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
|
|
2903
2921
|
);
|
|
2904
2922
|
const declared = [
|
|
2905
2923
|
...page.islandStrategy ? [page.islandStrategy] : [],
|
|
@@ -2970,11 +2988,11 @@ function getFarmLayoutKey(pattern, params) {
|
|
|
2970
2988
|
);
|
|
2971
2989
|
}
|
|
2972
2990
|
function countFarmKeptLayouts(layoutsHeader, layouts, params) {
|
|
2973
|
-
const chain =
|
|
2991
|
+
const chain = _chunk2MR4MABGcjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
|
|
2974
2992
|
if (chain.length === 0) return 0;
|
|
2975
2993
|
const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
|
|
2976
|
-
if (chain[0] === keys[0]) return
|
|
2977
|
-
return keys.length > 1 ? 1 +
|
|
2994
|
+
if (chain[0] === keys[0]) return _chunk2MR4MABGcjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
|
|
2995
|
+
return keys.length > 1 ? 1 + _chunk2MR4MABGcjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
|
|
2978
2996
|
}
|
|
2979
2997
|
function createFarmFlushToken() {
|
|
2980
2998
|
const bytes = new Uint8Array(16);
|
|
@@ -3229,7 +3247,7 @@ function createDefaultErrorDiagnostics(error, root) {
|
|
|
3229
3247
|
function canBootFarmIslandsClient(config) {
|
|
3230
3248
|
const docs = config.docs;
|
|
3231
3249
|
const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
|
|
3232
|
-
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.serverComponents])) === "islands" && !docsEnabled &&
|
|
3250
|
+
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.serverComponents])) === "islands" && !docsEnabled && _chunkDMXMIE2Ccjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkDMXMIE2Ccjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
|
|
3233
3251
|
}
|
|
3234
3252
|
|
|
3235
3253
|
// src/server/renderer.ts
|
|
@@ -3308,10 +3326,16 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
3308
3326
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
3309
3327
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
3310
3328
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
3311
|
-
_chunkQMNWKQL4cjs.logger.warn(
|
|
3329
|
+
_chunkQMNWKQL4cjs.logger.warn(_chunkIEN2EFE5cjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
3312
3330
|
}
|
|
3313
3331
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
3314
3332
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
3333
|
+
var reportedRenderErrors = /* @__PURE__ */ new WeakMap();
|
|
3334
|
+
function emitFarmRenderError(req, route, error) {
|
|
3335
|
+
if (reportedRenderErrors.has(req) && reportedRenderErrors.get(req) === error) return;
|
|
3336
|
+
reportedRenderErrors.set(req, error);
|
|
3337
|
+
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.error", route, error });
|
|
3338
|
+
}
|
|
3315
3339
|
function hasRequestHeader(req, name) {
|
|
3316
3340
|
const value = req.headers[name.toLowerCase()];
|
|
3317
3341
|
return Array.isArray(value) ? value.length > 0 : Boolean(value);
|
|
@@ -3353,7 +3377,7 @@ function appendResponseVary(res, value) {
|
|
|
3353
3377
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
3354
3378
|
if (snapshot.routing === "none") return "";
|
|
3355
3379
|
const url = new URL(requestPath, "http://farm.local");
|
|
3356
|
-
return
|
|
3380
|
+
return _chunk2MR4MABGcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
3357
3381
|
}
|
|
3358
3382
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
3359
3383
|
function createPPRRefreshScript() {
|
|
@@ -3724,7 +3748,7 @@ var ServerRenderer = class {
|
|
|
3724
3748
|
await this.initialize();
|
|
3725
3749
|
if (this.viteServer) await this.applyRendererAppSetup();
|
|
3726
3750
|
_chunkD22BUQKWcjs.setFarmBasePath.call(void 0, this.config.basePath);
|
|
3727
|
-
|
|
3751
|
+
_chunkDVJM55D2cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
|
|
3728
3752
|
let element = this.rendererRuntime.createElement(input.PageComponent, input.pageProps);
|
|
3729
3753
|
if (input.LoadingComponent) {
|
|
3730
3754
|
element = this.rendererRuntime.createElement(
|
|
@@ -3790,7 +3814,7 @@ var ServerRenderer = class {
|
|
|
3790
3814
|
async runWithRequestContext(request2, fn) {
|
|
3791
3815
|
return _chunkHDPT6OYEcjs._runWithCurrentRequest.call(void 0,
|
|
3792
3816
|
request2,
|
|
3793
|
-
() => _optionalChain([this, 'access', _75 => _75.i18nRuntime, 'optionalAccess', _76 => _76.config, 'access', _77 => _77.enabled]) ?
|
|
3817
|
+
() => _optionalChain([this, 'access', _75 => _75.i18nRuntime, 'optionalAccess', _76 => _76.config, 'access', _77 => _77.enabled]) ? _chunk2AM26UGIcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
|
|
3794
3818
|
redirect: false
|
|
3795
3819
|
}) : fn()
|
|
3796
3820
|
);
|
|
@@ -3821,7 +3845,7 @@ var ServerRenderer = class {
|
|
|
3821
3845
|
* Check if a path should be served from SSG cache
|
|
3822
3846
|
*/
|
|
3823
3847
|
async shouldServeSSG(pathname) {
|
|
3824
|
-
const ssgPage =
|
|
3848
|
+
const ssgPage = _chunkK7JMTAFHcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
3825
3849
|
if (!ssgPage) return null;
|
|
3826
3850
|
const cached = await this.getCachedSSGPage(pathname);
|
|
3827
3851
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -3833,7 +3857,7 @@ var ServerRenderer = class {
|
|
|
3833
3857
|
return _chunkDXUXQP2Tcjs.createFarmCacheKey.call(void 0, ["ssg", _chunkDMAP4RNDcjs.normalizeRevalidatePath.call(void 0, urlPath)]);
|
|
3834
3858
|
}
|
|
3835
3859
|
getPPRCacheKey(pathname, search = "", locale = "", origin = "") {
|
|
3836
|
-
const key = ["ppr", locale, _chunkDMAP4RNDcjs.normalizeRevalidatePath.call(void 0, pathname), search];
|
|
3860
|
+
const key = ["ppr", locale, _chunkDMAP4RNDcjs.normalizeRevalidatePath.call(void 0, pathname), search, this.getDeploymentId()];
|
|
3837
3861
|
return _chunkDXUXQP2Tcjs.createFarmCacheKey.call(void 0, origin ? [...key, origin] : key);
|
|
3838
3862
|
}
|
|
3839
3863
|
getCachedSSGPage(urlPath) {
|
|
@@ -3889,7 +3913,7 @@ var ServerRenderer = class {
|
|
|
3889
3913
|
if (method !== "GET" && method !== "HEAD") {
|
|
3890
3914
|
return "method";
|
|
3891
3915
|
}
|
|
3892
|
-
if (req.headers.cookie) {
|
|
3916
|
+
if (_chunkNLBHLPEOcjs.withoutFarmDeploymentCookie.call(void 0, req.headers.cookie)) {
|
|
3893
3917
|
return "cookie";
|
|
3894
3918
|
}
|
|
3895
3919
|
if (req.headers.authorization) {
|
|
@@ -4054,7 +4078,7 @@ var ServerRenderer = class {
|
|
|
4054
4078
|
await this.initialize();
|
|
4055
4079
|
if (this.viteServer) await this.applyRendererAppSetup();
|
|
4056
4080
|
_chunkD22BUQKWcjs.setFarmBasePath.call(void 0, this.config.basePath);
|
|
4057
|
-
|
|
4081
|
+
_chunkDVJM55D2cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
|
|
4058
4082
|
const cspNonce = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, this.security);
|
|
4059
4083
|
if (cspNonce) {
|
|
4060
4084
|
req.__FARM_CSP_NONCE__ = cspNonce;
|
|
@@ -4067,13 +4091,13 @@ var ServerRenderer = class {
|
|
|
4067
4091
|
const runtime = this.i18nRuntime;
|
|
4068
4092
|
if (_optionalChain([runtime, 'optionalAccess', _83 => _83.config, 'access', _84 => _84.enabled])) {
|
|
4069
4093
|
const resolution = runtime.resolveRequest(request2);
|
|
4070
|
-
const varyHeaders =
|
|
4094
|
+
const varyHeaders = _chunkY2SZVIVHcjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
|
|
4071
4095
|
for (const header of varyHeaders) appendResponseVary(res, header);
|
|
4072
4096
|
if (resolution.persist) {
|
|
4073
4097
|
appendResponseHeader(
|
|
4074
4098
|
res,
|
|
4075
4099
|
"Set-Cookie",
|
|
4076
|
-
|
|
4100
|
+
_chunkY2SZVIVHcjs.createFarmLocaleCookie.call(void 0, resolution.locale, runtime.config)
|
|
4077
4101
|
);
|
|
4078
4102
|
}
|
|
4079
4103
|
if (resolution.redirect && (request2.method === "GET" || request2.method === "HEAD")) {
|
|
@@ -4148,10 +4172,16 @@ var ServerRenderer = class {
|
|
|
4148
4172
|
completeRender(res.statusCode || 200, pathname);
|
|
4149
4173
|
return;
|
|
4150
4174
|
}
|
|
4151
|
-
this.applyDeploymentHeaders(req, res);
|
|
4152
4175
|
const match = this.routeManager.matchRoute(pathname);
|
|
4176
|
+
const deploymentMismatch = match.route ? this.getDeploymentMismatch(req) : null;
|
|
4177
|
+
if (deploymentMismatch) {
|
|
4178
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, _chunkNLBHLPEOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch));
|
|
4179
|
+
completeRender(res.statusCode, match.route.pattern);
|
|
4180
|
+
return;
|
|
4181
|
+
}
|
|
4182
|
+
if (match.route) this.applyDeploymentHeaders(req, res);
|
|
4153
4183
|
if (match.route) {
|
|
4154
|
-
const redirectLocation =
|
|
4184
|
+
const redirectLocation = _chunkDVJM55D2cjs.resolveFarmTrailingSlashRedirect.call(void 0, url, this.config.trailingSlash);
|
|
4155
4185
|
if (redirectLocation) {
|
|
4156
4186
|
res.statusCode = 308;
|
|
4157
4187
|
res.setHeader("Location", redirectLocation);
|
|
@@ -4175,14 +4205,14 @@ var ServerRenderer = class {
|
|
|
4175
4205
|
layouts = match.layouts;
|
|
4176
4206
|
routeSlots = _nullishCoalesce(match.slots, () => ( []));
|
|
4177
4207
|
if (!route) {
|
|
4178
|
-
if (
|
|
4208
|
+
if (_chunkVG6HYT5Kcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
|
|
4179
4209
|
await this.renderDefaultMCP(req, res);
|
|
4180
4210
|
completeRender(res.statusCode || 200, pathname);
|
|
4181
4211
|
return;
|
|
4182
4212
|
}
|
|
4183
4213
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "route.notFound", pathname });
|
|
4184
4214
|
await this.render404(req, res);
|
|
4185
|
-
completeRender(
|
|
4215
|
+
completeRender(res.statusCode);
|
|
4186
4216
|
return;
|
|
4187
4217
|
}
|
|
4188
4218
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
@@ -4217,7 +4247,7 @@ var ServerRenderer = class {
|
|
|
4217
4247
|
)
|
|
4218
4248
|
);
|
|
4219
4249
|
if (actionResponse) {
|
|
4220
|
-
await
|
|
4250
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, actionResponse);
|
|
4221
4251
|
completeRender(actionResponse.status, route.pattern);
|
|
4222
4252
|
return;
|
|
4223
4253
|
}
|
|
@@ -4284,7 +4314,7 @@ var ServerRenderer = class {
|
|
|
4284
4314
|
throw error;
|
|
4285
4315
|
}
|
|
4286
4316
|
}
|
|
4287
|
-
const renderingConfig = await
|
|
4317
|
+
const renderingConfig = await _chunkK7JMTAFHcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
4288
4318
|
routeModule,
|
|
4289
4319
|
route.modulePath,
|
|
4290
4320
|
{ experimentalPPR: _optionalChain([this, 'access', _99 => _99.config, 'access', _100 => _100.experimental, 'optionalAccess', _101 => _101.ppr]) === true }
|
|
@@ -4294,7 +4324,7 @@ var ServerRenderer = class {
|
|
|
4294
4324
|
islands && this.islandValues() && (requestHeader(req, "f-layouts") || requestHeader(req, "f-stream"))
|
|
4295
4325
|
);
|
|
4296
4326
|
const canCachePPRShell = renderingConfig.ppr && !pprBypassReason && !islandsNavigationRequest;
|
|
4297
|
-
const pprI18nSnapshot = canCachePPRShell ?
|
|
4327
|
+
const pprI18nSnapshot = canCachePPRShell ? _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, ) : void 0;
|
|
4298
4328
|
const pprShellOptions = canCachePPRShell ? {
|
|
4299
4329
|
pathname,
|
|
4300
4330
|
search: url.search,
|
|
@@ -4370,7 +4400,7 @@ var ServerRenderer = class {
|
|
|
4370
4400
|
const routeManifestEntry = routeManifest.routes.find(
|
|
4371
4401
|
(entry) => entry.pattern === route.pattern
|
|
4372
4402
|
);
|
|
4373
|
-
const moduleMetadata = routeManifestEntry ||
|
|
4403
|
+
const moduleMetadata = routeManifestEntry || _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
4374
4404
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
4375
4405
|
const renderedRouteSlots = await Promise.all(
|
|
4376
4406
|
routeSlots.map(async (slot) => {
|
|
@@ -4720,7 +4750,7 @@ var ServerRenderer = class {
|
|
|
4720
4750
|
let error = caughtError;
|
|
4721
4751
|
if (isWebResponse(error)) {
|
|
4722
4752
|
if (!res.headersSent && !res.writableEnded) {
|
|
4723
|
-
await
|
|
4753
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, error);
|
|
4724
4754
|
} else if (!res.writableEnded) {
|
|
4725
4755
|
res.end();
|
|
4726
4756
|
}
|
|
@@ -4729,7 +4759,7 @@ var ServerRenderer = class {
|
|
|
4729
4759
|
}
|
|
4730
4760
|
if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
|
|
4731
4761
|
const redirect = _chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error);
|
|
4732
|
-
const snapshot =
|
|
4762
|
+
const snapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
4733
4763
|
const redirectUrl = snapshot && redirect.url.startsWith("/") && !redirect.url.startsWith("//") ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, redirect.url, snapshot.locale, snapshot) : redirect.url;
|
|
4734
4764
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
4735
4765
|
type: "route.redirect",
|
|
@@ -4765,8 +4795,8 @@ var ServerRenderer = class {
|
|
|
4765
4795
|
return;
|
|
4766
4796
|
}
|
|
4767
4797
|
}
|
|
4768
|
-
|
|
4769
|
-
const errorStatus =
|
|
4798
|
+
emitFarmRenderError(req, pathname, error);
|
|
4799
|
+
const errorStatus = _chunk2MR4MABGcjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
4770
4800
|
if (pprRefreshRoute) {
|
|
4771
4801
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
4772
4802
|
type: "ppr.refresh.error",
|
|
@@ -4802,7 +4832,7 @@ var ServerRenderer = class {
|
|
|
4802
4832
|
}
|
|
4803
4833
|
}
|
|
4804
4834
|
async wrapWithIntegrationProviders(element) {
|
|
4805
|
-
const providers =
|
|
4835
|
+
const providers = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, this.config.integrations);
|
|
4806
4836
|
let wrapped = element;
|
|
4807
4837
|
for (let i = providers.length - 1; i >= 0; i--) {
|
|
4808
4838
|
const provider = providers[i];
|
|
@@ -4820,7 +4850,7 @@ var ServerRenderer = class {
|
|
|
4820
4850
|
}
|
|
4821
4851
|
let ProviderComponent;
|
|
4822
4852
|
let providerSourceModule;
|
|
4823
|
-
if (
|
|
4853
|
+
if (_chunkJX5VOLAVcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
4824
4854
|
providerSourceModule = provider.component.module;
|
|
4825
4855
|
const providerModuleId = provider.component.module.startsWith(".") ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0,
|
|
4826
4856
|
path9.resolve(this.config.root, provider.component.module),
|
|
@@ -4900,7 +4930,7 @@ var ServerRenderer = class {
|
|
|
4900
4930
|
manifestMatch.metadata,
|
|
4901
4931
|
manifestMatch.params
|
|
4902
4932
|
);
|
|
4903
|
-
const snapshot2 =
|
|
4933
|
+
const snapshot2 = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
4904
4934
|
const localizedHref = snapshot2 ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, rawHref, snapshot2.locale, snapshot2) : rawHref;
|
|
4905
4935
|
metadata.manifest = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
|
|
4906
4936
|
}
|
|
@@ -4911,14 +4941,14 @@ var ServerRenderer = class {
|
|
|
4911
4941
|
metadata = _chunk6IOZPJ3Icjs.addMetadataImageReference.call(void 0, metadata, reference);
|
|
4912
4942
|
}
|
|
4913
4943
|
}
|
|
4914
|
-
const snapshot =
|
|
4944
|
+
const snapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
4915
4945
|
const publicPathname = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0,
|
|
4916
4946
|
snapshot ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, options.pathname, snapshot.locale, snapshot) : options.pathname,
|
|
4917
4947
|
this.config.basePath
|
|
4918
4948
|
);
|
|
4919
4949
|
metadata = _chunk6IOZPJ3Icjs.addMetadataMarkdownAlternate.call(void 0,
|
|
4920
4950
|
metadata,
|
|
4921
|
-
|
|
4951
|
+
_chunkC2JOS77Zcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname, {
|
|
4922
4952
|
routePathname: (pathname) => this.routeManager.toRoutePathname(pathname)
|
|
4923
4953
|
})
|
|
4924
4954
|
);
|
|
@@ -4928,7 +4958,7 @@ var ServerRenderer = class {
|
|
|
4928
4958
|
const match = this.routeManager.getMatchingMetadataImage(pathname, kind);
|
|
4929
4959
|
if (!match) return null;
|
|
4930
4960
|
const rawHref = this.routeManager.resolveMetadataImagePath(match.image, match.params);
|
|
4931
|
-
const snapshot =
|
|
4961
|
+
const snapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
4932
4962
|
const localizedHref = snapshot ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, rawHref, snapshot.locale, snapshot) : rawHref;
|
|
4933
4963
|
const href = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
|
|
4934
4964
|
const reference = {
|
|
@@ -4992,18 +5022,18 @@ var ServerRenderer = class {
|
|
|
4992
5022
|
path: match.routePath,
|
|
4993
5023
|
...llmsContext
|
|
4994
5024
|
}) : routeModule.default;
|
|
4995
|
-
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await
|
|
5025
|
+
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkO32QPFVVcjs.renderFarmLlmsFullTxt.call(void 0, value, {
|
|
4996
5026
|
origin: await this.getAgentOrigin(request2),
|
|
4997
5027
|
readMarkdown: llmsContext.markdown
|
|
4998
5028
|
}) : value;
|
|
4999
|
-
const response =
|
|
5029
|
+
const response = _chunk2MR4MABGcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
5000
5030
|
method,
|
|
5001
5031
|
request: request2
|
|
5002
5032
|
});
|
|
5003
|
-
await
|
|
5033
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
5004
5034
|
} catch (error) {
|
|
5005
5035
|
_chunkQMNWKQL4cjs.logger.error(`Metadata route render failed for ${match.metadata.modulePath}: ${error}`);
|
|
5006
|
-
await
|
|
5036
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5007
5037
|
res,
|
|
5008
5038
|
new Response("Internal Server Error", {
|
|
5009
5039
|
status: 500,
|
|
@@ -5014,7 +5044,7 @@ var ServerRenderer = class {
|
|
|
5014
5044
|
}
|
|
5015
5045
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
5016
5046
|
getGeneratedLlmsKind(pathname) {
|
|
5017
|
-
const config =
|
|
5047
|
+
const config = _chunkO32QPFVVcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _136 => _136.config, 'access', _137 => _137.agent, 'optionalAccess', _138 => _138.llmsTxt]));
|
|
5018
5048
|
if (!config.enabled) return null;
|
|
5019
5049
|
if (pathname === "/llms.txt") return "llms";
|
|
5020
5050
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
@@ -5024,15 +5054,15 @@ var ServerRenderer = class {
|
|
|
5024
5054
|
const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5025
5055
|
trustProxy: _optionalChain([this, 'access', _139 => _139.config, 'access', _140 => _140.server, 'optionalAccess', _141 => _141.trustProxy])
|
|
5026
5056
|
});
|
|
5027
|
-
const config =
|
|
5057
|
+
const config = _chunkO32QPFVVcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _142 => _142.config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.llmsTxt]));
|
|
5028
5058
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
5029
|
-
const body = kind === "llms-full" ? await
|
|
5059
|
+
const body = kind === "llms-full" ? await _chunkO32QPFVVcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
5030
5060
|
origin: await this.getAgentOrigin(request2),
|
|
5031
5061
|
readMarkdown: context.markdown
|
|
5032
5062
|
}) : context.defaults;
|
|
5033
|
-
await
|
|
5063
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5034
5064
|
res,
|
|
5035
|
-
|
|
5065
|
+
_chunk2MR4MABGcjs.createFarmMetadataRouteResponse.call(void 0,
|
|
5036
5066
|
kind,
|
|
5037
5067
|
body,
|
|
5038
5068
|
{ revalidate: config.revalidate },
|
|
@@ -5041,7 +5071,7 @@ var ServerRenderer = class {
|
|
|
5041
5071
|
);
|
|
5042
5072
|
} catch (error) {
|
|
5043
5073
|
_chunkQMNWKQL4cjs.logger.error(`Generated ${kind}.txt failed: ${error}`);
|
|
5044
|
-
await
|
|
5074
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5045
5075
|
res,
|
|
5046
5076
|
new Response("Internal Server Error", {
|
|
5047
5077
|
status: 500,
|
|
@@ -5051,7 +5081,7 @@ var ServerRenderer = class {
|
|
|
5051
5081
|
}
|
|
5052
5082
|
}
|
|
5053
5083
|
getAgentCrawlers() {
|
|
5054
|
-
return
|
|
5084
|
+
return _chunkZUVAGMQ5cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _145 => _145.config, 'access', _146 => _146.agent, 'optionalAccess', _147 => _147.crawlers]));
|
|
5055
5085
|
}
|
|
5056
5086
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
5057
5087
|
async renderGeneratedRobotsTxt(req, res) {
|
|
@@ -5059,19 +5089,19 @@ var ServerRenderer = class {
|
|
|
5059
5089
|
const sitemapPath = _optionalChain([this, 'access', _148 => _148.routeManager, 'access', _149 => _149.matchMetadataRoute, 'call', _150 => _150("/sitemap.xml"), 'optionalAccess', _151 => _151.metadata, 'access', _152 => _152.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
|
|
5060
5090
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5061
5091
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5062
|
-
const robots =
|
|
5092
|
+
const robots = _chunkZUVAGMQ5cjs.createFarmAgentRobots.call(void 0, {
|
|
5063
5093
|
crawlers: this.getAgentCrawlers(),
|
|
5064
5094
|
sitemapPath,
|
|
5065
5095
|
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _153 => _153.metadataBase]),
|
|
5066
5096
|
basePath: this.config.basePath
|
|
5067
5097
|
});
|
|
5068
|
-
await
|
|
5098
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5069
5099
|
res,
|
|
5070
|
-
|
|
5100
|
+
_chunk2MR4MABGcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
5071
5101
|
);
|
|
5072
5102
|
} catch (error) {
|
|
5073
5103
|
_chunkQMNWKQL4cjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
5074
|
-
await
|
|
5104
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5075
5105
|
res,
|
|
5076
5106
|
new Response("Internal Server Error", {
|
|
5077
5107
|
status: 500,
|
|
@@ -5081,7 +5111,7 @@ var ServerRenderer = class {
|
|
|
5081
5111
|
}
|
|
5082
5112
|
}
|
|
5083
5113
|
getAgentSitemap() {
|
|
5084
|
-
return
|
|
5114
|
+
return _chunkZUVAGMQ5cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _154 => _154.config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.sitemap]));
|
|
5085
5115
|
}
|
|
5086
5116
|
/** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
|
|
5087
5117
|
async renderGeneratedSitemap(req, res) {
|
|
@@ -5104,22 +5134,24 @@ var ServerRenderer = class {
|
|
|
5104
5134
|
);
|
|
5105
5135
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5106
5136
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5107
|
-
const sitemap =
|
|
5137
|
+
const sitemap = _chunkZUVAGMQ5cjs.createFarmDefaultSitemap.call(void 0,
|
|
5108
5138
|
sources.filter((source) => source !== null),
|
|
5109
5139
|
{
|
|
5110
5140
|
origin: new URL(request2.url).origin,
|
|
5111
5141
|
config: this.getAgentSitemap(),
|
|
5112
5142
|
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _164 => _164.metadataBase]),
|
|
5113
|
-
basePath: this.config.basePath
|
|
5143
|
+
basePath: this.config.basePath,
|
|
5144
|
+
trailingSlash: this.config.trailingSlash,
|
|
5145
|
+
i18n: _optionalChain([this, 'access', _165 => _165.i18nRuntime, 'optionalAccess', _166 => _166.config])
|
|
5114
5146
|
}
|
|
5115
5147
|
);
|
|
5116
|
-
await
|
|
5148
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5117
5149
|
res,
|
|
5118
|
-
|
|
5150
|
+
_chunk2MR4MABGcjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
|
|
5119
5151
|
);
|
|
5120
5152
|
} catch (error) {
|
|
5121
5153
|
_chunkQMNWKQL4cjs.logger.error(`Generated sitemap.xml failed: ${error}`);
|
|
5122
|
-
await
|
|
5154
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5123
5155
|
res,
|
|
5124
5156
|
new Response("Internal Server Error", {
|
|
5125
5157
|
status: 500,
|
|
@@ -5142,9 +5174,9 @@ var ServerRenderer = class {
|
|
|
5142
5174
|
* matcher) covers, as the production build decides.
|
|
5143
5175
|
*/
|
|
5144
5176
|
getAgentListedRoutes() {
|
|
5145
|
-
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access',
|
|
5177
|
+
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _167 => _167.middlewareRoutes, 'optionalCall', _168 => _168()]), () => ( [])) };
|
|
5146
5178
|
return [...this.routeManager.getRoutes()].filter(
|
|
5147
|
-
([pattern]) => !pattern.includes("[") && !
|
|
5179
|
+
([pattern]) => !pattern.includes("[") && !_chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
|
|
5148
5180
|
);
|
|
5149
5181
|
}
|
|
5150
5182
|
/**
|
|
@@ -5160,7 +5192,7 @@ var ServerRenderer = class {
|
|
|
5160
5192
|
)
|
|
5161
5193
|
)
|
|
5162
5194
|
);
|
|
5163
|
-
return
|
|
5195
|
+
return _chunkO32QPFVVcjs.isFarmPageNoIndex.call(void 0, metadata, layoutMetadata);
|
|
5164
5196
|
}
|
|
5165
5197
|
/**
|
|
5166
5198
|
* The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
|
|
@@ -5168,24 +5200,26 @@ var ServerRenderer = class {
|
|
|
5168
5200
|
* or a registered server such as the docs engine's. Production applies the same rules.
|
|
5169
5201
|
*/
|
|
5170
5202
|
getDefaultMCPServer() {
|
|
5171
|
-
if (_optionalChain([this, 'access',
|
|
5172
|
-
if (_optionalChain([this, 'access',
|
|
5173
|
-
if (this.routeManager.matchRoute(
|
|
5174
|
-
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer =
|
|
5203
|
+
if (_optionalChain([this, 'access', _169 => _169.config, 'access', _170 => _170.agent, 'optionalAccess', _171 => _171.mcp]) !== true || _chunkVG6HYT5Kcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
|
|
5204
|
+
if (_optionalChain([this, 'access', _172 => _172.apiRouteExists, 'optionalCall', _173 => _173("/api/mcp")])) return void 0;
|
|
5205
|
+
if (this.routeManager.matchRoute(_chunkVG6HYT5Kcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
5206
|
+
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkVG6HYT5Kcjs.createFarmDefaultMCPServer.call(void 0,
|
|
5175
5207
|
readAppPackageIdentity(this.config.root),
|
|
5176
|
-
|
|
5208
|
+
_chunkMZLJFNMHcjs.FARM_VERSION
|
|
5177
5209
|
))));
|
|
5178
|
-
return
|
|
5210
|
+
return _chunkVG6HYT5Kcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
5179
5211
|
}
|
|
5180
5212
|
async renderDefaultMCP(req, res) {
|
|
5181
5213
|
const server = this.getDefaultMCPServer();
|
|
5182
|
-
const request2 = _nullishCoalesce(_chunkHDPT6OYEcjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
5214
|
+
const request2 = _nullishCoalesce(_chunkHDPT6OYEcjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _174 => _174.config, 'access', _175 => _175.server, 'optionalAccess', _176 => _176.trustProxy]) })));
|
|
5183
5215
|
try {
|
|
5184
|
-
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-
|
|
5216
|
+
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-6T2Z7TB6.cjs");
|
|
5185
5217
|
const origin = new URL(request2.url).origin;
|
|
5218
|
+
const i18n = _optionalChain([this, 'access', _177 => _177.i18nRuntime, 'optionalAccess', _178 => _178.config]);
|
|
5186
5219
|
const response = await handleFarmDefaultMCPRequest(request2, {
|
|
5187
5220
|
server,
|
|
5188
5221
|
basePath: this.config.basePath,
|
|
5222
|
+
i18n,
|
|
5189
5223
|
listPages: async () => {
|
|
5190
5224
|
const sources = await Promise.all(
|
|
5191
5225
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -5194,22 +5228,24 @@ var ServerRenderer = class {
|
|
|
5194
5228
|
return await this.isAgentPageNoIndex(pattern, metadata) ? null : { pattern, module };
|
|
5195
5229
|
})
|
|
5196
5230
|
);
|
|
5197
|
-
return
|
|
5231
|
+
return _chunkVG6HYT5Kcjs.collectFarmDefaultMCPPages.call(void 0,
|
|
5198
5232
|
sources.filter((source) => source !== null),
|
|
5199
5233
|
{
|
|
5200
5234
|
origin,
|
|
5201
5235
|
basePath: this.config.basePath,
|
|
5202
|
-
markdown:
|
|
5236
|
+
markdown: _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
5237
|
+
trailingSlash: this.config.trailingSlash,
|
|
5238
|
+
i18n
|
|
5203
5239
|
}
|
|
5204
5240
|
);
|
|
5205
5241
|
},
|
|
5206
5242
|
// Pages are read through this server's own socket, with no cookies, as llms-full.txt does.
|
|
5207
5243
|
readMarkdown: this.createDevMarkdownReader(req)
|
|
5208
5244
|
});
|
|
5209
|
-
await
|
|
5245
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
5210
5246
|
} catch (error) {
|
|
5211
5247
|
_chunkQMNWKQL4cjs.logger.error(`Default MCP server failed: ${error}`);
|
|
5212
|
-
await
|
|
5248
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5213
5249
|
res,
|
|
5214
5250
|
new Response(
|
|
5215
5251
|
JSON.stringify({
|
|
@@ -5224,7 +5260,7 @@ var ServerRenderer = class {
|
|
|
5224
5260
|
}
|
|
5225
5261
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
5226
5262
|
async createLlmsTxtContext(request2, options = {}) {
|
|
5227
|
-
const config =
|
|
5263
|
+
const config = _chunkO32QPFVVcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _179 => _179.config, 'access', _180 => _180.agent, 'optionalAccess', _181 => _181.llmsTxt]));
|
|
5228
5264
|
const origin = await this.getAgentOrigin(request2);
|
|
5229
5265
|
const sources = await Promise.all(
|
|
5230
5266
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -5241,24 +5277,26 @@ var ServerRenderer = class {
|
|
|
5241
5277
|
);
|
|
5242
5278
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5243
5279
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5244
|
-
const pages =
|
|
5280
|
+
const pages = _chunkO32QPFVVcjs.collectFarmLlmsTxtPages.call(void 0,
|
|
5245
5281
|
sources.filter((source) => source !== null),
|
|
5246
5282
|
{
|
|
5247
5283
|
origin,
|
|
5248
5284
|
basePath: this.config.basePath,
|
|
5249
|
-
markdown:
|
|
5285
|
+
markdown: _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
5250
5286
|
include: config.include,
|
|
5251
|
-
exclude: config.exclude
|
|
5287
|
+
exclude: config.exclude,
|
|
5288
|
+
trailingSlash: this.config.trailingSlash,
|
|
5289
|
+
i18n: _optionalChain([this, 'access', _182 => _182.i18nRuntime, 'optionalAccess', _183 => _183.config])
|
|
5252
5290
|
}
|
|
5253
5291
|
);
|
|
5254
5292
|
return {
|
|
5255
5293
|
pages,
|
|
5256
|
-
defaults:
|
|
5294
|
+
defaults: _chunkO32QPFVVcjs.createFarmDefaultLlmsTxt.call(void 0, {
|
|
5257
5295
|
origin,
|
|
5258
5296
|
pages,
|
|
5259
5297
|
config,
|
|
5260
5298
|
rootMetadata,
|
|
5261
|
-
mcp: _optionalChain([this, 'access',
|
|
5299
|
+
mcp: _optionalChain([this, 'access', _184 => _184.config, 'access', _185 => _185.agent, 'optionalAccess', _186 => _186.aiCatalog]) === false ? [] : _chunkK4UGCUXXcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
5262
5300
|
basePath: this.config.basePath,
|
|
5263
5301
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
5264
5302
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -5269,7 +5307,7 @@ var ServerRenderer = class {
|
|
|
5269
5307
|
})
|
|
5270
5308
|
}),
|
|
5271
5309
|
...options.full ? {
|
|
5272
|
-
markdown:
|
|
5310
|
+
markdown: _chunkO32QPFVVcjs.readFarmLlmsMarkdownFrom.call(void 0,
|
|
5273
5311
|
new URL(request2.url).origin,
|
|
5274
5312
|
origin,
|
|
5275
5313
|
this.createDevMarkdownReader(options.req)
|
|
@@ -5284,8 +5322,8 @@ var ServerRenderer = class {
|
|
|
5284
5322
|
async getAgentOrigin(request2) {
|
|
5285
5323
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5286
5324
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5287
|
-
return
|
|
5288
|
-
_optionalChain([rootMetadata, 'optionalAccess',
|
|
5325
|
+
return _chunkO32QPFVVcjs.resolveFarmAgentOrigin.call(void 0,
|
|
5326
|
+
_optionalChain([rootMetadata, 'optionalAccess', _187 => _187.metadataBase]),
|
|
5289
5327
|
new URL(request2.url).origin
|
|
5290
5328
|
);
|
|
5291
5329
|
}
|
|
@@ -5299,17 +5337,17 @@ var ServerRenderer = class {
|
|
|
5299
5337
|
* body is discarded.
|
|
5300
5338
|
*/
|
|
5301
5339
|
createDevMarkdownReader(req) {
|
|
5302
|
-
const socket = _optionalChain([req, 'optionalAccess',
|
|
5303
|
-
if (_optionalChain([req, 'optionalAccess',
|
|
5340
|
+
const socket = _optionalChain([req, 'optionalAccess', _188 => _188.socket]);
|
|
5341
|
+
if (_optionalChain([req, 'optionalAccess', _189 => _189.method, 'optionalAccess', _190 => _190.toUpperCase, 'call', _191 => _191()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _192 => _192.localAddress]) || !socket.localPort) {
|
|
5304
5342
|
return async () => null;
|
|
5305
5343
|
}
|
|
5306
5344
|
if (socket.encrypted) {
|
|
5307
5345
|
const address = { host: socket.localAddress, port: socket.localPort };
|
|
5308
|
-
return
|
|
5346
|
+
return _chunkO32QPFVVcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
|
|
5309
5347
|
}
|
|
5310
5348
|
const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
|
|
5311
5349
|
const localOrigin = `http://${host}:${socket.localPort}`;
|
|
5312
|
-
const read =
|
|
5350
|
+
const read = _chunkO32QPFVVcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
|
|
5313
5351
|
return (url) => {
|
|
5314
5352
|
const target = new URL(url);
|
|
5315
5353
|
return read(`${localOrigin}${target.pathname}${target.search}`);
|
|
@@ -5354,7 +5392,7 @@ var ServerRenderer = class {
|
|
|
5354
5392
|
ifNoneMatch: Array.isArray(ifNoneMatch) ? ifNoneMatch[0] : ifNoneMatch,
|
|
5355
5393
|
renderer: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
|
|
5356
5394
|
});
|
|
5357
|
-
await
|
|
5395
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
5358
5396
|
}
|
|
5359
5397
|
async writeStaticMetadataImageResponse(req, res, image) {
|
|
5360
5398
|
const method = (req.method || "GET").toUpperCase();
|
|
@@ -5366,7 +5404,7 @@ var ServerRenderer = class {
|
|
|
5366
5404
|
}
|
|
5367
5405
|
const etag = `"${image.staticInfo.hash}"`;
|
|
5368
5406
|
const requestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
5369
|
-
trustProxy: _optionalChain([this, 'access',
|
|
5407
|
+
trustProxy: _optionalChain([this, 'access', _193 => _193.config, 'access', _194 => _194.server, 'optionalAccess', _195 => _195.trustProxy])
|
|
5370
5408
|
});
|
|
5371
5409
|
const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
|
|
5372
5410
|
res.setHeader("Content-Type", image.staticInfo.contentType);
|
|
@@ -5541,12 +5579,12 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
|
|
|
5541
5579
|
window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
|
|
5542
5580
|
window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
|
|
5543
5581
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
5544
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
5545
|
-
window.__FARM_I18N__ = ${
|
|
5582
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkJX5VOLAVcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
5583
|
+
window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
5546
5584
|
</script>`);
|
|
5547
5585
|
const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
|
|
5548
5586
|
const rendererHydrationScript = farmScripts(
|
|
5549
|
-
_optionalChain([this, 'access',
|
|
5587
|
+
_optionalChain([this, 'access', _196 => _196.rendererRuntime, 'access', _197 => _197.generateHydrationScript, 'optionalCall', _198 => _198()]) || ""
|
|
5550
5588
|
);
|
|
5551
5589
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
5552
5590
|
const farmClientScript = farmScripts(
|
|
@@ -5555,8 +5593,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5555
5593
|
const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
|
|
5556
5594
|
element,
|
|
5557
5595
|
{
|
|
5558
|
-
rejectLateNavigation:
|
|
5559
|
-
_optionalChain([req, 'access',
|
|
5596
|
+
rejectLateNavigation: _chunkC2JOS77Zcjs._isFarmMarkdownPageCheck.call(void 0,
|
|
5597
|
+
_optionalChain([req, 'access', _199 => _199.headers, 'optionalAccess', _200 => _200[_chunkC2JOS77Zcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
|
|
5560
5598
|
)
|
|
5561
5599
|
}
|
|
5562
5600
|
);
|
|
@@ -5568,29 +5606,29 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5568
5606
|
viewport: viewportTags
|
|
5569
5607
|
} = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
5570
5608
|
pathname: getFarmMetadataPathname(req),
|
|
5571
|
-
jsonLd: _optionalChain([this, 'access',
|
|
5609
|
+
jsonLd: _optionalChain([this, 'access', _201 => _201.config, 'access', _202 => _202.agent, 'optionalAccess', _203 => _203.jsonLd])
|
|
5572
5610
|
});
|
|
5573
5611
|
const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
5574
5612
|
const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
|
|
5575
|
-
const i18nSnapshot =
|
|
5613
|
+
const i18nSnapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
5576
5614
|
const alternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
5577
5615
|
req.__FARM_ROUTE__ || req.url || "/",
|
|
5578
5616
|
i18nSnapshot,
|
|
5579
5617
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
5580
5618
|
) : "";
|
|
5581
|
-
const themeDocument =
|
|
5619
|
+
const themeDocument = _chunk2MR4MABGcjs.createFarmThemeDocumentParts.call(void 0,
|
|
5582
5620
|
this.config.theme,
|
|
5583
5621
|
this.config.basePath,
|
|
5584
5622
|
_chunkQIXEU2WVcjs.getTheme.call(void 0, )
|
|
5585
5623
|
);
|
|
5586
5624
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
5587
|
-
const fullDocument =
|
|
5625
|
+
const fullDocument = _chunk2MR4MABGcjs.extractFarmFullDocument.call(void 0, content);
|
|
5588
5626
|
let html;
|
|
5589
5627
|
if (fullDocument) {
|
|
5590
5628
|
const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
|
|
5591
|
-
const documentHtml = shouldReplaceLayoutTitle ?
|
|
5592
|
-
const effectiveRendererHead = hasExplicitTitle ?
|
|
5593
|
-
html =
|
|
5629
|
+
const documentHtml = shouldReplaceLayoutTitle ? _chunk2MR4MABGcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
|
|
5630
|
+
const effectiveRendererHead = hasExplicitTitle ? _chunk2MR4MABGcjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
|
|
5631
|
+
html = _chunk2MR4MABGcjs.composeFarmFullDocument.call(void 0, documentHtml, {
|
|
5594
5632
|
fallbackIcon: !hasFavicon,
|
|
5595
5633
|
viewport: viewportTags,
|
|
5596
5634
|
htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
|
|
@@ -5616,7 +5654,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5616
5654
|
});
|
|
5617
5655
|
} else {
|
|
5618
5656
|
html = `<!DOCTYPE html>
|
|
5619
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
5657
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _204 => _204.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
5620
5658
|
<head>
|
|
5621
5659
|
${themeDocument.head}
|
|
5622
5660
|
<meta charset="utf-8">
|
|
@@ -5647,17 +5685,17 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5647
5685
|
const securedHtml = this.secureDocumentHTML(req, html);
|
|
5648
5686
|
if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
|
|
5649
5687
|
res.end();
|
|
5650
|
-
if (!options.captureStaticShell) await _optionalChain([options, 'access',
|
|
5688
|
+
if (!options.captureStaticShell) await _optionalChain([options, 'access', _205 => _205.onComplete, 'optionalCall', _206 => _206(securedHtml)]);
|
|
5651
5689
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
5652
5690
|
type: "render.stream.complete",
|
|
5653
5691
|
route,
|
|
5654
5692
|
durationMs: Date.now() - startedAt
|
|
5655
5693
|
});
|
|
5656
5694
|
} catch (error) {
|
|
5657
|
-
|
|
5695
|
+
emitFarmRenderError(req, route, error);
|
|
5658
5696
|
throw error;
|
|
5659
5697
|
} finally {
|
|
5660
|
-
_optionalChain([clearMiddlewareData, 'optionalCall',
|
|
5698
|
+
_optionalChain([clearMiddlewareData, 'optionalCall', _207 => _207()]);
|
|
5661
5699
|
}
|
|
5662
5700
|
}
|
|
5663
5701
|
/**
|
|
@@ -5672,7 +5710,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5672
5710
|
if (!rootLayout) return false;
|
|
5673
5711
|
try {
|
|
5674
5712
|
const Layout = (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).default;
|
|
5675
|
-
if (typeof Layout !== "function" || _optionalChain([Layout, 'access',
|
|
5713
|
+
if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _208 => _208.prototype, 'optionalAccess', _209 => _209.isReactComponent]) || _optionalChain([Layout, 'access', _210 => _210.constructor, 'optionalAccess', _211 => _211.name]) === "AsyncFunction") {
|
|
5676
5714
|
return false;
|
|
5677
5715
|
}
|
|
5678
5716
|
const cached = documentLayouts.get(Layout);
|
|
@@ -5697,7 +5735,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5697
5735
|
const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
|
|
5698
5736
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
5699
5737
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument();
|
|
5700
|
-
if (!renderToPipeableStream ||
|
|
5738
|
+
if (!renderToPipeableStream || _chunkC2JOS77Zcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _212 => _212.headers, 'optionalAccess', _213 => _213[_chunkC2JOS77Zcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer))) {
|
|
5701
5739
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
5702
5740
|
}
|
|
5703
5741
|
return new Promise((resolve3, reject) => {
|
|
@@ -5813,8 +5851,8 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
|
|
|
5813
5851
|
req.__FARM_LOADING_MODULE_PATH__ || null
|
|
5814
5852
|
)};
|
|
5815
5853
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
5816
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
5817
|
-
window.__FARM_I18N__ = ${
|
|
5854
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkJX5VOLAVcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
5855
|
+
window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
5818
5856
|
</script>${_chunkW44X6IC2cjs.renderFarmFormStateScript.call(void 0, )}`;
|
|
5819
5857
|
const islandsOnlyPage = this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
|
|
5820
5858
|
const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
|
|
@@ -5829,16 +5867,16 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5829
5867
|
viewport: viewportTags
|
|
5830
5868
|
} = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
5831
5869
|
pathname: getFarmMetadataPathname(req),
|
|
5832
|
-
jsonLd: _optionalChain([this, 'access',
|
|
5870
|
+
jsonLd: _optionalChain([this, 'access', _214 => _214.config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.jsonLd])
|
|
5833
5871
|
});
|
|
5834
|
-
const i18nSnapshot =
|
|
5872
|
+
const i18nSnapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
5835
5873
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
5836
5874
|
req.__FARM_ROUTE__ || req.url || "/",
|
|
5837
5875
|
i18nSnapshot,
|
|
5838
5876
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
5839
5877
|
) : "";
|
|
5840
5878
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
5841
|
-
const themeDocument =
|
|
5879
|
+
const themeDocument = _chunk2MR4MABGcjs.createFarmThemeDocumentParts.call(void 0,
|
|
5842
5880
|
this.config.theme,
|
|
5843
5881
|
this.config.basePath,
|
|
5844
5882
|
_chunkQIXEU2WVcjs.getTheme.call(void 0, )
|
|
@@ -5857,7 +5895,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5857
5895
|
formState: _chunkW44X6IC2cjs.getFarmFormState.call(void 0, ),
|
|
5858
5896
|
onShellReady() {
|
|
5859
5897
|
if (pendingNavigationError) {
|
|
5860
|
-
_optionalChain([abort, 'optionalCall',
|
|
5898
|
+
_optionalChain([abort, 'optionalCall', _217 => _217(pendingNavigationError)]);
|
|
5861
5899
|
if (clearMiddlewareData) {
|
|
5862
5900
|
clearMiddlewareData();
|
|
5863
5901
|
}
|
|
@@ -5875,7 +5913,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5875
5913
|
console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
|
|
5876
5914
|
}
|
|
5877
5915
|
const shell = `<!DOCTYPE html>
|
|
5878
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
5916
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _218 => _218.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
5879
5917
|
<head>
|
|
5880
5918
|
${themeDocument.head}
|
|
5881
5919
|
<meta charset="utf-8">
|
|
@@ -5896,7 +5934,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5896
5934
|
const securedShell = streamDocument ? "" : stampDocumentHTML(shell);
|
|
5897
5935
|
if (securedShell) {
|
|
5898
5936
|
htmlParts.push(securedShell);
|
|
5899
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
5937
|
+
_optionalChain([staticShellParts, 'optionalAccess', _219 => _219.push, 'call', _220 => _220(securedShell)]);
|
|
5900
5938
|
}
|
|
5901
5939
|
const withEarlyClient = (document) => earlyClient ? {
|
|
5902
5940
|
...document,
|
|
@@ -5906,10 +5944,10 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5906
5944
|
${stampDocumentHTML(earlyClientScript)}`
|
|
5907
5945
|
)
|
|
5908
5946
|
} : document;
|
|
5909
|
-
const documentTransform = streamDocument ?
|
|
5947
|
+
const documentTransform = streamDocument ? _chunk2MR4MABGcjs.createFarmStreamedDocumentTransform.call(void 0,
|
|
5910
5948
|
(opening) => withEarlyClient(
|
|
5911
|
-
|
|
5912
|
-
hasExplicitTitle ?
|
|
5949
|
+
_chunk2MR4MABGcjs.openFarmStreamedDocument.call(void 0,
|
|
5950
|
+
hasExplicitTitle ? _chunk2MR4MABGcjs.removeFarmDocumentTitles.call(void 0, opening) : opening,
|
|
5913
5951
|
{
|
|
5914
5952
|
fallbackIcon: !hasFavicon,
|
|
5915
5953
|
viewport: viewportTags,
|
|
@@ -5948,7 +5986,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5948
5986
|
const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
|
|
5949
5987
|
if (!checkedFullDocument && renderedText) {
|
|
5950
5988
|
documentPrefix += renderedText;
|
|
5951
|
-
const prefix =
|
|
5989
|
+
const prefix = _chunk2MR4MABGcjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
|
|
5952
5990
|
if (prefix !== "pending") {
|
|
5953
5991
|
checkedFullDocument = true;
|
|
5954
5992
|
documentPrefix = "";
|
|
@@ -5967,7 +6005,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
5967
6005
|
staticShellClosed = true;
|
|
5968
6006
|
if (!suspenseHoleEmitted) {
|
|
5969
6007
|
suspenseHoleEmitted = true;
|
|
5970
|
-
_optionalChain([options, 'access',
|
|
6008
|
+
_optionalChain([options, 'access', _221 => _221.onSuspenseHoleDetected, 'optionalCall', _222 => _222()]);
|
|
5971
6009
|
}
|
|
5972
6010
|
} else {
|
|
5973
6011
|
staticShellParts.push(chunkText);
|
|
@@ -6031,8 +6069,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6031
6069
|
recordRenderedChunk(tail, rewritten);
|
|
6032
6070
|
if (tail) res.write(tail);
|
|
6033
6071
|
}
|
|
6034
|
-
const documentEnd = _optionalChain([documentTransform, 'optionalAccess',
|
|
6035
|
-
if (_optionalChain([documentEnd, 'optionalAccess',
|
|
6072
|
+
const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _223 => _223.end, 'call', _224 => _224()]);
|
|
6073
|
+
if (_optionalChain([documentEnd, 'optionalAccess', _225 => _225.text])) {
|
|
6036
6074
|
recordRenderedChunk(documentEnd.text, "");
|
|
6037
6075
|
res.write(documentEnd.text);
|
|
6038
6076
|
}
|
|
@@ -6043,7 +6081,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6043
6081
|
deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
|
|
6044
6082
|
earlyClient,
|
|
6045
6083
|
// A full document: Farm's #root closes only where Farm opened it.
|
|
6046
|
-
..._optionalChain([documentEnd, 'optionalAccess',
|
|
6084
|
+
..._optionalChain([documentEnd, 'optionalAccess', _226 => _226.document]) ? { closeRoot: documentEnd.rootOpened } : {}
|
|
6047
6085
|
})
|
|
6048
6086
|
);
|
|
6049
6087
|
htmlParts.push(footer);
|
|
@@ -6086,11 +6124,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6086
6124
|
didError = true;
|
|
6087
6125
|
if (!isWebResponse(error) && !_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error) && !_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error)) {
|
|
6088
6126
|
_chunkQMNWKQL4cjs.logger.error(`SSR shell error: ${error}`);
|
|
6089
|
-
|
|
6090
|
-
type: "render.error",
|
|
6091
|
-
route: observabilityRoute,
|
|
6092
|
-
error
|
|
6093
|
-
});
|
|
6127
|
+
emitFarmRenderError(req, observabilityRoute, error);
|
|
6094
6128
|
}
|
|
6095
6129
|
if (clearMiddlewareData) {
|
|
6096
6130
|
clearMiddlewareData();
|
|
@@ -6106,11 +6140,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6106
6140
|
}
|
|
6107
6141
|
if (!isWebResponse(error)) {
|
|
6108
6142
|
_chunkQMNWKQL4cjs.logger.error(`SSR streaming error: ${error}`);
|
|
6109
|
-
|
|
6110
|
-
type: "render.error",
|
|
6111
|
-
route: observabilityRoute,
|
|
6112
|
-
error
|
|
6113
|
-
});
|
|
6143
|
+
emitFarmRenderError(req, observabilityRoute, error);
|
|
6114
6144
|
}
|
|
6115
6145
|
}
|
|
6116
6146
|
});
|
|
@@ -6151,7 +6181,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6151
6181
|
};
|
|
6152
6182
|
}
|
|
6153
6183
|
localizeRedirectUrl(url) {
|
|
6154
|
-
const snapshot =
|
|
6184
|
+
const snapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6155
6185
|
return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
|
|
6156
6186
|
}
|
|
6157
6187
|
/** The app's not-found component, or null when it relies on the built-in page. */
|
|
@@ -6164,7 +6194,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6164
6194
|
return await this.routeManager.loadRouteModule(notFoundPath);
|
|
6165
6195
|
}
|
|
6166
6196
|
async loadNotFoundComponent() {
|
|
6167
|
-
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async
|
|
6197
|
+
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _227 => _227.default]), async () => ( null));
|
|
6168
6198
|
}
|
|
6169
6199
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
6170
6200
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
@@ -6187,13 +6217,13 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6187
6217
|
*/
|
|
6188
6218
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
6189
6219
|
if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
|
|
6190
|
-
return
|
|
6220
|
+
return _chunk2MR4MABGcjs.createLateRedirectRecovery.call(void 0,
|
|
6191
6221
|
this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
|
|
6192
6222
|
this.getCspNonce(req) || ""
|
|
6193
6223
|
);
|
|
6194
6224
|
}
|
|
6195
6225
|
const pathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6196
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6226
|
+
trustProxy: _optionalChain([this, 'access', _228 => _228.config, 'access', _229 => _229.server, 'optionalAccess', _230 => _230.trustProxy])
|
|
6197
6227
|
}).pathname;
|
|
6198
6228
|
let content = this.defaultNotFoundContent();
|
|
6199
6229
|
const NotFoundComponent = await this.loadNotFoundComponent();
|
|
@@ -6209,25 +6239,33 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6209
6239
|
_chunkQMNWKQL4cjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
6210
6240
|
}
|
|
6211
6241
|
}
|
|
6212
|
-
return
|
|
6242
|
+
return _chunk2MR4MABGcjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
|
|
6213
6243
|
}
|
|
6214
6244
|
async render404(req, res) {
|
|
6215
6245
|
res.statusCode = 404;
|
|
6216
6246
|
const pathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6217
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6247
|
+
trustProxy: _optionalChain([this, 'access', _231 => _231.config, 'access', _232 => _232.server, 'optionalAccess', _233 => _233.trustProxy])
|
|
6218
6248
|
}).pathname;
|
|
6219
6249
|
if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
6220
6250
|
res.setHeader("Content-Type", "application/json");
|
|
6221
6251
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
6222
6252
|
return;
|
|
6223
6253
|
}
|
|
6254
|
+
if (res.getHeader(_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER) === void 0) {
|
|
6255
|
+
const deploymentMismatch = this.getDeploymentMismatch(req);
|
|
6256
|
+
if (deploymentMismatch) {
|
|
6257
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, _chunkNLBHLPEOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch));
|
|
6258
|
+
return;
|
|
6259
|
+
}
|
|
6260
|
+
this.applyDeploymentHeaders(req, res);
|
|
6261
|
+
}
|
|
6224
6262
|
const acceptHeader = req.headers.accept;
|
|
6225
6263
|
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
6226
|
-
if (
|
|
6227
|
-
res.setHeader("Content-Type",
|
|
6264
|
+
if (_chunkC2JOS77Zcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
|
|
6265
|
+
res.setHeader("Content-Type", _chunkC2JOS77Zcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
6228
6266
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
6229
6267
|
res.setHeader("Cache-Control", "no-store");
|
|
6230
|
-
res.end(
|
|
6268
|
+
res.end(_chunkC2JOS77Zcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
|
|
6231
6269
|
return;
|
|
6232
6270
|
}
|
|
6233
6271
|
const appDir = path9.join(this.config.root, this.config.srcDir, "app");
|
|
@@ -6247,9 +6285,9 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6247
6285
|
);
|
|
6248
6286
|
if (notFoundPath) {
|
|
6249
6287
|
const notFoundModule = await this.loadNotFoundModule();
|
|
6250
|
-
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess',
|
|
6288
|
+
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _234 => _234.default]), () => ( null));
|
|
6251
6289
|
if (NotFoundComponent) {
|
|
6252
|
-
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess',
|
|
6290
|
+
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _235 => _235.default]), () => ( null));
|
|
6253
6291
|
let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
|
|
6254
6292
|
if (LayoutComponent) {
|
|
6255
6293
|
element = this.rendererRuntime.createElement(LayoutComponent, {
|
|
@@ -6289,23 +6327,23 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6289
6327
|
res.statusCode = statusCode;
|
|
6290
6328
|
const isDev = process.env.NODE_ENV === "development";
|
|
6291
6329
|
const requestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6292
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6330
|
+
trustProxy: _optionalChain([this, 'access', _236 => _236.config, 'access', _237 => _237.server, 'optionalAccess', _238 => _238.trustProxy])
|
|
6293
6331
|
});
|
|
6294
6332
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
6295
|
-
const statusText =
|
|
6333
|
+
const statusText = _chunk2MR4MABGcjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
6296
6334
|
const content = this.stampFarmScripts(
|
|
6297
6335
|
req,
|
|
6298
|
-
|
|
6336
|
+
_chunk2MR4MABGcjs.createDefaultErrorMarkup.call(void 0, {
|
|
6299
6337
|
statusCode,
|
|
6300
6338
|
statusText,
|
|
6301
6339
|
requestPath: requestUrl.pathname,
|
|
6302
6340
|
method: req.method || "GET",
|
|
6303
|
-
message: _optionalChain([diagnostics, 'optionalAccess',
|
|
6304
|
-
errorName: _optionalChain([diagnostics, 'optionalAccess',
|
|
6305
|
-
stack: _optionalChain([diagnostics, 'optionalAccess',
|
|
6306
|
-
sourceFrame: _optionalChain([diagnostics, 'optionalAccess',
|
|
6341
|
+
message: _optionalChain([diagnostics, 'optionalAccess', _239 => _239.message]),
|
|
6342
|
+
errorName: _optionalChain([diagnostics, 'optionalAccess', _240 => _240.name]),
|
|
6343
|
+
stack: _optionalChain([diagnostics, 'optionalAccess', _241 => _241.stack]),
|
|
6344
|
+
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _242 => _242.sourceFrame]),
|
|
6307
6345
|
development: isDev,
|
|
6308
|
-
farmVersion:
|
|
6346
|
+
farmVersion: _chunkMZLJFNMHcjs.FARM_VERSION,
|
|
6309
6347
|
nodeVersion: process.version,
|
|
6310
6348
|
mode: isDev ? "development" : "production"
|
|
6311
6349
|
})
|
|
@@ -6331,18 +6369,18 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6331
6369
|
*/
|
|
6332
6370
|
getI18nAlternateOptions(req, metadata) {
|
|
6333
6371
|
return {
|
|
6334
|
-
metadataBase: _optionalChain([metadata, 'optionalAccess',
|
|
6335
|
-
origin: req ? _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
6372
|
+
metadataBase: _optionalChain([metadata, 'optionalAccess', _243 => _243.metadataBase]),
|
|
6373
|
+
origin: req ? _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _244 => _244.config, 'access', _245 => _245.server, 'optionalAccess', _246 => _246.trustProxy]) }).origin : void 0
|
|
6336
6374
|
};
|
|
6337
6375
|
}
|
|
6338
6376
|
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
|
|
6339
|
-
const i18nSnapshot =
|
|
6377
|
+
const i18nSnapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6340
6378
|
const farmScripts = (html) => this.stampFarmScripts(alternates.req, html);
|
|
6341
6379
|
const clientScript = isClientComponent ? ` ${farmScripts(`<script type="module" src="/@farm/client.js"></script>`)}` : "";
|
|
6342
6380
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
6343
6381
|
const integrationManifestScript = farmScripts(`<script>
|
|
6344
6382
|
window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
|
|
6345
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6383
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkJX5VOLAVcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6346
6384
|
${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
|
|
6347
6385
|
</script>`);
|
|
6348
6386
|
const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -6351,20 +6389,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
6351
6389
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
6352
6390
|
) : "";
|
|
6353
6391
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6354
|
-
const themeDocument =
|
|
6392
|
+
const themeDocument = _chunk2MR4MABGcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6355
6393
|
this.config.theme,
|
|
6356
6394
|
this.config.basePath,
|
|
6357
6395
|
_chunkQIXEU2WVcjs.getTheme.call(void 0, )
|
|
6358
6396
|
);
|
|
6359
6397
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
6360
6398
|
const rendererHydrationScript = farmScripts(
|
|
6361
|
-
_optionalChain([this, 'access',
|
|
6399
|
+
_optionalChain([this, 'access', _247 => _247.rendererRuntime, 'access', _248 => _248.generateHydrationScript, 'optionalCall', _249 => _249()]) || ""
|
|
6362
6400
|
);
|
|
6363
|
-
const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access',
|
|
6364
|
-
const fullDocument =
|
|
6401
|
+
const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _250 => _250.metadata, 'optionalAccess', _251 => _251.viewport]));
|
|
6402
|
+
const fullDocument = _chunk2MR4MABGcjs.extractFarmFullDocument.call(void 0, content);
|
|
6365
6403
|
if (fullDocument) {
|
|
6366
|
-
return
|
|
6367
|
-
metadataHead ?
|
|
6404
|
+
return _chunk2MR4MABGcjs.composeFarmFullDocument.call(void 0,
|
|
6405
|
+
metadataHead ? _chunk2MR4MABGcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
|
|
6368
6406
|
{
|
|
6369
6407
|
fallbackIcon: !metadataHead,
|
|
6370
6408
|
viewport: viewportTags,
|
|
@@ -6390,7 +6428,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
6390
6428
|
);
|
|
6391
6429
|
}
|
|
6392
6430
|
return `<!DOCTYPE html>
|
|
6393
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6431
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _252 => _252.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6394
6432
|
<head>
|
|
6395
6433
|
${themeDocument.head}
|
|
6396
6434
|
<meta charset="utf-8">
|
|
@@ -6429,11 +6467,11 @@ ${clientScript}
|
|
|
6429
6467
|
}
|
|
6430
6468
|
applyDeploymentHeaders(req, res) {
|
|
6431
6469
|
const deploymentId = this.getDeploymentId();
|
|
6432
|
-
res.setHeader(
|
|
6470
|
+
res.setHeader(_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
|
|
6433
6471
|
if ((req.method || "GET").toUpperCase() !== "GET") return;
|
|
6434
6472
|
const forwardedProto = req.headers["x-forwarded-proto"];
|
|
6435
|
-
const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess',
|
|
6436
|
-
const cookie =
|
|
6473
|
+
const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _253 => _253.split, 'call', _254 => _254(","), 'access', _255 => _255[0], 'optionalAccess', _256 => _256.trim, 'call', _257 => _257()]) === "https" || Boolean(_optionalChain([req, 'access', _258 => _258.socket, 'optionalAccess', _259 => _259.encrypted]));
|
|
6474
|
+
const cookie = _chunkNLBHLPEOcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
|
|
6437
6475
|
const existing = res.getHeader("Set-Cookie");
|
|
6438
6476
|
if (Array.isArray(existing)) {
|
|
6439
6477
|
res.setHeader("Set-Cookie", [...existing, cookie]);
|
|
@@ -6443,6 +6481,17 @@ ${clientScript}
|
|
|
6443
6481
|
res.setHeader("Set-Cookie", cookie);
|
|
6444
6482
|
}
|
|
6445
6483
|
}
|
|
6484
|
+
getDeploymentMismatch(req) {
|
|
6485
|
+
const headers = new Headers();
|
|
6486
|
+
for (const name of [_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER, "cookie"]) {
|
|
6487
|
+
const value = req.headers[name];
|
|
6488
|
+
if (value) headers.set(name, Array.isArray(value) ? value.join("; ") : value);
|
|
6489
|
+
}
|
|
6490
|
+
return _chunkNLBHLPEOcjs.getFarmDeploymentMismatch.call(void 0,
|
|
6491
|
+
{ method: req.method || "GET", headers },
|
|
6492
|
+
this.getDeploymentId()
|
|
6493
|
+
);
|
|
6494
|
+
}
|
|
6446
6495
|
getDeploymentId() {
|
|
6447
6496
|
return this.config.deploymentId || "development";
|
|
6448
6497
|
}
|
|
@@ -6463,8 +6512,8 @@ var FarmApp = class {
|
|
|
6463
6512
|
this.config = this.normalizeConfig(config);
|
|
6464
6513
|
_chunkEVIWKPJVcjs.configureFarmObservability.call(void 0, this.config.observability);
|
|
6465
6514
|
_chunkQIXEU2WVcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
|
|
6466
|
-
this.i18nRuntime =
|
|
6467
|
-
|
|
6515
|
+
this.i18nRuntime = _chunk2AM26UGIcjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
|
|
6516
|
+
_chunk2AM26UGIcjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
|
|
6468
6517
|
this.viteServer = viteServer;
|
|
6469
6518
|
this.routeManager = new RouteManager(this.config, viteServer);
|
|
6470
6519
|
this.serverRenderer = new ServerRenderer(
|
|
@@ -6536,7 +6585,7 @@ var FarmApp = class {
|
|
|
6536
6585
|
config.images,
|
|
6537
6586
|
_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
6538
6587
|
),
|
|
6539
|
-
performance:
|
|
6588
|
+
performance: _chunkZUVAGMQ5cjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
6540
6589
|
theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
6541
6590
|
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkLNVGXUL3cjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
|
|
6542
6591
|
root,
|
|
@@ -6548,7 +6597,7 @@ var FarmApp = class {
|
|
|
6548
6597
|
serverRuntimeConfig: config.serverRuntimeConfig || {},
|
|
6549
6598
|
publicRuntimeConfig: config.publicRuntimeConfig || {},
|
|
6550
6599
|
docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
|
|
6551
|
-
md:
|
|
6600
|
+
md: _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, config.md),
|
|
6552
6601
|
mdx: _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx),
|
|
6553
6602
|
observability: _nullishCoalesce(config.observability, () => ( false)),
|
|
6554
6603
|
telemetry: config.telemetry !== false,
|
|
@@ -6564,10 +6613,10 @@ var FarmApp = class {
|
|
|
6564
6613
|
env: config.env || { server: {}, public: {} },
|
|
6565
6614
|
suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
|
|
6566
6615
|
experimental: {
|
|
6567
|
-
serverComponents: _nullishCoalesce(_optionalChain([config, 'access',
|
|
6568
|
-
serverActions: _nullishCoalesce(_optionalChain([config, 'access',
|
|
6569
|
-
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access',
|
|
6570
|
-
ppr: _nullishCoalesce(_optionalChain([config, 'access',
|
|
6616
|
+
serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _260 => _260.experimental, 'optionalAccess', _261 => _261.serverComponents]), () => ( false)),
|
|
6617
|
+
serverActions: _nullishCoalesce(_optionalChain([config, 'access', _262 => _262.experimental, 'optionalAccess', _263 => _263.serverActions]), () => ( false)),
|
|
6618
|
+
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _264 => _264.experimental, 'optionalAccess', _265 => _265.isolatedClientHydration]), () => ( "off")),
|
|
6619
|
+
ppr: _nullishCoalesce(_optionalChain([config, 'access', _266 => _266.experimental, 'optionalAccess', _267 => _267.ppr]), () => ( false)),
|
|
6571
6620
|
...config.experimental
|
|
6572
6621
|
},
|
|
6573
6622
|
agent: _nullishCoalesce(config.agent, () => ( {})),
|
|
@@ -6626,7 +6675,7 @@ function isResolvedAuthConfig(value) {
|
|
|
6626
6675
|
);
|
|
6627
6676
|
}
|
|
6628
6677
|
function normalizeFarmAppAPIConfig(config) {
|
|
6629
|
-
if (typeof _optionalChain([config, 'optionalAccess',
|
|
6678
|
+
if (typeof _optionalChain([config, 'optionalAccess', _268 => _268.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _269 => _269.basePath]) === "function") {
|
|
6630
6679
|
throw new Error(
|
|
6631
6680
|
"Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
|
|
6632
6681
|
);
|
|
@@ -6641,7 +6690,7 @@ function createFarmApp(config, viteServer) {
|
|
|
6641
6690
|
var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
|
|
6642
6691
|
var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
|
|
6643
6692
|
function resolveFarmImageProviderForRuntime(images, options) {
|
|
6644
|
-
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess',
|
|
6693
|
+
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _270 => _270.provider]), () => ( "auto"));
|
|
6645
6694
|
if (provider === "none") return images;
|
|
6646
6695
|
const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
|
|
6647
6696
|
if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
|
|
@@ -6770,9 +6819,9 @@ function staticValue(node) {
|
|
|
6770
6819
|
}
|
|
6771
6820
|
}
|
|
6772
6821
|
function property(object, name) {
|
|
6773
|
-
return _optionalChain([object, 'access',
|
|
6822
|
+
return _optionalChain([object, 'access', _271 => _271.properties, 'access', _272 => _272.find, 'call', _273 => _273(
|
|
6774
6823
|
(entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
|
|
6775
|
-
), 'optionalAccess',
|
|
6824
|
+
), 'optionalAccess', _274 => _274.value]);
|
|
6776
6825
|
}
|
|
6777
6826
|
function toolFromObject(object) {
|
|
6778
6827
|
const name = staticValue(property(object, "name"));
|
|
@@ -6818,7 +6867,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
6818
6867
|
if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
|
|
6819
6868
|
continue;
|
|
6820
6869
|
for (const specifier of statement.specifiers) {
|
|
6821
|
-
const imported = _nullishCoalesce(_optionalChain([specifier, 'access',
|
|
6870
|
+
const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _275 => _275.imported, 'optionalAccess', _276 => _276.name]), () => ( _optionalChain([specifier, 'access', _277 => _277.imported, 'optionalAccess', _278 => _278.value])));
|
|
6822
6871
|
if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
|
|
6823
6872
|
locals.set(specifier.local.name, imported);
|
|
6824
6873
|
}
|
|
@@ -6834,7 +6883,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
6834
6883
|
const [argument] = current.arguments;
|
|
6835
6884
|
if (definer && argument) {
|
|
6836
6885
|
const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
|
|
6837
|
-
(element) => _optionalChain([element, 'optionalAccess',
|
|
6886
|
+
(element) => _optionalChain([element, 'optionalAccess', _279 => _279.type]) === "ObjectExpression"
|
|
6838
6887
|
) : [] : argument.type === "ObjectExpression" ? [argument] : [];
|
|
6839
6888
|
for (const object of objects) {
|
|
6840
6889
|
const tool = toolFromObject(object);
|
|
@@ -6895,8 +6944,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
6895
6944
|
|
|
6896
6945
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
6897
6946
|
function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
6898
|
-
const client = _optionalChain([cache2, 'optionalAccess',
|
|
6899
|
-
const adapter = _optionalChain([client, 'optionalAccess',
|
|
6947
|
+
const client = _optionalChain([cache2, 'optionalAccess', _280 => _280.client]);
|
|
6948
|
+
const adapter = _optionalChain([client, 'optionalAccess', _281 => _281.adapter]);
|
|
6900
6949
|
if (adapter === void 0) return void 0;
|
|
6901
6950
|
if (typeof adapter !== "string" || adapter.trim().length === 0) {
|
|
6902
6951
|
throw new Error(
|
|
@@ -6911,8 +6960,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
|
6911
6960
|
);
|
|
6912
6961
|
}
|
|
6913
6962
|
const options = {};
|
|
6914
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
6915
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
6963
|
+
if (_optionalChain([client, 'optionalAccess', _282 => _282.version]) !== void 0) options.version = client.version;
|
|
6964
|
+
if (_optionalChain([client, 'optionalAccess', _283 => _283.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
|
|
6916
6965
|
return { importPath: found.replace(/\\/g, "/"), options };
|
|
6917
6966
|
}
|
|
6918
6967
|
function resolveAdapterFile(resolved) {
|
|
@@ -7318,7 +7367,7 @@ function redactFarmDocsClientConfig(code, filename) {
|
|
|
7318
7367
|
const current = node;
|
|
7319
7368
|
if (current.type === "Property") {
|
|
7320
7369
|
const name = propertyKeyName(current);
|
|
7321
|
-
const valueType = _optionalChain([current, 'access',
|
|
7370
|
+
const valueType = _optionalChain([current, 'access', _284 => _284.value, 'optionalAccess', _285 => _285.type]);
|
|
7322
7371
|
const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkSM2SYWARcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
|
|
7323
7372
|
if (name && credential) {
|
|
7324
7373
|
edits.push(
|
|
@@ -7361,7 +7410,7 @@ function farmDocsClientConfigPlugin(configModule) {
|
|
|
7361
7410
|
// Never matches without a docs config module, so the bundler never calls the handler.
|
|
7362
7411
|
filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
|
|
7363
7412
|
handler(code, id, options) {
|
|
7364
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7413
|
+
if (_optionalChain([options, 'optionalAccess', _286 => _286.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
|
|
7365
7414
|
const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
|
|
7366
7415
|
return redacted === null ? null : { code: redacted, map: null };
|
|
7367
7416
|
}
|
|
@@ -7393,7 +7442,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
|
7393
7442
|
];
|
|
7394
7443
|
function getFarmClientOptimizeDepsInclude(renderer) {
|
|
7395
7444
|
return Array.from(
|
|
7396
|
-
/* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess',
|
|
7445
|
+
/* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _287 => _287.optimizeDeps]) || []])
|
|
7397
7446
|
);
|
|
7398
7447
|
}
|
|
7399
7448
|
function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
@@ -7417,7 +7466,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
|
7417
7466
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
7418
7467
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
7419
7468
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
7420
|
-
..._optionalChain([entries, 'optionalAccess',
|
|
7469
|
+
..._optionalChain([entries, 'optionalAccess', _288 => _288.length]) ? { entries: [...entries] } : {}
|
|
7421
7470
|
};
|
|
7422
7471
|
}
|
|
7423
7472
|
function createFarmSourceAlias(projectRoot, srcDir = "src") {
|
|
@@ -7443,8 +7492,8 @@ function mergeAlias(farmValue, userValue) {
|
|
|
7443
7492
|
return [...normalize(userValue), ...normalize(farmValue)];
|
|
7444
7493
|
}
|
|
7445
7494
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
7446
|
-
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
7447
|
-
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
7495
|
+
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _289 => _289.optimizeDeps, 'optionalAccess', _290 => _290.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _291 => _291.optimizeDeps, 'optionalAccess', _292 => _292.noDiscovery])));
|
|
7496
|
+
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _293 => _293.optimizeDeps, 'optionalAccess', _294 => _294.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _295 => _295.optimizeDeps, 'optionalAccess', _296 => _296.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _297 => _297.optimizeDeps, 'optionalAccess', _298 => _298.holdUntilCrawlEnd]))));
|
|
7448
7497
|
return {
|
|
7449
7498
|
...farmConfig,
|
|
7450
7499
|
...userConfig,
|
|
@@ -7456,9 +7505,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
7456
7505
|
resolve: {
|
|
7457
7506
|
...farmConfig.resolve,
|
|
7458
7507
|
...userConfig.resolve,
|
|
7459
|
-
alias: mergeAlias(_optionalChain([farmConfig, 'access',
|
|
7508
|
+
alias: mergeAlias(_optionalChain([farmConfig, 'access', _299 => _299.resolve, 'optionalAccess', _300 => _300.alias]), _optionalChain([userConfig, 'access', _301 => _301.resolve, 'optionalAccess', _302 => _302.alias])),
|
|
7460
7509
|
dedupe: Array.from(
|
|
7461
|
-
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access',
|
|
7510
|
+
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _303 => _303.resolve, 'optionalAccess', _304 => _304.dedupe]) || [], ..._optionalChain([userConfig, 'access', _305 => _305.resolve, 'optionalAccess', _306 => _306.dedupe]) || []])
|
|
7462
7511
|
)
|
|
7463
7512
|
},
|
|
7464
7513
|
optimizeDeps: {
|
|
@@ -7468,21 +7517,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
7468
7517
|
holdUntilCrawlEnd,
|
|
7469
7518
|
include: Array.from(
|
|
7470
7519
|
/* @__PURE__ */ new Set([
|
|
7471
|
-
..._optionalChain([farmConfig, 'access',
|
|
7472
|
-
..._optionalChain([userConfig, 'access',
|
|
7520
|
+
..._optionalChain([farmConfig, 'access', _307 => _307.optimizeDeps, 'optionalAccess', _308 => _308.include]) || [],
|
|
7521
|
+
..._optionalChain([userConfig, 'access', _309 => _309.optimizeDeps, 'optionalAccess', _310 => _310.include]) || []
|
|
7473
7522
|
])
|
|
7474
7523
|
),
|
|
7475
7524
|
exclude: Array.from(
|
|
7476
7525
|
/* @__PURE__ */ new Set([
|
|
7477
|
-
..._optionalChain([farmConfig, 'access',
|
|
7478
|
-
..._optionalChain([userConfig, 'access',
|
|
7526
|
+
..._optionalChain([farmConfig, 'access', _311 => _311.optimizeDeps, 'optionalAccess', _312 => _312.exclude]) || [],
|
|
7527
|
+
..._optionalChain([userConfig, 'access', _313 => _313.optimizeDeps, 'optionalAccess', _314 => _314.exclude]) || []
|
|
7479
7528
|
])
|
|
7480
7529
|
)
|
|
7481
7530
|
},
|
|
7482
7531
|
ssr: {
|
|
7483
7532
|
...farmConfig.ssr,
|
|
7484
7533
|
...userConfig.ssr,
|
|
7485
|
-
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access',
|
|
7534
|
+
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _315 => _315.ssr, 'optionalAccess', _316 => _316.noExternal]), _optionalChain([userConfig, 'access', _317 => _317.ssr, 'optionalAccess', _318 => _318.noExternal]))
|
|
7486
7535
|
}
|
|
7487
7536
|
};
|
|
7488
7537
|
}
|
|
@@ -7534,7 +7583,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
|
|
|
7534
7583
|
...farmConfig.build,
|
|
7535
7584
|
rollupOptions: {
|
|
7536
7585
|
...userBundlerOptions,
|
|
7537
|
-
..._optionalChain([farmConfig, 'access',
|
|
7586
|
+
..._optionalChain([farmConfig, 'access', _319 => _319.build, 'optionalAccess', _320 => _320.rollupOptions])
|
|
7538
7587
|
}
|
|
7539
7588
|
},
|
|
7540
7589
|
css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
|
|
@@ -7542,7 +7591,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
|
|
|
7542
7591
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
7543
7592
|
ssr: {
|
|
7544
7593
|
...merged.ssr,
|
|
7545
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
7594
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _321 => _321.ssr, 'optionalAccess', _322 => _322.external]), _optionalChain([userConfig, 'access', _323 => _323.ssr, 'optionalAccess', _324 => _324.external]))
|
|
7546
7595
|
}
|
|
7547
7596
|
};
|
|
7548
7597
|
}
|
|
@@ -7611,4 +7660,5 @@ ${FARM_DARK_VARIANT}
|
|
|
7611
7660
|
|
|
7612
7661
|
|
|
7613
7662
|
|
|
7614
|
-
|
|
7663
|
+
|
|
7664
|
+
exports.inspectStaticMetadataImage = inspectStaticMetadataImage; exports.RouteManager = RouteManager; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_SCRIPT_SOURCE = FARM_NAVIGATION_SCRIPT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.FARM_REFRESH_FIELDS_SOURCE = FARM_REFRESH_FIELDS_SOURCE; exports.exactIdPattern = exactIdPattern; exports.fileNamePattern = fileNamePattern; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;
|