@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,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
hasFarmServerRuntimePlugins
|
|
3
|
-
} from "./chunk-QYNZ3CTI.mjs";
|
|
4
1
|
import {
|
|
5
2
|
FARM_MOBILE_CLIENT_ENTRY_NAME,
|
|
6
3
|
FARM_MOBILE_SHELL_CLIENT_PLACEHOLDER,
|
|
@@ -29,7 +26,7 @@ import {
|
|
|
29
26
|
import {
|
|
30
27
|
collectFarmNativeServerFns,
|
|
31
28
|
findFarmNativeScreenFiles
|
|
32
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-HAXFV2CD.mjs";
|
|
33
30
|
import {
|
|
34
31
|
generateNativeMCPPluginSource
|
|
35
32
|
} from "./chunk-KQH2COEJ.mjs";
|
|
@@ -42,8 +39,9 @@ import {
|
|
|
42
39
|
createFarmDocsAPIHandler,
|
|
43
40
|
farmDocsAdapterServesGuardedPages,
|
|
44
41
|
hasFarmDocsRuntimeAdapter,
|
|
45
|
-
listFarmDocsAdapterPages
|
|
46
|
-
|
|
42
|
+
listFarmDocsAdapterPages,
|
|
43
|
+
listFarmDocsPagePaths
|
|
44
|
+
} from "./chunk-JFVT5ZZV.mjs";
|
|
47
45
|
import {
|
|
48
46
|
FARM_DOCS_LAST_MODIFIED_MANIFEST,
|
|
49
47
|
createFarmDocsHandler,
|
|
@@ -56,7 +54,7 @@ import {
|
|
|
56
54
|
loadFarmDocsPage,
|
|
57
55
|
resolveFarmDocsContentDir,
|
|
58
56
|
toFarmDocsMarkdownPage
|
|
59
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-LXEJNWF5.mjs";
|
|
60
58
|
import {
|
|
61
59
|
generateFarmDocsSearchClientRuntime,
|
|
62
60
|
isFarmDocsSearchEnabled,
|
|
@@ -64,10 +62,10 @@ import {
|
|
|
64
62
|
} from "./chunk-ALEUMLJN.mjs";
|
|
65
63
|
import {
|
|
66
64
|
CDN_CACHE_CONTROL_HEADERS
|
|
67
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-OAEDVXVE.mjs";
|
|
68
66
|
import {
|
|
69
67
|
FARM_PRERENDER_ENV
|
|
70
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-3EXCZJEN.mjs";
|
|
71
69
|
import {
|
|
72
70
|
loadFarmDocsEngine
|
|
73
71
|
} from "./chunk-VE3FWJBO.mjs";
|
|
@@ -76,7 +74,7 @@ import {
|
|
|
76
74
|
getDeployTargetForPreset,
|
|
77
75
|
hasCustomFarmRouteContext,
|
|
78
76
|
resolveDeployOutputPath
|
|
79
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-3WS5AZ3R.mjs";
|
|
80
78
|
import {
|
|
81
79
|
resolveFarmInstrumentationFile
|
|
82
80
|
} from "./chunk-57QAQU4F.mjs";
|
|
@@ -112,19 +110,20 @@ import {
|
|
|
112
110
|
resolveFarmImageServerRuntime,
|
|
113
111
|
resolveFarmNotFoundComponentPath,
|
|
114
112
|
resolveFarmRouteRootStrategy
|
|
115
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-RMOU3PR4.mjs";
|
|
116
114
|
import {
|
|
117
115
|
generateFarmClientPluginEntryCode,
|
|
116
|
+
hasFarmServerRuntimePlugins,
|
|
118
117
|
loadTailwindVitePlugin
|
|
119
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-I4KPA2C6.mjs";
|
|
120
119
|
import {
|
|
121
120
|
PluginManager
|
|
122
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-PJQ5W356.mjs";
|
|
123
122
|
import {
|
|
124
123
|
generateFarmTypeArtifacts,
|
|
125
124
|
readRouteRenderingDirectiveFromFile,
|
|
126
125
|
resolveRouteRenderingConfigFromFile
|
|
127
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-5IJRJWJS.mjs";
|
|
128
127
|
import {
|
|
129
128
|
HOISTED_HEAD_ELEMENT,
|
|
130
129
|
appMiddlewareMayHandlePath,
|
|
@@ -137,7 +136,7 @@ import {
|
|
|
137
136
|
layoutsCanCoverSamePage,
|
|
138
137
|
routeBoundaryCoversDirectory,
|
|
139
138
|
stripRouteGroups
|
|
140
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-NA77GEIU.mjs";
|
|
141
140
|
import {
|
|
142
141
|
FARM_NATIVE_TREE_CONTENT_TYPE
|
|
143
142
|
} from "./chunk-LLZSYFOM.mjs";
|
|
@@ -151,15 +150,15 @@ import {
|
|
|
151
150
|
listFarmBuiltInRoutePaths,
|
|
152
151
|
resolveFarmApiCatalogInput,
|
|
153
152
|
resolveFarmAppManifestInput
|
|
154
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-A2TH5MKE.mjs";
|
|
155
154
|
import {
|
|
156
155
|
FARM_DEFAULT_MCP_PATH,
|
|
157
156
|
createFarmDefaultMCPServer,
|
|
158
157
|
farmConfigMountsMCP
|
|
159
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-75E5FDX2.mjs";
|
|
160
159
|
import {
|
|
161
160
|
isFarmPreviewDeploymentEnvironment
|
|
162
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-QZHTDVH4.mjs";
|
|
163
162
|
import {
|
|
164
163
|
FARM_NATIVE_SERVER_FN_PLUGIN
|
|
165
164
|
} from "./chunk-L4RTTTVE.mjs";
|
|
@@ -177,7 +176,7 @@ import {
|
|
|
177
176
|
usePackageClientBoundaryCacheFile,
|
|
178
177
|
usesFarmServerTree,
|
|
179
178
|
withPackageClientBoundaryCache
|
|
180
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-JRF2SKCD.mjs";
|
|
181
180
|
import {
|
|
182
181
|
generateFarmDocsAdapterClientRuntime,
|
|
183
182
|
getFarmDocsAdapterConfigModule
|
|
@@ -224,14 +223,14 @@ import {
|
|
|
224
223
|
} from "./chunk-N33DLJBC.mjs";
|
|
225
224
|
import {
|
|
226
225
|
isFarmMarkdownPageFile
|
|
227
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-R7254L3R.mjs";
|
|
228
227
|
import {
|
|
229
228
|
resolveFarmMdxComponentsModulePath,
|
|
230
229
|
resolveMdxConfig
|
|
231
230
|
} from "./chunk-UIJOLBUL.mjs";
|
|
232
231
|
import {
|
|
233
232
|
getFarmMarkdownAlternatePath
|
|
234
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-KPJYBSHL.mjs";
|
|
235
234
|
import {
|
|
236
235
|
withPlainDiagnostics
|
|
237
236
|
} from "./chunk-MGKWYPE3.mjs";
|
|
@@ -242,7 +241,7 @@ import {
|
|
|
242
241
|
import {
|
|
243
242
|
getFarmIntegrationPluginServerRuntime,
|
|
244
243
|
getIntegrationProviders
|
|
245
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-WW3LRNQV.mjs";
|
|
246
245
|
import {
|
|
247
246
|
FARM_INTEGRATION_API_BASE_PATH_KEY
|
|
248
247
|
} from "./chunk-M53MIIXY.mjs";
|
|
@@ -256,7 +255,7 @@ import {
|
|
|
256
255
|
} from "./chunk-MMK4MZUN.mjs";
|
|
257
256
|
import {
|
|
258
257
|
APIRouteManager
|
|
259
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-E77IA5IF.mjs";
|
|
260
259
|
import {
|
|
261
260
|
readFarmI18nCatalogs
|
|
262
261
|
} from "./chunk-DU4VHHPJ.mjs";
|
|
@@ -283,14 +282,14 @@ import {
|
|
|
283
282
|
} from "./chunk-2I6PUKWJ.mjs";
|
|
284
283
|
import {
|
|
285
284
|
FARM_VERSION
|
|
286
|
-
} from "./chunk-
|
|
285
|
+
} from "./chunk-NYF7A4UW.mjs";
|
|
287
286
|
import {
|
|
288
287
|
normalizeFarmTrailingSlashPathname
|
|
289
|
-
} from "./chunk-
|
|
288
|
+
} from "./chunk-4O26BPUY.mjs";
|
|
290
289
|
import {
|
|
291
290
|
getFarmPresetRuntime,
|
|
292
291
|
resolveCloudflareProcessEnvFlags
|
|
293
|
-
} from "./chunk-
|
|
292
|
+
} from "./chunk-IWJONXPF.mjs";
|
|
294
293
|
import {
|
|
295
294
|
_runWithFarmCspNonce
|
|
296
295
|
} from "./chunk-5OFNUETM.mjs";
|
|
@@ -965,13 +964,14 @@ function createFarmVercelImmutableAssetRoute() {
|
|
|
965
964
|
};
|
|
966
965
|
}
|
|
967
966
|
function buildFarmVercelRoutes(options) {
|
|
968
|
-
const { presetRoutes, runtimeRoutes, middlewareRoutes = [] } = options;
|
|
967
|
+
const { presetRoutes, runtimeRoutes, middlewareRoutes = [], canonicalSlashRoutes = [] } = options;
|
|
969
968
|
const filesystemIndex = presetRoutes.findIndex((route) => route.handle === "filesystem");
|
|
970
969
|
const sourceRoutes = filesystemIndex >= 0 ? presetRoutes.slice(0, filesystemIndex) : [];
|
|
971
970
|
const preservedSourceRoutes = sourceRoutes.filter((route) => route.continue !== true);
|
|
972
971
|
return [
|
|
973
972
|
...preservedSourceRoutes,
|
|
974
973
|
...middlewareRoutes,
|
|
974
|
+
...canonicalSlashRoutes,
|
|
975
975
|
createFarmVercelImmutableAssetRoute(),
|
|
976
976
|
{ handle: "filesystem" },
|
|
977
977
|
...runtimeRoutes,
|
|
@@ -981,6 +981,18 @@ function buildFarmVercelRoutes(options) {
|
|
|
981
981
|
}
|
|
982
982
|
];
|
|
983
983
|
}
|
|
984
|
+
function escapeRegExp2(value) {
|
|
985
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
986
|
+
}
|
|
987
|
+
function createFarmVercelCanonicalSlashRoutes(publicPaths) {
|
|
988
|
+
const otherSpellings = [
|
|
989
|
+
...new Set(
|
|
990
|
+
publicPaths.filter((pathname) => pathname !== "/").map((pathname) => pathname.endsWith("/") ? pathname.replace(/\/+$/, "") : `${pathname}/`).filter((pathname) => pathname !== "")
|
|
991
|
+
)
|
|
992
|
+
];
|
|
993
|
+
if (otherSpellings.length === 0) return [];
|
|
994
|
+
return [{ src: `^(?:${otherSpellings.map(escapeRegExp2).join("|")})$`, dest: "/__nitro" }];
|
|
995
|
+
}
|
|
984
996
|
|
|
985
997
|
// src/nitro/ssr-public-assets.ts
|
|
986
998
|
import path7 from "path";
|
|
@@ -1125,10 +1137,19 @@ const CREDENTIAL_VARY = /(?:^|,)\\s*(?:\\*|cookie|authorization)\\s*(?:,|$)/i;
|
|
|
1125
1137
|
// What Nitro's entry sets when the response has no Cache-Control of its own.
|
|
1126
1138
|
const NITRO_DEFAULT_CACHE_CONTROL = "public, max-age=0, must-revalidate";
|
|
1127
1139
|
|
|
1140
|
+
// The deployment cookie names a release, not a visitor (see @farm.js/core/deployment).
|
|
1141
|
+
function hasVisitorCookies(cookieHeader) {
|
|
1142
|
+
if (!cookieHeader) return false;
|
|
1143
|
+
return cookieHeader.split(";").some((part) => {
|
|
1144
|
+
const name = part.split("=")[0].trim();
|
|
1145
|
+
return name !== "" && name !== "__farm_deployment";
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1128
1149
|
function isSharedCacheable(request, response) {
|
|
1129
1150
|
return (
|
|
1130
1151
|
response.status === 200 &&
|
|
1131
|
-
!request.headers.
|
|
1152
|
+
!hasVisitorCookies(request.headers.get("cookie")) &&
|
|
1132
1153
|
!request.headers.has("authorization") &&
|
|
1133
1154
|
!response.headers.has("set-cookie") &&
|
|
1134
1155
|
!PRIVATE_CACHE_DIRECTIVE.test(response.headers.get("cache-control") || "") &&
|
|
@@ -1373,7 +1394,7 @@ function farmTargetRunsEdgeMiddleware(preset) {
|
|
|
1373
1394
|
function isFarmEdgeMiddlewareRoute(route) {
|
|
1374
1395
|
return typeof route.config === "object" && route.config?.runtime === "edge";
|
|
1375
1396
|
}
|
|
1376
|
-
function
|
|
1397
|
+
function escapeRegExp3(value) {
|
|
1377
1398
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1378
1399
|
}
|
|
1379
1400
|
function toFarmVercelEdgeGuardedUrls(pathnames, basePath) {
|
|
@@ -1385,7 +1406,7 @@ function createFarmVercelEdgeMiddlewareRoute(pathnames, basePath = "/") {
|
|
|
1385
1406
|
const publicPaths = toFarmVercelEdgeGuardedUrls(pathnames, basePath);
|
|
1386
1407
|
const alternatives = publicPaths.map((pathname) => {
|
|
1387
1408
|
const trimmed = pathname.replace(/\/+$/, "");
|
|
1388
|
-
return trimmed ? `${
|
|
1409
|
+
return trimmed ? `${escapeRegExp3(trimmed)}(?:/|/index\\.html|\\.html)?` : "/(?:index\\.html)?";
|
|
1389
1410
|
});
|
|
1390
1411
|
return {
|
|
1391
1412
|
src: `^(?:${alternatives.join("|")})$`,
|
|
@@ -2482,13 +2503,16 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2482
2503
|
function shouldBuildFarmMobileClient(config) {
|
|
2483
2504
|
return Boolean(config.mobileClient) && !config.desktop;
|
|
2484
2505
|
}
|
|
2485
|
-
function
|
|
2506
|
+
function varyFarmNitroCacheRules(rules, headerNames) {
|
|
2507
|
+
if (headerNames.length === 0) return rules;
|
|
2486
2508
|
return Object.fromEntries(
|
|
2487
2509
|
Object.entries(rules).map(([source, rule]) => {
|
|
2488
2510
|
const cached = rule?.swr !== void 0 && rule.swr !== false || rule?.cache !== void 0 && rule.cache !== false;
|
|
2489
2511
|
if (!cached || rule.cache === false) return [source, rule];
|
|
2490
2512
|
const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
|
|
2491
|
-
const varies = [
|
|
2513
|
+
const varies = [
|
|
2514
|
+
.../* @__PURE__ */ new Set([...Array.isArray(cache.varies) ? cache.varies : [], ...headerNames])
|
|
2515
|
+
];
|
|
2492
2516
|
return [source, { ...rule, cache: { ...cache, varies } }];
|
|
2493
2517
|
})
|
|
2494
2518
|
);
|
|
@@ -2598,7 +2622,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2598
2622
|
if (!mobile) await removeFarmMobileClientManifest(path12.dirname(outputDir));
|
|
2599
2623
|
const viteBuild = productionVite.build;
|
|
2600
2624
|
const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.mjs");
|
|
2601
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
2625
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-VEBRN7A3.mjs");
|
|
2602
2626
|
const fs4 = await import("fs/promises");
|
|
2603
2627
|
const pluginManager = new PluginManager2({
|
|
2604
2628
|
config,
|
|
@@ -6000,7 +6024,7 @@ void hydrate();
|
|
|
6000
6024
|
async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
|
|
6001
6025
|
const viteBuild = productionVite.build;
|
|
6002
6026
|
const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.mjs");
|
|
6003
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
6027
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-VEBRN7A3.mjs");
|
|
6004
6028
|
const fs4 = await import("fs/promises");
|
|
6005
6029
|
const pluginManager = new PluginManager2({
|
|
6006
6030
|
config,
|
|
@@ -6196,6 +6220,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6196
6220
|
if (farmDocsPrecompiledManifest && farmDocsCspNonceMarker) {
|
|
6197
6221
|
farmDocsPrecompiledManifest.cspNonceMarker = farmDocsCspNonceMarker;
|
|
6198
6222
|
}
|
|
6223
|
+
const farmDocsAnalyticsPages = await listFarmDocsAnalyticsPages(config, root, preset);
|
|
6199
6224
|
const virtualEntryCode = generateVirtualEntryCode(
|
|
6200
6225
|
apiRoutes,
|
|
6201
6226
|
pageRoutes,
|
|
@@ -6222,7 +6247,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6222
6247
|
i18nCatalogs,
|
|
6223
6248
|
isolatedClientBoundaryModules,
|
|
6224
6249
|
hydrationPlanCache,
|
|
6225
|
-
mobileShellLoadingRoutes
|
|
6250
|
+
mobileShellLoadingRoutes,
|
|
6251
|
+
farmDocsAnalyticsPages
|
|
6226
6252
|
);
|
|
6227
6253
|
const virtualEntryId = "\0virtual:farm-ssr-entry";
|
|
6228
6254
|
const useExternalMetadataImageRuntime = shouldUseExternalMetadataImageRuntime(preset, true);
|
|
@@ -6860,7 +6886,7 @@ if (typeof ReactDOMServer.configureApp !== "function") {
|
|
|
6860
6886
|
}
|
|
6861
6887
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
6862
6888
|
}
|
|
6863
|
-
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = []) {
|
|
6889
|
+
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
|
|
6864
6890
|
const farmRendererDisabled = isFarmRendererDisabled(config.renderer);
|
|
6865
6891
|
const farmIslandsMode = resolveFarmServerComponentsMode(config.experimental?.serverComponents) === "islands";
|
|
6866
6892
|
const farmClientBoot = canBootFarmIslandsClient(config);
|
|
@@ -7291,6 +7317,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7291
7317
|
createFarmProductionLifecycle,
|
|
7292
7318
|
createFarmNodeRequestAbortSignal,
|
|
7293
7319
|
createProductionMiddlewareRunner,
|
|
7320
|
+
_hasPrivateFarmRequestHeaders,
|
|
7294
7321
|
_withFarmGuardedResponseCache,
|
|
7295
7322
|
_farmPluginsKeepResponsesPrivate,
|
|
7296
7323
|
getTheme as getFarmTheme,
|
|
@@ -7304,6 +7331,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7304
7331
|
localizeFarmHref,
|
|
7305
7332
|
manageFarmDocumentPreloads,
|
|
7306
7333
|
mergeRouteRenderingDirectiveConfig,
|
|
7334
|
+
resolveRouteSharedCacheControl,
|
|
7307
7335
|
manageFarmLinkHeaderPreloads,
|
|
7308
7336
|
mergeMetadata,
|
|
7309
7337
|
mergeModuleViewport,
|
|
@@ -7332,7 +7360,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7332
7360
|
stripFarmLocaleFromPathname,
|
|
7333
7361
|
withFarmRouteContext,
|
|
7334
7362
|
createLateNotFoundRecovery,
|
|
7335
|
-
createLateRedirectRecovery
|
|
7363
|
+
createLateRedirectRecovery,
|
|
7364
|
+
_withFarmDeploymentCookie,
|
|
7365
|
+
_withFarmResponseHeaders,
|
|
7366
|
+
createFarmDeploymentMismatchResponse,
|
|
7367
|
+
FARM_DEPLOYMENT_ID_HEADER,
|
|
7368
|
+
getFarmDeploymentMismatch,
|
|
7369
|
+
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (config.md?.enabled || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
|
|
7336
7370
|
} from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
|
|
7337
7371
|
import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
|
|
7338
7372
|
// The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
|
|
@@ -7780,7 +7814,11 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
7780
7814
|
validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
|
|
7781
7815
|
onError(error) { console.error("[Farm Image]", error); },
|
|
7782
7816
|
})`};
|
|
7783
|
-
const farmMarkdownConfig = ${JSON.stringify(config.md)}
|
|
7817
|
+
const farmMarkdownConfig = ${JSON.stringify(config.md)};${config.md?.enabled || hasMarkdownPages ? config.trailingSlash ? `
|
|
7818
|
+
// A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
|
|
7819
|
+
// ('/about/'), so the trailing-slash 308 never answers in its place.
|
|
7820
|
+
const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
|
|
7821
|
+
const toFarmMarkdownPageRequest = (request) => request;` : ""}
|
|
7784
7822
|
const farmLlmsTxtConfig = ${JSON.stringify(config.agent?.llmsTxt ?? { enabled: false, include: [], exclude: [] })};
|
|
7785
7823
|
${config.agent?.llmsTxt?.enabled ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
7786
7824
|
const farmMdxConfig = ${JSON.stringify({
|
|
@@ -7974,6 +8012,10 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
7974
8012
|
return fetch(new Request(request, { headers }), context);
|
|
7975
8013
|
}
|
|
7976
8014
|
const farmLocalAPIBasePath = ${JSON.stringify(resolveFarmAPIServerBasePath(config.api))};
|
|
8015
|
+
// Deployment skew protection (see the deployment docs): documents embed this ID, page responses
|
|
8016
|
+
// name it, and a page request from a browser holding another deployment's page is refused.
|
|
8017
|
+
const farmDeploymentId = ${JSON.stringify(config.deploymentId)};
|
|
8018
|
+
const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
|
|
7977
8019
|
// Reports a failure Farm answers itself (an API or integration route's 500) to the plugin
|
|
7978
8020
|
// runtime request.
|
|
7979
8021
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
@@ -8087,7 +8129,8 @@ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, page
|
|
|
8087
8129
|
let source = 'window.__FARM_PROPS__=' + serializedPageProps +
|
|
8088
8130
|
';window.__FARM_INTEGRATION_API_MANIFEST__=' +
|
|
8089
8131
|
serializeFarmInlineValue(integrationManifest) +
|
|
8090
|
-
';window.__FARM_ROUTE_SLOTS__=' + serializedRouteSlots +
|
|
8132
|
+
';window.__FARM_ROUTE_SLOTS__=' + serializedRouteSlots +
|
|
8133
|
+
';window.__FARM_DEPLOYMENT_ID__=' + serializeFarmInlineValue(farmDeploymentId) + ';';
|
|
8091
8134
|
if (typeof canonicalPath === "string" && canonicalPath.startsWith("/")) {
|
|
8092
8135
|
const serializedPath = serializeFarmInlineValue(canonicalPath);
|
|
8093
8136
|
source += 'if(location.pathname+location.search!==' + serializedPath + '){' +
|
|
@@ -8889,38 +8932,14 @@ function applyFarmI18nResponse(response, resolution) {
|
|
|
8889
8932
|
});
|
|
8890
8933
|
}
|
|
8891
8934
|
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
const parts = cookieHeader.split(";");
|
|
8895
|
-
if (parts.length !== 1) return false;
|
|
8896
|
-
|
|
8897
|
-
const cookie = parts[0].trim();
|
|
8898
|
-
const separator = cookie.indexOf("=");
|
|
8899
|
-
if (separator <= 0) return false;
|
|
8900
|
-
|
|
8901
|
-
let name;
|
|
8902
|
-
let value;
|
|
8903
|
-
try {
|
|
8904
|
-
name = decodeURIComponent(cookie.slice(0, separator).trim());
|
|
8905
|
-
value = decodeURIComponent(cookie.slice(separator + 1).trim());
|
|
8906
|
-
} catch {
|
|
8907
|
-
return false;
|
|
8908
|
-
}
|
|
8909
|
-
|
|
8910
|
-
return (
|
|
8911
|
-
name === farmI18nConfig.cookie.name &&
|
|
8912
|
-
farmI18nConfig.locales.includes(value)
|
|
8913
|
-
);
|
|
8914
|
-
}
|
|
8915
|
-
|
|
8935
|
+
// Credentials or a visitor's cookie; the deployment cookie, and a lone valid locale cookie when
|
|
8936
|
+
// the URL names the locale, keep shared caching. The RSC server decides with the same helper.
|
|
8916
8937
|
function hasPrivateFarmRequestHeaders(request, farmLocaleResolution) {
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
farmLocaleResolution?.source === "url" &&
|
|
8923
|
-
hasOnlyValidFarmLocaleCookie(cookieHeader)
|
|
8938
|
+
return _hasPrivateFarmRequestHeaders(
|
|
8939
|
+
request,
|
|
8940
|
+
farmI18nRuntime && farmLocaleResolution?.source === "url"
|
|
8941
|
+
? { name: farmI18nConfig.cookie.name, locales: farmI18nConfig.locales }
|
|
8942
|
+
: undefined,
|
|
8924
8943
|
);
|
|
8925
8944
|
}
|
|
8926
8945
|
|
|
@@ -9221,7 +9240,7 @@ function createFarmAgentSitemapResponse(request) {
|
|
|
9221
9240
|
metadataBase: rootLayout && rootLayout.module && rootLayout.module.metadata
|
|
9222
9241
|
? rootLayout.module.metadata.metadataBase
|
|
9223
9242
|
: undefined,
|
|
9224
|
-
basePath: ${JSON.stringify(config.basePath)},
|
|
9243
|
+
basePath: ${JSON.stringify(config.basePath)},${config.trailingSlash ? "\n trailingSlash: true," : ""}${config.i18n.enabled ? "\n i18n: farmI18nConfig," : ""}
|
|
9225
9244
|
},
|
|
9226
9245
|
),
|
|
9227
9246
|
{},
|
|
@@ -9247,18 +9266,22 @@ async function handleFarmDefaultMCP(request) {
|
|
|
9247
9266
|
return handleFarmDefaultMCPRequest(request, {
|
|
9248
9267
|
server: getFarmDefaultMCPServer(),
|
|
9249
9268
|
basePath: ${JSON.stringify(config.basePath)},
|
|
9269
|
+
i18n: farmI18nConfig,
|
|
9270
|
+
// Each page at the URL it answers at, as in development and as the sitemap lists it.
|
|
9250
9271
|
listPages: () =>
|
|
9251
9272
|
collectFarmDefaultMCPPages(
|
|
9252
9273
|
getFarmAgentListedPageRoutes().map((route) => ({ pattern: route.pattern, module: route.module })),
|
|
9253
|
-
{
|
|
9274
|
+
{
|
|
9275
|
+
origin,
|
|
9276
|
+
basePath: ${JSON.stringify(config.basePath)},
|
|
9277
|
+
markdown: farmMarkdownConfig,${config.trailingSlash ? "\n trailingSlash: true," : ""}
|
|
9278
|
+
i18n: farmI18nConfig,
|
|
9279
|
+
},
|
|
9254
9280
|
),
|
|
9255
|
-
// A fresh request through this handler, so the caller's cookies never shape a page.
|
|
9256
|
-
//
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
page.pathname = stripFarmBasePath(page.pathname);
|
|
9260
|
-
return farmDefaultMCPReadMarkdown(page.href);
|
|
9261
|
-
},
|
|
9281
|
+
// A fresh request through this handler, so the caller's cookies never shape a page. It
|
|
9282
|
+
// reads the public URL, base path included, as llms-full.txt does: this handler sees
|
|
9283
|
+
// public paths, and with i18n a mirror path without the base path answers with a redirect.
|
|
9284
|
+
readMarkdown: farmDefaultMCPReadMarkdown,
|
|
9262
9285
|
});
|
|
9263
9286
|
}
|
|
9264
9287
|
// \`fetch\` is this module's outer request entry: plugin runtime hooks run and the page
|
|
@@ -9286,7 +9309,7 @@ function createFarmLlmsTxtContext(request, full) {
|
|
|
9286
9309
|
origin,
|
|
9287
9310
|
markdown: farmMarkdownConfig,
|
|
9288
9311
|
include: farmLlmsTxtConfig.include,
|
|
9289
|
-
exclude: farmLlmsTxtConfig.exclude,
|
|
9312
|
+
exclude: farmLlmsTxtConfig.exclude,${config.trailingSlash ? "\n trailingSlash: true," : ""}${config.i18n.enabled ? "\n i18n: farmI18nConfig," : ""}
|
|
9290
9313
|
},
|
|
9291
9314
|
);
|
|
9292
9315
|
const rootLayout = layoutRoutes.find((layout) => layout.pattern === "/");
|
|
@@ -9688,7 +9711,8 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
9688
9711
|
)});
|
|
9689
9712
|
${config.docs?.enabled ? `const farmDocsRouteLabelInput = {
|
|
9690
9713
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
9691
|
-
apiPath: ${JSON.stringify(farmDocsPrecompiledManifest?.apiPath || "/api/docs")},${config.docs.roots?.length ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}
|
|
9714
|
+
apiPath: ${JSON.stringify(farmDocsPrecompiledManifest?.apiPath || "/api/docs")},${config.docs.roots?.length ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
|
|
9715
|
+
pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
|
|
9692
9716
|
};
|
|
9693
9717
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
9694
9718
|
const farmRouteLabelSlot = Symbol("farm.route.label.slot");
|
|
@@ -9875,7 +9899,7 @@ function getPPRShellBypassReason(request, middlewareData, middlewareContext) {
|
|
|
9875
9899
|
if (farmSecurityConfig.csp && farmSecurityConfig.csp.nonce) return "csp-nonce";
|
|
9876
9900
|
const method = request.method.toUpperCase();
|
|
9877
9901
|
if (method !== "GET" && method !== "HEAD") return "method";
|
|
9878
|
-
if (request.headers.get("cookie")) return "cookie";
|
|
9902
|
+
if (withoutFarmDeploymentCookie(request.headers.get("cookie"))) return "cookie";
|
|
9879
9903
|
if (request.headers.get("authorization")) return "authorization";
|
|
9880
9904
|
if (request.headers.get("x-farm-intercept-from")) return "route-interception";
|
|
9881
9905
|
if (request.headers.get("x-farm-ppr-refresh")) return "refresh";
|
|
@@ -9887,12 +9911,15 @@ function getPPRShellBypassReason(request, middlewareData, middlewareContext) {
|
|
|
9887
9911
|
|
|
9888
9912
|
// origin is set when the shell carries hreflang alternates (i18n prefix
|
|
9889
9913
|
// routing), so one host never serves a shell holding another host's URLs.
|
|
9914
|
+
// A shell embeds its deployment's ID and client assets, and a shared cache
|
|
9915
|
+
// adapter outlives a deployment, so each deployment keys its own shells.
|
|
9890
9916
|
function getPPRShellCacheKey(url, locale, origin) {
|
|
9891
9917
|
const key = [
|
|
9892
9918
|
"ppr",
|
|
9893
9919
|
locale || "",
|
|
9894
9920
|
normalizeRevalidatePath(url.pathname),
|
|
9895
9921
|
url.search,
|
|
9922
|
+
farmDeploymentId,
|
|
9896
9923
|
];
|
|
9897
9924
|
return createFarmCacheKey(origin ? key.concat(origin) : key);
|
|
9898
9925
|
}
|
|
@@ -9922,22 +9949,13 @@ function hasFarmUnserializableRouteData(data) {
|
|
|
9922
9949
|
return Boolean(data) && typeof data === "object" && Object.values(data).some(isPromise);
|
|
9923
9950
|
}
|
|
9924
9951
|
|
|
9952
|
+
// Core's policy for the route, shared with the RSC server so both send the same Cache-Control.
|
|
9925
9953
|
function getRouteSharedCacheControl(route, pprCanCache) {
|
|
9926
9954
|
if (!route || !route.module) {
|
|
9927
9955
|
return null;
|
|
9928
9956
|
}
|
|
9929
9957
|
|
|
9930
|
-
|
|
9931
|
-
if (view.dynamic === "force-dynamic") {
|
|
9932
|
-
return null;
|
|
9933
|
-
}
|
|
9934
|
-
if (!view.ssg && !pprCanCache) {
|
|
9935
|
-
return null;
|
|
9936
|
-
}
|
|
9937
|
-
|
|
9938
|
-
const revalidate =
|
|
9939
|
-
typeof view.revalidate === "number" && view.revalidate > 0 ? view.revalidate : 60;
|
|
9940
|
-
return "public, s-maxage=" + revalidate + ", stale-while-revalidate=300";
|
|
9958
|
+
return resolveRouteSharedCacheControl(resolveRouteRenderingView(route), pprCanCache);
|
|
9941
9959
|
}
|
|
9942
9960
|
|
|
9943
9961
|
async function getCachedPPRShell(cacheKey) {
|
|
@@ -10008,8 +10026,9 @@ async function handleFarmRequestInContext(
|
|
|
10008
10026
|
adapterContext,
|
|
10009
10027
|
requestUrl = new URL(request.url),
|
|
10010
10028
|
) {
|
|
10011
|
-
|
|
10012
|
-
const
|
|
10029
|
+
// deploymentPage: a page route answered, so the response names this deployment.
|
|
10030
|
+
const farmCacheGuard = { guarded: farmPluginRuntimeKeepsResponsesPrivate, deploymentPage: false };
|
|
10031
|
+
let response = await resolveFarmRequestInContext(
|
|
10013
10032
|
farmCacheGuard,
|
|
10014
10033
|
request,
|
|
10015
10034
|
farmLocaleResolution,
|
|
@@ -10018,6 +10037,11 @@ async function handleFarmRequestInContext(
|
|
|
10018
10037
|
adapterContext,
|
|
10019
10038
|
requestUrl,
|
|
10020
10039
|
);
|
|
10040
|
+
if (farmCacheGuard.deploymentPage) {
|
|
10041
|
+
response = _withFarmResponseHeaders(response, (headers) =>
|
|
10042
|
+
headers.set(FARM_DEPLOYMENT_ID_HEADER, farmDeploymentId)
|
|
10043
|
+
);
|
|
10044
|
+
}
|
|
10021
10045
|
if (!farmCacheGuard.guarded) return response;
|
|
10022
10046
|
// Tells the Nitro entry, which keeps this policy over a swr rule's public one.
|
|
10023
10047
|
adapterContext?.onGuardedResponse?.();
|
|
@@ -10261,6 +10285,14 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10261
10285
|
middlewareHeaders,
|
|
10262
10286
|
);
|
|
10263
10287
|
}
|
|
10288
|
+
// A docs page is a page document: it names this deployment, and a navigation from
|
|
10289
|
+
// another deployment's page is refused, as for an app page.
|
|
10290
|
+
const farmDocsDeploymentMismatch = getFarmDeploymentMismatch(request, farmDeploymentId);
|
|
10291
|
+
if (farmDocsDeploymentMismatch) {
|
|
10292
|
+
await docsResponse.body?.cancel();
|
|
10293
|
+
return createFarmDeploymentMismatchResponse(farmDocsDeploymentMismatch);
|
|
10294
|
+
}
|
|
10295
|
+
farmCacheGuard.deploymentPage = true;
|
|
10264
10296
|
const wrappedDocsResponse = withFarmDocsRequestCache(
|
|
10265
10297
|
await wrapFarmDocsResponseWithLayouts(request, docsResponse),
|
|
10266
10298
|
request,
|
|
@@ -10292,7 +10324,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10292
10324
|
clientAddress: adapterContext?.clientAddress,
|
|
10293
10325
|
// An anonymous visitor's request: guards never see the caller's address.
|
|
10294
10326
|
renderPage: (targetRequest) =>
|
|
10295
|
-
fetchFarmInnerRequest(targetRequest, {
|
|
10327
|
+
fetchFarmInnerRequest(toFarmMarkdownPageRequest(targetRequest), {
|
|
10296
10328
|
...adapterContext,
|
|
10297
10329
|
clientAddress: FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS,
|
|
10298
10330
|
}),
|
|
@@ -10339,7 +10371,8 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10339
10371
|
routePathname: getFarmRoutePathname,
|
|
10340
10372
|
routeExists: (targetPathname) =>
|
|
10341
10373
|
Boolean(matchPageRoute(getFarmRoutePathname(targetPathname))),
|
|
10342
|
-
renderPage: (targetRequest) =>
|
|
10374
|
+
renderPage: (targetRequest) =>
|
|
10375
|
+
fetchFarmInnerRequest(toFarmMarkdownPageRequest(targetRequest), adapterContext),
|
|
10343
10376
|
apiServerBasePath: farmLocalAPIBasePath,
|
|
10344
10377
|
});
|
|
10345
10378
|
if (markdownResponse) {
|
|
@@ -10532,6 +10565,14 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10532
10565
|
// Handle page routes (SSR)
|
|
10533
10566
|
emitFarmEvent({ type: "render.start", route: pathname, pathname });
|
|
10534
10567
|
const matchedRoute = matchPageRoute(routePathname);
|
|
10568
|
+
if (matchedRoute) {
|
|
10569
|
+
// A browser holding another deployment's page names it: a navigation fetch in its header, a
|
|
10570
|
+
// form or server action post in the deployment cookie. Refuse it before an action runs, and
|
|
10571
|
+
// before a document would refresh that cookie to this deployment.
|
|
10572
|
+
const farmDeploymentMismatch = getFarmDeploymentMismatch(request, farmDeploymentId);
|
|
10573
|
+
if (farmDeploymentMismatch) return createFarmDeploymentMismatchResponse(farmDeploymentMismatch);
|
|
10574
|
+
farmCacheGuard.deploymentPage = true;
|
|
10575
|
+
}
|
|
10535
10576
|
${farmIslandsMode ? `// Islands mode: a form or client component posting a server action to this page.
|
|
10536
10577
|
if (matchedRoute && request.method === "POST") {
|
|
10537
10578
|
const actionResponse = await _runWithMiddlewareData(middlewareData || {}, () =>
|
|
@@ -11664,6 +11705,13 @@ ${farmRendererDisabled ? `
|
|
|
11664
11705
|
{ status: 404, headers: { "Content-Type": "application/json" } }
|
|
11665
11706
|
), middlewareHeaders);
|
|
11666
11707
|
` : ""}
|
|
11708
|
+
// The not-found page is a page document: it names this deployment, and a navigation from
|
|
11709
|
+
// another deployment's page is refused, as for an app page.
|
|
11710
|
+
const farmNotFoundDeploymentMismatch = getFarmDeploymentMismatch(request, farmDeploymentId);
|
|
11711
|
+
if (farmNotFoundDeploymentMismatch) {
|
|
11712
|
+
return createFarmDeploymentMismatchResponse(farmNotFoundDeploymentMismatch);
|
|
11713
|
+
}
|
|
11714
|
+
farmCacheGuard.deploymentPage = true;
|
|
11667
11715
|
// Agents that navigate in Markdown (a \`.md\` URL or \`Accept: text/markdown\`)
|
|
11668
11716
|
// get a Markdown error body instead of the HTML not-found shell.
|
|
11669
11717
|
if (farmRequestWantsMarkdown(pathname, request.headers.get("accept"))) {
|
|
@@ -11902,9 +11950,10 @@ async function handleFarmFetch(request, context) {
|
|
|
11902
11950
|
);
|
|
11903
11951
|
|
|
11904
11952
|
// headers() config applies after middleware let the request through, so it learns
|
|
11905
|
-
// whether the response was guarded and can't make that response shareable again.
|
|
11953
|
+
// whether the response was guarded and can't make that response shareable again. A plugin
|
|
11954
|
+
// runtime hook that throws answers a new 500 out here, which learns it the same way.
|
|
11906
11955
|
let farmGuardedResponse = false;
|
|
11907
|
-
if (configuredHeaderRoutes.length > 0) {
|
|
11956
|
+
if (configuredHeaderRoutes.length > 0 || farmPluginRuntime) {
|
|
11908
11957
|
const adapterContext = context;
|
|
11909
11958
|
context = {
|
|
11910
11959
|
...adapterContext,
|
|
@@ -11937,9 +11986,15 @@ async function handleFarmFetch(request, context) {
|
|
|
11937
11986
|
const configured = applyConfiguredResponseHeaders(response, routePathname);
|
|
11938
11987
|
// Configured headers may edit the response in place, so check it either way.
|
|
11939
11988
|
const guarded = farmGuardedResponse ? _withFarmGuardedResponseCache(configured) : configured;
|
|
11989
|
+
// The deployment cookie goes on once the response's cache policy is final.
|
|
11940
11990
|
return applyFarmPreloadBudget(
|
|
11941
11991
|
applyFarmCspNonceToResponse(
|
|
11942
|
-
|
|
11992
|
+
_withFarmDeploymentCookie(
|
|
11993
|
+
runtimeRequest,
|
|
11994
|
+
applyFarmMobileShellResponse(runtimeRequest, guarded, context),
|
|
11995
|
+
farmDeploymentId,
|
|
11996
|
+
farmDeploymentCookiePath,
|
|
11997
|
+
),
|
|
11943
11998
|
farmSecurityConfig,
|
|
11944
11999
|
cspNonce,
|
|
11945
12000
|
),
|
|
@@ -11984,7 +12039,9 @@ async function handleFarmFetch(request, context) {
|
|
|
11984
12039
|
const response = await _runWithCurrentRequest(request, () =>
|
|
11985
12040
|
_runWithFarmCspNonce(cspNonce, () => _runWithAfterRequest(request, runRequest, context)),
|
|
11986
12041
|
);
|
|
11987
|
-
|
|
12042
|
+
// A Nitro cache rule stores the response and strips its Content-Encoding, so a
|
|
12043
|
+
// response it caches is sent as it is, with no Vary on an encoding it never saw.
|
|
12044
|
+
return ${hasCompressionRuntime && !hasPluginRuntime ? "context?.routeRuleCache ? response : compressFarmResponse(request, response, getFarmOwnedBufferedHtml(response), farmLazyBufferedHtml.has(response))" : "response"};
|
|
11988
12045
|
}),
|
|
11989
12046
|
{
|
|
11990
12047
|
onResponseFinished: typeof context?.onResponseFinished === "function"
|
|
@@ -12078,6 +12135,14 @@ function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
|
12078
12135
|
"cache-control": "private, no-store"
|
|
12079
12136
|
};
|
|
12080
12137
|
}
|
|
12138
|
+
function prerenderWouldChangePageUrl(pathname) {
|
|
12139
|
+
if (/%(?:23|25|2F|3F)/i.test(pathname)) return true;
|
|
12140
|
+
try {
|
|
12141
|
+
return decodeURI(pathname) !== pathname;
|
|
12142
|
+
} catch {
|
|
12143
|
+
return true;
|
|
12144
|
+
}
|
|
12145
|
+
}
|
|
12081
12146
|
function getPhysicalPrerenderBypassReason(options) {
|
|
12082
12147
|
const {
|
|
12083
12148
|
config,
|
|
@@ -12087,6 +12152,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12087
12152
|
rewriteSources,
|
|
12088
12153
|
pathname
|
|
12089
12154
|
} = options;
|
|
12155
|
+
if (prerenderWouldChangePageUrl(pathname)) return "an escaped character in its URL";
|
|
12090
12156
|
if (config.i18n.enabled) return "request-sensitive i18n";
|
|
12091
12157
|
if (redirectSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
12092
12158
|
return "redirect";
|
|
@@ -12147,6 +12213,23 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
12147
12213
|
}
|
|
12148
12214
|
return pages;
|
|
12149
12215
|
}
|
|
12216
|
+
async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
12217
|
+
if (!config.docs?.enabled || config.analytics === false || resolveFarmInstrumentationRuntime(preset) !== "nodejs") {
|
|
12218
|
+
return [];
|
|
12219
|
+
}
|
|
12220
|
+
try {
|
|
12221
|
+
return await listFarmDocsPagePaths(config.docs, {
|
|
12222
|
+
root,
|
|
12223
|
+
srcDir: config.srcDir,
|
|
12224
|
+
adapter: isReactRenderer(config.renderer) && hasFarmDocsRuntimeAdapter(config.docs)
|
|
12225
|
+
});
|
|
12226
|
+
} catch (error) {
|
|
12227
|
+
logger.warn(
|
|
12228
|
+
`Farm Infra analytics reports docs pages by the docs route, not each page's path: listing them failed (${error instanceof Error ? error.message : String(error)}).`
|
|
12229
|
+
);
|
|
12230
|
+
return [];
|
|
12231
|
+
}
|
|
12232
|
+
}
|
|
12150
12233
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
12151
12234
|
return Object.values(routeRules || {}).some((rule) => {
|
|
12152
12235
|
const swr = rule?.swr;
|
|
@@ -12468,12 +12551,19 @@ function resolveTrustedLocalOrigin(event, request) {
|
|
|
12468
12551
|
: requestURL.hostname
|
|
12469
12552
|
const isLoopback = (value) =>
|
|
12470
12553
|
value === 'localhost' || value === '::1' || /^127(?:[.][0-9]{1,3}){3}$/.test(value)
|
|
12471
|
-
|
|
12554
|
+
if (
|
|
12555
|
+
requestURL.protocol === protocol &&
|
|
12472
12556
|
requestPort === port &&
|
|
12473
12557
|
isLoopback(address) &&
|
|
12474
12558
|
isLoopback(normalizedRequestHostname)
|
|
12475
|
-
|
|
12476
|
-
|
|
12559
|
+
) {
|
|
12560
|
+
return requestURL.origin
|
|
12561
|
+
}
|
|
12562
|
+
// Any other Host is the client's to choose, so it must not decide where a local image is
|
|
12563
|
+
// fetched from: the optimizer reads local sources from this server's own socket address, as the
|
|
12564
|
+
// development server does. A TLS socket's certificate names the public host, not this address,
|
|
12565
|
+
// so there the request origin still stands in.
|
|
12566
|
+
return socket.encrypted ? undefined : origin
|
|
12477
12567
|
}
|
|
12478
12568
|
|
|
12479
12569
|
// Export the event handler for Nitro
|
|
@@ -12494,6 +12584,7 @@ ${hasNitroCacheRouteRules ? " let farmGuardedResponse = false\n" : ""} const r
|
|
|
12494
12584
|
onResponseFinished: createResponseFinishedHook(event),
|
|
12495
12585
|
trustedLocalOrigin: resolveTrustedLocalOrigin(event, request),
|
|
12496
12586
|
clientAddress: resolveFarmClientAddress(event),${hasNitroCacheRouteRules ? `
|
|
12587
|
+
routeRuleCache: Boolean(event.context?.routeRules?.cache),
|
|
12497
12588
|
onGuardedResponse: () => {
|
|
12498
12589
|
farmGuardedResponse = true
|
|
12499
12590
|
},` : ""}
|
|
@@ -12608,7 +12699,10 @@ function toFarmNodeResponse(request, response) {
|
|
|
12608
12699
|
ssrEntryFile
|
|
12609
12700
|
);
|
|
12610
12701
|
const configuredNitroRouteRules = nitroRouteRulesBelowBasePath(
|
|
12611
|
-
|
|
12702
|
+
varyFarmNitroCacheRules(routeRulesToNitroRouteRules(config.routeRules), [
|
|
12703
|
+
...config.md.enabled ? ["accept"] : [],
|
|
12704
|
+
...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : []
|
|
12705
|
+
]),
|
|
12612
12706
|
config.basePath,
|
|
12613
12707
|
resolveFarmAPIServerBasePath(config.api)
|
|
12614
12708
|
);
|
|
@@ -13004,7 +13098,8 @@ function toFarmNodeResponse(request, response) {
|
|
|
13004
13098
|
buildDir: path12.join(root, distDir),
|
|
13005
13099
|
middlewareRoutes: edgeMiddlewareRoutes,
|
|
13006
13100
|
guardedPages: edgeGuardedPrerenderRoutes
|
|
13007
|
-
}
|
|
13101
|
+
},
|
|
13102
|
+
prerenderRoutes.map(toPrerenderPublicPath)
|
|
13008
13103
|
);
|
|
13009
13104
|
}
|
|
13010
13105
|
logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
|
|
@@ -13103,7 +13198,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
13103
13198
|
await fs4.cp(src, dest, { recursive: true, force: true });
|
|
13104
13199
|
await fs4.rm(src, { recursive: true, force: true });
|
|
13105
13200
|
}
|
|
13106
|
-
async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest, cronJobs, edgeMiddleware) {
|
|
13201
|
+
async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest, cronJobs, edgeMiddleware, prerenderedPages) {
|
|
13107
13202
|
const serverDir = path12.join(outputDir, "server");
|
|
13108
13203
|
const functionsDir = path12.join(outputDir, "functions");
|
|
13109
13204
|
const nitroFuncDir = path12.join(functionsDir, "__nitro.func");
|
|
@@ -13151,7 +13246,8 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13151
13246
|
vercelConfig.routes = buildFarmVercelRoutes({
|
|
13152
13247
|
presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
|
|
13153
13248
|
runtimeRoutes,
|
|
13154
|
-
middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? [createFarmVercelEdgeMiddlewareRoute(edgeMiddleware.guardedPages, config.basePath)] : []
|
|
13249
|
+
middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? [createFarmVercelEdgeMiddlewareRoute(edgeMiddleware.guardedPages, config.basePath)] : [],
|
|
13250
|
+
canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
|
|
13155
13251
|
});
|
|
13156
13252
|
const vercelConfigWithWorkflowCrons = applyFarmWorkflowVercelCrons(
|
|
13157
13253
|
vercelConfig,
|
|
@@ -13197,7 +13293,8 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
|
|
|
13197
13293
|
await fs4.mkdir(path12.dirname(bundledContentDir), { recursive: true });
|
|
13198
13294
|
await fs4.cp(docsContentDir, bundledContentDir, {
|
|
13199
13295
|
recursive: true,
|
|
13200
|
-
force: true
|
|
13296
|
+
force: true,
|
|
13297
|
+
dereference: true
|
|
13201
13298
|
});
|
|
13202
13299
|
await fs4.writeFile(
|
|
13203
13300
|
path12.join(bundledContentDir, FARM_DOCS_LAST_MODIFIED_MANIFEST),
|
|
@@ -13782,7 +13879,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13782
13879
|
}
|
|
13783
13880
|
async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
13784
13881
|
const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.mjs");
|
|
13785
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
13882
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-VEBRN7A3.mjs");
|
|
13786
13883
|
const pluginManager = new PluginManager2({
|
|
13787
13884
|
config,
|
|
13788
13885
|
isDev: false,
|
|
@@ -13809,7 +13906,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
13809
13906
|
}
|
|
13810
13907
|
async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
13811
13908
|
const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.mjs");
|
|
13812
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
13909
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-VEBRN7A3.mjs");
|
|
13813
13910
|
const pluginManager = new PluginManager2({
|
|
13814
13911
|
config,
|
|
13815
13912
|
isDev: false,
|