@farm.js/core 0.1.65 → 0.1.67
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-QLFDDTYN.mjs → agent-mcp-handler-AZ7QW4UP.mjs} +5 -5
- package/dist/{agent-mcp-handler-OXT73ZBY.cjs → agent-mcp-handler-FER4MQDF.cjs} +6 -6
- package/dist/{agent-mcp.d-QD2WZ9BS.d.ts → agent-mcp.d-BFu9xHAi.d.ts} +1 -1
- package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-DWyWkTSy.d.mts} +1 -1
- package/dist/agent-runtime.cjs +6 -5
- package/dist/agent-runtime.d.mts +6 -6
- package/dist/agent-runtime.d.ts +6 -6
- package/dist/agent-runtime.mjs +5 -4
- package/dist/analyzer-KVZGVY5Q.cjs +16 -0
- package/dist/{analyzer-PE33SK5W.mjs → analyzer-TTIIXXMQ.mjs} +3 -3
- package/dist/api/client.cjs +12 -2
- package/dist/api/client.d.mts +4 -4
- package/dist/api/client.d.ts +4 -4
- package/dist/api/client.mjs +12 -2
- package/dist/api/client.native.cjs +12 -2
- package/dist/api/client.native.d.mts +5 -5
- package/dist/api/client.native.d.ts +5 -5
- package/dist/api/client.native.mjs +12 -2
- package/dist/api/node.cjs +223 -0
- package/dist/api/node.d.mts +59 -0
- package/dist/api/node.d.ts +59 -0
- package/dist/api/node.mjs +223 -0
- package/dist/api/route-manager.cjs +11 -11
- package/dist/api/route-manager.d.mts +10 -9
- package/dist/api/route-manager.d.ts +10 -9
- package/dist/api/route-manager.mjs +10 -10
- package/dist/api/runtime.cjs +11 -7
- package/dist/api/runtime.d.mts +7 -7
- package/dist/api/runtime.d.ts +7 -7
- package/dist/api/runtime.mjs +10 -6
- package/dist/{api-client.d-BNLXNCXJ.d.mts → api-client.d-Bp35zMqR.d.mts} +1 -1
- package/dist/{api-client.d-ddQBNGtu.d.ts → api-client.d-CFI_xL0V.d.ts} +1 -1
- package/dist/api.cjs +17 -13
- package/dist/api.d.mts +11 -10
- package/dist/api.d.ts +11 -10
- package/dist/api.mjs +16 -12
- package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-CRmjN5j9.d.mts} +1 -1
- package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-CwfhGrVR.d.ts} +1 -1
- package/dist/app-markdown.cjs +5 -5
- package/dist/app-markdown.d.mts +7 -7
- package/dist/app-markdown.d.ts +7 -7
- package/dist/app-markdown.mjs +4 -4
- package/dist/{app.d-x68Cwr0_.d.ts → app.d-BX9LVTiP.d.ts} +50 -9
- package/dist/{app.d-kuoVWhWM.d.mts → app.d-uBBUxwyV.d.mts} +50 -9
- package/dist/{chunk-V56632LA.cjs → chunk-22IWL4YD.cjs} +19 -5
- package/dist/{chunk-CZF4XIRZ.cjs → chunk-23PVOIPT.cjs} +3 -3
- package/dist/{chunk-5C7XMKQ4.cjs → chunk-2AFW7673.cjs} +6 -1
- package/dist/{chunk-SYW346ZN.cjs → chunk-2LHZD3OP.cjs} +1 -21
- package/dist/{chunk-ZZI56IUY.mjs → chunk-2ZOYOYEE.mjs} +13 -13
- package/dist/{chunk-RVGSVQWT.mjs → chunk-3T5TLFCQ.mjs} +10 -5
- package/dist/{chunk-XBSKPLHF.cjs → chunk-3T7ALZJF.cjs} +2 -2
- package/dist/{chunk-JCEFKP5M.mjs → chunk-423SSBYQ.mjs} +6 -0
- package/dist/{chunk-7QVRWGBL.cjs → chunk-4DRINDGN.cjs} +319 -138
- package/dist/{chunk-O6L3YYPM.cjs → chunk-4E57QHPW.cjs} +8 -16
- package/dist/{chunk-WKPBIT5Q.cjs → chunk-4HGLJOXZ.cjs} +6 -6
- package/dist/{chunk-JGAE5XPL.cjs → chunk-4JX3M4C6.cjs} +2 -1
- package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
- package/dist/{chunk-IMK32ERL.cjs → chunk-556H7JCE.cjs} +65 -48
- package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
- package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
- package/dist/{chunk-TZVUF5JJ.mjs → chunk-5TA63JD3.mjs} +4 -4
- package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
- package/dist/chunk-6I4BFRE7.cjs +51 -0
- package/dist/{chunk-OSFIUSYK.cjs → chunk-6R53ZWX2.cjs} +7 -7
- package/dist/{chunk-MGKW5XZE.cjs → chunk-6SQZXRJ2.cjs} +7 -7
- package/dist/{chunk-WNXVWXG3.cjs → chunk-6V5YWI4W.cjs} +2 -2
- package/dist/{chunk-BM2LH2JM.mjs → chunk-6YBYX4K4.mjs} +13 -12
- package/dist/{chunk-X3XUZWRB.mjs → chunk-724MGMIL.mjs} +17 -3
- package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
- package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
- package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
- package/dist/{chunk-TGULJSHD.mjs → chunk-AJNBTOVQ.mjs} +20 -9
- package/dist/{chunk-FBEBSAVI.cjs → chunk-AKIQ54FK.cjs} +82 -63
- package/dist/{chunk-2NGZFOKG.mjs → chunk-AOIUYHPH.mjs} +2 -2
- package/dist/{chunk-ZEXE4TGY.mjs → chunk-AQDLVHNF.mjs} +230 -110
- package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
- package/dist/chunk-AQIRXBBY.cjs +26 -0
- package/dist/chunk-AZ6IW6SF.mjs +28 -0
- package/dist/{chunk-QMDU6QHN.mjs → chunk-B6RBJJ5G.mjs} +1 -1
- package/dist/{chunk-I32V5CZL.cjs → chunk-BDYM2TN3.cjs} +28 -17
- package/dist/{chunk-JLDNXURZ.cjs → chunk-BZWTBELF.cjs} +32 -32
- package/dist/{chunk-ITV4QQL2.cjs → chunk-C6CUUBY5.cjs} +14 -3
- package/dist/{chunk-V727H3RI.cjs → chunk-CCAUIBIS.cjs} +6 -0
- package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
- package/dist/{chunk-ZX2JHEWW.mjs → chunk-CO3YMZFD.mjs} +20 -9
- package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
- package/dist/{chunk-CNNBFGL5.cjs → chunk-DB2HSHQA.cjs} +14 -14
- package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
- package/dist/{chunk-32RPJAAS.cjs → chunk-DCXSIEFE.cjs} +40 -41
- package/dist/{chunk-D4MRNBVF.cjs → chunk-DGOFR7D5.cjs} +2 -2
- package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
- package/dist/chunk-DXZ57EPE.mjs +375 -0
- package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
- package/dist/{chunk-EFZGB7JC.cjs → chunk-E5UN4OWX.cjs} +1 -0
- package/dist/{chunk-HKNYNSOK.mjs → chunk-E6CD45JK.mjs} +30 -31
- package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
- package/dist/chunk-EIVGPQN5.mjs +51 -0
- package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
- package/dist/{chunk-E552H232.cjs → chunk-F43OG25P.cjs} +1 -1
- package/dist/{chunk-UAQD67HM.mjs → chunk-F7JKVHU2.mjs} +1 -1
- package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
- package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
- package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
- package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
- package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
- package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
- package/dist/{chunk-ZAUOOGER.mjs → chunk-GTV2ABO7.mjs} +218 -37
- package/dist/{chunk-72JSHQQQ.mjs → chunk-H37MDCPR.mjs} +1 -1
- package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
- package/dist/{chunk-25T5VXOE.mjs → chunk-HFHJJXSV.mjs} +106 -19
- package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
- package/dist/{chunk-A3G5IY2W.cjs → chunk-HM7AGSKU.cjs} +1 -1
- package/dist/{chunk-GL7N5UHF.cjs → chunk-HNVAZGQD.cjs} +20 -9
- package/dist/{chunk-GRBJ7VKH.mjs → chunk-HP2DQGQH.mjs} +1 -1
- package/dist/{chunk-E2TSYUHV.mjs → chunk-HRPTMX5C.mjs} +4 -4
- package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
- package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
- package/dist/{chunk-VQJHT2ND.mjs → chunk-IRA2CZAY.mjs} +2 -2
- package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
- package/dist/chunk-J6TZRYCO.cjs +22 -0
- package/dist/{chunk-WYAXRIYP.cjs → chunk-J7JHVCWA.cjs} +8 -8
- package/dist/chunk-JSOCDYER.cjs +375 -0
- package/dist/{chunk-YUW7F6SK.mjs → chunk-JVM3DKZE.mjs} +3 -3
- package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
- package/dist/{chunk-BQWBHWEW.mjs → chunk-JWSI5WO4.mjs} +1 -1
- package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
- package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
- package/dist/chunk-K63OWRY2.mjs +22 -0
- package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
- package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
- package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
- package/dist/{chunk-3CCAICF7.cjs → chunk-KCY52OUQ.cjs} +4 -4
- package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
- package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
- package/dist/{chunk-RFKTJTWZ.mjs → chunk-KWFNUODD.mjs} +2 -1
- package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
- package/dist/{chunk-C7DCMGC4.cjs → chunk-LPIZMU7D.cjs} +12 -12
- package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
- package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
- package/dist/{chunk-3KJPIO5D.cjs → chunk-N5DQMOAG.cjs} +589 -678
- package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
- package/dist/{chunk-CBOEJ5Z4.cjs → chunk-OB3IFUK6.cjs} +133 -46
- package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
- package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
- package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
- package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
- package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
- package/dist/{chunk-IP2KHSGF.mjs → chunk-P2NBQ5JI.mjs} +57 -4
- package/dist/{chunk-ZQQK4U66.cjs → chunk-PDFFYZAT.cjs} +72 -19
- package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
- package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
- package/dist/{chunk-YD4J37RN.cjs → chunk-PL6RTBDE.cjs} +30 -19
- package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
- package/dist/{chunk-WMTBBQHY.cjs → chunk-PPX7UOFY.cjs} +271 -151
- package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
- package/dist/{chunk-7XGWBPQQ.cjs → chunk-Q37INCXG.cjs} +13 -8
- package/dist/{chunk-T4M52BA5.cjs → chunk-Q5UX55YA.cjs} +1457 -612
- package/dist/{chunk-53ZCZ46B.cjs → chunk-QGQP6QKO.cjs} +4 -3
- package/dist/{chunk-TZOGZKI7.cjs → chunk-QITSS4TD.cjs} +1381 -626
- package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
- package/dist/{chunk-HCGWDRZO.mjs → chunk-QJVW76JG.mjs} +17 -6
- package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
- package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
- package/dist/chunk-RWR7SMD7.cjs +50 -0
- package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
- package/dist/chunk-SD6JGJOM.mjs +50 -0
- package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
- package/dist/{chunk-E4RDMG3K.mjs → chunk-TEG6HJVF.mjs} +4 -4
- package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
- package/dist/{chunk-ZNXTU4YH.mjs → chunk-TM2E623I.mjs} +1 -0
- package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
- package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
- package/dist/{chunk-W2ZXMMHA.mjs → chunk-UHE5JUKB.mjs} +1 -1
- package/dist/{chunk-6X5NKNBE.mjs → chunk-UHNSY2PQ.mjs} +1304 -459
- package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
- package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
- package/dist/{chunk-Q75QPLBA.mjs → chunk-V5MQMQ2P.mjs} +1 -1
- package/dist/{chunk-TRIDJQ6A.cjs → chunk-V5RTHYJB.cjs} +30 -10
- package/dist/{chunk-QHRCR44V.mjs → chunk-VK54PDQ6.mjs} +25 -5
- package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
- package/dist/{chunk-2L54YV25.mjs → chunk-WDD5CTZW.mjs} +49 -32
- package/dist/{chunk-7GYCZRTH.mjs → chunk-WGHY3OL5.mjs} +355 -444
- package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
- package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
- package/dist/chunk-WVQNXXNE.cjs +28 -0
- package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
- package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
- package/dist/{chunk-VHHLKIDZ.mjs → chunk-XNZWMXCF.mjs} +1090 -335
- package/dist/{chunk-FIR62CR3.mjs → chunk-XUES6OET.mjs} +1 -1
- package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
- package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
- package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
- package/dist/chunk-YFTGIHNC.mjs +26 -0
- package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
- package/dist/{chunk-UYRI6U3P.mjs → chunk-YQYTQJZN.mjs} +3 -2
- package/dist/{chunk-X4K7TYN6.cjs → chunk-YVTS3S3F.cjs} +24 -23
- package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
- package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
- package/dist/client/lifecycle.cjs +2 -2
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/client/lifecycle.mjs +1 -1
- package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-CDRvRmbU.d.mts} +2 -2
- package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DWRKyAp5.d.ts} +2 -2
- package/dist/client-plugins.cjs +2 -2
- package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-BNILjfX3.d.mts} +94 -140
- package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CrKZiNSN.d.ts} +94 -140
- package/dist/client-plugins.d.mts +6 -6
- package/dist/client-plugins.d.ts +6 -6
- package/dist/client-plugins.mjs +1 -1
- package/dist/client.cjs +11 -9
- package/dist/client.d.mts +13 -13
- package/dist/client.d.ts +13 -13
- package/dist/client.mjs +10 -8
- package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
- package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
- package/dist/config.d.mts +6 -6
- package/dist/config.d.ts +6 -6
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/deferred.cjs +2 -2
- package/dist/deferred.mjs +1 -1
- package/dist/deployment.cjs +2 -2
- package/dist/deployment.mjs +1 -1
- package/dist/desktop.d.mts +7 -7
- package/dist/desktop.d.ts +7 -7
- package/dist/{devtools-SGYOG36E.cjs → devtools-RZVT4JVN.cjs} +36 -32
- package/dist/{devtools-PUVZB3F2.mjs → devtools-UFQYT3VA.mjs} +31 -27
- package/dist/docs.cjs +26 -25
- package/dist/docs.d.mts +20 -8
- package/dist/docs.d.ts +20 -8
- package/dist/docs.mjs +25 -24
- package/dist/env-types.cjs +3 -3
- package/dist/env-types.mjs +2 -2
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.mjs +4 -4
- package/dist/headers.cjs +3 -3
- package/dist/headers.mjs +2 -2
- package/dist/image/server.d.mts +1 -1
- package/dist/image/server.d.ts +1 -1
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
- package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
- package/dist/image.cjs +6 -6
- package/dist/image.d.mts +1 -1
- package/dist/image.d.ts +1 -1
- package/dist/image.mjs +1 -1
- package/dist/index.cjs +143 -128
- package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bdm6866n.d.mts} +1 -1
- package/dist/{index.d-A_x10zGS.d.ts → index.d-Dey5T14f.d.ts} +1 -1
- package/dist/index.d.mts +31 -82
- package/dist/index.d.ts +31 -82
- package/dist/index.mjs +214 -199
- package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
- package/dist/integrations/orm.d.mts +33 -0
- package/dist/integrations/orm.d.ts +33 -0
- package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
- package/dist/integrations.cjs +6 -5
- package/dist/integrations.d.mts +6 -6
- package/dist/integrations.d.ts +6 -6
- package/dist/integrations.mjs +5 -4
- package/dist/internal/app-markdown-runtime.cjs +4 -4
- package/dist/internal/app-markdown-runtime.d.mts +17 -8
- package/dist/internal/app-markdown-runtime.d.ts +17 -8
- package/dist/internal/app-markdown-runtime.mjs +3 -3
- package/dist/internal/build-runtime.cjs +70 -68
- package/dist/internal/build-runtime.d.mts +8 -8
- package/dist/internal/build-runtime.d.ts +8 -8
- package/dist/internal/build-runtime.mjs +69 -67
- package/dist/internal/cli-runtime.cjs +45 -44
- package/dist/internal/cli-runtime.mjs +44 -43
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +60 -6
- package/dist/internal/client-runtime.d.mts +40 -11
- package/dist/internal/client-runtime.d.ts +40 -11
- package/dist/internal/client-runtime.mjs +58 -4
- package/dist/internal/compression-runtime.d.mts +6 -6
- package/dist/internal/compression-runtime.d.ts +6 -6
- package/dist/internal/config-runtime.cjs +25 -24
- package/dist/internal/config-runtime.d.mts +9 -9
- package/dist/internal/config-runtime.d.ts +9 -9
- package/dist/internal/config-runtime.mjs +24 -23
- package/dist/internal/docs-precompiled-runtime.cjs +16 -5
- package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
- package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
- package/dist/internal/docs-precompiled-runtime.mjs +15 -4
- package/dist/internal/infra-analytics-runtime.cjs +11 -11
- package/dist/internal/infra-analytics-runtime.mjs +9 -9
- package/dist/internal/islands-runtime.cjs +33 -4
- package/dist/internal/islands-runtime.d.mts +1 -1
- package/dist/internal/islands-runtime.d.ts +1 -1
- package/dist/internal/islands-runtime.mjs +31 -2
- package/dist/internal/native-server-fns.cjs +6 -6
- package/dist/internal/native-server-fns.mjs +5 -5
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +54 -40
- package/dist/internal/production-runtime.d.mts +23 -15
- package/dist/internal/production-runtime.d.ts +23 -15
- package/dist/internal/production-runtime.mjs +69 -55
- package/dist/internal/react-cache.cjs +3 -3
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
- package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
- package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
- package/dist/manager-JOHU6BQI.cjs +15 -0
- package/dist/markdown.cjs +7 -3
- package/dist/markdown.d.mts +6 -6
- package/dist/markdown.d.ts +6 -6
- package/dist/markdown.mjs +6 -2
- package/dist/middleware.cjs +10 -10
- package/dist/middleware.d.mts +8 -8
- package/dist/middleware.d.ts +8 -8
- package/dist/middleware.mjs +9 -9
- package/dist/mobile.d.mts +4 -4
- package/dist/mobile.d.ts +4 -4
- package/dist/mount.d-BP0nLYQO.d.mts +38 -0
- package/dist/mount.d-CkiPky_F.d.ts +38 -0
- package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
- package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
- package/dist/{native-tree-HE2FLS72.cjs → native-tree-W2SSJB3Y.cjs} +5 -5
- package/dist/{native-tree-YF2DSPKM.mjs → native-tree-Y5YQANW7.mjs} +4 -4
- package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-CdBP-hkZ.d.mts} +1 -1
- package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-DchcGzAQ.d.ts} +1 -1
- package/dist/navigation.cjs +8 -7
- package/dist/navigation.d.mts +9 -9
- package/dist/navigation.d.ts +9 -9
- package/dist/navigation.mjs +7 -6
- package/dist/{nitro-DD4QCA66.mjs → nitro-55YOZWRA.mjs} +11 -11
- package/dist/{nitro-VRDX2H4M.cjs → nitro-EEX2J3KB.cjs} +13 -13
- package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
- package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
- package/dist/plugin.cjs +61 -59
- package/dist/plugin.d.mts +8 -8
- package/dist/plugin.d.ts +8 -8
- package/dist/plugin.mjs +60 -58
- package/dist/{port-UFUZL6RI.mjs → port-CLL4BC4O.mjs} +1 -1
- package/dist/{port-VTLHPZOI.cjs → port-HASZTQGY.cjs} +9 -9
- package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-Dou_Htas.d.ts} +1 -1
- package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-VwsBzIee.d.mts} +1 -1
- package/dist/query/client.cjs +9 -7
- package/dist/query/client.mjs +5 -3
- package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-D8UakAIk.d.ts} +1 -1
- package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-LKymStDJ.d.mts} +1 -1
- package/dist/renderer/none/server.cjs +35 -0
- package/dist/renderer/none/server.d.mts +21 -0
- package/dist/renderer/none/server.d.ts +21 -0
- package/dist/renderer/none/server.mjs +35 -0
- package/dist/renderer/react/server.cjs +2 -2
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +8 -6
- package/dist/renderer-client.d.mts +9 -9
- package/dist/renderer-client.d.ts +9 -9
- package/dist/renderer-client.mjs +5 -3
- package/dist/renderer.cjs +6 -2
- package/dist/renderer.d.mts +20 -2
- package/dist/renderer.d.ts +20 -2
- package/dist/renderer.mjs +5 -1
- package/dist/request.cjs +2 -2
- package/dist/{request.d-B1RnTLri.d.ts → request.d-B928QjWy.d.ts} +1 -1
- package/dist/{request.d-DarDOCk9.d.mts → request.d-KG-4d2eG.d.mts} +1 -1
- package/dist/request.d.mts +7 -7
- package/dist/request.d.ts +7 -7
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-DoEe_w9t.d.ts} +1 -1
- package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-NIHQeb4m.d.mts} +1 -1
- package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
- package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
- package/dist/{router.d-Cuv1jntg.d.mts → router.d-B8PkJSGp.d.mts} +1 -1
- package/dist/{router.d-CMANF6da.d.ts → router.d-DYnRHQwz.d.ts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-DgZ_jgGG.d.mts} +1 -1
- package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-uUBZyWoK.d.ts} +1 -1
- package/dist/routes.d.mts +6 -6
- package/dist/routes.d.ts +6 -6
- package/dist/routes.mjs +2 -2
- package/dist/{rsc-pipeline-T3PWURLJ.mjs → rsc-pipeline-4OJ5ZQNZ.mjs} +26 -25
- package/dist/{rsc-pipeline-V4ANLRAA.cjs → rsc-pipeline-7K5H2RPH.cjs} +27 -26
- package/dist/{runtime-LRIQ3XH7.mjs → runtime-U7O3HZOZ.mjs} +62 -36
- package/dist/{runtime-5AROV2C3.cjs → runtime-X52Q7JFR.cjs} +72 -46
- package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-BxQIzwfy.d.mts} +11 -3
- package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-DP7mEkEF.d.ts} +11 -3
- package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
- package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
- package/dist/schema.cjs +6 -2
- package/dist/schema.d-Dny9pnrm.d.mts +298 -0
- package/dist/schema.d-Dny9pnrm.d.ts +298 -0
- package/dist/schema.d.mts +1 -115
- package/dist/schema.d.ts +1 -115
- package/dist/schema.mjs +5 -1
- package/dist/server-fn-client.d.mts +2 -2
- package/dist/server-fn-client.d.ts +2 -2
- package/dist/server-fn.cjs +5 -5
- package/dist/server-fn.mjs +4 -4
- package/dist/server-plugins.cjs +7 -7
- package/dist/server-plugins.d.mts +16 -10
- package/dist/server-plugins.d.ts +16 -10
- package/dist/server-plugins.mjs +8 -8
- package/dist/server-query.cjs +6 -6
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +160 -120
- package/dist/server.d.mts +20 -14
- package/dist/server.d.ts +20 -14
- package/dist/server.mjs +138 -98
- package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-BgHPVMhz.d.mts} +15 -5
- package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-DsFDHTsv.d.ts} +15 -5
- package/dist/testing.cjs +17 -17
- package/dist/testing.d.mts +6 -6
- package/dist/testing.d.ts +6 -6
- package/dist/testing.mjs +13 -13
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-BKyKDBR1.d.mts} +1 -1
- package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-zxAVcf_V.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +63 -61
- package/dist/vite.d.mts +32 -12
- package/dist/vite.d.ts +32 -12
- package/dist/vite.mjs +62 -60
- package/dist/workflows.cjs +4 -4
- package/dist/workflows.mjs +3 -3
- package/package.json +31 -1
- package/dist/analyzer-GHWK46LX.cjs +0 -16
- package/dist/chunk-5YPBFMBN.cjs +0 -19
- package/dist/chunk-OM7WILES.mjs +0 -100
- package/dist/chunk-Q5B4LNON.mjs +0 -19
- package/dist/chunk-QPJ4MZTO.mjs +0 -60
- package/dist/chunk-R53QDV6T.cjs +0 -100
- package/dist/chunk-UYTAP4FQ.cjs +0 -60
- package/dist/manager-2LUKNX2N.cjs +0 -14
- /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
- /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
- /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
- /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
- /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
- /package/dist/{chunk-46P5KNTE.mjs → chunk-VZBAW44S.mjs} +0 -0
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveFarmAppClientEntry,
|
|
3
|
+
resolveFarmClientPlugins
|
|
4
|
+
} from "./chunk-DXZ57EPE.mjs";
|
|
5
|
+
import {
|
|
6
|
+
collectSSGPages,
|
|
7
|
+
matchSSGPage,
|
|
8
|
+
resolveRouteRenderingConfigFromFile
|
|
9
|
+
} from "./chunk-6YBYX4K4.mjs";
|
|
1
10
|
import {
|
|
2
11
|
createFarmMetadataImageResponse
|
|
3
12
|
} from "./chunk-CROAFCMW.mjs";
|
|
4
13
|
import {
|
|
5
14
|
resolveFarmPlatform
|
|
6
15
|
} from "./chunk-SMUW7UST.mjs";
|
|
7
|
-
import {
|
|
8
|
-
collectSSGPages,
|
|
9
|
-
matchSSGPage,
|
|
10
|
-
resolveRouteRenderingConfigFromFile
|
|
11
|
-
} from "./chunk-BM2LH2JM.mjs";
|
|
12
16
|
import {
|
|
13
17
|
classifyFarmDocumentPrefix,
|
|
14
18
|
composeFarmFullDocument,
|
|
@@ -35,13 +39,10 @@ import {
|
|
|
35
39
|
renderFarmLocaleAlternateLinks,
|
|
36
40
|
resolveDefaultErrorStatus,
|
|
37
41
|
routeBoundaryCoversDirectory
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import {
|
|
40
|
-
handleFarmFormActionRequest
|
|
41
|
-
} from "./chunk-MK5E44WP.mjs";
|
|
42
|
+
} from "./chunk-ZPKJPM7K.mjs";
|
|
42
43
|
import {
|
|
43
44
|
listFarmMCPLlmsTxtLinks
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-HRPTMX5C.mjs";
|
|
45
46
|
import {
|
|
46
47
|
FARM_DEFAULT_MCP_PATH,
|
|
47
48
|
collectFarmDefaultMCPPages,
|
|
@@ -49,7 +50,10 @@ import {
|
|
|
49
50
|
farmConfigMountsMCP,
|
|
50
51
|
isFarmDefaultMCPPathname,
|
|
51
52
|
resolveFarmDefaultMCPServer
|
|
52
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-K6SXMVXO.mjs";
|
|
54
|
+
import {
|
|
55
|
+
handleFarmFormActionRequest
|
|
56
|
+
} from "./chunk-MK5E44WP.mjs";
|
|
53
57
|
import {
|
|
54
58
|
installFarmIslandValues,
|
|
55
59
|
uninstallFarmIslandValues
|
|
@@ -68,11 +72,16 @@ import {
|
|
|
68
72
|
resolveFarmIsolatedClientHydrationMode,
|
|
69
73
|
resolveImportedModule,
|
|
70
74
|
resolveProgrammaticClientRoutes,
|
|
75
|
+
runWithPackageClientBoundaryCacheFile,
|
|
71
76
|
usesFarmServerTree
|
|
72
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-GTV2ABO7.mjs";
|
|
73
78
|
import {
|
|
74
79
|
FARM_ISLAND_REPLAYABLE_SELECTOR
|
|
75
80
|
} from "./chunk-S32PDOLO.mjs";
|
|
81
|
+
import {
|
|
82
|
+
_setDefaultFarmThemeConfig,
|
|
83
|
+
getTheme
|
|
84
|
+
} from "./chunk-GJ7QVFAG.mjs";
|
|
76
85
|
import {
|
|
77
86
|
isSecretDocsConfigKey
|
|
78
87
|
} from "./chunk-EJCVG25Z.mjs";
|
|
@@ -82,7 +91,7 @@ import {
|
|
|
82
91
|
} from "./chunk-TPA2PV5J.mjs";
|
|
83
92
|
import {
|
|
84
93
|
normalizeRouteRules
|
|
85
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-724MGMIL.mjs";
|
|
86
95
|
import {
|
|
87
96
|
resolveFarmDevtoolsConfig
|
|
88
97
|
} from "./chunk-CU5SYTJG.mjs";
|
|
@@ -92,7 +101,17 @@ import {
|
|
|
92
101
|
resolveFarmAgentCrawlers,
|
|
93
102
|
resolveFarmAgentSitemap,
|
|
94
103
|
resolveFarmPerformanceConfig
|
|
95
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-OGVTUGMU.mjs";
|
|
105
|
+
import {
|
|
106
|
+
collectFarmLlmsTxtPages,
|
|
107
|
+
createFarmDefaultLlmsTxt,
|
|
108
|
+
createFarmLlmsMarkdownReader,
|
|
109
|
+
isFarmPageNoIndex,
|
|
110
|
+
readFarmLlmsMarkdownFrom,
|
|
111
|
+
renderFarmLlmsFullTxt,
|
|
112
|
+
resolveFarmAgentOrigin,
|
|
113
|
+
resolveFarmLlmsTxtConfig
|
|
114
|
+
} from "./chunk-YGJ5P3TJ.mjs";
|
|
96
115
|
import {
|
|
97
116
|
createFarmCspNonce,
|
|
98
117
|
createFarmCspNonceRewriter,
|
|
@@ -101,16 +120,9 @@ import {
|
|
|
101
120
|
resolveFarmSecurityConfig,
|
|
102
121
|
stampFarmCspNonce
|
|
103
122
|
} from "./chunk-22W4FNTG.mjs";
|
|
104
|
-
import {
|
|
105
|
-
collectFarmLlmsTxtPages,
|
|
106
|
-
createFarmDefaultLlmsTxt,
|
|
107
|
-
createFarmLlmsMarkdownReader,
|
|
108
|
-
renderFarmLlmsFullTxt,
|
|
109
|
-
resolveFarmLlmsTxtConfig
|
|
110
|
-
} from "./chunk-KL7SHLQB.mjs";
|
|
111
123
|
import {
|
|
112
124
|
resolveFarmServerComponentsMode
|
|
113
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-4QENVMG7.mjs";
|
|
114
126
|
import {
|
|
115
127
|
getFarmAppDirectories,
|
|
116
128
|
getFarmSourceRoots
|
|
@@ -120,23 +132,30 @@ import {
|
|
|
120
132
|
getFarmRendererCapabilities,
|
|
121
133
|
getFarmRendererComponentExtensions,
|
|
122
134
|
getFarmRendererStreamingCapabilitiesForRuntime,
|
|
135
|
+
isFarmRendererDisabled,
|
|
123
136
|
isReactRenderer,
|
|
124
137
|
readFarmRendererWebStream,
|
|
125
138
|
resolveFarmComponentExtensions,
|
|
126
139
|
resolveFarmRenderer,
|
|
127
140
|
resolveFarmRendererAppSetup,
|
|
128
141
|
resolveFarmRendererModule
|
|
129
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-GCRT6GJG.mjs";
|
|
130
143
|
import {
|
|
131
144
|
resolveFarmImageConfig
|
|
132
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-AOIUYHPH.mjs";
|
|
146
|
+
import {
|
|
147
|
+
resolveCronConfig
|
|
148
|
+
} from "./chunk-ME7RVELR.mjs";
|
|
149
|
+
import {
|
|
150
|
+
resolveServerActionsConfig
|
|
151
|
+
} from "./chunk-E46NXBNJ.mjs";
|
|
133
152
|
import {
|
|
134
153
|
createFarmMarkdownRouteModuleFromFile,
|
|
135
154
|
loadFarmMdxComponents
|
|
136
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-XUES6OET.mjs";
|
|
137
156
|
import {
|
|
138
157
|
isFarmMarkdownPageFile
|
|
139
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-3T5TLFCQ.mjs";
|
|
140
159
|
import {
|
|
141
160
|
resolveFarmMdxComponentsModulePath,
|
|
142
161
|
resolveMdxConfig
|
|
@@ -149,23 +168,18 @@ import {
|
|
|
149
168
|
farmRequestWantsMarkdown,
|
|
150
169
|
getFarmMarkdownAlternatePath,
|
|
151
170
|
resolveMarkdownConfig
|
|
152
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-IFR74W6S.mjs";
|
|
153
172
|
import {
|
|
154
173
|
resolveWorkflowsConfig
|
|
155
|
-
} from "./chunk-
|
|
156
|
-
import {
|
|
157
|
-
resolveCronConfig
|
|
158
|
-
} from "./chunk-DQF3QLOH.mjs";
|
|
159
|
-
import {
|
|
160
|
-
resolveServerActionsConfig
|
|
161
|
-
} from "./chunk-E46NXBNJ.mjs";
|
|
162
|
-
import {
|
|
163
|
-
_setDefaultFarmThemeConfig,
|
|
164
|
-
getTheme
|
|
165
|
-
} from "./chunk-EMDGXYUD.mjs";
|
|
174
|
+
} from "./chunk-5TA63JD3.mjs";
|
|
166
175
|
import {
|
|
167
176
|
resolveFarmThemeConfig
|
|
168
177
|
} from "./chunk-YWPNIYUP.mjs";
|
|
178
|
+
import {
|
|
179
|
+
getIntegrationProviders,
|
|
180
|
+
getRegisteredIntegrationAPIManifest,
|
|
181
|
+
isFarmIntegrationProviderComponentReference
|
|
182
|
+
} from "./chunk-AJNBTOVQ.mjs";
|
|
169
183
|
import {
|
|
170
184
|
initStorage
|
|
171
185
|
} from "./chunk-TJVUTGED.mjs";
|
|
@@ -173,11 +187,6 @@ import {
|
|
|
173
187
|
resolveFarmRouteContext,
|
|
174
188
|
withFarmRouteContext
|
|
175
189
|
} from "./chunk-BMQAPZXD.mjs";
|
|
176
|
-
import {
|
|
177
|
-
getIntegrationProviders,
|
|
178
|
-
getRegisteredIntegrationAPIManifest,
|
|
179
|
-
isFarmIntegrationProviderComponentReference
|
|
180
|
-
} from "./chunk-TGULJSHD.mjs";
|
|
181
190
|
import {
|
|
182
191
|
createRouteSlotContainerId,
|
|
183
192
|
parseRouteSlotFile
|
|
@@ -191,7 +200,7 @@ import {
|
|
|
191
200
|
import {
|
|
192
201
|
findProgrammaticRouteFiles,
|
|
193
202
|
loadProgrammaticRouteManifests
|
|
194
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-TXE4SAMV.mjs";
|
|
195
204
|
import {
|
|
196
205
|
_runWithFarmI18nRequest,
|
|
197
206
|
_setDefaultFarmI18nRuntime,
|
|
@@ -215,12 +224,15 @@ import {
|
|
|
215
224
|
normalizeFarmRouteRuntimeConfig,
|
|
216
225
|
resolveFarmRouteRuleRuntimeConfig,
|
|
217
226
|
resolveFarmRouteRuntimeConfig
|
|
218
|
-
} from "./chunk-
|
|
227
|
+
} from "./chunk-PKMUQ7LM.mjs";
|
|
219
228
|
import {
|
|
220
229
|
configureFarmCache,
|
|
221
230
|
getFarmDataCache,
|
|
222
231
|
normalizeRevalidatePath
|
|
223
232
|
} from "./chunk-RLEALQEN.mjs";
|
|
233
|
+
import {
|
|
234
|
+
sendWebResponse
|
|
235
|
+
} from "./chunk-CO6UYM2D.mjs";
|
|
224
236
|
import {
|
|
225
237
|
toFileModuleUrl
|
|
226
238
|
} from "./chunk-VHIXGZYH.mjs";
|
|
@@ -244,17 +256,6 @@ import {
|
|
|
244
256
|
toRootRelativeUrlPath,
|
|
245
257
|
toViteModuleId
|
|
246
258
|
} from "./chunk-JSDV2NUN.mjs";
|
|
247
|
-
import {
|
|
248
|
-
createFarmSearchParams,
|
|
249
|
-
searchParamsToObject
|
|
250
|
-
} from "./chunk-H3ASZDT7.mjs";
|
|
251
|
-
import {
|
|
252
|
-
configureFarmObservability,
|
|
253
|
-
emitFarmEvent
|
|
254
|
-
} from "./chunk-2DA7CLY7.mjs";
|
|
255
|
-
import {
|
|
256
|
-
sendWebResponse
|
|
257
|
-
} from "./chunk-CO6UYM2D.mjs";
|
|
258
259
|
import {
|
|
259
260
|
resolveFarmAPIServerBasePath
|
|
260
261
|
} from "./chunk-2I6PUKWJ.mjs";
|
|
@@ -265,13 +266,21 @@ import {
|
|
|
265
266
|
import {
|
|
266
267
|
getRequestContextSnapshot
|
|
267
268
|
} from "./chunk-D2LCAV6L.mjs";
|
|
269
|
+
import {
|
|
270
|
+
createFarmSearchParams,
|
|
271
|
+
searchParamsToObject
|
|
272
|
+
} from "./chunk-H3ASZDT7.mjs";
|
|
273
|
+
import {
|
|
274
|
+
configureFarmObservability,
|
|
275
|
+
emitFarmEvent
|
|
276
|
+
} from "./chunk-2DA7CLY7.mjs";
|
|
268
277
|
import {
|
|
269
278
|
FARM_VERSION
|
|
270
|
-
} from "./chunk-
|
|
279
|
+
} from "./chunk-H37MDCPR.mjs";
|
|
271
280
|
import {
|
|
272
281
|
resolveFarmTrailingSlashRedirect,
|
|
273
282
|
setFarmTrailingSlashPreference
|
|
274
|
-
} from "./chunk-
|
|
283
|
+
} from "./chunk-KWFNUODD.mjs";
|
|
275
284
|
import {
|
|
276
285
|
normalizeFarmAPIConfig
|
|
277
286
|
} from "./chunk-W6QLRQ3V.mjs";
|
|
@@ -279,6 +288,9 @@ import {
|
|
|
279
288
|
createFarmLocaleCookie,
|
|
280
289
|
getFarmLocaleVaryHeaders
|
|
281
290
|
} from "./chunk-K76CBYQM.mjs";
|
|
291
|
+
import {
|
|
292
|
+
getFarmPageDataRedirect
|
|
293
|
+
} from "./chunk-SD6JGJOM.mjs";
|
|
282
294
|
import {
|
|
283
295
|
addMetadataImageReference,
|
|
284
296
|
addMetadataMarkdownAlternate,
|
|
@@ -291,11 +303,11 @@ import {
|
|
|
291
303
|
import {
|
|
292
304
|
FARM_DEPLOYMENT_ID_HEADER,
|
|
293
305
|
createFarmDeploymentCookie
|
|
294
|
-
} from "./chunk-
|
|
306
|
+
} from "./chunk-F7JKVHU2.mjs";
|
|
295
307
|
import {
|
|
296
308
|
prepareDeferredData,
|
|
297
309
|
snapshotDeferredData
|
|
298
|
-
} from "./chunk-
|
|
310
|
+
} from "./chunk-7BIW7VCW.mjs";
|
|
299
311
|
import {
|
|
300
312
|
createFarmCacheKey
|
|
301
313
|
} from "./chunk-GLOICKDO.mjs";
|
|
@@ -303,10 +315,8 @@ import {
|
|
|
303
315
|
appendFarmRedirectQuery
|
|
304
316
|
} from "./chunk-XQ4DPO4G.mjs";
|
|
305
317
|
import {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
isFarmRedirectError
|
|
309
|
-
} from "./chunk-JNYFXL7X.mjs";
|
|
318
|
+
encodeConfigRouteSegment
|
|
319
|
+
} from "./chunk-JZGL2PIH.mjs";
|
|
310
320
|
import {
|
|
311
321
|
_getRequestReadCount,
|
|
312
322
|
_runWithCurrentRequest,
|
|
@@ -314,11 +324,16 @@ import {
|
|
|
314
324
|
createWebRequestFromFarmRequest,
|
|
315
325
|
getCurrentRequestOrNull,
|
|
316
326
|
resolveFarmRequestURL
|
|
317
|
-
} from "./chunk-
|
|
327
|
+
} from "./chunk-5OFNUETM.mjs";
|
|
318
328
|
import {
|
|
319
329
|
_peekCurrentRequest,
|
|
320
330
|
_resolveCurrentCspNonce
|
|
321
331
|
} from "./chunk-VIXTAVEA.mjs";
|
|
332
|
+
import {
|
|
333
|
+
getFarmRedirectError,
|
|
334
|
+
isFarmNotFoundError,
|
|
335
|
+
isFarmRedirectError
|
|
336
|
+
} from "./chunk-JNYFXL7X.mjs";
|
|
322
337
|
import {
|
|
323
338
|
localizeFarmHref,
|
|
324
339
|
localizeFarmPathname,
|
|
@@ -516,9 +531,14 @@ var RouteManager = class {
|
|
|
516
531
|
const routePathname = this.toRoutePathname(pathname);
|
|
517
532
|
const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
|
|
518
533
|
const pathParts = splitRoutePath(normalizedPath);
|
|
534
|
+
const trimmedPathname = routePathname.replace(/\/+$/, "");
|
|
535
|
+
const hasEmptySegment = trimmedPathname.includes("//") || trimmedPathname === "" && routePathname.length > 1;
|
|
519
536
|
let matchedRoute = null;
|
|
520
537
|
let params = {};
|
|
521
538
|
for (const routeEntry of this.routes.values()) {
|
|
539
|
+
if (hasEmptySegment && !routeEntry.route.segments.some((segment) => segment.isDynamic)) {
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
522
542
|
const match = matchRouteParts(pathParts, routeEntry.route.segments);
|
|
523
543
|
if (match.matches) {
|
|
524
544
|
matchedRoute = routeEntry;
|
|
@@ -550,6 +570,11 @@ var RouteManager = class {
|
|
|
550
570
|
getRouteSlots() {
|
|
551
571
|
return new Map(this.routeSlots);
|
|
552
572
|
}
|
|
573
|
+
/** The layouts that wrap a registered page, root first. */
|
|
574
|
+
getRouteLayouts(pattern) {
|
|
575
|
+
const routeEntry = this.routes.get(pattern);
|
|
576
|
+
return routeEntry ? this.findMatchingLayouts(splitRoutePath(pattern), routeEntry) : [];
|
|
577
|
+
}
|
|
553
578
|
/** Resolve route rules, inherited layouts, and the page export in precedence order. */
|
|
554
579
|
async resolveRouteRuntimeConfig(pattern) {
|
|
555
580
|
const routeEntry = this.routes.get(pattern);
|
|
@@ -602,17 +627,22 @@ var RouteManager = class {
|
|
|
602
627
|
matchRedirect(pathname, search = "") {
|
|
603
628
|
const i18n = this.getI18nConfig();
|
|
604
629
|
const localeMatch = i18n ? resolveFarmLocalePath(pathname, i18n) : void 0;
|
|
605
|
-
const routePathname = localeMatch?.pathname || pathname;
|
|
630
|
+
const routePathname = localeMatch?.pathname || this.toRoutePathname(pathname);
|
|
606
631
|
const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
|
|
632
|
+
const urlParts = splitRoutePath(normalizedPath);
|
|
607
633
|
for (const redirectEntry of this.redirects.values()) {
|
|
608
|
-
const match =
|
|
634
|
+
const match = matchRouteParts(urlParts, redirectEntry.route.segments);
|
|
609
635
|
if (!match.matches) continue;
|
|
610
636
|
const statusCode = redirectEntry.definition.statusCode || (redirectEntry.definition.permanent ? 308 : 307);
|
|
611
637
|
return {
|
|
612
638
|
redirect: redirectEntry.definition,
|
|
613
639
|
destination: appendFarmRedirectQuery(
|
|
614
640
|
this.localizeRedirectDestination(
|
|
615
|
-
interpolateRedirectDestination(
|
|
641
|
+
interpolateRedirectDestination(
|
|
642
|
+
redirectEntry.definition.destination,
|
|
643
|
+
match.params,
|
|
644
|
+
getCatchAllParamSegments(redirectEntry.route.segments, urlParts)
|
|
645
|
+
),
|
|
616
646
|
localeMatch?.locale
|
|
617
647
|
),
|
|
618
648
|
search
|
|
@@ -724,6 +754,20 @@ var RouteManager = class {
|
|
|
724
754
|
if (this.clientManifestCache?.projectRoot === normalizedProjectRoot) {
|
|
725
755
|
return this.clientManifestCache.manifest;
|
|
726
756
|
}
|
|
757
|
+
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
758
|
+
return cacheFile ? runWithPackageClientBoundaryCacheFile(
|
|
759
|
+
cacheFile,
|
|
760
|
+
() => this.computeClientManifest(normalizedProjectRoot)
|
|
761
|
+
) : this.computeClientManifest(normalizedProjectRoot);
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* @internal Keep package client-boundary inspections in `file` between plans, as the dev server
|
|
765
|
+
* does. Without it, each plan outside a production build reads every package's sources again.
|
|
766
|
+
*/
|
|
767
|
+
usePackageClientBoundaryCacheFile(file) {
|
|
768
|
+
this.packageClientBoundaryCacheFile = file;
|
|
769
|
+
}
|
|
770
|
+
computeClientManifest(normalizedProjectRoot) {
|
|
727
771
|
const toUrlPath = (absolutePath) => {
|
|
728
772
|
const rootRelative = toRootRelativeUrlPath(absolutePath, normalizedProjectRoot);
|
|
729
773
|
if (rootRelative !== void 0) return rootRelative;
|
|
@@ -898,13 +942,22 @@ var RouteManager = class {
|
|
|
898
942
|
containerId: entry.containerId,
|
|
899
943
|
interception: entry.interception,
|
|
900
944
|
fallback: entry.fallback,
|
|
901
|
-
|
|
945
|
+
// In islands mode a server slot stays on the server; its client components are islands.
|
|
946
|
+
shouldHydrate: metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent),
|
|
902
947
|
isClientComponent: metadata.isClientComponent,
|
|
903
948
|
segments: entry.route.segments
|
|
904
949
|
};
|
|
905
950
|
});
|
|
951
|
+
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
952
|
+
metadata: getClientModuleHydrationPlan(
|
|
953
|
+
entry.modulePath,
|
|
954
|
+
normalizedProjectRoot,
|
|
955
|
+
isolatedMode,
|
|
956
|
+
{ ...planOptions, serverOwners: true }
|
|
957
|
+
)
|
|
958
|
+
})) : [];
|
|
906
959
|
const isolatedClientBoundaryModules = /* @__PURE__ */ new Set();
|
|
907
|
-
for (const { metadata } of [...layoutEntries, ...routeEntries]) {
|
|
960
|
+
for (const { metadata } of [...layoutEntries, ...routeEntries, ...slotPlans]) {
|
|
908
961
|
if (!metadata.hasIsolatedClientBoundaries && !metadata.serverTreeLayout) continue;
|
|
909
962
|
for (const boundary of metadata.isolatedBoundaries) {
|
|
910
963
|
isolatedClientBoundaryModules.add(path2.resolve(boundary.modulePath));
|
|
@@ -1486,16 +1539,17 @@ var RouteManager = class {
|
|
|
1486
1539
|
)
|
|
1487
1540
|
};
|
|
1488
1541
|
}
|
|
1542
|
+
/** A request pathname as routes see it: without the basePath and, with i18n, the locale. */
|
|
1489
1543
|
toRoutePathname(pathname) {
|
|
1490
1544
|
const i18n = this.getI18nConfig();
|
|
1491
1545
|
return i18n ? stripFarmLocaleFromPathname(pathname, i18n) : stripFarmBasePath(pathname, this.config.basePath);
|
|
1492
1546
|
}
|
|
1493
1547
|
localizeRedirectDestination(destination, locale) {
|
|
1494
|
-
if (!
|
|
1548
|
+
if (!destination.startsWith("/") || destination.startsWith("//")) {
|
|
1495
1549
|
return destination;
|
|
1496
1550
|
}
|
|
1497
1551
|
const i18n = this.getI18nConfig();
|
|
1498
|
-
return i18n ? localizeFarmHref(destination, locale, i18n) : destination;
|
|
1552
|
+
return locale && i18n ? localizeFarmHref(destination, locale, i18n) : this.config.basePath ? applyFarmBasePath(destination, this.config.basePath) : destination;
|
|
1499
1553
|
}
|
|
1500
1554
|
getI18nConfig() {
|
|
1501
1555
|
const i18n = this.config.i18n;
|
|
@@ -1542,9 +1596,11 @@ function getPageDirectoryField(route, pattern) {
|
|
|
1542
1596
|
const directory = createRouteDirectoryPattern(route);
|
|
1543
1597
|
return directory === pattern ? {} : { directory };
|
|
1544
1598
|
}
|
|
1545
|
-
function interpolateRedirectDestination(destination, params) {
|
|
1599
|
+
function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
|
|
1546
1600
|
let result = destination;
|
|
1547
|
-
for (const [key,
|
|
1601
|
+
for (const [key, rawValue] of Object.entries(params)) {
|
|
1602
|
+
const segments = catchAllSegments[key];
|
|
1603
|
+
const value = segments ? segments.map(encodeConfigRouteSegment).join("/") : encodeConfigRouteSegment(rawValue);
|
|
1548
1604
|
result = replaceAll(result, `[[...${key}]]`, value);
|
|
1549
1605
|
result = replaceAll(result, `[...${key}]`, value);
|
|
1550
1606
|
result = replaceAll(result, `[${key}]`, value);
|
|
@@ -1553,6 +1609,10 @@ function interpolateRedirectDestination(destination, params) {
|
|
|
1553
1609
|
}
|
|
1554
1610
|
return result;
|
|
1555
1611
|
}
|
|
1612
|
+
function getCatchAllParamSegments(segments, urlParts) {
|
|
1613
|
+
const index = segments.findIndex((segment) => segment.isCatchAll);
|
|
1614
|
+
return index === -1 ? {} : { [segments[index].segment]: urlParts.slice(index) };
|
|
1615
|
+
}
|
|
1556
1616
|
function getMetadataImageSuffix(pathname) {
|
|
1557
1617
|
if (pathname === "/opengraph-image" || pathname.endsWith("/opengraph-image")) {
|
|
1558
1618
|
return { kind: "opengraph", fileName: "opengraph-image" };
|
|
@@ -1702,7 +1762,8 @@ function farmFontImportsPlugin(options = {}) {
|
|
|
1702
1762
|
);
|
|
1703
1763
|
registry.production = false;
|
|
1704
1764
|
server.middlewares.use(async (req, res, next) => {
|
|
1705
|
-
const
|
|
1765
|
+
const target = req.url || "/";
|
|
1766
|
+
const pathname = (target.startsWith("/") ? new URL(`http://farm.local${target}`) : new URL(target, "http://farm.local")).pathname;
|
|
1706
1767
|
if (pathname === "/@farm/fonts.css") {
|
|
1707
1768
|
res.statusCode = 200;
|
|
1708
1769
|
res.setHeader("Content-Type", "text/css; charset=utf-8");
|
|
@@ -2852,294 +2913,28 @@ function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
|
|
|
2852
2913
|
return inference.strategy ?? "load";
|
|
2853
2914
|
}
|
|
2854
2915
|
|
|
2855
|
-
// src/client-plugin-build.ts
|
|
2856
|
-
import fs3 from "fs";
|
|
2857
|
-
import path7 from "path";
|
|
2858
|
-
var CLIENT_KEYS = [
|
|
2859
|
-
"public",
|
|
2860
|
-
"setup",
|
|
2861
|
-
"hydration",
|
|
2862
|
-
"navigation",
|
|
2863
|
-
"error",
|
|
2864
|
-
"performance",
|
|
2865
|
-
"close"
|
|
2866
|
-
];
|
|
2867
|
-
var HYDRATION_KEYS = ["before", "after"];
|
|
2868
|
-
var NAVIGATION_KEYS = ["before", "loaded", "resolved", "rendered", "error"];
|
|
2869
|
-
var MOBILE_SHELL_CLIENT_IMPORT = 'import { farmMobileShellClient as __farmMobileShellClient } from "@farm.js/core/internal/client-runtime";';
|
|
2870
|
-
var MOBILE_SHELL_CLIENT_REGISTRATION = ` {
|
|
2871
|
-
name: "farm:mobile-shell",
|
|
2872
|
-
enforce: "pre",
|
|
2873
|
-
definition: __farmMobileShellClient,
|
|
2874
|
-
}`;
|
|
2875
|
-
var APP_CLIENT_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
2876
|
-
function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
|
|
2877
|
-
const sourceRoot = path7.resolve(root, srcDir);
|
|
2878
|
-
for (const extension of APP_CLIENT_EXTENSIONS) {
|
|
2879
|
-
const candidate = path7.join(sourceRoot, `client.${extension}`);
|
|
2880
|
-
if (fs3.existsSync(candidate) && fs3.statSync(candidate).isFile()) return candidate;
|
|
2881
|
-
}
|
|
2882
|
-
return void 0;
|
|
2883
|
-
}
|
|
2884
|
-
function resolveFarmClientPlugins(plugins, _root) {
|
|
2885
|
-
if (!plugins?.length) return [];
|
|
2886
|
-
return plugins.flatMap((plugin) => {
|
|
2887
|
-
if (!plugin.client) return [];
|
|
2888
|
-
assertClientLifecycle(plugin.client, plugin.name);
|
|
2889
|
-
assertPublicData(plugin.client.public, plugin.name);
|
|
2890
|
-
return [
|
|
2891
|
-
{
|
|
2892
|
-
name: plugin.name,
|
|
2893
|
-
version: plugin.version,
|
|
2894
|
-
enforce: plugin.enforce,
|
|
2895
|
-
definition: plugin.client,
|
|
2896
|
-
publicData: plugin.client.public
|
|
2897
|
-
}
|
|
2898
|
-
];
|
|
2899
|
-
});
|
|
2900
|
-
}
|
|
2901
|
-
function generateFarmClientPluginEntryCode(plugins, root, srcDir = "src", appPublicData, platform = resolveFarmPlatform()) {
|
|
2902
|
-
const resolved = resolveFarmClientPlugins(plugins, root);
|
|
2903
|
-
const appClientEntry = root ? resolveFarmAppClientEntry(root, srcDir) : void 0;
|
|
2904
|
-
const appImport = appClientEntry ? `import farmAppClientDefinition from ${JSON.stringify(appClientEntry.replace(/\\/g, "/"))};` : "";
|
|
2905
|
-
const mobileShell = platform === "mobile";
|
|
2906
|
-
const imports = mobileShell ? [MOBILE_SHELL_CLIENT_IMPORT, appImport].filter(Boolean).join("\n") : appImport;
|
|
2907
|
-
const serializedPlugins = mobileShell ? [MOBILE_SHELL_CLIENT_REGISTRATION] : [];
|
|
2908
|
-
serializedPlugins.push(
|
|
2909
|
-
...resolved.map(
|
|
2910
|
-
(plugin) => ` {
|
|
2911
|
-
name: ${JSON.stringify(plugin.name)},
|
|
2912
|
-
version: ${serializeOptionalString(plugin.version)},
|
|
2913
|
-
enforce: ${serializeOptionalString(plugin.enforce)},
|
|
2914
|
-
definition: ${serializeClientLifecycle(plugin.definition, plugin.name)},
|
|
2915
|
-
public: ${serializePublicData(plugin.publicData)},
|
|
2916
|
-
}`
|
|
2917
|
-
)
|
|
2918
|
-
);
|
|
2919
|
-
if (appClientEntry) {
|
|
2920
|
-
assertPublicData(appPublicData, "farm:app-client");
|
|
2921
|
-
serializedPlugins.push(` {
|
|
2922
|
-
name: "farm:app-client",
|
|
2923
|
-
enforce: "post",
|
|
2924
|
-
definition: farmAppClientDefinition,
|
|
2925
|
-
public: ${serializePublicData(appPublicData)},
|
|
2926
|
-
}`);
|
|
2927
|
-
}
|
|
2928
|
-
const registrations = `[
|
|
2929
|
-
${serializedPlugins.join(",\n")}
|
|
2930
|
-
]`;
|
|
2931
|
-
return { imports, registrations, plugins: resolved };
|
|
2932
|
-
}
|
|
2933
|
-
function assertClientLifecycle(client, pluginName) {
|
|
2934
|
-
assertLifecycleObject(client, pluginName, "client", CLIENT_KEYS);
|
|
2935
|
-
assertHook(client.setup, pluginName, "client.setup");
|
|
2936
|
-
assertHook(client.error, pluginName, "client.error");
|
|
2937
|
-
assertHook(client.performance, pluginName, "client.performance");
|
|
2938
|
-
assertHook(client.close, pluginName, "client.close");
|
|
2939
|
-
if (client.hydration !== void 0) {
|
|
2940
|
-
assertLifecycleObject(client.hydration, pluginName, "client.hydration", HYDRATION_KEYS);
|
|
2941
|
-
assertHook(client.hydration.before, pluginName, "client.hydration.before");
|
|
2942
|
-
assertHook(client.hydration.after, pluginName, "client.hydration.after");
|
|
2943
|
-
}
|
|
2944
|
-
if (client.navigation !== void 0) {
|
|
2945
|
-
assertLifecycleObject(client.navigation, pluginName, "client.navigation", NAVIGATION_KEYS);
|
|
2946
|
-
for (const key of NAVIGATION_KEYS) {
|
|
2947
|
-
assertHook(client.navigation[key], pluginName, `client.navigation.${key}`);
|
|
2948
|
-
}
|
|
2949
|
-
}
|
|
2950
|
-
}
|
|
2951
|
-
function assertLifecycleObject(value, pluginName, location, allowedKeys) {
|
|
2952
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
2953
|
-
throw new TypeError(`Client plugin "${pluginName}" ${location} must be an object`);
|
|
2954
|
-
}
|
|
2955
|
-
const prototype = Object.getPrototypeOf(value);
|
|
2956
|
-
if (prototype !== Object.prototype && prototype !== null) {
|
|
2957
|
-
throw new TypeError(`Client plugin "${pluginName}" ${location} must be a plain object`);
|
|
2958
|
-
}
|
|
2959
|
-
for (const key of Reflect.ownKeys(value)) {
|
|
2960
|
-
if (typeof key === "symbol") {
|
|
2961
|
-
throw new TypeError(`Client plugin "${pluginName}" ${location} cannot contain symbol keys`);
|
|
2962
|
-
}
|
|
2963
|
-
if (!allowedKeys.includes(key)) {
|
|
2964
|
-
throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
|
|
2965
|
-
}
|
|
2966
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
2967
|
-
if (!descriptor?.enumerable) {
|
|
2968
|
-
throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
|
|
2969
|
-
}
|
|
2970
|
-
if (!("value" in descriptor)) {
|
|
2971
|
-
throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} cannot be an accessor`);
|
|
2972
|
-
}
|
|
2973
|
-
}
|
|
2974
|
-
}
|
|
2975
|
-
function assertHook(value, pluginName, location) {
|
|
2976
|
-
if (value === void 0) return;
|
|
2977
|
-
if (typeof value !== "function") {
|
|
2978
|
-
throw new TypeError(`Client plugin "${pluginName}" ${location} must be a function`);
|
|
2979
|
-
}
|
|
2980
|
-
functionSource(value, pluginName, location);
|
|
2981
|
-
}
|
|
2982
|
-
function serializeClientLifecycle(definition, pluginName) {
|
|
2983
|
-
const fields = [];
|
|
2984
|
-
pushHook(fields, "setup", definition.setup, pluginName, "client.setup", 2);
|
|
2985
|
-
pushHookGroup(fields, "hydration", definition.hydration, HYDRATION_KEYS, pluginName, 2);
|
|
2986
|
-
pushHookGroup(fields, "navigation", definition.navigation, NAVIGATION_KEYS, pluginName, 2);
|
|
2987
|
-
pushHook(fields, "error", definition.error, pluginName, "client.error", 2);
|
|
2988
|
-
pushHook(fields, "performance", definition.performance, pluginName, "client.performance", 2);
|
|
2989
|
-
pushHook(fields, "close", definition.close, pluginName, "client.close", 2);
|
|
2990
|
-
return fields.length ? `{
|
|
2991
|
-
${fields.join(",\n")}
|
|
2992
|
-
}` : "{}";
|
|
2993
|
-
}
|
|
2994
|
-
function pushHookGroup(fields, groupName, group, keys, pluginName, indent) {
|
|
2995
|
-
if (!group) return;
|
|
2996
|
-
const hooks = [];
|
|
2997
|
-
for (const key of keys) {
|
|
2998
|
-
pushHook(hooks, key, group[key], pluginName, `client.${groupName}.${key}`, indent + 2);
|
|
2999
|
-
}
|
|
3000
|
-
fields.push(
|
|
3001
|
-
`${" ".repeat(indent)}${JSON.stringify(groupName)}: {
|
|
3002
|
-
${hooks.join(",\n")}
|
|
3003
|
-
${" ".repeat(indent)}}`
|
|
3004
|
-
);
|
|
3005
|
-
}
|
|
3006
|
-
function pushHook(fields, key, hook, pluginName, location, indent) {
|
|
3007
|
-
if (hook === void 0) return;
|
|
3008
|
-
fields.push(
|
|
3009
|
-
`${" ".repeat(indent)}${JSON.stringify(key)}: ${functionSource(hook, pluginName, location)}`
|
|
3010
|
-
);
|
|
3011
|
-
}
|
|
3012
|
-
function functionSource(value, pluginName, location) {
|
|
3013
|
-
if (typeof value !== "function") {
|
|
3014
|
-
throw new TypeError(`Client plugin "${pluginName}" ${location} must be a function`);
|
|
3015
|
-
}
|
|
3016
|
-
const source = Function.prototype.toString.call(value).trim();
|
|
3017
|
-
if (!source || source.includes("[native code]")) {
|
|
3018
|
-
throw new TypeError(
|
|
3019
|
-
`Client plugin "${pluginName}" ${location} must be authored inline and cannot be native or bound`
|
|
3020
|
-
);
|
|
3021
|
-
}
|
|
3022
|
-
if (/^(?:async\s+)?function(?:\s*\*)?(?:\s+|\()/.test(source)) {
|
|
3023
|
-
return `(${source})`;
|
|
3024
|
-
}
|
|
3025
|
-
const method = source.match(/^(async\s+)?(\*\s*)?[$A-Z_a-z][$\w]*\s*(\([\s\S]*)$/);
|
|
3026
|
-
if (method) {
|
|
3027
|
-
const asyncPrefix = method[1] ?? "";
|
|
3028
|
-
const generator = method[2] ? "*" : "";
|
|
3029
|
-
return `(${asyncPrefix}function${generator}${method[3]})`;
|
|
3030
|
-
}
|
|
3031
|
-
if (source.includes("=>")) return `(${source})`;
|
|
3032
|
-
throw new TypeError(
|
|
3033
|
-
`Client plugin "${pluginName}" ${location} must use a function, method, or arrow function`
|
|
3034
|
-
);
|
|
3035
|
-
}
|
|
3036
|
-
function assertPublicData(value, pluginName) {
|
|
3037
|
-
if (value === void 0) return;
|
|
3038
|
-
const seen = /* @__PURE__ */ new WeakSet();
|
|
3039
|
-
const visit = (current, pathSegments) => {
|
|
3040
|
-
if (current === null || typeof current === "string" || typeof current === "boolean") {
|
|
3041
|
-
return;
|
|
3042
|
-
}
|
|
3043
|
-
if (typeof current === "number") {
|
|
3044
|
-
if (Number.isFinite(current)) return;
|
|
3045
|
-
throwPublicDataError(pluginName, pathSegments, "must be a finite number");
|
|
3046
|
-
}
|
|
3047
|
-
if (typeof current !== "object") {
|
|
3048
|
-
throwPublicDataError(pluginName, pathSegments, `cannot contain ${typeof current} values`);
|
|
3049
|
-
}
|
|
3050
|
-
if (seen.has(current)) {
|
|
3051
|
-
throwPublicDataError(pluginName, pathSegments, "cannot contain circular references");
|
|
3052
|
-
}
|
|
3053
|
-
seen.add(current);
|
|
3054
|
-
if (Array.isArray(current)) {
|
|
3055
|
-
for (let index = 0; index < current.length; index += 1) {
|
|
3056
|
-
if (!Object.prototype.hasOwnProperty.call(current, index)) {
|
|
3057
|
-
throwPublicDataError(
|
|
3058
|
-
pluginName,
|
|
3059
|
-
[...pathSegments, String(index)],
|
|
3060
|
-
"cannot contain sparse array slots"
|
|
3061
|
-
);
|
|
3062
|
-
}
|
|
3063
|
-
visit(current[index], [...pathSegments, String(index)]);
|
|
3064
|
-
}
|
|
3065
|
-
for (const key of Reflect.ownKeys(current)) {
|
|
3066
|
-
if (key === "length" || typeof key === "string" && isArrayIndex(key)) continue;
|
|
3067
|
-
throwPublicDataError(
|
|
3068
|
-
pluginName,
|
|
3069
|
-
pathSegments,
|
|
3070
|
-
typeof key === "symbol" ? "cannot contain symbol keys" : `cannot contain non-index array property ${key}`
|
|
3071
|
-
);
|
|
3072
|
-
}
|
|
3073
|
-
seen.delete(current);
|
|
3074
|
-
return;
|
|
3075
|
-
}
|
|
3076
|
-
const prototype = Object.getPrototypeOf(current);
|
|
3077
|
-
if (prototype !== Object.prototype && prototype !== null) {
|
|
3078
|
-
throwPublicDataError(pluginName, pathSegments, "must contain only plain objects and arrays");
|
|
3079
|
-
}
|
|
3080
|
-
for (const key of Reflect.ownKeys(current)) {
|
|
3081
|
-
if (typeof key === "symbol") {
|
|
3082
|
-
throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
|
|
3083
|
-
}
|
|
3084
|
-
const descriptor = Object.getOwnPropertyDescriptor(current, key);
|
|
3085
|
-
if (!descriptor?.enumerable) {
|
|
3086
|
-
throwPublicDataError(
|
|
3087
|
-
pluginName,
|
|
3088
|
-
[...pathSegments, key],
|
|
3089
|
-
"cannot contain non-enumerable properties"
|
|
3090
|
-
);
|
|
3091
|
-
}
|
|
3092
|
-
if (!("value" in descriptor)) {
|
|
3093
|
-
throwPublicDataError(
|
|
3094
|
-
pluginName,
|
|
3095
|
-
[...pathSegments, key],
|
|
3096
|
-
"cannot contain accessor properties"
|
|
3097
|
-
);
|
|
3098
|
-
}
|
|
3099
|
-
visit(descriptor.value, [...pathSegments, key]);
|
|
3100
|
-
}
|
|
3101
|
-
seen.delete(current);
|
|
3102
|
-
};
|
|
3103
|
-
visit(value, []);
|
|
3104
|
-
}
|
|
3105
|
-
function throwPublicDataError(pluginName, pathSegments, message) {
|
|
3106
|
-
const location = pathSegments.length ? ` at client.public.${pathSegments.join(".")}` : "";
|
|
3107
|
-
throw new TypeError(`Client plugin "${pluginName}"${location} ${message}`);
|
|
3108
|
-
}
|
|
3109
|
-
function serializePublicData(value) {
|
|
3110
|
-
if (value === void 0) return "undefined";
|
|
3111
|
-
return `JSON.parse(${JSON.stringify(JSON.stringify(value))})`;
|
|
3112
|
-
}
|
|
3113
|
-
function serializeOptionalString(value) {
|
|
3114
|
-
return value === void 0 ? "undefined" : JSON.stringify(value);
|
|
3115
|
-
}
|
|
3116
|
-
function isArrayIndex(key) {
|
|
3117
|
-
const value = Number(key);
|
|
3118
|
-
return Number.isInteger(value) && value >= 0 && value < 4294967295 && String(value) === key;
|
|
3119
|
-
}
|
|
3120
|
-
|
|
3121
2916
|
// src/server/renderer.ts
|
|
3122
|
-
import * as
|
|
2917
|
+
import * as fs5 from "fs";
|
|
3123
2918
|
import * as https from "https";
|
|
3124
2919
|
import { isIP } from "net";
|
|
3125
|
-
import * as
|
|
2920
|
+
import * as path9 from "path";
|
|
3126
2921
|
import * as tls from "tls";
|
|
3127
2922
|
import { Readable, Writable } from "stream";
|
|
3128
2923
|
|
|
3129
2924
|
// src/not-found.ts
|
|
3130
|
-
import
|
|
3131
|
-
import
|
|
2925
|
+
import fs3 from "fs";
|
|
2926
|
+
import path7 from "path";
|
|
3132
2927
|
function resolveFarmNotFoundComponentPath(config, appDirs) {
|
|
3133
2928
|
const extensions = getFarmRendererComponentExtensions(config.renderer);
|
|
3134
2929
|
const configuredPath = config.notFound?.component?.trim();
|
|
3135
2930
|
if (configuredPath) {
|
|
3136
|
-
const componentPath =
|
|
2931
|
+
const componentPath = path7.isAbsolute(configuredPath) ? path7.normalize(configuredPath) : path7.resolve(config.root, configuredPath);
|
|
3137
2932
|
if (!extensions.some((extension) => componentPath.endsWith(extension))) {
|
|
3138
2933
|
throw new Error(
|
|
3139
2934
|
`notFound.component must use one of the configured renderer extensions: ${extensions.join(", ")}`
|
|
3140
2935
|
);
|
|
3141
2936
|
}
|
|
3142
|
-
if (!
|
|
2937
|
+
if (!fs3.existsSync(componentPath) || !fs3.statSync(componentPath).isFile()) {
|
|
3143
2938
|
throw new Error(`notFound.component was not found: ${componentPath}`);
|
|
3144
2939
|
}
|
|
3145
2940
|
return componentPath;
|
|
@@ -3147,8 +2942,8 @@ function resolveFarmNotFoundComponentPath(config, appDirs) {
|
|
|
3147
2942
|
let discoveredPath = null;
|
|
3148
2943
|
for (const appDir of appDirs) {
|
|
3149
2944
|
for (const extension of extensions) {
|
|
3150
|
-
const candidate =
|
|
3151
|
-
if (
|
|
2945
|
+
const candidate = path7.join(appDir, `not-found${extension}`);
|
|
2946
|
+
if (fs3.existsSync(candidate) && fs3.statSync(candidate).isFile()) {
|
|
3152
2947
|
discoveredPath = candidate;
|
|
3153
2948
|
break;
|
|
3154
2949
|
}
|
|
@@ -3344,8 +3139,8 @@ body {
|
|
|
3344
3139
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
3345
3140
|
|
|
3346
3141
|
// src/server/error-diagnostics.ts
|
|
3347
|
-
import * as
|
|
3348
|
-
import * as
|
|
3142
|
+
import * as fs4 from "fs";
|
|
3143
|
+
import * as path8 from "path";
|
|
3349
3144
|
import { fileURLToPath } from "url";
|
|
3350
3145
|
var SECRET_VALUE_PATTERN = /\b(api[_-]?key|access[_-]?token|auth[_-]?token|client[_-]?secret|secret[_-]?key|token|password|secret)\s*[:=]\s*([^\s,;]+)/gi;
|
|
3351
3146
|
var BEARER_PATTERN = /\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi;
|
|
@@ -3353,8 +3148,8 @@ function redactErrorText(value) {
|
|
|
3353
3148
|
return value.replace(BEARER_PATTERN, "$1[REDACTED]").replace(SECRET_VALUE_PATTERN, "$1=[REDACTED]");
|
|
3354
3149
|
}
|
|
3355
3150
|
function isPathInsideRoot(root, filePath) {
|
|
3356
|
-
const relative3 =
|
|
3357
|
-
return relative3 === "" || !relative3.startsWith("..") && !
|
|
3151
|
+
const relative3 = path8.relative(root, filePath);
|
|
3152
|
+
return relative3 === "" || !relative3.startsWith("..") && !path8.isAbsolute(relative3);
|
|
3358
3153
|
}
|
|
3359
3154
|
function normalizeStackPath(value) {
|
|
3360
3155
|
const withoutQuery = value.replace(/[?#].*$/, "");
|
|
@@ -3371,13 +3166,13 @@ function findStackLocation(stack, root) {
|
|
|
3371
3166
|
);
|
|
3372
3167
|
if (!match) continue;
|
|
3373
3168
|
const candidate = normalizeStackPath(match[1]);
|
|
3374
|
-
if (!candidate || candidate.includes(`${
|
|
3375
|
-
const absolutePath =
|
|
3376
|
-
if (!isPathInsideRoot(root, absolutePath) || !
|
|
3377
|
-
const relativePath =
|
|
3169
|
+
if (!candidate || candidate.includes(`${path8.sep}node_modules${path8.sep}`)) continue;
|
|
3170
|
+
const absolutePath = path8.resolve(candidate);
|
|
3171
|
+
if (!isPathInsideRoot(root, absolutePath) || !fs4.existsSync(absolutePath)) continue;
|
|
3172
|
+
const relativePath = path8.relative(root, absolutePath).split(path8.sep).join("/");
|
|
3378
3173
|
return {
|
|
3379
3174
|
absolutePath,
|
|
3380
|
-
displayPath: relativePath ||
|
|
3175
|
+
displayPath: relativePath || path8.basename(absolutePath),
|
|
3381
3176
|
line: Number(match[2]),
|
|
3382
3177
|
column: Number(match[3])
|
|
3383
3178
|
};
|
|
@@ -3386,7 +3181,7 @@ function findStackLocation(stack, root) {
|
|
|
3386
3181
|
}
|
|
3387
3182
|
function createSourceFrame(location) {
|
|
3388
3183
|
try {
|
|
3389
|
-
const sourceLines =
|
|
3184
|
+
const sourceLines = fs4.readFileSync(location.absolutePath, "utf8").split(/\r?\n/);
|
|
3390
3185
|
if (location.line < 1 || location.line > sourceLines.length) return void 0;
|
|
3391
3186
|
const start = Math.max(1, location.line - 2);
|
|
3392
3187
|
const end = Math.min(sourceLines.length, location.line + 2);
|
|
@@ -3409,13 +3204,13 @@ function createSourceFrame(location) {
|
|
|
3409
3204
|
}
|
|
3410
3205
|
}
|
|
3411
3206
|
function sanitizeStack(stack, root) {
|
|
3412
|
-
const normalizedRoot =
|
|
3207
|
+
const normalizedRoot = path8.resolve(root);
|
|
3413
3208
|
return redactErrorText(stack).split(normalizedRoot).join("<project>").replace(/<project>[^\s)]*/g, (segment) => segment.split("\\").join("/")).split("\n").filter((line, index) => index === 0 || !line.includes("node:internal")).slice(0, 14).join("\n");
|
|
3414
3209
|
}
|
|
3415
3210
|
function createDefaultErrorDiagnostics(error, root) {
|
|
3416
3211
|
const normalizedError = error instanceof Error ? error : new Error(typeof error === "string" ? error : "Unknown server rendering error");
|
|
3417
3212
|
const rawStack = normalizedError.stack || `${normalizedError.name}: ${normalizedError.message}`;
|
|
3418
|
-
const location = findStackLocation(rawStack,
|
|
3213
|
+
const location = findStackLocation(rawStack, path8.resolve(root));
|
|
3419
3214
|
return {
|
|
3420
3215
|
name: redactErrorText(normalizedError.name || "Error"),
|
|
3421
3216
|
message: redactErrorText(normalizedError.message || "Unknown server rendering error"),
|
|
@@ -3684,7 +3479,7 @@ function createRouteStateProps(input) {
|
|
|
3684
3479
|
function readAppPackageIdentity(root) {
|
|
3685
3480
|
try {
|
|
3686
3481
|
return JSON.parse(
|
|
3687
|
-
|
|
3482
|
+
fs5.readFileSync(path9.join(root || process.cwd(), "package.json"), "utf8")
|
|
3688
3483
|
);
|
|
3689
3484
|
} catch {
|
|
3690
3485
|
return {};
|
|
@@ -3713,7 +3508,7 @@ var ServerRenderer = class {
|
|
|
3713
3508
|
if (this.config.notFound?.component?.trim()) {
|
|
3714
3509
|
resolveFarmNotFoundComponentPath(this.config, getFarmAppDirectories(this.config));
|
|
3715
3510
|
}
|
|
3716
|
-
const loaded = isReactRenderer(this.config.renderer) ? await import("./renderer/react/server.mjs") : this.viteServer ? await loadFarmDevModule(this.viteServer, this.config.renderer.server) : await import(pathToFileURL2(
|
|
3511
|
+
const loaded = isReactRenderer(this.config.renderer) ? await import("./renderer/react/server.mjs") : isFarmRendererDisabled(this.config.renderer) ? await import("./renderer/none/server.mjs") : this.viteServer ? await loadFarmDevModule(this.viteServer, this.config.renderer.server) : await import(pathToFileURL2(
|
|
3717
3512
|
resolveFarmRendererModule(
|
|
3718
3513
|
this.config.root || process.cwd(),
|
|
3719
3514
|
this.config.renderer.server
|
|
@@ -3846,9 +3641,10 @@ var ServerRenderer = class {
|
|
|
3846
3641
|
const streaming = getFarmRendererStreamingCapabilitiesForRuntime(this.config.renderer, "node");
|
|
3847
3642
|
const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
|
|
3848
3643
|
if (renderToPipeableStream) {
|
|
3644
|
+
const inlineBoundaries = isReactRenderer(this.config.renderer);
|
|
3849
3645
|
return await new Promise((resolve3, reject) => {
|
|
3850
3646
|
const chunks = [];
|
|
3851
|
-
let
|
|
3647
|
+
let shellReady = false;
|
|
3852
3648
|
let lateNavigation;
|
|
3853
3649
|
const writable = new Writable({
|
|
3854
3650
|
write(chunk, _encoding, callback) {
|
|
@@ -3863,16 +3659,22 @@ var ServerRenderer = class {
|
|
|
3863
3659
|
writable.once("error", reject);
|
|
3864
3660
|
const stream = renderToPipeableStream(element, {
|
|
3865
3661
|
nonce: _resolveCurrentCspNonce(),
|
|
3662
|
+
...inlineBoundaries ? {
|
|
3663
|
+
progressiveChunkSize: Number.MAX_SAFE_INTEGER,
|
|
3664
|
+
onAllReady() {
|
|
3665
|
+
stream.pipe(writable);
|
|
3666
|
+
}
|
|
3667
|
+
} : {},
|
|
3866
3668
|
onShellReady() {
|
|
3867
|
-
|
|
3868
|
-
stream.pipe(writable);
|
|
3669
|
+
shellReady = true;
|
|
3670
|
+
if (!inlineBoundaries) stream.pipe(writable);
|
|
3869
3671
|
},
|
|
3870
3672
|
onShellError(error) {
|
|
3871
3673
|
reject(error);
|
|
3872
3674
|
},
|
|
3873
3675
|
onError(error) {
|
|
3874
|
-
if (!
|
|
3875
|
-
else if (
|
|
3676
|
+
if (!shellReady) reject(error);
|
|
3677
|
+
else if (lateNavigation === void 0 && (options.rejectLateErrors || options.rejectLateRedirects && isFarmRedirectError(error) || options.rejectLateNavigation && (isFarmRedirectError(error) || isFarmNotFoundError(error)))) {
|
|
3876
3678
|
lateNavigation = error;
|
|
3877
3679
|
}
|
|
3878
3680
|
}
|
|
@@ -3953,7 +3755,7 @@ var ServerRenderer = class {
|
|
|
3953
3755
|
continue;
|
|
3954
3756
|
}
|
|
3955
3757
|
let slotElement = this.rendererRuntime.createElement(slot.module.default, slot.props);
|
|
3956
|
-
slotElement = this.wrapClientGraph(slotElement);
|
|
3758
|
+
if (slot.shouldHydrate !== false) slotElement = this.wrapClientGraph(slotElement);
|
|
3957
3759
|
slotProps[slot.name] = this.rendererRuntime.createElement(
|
|
3958
3760
|
"div",
|
|
3959
3761
|
{
|
|
@@ -3974,7 +3776,9 @@ var ServerRenderer = class {
|
|
|
3974
3776
|
if (input.layoutShouldHydrate) {
|
|
3975
3777
|
element = this.wrapClientGraph(element);
|
|
3976
3778
|
}
|
|
3977
|
-
return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element)
|
|
3779
|
+
return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element), {
|
|
3780
|
+
rejectLateRedirects: true
|
|
3781
|
+
});
|
|
3978
3782
|
}
|
|
3979
3783
|
async runWithRequestContext(request2, fn) {
|
|
3980
3784
|
return _runWithCurrentRequest(
|
|
@@ -3991,10 +3795,10 @@ var ServerRenderer = class {
|
|
|
3991
3795
|
* Load SSG manifest from build output
|
|
3992
3796
|
*/
|
|
3993
3797
|
loadSSGManifest() {
|
|
3994
|
-
const manifestPath =
|
|
3798
|
+
const manifestPath = path9.join(this.config.root, this.config.outDir, "__ssg_manifest.json");
|
|
3995
3799
|
let content;
|
|
3996
3800
|
try {
|
|
3997
|
-
content =
|
|
3801
|
+
content = fs5.readFileSync(manifestPath, "utf-8");
|
|
3998
3802
|
} catch (error) {
|
|
3999
3803
|
if (error.code === "ENOENT") {
|
|
4000
3804
|
return;
|
|
@@ -4213,10 +4017,10 @@ var ServerRenderer = class {
|
|
|
4213
4017
|
return true;
|
|
4214
4018
|
}
|
|
4215
4019
|
try {
|
|
4216
|
-
const htmlPath = page.urlPath === "/" ?
|
|
4217
|
-
if (
|
|
4218
|
-
const stat =
|
|
4219
|
-
const html =
|
|
4020
|
+
const htmlPath = page.urlPath === "/" ? path9.join(this.config.root, this.config.outDir, "client", "index.html") : path9.join(this.config.root, this.config.outDir, "client", page.urlPath + ".html");
|
|
4021
|
+
if (fs5.existsSync(htmlPath)) {
|
|
4022
|
+
const stat = fs5.statSync(htmlPath);
|
|
4023
|
+
const html = fs5.readFileSync(htmlPath, "utf-8");
|
|
4220
4024
|
await this.cacheSSGPage(page, html, {
|
|
4221
4025
|
document: true,
|
|
4222
4026
|
createdAt: stat.mtimeMs
|
|
@@ -4310,18 +4114,19 @@ var ServerRenderer = class {
|
|
|
4310
4114
|
completeRender(res.statusCode || 200, pathname);
|
|
4311
4115
|
return;
|
|
4312
4116
|
}
|
|
4313
|
-
const
|
|
4117
|
+
const routePathname = this.routeManager.toRoutePathname(pathname);
|
|
4118
|
+
const generatedLlmsKind = this.getGeneratedLlmsKind(routePathname);
|
|
4314
4119
|
if (generatedLlmsKind) {
|
|
4315
4120
|
await this.renderGeneratedLlmsTxt(req, res, generatedLlmsKind);
|
|
4316
4121
|
completeRender(res.statusCode || 200, pathname);
|
|
4317
4122
|
return;
|
|
4318
4123
|
}
|
|
4319
|
-
if (
|
|
4124
|
+
if (routePathname === "/robots.txt" && this.getAgentCrawlers().enabled) {
|
|
4320
4125
|
await this.renderGeneratedRobotsTxt(req, res);
|
|
4321
4126
|
completeRender(res.statusCode || 200, pathname);
|
|
4322
4127
|
return;
|
|
4323
4128
|
}
|
|
4324
|
-
if (
|
|
4129
|
+
if (routePathname === "/sitemap.xml" && this.getAgentSitemap().enabled) {
|
|
4325
4130
|
await this.renderGeneratedSitemap(req, res);
|
|
4326
4131
|
completeRender(res.statusCode || 200, pathname);
|
|
4327
4132
|
return;
|
|
@@ -4388,9 +4193,16 @@ var ServerRenderer = class {
|
|
|
4388
4193
|
actionRequest = createWebRequestFromFarmRequest(req, {
|
|
4389
4194
|
trustProxy: this.config.server?.trustProxy
|
|
4390
4195
|
});
|
|
4391
|
-
const
|
|
4392
|
-
|
|
4393
|
-
|
|
4196
|
+
const formActionRequest = actionRequest;
|
|
4197
|
+
const actionResponse = await _runWithMiddlewareData(
|
|
4198
|
+
toMiddlewareMap(req.__FARM_MIDDLEWARE_DATA__),
|
|
4199
|
+
() => _runWithMiddlewareContext(
|
|
4200
|
+
toMiddlewareMap(req.__FARM_MIDDLEWARE_CONTEXT__),
|
|
4201
|
+
() => handleFarmFormActionRequest(
|
|
4202
|
+
formActionRequest,
|
|
4203
|
+
resolveServerActionsConfig(this.config.serverActions)
|
|
4204
|
+
)
|
|
4205
|
+
)
|
|
4394
4206
|
);
|
|
4395
4207
|
if (actionResponse) {
|
|
4396
4208
|
await sendWebResponse(res, actionResponse);
|
|
@@ -4723,7 +4535,7 @@ var ServerRenderer = class {
|
|
|
4723
4535
|
await _runWithMiddlewareContext(middlewareContext, async () => {
|
|
4724
4536
|
await _runWithCurrentRequest(currentRequest, async () => {
|
|
4725
4537
|
let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
|
|
4726
|
-
if (LoadingFallbackComponent) {
|
|
4538
|
+
if (LoadingFallbackComponent && !islandsNavigationRequest) {
|
|
4727
4539
|
const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
|
|
4728
4540
|
...createRouteStateProps({
|
|
4729
4541
|
params,
|
|
@@ -4754,7 +4566,27 @@ var ServerRenderer = class {
|
|
|
4754
4566
|
});
|
|
4755
4567
|
const islandsSegments = Boolean(islands && this.islandValues());
|
|
4756
4568
|
const keptLayoutCount = islandsSegments && !renderingConfig.ssg && !shouldHydrateLayout && renderedRouteSlots.length === 0 ? countFarmKeptLayouts(requestHeader(req, "f-layouts"), layouts, params) : 0;
|
|
4757
|
-
|
|
4569
|
+
let keptLayouts = keptLayoutCount > 1 ? keptLayoutCount : 0;
|
|
4570
|
+
if (keptLayouts > 0) {
|
|
4571
|
+
let keptElement = null;
|
|
4572
|
+
for (let i = keptLayouts - 1; i >= 0; i--) {
|
|
4573
|
+
const KeptLayout = layoutModules[i]?.default;
|
|
4574
|
+
if (KeptLayout) {
|
|
4575
|
+
keptElement = this.rendererRuntime.createElement(KeptLayout, {
|
|
4576
|
+
children: keptElement,
|
|
4577
|
+
params
|
|
4578
|
+
});
|
|
4579
|
+
}
|
|
4580
|
+
}
|
|
4581
|
+
try {
|
|
4582
|
+
await this.renderElementToCompleteHTML(
|
|
4583
|
+
await this.wrapWithIntegrationProviders(keptElement),
|
|
4584
|
+
{ rejectLateErrors: true }
|
|
4585
|
+
);
|
|
4586
|
+
} catch {
|
|
4587
|
+
keptLayouts = 0;
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4758
4590
|
let wrappedElement = pageElement;
|
|
4759
4591
|
for (let i = layoutModules.length - 1; i >= 0; i--) {
|
|
4760
4592
|
const layoutModule = layoutModules[i];
|
|
@@ -4775,7 +4607,7 @@ var ServerRenderer = class {
|
|
|
4775
4607
|
slot.module.default,
|
|
4776
4608
|
slot.props
|
|
4777
4609
|
);
|
|
4778
|
-
slotElement = this.wrapClientGraph(slotElement);
|
|
4610
|
+
if (slot.shouldHydrate) slotElement = this.wrapClientGraph(slotElement);
|
|
4779
4611
|
slotElement = this.rendererRuntime.createElement(
|
|
4780
4612
|
"div",
|
|
4781
4613
|
{
|
|
@@ -4979,11 +4811,11 @@ var ServerRenderer = class {
|
|
|
4979
4811
|
if (isFarmIntegrationProviderComponentReference(provider.component)) {
|
|
4980
4812
|
providerSourceModule = provider.component.module;
|
|
4981
4813
|
const providerModuleId = provider.component.module.startsWith(".") ? toViteModuleId(
|
|
4982
|
-
|
|
4814
|
+
path9.resolve(this.config.root, provider.component.module),
|
|
4983
4815
|
this.config.root
|
|
4984
4816
|
) : provider.component.module;
|
|
4985
4817
|
const providerModule = this.viteServer ? await loadFarmDevModule(this.viteServer, providerModuleId) : await importRuntimeModule(
|
|
4986
|
-
provider.component.module.startsWith(".") ? pathToFileURL2(
|
|
4818
|
+
provider.component.module.startsWith(".") ? pathToFileURL2(path9.resolve(this.config.root, provider.component.module)).href : provider.component.module
|
|
4987
4819
|
);
|
|
4988
4820
|
ProviderComponent = providerModule[provider.component.export || "default"];
|
|
4989
4821
|
} else if (typeof provider.component === "function") {
|
|
@@ -5074,7 +4906,9 @@ var ServerRenderer = class {
|
|
|
5074
4906
|
);
|
|
5075
4907
|
metadata = addMetadataMarkdownAlternate(
|
|
5076
4908
|
metadata,
|
|
5077
|
-
getFarmMarkdownAlternatePath(resolveMarkdownConfig(this.config.md), publicPathname
|
|
4909
|
+
getFarmMarkdownAlternatePath(resolveMarkdownConfig(this.config.md), publicPathname, {
|
|
4910
|
+
routePathname: (pathname) => this.routeManager.toRoutePathname(pathname)
|
|
4911
|
+
})
|
|
5078
4912
|
);
|
|
5079
4913
|
return metadata;
|
|
5080
4914
|
}
|
|
@@ -5147,7 +4981,7 @@ var ServerRenderer = class {
|
|
|
5147
4981
|
...llmsContext
|
|
5148
4982
|
}) : routeModule.default;
|
|
5149
4983
|
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await renderFarmLlmsFullTxt(value, {
|
|
5150
|
-
origin:
|
|
4984
|
+
origin: await this.getAgentOrigin(request2),
|
|
5151
4985
|
readMarkdown: llmsContext.markdown
|
|
5152
4986
|
}) : value;
|
|
5153
4987
|
const response = createFarmMetadataRouteResponse(match.metadata.kind, body, routeModule, {
|
|
@@ -5181,7 +5015,7 @@ var ServerRenderer = class {
|
|
|
5181
5015
|
const config = resolveFarmLlmsTxtConfig(this.config.agent?.llmsTxt);
|
|
5182
5016
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
5183
5017
|
const body = kind === "llms-full" ? await renderFarmLlmsFullTxt(context.defaults, {
|
|
5184
|
-
origin:
|
|
5018
|
+
origin: await this.getAgentOrigin(request2),
|
|
5185
5019
|
readMarkdown: context.markdown
|
|
5186
5020
|
}) : context.defaults;
|
|
5187
5021
|
await sendWebResponse(
|
|
@@ -5250,19 +5084,23 @@ var ServerRenderer = class {
|
|
|
5250
5084
|
logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
|
|
5251
5085
|
return void 0;
|
|
5252
5086
|
}),
|
|
5253
|
-
|
|
5087
|
+
fs5.promises.stat(route.modulePath).catch(() => void 0)
|
|
5254
5088
|
]);
|
|
5089
|
+
if (await this.isAgentPageNoIndex(pattern, module?.metadata)) return null;
|
|
5255
5090
|
return { pattern, module, lastModified: stat?.mtime.toISOString() };
|
|
5256
5091
|
})
|
|
5257
5092
|
);
|
|
5258
5093
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5259
5094
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5260
|
-
const sitemap = createFarmDefaultSitemap(
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5095
|
+
const sitemap = createFarmDefaultSitemap(
|
|
5096
|
+
sources.filter((source) => source !== null),
|
|
5097
|
+
{
|
|
5098
|
+
origin: new URL(request2.url).origin,
|
|
5099
|
+
config: this.getAgentSitemap(),
|
|
5100
|
+
metadataBase: rootMetadata?.metadataBase,
|
|
5101
|
+
basePath: this.config.basePath
|
|
5102
|
+
}
|
|
5103
|
+
);
|
|
5266
5104
|
await sendWebResponse(
|
|
5267
5105
|
res,
|
|
5268
5106
|
createFarmMetadataRouteResponse("sitemap", sitemap, {}, { method: req.method })
|
|
@@ -5297,6 +5135,21 @@ var ServerRenderer = class {
|
|
|
5297
5135
|
([pattern]) => !pattern.includes("[") && !farmPathGuardCoversPage(guards, pattern)
|
|
5298
5136
|
);
|
|
5299
5137
|
}
|
|
5138
|
+
/**
|
|
5139
|
+
* Whether a listed page renders noindex: its own `robots`, else its nearest layout's, as
|
|
5140
|
+
* the production server decides. A layout that fails to load is surfaced by the page.
|
|
5141
|
+
*/
|
|
5142
|
+
async isAgentPageNoIndex(pattern, metadata) {
|
|
5143
|
+
const layoutMetadata = await Promise.all(
|
|
5144
|
+
this.routeManager.getRouteLayouts(pattern).map(
|
|
5145
|
+
(layout) => this.routeManager.loadLayoutModule(layout.modulePath).then(
|
|
5146
|
+
(module) => module.metadata,
|
|
5147
|
+
() => void 0
|
|
5148
|
+
)
|
|
5149
|
+
)
|
|
5150
|
+
);
|
|
5151
|
+
return isFarmPageNoIndex(metadata, layoutMetadata);
|
|
5152
|
+
}
|
|
5300
5153
|
/**
|
|
5301
5154
|
* The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
|
|
5302
5155
|
* server of its own: a route that answers /mcp, an API route at /api/mcp, `@farm.js/mcp`,
|
|
@@ -5316,25 +5169,27 @@ var ServerRenderer = class {
|
|
|
5316
5169
|
const server = this.getDefaultMCPServer();
|
|
5317
5170
|
const request2 = getCurrentRequestOrNull() ?? createWebRequestFromFarmRequest(req, { trustProxy: this.config.server?.trustProxy });
|
|
5318
5171
|
try {
|
|
5319
|
-
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-
|
|
5172
|
+
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-AZ7QW4UP.mjs");
|
|
5320
5173
|
const origin = new URL(request2.url).origin;
|
|
5321
5174
|
const response = await handleFarmDefaultMCPRequest(request2, {
|
|
5322
5175
|
server,
|
|
5323
5176
|
basePath: this.config.basePath,
|
|
5324
5177
|
listPages: async () => {
|
|
5325
5178
|
const sources = await Promise.all(
|
|
5326
|
-
this.getAgentListedRoutes().map(async ([pattern, route]) =>
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5179
|
+
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
5180
|
+
const module = await this.routeManager.loadRouteModule(route.modulePath).catch(() => ({ __farmRouteGuard: true }));
|
|
5181
|
+
const metadata = module.metadata;
|
|
5182
|
+
return await this.isAgentPageNoIndex(pattern, metadata) ? null : { pattern, module };
|
|
5183
|
+
})
|
|
5184
|
+
);
|
|
5185
|
+
return collectFarmDefaultMCPPages(
|
|
5186
|
+
sources.filter((source) => source !== null),
|
|
5187
|
+
{
|
|
5188
|
+
origin,
|
|
5189
|
+
basePath: this.config.basePath,
|
|
5190
|
+
markdown: resolveMarkdownConfig(this.config.md)
|
|
5191
|
+
}
|
|
5332
5192
|
);
|
|
5333
|
-
return collectFarmDefaultMCPPages(sources, {
|
|
5334
|
-
origin,
|
|
5335
|
-
basePath: this.config.basePath,
|
|
5336
|
-
markdown: resolveMarkdownConfig(this.config.md)
|
|
5337
|
-
});
|
|
5338
5193
|
},
|
|
5339
5194
|
// Pages are read through this server's own socket, with no cookies, as llms-full.txt does.
|
|
5340
5195
|
readMarkdown: this.createDevMarkdownReader(req)
|
|
@@ -5358,12 +5213,13 @@ var ServerRenderer = class {
|
|
|
5358
5213
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
5359
5214
|
async createLlmsTxtContext(request2, options = {}) {
|
|
5360
5215
|
const config = resolveFarmLlmsTxtConfig(this.config.agent?.llmsTxt);
|
|
5361
|
-
const origin =
|
|
5216
|
+
const origin = await this.getAgentOrigin(request2);
|
|
5362
5217
|
const sources = await Promise.all(
|
|
5363
5218
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
5364
5219
|
try {
|
|
5365
5220
|
const module = await this.routeManager.loadRouteModule(route.modulePath);
|
|
5366
5221
|
if (module.__farmRouteGuard) return null;
|
|
5222
|
+
if (await this.isAgentPageNoIndex(pattern, module.metadata)) return null;
|
|
5367
5223
|
return { pattern, metadata: module.metadata };
|
|
5368
5224
|
} catch (error) {
|
|
5369
5225
|
logger.warn(`Could not read metadata for ${pattern} in llms.txt: ${error}`);
|
|
@@ -5400,9 +5256,27 @@ var ServerRenderer = class {
|
|
|
5400
5256
|
defaultMCP: () => this.getDefaultMCPServer()
|
|
5401
5257
|
})
|
|
5402
5258
|
}),
|
|
5403
|
-
...options.full ? {
|
|
5259
|
+
...options.full ? {
|
|
5260
|
+
markdown: readFarmLlmsMarkdownFrom(
|
|
5261
|
+
new URL(request2.url).origin,
|
|
5262
|
+
origin,
|
|
5263
|
+
this.createDevMarkdownReader(options.req)
|
|
5264
|
+
)
|
|
5265
|
+
} : {}
|
|
5404
5266
|
};
|
|
5405
5267
|
}
|
|
5268
|
+
/**
|
|
5269
|
+
* The origin llms.txt and llms-full.txt link to: the root layout's `metadataBase`, else the
|
|
5270
|
+
* request's origin, as for the sitemap and the production server.
|
|
5271
|
+
*/
|
|
5272
|
+
async getAgentOrigin(request2) {
|
|
5273
|
+
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5274
|
+
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5275
|
+
return resolveFarmAgentOrigin(
|
|
5276
|
+
rootMetadata?.metadataBase,
|
|
5277
|
+
new URL(request2.url).origin
|
|
5278
|
+
);
|
|
5279
|
+
}
|
|
5406
5280
|
/**
|
|
5407
5281
|
* Reads page mirrors back through this dev server, the way its .md handler
|
|
5408
5282
|
* renders pages, so Markdown sources and agent overrides are included. Requests
|
|
@@ -5501,7 +5375,7 @@ var ServerRenderer = class {
|
|
|
5501
5375
|
res.end();
|
|
5502
5376
|
return;
|
|
5503
5377
|
}
|
|
5504
|
-
res.write(await
|
|
5378
|
+
res.write(await fs5.promises.readFile(image.modulePath));
|
|
5505
5379
|
res.end();
|
|
5506
5380
|
}
|
|
5507
5381
|
async renderRouteErrorBoundary(req, res, options) {
|
|
@@ -5933,7 +5807,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
5933
5807
|
const islandsOnlyPage = this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
|
|
5934
5808
|
const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
|
|
5935
5809
|
const waitingRoot = this.islandValues() && !islandsOnlyPage && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true && rootStrategy !== void 0 && rootStrategy !== "load" ? req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? "root" : "__farm_page__" : null;
|
|
5936
|
-
const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && canBootFarmIslandsClient(this.config);
|
|
5810
|
+
const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && resolveFarmPlatform() !== "mobile" && canBootFarmIslandsClient(this.config);
|
|
5937
5811
|
const hydrationClickQueueScript = !islandsOnlyPage && !bootClient && (isClientComponent || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true) ? createPreHydrationClickQueueScript() : "";
|
|
5938
5812
|
const {
|
|
5939
5813
|
title,
|
|
@@ -6247,6 +6121,22 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6247
6121
|
}
|
|
6248
6122
|
return false;
|
|
6249
6123
|
}
|
|
6124
|
+
/**
|
|
6125
|
+
* The redirect a page-data request for `request` ended with. A `redirect()`
|
|
6126
|
+
* target is localized as a document render localizes it; a thrown 3xx
|
|
6127
|
+
* Response keeps its Location as written, as a document render sends it.
|
|
6128
|
+
*/
|
|
6129
|
+
async resolvePageDataRedirect(request2, error) {
|
|
6130
|
+
const redirect = getFarmPageDataRedirect(error);
|
|
6131
|
+
if (!redirect || !isFarmRedirectError(error)) return redirect;
|
|
6132
|
+
return {
|
|
6133
|
+
status: redirect.status,
|
|
6134
|
+
location: await this.runWithRequestContext(
|
|
6135
|
+
request2,
|
|
6136
|
+
() => this.localizeRedirectUrl(redirect.location)
|
|
6137
|
+
)
|
|
6138
|
+
};
|
|
6139
|
+
}
|
|
6250
6140
|
localizeRedirectUrl(url) {
|
|
6251
6141
|
const snapshot = getFarmI18nClientSnapshot();
|
|
6252
6142
|
return snapshot && url.startsWith("/") && !url.startsWith("//") ? localizeFarmHref(url, snapshot.locale, snapshot) : url;
|
|
@@ -6313,6 +6203,11 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6313
6203
|
const pathname = resolveFarmRequestURL(req, {
|
|
6314
6204
|
trustProxy: this.config.server?.trustProxy
|
|
6315
6205
|
}).pathname;
|
|
6206
|
+
if (isFarmRendererDisabled(this.config.renderer)) {
|
|
6207
|
+
res.setHeader("Content-Type", "application/json");
|
|
6208
|
+
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
6209
|
+
return;
|
|
6210
|
+
}
|
|
6316
6211
|
const acceptHeader = req.headers.accept;
|
|
6317
6212
|
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
6318
6213
|
if (farmRequestWantsMarkdown(pathname, accept)) {
|
|
@@ -6322,13 +6217,13 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6322
6217
|
res.end(createFarmMarkdownErrorBody(404, pathname, this.config.basePath || "/"));
|
|
6323
6218
|
return;
|
|
6324
6219
|
}
|
|
6325
|
-
const appDir =
|
|
6220
|
+
const appDir = path9.join(this.config.root, this.config.srcDir, "app");
|
|
6326
6221
|
const notFoundExtensions = getFarmRendererComponentExtensions(this.config.renderer);
|
|
6327
6222
|
let layoutModule = null;
|
|
6328
6223
|
try {
|
|
6329
6224
|
for (const ext of notFoundExtensions) {
|
|
6330
|
-
const layoutPath =
|
|
6331
|
-
if (
|
|
6225
|
+
const layoutPath = path9.join(appDir, `layout${ext}`);
|
|
6226
|
+
if (fs5.existsSync(layoutPath)) {
|
|
6332
6227
|
layoutModule = await this.routeManager.loadLayoutModule(layoutPath);
|
|
6333
6228
|
break;
|
|
6334
6229
|
}
|
|
@@ -6541,7 +6436,7 @@ ${clientScript}
|
|
|
6541
6436
|
};
|
|
6542
6437
|
|
|
6543
6438
|
// src/app.ts
|
|
6544
|
-
import
|
|
6439
|
+
import path10 from "path";
|
|
6545
6440
|
var defaultDocsConfig = {
|
|
6546
6441
|
enabled: false,
|
|
6547
6442
|
entry: "/docs",
|
|
@@ -6576,6 +6471,7 @@ var FarmApp = class {
|
|
|
6576
6471
|
await this.serverRenderer.initialize();
|
|
6577
6472
|
await this.verifyAppStructure();
|
|
6578
6473
|
await this.routeManager.discoverRoutes();
|
|
6474
|
+
if (isFarmRendererDisabled(this.config.renderer)) this.assertNoPageRoutes();
|
|
6579
6475
|
this.routeManager.generateClientManifest(this.config.root);
|
|
6580
6476
|
if (process.env.FARM_VERBOSE) {
|
|
6581
6477
|
logger.success("Farm.js application initialized successfully!");
|
|
@@ -6623,7 +6519,10 @@ var FarmApp = class {
|
|
|
6623
6519
|
server: resolveFarmServerConfig(config.server),
|
|
6624
6520
|
serverActions: resolveServerActionsConfig(config.serverActions),
|
|
6625
6521
|
security: resolveFarmSecurityConfig(config.security),
|
|
6626
|
-
images: resolveFarmImageConfig(
|
|
6522
|
+
images: resolveFarmImageConfig(
|
|
6523
|
+
config.images,
|
|
6524
|
+
isFarmRendererDisabled(config.renderer) ? "none" : void 0
|
|
6525
|
+
),
|
|
6627
6526
|
performance: resolveFarmPerformanceConfig(config.performance),
|
|
6628
6527
|
theme: resolveFarmThemeConfig(config.theme, basePath),
|
|
6629
6528
|
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : resolveFarmI18nConfig(config.i18n, {
|
|
@@ -6662,6 +6561,18 @@ var FarmApp = class {
|
|
|
6662
6561
|
vite: config.vite || {}
|
|
6663
6562
|
};
|
|
6664
6563
|
}
|
|
6564
|
+
/** `renderer: false` serves no pages, so a page or layout file would silently never answer. */
|
|
6565
|
+
assertNoPageRoutes() {
|
|
6566
|
+
const files = [
|
|
6567
|
+
...this.routeManager.getRoutes().values(),
|
|
6568
|
+
...this.routeManager.getLayouts().values()
|
|
6569
|
+
].map((entry) => path10.relative(this.config.root, entry.modulePath).split(path10.sep).join("/"));
|
|
6570
|
+
if (files.length === 0) return;
|
|
6571
|
+
throw new Error(
|
|
6572
|
+
`This app sets \`renderer: false\`, which serves API routes only, but it has pages or layouts:
|
|
6573
|
+
` + [...new Set(files)].map((file) => ` - ${file}`).join("\n") + "\nRemove these files, or remove `renderer: false` to render pages."
|
|
6574
|
+
);
|
|
6575
|
+
}
|
|
6665
6576
|
async verifyAppStructure() {
|
|
6666
6577
|
const appDirs = getFarmAppDirectories(this.config);
|
|
6667
6578
|
const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => fileExists(appDir)))).some(
|
|
@@ -6681,12 +6592,12 @@ var FarmApp = class {
|
|
|
6681
6592
|
}
|
|
6682
6593
|
const componentExtensions = getFarmRendererComponentExtensions(this.config.renderer);
|
|
6683
6594
|
const rootLayoutPaths = appDirs.flatMap(
|
|
6684
|
-
(appDir) => componentExtensions.map((extension) =>
|
|
6595
|
+
(appDir) => componentExtensions.map((extension) => path10.join(appDir, `layout${extension}`))
|
|
6685
6596
|
);
|
|
6686
6597
|
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => fileExists(p))).then(
|
|
6687
6598
|
(results) => results.some(Boolean)
|
|
6688
6599
|
);
|
|
6689
|
-
if (!hasRootLayout) {
|
|
6600
|
+
if (!hasRootLayout && !isFarmRendererDisabled(this.config.renderer)) {
|
|
6690
6601
|
logger.warn(
|
|
6691
6602
|
`No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
|
|
6692
6603
|
);
|
|
@@ -6745,13 +6656,13 @@ function resolveFarmImageServerRuntime(images, preset) {
|
|
|
6745
6656
|
}
|
|
6746
6657
|
|
|
6747
6658
|
// src/app-manifest-packages.ts
|
|
6748
|
-
import
|
|
6749
|
-
import
|
|
6659
|
+
import fs6 from "fs";
|
|
6660
|
+
import path11 from "path";
|
|
6750
6661
|
var FARM_PACKAGE = /^@(?:farm\.js|farming-labs)\/[a-z0-9._-]+$/;
|
|
6751
6662
|
function resolveFarmAppPackages(root) {
|
|
6752
6663
|
let manifest;
|
|
6753
6664
|
try {
|
|
6754
|
-
manifest = JSON.parse(
|
|
6665
|
+
manifest = JSON.parse(fs6.readFileSync(path11.join(root, "package.json"), "utf8"));
|
|
6755
6666
|
} catch {
|
|
6756
6667
|
return {};
|
|
6757
6668
|
}
|
|
@@ -6766,13 +6677,13 @@ function resolveFarmAppPackages(root) {
|
|
|
6766
6677
|
for (let dir = root; ; ) {
|
|
6767
6678
|
try {
|
|
6768
6679
|
const { version } = JSON.parse(
|
|
6769
|
-
|
|
6680
|
+
fs6.readFileSync(path11.join(dir, "node_modules", name, "package.json"), "utf8")
|
|
6770
6681
|
);
|
|
6771
6682
|
if (typeof version === "string" && /^[0-9A-Za-z.+-]{1,64}$/.test(version))
|
|
6772
6683
|
versions[name] = version;
|
|
6773
6684
|
break;
|
|
6774
6685
|
} catch {
|
|
6775
|
-
const parent =
|
|
6686
|
+
const parent = path11.dirname(dir);
|
|
6776
6687
|
if (parent === dir) break;
|
|
6777
6688
|
dir = parent;
|
|
6778
6689
|
}
|
|
@@ -6782,9 +6693,9 @@ function resolveFarmAppPackages(root) {
|
|
|
6782
6693
|
}
|
|
6783
6694
|
|
|
6784
6695
|
// src/app-manifest-webmcp.ts
|
|
6785
|
-
import
|
|
6696
|
+
import fs7 from "fs";
|
|
6786
6697
|
import { createRequire as createRequire2 } from "module";
|
|
6787
|
-
import
|
|
6698
|
+
import path12 from "path";
|
|
6788
6699
|
import { globSync } from "tinyglobby";
|
|
6789
6700
|
var WEBMCP_CLIENT = "@farm.js/webmcp/client";
|
|
6790
6701
|
var DEFINERS = /* @__PURE__ */ new Set(["defineWebMCPTool", "registerWebMCPTool", "registerWebMCPTools"]);
|
|
@@ -6879,7 +6790,7 @@ function toolFromObject(object) {
|
|
|
6879
6790
|
}
|
|
6880
6791
|
function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
6881
6792
|
if (!code.includes(WEBMCP_CLIENT)) return [];
|
|
6882
|
-
const lang = LANGS[
|
|
6793
|
+
const lang = LANGS[path12.extname(filename).slice(1)] ?? "tsx";
|
|
6883
6794
|
parseAst2 ?? (parseAst2 = createRequire2(typeof __filename === "string" ? __filename : import.meta.url)(
|
|
6884
6795
|
"rolldown/parseAst"
|
|
6885
6796
|
).parseAst);
|
|
@@ -6926,7 +6837,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
6926
6837
|
}
|
|
6927
6838
|
var cache = /* @__PURE__ */ new Map();
|
|
6928
6839
|
function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
6929
|
-
const base =
|
|
6840
|
+
const base = path12.resolve(root, srcDir);
|
|
6930
6841
|
let files;
|
|
6931
6842
|
try {
|
|
6932
6843
|
files = globSync("**/*.{ts,tsx,js,jsx,mts,mjs,cts,cjs}", {
|
|
@@ -6943,7 +6854,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
6943
6854
|
for (const file of files.sort()) {
|
|
6944
6855
|
let mtimeMs;
|
|
6945
6856
|
try {
|
|
6946
|
-
mtimeMs =
|
|
6857
|
+
mtimeMs = fs7.statSync(file).mtimeMs;
|
|
6947
6858
|
} catch {
|
|
6948
6859
|
continue;
|
|
6949
6860
|
}
|
|
@@ -6951,7 +6862,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
6951
6862
|
if (!entry || entry.mtimeMs !== mtimeMs) {
|
|
6952
6863
|
let code = "";
|
|
6953
6864
|
try {
|
|
6954
|
-
code =
|
|
6865
|
+
code = fs7.readFileSync(file, "utf8");
|
|
6955
6866
|
} catch {
|
|
6956
6867
|
}
|
|
6957
6868
|
entry = { mtimeMs, tools: findFarmWebMCPTools(code, file) };
|
|
@@ -6967,8 +6878,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
6967
6878
|
}
|
|
6968
6879
|
|
|
6969
6880
|
// src/client-cache-persistence-build.ts
|
|
6970
|
-
import
|
|
6971
|
-
import
|
|
6881
|
+
import fs8 from "fs";
|
|
6882
|
+
import path13 from "path";
|
|
6972
6883
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
6973
6884
|
function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
6974
6885
|
const client = cache2?.client;
|
|
@@ -6979,7 +6890,7 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
|
6979
6890
|
'cache.client.adapter must be a module path string, for example "./src/cache-adapter".'
|
|
6980
6891
|
);
|
|
6981
6892
|
}
|
|
6982
|
-
const resolved =
|
|
6893
|
+
const resolved = path13.resolve(root, adapter);
|
|
6983
6894
|
const found = resolveAdapterFile(resolved);
|
|
6984
6895
|
if (!found) {
|
|
6985
6896
|
throw new Error(
|
|
@@ -6992,10 +6903,10 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
|
6992
6903
|
return { importPath: found.replace(/\\/g, "/"), options };
|
|
6993
6904
|
}
|
|
6994
6905
|
function resolveAdapterFile(resolved) {
|
|
6995
|
-
if (
|
|
6906
|
+
if (fs8.existsSync(resolved) && fs8.statSync(resolved).isFile()) return resolved;
|
|
6996
6907
|
for (const extension of ADAPTER_EXTENSIONS) {
|
|
6997
6908
|
const candidate = `${resolved}.${extension}`;
|
|
6998
|
-
if (
|
|
6909
|
+
if (fs8.existsSync(candidate) && fs8.statSync(candidate).isFile()) return candidate;
|
|
6999
6910
|
}
|
|
7000
6911
|
return void 0;
|
|
7001
6912
|
}
|
|
@@ -7205,7 +7116,7 @@ async function readFarmNavigationStream(body, flushToken) {
|
|
|
7205
7116
|
// src/docs/client-config.ts
|
|
7206
7117
|
import { realpathSync as realpathSync2 } from "fs";
|
|
7207
7118
|
import { createRequire as createRequire3 } from "module";
|
|
7208
|
-
import
|
|
7119
|
+
import path14 from "path";
|
|
7209
7120
|
var parseAst3;
|
|
7210
7121
|
function propertyKeyName(property2) {
|
|
7211
7122
|
if (property2.computed) return void 0;
|
|
@@ -7218,7 +7129,7 @@ function redactFarmDocsClientConfig(code, filename) {
|
|
|
7218
7129
|
parseAst3 ?? (parseAst3 = createRequire3(typeof __filename === "string" ? __filename : import.meta.url)(
|
|
7219
7130
|
"rolldown/parseAst"
|
|
7220
7131
|
).parseAst);
|
|
7221
|
-
const extension =
|
|
7132
|
+
const extension = path14.extname(filename);
|
|
7222
7133
|
const program = parseAst3(code, {
|
|
7223
7134
|
lang: extension === ".tsx" || extension === ".jsx" ? "tsx" : "ts"
|
|
7224
7135
|
});
|
|
@@ -7280,7 +7191,7 @@ function farmDocsClientConfigPlugin(configModule) {
|
|
|
7280
7191
|
}
|
|
7281
7192
|
|
|
7282
7193
|
// src/server/vite-config.ts
|
|
7283
|
-
import
|
|
7194
|
+
import path15 from "path";
|
|
7284
7195
|
var FARM_CLIENT_ENTRY_PATTERN = "**/{page,layout,loading,error,not-found,default}.{js,jsx,ts,tsx}";
|
|
7285
7196
|
var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
7286
7197
|
"react",
|
|
@@ -7307,14 +7218,15 @@ function getFarmClientOptimizeDepsInclude(renderer) {
|
|
|
7307
7218
|
);
|
|
7308
7219
|
}
|
|
7309
7220
|
function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
7310
|
-
const resolvedProjectRoot =
|
|
7221
|
+
const resolvedProjectRoot = path15.resolve(projectRoot);
|
|
7311
7222
|
return appDirectories.map((appDirectory) => {
|
|
7312
|
-
const relativeAppDirectory =
|
|
7223
|
+
const relativeAppDirectory = path15.relative(resolvedProjectRoot, path15.resolve(appDirectory)).replace(/\\/g, "/");
|
|
7313
7224
|
const prefix = relativeAppDirectory || ".";
|
|
7314
7225
|
return `${prefix}/${FARM_CLIENT_ENTRY_PATTERN}`;
|
|
7315
7226
|
});
|
|
7316
7227
|
}
|
|
7317
7228
|
function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
7229
|
+
if (isFarmRendererDisabled(renderer)) return { noDiscovery: true, include: [] };
|
|
7318
7230
|
return {
|
|
7319
7231
|
// Keep normal application dependency discovery for CJS-only packages, but
|
|
7320
7232
|
// seed every Farm browser runtime so React is present in the first crawl.
|
|
@@ -7322,7 +7234,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
|
7322
7234
|
// Waiting for the crawl avoids serving a partial optimizer generation and
|
|
7323
7235
|
// then changing browser hashes while hydration is already in progress.
|
|
7324
7236
|
holdUntilCrawlEnd: true,
|
|
7325
|
-
include: getFarmClientOptimizeDepsInclude(renderer),
|
|
7237
|
+
include: getFarmClientOptimizeDepsInclude(renderer || void 0),
|
|
7326
7238
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
7327
7239
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
7328
7240
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
@@ -7331,7 +7243,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
|
7331
7243
|
}
|
|
7332
7244
|
function createFarmSourceAlias(projectRoot, srcDir = "src") {
|
|
7333
7245
|
return {
|
|
7334
|
-
"@":
|
|
7246
|
+
"@": path15.resolve(projectRoot, srcDir)
|
|
7335
7247
|
};
|
|
7336
7248
|
}
|
|
7337
7249
|
function mergeNoExternal(farmValue, userValue) {
|
|
@@ -7490,7 +7402,6 @@ export {
|
|
|
7490
7402
|
generateFarmIntegrationProviderServerModules,
|
|
7491
7403
|
inferFarmIslandStrategy,
|
|
7492
7404
|
resolveFarmRouteRootStrategy,
|
|
7493
|
-
generateFarmClientPluginEntryCode,
|
|
7494
7405
|
canBootFarmIslandsClient,
|
|
7495
7406
|
ServerRenderer,
|
|
7496
7407
|
FarmApp,
|