@farm.js/core 0.2.0-beta.2 → 0.2.0
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/README.md +1 -3
- package/dist/THIRD-PARTY-LICENSES.md +3220 -0
- package/dist/after.cjs +3 -3
- package/dist/after.mjs +1 -1
- package/dist/{agent-mcp-handler-VX4NDDHR.mjs → agent-mcp-handler-BY7VJQ4W.mjs} +1 -1
- package/dist/agent-mcp-handler-S4UTE7NO.cjs +21 -0
- package/dist/{agent-mcp.d-DhCEzIfu.d.mts → agent-mcp.d-DhZf5-v0.d.mts} +1 -1
- package/dist/{agent-mcp.d-DBaonhLg.d.ts → agent-mcp.d-xPua9Zdz.d.ts} +1 -1
- package/dist/agent-runtime.cjs +25 -22
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +2 -2
- package/dist/{analyzer-T2U345WL.mjs → analyzer-LQ4LVDCW.mjs} +3 -3
- package/dist/analyzer-ZFC2L6NZ.cjs +17 -0
- package/dist/api/client.cjs +16 -16
- package/dist/api/client.mjs +1 -1
- package/dist/api/client.native.cjs +21 -18
- package/dist/api/client.native.mjs +1 -1
- package/dist/api/node.cjs +29 -26
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/node.mjs +1 -1
- package/dist/api/route-manager.cjs +45 -45
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +5 -5
- package/dist/api/runtime.cjs +25 -25
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +1 -1
- package/dist/api.cjs +57 -57
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +6 -6
- package/dist/{app-manifest.d-uE0JGZKN.d.mts → app-manifest.d-Bq9VWtpk.d.mts} +1 -1
- package/dist/{app-manifest.d-nLVFFd7N.d.ts → app-manifest.d-D6l1Wkn6.d.ts} +1 -1
- package/dist/app-markdown-compiler-4RCCOTTF.cjs +33007 -0
- package/dist/app-markdown-compiler-OM2AMFRK.mjs +32402 -0
- package/dist/app-markdown.cjs +16 -16
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-DGGcNXV7.d.mts → app.d-Bn1bqBkf.d.mts} +17 -7
- package/dist/{app.d-CwVkAUEU.d.ts → app.d-gnTrW72o.d.ts} +17 -7
- package/dist/cache.cjs +8 -8
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-DA432P2F.cjs → chunk-25CHWAZY.cjs} +14 -10
- package/dist/{chunk-JDT733EW.cjs → chunk-27IPPPCV.cjs} +16 -19
- package/dist/{chunk-X2SMVPLH.mjs → chunk-2FBFJO2Z.mjs} +8 -5
- package/dist/{chunk-PHCJJJZV.cjs → chunk-2HC46EGU.cjs} +6 -2
- package/dist/{chunk-MF3IA2AW.cjs → chunk-2L4M6YUG.cjs} +6 -1
- package/dist/{chunk-RBSGFS5X.cjs → chunk-2LHO4HTP.cjs} +62 -54
- package/dist/{chunk-CIY74JLV.cjs → chunk-2RA2VIKN.cjs} +9 -5
- package/dist/{chunk-A3LNXQJJ.cjs → chunk-2VLW3HWJ.cjs} +9 -2
- package/dist/{chunk-4EBC7EMW.cjs → chunk-323JTLXR.cjs} +6 -1
- package/dist/{chunk-7KJJ4SBS.cjs → chunk-32HGOX3M.cjs} +6 -1
- package/dist/{chunk-RKQOMG2X.cjs → chunk-3ACTVXZG.cjs} +9 -5
- package/dist/{chunk-N3H7UPBM.cjs → chunk-3EZHMZGD.cjs} +6 -1
- package/dist/{chunk-LQWIIBI2.cjs → chunk-3KLDTMIC.cjs} +6 -1
- package/dist/{chunk-OO7DYIJD.cjs → chunk-3YT7DIIS.cjs} +7 -1
- package/dist/{chunk-ILQSRLKK.cjs → chunk-4A6WSOZH.cjs} +55 -49
- package/dist/{chunk-CBB7I6HW.cjs → chunk-4ER5KYSC.cjs} +9 -5
- package/dist/{chunk-E5UN4OWX.cjs → chunk-4JARM2QQ.cjs} +6 -1
- package/dist/{chunk-VGVRGGP4.cjs → chunk-4JCX33RZ.cjs} +13 -8
- package/dist/chunk-4RLFAN7T.cjs +6 -0
- package/dist/{chunk-OZUINP2P.cjs → chunk-4USE4SEU.cjs} +19 -15
- package/dist/{chunk-LQ3FISSD.mjs → chunk-54INSSWI.mjs} +66 -53
- package/dist/{chunk-PENBZAHJ.cjs → chunk-57OAZCWQ.cjs} +6 -1
- package/dist/{chunk-JYQ6DGPW.cjs → chunk-5P3TZGS3.cjs} +52 -45
- package/dist/{chunk-Z3RM3VA2.mjs → chunk-5VXVRMXK.mjs} +11 -1
- package/dist/{chunk-OZC2JPW6.cjs → chunk-5XYJ5KRN.cjs} +6 -1
- package/dist/{chunk-QKW6DLDT.cjs → chunk-5YT2ZSWS.cjs} +17 -13
- package/dist/{chunk-QCKSYYXK.cjs → chunk-63S7DAEG.cjs} +21 -17
- package/dist/{chunk-FDGYDQGL.cjs → chunk-66WIOZXX.cjs} +7 -1
- package/dist/{chunk-MHKPXX3J.cjs → chunk-6AUPJYHF.cjs} +13 -9
- package/dist/{chunk-DVJM55D2.cjs → chunk-6FIY4KBC.cjs} +6 -1
- package/dist/{chunk-TIZJYHB7.mjs → chunk-6IUWKO2Q.mjs} +15 -0
- package/dist/{chunk-VWIW47FW.cjs → chunk-6K7LEL2T.cjs} +6 -1
- package/dist/{chunk-UZCMMJJT.cjs → chunk-6NQ63L6N.cjs} +6 -1
- package/dist/{chunk-BTVDYS4B.cjs → chunk-6QCZWAGO.cjs} +6 -1
- package/dist/{chunk-RDADQG5S.cjs → chunk-6QWCFVGL.cjs} +14 -7
- package/dist/{chunk-JRGR5Z4K.cjs → chunk-6VC7NUY3.cjs} +6 -1
- package/dist/{chunk-CKPTIEDX.cjs → chunk-7BFFBYLN.cjs} +6 -1
- package/dist/{chunk-7Q7UB4TL.cjs → chunk-7GKZDRY2.cjs} +9 -5
- package/dist/{chunk-UCJCU2IL.cjs → chunk-7JI7W2MD.cjs} +34 -30
- package/dist/{chunk-C7LCTVJ2.cjs → chunk-7JZVCHNF.cjs} +10 -6
- package/dist/{chunk-QZUCVJZJ.cjs → chunk-7M3X4CBY.cjs} +6 -1
- package/dist/{chunk-7JUIK547.cjs → chunk-7MQMWGTL.cjs} +6 -1
- package/dist/{chunk-PIUTGRDI.cjs → chunk-7O3YJ6NP.cjs} +6 -1
- package/dist/{chunk-SXCL2MIN.cjs → chunk-7V5MQSBL.cjs} +9 -1
- package/dist/{chunk-7U4XF76R.cjs → chunk-7ZDLE77P.cjs} +12 -8
- package/dist/{chunk-NU5XLYRN.cjs → chunk-A2ELHZBZ.cjs} +10 -1
- package/dist/{chunk-RZI6436F.cjs → chunk-ADCVSTFV.cjs} +18 -11
- package/dist/chunk-AZJEQ5CR.cjs +6 -0
- package/dist/{chunk-ZMSVKVI3.cjs → chunk-B2VSX33T.cjs} +6 -1
- package/dist/{chunk-AQIRXBBY.cjs → chunk-B6JPBPBQ.cjs} +6 -1
- package/dist/{chunk-W76C7TCW.cjs → chunk-BNVQSUZK.cjs} +6 -2
- package/dist/{chunk-MNUYXZV7.cjs → chunk-BNWADCG2.cjs} +6 -1
- package/dist/{chunk-CCAUIBIS.cjs → chunk-BRWSQDKO.cjs} +10 -1
- package/dist/{chunk-KQS27YN7.cjs → chunk-C6DR4JAR.cjs} +14 -10
- package/dist/{chunk-Y3WG64CP.cjs → chunk-CH2JX3CM.cjs} +6 -1
- package/dist/{chunk-KDQKTX3Q.cjs → chunk-COMBIEAP.cjs} +44 -36
- package/dist/{chunk-YUQUGVSV.cjs → chunk-CTTXHHZG.cjs} +50 -46
- package/dist/{chunk-FDZZ6K3N.cjs → chunk-CUW7K4AU.cjs} +14 -10
- package/dist/chunk-CWSUKW2H.cjs +6 -0
- package/dist/chunk-CYUTK4JP.cjs +52 -0
- package/dist/{chunk-COK4IXOO.mjs → chunk-D7KBMJ7L.mjs} +1 -1
- package/dist/{chunk-T3SMMLSB.cjs → chunk-DB4NOIQC.cjs} +12 -8
- package/dist/{chunk-N2ZMSSPP.cjs → chunk-DNERKYN4.cjs} +77 -70
- package/dist/{chunk-OWOUTKIJ.cjs → chunk-DQYMTSF3.cjs} +6 -1
- package/dist/{chunk-7V5M43ND.mjs → chunk-DVL3UVYT.mjs} +2 -2
- package/dist/{chunk-UNOXV37V.cjs → chunk-DYGHX2UR.cjs} +6 -1
- package/dist/{chunk-LSHX2H5G.cjs → chunk-EBE6BK54.cjs} +6 -1
- package/dist/{chunk-WT6RAN2I.cjs → chunk-EGMJ5KEU.cjs} +6 -1
- package/dist/{chunk-22KXTL3I.cjs → chunk-EJLMRNSV.cjs} +24 -19
- package/dist/{chunk-RDNKQ5MK.cjs → chunk-EMM3YXXI.cjs} +19 -15
- package/dist/{chunk-EZUTDTFM.cjs → chunk-ERSLQ4C7.cjs} +18 -11
- package/dist/{chunk-4WXNTAOM.mjs → chunk-EUVHELJL.mjs} +1 -1
- package/dist/{chunk-VGZIIOU6.cjs → chunk-EWPH5IOC.cjs} +26 -19
- package/dist/{chunk-J6TZRYCO.cjs → chunk-F5JTXLS7.cjs} +6 -1
- package/dist/{chunk-UWDFH3ZV.mjs → chunk-FFROR7QD.mjs} +1 -1
- package/dist/{chunk-HUGPJFOC.cjs → chunk-G22QP2MX.cjs} +9 -5
- package/dist/{chunk-PMJSG4JS.cjs → chunk-G5KGLMPN.cjs} +6 -1
- package/dist/{chunk-4Q263EQI.mjs → chunk-GAD63TH7.mjs} +9 -9
- package/dist/{chunk-R5U7OIPI.cjs → chunk-GAII22G2.cjs} +6 -1
- package/dist/{chunk-SSFAPTRD.mjs → chunk-GK2RCRT2.mjs} +1 -1
- package/dist/{chunk-6CTFVBAT.cjs → chunk-GKYOFMPQ.cjs} +6 -1
- package/dist/{chunk-JYT7AN37.cjs → chunk-GLP3ID53.cjs} +6 -1
- package/dist/{chunk-QBJ6N5MT.mjs → chunk-GN2RXH72.mjs} +1 -1
- package/dist/{chunk-RQRTH57V.cjs → chunk-GQONHUMI.cjs} +6 -1
- package/dist/{chunk-EOXPRC2C.cjs → chunk-GQQID5IB.cjs} +7 -1
- package/dist/{chunk-IUKBPBM7.cjs → chunk-GUDYDNKU.cjs} +6 -1
- package/dist/{chunk-6GJZJAED.mjs → chunk-GUNPDMSX.mjs} +1 -1
- package/dist/{chunk-Z43CIBUR.cjs → chunk-GUYGMTWA.cjs} +20 -13
- package/dist/{chunk-QO24II6C.mjs → chunk-GXWCR7PP.mjs} +7 -3
- package/dist/{chunk-VS7HLH4S.cjs → chunk-GYH2B4YQ.cjs} +12 -8
- package/dist/{chunk-RGMUS3HO.cjs → chunk-H3TYWCMG.cjs} +18 -14
- package/dist/{chunk-2OF5RPVU.cjs → chunk-H5AC3XSE.cjs} +18 -14
- package/dist/{chunk-ZIOFRBIU.cjs → chunk-H7INTSUK.cjs} +15 -9
- package/dist/{chunk-RFNQTQ44.cjs → chunk-HBRCMX24.cjs} +10 -5
- package/dist/{chunk-UA77C2ZA.cjs → chunk-HF3JJPH4.cjs} +58 -50
- package/dist/{chunk-HV6CYSMF.mjs → chunk-HHZURH4U.mjs} +1 -17
- package/dist/{chunk-JP5TWUK2.cjs → chunk-HSAHQBMG.cjs} +8 -4
- package/dist/{chunk-OQOII62L.mjs → chunk-HYYOVRED.mjs} +2 -2
- package/dist/{chunk-3BTN3NP7.cjs → chunk-I5PDHLKE.cjs} +6 -2
- package/dist/{chunk-2RSVYJT6.cjs → chunk-IBZW57NW.cjs} +9 -5
- package/dist/{chunk-KORZ6PRE.cjs → chunk-IDUGG7VR.cjs} +6 -1
- package/dist/{chunk-6JHZPB52.cjs → chunk-IEZFFXSC.cjs} +10 -6
- package/dist/{chunk-VACYUMXW.cjs → chunk-IGA3OTFY.cjs} +37 -29
- package/dist/{chunk-YSRZSKQB.cjs → chunk-IGBQSUT5.cjs} +55 -40
- package/dist/{chunk-JIBEFLQ7.cjs → chunk-IKYNDANT.cjs} +7 -1
- package/dist/{chunk-KBGZ5FD6.cjs → chunk-IVEV44O2.cjs} +6 -2
- package/dist/{chunk-MCSRMEQV.cjs → chunk-J2JMESBJ.cjs} +6 -1
- package/dist/{chunk-WMRGIQTA.cjs → chunk-J3RIMCBD.cjs} +6 -1
- package/dist/{chunk-MWAWMFG3.cjs → chunk-J6JAUJPC.cjs} +737 -709
- package/dist/{chunk-N4AQNEXR.cjs → chunk-JIBZ6SCC.cjs} +6 -1
- package/dist/{chunk-SWPLGPYF.cjs → chunk-JKNQMGZE.cjs} +28 -24
- package/dist/{chunk-IZYFP7IN.cjs → chunk-JOSR2E2C.cjs} +17 -13
- package/dist/{chunk-AOKXITZ6.cjs → chunk-JOZDAIKZ.cjs} +6 -1
- package/dist/{chunk-EODGIFI7.cjs → chunk-JYQMGMKT.cjs} +16 -4
- package/dist/{chunk-J6RFB324.cjs → chunk-JZCUDAH2.cjs} +6 -1
- package/dist/{chunk-N2BRIN7I.mjs → chunk-K44IR6WC.mjs} +1 -1
- package/dist/{chunk-SUCDVKUB.cjs → chunk-K6LZMZNB.cjs} +6 -1
- package/dist/{chunk-GYJT2U7J.cjs → chunk-KAD5WBY4.cjs} +9 -5
- package/dist/{chunk-O4JYMU5N.cjs → chunk-KDUVIJSZ.cjs} +22 -18
- package/dist/{chunk-2LHZD3OP.cjs → chunk-KEBD377T.cjs} +6 -2
- package/dist/{chunk-3DE6RK7K.cjs → chunk-KHTJVI6B.cjs} +6 -1
- package/dist/{chunk-OY5XDG24.cjs → chunk-KI3B3H5K.cjs} +9 -5
- package/dist/{chunk-ANKMAGFJ.mjs → chunk-KJW6KEOZ.mjs} +1 -1
- package/dist/{chunk-4A6A6P4T.mjs → chunk-KKXGBQ2K.mjs} +3 -3
- package/dist/{chunk-4IE3YK7U.mjs → chunk-KQXYBJES.mjs} +14 -11
- package/dist/{chunk-P2355C6E.cjs → chunk-KSRWTQ6J.cjs} +6 -1
- package/dist/{chunk-SHIWRBFI.cjs → chunk-KUG3P3GY.cjs} +6 -1
- package/dist/{chunk-T7HGXF7D.cjs → chunk-KXCPX3HE.cjs} +11 -7
- package/dist/{chunk-C5QHZ626.cjs → chunk-KXXZDS7C.cjs} +6 -1
- package/dist/{chunk-DUIP64BF.cjs → chunk-KYFTDHNN.cjs} +6 -1
- package/dist/{chunk-VXCFJWK5.cjs → chunk-L6CW5AWM.cjs} +6 -1
- package/dist/{chunk-XGPRM7OK.cjs → chunk-LEK3P2ZD.cjs} +16 -7
- package/dist/{chunk-T7UC2ORA.cjs → chunk-LEZJZX4C.cjs} +7 -18
- package/dist/{chunk-HA7YRO53.cjs → chunk-LF7HAALM.cjs} +6 -1
- package/dist/{chunk-2KMIJDY6.cjs → chunk-LG62AYPQ.cjs} +6 -1
- package/dist/{chunk-OLIWLN4I.cjs → chunk-LGL5QKUJ.cjs} +24 -20
- package/dist/{chunk-SMUW7UST.mjs → chunk-LO5BNR6Y.mjs} +7 -2
- package/dist/{chunk-PWDBWXQI.cjs → chunk-LVYUTMW4.cjs} +6 -1
- package/dist/{chunk-XRRHPBG2.cjs → chunk-M6W3AN57.cjs} +6 -1
- package/dist/{chunk-PZXYAWYG.cjs → chunk-M7RS7HSB.cjs} +13 -8
- package/dist/{chunk-I5KPOXUE.mjs → chunk-MEIZIRMK.mjs} +1 -1
- package/dist/{chunk-HNB5JHBO.mjs → chunk-MLMDOIBY.mjs} +5 -5
- package/dist/{chunk-CEVXKJKF.cjs → chunk-MMSCWTJT.cjs} +6 -1
- package/dist/{chunk-SIECKBNK.cjs → chunk-MNBFSAWF.cjs} +7 -2
- package/dist/{chunk-EA5HVG45.cjs → chunk-MUQP2APN.cjs} +9 -2
- package/dist/{chunk-XOLYZZDX.mjs → chunk-MX4G24YS.mjs} +110 -56
- package/dist/{chunk-SCE7VWPN.cjs → chunk-MZG5M4JS.cjs} +48 -41
- package/dist/{chunk-DVAZ53X6.cjs → chunk-N4AM7Q34.cjs} +77 -73
- package/dist/{chunk-DXUXQP2T.cjs → chunk-N4C72FCD.cjs} +6 -1
- package/dist/{chunk-H7REG7OX.cjs → chunk-NKW4JEOH.cjs} +13 -9
- package/dist/{chunk-XRFGOYXG.cjs → chunk-NMMCBJZM.cjs} +17 -12
- package/dist/{chunk-SHDCKRP4.cjs → chunk-NQUZDXKJ.cjs} +7 -3
- package/dist/{chunk-UGWKNZ4U.cjs → chunk-O47IT4CS.cjs} +25 -21
- package/dist/{chunk-EUZFBHPP.cjs → chunk-O7B6LJWE.cjs} +7 -3
- package/dist/{chunk-UOMSGJHK.cjs → chunk-OAAVIFOJ.cjs} +116 -103
- package/dist/{chunk-SAUGKNCF.cjs → chunk-OBERQH7M.cjs} +42 -37
- package/dist/{chunk-NW3DL2PM.cjs → chunk-OCQSYDMG.cjs} +11 -4
- package/dist/{chunk-ZNXU4E6A.cjs → chunk-OSLI2SCA.cjs} +83 -72
- package/dist/{chunk-HLYRXN2I.cjs → chunk-OUOUPA37.cjs} +6 -1
- package/dist/{chunk-YIGUFJMR.cjs → chunk-OVSK47CZ.cjs} +6 -1
- package/dist/{chunk-ATYTLVSI.cjs → chunk-OX63SW6N.cjs} +7 -1
- package/dist/{chunk-GTHBWZUK.mjs → chunk-OZAVCLXY.mjs} +1 -1
- package/dist/{chunk-YKHRCY4T.cjs → chunk-P2LSRUQB.cjs} +6 -1
- package/dist/{chunk-XJDB564A.cjs → chunk-P4ZLFUNB.cjs} +7 -2
- package/dist/{chunk-2OFP3IVA.cjs → chunk-P5RNGH52.cjs} +32 -18
- package/dist/{chunk-NZRAUCUL.cjs → chunk-PATIHHC7.cjs} +26 -20
- package/dist/{chunk-6FXBJPF5.cjs → chunk-PCF54MSR.cjs} +6 -1
- package/dist/{chunk-52Q4OB4A.cjs → chunk-PFVNPOKN.cjs} +21 -7
- package/dist/{chunk-GVYZCJZH.cjs → chunk-PHYSFHJK.cjs} +6 -1
- package/dist/{chunk-4DCWVSL2.cjs → chunk-PHZ7MLRQ.cjs} +6 -1
- package/dist/{chunk-PCAEJNQF.cjs → chunk-PNMRXZS5.cjs} +13 -9
- package/dist/{chunk-HS4JPIGR.cjs → chunk-PRKFECGT.cjs} +7 -3
- package/dist/chunk-PTG5BEMG.mjs +47 -0
- package/dist/{chunk-YUCU6XB4.cjs → chunk-PYPHM7AS.cjs} +9 -4
- package/dist/{chunk-YNPVG2GG.mjs → chunk-PZ5ZJAAO.mjs} +2 -2
- package/dist/{chunk-H7OFZJCV.cjs → chunk-QBMMQS25.cjs} +14 -8
- package/dist/{chunk-Y2FEFQAY.cjs → chunk-QCVP22KW.cjs} +8 -5
- package/dist/{chunk-J3GFOQOL.cjs → chunk-QGJL7EPX.cjs} +13 -9
- package/dist/{chunk-2PE5STAR.cjs → chunk-QHHEL4ZO.cjs} +6 -2
- package/dist/{chunk-LTOT5KVJ.mjs → chunk-QKXQFBNL.mjs} +1 -1
- package/dist/{chunk-L6E5BSNU.cjs → chunk-QT7MJL5E.cjs} +7 -3
- package/dist/{chunk-ERMUL73L.cjs → chunk-QTGYT2DF.cjs} +6 -1
- package/dist/{chunk-WBTHHTBO.cjs → chunk-QW5I5D5T.cjs} +6 -1
- package/dist/{chunk-IIHZ2BEE.cjs → chunk-QZRFEHMS.cjs} +15 -11
- package/dist/{chunk-HXNLKCWH.cjs → chunk-QZVPBDF7.cjs} +6 -1
- package/dist/{chunk-JH4CDG4G.cjs → chunk-R6GOH5CH.cjs} +18 -14
- package/dist/{chunk-2BEGVSDF.cjs → chunk-RBDAW6IZ.cjs} +7 -3
- package/dist/{chunk-HVGINJTO.mjs → chunk-RDT2LJES.mjs} +77 -40
- package/dist/{chunk-PLJMEUAN.cjs → chunk-RFKPIAOF.cjs} +9 -1
- package/dist/{chunk-WPURVYXT.cjs → chunk-RGIHE6YL.cjs} +6 -2
- package/dist/{chunk-6B44ZU5P.cjs → chunk-RHORD2K2.cjs} +19 -15
- package/dist/{chunk-7MMDEIVC.mjs → chunk-RKWZ6F5D.mjs} +2 -2
- package/dist/{chunk-OCS3PSYR.cjs → chunk-RLC7NNTA.cjs} +6 -1
- package/dist/{chunk-WEZTGM7N.cjs → chunk-RMLXUVR5.cjs} +11 -9
- package/dist/{chunk-Q637AXGZ.mjs → chunk-RP55BUJM.mjs} +103 -20
- package/dist/{chunk-STF6VDYQ.cjs → chunk-RQSPBWXJ.cjs} +6 -1
- package/dist/{chunk-RWR7SMD7.cjs → chunk-S2QSTMBE.cjs} +7 -3
- package/dist/{chunk-GCJ4GNMC.cjs → chunk-SGBEJBBB.cjs} +8 -4
- package/dist/chunk-SGRWZEQC.cjs +44 -0
- package/dist/{chunk-BW563VZZ.mjs → chunk-SIHHYNX4.mjs} +1 -1
- package/dist/{chunk-NDMPGFKL.cjs → chunk-SIQPXYBB.cjs} +6 -1
- package/dist/{chunk-2HTNASSB.cjs → chunk-SM4Y7CL4.cjs} +10 -6
- package/dist/{chunk-UNJZGVPU.cjs → chunk-SQ5O5EDN.cjs} +6 -1
- package/dist/{chunk-A25FXJ7D.cjs → chunk-SWOJU7LI.cjs} +6 -1
- package/dist/{chunk-BNH53KOT.cjs → chunk-SZBBBLLS.cjs} +6 -1
- package/dist/{chunk-EXPVSFAG.cjs → chunk-T4VF6BYV.cjs} +50 -41
- package/dist/{chunk-ML4TOUZP.cjs → chunk-T4YCWRCJ.cjs} +6 -1
- package/dist/{chunk-NDOE76QC.cjs → chunk-TDAH76RR.cjs} +8 -4
- package/dist/{chunk-D22BUQKW.cjs → chunk-TFCBJFP7.cjs} +6 -1
- package/dist/{chunk-NWF2FTFV.mjs → chunk-TP3ISVRU.mjs} +2 -9
- package/dist/{chunk-3EIPOTZV.cjs → chunk-TP7JAC3T.cjs} +6 -2
- package/dist/{chunk-FB4CWSC2.cjs → chunk-TSLXAEGM.cjs} +16 -12
- package/dist/{chunk-5LJF4KUZ.cjs → chunk-U2HFXURZ.cjs} +19 -9
- package/dist/{chunk-SHD265HW.cjs → chunk-U3NUGF2E.cjs} +7 -1
- package/dist/{chunk-SVXOCTQ2.cjs → chunk-UARKTC55.cjs} +6 -1
- package/dist/{chunk-UZM3PDKK.cjs → chunk-UGL4BDNB.cjs} +27 -3
- package/dist/{chunk-GBMWLDCC.cjs → chunk-UHTXBC4Q.cjs} +7 -1
- package/dist/{chunk-47JV57DA.cjs → chunk-UOFTT6S4.cjs} +6 -1
- package/dist/{chunk-NNNMFSXG.mjs → chunk-V36K4TSU.mjs} +2 -2
- package/dist/{chunk-I2RBHZF7.cjs → chunk-VB7P66Q4.cjs} +6 -1
- package/dist/{chunk-BIAGSYIZ.cjs → chunk-VD7ENQP2.cjs} +54 -47
- package/dist/{chunk-J2EKGR6E.cjs → chunk-VFZQXADS.cjs} +719 -634
- package/dist/{chunk-NLBHLPEO.cjs → chunk-VIDUNAQE.cjs} +6 -1
- package/dist/{chunk-VM57CK74.cjs → chunk-VNWKJOJF.cjs} +6 -1
- package/dist/{chunk-MPU5DOXX.cjs → chunk-VUCDMV3Q.cjs} +6 -1
- package/dist/{chunk-M4YXD6MD.cjs → chunk-VWPGK6UV.cjs} +837 -769
- package/dist/{chunk-L2GUEYHR.cjs → chunk-VZ2P6GRC.cjs} +8 -1
- package/dist/{chunk-3SPECQXI.cjs → chunk-W4KSV6GX.cjs} +13 -9
- package/dist/{chunk-CHOOBTDD.cjs → chunk-W4WFKRLR.cjs} +17 -13
- package/dist/chunk-W7BMZI3I.cjs +6 -0
- package/dist/{chunk-SNP33A33.cjs → chunk-WCPGU6J6.cjs} +6 -1
- package/dist/{chunk-2OR5WAD5.cjs → chunk-WFNL24R6.cjs} +58 -43
- package/dist/{chunk-XOFJUSWC.cjs → chunk-WJ5ADUI2.cjs} +18 -14
- package/dist/{chunk-SPKZCFPH.mjs → chunk-WOPQQCP3.mjs} +5 -5
- package/dist/{chunk-ZSVFI7JM.cjs → chunk-WXPY5FRF.cjs} +23 -18
- package/dist/{chunk-JCYDWJVO.cjs → chunk-WZSLDPVZ.cjs} +13 -9
- package/dist/{chunk-O5YM6GU3.mjs → chunk-X2TC6PBK.mjs} +1 -1
- package/dist/{chunk-BSX5OGSD.cjs → chunk-XE3E4MER.cjs} +24 -20
- package/dist/{chunk-3BIASUGR.cjs → chunk-XEPUUTGC.cjs} +6 -1
- package/dist/{chunk-HQKCSJEH.cjs → chunk-XH4GQ7MT.cjs} +17 -10
- package/dist/{chunk-5AMH6AFA.cjs → chunk-XK7SRVHC.cjs} +15 -11
- package/dist/{chunk-WKVYF2B5.cjs → chunk-XSJYXUY6.cjs} +6 -1
- package/dist/{chunk-5DX3O6TT.cjs → chunk-XSLYRNNA.cjs} +8 -4
- package/dist/{chunk-UUQNJDGH.cjs → chunk-XTQPYWQW.cjs} +6 -1
- package/dist/{chunk-3HLQTOVU.cjs → chunk-XVD5Y6S4.cjs} +6 -1
- package/dist/{chunk-7Q2YWZF7.cjs → chunk-XXBWKAJF.cjs} +14 -10
- package/dist/{chunk-YDXLC4DW.cjs → chunk-XZ6L3FUU.cjs} +6 -1
- package/dist/{chunk-FZ7OUN5M.cjs → chunk-Y3HLU2XL.cjs} +6 -2
- package/dist/{chunk-I2BYNELA.cjs → chunk-Y6WRVFD6.cjs} +9 -5
- package/dist/{chunk-OOZEU5KK.cjs → chunk-YC3LKWJO.cjs} +6 -1
- package/dist/{chunk-SXXSQVKK.cjs → chunk-YCIFGYBY.cjs} +13 -8
- package/dist/{chunk-CYOTNHDF.cjs → chunk-YHALJBYT.cjs} +6 -2
- package/dist/{chunk-WOAXQ5MZ.cjs → chunk-YLEL4ZRQ.cjs} +18 -14
- package/dist/{chunk-WEGAVN37.cjs → chunk-YMJK6VWQ.cjs} +6 -1
- package/dist/{chunk-2HW5LWAH.cjs → chunk-YQ5NVEFS.cjs} +6 -1
- package/dist/{chunk-AQLHD6HZ.cjs → chunk-YQXLBYY2.cjs} +20 -11
- package/dist/{chunk-IBEHVSU4.cjs → chunk-YUV5XXDC.cjs} +6 -1
- package/dist/{chunk-PWMJBCAN.cjs → chunk-YV47TSSB.cjs} +7 -3
- package/dist/{chunk-X333W5KV.cjs → chunk-YZMSJRM5.cjs} +6 -1
- package/dist/{chunk-VFMHE5D3.cjs → chunk-Z23OCU33.cjs} +29 -25
- package/dist/{chunk-DBYNZIIQ.cjs → chunk-Z2JQR56W.cjs} +6 -1
- package/dist/chunk-Z7YIQ7AJ.cjs +16 -0
- package/dist/{chunk-RTAWQXME.cjs → chunk-ZCT6B5PQ.cjs} +242 -145
- package/dist/{chunk-P2TGLGRR.mjs → chunk-ZF7N222A.mjs} +2 -2
- package/dist/{chunk-RK3YYUX6.cjs → chunk-ZKVA2TV6.cjs} +6 -1
- package/dist/{chunk-SAPG45RA.cjs → chunk-ZPZGC6OD.cjs} +31 -27
- package/dist/{chunk-DV52ZS53.cjs → chunk-ZRRNF26T.cjs} +6 -2
- package/dist/{chunk-26ZTI2ZO.mjs → chunk-ZRTBDHO2.mjs} +19 -14
- package/dist/{chunk-PO5MXV5X.cjs → chunk-ZSSBEPN4.cjs} +6 -1
- package/dist/{chunk-TWFJJPE7.cjs → chunk-ZTNU4XCC.cjs} +42 -38
- package/dist/{chunk-V5FEFFHV.mjs → chunk-ZVEKOMZS.mjs} +1 -1
- package/dist/{cli-runtime.d-oUiNuspW.d.mts → cli-runtime.d-LwIb0swO.d.mts} +5 -5
- package/dist/{cli-runtime.d-Dbl-gIoz.d.ts → cli-runtime.d-Vvxf-Z8a.d.ts} +5 -5
- package/dist/client/lifecycle.cjs +8 -3
- package/dist/client/lifecycle.mjs +1 -1
- package/dist/{client-component.d-DaUqOhZT.d.mts → client-component.d-34DDMZcl.d.mts} +1 -1
- package/dist/{client-component.d-CT4q7tmy.d.ts → client-component.d-DT5OKBZu.d.ts} +1 -1
- package/dist/client-plugins.cjs +8 -3
- package/dist/{client-plugins.d-BfGTqbAH.d.mts → client-plugins.d-D7k9t9Ge.d.mts} +31 -12
- package/dist/{client-plugins.d-24qhjX8c.d.ts → client-plugins.d-D9CnUvZ5.d.ts} +31 -12
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client-plugins.mjs +1 -1
- package/dist/client.cjs +51 -51
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +1 -1
- package/dist/config.cjs +3 -3
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/cron.cjs +9 -9
- package/dist/cron.mjs +1 -1
- package/dist/deferred.cjs +3 -3
- package/dist/deferred.mjs +1 -1
- package/dist/deployment.cjs +3 -3
- package/dist/deployment.mjs +1 -1
- package/dist/desktop.cjs +4 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/desktop.mjs +1 -1
- package/dist/{dev-guard-VIEEA4LS.cjs → dev-guard-M3ZCDWCK.cjs} +14 -11
- package/dist/{dev-guard-K3GJDPEQ.mjs → dev-guard-TFVWJNIB.mjs} +2 -2
- package/dist/{devtools-5WDQQDTA.cjs → devtools-IUU4SWQL.cjs} +78 -72
- package/dist/{devtools-DPYIYHTI.mjs → devtools-R77KAJA4.mjs} +11 -8
- package/dist/{devtools-client-BKBCCORT.cjs → devtools-client-3K67NMWA.cjs} +7 -4
- package/dist/{devtools-client-L4MUWD6K.mjs → devtools-client-WAMA6Q77.mjs} +1 -1
- package/dist/{devtools-ui-C2EMF2SO.cjs → devtools-ui-TPBPQEEB.cjs} +4 -1
- package/dist/{devtools-ui-BOG33MT5.mjs → devtools-ui-UYEVDADD.mjs} +1 -1
- package/dist/docs.cjs +73 -72
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +9 -8
- package/dist/env-types.cjs +4 -4
- package/dist/env-types.mjs +1 -1
- package/dist/env.cjs +4 -4
- package/dist/env.mjs +1 -1
- package/dist/environment/vite.cjs +17 -16
- package/dist/environment/vite.d.mts +1 -0
- package/dist/environment/vite.d.ts +1 -0
- package/dist/environment/vite.mjs +6 -5
- package/dist/environment.cjs +3 -3
- package/dist/environment.mjs +1 -1
- package/dist/font.cjs +3 -3
- package/dist/font.mjs +1 -1
- package/dist/{handler.d-Oca5kNSz.d.ts → handler.d-DbZvbwNi.d.ts} +1 -1
- package/dist/{handler.d-GfNuz57p.d.mts → handler.d-fxTjv3Nn.d.mts} +1 -1
- package/dist/headers.cjs +6 -6
- package/dist/{headers.d-C_lsQIWA.d.mts → headers.d-OBHpGTF_.d.mts} +1 -1
- package/dist/{headers.d-b8gHJDvu.d.ts → headers.d-oeWybIk8.d.ts} +1 -1
- package/dist/headers.mjs +1 -1
- package/dist/i18n/client.cjs +23 -20
- package/dist/i18n/client.mjs +1 -1
- package/dist/i18n/index.cjs +12 -7
- package/dist/i18n/index.mjs +1 -1
- package/dist/i18n/server.cjs +11 -11
- package/dist/i18n/server.mjs +1 -1
- package/dist/image/server.cjs +8 -8
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +21 -18
- package/dist/image/sharp.mjs +1 -1
- package/dist/image.cjs +7 -4
- package/dist/image.mjs +1 -1
- package/dist/index.cjs +229 -216
- package/dist/{index.d-Ckv6kHFm.d.ts → index.d-BM-dKdzH.d.ts} +1 -1
- package/dist/{index.d-BLtjh1aS.d.mts → index.d-CRrPQwlO.d.mts} +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.mjs +42 -41
- package/dist/instrumentation.cjs +5 -5
- package/dist/instrumentation.mjs +1 -1
- package/dist/integrations/orm.cjs +7 -7
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations/orm.mjs +3 -3
- package/dist/integrations.cjs +22 -22
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.cjs +14 -14
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +187 -181
- package/dist/internal/build-runtime.d.mts +5 -5
- package/dist/internal/build-runtime.d.ts +5 -5
- package/dist/internal/build-runtime.mjs +36 -35
- package/dist/internal/cli-runtime.cjs +106 -100
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +18 -17
- package/dist/internal/client-error-overlay.cjs +12 -9
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +37 -26
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/client-runtime.mjs +1 -1
- package/dist/internal/compression-runtime.cjs +4 -4
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/compression-runtime.mjs +1 -1
- package/dist/internal/config-runtime.cjs +86 -82
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +10 -9
- package/dist/internal/desktop-guard.cjs +5 -5
- package/dist/internal/desktop-guard.mjs +1 -1
- package/dist/internal/docs-precompiled-runtime.cjs +10 -7
- package/dist/internal/docs-precompiled-runtime.mjs +1 -1
- package/dist/internal/form-actions-client.cjs +4 -1
- package/dist/internal/form-actions-client.mjs +1 -1
- package/dist/internal/form-actions.cjs +13 -13
- package/dist/internal/form-actions.mjs +1 -1
- package/dist/internal/infra-analytics-runtime.cjs +32 -29
- package/dist/internal/infra-analytics-runtime.mjs +5 -5
- package/dist/internal/island-codec.cjs +4 -4
- package/dist/internal/island-codec.mjs +1 -1
- package/dist/internal/island-value-store.cjs +4 -1
- package/dist/internal/island-value-store.mjs +1 -1
- package/dist/internal/islands-action-client.cjs +10 -10
- package/dist/internal/islands-action-client.mjs +1 -1
- package/dist/internal/islands-boot.cjs +6 -3
- package/dist/internal/islands-boot.mjs +1 -1
- package/dist/internal/islands-runtime.cjs +12 -9
- package/dist/internal/islands-runtime.mjs +2 -2
- package/dist/internal/islands-server-tree.cjs +4 -1
- package/dist/internal/islands-server-tree.mjs +1 -1
- package/dist/internal/islands-server.cjs +9 -6
- package/dist/internal/islands-server.mjs +1 -1
- package/dist/internal/islx-actions-client.cjs +13 -10
- package/dist/internal/islx-actions-client.mjs +1 -1
- package/dist/internal/islx-actions-server.cjs +4 -1
- package/dist/internal/islx-actions-server.mjs +1 -1
- package/dist/internal/islx-client.cjs +7 -4
- package/dist/internal/islx-client.mjs +2 -2
- package/dist/internal/islx-react.cjs +4 -1
- package/dist/internal/islx-server.cjs +4 -1
- package/dist/internal/isolated-boundary.cjs +5 -5
- package/dist/internal/isolated-boundary.mjs +1 -1
- package/dist/internal/metadata-image-runtime.cjs +8 -8
- package/dist/internal/metadata-image-runtime.mjs +1 -1
- package/dist/internal/native-server-fns.cjs +10 -10
- package/dist/internal/native-server-fns.mjs +4 -4
- package/dist/internal/navigation-neutral.cjs +6 -3
- package/dist/internal/navigation-neutral.mjs +1 -1
- package/dist/internal/product-telemetry-runtime.cjs +4 -4
- package/dist/internal/product-telemetry-runtime.mjs +3 -3
- package/dist/internal/production-node-env.cjs +3 -3
- package/dist/internal/production-node-env.mjs +2 -2
- package/dist/internal/production-runtime.cjs +97 -89
- package/dist/internal/production-runtime.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +6 -6
- package/dist/internal/react-cache.cjs +10 -7
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/internal/renderer-islands.cjs +4 -1
- package/dist/internal/renderer-islands.mjs +1 -1
- package/dist/internal/request-cookies.cjs +3 -3
- package/dist/internal/request-cookies.mjs +1 -1
- package/dist/internal/server-fn-transform.cjs +3 -3
- package/dist/internal/server-fn-transform.mjs +1 -1
- package/dist/internal/server-tree.cjs +5 -5
- package/dist/internal/server-tree.mjs +1 -1
- package/dist/internal/spa-router.cjs +20 -20
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/spa-router.mjs +1 -1
- package/dist/internal/start-manifest.cjs +4 -1
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/internal/start-manifest.mjs +1 -1
- package/dist/internal/vercel-edge-middleware.cjs +23 -20
- package/dist/internal/vercel-edge-middleware.mjs +1 -1
- package/dist/json-ld.cjs +4 -1
- package/dist/json-ld.mjs +1 -1
- package/dist/layers-6R55QDT5.cjs +26 -0
- package/dist/{layers-744BBUY5.mjs → layers-O6GUR6LT.mjs} +7 -2
- package/dist/{libsql-http-M6LMNXCN.cjs → libsql-http-5GYGFVGC.cjs} +94 -87
- package/dist/{libsql-http-2QD224YS.mjs → libsql-http-PBJXNEOX.mjs} +1 -1
- package/dist/{manager-7BNSJKME.mjs → manager-EFPBRS3U.mjs} +4 -4
- package/dist/manager-STAB5TVZ.cjs +18 -0
- package/dist/markdown.cjs +12 -12
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.cjs +32 -32
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.mjs +4 -4
- package/dist/mobile.cjs +4 -1
- package/dist/mobile.mjs +1 -1
- package/dist/{modules-3Q2ZCY4Q.mjs → modules-IVJXVV4W.mjs} +1 -1
- package/dist/modules-JDPCBWND.cjs +13 -0
- package/dist/{mount.d-BCS8mD4E.d.mts → mount.d-B7RiwjiO.d.mts} +1 -1
- package/dist/{mount.d-DEX8eref.d.ts → mount.d-TnD-Mebk.d.ts} +1 -1
- package/dist/{native-server-fn-handler-PYK65A46.mjs → native-server-fn-handler-IMLQMSIR.mjs} +1 -1
- package/dist/native-server-fn-handler-U7I6H6MM.cjs +30 -0
- package/dist/{native-specs-A7YOL463.mjs → native-specs-4DOPYSOJ.mjs} +1 -1
- package/dist/native-specs-IXHEIZCD.cjs +15 -0
- package/dist/{native-tree-AO7PQ7FR.mjs → native-tree-2GQMSOLV.mjs} +1 -1
- package/dist/native-tree-PHCV43W4.cjs +28 -0
- package/dist/native.cjs +4 -1
- package/dist/native.mjs +1 -1
- package/dist/{navigation-delegate.d-F83ugsZW.d.mts → navigation-delegate.d-Boz2511c.d.mts} +1 -1
- package/dist/{navigation-delegate.d-Cgi28e5Q.d.ts → navigation-delegate.d-VBCF0EeN.d.ts} +1 -1
- package/dist/navigation.cjs +26 -26
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +1 -1
- package/dist/{nitro-FK3SZM4H.mjs → nitro-6HSEGMWJ.mjs} +2 -2
- package/dist/{nitro-YDFMH5PY.cjs → nitro-K4MCBBB6.cjs} +31 -28
- package/dist/{node-module-bundle-ZWCQJCKA.mjs → node-module-bundle-4IN4YCDV.mjs} +1 -1
- package/dist/node-module-bundle-PHKRIHI6.cjs +15 -0
- package/dist/observability.cjs +3 -3
- package/dist/observability.mjs +1 -1
- package/dist/og.cjs +4 -1
- package/dist/og.mjs +1 -1
- package/dist/platform.cjs +4 -1
- package/dist/platform.mjs +1 -1
- package/dist/{plugin-EVKQZBNW.mjs → plugin-B7I5QVBE.mjs} +2 -2
- package/dist/plugin-QYBJSGHG.cjs +33 -0
- package/dist/plugin.cjs +176 -170
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +30 -29
- package/dist/{port-STMSGUVU.cjs → port-2YV5GBDN.cjs} +13 -10
- package/dist/{port-CEZTV776.mjs → port-4ZIDLV4Z.mjs} +1 -1
- package/dist/query/client.cjs +38 -34
- package/dist/query/client.mjs +1 -1
- package/dist/query/index.cjs +5 -5
- package/dist/query/index.mjs +1 -1
- package/dist/query/parsers.cjs +3 -3
- package/dist/query/parsers.mjs +1 -1
- package/dist/query/server.cjs +8 -5
- package/dist/query/server.mjs +1 -1
- package/dist/{render-plan.d-DCF2GZdD.d.ts → render-plan.d-BrumV_ZE.d.ts} +1 -1
- package/dist/{render-plan.d-BkVY4aFb.d.mts → render-plan.d-BwnmyfNk.d.mts} +1 -1
- package/dist/renderer/none/server.cjs +4 -1
- package/dist/renderer/none/server.mjs +1 -1
- package/dist/renderer/react/client.cjs +4 -1
- package/dist/renderer/react/client.mjs +1 -1
- package/dist/renderer/react/server.cjs +14 -11
- package/dist/renderer/react/server.mjs +1 -1
- package/dist/renderer/react/vite.cjs +4 -1
- package/dist/renderer/react/vite.mjs +1 -1
- package/dist/renderer-client.cjs +67 -64
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +1 -1
- package/dist/renderer.cjs +12 -6
- package/dist/renderer.d.mts +1 -1
- package/dist/renderer.d.ts +1 -1
- package/dist/renderer.mjs +4 -3
- package/dist/request.cjs +9 -4
- package/dist/{request.d-DMPB53-i.d.mts → request.d-Dd5nRTO5.d.mts} +1 -1
- package/dist/{request.d-C5o-4dU2.d.ts → request.d-NUi01-5e.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-DDvArvik.d.mts → route-rendering.d-BK0Pf7_k.d.mts} +1 -1
- package/dist/{route-rendering.d-DfP6zRP7.d.ts → route-rendering.d-CJR5BPXV.d.ts} +1 -1
- package/dist/router.cjs +5 -5
- package/dist/{router.d-s40h7aoS.d.ts → router.d-C-JSFCPU.d.ts} +1 -1
- package/dist/{router.d-1Skf2XCO.d.mts → router.d-CNUS3x1j.d.mts} +1 -1
- package/dist/router.mjs +1 -1
- package/dist/routes.cjs +16 -16
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +1 -1
- package/dist/{rsc-pipeline-O2YMVHUF.mjs → rsc-pipeline-DHISDFT7.mjs} +13 -12
- package/dist/rsc-pipeline-UBWVU3NF.cjs +92 -0
- package/dist/{runtime-K2X3IZAF.mjs → runtime-VUKMY44G.mjs} +16 -13
- package/dist/{runtime-WOTVFYQY.cjs → runtime-XKRQW3YT.cjs} +132 -119
- package/dist/{runtime.d-k-9kFUsM.d.ts → runtime.d-B2T4bM5_.d.ts} +1 -1
- package/dist/{runtime.d-Bykc5Qfg.d.mts → runtime.d-CsOpO6yQ.d.mts} +1 -1
- package/dist/safe-fetch.cjs +4 -4
- package/dist/safe-fetch.mjs +1 -1
- package/dist/{schema-dev-notice-EUPAUJVN.mjs → schema-dev-notice-EZAOFO7A.mjs} +1 -1
- package/dist/{schema-dev-notice-ZSCL47CT.cjs → schema-dev-notice-Y4J5KPEY.cjs} +16 -13
- package/dist/schema.cjs +4 -4
- package/dist/schema.mjs +1 -1
- package/dist/{search-client-GIXIEU75.mjs → search-client-HN3ZY6AK.mjs} +1 -1
- package/dist/search-client-Z7KDVD4C.cjs +15 -0
- package/dist/server-action-security.cjs +10 -10
- package/dist/server-action-security.mjs +1 -1
- package/dist/{server-components-status.d-DLNd1C5j.d.ts → server-components-status.d-Cc5rir0l.d.mts} +2 -2
- package/dist/{server-components-status.d-D-HixBe0.d.mts → server-components-status.d-DOYt4E_Q.d.ts} +2 -2
- package/dist/server-fn-client.cjs +4 -4
- package/dist/server-fn-client.mjs +1 -1
- package/dist/server-fn.cjs +17 -17
- package/dist/server-fn.mjs +1 -1
- package/dist/server-plugins.cjs +21 -16
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-plugins.mjs +1 -1
- package/dist/server-query-client.cjs +10 -10
- package/dist/server-query-client.mjs +1 -1
- package/dist/server-query.cjs +19 -19
- package/dist/server-query.mjs +1 -1
- package/dist/server.cjs +236 -224
- package/dist/server.d.mts +12 -12
- package/dist/server.d.ts +12 -12
- package/dist/server.mjs +37 -34
- package/dist/session-J7NTZI56.cjs +24 -0
- package/dist/{session-4IB34X35.mjs → session-ZFM3RDG2.mjs} +3 -3
- package/dist/{spa-router.d-Dl-EJeJT.d.ts → spa-router.d-C7FcpLxU.d.ts} +2 -2
- package/dist/{spa-router.d-DIlXwm00.d.mts → spa-router.d-Cq5UFJvq.d.mts} +2 -2
- package/dist/{ssg.d-D2ZV0bhs.d.mts → ssg.d-BzNZemk7.d.mts} +2 -2
- package/dist/{ssg.d-bE-ylg0e.d.ts → ssg.d-DUhacIxj.d.ts} +2 -2
- package/dist/storage.cjs +4 -4
- package/dist/storage.mjs +2 -2
- package/dist/{store-core.d-BmdnMopD.d.ts → store-core.d-BX3yXrxA.d.ts} +2 -2
- package/dist/{store-core.d-DPsCYzV7.d.mts → store-core.d-DbUAtSBK.d.mts} +2 -2
- package/dist/testing.cjs +65 -62
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +5 -5
- package/dist/theme/client.cjs +5 -5
- package/dist/theme/client.mjs +1 -1
- package/dist/theme/index.cjs +4 -4
- package/dist/theme/index.mjs +1 -1
- package/dist/theme/runtime.cjs +3 -3
- package/dist/theme/runtime.mjs +1 -1
- package/dist/theme/server.cjs +8 -8
- package/dist/theme/server.mjs +1 -1
- package/dist/{utils.d-BFZQcBZV.d.ts → utils.d-BhJJEXzo.d.ts} +1 -1
- package/dist/{utils.d-nM3OHKq5.d.mts → utils.d-NOMkLFpC.d.mts} +1 -1
- package/dist/version.cjs +3 -3
- package/dist/version.mjs +2 -2
- package/dist/vite.cjs +169 -168
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +30 -29
- package/dist/workflows.cjs +14 -14
- package/dist/workflows.mjs +2 -2
- package/package.json +5 -5
- package/LICENSE +0 -22
- package/dist/agent-mcp-handler-EXOG55M4.cjs +0 -21
- package/dist/analyzer-OWIHFO5M.cjs +0 -17
- package/dist/chunk-3376ZTRC.cjs +0 -1
- package/dist/chunk-K5NI5YQR.cjs +0 -1
- package/dist/chunk-MCJLA63J.cjs +0 -1
- package/dist/chunk-NOSLIDSG.cjs +0 -9
- package/dist/chunk-PAKB6JHX.cjs +0 -40
- package/dist/chunk-YTAABQEV.cjs +0 -1
- package/dist/layers-XLOMMQP7.cjs +0 -21
- package/dist/manager-37UJPUN4.cjs +0 -18
- package/dist/modules-KDHFBQ6L.cjs +0 -13
- package/dist/native-server-fn-handler-57TCQPSM.cjs +0 -30
- package/dist/native-specs-JDPH26AO.cjs +0 -15
- package/dist/native-tree-52CUAP3N.cjs +0 -28
- package/dist/node-module-bundle-TNSY5PAC.cjs +0 -15
- package/dist/plugin-MWO3G2XM.cjs +0 -33
- package/dist/rsc-pipeline-SFQSMVI7.cjs +0 -91
- package/dist/search-client-A7YJT7JZ.cjs +0 -15
- package/dist/session-MOYQJ7E6.cjs +0 -24
- package/dist/{chunk-IVP5Q4BX.mjs → chunk-6IKUYFNQ.mjs} +0 -0
- package/dist/{chunk-D7LXBLUW.mjs → chunk-FYTZZM5U.mjs} +3 -3
- /package/dist/{chunk-E72GG355.mjs → chunk-HDZ2AMDD.mjs} +0 -0
- /package/dist/{chunk-URBP6DLH.mjs → chunk-LQZXCSYG.mjs} +0 -0
- /package/dist/{chunk-M6AJZ4XR.mjs → chunk-QNJUQIUZ.mjs} +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkADCVSTFVcjs = require('./chunk-ADCVSTFV.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkYQXLBYY2cjs = require('./chunk-YQXLBYY2.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkT4VF6BYVcjs = require('./chunk-T4VF6BYV.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkWXPY5FRFcjs = require('./chunk-WXPY5FRF.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkEWPH5IOCcjs = require('./chunk-EWPH5IOC.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkGYH2B4YQcjs = require('./chunk-GYH2B4YQ.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -56,10 +56,10 @@ var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
var
|
|
59
|
+
var _chunkIGBQSUT5cjs = require('./chunk-IGBQSUT5.cjs');
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
var
|
|
62
|
+
var _chunkMZG5M4JScjs = require('./chunk-MZG5M4JS.cjs');
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
@@ -67,16 +67,16 @@ var _chunkSCE7VWPNcjs = require('./chunk-SCE7VWPN.cjs');
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var _chunkR6GOH5CHcjs = require('./chunk-R6GOH5CH.cjs');
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
var
|
|
75
|
+
var _chunk4USE4SEUcjs = require('./chunk-4USE4SEU.cjs');
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
var
|
|
79
|
+
var _chunkYLEL4ZRQcjs = require('./chunk-YLEL4ZRQ.cjs');
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
@@ -106,33 +106,33 @@ var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
|
|
109
|
-
var _chunkRTAWQXMEcjs = require('./chunk-RTAWQXME.cjs');
|
|
110
109
|
|
|
111
110
|
|
|
111
|
+
var _chunkZCT6B5PQcjs = require('./chunk-ZCT6B5PQ.cjs');
|
|
112
112
|
|
|
113
|
-
var _chunk5AMH6AFAcjs = require('./chunk-5AMH6AFA.cjs');
|
|
114
113
|
|
|
115
114
|
|
|
116
|
-
var
|
|
115
|
+
var _chunkXK7SRVHCcjs = require('./chunk-XK7SRVHC.cjs');
|
|
117
116
|
|
|
118
117
|
|
|
118
|
+
var _chunkP4ZLFUNBcjs = require('./chunk-P4ZLFUNB.cjs');
|
|
119
119
|
|
|
120
|
-
var _chunkL2GUEYHRcjs = require('./chunk-L2GUEYHR.cjs');
|
|
121
120
|
|
|
122
121
|
|
|
123
|
-
var
|
|
122
|
+
var _chunkVZ2P6GRCcjs = require('./chunk-VZ2P6GRC.cjs');
|
|
124
123
|
|
|
125
124
|
|
|
126
|
-
var
|
|
125
|
+
var _chunkQZRFEHMScjs = require('./chunk-QZRFEHMS.cjs');
|
|
127
126
|
|
|
128
127
|
|
|
128
|
+
var _chunkRQSPBWXJcjs = require('./chunk-RQSPBWXJ.cjs');
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
var _chunkEZUTDTFMcjs = require('./chunk-EZUTDTFM.cjs');
|
|
134
133
|
|
|
135
134
|
|
|
135
|
+
var _chunkERSLQ4C7cjs = require('./chunk-ERSLQ4C7.cjs');
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
|
|
@@ -140,21 +140,21 @@ var _chunkEZUTDTFMcjs = require('./chunk-EZUTDTFM.cjs');
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
|
|
143
|
-
var _chunkDA432P2Fcjs = require('./chunk-DA432P2F.cjs');
|
|
144
143
|
|
|
145
144
|
|
|
145
|
+
var _chunk25CHWAZYcjs = require('./chunk-25CHWAZY.cjs');
|
|
146
146
|
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
|
|
151
|
-
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
152
151
|
|
|
153
152
|
|
|
153
|
+
var _chunkIEZFFXSCcjs = require('./chunk-IEZFFXSC.cjs');
|
|
154
154
|
|
|
155
|
-
var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
156
155
|
|
|
157
156
|
|
|
157
|
+
var _chunkPFVNPOKNcjs = require('./chunk-PFVNPOKN.cjs');
|
|
158
158
|
|
|
159
159
|
|
|
160
160
|
|
|
@@ -167,115 +167,116 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
|
|
170
|
-
var _chunkT7UC2ORAcjs = require('./chunk-T7UC2ORA.cjs');
|
|
171
170
|
|
|
171
|
+
var _chunkLEZJZX4Ccjs = require('./chunk-LEZJZX4C.cjs');
|
|
172
172
|
|
|
173
|
-
var _chunkHQKCSJEHcjs = require('./chunk-HQKCSJEH.cjs');
|
|
174
173
|
|
|
175
174
|
|
|
176
|
-
var
|
|
175
|
+
var _chunkCYUTK4JPcjs = require('./chunk-CYUTK4JP.cjs');
|
|
177
176
|
|
|
178
177
|
|
|
178
|
+
var _chunkXH4GQ7MTcjs = require('./chunk-XH4GQ7MT.cjs');
|
|
179
179
|
|
|
180
|
-
var _chunkWPURVYXTcjs = require('./chunk-WPURVYXT.cjs');
|
|
181
180
|
|
|
181
|
+
var _chunkNMMCBJZMcjs = require('./chunk-NMMCBJZM.cjs');
|
|
182
182
|
|
|
183
|
-
var _chunkJDT733EWcjs = require('./chunk-JDT733EW.cjs');
|
|
184
183
|
|
|
185
184
|
|
|
185
|
+
var _chunkRGIHE6YLcjs = require('./chunk-RGIHE6YL.cjs');
|
|
186
186
|
|
|
187
|
-
var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
188
187
|
|
|
188
|
+
var _chunk27IPPPCVcjs = require('./chunk-27IPPPCV.cjs');
|
|
189
189
|
|
|
190
190
|
|
|
191
191
|
|
|
192
|
+
var _chunkYQ5NVEFScjs = require('./chunk-YQ5NVEFS.cjs');
|
|
192
193
|
|
|
193
194
|
|
|
194
195
|
|
|
195
196
|
|
|
196
|
-
var _chunk5LJF4KUZcjs = require('./chunk-5LJF4KUZ.cjs');
|
|
197
197
|
|
|
198
198
|
|
|
199
|
-
var _chunkPWDBWXQIcjs = require('./chunk-PWDBWXQI.cjs');
|
|
200
199
|
|
|
201
200
|
|
|
202
|
-
var
|
|
201
|
+
var _chunkU2HFXURZcjs = require('./chunk-U2HFXURZ.cjs');
|
|
203
202
|
|
|
204
203
|
|
|
205
|
-
var
|
|
204
|
+
var _chunkLVYUTMW4cjs = require('./chunk-LVYUTMW4.cjs');
|
|
206
205
|
|
|
207
206
|
|
|
207
|
+
var _chunkXE3E4MERcjs = require('./chunk-XE3E4MER.cjs');
|
|
208
208
|
|
|
209
209
|
|
|
210
|
+
var _chunkEGMJ5KEUcjs = require('./chunk-EGMJ5KEU.cjs');
|
|
210
211
|
|
|
211
|
-
var _chunkDVAZ53X6cjs = require('./chunk-DVAZ53X6.cjs');
|
|
212
212
|
|
|
213
213
|
|
|
214
|
-
var _chunkNW3DL2PMcjs = require('./chunk-NW3DL2PM.cjs');
|
|
215
214
|
|
|
216
215
|
|
|
216
|
+
var _chunkN4AM7Q34cjs = require('./chunk-N4AM7Q34.cjs');
|
|
217
217
|
|
|
218
|
-
var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
|
|
219
218
|
|
|
219
|
+
var _chunkOCQSYDMGcjs = require('./chunk-OCQSYDMG.cjs');
|
|
220
220
|
|
|
221
221
|
|
|
222
|
-
var _chunk2BEGVSDFcjs = require('./chunk-2BEGVSDF.cjs');
|
|
223
222
|
|
|
223
|
+
var _chunkYZMSJRM5cjs = require('./chunk-YZMSJRM5.cjs');
|
|
224
224
|
|
|
225
225
|
|
|
226
226
|
|
|
227
|
+
var _chunkRBDAW6IZcjs = require('./chunk-RBDAW6IZ.cjs');
|
|
227
228
|
|
|
228
|
-
var _chunkYDXLC4DWcjs = require('./chunk-YDXLC4DW.cjs');
|
|
229
229
|
|
|
230
230
|
|
|
231
231
|
|
|
232
|
-
var _chunkHS4JPIGRcjs = require('./chunk-HS4JPIGR.cjs');
|
|
233
232
|
|
|
233
|
+
var _chunkXZ6L3FUUcjs = require('./chunk-XZ6L3FUU.cjs');
|
|
234
234
|
|
|
235
235
|
|
|
236
236
|
|
|
237
|
+
var _chunkPRKFECGTcjs = require('./chunk-PRKFECGT.cjs');
|
|
237
238
|
|
|
238
|
-
var _chunkSXXSQVKKcjs = require('./chunk-SXXSQVKK.cjs');
|
|
239
239
|
|
|
240
240
|
|
|
241
241
|
|
|
242
|
-
var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
|
|
243
242
|
|
|
243
|
+
var _chunkYCIFGYBYcjs = require('./chunk-YCIFGYBY.cjs');
|
|
244
244
|
|
|
245
245
|
|
|
246
246
|
|
|
247
|
+
var _chunkIDUGG7VRcjs = require('./chunk-IDUGG7VR.cjs');
|
|
247
248
|
|
|
248
249
|
|
|
249
|
-
var _chunkYUCU6XB4cjs = require('./chunk-YUCU6XB4.cjs');
|
|
250
250
|
|
|
251
251
|
|
|
252
252
|
|
|
253
253
|
|
|
254
|
+
var _chunkPYPHM7AScjs = require('./chunk-PYPHM7AS.cjs');
|
|
254
255
|
|
|
255
256
|
|
|
256
|
-
var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
|
|
257
257
|
|
|
258
258
|
|
|
259
259
|
|
|
260
260
|
|
|
261
|
-
var
|
|
261
|
+
var _chunkGUDYDNKUcjs = require('./chunk-GUDYDNKU.cjs');
|
|
262
262
|
|
|
263
263
|
|
|
264
|
-
var _chunkJRGR5Z4Kcjs = require('./chunk-JRGR5Z4K.cjs');
|
|
265
264
|
|
|
266
265
|
|
|
267
|
-
var
|
|
266
|
+
var _chunkVD7ENQP2cjs = require('./chunk-VD7ENQP2.cjs');
|
|
268
267
|
|
|
269
268
|
|
|
269
|
+
var _chunk6VC7NUY3cjs = require('./chunk-6VC7NUY3.cjs');
|
|
270
270
|
|
|
271
|
-
var _chunkI2RBHZF7cjs = require('./chunk-I2RBHZF7.cjs');
|
|
272
271
|
|
|
273
272
|
|
|
274
|
-
var
|
|
273
|
+
var _chunkVB7P66Q4cjs = require('./chunk-VB7P66Q4.cjs');
|
|
275
274
|
|
|
276
275
|
|
|
276
|
+
var _chunkWCPGU6J6cjs = require('./chunk-WCPGU6J6.cjs');
|
|
277
277
|
|
|
278
278
|
|
|
279
|
+
var _chunkB2VSX33Tcjs = require('./chunk-B2VSX33T.cjs');
|
|
279
280
|
|
|
280
281
|
|
|
281
282
|
|
|
@@ -285,119 +286,125 @@ var _chunkZMSVKVI3cjs = require('./chunk-ZMSVKVI3.cjs');
|
|
|
285
286
|
|
|
286
287
|
|
|
287
288
|
|
|
288
|
-
var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
|
|
289
289
|
|
|
290
290
|
|
|
291
|
-
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
292
291
|
|
|
293
292
|
|
|
293
|
+
var _chunk7ZDLE77Pcjs = require('./chunk-7ZDLE77P.cjs');
|
|
294
294
|
|
|
295
295
|
|
|
296
|
-
var
|
|
296
|
+
var _chunkH5AC3XSEcjs = require('./chunk-H5AC3XSE.cjs');
|
|
297
297
|
|
|
298
298
|
|
|
299
|
-
var _chunkJYT7AN37cjs = require('./chunk-JYT7AN37.cjs');
|
|
300
299
|
|
|
301
300
|
|
|
301
|
+
var _chunk7GKZDRY2cjs = require('./chunk-7GKZDRY2.cjs');
|
|
302
302
|
|
|
303
|
-
var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
304
303
|
|
|
304
|
+
var _chunkGLP3ID53cjs = require('./chunk-GLP3ID53.cjs');
|
|
305
305
|
|
|
306
306
|
|
|
307
|
-
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
308
307
|
|
|
308
|
+
var _chunkK6LZMZNBcjs = require('./chunk-K6LZMZNB.cjs');
|
|
309
309
|
|
|
310
|
-
var _chunkNOSLIDSGcjs = require('./chunk-NOSLIDSG.cjs');
|
|
311
310
|
|
|
312
311
|
|
|
313
|
-
var
|
|
312
|
+
var _chunkRFKPIAOFcjs = require('./chunk-RFKPIAOF.cjs');
|
|
314
313
|
|
|
315
314
|
|
|
316
|
-
var
|
|
315
|
+
var _chunkZ7YIQ7AJcjs = require('./chunk-Z7YIQ7AJ.cjs');
|
|
317
316
|
|
|
318
317
|
|
|
319
|
-
var
|
|
318
|
+
var _chunkG5KGLMPNcjs = require('./chunk-G5KGLMPN.cjs');
|
|
320
319
|
|
|
321
320
|
|
|
322
|
-
var
|
|
321
|
+
var _chunkJ2JMESBJcjs = require('./chunk-J2JMESBJ.cjs');
|
|
323
322
|
|
|
324
323
|
|
|
324
|
+
var _chunkXSJYXUY6cjs = require('./chunk-XSJYXUY6.cjs');
|
|
325
325
|
|
|
326
326
|
|
|
327
|
+
var _chunkS2QSTMBEcjs = require('./chunk-S2QSTMBE.cjs');
|
|
327
328
|
|
|
328
329
|
|
|
329
330
|
|
|
330
331
|
|
|
331
|
-
var _chunkEUZFBHPPcjs = require('./chunk-EUZFBHPP.cjs');
|
|
332
332
|
|
|
333
333
|
|
|
334
334
|
|
|
335
|
-
var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
|
|
336
335
|
|
|
336
|
+
var _chunkO7B6LJWEcjs = require('./chunk-O7B6LJWE.cjs');
|
|
337
337
|
|
|
338
338
|
|
|
339
339
|
|
|
340
|
+
var _chunkZ2JQR56Wcjs = require('./chunk-Z2JQR56W.cjs');
|
|
340
341
|
|
|
341
342
|
|
|
342
|
-
var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
|
|
343
343
|
|
|
344
344
|
|
|
345
345
|
|
|
346
|
-
var _chunk7Q2YWZF7cjs = require('./chunk-7Q2YWZF7.cjs');
|
|
347
346
|
|
|
347
|
+
var _chunkVIDUNAQEcjs = require('./chunk-VIDUNAQE.cjs');
|
|
348
348
|
|
|
349
349
|
|
|
350
|
-
var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
351
350
|
|
|
351
|
+
var _chunkXXBWKAJFcjs = require('./chunk-XXBWKAJF.cjs');
|
|
352
352
|
|
|
353
|
-
var _chunkDXUXQP2Tcjs = require('./chunk-DXUXQP2T.cjs');
|
|
354
353
|
|
|
355
354
|
|
|
356
|
-
var
|
|
355
|
+
var _chunk6FIY4KBCcjs = require('./chunk-6FIY4KBC.cjs');
|
|
357
356
|
|
|
358
357
|
|
|
359
|
-
var
|
|
358
|
+
var _chunkN4C72FCDcjs = require('./chunk-N4C72FCD.cjs');
|
|
360
359
|
|
|
361
360
|
|
|
361
|
+
var _chunkQZVPBDF7cjs = require('./chunk-QZVPBDF7.cjs');
|
|
362
362
|
|
|
363
363
|
|
|
364
|
+
var _chunkCUW7K4AUcjs = require('./chunk-CUW7K4AU.cjs');
|
|
364
365
|
|
|
365
366
|
|
|
366
367
|
|
|
367
368
|
|
|
368
|
-
var _chunk2RSVYJT6cjs = require('./chunk-2RSVYJT6.cjs');
|
|
369
369
|
|
|
370
370
|
|
|
371
371
|
|
|
372
372
|
|
|
373
|
-
var
|
|
373
|
+
var _chunkIBZW57NWcjs = require('./chunk-IBZW57NW.cjs');
|
|
374
374
|
|
|
375
375
|
|
|
376
376
|
|
|
377
377
|
|
|
378
|
+
var _chunk7MQMWGTLcjs = require('./chunk-7MQMWGTL.cjs');
|
|
378
379
|
|
|
379
|
-
var _chunkGYJT2U7Jcjs = require('./chunk-GYJT2U7J.cjs');
|
|
380
380
|
|
|
381
381
|
|
|
382
382
|
|
|
383
383
|
|
|
384
|
+
var _chunkKAD5WBY4cjs = require('./chunk-KAD5WBY4.cjs');
|
|
384
385
|
|
|
385
|
-
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
386
386
|
|
|
387
387
|
|
|
388
388
|
|
|
389
389
|
|
|
390
|
+
var _chunkTFCBJFP7cjs = require('./chunk-TFCBJFP7.cjs');
|
|
390
391
|
|
|
391
|
-
var _chunkML4TOUZPcjs = require('./chunk-ML4TOUZP.cjs');
|
|
392
392
|
|
|
393
393
|
|
|
394
394
|
|
|
395
|
-
var _chunk3BIASUGRcjs = require('./chunk-3BIASUGR.cjs');
|
|
396
395
|
|
|
396
|
+
var _chunkT4YCWRCJcjs = require('./chunk-T4YCWRCJ.cjs');
|
|
397
397
|
|
|
398
|
-
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
var _chunkXEPUUTGCcjs = require('./chunk-XEPUUTGC.cjs');
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
var _chunkUGL4BDNBcjs = require('./chunk-UGL4BDNB.cjs');
|
|
399
405
|
|
|
400
406
|
// src/static-metadata-image.ts
|
|
407
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
401
408
|
var _crypto = require('crypto');
|
|
402
409
|
var _promises = require('fs/promises');
|
|
403
410
|
var _path = require('path'); var path4 = _interopRequireWildcard(_path); var path10 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path);
|
|
@@ -463,6 +470,7 @@ async function readAltText(filePath) {
|
|
|
463
470
|
}
|
|
464
471
|
|
|
465
472
|
// src/routing/route-manager.ts
|
|
473
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
466
474
|
var _fs = require('fs'); var fs2 = _interopRequireWildcard(_fs); var fs7 = _interopRequireWildcard(_fs); var fs5 = _interopRequireWildcard(_fs);
|
|
467
475
|
|
|
468
476
|
function getRouteEntryDirectory(entry) {
|
|
@@ -479,7 +487,7 @@ function getRouteSpecificity(entry) {
|
|
|
479
487
|
});
|
|
480
488
|
}
|
|
481
489
|
function compareRouteEntries(left, right) {
|
|
482
|
-
return
|
|
490
|
+
return _chunkT4YCWRCJcjs.compareRouteSpecificity.call(void 0, getRouteSpecificity(left), getRouteSpecificity(right));
|
|
483
491
|
}
|
|
484
492
|
var PLAN_SOURCE = /\.(?:[cm]?[jt]sx?|vue|svelte)$/;
|
|
485
493
|
var NODE_MODULES_SEGMENT = `${path4.default.sep}node_modules${path4.default.sep}`;
|
|
@@ -506,7 +514,7 @@ var RouteManager = class _RouteManager {
|
|
|
506
514
|
this.redirects = /* @__PURE__ */ new Map();
|
|
507
515
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
508
516
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
509
|
-
this.programmaticClientRoutes =
|
|
517
|
+
this.programmaticClientRoutes = _chunkZCT6B5PQcjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
510
518
|
// The hydration settings each route rule returned, by file.
|
|
511
519
|
this.rendererRouteHydration = /* @__PURE__ */ new Map();
|
|
512
520
|
this.disposeRendererHydration = () => {
|
|
@@ -531,11 +539,13 @@ var RouteManager = class _RouteManager {
|
|
|
531
539
|
this.planGroupSources = /* @__PURE__ */ new WeakMap();
|
|
532
540
|
// Whether each package directory under `node_modules` a plan read from links to a workspace.
|
|
533
541
|
this.linkedPackages = /* @__PURE__ */ new Map();
|
|
542
|
+
// The source files plans read through a workspace package's `node_modules` link.
|
|
543
|
+
this.linkedSources = /* @__PURE__ */ new Set();
|
|
534
544
|
// Source files edited since the last plan; null when the next plan must recompute every module.
|
|
535
545
|
this.editedSources = null;
|
|
536
546
|
this.config = config;
|
|
537
547
|
this.viteServer = viteServer;
|
|
538
|
-
if (viteServer)
|
|
548
|
+
if (viteServer) _chunkPYPHM7AScjs.trackProgrammaticRouteSources.call(void 0, );
|
|
539
549
|
}
|
|
540
550
|
setRendererRuntime(rendererRuntime) {
|
|
541
551
|
this.rendererRuntime = rendererRuntime;
|
|
@@ -598,8 +608,8 @@ var RouteManager = class _RouteManager {
|
|
|
598
608
|
});
|
|
599
609
|
}
|
|
600
610
|
}
|
|
601
|
-
this.disposeRendererHydration =
|
|
602
|
-
|
|
611
|
+
this.disposeRendererHydration = _chunkZCT6B5PQcjs.setFarmRendererHydrationScope.call(void 0,
|
|
612
|
+
_chunkPFVNPOKNcjs.getFarmSourceRoots.call(void 0, this.config).map((source) => source.root),
|
|
603
613
|
renderer,
|
|
604
614
|
routeModules
|
|
605
615
|
);
|
|
@@ -630,14 +640,14 @@ var RouteManager = class _RouteManager {
|
|
|
630
640
|
/** Fill this manager's empty route tables. Only a fresh manager made by discoverRoutes runs it. */
|
|
631
641
|
async discoverInto() {
|
|
632
642
|
const programmaticClientRoutes = [];
|
|
633
|
-
for (const source of
|
|
643
|
+
for (const source of _chunkPFVNPOKNcjs.getFarmSourceRoots.call(void 0, this.config)) {
|
|
634
644
|
await this.discoverFileRoutes(source);
|
|
635
645
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
636
646
|
}
|
|
637
|
-
this.programmaticClientRoutes =
|
|
647
|
+
this.programmaticClientRoutes = _chunkZCT6B5PQcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
638
648
|
for (const slot of this.routeSlots.values()) {
|
|
639
|
-
if (slot.interception && !this.pageRouteShapes.has(
|
|
640
|
-
throw new (0,
|
|
649
|
+
if (slot.interception && !this.pageRouteShapes.has(_chunkT4YCWRCJcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
650
|
+
throw new (0, _chunkT4YCWRCJcjs.AmbiguousRouteError)(
|
|
641
651
|
`Intercepting route slot "${slot.name}" targets "${slot.pattern}", but no canonical page exists for that URL`
|
|
642
652
|
);
|
|
643
653
|
}
|
|
@@ -653,18 +663,18 @@ var RouteManager = class _RouteManager {
|
|
|
653
663
|
)
|
|
654
664
|
);
|
|
655
665
|
this.orderedLayouts = Array.from(this.layouts.values()).sort(
|
|
656
|
-
(left, right) =>
|
|
657
|
-
).map((entry) => ({ entry, groupScope:
|
|
666
|
+
(left, right) => _chunkIGBQSUT5cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkIGBQSUT5cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
|
|
667
|
+
).map((entry) => ({ entry, groupScope: _chunkIGBQSUT5cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
|
|
658
668
|
for (const slot of this.routeSlots.values()) {
|
|
659
669
|
if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
|
|
660
670
|
this.routeSlotOwnerSegments.set(
|
|
661
671
|
slot.ownerPattern,
|
|
662
|
-
|
|
672
|
+
_chunk7ZDLE77Pcjs.parseRoutePath.call(void 0, `${slot.ownerPattern}/page.tsx`).segments
|
|
663
673
|
);
|
|
664
674
|
}
|
|
665
675
|
}
|
|
666
676
|
if (process.env.FARM_VERBOSE) {
|
|
667
|
-
|
|
677
|
+
_chunk7ZDLE77Pcjs.logger.info(
|
|
668
678
|
`Discovered ${this.routes.size} pages, ${this.layouts.size} layouts, and ${this.metadataRoutes.size} metadata routes`
|
|
669
679
|
);
|
|
670
680
|
}
|
|
@@ -678,7 +688,7 @@ var RouteManager = class _RouteManager {
|
|
|
678
688
|
matchRoute(pathname, options = {}) {
|
|
679
689
|
const routePathname = this.toRoutePathname(pathname);
|
|
680
690
|
const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
|
|
681
|
-
const pathParts =
|
|
691
|
+
const pathParts = _chunk7ZDLE77Pcjs.splitRoutePath.call(void 0, normalizedPath);
|
|
682
692
|
const trimmedPathname = routePathname.replace(/\/+$/, "");
|
|
683
693
|
const hasEmptySegment = trimmedPathname.includes("//") || trimmedPathname === "" && routePathname.length > 1;
|
|
684
694
|
let matchedRoute = null;
|
|
@@ -687,7 +697,7 @@ var RouteManager = class _RouteManager {
|
|
|
687
697
|
if (hasEmptySegment && !routeEntry.route.segments.some((segment) => segment.isDynamic)) {
|
|
688
698
|
continue;
|
|
689
699
|
}
|
|
690
|
-
const match =
|
|
700
|
+
const match = _chunk7ZDLE77Pcjs.matchRouteParts.call(void 0, pathParts, routeEntry.route.segments);
|
|
691
701
|
if (match.matches) {
|
|
692
702
|
matchedRoute = routeEntry;
|
|
693
703
|
params = match.params;
|
|
@@ -716,7 +726,7 @@ var RouteManager = class _RouteManager {
|
|
|
716
726
|
getSearchPreserveRoutes() {
|
|
717
727
|
const routes = [];
|
|
718
728
|
for (const entry of this.routes.values()) {
|
|
719
|
-
const preserve = _optionalChain([
|
|
729
|
+
const preserve = _optionalChain([_chunkPYPHM7AScjs.getProgrammaticRouteSearchClientOptions.call(void 0,
|
|
720
730
|
_optionalChain([this, 'access', _2 => _2.programmaticPages, 'access', _3 => _3.get, 'call', _4 => _4(entry.modulePath), 'optionalAccess', _5 => _5.search])
|
|
721
731
|
), 'optionalAccess', _6 => _6.preserve]);
|
|
722
732
|
if (!_optionalChain([preserve, 'optionalAccess', _7 => _7.length])) continue;
|
|
@@ -745,7 +755,7 @@ var RouteManager = class _RouteManager {
|
|
|
745
755
|
/** The layouts that wrap a registered page, root first. */
|
|
746
756
|
getRouteLayouts(pattern) {
|
|
747
757
|
const routeEntry = this.routes.get(pattern);
|
|
748
|
-
return routeEntry ? this.findMatchingLayouts(
|
|
758
|
+
return routeEntry ? this.findMatchingLayouts(_chunk7ZDLE77Pcjs.splitRoutePath.call(void 0, pattern), routeEntry) : [];
|
|
749
759
|
}
|
|
750
760
|
/** Resolve route rules, inherited layouts, and the page export in precedence order. */
|
|
751
761
|
async resolveRouteRuntimeConfig(pattern) {
|
|
@@ -753,25 +763,25 @@ var RouteManager = class _RouteManager {
|
|
|
753
763
|
if (!routeEntry) {
|
|
754
764
|
throw new Error(`Cannot resolve runtime configuration for unknown route "${pattern}"`);
|
|
755
765
|
}
|
|
756
|
-
const inherited =
|
|
757
|
-
const layouts = this.findMatchingLayouts(
|
|
766
|
+
const inherited = _chunkGUDYDNKUcjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
|
|
767
|
+
const layouts = this.findMatchingLayouts(_chunk7ZDLE77Pcjs.splitRoutePath.call(void 0, pattern), routeEntry);
|
|
758
768
|
const layoutConfigs = [];
|
|
759
769
|
for (const layout of layouts) {
|
|
760
770
|
const layoutModule = await this.loadLayoutModule(layout.modulePath);
|
|
761
771
|
layoutConfigs.push(
|
|
762
|
-
|
|
763
|
-
|
|
772
|
+
_chunkGUDYDNKUcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
|
|
773
|
+
_chunkGUDYDNKUcjs.getFarmRouteRuntimeConfig.call(void 0, layoutModule),
|
|
764
774
|
`Layout "${layout.pattern}"`
|
|
765
775
|
)
|
|
766
776
|
);
|
|
767
777
|
}
|
|
768
778
|
const routeModule = await this.loadRouteModule(routeEntry.modulePath);
|
|
769
|
-
const routeConfig =
|
|
770
|
-
|
|
779
|
+
const routeConfig = _chunkGUDYDNKUcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
|
|
780
|
+
_chunkGUDYDNKUcjs.getFarmRouteRuntimeConfig.call(void 0, routeModule),
|
|
771
781
|
`Route "${pattern}"`
|
|
772
782
|
);
|
|
773
|
-
return
|
|
774
|
-
|
|
783
|
+
return _chunkGUDYDNKUcjs.resolveFarmRouteRuntimeConfig.call(void 0,
|
|
784
|
+
_chunkGUDYDNKUcjs.mergeFarmRouteRuntimeConfigs.call(void 0, inherited, ...layoutConfigs, routeConfig),
|
|
775
785
|
`Route "${pattern}"`
|
|
776
786
|
);
|
|
777
787
|
}
|
|
@@ -798,17 +808,17 @@ var RouteManager = class _RouteManager {
|
|
|
798
808
|
}
|
|
799
809
|
matchRedirect(pathname, search = "") {
|
|
800
810
|
const i18n = this.getI18nConfig();
|
|
801
|
-
const localeMatch = i18n ?
|
|
811
|
+
const localeMatch = i18n ? _chunkKAD5WBY4cjs.resolveFarmLocalePath.call(void 0, pathname, i18n) : void 0;
|
|
802
812
|
const routePathname = _optionalChain([localeMatch, 'optionalAccess', _8 => _8.pathname]) || this.toRoutePathname(pathname);
|
|
803
813
|
const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
|
|
804
|
-
const urlParts =
|
|
814
|
+
const urlParts = _chunk7ZDLE77Pcjs.splitRoutePath.call(void 0, normalizedPath);
|
|
805
815
|
for (const redirectEntry of this.redirects.values()) {
|
|
806
|
-
const match =
|
|
816
|
+
const match = _chunk7ZDLE77Pcjs.matchRouteParts.call(void 0, urlParts, redirectEntry.route.segments);
|
|
807
817
|
if (!match.matches) continue;
|
|
808
818
|
const statusCode = redirectEntry.definition.statusCode || (redirectEntry.definition.permanent ? 308 : 307);
|
|
809
819
|
return {
|
|
810
820
|
redirect: redirectEntry.definition,
|
|
811
|
-
destination:
|
|
821
|
+
destination: _chunkQZVPBDF7cjs.appendFarmRedirectQuery.call(void 0,
|
|
812
822
|
this.localizeRedirectDestination(
|
|
813
823
|
interpolateRedirectDestination(
|
|
814
824
|
redirectEntry.definition.destination,
|
|
@@ -848,7 +858,7 @@ var RouteManager = class _RouteManager {
|
|
|
848
858
|
const pagePath = normalizedPath.slice(0, -suffix.fileName.length - 1) || "/";
|
|
849
859
|
for (const imageEntry of this.metadataImages.values()) {
|
|
850
860
|
if (imageEntry.kind !== suffix.kind) continue;
|
|
851
|
-
const match =
|
|
861
|
+
const match = _chunk7ZDLE77Pcjs.matchRoute.call(void 0, pagePath, imageEntry.route.segments);
|
|
852
862
|
if (!match.matches) continue;
|
|
853
863
|
return {
|
|
854
864
|
image: imageEntry,
|
|
@@ -866,7 +876,7 @@ var RouteManager = class _RouteManager {
|
|
|
866
876
|
const routePath = normalizedPath.slice(0, -suffix.outputName.length - 1) || "/";
|
|
867
877
|
for (const metadata of this.metadataRoutes.values()) {
|
|
868
878
|
if (metadata.kind !== suffix.kind) continue;
|
|
869
|
-
const match =
|
|
879
|
+
const match = _chunk7ZDLE77Pcjs.matchRoute.call(void 0, routePath, metadata.route.segments);
|
|
870
880
|
if (!match.matches) continue;
|
|
871
881
|
return { metadata, params: match.params, routePath };
|
|
872
882
|
}
|
|
@@ -880,7 +890,7 @@ var RouteManager = class _RouteManager {
|
|
|
880
890
|
for (const metadata of this.metadataRoutes.values()) {
|
|
881
891
|
if (metadata.kind !== kind || metadata.route.segments.length > pathSegments.length) continue;
|
|
882
892
|
const routePath = metadata.route.segments.length === 0 ? "/" : `/${pathSegments.slice(0, metadata.route.segments.length).join("/")}`;
|
|
883
|
-
const match =
|
|
893
|
+
const match = _chunk7ZDLE77Pcjs.matchRoute.call(void 0, routePath, metadata.route.segments);
|
|
884
894
|
if (!match.matches) continue;
|
|
885
895
|
if (!bestMatch || metadata.route.segments.length > bestMatch.metadata.route.segments.length) {
|
|
886
896
|
bestMatch = { metadata, params: match.params, routePath };
|
|
@@ -901,7 +911,7 @@ var RouteManager = class _RouteManager {
|
|
|
901
911
|
if (imageEntry.kind !== kind) continue;
|
|
902
912
|
if (imageEntry.route.segments.length > pathSegments.length) continue;
|
|
903
913
|
const candidatePath = imageEntry.route.segments.length === 0 ? "/" : `/${pathSegments.slice(0, imageEntry.route.segments.length).join("/")}`;
|
|
904
|
-
const match =
|
|
914
|
+
const match = _chunk7ZDLE77Pcjs.matchRoute.call(void 0, candidatePath, imageEntry.route.segments);
|
|
905
915
|
if (!match.matches) continue;
|
|
906
916
|
if (!bestMatch || imageEntry.route.segments.length > bestMatch.image.route.segments.length) {
|
|
907
917
|
bestMatch = {
|
|
@@ -927,11 +937,18 @@ var RouteManager = class _RouteManager {
|
|
|
927
937
|
return this.clientManifestCache.manifest;
|
|
928
938
|
}
|
|
929
939
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
930
|
-
const compute = () =>
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
940
|
+
const compute = () => {
|
|
941
|
+
try {
|
|
942
|
+
return _chunkZCT6B5PQcjs.withFarmSourceSnapshot.call(void 0,
|
|
943
|
+
() => this.computeClientManifest(normalizedProjectRoot),
|
|
944
|
+
this.sourceSnapshot
|
|
945
|
+
);
|
|
946
|
+
} catch (error) {
|
|
947
|
+
this.forgetSourceReads();
|
|
948
|
+
throw error;
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
return cacheFile ? _chunkZCT6B5PQcjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
|
|
935
952
|
}
|
|
936
953
|
/**
|
|
937
954
|
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
@@ -940,7 +957,7 @@ var RouteManager = class _RouteManager {
|
|
|
940
957
|
*/
|
|
941
958
|
trackSourceChanges() {
|
|
942
959
|
this.sourceChangeTracking = true;
|
|
943
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
960
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkZCT6B5PQcjs.FarmSourceSnapshotStore)())));
|
|
944
961
|
}
|
|
945
962
|
/**
|
|
946
963
|
* @internal A production build edits no source while it runs, so what the plan reads, parses and
|
|
@@ -949,7 +966,7 @@ var RouteManager = class _RouteManager {
|
|
|
949
966
|
*/
|
|
950
967
|
keepBuildSourceSnapshot() {
|
|
951
968
|
if (this.sourceChangeTracking) return;
|
|
952
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
969
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkZCT6B5PQcjs.FarmSourceSnapshotStore)(false))));
|
|
953
970
|
}
|
|
954
971
|
/**
|
|
955
972
|
* @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
|
|
@@ -977,23 +994,42 @@ var RouteManager = class _RouteManager {
|
|
|
977
994
|
} else if (!/\.jsonc?$/.test(file)) {
|
|
978
995
|
return;
|
|
979
996
|
}
|
|
997
|
+
this.forgetSourceReads();
|
|
998
|
+
}
|
|
999
|
+
/** Forgets what plans read, so the next plan recomputes every route module. */
|
|
1000
|
+
forgetSourceReads() {
|
|
980
1001
|
this.editedSources = null;
|
|
981
1002
|
_optionalChain([this, 'access', _15 => _15.sourceSnapshot, 'optionalAccess', _16 => _16.clear, 'call', _17 => _17()]);
|
|
982
1003
|
this.planSources.clear();
|
|
983
1004
|
this.planGroupSources = /* @__PURE__ */ new WeakMap();
|
|
984
1005
|
this.linkedPackages.clear();
|
|
1006
|
+
this.linkedSources.clear();
|
|
985
1007
|
}
|
|
986
1008
|
/**
|
|
987
|
-
* @internal Whether an edit to `file` leaves the current plan as it is
|
|
988
|
-
*
|
|
989
|
-
* kept. The next replan reads it again (the watcher reported it).
|
|
1009
|
+
* @internal Whether an edit to `file` leaves the current plan as it is (isPlanNeutralEdit). The
|
|
1010
|
+
* next replan reads it again (the watcher reported it).
|
|
990
1011
|
*/
|
|
991
1012
|
isEditPlanNeutral(file) {
|
|
1013
|
+
if (file.endsWith(".d.ts")) return true;
|
|
992
1014
|
if (!this.sourceChangeTracking || !this.editedSources || !this.clientManifestCache) {
|
|
993
1015
|
return false;
|
|
994
1016
|
}
|
|
995
|
-
const
|
|
996
|
-
return
|
|
1017
|
+
const resolved = path4.default.resolve(file);
|
|
1018
|
+
return this.isPlanNeutralEdit(resolved, _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(resolved)]));
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Whether an edit to `file`, which the last plan read as `previous`, leaves every plan as it was:
|
|
1022
|
+
* a client module whose directive, island and hydrate exports, export shape and imports the edit
|
|
1023
|
+
* kept, or a server module whose imports, exports and uses of what it imports the edit kept (its
|
|
1024
|
+
* markup text, attributes and logic changed). A workspace package's file is read through its
|
|
1025
|
+
* `node_modules` link as well, where its imports resolve from another path, so it replans.
|
|
1026
|
+
*/
|
|
1027
|
+
isPlanNeutralEdit(file, previous) {
|
|
1028
|
+
if (previous === void 0) return false;
|
|
1029
|
+
return _chunkZCT6B5PQcjs.withFarmSourceSnapshotAside.call(void 0,
|
|
1030
|
+
this.sourceSnapshot,
|
|
1031
|
+
() => _chunkZCT6B5PQcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous) || !file.includes(NODE_MODULES_SEGMENT) && !this.linkedSources.has(file) && _chunkZCT6B5PQcjs.isFarmServerModulePlanUnchanged.call(void 0, file, previous)
|
|
1032
|
+
);
|
|
997
1033
|
}
|
|
998
1034
|
/**
|
|
999
1035
|
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
@@ -1004,7 +1040,7 @@ var RouteManager = class _RouteManager {
|
|
|
1004
1040
|
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
1005
1041
|
return { ...previous.plan };
|
|
1006
1042
|
}
|
|
1007
|
-
const { result, files, groups } =
|
|
1043
|
+
const { result, files, groups } = _chunkZCT6B5PQcjs.traceFarmSourceReadGroups.call(void 0, compute);
|
|
1008
1044
|
const sources = /* @__PURE__ */ new Set();
|
|
1009
1045
|
for (const file of files) {
|
|
1010
1046
|
const source = this.planSourcePath(file);
|
|
@@ -1015,7 +1051,7 @@ var RouteManager = class _RouteManager {
|
|
|
1015
1051
|
}
|
|
1016
1052
|
if (!this.sourceChangeTracking) {
|
|
1017
1053
|
for (const source of sources) {
|
|
1018
|
-
if (!this.planStamps.has(source)) this.planStamps.set(source,
|
|
1054
|
+
if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkZCT6B5PQcjs.getFarmSourceStamp.call(void 0, source));
|
|
1019
1055
|
}
|
|
1020
1056
|
}
|
|
1021
1057
|
this.ownerPlans.set(key, { plan: result, files: sources, planKey });
|
|
@@ -1035,7 +1071,7 @@ var RouteManager = class _RouteManager {
|
|
|
1035
1071
|
const isUnchanged = (file) => {
|
|
1036
1072
|
let result = unchanged.get(file);
|
|
1037
1073
|
if (result === void 0) {
|
|
1038
|
-
result = this.planStamps.get(file) ===
|
|
1074
|
+
result = this.planStamps.get(file) === _chunkZCT6B5PQcjs.getFarmSourceStamp.call(void 0, file);
|
|
1039
1075
|
unchanged.set(file, result);
|
|
1040
1076
|
}
|
|
1041
1077
|
return result;
|
|
@@ -1073,13 +1109,14 @@ var RouteManager = class _RouteManager {
|
|
|
1073
1109
|
source = file;
|
|
1074
1110
|
const index = file.lastIndexOf(NODE_MODULES_SEGMENT);
|
|
1075
1111
|
if (index !== -1) {
|
|
1076
|
-
const directory =
|
|
1112
|
+
const directory = _chunkZCT6B5PQcjs.getInstalledPackageDirectory.call(void 0, file, index + NODE_MODULES_SEGMENT.length);
|
|
1077
1113
|
let linked = this.linkedPackages.get(directory);
|
|
1078
1114
|
if (linked === void 0) {
|
|
1079
1115
|
linked = realPathOutsideNodeModules(directory) !== null;
|
|
1080
1116
|
this.linkedPackages.set(directory, linked);
|
|
1081
1117
|
}
|
|
1082
1118
|
source = linked ? realPathOutsideNodeModules(file) : null;
|
|
1119
|
+
if (source) this.linkedSources.add(source);
|
|
1083
1120
|
}
|
|
1084
1121
|
this.planSources.set(file, source);
|
|
1085
1122
|
return source;
|
|
@@ -1098,11 +1135,11 @@ var RouteManager = class _RouteManager {
|
|
|
1098
1135
|
*/
|
|
1099
1136
|
inspectPackages(operation) {
|
|
1100
1137
|
const file = this.packageClientBoundaryCacheFile;
|
|
1101
|
-
return file ?
|
|
1138
|
+
return file ? _chunkZCT6B5PQcjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
|
|
1102
1139
|
}
|
|
1103
1140
|
computeClientManifest(normalizedProjectRoot) {
|
|
1104
1141
|
const toUrlPath = (absolutePath) => {
|
|
1105
|
-
const rootRelative =
|
|
1142
|
+
const rootRelative = _chunk7ZDLE77Pcjs.toRootRelativeUrlPath.call(void 0, absolutePath, normalizedProjectRoot);
|
|
1106
1143
|
if (rootRelative !== void 0) return rootRelative;
|
|
1107
1144
|
if (path4.default.isAbsolute(absolutePath)) {
|
|
1108
1145
|
const normalized = absolutePath.replace(/\\/g, "/");
|
|
@@ -1110,35 +1147,35 @@ var RouteManager = class _RouteManager {
|
|
|
1110
1147
|
}
|
|
1111
1148
|
return absolutePath;
|
|
1112
1149
|
};
|
|
1113
|
-
const integrationProviders =
|
|
1150
|
+
const integrationProviders = _chunkN4AM7Q34cjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
|
|
1114
1151
|
(provider) => provider.component || provider.type === "clerk"
|
|
1115
1152
|
);
|
|
1116
1153
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
1117
|
-
(provider) => !
|
|
1154
|
+
(provider) => !_chunkN4AM7Q34cjs.providerSupportsIslands.call(void 0, provider)
|
|
1118
1155
|
);
|
|
1119
|
-
if (_optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.isolatedClientHydration]) === "enabled" &&
|
|
1120
|
-
|
|
1156
|
+
if (_optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.isolatedClientHydration]) === "enabled" && _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, this.config)) !== "rsc" && unsupportedIntegrationProvider) {
|
|
1157
|
+
_chunk7ZDLE77Pcjs.logger.warn(
|
|
1121
1158
|
`[Farm.js] Client components hydrate with their route, not as islands, because integration provider "${unsupportedIntegrationProvider.name}" doesn't declare \`islands: true\`.`
|
|
1122
1159
|
);
|
|
1123
1160
|
}
|
|
1124
|
-
const isolatedMode =
|
|
1125
|
-
_optionalChain([this, 'access',
|
|
1161
|
+
const isolatedMode = _chunkZCT6B5PQcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1162
|
+
_optionalChain([this, 'access', _24 => _24.config, 'access', _25 => _25.experimental, 'optionalAccess', _26 => _26.isolatedClientHydration]),
|
|
1126
1163
|
{
|
|
1127
|
-
serverComponents:
|
|
1164
|
+
serverComponents: _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, this.config)) === "rsc",
|
|
1128
1165
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1129
1166
|
}
|
|
1130
1167
|
);
|
|
1131
|
-
const planOptions =
|
|
1168
|
+
const planOptions = _chunkZCT6B5PQcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1132
1169
|
this.config.renderer,
|
|
1133
1170
|
Boolean(unsupportedIntegrationProvider)
|
|
1134
1171
|
);
|
|
1135
|
-
const islandsMode =
|
|
1136
|
-
const changed = _optionalChain([this, 'access',
|
|
1172
|
+
const islandsMode = _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, this.config)) === "islands";
|
|
1173
|
+
const changed = _optionalChain([this, 'access', _27 => _27.sourceSnapshot, 'optionalAccess', _28 => _28.refresh, 'call', _29 => _29(_nullishCoalesce(this.editedSources, () => ( [])))]);
|
|
1137
1174
|
let edited = null;
|
|
1138
1175
|
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
1139
1176
|
edited = /* @__PURE__ */ new Set();
|
|
1140
1177
|
for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
|
|
1141
|
-
if (
|
|
1178
|
+
if (this.isPlanNeutralEdit(file, previous)) continue;
|
|
1142
1179
|
const source = this.planSourcePath(file);
|
|
1143
1180
|
if (source) edited.add(source);
|
|
1144
1181
|
}
|
|
@@ -1153,13 +1190,13 @@ var RouteManager = class _RouteManager {
|
|
|
1153
1190
|
metadata: this.planRouteModule(
|
|
1154
1191
|
`layout:${entry.modulePath}`,
|
|
1155
1192
|
edited,
|
|
1156
|
-
() =>
|
|
1193
|
+
() => _chunkZCT6B5PQcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1157
1194
|
entry.modulePath,
|
|
1158
1195
|
normalizedProjectRoot,
|
|
1159
1196
|
isolatedMode,
|
|
1160
1197
|
layoutPlanOptions
|
|
1161
1198
|
),
|
|
1162
|
-
|
|
1199
|
+
_chunkZCT6B5PQcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1163
1200
|
entry.modulePath,
|
|
1164
1201
|
normalizedProjectRoot,
|
|
1165
1202
|
isolatedMode,
|
|
@@ -1167,8 +1204,8 @@ var RouteManager = class _RouteManager {
|
|
|
1167
1204
|
)
|
|
1168
1205
|
)
|
|
1169
1206
|
}));
|
|
1170
|
-
const markdownComponentsPlan =
|
|
1171
|
-
|
|
1207
|
+
const markdownComponentsPlan = _chunkZCT6B5PQcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1208
|
+
_chunkYQ5NVEFScjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkYQ5NVEFScjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
1172
1209
|
normalizedProjectRoot,
|
|
1173
1210
|
isolatedMode,
|
|
1174
1211
|
{ ...planOptions, packageReferences: islandsMode }
|
|
@@ -1180,16 +1217,16 @@ var RouteManager = class _RouteManager {
|
|
|
1180
1217
|
const pagePlanOptions = { ...planOptions, serverOwners: islandsMode };
|
|
1181
1218
|
const routeEntries = Array.from(this.routes.values()).map((entry) => ({
|
|
1182
1219
|
entry,
|
|
1183
|
-
metadata:
|
|
1220
|
+
metadata: _chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
1184
1221
|
`page:${entry.modulePath}`,
|
|
1185
1222
|
edited,
|
|
1186
|
-
() =>
|
|
1223
|
+
() => _chunkZCT6B5PQcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1187
1224
|
entry.modulePath,
|
|
1188
1225
|
normalizedProjectRoot,
|
|
1189
1226
|
isolatedMode,
|
|
1190
1227
|
pagePlanOptions
|
|
1191
1228
|
),
|
|
1192
|
-
|
|
1229
|
+
_chunkZCT6B5PQcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1193
1230
|
entry.modulePath,
|
|
1194
1231
|
normalizedProjectRoot,
|
|
1195
1232
|
isolatedMode,
|
|
@@ -1198,51 +1235,51 @@ var RouteManager = class _RouteManager {
|
|
|
1198
1235
|
)
|
|
1199
1236
|
}));
|
|
1200
1237
|
const markdownFallback = routeEntries.find(
|
|
1201
|
-
({ entry, metadata }) =>
|
|
1238
|
+
({ entry, metadata }) => _chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
|
|
1202
1239
|
);
|
|
1203
1240
|
if (markdownFallback) {
|
|
1204
|
-
|
|
1241
|
+
_chunk7ZDLE77Pcjs.logger.warn(
|
|
1205
1242
|
`[Farm.js] client components in Markdown pages stay static: ${markdownFallback.metadata.fallbackReason}.`
|
|
1206
1243
|
);
|
|
1207
1244
|
}
|
|
1208
|
-
const markdownStaticPackages = _optionalChain([routeEntries, 'access',
|
|
1209
|
-
({ entry, metadata }) =>
|
|
1210
|
-
), 'optionalAccess',
|
|
1245
|
+
const markdownStaticPackages = _optionalChain([routeEntries, 'access', _30 => _30.find, 'call', _31 => _31(
|
|
1246
|
+
({ entry, metadata }) => _chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
|
|
1247
|
+
), 'optionalAccess', _32 => _32.metadata, 'access', _33 => _33.staticPackageBoundaries]);
|
|
1211
1248
|
if (markdownStaticPackages) {
|
|
1212
|
-
|
|
1249
|
+
_chunk7ZDLE77Pcjs.logger.info(
|
|
1213
1250
|
`[Farm.js] Markdown pages render client components from ${markdownStaticPackages.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1214
1251
|
);
|
|
1215
1252
|
}
|
|
1216
1253
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
1217
|
-
if (
|
|
1218
|
-
|
|
1254
|
+
if (_chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
|
|
1255
|
+
_chunk7ZDLE77Pcjs.logger.info(
|
|
1219
1256
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1220
1257
|
);
|
|
1221
1258
|
}
|
|
1222
|
-
|
|
1259
|
+
_chunkZCT6B5PQcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1223
1260
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1224
1261
|
pattern: entry.pattern,
|
|
1225
|
-
depth:
|
|
1262
|
+
depth: _chunkIGBQSUT5cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
1226
1263
|
metadata
|
|
1227
1264
|
})),
|
|
1228
1265
|
routeEntries.map(({ entry, metadata }) => ({
|
|
1229
1266
|
pattern: getRouteEntryDirectory(entry),
|
|
1230
|
-
depth:
|
|
1267
|
+
depth: _chunkIGBQSUT5cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
|
|
1231
1268
|
metadata
|
|
1232
1269
|
})),
|
|
1233
|
-
|
|
1270
|
+
_chunkIGBQSUT5cjs.routeBoundaryCoversDirectory,
|
|
1234
1271
|
{ serverOwners: islandsMode }
|
|
1235
1272
|
);
|
|
1236
1273
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
1237
1274
|
if (!metadata.costGuardExceeded) continue;
|
|
1238
|
-
|
|
1275
|
+
_chunk7ZDLE77Pcjs.logger.warn(
|
|
1239
1276
|
`[Farm.js] isolated hydration kept route-wide for ${entry.modulePath}: ${metadata.fallbackReason}.`
|
|
1240
1277
|
);
|
|
1241
1278
|
}
|
|
1242
1279
|
if (isolatedMode === "analyze") {
|
|
1243
1280
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
1244
1281
|
if (!metadata.isolatedHydrationEligible) continue;
|
|
1245
|
-
|
|
1282
|
+
_chunk7ZDLE77Pcjs.logger.info(
|
|
1246
1283
|
`[Farm.js] isolated hydration analysis: ${entry.modulePath} can keep ${metadata.isolatedBoundaries.length} client ${metadata.isolatedBoundaries.length === 1 ? "boundary" : "boundaries"} while excluding its server owner from the browser graph.`
|
|
1247
1284
|
);
|
|
1248
1285
|
}
|
|
@@ -1250,7 +1287,7 @@ var RouteManager = class _RouteManager {
|
|
|
1250
1287
|
const routes = routeEntries.map(({ entry, metadata }) => {
|
|
1251
1288
|
const programmaticPage = this.programmaticPages.get(entry.modulePath);
|
|
1252
1289
|
const layoutShouldHydrate = layoutEntries.some(
|
|
1253
|
-
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate &&
|
|
1290
|
+
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkIGBQSUT5cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
|
|
1254
1291
|
);
|
|
1255
1292
|
return {
|
|
1256
1293
|
pattern: entry.pattern,
|
|
@@ -1266,15 +1303,15 @@ var RouteManager = class _RouteManager {
|
|
|
1266
1303
|
modulePath: toUrlPath(boundary.modulePath)
|
|
1267
1304
|
}))
|
|
1268
1305
|
} : {},
|
|
1269
|
-
...
|
|
1270
|
-
renderPlan:
|
|
1306
|
+
..._chunkZCT6B5PQcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
1307
|
+
renderPlan: _chunkIGBQSUT5cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
1271
1308
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
1272
1309
|
layoutShouldHydrate,
|
|
1273
1310
|
islandStrategy: metadata.islandStrategy
|
|
1274
1311
|
}),
|
|
1275
1312
|
suppressedAsyncHydration: metadata.suppressedAsyncHydration,
|
|
1276
1313
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {},
|
|
1277
|
-
search:
|
|
1314
|
+
search: _chunkPYPHM7AScjs.getProgrammaticRouteSearchClientOptions.call(void 0, _optionalChain([programmaticPage, 'optionalAccess', _34 => _34.search])),
|
|
1278
1315
|
segments: entry.route.segments.map((seg) => ({
|
|
1279
1316
|
segment: seg.segment,
|
|
1280
1317
|
isDynamic: seg.isDynamic,
|
|
@@ -1283,7 +1320,7 @@ var RouteManager = class _RouteManager {
|
|
|
1283
1320
|
}))
|
|
1284
1321
|
};
|
|
1285
1322
|
});
|
|
1286
|
-
const treeLayoutPatterns = islandsMode ?
|
|
1323
|
+
const treeLayoutPatterns = islandsMode ? _chunkIGBQSUT5cjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
1287
1324
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1288
1325
|
pattern: entry.pattern,
|
|
1289
1326
|
shouldHydrate: metadata.shouldHydrate,
|
|
@@ -1308,7 +1345,7 @@ var RouteManager = class _RouteManager {
|
|
|
1308
1345
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
1309
1346
|
}));
|
|
1310
1347
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
1311
|
-
const metadata =
|
|
1348
|
+
const metadata = _chunkZCT6B5PQcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
1312
1349
|
return {
|
|
1313
1350
|
name: entry.name,
|
|
1314
1351
|
ownerPattern: entry.ownerPattern,
|
|
@@ -1324,7 +1361,7 @@ var RouteManager = class _RouteManager {
|
|
|
1324
1361
|
};
|
|
1325
1362
|
});
|
|
1326
1363
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
1327
|
-
metadata:
|
|
1364
|
+
metadata: _chunkZCT6B5PQcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1328
1365
|
entry.modulePath,
|
|
1329
1366
|
normalizedProjectRoot,
|
|
1330
1367
|
isolatedMode,
|
|
@@ -1349,7 +1386,7 @@ var RouteManager = class _RouteManager {
|
|
|
1349
1386
|
for (const error of islandsErrors) {
|
|
1350
1387
|
if (this.reportedIslandsErrors.has(error)) continue;
|
|
1351
1388
|
this.reportedIslandsErrors.add(error);
|
|
1352
|
-
|
|
1389
|
+
_chunk7ZDLE77Pcjs.logger.error(`[Farm.js] islands mode cannot hydrate ${error}`);
|
|
1353
1390
|
}
|
|
1354
1391
|
const manifest = { routes, layouts, slots };
|
|
1355
1392
|
this.editedSources = this.sourceChangeTracking ? /* @__PURE__ */ new Set() : null;
|
|
@@ -1389,7 +1426,7 @@ var RouteManager = class _RouteManager {
|
|
|
1389
1426
|
getIsolatedClientBoundaryModules(projectRoot = this.config.root) {
|
|
1390
1427
|
const normalizedProjectRoot = path4.default.resolve(projectRoot);
|
|
1391
1428
|
this.generateClientManifest(normalizedProjectRoot);
|
|
1392
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
1429
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _35 => _35.clientManifestCache, 'optionalAccess', _36 => _36.isolatedClientBoundaryModules]), () => ( /* @__PURE__ */ new Set()));
|
|
1393
1430
|
}
|
|
1394
1431
|
/**
|
|
1395
1432
|
* @internal Islands-mode pages with a client component that cannot become an island. Hydrating
|
|
@@ -1397,7 +1434,7 @@ var RouteManager = class _RouteManager {
|
|
|
1397
1434
|
*/
|
|
1398
1435
|
getIslandsErrors(projectRoot = this.config.root) {
|
|
1399
1436
|
this.generateClientManifest(path4.default.resolve(projectRoot));
|
|
1400
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
1437
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _37 => _37.clientManifestCache, 'optionalAccess', _38 => _38.islandsErrors]), () => ( []));
|
|
1401
1438
|
}
|
|
1402
1439
|
/**
|
|
1403
1440
|
* Invalidate build-time route metadata after a page or layout changes in dev.
|
|
@@ -1416,21 +1453,21 @@ var RouteManager = class _RouteManager {
|
|
|
1416
1453
|
const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
|
|
1417
1454
|
return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
|
|
1418
1455
|
}
|
|
1419
|
-
if (
|
|
1420
|
-
const mdxConfig =
|
|
1456
|
+
if (_chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
|
|
1457
|
+
const mdxConfig = _chunkYQ5NVEFScjs.resolveMdxConfig.call(void 0, this.config.mdx);
|
|
1421
1458
|
const viteServer = this.viteServer;
|
|
1422
|
-
return await
|
|
1459
|
+
return await _chunkRGIHE6YLcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
|
|
1423
1460
|
// Loaded on render: the route runtime manifest only reads metadata and rendering config.
|
|
1424
|
-
components: () =>
|
|
1461
|
+
components: () => _chunkRGIHE6YLcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
|
|
1425
1462
|
root: this.config.root,
|
|
1426
|
-
loadModule: viteServer ? (componentModulePath) =>
|
|
1463
|
+
loadModule: viteServer ? (componentModulePath) => _chunkVB7P66Q4cjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1427
1464
|
}),
|
|
1428
1465
|
config: mdxConfig,
|
|
1429
|
-
renderer:
|
|
1466
|
+
renderer: _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
|
|
1430
1467
|
});
|
|
1431
1468
|
}
|
|
1432
1469
|
if (this.viteServer) {
|
|
1433
|
-
const module = await
|
|
1470
|
+
const module = await _chunkVB7P66Q4cjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
|
|
1434
1471
|
return module;
|
|
1435
1472
|
} else {
|
|
1436
1473
|
const module = await import(
|
|
@@ -1440,7 +1477,7 @@ var RouteManager = class _RouteManager {
|
|
|
1440
1477
|
return module;
|
|
1441
1478
|
}
|
|
1442
1479
|
} catch (error) {
|
|
1443
|
-
|
|
1480
|
+
_chunk7ZDLE77Pcjs.logger.error(`Failed to load route module: ${modulePath}`);
|
|
1444
1481
|
throw error;
|
|
1445
1482
|
}
|
|
1446
1483
|
}
|
|
@@ -1455,7 +1492,7 @@ var RouteManager = class _RouteManager {
|
|
|
1455
1492
|
return createLayoutModuleFromProgrammaticLayout(programmaticLayout);
|
|
1456
1493
|
}
|
|
1457
1494
|
if (this.viteServer) {
|
|
1458
|
-
const module = await
|
|
1495
|
+
const module = await _chunkVB7P66Q4cjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
|
|
1459
1496
|
return module;
|
|
1460
1497
|
} else {
|
|
1461
1498
|
const module = await import(
|
|
@@ -1465,7 +1502,7 @@ var RouteManager = class _RouteManager {
|
|
|
1465
1502
|
return module;
|
|
1466
1503
|
}
|
|
1467
1504
|
} catch (error) {
|
|
1468
|
-
|
|
1505
|
+
_chunk7ZDLE77Pcjs.logger.error(`Failed to load layout module: ${modulePath}`);
|
|
1469
1506
|
throw error;
|
|
1470
1507
|
}
|
|
1471
1508
|
}
|
|
@@ -1474,11 +1511,11 @@ var RouteManager = class _RouteManager {
|
|
|
1474
1511
|
*/
|
|
1475
1512
|
createRoutePattern(route) {
|
|
1476
1513
|
if (route.segments.length === 0) return "/";
|
|
1477
|
-
return "/" + route.segments.map(
|
|
1514
|
+
return "/" + route.segments.map(_chunkIGBQSUT5cjs.formatRouteSegment).join("/");
|
|
1478
1515
|
}
|
|
1479
1516
|
registerPageRoute(entry) {
|
|
1480
|
-
|
|
1481
|
-
const shape =
|
|
1517
|
+
_chunkT4YCWRCJcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
|
|
1518
|
+
const shape = _chunkT4YCWRCJcjs.getRoutePatternShape.call(void 0, entry.pattern);
|
|
1482
1519
|
const existing = this.pageRouteShapes.get(shape);
|
|
1483
1520
|
if (existing && existing.pattern !== entry.pattern) {
|
|
1484
1521
|
if (existing.sourceRoot === entry.sourceRoot) {
|
|
@@ -1492,19 +1529,19 @@ var RouteManager = class _RouteManager {
|
|
|
1492
1529
|
this.pageRouteShapes.set(shape, entry);
|
|
1493
1530
|
}
|
|
1494
1531
|
async discoverFileRoutes(source) {
|
|
1495
|
-
const appDir =
|
|
1496
|
-
const componentExtensions =
|
|
1532
|
+
const appDir = _chunk7ZDLE77Pcjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
|
|
1533
|
+
const componentExtensions = _chunkLEZJZX4Ccjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
|
|
1497
1534
|
(extension) => extension.slice(1)
|
|
1498
1535
|
);
|
|
1499
1536
|
const componentGlob = componentExtensions.join(",");
|
|
1500
|
-
const rendererRoutes = await
|
|
1537
|
+
const rendererRoutes = await _chunkWXPY5FRFcjs.resolveFarmRendererRoutes.call(void 0, {
|
|
1501
1538
|
renderer: this.config.renderer,
|
|
1502
1539
|
root: source.root,
|
|
1503
1540
|
srcDir: source.srcDir
|
|
1504
1541
|
});
|
|
1505
1542
|
const routeModulePaths = /* @__PURE__ */ new Map();
|
|
1506
1543
|
const modulePathOf = (file) => _nullishCoalesce(routeModulePaths.get(file), () => ( path4.default.join(appDir, file)));
|
|
1507
|
-
const rendererFiles = (kind) => (_nullishCoalesce(_optionalChain([rendererRoutes, 'optionalAccess',
|
|
1544
|
+
const rendererFiles = (kind) => (_nullishCoalesce(_optionalChain([rendererRoutes, 'optionalAccess', _39 => _39.entries]), () => ( []))).filter((entry) => entry.kind === kind).map((entry) => {
|
|
1508
1545
|
routeModulePaths.set(entry.routeFile, entry.modulePath);
|
|
1509
1546
|
if (entry.hydration.hydrate !== void 0 || entry.hydration.strategy !== void 0) {
|
|
1510
1547
|
this.rendererRouteHydration.set(entry.modulePath, entry.hydration);
|
|
@@ -1518,7 +1555,7 @@ var RouteManager = class _RouteManager {
|
|
|
1518
1555
|
}
|
|
1519
1556
|
const notFound = rendererRoutes.entries.find((entry) => entry.kind === "not-found");
|
|
1520
1557
|
if (notFound || this.rendererNotFoundPath === void 0) {
|
|
1521
|
-
this.rendererNotFoundPath = _nullishCoalesce(_optionalChain([notFound, 'optionalAccess',
|
|
1558
|
+
this.rendererNotFoundPath = _nullishCoalesce(_optionalChain([notFound, 'optionalAccess', _40 => _40.modulePath]), () => ( null));
|
|
1522
1559
|
}
|
|
1523
1560
|
}
|
|
1524
1561
|
const pageFiles = rendererRoutes ? [
|
|
@@ -1538,8 +1575,8 @@ var RouteManager = class _RouteManager {
|
|
|
1538
1575
|
appDir
|
|
1539
1576
|
);
|
|
1540
1577
|
const canonicalPageGroups = /* @__PURE__ */ new Map();
|
|
1541
|
-
for (const file of pageFiles.filter((candidate) =>
|
|
1542
|
-
const route =
|
|
1578
|
+
for (const file of pageFiles.filter((candidate) => _chunkRBDAW6IZcjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
|
|
1579
|
+
const route = _chunk7ZDLE77Pcjs.parseRoutePath.call(void 0, file);
|
|
1543
1580
|
const pattern = this.createRoutePattern(route);
|
|
1544
1581
|
const group = canonicalPageGroups.get(pattern);
|
|
1545
1582
|
if (group) {
|
|
@@ -1552,8 +1589,8 @@ var RouteManager = class _RouteManager {
|
|
|
1552
1589
|
}
|
|
1553
1590
|
}
|
|
1554
1591
|
for (const [pattern, group] of canonicalPageGroups) {
|
|
1555
|
-
const componentFiles = group.files.filter((file) => !
|
|
1556
|
-
const markdownFiles = group.files.filter(
|
|
1592
|
+
const componentFiles = group.files.filter((file) => !_chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, file));
|
|
1593
|
+
const markdownFiles = group.files.filter(_chunk27IPPPCVcjs.isFarmMarkdownPageFile);
|
|
1557
1594
|
if (componentFiles.length > 1) {
|
|
1558
1595
|
throw new Error(
|
|
1559
1596
|
`Duplicate page route "${pattern}". Found ${componentFiles.map(modulePathOf).join(" and ")}.`
|
|
@@ -1570,7 +1607,7 @@ var RouteManager = class _RouteManager {
|
|
|
1570
1607
|
if (!primaryFile) continue;
|
|
1571
1608
|
const modulePath = modulePathOf(primaryFile);
|
|
1572
1609
|
const existing = this.routes.get(pattern);
|
|
1573
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1610
|
+
if (_optionalChain([existing, 'optionalAccess', _41 => _41.sourceRoot]) === source.root) {
|
|
1574
1611
|
throw new Error(
|
|
1575
1612
|
`Duplicate page route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
|
|
1576
1613
|
);
|
|
@@ -1593,11 +1630,11 @@ var RouteManager = class _RouteManager {
|
|
|
1593
1630
|
["error", errorFiles, this.errors]
|
|
1594
1631
|
]) {
|
|
1595
1632
|
for (const file of files) {
|
|
1596
|
-
const route =
|
|
1633
|
+
const route = _chunk7ZDLE77Pcjs.parseRoutePath.call(void 0, file);
|
|
1597
1634
|
const modulePath = modulePathOf(file);
|
|
1598
|
-
const pattern =
|
|
1635
|
+
const pattern = _chunkIGBQSUT5cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1599
1636
|
const existing = target.get(pattern);
|
|
1600
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1637
|
+
if (_optionalChain([existing, 'optionalAccess', _42 => _42.sourceRoot]) === source.root) {
|
|
1601
1638
|
throw new Error(
|
|
1602
1639
|
`Duplicate ${kind} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
|
|
1603
1640
|
);
|
|
@@ -1612,15 +1649,15 @@ var RouteManager = class _RouteManager {
|
|
|
1612
1649
|
}
|
|
1613
1650
|
}
|
|
1614
1651
|
for (const file of [...pageFiles, ...slotDefaultFiles]) {
|
|
1615
|
-
const slot =
|
|
1652
|
+
const slot = _chunkRBDAW6IZcjs.parseRouteSlotFile.call(void 0, file);
|
|
1616
1653
|
if (!slot) continue;
|
|
1617
1654
|
const modulePath = path4.default.join(appDir, file);
|
|
1618
1655
|
const pattern = this.createRoutePattern(slot.route);
|
|
1619
1656
|
const ownerPattern = this.createRoutePattern(slot.ownerRoute);
|
|
1620
|
-
const ownerDirectory =
|
|
1657
|
+
const ownerDirectory = _chunkIGBQSUT5cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
|
|
1621
1658
|
const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
|
|
1622
1659
|
const existing = this.routeSlots.get(key);
|
|
1623
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1660
|
+
if (_optionalChain([existing, 'optionalAccess', _43 => _43.sourceRoot]) === source.root) {
|
|
1624
1661
|
throw new Error(
|
|
1625
1662
|
`Duplicate route slot "${slot.name}" for "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
|
|
1626
1663
|
);
|
|
@@ -1636,20 +1673,20 @@ var RouteManager = class _RouteManager {
|
|
|
1636
1673
|
...ownerDirectory === ownerPattern ? {} : { ownerDirectory },
|
|
1637
1674
|
interception: slot.interception,
|
|
1638
1675
|
fallback: slot.fallback,
|
|
1639
|
-
containerId:
|
|
1676
|
+
containerId: _chunkRBDAW6IZcjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
|
|
1640
1677
|
});
|
|
1641
1678
|
}
|
|
1642
1679
|
for (const file of metadataImageFiles) {
|
|
1643
1680
|
const fileBase = path4.default.basename(file, path4.default.extname(file));
|
|
1644
1681
|
const kind = fileBase === "twitter-image" ? "twitter" : "opengraph";
|
|
1645
1682
|
const fileName = kind === "twitter" ? "twitter-image" : "opengraph-image";
|
|
1646
|
-
const route =
|
|
1683
|
+
const route = _chunk7ZDLE77Pcjs.parseRoutePath.call(void 0, file);
|
|
1647
1684
|
const modulePath = path4.default.join(appDir, file);
|
|
1648
1685
|
const pattern = this.createRoutePattern(route);
|
|
1649
1686
|
const key = `${kind}:${pattern}`;
|
|
1650
1687
|
const existing = this.metadataImages.get(key);
|
|
1651
1688
|
const sourceType = isStaticMetadataImageFile(file) ? "static" : "module";
|
|
1652
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1689
|
+
if (_optionalChain([existing, 'optionalAccess', _44 => _44.sourceRoot]) === source.root) {
|
|
1653
1690
|
throw new Error(
|
|
1654
1691
|
`Duplicate ${fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one static image or module per route segment.`
|
|
1655
1692
|
);
|
|
@@ -1672,12 +1709,12 @@ var RouteManager = class _RouteManager {
|
|
|
1672
1709
|
path4.default.basename(file, path4.default.extname(file))
|
|
1673
1710
|
);
|
|
1674
1711
|
if (!descriptor) continue;
|
|
1675
|
-
const route =
|
|
1712
|
+
const route = _chunk7ZDLE77Pcjs.parseRoutePath.call(void 0, file);
|
|
1676
1713
|
const modulePath = path4.default.join(appDir, file);
|
|
1677
1714
|
const pattern = this.createRoutePattern(route);
|
|
1678
1715
|
const key = `${descriptor.kind}:${pattern}`;
|
|
1679
1716
|
const existing = this.metadataRoutes.get(key);
|
|
1680
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1717
|
+
if (_optionalChain([existing, 'optionalAccess', _45 => _45.sourceRoot]) === source.root) {
|
|
1681
1718
|
throw new Error(
|
|
1682
1719
|
`Duplicate ${descriptor.fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one .ts or .js metadata route per segment.`
|
|
1683
1720
|
);
|
|
@@ -1693,35 +1730,35 @@ var RouteManager = class _RouteManager {
|
|
|
1693
1730
|
}
|
|
1694
1731
|
}
|
|
1695
1732
|
async discoverProgrammaticRoutes(source, clientRoutes) {
|
|
1696
|
-
if (this.viteServer)
|
|
1697
|
-
const manifests = await
|
|
1733
|
+
if (this.viteServer) _chunkPYPHM7AScjs.trackProgrammaticRouteSources.call(void 0, );
|
|
1734
|
+
const manifests = await _chunkPRKFECGTcjs.loadProgrammaticRouteManifests.call(void 0, {
|
|
1698
1735
|
root: source.root,
|
|
1699
1736
|
srcDir: source.srcDir,
|
|
1700
1737
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1701
1738
|
});
|
|
1702
|
-
const graph = this.viteServer ?
|
|
1739
|
+
const graph = this.viteServer ? _chunkZCT6B5PQcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1703
1740
|
for (const { filePath, manifest } of manifests) {
|
|
1704
1741
|
if (graph) {
|
|
1705
1742
|
clientRoutes.push(
|
|
1706
|
-
|
|
1743
|
+
_chunkZCT6B5PQcjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1707
1744
|
graph,
|
|
1708
1745
|
routesFile: toRealPath(filePath),
|
|
1709
1746
|
routes: manifest.routes,
|
|
1710
|
-
normalizeRoutePath:
|
|
1747
|
+
normalizeRoutePath: _chunkPYPHM7AScjs.normalizeProgrammaticRoutePath
|
|
1711
1748
|
})
|
|
1712
1749
|
);
|
|
1713
1750
|
}
|
|
1714
1751
|
for (const definition of manifest.routes) {
|
|
1715
1752
|
if (definition.kind === "page") {
|
|
1716
|
-
const route =
|
|
1753
|
+
const route = _chunkPYPHM7AScjs.parseProgrammaticRoutePath.call(void 0, definition.path, "page");
|
|
1717
1754
|
const pattern = this.createRoutePattern(route);
|
|
1718
1755
|
const existing = this.routes.get(pattern);
|
|
1719
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1756
|
+
if (_optionalChain([existing, 'optionalAccess', _46 => _46.sourceRoot]) === source.root) {
|
|
1720
1757
|
throw new Error(
|
|
1721
1758
|
`Duplicate page route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
|
|
1722
1759
|
);
|
|
1723
1760
|
}
|
|
1724
|
-
const modulePath =
|
|
1761
|
+
const modulePath = _chunkPYPHM7AScjs.createProgrammaticRouteModuleId.call(void 0, filePath, "page", definition.path);
|
|
1725
1762
|
this.programmaticPages.set(modulePath, definition);
|
|
1726
1763
|
this.registerPageRoute({
|
|
1727
1764
|
route,
|
|
@@ -1733,15 +1770,15 @@ var RouteManager = class _RouteManager {
|
|
|
1733
1770
|
});
|
|
1734
1771
|
}
|
|
1735
1772
|
if (definition.kind === "layout") {
|
|
1736
|
-
const route =
|
|
1737
|
-
const pattern =
|
|
1773
|
+
const route = _chunkPYPHM7AScjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
|
|
1774
|
+
const pattern = _chunkIGBQSUT5cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1738
1775
|
const existing = this.layouts.get(pattern);
|
|
1739
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1776
|
+
if (_optionalChain([existing, 'optionalAccess', _47 => _47.sourceRoot]) === source.root) {
|
|
1740
1777
|
throw new Error(
|
|
1741
1778
|
`Duplicate layout route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
|
|
1742
1779
|
);
|
|
1743
1780
|
}
|
|
1744
|
-
const modulePath =
|
|
1781
|
+
const modulePath = _chunkPYPHM7AScjs.createProgrammaticRouteModuleId.call(void 0, filePath, "layout", definition.path);
|
|
1745
1782
|
this.programmaticLayouts.set(modulePath, definition);
|
|
1746
1783
|
this.layouts.set(pattern, {
|
|
1747
1784
|
route,
|
|
@@ -1752,7 +1789,7 @@ var RouteManager = class _RouteManager {
|
|
|
1752
1789
|
});
|
|
1753
1790
|
}
|
|
1754
1791
|
if (definition.kind === "redirect") {
|
|
1755
|
-
const route =
|
|
1792
|
+
const route = _chunkPYPHM7AScjs.parseProgrammaticRoutePath.call(void 0, definition.source, "page");
|
|
1756
1793
|
const pattern = this.createRoutePattern(route);
|
|
1757
1794
|
this.redirects.set(pattern, {
|
|
1758
1795
|
route,
|
|
@@ -1765,12 +1802,12 @@ var RouteManager = class _RouteManager {
|
|
|
1765
1802
|
}
|
|
1766
1803
|
async loadProgrammaticRoutesModule(filePath) {
|
|
1767
1804
|
if (this.viteServer) {
|
|
1768
|
-
const viteRoot = _optionalChain([this, 'access',
|
|
1769
|
-
return await
|
|
1805
|
+
const viteRoot = _optionalChain([this, 'access', _48 => _48.viteServer, 'access', _49 => _49.config, 'optionalAccess', _50 => _50.root]) || this.config.root || process.cwd();
|
|
1806
|
+
return await _chunkVB7P66Q4cjs.loadFarmDevModule.call(void 0, this.viteServer, _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, filePath, viteRoot));
|
|
1770
1807
|
}
|
|
1771
1808
|
return await import(
|
|
1772
1809
|
/* @vite-ignore */
|
|
1773
|
-
|
|
1810
|
+
_chunkWCPGU6J6cjs.toFileModuleUrl.call(void 0, filePath)
|
|
1774
1811
|
);
|
|
1775
1812
|
}
|
|
1776
1813
|
/**
|
|
@@ -1780,8 +1817,8 @@ var RouteManager = class _RouteManager {
|
|
|
1780
1817
|
findMatchingLayouts(pathnameParts, route) {
|
|
1781
1818
|
const matchingLayouts = [];
|
|
1782
1819
|
for (const { entry, groupScope } of this.orderedLayouts) {
|
|
1783
|
-
if (!
|
|
1784
|
-
if (groupScope !== null && !
|
|
1820
|
+
if (!_chunk7ZDLE77Pcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
|
|
1821
|
+
if (groupScope !== null && !_chunkIGBQSUT5cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
|
|
1785
1822
|
continue;
|
|
1786
1823
|
}
|
|
1787
1824
|
matchingLayouts.push(entry);
|
|
@@ -1790,7 +1827,7 @@ var RouteManager = class _RouteManager {
|
|
|
1790
1827
|
}
|
|
1791
1828
|
matchPageRoute(pathnameParts) {
|
|
1792
1829
|
for (const routeEntry of this.routes.values()) {
|
|
1793
|
-
if (
|
|
1830
|
+
if (_chunk7ZDLE77Pcjs.matchRouteParts.call(void 0, pathnameParts, routeEntry.route.segments).matches) return routeEntry;
|
|
1794
1831
|
}
|
|
1795
1832
|
return null;
|
|
1796
1833
|
}
|
|
@@ -1804,14 +1841,14 @@ var RouteManager = class _RouteManager {
|
|
|
1804
1841
|
groups.set(key, entries);
|
|
1805
1842
|
}
|
|
1806
1843
|
const normalizedFrom = interceptFrom ? this.toRoutePathname(new URL(interceptFrom, "http://farm.local").pathname) : void 0;
|
|
1807
|
-
const normalizedFromParts = normalizedFrom ?
|
|
1844
|
+
const normalizedFromParts = normalizedFrom ? _chunk7ZDLE77Pcjs.splitRoutePath.call(void 0, normalizedFrom) : void 0;
|
|
1808
1845
|
const matches = [];
|
|
1809
1846
|
for (const entries of groups.values()) {
|
|
1810
1847
|
const candidates = entries.filter((entry) => !entry.fallback).filter(
|
|
1811
1848
|
(entry) => !entry.interception || normalizedFrom !== void 0 && this.matchesRoutePrefix(normalizedFrom, entry.ownerPattern, normalizedFromParts)
|
|
1812
1849
|
).map((entry) => ({
|
|
1813
1850
|
entry,
|
|
1814
|
-
match:
|
|
1851
|
+
match: _chunk7ZDLE77Pcjs.matchRouteParts.call(void 0, pathnameParts, entry.route.segments)
|
|
1815
1852
|
})).filter((candidate) => candidate.match.matches).sort((left, right) => {
|
|
1816
1853
|
if (left.entry.interception !== right.entry.interception) {
|
|
1817
1854
|
return left.entry.interception ? -1 : 1;
|
|
@@ -1851,25 +1888,25 @@ var RouteManager = class _RouteManager {
|
|
|
1851
1888
|
return ownerDifference || left.name.localeCompare(right.name);
|
|
1852
1889
|
});
|
|
1853
1890
|
}
|
|
1854
|
-
matchesRoutePrefix(pathname, pattern, pathnameParts =
|
|
1891
|
+
matchesRoutePrefix(pathname, pattern, pathnameParts = _chunk7ZDLE77Pcjs.splitRoutePath.call(void 0, pathname)) {
|
|
1855
1892
|
if (pattern === "/") return true;
|
|
1856
|
-
const patternSegments = _nullishCoalesce(this.routeSlotOwnerSegments.get(pattern), () => (
|
|
1857
|
-
return
|
|
1893
|
+
const patternSegments = _nullishCoalesce(this.routeSlotOwnerSegments.get(pattern), () => ( _chunk7ZDLE77Pcjs.parseRoutePath.call(void 0, `${pattern}/page.tsx`).segments));
|
|
1894
|
+
return _chunk7ZDLE77Pcjs.matchRoutePrefixParts.call(void 0, pathnameParts, patternSegments);
|
|
1858
1895
|
}
|
|
1859
1896
|
findNearestBoundary(pathname, boundaries, route) {
|
|
1860
1897
|
const normalizedPath = pathname === "/" ? "/" : pathname.replace(/\/$/, "");
|
|
1861
1898
|
let bestMatch = null;
|
|
1862
1899
|
let page = route;
|
|
1863
1900
|
for (const boundaryEntry of boundaries.values()) {
|
|
1864
|
-
if (!
|
|
1865
|
-
const groupScope =
|
|
1901
|
+
if (!_chunk7ZDLE77Pcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
|
|
1902
|
+
const groupScope = _chunkIGBQSUT5cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
|
|
1866
1903
|
if (groupScope !== null) {
|
|
1867
|
-
if (page === void 0) page = this.matchPageRoute(
|
|
1868
|
-
if (!
|
|
1904
|
+
if (page === void 0) page = this.matchPageRoute(_chunk7ZDLE77Pcjs.splitRoutePath.call(void 0, normalizedPath));
|
|
1905
|
+
if (!_chunkIGBQSUT5cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
|
|
1869
1906
|
}
|
|
1870
1907
|
const depth = boundaryEntry.route.segments.length;
|
|
1871
|
-
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess',
|
|
1872
|
-
if (!bestMatch || depth > bestDepth || depth === bestDepth &&
|
|
1908
|
+
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _51 => _51.route, 'access', _52 => _52.segments, 'access', _53 => _53.length]), () => ( -1));
|
|
1909
|
+
if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkIGBQSUT5cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkIGBQSUT5cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
|
|
1873
1910
|
bestMatch = boundaryEntry;
|
|
1874
1911
|
}
|
|
1875
1912
|
}
|
|
@@ -1880,13 +1917,13 @@ var RouteManager = class _RouteManager {
|
|
|
1880
1917
|
*/
|
|
1881
1918
|
logRoutes() {
|
|
1882
1919
|
if (this.routes.size > 0) {
|
|
1883
|
-
|
|
1920
|
+
_chunk7ZDLE77Pcjs.logger.info("Registered routes:");
|
|
1884
1921
|
for (const [pattern, entry] of this.routes) {
|
|
1885
1922
|
console.log(` ${pattern} -> ${entry.modulePath}`);
|
|
1886
1923
|
}
|
|
1887
1924
|
}
|
|
1888
1925
|
if (this.layouts.size > 0) {
|
|
1889
|
-
|
|
1926
|
+
_chunk7ZDLE77Pcjs.logger.info("Registered layouts:");
|
|
1890
1927
|
for (const [pattern, entry] of this.layouts) {
|
|
1891
1928
|
console.log(` ${pattern} -> ${entry.modulePath}`);
|
|
1892
1929
|
}
|
|
@@ -1917,7 +1954,7 @@ var RouteManager = class _RouteManager {
|
|
|
1917
1954
|
}));
|
|
1918
1955
|
const i18n = this.getI18nConfig();
|
|
1919
1956
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1920
|
-
const result = await
|
|
1957
|
+
const result = await _chunkT4VF6BYVcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1921
1958
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1922
1959
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1923
1960
|
});
|
|
@@ -1934,25 +1971,25 @@ var RouteManager = class _RouteManager {
|
|
|
1934
1971
|
ssg: result.ssg.flatMap(
|
|
1935
1972
|
(page) => i18n.locales.map((locale) => ({
|
|
1936
1973
|
...page,
|
|
1937
|
-
urlPath:
|
|
1974
|
+
urlPath: _chunkKAD5WBY4cjs.localizeFarmPathname.call(void 0, page.urlPath, locale, i18n)
|
|
1938
1975
|
}))
|
|
1939
1976
|
),
|
|
1940
1977
|
ssr: result.ssr.flatMap(
|
|
1941
|
-
(routePath) => i18n.locales.map((locale) =>
|
|
1978
|
+
(routePath) => i18n.locales.map((locale) => _chunkKAD5WBY4cjs.localizeFarmPathname.call(void 0, routePath, locale, i18n))
|
|
1942
1979
|
)
|
|
1943
1980
|
};
|
|
1944
1981
|
}
|
|
1945
1982
|
/** A request pathname as routes see it: without the basePath and, with i18n, the locale. */
|
|
1946
1983
|
toRoutePathname(pathname) {
|
|
1947
1984
|
const i18n = this.getI18nConfig();
|
|
1948
|
-
return i18n ?
|
|
1985
|
+
return i18n ? _chunkKAD5WBY4cjs.stripFarmLocaleFromPathname.call(void 0, pathname, i18n) : _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, pathname, this.config.basePath);
|
|
1949
1986
|
}
|
|
1950
1987
|
localizeRedirectDestination(destination, locale) {
|
|
1951
1988
|
if (!destination.startsWith("/") || destination.startsWith("//")) {
|
|
1952
1989
|
return destination;
|
|
1953
1990
|
}
|
|
1954
1991
|
const i18n = this.getI18nConfig();
|
|
1955
|
-
return locale && i18n ?
|
|
1992
|
+
return locale && i18n ? _chunkKAD5WBY4cjs.localizeFarmHref.call(void 0, destination, locale, i18n) : this.config.basePath ? _chunkTFCBJFP7cjs.applyFarmBasePath.call(void 0, destination, this.config.basePath) : destination;
|
|
1956
1993
|
}
|
|
1957
1994
|
getI18nConfig() {
|
|
1958
1995
|
const i18n = this.config.i18n;
|
|
@@ -1964,7 +2001,7 @@ var RouteManager = class _RouteManager {
|
|
|
1964
2001
|
async isRouteSSG(modulePath) {
|
|
1965
2002
|
try {
|
|
1966
2003
|
const mod = await this.loadRouteModule(modulePath);
|
|
1967
|
-
const rendering = await
|
|
2004
|
+
const rendering = await _chunkT4VF6BYVcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1968
2005
|
return rendering.ssg;
|
|
1969
2006
|
} catch (e2) {
|
|
1970
2007
|
return false;
|
|
@@ -1976,7 +2013,7 @@ var RouteManager = class _RouteManager {
|
|
|
1976
2013
|
async hasRouteISR(modulePath) {
|
|
1977
2014
|
try {
|
|
1978
2015
|
const mod = await this.loadRouteModule(modulePath);
|
|
1979
|
-
const rendering = await
|
|
2016
|
+
const rendering = await _chunkT4VF6BYVcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1980
2017
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1981
2018
|
} catch (e3) {
|
|
1982
2019
|
return false;
|
|
@@ -1988,7 +2025,7 @@ var RouteManager = class _RouteManager {
|
|
|
1988
2025
|
async getRouteRevalidateInterval(modulePath) {
|
|
1989
2026
|
try {
|
|
1990
2027
|
const mod = await this.loadRouteModule(modulePath);
|
|
1991
|
-
const rendering = await
|
|
2028
|
+
const rendering = await _chunkT4VF6BYVcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1992
2029
|
return rendering.revalidate;
|
|
1993
2030
|
} catch (e4) {
|
|
1994
2031
|
return void 0;
|
|
@@ -1996,14 +2033,14 @@ var RouteManager = class _RouteManager {
|
|
|
1996
2033
|
}
|
|
1997
2034
|
};
|
|
1998
2035
|
function getPageDirectoryField(route, pattern) {
|
|
1999
|
-
const directory =
|
|
2036
|
+
const directory = _chunkIGBQSUT5cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
2000
2037
|
return directory === pattern ? {} : { directory };
|
|
2001
2038
|
}
|
|
2002
2039
|
function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
|
|
2003
2040
|
let result = destination;
|
|
2004
2041
|
for (const [key, rawValue] of Object.entries(params)) {
|
|
2005
2042
|
const segments = catchAllSegments[key];
|
|
2006
|
-
const value = segments ? segments.map(
|
|
2043
|
+
const value = segments ? segments.map(_chunkCUW7K4AUcjs.encodeConfigRouteSegment).join("/") : _chunkCUW7K4AUcjs.encodeConfigRouteSegment.call(void 0, rawValue);
|
|
2007
2044
|
result = replaceAll(result, `[[...${key}]]`, value);
|
|
2008
2045
|
result = replaceAll(result, `[...${key}]`, value);
|
|
2009
2046
|
result = replaceAll(result, `[${key}]`, value);
|
|
@@ -2075,7 +2112,7 @@ function replaceAll(input, search, replacement) {
|
|
|
2075
2112
|
}
|
|
2076
2113
|
async function safeGlobFiles(pattern, cwd) {
|
|
2077
2114
|
try {
|
|
2078
|
-
return await
|
|
2115
|
+
return await _chunk7ZDLE77Pcjs.globFiles.call(void 0, pattern, cwd);
|
|
2079
2116
|
} catch (e5) {
|
|
2080
2117
|
return [];
|
|
2081
2118
|
}
|
|
@@ -2089,6 +2126,7 @@ function toRealPath(filePath) {
|
|
|
2089
2126
|
}
|
|
2090
2127
|
|
|
2091
2128
|
// src/server/dev-client-manifest.ts
|
|
2129
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
2092
2130
|
var FARM_DEV_CLIENT_MANIFEST_MODULE = "/@farm/manifest";
|
|
2093
2131
|
function createFarmDevClientManifest(manifest, options) {
|
|
2094
2132
|
const { boot } = options;
|
|
@@ -2120,11 +2158,11 @@ function createFarmDevClientManifest(manifest, options) {
|
|
|
2120
2158
|
}
|
|
2121
2159
|
for (const layout of manifest.layouts) {
|
|
2122
2160
|
if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
|
|
2123
|
-
const groupScope =
|
|
2161
|
+
const groupScope = _chunkIGBQSUT5cjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
2124
2162
|
clientManifest.layouts[layout.pattern] = {
|
|
2125
2163
|
modulePath: layout.modulePath,
|
|
2126
2164
|
pattern: layout.pattern,
|
|
2127
|
-
...groupScope ? { urlPattern:
|
|
2165
|
+
...groupScope ? { urlPattern: _chunkIGBQSUT5cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
2128
2166
|
shouldHydrate: layout.shouldHydrate,
|
|
2129
2167
|
islandStrategy: layout.islandStrategy,
|
|
2130
2168
|
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
@@ -2141,6 +2179,7 @@ function createFarmDevClientManifest(manifest, options) {
|
|
|
2141
2179
|
}
|
|
2142
2180
|
|
|
2143
2181
|
// src/font-vite.ts
|
|
2182
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
2144
2183
|
|
|
2145
2184
|
|
|
2146
2185
|
|
|
@@ -2148,7 +2187,7 @@ function createFarmDevClientManifest(manifest, options) {
|
|
|
2148
2187
|
var _module = require('module');
|
|
2149
2188
|
var _url = require('url');
|
|
2150
2189
|
var FONT_IMPORTS = /* @__PURE__ */ new Set(["@farm.js/core", "@farm.js/core/font"]);
|
|
2151
|
-
var FARM_CORE_DIRECTORY = `${path4.default.dirname(typeof __filename === "string" ? __filename : _url.fileURLToPath.call(void 0,
|
|
2190
|
+
var FARM_CORE_DIRECTORY = `${path4.default.dirname(typeof __filename === "string" ? __filename : _url.fileURLToPath.call(void 0, _chunkUGL4BDNBcjs.define_import_meta_default.url)).replace(/\\/g, "/")}/`;
|
|
2152
2191
|
var FONT_FUNCTIONS = /* @__PURE__ */ new Set(["localFont", "remoteFont"]);
|
|
2153
2192
|
var FONT_CSS_PREFIX = "\0farm:font-css:";
|
|
2154
2193
|
var FONT_RUNTIME_ID = "\0farm:font-runtime";
|
|
@@ -2202,7 +2241,7 @@ function farmFontImportsPlugin(options = {}) {
|
|
|
2202
2241
|
return;
|
|
2203
2242
|
}
|
|
2204
2243
|
const resource = registry.getDevResource(pathname);
|
|
2205
|
-
if (!_optionalChain([resource, 'optionalAccess',
|
|
2244
|
+
if (!_optionalChain([resource, 'optionalAccess', _54 => _54.bytes])) {
|
|
2206
2245
|
next();
|
|
2207
2246
|
return;
|
|
2208
2247
|
}
|
|
@@ -2242,10 +2281,10 @@ function farmFontImportsPlugin(options = {}) {
|
|
|
2242
2281
|
register: (moduleId, calls) => registry.register(moduleId, calls, production)
|
|
2243
2282
|
});
|
|
2244
2283
|
if (!result) registry.clearModule(id.split("?", 1)[0]);
|
|
2245
|
-
const server = this.environment ? this.environment.config.consumer === "server" : _optionalChain([transformOptions, 'optionalAccess',
|
|
2284
|
+
const server = this.environment ? this.environment.config.consumer === "server" : _optionalChain([transformOptions, 'optionalAccess', _55 => _55.ssr]) === true;
|
|
2246
2285
|
const cleanId = id.split("?", 1)[0];
|
|
2247
|
-
if (server && MODULE_EXTENSION_RE.test(cleanId) && _optionalChain([options, 'access',
|
|
2248
|
-
const source = _nullishCoalesce(_optionalChain([result, 'optionalAccess',
|
|
2286
|
+
if (server && MODULE_EXTENSION_RE.test(cleanId) && _optionalChain([options, 'access', _56 => _56.isLayoutModule, 'optionalCall', _57 => _57(cleanId)])) {
|
|
2287
|
+
const source = _nullishCoalesce(_optionalChain([result, 'optionalAccess', _58 => _58.code]), () => ( code));
|
|
2249
2288
|
const inferred = addInferredLayoutFonts(source, this.parse(source));
|
|
2250
2289
|
if (inferred) return { code: inferred, map: null };
|
|
2251
2290
|
}
|
|
@@ -2795,7 +2834,7 @@ function readFontOptions(code, id, call) {
|
|
|
2795
2834
|
const declaration = call.ancestors.at(-2);
|
|
2796
2835
|
const statement = call.ancestors.at(-3);
|
|
2797
2836
|
const statementParent = call.ancestors.at(-4);
|
|
2798
|
-
const isModuleScope = _optionalChain([declaration, 'optionalAccess',
|
|
2837
|
+
const isModuleScope = _optionalChain([declaration, 'optionalAccess', _59 => _59.type]) === "VariableDeclaration" && (_optionalChain([statement, 'optionalAccess', _60 => _60.type]) === "Program" || _optionalChain([statement, 'optionalAccess', _61 => _61.type]) === "ExportNamedDeclaration" && _optionalChain([statementParent, 'optionalAccess', _62 => _62.type]) === "Program");
|
|
2799
2838
|
if (!isModuleScope || call.ancestors.some((ancestor) => isFunctionNode(ancestor))) {
|
|
2800
2839
|
throw fontError(id, `${call.kind}() must be declared directly at module scope`);
|
|
2801
2840
|
}
|
|
@@ -3211,6 +3250,7 @@ function fontError(id, message) {
|
|
|
3211
3250
|
}
|
|
3212
3251
|
|
|
3213
3252
|
// src/server/dev-styles.ts
|
|
3253
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3214
3254
|
|
|
3215
3255
|
|
|
3216
3256
|
function resolveDevGlobalStylesheetHref(root, srcDir = "src") {
|
|
@@ -3254,6 +3294,7 @@ function farmDevServerStylesheetsPlugin() {
|
|
|
3254
3294
|
}
|
|
3255
3295
|
|
|
3256
3296
|
// src/integration-provider-build.ts
|
|
3297
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3257
3298
|
|
|
3258
3299
|
function isRendererCompiledComponent(moduleId, rendererComponentExtensions) {
|
|
3259
3300
|
const lowered = moduleId.toLowerCase();
|
|
@@ -3274,7 +3315,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
|
|
|
3274
3315
|
let hasClerkProvider = false;
|
|
3275
3316
|
renderedProviders.forEach((provider, index) => {
|
|
3276
3317
|
let componentExpression = "null";
|
|
3277
|
-
if (
|
|
3318
|
+
if (_chunkN4AM7Q34cjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
3278
3319
|
const namespace = `FarmIntegrationProviderModule${index}`;
|
|
3279
3320
|
imports.push(
|
|
3280
3321
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -3331,7 +3372,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
|
|
|
3331
3372
|
const entries = [];
|
|
3332
3373
|
let needsMarkHelper = false;
|
|
3333
3374
|
providers.forEach((provider, index) => {
|
|
3334
|
-
if (!
|
|
3375
|
+
if (!_chunkN4AM7Q34cjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
|
|
3335
3376
|
const namespace = `FarmServerIntegrationProviderModule${index}`;
|
|
3336
3377
|
imports.push(
|
|
3337
3378
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -3356,25 +3397,27 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
|
|
|
3356
3397
|
}
|
|
3357
3398
|
function resolveProviderModule(moduleId, root) {
|
|
3358
3399
|
if (!moduleId.startsWith(".")) return moduleId;
|
|
3359
|
-
return
|
|
3400
|
+
return _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, path4.default.resolve(root, moduleId), root);
|
|
3360
3401
|
}
|
|
3361
3402
|
|
|
3362
3403
|
// src/server-actions-mode.ts
|
|
3404
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3363
3405
|
function resolveFarmIslxActionsMode(config) {
|
|
3364
|
-
if (
|
|
3406
|
+
if (_chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) === "islands") {
|
|
3365
3407
|
return "islands";
|
|
3366
3408
|
}
|
|
3367
|
-
if (_optionalChain([config, 'access',
|
|
3409
|
+
if (_optionalChain([config, 'access', _63 => _63.experimental, 'optionalAccess', _64 => _64.serverActions]) !== true) return null;
|
|
3368
3410
|
const renderer = config.renderer;
|
|
3369
3411
|
if (renderer === void 0 || renderer === false) return null;
|
|
3370
|
-
if (
|
|
3412
|
+
if (_chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, renderer) || _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, renderer)) return null;
|
|
3371
3413
|
return "renderer";
|
|
3372
3414
|
}
|
|
3373
3415
|
function farmBrowserServerFnsEnabled(config) {
|
|
3374
|
-
return _optionalChain([config, 'access',
|
|
3416
|
+
return _optionalChain([config, 'access', _65 => _65.experimental, 'optionalAccess', _66 => _66.serverActions]) === true && resolveFarmIslxActionsMode(config) !== null;
|
|
3375
3417
|
}
|
|
3376
3418
|
|
|
3377
3419
|
// src/island-inference.ts
|
|
3420
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3378
3421
|
|
|
3379
3422
|
|
|
3380
3423
|
var _compiler = require('@farm.js/islx/compiler');
|
|
@@ -3414,7 +3457,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
3414
3457
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
3415
3458
|
parse: parseFarmIslandSource,
|
|
3416
3459
|
resolve: (specifier, importer) => {
|
|
3417
|
-
const resolved =
|
|
3460
|
+
const resolved = _chunkZCT6B5PQcjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
3418
3461
|
return resolved.local ? resolved.path : null;
|
|
3419
3462
|
}
|
|
3420
3463
|
});
|
|
@@ -3450,7 +3493,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
3450
3493
|
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3451
3494
|
return cached.result;
|
|
3452
3495
|
}
|
|
3453
|
-
const { result, files } =
|
|
3496
|
+
const { result, files } = _chunkZCT6B5PQcjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
|
|
3454
3497
|
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3455
3498
|
routeRootInferences.set(key, {
|
|
3456
3499
|
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
@@ -3467,7 +3510,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3467
3510
|
const files = [];
|
|
3468
3511
|
const modules = [];
|
|
3469
3512
|
for (const owner of owners) {
|
|
3470
|
-
const rendered =
|
|
3513
|
+
const rendered = _chunkZCT6B5PQcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
3471
3514
|
if (!rendered) {
|
|
3472
3515
|
return {
|
|
3473
3516
|
strategy: null,
|
|
@@ -3483,7 +3526,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3483
3526
|
source = fs2.default.readFileSync(module, "utf8");
|
|
3484
3527
|
} catch (e12) {
|
|
3485
3528
|
}
|
|
3486
|
-
if (
|
|
3529
|
+
if (_chunkZCT6B5PQcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
3487
3530
|
}
|
|
3488
3531
|
for (const module of modules) {
|
|
3489
3532
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3495,7 +3538,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3495
3538
|
function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
|
|
3496
3539
|
const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3497
3540
|
const onRoute = layouts.filter(
|
|
3498
|
-
(layout) =>
|
|
3541
|
+
(layout) => _chunkIGBQSUT5cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
|
|
3499
3542
|
);
|
|
3500
3543
|
const declared = [
|
|
3501
3544
|
...page.islandStrategy ? [page.islandStrategy] : [],
|
|
@@ -3516,6 +3559,7 @@ function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
|
|
|
3516
3559
|
}
|
|
3517
3560
|
|
|
3518
3561
|
// src/server/renderer.ts
|
|
3562
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3519
3563
|
|
|
3520
3564
|
var _https = require('https'); var https = _interopRequireWildcard(_https);
|
|
3521
3565
|
var _net = require('net');
|
|
@@ -3524,11 +3568,12 @@ var _tls = require('tls'); var tls = _interopRequireWildcard(_tls);
|
|
|
3524
3568
|
var _stream = require('stream');
|
|
3525
3569
|
|
|
3526
3570
|
// src/not-found.ts
|
|
3571
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3527
3572
|
|
|
3528
3573
|
|
|
3529
3574
|
function resolveFarmNotFoundComponentPath(config, appDirs, discovered) {
|
|
3530
|
-
const extensions =
|
|
3531
|
-
const configuredPath = _optionalChain([config, 'access',
|
|
3575
|
+
const extensions = _chunkLEZJZX4Ccjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
|
|
3576
|
+
const configuredPath = _optionalChain([config, 'access', _67 => _67.notFound, 'optionalAccess', _68 => _68.component, 'optionalAccess', _69 => _69.trim, 'call', _70 => _70()]);
|
|
3532
3577
|
if (configuredPath) {
|
|
3533
3578
|
const componentPath = path4.default.isAbsolute(configuredPath) ? path4.default.normalize(configuredPath) : path4.default.resolve(config.root, configuredPath);
|
|
3534
3579
|
if (!extensions.some((extension) => componentPath.endsWith(extension))) {
|
|
@@ -3556,6 +3601,7 @@ function resolveFarmNotFoundComponentPath(config, appDirs, discovered) {
|
|
|
3556
3601
|
}
|
|
3557
3602
|
|
|
3558
3603
|
// src/navigation/segment-navigation.ts
|
|
3604
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3559
3605
|
function getFarmLayoutKey(pattern, params) {
|
|
3560
3606
|
return pattern.replace(
|
|
3561
3607
|
/\[\[?\.\.\.([^\]]+)\]?\]|\[([^\]]+)\]/g,
|
|
@@ -3567,11 +3613,11 @@ function getFarmLayoutKey(pattern, params) {
|
|
|
3567
3613
|
);
|
|
3568
3614
|
}
|
|
3569
3615
|
function countFarmKeptLayouts(layoutsHeader, layouts, params) {
|
|
3570
|
-
const chain =
|
|
3616
|
+
const chain = _chunkIGBQSUT5cjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
|
|
3571
3617
|
if (chain.length === 0) return 0;
|
|
3572
3618
|
const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
|
|
3573
|
-
if (chain[0] === keys[0]) return
|
|
3574
|
-
return keys.length > 1 ? 1 +
|
|
3619
|
+
if (chain[0] === keys[0]) return _chunkIGBQSUT5cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
|
|
3620
|
+
return keys.length > 1 ? 1 + _chunkIGBQSUT5cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
|
|
3575
3621
|
}
|
|
3576
3622
|
function createFarmFlushToken() {
|
|
3577
3623
|
const bytes = new Uint8Array(16);
|
|
@@ -3585,6 +3631,7 @@ function farmFlushMarker(token) {
|
|
|
3585
3631
|
}
|
|
3586
3632
|
|
|
3587
3633
|
// src/components/not-found-styles.ts
|
|
3634
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3588
3635
|
var DEFAULT_NOT_FOUND_STYLES = `
|
|
3589
3636
|
body {
|
|
3590
3637
|
margin: 0;
|
|
@@ -3742,6 +3789,7 @@ body {
|
|
|
3742
3789
|
|
|
3743
3790
|
|
|
3744
3791
|
// src/server/error-diagnostics.ts
|
|
3792
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3745
3793
|
|
|
3746
3794
|
|
|
3747
3795
|
|
|
@@ -3823,13 +3871,15 @@ function createDefaultErrorDiagnostics(error, root) {
|
|
|
3823
3871
|
}
|
|
3824
3872
|
|
|
3825
3873
|
// src/islands-client-boot.ts
|
|
3874
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3826
3875
|
function canBootFarmIslandsClient(config) {
|
|
3827
3876
|
const docs = config.docs;
|
|
3828
3877
|
const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
|
|
3829
|
-
return
|
|
3878
|
+
return _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) === "islands" && !docsEnabled && _chunkADCVSTFVcjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkADCVSTFVcjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
|
|
3830
3879
|
}
|
|
3831
3880
|
|
|
3832
3881
|
// src/islands-kept-layouts.ts
|
|
3882
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
3833
3883
|
|
|
3834
3884
|
|
|
3835
3885
|
|
|
@@ -3874,7 +3924,7 @@ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
|
|
|
3874
3924
|
function parse(code, file) {
|
|
3875
3925
|
const extension = path4.default.extname(file).slice(1);
|
|
3876
3926
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
|
|
3877
|
-
return
|
|
3927
|
+
return _chunkZCT6B5PQcjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
|
|
3878
3928
|
try {
|
|
3879
3929
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
3880
3930
|
} catch (e15) {
|
|
@@ -3964,11 +4014,11 @@ function findFarmRequestDecidingConstruct(code, file) {
|
|
|
3964
4014
|
reason = "import.meta";
|
|
3965
4015
|
return;
|
|
3966
4016
|
case "CallExpression":
|
|
3967
|
-
if (_optionalChain([current, 'access',
|
|
4017
|
+
if (_optionalChain([current, 'access', _71 => _71.callee, 'optionalAccess', _72 => _72.type]) === "Identifier" && current.callee.name === "use") {
|
|
3968
4018
|
reason = "a use() call";
|
|
3969
4019
|
return;
|
|
3970
4020
|
}
|
|
3971
|
-
if (_optionalChain([current, 'access',
|
|
4021
|
+
if (_optionalChain([current, 'access', _73 => _73.callee, 'optionalAccess', _74 => _74.type]) === "MemberExpression" && !current.callee.computed && _optionalChain([current, 'access', _75 => _75.callee, 'access', _76 => _76.object, 'optionalAccess', _77 => _77.type]) === "Identifier" && current.callee.object.name === "Math" && _optionalChain([current, 'access', _78 => _78.callee, 'access', _79 => _79.property, 'optionalAccess', _80 => _80.name]) === "random") {
|
|
3972
4022
|
reason = "Math.random()";
|
|
3973
4023
|
return;
|
|
3974
4024
|
}
|
|
@@ -4009,14 +4059,14 @@ function isReference(node, parent, key) {
|
|
|
4009
4059
|
}
|
|
4010
4060
|
function readSource(file) {
|
|
4011
4061
|
try {
|
|
4012
|
-
|
|
4062
|
+
_chunkZCT6B5PQcjs.noteFarmSourceRead.call(void 0, file);
|
|
4013
4063
|
return fs2.default.readFileSync(file, "utf8");
|
|
4014
4064
|
} catch (e16) {
|
|
4015
4065
|
return null;
|
|
4016
4066
|
}
|
|
4017
4067
|
}
|
|
4018
4068
|
function explainFarmKeptLayoutRender(modulePath, root) {
|
|
4019
|
-
const entry =
|
|
4069
|
+
const entry = _chunkZCT6B5PQcjs.resolveModuleSourcePath.call(void 0, modulePath, root);
|
|
4020
4070
|
if (!entry) return `${modulePath} does not resolve`;
|
|
4021
4071
|
const visited = /* @__PURE__ */ new Set();
|
|
4022
4072
|
const check = (file) => {
|
|
@@ -4026,7 +4076,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
4026
4076
|
if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
|
|
4027
4077
|
const code = readSource(file);
|
|
4028
4078
|
if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
|
|
4029
|
-
const { reason, imports } =
|
|
4079
|
+
const { reason, imports } = _chunkZCT6B5PQcjs.memoizeInFarmSourceSnapshot.call(void 0,
|
|
4030
4080
|
"kept-layout-module",
|
|
4031
4081
|
code,
|
|
4032
4082
|
() => findFarmRequestDecidingConstruct(code, file)
|
|
@@ -4039,7 +4089,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
4039
4089
|
return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
|
|
4040
4090
|
}
|
|
4041
4091
|
if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
|
|
4042
|
-
const resolved =
|
|
4092
|
+
const resolved = _chunkZCT6B5PQcjs.resolveImportedModule.call(void 0, file, imported.source, root);
|
|
4043
4093
|
if (!resolved.path || !resolved.local) {
|
|
4044
4094
|
return `${path4.default.relative(root, file)} imports ${imported.source}`;
|
|
4045
4095
|
}
|
|
@@ -4054,15 +4104,15 @@ var answers = /* @__PURE__ */ new Map();
|
|
|
4054
4104
|
function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
4055
4105
|
const key = `${root}\0${modulePath}`;
|
|
4056
4106
|
const known = answers.get(key);
|
|
4057
|
-
if (known && known.stamps.every(([file, stamp]) =>
|
|
4107
|
+
if (known && known.stamps.every(([file, stamp]) => _chunkZCT6B5PQcjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
|
|
4058
4108
|
return known.skip;
|
|
4059
4109
|
}
|
|
4060
|
-
const { result, files } =
|
|
4110
|
+
const { result, files } = _chunkZCT6B5PQcjs.traceFarmSourceReads.call(void 0,
|
|
4061
4111
|
() => explainFarmKeptLayoutRender(modulePath, root) === null
|
|
4062
4112
|
);
|
|
4063
4113
|
answers.set(key, {
|
|
4064
4114
|
skip: result,
|
|
4065
|
-
stamps: files.map((file) => [file,
|
|
4115
|
+
stamps: files.map((file) => [file, _chunkZCT6B5PQcjs.getFarmSourceStamp.call(void 0, file)])
|
|
4066
4116
|
});
|
|
4067
4117
|
return result;
|
|
4068
4118
|
}
|
|
@@ -4097,7 +4147,7 @@ function pipeFarmRendererWebStream(runtime) {
|
|
|
4097
4147
|
source.once("error", (error) => {
|
|
4098
4148
|
if (settleShell(error)) return;
|
|
4099
4149
|
callbacks.onError(error);
|
|
4100
|
-
_optionalChain([destination, 'optionalAccess',
|
|
4150
|
+
_optionalChain([destination, 'optionalAccess', _81 => _81.end, 'call', _82 => _82()]);
|
|
4101
4151
|
});
|
|
4102
4152
|
},
|
|
4103
4153
|
(error) => settleShell(error)
|
|
@@ -4105,12 +4155,12 @@ function pipeFarmRendererWebStream(runtime) {
|
|
|
4105
4155
|
return {
|
|
4106
4156
|
pipe(target) {
|
|
4107
4157
|
destination = target;
|
|
4108
|
-
_optionalChain([source, 'optionalAccess',
|
|
4158
|
+
_optionalChain([source, 'optionalAccess', _83 => _83.pipe, 'call', _84 => _84(target)]);
|
|
4109
4159
|
},
|
|
4110
4160
|
abort() {
|
|
4111
4161
|
aborted = true;
|
|
4112
|
-
_optionalChain([source, 'optionalAccess',
|
|
4113
|
-
_optionalChain([destination, 'optionalAccess',
|
|
4162
|
+
_optionalChain([source, 'optionalAccess', _85 => _85.destroy, 'call', _86 => _86()]);
|
|
4163
|
+
_optionalChain([destination, 'optionalAccess', _87 => _87.end, 'call', _88 => _88()]);
|
|
4114
4164
|
}
|
|
4115
4165
|
};
|
|
4116
4166
|
};
|
|
@@ -4190,7 +4240,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
4190
4240
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
4191
4241
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
4192
4242
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
4193
|
-
|
|
4243
|
+
_chunk7ZDLE77Pcjs.logger.warn(_chunkZCT6B5PQcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
4194
4244
|
}
|
|
4195
4245
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
4196
4246
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -4198,7 +4248,7 @@ var reportedRenderErrors = /* @__PURE__ */ new WeakMap();
|
|
|
4198
4248
|
function emitFarmRenderError(req, route, error) {
|
|
4199
4249
|
if (reportedRenderErrors.has(req) && reportedRenderErrors.get(req) === error) return;
|
|
4200
4250
|
reportedRenderErrors.set(req, error);
|
|
4201
|
-
|
|
4251
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, { type: "render.error", route, error });
|
|
4202
4252
|
}
|
|
4203
4253
|
function hasRequestHeader(req, name) {
|
|
4204
4254
|
const value = req.headers[name.toLowerCase()];
|
|
@@ -4227,7 +4277,7 @@ function appendResponseHeader(res, name, value) {
|
|
|
4227
4277
|
}
|
|
4228
4278
|
}
|
|
4229
4279
|
function requestHeader(req, name) {
|
|
4230
|
-
const value = _optionalChain([req, 'access',
|
|
4280
|
+
const value = _optionalChain([req, 'access', _89 => _89.headers, 'optionalAccess', _90 => _90[name]]);
|
|
4231
4281
|
return Array.isArray(value) ? value[0] : value;
|
|
4232
4282
|
}
|
|
4233
4283
|
function appendResponseVary(res, value) {
|
|
@@ -4241,14 +4291,14 @@ function appendResponseVary(res, value) {
|
|
|
4241
4291
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
4242
4292
|
if (snapshot.routing === "none") return "";
|
|
4243
4293
|
const url = new URL(requestPath, "http://farm.local");
|
|
4244
|
-
return
|
|
4294
|
+
return _chunkIGBQSUT5cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
4245
4295
|
}
|
|
4246
4296
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
4247
4297
|
function createPPRRefreshScript() {
|
|
4248
4298
|
return `<script>(function(){if(window.__FARM_PPR_REFRESHING__)return;window.__FARM_PPR_REFRESHING__=true;var owner=document.currentScript;function applyState(doc){doc.querySelectorAll("script[data-farm-refresh-state]").forEach(function(source){var script=document.createElement("script");if(owner&&owner.nonce)script.nonce=owner.nonce;script.textContent=source.textContent||"";document.head.appendChild(script);script.remove();});}function key(node){return node.nodeType===1?node.getAttribute("id"):null}function compatible(current,next){if(current.nodeType!==next.nodeType)return false;if(current.nodeType===1&¤t.tagName!==next.tagName)return false;var currentKey=key(current);var nextKey=key(next);return currentKey||nextKey?currentKey===nextKey:true}function syncAttributes(current,next){Array.from(current.attributes).forEach(function(attribute){if(!next.hasAttribute(attribute.name))current.removeAttribute(attribute.name)});Array.from(next.attributes).forEach(function(attribute){if(current.getAttribute(attribute.name)!==attribute.value)current.setAttribute(attribute.name,attribute.value)})}function syncChildren(current,next){var cursor=current.firstChild;Array.from(next.childNodes).forEach(function(nextChild){if(cursor&&compatible(cursor,nextChild)){var matched=cursor;cursor=cursor.nextSibling;syncNode(matched,nextChild);return}var candidate=cursor;while(candidate&&!compatible(candidate,nextChild))candidate=candidate.nextSibling;if(candidate){current.insertBefore(candidate,cursor);syncNode(candidate,nextChild);return}current.insertBefore(nextChild.cloneNode(true),cursor)});while(cursor){var stale=cursor;cursor=cursor.nextSibling;stale.remove()}}function syncNode(current,next){if(current.nodeType===3||current.nodeType===8){if(current.nodeValue!==next.nodeValue)current.nodeValue=next.nodeValue;return}if(current.nodeType!==1)return;var tag=current.tagName;var value=tag==="INPUT"&¤t.type==="file"?null:"value" in current?current.value:null;var checked="checked" in current?current.checked:null;var selected=tag==="SELECT"?Array.from(current.options).map(function(option){return option.selected}):null;var focused=document.activeElement===current;var selection=focused&&typeof current.selectionStart==="number"?[current.selectionStart,current.selectionEnd,current.selectionDirection]:null;syncAttributes(current,next);syncChildren(current,next);if(value!==null)current.value=value;if(checked!==null)current.checked=checked;if(selected)Array.from(current.options).forEach(function(option,index){option.selected=selected[index]===true});if(selection)try{current.setSelectionRange(selection[0],selection[1],selection[2])}catch{}}function replaceRoot(html){var doc=new DOMParser().parseFromString(html,"text/html");var next=doc.getElementById("root");var current=document.getElementById("root");if(!next||!current)return false;applyState(doc);syncNode(current,next);return true}var attempts=0,settle;window.__FARM_PPR_REFRESH_PROMISE__=new Promise(function(resolve){settle=resolve;});function release(){window.__FARM_PPR_REFRESHING__=false;}function retry(){settle();if(window.__FARM_PPR_HYDRATING__||attempts>=${PPR_REFRESH_MAX_ATTEMPTS})return release();if(navigator.onLine===false){window.addEventListener("online",run,{once:true});return;}setTimeout(run,1000*Math.pow(2,attempts-1));}function run(){if(window.__FARM_PPR_HYDRATING__)return release();attempts++;fetch(window.location.href,{cache:"no-store",credentials:"same-origin",headers:{"x-farm-ppr-refresh":"1"}}).then(function(response){if(!response.ok)throw new Error("status "+response.status);return response.text();}).then(function(html){if(window.__FARM_PPR_HYDRATING__)return release();if(!replaceRoot(html))throw new Error("no root");settle();}).catch(retry);}run();})();</script>`;
|
|
4249
4299
|
}
|
|
4250
4300
|
function rendererRenderOptions() {
|
|
4251
|
-
const nonce =
|
|
4301
|
+
const nonce = _chunkXEPUUTGCcjs._resolveCurrentCspNonce.call(void 0, );
|
|
4252
4302
|
return nonce ? { nonce } : void 0;
|
|
4253
4303
|
}
|
|
4254
4304
|
var FARM_DEV_EARLY_CLIENT_SCRIPT = `<script type="module" async src="/@farm/client.js"></script>`;
|
|
@@ -4267,7 +4317,7 @@ function createDocumentFooter(options) {
|
|
|
4267
4317
|
}
|
|
4268
4318
|
function createDeferredHydrationScript(records) {
|
|
4269
4319
|
return `<script data-farm-refresh-state>window.__FARM_DEFERRED_DATA__=${serializeInlineValue(
|
|
4270
|
-
|
|
4320
|
+
_chunkZ2JQR56Wcjs.snapshotDeferredData.call(void 0, records)
|
|
4271
4321
|
)};</script>`;
|
|
4272
4322
|
}
|
|
4273
4323
|
function toMiddlewareMap(input) {
|
|
@@ -4332,17 +4382,17 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4332
4382
|
}
|
|
4333
4383
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4334
4384
|
const params = parseRouteModuleSchema(
|
|
4335
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4385
|
+
_optionalChain([schemas, 'optionalAccess', _91 => _91.params]),
|
|
4336
4386
|
input.props.params,
|
|
4337
4387
|
"params",
|
|
4338
4388
|
input.routePath
|
|
4339
4389
|
);
|
|
4340
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4390
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _92 => _92.search]), input.search, "search", input.routePath);
|
|
4341
4391
|
return {
|
|
4342
4392
|
...input.props,
|
|
4343
4393
|
params,
|
|
4344
4394
|
search,
|
|
4345
|
-
searchParams:
|
|
4395
|
+
searchParams: _chunkK6LZMZNBcjs.createFarmSearchParams.call(void 0, search)
|
|
4346
4396
|
};
|
|
4347
4397
|
}
|
|
4348
4398
|
function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
@@ -4360,7 +4410,7 @@ function createRouteStateProps(input) {
|
|
|
4360
4410
|
return {
|
|
4361
4411
|
params: input.params,
|
|
4362
4412
|
search: input.searchParamsObject,
|
|
4363
|
-
searchParams:
|
|
4413
|
+
searchParams: _chunkK6LZMZNBcjs.createFarmSearchParams.call(void 0, input.searchParamsObject),
|
|
4364
4414
|
path: input.path,
|
|
4365
4415
|
middleware: input.middlewareMap.size > 0 ? { data: input.middlewareMap } : void 0,
|
|
4366
4416
|
context: input.pluginExposedContext.size > 0 ? { data: input.pluginExposedContext } : void 0
|
|
@@ -4379,44 +4429,44 @@ var pageRequests = /* @__PURE__ */ new WeakMap();
|
|
|
4379
4429
|
var ServerRenderer = class {
|
|
4380
4430
|
constructor(config, routeManager, i18nRuntime, viteServer) {
|
|
4381
4431
|
this.ssgManifest = [];
|
|
4382
|
-
this.dataCache =
|
|
4432
|
+
this.dataCache = _chunkVD7ENQP2cjs.getFarmDataCache.call(void 0, );
|
|
4383
4433
|
this.rendererServerModuleCurrent = () => true;
|
|
4384
4434
|
this.config = config;
|
|
4385
4435
|
this.routeManager = routeManager;
|
|
4386
4436
|
this.i18nRuntime = i18nRuntime;
|
|
4387
4437
|
this.viteServer = viteServer;
|
|
4388
|
-
this.security =
|
|
4438
|
+
this.security = _chunkIEZFFXSCcjs.resolveFarmSecurityConfig.call(void 0, config.security);
|
|
4389
4439
|
this.loadSSGManifest();
|
|
4390
4440
|
}
|
|
4391
4441
|
async initialize() {
|
|
4392
4442
|
if (this.rendererRuntime && this.rendererServerModuleCurrent()) return;
|
|
4393
4443
|
if (this.islandValues()) {
|
|
4394
|
-
|
|
4444
|
+
_chunkYLEL4ZRQcjs.installFarmIslandValues.call(void 0, );
|
|
4395
4445
|
(await import("./internal/islands-server.cjs")).installFarmIslandsServer();
|
|
4396
4446
|
await _asyncNullishCoalesce(islands, async () => ( (islands = await import("./internal/islands-runtime.cjs"))));
|
|
4397
4447
|
} else {
|
|
4398
|
-
|
|
4448
|
+
_chunkYLEL4ZRQcjs.uninstallFarmIslandValues.call(void 0, );
|
|
4399
4449
|
}
|
|
4400
|
-
if (_optionalChain([this, 'access',
|
|
4401
|
-
resolveFarmNotFoundComponentPath(this.config,
|
|
4450
|
+
if (_optionalChain([this, 'access', _93 => _93.config, 'access', _94 => _94.notFound, 'optionalAccess', _95 => _95.component, 'optionalAccess', _96 => _96.trim, 'call', _97 => _97()])) {
|
|
4451
|
+
resolveFarmNotFoundComponentPath(this.config, _chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, this.config));
|
|
4402
4452
|
}
|
|
4403
|
-
const loaded =
|
|
4404
|
-
|
|
4453
|
+
const loaded = _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? await import("./renderer/none/server.cjs") : this.viteServer ? await _chunkVB7P66Q4cjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
|
|
4454
|
+
_chunkLEZJZX4Ccjs.resolveFarmRendererModule.call(void 0,
|
|
4405
4455
|
this.config.root || process.cwd(),
|
|
4406
4456
|
this.config.renderer.server
|
|
4407
4457
|
)
|
|
4408
4458
|
).href);
|
|
4409
|
-
this.rendererServerModuleCurrent = this.viteServer && !
|
|
4459
|
+
this.rendererServerModuleCurrent = this.viteServer && !_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, this.config.renderer) && !_chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? _chunkVB7P66Q4cjs.createFarmDevModuleCheck.call(void 0, this.viteServer, loaded) : () => true;
|
|
4410
4460
|
const runtime = loaded;
|
|
4411
|
-
|
|
4412
|
-
|
|
4461
|
+
_chunkLEZJZX4Ccjs.assertFarmRendererServerModule.call(void 0, runtime, this.config.renderer);
|
|
4462
|
+
_chunkLEZJZX4Ccjs.assertFarmRendererStreamingRuntime.call(void 0,
|
|
4413
4463
|
this.config.renderer.name,
|
|
4414
4464
|
this.config.renderer,
|
|
4415
4465
|
runtime,
|
|
4416
4466
|
"node"
|
|
4417
4467
|
);
|
|
4418
4468
|
this.rendererRuntime = islands && this.islandValues() ? withFarmIslandsRenders(runtime, islands) : runtime;
|
|
4419
|
-
_optionalChain([this, 'access',
|
|
4469
|
+
_optionalChain([this, 'access', _98 => _98.routeManager, 'access', _99 => _99.setRendererRuntime, 'optionalCall', _100 => _100(this.rendererRuntime)]);
|
|
4420
4470
|
await this.applyRendererAppSetup();
|
|
4421
4471
|
}
|
|
4422
4472
|
/**
|
|
@@ -4425,7 +4475,7 @@ var ServerRenderer = class {
|
|
|
4425
4475
|
* re-applied on the next request without restarting.
|
|
4426
4476
|
*/
|
|
4427
4477
|
async applyRendererAppSetup() {
|
|
4428
|
-
const appSetupPath =
|
|
4478
|
+
const appSetupPath = _chunkLEZJZX4Ccjs.resolveFarmRendererAppSetup.call(void 0,
|
|
4429
4479
|
this.config.root || process.cwd(),
|
|
4430
4480
|
this.config.renderer
|
|
4431
4481
|
);
|
|
@@ -4436,7 +4486,7 @@ var ServerRenderer = class {
|
|
|
4436
4486
|
`Renderer \`${this.config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`
|
|
4437
4487
|
);
|
|
4438
4488
|
}
|
|
4439
|
-
const setupModule = this.viteServer ? await
|
|
4489
|
+
const setupModule = this.viteServer ? await _chunkVB7P66Q4cjs.loadFarmDevModule.call(void 0, this.viteServer, appSetupPath) : await import(_url.pathToFileURL.call(void 0, appSetupPath).href);
|
|
4440
4490
|
if (setupModule === this.appliedAppSetupModule) return;
|
|
4441
4491
|
this.appliedAppSetupModule = setupModule;
|
|
4442
4492
|
configureApp(setupModule.default);
|
|
@@ -4486,7 +4536,7 @@ var ServerRenderer = class {
|
|
|
4486
4536
|
/// Stylesheets the app imported through JS (fontsource packages, component
|
|
4487
4537
|
/// CSS) that the document must link alongside globals.css — see #658.
|
|
4488
4538
|
collectDevStyleHrefs() {
|
|
4489
|
-
const graph = _optionalChain([this, 'access',
|
|
4539
|
+
const graph = _optionalChain([this, 'access', _101 => _101.viteServer, 'optionalAccess', _102 => _102.moduleGraph]);
|
|
4490
4540
|
if (!graph) return [];
|
|
4491
4541
|
return collectDevStylesheetUrls(
|
|
4492
4542
|
graph.idToModuleMap.values(),
|
|
@@ -4537,7 +4587,7 @@ var ServerRenderer = class {
|
|
|
4537
4587
|
"data-farm-layout-boundary": "true",
|
|
4538
4588
|
"data-farm-layout-pattern": pattern,
|
|
4539
4589
|
...segment ? { "data-farm-layout-key": segment.key } : {},
|
|
4540
|
-
..._optionalChain([segment, 'optionalAccess',
|
|
4590
|
+
..._optionalChain([segment, 'optionalAccess', _103 => _103.kept]) ? { "data-farm-layout-kept": "true" } : {},
|
|
4541
4591
|
style: { display: "contents" }
|
|
4542
4592
|
},
|
|
4543
4593
|
layoutElement
|
|
@@ -4568,10 +4618,10 @@ var ServerRenderer = class {
|
|
|
4568
4618
|
return serverTree && this.rendererRuntime.renderServerTreePage ? this.rendererRuntime.renderServerTreePage(element, { values: false }) : this.rendererRuntime.isolateServerPageGraph(element);
|
|
4569
4619
|
}
|
|
4570
4620
|
async renderElementToCompleteHTML(element, options = {}) {
|
|
4571
|
-
const streaming =
|
|
4621
|
+
const streaming = _chunkLEZJZX4Ccjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
|
|
4572
4622
|
const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
|
|
4573
4623
|
if (renderToPipeableStream) {
|
|
4574
|
-
const inlineBoundaries =
|
|
4624
|
+
const inlineBoundaries = _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, this.config.renderer);
|
|
4575
4625
|
return await new Promise((resolve3, reject) => {
|
|
4576
4626
|
const chunks = [];
|
|
4577
4627
|
let shellReady = false;
|
|
@@ -4588,8 +4638,8 @@ var ServerRenderer = class {
|
|
|
4588
4638
|
);
|
|
4589
4639
|
writable.once("error", reject);
|
|
4590
4640
|
const stream = renderToPipeableStream(element, {
|
|
4591
|
-
nonce:
|
|
4592
|
-
formState:
|
|
4641
|
+
nonce: _chunkXEPUUTGCcjs._resolveCurrentCspNonce.call(void 0, ),
|
|
4642
|
+
formState: _chunk4USE4SEUcjs.getFarmFormState.call(void 0, ),
|
|
4593
4643
|
...inlineBoundaries ? {
|
|
4594
4644
|
progressiveChunkSize: Number.MAX_SAFE_INTEGER,
|
|
4595
4645
|
onAllReady() {
|
|
@@ -4605,7 +4655,7 @@ var ServerRenderer = class {
|
|
|
4605
4655
|
},
|
|
4606
4656
|
onError(error) {
|
|
4607
4657
|
if (!shellReady) reject(error);
|
|
4608
|
-
else if (lateNavigation === void 0 && (options.rejectLateErrors || options.rejectLateRedirects &&
|
|
4658
|
+
else if (lateNavigation === void 0 && (options.rejectLateErrors || options.rejectLateRedirects && _chunk7MQMWGTLcjs.isFarmRedirectError.call(void 0, error) || options.rejectLateNavigation && (_chunk7MQMWGTLcjs.isFarmRedirectError.call(void 0, error) || _chunk7MQMWGTLcjs.isFarmNotFoundError.call(void 0, error)))) {
|
|
4609
4659
|
lateNavigation = error;
|
|
4610
4660
|
}
|
|
4611
4661
|
}
|
|
@@ -4617,7 +4667,7 @@ var ServerRenderer = class {
|
|
|
4617
4667
|
element,
|
|
4618
4668
|
rendererRenderOptions()
|
|
4619
4669
|
);
|
|
4620
|
-
return await
|
|
4670
|
+
return await _chunkLEZJZX4Ccjs.readFarmRendererWebStream.call(void 0, stream);
|
|
4621
4671
|
}
|
|
4622
4672
|
return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
|
|
4623
4673
|
}
|
|
@@ -4633,7 +4683,7 @@ var ServerRenderer = class {
|
|
|
4633
4683
|
);
|
|
4634
4684
|
return { html: rendered.html, head: rendered.head || "" };
|
|
4635
4685
|
}
|
|
4636
|
-
const { head, body } =
|
|
4686
|
+
const { head, body } = _chunkIGBQSUT5cjs.takeFarmHoistedHead.call(void 0,
|
|
4637
4687
|
await this.renderElementToCompleteHTML(element, options),
|
|
4638
4688
|
true
|
|
4639
4689
|
);
|
|
@@ -4641,7 +4691,7 @@ var ServerRenderer = class {
|
|
|
4641
4691
|
}
|
|
4642
4692
|
/** Islands mode sends large prop values once, keyed by content (RFC 0003). */
|
|
4643
4693
|
islandValues() {
|
|
4644
|
-
return
|
|
4694
|
+
return _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, this.config)) === "islands";
|
|
4645
4695
|
}
|
|
4646
4696
|
/**
|
|
4647
4697
|
* The page's element. Only React renders an async component, so for any other renderer Farm
|
|
@@ -4650,7 +4700,7 @@ var ServerRenderer = class {
|
|
|
4650
4700
|
*/
|
|
4651
4701
|
async createPageElement(PageComponent, pageProps) {
|
|
4652
4702
|
const runtime = this.rendererRuntime;
|
|
4653
|
-
if (
|
|
4703
|
+
if (_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, this.config.renderer) || typeof PageComponent !== "function" || _optionalChain([PageComponent, 'access', _104 => _104.constructor, 'optionalAccess', _105 => _105.name]) !== "AsyncFunction") {
|
|
4654
4704
|
return runtime.createElement(PageComponent, pageProps);
|
|
4655
4705
|
}
|
|
4656
4706
|
const result = await PageComponent(pageProps);
|
|
@@ -4664,9 +4714,9 @@ var ServerRenderer = class {
|
|
|
4664
4714
|
async renderNavigationFragment(input) {
|
|
4665
4715
|
await this.initialize();
|
|
4666
4716
|
if (this.viteServer) await this.applyRendererAppSetup();
|
|
4667
|
-
|
|
4717
|
+
_chunkTFCBJFP7cjs.setFarmBasePath.call(void 0, this.config.basePath);
|
|
4668
4718
|
this.publishSearchPreserveRoutes();
|
|
4669
|
-
|
|
4719
|
+
_chunk6FIY4KBCcjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
|
|
4670
4720
|
let element = await this.createPageElement(input.PageComponent, input.pageProps);
|
|
4671
4721
|
if (input.LoadingComponent) {
|
|
4672
4722
|
element = this.rendererRuntime.createElement(
|
|
@@ -4749,7 +4799,7 @@ var ServerRenderer = class {
|
|
|
4749
4799
|
rejectLateRedirects: true
|
|
4750
4800
|
}
|
|
4751
4801
|
);
|
|
4752
|
-
return fragmentTag ?
|
|
4802
|
+
return fragmentTag ? _chunkIGBQSUT5cjs.takeFarmNavigationOutlet.call(void 0, html, fragmentTag) : html;
|
|
4753
4803
|
}
|
|
4754
4804
|
/**
|
|
4755
4805
|
* A built-in docs runtime page (`docs.entry`, no adapter) under layouts that hydrate, or whose
|
|
@@ -4759,7 +4809,7 @@ var ServerRenderer = class {
|
|
|
4759
4809
|
* Any other docs response is sent as it is.
|
|
4760
4810
|
*/
|
|
4761
4811
|
async wrapDocsResponseWithLayouts(request2, response) {
|
|
4762
|
-
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
4812
|
+
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _106 => _106.headers, 'access', _107 => _107.get, 'call', _108 => _108("content-type"), 'optionalAccess', _109 => _109.toLowerCase, 'call', _110 => _110(), 'access', _111 => _111.includes, 'call', _112 => _112("text/html")])) {
|
|
4763
4813
|
return response;
|
|
4764
4814
|
}
|
|
4765
4815
|
await this.initialize();
|
|
@@ -4774,14 +4824,14 @@ var ServerRenderer = class {
|
|
|
4774
4824
|
return {
|
|
4775
4825
|
pattern: layout.pattern,
|
|
4776
4826
|
modulePath: layout.modulePath,
|
|
4777
|
-
shouldHydrate: _optionalChain([entry, 'optionalAccess',
|
|
4778
|
-
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
4779
|
-
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess',
|
|
4780
|
-
serverTree: _optionalChain([entry, 'optionalAccess',
|
|
4781
|
-
islands: _optionalChain([entry, 'optionalAccess',
|
|
4827
|
+
shouldHydrate: _optionalChain([entry, 'optionalAccess', _113 => _113.shouldHydrate]) === true,
|
|
4828
|
+
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _114 => _114.islandStrategy]), () => ( null)),
|
|
4829
|
+
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess', _115 => _115.hasIsolatedClientBoundaries]) === true,
|
|
4830
|
+
serverTree: _optionalChain([entry, 'optionalAccess', _116 => _116.serverTree]) === true,
|
|
4831
|
+
islands: _optionalChain([entry, 'optionalAccess', _117 => _117.hasIsolatedClientBoundaries]) === true
|
|
4782
4832
|
};
|
|
4783
4833
|
});
|
|
4784
|
-
if (!
|
|
4834
|
+
if (!_chunkIGBQSUT5cjs.farmDocsLayoutsWrapPage.call(void 0, layouts)) return response;
|
|
4785
4835
|
const shouldHydrateLayout = layouts.some((layout) => layout.shouldHydrate);
|
|
4786
4836
|
const hasIsolatedClientBoundaries = layouts.some(
|
|
4787
4837
|
(layout) => layout.hasIsolatedClientBoundaries
|
|
@@ -4800,10 +4850,10 @@ var ServerRenderer = class {
|
|
|
4800
4850
|
);
|
|
4801
4851
|
const treeLayouts = layouts.map((layout, index) => ({
|
|
4802
4852
|
...layout,
|
|
4803
|
-
Component: _optionalChain([modules, 'access',
|
|
4853
|
+
Component: _optionalChain([modules, 'access', _118 => _118[index], 'optionalAccess', _119 => _119.default])
|
|
4804
4854
|
}));
|
|
4805
|
-
const islandStrategy =
|
|
4806
|
-
const tree = await
|
|
4855
|
+
const islandStrategy = _chunkIGBQSUT5cjs.resolveFarmDocsLayoutIslandStrategy.call(void 0, treeLayouts);
|
|
4856
|
+
const tree = await _chunkIGBQSUT5cjs.createFarmDocsLayoutTree.call(void 0, this.rendererRuntime, {
|
|
4807
4857
|
pageHtml: bodyMatch[2],
|
|
4808
4858
|
layouts: treeLayouts,
|
|
4809
4859
|
params: matched.params,
|
|
@@ -4824,10 +4874,10 @@ var ServerRenderer = class {
|
|
|
4824
4874
|
)
|
|
4825
4875
|
)
|
|
4826
4876
|
);
|
|
4827
|
-
const rootMarkup =
|
|
4877
|
+
const rootMarkup = _chunkIGBQSUT5cjs.placeFarmDocsLayoutRoot.call(void 0, rendered.html);
|
|
4828
4878
|
const clientLayouts = layouts.map((layout) => ({
|
|
4829
4879
|
pattern: layout.pattern,
|
|
4830
|
-
modulePath:
|
|
4880
|
+
modulePath: _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, layout.modulePath, root),
|
|
4831
4881
|
shouldHydrate: layout.shouldHydrate,
|
|
4832
4882
|
islandStrategy: layout.islandStrategy,
|
|
4833
4883
|
...layout.hasIsolatedClientBoundaries ? { hasIsolatedClientBoundaries: true } : {},
|
|
@@ -4844,7 +4894,7 @@ var ServerRenderer = class {
|
|
|
4844
4894
|
],
|
|
4845
4895
|
boot: { layoutPatterns: layouts.map((layout) => layout.pattern) }
|
|
4846
4896
|
});
|
|
4847
|
-
const i18nSnapshot =
|
|
4897
|
+
const i18nSnapshot = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
4848
4898
|
const bootstrapScript = `<script>
|
|
4849
4899
|
window.__FARM_PROPS__ = ${serializeInlineValue({ params: matched.params })};
|
|
4850
4900
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -4860,17 +4910,17 @@ window.__FARM_ISLAND_STRATEGY__ = ${serializeInlineValue(islandStrategy)};
|
|
|
4860
4910
|
window.__FARM_PAGE_MODULE__ = "";
|
|
4861
4911
|
window.__FARM_LOADING_MODULE__ = null;
|
|
4862
4912
|
window.__FARM_MANIFEST__ = ${serializeInlineValue(clientManifest)};
|
|
4863
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${serializeInlineValue(
|
|
4913
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${serializeInlineValue(_chunkN4AM7Q34cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
4864
4914
|
window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "null"};
|
|
4865
4915
|
</script>`;
|
|
4866
4916
|
const head = [
|
|
4867
4917
|
...this.collectDevStyleLinks(),
|
|
4868
4918
|
`<script type="module" src="/@vite/client"></script>`,
|
|
4869
|
-
source.includes("window._$HY") ? "" : _optionalChain([this, 'access',
|
|
4919
|
+
source.includes("window._$HY") ? "" : _optionalChain([this, 'access', _120 => _120.rendererRuntime, 'access', _121 => _121.generateHydrationScript, 'optionalCall', _122 => _122()]),
|
|
4870
4920
|
bootstrapScript
|
|
4871
|
-
].filter(Boolean).map((markup) =>
|
|
4921
|
+
].filter(Boolean).map((markup) => _chunkIEZFFXSCcjs.stampFarmCspNonce.call(void 0, markup)).concat(rendered.head || []).join("\n ");
|
|
4872
4922
|
const clientScript = source.includes('src="/@farm/client.js"') ? "" : `
|
|
4873
|
-
${
|
|
4923
|
+
${_chunkIEZFFXSCcjs.stampFarmCspNonce.call(void 0, `<script type="module" src="/@farm/client.js"></script>`)}`;
|
|
4874
4924
|
const html = source.replace(bodyMatch[0], () => `<body${bodyMatch[1]}>${rootMarkup}${clientScript}</body>`).replace(/<\/head>/i, () => ` ${head}
|
|
4875
4925
|
</head>`);
|
|
4876
4926
|
const headers = new Headers(response.headers);
|
|
@@ -4883,15 +4933,15 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4883
4933
|
});
|
|
4884
4934
|
}
|
|
4885
4935
|
async runWithRequestContext(request2, fn) {
|
|
4886
|
-
return
|
|
4936
|
+
return _chunkIBZW57NWcjs._runWithCurrentRequest.call(void 0,
|
|
4887
4937
|
request2,
|
|
4888
|
-
() => _optionalChain([this, 'access',
|
|
4938
|
+
() => _optionalChain([this, 'access', _123 => _123.i18nRuntime, 'optionalAccess', _124 => _124.config, 'access', _125 => _125.enabled]) ? _chunkYCIFGYBYcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
|
|
4889
4939
|
redirect: false
|
|
4890
4940
|
}) : fn()
|
|
4891
4941
|
);
|
|
4892
4942
|
}
|
|
4893
4943
|
async resolveRouteContext(input) {
|
|
4894
|
-
return
|
|
4944
|
+
return _chunkYZMSJRM5cjs.resolveFarmRouteContext.call(void 0, this.config, input);
|
|
4895
4945
|
}
|
|
4896
4946
|
/**
|
|
4897
4947
|
* Load SSG manifest from build output
|
|
@@ -4910,13 +4960,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4910
4960
|
);
|
|
4911
4961
|
}
|
|
4912
4962
|
this.ssgManifest = parseSSGManifest(content, manifestPath);
|
|
4913
|
-
|
|
4963
|
+
_chunk7ZDLE77Pcjs.logger.info(`Loaded SSG manifest: ${this.ssgManifest.length} pages`);
|
|
4914
4964
|
}
|
|
4915
4965
|
/**
|
|
4916
4966
|
* Check if a path should be served from SSG cache
|
|
4917
4967
|
*/
|
|
4918
4968
|
async shouldServeSSG(pathname) {
|
|
4919
|
-
const ssgPage =
|
|
4969
|
+
const ssgPage = _chunkT4VF6BYVcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
4920
4970
|
if (!ssgPage) return null;
|
|
4921
4971
|
const cached = await this.getCachedSSGPage(pathname);
|
|
4922
4972
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -4925,11 +4975,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4925
4975
|
return ssgPage;
|
|
4926
4976
|
}
|
|
4927
4977
|
getSSGCacheKey(urlPath) {
|
|
4928
|
-
return
|
|
4978
|
+
return _chunkN4C72FCDcjs.createFarmCacheKey.call(void 0, ["ssg", _chunkVD7ENQP2cjs.normalizeRevalidatePath.call(void 0, urlPath)]);
|
|
4929
4979
|
}
|
|
4930
4980
|
getPPRCacheKey(pathname, search = "", locale = "", origin = "") {
|
|
4931
|
-
const key = ["ppr", locale,
|
|
4932
|
-
return
|
|
4981
|
+
const key = ["ppr", locale, _chunkVD7ENQP2cjs.normalizeRevalidatePath.call(void 0, pathname), search, this.getDeploymentId()];
|
|
4982
|
+
return _chunkN4C72FCDcjs.createFarmCacheKey.call(void 0, origin ? [...key, origin] : key);
|
|
4933
4983
|
}
|
|
4934
4984
|
getCachedSSGPage(urlPath) {
|
|
4935
4985
|
return this.dataCache.getEntryAsync(this.getSSGCacheKey(urlPath), {
|
|
@@ -4970,7 +5020,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4970
5020
|
options.origin
|
|
4971
5021
|
);
|
|
4972
5022
|
await (await _asyncNullishCoalesce(write, async () => ( await this.dataCache.pprShellCache.startWriteAsync(this.getPPRShellWriteOptions(options))))).commit(key, { html, ...cookieIndependent ? { cookieIndependent: true } : {} });
|
|
4973
|
-
|
|
5023
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
4974
5024
|
type: "ppr.shell.cached",
|
|
4975
5025
|
route: options.pathname,
|
|
4976
5026
|
key,
|
|
@@ -5020,7 +5070,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5020
5070
|
for (const [key, value] of Object.entries(this.getPPRHeaders("hit", revalidate))) {
|
|
5021
5071
|
res.setHeader(key, value);
|
|
5022
5072
|
}
|
|
5023
|
-
if (
|
|
5073
|
+
if (_chunkVIDUNAQEcjs.withoutFarmDeploymentCookie.call(void 0, req.headers.cookie)) {
|
|
5024
5074
|
res.setHeader("Cache-Control", "private, no-store");
|
|
5025
5075
|
}
|
|
5026
5076
|
res.write(shell.html);
|
|
@@ -5034,7 +5084,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5034
5084
|
setImmediate(async () => {
|
|
5035
5085
|
try {
|
|
5036
5086
|
const mod = await this.routeManager.loadRouteModule(page.filePath);
|
|
5037
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
5087
|
+
if (!_optionalChain([mod, 'optionalAccess', _126 => _126.default])) return;
|
|
5038
5088
|
const { route, layouts } = this.routeManager.matchRoute(page.urlPath);
|
|
5039
5089
|
const layoutModules = await Promise.all(
|
|
5040
5090
|
layouts.map((l) => this.routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -5043,12 +5093,12 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5043
5093
|
const PageComponent = mod.default;
|
|
5044
5094
|
const pageProps = {
|
|
5045
5095
|
params: page.params,
|
|
5046
|
-
searchParams:
|
|
5096
|
+
searchParams: _chunkK6LZMZNBcjs.createFarmSearchParams.call(void 0, {}),
|
|
5047
5097
|
path: page.urlPath
|
|
5048
5098
|
};
|
|
5049
5099
|
let pageElement = await this.createPageElement(PageComponent, pageProps);
|
|
5050
5100
|
const pageMetadata = _nullishCoalesce(routeManifest.routes.find(
|
|
5051
|
-
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess',
|
|
5101
|
+
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _127 => _127.pattern])
|
|
5052
5102
|
), () => ( {
|
|
5053
5103
|
shouldHydrate: false,
|
|
5054
5104
|
islandStrategy: null
|
|
@@ -5086,7 +5136,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5086
5136
|
pageProps,
|
|
5087
5137
|
pathname: page.urlPath
|
|
5088
5138
|
});
|
|
5089
|
-
const { title, tags, hasFavicon, hasExplicitTitle } =
|
|
5139
|
+
const { title, tags, hasFavicon, hasExplicitTitle } = _chunkO7B6LJWEcjs.renderMetadataHead.call(void 0, mergedMetadata);
|
|
5090
5140
|
const titleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
5091
5141
|
const metadataHead = `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}${titleTag}${tags}${rendererHead}`;
|
|
5092
5142
|
const fullDocument = this.createFullHTML(
|
|
@@ -5097,13 +5147,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5097
5147
|
{ metadata: mergedMetadata }
|
|
5098
5148
|
);
|
|
5099
5149
|
await this.cacheSSGPage(page, fullDocument, { document: true });
|
|
5100
|
-
|
|
5150
|
+
_chunk7ZDLE77Pcjs.logger.info(`ISR: Regenerated ${page.urlPath}`);
|
|
5101
5151
|
} catch (error) {
|
|
5102
|
-
|
|
5152
|
+
_chunk7ZDLE77Pcjs.logger.error(`ISR regeneration failed for ${page.urlPath}: ${error}`);
|
|
5103
5153
|
}
|
|
5104
5154
|
});
|
|
5105
5155
|
} catch (error) {
|
|
5106
|
-
|
|
5156
|
+
_chunk7ZDLE77Pcjs.logger.error(`ISR trigger failed: ${error}`);
|
|
5107
5157
|
}
|
|
5108
5158
|
}
|
|
5109
5159
|
/**
|
|
@@ -5146,7 +5196,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5146
5196
|
return true;
|
|
5147
5197
|
}
|
|
5148
5198
|
} catch (error) {
|
|
5149
|
-
|
|
5199
|
+
_chunk7ZDLE77Pcjs.logger.error(`Failed to serve SSG page ${page.urlPath}: ${error}`);
|
|
5150
5200
|
}
|
|
5151
5201
|
return false;
|
|
5152
5202
|
}
|
|
@@ -5156,31 +5206,31 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5156
5206
|
* such as a partial test double, has none.
|
|
5157
5207
|
*/
|
|
5158
5208
|
publishSearchPreserveRoutes() {
|
|
5159
|
-
|
|
5209
|
+
_chunkXSJYXUY6cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access', _128 => _128.routeManager, 'access', _129 => _129.getSearchPreserveRoutes, 'optionalCall', _130 => _130()]), () => ( [])));
|
|
5160
5210
|
}
|
|
5161
5211
|
async renderPage(req, res) {
|
|
5162
5212
|
await this.initialize();
|
|
5163
5213
|
if (this.viteServer) await this.applyRendererAppSetup();
|
|
5164
|
-
|
|
5214
|
+
_chunkTFCBJFP7cjs.setFarmBasePath.call(void 0, this.config.basePath);
|
|
5165
5215
|
this.publishSearchPreserveRoutes();
|
|
5166
|
-
|
|
5167
|
-
const cspNonce =
|
|
5216
|
+
_chunk6FIY4KBCcjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
|
|
5217
|
+
const cspNonce = _chunkIEZFFXSCcjs.createFarmCspNonce.call(void 0, this.security);
|
|
5168
5218
|
if (cspNonce) {
|
|
5169
5219
|
req.__FARM_CSP_NONCE__ = cspNonce;
|
|
5170
|
-
const header =
|
|
5220
|
+
const header = _chunkIEZFFXSCcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
|
|
5171
5221
|
res.setHeader(header.key, header.value);
|
|
5172
5222
|
}
|
|
5173
5223
|
const request2 = this.createPageRequest(req, res);
|
|
5174
5224
|
const runtime = this.i18nRuntime;
|
|
5175
|
-
if (_optionalChain([runtime, 'optionalAccess',
|
|
5225
|
+
if (_optionalChain([runtime, 'optionalAccess', _131 => _131.config, 'access', _132 => _132.enabled])) {
|
|
5176
5226
|
const resolution = runtime.resolveRequest(request2);
|
|
5177
|
-
const varyHeaders =
|
|
5227
|
+
const varyHeaders = _chunkXXBWKAJFcjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
|
|
5178
5228
|
for (const header of varyHeaders) appendResponseVary(res, header);
|
|
5179
5229
|
if (resolution.persist) {
|
|
5180
5230
|
appendResponseHeader(
|
|
5181
5231
|
res,
|
|
5182
5232
|
"Set-Cookie",
|
|
5183
|
-
|
|
5233
|
+
_chunkXXBWKAJFcjs.createFarmLocaleCookie.call(void 0, resolution.locale, runtime.config)
|
|
5184
5234
|
);
|
|
5185
5235
|
}
|
|
5186
5236
|
if (resolution.redirect && (request2.method === "GET" || request2.method === "HEAD")) {
|
|
@@ -5191,7 +5241,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5191
5241
|
return;
|
|
5192
5242
|
}
|
|
5193
5243
|
}
|
|
5194
|
-
return
|
|
5244
|
+
return _chunkIBZW57NWcjs._runWithFarmCspNonce.call(void 0,
|
|
5195
5245
|
cspNonce,
|
|
5196
5246
|
() => this.runWithRequestContext(request2, () => this.renderPageInContext(req, res))
|
|
5197
5247
|
);
|
|
@@ -5210,9 +5260,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5210
5260
|
}
|
|
5211
5261
|
createPageRequestOnce(req, res) {
|
|
5212
5262
|
const observable = typeof req.once === "function" && typeof res.once === "function";
|
|
5213
|
-
return
|
|
5214
|
-
trustProxy: _optionalChain([this, 'access',
|
|
5215
|
-
signal: observable ?
|
|
5263
|
+
return _chunkIBZW57NWcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5264
|
+
trustProxy: _optionalChain([this, 'access', _133 => _133.config, 'access', _134 => _134.server, 'optionalAccess', _135 => _135.trustProxy]),
|
|
5265
|
+
signal: observable ? _chunk7GKZDRY2cjs.createFarmNodeRequestAbortSignal.call(void 0,
|
|
5216
5266
|
req,
|
|
5217
5267
|
res
|
|
5218
5268
|
) : void 0
|
|
@@ -5231,7 +5281,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5231
5281
|
let errorBoundaryEntry = null;
|
|
5232
5282
|
let pprRefreshRoute = null;
|
|
5233
5283
|
const completeRender = (status = res.statusCode || 200, route = pathname) => {
|
|
5234
|
-
|
|
5284
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5235
5285
|
type: "render.complete",
|
|
5236
5286
|
route,
|
|
5237
5287
|
pathname,
|
|
@@ -5241,10 +5291,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5241
5291
|
};
|
|
5242
5292
|
let pprShellWrite;
|
|
5243
5293
|
try {
|
|
5244
|
-
const url =
|
|
5294
|
+
const url = _chunkIBZW57NWcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _136 => _136.config, 'access', _137 => _137.server, 'optionalAccess', _138 => _138.trustProxy]) });
|
|
5245
5295
|
pathname = url.pathname;
|
|
5246
|
-
|
|
5247
|
-
searchParamsObject =
|
|
5296
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
|
|
5297
|
+
searchParamsObject = _chunkK6LZMZNBcjs.searchParamsToObject.call(void 0, url.searchParams);
|
|
5248
5298
|
const metadataRouteMatch = this.routeManager.matchMetadataRoute(pathname);
|
|
5249
5299
|
if (metadataRouteMatch) {
|
|
5250
5300
|
await this.renderMetadataRoute(req, res, metadataRouteMatch);
|
|
@@ -5281,13 +5331,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5281
5331
|
const match = this.routeManager.matchRoute(pathname);
|
|
5282
5332
|
const deploymentMismatch = match.route ? this.getDeploymentMismatch(req) : null;
|
|
5283
5333
|
if (deploymentMismatch) {
|
|
5284
|
-
await
|
|
5334
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0, res, _chunkVIDUNAQEcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch));
|
|
5285
5335
|
completeRender(res.statusCode, match.route.pattern);
|
|
5286
5336
|
return;
|
|
5287
5337
|
}
|
|
5288
5338
|
if (match.route) this.applyDeploymentHeaders(req, res);
|
|
5289
5339
|
if (match.route) {
|
|
5290
|
-
const redirectLocation =
|
|
5340
|
+
const redirectLocation = _chunk6FIY4KBCcjs.resolveFarmTrailingSlashRedirect.call(void 0, url, this.config.trailingSlash);
|
|
5291
5341
|
if (redirectLocation) {
|
|
5292
5342
|
res.statusCode = 308;
|
|
5293
5343
|
res.setHeader("Location", redirectLocation);
|
|
@@ -5311,17 +5361,17 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5311
5361
|
layouts = match.layouts;
|
|
5312
5362
|
routeSlots = _nullishCoalesce(match.slots, () => ( []));
|
|
5313
5363
|
if (!route) {
|
|
5314
|
-
if (
|
|
5364
|
+
if (_chunkR6GOH5CHcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
|
|
5315
5365
|
await this.renderDefaultMCP(req, res);
|
|
5316
5366
|
completeRender(res.statusCode || 200, pathname);
|
|
5317
5367
|
return;
|
|
5318
5368
|
}
|
|
5319
|
-
|
|
5369
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, { type: "route.notFound", pathname });
|
|
5320
5370
|
await this.render404(req, res);
|
|
5321
5371
|
completeRender(res.statusCode);
|
|
5322
5372
|
return;
|
|
5323
5373
|
}
|
|
5324
|
-
|
|
5374
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5325
5375
|
type: "route.matched",
|
|
5326
5376
|
pathname,
|
|
5327
5377
|
route: route.pattern,
|
|
@@ -5335,13 +5385,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5335
5385
|
]);
|
|
5336
5386
|
actionRequest = this.createPageRequest(req, res);
|
|
5337
5387
|
const formActionRequest = actionRequest;
|
|
5338
|
-
const actionResponse = await
|
|
5388
|
+
const actionResponse = await _chunkXZ6L3FUUcjs._runWithMiddlewareData.call(void 0,
|
|
5339
5389
|
toMiddlewareMap(req.__FARM_MIDDLEWARE_DATA__),
|
|
5340
|
-
() =>
|
|
5390
|
+
() => _chunkXZ6L3FUUcjs._runWithMiddlewareContext.call(void 0,
|
|
5341
5391
|
toMiddlewareMap(req.__FARM_MIDDLEWARE_CONTEXT__),
|
|
5342
|
-
() =>
|
|
5392
|
+
() => _chunk4USE4SEUcjs.handleFarmFormActionRequest.call(void 0,
|
|
5343
5393
|
formActionRequest,
|
|
5344
|
-
|
|
5394
|
+
_chunkNMMCBJZMcjs.resolveServerActionsConfig.call(void 0, this.config.serverActions),
|
|
5345
5395
|
// Before a rewrite, the URL the browser posted to.
|
|
5346
5396
|
new URL(
|
|
5347
5397
|
_nullishCoalesce(_nullishCoalesce(req.originalUrl, () => ( req.url)), () => ( "/")),
|
|
@@ -5351,7 +5401,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5351
5401
|
)
|
|
5352
5402
|
);
|
|
5353
5403
|
if (actionResponse) {
|
|
5354
|
-
await
|
|
5404
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0, res, actionResponse);
|
|
5355
5405
|
completeRender(actionResponse.status, route.pattern);
|
|
5356
5406
|
return;
|
|
5357
5407
|
}
|
|
@@ -5360,7 +5410,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5360
5410
|
errorBoundaryEntry = this.routeManager.getMatchingError(pathname, route);
|
|
5361
5411
|
middlewareMap = toMiddlewareMap(req.__FARM_MIDDLEWARE_DATA__);
|
|
5362
5412
|
middlewareContext = toMiddlewareMap(req.__FARM_MIDDLEWARE_CONTEXT__);
|
|
5363
|
-
pluginExposedContext =
|
|
5413
|
+
pluginExposedContext = _chunkGLP3ID53cjs.getRequestContextSnapshot.call(void 0, req, {
|
|
5364
5414
|
exposedOnly: true
|
|
5365
5415
|
});
|
|
5366
5416
|
const currentRequest = _nullishCoalesce(actionRequest, () => ( this.createPageRequest(req, res)));
|
|
@@ -5375,10 +5425,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5375
5425
|
if (!routeModule.default) {
|
|
5376
5426
|
throw new Error(`Route module ${route.modulePath} does not export a default component`);
|
|
5377
5427
|
}
|
|
5378
|
-
const rawPageProps =
|
|
5428
|
+
const rawPageProps = _chunkYZMSJRM5cjs.withFarmRouteContext.call(void 0,
|
|
5379
5429
|
{
|
|
5380
5430
|
params,
|
|
5381
|
-
searchParams:
|
|
5431
|
+
searchParams: _chunkK6LZMZNBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
|
|
5382
5432
|
path: pathname,
|
|
5383
5433
|
middleware: middlewareMap.size > 0 ? { data: middlewareMap } : void 0,
|
|
5384
5434
|
context: pluginExposedContext.size > 0 ? { data: pluginExposedContext } : void 0
|
|
@@ -5396,19 +5446,19 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5396
5446
|
routePath: route.pattern
|
|
5397
5447
|
});
|
|
5398
5448
|
} catch (error) {
|
|
5399
|
-
if (
|
|
5449
|
+
if (_chunk7MQMWGTLcjs.isFarmRedirectError.call(void 0, error)) throw error;
|
|
5400
5450
|
routeStateRejected = true;
|
|
5401
5451
|
const routeStateProps = {
|
|
5402
5452
|
...rawPageProps,
|
|
5403
5453
|
search: searchParamsObject,
|
|
5404
|
-
searchParams:
|
|
5454
|
+
searchParams: _chunkK6LZMZNBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
|
|
5405
5455
|
error
|
|
5406
5456
|
};
|
|
5407
|
-
if (
|
|
5457
|
+
if (_chunk7MQMWGTLcjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _139 => _139.notFound])) {
|
|
5408
5458
|
res.statusCode = 404;
|
|
5409
5459
|
PageComponent = programmaticRouteComponents.notFound;
|
|
5410
5460
|
pageProps = routeStateProps;
|
|
5411
|
-
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess',
|
|
5461
|
+
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _140 => _140.error])) {
|
|
5412
5462
|
res.statusCode = 500;
|
|
5413
5463
|
PageComponent = programmaticRouteComponents.error;
|
|
5414
5464
|
pageProps = routeStateProps;
|
|
@@ -5416,41 +5466,41 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5416
5466
|
throw error;
|
|
5417
5467
|
}
|
|
5418
5468
|
}
|
|
5419
|
-
const renderingConfig = await
|
|
5469
|
+
const renderingConfig = await _chunkT4VF6BYVcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5420
5470
|
routeModule,
|
|
5421
5471
|
route.modulePath,
|
|
5422
|
-
{ experimentalPPR: _optionalChain([this, 'access',
|
|
5472
|
+
{ experimentalPPR: _optionalChain([this, 'access', _141 => _141.config, 'access', _142 => _142.experimental, 'optionalAccess', _143 => _143.ppr]) === true }
|
|
5423
5473
|
);
|
|
5424
5474
|
const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
|
|
5425
5475
|
const islandsNavigationRequest = Boolean(
|
|
5426
5476
|
islands && this.islandValues() && (requestHeader(req, "f-layouts") || requestHeader(req, "f-stream"))
|
|
5427
5477
|
);
|
|
5428
5478
|
const canCachePPRShell = renderingConfig.ppr && !pprBypassReason && !islandsNavigationRequest;
|
|
5429
|
-
const pprI18nSnapshot = canCachePPRShell ?
|
|
5479
|
+
const pprI18nSnapshot = canCachePPRShell ? _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, ) : void 0;
|
|
5430
5480
|
let pprShellOptions = canCachePPRShell ? {
|
|
5431
5481
|
pathname,
|
|
5432
5482
|
search: url.search,
|
|
5433
|
-
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess',
|
|
5483
|
+
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _144 => _144.locale]), () => ( "")),
|
|
5434
5484
|
origin: pprI18nSnapshot && pprI18nSnapshot.routing !== "none" ? url.origin : "",
|
|
5435
5485
|
revalidate: renderingConfig.revalidate
|
|
5436
5486
|
} : void 0;
|
|
5437
5487
|
if (renderingConfig.ppr && pprBypassReason) {
|
|
5438
|
-
|
|
5488
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5439
5489
|
type: "ppr.shell.bypass",
|
|
5440
5490
|
route: pathname,
|
|
5441
5491
|
reason: pprBypassReason
|
|
5442
5492
|
});
|
|
5443
|
-
|
|
5493
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5444
5494
|
type: "cache.bypass",
|
|
5445
5495
|
route: pathname,
|
|
5446
5496
|
reason: pprBypassReason
|
|
5447
5497
|
});
|
|
5448
5498
|
if (pprBypassReason === "refresh") {
|
|
5449
5499
|
pprRefreshRoute = pathname;
|
|
5450
|
-
|
|
5500
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, { type: "ppr.refresh.start", route: pathname });
|
|
5451
5501
|
}
|
|
5452
5502
|
}
|
|
5453
|
-
const pprVisitorCookies = Boolean(
|
|
5503
|
+
const pprVisitorCookies = Boolean(_chunkVIDUNAQEcjs.withoutFarmDeploymentCookie.call(void 0, req.headers.cookie));
|
|
5454
5504
|
if (pprShellOptions) {
|
|
5455
5505
|
const pprCacheKey = this.getPPRCacheKey(
|
|
5456
5506
|
pathname,
|
|
@@ -5466,10 +5516,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5466
5516
|
);
|
|
5467
5517
|
if (cachedPPRShell && pprVisitorCookies && !cachedPPRShell.value.cookieIndependent) {
|
|
5468
5518
|
pprShellOptions = void 0;
|
|
5469
|
-
|
|
5470
|
-
|
|
5519
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, { type: "ppr.shell.bypass", route: pathname, reason: "cookie" });
|
|
5520
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, { type: "cache.bypass", route: pathname, reason: "cookie" });
|
|
5471
5521
|
} else if (cachedPPRShell) {
|
|
5472
|
-
|
|
5522
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5473
5523
|
type: "ppr.shell.hit",
|
|
5474
5524
|
route: pathname,
|
|
5475
5525
|
key: pprCacheKey
|
|
@@ -5478,7 +5528,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5478
5528
|
completeRender(res.statusCode || 200, pathname);
|
|
5479
5529
|
return;
|
|
5480
5530
|
} else {
|
|
5481
|
-
|
|
5531
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5482
5532
|
type: "ppr.shell.miss",
|
|
5483
5533
|
route: pathname,
|
|
5484
5534
|
key: pprCacheKey
|
|
@@ -5490,10 +5540,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5490
5540
|
}
|
|
5491
5541
|
}
|
|
5492
5542
|
}
|
|
5493
|
-
const outerRequest =
|
|
5494
|
-
const countRequestReads = () => (outerRequest ?
|
|
5543
|
+
const outerRequest = _chunkXEPUUTGCcjs._peekCurrentRequest.call(void 0, );
|
|
5544
|
+
const countRequestReads = () => (outerRequest ? _chunkIBZW57NWcjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkIBZW57NWcjs._getRequestReadCount.call(void 0, currentRequest);
|
|
5495
5545
|
const requestReadsBeforeRender = countRequestReads();
|
|
5496
|
-
const countRequestCookieReads = () => (outerRequest ?
|
|
5546
|
+
const countRequestCookieReads = () => (outerRequest ? _chunkIBZW57NWcjs._getRequestCookieReadCount.call(void 0, outerRequest) : 0) + _chunkIBZW57NWcjs._getRequestCookieReadCount.call(void 0, currentRequest);
|
|
5497
5547
|
const requestCookieReadsBeforeRender = countRequestCookieReads();
|
|
5498
5548
|
let LoadingFallbackComponent = null;
|
|
5499
5549
|
if (loadingBoundaryEntry) {
|
|
@@ -5508,7 +5558,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5508
5558
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5509
5559
|
(entry) => entry.pattern === route.pattern
|
|
5510
5560
|
);
|
|
5511
|
-
const moduleMetadata = routeManifestEntry ||
|
|
5561
|
+
const moduleMetadata = routeManifestEntry || _chunkZCT6B5PQcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
5512
5562
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
5513
5563
|
const renderedRouteSlots = await Promise.all(
|
|
5514
5564
|
routeSlots.map(async (slot) => {
|
|
@@ -5525,10 +5575,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5525
5575
|
search: searchParamsObject,
|
|
5526
5576
|
path: pathname
|
|
5527
5577
|
});
|
|
5528
|
-
const rawSlotProps =
|
|
5578
|
+
const rawSlotProps = _chunkYZMSJRM5cjs.withFarmRouteContext.call(void 0,
|
|
5529
5579
|
{
|
|
5530
5580
|
params: slot.params,
|
|
5531
|
-
searchParams:
|
|
5581
|
+
searchParams: _chunkK6LZMZNBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
|
|
5532
5582
|
path: pathname,
|
|
5533
5583
|
middleware: middlewareMap.size > 0 ? { data: middlewareMap } : void 0,
|
|
5534
5584
|
context: pluginExposedContext.size > 0 ? { data: pluginExposedContext } : void 0
|
|
@@ -5559,20 +5609,20 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5559
5609
|
if (moduleMetadata.suppressedAsyncHydration) {
|
|
5560
5610
|
warnSuppressedAsyncHydrationOnce(
|
|
5561
5611
|
route.modulePath,
|
|
5562
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5612
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _145 => _145.suppressedAsyncHydrationReason])
|
|
5563
5613
|
);
|
|
5564
5614
|
}
|
|
5565
5615
|
const layoutHydrationMetadata = layouts.map((layout) => {
|
|
5566
5616
|
const manifestEntry = routeManifest.layouts.find(
|
|
5567
5617
|
(entry) => entry.pattern === layout.pattern
|
|
5568
5618
|
);
|
|
5569
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
5619
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _146 => _146.suppressedAsyncHydration])) {
|
|
5570
5620
|
warnSuppressedAsyncHydrationOnce(
|
|
5571
5621
|
layout.modulePath,
|
|
5572
5622
|
manifestEntry.suppressedAsyncHydrationReason
|
|
5573
5623
|
);
|
|
5574
5624
|
}
|
|
5575
|
-
if (typeof _optionalChain([manifestEntry, 'optionalAccess',
|
|
5625
|
+
if (typeof _optionalChain([manifestEntry, 'optionalAccess', _147 => _147.shouldHydrate]) === "boolean") {
|
|
5576
5626
|
return {
|
|
5577
5627
|
isClientComponent: manifestEntry.isClientComponent === true,
|
|
5578
5628
|
shouldHydrate: manifestEntry.shouldHydrate,
|
|
@@ -5592,12 +5642,12 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5592
5642
|
);
|
|
5593
5643
|
const clientLayouts = layouts.map((layout, index) => ({
|
|
5594
5644
|
pattern: layout.pattern,
|
|
5595
|
-
modulePath:
|
|
5596
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5597
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5598
|
-
..._optionalChain([layoutHydrationMetadata, 'access',
|
|
5645
|
+
modulePath: _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, layout.modulePath, this.config.root),
|
|
5646
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _148 => _148[index], 'optionalAccess', _149 => _149.shouldHydrate]) === true,
|
|
5647
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _150 => _150[index], 'optionalAccess', _151 => _151.islandStrategy]), () => ( null)),
|
|
5648
|
+
..._optionalChain([layoutHydrationMetadata, 'access', _152 => _152[index], 'optionalAccess', _153 => _153.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
|
|
5599
5649
|
// Islands mode: the browser rebuilds this layout from its tree, not its module.
|
|
5600
|
-
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5650
|
+
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _154 => _154[index], 'optionalAccess', _155 => _155.serverTree]) === true ? { serverTree: true } : {}
|
|
5601
5651
|
}));
|
|
5602
5652
|
const hydrationStrategies = [
|
|
5603
5653
|
...shouldHydrate && moduleMetadata.islandStrategy ? [moduleMetadata.islandStrategy] : [],
|
|
@@ -5611,9 +5661,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5611
5661
|
layouts.map((layout, index) => ({
|
|
5612
5662
|
pattern: layout.pattern,
|
|
5613
5663
|
modulePath: layout.modulePath,
|
|
5614
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5615
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5616
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5664
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _156 => _156[index], 'optionalAccess', _157 => _157.shouldHydrate]) === true,
|
|
5665
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _158 => _158[index], 'optionalAccess', _159 => _159.hasIsolatedClientBoundaries]) === true,
|
|
5666
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _160 => _160[index], 'optionalAccess', _161 => _161.islandStrategy]), () => ( null))
|
|
5617
5667
|
})),
|
|
5618
5668
|
this.config.root || process.cwd(),
|
|
5619
5669
|
true
|
|
@@ -5621,10 +5671,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5621
5671
|
const hasHydratableRouteSlots = renderedRouteSlots.some(
|
|
5622
5672
|
(slot) => slot.isClientComponent || slot.shouldHydrate
|
|
5623
5673
|
);
|
|
5624
|
-
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5674
|
+
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _162 => _162.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
|
|
5625
5675
|
req.__FARM_PAGE_PATH__ = route.modulePath;
|
|
5626
5676
|
req.__FARM_ROUTE__ = pathname;
|
|
5627
|
-
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access',
|
|
5677
|
+
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access', _163 => _163[0], 'optionalAccess', _164 => _164.modulePath]);
|
|
5628
5678
|
req.__FARM_IS_CLIENT_COMPONENT__ = isClientComponent;
|
|
5629
5679
|
req.__FARM_PAGE_SHOULD_HYDRATE__ = shouldHydrate;
|
|
5630
5680
|
req.__FARM_LAYOUT_SHOULD_HYDRATE__ = shouldHydrateLayout;
|
|
@@ -5635,7 +5685,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5635
5685
|
req.__FARM_SHOULD_HYDRATE__ = shouldHydrate || shouldHydrateLayout || hasIsolatedClientBoundaries;
|
|
5636
5686
|
req.__FARM_ISLAND_STRATEGY__ = hydrationIslandStrategy;
|
|
5637
5687
|
req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ = hasHydratableRouteSlots;
|
|
5638
|
-
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess',
|
|
5688
|
+
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _165 => _165.modulePath]) ? _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
|
|
5639
5689
|
req.__FARM_ROUTE_SLOTS__ = renderedRouteSlots.map((slot) => ({
|
|
5640
5690
|
name: slot.name,
|
|
5641
5691
|
ownerPattern: slot.ownerPattern,
|
|
@@ -5682,9 +5732,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5682
5732
|
});
|
|
5683
5733
|
req.__FARM_METADATA__ = mergedMetadata;
|
|
5684
5734
|
const middlewareDataForContext = middlewareMap;
|
|
5685
|
-
await
|
|
5686
|
-
await
|
|
5687
|
-
await
|
|
5735
|
+
await _chunkXZ6L3FUUcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
|
|
5736
|
+
await _chunkXZ6L3FUUcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
|
|
5737
|
+
await _chunkIBZW57NWcjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
|
|
5688
5738
|
let pageElement = await this.createPageElement(PageComponent, pageProps);
|
|
5689
5739
|
if (LoadingFallbackComponent && !islandsNavigationRequest) {
|
|
5690
5740
|
const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
|
|
@@ -5707,7 +5757,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5707
5757
|
} else if (shouldHydrateLayout && !(isClientComponent || shouldHydrate) && this.rendererRuntime.isolateServerPageGraph) {
|
|
5708
5758
|
pageElement = await this.isolateServerPage(
|
|
5709
5759
|
pageElement,
|
|
5710
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5760
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _166 => _166.serverTree]) === true
|
|
5711
5761
|
);
|
|
5712
5762
|
}
|
|
5713
5763
|
pageElement = await this.createPageBoundary(pageElement, {
|
|
@@ -5722,7 +5772,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5722
5772
|
if (keptLayouts > 0 && !layouts.slice(0, keptLayouts).every((layout) => canFarmSkipKeptLayoutRender(layout.modulePath, keptRoot))) {
|
|
5723
5773
|
let keptElement = null;
|
|
5724
5774
|
for (let i = keptLayouts - 1; i >= 0; i--) {
|
|
5725
|
-
const KeptLayout = _optionalChain([layoutModules, 'access',
|
|
5775
|
+
const KeptLayout = _optionalChain([layoutModules, 'access', _167 => _167[i], 'optionalAccess', _168 => _168.default]);
|
|
5726
5776
|
if (KeptLayout) {
|
|
5727
5777
|
keptElement = this.rendererRuntime.createElement(KeptLayout, {
|
|
5728
5778
|
children: keptElement,
|
|
@@ -5775,7 +5825,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5775
5825
|
);
|
|
5776
5826
|
slotProps[slot.name] = slotElement;
|
|
5777
5827
|
}
|
|
5778
|
-
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5828
|
+
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _169 => _169[i], 'optionalAccess', _170 => _170.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
|
|
5779
5829
|
LayoutComponent,
|
|
5780
5830
|
{ params },
|
|
5781
5831
|
{ children: wrappedElement, ...slotProps },
|
|
@@ -5807,8 +5857,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5807
5857
|
req,
|
|
5808
5858
|
res,
|
|
5809
5859
|
() => {
|
|
5810
|
-
|
|
5811
|
-
|
|
5860
|
+
_chunkXZ6L3FUUcjs._clearCurrentMiddlewareData.call(void 0, );
|
|
5861
|
+
_chunkXZ6L3FUUcjs._clearCurrentMiddlewareContext.call(void 0, );
|
|
5812
5862
|
},
|
|
5813
5863
|
{
|
|
5814
5864
|
responseHeaders: pprHeaders,
|
|
@@ -5816,18 +5866,18 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5816
5866
|
clientRoutePattern: route.pattern,
|
|
5817
5867
|
captureStaticShell: Boolean(pprShellOptions),
|
|
5818
5868
|
observabilityRoute: pathname,
|
|
5819
|
-
onSuspenseHoleDetected: pprShellOptions ? () =>
|
|
5869
|
+
onSuspenseHoleDetected: pprShellOptions ? () => _chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5820
5870
|
type: "ppr.suspense.holeDetected",
|
|
5821
5871
|
route: pathname
|
|
5822
5872
|
}) : void 0,
|
|
5823
5873
|
onComplete: pprShellOptions && req.method !== "HEAD" ? (html) => {
|
|
5824
5874
|
if (countRequestReads() !== requestReadsBeforeRender) {
|
|
5825
|
-
|
|
5875
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5826
5876
|
type: "ppr.shell.bypass",
|
|
5827
5877
|
route: pathname,
|
|
5828
5878
|
reason: "request-read"
|
|
5829
5879
|
});
|
|
5830
|
-
|
|
5880
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5831
5881
|
type: "cache.bypass",
|
|
5832
5882
|
route: pathname,
|
|
5833
5883
|
reason: "request-read"
|
|
@@ -5836,12 +5886,12 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5836
5886
|
}
|
|
5837
5887
|
const renderReadCookies = countRequestCookieReads() !== requestCookieReadsBeforeRender;
|
|
5838
5888
|
if (renderReadCookies && pprVisitorCookies) {
|
|
5839
|
-
|
|
5889
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5840
5890
|
type: "ppr.shell.bypass",
|
|
5841
5891
|
route: pathname,
|
|
5842
5892
|
reason: "cookie"
|
|
5843
5893
|
});
|
|
5844
|
-
|
|
5894
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5845
5895
|
type: "cache.bypass",
|
|
5846
5896
|
route: pathname,
|
|
5847
5897
|
reason: "cookie"
|
|
@@ -5858,7 +5908,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5858
5908
|
}
|
|
5859
5909
|
);
|
|
5860
5910
|
if (pprRefreshRoute) {
|
|
5861
|
-
|
|
5911
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5862
5912
|
type: "ppr.refresh.complete",
|
|
5863
5913
|
route: pprRefreshRoute,
|
|
5864
5914
|
durationMs: Date.now() - renderStartTime
|
|
@@ -5872,18 +5922,18 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5872
5922
|
let error = caughtError;
|
|
5873
5923
|
if (isWebResponse(error)) {
|
|
5874
5924
|
if (!res.headersSent && !res.writableEnded) {
|
|
5875
|
-
await
|
|
5925
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0, res, error);
|
|
5876
5926
|
} else if (!res.writableEnded) {
|
|
5877
5927
|
res.end();
|
|
5878
5928
|
}
|
|
5879
5929
|
completeRender(error.status, pathname);
|
|
5880
5930
|
return;
|
|
5881
5931
|
}
|
|
5882
|
-
if (
|
|
5883
|
-
const redirect =
|
|
5884
|
-
const snapshot =
|
|
5885
|
-
const redirectUrl = snapshot && redirect.url.startsWith("/") && !redirect.url.startsWith("//") ?
|
|
5886
|
-
|
|
5932
|
+
if (_chunk7MQMWGTLcjs.isFarmRedirectError.call(void 0, error)) {
|
|
5933
|
+
const redirect = _chunk7MQMWGTLcjs.getFarmRedirectError.call(void 0, error);
|
|
5934
|
+
const snapshot = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
5935
|
+
const redirectUrl = snapshot && redirect.url.startsWith("/") && !redirect.url.startsWith("//") ? _chunkKAD5WBY4cjs.localizeFarmHref.call(void 0, redirect.url, snapshot.locale, snapshot) : redirect.url;
|
|
5936
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5887
5937
|
type: "route.redirect",
|
|
5888
5938
|
from: pathname,
|
|
5889
5939
|
to: redirectUrl,
|
|
@@ -5899,8 +5949,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5899
5949
|
completeRender(redirect.status, pathname);
|
|
5900
5950
|
return;
|
|
5901
5951
|
}
|
|
5902
|
-
if (
|
|
5903
|
-
|
|
5952
|
+
if (_chunk7MQMWGTLcjs.isFarmNotFoundError.call(void 0, error)) {
|
|
5953
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, { type: "route.notFound", pathname });
|
|
5904
5954
|
if (!res.headersSent && !res.writableEnded) {
|
|
5905
5955
|
try {
|
|
5906
5956
|
await this.render404(req, res);
|
|
@@ -5918,15 +5968,15 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5918
5968
|
}
|
|
5919
5969
|
}
|
|
5920
5970
|
emitFarmRenderError(req, pathname, error);
|
|
5921
|
-
const errorStatus =
|
|
5971
|
+
const errorStatus = _chunkIGBQSUT5cjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
5922
5972
|
if (pprRefreshRoute) {
|
|
5923
|
-
|
|
5973
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
5924
5974
|
type: "ppr.refresh.error",
|
|
5925
5975
|
route: pprRefreshRoute,
|
|
5926
5976
|
error
|
|
5927
5977
|
});
|
|
5928
5978
|
}
|
|
5929
|
-
|
|
5979
|
+
_chunk7ZDLE77Pcjs.logger.error(`Error rendering page: ${error}`);
|
|
5930
5980
|
if (res.headersSent || res.writableEnded) {
|
|
5931
5981
|
if (!res.writableEnded) {
|
|
5932
5982
|
res.end();
|
|
@@ -5953,35 +6003,35 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5953
6003
|
}
|
|
5954
6004
|
await this.renderError(req, res, error, errorStatus);
|
|
5955
6005
|
} finally {
|
|
5956
|
-
_optionalChain([pprShellWrite, 'optionalAccess',
|
|
6006
|
+
_optionalChain([pprShellWrite, 'optionalAccess', _171 => _171.release, 'call', _172 => _172()]);
|
|
5957
6007
|
}
|
|
5958
6008
|
}
|
|
5959
6009
|
async wrapWithIntegrationProviders(element) {
|
|
5960
|
-
const providers =
|
|
6010
|
+
const providers = _chunkN4AM7Q34cjs.getIntegrationProviders.call(void 0, this.config.integrations);
|
|
5961
6011
|
let wrapped = element;
|
|
5962
6012
|
for (let i = providers.length - 1; i >= 0; i--) {
|
|
5963
6013
|
const provider = providers[i];
|
|
5964
6014
|
if (provider.component || provider.type === "clerk") {
|
|
5965
|
-
const rendererCapabilities =
|
|
6015
|
+
const rendererCapabilities = _chunkLEZJZX4Ccjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
|
|
5966
6016
|
if (!rendererCapabilities.functionComponents) {
|
|
5967
6017
|
throw new Error(
|
|
5968
|
-
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access',
|
|
6018
|
+
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _173 => _173.config, 'access', _174 => _174.renderer, 'optionalAccess', _175 => _175.name]), () => ( "the configured renderer"))}\` cannot.`
|
|
5969
6019
|
);
|
|
5970
6020
|
}
|
|
5971
|
-
if (provider.type === "clerk" && !
|
|
6021
|
+
if (provider.type === "clerk" && !_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, this.config.renderer)) {
|
|
5972
6022
|
throw new Error(
|
|
5973
6023
|
`Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
|
|
5974
6024
|
);
|
|
5975
6025
|
}
|
|
5976
6026
|
let ProviderComponent;
|
|
5977
6027
|
let providerSourceModule;
|
|
5978
|
-
if (
|
|
6028
|
+
if (_chunkN4AM7Q34cjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
5979
6029
|
providerSourceModule = provider.component.module;
|
|
5980
|
-
const providerModuleId = provider.component.module.startsWith(".") ?
|
|
6030
|
+
const providerModuleId = provider.component.module.startsWith(".") ? _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0,
|
|
5981
6031
|
path10.resolve(this.config.root, provider.component.module),
|
|
5982
6032
|
this.config.root
|
|
5983
6033
|
) : provider.component.module;
|
|
5984
|
-
const providerModule = this.viteServer ? await
|
|
6034
|
+
const providerModule = this.viteServer ? await _chunkVB7P66Q4cjs.loadFarmDevModule.call(void 0, this.viteServer, providerModuleId) : await importRuntimeModule(
|
|
5985
6035
|
provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path10.resolve(this.config.root, provider.component.module)).href : provider.component.module
|
|
5986
6036
|
);
|
|
5987
6037
|
ProviderComponent = providerModule[provider.component.export || "default"];
|
|
@@ -6004,7 +6054,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6004
6054
|
}
|
|
6005
6055
|
if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
|
|
6006
6056
|
_nullishCoalesce(providerSourceModule, () => ( "")),
|
|
6007
|
-
|
|
6057
|
+
_chunkLEZJZX4Ccjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _176 => _176.config, 'access', _177 => _177.renderer, 'optionalAccess', _178 => _178.componentExtensions]))
|
|
6008
6058
|
)) {
|
|
6009
6059
|
ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
|
|
6010
6060
|
}
|
|
@@ -6020,27 +6070,27 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6020
6070
|
async resolveRouteMetadata(options) {
|
|
6021
6071
|
let metadata = {};
|
|
6022
6072
|
for (const layoutModule of options.layoutModules) {
|
|
6023
|
-
metadata =
|
|
6073
|
+
metadata = _chunkO7B6LJWEcjs.mergeMetadata.call(void 0, metadata, layoutModule.metadata);
|
|
6024
6074
|
if (typeof layoutModule.generateMetadata === "function") {
|
|
6025
|
-
metadata =
|
|
6075
|
+
metadata = _chunkO7B6LJWEcjs.mergeMetadata.call(void 0,
|
|
6026
6076
|
metadata,
|
|
6027
6077
|
await layoutModule.generateMetadata({
|
|
6028
6078
|
params: options.pageProps.params
|
|
6029
6079
|
})
|
|
6030
6080
|
);
|
|
6031
6081
|
}
|
|
6032
|
-
metadata = await
|
|
6082
|
+
metadata = await _chunkO7B6LJWEcjs.mergeModuleViewport.call(void 0, metadata, layoutModule, {
|
|
6033
6083
|
params: options.pageProps.params
|
|
6034
6084
|
});
|
|
6035
6085
|
}
|
|
6036
|
-
metadata =
|
|
6086
|
+
metadata = _chunkO7B6LJWEcjs.mergeMetadata.call(void 0, metadata, options.routeModule.metadata);
|
|
6037
6087
|
if (!options.skipGeneratedRouteMetadata && typeof options.routeModule.generateMetadata === "function") {
|
|
6038
|
-
metadata =
|
|
6088
|
+
metadata = _chunkO7B6LJWEcjs.mergeMetadata.call(void 0,
|
|
6039
6089
|
metadata,
|
|
6040
6090
|
await options.routeModule.generateMetadata(options.pageProps)
|
|
6041
6091
|
);
|
|
6042
6092
|
}
|
|
6043
|
-
metadata = await
|
|
6093
|
+
metadata = await _chunkO7B6LJWEcjs.mergeModuleViewport.call(void 0,
|
|
6044
6094
|
metadata,
|
|
6045
6095
|
options.skipGeneratedRouteMetadata ? { viewport: options.routeModule.viewport } : options.routeModule,
|
|
6046
6096
|
options.pageProps
|
|
@@ -6055,25 +6105,25 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6055
6105
|
manifestMatch.metadata,
|
|
6056
6106
|
manifestMatch.params
|
|
6057
6107
|
);
|
|
6058
|
-
const snapshot2 =
|
|
6059
|
-
const localizedHref = snapshot2 ?
|
|
6060
|
-
metadata.manifest =
|
|
6108
|
+
const snapshot2 = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6109
|
+
const localizedHref = snapshot2 ? _chunkKAD5WBY4cjs.localizeFarmHref.call(void 0, rawHref, snapshot2.locale, snapshot2) : rawHref;
|
|
6110
|
+
metadata.manifest = _chunkTFCBJFP7cjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
|
|
6061
6111
|
}
|
|
6062
6112
|
}
|
|
6063
6113
|
for (const kind of ["opengraph", "twitter"]) {
|
|
6064
6114
|
const reference = await this.resolveMetadataImageReference(kind, options.pathname);
|
|
6065
6115
|
if (reference) {
|
|
6066
|
-
metadata =
|
|
6116
|
+
metadata = _chunkO7B6LJWEcjs.addMetadataImageReference.call(void 0, metadata, reference);
|
|
6067
6117
|
}
|
|
6068
6118
|
}
|
|
6069
|
-
const snapshot =
|
|
6070
|
-
const publicPathname =
|
|
6071
|
-
snapshot ?
|
|
6119
|
+
const snapshot = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6120
|
+
const publicPathname = _chunkTFCBJFP7cjs.applyFarmBasePath.call(void 0,
|
|
6121
|
+
snapshot ? _chunkKAD5WBY4cjs.localizeFarmHref.call(void 0, options.pathname, snapshot.locale, snapshot) : options.pathname,
|
|
6072
6122
|
this.config.basePath
|
|
6073
6123
|
);
|
|
6074
|
-
metadata =
|
|
6124
|
+
metadata = _chunkO7B6LJWEcjs.addMetadataMarkdownAlternate.call(void 0,
|
|
6075
6125
|
metadata,
|
|
6076
|
-
|
|
6126
|
+
_chunkU2HFXURZcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkU2HFXURZcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname, {
|
|
6077
6127
|
routePathname: (pathname) => this.routeManager.toRoutePathname(pathname)
|
|
6078
6128
|
})
|
|
6079
6129
|
);
|
|
@@ -6083,9 +6133,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6083
6133
|
const match = this.routeManager.getMatchingMetadataImage(pathname, kind);
|
|
6084
6134
|
if (!match) return null;
|
|
6085
6135
|
const rawHref = this.routeManager.resolveMetadataImagePath(match.image, match.params);
|
|
6086
|
-
const snapshot =
|
|
6087
|
-
const localizedHref = snapshot ?
|
|
6088
|
-
const href =
|
|
6136
|
+
const snapshot = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6137
|
+
const localizedHref = snapshot ? _chunkKAD5WBY4cjs.localizeFarmHref.call(void 0, rawHref, snapshot.locale, snapshot) : rawHref;
|
|
6138
|
+
const href = _chunkTFCBJFP7cjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
|
|
6089
6139
|
const reference = {
|
|
6090
6140
|
kind,
|
|
6091
6141
|
href
|
|
@@ -6113,7 +6163,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6113
6163
|
reference.contentType = imageModule.contentType;
|
|
6114
6164
|
}
|
|
6115
6165
|
} catch (error) {
|
|
6116
|
-
|
|
6166
|
+
_chunk7ZDLE77Pcjs.logger.warn(`Failed to read ${kind} image metadata for ${pathname}: ${error}`);
|
|
6117
6167
|
}
|
|
6118
6168
|
return reference;
|
|
6119
6169
|
}
|
|
@@ -6132,8 +6182,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6132
6182
|
`Metadata route module ${match.metadata.modulePath} does not export a default value or handler`
|
|
6133
6183
|
);
|
|
6134
6184
|
}
|
|
6135
|
-
const request2 =
|
|
6136
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6185
|
+
const request2 = _chunkIBZW57NWcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6186
|
+
trustProxy: _optionalChain([this, 'access', _179 => _179.config, 'access', _180 => _180.server, 'optionalAccess', _181 => _181.trustProxy])
|
|
6137
6187
|
});
|
|
6138
6188
|
const url = new URL(request2.url);
|
|
6139
6189
|
const llmsContext = match.metadata.kind === "llms" || match.metadata.kind === "llms-full" ? await this.createLlmsTxtContext(request2, {
|
|
@@ -6147,18 +6197,18 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6147
6197
|
path: match.routePath,
|
|
6148
6198
|
...llmsContext
|
|
6149
6199
|
}) : routeModule.default;
|
|
6150
|
-
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await
|
|
6200
|
+
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunk25CHWAZYcjs.renderFarmLlmsFullTxt.call(void 0, value, {
|
|
6151
6201
|
origin: await this.getAgentOrigin(request2),
|
|
6152
6202
|
readMarkdown: llmsContext.markdown
|
|
6153
6203
|
}) : value;
|
|
6154
|
-
const response =
|
|
6204
|
+
const response = _chunkIGBQSUT5cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
6155
6205
|
method,
|
|
6156
6206
|
request: request2
|
|
6157
6207
|
});
|
|
6158
|
-
await
|
|
6208
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0, res, response);
|
|
6159
6209
|
} catch (error) {
|
|
6160
|
-
|
|
6161
|
-
await
|
|
6210
|
+
_chunk7ZDLE77Pcjs.logger.error(`Metadata route render failed for ${match.metadata.modulePath}: ${error}`);
|
|
6211
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0,
|
|
6162
6212
|
res,
|
|
6163
6213
|
new Response("Internal Server Error", {
|
|
6164
6214
|
status: 500,
|
|
@@ -6169,25 +6219,25 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6169
6219
|
}
|
|
6170
6220
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
6171
6221
|
getGeneratedLlmsKind(pathname) {
|
|
6172
|
-
const config =
|
|
6222
|
+
const config = _chunk25CHWAZYcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _182 => _182.config, 'access', _183 => _183.agent, 'optionalAccess', _184 => _184.llmsTxt]));
|
|
6173
6223
|
if (!config.enabled) return null;
|
|
6174
6224
|
if (pathname === "/llms.txt") return "llms";
|
|
6175
6225
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
6176
6226
|
}
|
|
6177
6227
|
async renderGeneratedLlmsTxt(req, res, kind) {
|
|
6178
6228
|
try {
|
|
6179
|
-
const request2 =
|
|
6180
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6229
|
+
const request2 = _chunkIBZW57NWcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6230
|
+
trustProxy: _optionalChain([this, 'access', _185 => _185.config, 'access', _186 => _186.server, 'optionalAccess', _187 => _187.trustProxy])
|
|
6181
6231
|
});
|
|
6182
|
-
const config =
|
|
6232
|
+
const config = _chunk25CHWAZYcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _188 => _188.config, 'access', _189 => _189.agent, 'optionalAccess', _190 => _190.llmsTxt]));
|
|
6183
6233
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
6184
|
-
const body = kind === "llms-full" ? await
|
|
6234
|
+
const body = kind === "llms-full" ? await _chunk25CHWAZYcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
6185
6235
|
origin: await this.getAgentOrigin(request2),
|
|
6186
6236
|
readMarkdown: context.markdown
|
|
6187
6237
|
}) : context.defaults;
|
|
6188
|
-
await
|
|
6238
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0,
|
|
6189
6239
|
res,
|
|
6190
|
-
|
|
6240
|
+
_chunkIGBQSUT5cjs.createFarmMetadataRouteResponse.call(void 0,
|
|
6191
6241
|
kind,
|
|
6192
6242
|
body,
|
|
6193
6243
|
{ revalidate: config.revalidate },
|
|
@@ -6195,8 +6245,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6195
6245
|
)
|
|
6196
6246
|
);
|
|
6197
6247
|
} catch (error) {
|
|
6198
|
-
|
|
6199
|
-
await
|
|
6248
|
+
_chunk7ZDLE77Pcjs.logger.error(`Generated ${kind}.txt failed: ${error}`);
|
|
6249
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0,
|
|
6200
6250
|
res,
|
|
6201
6251
|
new Response("Internal Server Error", {
|
|
6202
6252
|
status: 500,
|
|
@@ -6206,27 +6256,27 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6206
6256
|
}
|
|
6207
6257
|
}
|
|
6208
6258
|
getAgentCrawlers() {
|
|
6209
|
-
return
|
|
6259
|
+
return _chunkERSLQ4C7cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _191 => _191.config, 'access', _192 => _192.agent, 'optionalAccess', _193 => _193.crawlers]));
|
|
6210
6260
|
}
|
|
6211
6261
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
6212
6262
|
async renderGeneratedRobotsTxt(req, res) {
|
|
6213
6263
|
try {
|
|
6214
|
-
const sitemapPath = _optionalChain([this, 'access',
|
|
6264
|
+
const sitemapPath = _optionalChain([this, 'access', _194 => _194.routeManager, 'access', _195 => _195.matchMetadataRoute, 'call', _196 => _196("/sitemap.xml"), 'optionalAccess', _197 => _197.metadata, 'access', _198 => _198.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
|
|
6215
6265
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6216
6266
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6217
|
-
const robots =
|
|
6267
|
+
const robots = _chunkERSLQ4C7cjs.createFarmAgentRobots.call(void 0, {
|
|
6218
6268
|
crawlers: this.getAgentCrawlers(),
|
|
6219
6269
|
sitemapPath,
|
|
6220
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
6270
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _199 => _199.metadataBase]),
|
|
6221
6271
|
basePath: this.config.basePath
|
|
6222
6272
|
});
|
|
6223
|
-
await
|
|
6273
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0,
|
|
6224
6274
|
res,
|
|
6225
|
-
|
|
6275
|
+
_chunkIGBQSUT5cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
6226
6276
|
);
|
|
6227
6277
|
} catch (error) {
|
|
6228
|
-
|
|
6229
|
-
await
|
|
6278
|
+
_chunk7ZDLE77Pcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
6279
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0,
|
|
6230
6280
|
res,
|
|
6231
6281
|
new Response("Internal Server Error", {
|
|
6232
6282
|
status: 500,
|
|
@@ -6236,47 +6286,47 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6236
6286
|
}
|
|
6237
6287
|
}
|
|
6238
6288
|
getAgentSitemap() {
|
|
6239
|
-
return
|
|
6289
|
+
return _chunkERSLQ4C7cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.sitemap]));
|
|
6240
6290
|
}
|
|
6241
6291
|
/** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
|
|
6242
6292
|
async renderGeneratedSitemap(req, res) {
|
|
6243
6293
|
try {
|
|
6244
|
-
const request2 =
|
|
6245
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6294
|
+
const request2 = _chunkIBZW57NWcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6295
|
+
trustProxy: _optionalChain([this, 'access', _203 => _203.config, 'access', _204 => _204.server, 'optionalAccess', _205 => _205.trustProxy])
|
|
6246
6296
|
});
|
|
6247
6297
|
const sources = await Promise.all(
|
|
6248
6298
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
6249
6299
|
const [module, stat] = await Promise.all([
|
|
6250
6300
|
this.routeManager.loadRouteModule(route.modulePath).catch((error) => {
|
|
6251
|
-
|
|
6301
|
+
_chunk7ZDLE77Pcjs.logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
|
|
6252
6302
|
return void 0;
|
|
6253
6303
|
}),
|
|
6254
6304
|
fs7.promises.stat(route.modulePath).catch(() => void 0)
|
|
6255
6305
|
]);
|
|
6256
|
-
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess',
|
|
6257
|
-
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess',
|
|
6306
|
+
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _206 => _206.metadata]))) return null;
|
|
6307
|
+
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _207 => _207.mtime, 'access', _208 => _208.toISOString, 'call', _209 => _209()]) };
|
|
6258
6308
|
})
|
|
6259
6309
|
);
|
|
6260
6310
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6261
6311
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6262
|
-
const sitemap =
|
|
6312
|
+
const sitemap = _chunkERSLQ4C7cjs.createFarmDefaultSitemap.call(void 0,
|
|
6263
6313
|
sources.filter((source) => source !== null),
|
|
6264
6314
|
{
|
|
6265
6315
|
origin: new URL(request2.url).origin,
|
|
6266
6316
|
config: this.getAgentSitemap(),
|
|
6267
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
6317
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _210 => _210.metadataBase]),
|
|
6268
6318
|
basePath: this.config.basePath,
|
|
6269
6319
|
trailingSlash: this.config.trailingSlash,
|
|
6270
|
-
i18n: _optionalChain([this, 'access',
|
|
6320
|
+
i18n: _optionalChain([this, 'access', _211 => _211.i18nRuntime, 'optionalAccess', _212 => _212.config])
|
|
6271
6321
|
}
|
|
6272
6322
|
);
|
|
6273
|
-
await
|
|
6323
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0,
|
|
6274
6324
|
res,
|
|
6275
|
-
|
|
6325
|
+
_chunkIGBQSUT5cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
|
|
6276
6326
|
);
|
|
6277
6327
|
} catch (error) {
|
|
6278
|
-
|
|
6279
|
-
await
|
|
6328
|
+
_chunk7ZDLE77Pcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
|
|
6329
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0,
|
|
6280
6330
|
res,
|
|
6281
6331
|
new Response("Internal Server Error", {
|
|
6282
6332
|
status: 500,
|
|
@@ -6299,9 +6349,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6299
6349
|
* matcher) covers, as the production build decides.
|
|
6300
6350
|
*/
|
|
6301
6351
|
getAgentListedRoutes() {
|
|
6302
|
-
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access',
|
|
6352
|
+
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _213 => _213.middlewareRoutes, 'optionalCall', _214 => _214()]), () => ( [])) };
|
|
6303
6353
|
return [...this.routeManager.getRoutes()].filter(
|
|
6304
|
-
([pattern]) => !pattern.includes("[") && !
|
|
6354
|
+
([pattern]) => !pattern.includes("[") && !_chunkIGBQSUT5cjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
|
|
6305
6355
|
);
|
|
6306
6356
|
}
|
|
6307
6357
|
/**
|
|
@@ -6317,7 +6367,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6317
6367
|
)
|
|
6318
6368
|
)
|
|
6319
6369
|
);
|
|
6320
|
-
return
|
|
6370
|
+
return _chunk25CHWAZYcjs.isFarmPageNoIndex.call(void 0, metadata, layoutMetadata);
|
|
6321
6371
|
}
|
|
6322
6372
|
/**
|
|
6323
6373
|
* The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
|
|
@@ -6325,22 +6375,22 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6325
6375
|
* or a registered server such as the docs engine's. Production applies the same rules.
|
|
6326
6376
|
*/
|
|
6327
6377
|
getDefaultMCPServer() {
|
|
6328
|
-
if (_optionalChain([this, 'access',
|
|
6329
|
-
if (_optionalChain([this, 'access',
|
|
6330
|
-
if (this.routeManager.matchRoute(
|
|
6331
|
-
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer =
|
|
6378
|
+
if (_optionalChain([this, 'access', _215 => _215.config, 'access', _216 => _216.agent, 'optionalAccess', _217 => _217.mcp]) !== true || _chunkR6GOH5CHcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
|
|
6379
|
+
if (_optionalChain([this, 'access', _218 => _218.apiRouteExists, 'optionalCall', _219 => _219("/api/mcp")])) return void 0;
|
|
6380
|
+
if (this.routeManager.matchRoute(_chunkR6GOH5CHcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6381
|
+
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkR6GOH5CHcjs.createFarmDefaultMCPServer.call(void 0,
|
|
6332
6382
|
readAppPackageIdentity(this.config.root),
|
|
6333
|
-
|
|
6383
|
+
_chunkZ7YIQ7AJcjs.FARM_VERSION
|
|
6334
6384
|
))));
|
|
6335
|
-
return
|
|
6385
|
+
return _chunkR6GOH5CHcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
6336
6386
|
}
|
|
6337
6387
|
async renderDefaultMCP(req, res) {
|
|
6338
6388
|
const server = this.getDefaultMCPServer();
|
|
6339
|
-
const request2 = _nullishCoalesce(
|
|
6389
|
+
const request2 = _nullishCoalesce(_chunkIBZW57NWcjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkIBZW57NWcjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _220 => _220.config, 'access', _221 => _221.server, 'optionalAccess', _222 => _222.trustProxy]) })));
|
|
6340
6390
|
try {
|
|
6341
|
-
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-
|
|
6391
|
+
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-S4UTE7NO.cjs");
|
|
6342
6392
|
const origin = new URL(request2.url).origin;
|
|
6343
|
-
const i18n = _optionalChain([this, 'access',
|
|
6393
|
+
const i18n = _optionalChain([this, 'access', _223 => _223.i18nRuntime, 'optionalAccess', _224 => _224.config]);
|
|
6344
6394
|
const metadataBase = await this.getRootMetadataBase();
|
|
6345
6395
|
const response = await handleFarmDefaultMCPRequest(request2, {
|
|
6346
6396
|
server,
|
|
@@ -6355,13 +6405,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6355
6405
|
return await this.isAgentPageNoIndex(pattern, metadata) ? null : { pattern, module };
|
|
6356
6406
|
})
|
|
6357
6407
|
);
|
|
6358
|
-
return
|
|
6408
|
+
return _chunkR6GOH5CHcjs.collectFarmDefaultMCPPages.call(void 0,
|
|
6359
6409
|
sources.filter((source) => source !== null),
|
|
6360
6410
|
{
|
|
6361
6411
|
origin,
|
|
6362
6412
|
metadataBase,
|
|
6363
6413
|
basePath: this.config.basePath,
|
|
6364
|
-
markdown:
|
|
6414
|
+
markdown: _chunkU2HFXURZcjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
6365
6415
|
trailingSlash: this.config.trailingSlash,
|
|
6366
6416
|
i18n
|
|
6367
6417
|
}
|
|
@@ -6370,10 +6420,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6370
6420
|
// Pages are read through this server's own socket, with no cookies, as llms-full.txt does.
|
|
6371
6421
|
readMarkdown: this.createDevMarkdownReader(req)
|
|
6372
6422
|
});
|
|
6373
|
-
await
|
|
6423
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0, res, response);
|
|
6374
6424
|
} catch (error) {
|
|
6375
|
-
|
|
6376
|
-
await
|
|
6425
|
+
_chunk7ZDLE77Pcjs.logger.error(`Default MCP server failed: ${error}`);
|
|
6426
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0,
|
|
6377
6427
|
res,
|
|
6378
6428
|
new Response(
|
|
6379
6429
|
JSON.stringify({
|
|
@@ -6388,7 +6438,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6388
6438
|
}
|
|
6389
6439
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6390
6440
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6391
|
-
const config =
|
|
6441
|
+
const config = _chunk25CHWAZYcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _225 => _225.config, 'access', _226 => _226.agent, 'optionalAccess', _227 => _227.llmsTxt]));
|
|
6392
6442
|
const origin = await this.getAgentOrigin(request2);
|
|
6393
6443
|
const sources = await Promise.all(
|
|
6394
6444
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -6398,36 +6448,36 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6398
6448
|
if (await this.isAgentPageNoIndex(pattern, module.metadata)) return null;
|
|
6399
6449
|
return { pattern, metadata: module.metadata };
|
|
6400
6450
|
} catch (error) {
|
|
6401
|
-
|
|
6451
|
+
_chunk7ZDLE77Pcjs.logger.warn(`Could not read metadata for ${pattern} in llms.txt: ${error}`);
|
|
6402
6452
|
return { pattern };
|
|
6403
6453
|
}
|
|
6404
6454
|
})
|
|
6405
6455
|
);
|
|
6406
6456
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6407
6457
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6408
|
-
const pages =
|
|
6458
|
+
const pages = _chunk25CHWAZYcjs.collectFarmLlmsTxtPages.call(void 0,
|
|
6409
6459
|
sources.filter((source) => source !== null),
|
|
6410
6460
|
{
|
|
6411
6461
|
origin,
|
|
6412
6462
|
basePath: this.config.basePath,
|
|
6413
|
-
markdown:
|
|
6463
|
+
markdown: _chunkU2HFXURZcjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
6414
6464
|
include: config.include,
|
|
6415
6465
|
exclude: config.exclude,
|
|
6416
6466
|
trailingSlash: this.config.trailingSlash,
|
|
6417
|
-
i18n: _optionalChain([this, 'access',
|
|
6467
|
+
i18n: _optionalChain([this, 'access', _228 => _228.i18nRuntime, 'optionalAccess', _229 => _229.config])
|
|
6418
6468
|
}
|
|
6419
6469
|
);
|
|
6420
6470
|
return {
|
|
6421
6471
|
pages,
|
|
6422
|
-
defaults:
|
|
6472
|
+
defaults: _chunk25CHWAZYcjs.createFarmDefaultLlmsTxt.call(void 0, {
|
|
6423
6473
|
origin,
|
|
6424
6474
|
pages,
|
|
6425
6475
|
config,
|
|
6426
6476
|
rootMetadata,
|
|
6427
|
-
mcp: _optionalChain([this, 'access',
|
|
6477
|
+
mcp: _optionalChain([this, 'access', _230 => _230.config, 'access', _231 => _231.agent, 'optionalAccess', _232 => _232.aiCatalog]) === false ? [] : _chunkMZG5M4JScjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
6428
6478
|
basePath: this.config.basePath,
|
|
6429
|
-
apiServerBasePath:
|
|
6430
|
-
|
|
6479
|
+
apiServerBasePath: _chunkH5AC3XSEcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
6480
|
+
_chunkG5KGLMPNcjs.normalizeFarmAPIConfig.call(void 0,
|
|
6431
6481
|
this.config.api
|
|
6432
6482
|
)
|
|
6433
6483
|
),
|
|
@@ -6435,7 +6485,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6435
6485
|
})
|
|
6436
6486
|
}),
|
|
6437
6487
|
...options.full ? {
|
|
6438
|
-
markdown:
|
|
6488
|
+
markdown: _chunk25CHWAZYcjs.readFarmLlmsMarkdownFrom.call(void 0,
|
|
6439
6489
|
new URL(request2.url).origin,
|
|
6440
6490
|
origin,
|
|
6441
6491
|
this.createDevMarkdownReader(options.req)
|
|
@@ -6448,13 +6498,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6448
6498
|
* `metadataBase`, else the request's origin, as for the sitemap and the production server.
|
|
6449
6499
|
*/
|
|
6450
6500
|
async getAgentOrigin(request2) {
|
|
6451
|
-
return
|
|
6501
|
+
return _chunk25CHWAZYcjs.resolveFarmAgentOrigin.call(void 0, await this.getRootMetadataBase(), new URL(request2.url).origin);
|
|
6452
6502
|
}
|
|
6453
6503
|
/** The root layout's `metadataBase`, which generated agent files and list_pages link to. */
|
|
6454
6504
|
async getRootMetadataBase() {
|
|
6455
6505
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6456
6506
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6457
|
-
return _optionalChain([rootMetadata, 'optionalAccess',
|
|
6507
|
+
return _optionalChain([rootMetadata, 'optionalAccess', _233 => _233.metadataBase]);
|
|
6458
6508
|
}
|
|
6459
6509
|
/**
|
|
6460
6510
|
* Reads page mirrors back through this dev server, the way its .md handler
|
|
@@ -6466,17 +6516,17 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6466
6516
|
* body is discarded.
|
|
6467
6517
|
*/
|
|
6468
6518
|
createDevMarkdownReader(req) {
|
|
6469
|
-
const socket = _optionalChain([req, 'optionalAccess',
|
|
6470
|
-
if (_optionalChain([req, 'optionalAccess',
|
|
6519
|
+
const socket = _optionalChain([req, 'optionalAccess', _234 => _234.socket]);
|
|
6520
|
+
if (_optionalChain([req, 'optionalAccess', _235 => _235.method, 'optionalAccess', _236 => _236.toUpperCase, 'call', _237 => _237()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _238 => _238.localAddress]) || !socket.localPort) {
|
|
6471
6521
|
return async () => null;
|
|
6472
6522
|
}
|
|
6473
6523
|
if (socket.encrypted) {
|
|
6474
6524
|
const address = { host: socket.localAddress, port: socket.localPort };
|
|
6475
|
-
return
|
|
6525
|
+
return _chunk25CHWAZYcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
|
|
6476
6526
|
}
|
|
6477
6527
|
const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
|
|
6478
6528
|
const localOrigin = `http://${host}:${socket.localPort}`;
|
|
6479
|
-
const read =
|
|
6529
|
+
const read = _chunk25CHWAZYcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
|
|
6480
6530
|
return (url) => {
|
|
6481
6531
|
const target = new URL(url);
|
|
6482
6532
|
return read(`${localOrigin}${target.pathname}${target.search}`);
|
|
@@ -6508,30 +6558,30 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6508
6558
|
}
|
|
6509
6559
|
const imageProps = {
|
|
6510
6560
|
params: options.params,
|
|
6511
|
-
searchParams:
|
|
6561
|
+
searchParams: _chunkK6LZMZNBcjs.createFarmSearchParams.call(void 0, options.searchParamsObject),
|
|
6512
6562
|
path: options.pagePath
|
|
6513
6563
|
};
|
|
6514
|
-
const handlerResult = await
|
|
6564
|
+
const handlerResult = await _chunkGYH2B4YQcjs.resolveFarmMetadataImageValue.call(void 0, imageModule, imageProps, {
|
|
6515
6565
|
renderer: this.getMetadataImageRenderer(),
|
|
6516
6566
|
component: isRendererCompiledComponent(
|
|
6517
6567
|
options.image.modulePath,
|
|
6518
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
6568
|
+
_nullishCoalesce(_optionalChain([this, 'access', _239 => _239.config, 'access', _240 => _240.renderer, 'optionalAccess', _241 => _241.componentExtensions]), () => ( []))
|
|
6519
6569
|
)
|
|
6520
6570
|
});
|
|
6521
6571
|
await this.writeMetadataImageResponse(req, res, handlerResult, imageModule);
|
|
6522
6572
|
}
|
|
6523
6573
|
async writeMetadataImageResponse(req, res, value, imageModule) {
|
|
6524
6574
|
const ifNoneMatch = req.headers["if-none-match"];
|
|
6525
|
-
const response = await
|
|
6575
|
+
const response = await _chunkGYH2B4YQcjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
|
|
6526
6576
|
method: req.method,
|
|
6527
6577
|
ifNoneMatch: Array.isArray(ifNoneMatch) ? ifNoneMatch[0] : ifNoneMatch,
|
|
6528
6578
|
renderer: this.getMetadataImageRenderer()
|
|
6529
6579
|
});
|
|
6530
|
-
await
|
|
6580
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0, res, response);
|
|
6531
6581
|
}
|
|
6532
6582
|
/** The renderer that draws a metadata image: none for React, whose elements Satori reads directly. */
|
|
6533
6583
|
getMetadataImageRenderer() {
|
|
6534
|
-
return
|
|
6584
|
+
return _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime;
|
|
6535
6585
|
}
|
|
6536
6586
|
async writeStaticMetadataImageResponse(req, res, image) {
|
|
6537
6587
|
const method = (req.method || "GET").toUpperCase();
|
|
@@ -6542,8 +6592,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6542
6592
|
return;
|
|
6543
6593
|
}
|
|
6544
6594
|
const etag = `"${image.staticInfo.hash}"`;
|
|
6545
|
-
const requestUrl =
|
|
6546
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6595
|
+
const requestUrl = _chunkIBZW57NWcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6596
|
+
trustProxy: _optionalChain([this, 'access', _242 => _242.config, 'access', _243 => _243.server, 'optionalAccess', _244 => _244.trustProxy])
|
|
6547
6597
|
});
|
|
6548
6598
|
const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
|
|
6549
6599
|
res.setHeader("Content-Type", image.staticInfo.contentType);
|
|
@@ -6554,7 +6604,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6554
6604
|
"Cache-Control",
|
|
6555
6605
|
isVersioned ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate"
|
|
6556
6606
|
);
|
|
6557
|
-
if (
|
|
6607
|
+
if (_chunk7GKZDRY2cjs.matchesFarmIfNoneMatch.call(void 0, req.headers["if-none-match"], etag)) {
|
|
6558
6608
|
res.statusCode = 304;
|
|
6559
6609
|
res.end();
|
|
6560
6610
|
return;
|
|
@@ -6594,7 +6644,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6594
6644
|
});
|
|
6595
6645
|
let wrapped = errorElement;
|
|
6596
6646
|
const boundaryLayouts = options.errorPattern === void 0 ? options.layouts : options.layouts.filter(
|
|
6597
|
-
(layout) => !("pattern" in layout) ||
|
|
6647
|
+
(layout) => !("pattern" in layout) || _chunkIGBQSUT5cjs.routeBoundaryCoversDirectory.call(void 0,
|
|
6598
6648
|
layout.pattern,
|
|
6599
6649
|
options.errorPattern
|
|
6600
6650
|
)
|
|
@@ -6610,9 +6660,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6610
6660
|
});
|
|
6611
6661
|
}
|
|
6612
6662
|
wrapped = await this.wrapWithIntegrationProviders(wrapped);
|
|
6613
|
-
const html = await
|
|
6663
|
+
const html = await _chunkXZ6L3FUUcjs._runWithMiddlewareData.call(void 0,
|
|
6614
6664
|
options.middlewareMap,
|
|
6615
|
-
() =>
|
|
6665
|
+
() => _chunkXZ6L3FUUcjs._runWithMiddlewareContext.call(void 0,
|
|
6616
6666
|
options.middlewareContext,
|
|
6617
6667
|
() => this.renderElementToCompleteHTML(wrapped)
|
|
6618
6668
|
)
|
|
@@ -6633,7 +6683,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6633
6683
|
res.end();
|
|
6634
6684
|
return true;
|
|
6635
6685
|
} catch (renderError) {
|
|
6636
|
-
|
|
6686
|
+
_chunk7ZDLE77Pcjs.logger.warn(`Failed to render route-level error boundary: ${renderError}`);
|
|
6637
6687
|
return false;
|
|
6638
6688
|
}
|
|
6639
6689
|
}
|
|
@@ -6650,12 +6700,12 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6650
6700
|
*/
|
|
6651
6701
|
renderPreHydrationHold(req, bootClient) {
|
|
6652
6702
|
const hydrates = req.__FARM_IS_CLIENT_COMPONENT__ === true || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true;
|
|
6653
|
-
return hydrates && !bootClient && !this.isIslandsOnlyPage(req) ?
|
|
6703
|
+
return hydrates && !bootClient && !this.isIslandsOnlyPage(req) ? _chunkIGBQSUT5cjs.createPreHydrationClickQueueScript.call(void 0, ) : "";
|
|
6654
6704
|
}
|
|
6655
6705
|
async renderBufferedSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6656
6706
|
const startedAt = Date.now();
|
|
6657
6707
|
const route = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6658
|
-
|
|
6708
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, { type: "render.stream.start", route });
|
|
6659
6709
|
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
6660
6710
|
for (const [key, value] of Object.entries(options.responseHeaders || {})) {
|
|
6661
6711
|
res.setHeader(key, value);
|
|
@@ -6665,15 +6715,15 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6665
6715
|
const routeSlots = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
6666
6716
|
(slot) => ({
|
|
6667
6717
|
...slot,
|
|
6668
|
-
modulePath: typeof slot.modulePath === "string" ?
|
|
6718
|
+
modulePath: typeof slot.modulePath === "string" ? _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
|
|
6669
6719
|
})
|
|
6670
6720
|
);
|
|
6671
|
-
const deferredProps =
|
|
6721
|
+
const deferredProps = _chunkZ2JQR56Wcjs.prepareDeferredData.call(void 0, {
|
|
6672
6722
|
page: req.__FARM_PROPS__ || {},
|
|
6673
6723
|
slots: routeSlots
|
|
6674
6724
|
});
|
|
6675
6725
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
6676
|
-
const relativePath = pagePath ?
|
|
6726
|
+
const relativePath = pagePath ? _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
|
|
6677
6727
|
const deploymentId = this.getDeploymentId();
|
|
6678
6728
|
const farmScripts = (markup) => this.stampFarmScripts(req, markup);
|
|
6679
6729
|
const bootstrapScript = farmScripts(`<script data-farm-refresh-state>
|
|
@@ -6693,12 +6743,12 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
|
|
|
6693
6743
|
window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
|
|
6694
6744
|
window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
|
|
6695
6745
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6696
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6697
|
-
window.__FARM_I18N__ = ${
|
|
6746
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkN4AM7Q34cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6747
|
+
window.__FARM_I18N__ = ${_chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6698
6748
|
</script>`);
|
|
6699
6749
|
const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
|
|
6700
6750
|
const rendererHydrationScript = farmScripts(
|
|
6701
|
-
_optionalChain([this, 'access',
|
|
6751
|
+
_optionalChain([this, 'access', _245 => _245.rendererRuntime, 'access', _246 => _246.generateHydrationScript, 'optionalCall', _247 => _247()]) || ""
|
|
6702
6752
|
);
|
|
6703
6753
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
6704
6754
|
const farmClientScript = farmScripts(
|
|
@@ -6708,8 +6758,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6708
6758
|
const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
|
|
6709
6759
|
element,
|
|
6710
6760
|
{
|
|
6711
|
-
rejectLateNavigation:
|
|
6712
|
-
_optionalChain([req, 'access',
|
|
6761
|
+
rejectLateNavigation: _chunkU2HFXURZcjs._isFarmMarkdownPageCheck.call(void 0,
|
|
6762
|
+
_optionalChain([req, 'access', _248 => _248.headers, 'optionalAccess', _249 => _249[_chunkU2HFXURZcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
|
|
6713
6763
|
)
|
|
6714
6764
|
}
|
|
6715
6765
|
);
|
|
@@ -6719,31 +6769,31 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6719
6769
|
hasFavicon,
|
|
6720
6770
|
hasExplicitTitle,
|
|
6721
6771
|
viewport: viewportTags
|
|
6722
|
-
} =
|
|
6772
|
+
} = _chunkO7B6LJWEcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6723
6773
|
pathname: getFarmMetadataPathname(req),
|
|
6724
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6774
|
+
jsonLd: _optionalChain([this, 'access', _250 => _250.config, 'access', _251 => _251.agent, 'optionalAccess', _252 => _252.jsonLd])
|
|
6725
6775
|
});
|
|
6726
6776
|
const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
6727
6777
|
const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
|
|
6728
|
-
const i18nSnapshot =
|
|
6778
|
+
const i18nSnapshot = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6729
6779
|
const alternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
6730
6780
|
req.__FARM_ROUTE__ || req.url || "/",
|
|
6731
6781
|
i18nSnapshot,
|
|
6732
6782
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6733
6783
|
) : "";
|
|
6734
|
-
const themeDocument =
|
|
6784
|
+
const themeDocument = _chunkIGBQSUT5cjs.createFarmThemeDocumentParts.call(void 0,
|
|
6735
6785
|
this.config.theme,
|
|
6736
6786
|
this.config.basePath,
|
|
6737
|
-
|
|
6787
|
+
_chunkXK7SRVHCcjs.getTheme.call(void 0, )
|
|
6738
6788
|
);
|
|
6739
6789
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
6740
|
-
const fullDocument =
|
|
6790
|
+
const fullDocument = _chunkIGBQSUT5cjs.extractFarmFullDocument.call(void 0, _chunkIGBQSUT5cjs.markFarmDocumentLayouts.call(void 0, content));
|
|
6741
6791
|
let html;
|
|
6742
6792
|
if (fullDocument) {
|
|
6743
6793
|
const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
|
|
6744
|
-
const documentHtml = shouldReplaceLayoutTitle ?
|
|
6745
|
-
const effectiveRendererHead = hasExplicitTitle ?
|
|
6746
|
-
html =
|
|
6794
|
+
const documentHtml = shouldReplaceLayoutTitle ? _chunkIGBQSUT5cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
|
|
6795
|
+
const effectiveRendererHead = hasExplicitTitle ? _chunkIGBQSUT5cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
|
|
6796
|
+
html = _chunkIGBQSUT5cjs.composeFarmFullDocument.call(void 0, documentHtml, {
|
|
6747
6797
|
fallbackIcon: !hasFavicon,
|
|
6748
6798
|
viewport: viewportTags,
|
|
6749
6799
|
htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
|
|
@@ -6770,7 +6820,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6770
6820
|
});
|
|
6771
6821
|
} else {
|
|
6772
6822
|
html = `<!DOCTYPE html>
|
|
6773
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6823
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _253 => _253.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6774
6824
|
<head>
|
|
6775
6825
|
${themeDocument.head}
|
|
6776
6826
|
<meta charset="utf-8">
|
|
@@ -6794,7 +6844,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6794
6844
|
</body>
|
|
6795
6845
|
</html>`;
|
|
6796
6846
|
}
|
|
6797
|
-
|
|
6847
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
6798
6848
|
type: "render.stream.shellReady",
|
|
6799
6849
|
route,
|
|
6800
6850
|
durationMs: Date.now() - startedAt
|
|
@@ -6802,8 +6852,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6802
6852
|
const securedHtml = this.secureDocumentHTML(req, html);
|
|
6803
6853
|
if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
|
|
6804
6854
|
res.end();
|
|
6805
|
-
if (!options.captureStaticShell) await _optionalChain([options, 'access',
|
|
6806
|
-
|
|
6855
|
+
if (!options.captureStaticShell) await _optionalChain([options, 'access', _254 => _254.onComplete, 'optionalCall', _255 => _255(securedHtml)]);
|
|
6856
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
6807
6857
|
type: "render.stream.complete",
|
|
6808
6858
|
route,
|
|
6809
6859
|
durationMs: Date.now() - startedAt
|
|
@@ -6812,7 +6862,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6812
6862
|
emitFarmRenderError(req, route, error);
|
|
6813
6863
|
throw error;
|
|
6814
6864
|
} finally {
|
|
6815
|
-
_optionalChain([clearMiddlewareData, 'optionalCall',
|
|
6865
|
+
_optionalChain([clearMiddlewareData, 'optionalCall', _256 => _256()]);
|
|
6816
6866
|
}
|
|
6817
6867
|
}
|
|
6818
6868
|
/**
|
|
@@ -6822,11 +6872,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6822
6872
|
* call (async, a class, or one using hooks) falls back to detection from the stream.
|
|
6823
6873
|
*/
|
|
6824
6874
|
async rootLayoutRendersDocument(req) {
|
|
6825
|
-
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access',
|
|
6875
|
+
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access', _257 => _257.routeManager, 'access', _258 => _258.getLayouts, 'call', _259 => _259(), 'access', _260 => _260.get, 'call', _261 => _261("/"), 'optionalAccess', _262 => _262.modulePath]) : void 0)));
|
|
6826
6876
|
if (!modulePath) return false;
|
|
6827
6877
|
try {
|
|
6828
6878
|
const Layout = (await this.routeManager.loadLayoutModule(modulePath)).default;
|
|
6829
|
-
if (typeof Layout !== "function" || _optionalChain([Layout, 'access',
|
|
6879
|
+
if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _263 => _263.prototype, 'optionalAccess', _264 => _264.isReactComponent]) || _optionalChain([Layout, 'access', _265 => _265.constructor, 'optionalAccess', _266 => _266.name]) === "AsyncFunction") {
|
|
6830
6880
|
return false;
|
|
6831
6881
|
}
|
|
6832
6882
|
const cached = documentLayouts.get(Layout);
|
|
@@ -6849,17 +6899,17 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6849
6899
|
}
|
|
6850
6900
|
async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6851
6901
|
const runtime = this.rendererRuntime;
|
|
6852
|
-
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (
|
|
6902
|
+
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (_chunkLEZJZX4Ccjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node").web && runtime.renderToReadableStream ? pipeFarmRendererWebStream(runtime) : void 0)));
|
|
6853
6903
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6854
6904
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
|
|
6855
|
-
if (!renderToPipeableStream ||
|
|
6905
|
+
if (!renderToPipeableStream || _chunkU2HFXURZcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _267 => _267.headers, 'optionalAccess', _268 => _268[_chunkU2HFXURZcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && options.captureStaticShell) {
|
|
6856
6906
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6857
6907
|
}
|
|
6858
6908
|
return new Promise((resolve3, reject) => {
|
|
6859
6909
|
const streamStartTime = Date.now();
|
|
6860
6910
|
const observabilityRoute = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6861
6911
|
const deploymentId = this.getDeploymentId();
|
|
6862
|
-
|
|
6912
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, { type: "render.stream.start", route: observabilityRoute });
|
|
6863
6913
|
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
6864
6914
|
for (const [key, value] of Object.entries(options.responseHeaders || {})) {
|
|
6865
6915
|
res.setHeader(key, value);
|
|
@@ -6887,15 +6937,15 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6887
6937
|
let lateNavigationError = null;
|
|
6888
6938
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
6889
6939
|
const isClientComponent = req.__FARM_IS_CLIENT_COMPONENT__ === true;
|
|
6890
|
-
const relativePath = pagePath ?
|
|
6940
|
+
const relativePath = pagePath ? _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
|
|
6891
6941
|
const clientManifest = this.createDevBootClientManifest(req, options);
|
|
6892
6942
|
const routeSlotPayload = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
6893
6943
|
(slot) => ({
|
|
6894
6944
|
...slot,
|
|
6895
|
-
modulePath: typeof slot.modulePath === "string" ?
|
|
6945
|
+
modulePath: typeof slot.modulePath === "string" ? _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
|
|
6896
6946
|
})
|
|
6897
6947
|
);
|
|
6898
|
-
const deferredProps =
|
|
6948
|
+
const deferredProps = _chunkZ2JQR56Wcjs.prepareDeferredData.call(void 0, {
|
|
6899
6949
|
page: req.__FARM_PROPS__ || {},
|
|
6900
6950
|
slots: routeSlotPayload
|
|
6901
6951
|
});
|
|
@@ -6922,52 +6972,52 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
|
|
|
6922
6972
|
req.__FARM_LOADING_MODULE_PATH__ || null
|
|
6923
6973
|
)};
|
|
6924
6974
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6925
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6926
|
-
window.__FARM_I18N__ = ${
|
|
6927
|
-
</script>${
|
|
6975
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkN4AM7Q34cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6976
|
+
window.__FARM_I18N__ = ${_chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6977
|
+
</script>${_chunk4USE4SEUcjs.renderFarmFormStateScript.call(void 0, )}`;
|
|
6928
6978
|
const islandsOnlyPage = this.isIslandsOnlyPage(req);
|
|
6929
6979
|
const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
|
|
6930
6980
|
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;
|
|
6931
|
-
const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts &&
|
|
6981
|
+
const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && _chunkYQXLBYY2cjs.resolveFarmPlatform.call(void 0, ) !== "mobile" && canBootFarmIslandsClient(this.config);
|
|
6932
6982
|
const hydrationClickQueueScript = this.renderPreHydrationHold(req, bootClient);
|
|
6933
|
-
const rendererHydrationScript = _optionalChain([this, 'access',
|
|
6983
|
+
const rendererHydrationScript = _optionalChain([this, 'access', _269 => _269.rendererRuntime, 'access', _270 => _270.generateHydrationScript, 'optionalCall', _271 => _271()]) || "";
|
|
6934
6984
|
const {
|
|
6935
6985
|
title,
|
|
6936
6986
|
tags: metaTags,
|
|
6937
6987
|
hasFavicon,
|
|
6938
6988
|
hasExplicitTitle,
|
|
6939
6989
|
viewport: viewportTags
|
|
6940
|
-
} =
|
|
6990
|
+
} = _chunkO7B6LJWEcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6941
6991
|
pathname: getFarmMetadataPathname(req),
|
|
6942
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6992
|
+
jsonLd: _optionalChain([this, 'access', _272 => _272.config, 'access', _273 => _273.agent, 'optionalAccess', _274 => _274.jsonLd])
|
|
6943
6993
|
});
|
|
6944
|
-
const i18nSnapshot =
|
|
6994
|
+
const i18nSnapshot = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6945
6995
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
6946
6996
|
req.__FARM_ROUTE__ || req.url || "/",
|
|
6947
6997
|
i18nSnapshot,
|
|
6948
6998
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6949
6999
|
) : "";
|
|
6950
7000
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6951
|
-
const themeDocument =
|
|
7001
|
+
const themeDocument = _chunkIGBQSUT5cjs.createFarmThemeDocumentParts.call(void 0,
|
|
6952
7002
|
this.config.theme,
|
|
6953
7003
|
this.config.basePath,
|
|
6954
|
-
|
|
7004
|
+
_chunkXK7SRVHCcjs.getTheme.call(void 0, )
|
|
6955
7005
|
);
|
|
6956
7006
|
const streamRoot = req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? element : this.rendererRuntime.createElement("div", { style: { display: "contents" } }, element);
|
|
6957
7007
|
const devStyleLinks = this.collectDevStyleLinks();
|
|
6958
7008
|
const globalStylesheetLink = this.devGlobalStylesheetLink(true);
|
|
6959
7009
|
const cspNonce = this.getCspNonce(req);
|
|
6960
|
-
const stampDocumentHTML = (html) =>
|
|
6961
|
-
const filterDocumentHTML = (html) => cspNonce ?
|
|
7010
|
+
const stampDocumentHTML = (html) => _chunkIEZFFXSCcjs.stampFarmCspNonce.call(void 0, html, cspNonce || "");
|
|
7011
|
+
const filterDocumentHTML = (html) => cspNonce ? _chunkIEZFFXSCcjs.filterFarmCspNonces.call(void 0, html, cspNonce) : html;
|
|
6962
7012
|
const createLateNavigationRecovery = (navigationError) => this.createLateNavigationRecoveryHTML(req, navigationError);
|
|
6963
7013
|
const earlyClient = this.islandValues();
|
|
6964
7014
|
const earlyClientScript = bootClient ? createFarmDevBootScript(waitingRoot, rootStrategy) : FARM_DEV_EARLY_CLIENT_SCRIPT;
|
|
6965
7015
|
const { pipe, abort } = renderToPipeableStream(streamRoot, {
|
|
6966
7016
|
nonce: cspNonce,
|
|
6967
|
-
formState:
|
|
7017
|
+
formState: _chunk4USE4SEUcjs.getFarmFormState.call(void 0, ),
|
|
6968
7018
|
onShellReady() {
|
|
6969
7019
|
if (pendingNavigationError) {
|
|
6970
|
-
_optionalChain([abort, 'optionalCall',
|
|
7020
|
+
_optionalChain([abort, 'optionalCall', _275 => _275(pendingNavigationError)]);
|
|
6971
7021
|
if (clearMiddlewareData) {
|
|
6972
7022
|
clearMiddlewareData();
|
|
6973
7023
|
}
|
|
@@ -6976,7 +7026,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6976
7026
|
}
|
|
6977
7027
|
shellFlushed = true;
|
|
6978
7028
|
const shellReadyMs = Date.now() - streamStartTime;
|
|
6979
|
-
|
|
7029
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
6980
7030
|
type: "render.stream.shellReady",
|
|
6981
7031
|
route: observabilityRoute,
|
|
6982
7032
|
durationMs: shellReadyMs
|
|
@@ -6985,7 +7035,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6985
7035
|
console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
|
|
6986
7036
|
}
|
|
6987
7037
|
const shell = `<!DOCTYPE html>
|
|
6988
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
7038
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _276 => _276.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6989
7039
|
<head>
|
|
6990
7040
|
${themeDocument.head}
|
|
6991
7041
|
<meta charset="utf-8">
|
|
@@ -7007,14 +7057,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7007
7057
|
let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
|
|
7008
7058
|
let heldHead = "";
|
|
7009
7059
|
const releaseShell = (complete) => {
|
|
7010
|
-
const split =
|
|
7060
|
+
const split = _chunkIGBQSUT5cjs.takeFarmHoistedHead.call(void 0, heldHead, complete);
|
|
7011
7061
|
if (!split) return null;
|
|
7012
|
-
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ?
|
|
7013
|
-
const opened =
|
|
7062
|
+
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? _chunkIGBQSUT5cjs.removeFarmDocumentTitles.call(void 0, pendingShell) : pendingShell;
|
|
7063
|
+
const opened = _chunkIGBQSUT5cjs.appendFarmHead.call(void 0, shellHead, split.head);
|
|
7014
7064
|
pendingShell = "";
|
|
7015
7065
|
heldHead = "";
|
|
7016
7066
|
htmlParts.push(opened);
|
|
7017
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
7067
|
+
_optionalChain([staticShellParts, 'optionalAccess', _277 => _277.push, 'call', _278 => _278(opened)]);
|
|
7018
7068
|
res.write(opened);
|
|
7019
7069
|
return split.body;
|
|
7020
7070
|
};
|
|
@@ -7026,11 +7076,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7026
7076
|
${stampDocumentHTML(earlyClientScript)}`
|
|
7027
7077
|
)
|
|
7028
7078
|
} : document;
|
|
7029
|
-
const documentTransform = streamDocument ?
|
|
7079
|
+
const documentTransform = streamDocument ? _chunkIGBQSUT5cjs.createFarmStreamedDocumentTransform.call(void 0,
|
|
7030
7080
|
(opening) => withEarlyClient(
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
hasExplicitTitle ?
|
|
7081
|
+
_chunkIGBQSUT5cjs.openFarmStreamedDocument.call(void 0,
|
|
7082
|
+
_chunkIGBQSUT5cjs.markFarmDocumentLayouts.call(void 0,
|
|
7083
|
+
hasExplicitTitle ? _chunkIGBQSUT5cjs.removeFarmDocumentTitles.call(void 0, opening) : opening
|
|
7034
7084
|
),
|
|
7035
7085
|
{
|
|
7036
7086
|
fallbackIcon: !hasFavicon,
|
|
@@ -7066,12 +7116,12 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7066
7116
|
let firstChunk = true;
|
|
7067
7117
|
let checkedFullDocument = false;
|
|
7068
7118
|
let documentPrefix = "";
|
|
7069
|
-
const cspNonceRewriter = cspNonce ?
|
|
7119
|
+
const cspNonceRewriter = cspNonce ? _chunkIEZFFXSCcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
|
|
7070
7120
|
const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
|
|
7071
7121
|
const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
|
|
7072
7122
|
if (!checkedFullDocument && renderedText) {
|
|
7073
7123
|
documentPrefix += renderedText;
|
|
7074
|
-
const prefix =
|
|
7124
|
+
const prefix = _chunkIGBQSUT5cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
|
|
7075
7125
|
if (prefix !== "pending") {
|
|
7076
7126
|
checkedFullDocument = true;
|
|
7077
7127
|
documentPrefix = "";
|
|
@@ -7090,7 +7140,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7090
7140
|
staticShellClosed = true;
|
|
7091
7141
|
if (!suspenseHoleEmitted) {
|
|
7092
7142
|
suspenseHoleEmitted = true;
|
|
7093
|
-
_optionalChain([options, 'access',
|
|
7143
|
+
_optionalChain([options, 'access', _279 => _279.onSuspenseHoleDetected, 'optionalCall', _280 => _280()]);
|
|
7094
7144
|
}
|
|
7095
7145
|
} else {
|
|
7096
7146
|
staticShellParts.push(chunkText);
|
|
@@ -7142,7 +7192,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7142
7192
|
const body = releaseShell(true);
|
|
7143
7193
|
if (body) {
|
|
7144
7194
|
htmlParts.push(body);
|
|
7145
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
7195
|
+
_optionalChain([staticShellParts, 'optionalAccess', _281 => _281.push, 'call', _282 => _282(body)]);
|
|
7146
7196
|
res.write(body);
|
|
7147
7197
|
}
|
|
7148
7198
|
}
|
|
@@ -7158,7 +7208,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7158
7208
|
finishStream(callback);
|
|
7159
7209
|
},
|
|
7160
7210
|
(error) => {
|
|
7161
|
-
|
|
7211
|
+
_chunk7ZDLE77Pcjs.logger.error(`Could not recover from a late navigation error: ${error}`);
|
|
7162
7212
|
finishStream(callback);
|
|
7163
7213
|
}
|
|
7164
7214
|
);
|
|
@@ -7174,8 +7224,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7174
7224
|
recordRenderedChunk(tail, rewritten);
|
|
7175
7225
|
if (tail) res.write(tail);
|
|
7176
7226
|
}
|
|
7177
|
-
const documentEnd = _optionalChain([documentTransform, 'optionalAccess',
|
|
7178
|
-
if (_optionalChain([documentEnd, 'optionalAccess',
|
|
7227
|
+
const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _283 => _283.end, 'call', _284 => _284()]);
|
|
7228
|
+
if (_optionalChain([documentEnd, 'optionalAccess', _285 => _285.text])) {
|
|
7179
7229
|
recordRenderedChunk(documentEnd.text, "");
|
|
7180
7230
|
res.write(documentEnd.text);
|
|
7181
7231
|
}
|
|
@@ -7186,7 +7236,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7186
7236
|
deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
|
|
7187
7237
|
earlyClient,
|
|
7188
7238
|
// A full document: Farm's #root closes only where Farm opened it.
|
|
7189
|
-
..._optionalChain([documentEnd, 'optionalAccess',
|
|
7239
|
+
..._optionalChain([documentEnd, 'optionalAccess', _286 => _286.document]) ? { closeRoot: documentEnd.rootOpened } : {}
|
|
7190
7240
|
})
|
|
7191
7241
|
);
|
|
7192
7242
|
htmlParts.push(footer);
|
|
@@ -7208,10 +7258,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7208
7258
|
}
|
|
7209
7259
|
const cachedHtml = staticShellParts ? staticShellParts.join("") : htmlParts.join("");
|
|
7210
7260
|
Promise.resolve(options.onComplete(cachedHtml)).catch((error) => {
|
|
7211
|
-
|
|
7261
|
+
_chunk7ZDLE77Pcjs.logger.warn(`Failed to cache PPR shell: ${error}`);
|
|
7212
7262
|
});
|
|
7213
7263
|
}
|
|
7214
|
-
|
|
7264
|
+
_chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
|
|
7215
7265
|
type: "render.stream.complete",
|
|
7216
7266
|
route: observabilityRoute,
|
|
7217
7267
|
durationMs: Date.now() - streamStartTime
|
|
@@ -7226,8 +7276,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7226
7276
|
},
|
|
7227
7277
|
onShellError(error) {
|
|
7228
7278
|
didError = true;
|
|
7229
|
-
if (!isWebResponse(error) && !
|
|
7230
|
-
|
|
7279
|
+
if (!isWebResponse(error) && !_chunk7MQMWGTLcjs.isFarmRedirectError.call(void 0, error) && !_chunk7MQMWGTLcjs.isFarmNotFoundError.call(void 0, error)) {
|
|
7280
|
+
_chunk7ZDLE77Pcjs.logger.error(`SSR shell error: ${error}`);
|
|
7231
7281
|
emitFarmRenderError(req, observabilityRoute, error);
|
|
7232
7282
|
}
|
|
7233
7283
|
if (clearMiddlewareData) {
|
|
@@ -7237,13 +7287,13 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7237
7287
|
},
|
|
7238
7288
|
onError(error) {
|
|
7239
7289
|
didError = true;
|
|
7240
|
-
if (
|
|
7290
|
+
if (_chunk7MQMWGTLcjs.isFarmRedirectError.call(void 0, error) || _chunk7MQMWGTLcjs.isFarmNotFoundError.call(void 0, error)) {
|
|
7241
7291
|
if (!shellFlushed) _nullishCoalesce(pendingNavigationError, () => ( (pendingNavigationError = error)));
|
|
7242
7292
|
else _nullishCoalesce(lateNavigationError, () => ( (lateNavigationError = error)));
|
|
7243
7293
|
return;
|
|
7244
7294
|
}
|
|
7245
7295
|
if (!isWebResponse(error)) {
|
|
7246
|
-
|
|
7296
|
+
_chunk7ZDLE77Pcjs.logger.error(`SSR streaming error: ${error}`);
|
|
7247
7297
|
emitFarmRenderError(req, observabilityRoute, error);
|
|
7248
7298
|
}
|
|
7249
7299
|
}
|
|
@@ -7255,14 +7305,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7255
7305
|
* sent. Returns false for any other error.
|
|
7256
7306
|
*/
|
|
7257
7307
|
async respondToNavigationError(req, res, error) {
|
|
7258
|
-
if (
|
|
7259
|
-
const redirect =
|
|
7308
|
+
if (_chunk7MQMWGTLcjs.isFarmRedirectError.call(void 0, error)) {
|
|
7309
|
+
const redirect = _chunk7MQMWGTLcjs.getFarmRedirectError.call(void 0, error);
|
|
7260
7310
|
res.statusCode = redirect.status;
|
|
7261
7311
|
res.setHeader("Location", redirect.url);
|
|
7262
7312
|
res.end();
|
|
7263
7313
|
return true;
|
|
7264
7314
|
}
|
|
7265
|
-
if (
|
|
7315
|
+
if (_chunk7MQMWGTLcjs.isFarmNotFoundError.call(void 0, error)) {
|
|
7266
7316
|
await this.render404(req, res);
|
|
7267
7317
|
return true;
|
|
7268
7318
|
}
|
|
@@ -7274,8 +7324,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7274
7324
|
* Response keeps its Location as written, as a document render sends it.
|
|
7275
7325
|
*/
|
|
7276
7326
|
async resolvePageDataRedirect(request2, error) {
|
|
7277
|
-
const redirect =
|
|
7278
|
-
if (!redirect || !
|
|
7327
|
+
const redirect = _chunkS2QSTMBEcjs.getFarmPageDataRedirect.call(void 0, error);
|
|
7328
|
+
if (!redirect || !_chunk7MQMWGTLcjs.isFarmRedirectError.call(void 0, error)) return redirect;
|
|
7279
7329
|
return {
|
|
7280
7330
|
status: redirect.status,
|
|
7281
7331
|
location: await this.runWithRequestContext(
|
|
@@ -7285,40 +7335,40 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7285
7335
|
};
|
|
7286
7336
|
}
|
|
7287
7337
|
localizeRedirectUrl(url) {
|
|
7288
|
-
const snapshot =
|
|
7289
|
-
return snapshot && url.startsWith("/") && !url.startsWith("//") ?
|
|
7338
|
+
const snapshot = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
7339
|
+
return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkKAD5WBY4cjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
|
|
7290
7340
|
}
|
|
7291
7341
|
/**
|
|
7292
7342
|
* The not-found page the renderer's `routes()` mapped, or undefined when the renderer has no route
|
|
7293
7343
|
* rules and the not-found lookup scans `src/app` as before.
|
|
7294
7344
|
*/
|
|
7295
7345
|
getRendererNotFoundPath() {
|
|
7296
|
-
return _optionalChain([this, 'access',
|
|
7346
|
+
return _optionalChain([this, 'access', _287 => _287.config, 'access', _288 => _288.renderer, 'optionalAccess', _289 => _289.routes]) ? this.routeManager.getRendererNotFoundPath() : void 0;
|
|
7297
7347
|
}
|
|
7298
7348
|
/** The app's not-found component, or null when it relies on the built-in page. */
|
|
7299
7349
|
async loadNotFoundModule() {
|
|
7300
7350
|
const notFoundPath = resolveFarmNotFoundComponentPath(
|
|
7301
7351
|
this.config,
|
|
7302
|
-
|
|
7352
|
+
_chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, this.config),
|
|
7303
7353
|
this.getRendererNotFoundPath()
|
|
7304
7354
|
);
|
|
7305
7355
|
if (!notFoundPath) return null;
|
|
7306
7356
|
return await this.routeManager.loadRouteModule(notFoundPath);
|
|
7307
7357
|
}
|
|
7308
7358
|
async loadNotFoundComponent() {
|
|
7309
|
-
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async
|
|
7359
|
+
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _290 => _290.default]), async () => ( null));
|
|
7310
7360
|
}
|
|
7311
7361
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
7312
7362
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
7313
|
-
const metadata = await
|
|
7314
|
-
const { title, tags, hasFavicon } =
|
|
7363
|
+
const metadata = await _chunkO7B6LJWEcjs.resolveFarmNotFoundMetadata.call(void 0, [layoutModule], notFoundModule);
|
|
7364
|
+
const { title, tags, hasFavicon } = _chunkO7B6LJWEcjs.renderMetadataHead.call(void 0, metadata);
|
|
7315
7365
|
return {
|
|
7316
7366
|
head: `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`,
|
|
7317
7367
|
metadata
|
|
7318
7368
|
};
|
|
7319
7369
|
}
|
|
7320
7370
|
defaultNotFoundContent() {
|
|
7321
|
-
const homeHref = escapeHtmlAttribute2(
|
|
7371
|
+
const homeHref = escapeHtmlAttribute2(_chunkTFCBJFP7cjs.applyFarmBasePath.call(void 0, "/", this.config.basePath));
|
|
7322
7372
|
return `<style>${DEFAULT_NOT_FOUND_STYLES}</style><main class="farm-default-not-found" aria-labelledby="farm-default-not-found-title" aria-describedby="farm-default-not-found-description"><div class="farm-default-not-found__content"><h1 id="farm-default-not-found-title" class="farm-default-not-found__code">404</h1><p id="farm-default-not-found-description" class="farm-default-not-found__description">Not found</p><a class="farm-default-not-found__home" href="${homeHref}">GO HOME</a></div></main>`;
|
|
7323
7373
|
}
|
|
7324
7374
|
/**
|
|
@@ -7328,14 +7378,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7328
7378
|
* the document noindex.
|
|
7329
7379
|
*/
|
|
7330
7380
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7331
|
-
if (
|
|
7332
|
-
return
|
|
7333
|
-
this.localizeRedirectUrl(
|
|
7381
|
+
if (_chunk7MQMWGTLcjs.isFarmRedirectError.call(void 0, error)) {
|
|
7382
|
+
return _chunkIGBQSUT5cjs.createLateRedirectRecovery.call(void 0,
|
|
7383
|
+
this.localizeRedirectUrl(_chunk7MQMWGTLcjs.getFarmRedirectError.call(void 0, error).url),
|
|
7334
7384
|
this.getCspNonce(req) || ""
|
|
7335
7385
|
);
|
|
7336
7386
|
}
|
|
7337
|
-
const pathname =
|
|
7338
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7387
|
+
const pathname = _chunkIBZW57NWcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7388
|
+
trustProxy: _optionalChain([this, 'access', _291 => _291.config, 'access', _292 => _292.server, 'optionalAccess', _293 => _293.trustProxy])
|
|
7339
7389
|
}).pathname;
|
|
7340
7390
|
let content = this.defaultNotFoundContent();
|
|
7341
7391
|
const NotFoundComponent = await this.loadNotFoundComponent();
|
|
@@ -7347,42 +7397,42 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7347
7397
|
)
|
|
7348
7398
|
);
|
|
7349
7399
|
} catch (error2) {
|
|
7350
|
-
|
|
7400
|
+
_chunk7ZDLE77Pcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7351
7401
|
}
|
|
7352
7402
|
}
|
|
7353
|
-
return
|
|
7403
|
+
return _chunkIGBQSUT5cjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
|
|
7354
7404
|
}
|
|
7355
7405
|
async render404(req, res) {
|
|
7356
7406
|
res.statusCode = 404;
|
|
7357
|
-
const pathname =
|
|
7358
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7407
|
+
const pathname = _chunkIBZW57NWcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7408
|
+
trustProxy: _optionalChain([this, 'access', _294 => _294.config, 'access', _295 => _295.server, 'optionalAccess', _296 => _296.trustProxy])
|
|
7359
7409
|
}).pathname;
|
|
7360
|
-
if (
|
|
7410
|
+
if (_chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7361
7411
|
res.setHeader("Content-Type", "application/json");
|
|
7362
7412
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
7363
7413
|
return;
|
|
7364
7414
|
}
|
|
7365
|
-
if (res.getHeader(
|
|
7415
|
+
if (res.getHeader(_chunkVIDUNAQEcjs.FARM_DEPLOYMENT_ID_HEADER) === void 0) {
|
|
7366
7416
|
const deploymentMismatch = this.getDeploymentMismatch(req);
|
|
7367
7417
|
if (deploymentMismatch) {
|
|
7368
|
-
await
|
|
7418
|
+
await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0, res, _chunkVIDUNAQEcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch));
|
|
7369
7419
|
return;
|
|
7370
7420
|
}
|
|
7371
7421
|
this.applyDeploymentHeaders(req, res);
|
|
7372
7422
|
}
|
|
7373
7423
|
const acceptHeader = req.headers.accept;
|
|
7374
7424
|
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
7375
|
-
if (
|
|
7376
|
-
res.setHeader("Content-Type",
|
|
7425
|
+
if (_chunkU2HFXURZcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
|
|
7426
|
+
res.setHeader("Content-Type", _chunkU2HFXURZcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
7377
7427
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
7378
7428
|
res.setHeader("Cache-Control", "no-store");
|
|
7379
|
-
res.end(
|
|
7429
|
+
res.end(_chunkU2HFXURZcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
|
|
7380
7430
|
return;
|
|
7381
7431
|
}
|
|
7382
7432
|
const appDir = path10.join(this.config.root, this.config.srcDir, "app");
|
|
7383
|
-
const notFoundExtensions =
|
|
7433
|
+
const notFoundExtensions = _chunkLEZJZX4Ccjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7384
7434
|
let layoutModule = null;
|
|
7385
|
-
const rendererRootLayout = _optionalChain([this, 'access',
|
|
7435
|
+
const rendererRootLayout = _optionalChain([this, 'access', _297 => _297.config, 'access', _298 => _298.renderer, 'optionalAccess', _299 => _299.routes]) ? _optionalChain([this, 'access', _300 => _300.routeManager, 'access', _301 => _301.getLayouts, 'call', _302 => _302(), 'access', _303 => _303.get, 'call', _304 => _304("/"), 'optionalAccess', _305 => _305.modulePath]) : void 0;
|
|
7386
7436
|
try {
|
|
7387
7437
|
for (const layoutPath of rendererRootLayout ? [rendererRootLayout] : notFoundExtensions.map((ext) => path10.join(appDir, `layout${ext}`))) {
|
|
7388
7438
|
if (fs7.existsSync(layoutPath)) {
|
|
@@ -7392,14 +7442,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7392
7442
|
}
|
|
7393
7443
|
const notFoundPath = resolveFarmNotFoundComponentPath(
|
|
7394
7444
|
this.config,
|
|
7395
|
-
|
|
7445
|
+
_chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, this.config),
|
|
7396
7446
|
this.getRendererNotFoundPath()
|
|
7397
7447
|
);
|
|
7398
7448
|
if (notFoundPath) {
|
|
7399
7449
|
const notFoundModule = await this.loadNotFoundModule();
|
|
7400
|
-
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess',
|
|
7450
|
+
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _306 => _306.default]), () => ( null));
|
|
7401
7451
|
if (NotFoundComponent) {
|
|
7402
|
-
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess',
|
|
7452
|
+
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _307 => _307.default]), () => ( null));
|
|
7403
7453
|
let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
|
|
7404
7454
|
if (LayoutComponent) {
|
|
7405
7455
|
element = this.rendererRuntime.createElement(LayoutComponent, {
|
|
@@ -7435,24 +7485,24 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7435
7485
|
}
|
|
7436
7486
|
res.statusCode = statusCode;
|
|
7437
7487
|
const isDev = process.env.NODE_ENV === "development";
|
|
7438
|
-
const requestUrl =
|
|
7439
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7488
|
+
const requestUrl = _chunkIBZW57NWcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7489
|
+
trustProxy: _optionalChain([this, 'access', _308 => _308.config, 'access', _309 => _309.server, 'optionalAccess', _310 => _310.trustProxy])
|
|
7440
7490
|
});
|
|
7441
7491
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7442
|
-
const statusText =
|
|
7492
|
+
const statusText = _chunkIGBQSUT5cjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7443
7493
|
const content = this.stampFarmScripts(
|
|
7444
7494
|
req,
|
|
7445
|
-
|
|
7495
|
+
_chunkIGBQSUT5cjs.createDefaultErrorMarkup.call(void 0, {
|
|
7446
7496
|
statusCode,
|
|
7447
7497
|
statusText,
|
|
7448
7498
|
requestPath: requestUrl.pathname,
|
|
7449
7499
|
method: req.method || "GET",
|
|
7450
|
-
message: _optionalChain([diagnostics, 'optionalAccess',
|
|
7451
|
-
errorName: _optionalChain([diagnostics, 'optionalAccess',
|
|
7452
|
-
stack: _optionalChain([diagnostics, 'optionalAccess',
|
|
7453
|
-
sourceFrame: _optionalChain([diagnostics, 'optionalAccess',
|
|
7500
|
+
message: _optionalChain([diagnostics, 'optionalAccess', _311 => _311.message]),
|
|
7501
|
+
errorName: _optionalChain([diagnostics, 'optionalAccess', _312 => _312.name]),
|
|
7502
|
+
stack: _optionalChain([diagnostics, 'optionalAccess', _313 => _313.stack]),
|
|
7503
|
+
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _314 => _314.sourceFrame]),
|
|
7454
7504
|
development: isDev,
|
|
7455
|
-
farmVersion:
|
|
7505
|
+
farmVersion: _chunkZ7YIQ7AJcjs.FARM_VERSION,
|
|
7456
7506
|
nodeVersion: process.version,
|
|
7457
7507
|
mode: isDev ? "development" : "production"
|
|
7458
7508
|
})
|
|
@@ -7478,19 +7528,19 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7478
7528
|
*/
|
|
7479
7529
|
getI18nAlternateOptions(req, metadata) {
|
|
7480
7530
|
return {
|
|
7481
|
-
metadataBase: _optionalChain([metadata, 'optionalAccess',
|
|
7482
|
-
origin: req ?
|
|
7483
|
-
languages: _optionalChain([metadata, 'optionalAccess',
|
|
7531
|
+
metadataBase: _optionalChain([metadata, 'optionalAccess', _315 => _315.metadataBase]),
|
|
7532
|
+
origin: req ? _chunkIBZW57NWcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _316 => _316.config, 'access', _317 => _317.server, 'optionalAccess', _318 => _318.trustProxy]) }).origin : void 0,
|
|
7533
|
+
languages: _optionalChain([metadata, 'optionalAccess', _319 => _319.alternates, 'optionalAccess', _320 => _320.languages])
|
|
7484
7534
|
};
|
|
7485
7535
|
}
|
|
7486
7536
|
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
|
|
7487
|
-
const i18nSnapshot =
|
|
7537
|
+
const i18nSnapshot = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
7488
7538
|
const farmScripts = (html) => this.stampFarmScripts(alternates.req, html);
|
|
7489
7539
|
const clientScript = isClientComponent ? ` ${farmScripts(`<script type="module" src="/@farm/client.js"></script>`)}` : "";
|
|
7490
7540
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
7491
7541
|
const integrationManifestScript = farmScripts(`<script>
|
|
7492
7542
|
window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
|
|
7493
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
7543
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkN4AM7Q34cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
7494
7544
|
${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
|
|
7495
7545
|
</script>`);
|
|
7496
7546
|
const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -7499,20 +7549,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7499
7549
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7500
7550
|
) : "";
|
|
7501
7551
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7502
|
-
const themeDocument =
|
|
7552
|
+
const themeDocument = _chunkIGBQSUT5cjs.createFarmThemeDocumentParts.call(void 0,
|
|
7503
7553
|
this.config.theme,
|
|
7504
7554
|
this.config.basePath,
|
|
7505
|
-
|
|
7555
|
+
_chunkXK7SRVHCcjs.getTheme.call(void 0, )
|
|
7506
7556
|
);
|
|
7507
7557
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
7508
7558
|
const rendererHydrationScript = farmScripts(
|
|
7509
|
-
_optionalChain([this, 'access',
|
|
7559
|
+
_optionalChain([this, 'access', _321 => _321.rendererRuntime, 'access', _322 => _322.generateHydrationScript, 'optionalCall', _323 => _323()]) || ""
|
|
7510
7560
|
);
|
|
7511
|
-
const viewportTags =
|
|
7512
|
-
const fullDocument =
|
|
7561
|
+
const viewportTags = _chunkO7B6LJWEcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _324 => _324.metadata, 'optionalAccess', _325 => _325.viewport]));
|
|
7562
|
+
const fullDocument = _chunkIGBQSUT5cjs.extractFarmFullDocument.call(void 0, _chunkIGBQSUT5cjs.markFarmDocumentLayouts.call(void 0, content));
|
|
7513
7563
|
if (fullDocument) {
|
|
7514
|
-
return
|
|
7515
|
-
metadataHead ?
|
|
7564
|
+
return _chunkIGBQSUT5cjs.composeFarmFullDocument.call(void 0,
|
|
7565
|
+
metadataHead ? _chunkIGBQSUT5cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
|
|
7516
7566
|
{
|
|
7517
7567
|
fallbackIcon: !metadataHead,
|
|
7518
7568
|
viewport: viewportTags,
|
|
@@ -7538,7 +7588,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7538
7588
|
);
|
|
7539
7589
|
}
|
|
7540
7590
|
return `<!DOCTYPE html>
|
|
7541
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
7591
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _326 => _326.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
7542
7592
|
<head>
|
|
7543
7593
|
${themeDocument.head}
|
|
7544
7594
|
<meta charset="utf-8">
|
|
@@ -7564,7 +7614,7 @@ ${clientScript}
|
|
|
7564
7614
|
}
|
|
7565
7615
|
/** Stamp the response nonce on markup Farm generates (never on rendered app output). */
|
|
7566
7616
|
stampFarmScripts(req, html) {
|
|
7567
|
-
return
|
|
7617
|
+
return _chunkIEZFFXSCcjs.stampFarmCspNonce.call(void 0, html, req && this.getCspNonce(req) || "");
|
|
7568
7618
|
}
|
|
7569
7619
|
/**
|
|
7570
7620
|
* The last pass over a document that holds rendered app output: scripts
|
|
@@ -7573,14 +7623,14 @@ ${clientScript}
|
|
|
7573
7623
|
*/
|
|
7574
7624
|
secureDocumentHTML(req, html) {
|
|
7575
7625
|
const nonce = this.getCspNonce(req);
|
|
7576
|
-
return nonce ?
|
|
7626
|
+
return nonce ? _chunkIEZFFXSCcjs.filterFarmCspNonces.call(void 0, html, nonce) : html;
|
|
7577
7627
|
}
|
|
7578
7628
|
applyDeploymentHeaders(req, res) {
|
|
7579
7629
|
const deploymentId = this.getDeploymentId();
|
|
7580
|
-
res.setHeader(
|
|
7630
|
+
res.setHeader(_chunkVIDUNAQEcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
|
|
7581
7631
|
if ((req.method || "GET").toUpperCase() !== "GET") return;
|
|
7582
|
-
const isSecure =
|
|
7583
|
-
const cookie =
|
|
7632
|
+
const isSecure = _chunkIBZW57NWcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _327 => _327.config, 'access', _328 => _328.server, 'optionalAccess', _329 => _329.trustProxy]) }).protocol === "https:";
|
|
7633
|
+
const cookie = _chunkVIDUNAQEcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
|
|
7584
7634
|
const existing = res.getHeader("Set-Cookie");
|
|
7585
7635
|
if (Array.isArray(existing)) {
|
|
7586
7636
|
res.setHeader("Set-Cookie", [...existing, cookie]);
|
|
@@ -7592,11 +7642,11 @@ ${clientScript}
|
|
|
7592
7642
|
}
|
|
7593
7643
|
getDeploymentMismatch(req) {
|
|
7594
7644
|
const headers = new Headers();
|
|
7595
|
-
for (const name of [
|
|
7645
|
+
for (const name of [_chunkVIDUNAQEcjs.FARM_DEPLOYMENT_ID_HEADER, "cookie"]) {
|
|
7596
7646
|
const value = req.headers[name];
|
|
7597
7647
|
if (value) headers.set(name, Array.isArray(value) ? value.join("; ") : value);
|
|
7598
7648
|
}
|
|
7599
|
-
return
|
|
7649
|
+
return _chunkVIDUNAQEcjs.getFarmDeploymentMismatch.call(void 0,
|
|
7600
7650
|
{ method: req.method || "GET", headers },
|
|
7601
7651
|
this.getDeploymentId()
|
|
7602
7652
|
);
|
|
@@ -7607,6 +7657,7 @@ ${clientScript}
|
|
|
7607
7657
|
};
|
|
7608
7658
|
|
|
7609
7659
|
// src/app.ts
|
|
7660
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
7610
7661
|
|
|
7611
7662
|
var defaultDocsConfig = {
|
|
7612
7663
|
enabled: false,
|
|
@@ -7619,10 +7670,10 @@ function isResolvedDocsConfig(value) {
|
|
|
7619
7670
|
var FarmApp = class {
|
|
7620
7671
|
constructor(config = {}, viteServer) {
|
|
7621
7672
|
this.config = this.normalizeConfig(config);
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
this.i18nRuntime =
|
|
7625
|
-
|
|
7673
|
+
_chunkRFKPIAOFcjs.configureFarmObservability.call(void 0, this.config.observability);
|
|
7674
|
+
_chunkXK7SRVHCcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
|
|
7675
|
+
this.i18nRuntime = _chunkYCIFGYBYcjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
|
|
7676
|
+
_chunkYCIFGYBYcjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
|
|
7626
7677
|
this.viteServer = viteServer;
|
|
7627
7678
|
this.routeManager = new RouteManager(this.config, viteServer);
|
|
7628
7679
|
this.serverRenderer = new ServerRenderer(
|
|
@@ -7634,18 +7685,18 @@ var FarmApp = class {
|
|
|
7634
7685
|
}
|
|
7635
7686
|
async initialize() {
|
|
7636
7687
|
if (process.env.FARM_VERBOSE) {
|
|
7637
|
-
|
|
7688
|
+
_chunk7ZDLE77Pcjs.logger.info("Initializing Farm.js application...");
|
|
7638
7689
|
}
|
|
7639
|
-
await
|
|
7640
|
-
await
|
|
7690
|
+
await _chunkOCQSYDMGcjs.initStorage.call(void 0, this.config.storage);
|
|
7691
|
+
await _chunkVD7ENQP2cjs.configureFarmCache.call(void 0, this.config.cache);
|
|
7641
7692
|
await this.i18nRuntime.initialize();
|
|
7642
7693
|
await this.serverRenderer.initialize();
|
|
7643
7694
|
await this.verifyAppStructure();
|
|
7644
7695
|
await this.routeManager.discoverRoutes();
|
|
7645
|
-
if (
|
|
7696
|
+
if (_chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
|
|
7646
7697
|
this.routeManager.generateClientManifest(this.config.root);
|
|
7647
7698
|
if (process.env.FARM_VERBOSE) {
|
|
7648
|
-
|
|
7699
|
+
_chunk7ZDLE77Pcjs.logger.success("Farm.js application initialized successfully!");
|
|
7649
7700
|
}
|
|
7650
7701
|
}
|
|
7651
7702
|
getRouteManager() {
|
|
@@ -7662,7 +7713,8 @@ var FarmApp = class {
|
|
|
7662
7713
|
}
|
|
7663
7714
|
normalizeConfig(config) {
|
|
7664
7715
|
const root = config.root || process.cwd();
|
|
7665
|
-
const basePath =
|
|
7716
|
+
const basePath = _chunkTFCBJFP7cjs.normalizeFarmConfigBasePath.call(void 0, config.basePath);
|
|
7717
|
+
const serverComponents = _nullishCoalesce(_chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config), () => ( false));
|
|
7666
7718
|
return {
|
|
7667
7719
|
root,
|
|
7668
7720
|
srcDir: config.srcDir || "src",
|
|
@@ -7671,32 +7723,32 @@ var FarmApp = class {
|
|
|
7671
7723
|
outDir: config.outDir || "dist",
|
|
7672
7724
|
basePath,
|
|
7673
7725
|
trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
|
|
7674
|
-
renderer:
|
|
7726
|
+
renderer: _chunkLEZJZX4Ccjs.resolveFarmRenderer.call(void 0, config.renderer),
|
|
7675
7727
|
preset: _nullishCoalesce(config.preset, () => ( "node-server")),
|
|
7676
7728
|
deploy: config.deploy || {},
|
|
7677
7729
|
storage: config.storage || {},
|
|
7678
7730
|
schema: config.schema || {},
|
|
7679
7731
|
cache: config.cache || {},
|
|
7680
|
-
auth: isResolvedAuthConfig(config.auth) ? config.auth :
|
|
7732
|
+
auth: isResolvedAuthConfig(config.auth) ? config.auth : _chunkVZ2P6GRCcjs.resolveFarmAuthConfig.call(void 0, config.auth),
|
|
7681
7733
|
integrations: config.integrations || {},
|
|
7682
7734
|
plugins: config.plugins || [],
|
|
7683
7735
|
migrations: config.migrations || { commands: [] },
|
|
7684
|
-
cron:
|
|
7685
|
-
workflows:
|
|
7736
|
+
cron: _chunkXH4GQ7MTcjs.resolveCronConfig.call(void 0, config.cron),
|
|
7737
|
+
workflows: _chunkXE3E4MERcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
|
|
7686
7738
|
api: normalizeFarmAppAPIConfig(config.api),
|
|
7687
7739
|
middleware: config.middleware || {},
|
|
7688
|
-
routeRules:
|
|
7740
|
+
routeRules: _chunkQZRFEHMScjs.normalizeRouteRules.call(void 0, config.routeRules),
|
|
7689
7741
|
context: config.context || (() => void 0),
|
|
7690
|
-
server:
|
|
7691
|
-
serverActions:
|
|
7692
|
-
security:
|
|
7693
|
-
images:
|
|
7742
|
+
server: _chunk7GKZDRY2cjs.resolveFarmServerConfig.call(void 0, config.server),
|
|
7743
|
+
serverActions: _chunkNMMCBJZMcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
|
|
7744
|
+
security: _chunkIEZFFXSCcjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7745
|
+
images: _chunkJ2JMESBJcjs.resolveFarmImageConfig.call(void 0,
|
|
7694
7746
|
config.images,
|
|
7695
|
-
|
|
7747
|
+
_chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
7696
7748
|
),
|
|
7697
|
-
performance:
|
|
7698
|
-
theme:
|
|
7699
|
-
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n :
|
|
7749
|
+
performance: _chunkERSLQ4C7cjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7750
|
+
theme: _chunkEGMJ5KEUcjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
7751
|
+
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkB2VSX33Tcjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
|
|
7700
7752
|
root,
|
|
7701
7753
|
mode: process.env.NODE_ENV === "production" ? "production" : "development",
|
|
7702
7754
|
basePath
|
|
@@ -7706,27 +7758,29 @@ var FarmApp = class {
|
|
|
7706
7758
|
serverRuntimeConfig: config.serverRuntimeConfig || {},
|
|
7707
7759
|
publicRuntimeConfig: config.publicRuntimeConfig || {},
|
|
7708
7760
|
docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
|
|
7709
|
-
md:
|
|
7710
|
-
mdx:
|
|
7761
|
+
md: _chunkU2HFXURZcjs.resolveMarkdownConfig.call(void 0, config.md),
|
|
7762
|
+
mdx: _chunkYQ5NVEFScjs.resolveMdxConfig.call(void 0, config.mdx),
|
|
7711
7763
|
observability: _nullishCoalesce(config.observability, () => ( false)),
|
|
7712
7764
|
telemetry: config.telemetry !== false,
|
|
7713
7765
|
analytics: config.analytics !== false,
|
|
7714
|
-
devtools:
|
|
7766
|
+
devtools: _chunkRQSPBWXJcjs.resolveFarmDevtoolsConfig.call(void 0,
|
|
7715
7767
|
config.devtools,
|
|
7716
7768
|
process.env.NODE_ENV === "production" ? "production" : "development"
|
|
7717
7769
|
),
|
|
7718
|
-
devIndicators:
|
|
7770
|
+
devIndicators: _chunkVZ2P6GRCcjs.resolveFarmDevIndicatorsConfig.call(void 0,
|
|
7719
7771
|
config.devIndicators,
|
|
7720
7772
|
process.env.NODE_ENV === "production" ? "production" : "development"
|
|
7721
7773
|
),
|
|
7722
7774
|
env: config.env || { server: {}, public: {} },
|
|
7723
7775
|
suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
|
|
7776
|
+
serverComponents,
|
|
7724
7777
|
experimental: {
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7778
|
+
serverActions: _nullishCoalesce(_optionalChain([config, 'access', _330 => _330.experimental, 'optionalAccess', _331 => _331.serverActions]), () => ( false)),
|
|
7779
|
+
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _332 => _332.experimental, 'optionalAccess', _333 => _333.isolatedClientHydration]), () => ( "off")),
|
|
7780
|
+
ppr: _nullishCoalesce(_optionalChain([config, 'access', _334 => _334.experimental, 'optionalAccess', _335 => _335.ppr]), () => ( false)),
|
|
7781
|
+
...config.experimental,
|
|
7782
|
+
// The deprecated spelling mirrors `serverComponents` for code that still reads it.
|
|
7783
|
+
serverComponents
|
|
7730
7784
|
},
|
|
7731
7785
|
agent: _nullishCoalesce(config.agent, () => ( {})),
|
|
7732
7786
|
vite: config.vite || {}
|
|
@@ -7745,32 +7799,32 @@ var FarmApp = class {
|
|
|
7745
7799
|
);
|
|
7746
7800
|
}
|
|
7747
7801
|
async verifyAppStructure() {
|
|
7748
|
-
if (typeof _optionalChain([this, 'access',
|
|
7749
|
-
const appDirs =
|
|
7750
|
-
const hasAppDirectory = (await Promise.all(appDirs.map((appDir) =>
|
|
7802
|
+
if (typeof _optionalChain([this, 'access', _336 => _336.config, 'access', _337 => _337.renderer, 'optionalAccess', _338 => _338.routes]) === "function") return;
|
|
7803
|
+
const appDirs = _chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, this.config);
|
|
7804
|
+
const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunk7ZDLE77Pcjs.fileExists.call(void 0, appDir)))).some(
|
|
7751
7805
|
Boolean
|
|
7752
7806
|
);
|
|
7753
7807
|
if (!hasAppDirectory) {
|
|
7754
|
-
const routeFiles =
|
|
7755
|
-
(source) =>
|
|
7808
|
+
const routeFiles = _chunkPFVNPOKNcjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
|
|
7809
|
+
(source) => _chunkPRKFECGTcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
|
|
7756
7810
|
);
|
|
7757
7811
|
if (routeFiles.length > 0) {
|
|
7758
7812
|
return;
|
|
7759
7813
|
}
|
|
7760
|
-
const appDir =
|
|
7814
|
+
const appDir = _chunk7ZDLE77Pcjs.resolveAppPath.call(void 0, this.config.root, this.config.srcDir, "app");
|
|
7761
7815
|
throw new Error(
|
|
7762
7816
|
`App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
|
|
7763
7817
|
);
|
|
7764
7818
|
}
|
|
7765
|
-
const componentExtensions =
|
|
7819
|
+
const componentExtensions = _chunkLEZJZX4Ccjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7766
7820
|
const rootLayoutPaths = appDirs.flatMap(
|
|
7767
7821
|
(appDir) => componentExtensions.map((extension) => path4.default.join(appDir, `layout${extension}`))
|
|
7768
7822
|
);
|
|
7769
|
-
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) =>
|
|
7823
|
+
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunk7ZDLE77Pcjs.fileExists.call(void 0, p))).then(
|
|
7770
7824
|
(results) => results.some(Boolean)
|
|
7771
7825
|
);
|
|
7772
|
-
if (!hasRootLayout && !
|
|
7773
|
-
|
|
7826
|
+
if (!hasRootLayout && !_chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7827
|
+
_chunk7ZDLE77Pcjs.logger.warn(
|
|
7774
7828
|
`No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
|
|
7775
7829
|
);
|
|
7776
7830
|
}
|
|
@@ -7785,31 +7839,32 @@ function isResolvedAuthConfig(value) {
|
|
|
7785
7839
|
);
|
|
7786
7840
|
}
|
|
7787
7841
|
function normalizeFarmAppAPIConfig(config) {
|
|
7788
|
-
if (typeof _optionalChain([config, 'optionalAccess',
|
|
7842
|
+
if (typeof _optionalChain([config, 'optionalAccess', _339 => _339.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _340 => _340.basePath]) === "function") {
|
|
7789
7843
|
throw new Error(
|
|
7790
7844
|
"Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
|
|
7791
7845
|
);
|
|
7792
7846
|
}
|
|
7793
|
-
return
|
|
7847
|
+
return _chunkG5KGLMPNcjs.normalizeFarmAPIConfig.call(void 0, config);
|
|
7794
7848
|
}
|
|
7795
7849
|
function createFarmApp(config, viteServer) {
|
|
7796
7850
|
return new FarmApp(config, viteServer);
|
|
7797
7851
|
}
|
|
7798
7852
|
|
|
7799
7853
|
// src/image-runtime.ts
|
|
7800
|
-
|
|
7854
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
7855
|
+
var SHARP_INSTALL_HINT = _chunkIDUGG7VRcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
|
|
7801
7856
|
var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
|
|
7802
7857
|
function resolveFarmImageProviderForRuntime(images, options) {
|
|
7803
|
-
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess',
|
|
7858
|
+
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _341 => _341.provider]), () => ( "auto"));
|
|
7804
7859
|
if (provider === "none") return images;
|
|
7805
7860
|
const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
|
|
7806
|
-
if (!usesSharp ||
|
|
7861
|
+
if (!usesSharp || _chunkIDUGG7VRcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
|
|
7807
7862
|
if (provider === "node") {
|
|
7808
7863
|
throw new Error(
|
|
7809
7864
|
`images.provider "node" optimizes images with sharp, which is not installed. ${SHARP_INSTALL_HINT}`
|
|
7810
7865
|
);
|
|
7811
7866
|
}
|
|
7812
|
-
|
|
7867
|
+
_chunk7ZDLE77Pcjs.logger.info(
|
|
7813
7868
|
`Image optimization is off because sharp is not installed; images use their original URLs. ${SHARP_INSTALL_HINT}, or set images.provider to "none".`
|
|
7814
7869
|
);
|
|
7815
7870
|
return Object.freeze({ ...images, provider: "none" });
|
|
@@ -7828,6 +7883,7 @@ function resolveFarmImageServerRuntime(images, preset) {
|
|
|
7828
7883
|
}
|
|
7829
7884
|
|
|
7830
7885
|
// src/markdown-source-path.ts
|
|
7886
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
7831
7887
|
|
|
7832
7888
|
function toBakedMarkdownSourcePath(root, filePath) {
|
|
7833
7889
|
if (!filePath) return "";
|
|
@@ -7840,6 +7896,7 @@ function toBakedMarkdownSourcePath(root, filePath) {
|
|
|
7840
7896
|
}
|
|
7841
7897
|
|
|
7842
7898
|
// src/app-manifest-packages.ts
|
|
7899
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
7843
7900
|
|
|
7844
7901
|
|
|
7845
7902
|
var FARM_PACKAGE = /^@(?:farm\.js|farming-labs)\/[a-z0-9._-]+$/;
|
|
@@ -7877,6 +7934,7 @@ function resolveFarmAppPackages(root) {
|
|
|
7877
7934
|
}
|
|
7878
7935
|
|
|
7879
7936
|
// src/app-manifest-webmcp.ts
|
|
7937
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
7880
7938
|
|
|
7881
7939
|
|
|
7882
7940
|
|
|
@@ -7941,9 +7999,9 @@ function staticValue(node) {
|
|
|
7941
7999
|
}
|
|
7942
8000
|
}
|
|
7943
8001
|
function property(object, name) {
|
|
7944
|
-
return _optionalChain([object, 'access',
|
|
8002
|
+
return _optionalChain([object, 'access', _342 => _342.properties, 'access', _343 => _343.find, 'call', _344 => _344(
|
|
7945
8003
|
(entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
|
|
7946
|
-
), 'optionalAccess',
|
|
8004
|
+
), 'optionalAccess', _345 => _345.value]);
|
|
7947
8005
|
}
|
|
7948
8006
|
function toolFromObject(object) {
|
|
7949
8007
|
const name = staticValue(property(object, "name"));
|
|
@@ -7975,7 +8033,7 @@ function toolFromObject(object) {
|
|
|
7975
8033
|
function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
7976
8034
|
if (!code.includes(WEBMCP_CLIENT)) return [];
|
|
7977
8035
|
const lang = _nullishCoalesce(LANGS[path4.default.extname(filename).slice(1)], () => ( "tsx"));
|
|
7978
|
-
_nullishCoalesce(parseAst3, () => ( (parseAst3 = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename :
|
|
8036
|
+
_nullishCoalesce(parseAst3, () => ( (parseAst3 = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename : _chunkUGL4BDNBcjs.define_import_meta_default.url)(
|
|
7979
8037
|
"rolldown/parseAst"
|
|
7980
8038
|
).parseAst)));
|
|
7981
8039
|
let program;
|
|
@@ -7989,7 +8047,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7989
8047
|
if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
|
|
7990
8048
|
continue;
|
|
7991
8049
|
for (const specifier of statement.specifiers) {
|
|
7992
|
-
const imported = _nullishCoalesce(_optionalChain([specifier, 'access',
|
|
8050
|
+
const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _346 => _346.imported, 'optionalAccess', _347 => _347.name]), () => ( _optionalChain([specifier, 'access', _348 => _348.imported, 'optionalAccess', _349 => _349.value])));
|
|
7993
8051
|
if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
|
|
7994
8052
|
locals.set(specifier.local.name, imported);
|
|
7995
8053
|
}
|
|
@@ -8005,7 +8063,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
8005
8063
|
const [argument] = current.arguments;
|
|
8006
8064
|
if (definer && argument) {
|
|
8007
8065
|
const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
|
|
8008
|
-
(element) => _optionalChain([element, 'optionalAccess',
|
|
8066
|
+
(element) => _optionalChain([element, 'optionalAccess', _350 => _350.type]) === "ObjectExpression"
|
|
8009
8067
|
) : [] : argument.type === "ObjectExpression" ? [argument] : [];
|
|
8010
8068
|
for (const object of objects) {
|
|
8011
8069
|
const tool = toolFromObject(object);
|
|
@@ -8062,12 +8120,13 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
8062
8120
|
}
|
|
8063
8121
|
|
|
8064
8122
|
// src/client-cache-persistence-build.ts
|
|
8123
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8065
8124
|
|
|
8066
8125
|
|
|
8067
8126
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
8068
8127
|
function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
8069
|
-
const client = _optionalChain([cache2, 'optionalAccess',
|
|
8070
|
-
const adapter = _optionalChain([client, 'optionalAccess',
|
|
8128
|
+
const client = _optionalChain([cache2, 'optionalAccess', _351 => _351.client]);
|
|
8129
|
+
const adapter = _optionalChain([client, 'optionalAccess', _352 => _352.adapter]);
|
|
8071
8130
|
if (adapter === void 0) return void 0;
|
|
8072
8131
|
if (typeof adapter !== "string" || adapter.trim().length === 0) {
|
|
8073
8132
|
throw new Error(
|
|
@@ -8082,8 +8141,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
|
8082
8141
|
);
|
|
8083
8142
|
}
|
|
8084
8143
|
const options = {};
|
|
8085
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
8086
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
8144
|
+
if (_optionalChain([client, 'optionalAccess', _353 => _353.version]) !== void 0) options.version = client.version;
|
|
8145
|
+
if (_optionalChain([client, 'optionalAccess', _354 => _354.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
|
|
8087
8146
|
return { importPath: found.replace(/\\/g, "/"), options };
|
|
8088
8147
|
}
|
|
8089
8148
|
function resolveAdapterFile(resolved) {
|
|
@@ -8106,6 +8165,7 @@ function generateClientCachePersistenceCode(entry) {
|
|
|
8106
8165
|
}
|
|
8107
8166
|
|
|
8108
8167
|
// src/document-layout-client.ts
|
|
8168
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8109
8169
|
var FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = String.raw`
|
|
8110
8170
|
const farmLayoutComponentKeys = new WeakMap();
|
|
8111
8171
|
let farmLayoutComponentKeyCount = 0;
|
|
@@ -8267,6 +8327,7 @@ async function buildFarmTreeLayouts(layouts, params, source, options) {
|
|
|
8267
8327
|
`;
|
|
8268
8328
|
|
|
8269
8329
|
// src/client/navigation-scripts.ts
|
|
8330
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8270
8331
|
var FARM_NAVIGATION_SCRIPT_SOURCE = `// The nonce the page's Content Security Policy trusts: the one of the response that loaded the
|
|
8271
8332
|
// document, read once, before a navigation adds scripts that carry another response's nonce.
|
|
8272
8333
|
const farmDocumentScriptNonce = (function() {
|
|
@@ -8353,6 +8414,7 @@ function revealFarmStreamedContent(root) {
|
|
|
8353
8414
|
`;
|
|
8354
8415
|
|
|
8355
8416
|
// src/client/navigation-stream-client.ts
|
|
8417
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8356
8418
|
var FARM_NAVIGATION_STREAM_READER_SOURCE = `// Reads a streamed navigation (F-Stream) up to the end of React's shell. \`next\` then resolves
|
|
8357
8419
|
// with each later flush as it ends, and null at the end; a document without a marker is all shell.
|
|
8358
8420
|
// The marker carries the random token the server sent in the F-Flush header, so page content
|
|
@@ -8427,6 +8489,7 @@ function takeFarmEarlyNavigation(url, headers, signal) {
|
|
|
8427
8489
|
}`;
|
|
8428
8490
|
|
|
8429
8491
|
// src/client/refresh-fields.ts
|
|
8492
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8430
8493
|
var FARM_REFRESH_FIELDS_SOURCE = `// The server-rendered fields of a tree: islands keep their own.
|
|
8431
8494
|
function listFarmServerFields(root) {
|
|
8432
8495
|
return Array.from(root.querySelectorAll("input, textarea, select")).filter(function(field) {
|
|
@@ -8491,6 +8554,7 @@ function restoreFarmServerFields(captured, root) {
|
|
|
8491
8554
|
`;
|
|
8492
8555
|
|
|
8493
8556
|
// src/utils/hook-filters.ts
|
|
8557
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8494
8558
|
|
|
8495
8559
|
|
|
8496
8560
|
function escapeRegExp(value) {
|
|
@@ -8512,6 +8576,7 @@ function fileNamePattern(files) {
|
|
|
8512
8576
|
}
|
|
8513
8577
|
|
|
8514
8578
|
// src/docs/client-config.ts
|
|
8579
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8515
8580
|
|
|
8516
8581
|
|
|
8517
8582
|
|
|
@@ -8524,7 +8589,7 @@ function propertyKeyName(property2) {
|
|
|
8524
8589
|
return void 0;
|
|
8525
8590
|
}
|
|
8526
8591
|
function redactFarmDocsClientConfig(code, filename) {
|
|
8527
|
-
_nullishCoalesce(parseAst4, () => ( (parseAst4 = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename :
|
|
8592
|
+
_nullishCoalesce(parseAst4, () => ( (parseAst4 = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename : _chunkUGL4BDNBcjs.define_import_meta_default.url)(
|
|
8528
8593
|
"rolldown/parseAst"
|
|
8529
8594
|
).parseAst)));
|
|
8530
8595
|
const extension = path4.default.extname(filename);
|
|
@@ -8541,8 +8606,8 @@ function redactFarmDocsClientConfig(code, filename) {
|
|
|
8541
8606
|
const current = node;
|
|
8542
8607
|
if (current.type === "Property") {
|
|
8543
8608
|
const name = propertyKeyName(current);
|
|
8544
|
-
const valueType = _optionalChain([current, 'access',
|
|
8545
|
-
const credential = name !== void 0 && (name.toLowerCase() === "headers" ||
|
|
8609
|
+
const valueType = _optionalChain([current, 'access', _355 => _355.value, 'optionalAccess', _356 => _356.type]);
|
|
8610
|
+
const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkP4ZLFUNBcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
|
|
8546
8611
|
if (name && credential) {
|
|
8547
8612
|
edits.push(
|
|
8548
8613
|
current.shorthand || current.method || current.kind !== "init" ? { start: current.start, end: current.end, text: `${JSON.stringify(name)}: undefined` } : {
|
|
@@ -8584,7 +8649,7 @@ function farmDocsClientConfigPlugin(configModule) {
|
|
|
8584
8649
|
// Never matches without a docs config module, so the bundler never calls the handler.
|
|
8585
8650
|
filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
|
|
8586
8651
|
handler(code, id, options) {
|
|
8587
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
8652
|
+
if (_optionalChain([options, 'optionalAccess', _357 => _357.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
|
|
8588
8653
|
const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
|
|
8589
8654
|
return redacted === null ? null : { code: redacted, map: null };
|
|
8590
8655
|
}
|
|
@@ -8593,6 +8658,7 @@ function farmDocsClientConfigPlugin(configModule) {
|
|
|
8593
8658
|
}
|
|
8594
8659
|
|
|
8595
8660
|
// src/video-player.ts
|
|
8661
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8596
8662
|
var FARM_VIDEO_PLAYER_HTML = `<!doctype html>
|
|
8597
8663
|
<html lang="en">
|
|
8598
8664
|
<head>
|
|
@@ -8659,6 +8725,7 @@ var FARM_VIDEO_PLAYER_HTML = `<!doctype html>
|
|
|
8659
8725
|
`;
|
|
8660
8726
|
|
|
8661
8727
|
// src/server/vite-config.ts
|
|
8728
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8662
8729
|
|
|
8663
8730
|
var FARM_CLIENT_ENTRY_PATTERN = "**/{page,layout,loading,error,not-found,default}.{js,jsx,ts,tsx}";
|
|
8664
8731
|
var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
@@ -8697,27 +8764,27 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
|
8697
8764
|
function isInstalledPackage(root, specifier) {
|
|
8698
8765
|
const parts = specifier.split("/");
|
|
8699
8766
|
const name = specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
|
|
8700
|
-
const directory =
|
|
8767
|
+
const directory = _chunkEWPH5IOCcjs.findFarmAppPackageDir.call(void 0, root, name);
|
|
8701
8768
|
return directory !== void 0 && directory.split(path4.default.sep).includes("node_modules");
|
|
8702
8769
|
}
|
|
8703
8770
|
function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
8704
8771
|
return Array.from(
|
|
8705
8772
|
/* @__PURE__ */ new Set([
|
|
8706
8773
|
...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE,
|
|
8707
|
-
..._optionalChain([renderer, 'optionalAccess',
|
|
8774
|
+
..._optionalChain([renderer, 'optionalAccess', _358 => _358.optimizeDeps]) || [],
|
|
8708
8775
|
// Farm's browser entry imports a renderer's client module, and no app file does, so Vite's
|
|
8709
8776
|
// scan never sees it and finds it only on the first page request, then bundles again. The
|
|
8710
8777
|
// React entry imports `react-dom/client` instead, which is already listed. A linked
|
|
8711
8778
|
// renderer stays source: pre-bundling it would copy the packages it shares with the app's
|
|
8712
8779
|
// components into the bundle, so a hook would read a different copy than the renderer set.
|
|
8713
|
-
...renderer && root && !
|
|
8780
|
+
...renderer && root && !_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, renderer) && _chunkLVYUTMW4cjs.isPackageSpecifier.call(void 0, renderer.client) && isInstalledPackage(root, renderer.client) ? [renderer.client] : [],
|
|
8714
8781
|
// Farm's renderer API, which a renderer's bindings import. An app's components reach it only
|
|
8715
8782
|
// through them, from files Vite's scan may not read, such as a custom renderer's own format.
|
|
8716
8783
|
// Served as source from a linked renderer, its imports were found on the first page request,
|
|
8717
8784
|
// and Vite bundled again and reloaded the page while it loaded.
|
|
8718
|
-
...renderer && !
|
|
8785
|
+
...renderer && !_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, renderer) ? ["@farm.js/core/renderer-client"] : [],
|
|
8719
8786
|
// The islands runtime of a renderer that declares `islands`, which only Farm's entry imports.
|
|
8720
|
-
...renderer && !
|
|
8787
|
+
...renderer && !_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, renderer) && _chunkLEZJZX4Ccjs.getFarmRendererCapabilities.call(void 0, renderer).islands ? [
|
|
8721
8788
|
"@farm.js/core/internal/renderer-islands",
|
|
8722
8789
|
"@farm.js/core > @farm.js/islx/islands/client"
|
|
8723
8790
|
] : []
|
|
@@ -8733,7 +8800,7 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
|
8733
8800
|
});
|
|
8734
8801
|
}
|
|
8735
8802
|
function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
8736
|
-
if (
|
|
8803
|
+
if (_chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, renderer)) return { noDiscovery: true, include: [] };
|
|
8737
8804
|
const jsxImportSource = renderer ? renderer.jsxImportSource : void 0;
|
|
8738
8805
|
return {
|
|
8739
8806
|
// Keep normal application dependency discovery for CJS-only packages, but
|
|
@@ -8746,7 +8813,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
|
8746
8813
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
8747
8814
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
8748
8815
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
8749
|
-
..._optionalChain([entries, 'optionalAccess',
|
|
8816
|
+
..._optionalChain([entries, 'optionalAccess', _359 => _359.length]) ? { entries: [...entries] } : {},
|
|
8750
8817
|
// Vite's dependency scan compiles JSX on its own: with the app tsconfig's `jsxImportSource`
|
|
8751
8818
|
// when there is one, otherwise as React, whatever the renderer's plugin set for its own
|
|
8752
8819
|
// transforms. React is the default already, and naming it here would override a tsconfig
|
|
@@ -8787,8 +8854,8 @@ function mergeFarmViteAlias(farmValue, userValue) {
|
|
|
8787
8854
|
return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
|
|
8788
8855
|
}
|
|
8789
8856
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
8790
|
-
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8791
|
-
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8857
|
+
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _360 => _360.optimizeDeps, 'optionalAccess', _361 => _361.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _362 => _362.optimizeDeps, 'optionalAccess', _363 => _363.noDiscovery])));
|
|
8858
|
+
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _364 => _364.optimizeDeps, 'optionalAccess', _365 => _365.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _366 => _366.optimizeDeps, 'optionalAccess', _367 => _367.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _368 => _368.optimizeDeps, 'optionalAccess', _369 => _369.holdUntilCrawlEnd]))));
|
|
8792
8859
|
return {
|
|
8793
8860
|
...farmConfig,
|
|
8794
8861
|
...userConfig,
|
|
@@ -8800,9 +8867,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8800
8867
|
resolve: {
|
|
8801
8868
|
...farmConfig.resolve,
|
|
8802
8869
|
...userConfig.resolve,
|
|
8803
|
-
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access',
|
|
8870
|
+
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _370 => _370.resolve, 'optionalAccess', _371 => _371.alias]), _optionalChain([userConfig, 'access', _372 => _372.resolve, 'optionalAccess', _373 => _373.alias])),
|
|
8804
8871
|
dedupe: Array.from(
|
|
8805
|
-
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access',
|
|
8872
|
+
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _374 => _374.resolve, 'optionalAccess', _375 => _375.dedupe]) || [], ..._optionalChain([userConfig, 'access', _376 => _376.resolve, 'optionalAccess', _377 => _377.dedupe]) || []])
|
|
8806
8873
|
)
|
|
8807
8874
|
},
|
|
8808
8875
|
optimizeDeps: {
|
|
@@ -8812,21 +8879,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8812
8879
|
holdUntilCrawlEnd,
|
|
8813
8880
|
include: Array.from(
|
|
8814
8881
|
/* @__PURE__ */ new Set([
|
|
8815
|
-
..._optionalChain([farmConfig, 'access',
|
|
8816
|
-
..._optionalChain([userConfig, 'access',
|
|
8882
|
+
..._optionalChain([farmConfig, 'access', _378 => _378.optimizeDeps, 'optionalAccess', _379 => _379.include]) || [],
|
|
8883
|
+
..._optionalChain([userConfig, 'access', _380 => _380.optimizeDeps, 'optionalAccess', _381 => _381.include]) || []
|
|
8817
8884
|
])
|
|
8818
8885
|
),
|
|
8819
8886
|
exclude: Array.from(
|
|
8820
8887
|
/* @__PURE__ */ new Set([
|
|
8821
|
-
..._optionalChain([farmConfig, 'access',
|
|
8822
|
-
..._optionalChain([userConfig, 'access',
|
|
8888
|
+
..._optionalChain([farmConfig, 'access', _382 => _382.optimizeDeps, 'optionalAccess', _383 => _383.exclude]) || [],
|
|
8889
|
+
..._optionalChain([userConfig, 'access', _384 => _384.optimizeDeps, 'optionalAccess', _385 => _385.exclude]) || []
|
|
8823
8890
|
])
|
|
8824
8891
|
)
|
|
8825
8892
|
},
|
|
8826
8893
|
ssr: {
|
|
8827
8894
|
...farmConfig.ssr,
|
|
8828
8895
|
...userConfig.ssr,
|
|
8829
|
-
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access',
|
|
8896
|
+
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _386 => _386.ssr, 'optionalAccess', _387 => _387.noExternal]), _optionalChain([userConfig, 'access', _388 => _388.ssr, 'optionalAccess', _389 => _389.noExternal]))
|
|
8830
8897
|
}
|
|
8831
8898
|
};
|
|
8832
8899
|
}
|
|
@@ -8897,8 +8964,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8897
8964
|
...userRolldownOptions
|
|
8898
8965
|
};
|
|
8899
8966
|
const merged = mergeFarmViteConfig(farmConfig, shared);
|
|
8900
|
-
const farmBundlerOptions = _optionalChain([farmConfig, 'access',
|
|
8901
|
-
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess',
|
|
8967
|
+
const farmBundlerOptions = _optionalChain([farmConfig, 'access', _390 => _390.build, 'optionalAccess', _391 => _391.rollupOptions]);
|
|
8968
|
+
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _392 => _392.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _393 => _393.output]);
|
|
8902
8969
|
return {
|
|
8903
8970
|
...merged,
|
|
8904
8971
|
build: {
|
|
@@ -8915,15 +8982,16 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8915
8982
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
8916
8983
|
ssr: {
|
|
8917
8984
|
...merged.ssr,
|
|
8918
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
8985
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _394 => _394.ssr, 'optionalAccess', _395 => _395.external]), _optionalChain([userConfig, 'access', _396 => _396.ssr, 'optionalAccess', _397 => _397.external]))
|
|
8919
8986
|
}
|
|
8920
8987
|
};
|
|
8921
8988
|
}
|
|
8922
8989
|
|
|
8923
8990
|
// src/theme/vite.ts
|
|
8991
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
8924
8992
|
var FARM_DARK_VARIANT = '@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));';
|
|
8925
8993
|
function createFarmThemeCssPlugin(input, basePath = "/") {
|
|
8926
|
-
const config =
|
|
8994
|
+
const config = _chunkEGMJ5KEUcjs.resolveFarmThemeConfig.call(void 0, input, basePath);
|
|
8927
8995
|
return {
|
|
8928
8996
|
name: "farm:theme-css",
|
|
8929
8997
|
enforce: "pre",
|