@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,8 +1,5 @@
|
|
|
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; }
|
|
2
2
|
|
|
3
|
-
var _chunkHHLEYA4Bcjs = require('./chunk-HHLEYA4B.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
|
|
7
4
|
|
|
8
5
|
|
|
@@ -29,7 +26,7 @@ var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
|
|
|
29
26
|
|
|
30
27
|
|
|
31
28
|
|
|
32
|
-
var
|
|
29
|
+
var _chunkA7HCBHMCcjs = require('./chunk-A7HCBHMC.cjs');
|
|
33
30
|
|
|
34
31
|
|
|
35
32
|
var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
@@ -43,7 +40,8 @@ var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
|
|
|
43
40
|
|
|
44
41
|
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
|
|
44
|
+
var _chunkI7NUT24Zcjs = require('./chunk-I7NUT24Z.cjs');
|
|
47
45
|
|
|
48
46
|
|
|
49
47
|
|
|
@@ -56,7 +54,7 @@ var _chunkLDEXTX4Icjs = require('./chunk-LDEXTX4I.cjs');
|
|
|
56
54
|
|
|
57
55
|
|
|
58
56
|
|
|
59
|
-
var
|
|
57
|
+
var _chunkNAXKOTPPcjs = require('./chunk-NAXKOTPP.cjs');
|
|
60
58
|
|
|
61
59
|
|
|
62
60
|
|
|
@@ -64,10 +62,10 @@ var _chunkFVYBEMODcjs = require('./chunk-FVYBEMOD.cjs');
|
|
|
64
62
|
var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
|
|
65
63
|
|
|
66
64
|
|
|
67
|
-
var
|
|
65
|
+
var _chunkJWY66PIDcjs = require('./chunk-JWY66PID.cjs');
|
|
68
66
|
|
|
69
67
|
|
|
70
|
-
var
|
|
68
|
+
var _chunkBPUVDCGGcjs = require('./chunk-BPUVDCGG.cjs');
|
|
71
69
|
|
|
72
70
|
|
|
73
71
|
var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
@@ -76,7 +74,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
|
76
74
|
|
|
77
75
|
|
|
78
76
|
|
|
79
|
-
var
|
|
77
|
+
var _chunkXYVPTTUTcjs = require('./chunk-XYVPTTUT.cjs');
|
|
80
78
|
|
|
81
79
|
|
|
82
80
|
var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
|
|
@@ -112,20 +110,20 @@ var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
|
|
|
112
110
|
|
|
113
111
|
|
|
114
112
|
|
|
115
|
-
var
|
|
113
|
+
var _chunkM6U6E4F7cjs = require('./chunk-M6U6E4F7.cjs');
|
|
116
114
|
|
|
117
115
|
|
|
118
116
|
|
|
119
|
-
var _chunkJSOCDYERcjs = require('./chunk-JSOCDYER.cjs');
|
|
120
117
|
|
|
118
|
+
var _chunkDMXMIE2Ccjs = require('./chunk-DMXMIE2C.cjs');
|
|
121
119
|
|
|
122
|
-
var _chunkWUTFJOV7cjs = require('./chunk-WUTFJOV7.cjs');
|
|
123
120
|
|
|
121
|
+
var _chunkJFPKARWMcjs = require('./chunk-JFPKARWM.cjs');
|
|
124
122
|
|
|
125
123
|
|
|
126
124
|
|
|
127
|
-
var _chunkQOGIZKSOcjs = require('./chunk-QOGIZKSO.cjs');
|
|
128
125
|
|
|
126
|
+
var _chunkK7JMTAFHcjs = require('./chunk-K7JMTAFH.cjs');
|
|
129
127
|
|
|
130
128
|
|
|
131
129
|
|
|
@@ -137,7 +135,8 @@ var _chunkQOGIZKSOcjs = require('./chunk-QOGIZKSO.cjs');
|
|
|
137
135
|
|
|
138
136
|
|
|
139
137
|
|
|
140
|
-
|
|
138
|
+
|
|
139
|
+
var _chunk2MR4MABGcjs = require('./chunk-2MR4MABG.cjs');
|
|
141
140
|
|
|
142
141
|
|
|
143
142
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
@@ -151,15 +150,15 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
|
151
150
|
|
|
152
151
|
|
|
153
152
|
|
|
154
|
-
var
|
|
153
|
+
var _chunkK4UGCUXXcjs = require('./chunk-K4UGCUXX.cjs');
|
|
155
154
|
|
|
156
155
|
|
|
157
156
|
|
|
158
157
|
|
|
159
|
-
var
|
|
158
|
+
var _chunkVG6HYT5Kcjs = require('./chunk-VG6HYT5K.cjs');
|
|
160
159
|
|
|
161
160
|
|
|
162
|
-
var
|
|
161
|
+
var _chunkLECZ5DPZcjs = require('./chunk-LECZ5DPZ.cjs');
|
|
163
162
|
|
|
164
163
|
|
|
165
164
|
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
@@ -177,7 +176,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
|
177
176
|
|
|
178
177
|
|
|
179
178
|
|
|
180
|
-
var
|
|
179
|
+
var _chunkIEN2EFE5cjs = require('./chunk-IEN2EFE5.cjs');
|
|
181
180
|
|
|
182
181
|
|
|
183
182
|
|
|
@@ -224,14 +223,14 @@ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
|
|
|
224
223
|
var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
225
224
|
|
|
226
225
|
|
|
227
|
-
var
|
|
226
|
+
var _chunkNSZY3EWGcjs = require('./chunk-NSZY3EWG.cjs');
|
|
228
227
|
|
|
229
228
|
|
|
230
229
|
|
|
231
230
|
var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
232
231
|
|
|
233
232
|
|
|
234
|
-
var
|
|
233
|
+
var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
|
|
235
234
|
|
|
236
235
|
|
|
237
236
|
var _chunkASYOWPSRcjs = require('./chunk-ASYOWPSR.cjs');
|
|
@@ -242,7 +241,7 @@ var _chunkFSODPZRTcjs = require('./chunk-FSODPZRT.cjs');
|
|
|
242
241
|
|
|
243
242
|
|
|
244
243
|
|
|
245
|
-
var
|
|
244
|
+
var _chunkJX5VOLAVcjs = require('./chunk-JX5VOLAV.cjs');
|
|
246
245
|
|
|
247
246
|
|
|
248
247
|
var _chunkZOYKJBP5cjs = require('./chunk-ZOYKJBP5.cjs');
|
|
@@ -256,7 +255,7 @@ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
|
|
|
256
255
|
var _chunkMHLNWRCJcjs = require('./chunk-MHLNWRCJ.cjs');
|
|
257
256
|
|
|
258
257
|
|
|
259
|
-
var
|
|
258
|
+
var _chunkK66JILV3cjs = require('./chunk-K66JILV3.cjs');
|
|
260
259
|
|
|
261
260
|
|
|
262
261
|
var _chunkBBPDJGCUcjs = require('./chunk-BBPDJGCU.cjs');
|
|
@@ -283,14 +282,14 @@ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
|
283
282
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
284
283
|
|
|
285
284
|
|
|
286
|
-
var
|
|
285
|
+
var _chunkMZLJFNMHcjs = require('./chunk-MZLJFNMH.cjs');
|
|
287
286
|
|
|
288
287
|
|
|
289
|
-
var
|
|
288
|
+
var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
290
289
|
|
|
291
290
|
|
|
292
291
|
|
|
293
|
-
var
|
|
292
|
+
var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
|
|
294
293
|
|
|
295
294
|
|
|
296
295
|
var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
|
|
@@ -420,7 +419,7 @@ function getDocsTitle(docs) {
|
|
|
420
419
|
return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
|
|
421
420
|
}
|
|
422
421
|
function loadPages(contentDir, docs) {
|
|
423
|
-
return
|
|
422
|
+
return _chunkNAXKOTPPcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkNAXKOTPPcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
|
|
424
423
|
}
|
|
425
424
|
function findSocialImagePath(html, basePath) {
|
|
426
425
|
const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
|
|
@@ -438,7 +437,7 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
|
|
|
438
437
|
return response;
|
|
439
438
|
}
|
|
440
439
|
async function compileFarmDocsManifest(docs, options) {
|
|
441
|
-
const contentDir =
|
|
440
|
+
const contentDir = _chunkNAXKOTPPcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
|
|
442
441
|
const pages = loadPages(contentDir, docs);
|
|
443
442
|
const basePath = _chunkD22BUQKWcjs.normalizeFarmBasePath.call(void 0, options.basePath);
|
|
444
443
|
const absolutePaths = [
|
|
@@ -446,7 +445,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
446
445
|
_path2.default.resolve(contentDir),
|
|
447
446
|
docs.configPath || ""
|
|
448
447
|
];
|
|
449
|
-
const handler =
|
|
448
|
+
const handler = _chunkNAXKOTPPcjs.createFarmDocsHandler.call(void 0, docs, {
|
|
450
449
|
root: options.root,
|
|
451
450
|
srcDir: options.srcDir,
|
|
452
451
|
clientEntry: options.clientEntry,
|
|
@@ -456,7 +455,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
456
455
|
isPathGuarded: options.isPathGuarded,
|
|
457
456
|
basePath
|
|
458
457
|
});
|
|
459
|
-
const apiHandler =
|
|
458
|
+
const apiHandler = _chunkI7NUT24Zcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
460
459
|
rootDir: options.root,
|
|
461
460
|
srcDir: options.srcDir,
|
|
462
461
|
docs,
|
|
@@ -468,7 +467,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
468
467
|
const apiMarkdown = {};
|
|
469
468
|
for (const page of pages) {
|
|
470
469
|
const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
|
|
471
|
-
const markdownPath =
|
|
470
|
+
const markdownPath = _chunkNAXKOTPPcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
|
|
472
471
|
await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
|
|
473
472
|
if (htmlResponse) {
|
|
474
473
|
const socialImagePath = findSocialImagePath(await htmlResponse.text(), basePath);
|
|
@@ -553,7 +552,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
553
552
|
post: await compileResponse(postResponse, absolutePaths),
|
|
554
553
|
search: {
|
|
555
554
|
pages: publicPages.map((page) => ({
|
|
556
|
-
...
|
|
555
|
+
..._chunkNAXKOTPPcjs.toFarmDocsMarkdownPage.call(void 0, page, basePath),
|
|
557
556
|
sourcePath: `farm-docs:${page.slug || "index"}`
|
|
558
557
|
})),
|
|
559
558
|
search: _nullishCoalesce(searchConfig, () => ( true)),
|
|
@@ -731,7 +730,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
731
730
|
const routes = [];
|
|
732
731
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
733
732
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
734
|
-
const rendering = await
|
|
733
|
+
const rendering = await _chunkK7JMTAFHcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
735
734
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
736
735
|
routes.push({
|
|
737
736
|
kind: "page",
|
|
@@ -804,7 +803,7 @@ async function writeFarmRouteRuntimeManifest(directory, manifest) {
|
|
|
804
803
|
return manifestPath;
|
|
805
804
|
}
|
|
806
805
|
function validateFarmRouteRuntimeDeployment(manifest, preset) {
|
|
807
|
-
const runtime =
|
|
806
|
+
const runtime = _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset);
|
|
808
807
|
const warnings = /* @__PURE__ */ new Set();
|
|
809
808
|
for (const route of manifest.routes) {
|
|
810
809
|
if (route.rendering === "static") continue;
|
|
@@ -968,13 +967,14 @@ function createFarmVercelImmutableAssetRoute() {
|
|
|
968
967
|
};
|
|
969
968
|
}
|
|
970
969
|
function buildFarmVercelRoutes(options) {
|
|
971
|
-
const { presetRoutes, runtimeRoutes, middlewareRoutes = [] } = options;
|
|
970
|
+
const { presetRoutes, runtimeRoutes, middlewareRoutes = [], canonicalSlashRoutes = [] } = options;
|
|
972
971
|
const filesystemIndex = presetRoutes.findIndex((route) => route.handle === "filesystem");
|
|
973
972
|
const sourceRoutes = filesystemIndex >= 0 ? presetRoutes.slice(0, filesystemIndex) : [];
|
|
974
973
|
const preservedSourceRoutes = sourceRoutes.filter((route) => route.continue !== true);
|
|
975
974
|
return [
|
|
976
975
|
...preservedSourceRoutes,
|
|
977
976
|
...middlewareRoutes,
|
|
977
|
+
...canonicalSlashRoutes,
|
|
978
978
|
createFarmVercelImmutableAssetRoute(),
|
|
979
979
|
{ handle: "filesystem" },
|
|
980
980
|
...runtimeRoutes,
|
|
@@ -984,6 +984,18 @@ function buildFarmVercelRoutes(options) {
|
|
|
984
984
|
}
|
|
985
985
|
];
|
|
986
986
|
}
|
|
987
|
+
function escapeRegExp2(value) {
|
|
988
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
989
|
+
}
|
|
990
|
+
function createFarmVercelCanonicalSlashRoutes(publicPaths) {
|
|
991
|
+
const otherSpellings = [
|
|
992
|
+
...new Set(
|
|
993
|
+
publicPaths.filter((pathname) => pathname !== "/").map((pathname) => pathname.endsWith("/") ? pathname.replace(/\/+$/, "") : `${pathname}/`).filter((pathname) => pathname !== "")
|
|
994
|
+
)
|
|
995
|
+
];
|
|
996
|
+
if (otherSpellings.length === 0) return [];
|
|
997
|
+
return [{ src: `^(?:${otherSpellings.map(escapeRegExp2).join("|")})$`, dest: "/__nitro" }];
|
|
998
|
+
}
|
|
987
999
|
|
|
988
1000
|
// src/nitro/ssr-public-assets.ts
|
|
989
1001
|
|
|
@@ -1048,7 +1060,7 @@ function collectServerOnlySSRAssets(bundle) {
|
|
|
1048
1060
|
return serverOnly;
|
|
1049
1061
|
}
|
|
1050
1062
|
function canReadServerFiles(preset) {
|
|
1051
|
-
return
|
|
1063
|
+
return _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" && !preset.startsWith("cloudflare");
|
|
1052
1064
|
}
|
|
1053
1065
|
function assertServerReadSSRAssetsSupported(bundle, preset, root) {
|
|
1054
1066
|
if (canReadServerFiles(preset)) return;
|
|
@@ -1128,10 +1140,19 @@ const CREDENTIAL_VARY = /(?:^|,)\\s*(?:\\*|cookie|authorization)\\s*(?:,|$)/i;
|
|
|
1128
1140
|
// What Nitro's entry sets when the response has no Cache-Control of its own.
|
|
1129
1141
|
const NITRO_DEFAULT_CACHE_CONTROL = "public, max-age=0, must-revalidate";
|
|
1130
1142
|
|
|
1143
|
+
// The deployment cookie names a release, not a visitor (see @farm.js/core/deployment).
|
|
1144
|
+
function hasVisitorCookies(cookieHeader) {
|
|
1145
|
+
if (!cookieHeader) return false;
|
|
1146
|
+
return cookieHeader.split(";").some((part) => {
|
|
1147
|
+
const name = part.split("=")[0].trim();
|
|
1148
|
+
return name !== "" && name !== "__farm_deployment";
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1131
1152
|
function isSharedCacheable(request, response) {
|
|
1132
1153
|
return (
|
|
1133
1154
|
response.status === 200 &&
|
|
1134
|
-
!request.headers.
|
|
1155
|
+
!hasVisitorCookies(request.headers.get("cookie")) &&
|
|
1135
1156
|
!request.headers.has("authorization") &&
|
|
1136
1157
|
!response.headers.has("set-cookie") &&
|
|
1137
1158
|
!PRIVATE_CACHE_DIRECTIVE.test(response.headers.get("cache-control") || "") &&
|
|
@@ -1243,7 +1264,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1243
1264
|
// removed block used (`readFileSync` for a version, say).
|
|
1244
1265
|
enforce: "pre",
|
|
1245
1266
|
transform: {
|
|
1246
|
-
filter: { id:
|
|
1267
|
+
filter: { id: _chunkM6U6E4F7cjs.fileNamePattern.call(void 0, configFiles) },
|
|
1247
1268
|
async handler(code, id) {
|
|
1248
1269
|
const file = id.split("?", 1)[0];
|
|
1249
1270
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -1376,7 +1397,7 @@ function farmTargetRunsEdgeMiddleware(preset) {
|
|
|
1376
1397
|
function isFarmEdgeMiddlewareRoute(route) {
|
|
1377
1398
|
return typeof route.config === "object" && _optionalChain([route, 'access', _42 => _42.config, 'optionalAccess', _43 => _43.runtime]) === "edge";
|
|
1378
1399
|
}
|
|
1379
|
-
function
|
|
1400
|
+
function escapeRegExp3(value) {
|
|
1380
1401
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1381
1402
|
}
|
|
1382
1403
|
function toFarmVercelEdgeGuardedUrls(pathnames, basePath) {
|
|
@@ -1388,7 +1409,7 @@ function createFarmVercelEdgeMiddlewareRoute(pathnames, basePath = "/") {
|
|
|
1388
1409
|
const publicPaths = toFarmVercelEdgeGuardedUrls(pathnames, basePath);
|
|
1389
1410
|
const alternatives = publicPaths.map((pathname) => {
|
|
1390
1411
|
const trimmed = pathname.replace(/\/+$/, "");
|
|
1391
|
-
return trimmed ? `${
|
|
1412
|
+
return trimmed ? `${escapeRegExp3(trimmed)}(?:/|/index\\.html|\\.html)?` : "/(?:index\\.html)?";
|
|
1392
1413
|
});
|
|
1393
1414
|
return {
|
|
1394
1415
|
src: `^(?:${alternatives.join("|")})$`,
|
|
@@ -1471,7 +1492,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
1471
1492
|
logLevel: "silent",
|
|
1472
1493
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
1473
1494
|
resolve: {
|
|
1474
|
-
alias:
|
|
1495
|
+
alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
1475
1496
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
1476
1497
|
},
|
|
1477
1498
|
transform: {
|
|
@@ -1818,7 +1839,7 @@ function hasReactDomEdgeServerBuild(root) {
|
|
|
1818
1839
|
}
|
|
1819
1840
|
}
|
|
1820
1841
|
function shouldAliasReactServerToWebBuild(renderer, preset) {
|
|
1821
|
-
return _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) &&
|
|
1842
|
+
return _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
|
|
1822
1843
|
}
|
|
1823
1844
|
function isCloudflareImagePreset(preset) {
|
|
1824
1845
|
return preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module";
|
|
@@ -1860,7 +1881,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
1860
1881
|
return {
|
|
1861
1882
|
name: "farm-omitted-metadata-image-runtime",
|
|
1862
1883
|
resolveId: {
|
|
1863
|
-
filter: { id:
|
|
1884
|
+
filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
1864
1885
|
handler(source, importer) {
|
|
1865
1886
|
if (source !== "@vercel/og") return null;
|
|
1866
1887
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -1869,7 +1890,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
1869
1890
|
}
|
|
1870
1891
|
},
|
|
1871
1892
|
load: {
|
|
1872
|
-
filter: { id:
|
|
1893
|
+
filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
1873
1894
|
handler(id) {
|
|
1874
1895
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
1875
1896
|
return `
|
|
@@ -2193,7 +2214,7 @@ function hasFarmPluginRoutes(config) {
|
|
|
2193
2214
|
}
|
|
2194
2215
|
function farmServerRuntimePluginsMayHandlePath(config, pathname) {
|
|
2195
2216
|
return (config.plugins || []).some(
|
|
2196
|
-
(plugin) =>
|
|
2217
|
+
(plugin) => _chunkJX5VOLAVcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && // Mobile session tokens change only bearer requests and cookie-clearing responses, which a
|
|
2197
2218
|
// prerendered file never answers or sends; its endpoints live under /__farm/.
|
|
2198
2219
|
plugin.name !== _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
|
|
2199
2220
|
);
|
|
@@ -2241,7 +2262,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
2241
2262
|
return Array.from(routes.values()).sort(_chunkMHLNWRCJcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
|
|
2242
2263
|
}
|
|
2243
2264
|
function assertFarmDocsRuntimeSupported(config, preset) {
|
|
2244
|
-
if (!_optionalChain([config, 'access', _72 => _72.docs, 'optionalAccess', _73 => _73.enabled]) || !_optionalChain([config, 'access', _74 => _74.docs, 'access', _75 => _75.adapter, 'optionalAccess', _76 => _76.server]) ||
|
|
2265
|
+
if (!_optionalChain([config, 'access', _72 => _72.docs, 'optionalAccess', _73 => _73.enabled]) || !_optionalChain([config, 'access', _74 => _74.docs, 'access', _75 => _75.adapter, 'optionalAccess', _76 => _76.server]) || _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
|
|
2245
2266
|
return;
|
|
2246
2267
|
}
|
|
2247
2268
|
throw new Error(
|
|
@@ -2254,7 +2275,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
2254
2275
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
2255
2276
|
const srcDir = config.srcDir || "src";
|
|
2256
2277
|
const distDir = config.distDir || ".farm";
|
|
2257
|
-
const deployOutputDir =
|
|
2278
|
+
const deployOutputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
2258
2279
|
const lifecyclePluginManager = options.pluginManager;
|
|
2259
2280
|
const productionViteResultPromise = Promise.allSettled([
|
|
2260
2281
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
|
|
@@ -2273,7 +2294,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
2273
2294
|
const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
|
|
2274
2295
|
const pageRoutes = [];
|
|
2275
2296
|
for (const [pattern, entry] of routeManager.getRoutes()) {
|
|
2276
|
-
const markdownSourcePath = entry.markdownSourcePath || (
|
|
2297
|
+
const markdownSourcePath = entry.markdownSourcePath || (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
|
|
2277
2298
|
pageRoutes.push({
|
|
2278
2299
|
pattern,
|
|
2279
2300
|
...entry.directory ? { directory: entry.directory } : {},
|
|
@@ -2485,13 +2506,16 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2485
2506
|
function shouldBuildFarmMobileClient(config) {
|
|
2486
2507
|
return Boolean(config.mobileClient) && !config.desktop;
|
|
2487
2508
|
}
|
|
2488
|
-
function
|
|
2509
|
+
function varyFarmNitroCacheRules(rules, headerNames) {
|
|
2510
|
+
if (headerNames.length === 0) return rules;
|
|
2489
2511
|
return Object.fromEntries(
|
|
2490
2512
|
Object.entries(rules).map(([source, rule]) => {
|
|
2491
2513
|
const cached = _optionalChain([rule, 'optionalAccess', _79 => _79.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _80 => _80.cache]) !== void 0 && rule.cache !== false;
|
|
2492
2514
|
if (!cached || rule.cache === false) return [source, rule];
|
|
2493
2515
|
const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
|
|
2494
|
-
const varies = [
|
|
2516
|
+
const varies = [
|
|
2517
|
+
.../* @__PURE__ */ new Set([...Array.isArray(cache.varies) ? cache.varies : [], ...headerNames])
|
|
2518
|
+
];
|
|
2495
2519
|
return [source, { ...rule, cache: { ...cache, varies } }];
|
|
2496
2520
|
})
|
|
2497
2521
|
);
|
|
@@ -2539,7 +2563,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
2539
2563
|
}
|
|
2540
2564
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
2541
2565
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
2542
|
-
await fs4.writeFile(clientCssPath,
|
|
2566
|
+
await fs4.writeFile(clientCssPath, _chunkM6U6E4F7cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
2543
2567
|
}
|
|
2544
2568
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
2545
2569
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -2592,7 +2616,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2592
2616
|
const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${_path2.default.resolve(modulePath)}`;
|
|
2593
2617
|
let plan = cache.get(key);
|
|
2594
2618
|
if (!plan) {
|
|
2595
|
-
plan =
|
|
2619
|
+
plan = _chunkIEN2EFE5cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2596
2620
|
cache.set(key, plan);
|
|
2597
2621
|
}
|
|
2598
2622
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2601,7 +2625,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2601
2625
|
if (!mobile) await _chunkE5UN4OWXcjs.removeFarmMobileClientManifest.call(void 0, _path2.default.dirname(outputDir));
|
|
2602
2626
|
const viteBuild = productionVite.build;
|
|
2603
2627
|
const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
2604
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
2628
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
|
|
2605
2629
|
const fs4 = await import("fs/promises");
|
|
2606
2630
|
const pluginManager = new PluginManager2({
|
|
2607
2631
|
config,
|
|
@@ -2610,7 +2634,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2610
2634
|
});
|
|
2611
2635
|
pluginManager.addPlugins(config.plugins || []);
|
|
2612
2636
|
const clientPages = [];
|
|
2613
|
-
const integrationProviders =
|
|
2637
|
+
const integrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
|
|
2614
2638
|
(provider) => provider.component || provider.type === "clerk"
|
|
2615
2639
|
);
|
|
2616
2640
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
@@ -2621,14 +2645,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2621
2645
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2622
2646
|
);
|
|
2623
2647
|
}
|
|
2624
|
-
const isolatedMode =
|
|
2648
|
+
const isolatedMode = _chunkIEN2EFE5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2625
2649
|
_optionalChain([config, 'access', _85 => _85.experimental, 'optionalAccess', _86 => _86.isolatedClientHydration]),
|
|
2626
2650
|
{
|
|
2627
2651
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _87 => _87.experimental, 'optionalAccess', _88 => _88.serverComponents])) === "rsc",
|
|
2628
2652
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2629
2653
|
}
|
|
2630
2654
|
);
|
|
2631
|
-
const planOptions =
|
|
2655
|
+
const planOptions = _chunkIEN2EFE5cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2632
2656
|
config.renderer,
|
|
2633
2657
|
Boolean(unsupportedIntegrationProvider)
|
|
2634
2658
|
);
|
|
@@ -2685,13 +2709,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2685
2709
|
};
|
|
2686
2710
|
}
|
|
2687
2711
|
});
|
|
2688
|
-
const layoutAppliesToRoute =
|
|
2712
|
+
const layoutAppliesToRoute = _chunk2MR4MABGcjs.routeBoundaryCoversDirectory;
|
|
2689
2713
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
2690
2714
|
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverComponents])) === "islands";
|
|
2691
2715
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2692
2716
|
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _93 => _93.docs, 'optionalAccess', _94 => _94.enabled]) && _optionalChain([config, 'access', _95 => _95.docs, 'access', _96 => _96.adapter, 'optionalAccess', _97 => _97.server]) && config.docs.adapter.react
|
|
2693
2717
|
);
|
|
2694
|
-
const docsEntries = _optionalChain([config, 'access', _98 => _98.docs, 'optionalAccess', _99 => _99.enabled]) ?
|
|
2718
|
+
const docsEntries = _optionalChain([config, 'access', _98 => _98.docs, 'optionalAccess', _99 => _99.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map(
|
|
2695
2719
|
(docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
|
|
2696
2720
|
) : [];
|
|
2697
2721
|
const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
|
|
@@ -2700,7 +2724,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2700
2724
|
);
|
|
2701
2725
|
const syntheticDocsEntry = _optionalChain([config, 'access', _100 => _100.docs, 'optionalAccess', _101 => _101.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2702
2726
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2703
|
-
const markdownPagePlan =
|
|
2727
|
+
const markdownPagePlan = _chunkIEN2EFE5cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2704
2728
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2705
2729
|
root,
|
|
2706
2730
|
isolatedMode,
|
|
@@ -2708,7 +2732,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2708
2732
|
);
|
|
2709
2733
|
const routePlans = pageRoutes.map((route) => ({
|
|
2710
2734
|
route,
|
|
2711
|
-
metadata:
|
|
2735
|
+
metadata: _chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
2712
2736
|
route.modulePath,
|
|
2713
2737
|
root,
|
|
2714
2738
|
isolatedMode,
|
|
@@ -2716,7 +2740,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2716
2740
|
pagePlanOptions
|
|
2717
2741
|
)
|
|
2718
2742
|
}));
|
|
2719
|
-
|
|
2743
|
+
_chunkIEN2EFE5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2720
2744
|
clientLayouts.map((layout) => ({
|
|
2721
2745
|
pattern: layout.pattern,
|
|
2722
2746
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2725,7 +2749,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2725
2749
|
[
|
|
2726
2750
|
...routePlans.map(({ route, metadata }) => ({
|
|
2727
2751
|
pattern: routeDirectory(route),
|
|
2728
|
-
depth:
|
|
2752
|
+
depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
2729
2753
|
metadata
|
|
2730
2754
|
})),
|
|
2731
2755
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -2749,7 +2773,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2749
2773
|
for (const layout of clientLayouts) {
|
|
2750
2774
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
2751
2775
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2752
|
-
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${
|
|
2776
|
+
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunkIEN2EFE5cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2753
2777
|
}
|
|
2754
2778
|
}
|
|
2755
2779
|
if (isolatedMode === "analyze") {
|
|
@@ -2783,7 +2807,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2783
2807
|
);
|
|
2784
2808
|
if (metadata.suppressedAsyncHydration) {
|
|
2785
2809
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
2786
|
-
`\u26A0\uFE0F ${
|
|
2810
|
+
`\u26A0\uFE0F ${_chunkIEN2EFE5cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2787
2811
|
);
|
|
2788
2812
|
}
|
|
2789
2813
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -2791,7 +2815,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2791
2815
|
).flatMap(({ plan }) => plan.isolatedBoundaries);
|
|
2792
2816
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
2793
2817
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
2794
|
-
const islandStrategy =
|
|
2818
|
+
const islandStrategy = _chunkM6U6E4F7cjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
2795
2819
|
route,
|
|
2796
2820
|
metadata,
|
|
2797
2821
|
clientLayouts,
|
|
@@ -2810,7 +2834,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2810
2834
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
2811
2835
|
],
|
|
2812
2836
|
// The server renders a server tree only below a hydrating layout.
|
|
2813
|
-
...
|
|
2837
|
+
..._chunkIEN2EFE5cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2814
2838
|
});
|
|
2815
2839
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2816
2840
|
}
|
|
@@ -2847,7 +2871,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2847
2871
|
}
|
|
2848
2872
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2849
2873
|
try {
|
|
2850
|
-
const metadata =
|
|
2874
|
+
const metadata = _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
2851
2875
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
2852
2876
|
} catch (error) {
|
|
2853
2877
|
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
@@ -2870,20 +2894,20 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2870
2894
|
srcDir,
|
|
2871
2895
|
adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
2872
2896
|
adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
2873
|
-
_optionalChain([config, 'access', _102 => _102.docs, 'optionalAccess', _103 => _103.enabled]) ?
|
|
2897
|
+
_optionalChain([config, 'access', _102 => _102.docs, 'optionalAccess', _103 => _103.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
|
|
2874
2898
|
adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _104 => _104.docs, 'access', _105 => _105.adapter, 'optionalAccess', _106 => _106.react]) : void 0,
|
|
2875
2899
|
config.i18n,
|
|
2876
2900
|
config.plugins,
|
|
2877
2901
|
config.renderer,
|
|
2878
2902
|
config.publicRuntimeConfig,
|
|
2879
2903
|
config.trailingSlash,
|
|
2880
|
-
|
|
2904
|
+
_chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2881
2905
|
config.basePath,
|
|
2882
|
-
|
|
2906
|
+
_chunkM6U6E4F7cjs.generateClientCachePersistenceCode.call(void 0, _chunkM6U6E4F7cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2883
2907
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
2884
2908
|
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _107 => _107.experimental, 'optionalAccess', _108 => _108.serverComponents])) === "islands",
|
|
2885
2909
|
platform,
|
|
2886
|
-
islandsMode ?
|
|
2910
|
+
islandsMode ? _chunkIEN2EFE5cjs.collectFarmServerStylesheets.call(void 0,
|
|
2887
2911
|
[
|
|
2888
2912
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
2889
2913
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -2898,7 +2922,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2898
2922
|
await fs4.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
|
|
2899
2923
|
}
|
|
2900
2924
|
const clientInput = { [entryName]: clientEntryPath };
|
|
2901
|
-
if (platform === "web" &&
|
|
2925
|
+
if (platform === "web" && _chunkM6U6E4F7cjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
2902
2926
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
2903
2927
|
await fs4.writeFile(
|
|
2904
2928
|
clientBootPath,
|
|
@@ -2919,7 +2943,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2919
2943
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
2920
2944
|
await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
2921
2945
|
postcssSearchPath = clientEntryDir;
|
|
2922
|
-
tailwindVitePlugin = await
|
|
2946
|
+
tailwindVitePlugin = await _chunkDMXMIE2Ccjs.loadTailwindVitePlugin.call(void 0, {
|
|
2923
2947
|
builder: productionVite.builder,
|
|
2924
2948
|
announce: true
|
|
2925
2949
|
});
|
|
@@ -2970,7 +2994,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2970
2994
|
}
|
|
2971
2995
|
},
|
|
2972
2996
|
plugins: [
|
|
2973
|
-
|
|
2997
|
+
_chunkM6U6E4F7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2974
2998
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2975
2999
|
outDir: _path2.default.join(
|
|
2976
3000
|
_path2.default.dirname(outputDir),
|
|
@@ -3002,7 +3026,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3002
3026
|
...rendererVitePlugins,
|
|
3003
3027
|
...config.vite.plugins || [],
|
|
3004
3028
|
farmServerOnlyEntriesPlugin({ platform }),
|
|
3005
|
-
|
|
3029
|
+
_chunkM6U6E4F7cjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3006
3030
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3007
3031
|
),
|
|
3008
3032
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3035,7 +3059,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3035
3059
|
},
|
|
3036
3060
|
load: {
|
|
3037
3061
|
filter: {
|
|
3038
|
-
id:
|
|
3062
|
+
id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [
|
|
3039
3063
|
"\0empty-module",
|
|
3040
3064
|
"\0empty-api-route",
|
|
3041
3065
|
"\0farm-i18n-client-bridge",
|
|
@@ -3072,7 +3096,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3072
3096
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
|
|
3073
3097
|
pluginManager
|
|
3074
3098
|
),
|
|
3075
|
-
|
|
3099
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
3076
3100
|
],
|
|
3077
3101
|
mode: "production",
|
|
3078
3102
|
css: postcssSearchPath ? {
|
|
@@ -3080,7 +3104,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3080
3104
|
} : void 0,
|
|
3081
3105
|
// Ensure React is bundled for client
|
|
3082
3106
|
resolve: {
|
|
3083
|
-
alias:
|
|
3107
|
+
alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
3084
3108
|
dedupe: [...config.renderer.dedupe || []]
|
|
3085
3109
|
},
|
|
3086
3110
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -3093,7 +3117,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3093
3117
|
]
|
|
3094
3118
|
}
|
|
3095
3119
|
};
|
|
3096
|
-
await viteBuild(
|
|
3120
|
+
await viteBuild(_chunkM6U6E4F7cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
3097
3121
|
if (platform === "mobile") {
|
|
3098
3122
|
await fs4.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
3099
3123
|
if (!await _chunkE5UN4OWXcjs.hasFarmMobileClientEntry.call(void 0, _path2.default.dirname(outputDir), outputDir)) {
|
|
@@ -3193,7 +3217,7 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
3193
3217
|
return response;
|
|
3194
3218
|
}
|
|
3195
3219
|
|
|
3196
|
-
${streamNavigations ?
|
|
3220
|
+
${streamNavigations ? _chunkM6U6E4F7cjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
|
|
3197
3221
|
|
|
3198
3222
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
3199
3223
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -4150,7 +4174,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
4150
4174
|
direction: {}
|
|
4151
4175
|
}, plugins = [], renderer = _chunk67MZTLTFcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
|
|
4152
4176
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
4153
|
-
const clientPluginEntry =
|
|
4177
|
+
const clientPluginEntry = _chunkDMXMIE2Ccjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4154
4178
|
plugins,
|
|
4155
4179
|
root,
|
|
4156
4180
|
srcDir,
|
|
@@ -4162,7 +4186,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
4162
4186
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
4163
4187
|
import __farmAppSetup from ${JSON.stringify(_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appSetupPath))};
|
|
4164
4188
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
4165
|
-
const providerClientCode =
|
|
4189
|
+
const providerClientCode = _chunkM6U6E4F7cjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4166
4190
|
integrationProviders,
|
|
4167
4191
|
root,
|
|
4168
4192
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -4185,18 +4209,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
|
|
|
4185
4209
|
const layoutImportStatements = [];
|
|
4186
4210
|
const layoutRegistrations = [];
|
|
4187
4211
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
4188
|
-
const treeLayoutPatterns = islandValues ?
|
|
4212
|
+
const treeLayoutPatterns = islandValues ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
|
|
4189
4213
|
layoutRoutes.forEach((layout, index) => {
|
|
4190
4214
|
const relativePath = toImportPath(layout.modulePath);
|
|
4191
4215
|
const treeLayout = treeLayoutPatterns.has(layout.pattern);
|
|
4192
4216
|
const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
|
|
4193
|
-
(pattern) =>
|
|
4217
|
+
(pattern) => _chunk2MR4MABGcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
|
|
4194
4218
|
);
|
|
4195
4219
|
if (rendersOnClient && !treeLayout) {
|
|
4196
4220
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
4197
4221
|
}
|
|
4198
|
-
const groupScope =
|
|
4199
|
-
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(
|
|
4222
|
+
const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
4223
|
+
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
|
|
4200
4224
|
layoutRegistrations.push(
|
|
4201
4225
|
` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? treeLayout ? `getFarmTreeLayoutComponent(${JSON.stringify(layout.pattern)})` : `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)}${treeLayout ? ", serverTree: true" : ""} }`
|
|
4202
4226
|
);
|
|
@@ -4283,7 +4307,7 @@ mountFarmDocsSearch();
|
|
|
4283
4307
|
|
|
4284
4308
|
${generateUniversalRouterStateRuntime()}
|
|
4285
4309
|
|
|
4286
|
-
${
|
|
4310
|
+
${_chunkM6U6E4F7cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
4287
4311
|
|
|
4288
4312
|
// SPA Router for server-rendered pages (HTML swap)
|
|
4289
4313
|
const spaRouter = {
|
|
@@ -4719,7 +4743,7 @@ function hasHydratableLayout(pathname) {
|
|
|
4719
4743
|
});
|
|
4720
4744
|
}
|
|
4721
4745
|
|
|
4722
|
-
${
|
|
4746
|
+
${_chunkM6U6E4F7cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
4723
4747
|
// Wrap a page element with applicable layouts
|
|
4724
4748
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
4725
4749
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -4754,7 +4778,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
4754
4778
|
return React.createElement("div", props, pageElement);
|
|
4755
4779
|
}
|
|
4756
4780
|
let farmLastRouteState = null;
|
|
4757
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
4781
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkM6U6E4F7cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4758
4782
|
function farmTreeLayoutsOf(pathname) {
|
|
4759
4783
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
4760
4784
|
return layout.serverTree === true;
|
|
@@ -5318,7 +5342,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
5318
5342
|
return true;
|
|
5319
5343
|
}` : ""}
|
|
5320
5344
|
|
|
5321
|
-
${
|
|
5345
|
+
${_chunkM6U6E4F7cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5322
5346
|
|
|
5323
5347
|
function activateNavigationScripts(root) {
|
|
5324
5348
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -5421,7 +5445,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
5421
5445
|
return shell.innerHTML;
|
|
5422
5446
|
}
|
|
5423
5447
|
|
|
5424
|
-
${islandValues ?
|
|
5448
|
+
${islandValues ? _chunkM6U6E4F7cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
5425
5449
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
5426
5450
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
5427
5451
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -6003,7 +6027,7 @@ void hydrate();
|
|
|
6003
6027
|
async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
|
|
6004
6028
|
const viteBuild = productionVite.build;
|
|
6005
6029
|
const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
6006
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
6030
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
|
|
6007
6031
|
const fs4 = await import("fs/promises");
|
|
6008
6032
|
const pluginManager = new PluginManager2({
|
|
6009
6033
|
config,
|
|
@@ -6024,7 +6048,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6024
6048
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
6025
6049
|
"module.exports = { plugins: [] };\n"
|
|
6026
6050
|
);
|
|
6027
|
-
tailwindVitePlugin = await
|
|
6051
|
+
tailwindVitePlugin = await _chunkDMXMIE2Ccjs.loadTailwindVitePlugin.call(void 0, {
|
|
6028
6052
|
builder: productionVite.builder,
|
|
6029
6053
|
label: "for SSR"
|
|
6030
6054
|
});
|
|
@@ -6131,7 +6155,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6131
6155
|
}))
|
|
6132
6156
|
) : discoveredMiddlewareRoutes;
|
|
6133
6157
|
const instrumentationPath = _chunk3GNHJ3RNcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
6134
|
-
const notFoundPath =
|
|
6158
|
+
const notFoundPath = _chunkM6U6E4F7cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
6135
6159
|
if (notFoundPath) _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
6136
6160
|
layoutRoutes.sort((a, b) => {
|
|
6137
6161
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -6148,14 +6172,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6148
6172
|
const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
|
|
6149
6173
|
(integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
|
|
6150
6174
|
);
|
|
6151
|
-
const hasIntegrationProviders =
|
|
6175
|
+
const hasIntegrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations).some(
|
|
6152
6176
|
(provider) => provider.component || provider.type === "clerk"
|
|
6153
6177
|
);
|
|
6154
6178
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
6155
6179
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _118 => _118.mdx, 'optionalAccess', _119 => _119.components]));
|
|
6156
|
-
const hasMiddlewareConfig =
|
|
6157
|
-
const hasRouteContextConfig =
|
|
6158
|
-
const hasServerRuntimePlugins =
|
|
6180
|
+
const hasMiddlewareConfig = _chunk2MR4MABGcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
6181
|
+
const hasRouteContextConfig = _chunkXYVPTTUTcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
6182
|
+
const hasServerRuntimePlugins = _chunkDMXMIE2Ccjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
|
|
6159
6183
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
6160
6184
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
6161
6185
|
const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasFarmServerStorageConfig(config.storage) || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
|
|
@@ -6164,19 +6188,19 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6164
6188
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
6165
6189
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
6166
6190
|
);
|
|
6167
|
-
if (
|
|
6191
|
+
if (_chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
6168
6192
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
6169
|
-
|
|
6193
|
+
_chunkI7NUT24Zcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
6170
6194
|
config.docs,
|
|
6171
6195
|
{ root, srcDir: config.srcDir },
|
|
6172
6196
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
6173
|
-
|
|
6197
|
+
_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? "edge" : "node"
|
|
6174
6198
|
);
|
|
6175
6199
|
}
|
|
6176
6200
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
6177
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _120 => _120.docs, 'optionalAccess', _121 => _121.enabled]) &&
|
|
6201
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _120 => _120.docs, 'optionalAccess', _121 => _121.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHDPT6OYEcjs._runWithFarmCspNonce.call(void 0,
|
|
6178
6202
|
farmDocsCspNonceMarker,
|
|
6179
|
-
async () => _optionalChain([config, 'access', _122 => _122.docs, 'access', _123 => _123.adapter, 'optionalAccess', _124 => _124.server]) ? await
|
|
6203
|
+
async () => _optionalChain([config, 'access', _122 => _122.docs, 'access', _123 => _123.adapter, 'optionalAccess', _124 => _124.server]) ? await _chunkI7NUT24Zcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
6180
6204
|
root,
|
|
6181
6205
|
srcDir: config.srcDir,
|
|
6182
6206
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -6199,6 +6223,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6199
6223
|
if (farmDocsPrecompiledManifest && farmDocsCspNonceMarker) {
|
|
6200
6224
|
farmDocsPrecompiledManifest.cspNonceMarker = farmDocsCspNonceMarker;
|
|
6201
6225
|
}
|
|
6226
|
+
const farmDocsAnalyticsPages = await listFarmDocsAnalyticsPages(config, root, preset);
|
|
6202
6227
|
const virtualEntryCode = generateVirtualEntryCode(
|
|
6203
6228
|
apiRoutes,
|
|
6204
6229
|
pageRoutes,
|
|
@@ -6225,7 +6250,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6225
6250
|
i18nCatalogs,
|
|
6226
6251
|
isolatedClientBoundaryModules,
|
|
6227
6252
|
hydrationPlanCache,
|
|
6228
|
-
mobileShellLoadingRoutes
|
|
6253
|
+
mobileShellLoadingRoutes,
|
|
6254
|
+
farmDocsAnalyticsPages
|
|
6229
6255
|
);
|
|
6230
6256
|
const virtualEntryId = "\0virtual:farm-ssr-entry";
|
|
6231
6257
|
const useExternalMetadataImageRuntime = shouldUseExternalMetadataImageRuntime(preset, true);
|
|
@@ -6341,7 +6367,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6341
6367
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _130 => _130.env, 'optionalAccess', _131 => _131.public]) || {})
|
|
6342
6368
|
},
|
|
6343
6369
|
plugins: [
|
|
6344
|
-
|
|
6370
|
+
_chunkM6U6E4F7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6345
6371
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
6346
6372
|
...rendererVitePlugins,
|
|
6347
6373
|
...config.vite.plugins || [],
|
|
@@ -6364,7 +6390,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6364
6390
|
{ ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
|
|
6365
6391
|
farmServerOnlyEntriesPlugin(),
|
|
6366
6392
|
farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
|
|
6367
|
-
|
|
6393
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
6368
6394
|
...hasRuntimeConfigModule ? [
|
|
6369
6395
|
farmStripPlatformConfigPlugin(
|
|
6370
6396
|
[
|
|
@@ -6376,7 +6402,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6376
6402
|
{
|
|
6377
6403
|
name: "farm-virtual-ssr-entry",
|
|
6378
6404
|
resolveId: {
|
|
6379
|
-
filter: { id:
|
|
6405
|
+
filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
6380
6406
|
handler(id) {
|
|
6381
6407
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
6382
6408
|
return virtualEntryId;
|
|
@@ -6385,7 +6411,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6385
6411
|
}
|
|
6386
6412
|
},
|
|
6387
6413
|
load: {
|
|
6388
|
-
filter: { id:
|
|
6414
|
+
filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
6389
6415
|
handler(id) {
|
|
6390
6416
|
if (id === virtualEntryId) {
|
|
6391
6417
|
return virtualEntryCode;
|
|
@@ -6417,7 +6443,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6417
6443
|
resolve: {
|
|
6418
6444
|
alias: [
|
|
6419
6445
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
6420
|
-
...Object.entries(
|
|
6446
|
+
...Object.entries(_chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
6421
6447
|
([find, replacement]) => ({ find, replacement })
|
|
6422
6448
|
)
|
|
6423
6449
|
],
|
|
@@ -6425,7 +6451,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6425
6451
|
dedupe: [...config.renderer.dedupe || []]
|
|
6426
6452
|
}
|
|
6427
6453
|
};
|
|
6428
|
-
await viteBuild(
|
|
6454
|
+
await viteBuild(_chunkM6U6E4F7cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
6429
6455
|
} finally {
|
|
6430
6456
|
if (postcssConfigDir) {
|
|
6431
6457
|
try {
|
|
@@ -6467,9 +6493,9 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
6467
6493
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
6468
6494
|
middlewareRoutes
|
|
6469
6495
|
};
|
|
6470
|
-
return
|
|
6471
|
-
(docsRoot) =>
|
|
6472
|
-
).flatMap((page) => [page.href,
|
|
6496
|
+
return _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
|
|
6497
|
+
(docsRoot) => _chunkNAXKOTPPcjs.discoverFarmDocsPages.call(void 0, _chunkNAXKOTPPcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
|
|
6498
|
+
).flatMap((page) => [page.href, _chunkNAXKOTPPcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
6473
6499
|
}
|
|
6474
6500
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
6475
6501
|
const llmsTxt = _optionalChain([agent, 'optionalAccess', _134 => _134.llmsTxt]);
|
|
@@ -6863,10 +6889,10 @@ if (typeof ReactDOMServer.configureApp !== "function") {
|
|
|
6863
6889
|
}
|
|
6864
6890
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
6865
6891
|
}
|
|
6866
|
-
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 = []) {
|
|
6892
|
+
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 = []) {
|
|
6867
6893
|
const farmRendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
6868
6894
|
const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _148 => _148.experimental, 'optionalAccess', _149 => _149.serverComponents])) === "islands";
|
|
6869
|
-
const farmClientBoot =
|
|
6895
|
+
const farmClientBoot = _chunkM6U6E4F7cjs.canBootFarmIslandsClient.call(void 0, config);
|
|
6870
6896
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
6871
6897
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
6872
6898
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
@@ -6876,7 +6902,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
6876
6902
|
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _153 => _153.agent, 'optionalAccess', _154 => _154.sitemap, 'optionalAccess', _155 => _155.enabled])) && !applicationMetadataRoutes.some(
|
|
6877
6903
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
6878
6904
|
);
|
|
6879
|
-
const servesDefaultMCP = _optionalChain([config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.mcp]) === true && !
|
|
6905
|
+
const servesDefaultMCP = _optionalChain([config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.mcp]) === true && !_chunkVG6HYT5Kcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
|
|
6880
6906
|
const servesAiCatalog = _optionalChain([config, 'access', _158 => _158.agent, 'optionalAccess', _159 => _159.aiCatalog]) !== false;
|
|
6881
6907
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
6882
6908
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
@@ -6894,7 +6920,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
6894
6920
|
const hasIsolatedClientGraphRuntime = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
6895
6921
|
const rendererStreamingCapabilities = _chunk67MZTLTFcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
|
|
6896
6922
|
config.renderer,
|
|
6897
|
-
|
|
6923
|
+
_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset)
|
|
6898
6924
|
);
|
|
6899
6925
|
const hasReactSyncRender = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer);
|
|
6900
6926
|
const rendererServerImports = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
|
|
@@ -6934,9 +6960,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6934
6960
|
(image) => image.sourceType === "module"
|
|
6935
6961
|
);
|
|
6936
6962
|
const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
|
|
6937
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
6963
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk2MR4MABGcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
6938
6964
|
const farmDocsFontAssets = _optionalChain([config, 'access', _170 => _170.docs, 'optionalAccess', _171 => _171.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
6939
|
-
const integrationProviders =
|
|
6965
|
+
const integrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
6940
6966
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
6941
6967
|
(provider) => provider.component || provider.type === "clerk"
|
|
6942
6968
|
);
|
|
@@ -6945,7 +6971,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6945
6971
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
6946
6972
|
);
|
|
6947
6973
|
}
|
|
6948
|
-
const providerServerModules =
|
|
6974
|
+
const providerServerModules = _chunkM6U6E4F7cjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
6949
6975
|
renderedIntegrationProviders,
|
|
6950
6976
|
config.root,
|
|
6951
6977
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -6965,14 +6991,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6965
6991
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
6966
6992
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
6967
6993
|
);
|
|
6968
|
-
const isolatedHydrationMode =
|
|
6994
|
+
const isolatedHydrationMode = _chunkIEN2EFE5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
6969
6995
|
_optionalChain([config, 'access', _174 => _174.experimental, 'optionalAccess', _175 => _175.isolatedClientHydration]),
|
|
6970
6996
|
{
|
|
6971
6997
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _176 => _176.experimental, 'optionalAccess', _177 => _177.serverComponents])) === "rsc",
|
|
6972
6998
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
6973
6999
|
}
|
|
6974
7000
|
);
|
|
6975
|
-
const hydrationPlanOptions =
|
|
7001
|
+
const hydrationPlanOptions = _chunkIEN2EFE5cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
6976
7002
|
config.renderer,
|
|
6977
7003
|
Boolean(unsupportedIntegrationProvider)
|
|
6978
7004
|
);
|
|
@@ -6990,7 +7016,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6990
7016
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
6991
7017
|
)
|
|
6992
7018
|
}));
|
|
6993
|
-
const markdownPagePlan =
|
|
7019
|
+
const markdownPagePlan = _chunkIEN2EFE5cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
6994
7020
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
6995
7021
|
config.root,
|
|
6996
7022
|
isolatedHydrationMode,
|
|
@@ -6999,7 +7025,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6999
7025
|
const pageHydrationPlans = new Map(
|
|
7000
7026
|
pageRoutes.map((route) => [
|
|
7001
7027
|
route.modulePath,
|
|
7002
|
-
|
|
7028
|
+
_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
7003
7029
|
route.modulePath,
|
|
7004
7030
|
config.root,
|
|
7005
7031
|
isolatedHydrationMode,
|
|
@@ -7008,7 +7034,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7008
7034
|
)
|
|
7009
7035
|
])
|
|
7010
7036
|
);
|
|
7011
|
-
|
|
7037
|
+
_chunkIEN2EFE5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
7012
7038
|
layoutHydrationPlans.map((layout) => ({
|
|
7013
7039
|
pattern: layout.pattern,
|
|
7014
7040
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -7017,10 +7043,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7017
7043
|
pageRoutes.map((route) => ({
|
|
7018
7044
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
7019
7045
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
7020
|
-
depth:
|
|
7046
|
+
depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
7021
7047
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
7022
7048
|
})),
|
|
7023
|
-
|
|
7049
|
+
_chunk2MR4MABGcjs.routeBoundaryCoversDirectory,
|
|
7024
7050
|
{ serverOwners: pageHydrationPlanOptions.serverOwners }
|
|
7025
7051
|
);
|
|
7026
7052
|
const providerServerImports = [
|
|
@@ -7051,7 +7077,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7051
7077
|
}).map(({ route }) => route);
|
|
7052
7078
|
orderedPageRoutes.forEach((route, index) => {
|
|
7053
7079
|
const varName = `pageRoute${index}`;
|
|
7054
|
-
if (
|
|
7080
|
+
if (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
7055
7081
|
pageRegistrations.push(`
|
|
7056
7082
|
{
|
|
7057
7083
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -7075,7 +7101,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7075
7101
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
7076
7102
|
);
|
|
7077
7103
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
7078
|
-
const renderingDirective =
|
|
7104
|
+
const renderingDirective = _chunkK7JMTAFHcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
7079
7105
|
pageRegistrations.push(`
|
|
7080
7106
|
{
|
|
7081
7107
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -7083,8 +7109,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7083
7109
|
module: ${varName},
|
|
7084
7110
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
7085
7111
|
clientModule: ${JSON.stringify(_chunkQMNWKQL4cjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
7086
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
7087
|
-
const rootStrategy =
|
|
7112
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkIEN2EFE5cjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
7113
|
+
const rootStrategy = _chunkM6U6E4F7cjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
7088
7114
|
route,
|
|
7089
7115
|
clientMetadata,
|
|
7090
7116
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -7103,7 +7129,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7103
7129
|
});
|
|
7104
7130
|
const layoutImports = [];
|
|
7105
7131
|
const layoutRegistrations = [];
|
|
7106
|
-
const treeLayoutPatterns = farmIslandsMode ?
|
|
7132
|
+
const treeLayoutPatterns = farmIslandsMode ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
7107
7133
|
layoutHydrationPlans.map((layout) => ({
|
|
7108
7134
|
pattern: layout.pattern,
|
|
7109
7135
|
shouldHydrate: layout.hydration.shouldHydrate,
|
|
@@ -7147,7 +7173,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7147
7173
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
7148
7174
|
interception: ${JSON.stringify(slot.interception)},
|
|
7149
7175
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
7150
|
-
hydrates: ${!farmIslandsMode ||
|
|
7176
|
+
hydrates: ${!farmIslandsMode || _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
7151
7177
|
module: ${varName},
|
|
7152
7178
|
}`);
|
|
7153
7179
|
});
|
|
@@ -7158,12 +7184,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7158
7184
|
errorImports.push(
|
|
7159
7185
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
7160
7186
|
);
|
|
7161
|
-
const groupScope =
|
|
7187
|
+
const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
7162
7188
|
errorRegistrations.push(`
|
|
7163
7189
|
{
|
|
7164
|
-
pattern: ${JSON.stringify(
|
|
7190
|
+
pattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
7165
7191
|
groupScope: ${JSON.stringify(groupScope)},
|
|
7166
|
-
directoryDepth: ${
|
|
7192
|
+
directoryDepth: ${_chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
7167
7193
|
module: ${varName},
|
|
7168
7194
|
}`);
|
|
7169
7195
|
});
|
|
@@ -7175,12 +7201,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7175
7201
|
loadingImports.push(
|
|
7176
7202
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
|
|
7177
7203
|
);
|
|
7178
|
-
const groupScope =
|
|
7204
|
+
const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
|
|
7179
7205
|
loadingRegistrations.push(`
|
|
7180
7206
|
{
|
|
7181
|
-
pattern: ${JSON.stringify(
|
|
7207
|
+
pattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
|
|
7182
7208
|
groupScope: ${JSON.stringify(groupScope)},
|
|
7183
|
-
directoryDepth: ${
|
|
7209
|
+
directoryDepth: ${_chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
|
|
7184
7210
|
module: ${varName},
|
|
7185
7211
|
}`);
|
|
7186
7212
|
});
|
|
@@ -7294,6 +7320,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7294
7320
|
createFarmProductionLifecycle,
|
|
7295
7321
|
createFarmNodeRequestAbortSignal,
|
|
7296
7322
|
createProductionMiddlewareRunner,
|
|
7323
|
+
_hasPrivateFarmRequestHeaders,
|
|
7297
7324
|
_withFarmGuardedResponseCache,
|
|
7298
7325
|
_farmPluginsKeepResponsesPrivate,
|
|
7299
7326
|
getTheme as getFarmTheme,
|
|
@@ -7307,6 +7334,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7307
7334
|
localizeFarmHref,
|
|
7308
7335
|
manageFarmDocumentPreloads,
|
|
7309
7336
|
mergeRouteRenderingDirectiveConfig,
|
|
7337
|
+
resolveRouteSharedCacheControl,
|
|
7310
7338
|
manageFarmLinkHeaderPreloads,
|
|
7311
7339
|
mergeMetadata,
|
|
7312
7340
|
mergeModuleViewport,
|
|
@@ -7335,7 +7363,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7335
7363
|
stripFarmLocaleFromPathname,
|
|
7336
7364
|
withFarmRouteContext,
|
|
7337
7365
|
createLateNotFoundRecovery,
|
|
7338
|
-
createLateRedirectRecovery
|
|
7366
|
+
createLateRedirectRecovery,
|
|
7367
|
+
_withFarmDeploymentCookie,
|
|
7368
|
+
_withFarmResponseHeaders,
|
|
7369
|
+
createFarmDeploymentMismatchResponse,
|
|
7370
|
+
FARM_DEPLOYMENT_ID_HEADER,
|
|
7371
|
+
getFarmDeploymentMismatch,
|
|
7372
|
+
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _183 => _183.md, 'optionalAccess', _184 => _184.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
|
|
7339
7373
|
} from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
|
|
7340
7374
|
import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
|
|
7341
7375
|
// The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
|
|
@@ -7404,25 +7438,25 @@ function farmFormStateScript() { return ""; }`}`;
|
|
|
7404
7438
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
7405
7439
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
7406
7440
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
7407
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
7441
|
+
const docsHandlerImport = _optionalChain([config, 'access', _185 => _185.docs, 'optionalAccess', _186 => _186.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
7408
7442
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
7409
7443
|
const pathname = typeof requestOrPathname === "string"
|
|
7410
7444
|
? requestOrPathname
|
|
7411
7445
|
: new URL(requestOrPathname.url).pathname;
|
|
7412
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
7446
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _187 => _187.apiPath]) || "/api/docs")};
|
|
7413
7447
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
7414
7448
|
};` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
7415
|
-
import { ${_optionalChain([config, 'access',
|
|
7449
|
+
import { ${_optionalChain([config, 'access', _188 => _188.docs, 'access', _189 => _189.roots, 'optionalAccess', _190 => _190.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
|
|
7416
7450
|
import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
|
|
7417
7451
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
7418
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
7419
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
7452
|
+
const docsFontImport = _optionalChain([config, 'access', _191 => _191.docs, 'optionalAccess', _192 => _192.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
7453
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _193 => _193.docs, 'optionalAccess', _194 => _194.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
7420
7454
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
7421
7455
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
7422
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
7456
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _195 => _195.md, 'optionalAccess', _196 => _196.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
7423
7457
|
const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
|
|
7424
7458
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
7425
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
7459
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _197 => _197.mdx, 'optionalAccess', _198 => _198.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
7426
7460
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
7427
7461
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
7428
7462
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -7442,14 +7476,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
7442
7476
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
7443
7477
|
const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
7444
7478
|
const mobileSession = (config.plugins || []).some(
|
|
7445
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
7479
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _199 => _199.name]) === _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN
|
|
7446
7480
|
);
|
|
7447
7481
|
const nativeServerFns = (config.plugins || []).some(
|
|
7448
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
7449
|
-
) ?
|
|
7482
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _200 => _200.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
7483
|
+
) ? _chunkA7HCBHMCcjs.collectFarmNativeServerFns.call(void 0, {
|
|
7450
7484
|
root: config.root,
|
|
7451
7485
|
srcDir: config.srcDir,
|
|
7452
|
-
entries:
|
|
7486
|
+
entries: _chunkA7HCBHMCcjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
|
|
7453
7487
|
}) : void 0;
|
|
7454
7488
|
const integrationImports = `
|
|
7455
7489
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -7464,7 +7498,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
7464
7498
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
7465
7499
|
});` : ""}
|
|
7466
7500
|
`;
|
|
7467
|
-
const imageRuntime =
|
|
7501
|
+
const imageRuntime = _chunkM6U6E4F7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
7468
7502
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
7469
7503
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
7470
7504
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -7601,7 +7635,7 @@ ${routeClientGraphServerRuntime}
|
|
|
7601
7635
|
const farmRendererStreamingCapabilities = ${JSON.stringify(rendererStreamingCapabilities)};
|
|
7602
7636
|
const farmRendererName = ${JSON.stringify(config.renderer.name)};
|
|
7603
7637
|
const farmReactSyncRender = ${JSON.stringify(hasReactSyncRender)};
|
|
7604
|
-
const farmRendererRuntime = ${JSON.stringify(
|
|
7638
|
+
const farmRendererRuntime = ${JSON.stringify(_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset))};
|
|
7605
7639
|
const farmRendererRuntimeStreamingCapabilities = ReactDOMServer.capabilities &&
|
|
7606
7640
|
ReactDOMServer.capabilities.streaming;
|
|
7607
7641
|
if (farmRendererRuntimeStreamingCapabilities &&
|
|
@@ -7646,7 +7680,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
7646
7680
|
|
|
7647
7681
|
function FarmDefault404Page() {
|
|
7648
7682
|
return React.createElement(React.Fragment, null,
|
|
7649
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
7683
|
+
React.createElement("style", null, ${JSON.stringify(_chunkM6U6E4F7cjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
7650
7684
|
React.createElement("main", {
|
|
7651
7685
|
className: "farm-default-not-found",
|
|
7652
7686
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -7783,20 +7817,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
7783
7817
|
validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
|
|
7784
7818
|
onError(error) { console.error("[Farm Image]", error); },
|
|
7785
7819
|
})`};
|
|
7786
|
-
const farmMarkdownConfig = ${JSON.stringify(config.md)}
|
|
7787
|
-
|
|
7788
|
-
|
|
7820
|
+
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _201 => _201.md, 'optionalAccess', _202 => _202.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
|
|
7821
|
+
// A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
|
|
7822
|
+
// ('/about/'), so the trailing-slash 308 never answers in its place.
|
|
7823
|
+
const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
|
|
7824
|
+
const toFarmMarkdownPageRequest = (request) => request;` : ""}
|
|
7825
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _203 => _203.agent, 'optionalAccess', _204 => _204.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
7826
|
+
${_optionalChain([config, 'access', _205 => _205.agent, 'optionalAccess', _206 => _206.llmsTxt, 'optionalAccess', _207 => _207.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
7789
7827
|
const farmMdxConfig = ${JSON.stringify({
|
|
7790
7828
|
...config.mdx,
|
|
7791
|
-
components: typeof _optionalChain([config, 'access',
|
|
7829
|
+
components: typeof _optionalChain([config, 'access', _208 => _208.mdx, 'optionalAccess', _209 => _209.components]) === "string" ? config.mdx.components : void 0
|
|
7792
7830
|
})};
|
|
7793
7831
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
7794
|
-
${_optionalChain([config, 'access',
|
|
7832
|
+
${_optionalChain([config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
7795
7833
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
7796
7834
|
// to the build.
|
|
7797
7835
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
7798
7836
|
globalThis.process?.env,
|
|
7799
|
-
${JSON.stringify(
|
|
7837
|
+
${JSON.stringify(_chunkLECZ5DPZcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
7800
7838
|
);` : ""}
|
|
7801
7839
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
7802
7840
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -7842,7 +7880,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
7842
7880
|
});
|
|
7843
7881
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
7844
7882
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
7845
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
7883
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _212 => _212.docs, 'optionalAccess', _213 => _213.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
7846
7884
|
try {
|
|
7847
7885
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
7848
7886
|
const candidates = [
|
|
@@ -7854,7 +7892,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _208 => _2
|
|
|
7854
7892
|
} catch {
|
|
7855
7893
|
return null;
|
|
7856
7894
|
}
|
|
7857
|
-
})()` : "null"};${_optionalChain([config, 'access',
|
|
7895
|
+
})()` : "null"};${_optionalChain([config, 'access', _214 => _214.docs, 'optionalAccess', _215 => _215.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _216 => _216.docs, 'access', _217 => _217.roots, 'optionalAccess', _218 => _218.length]) ? `
|
|
7858
7896
|
const farmDocsBundledRootsDir = (() => {
|
|
7859
7897
|
try {
|
|
7860
7898
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
@@ -7906,7 +7944,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
7906
7944
|
),
|
|
7907
7945
|
}
|
|
7908
7946
|
: undefined;
|
|
7909
|
-
const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
7947
|
+
const farmDocsHandler = ${_optionalChain([config, 'access', _219 => _219.docs, 'optionalAccess', _220 => _220.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
|
|
7910
7948
|
rootDir: farmDocsRuntimeRoot,
|
|
7911
7949
|
// A production build's content cannot change, so the adapter reads its
|
|
7912
7950
|
// navigation once instead of scanning the content directory per request.
|
|
@@ -7927,7 +7965,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _215 => _215.docs, '
|
|
|
7927
7965
|
registerMCPServer: registerFarmMCPServer,
|
|
7928
7966
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
7929
7967
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
7930
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
7968
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunkI7NUT24Zcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
7931
7969
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
7932
7970
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
7933
7971
|
isPathGuarded: (pathname) =>
|
|
@@ -7953,7 +7991,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _215 => _215.docs, '
|
|
|
7953
7991
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
7954
7992
|
basePath: ${JSON.stringify(config.basePath)},
|
|
7955
7993
|
})` : "null"};
|
|
7956
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
7994
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _221 => _221.docs, 'optionalAccess', _222 => _222.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
|
|
7957
7995
|
|
|
7958
7996
|
// API routes bundled at build time
|
|
7959
7997
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
@@ -7977,16 +8015,20 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
7977
8015
|
return fetch(new Request(request, { headers }), context);
|
|
7978
8016
|
}
|
|
7979
8017
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
8018
|
+
// Deployment skew protection (see the deployment docs): documents embed this ID, page responses
|
|
8019
|
+
// name it, and a page request from a browser holding another deployment's page is refused.
|
|
8020
|
+
const farmDeploymentId = ${JSON.stringify(config.deploymentId)};
|
|
8021
|
+
const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
|
|
7980
8022
|
// Reports a failure Farm answers itself (an API or integration route's 500) to the plugin
|
|
7981
8023
|
// runtime request.
|
|
7982
8024
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
7983
8025
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
7984
|
-
${_optionalChain([config, 'access',
|
|
7985
|
-
` : ""}${_optionalChain([config, 'access',
|
|
7986
|
-
|
|
8026
|
+
${_optionalChain([config, 'access', _223 => _223.agent, 'optionalAccess', _224 => _224.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkK4UGCUXXcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
8027
|
+
` : ""}${_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
8028
|
+
_chunkK4UGCUXXcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
7987
8029
|
build: config.deploymentId,
|
|
7988
|
-
packages:
|
|
7989
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
8030
|
+
packages: _chunkM6U6E4F7cjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
8031
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkM6U6E4F7cjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
7990
8032
|
})
|
|
7991
8033
|
)};
|
|
7992
8034
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -8090,7 +8132,8 @@ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, page
|
|
|
8090
8132
|
let source = 'window.__FARM_PROPS__=' + serializedPageProps +
|
|
8091
8133
|
';window.__FARM_INTEGRATION_API_MANIFEST__=' +
|
|
8092
8134
|
serializeFarmInlineValue(integrationManifest) +
|
|
8093
|
-
';window.__FARM_ROUTE_SLOTS__=' + serializedRouteSlots +
|
|
8135
|
+
';window.__FARM_ROUTE_SLOTS__=' + serializedRouteSlots +
|
|
8136
|
+
';window.__FARM_DEPLOYMENT_ID__=' + serializeFarmInlineValue(farmDeploymentId) + ';';
|
|
8094
8137
|
if (typeof canonicalPath === "string" && canonicalPath.startsWith("/")) {
|
|
8095
8138
|
const serializedPath = serializeFarmInlineValue(canonicalPath);
|
|
8096
8139
|
source += 'if(location.pathname+location.search!==' + serializedPath + '){' +
|
|
@@ -8652,7 +8695,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
8652
8695
|
let inner = markup.replace(/^\\s+/, "");
|
|
8653
8696
|
let hoisted = "";
|
|
8654
8697
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
8655
|
-
const hoistable = /${
|
|
8698
|
+
const hoistable = /${_chunk2MR4MABGcjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
8656
8699
|
let match;
|
|
8657
8700
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
8658
8701
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -8892,38 +8935,14 @@ function applyFarmI18nResponse(response, resolution) {
|
|
|
8892
8935
|
});
|
|
8893
8936
|
}
|
|
8894
8937
|
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
const parts = cookieHeader.split(";");
|
|
8898
|
-
if (parts.length !== 1) return false;
|
|
8899
|
-
|
|
8900
|
-
const cookie = parts[0].trim();
|
|
8901
|
-
const separator = cookie.indexOf("=");
|
|
8902
|
-
if (separator <= 0) return false;
|
|
8903
|
-
|
|
8904
|
-
let name;
|
|
8905
|
-
let value;
|
|
8906
|
-
try {
|
|
8907
|
-
name = decodeURIComponent(cookie.slice(0, separator).trim());
|
|
8908
|
-
value = decodeURIComponent(cookie.slice(separator + 1).trim());
|
|
8909
|
-
} catch {
|
|
8910
|
-
return false;
|
|
8911
|
-
}
|
|
8912
|
-
|
|
8913
|
-
return (
|
|
8914
|
-
name === farmI18nConfig.cookie.name &&
|
|
8915
|
-
farmI18nConfig.locales.includes(value)
|
|
8916
|
-
);
|
|
8917
|
-
}
|
|
8918
|
-
|
|
8938
|
+
// Credentials or a visitor's cookie; the deployment cookie, and a lone valid locale cookie when
|
|
8939
|
+
// the URL names the locale, keep shared caching. The RSC server decides with the same helper.
|
|
8919
8940
|
function hasPrivateFarmRequestHeaders(request, farmLocaleResolution) {
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
farmLocaleResolution?.source === "url" &&
|
|
8926
|
-
hasOnlyValidFarmLocaleCookie(cookieHeader)
|
|
8941
|
+
return _hasPrivateFarmRequestHeaders(
|
|
8942
|
+
request,
|
|
8943
|
+
farmI18nRuntime && farmLocaleResolution?.source === "url"
|
|
8944
|
+
? { name: farmI18nConfig.cookie.name, locales: farmI18nConfig.locales }
|
|
8945
|
+
: undefined,
|
|
8927
8946
|
);
|
|
8928
8947
|
}
|
|
8929
8948
|
|
|
@@ -9181,7 +9200,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
9181
9200
|
// its nearest layout's.
|
|
9182
9201
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
9183
9202
|
pageRoutes.map((route) => route.pattern).filter(
|
|
9184
|
-
(pattern) => !pattern.includes("[") &&
|
|
9203
|
+
(pattern) => !pattern.includes("[") && _chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0,
|
|
9185
9204
|
{
|
|
9186
9205
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
9187
9206
|
middlewareRoutes
|
|
@@ -9224,7 +9243,7 @@ function createFarmAgentSitemapResponse(request) {
|
|
|
9224
9243
|
metadataBase: rootLayout && rootLayout.module && rootLayout.module.metadata
|
|
9225
9244
|
? rootLayout.module.metadata.metadataBase
|
|
9226
9245
|
: undefined,
|
|
9227
|
-
basePath: ${JSON.stringify(config.basePath)},
|
|
9246
|
+
basePath: ${JSON.stringify(config.basePath)},${config.trailingSlash ? "\n trailingSlash: true," : ""}${config.i18n.enabled ? "\n i18n: farmI18nConfig," : ""}
|
|
9228
9247
|
},
|
|
9229
9248
|
),
|
|
9230
9249
|
{},
|
|
@@ -9236,12 +9255,12 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
9236
9255
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
9237
9256
|
// registered at runtime, such as the docs engine's.
|
|
9238
9257
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
9239
|
-
|
|
9258
|
+
_chunkVG6HYT5Kcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkMZLJFNMHcjs.FARM_VERSION)
|
|
9240
9259
|
)};
|
|
9241
9260
|
let farmDefaultMCPRouteFree;
|
|
9242
9261
|
function getFarmDefaultMCPServer() {
|
|
9243
9262
|
if (farmDefaultMCPRouteFree === undefined) {
|
|
9244
|
-
farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(
|
|
9263
|
+
farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkVG6HYT5Kcjs.FARM_DEFAULT_MCP_PATH)});
|
|
9245
9264
|
}
|
|
9246
9265
|
return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
|
|
9247
9266
|
}
|
|
@@ -9250,18 +9269,22 @@ async function handleFarmDefaultMCP(request) {
|
|
|
9250
9269
|
return handleFarmDefaultMCPRequest(request, {
|
|
9251
9270
|
server: getFarmDefaultMCPServer(),
|
|
9252
9271
|
basePath: ${JSON.stringify(config.basePath)},
|
|
9272
|
+
i18n: farmI18nConfig,
|
|
9273
|
+
// Each page at the URL it answers at, as in development and as the sitemap lists it.
|
|
9253
9274
|
listPages: () =>
|
|
9254
9275
|
collectFarmDefaultMCPPages(
|
|
9255
9276
|
getFarmAgentListedPageRoutes().map((route) => ({ pattern: route.pattern, module: route.module })),
|
|
9256
|
-
{
|
|
9277
|
+
{
|
|
9278
|
+
origin,
|
|
9279
|
+
basePath: ${JSON.stringify(config.basePath)},
|
|
9280
|
+
markdown: farmMarkdownConfig,${config.trailingSlash ? "\n trailingSlash: true," : ""}
|
|
9281
|
+
i18n: farmI18nConfig,
|
|
9282
|
+
},
|
|
9257
9283
|
),
|
|
9258
|
-
// A fresh request through this handler, so the caller's cookies never shape a page.
|
|
9259
|
-
//
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
page.pathname = stripFarmBasePath(page.pathname);
|
|
9263
|
-
return farmDefaultMCPReadMarkdown(page.href);
|
|
9264
|
-
},
|
|
9284
|
+
// A fresh request through this handler, so the caller's cookies never shape a page. It
|
|
9285
|
+
// reads the public URL, base path included, as llms-full.txt does: this handler sees
|
|
9286
|
+
// public paths, and with i18n a mirror path without the base path answers with a redirect.
|
|
9287
|
+
readMarkdown: farmDefaultMCPReadMarkdown,
|
|
9265
9288
|
});
|
|
9266
9289
|
}
|
|
9267
9290
|
// \`fetch\` is this module's outer request entry: plugin runtime hooks run and the page
|
|
@@ -9289,7 +9312,7 @@ function createFarmLlmsTxtContext(request, full) {
|
|
|
9289
9312
|
origin,
|
|
9290
9313
|
markdown: farmMarkdownConfig,
|
|
9291
9314
|
include: farmLlmsTxtConfig.include,
|
|
9292
|
-
exclude: farmLlmsTxtConfig.exclude,
|
|
9315
|
+
exclude: farmLlmsTxtConfig.exclude,${config.trailingSlash ? "\n trailingSlash: true," : ""}${config.i18n.enabled ? "\n i18n: farmI18nConfig," : ""}
|
|
9293
9316
|
},
|
|
9294
9317
|
);
|
|
9295
9318
|
const rootLayout = layoutRoutes.find((layout) => layout.pattern === "/");
|
|
@@ -9422,7 +9445,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
9422
9445
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
9423
9446
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
9424
9447
|
const farmPrerendering =
|
|
9425
|
-
typeof process !== "undefined" && process.env?.${
|
|
9448
|
+
typeof process !== "undefined" && process.env?.${_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV} === "1";
|
|
9426
9449
|
` : ""}
|
|
9427
9450
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
9428
9451
|
config: farmMiddlewareConfig,
|
|
@@ -9566,7 +9589,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
9566
9589
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
9567
9590
|
return true;
|
|
9568
9591
|
}
|
|
9569
|
-
${_optionalChain([config, 'access',
|
|
9592
|
+
${_optionalChain([config, 'access', _227 => _227.docs, 'optionalAccess', _228 => _228.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
9570
9593
|
// The docs answer below the basePath; their API stays at /api/docs, as API routes do.
|
|
9571
9594
|
const docsRoutePathname = stripFarmBasePath(pathname);
|
|
9572
9595
|
if (
|
|
@@ -9594,7 +9617,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
9594
9617
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
9595
9618
|
};
|
|
9596
9619
|
}
|
|
9597
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
9620
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _229 => _229.docs, 'optionalAccess', _230 => _230.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
9598
9621
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
9599
9622
|
pathname,
|
|
9600
9623
|
method: request.method,
|
|
@@ -9678,7 +9701,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
9678
9701
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
9679
9702
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
9680
9703
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
9681
|
-
|
|
9704
|
+
_chunkK4UGCUXXcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
9682
9705
|
agent: {
|
|
9683
9706
|
...config.agent,
|
|
9684
9707
|
aiCatalog: servesAiCatalog,
|
|
@@ -9689,9 +9712,10 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
9689
9712
|
openapi: openAPIReference
|
|
9690
9713
|
})
|
|
9691
9714
|
)});
|
|
9692
|
-
${_optionalChain([config, 'access',
|
|
9715
|
+
${_optionalChain([config, 'access', _231 => _231.docs, 'optionalAccess', _232 => _232.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
9693
9716
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
9694
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
9717
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _233 => _233.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _234 => _234.docs, 'access', _235 => _235.roots, 'optionalAccess', _236 => _236.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
|
|
9718
|
+
pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
|
|
9695
9719
|
};
|
|
9696
9720
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
9697
9721
|
const farmRouteLabelSlot = Symbol("farm.route.label.slot");
|
|
@@ -9706,11 +9730,11 @@ function labelFarmRequestOptions(options) {
|
|
|
9706
9730
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
9707
9731
|
return options;
|
|
9708
9732
|
}
|
|
9709
|
-
${_optionalChain([config, 'access',
|
|
9733
|
+
${_optionalChain([config, 'access', _237 => _237.docs, 'optionalAccess', _238 => _238.enabled]) ? `if (options.kind === "docs") {
|
|
9710
9734
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
9711
9735
|
return options;
|
|
9712
9736
|
}` : ""}
|
|
9713
|
-
${_optionalChain([config, 'access',
|
|
9737
|
+
${_optionalChain([config, 'access', _239 => _239.md, 'optionalAccess', _240 => _240.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
9714
9738
|
routePathname,
|
|
9715
9739
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
9716
9740
|
);
|
|
@@ -9745,7 +9769,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
9745
9769
|
return applicable;
|
|
9746
9770
|
}
|
|
9747
9771
|
|
|
9748
|
-
${_optionalChain([config, 'access',
|
|
9772
|
+
${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
9749
9773
|
if (request.method === "HEAD") return response;
|
|
9750
9774
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
9751
9775
|
|
|
@@ -9853,7 +9877,7 @@ ${_optionalChain([config, 'access', _237 => _237.docs, 'optionalAccess', _238 =>
|
|
|
9853
9877
|
|
|
9854
9878
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
9855
9879
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
9856
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
9880
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _243 => _243.experimental, 'optionalAccess', _244 => _244.ppr]) === true)};
|
|
9857
9881
|
|
|
9858
9882
|
function resolveRouteRenderingView(route) {
|
|
9859
9883
|
// The same merge development uses: baked directive config under the
|
|
@@ -9878,7 +9902,7 @@ function getPPRShellBypassReason(request, middlewareData, middlewareContext) {
|
|
|
9878
9902
|
if (farmSecurityConfig.csp && farmSecurityConfig.csp.nonce) return "csp-nonce";
|
|
9879
9903
|
const method = request.method.toUpperCase();
|
|
9880
9904
|
if (method !== "GET" && method !== "HEAD") return "method";
|
|
9881
|
-
if (request.headers.get("cookie")) return "cookie";
|
|
9905
|
+
if (withoutFarmDeploymentCookie(request.headers.get("cookie"))) return "cookie";
|
|
9882
9906
|
if (request.headers.get("authorization")) return "authorization";
|
|
9883
9907
|
if (request.headers.get("x-farm-intercept-from")) return "route-interception";
|
|
9884
9908
|
if (request.headers.get("x-farm-ppr-refresh")) return "refresh";
|
|
@@ -9890,12 +9914,15 @@ function getPPRShellBypassReason(request, middlewareData, middlewareContext) {
|
|
|
9890
9914
|
|
|
9891
9915
|
// origin is set when the shell carries hreflang alternates (i18n prefix
|
|
9892
9916
|
// routing), so one host never serves a shell holding another host's URLs.
|
|
9917
|
+
// A shell embeds its deployment's ID and client assets, and a shared cache
|
|
9918
|
+
// adapter outlives a deployment, so each deployment keys its own shells.
|
|
9893
9919
|
function getPPRShellCacheKey(url, locale, origin) {
|
|
9894
9920
|
const key = [
|
|
9895
9921
|
"ppr",
|
|
9896
9922
|
locale || "",
|
|
9897
9923
|
normalizeRevalidatePath(url.pathname),
|
|
9898
9924
|
url.search,
|
|
9925
|
+
farmDeploymentId,
|
|
9899
9926
|
];
|
|
9900
9927
|
return createFarmCacheKey(origin ? key.concat(origin) : key);
|
|
9901
9928
|
}
|
|
@@ -9925,22 +9952,13 @@ function hasFarmUnserializableRouteData(data) {
|
|
|
9925
9952
|
return Boolean(data) && typeof data === "object" && Object.values(data).some(isPromise);
|
|
9926
9953
|
}
|
|
9927
9954
|
|
|
9955
|
+
// Core's policy for the route, shared with the RSC server so both send the same Cache-Control.
|
|
9928
9956
|
function getRouteSharedCacheControl(route, pprCanCache) {
|
|
9929
9957
|
if (!route || !route.module) {
|
|
9930
9958
|
return null;
|
|
9931
9959
|
}
|
|
9932
9960
|
|
|
9933
|
-
|
|
9934
|
-
if (view.dynamic === "force-dynamic") {
|
|
9935
|
-
return null;
|
|
9936
|
-
}
|
|
9937
|
-
if (!view.ssg && !pprCanCache) {
|
|
9938
|
-
return null;
|
|
9939
|
-
}
|
|
9940
|
-
|
|
9941
|
-
const revalidate =
|
|
9942
|
-
typeof view.revalidate === "number" && view.revalidate > 0 ? view.revalidate : 60;
|
|
9943
|
-
return "public, s-maxage=" + revalidate + ", stale-while-revalidate=300";
|
|
9961
|
+
return resolveRouteSharedCacheControl(resolveRouteRenderingView(route), pprCanCache);
|
|
9944
9962
|
}
|
|
9945
9963
|
|
|
9946
9964
|
async function getCachedPPRShell(cacheKey) {
|
|
@@ -9987,7 +10005,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
9987
10005
|
},
|
|
9988
10006
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
9989
10007
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
9990
|
-
${_optionalChain([config, 'access',
|
|
10008
|
+
${_optionalChain([config, 'access', _245 => _245.md, 'optionalAccess', _246 => _246.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
9991
10009
|
if (matchPageRoute(pathname)) {
|
|
9992
10010
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
9993
10011
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -10011,8 +10029,9 @@ async function handleFarmRequestInContext(
|
|
|
10011
10029
|
adapterContext,
|
|
10012
10030
|
requestUrl = new URL(request.url),
|
|
10013
10031
|
) {
|
|
10014
|
-
|
|
10015
|
-
const
|
|
10032
|
+
// deploymentPage: a page route answered, so the response names this deployment.
|
|
10033
|
+
const farmCacheGuard = { guarded: farmPluginRuntimeKeepsResponsesPrivate, deploymentPage: false };
|
|
10034
|
+
let response = await resolveFarmRequestInContext(
|
|
10016
10035
|
farmCacheGuard,
|
|
10017
10036
|
request,
|
|
10018
10037
|
farmLocaleResolution,
|
|
@@ -10021,6 +10040,11 @@ async function handleFarmRequestInContext(
|
|
|
10021
10040
|
adapterContext,
|
|
10022
10041
|
requestUrl,
|
|
10023
10042
|
);
|
|
10043
|
+
if (farmCacheGuard.deploymentPage) {
|
|
10044
|
+
response = _withFarmResponseHeaders(response, (headers) =>
|
|
10045
|
+
headers.set(FARM_DEPLOYMENT_ID_HEADER, farmDeploymentId)
|
|
10046
|
+
);
|
|
10047
|
+
}
|
|
10024
10048
|
if (!farmCacheGuard.guarded) return response;
|
|
10025
10049
|
// Tells the Nitro entry, which keeps this policy over a swr rule's public one.
|
|
10026
10050
|
adapterContext?.onGuardedResponse?.();
|
|
@@ -10198,7 +10222,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10198
10222
|
return renderFarmErrorJSONResponse();` : `
|
|
10199
10223
|
if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
|
|
10200
10224
|
// No page was selected, so only the root error boundary and layouts apply.
|
|
10201
|
-
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access',
|
|
10225
|
+
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _247 => _247.md, 'optionalAccess', _248 => _248.enabled]) ? `
|
|
10202
10226
|
// An agent asking for Markdown reads the error document as Markdown, as it
|
|
10203
10227
|
// does when a page throws. The helper answers null when Markdown is off.
|
|
10204
10228
|
const markdownErrorResponse = await createMarkdownMirrorResponse({
|
|
@@ -10240,7 +10264,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10240
10264
|
}
|
|
10241
10265
|
` : ""}
|
|
10242
10266
|
|
|
10243
|
-
${_optionalChain([config, 'access',
|
|
10267
|
+
${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `
|
|
10244
10268
|
// Docs responses are served after app middleware so route guards and
|
|
10245
10269
|
// middleware headers apply to the docs engine like any other page content.
|
|
10246
10270
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -10264,6 +10288,14 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10264
10288
|
middlewareHeaders,
|
|
10265
10289
|
);
|
|
10266
10290
|
}
|
|
10291
|
+
// A docs page is a page document: it names this deployment, and a navigation from
|
|
10292
|
+
// another deployment's page is refused, as for an app page.
|
|
10293
|
+
const farmDocsDeploymentMismatch = getFarmDeploymentMismatch(request, farmDeploymentId);
|
|
10294
|
+
if (farmDocsDeploymentMismatch) {
|
|
10295
|
+
await docsResponse.body?.cancel();
|
|
10296
|
+
return createFarmDeploymentMismatchResponse(farmDocsDeploymentMismatch);
|
|
10297
|
+
}
|
|
10298
|
+
farmCacheGuard.deploymentPage = true;
|
|
10267
10299
|
const wrappedDocsResponse = withFarmDocsRequestCache(
|
|
10268
10300
|
await wrapFarmDocsResponseWithLayouts(request, docsResponse),
|
|
10269
10301
|
request,
|
|
@@ -10295,7 +10327,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10295
10327
|
clientAddress: adapterContext?.clientAddress,
|
|
10296
10328
|
// An anonymous visitor's request: guards never see the caller's address.
|
|
10297
10329
|
renderPage: (targetRequest) =>
|
|
10298
|
-
fetchFarmInnerRequest(targetRequest, {
|
|
10330
|
+
fetchFarmInnerRequest(toFarmMarkdownPageRequest(targetRequest), {
|
|
10299
10331
|
...adapterContext,
|
|
10300
10332
|
clientAddress: FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS,
|
|
10301
10333
|
}),
|
|
@@ -10330,7 +10362,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10330
10362
|
}
|
|
10331
10363
|
` : ""}
|
|
10332
10364
|
|
|
10333
|
-
${_optionalChain([config, 'access',
|
|
10365
|
+
${_optionalChain([config, 'access', _251 => _251.md, 'optionalAccess', _252 => _252.enabled]) ? `
|
|
10334
10366
|
if (farmMarkdownConfig?.enabled) {
|
|
10335
10367
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
10336
10368
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -10342,7 +10374,8 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10342
10374
|
routePathname: getFarmRoutePathname,
|
|
10343
10375
|
routeExists: (targetPathname) =>
|
|
10344
10376
|
Boolean(matchPageRoute(getFarmRoutePathname(targetPathname))),
|
|
10345
|
-
renderPage: (targetRequest) =>
|
|
10377
|
+
renderPage: (targetRequest) =>
|
|
10378
|
+
fetchFarmInnerRequest(toFarmMarkdownPageRequest(targetRequest), adapterContext),
|
|
10346
10379
|
apiServerBasePath: farmLocalAPIBasePath,
|
|
10347
10380
|
});
|
|
10348
10381
|
if (markdownResponse) {
|
|
@@ -10433,11 +10466,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10433
10466
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
10434
10467
|
}
|
|
10435
10468
|
` : ""}
|
|
10436
|
-
${_optionalChain([config, 'access',
|
|
10469
|
+
${_optionalChain([config, 'access', _253 => _253.agent, 'optionalAccess', _254 => _254.manifest]) !== false ? `
|
|
10437
10470
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
10438
10471
|
// public manifest, the same document for every request.
|
|
10439
10472
|
if (
|
|
10440
|
-
[${JSON.stringify(
|
|
10473
|
+
[${JSON.stringify(_chunkK4UGCUXXcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkK4UGCUXXcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
10441
10474
|
normalizeRuntimePath(routePathname),
|
|
10442
10475
|
)
|
|
10443
10476
|
) {
|
|
@@ -10447,9 +10480,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10447
10480
|
);
|
|
10448
10481
|
}
|
|
10449
10482
|
` : ""}
|
|
10450
|
-
${_optionalChain([config, 'access',
|
|
10483
|
+
${_optionalChain([config, 'access', _255 => _255.agent, 'optionalAccess', _256 => _256.apiCatalog]) ? `
|
|
10451
10484
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
10452
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
10485
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkK4UGCUXXcjs.FARM_API_CATALOG_PATH)}) {
|
|
10453
10486
|
return applyProductionMiddlewareHeaders(
|
|
10454
10487
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
10455
10488
|
middlewareHeaders,
|
|
@@ -10474,11 +10507,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10474
10507
|
);
|
|
10475
10508
|
}
|
|
10476
10509
|
` : ""}
|
|
10477
|
-
${_optionalChain([config, 'access',
|
|
10510
|
+
${_optionalChain([config, 'access', _257 => _257.agent, 'optionalAccess', _258 => _258.llmsTxt, 'optionalAccess', _259 => _259.enabled]) ? `
|
|
10478
10511
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
10479
10512
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
10480
10513
|
? "llms"
|
|
10481
|
-
: ${_optionalChain([config, 'access',
|
|
10514
|
+
: ${_optionalChain([config, 'access', _260 => _260.agent, 'optionalAccess', _261 => _261.llmsTxt, 'optionalAccess', _262 => _262.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
10482
10515
|
if (farmGeneratedLlmsKind) {
|
|
10483
10516
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
10484
10517
|
// Renders are shared per origin the request reached, which is where pages are read.
|
|
@@ -10514,7 +10547,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10514
10547
|
}
|
|
10515
10548
|
` : ""}
|
|
10516
10549
|
|
|
10517
|
-
${_optionalChain([config, 'access',
|
|
10550
|
+
${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 => _264.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
10518
10551
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
10519
10552
|
if (docsAPIResponse) {
|
|
10520
10553
|
return applyProductionMiddlewareHeaders(
|
|
@@ -10535,6 +10568,14 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10535
10568
|
// Handle page routes (SSR)
|
|
10536
10569
|
emitFarmEvent({ type: "render.start", route: pathname, pathname });
|
|
10537
10570
|
const matchedRoute = matchPageRoute(routePathname);
|
|
10571
|
+
if (matchedRoute) {
|
|
10572
|
+
// A browser holding another deployment's page names it: a navigation fetch in its header, a
|
|
10573
|
+
// form or server action post in the deployment cookie. Refuse it before an action runs, and
|
|
10574
|
+
// before a document would refresh that cookie to this deployment.
|
|
10575
|
+
const farmDeploymentMismatch = getFarmDeploymentMismatch(request, farmDeploymentId);
|
|
10576
|
+
if (farmDeploymentMismatch) return createFarmDeploymentMismatchResponse(farmDeploymentMismatch);
|
|
10577
|
+
farmCacheGuard.deploymentPage = true;
|
|
10578
|
+
}
|
|
10538
10579
|
${farmIslandsMode ? `// Islands mode: a form or client component posting a server action to this page.
|
|
10539
10580
|
if (matchedRoute && request.method === "POST") {
|
|
10540
10581
|
const actionResponse = await _runWithMiddlewareData(middlewareData || {}, () =>
|
|
@@ -11104,7 +11145,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11104
11145
|
);
|
|
11105
11146
|
}
|
|
11106
11147
|
}
|
|
11107
|
-
${_optionalChain([config, 'access',
|
|
11148
|
+
${_optionalChain([config, 'access', _265 => _265.md, 'optionalAccess', _266 => _266.enabled]) ? `
|
|
11108
11149
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
11109
11150
|
// using the public path the .md request will be resolved against.
|
|
11110
11151
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -11123,7 +11164,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11123
11164
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
|
|
11124
11165
|
}
|
|
11125
11166
|
|
|
11126
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
11167
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _267 => _267.agent, 'optionalAccess', _268 => _268.jsonLd]), () => ( false)))} });
|
|
11127
11168
|
const title = renderedMetadata.title;
|
|
11128
11169
|
const metaTags = renderedMetadata.tags;
|
|
11129
11170
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -11525,7 +11566,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11525
11566
|
${servesDefaultMCP ? `
|
|
11526
11567
|
// agent.mcp: no app route answered /mcp, so the default read-only server may.
|
|
11527
11568
|
if (
|
|
11528
|
-
normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
11569
|
+
normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkVG6HYT5Kcjs.FARM_DEFAULT_MCP_PATH)} &&
|
|
11529
11570
|
getFarmDefaultMCPServer()
|
|
11530
11571
|
) {
|
|
11531
11572
|
return applyProductionMiddlewareHeaders(
|
|
@@ -11667,6 +11708,13 @@ ${farmRendererDisabled ? `
|
|
|
11667
11708
|
{ status: 404, headers: { "Content-Type": "application/json" } }
|
|
11668
11709
|
), middlewareHeaders);
|
|
11669
11710
|
` : ""}
|
|
11711
|
+
// The not-found page is a page document: it names this deployment, and a navigation from
|
|
11712
|
+
// another deployment's page is refused, as for an app page.
|
|
11713
|
+
const farmNotFoundDeploymentMismatch = getFarmDeploymentMismatch(request, farmDeploymentId);
|
|
11714
|
+
if (farmNotFoundDeploymentMismatch) {
|
|
11715
|
+
return createFarmDeploymentMismatchResponse(farmNotFoundDeploymentMismatch);
|
|
11716
|
+
}
|
|
11717
|
+
farmCacheGuard.deploymentPage = true;
|
|
11670
11718
|
// Agents that navigate in Markdown (a \`.md\` URL or \`Accept: text/markdown\`)
|
|
11671
11719
|
// get a Markdown error body instead of the HTML not-found shell.
|
|
11672
11720
|
if (farmRequestWantsMarkdown(pathname, request.headers.get("accept"))) {
|
|
@@ -11883,11 +11931,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
|
|
|
11883
11931
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
11884
11932
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
11885
11933
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
11886
|
-
${_optionalChain([config, 'access',
|
|
11934
|
+
${_optionalChain([config, 'access', _269 => _269.agent, 'optionalAccess', _270 => _270.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
11887
11935
|
basePath: farmLocalAPIBasePath,
|
|
11888
11936
|
dispatch: async (localRequest) =>
|
|
11889
11937
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
11890
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
11938
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _271 => _271.agent, 'optionalAccess', _272 => _272.noindexPreviews]) ? `
|
|
11891
11939
|
// Keep every response of a preview deployment out of search indexes.
|
|
11892
11940
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
11893
11941
|
}
|
|
@@ -11905,9 +11953,10 @@ async function handleFarmFetch(request, context) {
|
|
|
11905
11953
|
);
|
|
11906
11954
|
|
|
11907
11955
|
// headers() config applies after middleware let the request through, so it learns
|
|
11908
|
-
// whether the response was guarded and can't make that response shareable again.
|
|
11956
|
+
// whether the response was guarded and can't make that response shareable again. A plugin
|
|
11957
|
+
// runtime hook that throws answers a new 500 out here, which learns it the same way.
|
|
11909
11958
|
let farmGuardedResponse = false;
|
|
11910
|
-
if (configuredHeaderRoutes.length > 0) {
|
|
11959
|
+
if (configuredHeaderRoutes.length > 0 || farmPluginRuntime) {
|
|
11911
11960
|
const adapterContext = context;
|
|
11912
11961
|
context = {
|
|
11913
11962
|
...adapterContext,
|
|
@@ -11940,9 +11989,15 @@ async function handleFarmFetch(request, context) {
|
|
|
11940
11989
|
const configured = applyConfiguredResponseHeaders(response, routePathname);
|
|
11941
11990
|
// Configured headers may edit the response in place, so check it either way.
|
|
11942
11991
|
const guarded = farmGuardedResponse ? _withFarmGuardedResponseCache(configured) : configured;
|
|
11992
|
+
// The deployment cookie goes on once the response's cache policy is final.
|
|
11943
11993
|
return applyFarmPreloadBudget(
|
|
11944
11994
|
applyFarmCspNonceToResponse(
|
|
11945
|
-
|
|
11995
|
+
_withFarmDeploymentCookie(
|
|
11996
|
+
runtimeRequest,
|
|
11997
|
+
applyFarmMobileShellResponse(runtimeRequest, guarded, context),
|
|
11998
|
+
farmDeploymentId,
|
|
11999
|
+
farmDeploymentCookiePath,
|
|
12000
|
+
),
|
|
11946
12001
|
farmSecurityConfig,
|
|
11947
12002
|
cspNonce,
|
|
11948
12003
|
),
|
|
@@ -11987,7 +12042,9 @@ async function handleFarmFetch(request, context) {
|
|
|
11987
12042
|
const response = await _runWithCurrentRequest(request, () =>
|
|
11988
12043
|
_runWithFarmCspNonce(cspNonce, () => _runWithAfterRequest(request, runRequest, context)),
|
|
11989
12044
|
);
|
|
11990
|
-
|
|
12045
|
+
// A Nitro cache rule stores the response and strips its Content-Encoding, so a
|
|
12046
|
+
// response it caches is sent as it is, with no Vary on an encoding it never saw.
|
|
12047
|
+
return ${hasCompressionRuntime && !hasPluginRuntime ? "context?.routeRuleCache ? response : compressFarmResponse(request, response, getFarmOwnedBufferedHtml(response), farmLazyBufferedHtml.has(response))" : "response"};
|
|
11991
12048
|
}),
|
|
11992
12049
|
{
|
|
11993
12050
|
onResponseFinished: typeof context?.onResponseFinished === "function"
|
|
@@ -12073,7 +12130,7 @@ function getManifestPageEntry(manifest, pathname) {
|
|
|
12073
12130
|
}
|
|
12074
12131
|
function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
12075
12132
|
if (!edgeGuarded) return headers;
|
|
12076
|
-
const cacheHeaders = /* @__PURE__ */ new Set(["cache-control", ...
|
|
12133
|
+
const cacheHeaders = /* @__PURE__ */ new Set(["cache-control", ..._chunkJWY66PIDcjs.CDN_CACHE_CONTROL_HEADERS]);
|
|
12077
12134
|
return {
|
|
12078
12135
|
...Object.fromEntries(
|
|
12079
12136
|
Object.entries(headers).filter(([name]) => !cacheHeaders.has(name.toLowerCase()))
|
|
@@ -12081,6 +12138,14 @@ function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
|
12081
12138
|
"cache-control": "private, no-store"
|
|
12082
12139
|
};
|
|
12083
12140
|
}
|
|
12141
|
+
function prerenderWouldChangePageUrl(pathname) {
|
|
12142
|
+
if (/%(?:23|25|2F|3F)/i.test(pathname)) return true;
|
|
12143
|
+
try {
|
|
12144
|
+
return decodeURI(pathname) !== pathname;
|
|
12145
|
+
} catch (e34) {
|
|
12146
|
+
return true;
|
|
12147
|
+
}
|
|
12148
|
+
}
|
|
12084
12149
|
function getPhysicalPrerenderBypassReason(options) {
|
|
12085
12150
|
const {
|
|
12086
12151
|
config,
|
|
@@ -12090,6 +12155,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12090
12155
|
rewriteSources,
|
|
12091
12156
|
pathname
|
|
12092
12157
|
} = options;
|
|
12158
|
+
if (prerenderWouldChangePageUrl(pathname)) return "an escaped character in its URL";
|
|
12093
12159
|
if (config.i18n.enabled) return "request-sensitive i18n";
|
|
12094
12160
|
if (redirectSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
12095
12161
|
return "redirect";
|
|
@@ -12097,13 +12163,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12097
12163
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
12098
12164
|
return "rewrite";
|
|
12099
12165
|
}
|
|
12100
|
-
if (
|
|
12101
|
-
if (
|
|
12102
|
-
if (
|
|
12166
|
+
if (_chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
12167
|
+
if (_chunk2MR4MABGcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
12168
|
+
if (_chunkXYVPTTUTcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
12103
12169
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
12104
12170
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
12105
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
12106
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
12171
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _273 => _273.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
12172
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _274 => _274.regions, 'optionalAccess', _275 => _275.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
12107
12173
|
return "route runtime controls";
|
|
12108
12174
|
}
|
|
12109
12175
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -12116,15 +12182,15 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12116
12182
|
return void 0;
|
|
12117
12183
|
}
|
|
12118
12184
|
async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
12119
|
-
if (!_optionalChain([config, 'access',
|
|
12120
|
-
if (
|
|
12185
|
+
if (!_optionalChain([config, 'access', _276 => _276.docs, 'optionalAccess', _277 => _277.enabled]) || !config.docs.prerender) return [];
|
|
12186
|
+
if (_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
|
|
12121
12187
|
_chunkQMNWKQL4cjs.logger.info(
|
|
12122
12188
|
`\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
|
|
12123
12189
|
);
|
|
12124
12190
|
return [];
|
|
12125
12191
|
}
|
|
12126
|
-
if (!
|
|
12127
|
-
const { pages: pages2, originDependent } =
|
|
12192
|
+
if (!_chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
12193
|
+
const { pages: pages2, originDependent } = _chunkNAXKOTPPcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
|
|
12128
12194
|
root,
|
|
12129
12195
|
srcDir: config.srcDir
|
|
12130
12196
|
});
|
|
@@ -12141,7 +12207,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
12141
12207
|
);
|
|
12142
12208
|
return [];
|
|
12143
12209
|
}
|
|
12144
|
-
const pages = await
|
|
12210
|
+
const pages = await _chunkI7NUT24Zcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
12145
12211
|
if (!pages) {
|
|
12146
12212
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
12147
12213
|
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
|
|
@@ -12150,11 +12216,28 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
12150
12216
|
}
|
|
12151
12217
|
return pages;
|
|
12152
12218
|
}
|
|
12219
|
+
async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
12220
|
+
if (!_optionalChain([config, 'access', _278 => _278.docs, 'optionalAccess', _279 => _279.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
|
|
12221
|
+
return [];
|
|
12222
|
+
}
|
|
12223
|
+
try {
|
|
12224
|
+
return await _chunkI7NUT24Zcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
12225
|
+
root,
|
|
12226
|
+
srcDir: config.srcDir,
|
|
12227
|
+
adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
12228
|
+
});
|
|
12229
|
+
} catch (error) {
|
|
12230
|
+
_chunkQMNWKQL4cjs.logger.warn(
|
|
12231
|
+
`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)}).`
|
|
12232
|
+
);
|
|
12233
|
+
return [];
|
|
12234
|
+
}
|
|
12235
|
+
}
|
|
12153
12236
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
12154
12237
|
return Object.values(routeRules || {}).some((rule) => {
|
|
12155
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
12156
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
12157
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
12238
|
+
const swr = _optionalChain([rule, 'optionalAccess', _280 => _280.swr]);
|
|
12239
|
+
const cache = _optionalChain([rule, 'optionalAccess', _281 => _281.cache]);
|
|
12240
|
+
const headers = _optionalChain([rule, 'optionalAccess', _282 => _282.headers]);
|
|
12158
12241
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
12159
12242
|
});
|
|
12160
12243
|
}
|
|
@@ -12167,10 +12250,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12167
12250
|
const nitroBuilder = nitroBuilderResult.value;
|
|
12168
12251
|
const isVercel = preset === "vercel";
|
|
12169
12252
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
12170
|
-
const outputDir =
|
|
12253
|
+
const outputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
12171
12254
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
12172
12255
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
12173
|
-
const imageRuntime =
|
|
12256
|
+
const imageRuntime = _chunkM6U6E4F7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
12174
12257
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
12175
12258
|
(image) => image.sourceType === "module"
|
|
12176
12259
|
);
|
|
@@ -12226,7 +12309,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12226
12309
|
const edgeGuardedPrerenderRoutes = [];
|
|
12227
12310
|
const addPrerenderRoute = (pathname) => {
|
|
12228
12311
|
prerenderRoutes.push(pathname);
|
|
12229
|
-
if (
|
|
12312
|
+
if (_chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
|
|
12230
12313
|
edgeGuardedPrerenderRoutes.push(pathname);
|
|
12231
12314
|
}
|
|
12232
12315
|
};
|
|
@@ -12304,7 +12387,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12304
12387
|
webEntry: clientJsSrc,
|
|
12305
12388
|
webBoot: clientBootSrc,
|
|
12306
12389
|
stylesheet: clientCssHref,
|
|
12307
|
-
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess',
|
|
12390
|
+
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _283 => _283.files]), () => ( []))
|
|
12308
12391
|
})
|
|
12309
12392
|
) : null;
|
|
12310
12393
|
for (const output of Object.values(ssrBundle)) {
|
|
@@ -12471,12 +12554,19 @@ function resolveTrustedLocalOrigin(event, request) {
|
|
|
12471
12554
|
: requestURL.hostname
|
|
12472
12555
|
const isLoopback = (value) =>
|
|
12473
12556
|
value === 'localhost' || value === '::1' || /^127(?:[.][0-9]{1,3}){3}$/.test(value)
|
|
12474
|
-
|
|
12557
|
+
if (
|
|
12558
|
+
requestURL.protocol === protocol &&
|
|
12475
12559
|
requestPort === port &&
|
|
12476
12560
|
isLoopback(address) &&
|
|
12477
12561
|
isLoopback(normalizedRequestHostname)
|
|
12478
|
-
|
|
12479
|
-
|
|
12562
|
+
) {
|
|
12563
|
+
return requestURL.origin
|
|
12564
|
+
}
|
|
12565
|
+
// Any other Host is the client's to choose, so it must not decide where a local image is
|
|
12566
|
+
// fetched from: the optimizer reads local sources from this server's own socket address, as the
|
|
12567
|
+
// development server does. A TLS socket's certificate names the public host, not this address,
|
|
12568
|
+
// so there the request origin still stands in.
|
|
12569
|
+
return socket.encrypted ? undefined : origin
|
|
12480
12570
|
}
|
|
12481
12571
|
|
|
12482
12572
|
// Export the event handler for Nitro
|
|
@@ -12497,6 +12587,7 @@ ${hasNitroCacheRouteRules ? " let farmGuardedResponse = false\n" : ""} const r
|
|
|
12497
12587
|
onResponseFinished: createResponseFinishedHook(event),
|
|
12498
12588
|
trustedLocalOrigin: resolveTrustedLocalOrigin(event, request),
|
|
12499
12589
|
clientAddress: resolveFarmClientAddress(event),${hasNitroCacheRouteRules ? `
|
|
12590
|
+
routeRuleCache: Boolean(event.context?.routeRules?.cache),
|
|
12500
12591
|
onGuardedResponse: () => {
|
|
12501
12592
|
farmGuardedResponse = true
|
|
12502
12593
|
},` : ""}
|
|
@@ -12611,11 +12702,14 @@ function toFarmNodeResponse(request, response) {
|
|
|
12611
12702
|
ssrEntryFile
|
|
12612
12703
|
);
|
|
12613
12704
|
const configuredNitroRouteRules = _chunkOCNV4CI2cjs.nitroRouteRulesBelowBasePath.call(void 0,
|
|
12614
|
-
|
|
12705
|
+
varyFarmNitroCacheRules(_chunkOCNV4CI2cjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
|
|
12706
|
+
...config.md.enabled ? ["accept"] : [],
|
|
12707
|
+
...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : []
|
|
12708
|
+
]),
|
|
12615
12709
|
config.basePath,
|
|
12616
12710
|
_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
|
|
12617
12711
|
);
|
|
12618
|
-
const toPrerenderPublicPath = (route) =>
|
|
12712
|
+
const toPrerenderPublicPath = (route) => _chunkDVJM55D2cjs.normalizeFarmTrailingSlashPathname.call(void 0,
|
|
12619
12713
|
_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, route, config.basePath),
|
|
12620
12714
|
config.trailingSlash === true
|
|
12621
12715
|
);
|
|
@@ -12757,23 +12851,23 @@ function toFarmNodeResponse(request, response) {
|
|
|
12757
12851
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
12758
12852
|
);
|
|
12759
12853
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
12760
|
-
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
12761
|
-
_optionalChain([nitroConfig, 'access',
|
|
12762
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
12854
|
+
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _284 => _284.rollupConfig, 'optionalAccess', _285 => _285.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _286 => _286.rollupConfig, 'optionalAccess', _287 => _287.plugins])) && customRollupKeys.length === 0 && Boolean(
|
|
12855
|
+
_optionalChain([nitroConfig, 'access', _288 => _288.handlers, 'optionalAccess', _289 => _289.some, 'call', _290 => _290(
|
|
12856
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _291 => _291.handler]) || "") === nitroEntryPath
|
|
12763
12857
|
)])
|
|
12764
12858
|
);
|
|
12765
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access',
|
|
12859
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _292 => _292.output, 'optionalAccess', _293 => _293.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
|
|
12766
12860
|
const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
|
|
12767
12861
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
12768
12862
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
12769
12863
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
12770
12864
|
const shouldMinify = nitroConfig.minify !== false;
|
|
12771
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
12865
|
+
const keepServerNames = !(_optionalChain([config, 'access', _294 => _294.docs, 'optionalAccess', _295 => _295.enabled]) && _optionalChain([config, 'access', _296 => _296.docs, 'access', _297 => _297.adapter, 'optionalAccess', _298 => _298.server]));
|
|
12772
12866
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
12773
12867
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
12774
12868
|
const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
|
|
12775
12869
|
if (ssrRollupPlugin) {
|
|
12776
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
12870
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _299 => _299.rollupConfig, 'optionalAccess', _300 => _300.plugins]);
|
|
12777
12871
|
nitroConfig.rollupConfig = {
|
|
12778
12872
|
...nitroConfig.rollupConfig,
|
|
12779
12873
|
plugins: [
|
|
@@ -12790,7 +12884,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
12790
12884
|
Array.from(routes, (route, index) => {
|
|
12791
12885
|
try {
|
|
12792
12886
|
return [decodeURI(route), index];
|
|
12793
|
-
} catch (
|
|
12887
|
+
} catch (e35) {
|
|
12794
12888
|
return [route, index];
|
|
12795
12889
|
}
|
|
12796
12890
|
})
|
|
@@ -12800,10 +12894,10 @@ function toFarmNodeResponse(request, response) {
|
|
|
12800
12894
|
const orderOf = (route) => _nullishCoalesce(prerenderOrder.get(route), () => ( Number.MAX_SAFE_INTEGER));
|
|
12801
12895
|
prerenderedRoutes.sort((a, b) => orderOf(a.route) - orderOf(b.route));
|
|
12802
12896
|
});
|
|
12803
|
-
if (_optionalChain([config, 'access',
|
|
12897
|
+
if (_optionalChain([config, 'access', _301 => _301.md, 'optionalAccess', _302 => _302.enabled])) {
|
|
12804
12898
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
12805
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
12806
|
-
const alternatePath =
|
|
12899
|
+
if (!route.contents || !_optionalChain([route, 'access', _303 => _303.contentType, 'optionalAccess', _304 => _304.toLowerCase, 'call', _305 => _305(), 'access', _306 => _306.includes, 'call', _307 => _307("html")])) return;
|
|
12900
|
+
const alternatePath = _chunkC2JOS77Zcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
|
|
12807
12901
|
routePathname: (pathname) => routeManager.toRoutePathname(pathname)
|
|
12808
12902
|
});
|
|
12809
12903
|
if (!alternatePath) return;
|
|
@@ -12825,7 +12919,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
12825
12919
|
}
|
|
12826
12920
|
if (config.security.csp && config.security.csp.nonce) {
|
|
12827
12921
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
12828
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
12922
|
+
if (!route.contents || !_optionalChain([route, 'access', _308 => _308.contentType, 'optionalAccess', _309 => _309.toLowerCase, 'call', _310 => _310(), 'access', _311 => _311.includes, 'call', _312 => _312("html")])) return;
|
|
12829
12923
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
12830
12924
|
if (!staticCsp) return;
|
|
12831
12925
|
route.contents = staticCsp.html;
|
|
@@ -12860,7 +12954,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
12860
12954
|
await nitroBuilder.copyPublicAssets(nitroInstance);
|
|
12861
12955
|
if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
|
|
12862
12956
|
nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
|
|
12863
|
-
const configuredPlugins = _optionalChain([prerendererConfig, 'access',
|
|
12957
|
+
const configuredPlugins = _optionalChain([prerendererConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.plugins]);
|
|
12864
12958
|
const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
|
|
12865
12959
|
prerendererConfig.rollupConfig = {
|
|
12866
12960
|
...prerendererConfig.rollupConfig,
|
|
@@ -12917,13 +13011,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
12917
13011
|
}
|
|
12918
13012
|
if (prerenderRoutes.length > 0) {
|
|
12919
13013
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
12920
|
-
const previousPrerender = process.env[
|
|
12921
|
-
process.env[
|
|
13014
|
+
const previousPrerender = process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV];
|
|
13015
|
+
process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV] = "1";
|
|
12922
13016
|
try {
|
|
12923
13017
|
await nitroBuilder.prerender(nitroInstance);
|
|
12924
13018
|
} finally {
|
|
12925
|
-
if (previousPrerender === void 0) delete process.env[
|
|
12926
|
-
else process.env[
|
|
13019
|
+
if (previousPrerender === void 0) delete process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV];
|
|
13020
|
+
else process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
12927
13021
|
}
|
|
12928
13022
|
}
|
|
12929
13023
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
|
|
@@ -13007,7 +13101,8 @@ function toFarmNodeResponse(request, response) {
|
|
|
13007
13101
|
buildDir: _path2.default.join(root, distDir),
|
|
13008
13102
|
middlewareRoutes: edgeMiddlewareRoutes,
|
|
13009
13103
|
guardedPages: edgeGuardedPrerenderRoutes
|
|
13010
|
-
}
|
|
13104
|
+
},
|
|
13105
|
+
prerenderRoutes.map(toPrerenderPublicPath)
|
|
13011
13106
|
);
|
|
13012
13107
|
}
|
|
13013
13108
|
_chunkQMNWKQL4cjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
|
|
@@ -13035,7 +13130,7 @@ async function populateCloudflareProcessEnv(serverDir, fs4) {
|
|
|
13035
13130
|
throw error;
|
|
13036
13131
|
}
|
|
13037
13132
|
const wrangler = JSON.parse(source);
|
|
13038
|
-
const flags =
|
|
13133
|
+
const flags = _chunkNLBHLPEOcjs.resolveCloudflareProcessEnvFlags.call(void 0, wrangler);
|
|
13039
13134
|
if (!flags) return;
|
|
13040
13135
|
await fs4.writeFile(
|
|
13041
13136
|
wranglerPath,
|
|
@@ -13098,7 +13193,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
13098
13193
|
await fs4.rename(src, dest);
|
|
13099
13194
|
return;
|
|
13100
13195
|
} catch (error) {
|
|
13101
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
13196
|
+
const code = _optionalChain([error, 'optionalAccess', _315 => _315.code]);
|
|
13102
13197
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
13103
13198
|
throw error;
|
|
13104
13199
|
}
|
|
@@ -13106,7 +13201,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
13106
13201
|
await fs4.cp(src, dest, { recursive: true, force: true });
|
|
13107
13202
|
await fs4.rm(src, { recursive: true, force: true });
|
|
13108
13203
|
}
|
|
13109
|
-
async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest, cronJobs, edgeMiddleware) {
|
|
13204
|
+
async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest, cronJobs, edgeMiddleware, prerenderedPages) {
|
|
13110
13205
|
const serverDir = _path2.default.join(outputDir, "server");
|
|
13111
13206
|
const functionsDir = _path2.default.join(outputDir, "functions");
|
|
13112
13207
|
const nitroFuncDir = _path2.default.join(functionsDir, "__nitro.func");
|
|
@@ -13124,7 +13219,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13124
13219
|
try {
|
|
13125
13220
|
await moveVercelOutputPath(publicDir, staticDir, fs4);
|
|
13126
13221
|
} catch (error) {
|
|
13127
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
13222
|
+
if (_optionalChain([error, 'optionalAccess', _316 => _316.code]) !== "ENOENT") throw error;
|
|
13128
13223
|
}
|
|
13129
13224
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
|
|
13130
13225
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
|
|
@@ -13138,7 +13233,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13138
13233
|
config.basePath
|
|
13139
13234
|
);
|
|
13140
13235
|
const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
|
|
13141
|
-
(route) => edgeMiddleware.guardedPages.some((pathname) =>
|
|
13236
|
+
(route) => edgeMiddleware.guardedPages.some((pathname) => _chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
|
|
13142
13237
|
);
|
|
13143
13238
|
if (edgeMiddlewareRoutes.length > 0) {
|
|
13144
13239
|
await writeFarmVercelEdgeMiddlewareFunction({
|
|
@@ -13154,7 +13249,8 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13154
13249
|
vercelConfig.routes = buildFarmVercelRoutes({
|
|
13155
13250
|
presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
|
|
13156
13251
|
runtimeRoutes,
|
|
13157
|
-
middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? [createFarmVercelEdgeMiddlewareRoute(edgeMiddleware.guardedPages, config.basePath)] : []
|
|
13252
|
+
middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? [createFarmVercelEdgeMiddlewareRoute(edgeMiddleware.guardedPages, config.basePath)] : [],
|
|
13253
|
+
canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
|
|
13158
13254
|
});
|
|
13159
13255
|
const vercelConfigWithWorkflowCrons = _chunkFSODPZRTcjs.applyFarmWorkflowVercelCrons.call(void 0,
|
|
13160
13256
|
vercelConfig,
|
|
@@ -13165,8 +13261,8 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13165
13261
|
_chunkQMNWKQL4cjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
13166
13262
|
}
|
|
13167
13263
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
13168
|
-
if (!_optionalChain([config, 'access',
|
|
13169
|
-
const [mainRoot, ...extraRoots] =
|
|
13264
|
+
if (!_optionalChain([config, 'access', _317 => _317.docs, 'optionalAccess', _318 => _318.enabled])) return;
|
|
13265
|
+
const [mainRoot, ...extraRoots] = _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs);
|
|
13170
13266
|
await copyFarmDocsRootContent(
|
|
13171
13267
|
mainRoot,
|
|
13172
13268
|
root,
|
|
@@ -13187,10 +13283,10 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
|
13187
13283
|
async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs4) {
|
|
13188
13284
|
const docsContentDir = resolveBuildDocsContentDir(docs, root, srcDir);
|
|
13189
13285
|
if (!docsContentDir) return;
|
|
13190
|
-
const lastModifiedManifest =
|
|
13286
|
+
const lastModifiedManifest = _chunkNAXKOTPPcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
13191
13287
|
fallback: "now"
|
|
13192
13288
|
});
|
|
13193
|
-
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access',
|
|
13289
|
+
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _319 => _319.unknown, 'optionalAccess', _320 => _320.length]), () => ( 0));
|
|
13194
13290
|
if (undatedPages > 0) {
|
|
13195
13291
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
13196
13292
|
`${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
|
|
@@ -13200,10 +13296,11 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
|
|
|
13200
13296
|
await fs4.mkdir(_path2.default.dirname(bundledContentDir), { recursive: true });
|
|
13201
13297
|
await fs4.cp(docsContentDir, bundledContentDir, {
|
|
13202
13298
|
recursive: true,
|
|
13203
|
-
force: true
|
|
13299
|
+
force: true,
|
|
13300
|
+
dereference: true
|
|
13204
13301
|
});
|
|
13205
13302
|
await fs4.writeFile(
|
|
13206
|
-
_path2.default.join(bundledContentDir,
|
|
13303
|
+
_path2.default.join(bundledContentDir, _chunkNAXKOTPPcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
|
|
13207
13304
|
`${JSON.stringify(lastModifiedManifest, null, 2)}
|
|
13208
13305
|
`
|
|
13209
13306
|
);
|
|
@@ -13229,7 +13326,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
13229
13326
|
if (!resolvePackageJson(projectRequire, "sharp")) {
|
|
13230
13327
|
try {
|
|
13231
13328
|
sharpRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
13232
|
-
} catch (
|
|
13329
|
+
} catch (e36) {
|
|
13233
13330
|
}
|
|
13234
13331
|
}
|
|
13235
13332
|
const copiedPackages = /* @__PURE__ */ new Map();
|
|
@@ -13274,7 +13371,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
13274
13371
|
try {
|
|
13275
13372
|
await copyPackage("sharp", sharpRequire);
|
|
13276
13373
|
if (!copiedPackages.has("sharp")) {
|
|
13277
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
13374
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkM6U6E4F7cjs.SHARP_INSTALL_HINT}`);
|
|
13278
13375
|
}
|
|
13279
13376
|
} catch (error) {
|
|
13280
13377
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -13356,7 +13453,7 @@ function resolveMetadataImageRuntimePackageJson(root) {
|
|
|
13356
13453
|
if (packageJsonPath) return packageJsonPath;
|
|
13357
13454
|
try {
|
|
13358
13455
|
return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
|
|
13359
|
-
} catch (
|
|
13456
|
+
} catch (e37) {
|
|
13360
13457
|
return null;
|
|
13361
13458
|
}
|
|
13362
13459
|
}
|
|
@@ -13403,7 +13500,7 @@ function resolvePackageJson(parentRequire, packageName) {
|
|
|
13403
13500
|
const resolved = parentRequire.resolve(request);
|
|
13404
13501
|
if (resolved.endsWith(".json")) return resolved;
|
|
13405
13502
|
_nullishCoalesce(metadataModule, () => ( (metadataModule = resolved)));
|
|
13406
|
-
} catch (
|
|
13503
|
+
} catch (e38) {
|
|
13407
13504
|
}
|
|
13408
13505
|
}
|
|
13409
13506
|
try {
|
|
@@ -13414,13 +13511,13 @@ function resolvePackageJson(parentRequire, packageName) {
|
|
|
13414
13511
|
try {
|
|
13415
13512
|
const manifest = JSON.parse(_fs.readFileSync.call(void 0, candidate, "utf8"));
|
|
13416
13513
|
if (manifest.name === packageName) return candidate;
|
|
13417
|
-
} catch (
|
|
13514
|
+
} catch (e39) {
|
|
13418
13515
|
}
|
|
13419
13516
|
}
|
|
13420
13517
|
if (_path2.default.basename(directory) === "node_modules") break;
|
|
13421
13518
|
directory = _path2.default.dirname(directory);
|
|
13422
13519
|
}
|
|
13423
|
-
} catch (
|
|
13520
|
+
} catch (e40) {
|
|
13424
13521
|
}
|
|
13425
13522
|
return null;
|
|
13426
13523
|
}
|
|
@@ -13431,7 +13528,7 @@ async function resolveProjectInstalledPackageDir(root, packageName, fs4) {
|
|
|
13431
13528
|
try {
|
|
13432
13529
|
const packageDir = await fs4.realpath(candidate);
|
|
13433
13530
|
if ((await fs4.stat(_path2.default.join(packageDir, "package.json"))).isFile()) return packageDir;
|
|
13434
|
-
} catch (
|
|
13531
|
+
} catch (e41) {
|
|
13435
13532
|
}
|
|
13436
13533
|
const parent = _path2.default.dirname(directory);
|
|
13437
13534
|
if (parent === directory) return null;
|
|
@@ -13444,7 +13541,7 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs4) {
|
|
|
13444
13541
|
const generatedClientDir = _path2.default.join(prismaClientDir, "..", "..", ".prisma", "client");
|
|
13445
13542
|
try {
|
|
13446
13543
|
await fs4.access(generatedClientDir);
|
|
13447
|
-
} catch (
|
|
13544
|
+
} catch (e42) {
|
|
13448
13545
|
return;
|
|
13449
13546
|
}
|
|
13450
13547
|
const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
|
|
@@ -13504,7 +13601,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
13504
13601
|
// src/build/index.ts
|
|
13505
13602
|
async function build(config, options = {}) {
|
|
13506
13603
|
return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
|
|
13507
|
-
() =>
|
|
13604
|
+
() => _chunkIEN2EFE5cjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
13508
13605
|
);
|
|
13509
13606
|
}
|
|
13510
13607
|
function createBuildTargetBaseline(config) {
|
|
@@ -13515,7 +13612,7 @@ function createBuildTargetBaseline(config) {
|
|
|
13515
13612
|
preset,
|
|
13516
13613
|
distDir,
|
|
13517
13614
|
outputDir,
|
|
13518
|
-
outputWasDerived: outputDir ===
|
|
13615
|
+
outputWasDerived: outputDir === _chunkXYVPTTUTcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
13519
13616
|
};
|
|
13520
13617
|
}
|
|
13521
13618
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -13524,8 +13621,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
13524
13621
|
const distDir = config.distDir || ".farm";
|
|
13525
13622
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
13526
13623
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
13527
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
13528
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
13624
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkXYVPTTUTcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
13625
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkXYVPTTUTcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
13529
13626
|
return {
|
|
13530
13627
|
root,
|
|
13531
13628
|
preset,
|
|
@@ -13533,7 +13630,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
13533
13630
|
distDir,
|
|
13534
13631
|
deployTarget,
|
|
13535
13632
|
outputDir,
|
|
13536
|
-
deployOutputDir:
|
|
13633
|
+
deployOutputDir: _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
13537
13634
|
};
|
|
13538
13635
|
}
|
|
13539
13636
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -13541,7 +13638,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13541
13638
|
const targetBaseline = createBuildTargetBaseline(config);
|
|
13542
13639
|
let targets;
|
|
13543
13640
|
const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))]);
|
|
13544
|
-
const pluginManager = new (0,
|
|
13641
|
+
const pluginManager = new (0, _chunkJFPKARWMcjs.PluginManager)({
|
|
13545
13642
|
config,
|
|
13546
13643
|
isDev: false,
|
|
13547
13644
|
isProd: true
|
|
@@ -13570,15 +13667,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13570
13667
|
};
|
|
13571
13668
|
config = {
|
|
13572
13669
|
...config,
|
|
13573
|
-
images:
|
|
13670
|
+
images: _chunkM6U6E4F7cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
13574
13671
|
root: targets.root,
|
|
13575
13672
|
preset: targets.preset
|
|
13576
13673
|
})
|
|
13577
13674
|
};
|
|
13578
|
-
if (_optionalChain([config, 'access',
|
|
13675
|
+
if (_optionalChain([config, 'access', _321 => _321.docs, 'optionalAccess', _322 => _322.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
|
|
13579
13676
|
pluginManager.updateContext({ config });
|
|
13580
13677
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
13581
|
-
|
|
13678
|
+
_chunkIEN2EFE5cjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkIEN2EFE5cjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
13582
13679
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
13583
13680
|
await pluginManager.setupPlugins();
|
|
13584
13681
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
@@ -13590,8 +13687,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13590
13687
|
});
|
|
13591
13688
|
_chunkQMNWKQL4cjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
13592
13689
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
13593
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
13594
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
13690
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _323 => _323.status]) === "rejected") throw productionViteResult.reason;
|
|
13691
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _324 => _324.value]);
|
|
13595
13692
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
13596
13693
|
projectModuleServer = await createProjectModuleServer(
|
|
13597
13694
|
createViteServer,
|
|
@@ -13599,18 +13696,18 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13599
13696
|
root,
|
|
13600
13697
|
rendererBuild.signal
|
|
13601
13698
|
);
|
|
13602
|
-
const farmApp =
|
|
13699
|
+
const farmApp = _chunkM6U6E4F7cjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
13603
13700
|
await farmApp.initialize();
|
|
13604
13701
|
const routeManager = farmApp.getRouteManager();
|
|
13605
13702
|
const serverRenderer = farmApp.getServerRenderer();
|
|
13606
|
-
const typeArtifacts =
|
|
13703
|
+
const typeArtifacts = _chunkK7JMTAFHcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
13607
13704
|
root,
|
|
13608
13705
|
srcDir,
|
|
13609
13706
|
layers: config.layers,
|
|
13610
13707
|
plugins: config.plugins,
|
|
13611
13708
|
extraRoutes: [
|
|
13612
|
-
..._optionalChain([config, 'access',
|
|
13613
|
-
...
|
|
13709
|
+
..._optionalChain([config, 'access', _325 => _325.openapi, 'optionalAccess', _326 => _326.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
13710
|
+
..._chunkNAXKOTPPcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
13614
13711
|
],
|
|
13615
13712
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
13616
13713
|
componentExtensions: config.renderer.componentExtensions,
|
|
@@ -13619,7 +13716,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13619
13716
|
const message = error instanceof Error ? error.message : String(error);
|
|
13620
13717
|
_chunkQMNWKQL4cjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
13621
13718
|
});
|
|
13622
|
-
const apiRouteManager = new (0,
|
|
13719
|
+
const apiRouteManager = new (0, _chunkK66JILV3cjs.APIRouteManager)(
|
|
13623
13720
|
_chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config),
|
|
13624
13721
|
projectModuleServer,
|
|
13625
13722
|
{
|
|
@@ -13694,7 +13791,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13694
13791
|
throw error;
|
|
13695
13792
|
} finally {
|
|
13696
13793
|
try {
|
|
13697
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
13794
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _327 => _327.close, 'call', _328 => _328()]);
|
|
13698
13795
|
} finally {
|
|
13699
13796
|
rendererBuild.abort();
|
|
13700
13797
|
}
|
|
@@ -13706,7 +13803,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13706
13803
|
ssr: true,
|
|
13707
13804
|
buildLifetime
|
|
13708
13805
|
});
|
|
13709
|
-
const viteConfig =
|
|
13806
|
+
const viteConfig = _chunkM6U6E4F7cjs.mergeFarmViteConfig.call(void 0,
|
|
13710
13807
|
{
|
|
13711
13808
|
root,
|
|
13712
13809
|
appType: "custom",
|
|
@@ -13718,12 +13815,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13718
13815
|
},
|
|
13719
13816
|
plugins: [
|
|
13720
13817
|
...rendererVitePlugins,
|
|
13721
|
-
|
|
13818
|
+
_chunkM6U6E4F7cjs.farmFontImportsPlugin.call(void 0, {
|
|
13722
13819
|
root,
|
|
13723
13820
|
basePath: config.basePath,
|
|
13724
13821
|
publicDir: config.publicDir
|
|
13725
13822
|
}),
|
|
13726
|
-
|
|
13823
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
|
|
13727
13824
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
13728
13825
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
13729
13826
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
@@ -13735,7 +13832,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13735
13832
|
hmr: false
|
|
13736
13833
|
},
|
|
13737
13834
|
resolve: {
|
|
13738
|
-
alias:
|
|
13835
|
+
alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
13739
13836
|
dedupe: [...config.renderer.dedupe || []]
|
|
13740
13837
|
},
|
|
13741
13838
|
optimizeDeps: {
|
|
@@ -13774,10 +13871,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13774
13871
|
noDiscovery: true
|
|
13775
13872
|
},
|
|
13776
13873
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
13777
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
13874
|
+
environments: _optionalChain([viteConfig, 'access', _329 => _329.environments, 'optionalAccess', _330 => _330.ssr, 'optionalAccess', _331 => _331.dev, 'optionalAccess', _332 => _332.createEnvironment]) ? viteConfig.environments : {
|
|
13778
13875
|
...viteConfig.environments,
|
|
13779
13876
|
ssr: {
|
|
13780
|
-
..._optionalChain([viteConfig, 'access',
|
|
13877
|
+
..._optionalChain([viteConfig, 'access', _333 => _333.environments, 'optionalAccess', _334 => _334.ssr]),
|
|
13781
13878
|
...await createFarmProjectModuleSsrEnvironment()
|
|
13782
13879
|
}
|
|
13783
13880
|
}
|
|
@@ -13785,7 +13882,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13785
13882
|
}
|
|
13786
13883
|
async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
13787
13884
|
const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
13788
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
13885
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
|
|
13789
13886
|
const pluginManager = new PluginManager2({
|
|
13790
13887
|
config,
|
|
13791
13888
|
isDev: false,
|
|
@@ -13805,14 +13902,14 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
13805
13902
|
farmI18nClientBridgePlugin(),
|
|
13806
13903
|
farmServerOnlyEntriesPlugin(),
|
|
13807
13904
|
farmPlugin(config, pluginManager),
|
|
13808
|
-
|
|
13905
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
13809
13906
|
],
|
|
13810
13907
|
mode: "production"
|
|
13811
13908
|
});
|
|
13812
13909
|
}
|
|
13813
13910
|
async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
13814
13911
|
const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.cjs");
|
|
13815
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
13912
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
|
|
13816
13913
|
const pluginManager = new PluginManager2({
|
|
13817
13914
|
config,
|
|
13818
13915
|
isDev: false,
|
|
@@ -13833,12 +13930,12 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
13833
13930
|
define: {
|
|
13834
13931
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
13835
13932
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
13836
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
13933
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _335 => _335.env, 'optionalAccess', _336 => _336.public]) || {})
|
|
13837
13934
|
},
|
|
13838
13935
|
plugins: [
|
|
13839
13936
|
farmI18nClientBridgePlugin(),
|
|
13840
13937
|
farmPlugin(config, pluginManager),
|
|
13841
|
-
|
|
13938
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
13842
13939
|
],
|
|
13843
13940
|
mode: "production"
|
|
13844
13941
|
});
|
|
@@ -13866,7 +13963,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
13866
13963
|
if (pluginManager) {
|
|
13867
13964
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
13868
13965
|
}
|
|
13869
|
-
const outputDir =
|
|
13966
|
+
const outputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
13870
13967
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
13871
13968
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
13872
13969
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -13925,7 +14022,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
13925
14022
|
const { readFile } = await import("fs/promises");
|
|
13926
14023
|
const manifestContent = await readFile(clientManifestPath, "utf-8");
|
|
13927
14024
|
farmRegistry.clientManifest = JSON.parse(manifestContent);
|
|
13928
|
-
} catch (
|
|
14025
|
+
} catch (e43) {
|
|
13929
14026
|
farmRegistry.clientManifest = {};
|
|
13930
14027
|
}
|
|
13931
14028
|
} catch (error) {
|
|
@@ -13937,7 +14034,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
13937
14034
|
root,
|
|
13938
14035
|
preset,
|
|
13939
14036
|
distDir,
|
|
13940
|
-
outputDir:
|
|
14037
|
+
outputDir: _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
13941
14038
|
});
|
|
13942
14039
|
}
|
|
13943
14040
|
}
|