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