@farm.js/core 0.1.69 → 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-DOfBMEzP.d.mts → agent-mcp.d-DulgFLBt.d.ts} +13 -4
- package/dist/{agent-mcp.d-DnIgriX1.d.ts → 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-NAL5TJUP.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 -7
- package/dist/api.d.ts +8 -7
- package/dist/api.mjs +5 -5
- package/dist/{app-manifest.d-_BVbI0xp.d.mts → app-manifest.d-6zXb90o6.d.mts} +1 -1
- package/dist/{app-manifest.d-CaAcaukR.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-BWeDqOaF.d.ts → app.d-C2xeMIYT.d.ts} +18 -8
- package/dist/{app.d-CaPwtytN.d.mts → app.d-DF0aundc.d.mts} +18 -8
- package/dist/{base-path.d-CTDVF0Fc.d.mts → base-path.d-BJ3SYpB8.d.mts} +6 -1
- package/dist/{base-path.d-CTDVF0Fc.d.ts → base-path.d-BJ3SYpB8.d.ts} +6 -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-F6YLXK5L.cjs → chunk-32SYRIQ7.cjs} +18 -18
- package/dist/{chunk-CV6MFQ4Y.mjs → chunk-3AUINHFG.mjs} +1 -1
- package/dist/{chunk-ZYCEEE3V.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-SZORL7EW.mjs → chunk-3WS5AZ3R.mjs} +5 -5
- 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-ABIBASLJ.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-ZR2QB45W.mjs → chunk-A2TH5MKE.mjs} +4 -4
- package/dist/{chunk-L5OZN6YW.cjs → chunk-A7HCBHMC.cjs} +3 -3
- package/dist/{chunk-VX2HZGC7.cjs → chunk-ACGBXN3U.cjs} +2 -2
- package/dist/{chunk-TKYOJ5G2.cjs → chunk-BPUVDCGG.cjs} +5 -5
- package/dist/{chunk-FT6KJHS3.cjs → chunk-C2JOS77Z.cjs} +4 -1
- package/dist/{chunk-UHU4QALN.mjs → chunk-CCHJWJGP.mjs} +177 -102
- package/dist/{chunk-CRVSYDHV.mjs → chunk-CKQAQFF6.mjs} +2 -2
- package/dist/chunk-DC2AXGNZ.mjs +129 -0
- package/dist/{chunk-4W4ZWSV2.cjs → chunk-DIHBWZDZ.cjs} +391 -335
- package/dist/{chunk-Q4HH5Q6A.cjs → chunk-DMXMIE2C.cjs} +2 -2
- 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-PEYDQMSA.mjs → chunk-EDZU7YRK.mjs} +5 -5
- 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-L6NWQ3DR.cjs → chunk-FJ5YCERM.cjs} +375 -300
- package/dist/{chunk-PDFFYZAT.cjs → chunk-GF22VGMS.cjs} +2 -2
- package/dist/{chunk-OOJBBHYW.cjs → chunk-GVYZCJZH.cjs} +30 -1
- package/dist/{chunk-5TOWKGV3.mjs → chunk-HAXFV2CD.mjs} +1 -1
- package/dist/{chunk-YOHHL2UE.mjs → chunk-I4KPA2C6.mjs} +1 -1
- package/dist/{chunk-4JRAMCUP.cjs → chunk-I7NUT24Z.cjs} +22 -22
- package/dist/{chunk-VO65MYJD.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-PDQ6EGPK.mjs → chunk-JFVT5ZZV.mjs} +2 -2
- package/dist/{chunk-ULMXZYOA.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-GQ6QOH7T.cjs → chunk-K4UGCUXX.cjs} +12 -12
- 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-CKCKCUYO.mjs → chunk-KPMLDT3B.mjs} +146 -90
- package/dist/{chunk-KI3MU7B5.mjs → chunk-LDVJIBGN.mjs} +1 -1
- package/dist/{chunk-GUMKIQJL.cjs → chunk-LECZ5DPZ.cjs} +2 -2
- package/dist/{chunk-5FBZJJGA.mjs → chunk-LXEJNWF5.mjs} +2 -2
- package/dist/{chunk-DHR2WDSL.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-22LGTSBA.cjs → chunk-MZLJFNMH.cjs} +1 -1
- package/dist/{chunk-MAGFDK4Q.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-ANMIR6US.mjs → chunk-NYF7A4UW.mjs} +1 -1
- package/dist/{chunk-QO43L7Z4.cjs → chunk-O32QPFVV.cjs} +25 -7
- package/dist/{chunk-CO6UYM2D.mjs → chunk-O5QUJEWT.mjs} +1 -1
- package/dist/{chunk-JL2YW5KX.mjs → chunk-OAEDVXVE.mjs} +44 -1
- package/dist/{chunk-GTQOEEE7.cjs → chunk-Q5HMVGR5.cjs} +13 -13
- package/dist/{chunk-5NFQ6AZI.cjs → chunk-QEWWKYDL.cjs} +25 -10
- package/dist/{chunk-QOSDWGKT.mjs → chunk-QVBXTSIZ.mjs} +1 -1
- package/dist/{chunk-2P7UYHZP.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-IYLZZTP6.mjs → chunk-RMOU3PR4.mjs} +112 -62
- package/dist/{chunk-WYL4ODZ4.mjs → chunk-SE7HPBYK.mjs} +30 -1
- package/dist/{chunk-D5F7RPZP.mjs → chunk-THG2TVDH.mjs} +3 -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-6GQJVY4E.cjs → chunk-XYVPTTUT.cjs} +13 -13
- 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-CnEeVvGG.d.mts → client-component.d-Bk5qKJM-.d.mts} +2 -2
- package/dist/{client-component.d-CfJxuXZl.d.ts → client-component.d-DNbC4oWI.d.ts} +2 -2
- package/dist/{client-plugins.d-D7dHV1Nf.d.ts → client-plugins.d-DwUqh4gp.d.ts} +36 -3
- package/dist/{client-plugins.d-Do5ULA0x.d.mts → client-plugins.d-Pi9nG0W0.d.mts} +36 -3
- 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-BP4EBTKQ.mjs → devtools-CB43AHEP.mjs} +8 -7
- package/dist/{devtools-7HNDS4SY.cjs → devtools-L5DUNDF3.cjs} +9 -8
- package/dist/docs.cjs +12 -11
- package/dist/docs.d.mts +4 -3
- package/dist/docs.d.ts +4 -3
- package/dist/docs.mjs +11 -10
- 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/index.cjs +46 -43
- package/dist/{index.d-B1MpEJAo.d.mts → index.d-CbvOjJcp.d.mts} +1 -1
- package/dist/{index.d-CVFk37uX.d.ts → index.d-c9UwIqDy.d.ts} +1 -1
- package/dist/index.d.mts +25 -23
- package/dist/index.d.ts +25 -23
- package/dist/index.mjs +59 -56
- 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 +35 -35
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +34 -34
- 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 +48 -17
- package/dist/internal/production-runtime.d.mts +48 -18
- package/dist/internal/production-runtime.d.ts +48 -18
- package/dist/internal/production-runtime.mjs +50 -19
- 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-CBqr-LfI.d.mts → mount.d-BvWxf8ZE.d.mts} +1 -1
- package/dist/{mount.d-CGzN61Kq.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-BwCOhpj7.d.mts → navigation-delegate.d-CMyl1h2l.d.mts} +1 -1
- package/dist/{navigation-delegate.d-CLH2dXjy.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.cjs +28 -27
- package/dist/plugin.d.mts +6 -4
- package/dist/plugin.d.ts +6 -4
- package/dist/plugin.mjs +27 -26
- 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-W6LmjD6y.d.ts → render-plan.d-DQj2bzd2.d.ts} +1 -1
- package/dist/{render-plan.d-CzGDjcT0.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-CTVRZiQv.d.ts → request.d-C5vyoYeL.d.ts} +1 -1
- package/dist/{request.d-CgNVderU.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-D0bmZVJA.d.mts → route-rendering.d-C-et2TZ1.d.mts} +9 -2
- package/dist/{route-rendering.d-FDSNtCMg.d.ts → route-rendering.d-DhsY5M2I.d.ts} +9 -2
- package/dist/{router.d-GRKm_uAV.d.mts → router.d-BMDS5s5X.d.mts} +1 -1
- package/dist/{router.d-DZ3ldniI.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-PJZOVYSY.mjs → rsc-pipeline-AXQJCCHI.mjs} +12 -11
- package/dist/{rsc-pipeline-J4KKBSCH.cjs → rsc-pipeline-NJKLZ3YE.cjs} +13 -12
- package/dist/{runtime-OLEO5NXF.cjs → runtime-DMW6DDOI.cjs} +19 -18
- package/dist/{runtime-QDBSE4H6.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-DqXihlxm.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-pqFQBU2N.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 +60 -52
- package/dist/server.d.mts +23 -14
- package/dist/server.d.ts +23 -14
- package/dist/server.mjs +38 -30
- package/dist/{spa-router.d-DhOhaQ-7.d.ts → spa-router.d-l0d9pPZj.d.ts} +3 -3
- package/dist/{spa-router.d-Dhvy60p4.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-BVCMRRau.d.ts → utils.d-BK-PTOF8.d.ts} +1 -1
- package/dist/{utils.d-Q8EHCpkF.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 +35 -27
- package/dist/vite.d.mts +26 -6
- package/dist/vite.d.ts +26 -6
- package/dist/vite.mjs +34 -26
- package/package.json +2 -2
- package/dist/analyzer-SAJSV6SP.cjs +0 -16
- package/dist/response.d-BolW0Vx_.d.mts +0 -10
- package/dist/response.d-BolW0Vx_.d.ts +0 -10
|
@@ -26,7 +26,7 @@ var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkA7HCBHMCcjs = require('./chunk-A7HCBHMC.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
@@ -41,7 +41,7 @@ var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _chunkI7NUT24Zcjs = require('./chunk-I7NUT24Z.cjs');
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
@@ -54,7 +54,7 @@ var _chunk4JRAMCUPcjs = require('./chunk-4JRAMCUP.cjs');
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var
|
|
57
|
+
var _chunkNAXKOTPPcjs = require('./chunk-NAXKOTPP.cjs');
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
@@ -62,10 +62,10 @@ var _chunkFVYBEMODcjs = require('./chunk-FVYBEMOD.cjs');
|
|
|
62
62
|
var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunkJWY66PIDcjs = require('./chunk-JWY66PID.cjs');
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
var
|
|
68
|
+
var _chunkBPUVDCGGcjs = require('./chunk-BPUVDCGG.cjs');
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
@@ -74,7 +74,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
var
|
|
77
|
+
var _chunkXYVPTTUTcjs = require('./chunk-XYVPTTUT.cjs');
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
|
|
@@ -110,12 +110,12 @@ var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
|
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
var
|
|
113
|
+
var _chunkM6U6E4F7cjs = require('./chunk-M6U6E4F7.cjs');
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
|
|
118
|
-
var
|
|
118
|
+
var _chunkDMXMIE2Ccjs = require('./chunk-DMXMIE2C.cjs');
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
var _chunkJFPKARWMcjs = require('./chunk-JFPKARWM.cjs');
|
|
@@ -123,7 +123,7 @@ var _chunkJFPKARWMcjs = require('./chunk-JFPKARWM.cjs');
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
var
|
|
126
|
+
var _chunkK7JMTAFHcjs = require('./chunk-K7JMTAFH.cjs');
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
|
|
@@ -136,7 +136,7 @@ var _chunkQOGIZKSOcjs = require('./chunk-QOGIZKSO.cjs');
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
var
|
|
139
|
+
var _chunk2MR4MABGcjs = require('./chunk-2MR4MABG.cjs');
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
@@ -150,15 +150,15 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
|
|
153
|
-
var
|
|
153
|
+
var _chunkK4UGCUXXcjs = require('./chunk-K4UGCUXX.cjs');
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
var
|
|
158
|
+
var _chunkVG6HYT5Kcjs = require('./chunk-VG6HYT5K.cjs');
|
|
159
159
|
|
|
160
160
|
|
|
161
|
-
var
|
|
161
|
+
var _chunkLECZ5DPZcjs = require('./chunk-LECZ5DPZ.cjs');
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
@@ -176,7 +176,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
|
176
176
|
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
var
|
|
179
|
+
var _chunkIEN2EFE5cjs = require('./chunk-IEN2EFE5.cjs');
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
|
|
@@ -223,14 +223,14 @@ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
|
|
|
223
223
|
var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
224
224
|
|
|
225
225
|
|
|
226
|
-
var
|
|
226
|
+
var _chunkNSZY3EWGcjs = require('./chunk-NSZY3EWG.cjs');
|
|
227
227
|
|
|
228
228
|
|
|
229
229
|
|
|
230
230
|
var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
231
231
|
|
|
232
232
|
|
|
233
|
-
var
|
|
233
|
+
var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
|
|
234
234
|
|
|
235
235
|
|
|
236
236
|
var _chunkASYOWPSRcjs = require('./chunk-ASYOWPSR.cjs');
|
|
@@ -241,7 +241,7 @@ var _chunkFSODPZRTcjs = require('./chunk-FSODPZRT.cjs');
|
|
|
241
241
|
|
|
242
242
|
|
|
243
243
|
|
|
244
|
-
var
|
|
244
|
+
var _chunkJX5VOLAVcjs = require('./chunk-JX5VOLAV.cjs');
|
|
245
245
|
|
|
246
246
|
|
|
247
247
|
var _chunkZOYKJBP5cjs = require('./chunk-ZOYKJBP5.cjs');
|
|
@@ -255,7 +255,7 @@ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
|
|
|
255
255
|
var _chunkMHLNWRCJcjs = require('./chunk-MHLNWRCJ.cjs');
|
|
256
256
|
|
|
257
257
|
|
|
258
|
-
var
|
|
258
|
+
var _chunkK66JILV3cjs = require('./chunk-K66JILV3.cjs');
|
|
259
259
|
|
|
260
260
|
|
|
261
261
|
var _chunkBBPDJGCUcjs = require('./chunk-BBPDJGCU.cjs');
|
|
@@ -282,14 +282,14 @@ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
|
282
282
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
283
283
|
|
|
284
284
|
|
|
285
|
-
var
|
|
285
|
+
var _chunkMZLJFNMHcjs = require('./chunk-MZLJFNMH.cjs');
|
|
286
286
|
|
|
287
287
|
|
|
288
|
-
var
|
|
288
|
+
var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
289
289
|
|
|
290
290
|
|
|
291
291
|
|
|
292
|
-
var
|
|
292
|
+
var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
|
|
293
293
|
|
|
294
294
|
|
|
295
295
|
var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
|
|
@@ -419,7 +419,7 @@ function getDocsTitle(docs) {
|
|
|
419
419
|
return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
|
|
420
420
|
}
|
|
421
421
|
function loadPages(contentDir, docs) {
|
|
422
|
-
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));
|
|
423
423
|
}
|
|
424
424
|
function findSocialImagePath(html, basePath) {
|
|
425
425
|
const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
|
|
@@ -437,7 +437,7 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
|
|
|
437
437
|
return response;
|
|
438
438
|
}
|
|
439
439
|
async function compileFarmDocsManifest(docs, options) {
|
|
440
|
-
const contentDir =
|
|
440
|
+
const contentDir = _chunkNAXKOTPPcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
|
|
441
441
|
const pages = loadPages(contentDir, docs);
|
|
442
442
|
const basePath = _chunkD22BUQKWcjs.normalizeFarmBasePath.call(void 0, options.basePath);
|
|
443
443
|
const absolutePaths = [
|
|
@@ -445,7 +445,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
445
445
|
_path2.default.resolve(contentDir),
|
|
446
446
|
docs.configPath || ""
|
|
447
447
|
];
|
|
448
|
-
const handler =
|
|
448
|
+
const handler = _chunkNAXKOTPPcjs.createFarmDocsHandler.call(void 0, docs, {
|
|
449
449
|
root: options.root,
|
|
450
450
|
srcDir: options.srcDir,
|
|
451
451
|
clientEntry: options.clientEntry,
|
|
@@ -455,7 +455,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
455
455
|
isPathGuarded: options.isPathGuarded,
|
|
456
456
|
basePath
|
|
457
457
|
});
|
|
458
|
-
const apiHandler =
|
|
458
|
+
const apiHandler = _chunkI7NUT24Zcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
459
459
|
rootDir: options.root,
|
|
460
460
|
srcDir: options.srcDir,
|
|
461
461
|
docs,
|
|
@@ -467,7 +467,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
467
467
|
const apiMarkdown = {};
|
|
468
468
|
for (const page of pages) {
|
|
469
469
|
const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
|
|
470
|
-
const markdownPath =
|
|
470
|
+
const markdownPath = _chunkNAXKOTPPcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
|
|
471
471
|
await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
|
|
472
472
|
if (htmlResponse) {
|
|
473
473
|
const socialImagePath = findSocialImagePath(await htmlResponse.text(), basePath);
|
|
@@ -552,7 +552,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
552
552
|
post: await compileResponse(postResponse, absolutePaths),
|
|
553
553
|
search: {
|
|
554
554
|
pages: publicPages.map((page) => ({
|
|
555
|
-
...
|
|
555
|
+
..._chunkNAXKOTPPcjs.toFarmDocsMarkdownPage.call(void 0, page, basePath),
|
|
556
556
|
sourcePath: `farm-docs:${page.slug || "index"}`
|
|
557
557
|
})),
|
|
558
558
|
search: _nullishCoalesce(searchConfig, () => ( true)),
|
|
@@ -730,7 +730,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
730
730
|
const routes = [];
|
|
731
731
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
732
732
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
733
|
-
const rendering = await
|
|
733
|
+
const rendering = await _chunkK7JMTAFHcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
734
734
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
735
735
|
routes.push({
|
|
736
736
|
kind: "page",
|
|
@@ -803,7 +803,7 @@ async function writeFarmRouteRuntimeManifest(directory, manifest) {
|
|
|
803
803
|
return manifestPath;
|
|
804
804
|
}
|
|
805
805
|
function validateFarmRouteRuntimeDeployment(manifest, preset) {
|
|
806
|
-
const runtime =
|
|
806
|
+
const runtime = _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset);
|
|
807
807
|
const warnings = /* @__PURE__ */ new Set();
|
|
808
808
|
for (const route of manifest.routes) {
|
|
809
809
|
if (route.rendering === "static") continue;
|
|
@@ -1060,7 +1060,7 @@ function collectServerOnlySSRAssets(bundle) {
|
|
|
1060
1060
|
return serverOnly;
|
|
1061
1061
|
}
|
|
1062
1062
|
function canReadServerFiles(preset) {
|
|
1063
|
-
return
|
|
1063
|
+
return _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" && !preset.startsWith("cloudflare");
|
|
1064
1064
|
}
|
|
1065
1065
|
function assertServerReadSSRAssetsSupported(bundle, preset, root) {
|
|
1066
1066
|
if (canReadServerFiles(preset)) return;
|
|
@@ -1140,10 +1140,19 @@ const CREDENTIAL_VARY = /(?:^|,)\\s*(?:\\*|cookie|authorization)\\s*(?:,|$)/i;
|
|
|
1140
1140
|
// What Nitro's entry sets when the response has no Cache-Control of its own.
|
|
1141
1141
|
const NITRO_DEFAULT_CACHE_CONTROL = "public, max-age=0, must-revalidate";
|
|
1142
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
|
+
|
|
1143
1152
|
function isSharedCacheable(request, response) {
|
|
1144
1153
|
return (
|
|
1145
1154
|
response.status === 200 &&
|
|
1146
|
-
!request.headers.
|
|
1155
|
+
!hasVisitorCookies(request.headers.get("cookie")) &&
|
|
1147
1156
|
!request.headers.has("authorization") &&
|
|
1148
1157
|
!response.headers.has("set-cookie") &&
|
|
1149
1158
|
!PRIVATE_CACHE_DIRECTIVE.test(response.headers.get("cache-control") || "") &&
|
|
@@ -1255,7 +1264,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1255
1264
|
// removed block used (`readFileSync` for a version, say).
|
|
1256
1265
|
enforce: "pre",
|
|
1257
1266
|
transform: {
|
|
1258
|
-
filter: { id:
|
|
1267
|
+
filter: { id: _chunkM6U6E4F7cjs.fileNamePattern.call(void 0, configFiles) },
|
|
1259
1268
|
async handler(code, id) {
|
|
1260
1269
|
const file = id.split("?", 1)[0];
|
|
1261
1270
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -1483,7 +1492,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
1483
1492
|
logLevel: "silent",
|
|
1484
1493
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
1485
1494
|
resolve: {
|
|
1486
|
-
alias:
|
|
1495
|
+
alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
1487
1496
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
1488
1497
|
},
|
|
1489
1498
|
transform: {
|
|
@@ -1830,7 +1839,7 @@ function hasReactDomEdgeServerBuild(root) {
|
|
|
1830
1839
|
}
|
|
1831
1840
|
}
|
|
1832
1841
|
function shouldAliasReactServerToWebBuild(renderer, preset) {
|
|
1833
|
-
return _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) &&
|
|
1842
|
+
return _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
|
|
1834
1843
|
}
|
|
1835
1844
|
function isCloudflareImagePreset(preset) {
|
|
1836
1845
|
return preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module";
|
|
@@ -1872,7 +1881,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
1872
1881
|
return {
|
|
1873
1882
|
name: "farm-omitted-metadata-image-runtime",
|
|
1874
1883
|
resolveId: {
|
|
1875
|
-
filter: { id:
|
|
1884
|
+
filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
1876
1885
|
handler(source, importer) {
|
|
1877
1886
|
if (source !== "@vercel/og") return null;
|
|
1878
1887
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -1881,7 +1890,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
1881
1890
|
}
|
|
1882
1891
|
},
|
|
1883
1892
|
load: {
|
|
1884
|
-
filter: { id:
|
|
1893
|
+
filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
1885
1894
|
handler(id) {
|
|
1886
1895
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
1887
1896
|
return `
|
|
@@ -2205,7 +2214,7 @@ function hasFarmPluginRoutes(config) {
|
|
|
2205
2214
|
}
|
|
2206
2215
|
function farmServerRuntimePluginsMayHandlePath(config, pathname) {
|
|
2207
2216
|
return (config.plugins || []).some(
|
|
2208
|
-
(plugin) =>
|
|
2217
|
+
(plugin) => _chunkJX5VOLAVcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && // Mobile session tokens change only bearer requests and cookie-clearing responses, which a
|
|
2209
2218
|
// prerendered file never answers or sends; its endpoints live under /__farm/.
|
|
2210
2219
|
plugin.name !== _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
|
|
2211
2220
|
);
|
|
@@ -2253,7 +2262,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
2253
2262
|
return Array.from(routes.values()).sort(_chunkMHLNWRCJcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
|
|
2254
2263
|
}
|
|
2255
2264
|
function assertFarmDocsRuntimeSupported(config, preset) {
|
|
2256
|
-
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)) {
|
|
2257
2266
|
return;
|
|
2258
2267
|
}
|
|
2259
2268
|
throw new Error(
|
|
@@ -2266,7 +2275,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
2266
2275
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
2267
2276
|
const srcDir = config.srcDir || "src";
|
|
2268
2277
|
const distDir = config.distDir || ".farm";
|
|
2269
|
-
const deployOutputDir =
|
|
2278
|
+
const deployOutputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
2270
2279
|
const lifecyclePluginManager = options.pluginManager;
|
|
2271
2280
|
const productionViteResultPromise = Promise.allSettled([
|
|
2272
2281
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
|
|
@@ -2285,7 +2294,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
2285
2294
|
const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
|
|
2286
2295
|
const pageRoutes = [];
|
|
2287
2296
|
for (const [pattern, entry] of routeManager.getRoutes()) {
|
|
2288
|
-
const markdownSourcePath = entry.markdownSourcePath || (
|
|
2297
|
+
const markdownSourcePath = entry.markdownSourcePath || (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
|
|
2289
2298
|
pageRoutes.push({
|
|
2290
2299
|
pattern,
|
|
2291
2300
|
...entry.directory ? { directory: entry.directory } : {},
|
|
@@ -2497,13 +2506,16 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2497
2506
|
function shouldBuildFarmMobileClient(config) {
|
|
2498
2507
|
return Boolean(config.mobileClient) && !config.desktop;
|
|
2499
2508
|
}
|
|
2500
|
-
function
|
|
2509
|
+
function varyFarmNitroCacheRules(rules, headerNames) {
|
|
2510
|
+
if (headerNames.length === 0) return rules;
|
|
2501
2511
|
return Object.fromEntries(
|
|
2502
2512
|
Object.entries(rules).map(([source, rule]) => {
|
|
2503
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;
|
|
2504
2514
|
if (!cached || rule.cache === false) return [source, rule];
|
|
2505
2515
|
const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
|
|
2506
|
-
const varies = [
|
|
2516
|
+
const varies = [
|
|
2517
|
+
.../* @__PURE__ */ new Set([...Array.isArray(cache.varies) ? cache.varies : [], ...headerNames])
|
|
2518
|
+
];
|
|
2507
2519
|
return [source, { ...rule, cache: { ...cache, varies } }];
|
|
2508
2520
|
})
|
|
2509
2521
|
);
|
|
@@ -2551,7 +2563,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
2551
2563
|
}
|
|
2552
2564
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
2553
2565
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
2554
|
-
await fs4.writeFile(clientCssPath,
|
|
2566
|
+
await fs4.writeFile(clientCssPath, _chunkM6U6E4F7cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
2555
2567
|
}
|
|
2556
2568
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
2557
2569
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -2604,7 +2616,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2604
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)}`;
|
|
2605
2617
|
let plan = cache.get(key);
|
|
2606
2618
|
if (!plan) {
|
|
2607
|
-
plan =
|
|
2619
|
+
plan = _chunkIEN2EFE5cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2608
2620
|
cache.set(key, plan);
|
|
2609
2621
|
}
|
|
2610
2622
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2622,7 +2634,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2622
2634
|
});
|
|
2623
2635
|
pluginManager.addPlugins(config.plugins || []);
|
|
2624
2636
|
const clientPages = [];
|
|
2625
|
-
const integrationProviders =
|
|
2637
|
+
const integrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
|
|
2626
2638
|
(provider) => provider.component || provider.type === "clerk"
|
|
2627
2639
|
);
|
|
2628
2640
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
@@ -2633,14 +2645,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2633
2645
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2634
2646
|
);
|
|
2635
2647
|
}
|
|
2636
|
-
const isolatedMode =
|
|
2648
|
+
const isolatedMode = _chunkIEN2EFE5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2637
2649
|
_optionalChain([config, 'access', _85 => _85.experimental, 'optionalAccess', _86 => _86.isolatedClientHydration]),
|
|
2638
2650
|
{
|
|
2639
2651
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _87 => _87.experimental, 'optionalAccess', _88 => _88.serverComponents])) === "rsc",
|
|
2640
2652
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2641
2653
|
}
|
|
2642
2654
|
);
|
|
2643
|
-
const planOptions =
|
|
2655
|
+
const planOptions = _chunkIEN2EFE5cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2644
2656
|
config.renderer,
|
|
2645
2657
|
Boolean(unsupportedIntegrationProvider)
|
|
2646
2658
|
);
|
|
@@ -2697,13 +2709,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2697
2709
|
};
|
|
2698
2710
|
}
|
|
2699
2711
|
});
|
|
2700
|
-
const layoutAppliesToRoute =
|
|
2712
|
+
const layoutAppliesToRoute = _chunk2MR4MABGcjs.routeBoundaryCoversDirectory;
|
|
2701
2713
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
2702
2714
|
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverComponents])) === "islands";
|
|
2703
2715
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2704
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
|
|
2705
2717
|
);
|
|
2706
|
-
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(
|
|
2707
2719
|
(docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
|
|
2708
2720
|
) : [];
|
|
2709
2721
|
const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
|
|
@@ -2712,7 +2724,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2712
2724
|
);
|
|
2713
2725
|
const syntheticDocsEntry = _optionalChain([config, 'access', _100 => _100.docs, 'optionalAccess', _101 => _101.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2714
2726
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2715
|
-
const markdownPagePlan =
|
|
2727
|
+
const markdownPagePlan = _chunkIEN2EFE5cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2716
2728
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2717
2729
|
root,
|
|
2718
2730
|
isolatedMode,
|
|
@@ -2720,7 +2732,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2720
2732
|
);
|
|
2721
2733
|
const routePlans = pageRoutes.map((route) => ({
|
|
2722
2734
|
route,
|
|
2723
|
-
metadata:
|
|
2735
|
+
metadata: _chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
2724
2736
|
route.modulePath,
|
|
2725
2737
|
root,
|
|
2726
2738
|
isolatedMode,
|
|
@@ -2728,7 +2740,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2728
2740
|
pagePlanOptions
|
|
2729
2741
|
)
|
|
2730
2742
|
}));
|
|
2731
|
-
|
|
2743
|
+
_chunkIEN2EFE5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2732
2744
|
clientLayouts.map((layout) => ({
|
|
2733
2745
|
pattern: layout.pattern,
|
|
2734
2746
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2737,7 +2749,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2737
2749
|
[
|
|
2738
2750
|
...routePlans.map(({ route, metadata }) => ({
|
|
2739
2751
|
pattern: routeDirectory(route),
|
|
2740
|
-
depth:
|
|
2752
|
+
depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
2741
2753
|
metadata
|
|
2742
2754
|
})),
|
|
2743
2755
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -2761,7 +2773,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2761
2773
|
for (const layout of clientLayouts) {
|
|
2762
2774
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
2763
2775
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2764
|
-
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${
|
|
2776
|
+
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunkIEN2EFE5cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2765
2777
|
}
|
|
2766
2778
|
}
|
|
2767
2779
|
if (isolatedMode === "analyze") {
|
|
@@ -2795,7 +2807,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2795
2807
|
);
|
|
2796
2808
|
if (metadata.suppressedAsyncHydration) {
|
|
2797
2809
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
2798
|
-
`\u26A0\uFE0F ${
|
|
2810
|
+
`\u26A0\uFE0F ${_chunkIEN2EFE5cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2799
2811
|
);
|
|
2800
2812
|
}
|
|
2801
2813
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -2803,7 +2815,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2803
2815
|
).flatMap(({ plan }) => plan.isolatedBoundaries);
|
|
2804
2816
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
2805
2817
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
2806
|
-
const islandStrategy =
|
|
2818
|
+
const islandStrategy = _chunkM6U6E4F7cjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
2807
2819
|
route,
|
|
2808
2820
|
metadata,
|
|
2809
2821
|
clientLayouts,
|
|
@@ -2822,7 +2834,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2822
2834
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
2823
2835
|
],
|
|
2824
2836
|
// The server renders a server tree only below a hydrating layout.
|
|
2825
|
-
...
|
|
2837
|
+
..._chunkIEN2EFE5cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2826
2838
|
});
|
|
2827
2839
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2828
2840
|
}
|
|
@@ -2859,7 +2871,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2859
2871
|
}
|
|
2860
2872
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2861
2873
|
try {
|
|
2862
|
-
const metadata =
|
|
2874
|
+
const metadata = _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
2863
2875
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
2864
2876
|
} catch (error) {
|
|
2865
2877
|
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
@@ -2882,20 +2894,20 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2882
2894
|
srcDir,
|
|
2883
2895
|
adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
2884
2896
|
adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
2885
|
-
_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,
|
|
2886
2898
|
adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _104 => _104.docs, 'access', _105 => _105.adapter, 'optionalAccess', _106 => _106.react]) : void 0,
|
|
2887
2899
|
config.i18n,
|
|
2888
2900
|
config.plugins,
|
|
2889
2901
|
config.renderer,
|
|
2890
2902
|
config.publicRuntimeConfig,
|
|
2891
2903
|
config.trailingSlash,
|
|
2892
|
-
|
|
2904
|
+
_chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2893
2905
|
config.basePath,
|
|
2894
|
-
|
|
2906
|
+
_chunkM6U6E4F7cjs.generateClientCachePersistenceCode.call(void 0, _chunkM6U6E4F7cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2895
2907
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
2896
2908
|
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _107 => _107.experimental, 'optionalAccess', _108 => _108.serverComponents])) === "islands",
|
|
2897
2909
|
platform,
|
|
2898
|
-
islandsMode ?
|
|
2910
|
+
islandsMode ? _chunkIEN2EFE5cjs.collectFarmServerStylesheets.call(void 0,
|
|
2899
2911
|
[
|
|
2900
2912
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
2901
2913
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -2910,7 +2922,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2910
2922
|
await fs4.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
|
|
2911
2923
|
}
|
|
2912
2924
|
const clientInput = { [entryName]: clientEntryPath };
|
|
2913
|
-
if (platform === "web" &&
|
|
2925
|
+
if (platform === "web" && _chunkM6U6E4F7cjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
2914
2926
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
2915
2927
|
await fs4.writeFile(
|
|
2916
2928
|
clientBootPath,
|
|
@@ -2931,7 +2943,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2931
2943
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
2932
2944
|
await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
2933
2945
|
postcssSearchPath = clientEntryDir;
|
|
2934
|
-
tailwindVitePlugin = await
|
|
2946
|
+
tailwindVitePlugin = await _chunkDMXMIE2Ccjs.loadTailwindVitePlugin.call(void 0, {
|
|
2935
2947
|
builder: productionVite.builder,
|
|
2936
2948
|
announce: true
|
|
2937
2949
|
});
|
|
@@ -2982,7 +2994,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2982
2994
|
}
|
|
2983
2995
|
},
|
|
2984
2996
|
plugins: [
|
|
2985
|
-
|
|
2997
|
+
_chunkM6U6E4F7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2986
2998
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2987
2999
|
outDir: _path2.default.join(
|
|
2988
3000
|
_path2.default.dirname(outputDir),
|
|
@@ -3014,7 +3026,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3014
3026
|
...rendererVitePlugins,
|
|
3015
3027
|
...config.vite.plugins || [],
|
|
3016
3028
|
farmServerOnlyEntriesPlugin({ platform }),
|
|
3017
|
-
|
|
3029
|
+
_chunkM6U6E4F7cjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3018
3030
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3019
3031
|
),
|
|
3020
3032
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3047,7 +3059,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3047
3059
|
},
|
|
3048
3060
|
load: {
|
|
3049
3061
|
filter: {
|
|
3050
|
-
id:
|
|
3062
|
+
id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [
|
|
3051
3063
|
"\0empty-module",
|
|
3052
3064
|
"\0empty-api-route",
|
|
3053
3065
|
"\0farm-i18n-client-bridge",
|
|
@@ -3084,7 +3096,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3084
3096
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
|
|
3085
3097
|
pluginManager
|
|
3086
3098
|
),
|
|
3087
|
-
|
|
3099
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
3088
3100
|
],
|
|
3089
3101
|
mode: "production",
|
|
3090
3102
|
css: postcssSearchPath ? {
|
|
@@ -3092,7 +3104,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3092
3104
|
} : void 0,
|
|
3093
3105
|
// Ensure React is bundled for client
|
|
3094
3106
|
resolve: {
|
|
3095
|
-
alias:
|
|
3107
|
+
alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
3096
3108
|
dedupe: [...config.renderer.dedupe || []]
|
|
3097
3109
|
},
|
|
3098
3110
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -3105,7 +3117,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3105
3117
|
]
|
|
3106
3118
|
}
|
|
3107
3119
|
};
|
|
3108
|
-
await viteBuild(
|
|
3120
|
+
await viteBuild(_chunkM6U6E4F7cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
3109
3121
|
if (platform === "mobile") {
|
|
3110
3122
|
await fs4.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
3111
3123
|
if (!await _chunkE5UN4OWXcjs.hasFarmMobileClientEntry.call(void 0, _path2.default.dirname(outputDir), outputDir)) {
|
|
@@ -3205,7 +3217,7 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
3205
3217
|
return response;
|
|
3206
3218
|
}
|
|
3207
3219
|
|
|
3208
|
-
${streamNavigations ?
|
|
3220
|
+
${streamNavigations ? _chunkM6U6E4F7cjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
|
|
3209
3221
|
|
|
3210
3222
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
3211
3223
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -4162,7 +4174,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
4162
4174
|
direction: {}
|
|
4163
4175
|
}, plugins = [], renderer = _chunk67MZTLTFcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
|
|
4164
4176
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
4165
|
-
const clientPluginEntry =
|
|
4177
|
+
const clientPluginEntry = _chunkDMXMIE2Ccjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4166
4178
|
plugins,
|
|
4167
4179
|
root,
|
|
4168
4180
|
srcDir,
|
|
@@ -4174,7 +4186,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
4174
4186
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
4175
4187
|
import __farmAppSetup from ${JSON.stringify(_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appSetupPath))};
|
|
4176
4188
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
4177
|
-
const providerClientCode =
|
|
4189
|
+
const providerClientCode = _chunkM6U6E4F7cjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4178
4190
|
integrationProviders,
|
|
4179
4191
|
root,
|
|
4180
4192
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -4197,18 +4209,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
|
|
|
4197
4209
|
const layoutImportStatements = [];
|
|
4198
4210
|
const layoutRegistrations = [];
|
|
4199
4211
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
4200
|
-
const treeLayoutPatterns = islandValues ?
|
|
4212
|
+
const treeLayoutPatterns = islandValues ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
|
|
4201
4213
|
layoutRoutes.forEach((layout, index) => {
|
|
4202
4214
|
const relativePath = toImportPath(layout.modulePath);
|
|
4203
4215
|
const treeLayout = treeLayoutPatterns.has(layout.pattern);
|
|
4204
4216
|
const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
|
|
4205
|
-
(pattern) =>
|
|
4217
|
+
(pattern) => _chunk2MR4MABGcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
|
|
4206
4218
|
);
|
|
4207
4219
|
if (rendersOnClient && !treeLayout) {
|
|
4208
4220
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
4209
4221
|
}
|
|
4210
|
-
const groupScope =
|
|
4211
|
-
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)}` : "";
|
|
4212
4224
|
layoutRegistrations.push(
|
|
4213
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" : ""} }`
|
|
4214
4226
|
);
|
|
@@ -4295,7 +4307,7 @@ mountFarmDocsSearch();
|
|
|
4295
4307
|
|
|
4296
4308
|
${generateUniversalRouterStateRuntime()}
|
|
4297
4309
|
|
|
4298
|
-
${
|
|
4310
|
+
${_chunkM6U6E4F7cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
4299
4311
|
|
|
4300
4312
|
// SPA Router for server-rendered pages (HTML swap)
|
|
4301
4313
|
const spaRouter = {
|
|
@@ -4731,7 +4743,7 @@ function hasHydratableLayout(pathname) {
|
|
|
4731
4743
|
});
|
|
4732
4744
|
}
|
|
4733
4745
|
|
|
4734
|
-
${
|
|
4746
|
+
${_chunkM6U6E4F7cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
4735
4747
|
// Wrap a page element with applicable layouts
|
|
4736
4748
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
4737
4749
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -4766,7 +4778,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
4766
4778
|
return React.createElement("div", props, pageElement);
|
|
4767
4779
|
}
|
|
4768
4780
|
let farmLastRouteState = null;
|
|
4769
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
4781
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkM6U6E4F7cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4770
4782
|
function farmTreeLayoutsOf(pathname) {
|
|
4771
4783
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
4772
4784
|
return layout.serverTree === true;
|
|
@@ -5330,7 +5342,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
5330
5342
|
return true;
|
|
5331
5343
|
}` : ""}
|
|
5332
5344
|
|
|
5333
|
-
${
|
|
5345
|
+
${_chunkM6U6E4F7cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5334
5346
|
|
|
5335
5347
|
function activateNavigationScripts(root) {
|
|
5336
5348
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -5433,7 +5445,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
5433
5445
|
return shell.innerHTML;
|
|
5434
5446
|
}
|
|
5435
5447
|
|
|
5436
|
-
${islandValues ?
|
|
5448
|
+
${islandValues ? _chunkM6U6E4F7cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
5437
5449
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
5438
5450
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
5439
5451
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -6036,7 +6048,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6036
6048
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
6037
6049
|
"module.exports = { plugins: [] };\n"
|
|
6038
6050
|
);
|
|
6039
|
-
tailwindVitePlugin = await
|
|
6051
|
+
tailwindVitePlugin = await _chunkDMXMIE2Ccjs.loadTailwindVitePlugin.call(void 0, {
|
|
6040
6052
|
builder: productionVite.builder,
|
|
6041
6053
|
label: "for SSR"
|
|
6042
6054
|
});
|
|
@@ -6143,7 +6155,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6143
6155
|
}))
|
|
6144
6156
|
) : discoveredMiddlewareRoutes;
|
|
6145
6157
|
const instrumentationPath = _chunk3GNHJ3RNcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
6146
|
-
const notFoundPath =
|
|
6158
|
+
const notFoundPath = _chunkM6U6E4F7cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
6147
6159
|
if (notFoundPath) _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
6148
6160
|
layoutRoutes.sort((a, b) => {
|
|
6149
6161
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -6160,14 +6172,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6160
6172
|
const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
|
|
6161
6173
|
(integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
|
|
6162
6174
|
);
|
|
6163
|
-
const hasIntegrationProviders =
|
|
6175
|
+
const hasIntegrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations).some(
|
|
6164
6176
|
(provider) => provider.component || provider.type === "clerk"
|
|
6165
6177
|
);
|
|
6166
6178
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
6167
6179
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _118 => _118.mdx, 'optionalAccess', _119 => _119.components]));
|
|
6168
|
-
const hasMiddlewareConfig =
|
|
6169
|
-
const hasRouteContextConfig =
|
|
6170
|
-
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);
|
|
6171
6183
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
6172
6184
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
6173
6185
|
const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasFarmServerStorageConfig(config.storage) || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
|
|
@@ -6176,19 +6188,19 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6176
6188
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
6177
6189
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
6178
6190
|
);
|
|
6179
|
-
if (
|
|
6191
|
+
if (_chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
6180
6192
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
6181
|
-
|
|
6193
|
+
_chunkI7NUT24Zcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
6182
6194
|
config.docs,
|
|
6183
6195
|
{ root, srcDir: config.srcDir },
|
|
6184
6196
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
6185
|
-
|
|
6197
|
+
_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? "edge" : "node"
|
|
6186
6198
|
);
|
|
6187
6199
|
}
|
|
6188
6200
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
6189
|
-
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,
|
|
6190
6202
|
farmDocsCspNonceMarker,
|
|
6191
|
-
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, {
|
|
6192
6204
|
root,
|
|
6193
6205
|
srcDir: config.srcDir,
|
|
6194
6206
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -6355,7 +6367,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6355
6367
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _130 => _130.env, 'optionalAccess', _131 => _131.public]) || {})
|
|
6356
6368
|
},
|
|
6357
6369
|
plugins: [
|
|
6358
|
-
|
|
6370
|
+
_chunkM6U6E4F7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6359
6371
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
6360
6372
|
...rendererVitePlugins,
|
|
6361
6373
|
...config.vite.plugins || [],
|
|
@@ -6378,7 +6390,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6378
6390
|
{ ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
|
|
6379
6391
|
farmServerOnlyEntriesPlugin(),
|
|
6380
6392
|
farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
|
|
6381
|
-
|
|
6393
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
6382
6394
|
...hasRuntimeConfigModule ? [
|
|
6383
6395
|
farmStripPlatformConfigPlugin(
|
|
6384
6396
|
[
|
|
@@ -6390,7 +6402,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6390
6402
|
{
|
|
6391
6403
|
name: "farm-virtual-ssr-entry",
|
|
6392
6404
|
resolveId: {
|
|
6393
|
-
filter: { id:
|
|
6405
|
+
filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
6394
6406
|
handler(id) {
|
|
6395
6407
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
6396
6408
|
return virtualEntryId;
|
|
@@ -6399,7 +6411,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6399
6411
|
}
|
|
6400
6412
|
},
|
|
6401
6413
|
load: {
|
|
6402
|
-
filter: { id:
|
|
6414
|
+
filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
6403
6415
|
handler(id) {
|
|
6404
6416
|
if (id === virtualEntryId) {
|
|
6405
6417
|
return virtualEntryCode;
|
|
@@ -6431,7 +6443,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6431
6443
|
resolve: {
|
|
6432
6444
|
alias: [
|
|
6433
6445
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
6434
|
-
...Object.entries(
|
|
6446
|
+
...Object.entries(_chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
6435
6447
|
([find, replacement]) => ({ find, replacement })
|
|
6436
6448
|
)
|
|
6437
6449
|
],
|
|
@@ -6439,7 +6451,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6439
6451
|
dedupe: [...config.renderer.dedupe || []]
|
|
6440
6452
|
}
|
|
6441
6453
|
};
|
|
6442
|
-
await viteBuild(
|
|
6454
|
+
await viteBuild(_chunkM6U6E4F7cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
6443
6455
|
} finally {
|
|
6444
6456
|
if (postcssConfigDir) {
|
|
6445
6457
|
try {
|
|
@@ -6481,9 +6493,9 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
6481
6493
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
6482
6494
|
middlewareRoutes
|
|
6483
6495
|
};
|
|
6484
|
-
return
|
|
6485
|
-
(docsRoot) =>
|
|
6486
|
-
).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));
|
|
6487
6499
|
}
|
|
6488
6500
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
6489
6501
|
const llmsTxt = _optionalChain([agent, 'optionalAccess', _134 => _134.llmsTxt]);
|
|
@@ -6880,7 +6892,7 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
|
6880
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 = []) {
|
|
6881
6893
|
const farmRendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
6882
6894
|
const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _148 => _148.experimental, 'optionalAccess', _149 => _149.serverComponents])) === "islands";
|
|
6883
|
-
const farmClientBoot =
|
|
6895
|
+
const farmClientBoot = _chunkM6U6E4F7cjs.canBootFarmIslandsClient.call(void 0, config);
|
|
6884
6896
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
6885
6897
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
6886
6898
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
@@ -6890,7 +6902,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
6890
6902
|
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _153 => _153.agent, 'optionalAccess', _154 => _154.sitemap, 'optionalAccess', _155 => _155.enabled])) && !applicationMetadataRoutes.some(
|
|
6891
6903
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
6892
6904
|
);
|
|
6893
|
-
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");
|
|
6894
6906
|
const servesAiCatalog = _optionalChain([config, 'access', _158 => _158.agent, 'optionalAccess', _159 => _159.aiCatalog]) !== false;
|
|
6895
6907
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
6896
6908
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
@@ -6908,7 +6920,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
6908
6920
|
const hasIsolatedClientGraphRuntime = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
6909
6921
|
const rendererStreamingCapabilities = _chunk67MZTLTFcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
|
|
6910
6922
|
config.renderer,
|
|
6911
|
-
|
|
6923
|
+
_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset)
|
|
6912
6924
|
);
|
|
6913
6925
|
const hasReactSyncRender = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer);
|
|
6914
6926
|
const rendererServerImports = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
|
|
@@ -6948,9 +6960,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6948
6960
|
(image) => image.sourceType === "module"
|
|
6949
6961
|
);
|
|
6950
6962
|
const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
|
|
6951
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
6963
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk2MR4MABGcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
6952
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)) : [];
|
|
6953
|
-
const integrationProviders =
|
|
6965
|
+
const integrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
6954
6966
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
6955
6967
|
(provider) => provider.component || provider.type === "clerk"
|
|
6956
6968
|
);
|
|
@@ -6959,7 +6971,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6959
6971
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
6960
6972
|
);
|
|
6961
6973
|
}
|
|
6962
|
-
const providerServerModules =
|
|
6974
|
+
const providerServerModules = _chunkM6U6E4F7cjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
6963
6975
|
renderedIntegrationProviders,
|
|
6964
6976
|
config.root,
|
|
6965
6977
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -6979,14 +6991,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6979
6991
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
6980
6992
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
6981
6993
|
);
|
|
6982
|
-
const isolatedHydrationMode =
|
|
6994
|
+
const isolatedHydrationMode = _chunkIEN2EFE5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
6983
6995
|
_optionalChain([config, 'access', _174 => _174.experimental, 'optionalAccess', _175 => _175.isolatedClientHydration]),
|
|
6984
6996
|
{
|
|
6985
6997
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _176 => _176.experimental, 'optionalAccess', _177 => _177.serverComponents])) === "rsc",
|
|
6986
6998
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
6987
6999
|
}
|
|
6988
7000
|
);
|
|
6989
|
-
const hydrationPlanOptions =
|
|
7001
|
+
const hydrationPlanOptions = _chunkIEN2EFE5cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
6990
7002
|
config.renderer,
|
|
6991
7003
|
Boolean(unsupportedIntegrationProvider)
|
|
6992
7004
|
);
|
|
@@ -7004,7 +7016,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7004
7016
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
7005
7017
|
)
|
|
7006
7018
|
}));
|
|
7007
|
-
const markdownPagePlan =
|
|
7019
|
+
const markdownPagePlan = _chunkIEN2EFE5cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
7008
7020
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
7009
7021
|
config.root,
|
|
7010
7022
|
isolatedHydrationMode,
|
|
@@ -7013,7 +7025,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7013
7025
|
const pageHydrationPlans = new Map(
|
|
7014
7026
|
pageRoutes.map((route) => [
|
|
7015
7027
|
route.modulePath,
|
|
7016
|
-
|
|
7028
|
+
_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
7017
7029
|
route.modulePath,
|
|
7018
7030
|
config.root,
|
|
7019
7031
|
isolatedHydrationMode,
|
|
@@ -7022,7 +7034,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7022
7034
|
)
|
|
7023
7035
|
])
|
|
7024
7036
|
);
|
|
7025
|
-
|
|
7037
|
+
_chunkIEN2EFE5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
7026
7038
|
layoutHydrationPlans.map((layout) => ({
|
|
7027
7039
|
pattern: layout.pattern,
|
|
7028
7040
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -7031,10 +7043,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7031
7043
|
pageRoutes.map((route) => ({
|
|
7032
7044
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
7033
7045
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
7034
|
-
depth:
|
|
7046
|
+
depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
7035
7047
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
7036
7048
|
})),
|
|
7037
|
-
|
|
7049
|
+
_chunk2MR4MABGcjs.routeBoundaryCoversDirectory,
|
|
7038
7050
|
{ serverOwners: pageHydrationPlanOptions.serverOwners }
|
|
7039
7051
|
);
|
|
7040
7052
|
const providerServerImports = [
|
|
@@ -7065,7 +7077,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7065
7077
|
}).map(({ route }) => route);
|
|
7066
7078
|
orderedPageRoutes.forEach((route, index) => {
|
|
7067
7079
|
const varName = `pageRoute${index}`;
|
|
7068
|
-
if (
|
|
7080
|
+
if (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
7069
7081
|
pageRegistrations.push(`
|
|
7070
7082
|
{
|
|
7071
7083
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -7089,7 +7101,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7089
7101
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
7090
7102
|
);
|
|
7091
7103
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
7092
|
-
const renderingDirective =
|
|
7104
|
+
const renderingDirective = _chunkK7JMTAFHcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
7093
7105
|
pageRegistrations.push(`
|
|
7094
7106
|
{
|
|
7095
7107
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -7097,8 +7109,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7097
7109
|
module: ${varName},
|
|
7098
7110
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
7099
7111
|
clientModule: ${JSON.stringify(_chunkQMNWKQL4cjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
7100
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
7101
|
-
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,
|
|
7102
7114
|
route,
|
|
7103
7115
|
clientMetadata,
|
|
7104
7116
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -7117,7 +7129,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7117
7129
|
});
|
|
7118
7130
|
const layoutImports = [];
|
|
7119
7131
|
const layoutRegistrations = [];
|
|
7120
|
-
const treeLayoutPatterns = farmIslandsMode ?
|
|
7132
|
+
const treeLayoutPatterns = farmIslandsMode ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
7121
7133
|
layoutHydrationPlans.map((layout) => ({
|
|
7122
7134
|
pattern: layout.pattern,
|
|
7123
7135
|
shouldHydrate: layout.hydration.shouldHydrate,
|
|
@@ -7161,7 +7173,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7161
7173
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
7162
7174
|
interception: ${JSON.stringify(slot.interception)},
|
|
7163
7175
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
7164
|
-
hydrates: ${!farmIslandsMode ||
|
|
7176
|
+
hydrates: ${!farmIslandsMode || _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
7165
7177
|
module: ${varName},
|
|
7166
7178
|
}`);
|
|
7167
7179
|
});
|
|
@@ -7172,12 +7184,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7172
7184
|
errorImports.push(
|
|
7173
7185
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
7174
7186
|
);
|
|
7175
|
-
const groupScope =
|
|
7187
|
+
const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
7176
7188
|
errorRegistrations.push(`
|
|
7177
7189
|
{
|
|
7178
|
-
pattern: ${JSON.stringify(
|
|
7190
|
+
pattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
7179
7191
|
groupScope: ${JSON.stringify(groupScope)},
|
|
7180
|
-
directoryDepth: ${
|
|
7192
|
+
directoryDepth: ${_chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
7181
7193
|
module: ${varName},
|
|
7182
7194
|
}`);
|
|
7183
7195
|
});
|
|
@@ -7189,12 +7201,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7189
7201
|
loadingImports.push(
|
|
7190
7202
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
|
|
7191
7203
|
);
|
|
7192
|
-
const groupScope =
|
|
7204
|
+
const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
|
|
7193
7205
|
loadingRegistrations.push(`
|
|
7194
7206
|
{
|
|
7195
|
-
pattern: ${JSON.stringify(
|
|
7207
|
+
pattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
|
|
7196
7208
|
groupScope: ${JSON.stringify(groupScope)},
|
|
7197
|
-
directoryDepth: ${
|
|
7209
|
+
directoryDepth: ${_chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
|
|
7198
7210
|
module: ${varName},
|
|
7199
7211
|
}`);
|
|
7200
7212
|
});
|
|
@@ -7308,6 +7320,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7308
7320
|
createFarmProductionLifecycle,
|
|
7309
7321
|
createFarmNodeRequestAbortSignal,
|
|
7310
7322
|
createProductionMiddlewareRunner,
|
|
7323
|
+
_hasPrivateFarmRequestHeaders,
|
|
7311
7324
|
_withFarmGuardedResponseCache,
|
|
7312
7325
|
_farmPluginsKeepResponsesPrivate,
|
|
7313
7326
|
getTheme as getFarmTheme,
|
|
@@ -7321,6 +7334,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7321
7334
|
localizeFarmHref,
|
|
7322
7335
|
manageFarmDocumentPreloads,
|
|
7323
7336
|
mergeRouteRenderingDirectiveConfig,
|
|
7337
|
+
resolveRouteSharedCacheControl,
|
|
7324
7338
|
manageFarmLinkHeaderPreloads,
|
|
7325
7339
|
mergeMetadata,
|
|
7326
7340
|
mergeModuleViewport,
|
|
@@ -7349,7 +7363,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7349
7363
|
stripFarmLocaleFromPathname,
|
|
7350
7364
|
withFarmRouteContext,
|
|
7351
7365
|
createLateNotFoundRecovery,
|
|
7352
|
-
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," : ""}
|
|
7353
7373
|
} from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
|
|
7354
7374
|
import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
|
|
7355
7375
|
// The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
|
|
@@ -7418,25 +7438,25 @@ function farmFormStateScript() { return ""; }`}`;
|
|
|
7418
7438
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
7419
7439
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
7420
7440
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
7421
|
-
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";
|
|
7422
7442
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
7423
7443
|
const pathname = typeof requestOrPathname === "string"
|
|
7424
7444
|
? requestOrPathname
|
|
7425
7445
|
: new URL(requestOrPathname.url).pathname;
|
|
7426
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
7446
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _187 => _187.apiPath]) || "/api/docs")};
|
|
7427
7447
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
7428
7448
|
};` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
7429
|
-
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)};
|
|
7430
7450
|
import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
|
|
7431
7451
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
7432
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
7433
|
-
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";
|
|
7434
7454
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
7435
7455
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
7436
|
-
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";` : "";
|
|
7437
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;";
|
|
7438
7458
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
7439
|
-
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;
|
|
7440
7460
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
7441
7461
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
7442
7462
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -7456,14 +7476,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
7456
7476
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
7457
7477
|
const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
7458
7478
|
const mobileSession = (config.plugins || []).some(
|
|
7459
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
7479
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _199 => _199.name]) === _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN
|
|
7460
7480
|
);
|
|
7461
7481
|
const nativeServerFns = (config.plugins || []).some(
|
|
7462
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
7463
|
-
) ?
|
|
7482
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _200 => _200.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
7483
|
+
) ? _chunkA7HCBHMCcjs.collectFarmNativeServerFns.call(void 0, {
|
|
7464
7484
|
root: config.root,
|
|
7465
7485
|
srcDir: config.srcDir,
|
|
7466
|
-
entries:
|
|
7486
|
+
entries: _chunkA7HCBHMCcjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
|
|
7467
7487
|
}) : void 0;
|
|
7468
7488
|
const integrationImports = `
|
|
7469
7489
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -7478,7 +7498,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
7478
7498
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
7479
7499
|
});` : ""}
|
|
7480
7500
|
`;
|
|
7481
|
-
const imageRuntime =
|
|
7501
|
+
const imageRuntime = _chunkM6U6E4F7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
7482
7502
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
7483
7503
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
7484
7504
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -7615,7 +7635,7 @@ ${routeClientGraphServerRuntime}
|
|
|
7615
7635
|
const farmRendererStreamingCapabilities = ${JSON.stringify(rendererStreamingCapabilities)};
|
|
7616
7636
|
const farmRendererName = ${JSON.stringify(config.renderer.name)};
|
|
7617
7637
|
const farmReactSyncRender = ${JSON.stringify(hasReactSyncRender)};
|
|
7618
|
-
const farmRendererRuntime = ${JSON.stringify(
|
|
7638
|
+
const farmRendererRuntime = ${JSON.stringify(_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset))};
|
|
7619
7639
|
const farmRendererRuntimeStreamingCapabilities = ReactDOMServer.capabilities &&
|
|
7620
7640
|
ReactDOMServer.capabilities.streaming;
|
|
7621
7641
|
if (farmRendererRuntimeStreamingCapabilities &&
|
|
@@ -7660,7 +7680,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
7660
7680
|
|
|
7661
7681
|
function FarmDefault404Page() {
|
|
7662
7682
|
return React.createElement(React.Fragment, null,
|
|
7663
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
7683
|
+
React.createElement("style", null, ${JSON.stringify(_chunkM6U6E4F7cjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
7664
7684
|
React.createElement("main", {
|
|
7665
7685
|
className: "farm-default-not-found",
|
|
7666
7686
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -7797,20 +7817,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
7797
7817
|
validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
|
|
7798
7818
|
onError(error) { console.error("[Farm Image]", error); },
|
|
7799
7819
|
})`};
|
|
7800
|
-
const farmMarkdownConfig = ${JSON.stringify(config.md)}
|
|
7801
|
-
|
|
7802
|
-
|
|
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)};` : ""}
|
|
7803
7827
|
const farmMdxConfig = ${JSON.stringify({
|
|
7804
7828
|
...config.mdx,
|
|
7805
|
-
components: typeof _optionalChain([config, 'access',
|
|
7829
|
+
components: typeof _optionalChain([config, 'access', _208 => _208.mdx, 'optionalAccess', _209 => _209.components]) === "string" ? config.mdx.components : void 0
|
|
7806
7830
|
})};
|
|
7807
7831
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
7808
|
-
${_optionalChain([config, 'access',
|
|
7832
|
+
${_optionalChain([config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
7809
7833
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
7810
7834
|
// to the build.
|
|
7811
7835
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
7812
7836
|
globalThis.process?.env,
|
|
7813
|
-
${JSON.stringify(
|
|
7837
|
+
${JSON.stringify(_chunkLECZ5DPZcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
7814
7838
|
);` : ""}
|
|
7815
7839
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
7816
7840
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -7856,7 +7880,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
7856
7880
|
});
|
|
7857
7881
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
7858
7882
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
7859
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
7883
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _212 => _212.docs, 'optionalAccess', _213 => _213.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
7860
7884
|
try {
|
|
7861
7885
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
7862
7886
|
const candidates = [
|
|
@@ -7868,7 +7892,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _208 => _2
|
|
|
7868
7892
|
} catch {
|
|
7869
7893
|
return null;
|
|
7870
7894
|
}
|
|
7871
|
-
})()` : "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]) ? `
|
|
7872
7896
|
const farmDocsBundledRootsDir = (() => {
|
|
7873
7897
|
try {
|
|
7874
7898
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
@@ -7920,7 +7944,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
7920
7944
|
),
|
|
7921
7945
|
}
|
|
7922
7946
|
: undefined;
|
|
7923
|
-
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}, {
|
|
7924
7948
|
rootDir: farmDocsRuntimeRoot,
|
|
7925
7949
|
// A production build's content cannot change, so the adapter reads its
|
|
7926
7950
|
// navigation once instead of scanning the content directory per request.
|
|
@@ -7941,7 +7965,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _215 => _215.docs, '
|
|
|
7941
7965
|
registerMCPServer: registerFarmMCPServer,
|
|
7942
7966
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
7943
7967
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
7944
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
7968
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunkI7NUT24Zcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
7945
7969
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
7946
7970
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
7947
7971
|
isPathGuarded: (pathname) =>
|
|
@@ -7967,7 +7991,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _215 => _215.docs, '
|
|
|
7967
7991
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
7968
7992
|
basePath: ${JSON.stringify(config.basePath)},
|
|
7969
7993
|
})` : "null"};
|
|
7970
|
-
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"};
|
|
7971
7995
|
|
|
7972
7996
|
// API routes bundled at build time
|
|
7973
7997
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
@@ -7991,16 +8015,20 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
7991
8015
|
return fetch(new Request(request, { headers }), context);
|
|
7992
8016
|
}
|
|
7993
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 || "/")};
|
|
7994
8022
|
// Reports a failure Farm answers itself (an API or integration route's 500) to the plugin
|
|
7995
8023
|
// runtime request.
|
|
7996
8024
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
7997
8025
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
7998
|
-
${_optionalChain([config, 'access',
|
|
7999
|
-
` : ""}${_optionalChain([config, 'access',
|
|
8000
|
-
|
|
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, {
|
|
8001
8029
|
build: config.deploymentId,
|
|
8002
|
-
packages:
|
|
8003
|
-
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) : []
|
|
8004
8032
|
})
|
|
8005
8033
|
)};
|
|
8006
8034
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -8104,7 +8132,8 @@ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, page
|
|
|
8104
8132
|
let source = 'window.__FARM_PROPS__=' + serializedPageProps +
|
|
8105
8133
|
';window.__FARM_INTEGRATION_API_MANIFEST__=' +
|
|
8106
8134
|
serializeFarmInlineValue(integrationManifest) +
|
|
8107
|
-
';window.__FARM_ROUTE_SLOTS__=' + serializedRouteSlots +
|
|
8135
|
+
';window.__FARM_ROUTE_SLOTS__=' + serializedRouteSlots +
|
|
8136
|
+
';window.__FARM_DEPLOYMENT_ID__=' + serializeFarmInlineValue(farmDeploymentId) + ';';
|
|
8108
8137
|
if (typeof canonicalPath === "string" && canonicalPath.startsWith("/")) {
|
|
8109
8138
|
const serializedPath = serializeFarmInlineValue(canonicalPath);
|
|
8110
8139
|
source += 'if(location.pathname+location.search!==' + serializedPath + '){' +
|
|
@@ -8666,7 +8695,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
8666
8695
|
let inner = markup.replace(/^\\s+/, "");
|
|
8667
8696
|
let hoisted = "";
|
|
8668
8697
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
8669
|
-
const hoistable = /${
|
|
8698
|
+
const hoistable = /${_chunk2MR4MABGcjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
8670
8699
|
let match;
|
|
8671
8700
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
8672
8701
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -8906,38 +8935,14 @@ function applyFarmI18nResponse(response, resolution) {
|
|
|
8906
8935
|
});
|
|
8907
8936
|
}
|
|
8908
8937
|
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
const parts = cookieHeader.split(";");
|
|
8912
|
-
if (parts.length !== 1) return false;
|
|
8913
|
-
|
|
8914
|
-
const cookie = parts[0].trim();
|
|
8915
|
-
const separator = cookie.indexOf("=");
|
|
8916
|
-
if (separator <= 0) return false;
|
|
8917
|
-
|
|
8918
|
-
let name;
|
|
8919
|
-
let value;
|
|
8920
|
-
try {
|
|
8921
|
-
name = decodeURIComponent(cookie.slice(0, separator).trim());
|
|
8922
|
-
value = decodeURIComponent(cookie.slice(separator + 1).trim());
|
|
8923
|
-
} catch {
|
|
8924
|
-
return false;
|
|
8925
|
-
}
|
|
8926
|
-
|
|
8927
|
-
return (
|
|
8928
|
-
name === farmI18nConfig.cookie.name &&
|
|
8929
|
-
farmI18nConfig.locales.includes(value)
|
|
8930
|
-
);
|
|
8931
|
-
}
|
|
8932
|
-
|
|
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.
|
|
8933
8940
|
function hasPrivateFarmRequestHeaders(request, farmLocaleResolution) {
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
farmLocaleResolution?.source === "url" &&
|
|
8940
|
-
hasOnlyValidFarmLocaleCookie(cookieHeader)
|
|
8941
|
+
return _hasPrivateFarmRequestHeaders(
|
|
8942
|
+
request,
|
|
8943
|
+
farmI18nRuntime && farmLocaleResolution?.source === "url"
|
|
8944
|
+
? { name: farmI18nConfig.cookie.name, locales: farmI18nConfig.locales }
|
|
8945
|
+
: undefined,
|
|
8941
8946
|
);
|
|
8942
8947
|
}
|
|
8943
8948
|
|
|
@@ -9195,7 +9200,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
9195
9200
|
// its nearest layout's.
|
|
9196
9201
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
9197
9202
|
pageRoutes.map((route) => route.pattern).filter(
|
|
9198
|
-
(pattern) => !pattern.includes("[") &&
|
|
9203
|
+
(pattern) => !pattern.includes("[") && _chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0,
|
|
9199
9204
|
{
|
|
9200
9205
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
9201
9206
|
middlewareRoutes
|
|
@@ -9238,7 +9243,7 @@ function createFarmAgentSitemapResponse(request) {
|
|
|
9238
9243
|
metadataBase: rootLayout && rootLayout.module && rootLayout.module.metadata
|
|
9239
9244
|
? rootLayout.module.metadata.metadataBase
|
|
9240
9245
|
: undefined,
|
|
9241
|
-
basePath: ${JSON.stringify(config.basePath)},
|
|
9246
|
+
basePath: ${JSON.stringify(config.basePath)},${config.trailingSlash ? "\n trailingSlash: true," : ""}${config.i18n.enabled ? "\n i18n: farmI18nConfig," : ""}
|
|
9242
9247
|
},
|
|
9243
9248
|
),
|
|
9244
9249
|
{},
|
|
@@ -9250,12 +9255,12 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
9250
9255
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
9251
9256
|
// registered at runtime, such as the docs engine's.
|
|
9252
9257
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
9253
|
-
|
|
9258
|
+
_chunkVG6HYT5Kcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkMZLJFNMHcjs.FARM_VERSION)
|
|
9254
9259
|
)};
|
|
9255
9260
|
let farmDefaultMCPRouteFree;
|
|
9256
9261
|
function getFarmDefaultMCPServer() {
|
|
9257
9262
|
if (farmDefaultMCPRouteFree === undefined) {
|
|
9258
|
-
farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(
|
|
9263
|
+
farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkVG6HYT5Kcjs.FARM_DEFAULT_MCP_PATH)});
|
|
9259
9264
|
}
|
|
9260
9265
|
return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
|
|
9261
9266
|
}
|
|
@@ -9264,18 +9269,22 @@ async function handleFarmDefaultMCP(request) {
|
|
|
9264
9269
|
return handleFarmDefaultMCPRequest(request, {
|
|
9265
9270
|
server: getFarmDefaultMCPServer(),
|
|
9266
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.
|
|
9267
9274
|
listPages: () =>
|
|
9268
9275
|
collectFarmDefaultMCPPages(
|
|
9269
9276
|
getFarmAgentListedPageRoutes().map((route) => ({ pattern: route.pattern, module: route.module })),
|
|
9270
|
-
{
|
|
9277
|
+
{
|
|
9278
|
+
origin,
|
|
9279
|
+
basePath: ${JSON.stringify(config.basePath)},
|
|
9280
|
+
markdown: farmMarkdownConfig,${config.trailingSlash ? "\n trailingSlash: true," : ""}
|
|
9281
|
+
i18n: farmI18nConfig,
|
|
9282
|
+
},
|
|
9271
9283
|
),
|
|
9272
|
-
// A fresh request through this handler, so the caller's cookies never shape a page.
|
|
9273
|
-
//
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
page.pathname = stripFarmBasePath(page.pathname);
|
|
9277
|
-
return farmDefaultMCPReadMarkdown(page.href);
|
|
9278
|
-
},
|
|
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,
|
|
9279
9288
|
});
|
|
9280
9289
|
}
|
|
9281
9290
|
// \`fetch\` is this module's outer request entry: plugin runtime hooks run and the page
|
|
@@ -9303,7 +9312,7 @@ function createFarmLlmsTxtContext(request, full) {
|
|
|
9303
9312
|
origin,
|
|
9304
9313
|
markdown: farmMarkdownConfig,
|
|
9305
9314
|
include: farmLlmsTxtConfig.include,
|
|
9306
|
-
exclude: farmLlmsTxtConfig.exclude,
|
|
9315
|
+
exclude: farmLlmsTxtConfig.exclude,${config.trailingSlash ? "\n trailingSlash: true," : ""}${config.i18n.enabled ? "\n i18n: farmI18nConfig," : ""}
|
|
9307
9316
|
},
|
|
9308
9317
|
);
|
|
9309
9318
|
const rootLayout = layoutRoutes.find((layout) => layout.pattern === "/");
|
|
@@ -9436,7 +9445,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
9436
9445
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
9437
9446
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
9438
9447
|
const farmPrerendering =
|
|
9439
|
-
typeof process !== "undefined" && process.env?.${
|
|
9448
|
+
typeof process !== "undefined" && process.env?.${_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV} === "1";
|
|
9440
9449
|
` : ""}
|
|
9441
9450
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
9442
9451
|
config: farmMiddlewareConfig,
|
|
@@ -9580,7 +9589,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
9580
9589
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
9581
9590
|
return true;
|
|
9582
9591
|
}
|
|
9583
|
-
${_optionalChain([config, 'access',
|
|
9592
|
+
${_optionalChain([config, 'access', _227 => _227.docs, 'optionalAccess', _228 => _228.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
9584
9593
|
// The docs answer below the basePath; their API stays at /api/docs, as API routes do.
|
|
9585
9594
|
const docsRoutePathname = stripFarmBasePath(pathname);
|
|
9586
9595
|
if (
|
|
@@ -9608,7 +9617,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
9608
9617
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
9609
9618
|
};
|
|
9610
9619
|
}
|
|
9611
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
9620
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _229 => _229.docs, 'optionalAccess', _230 => _230.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
9612
9621
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
9613
9622
|
pathname,
|
|
9614
9623
|
method: request.method,
|
|
@@ -9692,7 +9701,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
9692
9701
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
9693
9702
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
9694
9703
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
9695
|
-
|
|
9704
|
+
_chunkK4UGCUXXcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
9696
9705
|
agent: {
|
|
9697
9706
|
...config.agent,
|
|
9698
9707
|
aiCatalog: servesAiCatalog,
|
|
@@ -9703,9 +9712,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
9703
9712
|
openapi: openAPIReference
|
|
9704
9713
|
})
|
|
9705
9714
|
)});
|
|
9706
|
-
${_optionalChain([config, 'access',
|
|
9715
|
+
${_optionalChain([config, 'access', _231 => _231.docs, 'optionalAccess', _232 => _232.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
9707
9716
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
9708
|
-
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 ? `
|
|
9709
9718
|
pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
|
|
9710
9719
|
};
|
|
9711
9720
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
@@ -9721,11 +9730,11 @@ function labelFarmRequestOptions(options) {
|
|
|
9721
9730
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
9722
9731
|
return options;
|
|
9723
9732
|
}
|
|
9724
|
-
${_optionalChain([config, 'access',
|
|
9733
|
+
${_optionalChain([config, 'access', _237 => _237.docs, 'optionalAccess', _238 => _238.enabled]) ? `if (options.kind === "docs") {
|
|
9725
9734
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
9726
9735
|
return options;
|
|
9727
9736
|
}` : ""}
|
|
9728
|
-
${_optionalChain([config, 'access',
|
|
9737
|
+
${_optionalChain([config, 'access', _239 => _239.md, 'optionalAccess', _240 => _240.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
9729
9738
|
routePathname,
|
|
9730
9739
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
9731
9740
|
);
|
|
@@ -9760,7 +9769,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
9760
9769
|
return applicable;
|
|
9761
9770
|
}
|
|
9762
9771
|
|
|
9763
|
-
${_optionalChain([config, 'access',
|
|
9772
|
+
${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
9764
9773
|
if (request.method === "HEAD") return response;
|
|
9765
9774
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
9766
9775
|
|
|
@@ -9868,7 +9877,7 @@ ${_optionalChain([config, 'access', _237 => _237.docs, 'optionalAccess', _238 =>
|
|
|
9868
9877
|
|
|
9869
9878
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
9870
9879
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
9871
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
9880
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _243 => _243.experimental, 'optionalAccess', _244 => _244.ppr]) === true)};
|
|
9872
9881
|
|
|
9873
9882
|
function resolveRouteRenderingView(route) {
|
|
9874
9883
|
// The same merge development uses: baked directive config under the
|
|
@@ -9893,7 +9902,7 @@ function getPPRShellBypassReason(request, middlewareData, middlewareContext) {
|
|
|
9893
9902
|
if (farmSecurityConfig.csp && farmSecurityConfig.csp.nonce) return "csp-nonce";
|
|
9894
9903
|
const method = request.method.toUpperCase();
|
|
9895
9904
|
if (method !== "GET" && method !== "HEAD") return "method";
|
|
9896
|
-
if (request.headers.get("cookie")) return "cookie";
|
|
9905
|
+
if (withoutFarmDeploymentCookie(request.headers.get("cookie"))) return "cookie";
|
|
9897
9906
|
if (request.headers.get("authorization")) return "authorization";
|
|
9898
9907
|
if (request.headers.get("x-farm-intercept-from")) return "route-interception";
|
|
9899
9908
|
if (request.headers.get("x-farm-ppr-refresh")) return "refresh";
|
|
@@ -9905,12 +9914,15 @@ function getPPRShellBypassReason(request, middlewareData, middlewareContext) {
|
|
|
9905
9914
|
|
|
9906
9915
|
// origin is set when the shell carries hreflang alternates (i18n prefix
|
|
9907
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.
|
|
9908
9919
|
function getPPRShellCacheKey(url, locale, origin) {
|
|
9909
9920
|
const key = [
|
|
9910
9921
|
"ppr",
|
|
9911
9922
|
locale || "",
|
|
9912
9923
|
normalizeRevalidatePath(url.pathname),
|
|
9913
9924
|
url.search,
|
|
9925
|
+
farmDeploymentId,
|
|
9914
9926
|
];
|
|
9915
9927
|
return createFarmCacheKey(origin ? key.concat(origin) : key);
|
|
9916
9928
|
}
|
|
@@ -9940,22 +9952,13 @@ function hasFarmUnserializableRouteData(data) {
|
|
|
9940
9952
|
return Boolean(data) && typeof data === "object" && Object.values(data).some(isPromise);
|
|
9941
9953
|
}
|
|
9942
9954
|
|
|
9955
|
+
// Core's policy for the route, shared with the RSC server so both send the same Cache-Control.
|
|
9943
9956
|
function getRouteSharedCacheControl(route, pprCanCache) {
|
|
9944
9957
|
if (!route || !route.module) {
|
|
9945
9958
|
return null;
|
|
9946
9959
|
}
|
|
9947
9960
|
|
|
9948
|
-
|
|
9949
|
-
if (view.dynamic === "force-dynamic") {
|
|
9950
|
-
return null;
|
|
9951
|
-
}
|
|
9952
|
-
if (!view.ssg && !pprCanCache) {
|
|
9953
|
-
return null;
|
|
9954
|
-
}
|
|
9955
|
-
|
|
9956
|
-
const revalidate =
|
|
9957
|
-
typeof view.revalidate === "number" && view.revalidate > 0 ? view.revalidate : 60;
|
|
9958
|
-
return "public, s-maxage=" + revalidate + ", stale-while-revalidate=300";
|
|
9961
|
+
return resolveRouteSharedCacheControl(resolveRouteRenderingView(route), pprCanCache);
|
|
9959
9962
|
}
|
|
9960
9963
|
|
|
9961
9964
|
async function getCachedPPRShell(cacheKey) {
|
|
@@ -10002,7 +10005,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
10002
10005
|
},
|
|
10003
10006
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
10004
10007
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
10005
|
-
${_optionalChain([config, 'access',
|
|
10008
|
+
${_optionalChain([config, 'access', _245 => _245.md, 'optionalAccess', _246 => _246.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
10006
10009
|
if (matchPageRoute(pathname)) {
|
|
10007
10010
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
10008
10011
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -10026,8 +10029,9 @@ async function handleFarmRequestInContext(
|
|
|
10026
10029
|
adapterContext,
|
|
10027
10030
|
requestUrl = new URL(request.url),
|
|
10028
10031
|
) {
|
|
10029
|
-
|
|
10030
|
-
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(
|
|
10031
10035
|
farmCacheGuard,
|
|
10032
10036
|
request,
|
|
10033
10037
|
farmLocaleResolution,
|
|
@@ -10036,6 +10040,11 @@ async function handleFarmRequestInContext(
|
|
|
10036
10040
|
adapterContext,
|
|
10037
10041
|
requestUrl,
|
|
10038
10042
|
);
|
|
10043
|
+
if (farmCacheGuard.deploymentPage) {
|
|
10044
|
+
response = _withFarmResponseHeaders(response, (headers) =>
|
|
10045
|
+
headers.set(FARM_DEPLOYMENT_ID_HEADER, farmDeploymentId)
|
|
10046
|
+
);
|
|
10047
|
+
}
|
|
10039
10048
|
if (!farmCacheGuard.guarded) return response;
|
|
10040
10049
|
// Tells the Nitro entry, which keeps this policy over a swr rule's public one.
|
|
10041
10050
|
adapterContext?.onGuardedResponse?.();
|
|
@@ -10213,7 +10222,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10213
10222
|
return renderFarmErrorJSONResponse();` : `
|
|
10214
10223
|
if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
|
|
10215
10224
|
// No page was selected, so only the root error boundary and layouts apply.
|
|
10216
|
-
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]) ? `
|
|
10217
10226
|
// An agent asking for Markdown reads the error document as Markdown, as it
|
|
10218
10227
|
// does when a page throws. The helper answers null when Markdown is off.
|
|
10219
10228
|
const markdownErrorResponse = await createMarkdownMirrorResponse({
|
|
@@ -10255,7 +10264,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10255
10264
|
}
|
|
10256
10265
|
` : ""}
|
|
10257
10266
|
|
|
10258
|
-
${_optionalChain([config, 'access',
|
|
10267
|
+
${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `
|
|
10259
10268
|
// Docs responses are served after app middleware so route guards and
|
|
10260
10269
|
// middleware headers apply to the docs engine like any other page content.
|
|
10261
10270
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -10279,6 +10288,14 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10279
10288
|
middlewareHeaders,
|
|
10280
10289
|
);
|
|
10281
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;
|
|
10282
10299
|
const wrappedDocsResponse = withFarmDocsRequestCache(
|
|
10283
10300
|
await wrapFarmDocsResponseWithLayouts(request, docsResponse),
|
|
10284
10301
|
request,
|
|
@@ -10310,7 +10327,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10310
10327
|
clientAddress: adapterContext?.clientAddress,
|
|
10311
10328
|
// An anonymous visitor's request: guards never see the caller's address.
|
|
10312
10329
|
renderPage: (targetRequest) =>
|
|
10313
|
-
fetchFarmInnerRequest(targetRequest, {
|
|
10330
|
+
fetchFarmInnerRequest(toFarmMarkdownPageRequest(targetRequest), {
|
|
10314
10331
|
...adapterContext,
|
|
10315
10332
|
clientAddress: FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS,
|
|
10316
10333
|
}),
|
|
@@ -10345,7 +10362,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10345
10362
|
}
|
|
10346
10363
|
` : ""}
|
|
10347
10364
|
|
|
10348
|
-
${_optionalChain([config, 'access',
|
|
10365
|
+
${_optionalChain([config, 'access', _251 => _251.md, 'optionalAccess', _252 => _252.enabled]) ? `
|
|
10349
10366
|
if (farmMarkdownConfig?.enabled) {
|
|
10350
10367
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
10351
10368
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -10357,7 +10374,8 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10357
10374
|
routePathname: getFarmRoutePathname,
|
|
10358
10375
|
routeExists: (targetPathname) =>
|
|
10359
10376
|
Boolean(matchPageRoute(getFarmRoutePathname(targetPathname))),
|
|
10360
|
-
renderPage: (targetRequest) =>
|
|
10377
|
+
renderPage: (targetRequest) =>
|
|
10378
|
+
fetchFarmInnerRequest(toFarmMarkdownPageRequest(targetRequest), adapterContext),
|
|
10361
10379
|
apiServerBasePath: farmLocalAPIBasePath,
|
|
10362
10380
|
});
|
|
10363
10381
|
if (markdownResponse) {
|
|
@@ -10448,11 +10466,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10448
10466
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
10449
10467
|
}
|
|
10450
10468
|
` : ""}
|
|
10451
|
-
${_optionalChain([config, 'access',
|
|
10469
|
+
${_optionalChain([config, 'access', _253 => _253.agent, 'optionalAccess', _254 => _254.manifest]) !== false ? `
|
|
10452
10470
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
10453
10471
|
// public manifest, the same document for every request.
|
|
10454
10472
|
if (
|
|
10455
|
-
[${JSON.stringify(
|
|
10473
|
+
[${JSON.stringify(_chunkK4UGCUXXcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkK4UGCUXXcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
10456
10474
|
normalizeRuntimePath(routePathname),
|
|
10457
10475
|
)
|
|
10458
10476
|
) {
|
|
@@ -10462,9 +10480,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10462
10480
|
);
|
|
10463
10481
|
}
|
|
10464
10482
|
` : ""}
|
|
10465
|
-
${_optionalChain([config, 'access',
|
|
10483
|
+
${_optionalChain([config, 'access', _255 => _255.agent, 'optionalAccess', _256 => _256.apiCatalog]) ? `
|
|
10466
10484
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
10467
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
10485
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkK4UGCUXXcjs.FARM_API_CATALOG_PATH)}) {
|
|
10468
10486
|
return applyProductionMiddlewareHeaders(
|
|
10469
10487
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
10470
10488
|
middlewareHeaders,
|
|
@@ -10489,11 +10507,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10489
10507
|
);
|
|
10490
10508
|
}
|
|
10491
10509
|
` : ""}
|
|
10492
|
-
${_optionalChain([config, 'access',
|
|
10510
|
+
${_optionalChain([config, 'access', _257 => _257.agent, 'optionalAccess', _258 => _258.llmsTxt, 'optionalAccess', _259 => _259.enabled]) ? `
|
|
10493
10511
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
10494
10512
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
10495
10513
|
? "llms"
|
|
10496
|
-
: ${_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;
|
|
10497
10515
|
if (farmGeneratedLlmsKind) {
|
|
10498
10516
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
10499
10517
|
// Renders are shared per origin the request reached, which is where pages are read.
|
|
@@ -10529,7 +10547,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10529
10547
|
}
|
|
10530
10548
|
` : ""}
|
|
10531
10549
|
|
|
10532
|
-
${_optionalChain([config, 'access',
|
|
10550
|
+
${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 => _264.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
10533
10551
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
10534
10552
|
if (docsAPIResponse) {
|
|
10535
10553
|
return applyProductionMiddlewareHeaders(
|
|
@@ -10550,6 +10568,14 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10550
10568
|
// Handle page routes (SSR)
|
|
10551
10569
|
emitFarmEvent({ type: "render.start", route: pathname, pathname });
|
|
10552
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
|
+
}
|
|
10553
10579
|
${farmIslandsMode ? `// Islands mode: a form or client component posting a server action to this page.
|
|
10554
10580
|
if (matchedRoute && request.method === "POST") {
|
|
10555
10581
|
const actionResponse = await _runWithMiddlewareData(middlewareData || {}, () =>
|
|
@@ -11119,7 +11145,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11119
11145
|
);
|
|
11120
11146
|
}
|
|
11121
11147
|
}
|
|
11122
|
-
${_optionalChain([config, 'access',
|
|
11148
|
+
${_optionalChain([config, 'access', _265 => _265.md, 'optionalAccess', _266 => _266.enabled]) ? `
|
|
11123
11149
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
11124
11150
|
// using the public path the .md request will be resolved against.
|
|
11125
11151
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -11138,7 +11164,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11138
11164
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
|
|
11139
11165
|
}
|
|
11140
11166
|
|
|
11141
|
-
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)))} });
|
|
11142
11168
|
const title = renderedMetadata.title;
|
|
11143
11169
|
const metaTags = renderedMetadata.tags;
|
|
11144
11170
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -11540,7 +11566,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11540
11566
|
${servesDefaultMCP ? `
|
|
11541
11567
|
// agent.mcp: no app route answered /mcp, so the default read-only server may.
|
|
11542
11568
|
if (
|
|
11543
|
-
normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
11569
|
+
normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkVG6HYT5Kcjs.FARM_DEFAULT_MCP_PATH)} &&
|
|
11544
11570
|
getFarmDefaultMCPServer()
|
|
11545
11571
|
) {
|
|
11546
11572
|
return applyProductionMiddlewareHeaders(
|
|
@@ -11682,6 +11708,13 @@ ${farmRendererDisabled ? `
|
|
|
11682
11708
|
{ status: 404, headers: { "Content-Type": "application/json" } }
|
|
11683
11709
|
), middlewareHeaders);
|
|
11684
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;
|
|
11685
11718
|
// Agents that navigate in Markdown (a \`.md\` URL or \`Accept: text/markdown\`)
|
|
11686
11719
|
// get a Markdown error body instead of the HTML not-found shell.
|
|
11687
11720
|
if (farmRequestWantsMarkdown(pathname, request.headers.get("accept"))) {
|
|
@@ -11898,11 +11931,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
|
|
|
11898
11931
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
11899
11932
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
11900
11933
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
11901
|
-
${_optionalChain([config, 'access',
|
|
11934
|
+
${_optionalChain([config, 'access', _269 => _269.agent, 'optionalAccess', _270 => _270.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
11902
11935
|
basePath: farmLocalAPIBasePath,
|
|
11903
11936
|
dispatch: async (localRequest) =>
|
|
11904
11937
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
11905
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
11938
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _271 => _271.agent, 'optionalAccess', _272 => _272.noindexPreviews]) ? `
|
|
11906
11939
|
// Keep every response of a preview deployment out of search indexes.
|
|
11907
11940
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
11908
11941
|
}
|
|
@@ -11920,9 +11953,10 @@ async function handleFarmFetch(request, context) {
|
|
|
11920
11953
|
);
|
|
11921
11954
|
|
|
11922
11955
|
// headers() config applies after middleware let the request through, so it learns
|
|
11923
|
-
// 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.
|
|
11924
11958
|
let farmGuardedResponse = false;
|
|
11925
|
-
if (configuredHeaderRoutes.length > 0) {
|
|
11959
|
+
if (configuredHeaderRoutes.length > 0 || farmPluginRuntime) {
|
|
11926
11960
|
const adapterContext = context;
|
|
11927
11961
|
context = {
|
|
11928
11962
|
...adapterContext,
|
|
@@ -11955,9 +11989,15 @@ async function handleFarmFetch(request, context) {
|
|
|
11955
11989
|
const configured = applyConfiguredResponseHeaders(response, routePathname);
|
|
11956
11990
|
// Configured headers may edit the response in place, so check it either way.
|
|
11957
11991
|
const guarded = farmGuardedResponse ? _withFarmGuardedResponseCache(configured) : configured;
|
|
11992
|
+
// The deployment cookie goes on once the response's cache policy is final.
|
|
11958
11993
|
return applyFarmPreloadBudget(
|
|
11959
11994
|
applyFarmCspNonceToResponse(
|
|
11960
|
-
|
|
11995
|
+
_withFarmDeploymentCookie(
|
|
11996
|
+
runtimeRequest,
|
|
11997
|
+
applyFarmMobileShellResponse(runtimeRequest, guarded, context),
|
|
11998
|
+
farmDeploymentId,
|
|
11999
|
+
farmDeploymentCookiePath,
|
|
12000
|
+
),
|
|
11961
12001
|
farmSecurityConfig,
|
|
11962
12002
|
cspNonce,
|
|
11963
12003
|
),
|
|
@@ -12002,7 +12042,9 @@ async function handleFarmFetch(request, context) {
|
|
|
12002
12042
|
const response = await _runWithCurrentRequest(request, () =>
|
|
12003
12043
|
_runWithFarmCspNonce(cspNonce, () => _runWithAfterRequest(request, runRequest, context)),
|
|
12004
12044
|
);
|
|
12005
|
-
|
|
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"};
|
|
12006
12048
|
}),
|
|
12007
12049
|
{
|
|
12008
12050
|
onResponseFinished: typeof context?.onResponseFinished === "function"
|
|
@@ -12088,7 +12130,7 @@ function getManifestPageEntry(manifest, pathname) {
|
|
|
12088
12130
|
}
|
|
12089
12131
|
function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
12090
12132
|
if (!edgeGuarded) return headers;
|
|
12091
|
-
const cacheHeaders = /* @__PURE__ */ new Set(["cache-control", ...
|
|
12133
|
+
const cacheHeaders = /* @__PURE__ */ new Set(["cache-control", ..._chunkJWY66PIDcjs.CDN_CACHE_CONTROL_HEADERS]);
|
|
12092
12134
|
return {
|
|
12093
12135
|
...Object.fromEntries(
|
|
12094
12136
|
Object.entries(headers).filter(([name]) => !cacheHeaders.has(name.toLowerCase()))
|
|
@@ -12096,6 +12138,14 @@ function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
|
12096
12138
|
"cache-control": "private, no-store"
|
|
12097
12139
|
};
|
|
12098
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
|
+
}
|
|
12099
12149
|
function getPhysicalPrerenderBypassReason(options) {
|
|
12100
12150
|
const {
|
|
12101
12151
|
config,
|
|
@@ -12105,6 +12155,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12105
12155
|
rewriteSources,
|
|
12106
12156
|
pathname
|
|
12107
12157
|
} = options;
|
|
12158
|
+
if (prerenderWouldChangePageUrl(pathname)) return "an escaped character in its URL";
|
|
12108
12159
|
if (config.i18n.enabled) return "request-sensitive i18n";
|
|
12109
12160
|
if (redirectSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
12110
12161
|
return "redirect";
|
|
@@ -12112,13 +12163,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12112
12163
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
12113
12164
|
return "rewrite";
|
|
12114
12165
|
}
|
|
12115
|
-
if (
|
|
12116
|
-
if (
|
|
12117
|
-
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";
|
|
12118
12169
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
12119
12170
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
12120
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
12121
|
-
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)) {
|
|
12122
12173
|
return "route runtime controls";
|
|
12123
12174
|
}
|
|
12124
12175
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -12131,15 +12182,15 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12131
12182
|
return void 0;
|
|
12132
12183
|
}
|
|
12133
12184
|
async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
12134
|
-
if (!_optionalChain([config, 'access',
|
|
12135
|
-
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") {
|
|
12136
12187
|
_chunkQMNWKQL4cjs.logger.info(
|
|
12137
12188
|
`\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
|
|
12138
12189
|
);
|
|
12139
12190
|
return [];
|
|
12140
12191
|
}
|
|
12141
|
-
if (!
|
|
12142
|
-
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, {
|
|
12143
12194
|
root,
|
|
12144
12195
|
srcDir: config.srcDir
|
|
12145
12196
|
});
|
|
@@ -12156,7 +12207,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
12156
12207
|
);
|
|
12157
12208
|
return [];
|
|
12158
12209
|
}
|
|
12159
|
-
const pages = await
|
|
12210
|
+
const pages = await _chunkI7NUT24Zcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
12160
12211
|
if (!pages) {
|
|
12161
12212
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
12162
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.`
|
|
@@ -12166,14 +12217,14 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
12166
12217
|
return pages;
|
|
12167
12218
|
}
|
|
12168
12219
|
async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
12169
|
-
if (!_optionalChain([config, 'access',
|
|
12220
|
+
if (!_optionalChain([config, 'access', _278 => _278.docs, 'optionalAccess', _279 => _279.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
|
|
12170
12221
|
return [];
|
|
12171
12222
|
}
|
|
12172
12223
|
try {
|
|
12173
|
-
return await
|
|
12224
|
+
return await _chunkI7NUT24Zcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
12174
12225
|
root,
|
|
12175
12226
|
srcDir: config.srcDir,
|
|
12176
|
-
adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) &&
|
|
12227
|
+
adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
12177
12228
|
});
|
|
12178
12229
|
} catch (error) {
|
|
12179
12230
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
@@ -12184,9 +12235,9 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
|
12184
12235
|
}
|
|
12185
12236
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
12186
12237
|
return Object.values(routeRules || {}).some((rule) => {
|
|
12187
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
12188
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
12189
|
-
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]);
|
|
12190
12241
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
12191
12242
|
});
|
|
12192
12243
|
}
|
|
@@ -12199,10 +12250,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12199
12250
|
const nitroBuilder = nitroBuilderResult.value;
|
|
12200
12251
|
const isVercel = preset === "vercel";
|
|
12201
12252
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
12202
|
-
const outputDir =
|
|
12253
|
+
const outputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
12203
12254
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
12204
12255
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
12205
|
-
const imageRuntime =
|
|
12256
|
+
const imageRuntime = _chunkM6U6E4F7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
12206
12257
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
12207
12258
|
(image) => image.sourceType === "module"
|
|
12208
12259
|
);
|
|
@@ -12258,7 +12309,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12258
12309
|
const edgeGuardedPrerenderRoutes = [];
|
|
12259
12310
|
const addPrerenderRoute = (pathname) => {
|
|
12260
12311
|
prerenderRoutes.push(pathname);
|
|
12261
|
-
if (
|
|
12312
|
+
if (_chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
|
|
12262
12313
|
edgeGuardedPrerenderRoutes.push(pathname);
|
|
12263
12314
|
}
|
|
12264
12315
|
};
|
|
@@ -12336,7 +12387,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12336
12387
|
webEntry: clientJsSrc,
|
|
12337
12388
|
webBoot: clientBootSrc,
|
|
12338
12389
|
stylesheet: clientCssHref,
|
|
12339
|
-
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess',
|
|
12390
|
+
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _283 => _283.files]), () => ( []))
|
|
12340
12391
|
})
|
|
12341
12392
|
) : null;
|
|
12342
12393
|
for (const output of Object.values(ssrBundle)) {
|
|
@@ -12536,6 +12587,7 @@ ${hasNitroCacheRouteRules ? " let farmGuardedResponse = false\n" : ""} const r
|
|
|
12536
12587
|
onResponseFinished: createResponseFinishedHook(event),
|
|
12537
12588
|
trustedLocalOrigin: resolveTrustedLocalOrigin(event, request),
|
|
12538
12589
|
clientAddress: resolveFarmClientAddress(event),${hasNitroCacheRouteRules ? `
|
|
12590
|
+
routeRuleCache: Boolean(event.context?.routeRules?.cache),
|
|
12539
12591
|
onGuardedResponse: () => {
|
|
12540
12592
|
farmGuardedResponse = true
|
|
12541
12593
|
},` : ""}
|
|
@@ -12650,11 +12702,14 @@ function toFarmNodeResponse(request, response) {
|
|
|
12650
12702
|
ssrEntryFile
|
|
12651
12703
|
);
|
|
12652
12704
|
const configuredNitroRouteRules = _chunkOCNV4CI2cjs.nitroRouteRulesBelowBasePath.call(void 0,
|
|
12653
|
-
|
|
12705
|
+
varyFarmNitroCacheRules(_chunkOCNV4CI2cjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
|
|
12706
|
+
...config.md.enabled ? ["accept"] : [],
|
|
12707
|
+
...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : []
|
|
12708
|
+
]),
|
|
12654
12709
|
config.basePath,
|
|
12655
12710
|
_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
|
|
12656
12711
|
);
|
|
12657
|
-
const toPrerenderPublicPath = (route) =>
|
|
12712
|
+
const toPrerenderPublicPath = (route) => _chunkDVJM55D2cjs.normalizeFarmTrailingSlashPathname.call(void 0,
|
|
12658
12713
|
_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, route, config.basePath),
|
|
12659
12714
|
config.trailingSlash === true
|
|
12660
12715
|
);
|
|
@@ -12796,23 +12851,23 @@ function toFarmNodeResponse(request, response) {
|
|
|
12796
12851
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
12797
12852
|
);
|
|
12798
12853
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
12799
|
-
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
12800
|
-
_optionalChain([nitroConfig, 'access',
|
|
12801
|
-
(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
|
|
12802
12857
|
)])
|
|
12803
12858
|
);
|
|
12804
|
-
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);
|
|
12805
12860
|
const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
|
|
12806
12861
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
12807
12862
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
12808
12863
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
12809
12864
|
const shouldMinify = nitroConfig.minify !== false;
|
|
12810
|
-
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]));
|
|
12811
12866
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
12812
12867
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
12813
12868
|
const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
|
|
12814
12869
|
if (ssrRollupPlugin) {
|
|
12815
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
12870
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _299 => _299.rollupConfig, 'optionalAccess', _300 => _300.plugins]);
|
|
12816
12871
|
nitroConfig.rollupConfig = {
|
|
12817
12872
|
...nitroConfig.rollupConfig,
|
|
12818
12873
|
plugins: [
|
|
@@ -12829,7 +12884,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
12829
12884
|
Array.from(routes, (route, index) => {
|
|
12830
12885
|
try {
|
|
12831
12886
|
return [decodeURI(route), index];
|
|
12832
|
-
} catch (
|
|
12887
|
+
} catch (e35) {
|
|
12833
12888
|
return [route, index];
|
|
12834
12889
|
}
|
|
12835
12890
|
})
|
|
@@ -12839,10 +12894,10 @@ function toFarmNodeResponse(request, response) {
|
|
|
12839
12894
|
const orderOf = (route) => _nullishCoalesce(prerenderOrder.get(route), () => ( Number.MAX_SAFE_INTEGER));
|
|
12840
12895
|
prerenderedRoutes.sort((a, b) => orderOf(a.route) - orderOf(b.route));
|
|
12841
12896
|
});
|
|
12842
|
-
if (_optionalChain([config, 'access',
|
|
12897
|
+
if (_optionalChain([config, 'access', _301 => _301.md, 'optionalAccess', _302 => _302.enabled])) {
|
|
12843
12898
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
12844
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
12845
|
-
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, {
|
|
12846
12901
|
routePathname: (pathname) => routeManager.toRoutePathname(pathname)
|
|
12847
12902
|
});
|
|
12848
12903
|
if (!alternatePath) return;
|
|
@@ -12864,7 +12919,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
12864
12919
|
}
|
|
12865
12920
|
if (config.security.csp && config.security.csp.nonce) {
|
|
12866
12921
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
12867
|
-
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;
|
|
12868
12923
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
12869
12924
|
if (!staticCsp) return;
|
|
12870
12925
|
route.contents = staticCsp.html;
|
|
@@ -12899,7 +12954,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
12899
12954
|
await nitroBuilder.copyPublicAssets(nitroInstance);
|
|
12900
12955
|
if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
|
|
12901
12956
|
nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
|
|
12902
|
-
const configuredPlugins = _optionalChain([prerendererConfig, 'access',
|
|
12957
|
+
const configuredPlugins = _optionalChain([prerendererConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.plugins]);
|
|
12903
12958
|
const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
|
|
12904
12959
|
prerendererConfig.rollupConfig = {
|
|
12905
12960
|
...prerendererConfig.rollupConfig,
|
|
@@ -12956,13 +13011,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
12956
13011
|
}
|
|
12957
13012
|
if (prerenderRoutes.length > 0) {
|
|
12958
13013
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
12959
|
-
const previousPrerender = process.env[
|
|
12960
|
-
process.env[
|
|
13014
|
+
const previousPrerender = process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV];
|
|
13015
|
+
process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV] = "1";
|
|
12961
13016
|
try {
|
|
12962
13017
|
await nitroBuilder.prerender(nitroInstance);
|
|
12963
13018
|
} finally {
|
|
12964
|
-
if (previousPrerender === void 0) delete process.env[
|
|
12965
|
-
else process.env[
|
|
13019
|
+
if (previousPrerender === void 0) delete process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV];
|
|
13020
|
+
else process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
12966
13021
|
}
|
|
12967
13022
|
}
|
|
12968
13023
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
|
|
@@ -13075,7 +13130,7 @@ async function populateCloudflareProcessEnv(serverDir, fs4) {
|
|
|
13075
13130
|
throw error;
|
|
13076
13131
|
}
|
|
13077
13132
|
const wrangler = JSON.parse(source);
|
|
13078
|
-
const flags =
|
|
13133
|
+
const flags = _chunkNLBHLPEOcjs.resolveCloudflareProcessEnvFlags.call(void 0, wrangler);
|
|
13079
13134
|
if (!flags) return;
|
|
13080
13135
|
await fs4.writeFile(
|
|
13081
13136
|
wranglerPath,
|
|
@@ -13138,7 +13193,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
13138
13193
|
await fs4.rename(src, dest);
|
|
13139
13194
|
return;
|
|
13140
13195
|
} catch (error) {
|
|
13141
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
13196
|
+
const code = _optionalChain([error, 'optionalAccess', _315 => _315.code]);
|
|
13142
13197
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
13143
13198
|
throw error;
|
|
13144
13199
|
}
|
|
@@ -13164,7 +13219,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13164
13219
|
try {
|
|
13165
13220
|
await moveVercelOutputPath(publicDir, staticDir, fs4);
|
|
13166
13221
|
} catch (error) {
|
|
13167
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
13222
|
+
if (_optionalChain([error, 'optionalAccess', _316 => _316.code]) !== "ENOENT") throw error;
|
|
13168
13223
|
}
|
|
13169
13224
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
|
|
13170
13225
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
|
|
@@ -13178,7 +13233,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13178
13233
|
config.basePath
|
|
13179
13234
|
);
|
|
13180
13235
|
const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
|
|
13181
|
-
(route) => edgeMiddleware.guardedPages.some((pathname) =>
|
|
13236
|
+
(route) => edgeMiddleware.guardedPages.some((pathname) => _chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
|
|
13182
13237
|
);
|
|
13183
13238
|
if (edgeMiddlewareRoutes.length > 0) {
|
|
13184
13239
|
await writeFarmVercelEdgeMiddlewareFunction({
|
|
@@ -13206,8 +13261,8 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13206
13261
|
_chunkQMNWKQL4cjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
13207
13262
|
}
|
|
13208
13263
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
13209
|
-
if (!_optionalChain([config, 'access',
|
|
13210
|
-
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);
|
|
13211
13266
|
await copyFarmDocsRootContent(
|
|
13212
13267
|
mainRoot,
|
|
13213
13268
|
root,
|
|
@@ -13228,10 +13283,10 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
|
13228
13283
|
async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs4) {
|
|
13229
13284
|
const docsContentDir = resolveBuildDocsContentDir(docs, root, srcDir);
|
|
13230
13285
|
if (!docsContentDir) return;
|
|
13231
|
-
const lastModifiedManifest =
|
|
13286
|
+
const lastModifiedManifest = _chunkNAXKOTPPcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
13232
13287
|
fallback: "now"
|
|
13233
13288
|
});
|
|
13234
|
-
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access',
|
|
13289
|
+
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _319 => _319.unknown, 'optionalAccess', _320 => _320.length]), () => ( 0));
|
|
13235
13290
|
if (undatedPages > 0) {
|
|
13236
13291
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
13237
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.`
|
|
@@ -13241,10 +13296,11 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
|
|
|
13241
13296
|
await fs4.mkdir(_path2.default.dirname(bundledContentDir), { recursive: true });
|
|
13242
13297
|
await fs4.cp(docsContentDir, bundledContentDir, {
|
|
13243
13298
|
recursive: true,
|
|
13244
|
-
force: true
|
|
13299
|
+
force: true,
|
|
13300
|
+
dereference: true
|
|
13245
13301
|
});
|
|
13246
13302
|
await fs4.writeFile(
|
|
13247
|
-
_path2.default.join(bundledContentDir,
|
|
13303
|
+
_path2.default.join(bundledContentDir, _chunkNAXKOTPPcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
|
|
13248
13304
|
`${JSON.stringify(lastModifiedManifest, null, 2)}
|
|
13249
13305
|
`
|
|
13250
13306
|
);
|
|
@@ -13270,7 +13326,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
13270
13326
|
if (!resolvePackageJson(projectRequire, "sharp")) {
|
|
13271
13327
|
try {
|
|
13272
13328
|
sharpRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
13273
|
-
} catch (
|
|
13329
|
+
} catch (e36) {
|
|
13274
13330
|
}
|
|
13275
13331
|
}
|
|
13276
13332
|
const copiedPackages = /* @__PURE__ */ new Map();
|
|
@@ -13315,7 +13371,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
13315
13371
|
try {
|
|
13316
13372
|
await copyPackage("sharp", sharpRequire);
|
|
13317
13373
|
if (!copiedPackages.has("sharp")) {
|
|
13318
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
13374
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkM6U6E4F7cjs.SHARP_INSTALL_HINT}`);
|
|
13319
13375
|
}
|
|
13320
13376
|
} catch (error) {
|
|
13321
13377
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -13397,7 +13453,7 @@ function resolveMetadataImageRuntimePackageJson(root) {
|
|
|
13397
13453
|
if (packageJsonPath) return packageJsonPath;
|
|
13398
13454
|
try {
|
|
13399
13455
|
return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
|
|
13400
|
-
} catch (
|
|
13456
|
+
} catch (e37) {
|
|
13401
13457
|
return null;
|
|
13402
13458
|
}
|
|
13403
13459
|
}
|
|
@@ -13444,7 +13500,7 @@ function resolvePackageJson(parentRequire, packageName) {
|
|
|
13444
13500
|
const resolved = parentRequire.resolve(request);
|
|
13445
13501
|
if (resolved.endsWith(".json")) return resolved;
|
|
13446
13502
|
_nullishCoalesce(metadataModule, () => ( (metadataModule = resolved)));
|
|
13447
|
-
} catch (
|
|
13503
|
+
} catch (e38) {
|
|
13448
13504
|
}
|
|
13449
13505
|
}
|
|
13450
13506
|
try {
|
|
@@ -13455,13 +13511,13 @@ function resolvePackageJson(parentRequire, packageName) {
|
|
|
13455
13511
|
try {
|
|
13456
13512
|
const manifest = JSON.parse(_fs.readFileSync.call(void 0, candidate, "utf8"));
|
|
13457
13513
|
if (manifest.name === packageName) return candidate;
|
|
13458
|
-
} catch (
|
|
13514
|
+
} catch (e39) {
|
|
13459
13515
|
}
|
|
13460
13516
|
}
|
|
13461
13517
|
if (_path2.default.basename(directory) === "node_modules") break;
|
|
13462
13518
|
directory = _path2.default.dirname(directory);
|
|
13463
13519
|
}
|
|
13464
|
-
} catch (
|
|
13520
|
+
} catch (e40) {
|
|
13465
13521
|
}
|
|
13466
13522
|
return null;
|
|
13467
13523
|
}
|
|
@@ -13472,7 +13528,7 @@ async function resolveProjectInstalledPackageDir(root, packageName, fs4) {
|
|
|
13472
13528
|
try {
|
|
13473
13529
|
const packageDir = await fs4.realpath(candidate);
|
|
13474
13530
|
if ((await fs4.stat(_path2.default.join(packageDir, "package.json"))).isFile()) return packageDir;
|
|
13475
|
-
} catch (
|
|
13531
|
+
} catch (e41) {
|
|
13476
13532
|
}
|
|
13477
13533
|
const parent = _path2.default.dirname(directory);
|
|
13478
13534
|
if (parent === directory) return null;
|
|
@@ -13485,7 +13541,7 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs4) {
|
|
|
13485
13541
|
const generatedClientDir = _path2.default.join(prismaClientDir, "..", "..", ".prisma", "client");
|
|
13486
13542
|
try {
|
|
13487
13543
|
await fs4.access(generatedClientDir);
|
|
13488
|
-
} catch (
|
|
13544
|
+
} catch (e42) {
|
|
13489
13545
|
return;
|
|
13490
13546
|
}
|
|
13491
13547
|
const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
|
|
@@ -13545,7 +13601,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
13545
13601
|
// src/build/index.ts
|
|
13546
13602
|
async function build(config, options = {}) {
|
|
13547
13603
|
return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
|
|
13548
|
-
() =>
|
|
13604
|
+
() => _chunkIEN2EFE5cjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
13549
13605
|
);
|
|
13550
13606
|
}
|
|
13551
13607
|
function createBuildTargetBaseline(config) {
|
|
@@ -13556,7 +13612,7 @@ function createBuildTargetBaseline(config) {
|
|
|
13556
13612
|
preset,
|
|
13557
13613
|
distDir,
|
|
13558
13614
|
outputDir,
|
|
13559
|
-
outputWasDerived: outputDir ===
|
|
13615
|
+
outputWasDerived: outputDir === _chunkXYVPTTUTcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
13560
13616
|
};
|
|
13561
13617
|
}
|
|
13562
13618
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -13565,8 +13621,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
13565
13621
|
const distDir = config.distDir || ".farm";
|
|
13566
13622
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
13567
13623
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
13568
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
13569
|
-
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;
|
|
13570
13626
|
return {
|
|
13571
13627
|
root,
|
|
13572
13628
|
preset,
|
|
@@ -13574,7 +13630,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
13574
13630
|
distDir,
|
|
13575
13631
|
deployTarget,
|
|
13576
13632
|
outputDir,
|
|
13577
|
-
deployOutputDir:
|
|
13633
|
+
deployOutputDir: _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
13578
13634
|
};
|
|
13579
13635
|
}
|
|
13580
13636
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -13611,15 +13667,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13611
13667
|
};
|
|
13612
13668
|
config = {
|
|
13613
13669
|
...config,
|
|
13614
|
-
images:
|
|
13670
|
+
images: _chunkM6U6E4F7cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
13615
13671
|
root: targets.root,
|
|
13616
13672
|
preset: targets.preset
|
|
13617
13673
|
})
|
|
13618
13674
|
};
|
|
13619
|
-
if (_optionalChain([config, 'access',
|
|
13675
|
+
if (_optionalChain([config, 'access', _321 => _321.docs, 'optionalAccess', _322 => _322.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
|
|
13620
13676
|
pluginManager.updateContext({ config });
|
|
13621
13677
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
13622
|
-
|
|
13678
|
+
_chunkIEN2EFE5cjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkIEN2EFE5cjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
13623
13679
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
13624
13680
|
await pluginManager.setupPlugins();
|
|
13625
13681
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
@@ -13631,8 +13687,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13631
13687
|
});
|
|
13632
13688
|
_chunkQMNWKQL4cjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
13633
13689
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
13634
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
13635
|
-
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]);
|
|
13636
13692
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
13637
13693
|
projectModuleServer = await createProjectModuleServer(
|
|
13638
13694
|
createViteServer,
|
|
@@ -13640,18 +13696,18 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13640
13696
|
root,
|
|
13641
13697
|
rendererBuild.signal
|
|
13642
13698
|
);
|
|
13643
|
-
const farmApp =
|
|
13699
|
+
const farmApp = _chunkM6U6E4F7cjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
13644
13700
|
await farmApp.initialize();
|
|
13645
13701
|
const routeManager = farmApp.getRouteManager();
|
|
13646
13702
|
const serverRenderer = farmApp.getServerRenderer();
|
|
13647
|
-
const typeArtifacts =
|
|
13703
|
+
const typeArtifacts = _chunkK7JMTAFHcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
13648
13704
|
root,
|
|
13649
13705
|
srcDir,
|
|
13650
13706
|
layers: config.layers,
|
|
13651
13707
|
plugins: config.plugins,
|
|
13652
13708
|
extraRoutes: [
|
|
13653
|
-
..._optionalChain([config, 'access',
|
|
13654
|
-
...
|
|
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)
|
|
13655
13711
|
],
|
|
13656
13712
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
13657
13713
|
componentExtensions: config.renderer.componentExtensions,
|
|
@@ -13660,7 +13716,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13660
13716
|
const message = error instanceof Error ? error.message : String(error);
|
|
13661
13717
|
_chunkQMNWKQL4cjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
13662
13718
|
});
|
|
13663
|
-
const apiRouteManager = new (0,
|
|
13719
|
+
const apiRouteManager = new (0, _chunkK66JILV3cjs.APIRouteManager)(
|
|
13664
13720
|
_chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config),
|
|
13665
13721
|
projectModuleServer,
|
|
13666
13722
|
{
|
|
@@ -13735,7 +13791,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13735
13791
|
throw error;
|
|
13736
13792
|
} finally {
|
|
13737
13793
|
try {
|
|
13738
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
13794
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _327 => _327.close, 'call', _328 => _328()]);
|
|
13739
13795
|
} finally {
|
|
13740
13796
|
rendererBuild.abort();
|
|
13741
13797
|
}
|
|
@@ -13747,7 +13803,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13747
13803
|
ssr: true,
|
|
13748
13804
|
buildLifetime
|
|
13749
13805
|
});
|
|
13750
|
-
const viteConfig =
|
|
13806
|
+
const viteConfig = _chunkM6U6E4F7cjs.mergeFarmViteConfig.call(void 0,
|
|
13751
13807
|
{
|
|
13752
13808
|
root,
|
|
13753
13809
|
appType: "custom",
|
|
@@ -13759,12 +13815,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13759
13815
|
},
|
|
13760
13816
|
plugins: [
|
|
13761
13817
|
...rendererVitePlugins,
|
|
13762
|
-
|
|
13818
|
+
_chunkM6U6E4F7cjs.farmFontImportsPlugin.call(void 0, {
|
|
13763
13819
|
root,
|
|
13764
13820
|
basePath: config.basePath,
|
|
13765
13821
|
publicDir: config.publicDir
|
|
13766
13822
|
}),
|
|
13767
|
-
|
|
13823
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
|
|
13768
13824
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
13769
13825
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
13770
13826
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
@@ -13776,7 +13832,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13776
13832
|
hmr: false
|
|
13777
13833
|
},
|
|
13778
13834
|
resolve: {
|
|
13779
|
-
alias:
|
|
13835
|
+
alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
13780
13836
|
dedupe: [...config.renderer.dedupe || []]
|
|
13781
13837
|
},
|
|
13782
13838
|
optimizeDeps: {
|
|
@@ -13815,10 +13871,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13815
13871
|
noDiscovery: true
|
|
13816
13872
|
},
|
|
13817
13873
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
13818
|
-
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 : {
|
|
13819
13875
|
...viteConfig.environments,
|
|
13820
13876
|
ssr: {
|
|
13821
|
-
..._optionalChain([viteConfig, 'access',
|
|
13877
|
+
..._optionalChain([viteConfig, 'access', _333 => _333.environments, 'optionalAccess', _334 => _334.ssr]),
|
|
13822
13878
|
...await createFarmProjectModuleSsrEnvironment()
|
|
13823
13879
|
}
|
|
13824
13880
|
}
|
|
@@ -13846,7 +13902,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
13846
13902
|
farmI18nClientBridgePlugin(),
|
|
13847
13903
|
farmServerOnlyEntriesPlugin(),
|
|
13848
13904
|
farmPlugin(config, pluginManager),
|
|
13849
|
-
|
|
13905
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
13850
13906
|
],
|
|
13851
13907
|
mode: "production"
|
|
13852
13908
|
});
|
|
@@ -13874,12 +13930,12 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
13874
13930
|
define: {
|
|
13875
13931
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
13876
13932
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
13877
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
13933
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _335 => _335.env, 'optionalAccess', _336 => _336.public]) || {})
|
|
13878
13934
|
},
|
|
13879
13935
|
plugins: [
|
|
13880
13936
|
farmI18nClientBridgePlugin(),
|
|
13881
13937
|
farmPlugin(config, pluginManager),
|
|
13882
|
-
|
|
13938
|
+
_chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
13883
13939
|
],
|
|
13884
13940
|
mode: "production"
|
|
13885
13941
|
});
|
|
@@ -13907,7 +13963,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
13907
13963
|
if (pluginManager) {
|
|
13908
13964
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
13909
13965
|
}
|
|
13910
|
-
const outputDir =
|
|
13966
|
+
const outputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
13911
13967
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
13912
13968
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
13913
13969
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -13966,7 +14022,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
13966
14022
|
const { readFile } = await import("fs/promises");
|
|
13967
14023
|
const manifestContent = await readFile(clientManifestPath, "utf-8");
|
|
13968
14024
|
farmRegistry.clientManifest = JSON.parse(manifestContent);
|
|
13969
|
-
} catch (
|
|
14025
|
+
} catch (e43) {
|
|
13970
14026
|
farmRegistry.clientManifest = {};
|
|
13971
14027
|
}
|
|
13972
14028
|
} catch (error) {
|
|
@@ -13978,7 +14034,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
13978
14034
|
root,
|
|
13979
14035
|
preset,
|
|
13980
14036
|
distDir,
|
|
13981
|
-
outputDir:
|
|
14037
|
+
outputDir: _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
13982
14038
|
});
|
|
13983
14039
|
}
|
|
13984
14040
|
}
|