@farm.js/core 0.1.74 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-handler-NRIL4JBC.cjs → agent-mcp-handler-73SGWVZT.cjs} +9 -9
- package/dist/{agent-mcp-handler-HX4F4VKN.mjs → agent-mcp-handler-PJKZHYSA.mjs} +8 -8
- package/dist/{agent-mcp.d-CX8_oOT_.d.ts → agent-mcp.d-Djvao5eV.d.ts} +24 -2
- package/dist/{agent-mcp.d-BEhDfdWc.d.mts → agent-mcp.d-wA13pwmS.d.mts} +24 -2
- package/dist/agent-runtime.cjs +7 -7
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +6 -6
- package/dist/analyzer-23GCBYFI.cjs +16 -0
- package/dist/{analyzer-2K35LIQZ.mjs → analyzer-LJHMFCDW.mjs} +2 -2
- package/dist/api/client.cjs +4 -4
- package/dist/api/client.mjs +3 -3
- package/dist/api/client.native.cjs +6 -6
- package/dist/api/client.native.mjs +3 -3
- package/dist/api/node.cjs +12 -12
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/node.mjs +11 -11
- package/dist/api/route-manager.cjs +20 -20
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +19 -19
- package/dist/api/runtime.cjs +11 -11
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +10 -10
- package/dist/api.cjs +23 -23
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +22 -22
- package/dist/{app-manifest.d-CVEx1CFB.d.ts → app-manifest.d-BukcP_EV.d.ts} +1 -1
- package/dist/{app-manifest.d-BcXt2yCx.d.mts → app-manifest.d-DIuqSi9k.d.mts} +1 -1
- package/dist/app-markdown.cjs +7 -7
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +6 -6
- package/dist/{app.d-B6i8CSrx.d.ts → app.d-BQqmM6Gy.d.ts} +29 -4
- package/dist/{app.d-DowzSmT5.d.mts → app.d-YVuFb10p.d.mts} +29 -4
- package/dist/{base-path.d-BJ3SYpB8.d.mts → base-path.d-m7wvRMnG.d.mts} +15 -1
- package/dist/{base-path.d-BJ3SYpB8.d.ts → base-path.d-m7wvRMnG.d.ts} +15 -1
- package/dist/cache.cjs +2 -2
- package/dist/cache.d.mts +14 -1
- package/dist/cache.d.ts +14 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-JYNNIGQO.cjs → chunk-25JGHAGH.cjs} +11 -1
- package/dist/{chunk-GWXZS7K5.mjs → chunk-2LKUR5QJ.mjs} +1 -1
- package/dist/{chunk-B3XY6FMC.mjs → chunk-2NQ3S2SJ.mjs} +3 -3
- package/dist/chunk-2PJVEL56.cjs +90 -0
- package/dist/{chunk-4M5ESTJ2.cjs → chunk-2RSVYJT6.cjs} +19 -3
- package/dist/{chunk-PG6ZIHKE.cjs → chunk-2YJ4DHTD.cjs} +2 -2
- package/dist/{chunk-MGZVDX4R.mjs → chunk-3AJQFVWW.mjs} +3 -3
- package/dist/{chunk-DRHHTHA3.mjs → chunk-3GMD2E4Q.mjs} +3 -3
- package/dist/{chunk-S3D6SL2V.cjs → chunk-42EUEYW6.cjs} +17 -12
- package/dist/{chunk-D2IAYGYA.mjs → chunk-47R7CX4A.mjs} +6 -6
- package/dist/{chunk-YQWRBBAA.mjs → chunk-4PWGLPL6.mjs} +1 -1
- package/dist/{chunk-7S7AAK2D.mjs → chunk-4QBFYEDC.mjs} +2 -1
- package/dist/{chunk-UHAARKF3.mjs → chunk-4T2RB4JA.mjs} +5 -5
- package/dist/{chunk-KMYOKQPP.cjs → chunk-4VLXQ55O.cjs} +27 -22
- package/dist/{chunk-V6T3UJAH.cjs → chunk-4ZSZI6XL.cjs} +17 -17
- package/dist/{chunk-XGJVRPYL.cjs → chunk-52LTENRE.cjs} +3 -3
- package/dist/{chunk-RQ4UZJPR.cjs → chunk-5AMH6AFA.cjs} +5 -3
- package/dist/{chunk-AYP2YFVN.mjs → chunk-5KAEGBIL.mjs} +75 -42
- package/dist/{chunk-FCBUNILW.mjs → chunk-5O3SK3ZC.mjs} +4 -4
- package/dist/{chunk-IJFNXP3D.cjs → chunk-5QZT2EQN.cjs} +2 -2
- package/dist/{chunk-X2KNHD4B.mjs → chunk-5WFPZG7K.mjs} +8 -8
- package/dist/{chunk-TPDKFRQX.cjs → chunk-62DZHPDK.cjs} +16 -11
- package/dist/{chunk-DTBRSRTR.cjs → chunk-63EFR2WF.cjs} +6 -5
- package/dist/{chunk-2RCCFB2Y.cjs → chunk-6B44ZU5P.cjs} +11 -11
- package/dist/{chunk-ZRCGPSUM.cjs → chunk-6D3CJFNU.cjs} +37 -21
- package/dist/{chunk-65OS2TOT.cjs → chunk-6DBBMQWT.cjs} +34 -34
- package/dist/{chunk-IP2R2TAE.mjs → chunk-6MATGOEF.mjs} +1 -1
- package/dist/{chunk-ACAEFEOH.cjs → chunk-7564NP5Z.cjs} +10 -10
- package/dist/{chunk-7H45IJWO.mjs → chunk-7DBJ2SWK.mjs} +1 -1
- package/dist/chunk-7E4FDO5X.mjs +265 -0
- package/dist/{chunk-FPBOAG6N.cjs → chunk-7EOSFIPN.cjs} +3 -3
- package/dist/{chunk-DRBXYJZ6.mjs → chunk-7FQFK3OA.mjs} +2 -2
- package/dist/{chunk-TUOO6IK3.mjs → chunk-7H2TXT2K.mjs} +11 -1
- package/dist/{chunk-A4PWGL46.mjs → chunk-7KDCVSTR.mjs} +4 -4
- package/dist/{chunk-GPICBTDV.cjs → chunk-7Q2YWZF7.cjs} +6 -6
- package/dist/{chunk-CFG4QERR.cjs → chunk-7Q7UB4TL.cjs} +2 -2
- package/dist/chunk-A3LNXQJJ.cjs +265 -0
- package/dist/{chunk-BFOMCSZ2.mjs → chunk-A5F55ZFA.mjs} +184 -27
- package/dist/{chunk-S6O2L47H.mjs → chunk-AG27TI6Q.mjs} +67 -5
- package/dist/{chunk-DC2AXGNZ.mjs → chunk-AM2M56SL.mjs} +1 -1
- package/dist/{chunk-JRHGJVJH.mjs → chunk-B5QRNCIE.mjs} +1 -1
- package/dist/{chunk-R6Q6VSGU.mjs → chunk-BGUTIQII.mjs} +1 -1
- package/dist/{chunk-3OMLZLDE.cjs → chunk-BNCKXPCU.cjs} +44 -0
- package/dist/{chunk-35GBGSQZ.cjs → chunk-BNTRXJL4.cjs} +3 -3
- package/dist/{chunk-BPAXGCKX.mjs → chunk-BRNPLD22.mjs} +30 -17
- package/dist/{chunk-JZGL2PIH.mjs → chunk-CDT7CGQT.mjs} +2 -2
- package/dist/{chunk-BNXV3PRM.mjs → chunk-CF74ABRI.mjs} +10 -10
- package/dist/chunk-CIY74JLV.cjs +134 -0
- package/dist/{chunk-IZ5WOTQP.mjs → chunk-CLM73YYD.mjs} +2 -2
- package/dist/{chunk-FGXSWRWA.mjs → chunk-CSAIIMY3.mjs} +1 -1
- package/dist/{chunk-EF5AP4CV.cjs → chunk-CYNQPKA4.cjs} +2 -2
- package/dist/{chunk-M53MIIXY.mjs → chunk-CZOXZ6WQ.mjs} +1 -1
- package/dist/{chunk-ROPMQNCG.mjs → chunk-DASQJ5UD.mjs} +2 -2
- package/dist/{chunk-BWFBTTJ5.cjs → chunk-DD22NQFX.cjs} +2 -2
- package/dist/{chunk-AL6E63FZ.mjs → chunk-DUSTJ6A5.mjs} +20 -17
- package/dist/{chunk-EWIEJQP6.cjs → chunk-DZ3AZ7UK.cjs} +52 -52
- package/dist/{chunk-6YFC3ZFX.mjs → chunk-DZXD6CYJ.mjs} +1 -1
- package/dist/{chunk-Q4G52OSW.mjs → chunk-EMTN5ABC.mjs} +1 -1
- package/dist/{chunk-GK2GBIXD.mjs → chunk-ERT6HQAI.mjs} +8 -3
- package/dist/{chunk-ZLRWO5GK.mjs → chunk-F35C3TJZ.mjs} +1 -1
- package/dist/{chunk-F244KE2D.cjs → chunk-F4ID7BGO.cjs} +33 -30
- package/dist/{chunk-C7GJDVN4.mjs → chunk-F7MJWW6A.mjs} +1 -1
- package/dist/{chunk-WTTJ2YS2.mjs → chunk-FCAYYLAE.mjs} +18 -2
- package/dist/{chunk-PWKAX5MS.cjs → chunk-FDZZ6K3N.cjs} +6 -6
- package/dist/{chunk-MHLNWRCJ.cjs → chunk-FE6KYDHC.cjs} +3 -3
- package/dist/{chunk-PTLXHRJZ.mjs → chunk-FLMALEY2.mjs} +37 -4
- package/dist/{chunk-GRHSQYD4.cjs → chunk-G7B6NU4X.cjs} +11 -11
- package/dist/{chunk-E4T7WJJN.mjs → chunk-GAAK3HDZ.mjs} +28 -7
- package/dist/{chunk-QMNWKQL4.cjs → chunk-GC5ROI3A.cjs} +4 -4
- package/dist/{chunk-JXIYH2NO.cjs → chunk-GCJ4GNMC.cjs} +4 -4
- package/dist/{chunk-KNEYWPZV.mjs → chunk-GFXKO4UW.mjs} +42 -10
- package/dist/{chunk-AU5UPNOD.mjs → chunk-GLF44JKY.mjs} +3 -3
- package/dist/{chunk-GUZC226X.mjs → chunk-GLVDXRG2.mjs} +1 -1
- package/dist/{chunk-FEQ72ZHD.mjs → chunk-GNY7BO7R.mjs} +6 -6
- package/dist/{chunk-OWQV6MLM.cjs → chunk-GYJT2U7J.cjs} +2 -1
- package/dist/{chunk-XZPI44Q7.cjs → chunk-H7OFZJCV.cjs} +8 -8
- package/dist/{chunk-IG4IQMIW.mjs → chunk-H7QY7ZE4.mjs} +1 -1
- package/dist/{chunk-2TZ3F6TN.cjs → chunk-HFJLMALC.cjs} +25 -25
- package/dist/{chunk-CROAFCMW.mjs → chunk-HONTCUK6.mjs} +1 -1
- package/dist/{chunk-7PJARAQQ.mjs → chunk-HQ2VAJLW.mjs} +1 -1
- package/dist/{chunk-LHFGTR7F.mjs → chunk-HT2SZKXG.mjs} +92 -10
- package/dist/{chunk-6JEXH7N6.mjs → chunk-HV2WZFUW.mjs} +1 -1
- package/dist/{chunk-ENYBDM4U.cjs → chunk-HVJ7IACB.cjs} +15 -7
- package/dist/{chunk-WS4SLJW5.mjs → chunk-IDOUCM2X.mjs} +142 -170
- package/dist/{chunk-FN5UEC7I.mjs → chunk-IG2JE6WJ.mjs} +1 -1
- package/dist/{chunk-MQ4DYVFS.cjs → chunk-IIHZ2BEE.cjs} +3 -3
- package/dist/{chunk-56HHUSR5.cjs → chunk-IK33N2AN.cjs} +1281 -685
- package/dist/{chunk-RSL3YFJG.cjs → chunk-IVBDRAOR.cjs} +1 -1
- package/dist/{chunk-FNWL5DMG.cjs → chunk-IXO6O2EL.cjs} +6 -6
- package/dist/{chunk-B5WZP3T3.cjs → chunk-IYFBLWXU.cjs} +41 -23
- package/dist/{chunk-R4BWNP73.mjs → chunk-JA6RML7C.mjs} +3 -3
- package/dist/{chunk-JSUVQ5HG.cjs → chunk-JHZ6HULQ.cjs} +12 -9
- package/dist/{chunk-NXGQIXR7.cjs → chunk-JNZDTE75.cjs} +313 -156
- package/dist/{chunk-KWUZJZ23.mjs → chunk-JRBWBMP2.mjs} +4 -3
- package/dist/{chunk-YH33PZ3K.mjs → chunk-K6DXKHFE.mjs} +1 -1
- package/dist/{chunk-AXVRUDMB.cjs → chunk-K6PGK7DC.cjs} +2 -2
- package/dist/{chunk-72NTEYCX.mjs → chunk-KHS3T3E5.mjs} +15 -10
- package/dist/{chunk-D4TYE6MY.cjs → chunk-KPYQ32BA.cjs} +2 -2
- package/dist/{chunk-J42QN7OC.cjs → chunk-KQS27YN7.cjs} +6 -6
- package/dist/{chunk-KUMKBBYP.mjs → chunk-KUXEII7V.mjs} +1 -1
- package/dist/{chunk-CA7DNRHO.cjs → chunk-L6E5BSNU.cjs} +3 -3
- package/dist/{chunk-47ZDUDN5.cjs → chunk-L7Y65BQU.cjs} +64 -32
- package/dist/{chunk-OSKIG4OP.mjs → chunk-LPXJEZJK.mjs} +30 -14
- package/dist/{chunk-CF77L6RL.mjs → chunk-LQBV2Y37.mjs} +4 -4
- package/dist/{chunk-HK4VJI27.cjs → chunk-LQWIIBI2.cjs} +11 -1
- package/dist/{chunk-BIX46FTI.mjs → chunk-MFU7SXAB.mjs} +10 -2
- package/dist/{chunk-YTVSWXEZ.cjs → chunk-ML4TOUZP.cjs} +76 -43
- package/dist/{chunk-ZD7JUTBY.mjs → chunk-NLATR3T3.mjs} +2 -2
- package/dist/{chunk-P3EZKU6L.cjs → chunk-NPGXX7HN.cjs} +37 -37
- package/dist/{chunk-3BUJIPKE.cjs → chunk-NSNQLBHR.cjs} +2 -2
- package/dist/chunk-NUWUEXUD.mjs +55 -0
- package/dist/{chunk-53EHWHT2.cjs → chunk-O4JYMU5N.cjs} +35 -22
- package/dist/{chunk-TNYC3TYP.mjs → chunk-O7JEFGUV.mjs} +2 -2
- package/dist/{chunk-62ZRA7XU.mjs → chunk-OCLCA3X3.mjs} +1 -1
- package/dist/{chunk-JI6N4W2I.mjs → chunk-OFIFRB62.mjs} +813 -217
- package/dist/{chunk-CXQZQK6R.mjs → chunk-OVUU2RCQ.mjs} +2 -2
- package/dist/{chunk-Q3MVNRAO.cjs → chunk-OZARLCYQ.cjs} +1005 -582
- package/dist/{chunk-HBLYSWIJ.cjs → chunk-PBJ7MEOV.cjs} +9 -9
- package/dist/{chunk-4AB62NMW.cjs → chunk-PBQGIA27.cjs} +2 -2
- package/dist/{chunk-RBRIKT6B.mjs → chunk-PDACTAVX.mjs} +3 -3
- package/dist/{chunk-AO5IRA2N.mjs → chunk-PE2LEWXA.mjs} +6 -3
- package/dist/{chunk-VZKCGHWC.cjs → chunk-PG7J7XYT.cjs} +6 -6
- package/dist/{chunk-MMK4MZUN.mjs → chunk-PKXGFQZS.mjs} +1 -1
- package/dist/{chunk-NKETXVKP.mjs → chunk-PL7MCYYD.mjs} +32 -14
- package/dist/chunk-PWHF2C6A.mjs +134 -0
- package/dist/{chunk-JWHRVBCZ.cjs → chunk-Q2EKSSEG.cjs} +21 -21
- package/dist/{chunk-EHJOSIXM.cjs → chunk-QDHR54S6.cjs} +11 -11
- package/dist/{chunk-YWDRWG4L.mjs → chunk-QGYHE6VJ.mjs} +872 -449
- package/dist/{chunk-ZOYKJBP5.cjs → chunk-QKW6DLDT.cjs} +2 -2
- package/dist/{chunk-3ODLJRA6.mjs → chunk-QSLGE2ZC.mjs} +1 -1
- package/dist/{chunk-FSODPZRT.cjs → chunk-QUEYL2WM.cjs} +10 -10
- package/dist/{chunk-ZDAEHG2O.cjs → chunk-QYOAGT3E.cjs} +3 -3
- package/dist/{chunk-VKLV7GF4.mjs → chunk-R5X7FDOG.mjs} +1 -1
- package/dist/{chunk-O47W53D3.cjs → chunk-RDADQG5S.cjs} +7 -77
- package/dist/chunk-RDSHEHBA.mjs +82 -0
- package/dist/{chunk-K3RU5MOR.mjs → chunk-RK4MGL6Q.mjs} +1 -1
- package/dist/{chunk-LRB5OVRT.cjs → chunk-RKQOMG2X.cjs} +2 -2
- package/dist/chunk-RQRTH57V.cjs +82 -0
- package/dist/{chunk-MUITBU5Z.mjs → chunk-S7QEQCVV.mjs} +2 -2
- package/dist/{chunk-HKZVC5GP.cjs → chunk-SFSTZ7TB.cjs} +8 -8
- package/dist/{chunk-ZZGANFQH.cjs → chunk-SX535SU5.cjs} +12 -12
- package/dist/{chunk-NLBK37HI.cjs → chunk-SXXSQVKK.cjs} +4 -4
- package/dist/{chunk-ELJQWUAR.mjs → chunk-SYPEMXW2.mjs} +2 -2
- package/dist/{chunk-XXKMAHYE.mjs → chunk-TFEODQLG.mjs} +1 -1
- package/dist/{chunk-BSJMWCWM.cjs → chunk-TZ2YPXLB.cjs} +7 -7
- package/dist/{chunk-OEL5EPOJ.mjs → chunk-UD6KTSJS.mjs} +6 -76
- package/dist/{chunk-2EVESLP3.mjs → chunk-UJIBSFUE.mjs} +4 -4
- package/dist/chunk-UNOXV37V.cjs +55 -0
- package/dist/{chunk-H2ZJ35NW.mjs → chunk-UOE6ZZZP.mjs} +1 -1
- package/dist/{chunk-O6K4G7YA.mjs → chunk-URQW27KO.mjs} +10 -5
- package/dist/chunk-VDQZV6BX.mjs +17 -0
- package/dist/{chunk-2DOI6HLJ.cjs → chunk-VJ6L7TII.cjs} +3 -3
- package/dist/{chunk-QL3YZTGZ.cjs → chunk-VJI2LWTL.cjs} +2 -2
- package/dist/{chunk-7RKHXF4P.mjs → chunk-WGNGM6MJ.mjs} +2 -2
- package/dist/{chunk-77SVUQM5.cjs → chunk-WHCNJVYU.cjs} +10 -10
- package/dist/{chunk-DM2YGTRH.cjs → chunk-WJ5CCQBM.cjs} +23 -23
- package/dist/chunk-WKVYF2B5.cjs +17 -0
- package/dist/{chunk-MKQ27TGW.cjs → chunk-WRWJ7IWT.cjs} +7 -7
- package/dist/{chunk-Y4FEQBKY.cjs → chunk-WW62HKA2.cjs} +47 -26
- package/dist/{chunk-XVSBALOY.cjs → chunk-X3Y6JWJG.cjs} +3 -3
- package/dist/{chunk-O2A6HE76.cjs → chunk-XGDI4OUB.cjs} +103 -21
- package/dist/{chunk-LIQJYEQP.cjs → chunk-XRFGOYXG.cjs} +4 -4
- package/dist/{chunk-42KMUIWZ.cjs → chunk-XX6ZA2IO.cjs} +3 -3
- package/dist/{chunk-6IOZPJ3I.cjs → chunk-Y3DO7BIJ.cjs} +69 -7
- package/dist/{chunk-L5JDKFMQ.cjs → chunk-YBXIVQCE.cjs} +4 -4
- package/dist/{chunk-JZ43UD6S.mjs → chunk-YCNKS6SD.mjs} +12 -12
- package/dist/{chunk-FYV6DTAG.cjs → chunk-YL7BKHYE.cjs} +538 -566
- package/dist/{chunk-G7S6XG6X.cjs → chunk-YN7G22MP.cjs} +6 -6
- package/dist/{chunk-VKRMO3EZ.cjs → chunk-YRXPDKMM.cjs} +10 -10
- package/dist/{chunk-VFPFXMTF.mjs → chunk-YSTKSZD2.mjs} +1 -1
- package/dist/{chunk-QDWMCFTH.mjs → chunk-YT2ZMLXK.mjs} +1 -1
- package/dist/{chunk-EMRYJG4U.cjs → chunk-YTNE4KGC.cjs} +3 -3
- package/dist/{chunk-E7QOEV5Z.cjs → chunk-YUCU6XB4.cjs} +4 -4
- package/dist/{chunk-NLRAQXAA.mjs → chunk-YVVY276M.mjs} +1 -1
- package/dist/{chunk-MQ5HA7H2.mjs → chunk-Z2FFLTF5.mjs} +3 -3
- package/dist/{chunk-JSDV2NUN.mjs → chunk-Z3QXQN4U.mjs} +1 -1
- package/dist/{chunk-HRQV5Q3J.mjs → chunk-Z4IRG4RG.mjs} +96 -9
- package/dist/{chunk-JOECBGY7.mjs → chunk-ZEWWZJPZ.mjs} +3 -1
- package/dist/{chunk-2GQBBOFH.mjs → chunk-ZIAWO6BC.mjs} +11 -1
- package/dist/{chunk-WH3PBJS7.cjs → chunk-ZIOFRBIU.cjs} +100 -13
- package/dist/{chunk-3OJNNCDL.cjs → chunk-ZNXU4E6A.cjs} +8 -8
- package/dist/{chunk-KIRIFO6T.mjs → chunk-ZO6TOLHL.mjs} +44 -0
- package/dist/{chunk-737MIVX3.cjs → chunk-ZPCZWEU3.cjs} +24 -24
- package/dist/{chunk-NET6PBUH.cjs → chunk-ZV76IQG7.cjs} +2 -2
- package/dist/{client-component.d-edV76QvU.d.mts → client-component.d-BeqVuqy2.d.mts} +2 -2
- package/dist/{client-component.d-DYOwmq0c.d.ts → client-component.d-CZ1NpHAY.d.ts} +2 -2
- package/dist/{client-plugins.d-DwvqqGsU.d.mts → client-plugins.d-ChceYO9t.d.mts} +24 -3
- package/dist/{client-plugins.d-BmJYW2FY.d.ts → client-plugins.d-D9kWC0QB.d.ts} +24 -3
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +15 -13
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +14 -12
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/cron.cjs +4 -4
- package/dist/cron.mjs +3 -3
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-WPX62NG2.mjs → devtools-B3W3DLPG.mjs} +18 -18
- package/dist/{devtools-YMDS7PUA.cjs → devtools-T5I2WHRX.cjs} +20 -20
- package/dist/docs.cjs +27 -21
- package/dist/docs.d.mts +17 -3
- package/dist/docs.d.ts +17 -3
- package/dist/docs.mjs +26 -20
- package/dist/environment/vite.cjs +6 -6
- package/dist/environment/vite.mjs +5 -5
- package/dist/headers.cjs +3 -3
- package/dist/{headers.d-BIbQyAxJ.d.ts → headers.d-Aux4JVnm.d.ts} +1 -1
- package/dist/{headers.d-BtNxFc2s.d.mts → headers.d-BawakaPv.d.mts} +1 -1
- package/dist/headers.mjs +2 -2
- package/dist/i18n/client.cjs +15 -16
- package/dist/i18n/client.mjs +5 -6
- package/dist/i18n/index.cjs +4 -4
- package/dist/i18n/index.mjs +3 -3
- package/dist/i18n/server.cjs +5 -5
- package/dist/i18n/server.mjs +4 -4
- package/dist/image/server.cjs +5 -4
- package/dist/image/server.d.mts +5 -1
- package/dist/image/server.d.ts +5 -1
- package/dist/image/server.mjs +4 -3
- package/dist/image/sharp.cjs +53 -89
- package/dist/image/sharp.d.mts +2 -1
- package/dist/image/sharp.d.ts +2 -1
- package/dist/image/sharp.mjs +50 -86
- package/dist/index.cjs +99 -93
- package/dist/{index.d-CQdDRXd1.d.mts → index.d-Ccq42CPU.d.mts} +1 -1
- package/dist/{index.d-CQ_wUzOV.d.ts → index.d-r1MLpgeE.d.ts} +1 -1
- package/dist/index.d.mts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.mjs +96 -90
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.cjs +7 -7
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +6 -6
- package/dist/internal/app-markdown-runtime.cjs +6 -6
- 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 +5 -5
- package/dist/internal/build-runtime.cjs +68 -66
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +67 -65
- package/dist/internal/cli-runtime.cjs +33 -33
- package/dist/internal/cli-runtime.mjs +32 -32
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +23 -2
- package/dist/internal/client-runtime.d.mts +29 -8
- package/dist/internal/client-runtime.d.ts +29 -8
- package/dist/internal/client-runtime.mjs +23 -2
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +20 -20
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +19 -19
- package/dist/internal/form-actions.cjs +6 -6
- package/dist/internal/form-actions.mjs +5 -5
- package/dist/internal/infra-analytics-runtime.cjs +15 -15
- package/dist/internal/infra-analytics-runtime.mjs +13 -13
- package/dist/internal/islands-server.cjs +2 -2
- package/dist/internal/islands-server.mjs +1 -1
- package/dist/internal/metadata-image-runtime.cjs +4 -4
- package/dist/internal/metadata-image-runtime.mjs +3 -3
- package/dist/internal/native-server-fns.cjs +5 -5
- package/dist/internal/native-server-fns.mjs +4 -4
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +63 -40
- package/dist/internal/production-runtime.d.mts +80 -13
- package/dist/internal/production-runtime.d.ts +80 -13
- package/dist/internal/production-runtime.mjs +66 -43
- package/dist/internal/react-cache.cjs +3 -3
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/internal/start-manifest.cjs +54 -0
- package/dist/internal/start-manifest.d.mts +43 -0
- package/dist/internal/start-manifest.d.ts +43 -0
- package/dist/internal/start-manifest.mjs +54 -0
- package/dist/internal/vercel-edge-middleware.cjs +8 -8
- package/dist/internal/vercel-edge-middleware.mjs +7 -7
- package/dist/manager-R7FV4A56.cjs +18 -0
- package/dist/{manager-RHB2P35B.mjs → manager-YO2RHDYU.mjs} +5 -5
- package/dist/markdown.cjs +5 -5
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +4 -4
- package/dist/middleware.cjs +14 -14
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.mjs +13 -13
- package/dist/{mount.d-6bhpBQQB.d.mts → mount.d-BomEt2kV.d.mts} +1 -1
- package/dist/{mount.d-C-u7rFkM.d.ts → mount.d-Ca8eb9GB.d.ts} +1 -1
- package/dist/{native-server-fn-handler-W4FSD76W.cjs → native-server-fn-handler-IWNKQEXK.cjs} +9 -8
- package/dist/{native-server-fn-handler-I66X4E5S.mjs → native-server-fn-handler-LII4MDRR.mjs} +8 -7
- package/dist/native-tree-D3PW64ZL.cjs +28 -0
- package/dist/{native-tree-3X23BT3N.mjs → native-tree-G6ZWS7IR.mjs} +5 -5
- package/dist/{navigation-delegate.d-nx6gtsY4.d.mts → navigation-delegate.d-B1ujRkYo.d.mts} +1 -1
- package/dist/{navigation-delegate.d-xsG4T1x-.d.ts → navigation-delegate.d-DJCC2jXF.d.ts} +1 -1
- package/dist/navigation.cjs +13 -11
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +12 -10
- package/dist/{nitro-SSFTPZMW.cjs → nitro-HKMVYIXY.cjs} +13 -13
- package/dist/{nitro-XTQ2HKDL.mjs → nitro-RHLKLYXH.mjs} +8 -8
- package/dist/{plugin-5PIQQVRP.cjs → plugin-5BNPYCER.cjs} +2 -2
- package/dist/{plugin-QZT747YW.mjs → plugin-FD4S2QEJ.mjs} +1 -1
- package/dist/plugin.cjs +62 -60
- package/dist/plugin.d.mts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.mjs +61 -59
- package/dist/query/client.cjs +20 -9
- package/dist/query/client.mjs +16 -5
- package/dist/{render-plan.d-gW0fwKz2.d.ts → render-plan.d-BxRbaxYA.d.ts} +1 -1
- package/dist/{render-plan.d-B5y3h97B.d.mts → render-plan.d-CFod_Zf-.d.mts} +1 -1
- package/dist/renderer/react/server.cjs +9 -1
- package/dist/renderer/react/server.d.mts +9 -1
- package/dist/renderer/react/server.d.ts +9 -1
- package/dist/renderer/react/server.mjs +8 -0
- package/dist/renderer-client.cjs +25 -26
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/renderer-client.mjs +15 -16
- package/dist/request.cjs +2 -2
- package/dist/{request.d-B0ugAadD.d.ts → request.d-DG4TeXMM.d.mts} +7 -2
- package/dist/{request.d-DLq33nYo.d.mts → request.d-DRQgaXGG.d.ts} +7 -2
- 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-DSeIV7yV.d.mts → route-rendering.d-BXtZKgqu.d.mts} +1 -1
- package/dist/{route-rendering.d-ytaqDQD6.d.ts → route-rendering.d-Db07UNVG.d.ts} +1 -1
- package/dist/router.cjs +4 -4
- package/dist/{router.d-Chd5cpe3.d.mts → router.d-B61kXqxJ.d.mts} +1 -1
- package/dist/{router.d-BaEAEGPg.d.ts → router.d-BC3hyjf0.d.ts} +1 -1
- package/dist/router.mjs +3 -3
- package/dist/routes.cjs +6 -6
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +5 -5
- package/dist/{rsc-pipeline-DPMYONEV.mjs → rsc-pipeline-LJ7YCGY6.mjs} +22 -22
- package/dist/{rsc-pipeline-XIUUMMG5.cjs → rsc-pipeline-VENBFYXW.cjs} +23 -23
- package/dist/{runtime-XIUJZTZ3.mjs → runtime-4DWUXZHS.mjs} +27 -27
- package/dist/{runtime-WD77S3C5.cjs → runtime-UNDTYGQS.cjs} +38 -38
- package/dist/{runtime.d-DpCs0eAO.d.mts → runtime.d-Cl6EBGmC.d.mts} +1 -1
- package/dist/{runtime.d-h2USyQsz.d.ts → runtime.d-SC95yDzr.d.ts} +1 -1
- package/dist/safe-fetch.cjs +15 -0
- package/dist/safe-fetch.d.mts +61 -0
- package/dist/safe-fetch.d.ts +61 -0
- package/dist/safe-fetch.mjs +15 -0
- package/dist/{schema-dev-notice-C2JINRZI.mjs → schema-dev-notice-CA55V57L.mjs} +2 -2
- package/dist/{schema-dev-notice-X7GG7QVB.cjs → schema-dev-notice-RWA2UTR6.cjs} +3 -3
- package/dist/server-action-security.cjs +5 -5
- package/dist/server-action-security.mjs +4 -4
- package/dist/server-fn.cjs +8 -7
- package/dist/server-fn.mjs +7 -6
- package/dist/server-plugins.cjs +7 -7
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-plugins.mjs +6 -6
- package/dist/server-query.cjs +9 -8
- package/dist/server-query.mjs +8 -7
- package/dist/server.cjs +101 -94
- package/dist/server.d.mts +13 -13
- package/dist/server.d.ts +13 -13
- package/dist/server.mjs +74 -67
- package/dist/{spa-router.d-DCQVtEaE.d.mts → spa-router.d-DrlXgDqY.d.mts} +4 -3
- package/dist/{spa-router.d-DpdJHs1q.d.ts → spa-router.d-DwM02Mwd.d.ts} +4 -3
- package/dist/testing.cjs +31 -31
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +23 -23
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/{utils.d-DmicwMvS.d.ts → utils.d-C6KXz3uB.d.ts} +1 -1
- package/dist/{utils.d-DKDZtAY5.d.mts → utils.d-CHzxAshz.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +62 -60
- package/dist/vite.d.mts +10 -5
- package/dist/vite.d.ts +10 -5
- package/dist/vite.mjs +61 -59
- package/dist/workflows.cjs +7 -7
- package/dist/workflows.mjs +6 -6
- package/package.json +18 -1
- package/dist/analyzer-6EOYURMV.cjs +0 -16
- package/dist/chunk-D4XGKF67.cjs +0 -127
- package/dist/chunk-MFQGU5CC.mjs +0 -127
- package/dist/chunk-NCIAP562.mjs +0 -27
- package/dist/chunk-QQ44FYRO.cjs +0 -27
- package/dist/chunk-RI3EVPKD.cjs +0 -57
- package/dist/manager-S77ZARTC.cjs +0 -18
- package/dist/native-tree-TAPKR7QJ.cjs +0 -28
|
@@ -25,14 +25,14 @@ var _chunkMF3IA2AWcjs = require('./chunk-MF3IA2AW.cjs');
|
|
|
25
25
|
var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
28
29
|
|
|
29
|
-
var _chunk35GBGSQZcjs = require('./chunk-35GBGSQZ.cjs');
|
|
30
30
|
|
|
31
|
+
var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
|
|
31
32
|
|
|
32
|
-
var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkBNTRXJL4cjs = require('./chunk-BNTRXJL4.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -41,7 +41,7 @@ var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _chunkZPCZWEU3cjs = require('./chunk-ZPCZWEU3.cjs');
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
@@ -54,7 +54,7 @@ var _chunk737MIVX3cjs = require('./chunk-737MIVX3.cjs');
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var
|
|
57
|
+
var _chunk6D3CJFNUcjs = require('./chunk-6D3CJFNU.cjs');
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
@@ -62,10 +62,10 @@ var _chunkZRCGPSUMcjs = require('./chunk-ZRCGPSUM.cjs');
|
|
|
62
62
|
var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunk42EUEYW6cjs = require('./chunk-42EUEYW6.cjs');
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
var
|
|
68
|
+
var _chunkWHCNJVYUcjs = require('./chunk-WHCNJVYU.cjs');
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
|
|
@@ -74,7 +74,7 @@ var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
var
|
|
77
|
+
var _chunkNPGXX7HNcjs = require('./chunk-NPGXX7HN.cjs');
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
|
|
@@ -83,6 +83,10 @@ var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
|
|
|
83
83
|
var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
|
|
84
84
|
|
|
85
85
|
|
|
86
|
+
var _chunkO4JYMU5Ncjs = require('./chunk-O4JYMU5N.cjs');
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
86
90
|
|
|
87
91
|
|
|
88
92
|
|
|
@@ -110,12 +114,16 @@ var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
|
|
|
110
114
|
|
|
111
115
|
|
|
112
116
|
|
|
113
|
-
var _chunk56HHUSR5cjs = require('./chunk-56HHUSR5.cjs');
|
|
114
117
|
|
|
115
118
|
|
|
119
|
+
var _chunkIK33N2ANcjs = require('./chunk-IK33N2AN.cjs');
|
|
116
120
|
|
|
117
121
|
|
|
118
|
-
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
var _chunkHVJ7IACBcjs = require('./chunk-HVJ7IACB.cjs');
|
|
119
127
|
|
|
120
128
|
|
|
121
129
|
var _chunkPMU4U2W2cjs = require('./chunk-PMU4U2W2.cjs');
|
|
@@ -124,7 +132,7 @@ var _chunkPMU4U2W2cjs = require('./chunk-PMU4U2W2.cjs');
|
|
|
124
132
|
|
|
125
133
|
|
|
126
134
|
|
|
127
|
-
var
|
|
135
|
+
var _chunk7564NP5Zcjs = require('./chunk-7564NP5Z.cjs');
|
|
128
136
|
|
|
129
137
|
|
|
130
138
|
|
|
@@ -137,7 +145,7 @@ var _chunkACAEFEOHcjs = require('./chunk-ACAEFEOH.cjs');
|
|
|
137
145
|
|
|
138
146
|
|
|
139
147
|
|
|
140
|
-
var
|
|
148
|
+
var _chunkXGDI4OUBcjs = require('./chunk-XGDI4OUB.cjs');
|
|
141
149
|
|
|
142
150
|
|
|
143
151
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
@@ -151,15 +159,15 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
|
151
159
|
|
|
152
160
|
|
|
153
161
|
|
|
154
|
-
var
|
|
162
|
+
var _chunkWJ5CCQBMcjs = require('./chunk-WJ5CCQBM.cjs');
|
|
155
163
|
|
|
156
164
|
|
|
157
165
|
|
|
158
166
|
|
|
159
|
-
var
|
|
167
|
+
var _chunkYRXPDKMMcjs = require('./chunk-YRXPDKMM.cjs');
|
|
160
168
|
|
|
161
169
|
|
|
162
|
-
var
|
|
170
|
+
var _chunkKPYQ32BAcjs = require('./chunk-KPYQ32BA.cjs');
|
|
163
171
|
|
|
164
172
|
|
|
165
173
|
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
@@ -180,7 +188,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
|
180
188
|
|
|
181
189
|
|
|
182
190
|
|
|
183
|
-
var
|
|
191
|
+
var _chunkJNZDTE75cjs = require('./chunk-JNZDTE75.cjs');
|
|
184
192
|
|
|
185
193
|
|
|
186
194
|
|
|
@@ -192,7 +200,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
|
|
|
192
200
|
|
|
193
201
|
|
|
194
202
|
|
|
195
|
-
var
|
|
203
|
+
var _chunkIIHZ2BEEcjs = require('./chunk-IIHZ2BEE.cjs');
|
|
196
204
|
|
|
197
205
|
|
|
198
206
|
|
|
@@ -219,10 +227,10 @@ var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
|
|
|
219
227
|
|
|
220
228
|
|
|
221
229
|
|
|
222
|
-
var
|
|
230
|
+
var _chunkCYNQPKA4cjs = require('./chunk-CYNQPKA4.cjs');
|
|
223
231
|
|
|
224
232
|
|
|
225
|
-
var
|
|
233
|
+
var _chunkXRFGOYXGcjs = require('./chunk-XRFGOYXG.cjs');
|
|
226
234
|
|
|
227
235
|
|
|
228
236
|
var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
@@ -231,28 +239,28 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
|
231
239
|
|
|
232
240
|
|
|
233
241
|
|
|
234
|
-
var
|
|
242
|
+
var _chunkPG7J7XYTcjs = require('./chunk-PG7J7XYT.cjs');
|
|
235
243
|
|
|
236
244
|
|
|
237
245
|
|
|
238
246
|
var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
239
247
|
|
|
240
248
|
|
|
241
|
-
var
|
|
249
|
+
var _chunk2YJ4DHTDcjs = require('./chunk-2YJ4DHTD.cjs');
|
|
242
250
|
|
|
243
251
|
|
|
244
252
|
var _chunkASYOWPSRcjs = require('./chunk-ASYOWPSR.cjs');
|
|
245
253
|
|
|
246
254
|
|
|
247
255
|
|
|
248
|
-
var
|
|
256
|
+
var _chunkQUEYL2WMcjs = require('./chunk-QUEYL2WM.cjs');
|
|
249
257
|
|
|
250
258
|
|
|
251
259
|
|
|
252
|
-
var
|
|
260
|
+
var _chunk6DBBMQWTcjs = require('./chunk-6DBBMQWT.cjs');
|
|
253
261
|
|
|
254
262
|
|
|
255
|
-
var
|
|
263
|
+
var _chunkQKW6DLDTcjs = require('./chunk-QKW6DLDT.cjs');
|
|
256
264
|
|
|
257
265
|
|
|
258
266
|
var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
|
|
@@ -260,10 +268,10 @@ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
|
|
|
260
268
|
|
|
261
269
|
|
|
262
270
|
|
|
263
|
-
var
|
|
271
|
+
var _chunkFE6KYDHCcjs = require('./chunk-FE6KYDHC.cjs');
|
|
264
272
|
|
|
265
273
|
|
|
266
|
-
var
|
|
274
|
+
var _chunkHFJLMALCcjs = require('./chunk-HFJLMALC.cjs');
|
|
267
275
|
|
|
268
276
|
|
|
269
277
|
var _chunkCYOTNHDFcjs = require('./chunk-CYOTNHDF.cjs');
|
|
@@ -284,14 +292,17 @@ var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
|
|
|
284
292
|
|
|
285
293
|
|
|
286
294
|
|
|
287
|
-
var
|
|
295
|
+
var _chunkGC5ROI3Acjs = require('./chunk-GC5ROI3A.cjs');
|
|
288
296
|
|
|
289
297
|
|
|
290
298
|
|
|
291
299
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
292
300
|
|
|
293
301
|
|
|
294
|
-
var
|
|
302
|
+
var _chunkIVBDRAORcjs = require('./chunk-IVBDRAOR.cjs');
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
|
|
295
306
|
|
|
296
307
|
|
|
297
308
|
|
|
@@ -301,7 +312,7 @@ var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
|
|
|
301
312
|
var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
302
313
|
|
|
303
314
|
|
|
304
|
-
var
|
|
315
|
+
var _chunk2RSVYJT6cjs = require('./chunk-2RSVYJT6.cjs');
|
|
305
316
|
|
|
306
317
|
|
|
307
318
|
|
|
@@ -311,7 +322,8 @@ var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
|
311
322
|
|
|
312
323
|
|
|
313
324
|
|
|
314
|
-
|
|
325
|
+
|
|
326
|
+
var _chunkML4TOUZPcjs = require('./chunk-ML4TOUZP.cjs');
|
|
315
327
|
|
|
316
328
|
|
|
317
329
|
var _chunkBTZ5O6VMcjs = require('./chunk-BTZ5O6VM.cjs');
|
|
@@ -323,6 +335,169 @@ var _fs = require('fs');
|
|
|
323
335
|
// src/nitro/universal-build.ts
|
|
324
336
|
var _crypto = require('crypto');
|
|
325
337
|
|
|
338
|
+
// src/nitro/static-range.ts
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
var FARM_NITRO_STATIC_HANDLER_SOURCE = `import { HTTPError, defineHandler } from "h3";
|
|
342
|
+
import { decodePath, joinURL, withLeadingSlash, withoutTrailingSlash } from "ufo";
|
|
343
|
+
import { getAsset, isPublicAssetURL, readAsset } from "#nitro/virtual/public-assets";
|
|
344
|
+
const METHODS = new Set(["HEAD", "GET"]);
|
|
345
|
+
const EncodingMap = {
|
|
346
|
+
gzip: ".gz",
|
|
347
|
+
br: ".br",
|
|
348
|
+
zstd: ".zst"
|
|
349
|
+
};
|
|
350
|
+
const RANGE_RE = /^bytes=(\\d*)-(\\d*)$/i;
|
|
351
|
+
export default defineHandler((event) => {
|
|
352
|
+
if (event.req.method && !METHODS.has(event.req.method)) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
let id = decodePath(withLeadingSlash(withoutTrailingSlash(event.url.pathname)));
|
|
356
|
+
let asset;
|
|
357
|
+
const encodingHeader = event.req.headers.get("accept-encoding") || "";
|
|
358
|
+
const encodings = [...encodingHeader.split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(), ""];
|
|
359
|
+
for (const encoding of encodings) {
|
|
360
|
+
for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) {
|
|
361
|
+
const _asset = getAsset(_id);
|
|
362
|
+
if (_asset) {
|
|
363
|
+
asset = _asset;
|
|
364
|
+
id = _id;
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
if (!asset) {
|
|
370
|
+
if (isPublicAssetURL(id)) {
|
|
371
|
+
event.res.headers.delete("Cache-Control");
|
|
372
|
+
throw new HTTPError({ status: 404 });
|
|
373
|
+
}
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (encodings.length > 1) {
|
|
377
|
+
event.res.headers.append("Vary", "Accept-Encoding");
|
|
378
|
+
}
|
|
379
|
+
const ifNotMatch = event.req.headers.get("if-none-match") === asset.etag;
|
|
380
|
+
if (ifNotMatch) {
|
|
381
|
+
event.res.status = 304;
|
|
382
|
+
event.res.statusText = "Not Modified";
|
|
383
|
+
return "";
|
|
384
|
+
}
|
|
385
|
+
const ifModifiedSinceH = event.req.headers.get("if-modified-since");
|
|
386
|
+
const mtimeDate = new Date(asset.mtime);
|
|
387
|
+
if (ifModifiedSinceH && asset.mtime && new Date(ifModifiedSinceH) >= mtimeDate) {
|
|
388
|
+
event.res.status = 304;
|
|
389
|
+
event.res.statusText = "Not Modified";
|
|
390
|
+
return "";
|
|
391
|
+
}
|
|
392
|
+
if (asset.type) {
|
|
393
|
+
event.res.headers.set("Content-Type", asset.type);
|
|
394
|
+
}
|
|
395
|
+
if (asset.etag && !event.res.headers.has("ETag")) {
|
|
396
|
+
event.res.headers.set("ETag", asset.etag);
|
|
397
|
+
}
|
|
398
|
+
if (asset.mtime && !event.res.headers.has("Last-Modified")) {
|
|
399
|
+
event.res.headers.set("Last-Modified", mtimeDate.toUTCString());
|
|
400
|
+
}
|
|
401
|
+
if (asset.encoding && !event.res.headers.has("Content-Encoding")) {
|
|
402
|
+
event.res.headers.set("Content-Encoding", asset.encoding);
|
|
403
|
+
}
|
|
404
|
+
let range;
|
|
405
|
+
if (!asset.encoding && asset.size > 0) {
|
|
406
|
+
event.res.headers.set("Accept-Ranges", "bytes");
|
|
407
|
+
// If-Range needs a strong validator match (RFC 9110 13.1.5).
|
|
408
|
+
const ifRange = event.req.headers.get("if-range");
|
|
409
|
+
if (event.req.method === "GET" && (!ifRange || (ifRange === asset.etag && !ifRange.startsWith("W/")))) {
|
|
410
|
+
range = parseRange(event.req.headers.get("range") || "", asset.size);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (range === "unsatisfiable") {
|
|
414
|
+
event.res.headers.delete("Cache-Control");
|
|
415
|
+
throw new HTTPError({ status: 416, headers: { "Content-Range": \`bytes */\${asset.size}\` } });
|
|
416
|
+
}
|
|
417
|
+
if (asset.size > 0 && !event.res.headers.has("Content-Length")) {
|
|
418
|
+
event.res.headers.set("Content-Length", asset.size.toString());
|
|
419
|
+
}
|
|
420
|
+
if (!range) {
|
|
421
|
+
return readAsset(id);
|
|
422
|
+
}
|
|
423
|
+
return Promise.resolve(readAsset(id)).then((data) => {
|
|
424
|
+
if (!(data instanceof Uint8Array)) {
|
|
425
|
+
return data;
|
|
426
|
+
}
|
|
427
|
+
event.res.status = 206;
|
|
428
|
+
event.res.headers.set("Content-Range", \`bytes \${range.start}-\${range.end}/\${asset.size}\`);
|
|
429
|
+
event.res.headers.set("Content-Length", String(range.end - range.start + 1));
|
|
430
|
+
return data.subarray(range.start, range.end + 1);
|
|
431
|
+
});
|
|
432
|
+
});
|
|
433
|
+
// One "bytes=" range; anything else (several ranges, other units) gets the whole file.
|
|
434
|
+
function parseRange(header, size) {
|
|
435
|
+
const match = RANGE_RE.exec(header);
|
|
436
|
+
if (!match) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const [, startStr, endStr] = match;
|
|
440
|
+
if (!startStr) {
|
|
441
|
+
if (!endStr) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
const suffix = Number(endStr);
|
|
445
|
+
if (suffix === 0) {
|
|
446
|
+
return "unsatisfiable";
|
|
447
|
+
}
|
|
448
|
+
return { start: Math.max(size - suffix, 0), end: size - 1 };
|
|
449
|
+
}
|
|
450
|
+
const start = Number(startStr);
|
|
451
|
+
if (endStr && Number(endStr) < start) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
if (start >= size) {
|
|
455
|
+
return "unsatisfiable";
|
|
456
|
+
}
|
|
457
|
+
return { start, end: endStr ? Math.min(Number(endStr), size - 1) : size - 1 };
|
|
458
|
+
}
|
|
459
|
+
`;
|
|
460
|
+
function createNitroStaticRangePlugin(nitroPackageEntry, canonicalPages = []) {
|
|
461
|
+
const redirects = canonicalPages.filter((url) => url !== "/" && !url.startsWith("//")).map((url) => [url.endsWith("/") ? url.slice(0, -1) : url + "/", url]);
|
|
462
|
+
const original = "?farm-static-handler";
|
|
463
|
+
const handlerFile = _path2.default.join(_path2.default.dirname(nitroPackageEntry), "internal", "static.mjs");
|
|
464
|
+
const handlerIds = /* @__PURE__ */ new Set([toPosix(handlerFile)]);
|
|
465
|
+
try {
|
|
466
|
+
handlerIds.add(toPosix(_fs.realpathSync.call(void 0, handlerFile)));
|
|
467
|
+
} catch (e2) {
|
|
468
|
+
}
|
|
469
|
+
return {
|
|
470
|
+
name: "farm:nitro-static-range",
|
|
471
|
+
resolveId(id) {
|
|
472
|
+
if (id.endsWith(original) && handlerIds.has(id.slice(0, -original.length))) return id;
|
|
473
|
+
return null;
|
|
474
|
+
},
|
|
475
|
+
load: {
|
|
476
|
+
filter: { id: /[\\/]internal[\\/]static\.mjs(?:\?.*)?$/ },
|
|
477
|
+
handler(id) {
|
|
478
|
+
const file = id.split("?", 1)[0];
|
|
479
|
+
if (!handlerIds.has(toPosix(file))) return null;
|
|
480
|
+
if (redirects.length && !id.endsWith(original)) {
|
|
481
|
+
return `import serve from ${JSON.stringify(toPosix(file) + original)};
|
|
482
|
+
const redirects = new Map(${JSON.stringify(redirects)});
|
|
483
|
+
export default function(event) {
|
|
484
|
+
const url = new URL(event.req.url);
|
|
485
|
+
const target = redirects.get(url.pathname);
|
|
486
|
+
if (target !== undefined) return new Response(null, { status: 308, headers: { Location: target + url.search } });
|
|
487
|
+
return serve(event);
|
|
488
|
+
}`;
|
|
489
|
+
}
|
|
490
|
+
const source = _fs.readFileSync.call(void 0, file, "utf8");
|
|
491
|
+
if (source.includes("Accept-Ranges")) return id.endsWith(original) ? source : null;
|
|
492
|
+
return FARM_NITRO_STATIC_HANDLER_SOURCE;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
function toPosix(file) {
|
|
498
|
+
return file.split(_path2.default.sep).join("/");
|
|
499
|
+
}
|
|
500
|
+
|
|
326
501
|
// src/nitro/client-css-href.ts
|
|
327
502
|
|
|
328
503
|
var FARM_CLIENT_CSS_HREF_PLACEHOLDER = "/__farm_client_css_href__";
|
|
@@ -339,7 +514,7 @@ async function hashAndCopy(sourcePath, destinationDir, hashedName) {
|
|
|
339
514
|
await fs5.mkdir(destinationDir, { recursive: true });
|
|
340
515
|
await fs5.writeFile(_path2.default.join(destinationDir, name), bytes);
|
|
341
516
|
return name;
|
|
342
|
-
} catch (
|
|
517
|
+
} catch (e3) {
|
|
343
518
|
return null;
|
|
344
519
|
}
|
|
345
520
|
}
|
|
@@ -356,7 +531,7 @@ async function findFingerprintedClientEntry(clientOutputDir) {
|
|
|
356
531
|
try {
|
|
357
532
|
const entries = await fs5.readdir(clientOutputDir);
|
|
358
533
|
return _nullishCoalesce(entries.find((name) => /^farm-client-h[0-9a-f]+\.js$/.test(name)), () => ( null));
|
|
359
|
-
} catch (
|
|
534
|
+
} catch (e4) {
|
|
360
535
|
return null;
|
|
361
536
|
}
|
|
362
537
|
}
|
|
@@ -366,7 +541,7 @@ async function resolveClientBootSrc(clientOutputDir) {
|
|
|
366
541
|
const entries = await fs5.readdir(clientOutputDir);
|
|
367
542
|
const name = entries.find((entry) => /^farm-client-boot-h[0-9a-f]+\.js$/.test(entry));
|
|
368
543
|
return name ? `/${name}` : null;
|
|
369
|
-
} catch (
|
|
544
|
+
} catch (e5) {
|
|
370
545
|
return null;
|
|
371
546
|
}
|
|
372
547
|
}
|
|
@@ -431,14 +606,14 @@ function getDocsTitle(docs) {
|
|
|
431
606
|
return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
|
|
432
607
|
}
|
|
433
608
|
function loadPages(contentDir, docs) {
|
|
434
|
-
return
|
|
609
|
+
return _chunk6D3CJFNUcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunk6D3CJFNUcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
|
|
435
610
|
}
|
|
436
611
|
function findSocialImagePath(html, basePath) {
|
|
437
612
|
const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
|
|
438
613
|
if (!_optionalChain([match, 'optionalAccess', _2 => _2[1]])) return null;
|
|
439
614
|
try {
|
|
440
615
|
return _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, new URL(match[1], FARM_DOCS_COMPILED_ORIGIN).pathname, basePath);
|
|
441
|
-
} catch (
|
|
616
|
+
} catch (e6) {
|
|
442
617
|
return null;
|
|
443
618
|
}
|
|
444
619
|
}
|
|
@@ -449,7 +624,7 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
|
|
|
449
624
|
return response;
|
|
450
625
|
}
|
|
451
626
|
async function compileFarmDocsManifest(docs, options) {
|
|
452
|
-
const contentDir =
|
|
627
|
+
const contentDir = _chunk6D3CJFNUcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
|
|
453
628
|
const pages = loadPages(contentDir, docs);
|
|
454
629
|
const basePath = _chunkD22BUQKWcjs.normalizeFarmBasePath.call(void 0, options.basePath);
|
|
455
630
|
const absolutePaths = [
|
|
@@ -457,7 +632,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
457
632
|
_path2.default.resolve(contentDir),
|
|
458
633
|
docs.configPath || ""
|
|
459
634
|
];
|
|
460
|
-
const handler =
|
|
635
|
+
const handler = _chunk6D3CJFNUcjs.createFarmDocsHandler.call(void 0, docs, {
|
|
461
636
|
root: options.root,
|
|
462
637
|
srcDir: options.srcDir,
|
|
463
638
|
clientEntry: options.clientEntry,
|
|
@@ -467,7 +642,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
467
642
|
isPathGuarded: options.isPathGuarded,
|
|
468
643
|
basePath
|
|
469
644
|
});
|
|
470
|
-
const apiHandler =
|
|
645
|
+
const apiHandler = _chunkZPCZWEU3cjs.createFarmDocsAPIHandler.call(void 0, {
|
|
471
646
|
rootDir: options.root,
|
|
472
647
|
srcDir: options.srcDir,
|
|
473
648
|
docs,
|
|
@@ -479,7 +654,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
479
654
|
const apiMarkdown = {};
|
|
480
655
|
for (const page of pages) {
|
|
481
656
|
const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
|
|
482
|
-
const markdownPath =
|
|
657
|
+
const markdownPath = _chunk6D3CJFNUcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
|
|
483
658
|
await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
|
|
484
659
|
if (htmlResponse) {
|
|
485
660
|
const socialImagePath = findSocialImagePath(await htmlResponse.text(), basePath);
|
|
@@ -564,7 +739,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
564
739
|
post: await compileResponse(postResponse, absolutePaths),
|
|
565
740
|
search: {
|
|
566
741
|
pages: publicPages.map((page) => ({
|
|
567
|
-
...
|
|
742
|
+
..._chunk6D3CJFNUcjs.toFarmDocsMarkdownPage.call(void 0, page, basePath),
|
|
568
743
|
sourcePath: `farm-docs:${page.slug || "index"}`
|
|
569
744
|
})),
|
|
570
745
|
search: _nullishCoalesce(searchConfig, () => ( true)),
|
|
@@ -617,7 +792,7 @@ function collectFarmClientModulePreloads(bundle, options) {
|
|
|
617
792
|
const moduleId = chunk.facadeModuleId.split("?")[0];
|
|
618
793
|
if (!_path2.default.isAbsolute(moduleId)) continue;
|
|
619
794
|
const loaded = /* @__PURE__ */ new Set([...entryLoaded, chunk.fileName]);
|
|
620
|
-
modules[
|
|
795
|
+
modules[_chunkGC5ROI3Acjs.toViteModuleId.call(void 0, moduleId, options.root)] = [
|
|
621
796
|
chunk.fileName,
|
|
622
797
|
...staticImports(chunk, loaded, [])
|
|
623
798
|
].map(index);
|
|
@@ -642,7 +817,7 @@ async function readFarmClientModulePreloads(buildDir) {
|
|
|
642
817
|
return JSON.parse(
|
|
643
818
|
await _promises2.default.readFile(_path2.default.join(buildDir, FARM_CLIENT_MODULE_PRELOADS_FILE), "utf8")
|
|
644
819
|
);
|
|
645
|
-
} catch (
|
|
820
|
+
} catch (e7) {
|
|
646
821
|
return null;
|
|
647
822
|
}
|
|
648
823
|
}
|
|
@@ -671,6 +846,40 @@ function createFarmClientRouteTable(clientPages) {
|
|
|
671
846
|
...page.pageShouldHydrate ? { loader: loaders++ } : {}
|
|
672
847
|
}));
|
|
673
848
|
}
|
|
849
|
+
function resolveFarmDocsClientRoutes(pages, docsPagePaths) {
|
|
850
|
+
const docsRoutes = /* @__PURE__ */ new Map();
|
|
851
|
+
for (const page of pages) {
|
|
852
|
+
if (page.docs) docsRoutes.set(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, page.pattern, "router"), page);
|
|
853
|
+
}
|
|
854
|
+
const docsTemplate = docsRoutes.values().next().value;
|
|
855
|
+
const groupedDocsPages = [];
|
|
856
|
+
const appPages = [];
|
|
857
|
+
const shadowed = [];
|
|
858
|
+
for (const page of pages) {
|
|
859
|
+
if (page.docs) continue;
|
|
860
|
+
const shape = _chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, page.pattern, "router");
|
|
861
|
+
const docsRoute = docsRoutes.get(shape);
|
|
862
|
+
const directory = page.directory ? { directory: page.directory } : {};
|
|
863
|
+
if (docsPagePaths.has(page.pattern)) {
|
|
864
|
+
if (docsRoute) docsRoutes.set(shape, { ...docsRoute, ...directory });
|
|
865
|
+
else if (docsTemplate && page.directory) {
|
|
866
|
+
groupedDocsPages.push({ ...docsTemplate, pattern: page.pattern, ...directory });
|
|
867
|
+
}
|
|
868
|
+
} else if (!docsRoute) {
|
|
869
|
+
appPages.push(page);
|
|
870
|
+
} else if (_chunkML4TOUZPcjs.getRoutePatternSpecificity.call(void 0, docsRoute.pattern, "router").every(isStatic)) {
|
|
871
|
+
docsRoutes.delete(shape);
|
|
872
|
+
appPages.push(page);
|
|
873
|
+
} else {
|
|
874
|
+
docsRoutes.set(shape, { ...docsRoute, ...directory });
|
|
875
|
+
shadowed.push(page);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
return { pages: [...docsRoutes.values(), ...groupedDocsPages, ...appPages], shadowed };
|
|
879
|
+
}
|
|
880
|
+
function isStatic(segment) {
|
|
881
|
+
return segment === "static";
|
|
882
|
+
}
|
|
674
883
|
function generateFarmClientRouteTableModule(table) {
|
|
675
884
|
return `export default JSON.parse(${JSON.stringify(JSON.stringify(table))});
|
|
676
885
|
`;
|
|
@@ -684,7 +893,7 @@ async function readFarmClientRouteTable(buildDir) {
|
|
|
684
893
|
return JSON.parse(
|
|
685
894
|
await _promises2.default.readFile(_path2.default.join(buildDir, FARM_CLIENT_ROUTE_TABLE_FILE), "utf8")
|
|
686
895
|
);
|
|
687
|
-
} catch (
|
|
896
|
+
} catch (e8) {
|
|
688
897
|
return null;
|
|
689
898
|
}
|
|
690
899
|
}
|
|
@@ -768,7 +977,7 @@ async function readFarmDocsModulePreloads(buildDir) {
|
|
|
768
977
|
return JSON.parse(
|
|
769
978
|
await _promises2.default.readFile(_path2.default.join(buildDir, FARM_DOCS_MODULE_PRELOADS_FILE), "utf8")
|
|
770
979
|
);
|
|
771
|
-
} catch (
|
|
980
|
+
} catch (e9) {
|
|
772
981
|
return null;
|
|
773
982
|
}
|
|
774
983
|
}
|
|
@@ -784,7 +993,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
784
993
|
const routes = [];
|
|
785
994
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
786
995
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
787
|
-
const rendering = await
|
|
996
|
+
const rendering = await _chunk7564NP5Zcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
788
997
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
789
998
|
routes.push({
|
|
790
999
|
kind: "page",
|
|
@@ -1079,8 +1288,8 @@ function buildFarmVercelRoutes(options) {
|
|
|
1079
1288
|
const sourceRoutes = filesystemIndex >= 0 ? presetRoutes.slice(0, filesystemIndex) : [];
|
|
1080
1289
|
const preservedSourceRoutes = sourceRoutes.filter((route) => route.continue !== true);
|
|
1081
1290
|
return [
|
|
1082
|
-
...preservedSourceRoutes,
|
|
1083
1291
|
...middlewareRoutes,
|
|
1292
|
+
...preservedSourceRoutes,
|
|
1084
1293
|
...canonicalSlashRoutes,
|
|
1085
1294
|
createFarmVercelImmutableAssetRoute(),
|
|
1086
1295
|
{ handle: "filesystem" },
|
|
@@ -1138,7 +1347,7 @@ function resolveBundleFileName(chunkFileName, relativeUrl) {
|
|
|
1138
1347
|
let relativePath = relativeUrl.replace(/[?#].*$/, "");
|
|
1139
1348
|
try {
|
|
1140
1349
|
relativePath = decodeURI(relativePath);
|
|
1141
|
-
} catch (
|
|
1350
|
+
} catch (e10) {
|
|
1142
1351
|
}
|
|
1143
1352
|
const fileName = _path2.default.posix.normalize(
|
|
1144
1353
|
_path2.default.posix.join(_path2.default.posix.dirname(chunkFileName), relativePath)
|
|
@@ -1385,7 +1594,7 @@ function stripPlatformConfigSource(code, parse) {
|
|
|
1385
1594
|
function realPath(file) {
|
|
1386
1595
|
try {
|
|
1387
1596
|
return _fs.realpathSync.call(void 0, file);
|
|
1388
|
-
} catch (
|
|
1597
|
+
} catch (e11) {
|
|
1389
1598
|
return _path2.default.resolve(file);
|
|
1390
1599
|
}
|
|
1391
1600
|
}
|
|
@@ -1397,7 +1606,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1397
1606
|
// removed block used (`readFileSync` for a version, say).
|
|
1398
1607
|
enforce: "pre",
|
|
1399
1608
|
transform: {
|
|
1400
|
-
filter: { id:
|
|
1609
|
+
filter: { id: _chunkIK33N2ANcjs.fileNamePattern.call(void 0, configFiles) },
|
|
1401
1610
|
async handler(code, id) {
|
|
1402
1611
|
const file = id.split("?", 1)[0];
|
|
1403
1612
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -1445,7 +1654,7 @@ function precompileFarmMarkdownPages(bodies, coreRoot) {
|
|
|
1445
1654
|
eval: true,
|
|
1446
1655
|
workerData: { runtime: _url.pathToFileURL.call(void 0, runtime).href, bodies: [...new Set(bodies)] }
|
|
1447
1656
|
});
|
|
1448
|
-
} catch (
|
|
1657
|
+
} catch (e12) {
|
|
1449
1658
|
done();
|
|
1450
1659
|
return;
|
|
1451
1660
|
}
|
|
@@ -1564,7 +1773,7 @@ async function readMiddlewareFileConfig(filePath) {
|
|
|
1564
1773
|
const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
|
|
1565
1774
|
if (_optionalChain([parsed, 'access', _45 => _45.errors, 'optionalAccess', _46 => _46.length])) return "unknown";
|
|
1566
1775
|
return readStaticMiddlewareConfig(parsed.program);
|
|
1567
|
-
} catch (
|
|
1776
|
+
} catch (e13) {
|
|
1568
1777
|
return "unknown";
|
|
1569
1778
|
}
|
|
1570
1779
|
}
|
|
@@ -1677,7 +1886,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
1677
1886
|
logLevel: "silent",
|
|
1678
1887
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
1679
1888
|
resolve: {
|
|
1680
|
-
alias:
|
|
1889
|
+
alias: _chunkIK33N2ANcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
1681
1890
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
1682
1891
|
},
|
|
1683
1892
|
transform: {
|
|
@@ -1717,11 +1926,11 @@ Remove them from the middleware (Edge provides ${[...EDGE_NODE_MODULES].join(",
|
|
|
1717
1926
|
);
|
|
1718
1927
|
const gzippedBytes = _zlib.gzipSync.call(void 0, code).length;
|
|
1719
1928
|
if (gzippedBytes > EDGE_FUNCTION_SIZE_WARNING_BYTES) {
|
|
1720
|
-
|
|
1929
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
1721
1930
|
`Vercel edge middleware is ${(gzippedBytes / 1024 / 1024).toFixed(2)} MB gzipped, over the Hobby plan's 1 MB Edge function limit (Pro allows 2 MB, Enterprise 4 MB).`
|
|
1722
1931
|
);
|
|
1723
1932
|
}
|
|
1724
|
-
|
|
1933
|
+
_chunkGC5ROI3Acjs.logger.info(
|
|
1725
1934
|
`\u{1F6E1}\uFE0F Vercel edge middleware: ${routes.length} middleware file(s) guard their prerendered pages before the CDN serves them`
|
|
1726
1935
|
);
|
|
1727
1936
|
}
|
|
@@ -1737,7 +1946,7 @@ async function readFarmNativeStylesheets(clientOutputDir, clientCssHref) {
|
|
|
1737
1946
|
"utf8"
|
|
1738
1947
|
)
|
|
1739
1948
|
};
|
|
1740
|
-
} catch (
|
|
1949
|
+
} catch (e14) {
|
|
1741
1950
|
return {};
|
|
1742
1951
|
}
|
|
1743
1952
|
}
|
|
@@ -1756,7 +1965,7 @@ function findFarmCoreRoot(from) {
|
|
|
1756
1965
|
if (_fs.existsSync.call(void 0, manifest)) {
|
|
1757
1966
|
try {
|
|
1758
1967
|
if (JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core") return dir;
|
|
1759
|
-
} catch (
|
|
1968
|
+
} catch (e15) {
|
|
1760
1969
|
}
|
|
1761
1970
|
}
|
|
1762
1971
|
dir = _path2.default.dirname(dir);
|
|
@@ -1774,7 +1983,7 @@ function findInstalledPackageDir(name, from) {
|
|
|
1774
1983
|
if (_fs.existsSync.call(void 0, _path2.default.join(candidate, "package.json"))) {
|
|
1775
1984
|
try {
|
|
1776
1985
|
return _fs.realpathSync.call(void 0, candidate);
|
|
1777
|
-
} catch (
|
|
1986
|
+
} catch (e16) {
|
|
1778
1987
|
return null;
|
|
1779
1988
|
}
|
|
1780
1989
|
}
|
|
@@ -1790,7 +1999,7 @@ function collectFarmDependencyDirs(root) {
|
|
|
1790
1999
|
let manifest;
|
|
1791
2000
|
try {
|
|
1792
2001
|
manifest = JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(dir, "package.json"), "utf8"));
|
|
1793
|
-
} catch (
|
|
2002
|
+
} catch (e17) {
|
|
1794
2003
|
return;
|
|
1795
2004
|
}
|
|
1796
2005
|
for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
|
|
@@ -1806,7 +2015,7 @@ function collectFarmDependencyDirs(root) {
|
|
|
1806
2015
|
if (name.startsWith("@farm.js/")) queue.push({ name, from: root });
|
|
1807
2016
|
}
|
|
1808
2017
|
}
|
|
1809
|
-
} catch (
|
|
2018
|
+
} catch (e18) {
|
|
1810
2019
|
}
|
|
1811
2020
|
for (let next = queue.pop(); next; next = queue.pop()) {
|
|
1812
2021
|
const dir = findInstalledPackageDir(next.name, next.from);
|
|
@@ -1899,7 +2108,7 @@ function createPrerenderMarkdownPagesPlugin(pages) {
|
|
|
1899
2108
|
const compiled = await pages;
|
|
1900
2109
|
if (compiled.size === 0) return "";
|
|
1901
2110
|
return `globalThis[Symbol.for(${JSON.stringify(
|
|
1902
|
-
|
|
2111
|
+
_chunkPG7J7XYTcjs.FARM_MARKDOWN_PRECOMPILED_PAGES.description
|
|
1903
2112
|
)})] = new Map(${JSON.stringify([...compiled])});`;
|
|
1904
2113
|
}
|
|
1905
2114
|
};
|
|
@@ -1916,7 +2125,7 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
|
|
|
1916
2125
|
if (nitroEntry === void 0) {
|
|
1917
2126
|
try {
|
|
1918
2127
|
nitroEntry = resolveNitroEntry(root);
|
|
1919
|
-
} catch (
|
|
2128
|
+
} catch (e19) {
|
|
1920
2129
|
nitroEntry = null;
|
|
1921
2130
|
}
|
|
1922
2131
|
}
|
|
@@ -1937,7 +2146,7 @@ function createFarmStorageModuleRegistration(config) {
|
|
|
1937
2146
|
let runtimeRequire = projectRequire;
|
|
1938
2147
|
try {
|
|
1939
2148
|
runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
1940
|
-
} catch (
|
|
2149
|
+
} catch (e20) {
|
|
1941
2150
|
}
|
|
1942
2151
|
const loaders = [];
|
|
1943
2152
|
for (const specifier of modules) {
|
|
@@ -1946,7 +2155,7 @@ function createFarmStorageModuleRegistration(config) {
|
|
|
1946
2155
|
try {
|
|
1947
2156
|
resolved = require2.resolve(specifier);
|
|
1948
2157
|
break;
|
|
1949
|
-
} catch (
|
|
2158
|
+
} catch (e21) {
|
|
1950
2159
|
}
|
|
1951
2160
|
}
|
|
1952
2161
|
if (resolved) {
|
|
@@ -1964,7 +2173,7 @@ function resolveNitroPackageEntry(root) {
|
|
|
1964
2173
|
let runtimeRequire = projectRequire;
|
|
1965
2174
|
try {
|
|
1966
2175
|
runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
1967
|
-
} catch (
|
|
2176
|
+
} catch (e22) {
|
|
1968
2177
|
}
|
|
1969
2178
|
return runtimeRequire.resolve("nitro");
|
|
1970
2179
|
}
|
|
@@ -2018,7 +2227,7 @@ async function canUseRolldownBuilder() {
|
|
|
2018
2227
|
try {
|
|
2019
2228
|
await import("rolldown");
|
|
2020
2229
|
return true;
|
|
2021
|
-
} catch (
|
|
2230
|
+
} catch (e23) {
|
|
2022
2231
|
return false;
|
|
2023
2232
|
}
|
|
2024
2233
|
}
|
|
@@ -2032,7 +2241,7 @@ function hasReactDomEdgeServerBuild(root) {
|
|
|
2032
2241
|
try {
|
|
2033
2242
|
_module.createRequire.call(void 0, _path2.default.join(root, "package.json")).resolve("react-dom/server.edge");
|
|
2034
2243
|
return true;
|
|
2035
|
-
} catch (
|
|
2244
|
+
} catch (e24) {
|
|
2036
2245
|
return false;
|
|
2037
2246
|
}
|
|
2038
2247
|
}
|
|
@@ -2067,7 +2276,7 @@ function isFarmCoreModule(file) {
|
|
|
2067
2276
|
if (_fs.existsSync.call(void 0, manifest)) {
|
|
2068
2277
|
try {
|
|
2069
2278
|
return JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core";
|
|
2070
|
-
} catch (
|
|
2279
|
+
} catch (e25) {
|
|
2071
2280
|
return false;
|
|
2072
2281
|
}
|
|
2073
2282
|
}
|
|
@@ -2079,7 +2288,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2079
2288
|
return {
|
|
2080
2289
|
name: "farm-omitted-metadata-image-runtime",
|
|
2081
2290
|
resolveId: {
|
|
2082
|
-
filter: { id:
|
|
2291
|
+
filter: { id: _chunkIK33N2ANcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
2083
2292
|
handler(source, importer) {
|
|
2084
2293
|
if (source !== "@vercel/og") return null;
|
|
2085
2294
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -2088,7 +2297,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2088
2297
|
}
|
|
2089
2298
|
},
|
|
2090
2299
|
load: {
|
|
2091
|
-
filter: { id:
|
|
2300
|
+
filter: { id: _chunkIK33N2ANcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
2092
2301
|
handler(id) {
|
|
2093
2302
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
2094
2303
|
return `
|
|
@@ -2137,7 +2346,7 @@ function createEdgeMetadataImageRuntimePlugin({
|
|
|
2137
2346
|
return null;
|
|
2138
2347
|
}
|
|
2139
2348
|
const resolvedPath = _path2.default.resolve(_path2.default.dirname(importer.split("?", 1)[0]), source);
|
|
2140
|
-
return { id:
|
|
2349
|
+
return { id: _chunkGC5ROI3Acjs.toPosixPath.call(void 0, resolvedPath), external: "absolute" };
|
|
2141
2350
|
}
|
|
2142
2351
|
};
|
|
2143
2352
|
}
|
|
@@ -2276,7 +2485,7 @@ function lexDynamicImportArguments(code) {
|
|
|
2276
2485
|
}
|
|
2277
2486
|
try {
|
|
2278
2487
|
return _esmodulelexer.parse.call(void 0, code)[0].filter((entry) => entry.d > -1).map((entry) => ({ start: entry.s, end: entry.e }));
|
|
2279
|
-
} catch (
|
|
2488
|
+
} catch (e26) {
|
|
2280
2489
|
return null;
|
|
2281
2490
|
}
|
|
2282
2491
|
}
|
|
@@ -2385,7 +2594,7 @@ function hasProjectPostcssConfig(root) {
|
|
|
2385
2594
|
try {
|
|
2386
2595
|
projectRequire.resolve(`./${file}`);
|
|
2387
2596
|
return true;
|
|
2388
|
-
} catch (
|
|
2597
|
+
} catch (e27) {
|
|
2389
2598
|
return false;
|
|
2390
2599
|
}
|
|
2391
2600
|
});
|
|
@@ -2407,7 +2616,7 @@ async function findFarmConfigPath(root) {
|
|
|
2407
2616
|
try {
|
|
2408
2617
|
await fs5.access(resolvedPath);
|
|
2409
2618
|
return resolvedPath;
|
|
2410
|
-
} catch (
|
|
2619
|
+
} catch (e28) {
|
|
2411
2620
|
}
|
|
2412
2621
|
}
|
|
2413
2622
|
return null;
|
|
@@ -2417,7 +2626,7 @@ function hasFarmPluginRoutes(config) {
|
|
|
2417
2626
|
}
|
|
2418
2627
|
function farmServerRuntimePluginsMayHandlePath(config, pathname) {
|
|
2419
2628
|
return (config.plugins || []).some(
|
|
2420
|
-
(plugin) =>
|
|
2629
|
+
(plugin) => _chunk6DBBMQWTcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && // Mobile session tokens change only bearer requests and cookie-clearing responses, which a
|
|
2421
2630
|
// prerendered file never answers or sends; its endpoints live under /__farm/.
|
|
2422
2631
|
plugin.name !== _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
|
|
2423
2632
|
);
|
|
@@ -2430,7 +2639,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
2430
2639
|
let entries;
|
|
2431
2640
|
try {
|
|
2432
2641
|
entries = await fs5.readdir(dir, { withFileTypes: true });
|
|
2433
|
-
} catch (
|
|
2642
|
+
} catch (e29) {
|
|
2434
2643
|
return;
|
|
2435
2644
|
}
|
|
2436
2645
|
const middlewareFile = entries.find(
|
|
@@ -2449,8 +2658,8 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
2449
2658
|
}
|
|
2450
2659
|
await walk(
|
|
2451
2660
|
_path2.default.join(dir, entry.name),
|
|
2452
|
-
|
|
2453
|
-
|
|
2661
|
+
_chunkFE6KYDHCcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
|
|
2662
|
+
_chunkFE6KYDHCcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
|
|
2454
2663
|
discovered
|
|
2455
2664
|
);
|
|
2456
2665
|
}
|
|
@@ -2462,7 +2671,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
2462
2671
|
routes.set(route.directory, route);
|
|
2463
2672
|
}
|
|
2464
2673
|
}
|
|
2465
|
-
return Array.from(routes.values()).sort(
|
|
2674
|
+
return Array.from(routes.values()).sort(_chunkFE6KYDHCcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
|
|
2466
2675
|
}
|
|
2467
2676
|
function assertFarmDocsRuntimeSupported(config, preset) {
|
|
2468
2677
|
if (!_optionalChain([config, 'access', _77 => _77.docs, 'optionalAccess', _78 => _78.enabled]) || !_optionalChain([config, 'access', _79 => _79.docs, 'access', _80 => _80.adapter, 'optionalAccess', _81 => _81.server]) || _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
|
|
@@ -2483,7 +2692,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
2483
2692
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
|
|
2484
2693
|
]);
|
|
2485
2694
|
const nitroBuilderResultPromise = preloadFarmNitroBuilder();
|
|
2486
|
-
|
|
2695
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F69C} Building Farm.js application (universal) with preset: ${preset}...`);
|
|
2487
2696
|
const rendererBuild = options.rendererBuildLifetime ? void 0 : new AbortController();
|
|
2488
2697
|
const rendererBuildLifetime = _nullishCoalesce(options.rendererBuildLifetime, () => ( rendererBuild.signal));
|
|
2489
2698
|
let markdownPrecompile;
|
|
@@ -2496,12 +2705,17 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
2496
2705
|
});
|
|
2497
2706
|
const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
|
|
2498
2707
|
const pageRoutes = [];
|
|
2708
|
+
const searchPreserveRoutes = new Map(
|
|
2709
|
+
routeManager.getSearchPreserveRoutes().map((route) => [route.pattern, route])
|
|
2710
|
+
);
|
|
2499
2711
|
for (const [pattern, entry] of routeManager.getRoutes()) {
|
|
2500
|
-
const markdownSourcePath = entry.markdownSourcePath || (
|
|
2712
|
+
const markdownSourcePath = entry.markdownSourcePath || (_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
|
|
2713
|
+
const searchPreserve = searchPreserveRoutes.get(entry.pattern);
|
|
2501
2714
|
pageRoutes.push({
|
|
2502
2715
|
pattern,
|
|
2503
2716
|
...entry.directory ? { directory: entry.directory } : {},
|
|
2504
2717
|
modulePath: entry.modulePath,
|
|
2718
|
+
...searchPreserve ? { searchPreserve } : {},
|
|
2505
2719
|
...markdownSourcePath ? {
|
|
2506
2720
|
source: _fs.readFileSync.call(void 0, markdownSourcePath, "utf8"),
|
|
2507
2721
|
markdownSourcePath
|
|
@@ -2525,35 +2739,13 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
2525
2739
|
fallback: entry.fallback
|
|
2526
2740
|
})
|
|
2527
2741
|
);
|
|
2528
|
-
|
|
2742
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
|
|
2529
2743
|
const fs5 = await import("fs/promises");
|
|
2530
|
-
const layoutRoutes = []
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
for (const entry of entries) {
|
|
2536
|
-
if (entry.isFile() && entry.name.match(/^layout\.(tsx?|jsx?|vue|svelte)$/)) {
|
|
2537
|
-
layoutRoutes.push({
|
|
2538
|
-
pattern: routePrefix,
|
|
2539
|
-
modulePath: _path2.default.join(dir, entry.name)
|
|
2540
|
-
});
|
|
2541
|
-
} else if (entry.isDirectory() && !entry.name.startsWith(".") && !entry.name.startsWith("_")) {
|
|
2542
|
-
const childPrefix = routePrefix === "/" ? `/${entry.name}` : `${routePrefix}/${entry.name}`;
|
|
2543
|
-
await findLayoutsForClient(_path2.default.join(dir, entry.name), childPrefix);
|
|
2544
|
-
}
|
|
2545
|
-
}
|
|
2546
|
-
} catch (e29) {
|
|
2547
|
-
}
|
|
2548
|
-
}
|
|
2549
|
-
await findLayoutsForClient(appDir);
|
|
2550
|
-
const seenLayoutPatterns = new Set(layoutRoutes.map((layout) => layout.pattern));
|
|
2551
|
-
for (const [pattern, entry] of routeManager.getLayouts()) {
|
|
2552
|
-
if (seenLayoutPatterns.has(pattern)) continue;
|
|
2553
|
-
seenLayoutPatterns.add(pattern);
|
|
2554
|
-
layoutRoutes.push({ pattern, modulePath: entry.modulePath });
|
|
2555
|
-
}
|
|
2556
|
-
_chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
|
|
2744
|
+
const layoutRoutes = Array.from(routeManager.getLayouts(), ([pattern, { modulePath }]) => ({
|
|
2745
|
+
pattern,
|
|
2746
|
+
modulePath
|
|
2747
|
+
}));
|
|
2748
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
|
|
2557
2749
|
const isolatedClientBoundaryModules = routeManager.getIsolatedClientBoundaryModules(root);
|
|
2558
2750
|
const islandsErrors = routeManager.getIslandsErrors(root);
|
|
2559
2751
|
if (islandsErrors.length > 0) {
|
|
@@ -2572,7 +2764,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2572
2764
|
throw productionViteResult.reason;
|
|
2573
2765
|
}
|
|
2574
2766
|
const productionVite = productionViteResult.value;
|
|
2575
|
-
|
|
2767
|
+
_chunkGC5ROI3Acjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
|
|
2576
2768
|
const mobileClient = shouldBuildFarmMobileClient(config);
|
|
2577
2769
|
const rendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
2578
2770
|
const buildClientBundle = async () => {
|
|
@@ -2617,11 +2809,11 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2617
2809
|
let clientBuildResult;
|
|
2618
2810
|
let ssrBuildResult;
|
|
2619
2811
|
if (!rendererDisabled && config.renderer.buildConcurrency === "serial") {
|
|
2620
|
-
|
|
2812
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4E6} Building client and SSR bundles serially for ${config.renderer.name}...`);
|
|
2621
2813
|
[clientBuildResult] = await Promise.allSettled([buildClientBundle()]);
|
|
2622
2814
|
[ssrBuildResult] = await Promise.allSettled([buildSSRBundle()]);
|
|
2623
2815
|
} else {
|
|
2624
|
-
|
|
2816
|
+
_chunkGC5ROI3Acjs.logger.info(
|
|
2625
2817
|
rendererDisabled ? "\u{1F4E6} Building the server bundle (renderer: false, no client bundle)..." : "\u{1F4E6} Building client and SSR bundles in parallel..."
|
|
2626
2818
|
);
|
|
2627
2819
|
[clientBuildResult, ssrBuildResult] = await Promise.allSettled([
|
|
@@ -2638,7 +2830,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2638
2830
|
if (productionVite.builder !== "rolldown" || !(clientBuildResult.reason instanceof IncompleteClientBuildOutputError)) {
|
|
2639
2831
|
throw clientBuildResult.reason;
|
|
2640
2832
|
}
|
|
2641
|
-
|
|
2833
|
+
_chunkGC5ROI3Acjs.logger.warn("Client bundle was incomplete; retrying after the SSR build...");
|
|
2642
2834
|
try {
|
|
2643
2835
|
await buildClient(
|
|
2644
2836
|
productionVite,
|
|
@@ -2668,15 +2860,18 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2668
2860
|
const routeRuntimeManifest = routeRuntimeManifestResult.value;
|
|
2669
2861
|
const runtimeValidation = validateFarmRouteRuntimeDeployment(routeRuntimeManifest, preset);
|
|
2670
2862
|
for (const warning of runtimeValidation.warnings) {
|
|
2671
|
-
|
|
2863
|
+
_chunkGC5ROI3Acjs.logger.warn(warning);
|
|
2672
2864
|
}
|
|
2673
2865
|
const { bundle: ssrBundle, entryFile: ssrEntryFile, configuredHeaderRoutes } = ssrResult;
|
|
2674
2866
|
assertServerReadSSRAssetsSupported(ssrBundle, preset, root);
|
|
2675
2867
|
await writeSSRAssetsToClient(ssrBundle, clientOutputDir);
|
|
2868
|
+
if (!rendererDisabled) {
|
|
2869
|
+
await writeFarmVideoPlayerToClient(clientOutputDir);
|
|
2870
|
+
}
|
|
2676
2871
|
if (config.docs.enabled) {
|
|
2677
2872
|
await copyFarmDocsFontAssetsToClient(root, clientOutputDir);
|
|
2678
2873
|
}
|
|
2679
|
-
|
|
2874
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
|
|
2680
2875
|
await buildNitroUniversal(
|
|
2681
2876
|
config,
|
|
2682
2877
|
routeManager,
|
|
@@ -2698,7 +2893,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2698
2893
|
_path2.default.join(root, distDir),
|
|
2699
2894
|
routeRuntimeManifest
|
|
2700
2895
|
);
|
|
2701
|
-
|
|
2896
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4CB} Route runtime manifest: ${_path2.default.relative(root, runtimeManifestPath)}`);
|
|
2702
2897
|
} catch (error) {
|
|
2703
2898
|
if (lifecyclePluginManager) {
|
|
2704
2899
|
await lifecyclePluginManager.runHookParallel("onError", {
|
|
@@ -2710,7 +2905,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2710
2905
|
}
|
|
2711
2906
|
});
|
|
2712
2907
|
}
|
|
2713
|
-
|
|
2908
|
+
_chunkGC5ROI3Acjs.logger.error(`\u274C Build failed: ${error}`);
|
|
2714
2909
|
throw error;
|
|
2715
2910
|
} finally {
|
|
2716
2911
|
_optionalChain([rendererBuild, 'optionalAccess', _85 => _85.abort, 'call', _86 => _86()]);
|
|
@@ -2720,10 +2915,10 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2720
2915
|
function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
2721
2916
|
const bodies = [];
|
|
2722
2917
|
for (const route of pageRoutes) {
|
|
2723
|
-
if (route.source === void 0 || !
|
|
2724
|
-
const { body } =
|
|
2725
|
-
const rendering =
|
|
2726
|
-
|
|
2918
|
+
if (route.source === void 0 || !_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
|
|
2919
|
+
const { body } = _chunkPG7J7XYTcjs.parseMarkdownFrontmatter.call(void 0, route.source);
|
|
2920
|
+
const rendering = _chunk7564NP5Zcjs.resolveRouteRenderingConfig.call(void 0,
|
|
2921
|
+
_chunkPG7J7XYTcjs.readFarmMarkdownRouteConfig.call(void 0, body),
|
|
2727
2922
|
route.source
|
|
2728
2923
|
);
|
|
2729
2924
|
if (rendering.ssg && rendering.revalidate === void 0) bodies.push(body);
|
|
@@ -2761,6 +2956,16 @@ async function writeSSRAssetsToClient(bundle, outputDir) {
|
|
|
2761
2956
|
await fs5.writeFile(filePath, output.source);
|
|
2762
2957
|
}
|
|
2763
2958
|
}
|
|
2959
|
+
async function writeFarmVideoPlayerToClient(outputDir) {
|
|
2960
|
+
const fs5 = await import("fs/promises");
|
|
2961
|
+
const filePath = _path2.default.join(outputDir, _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH.slice(1));
|
|
2962
|
+
await fs5.mkdir(_path2.default.dirname(filePath), { recursive: true });
|
|
2963
|
+
try {
|
|
2964
|
+
await fs5.writeFile(filePath, _chunkIK33N2ANcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
|
|
2965
|
+
} catch (error) {
|
|
2966
|
+
if (error.code !== "EEXIST") throw error;
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2764
2969
|
async function copyFarmDocsFontAssetsToClient(root, outputDir) {
|
|
2765
2970
|
const fs5 = await import("fs/promises");
|
|
2766
2971
|
await Promise.all(
|
|
@@ -2790,7 +2995,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
2790
2995
|
}
|
|
2791
2996
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
2792
2997
|
await fs5.writeFile(fontCssPath, normalizedFontCss);
|
|
2793
|
-
await fs5.writeFile(clientCssPath,
|
|
2998
|
+
await fs5.writeFile(clientCssPath, _chunkIK33N2ANcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
2794
2999
|
}
|
|
2795
3000
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
2796
3001
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -2840,10 +3045,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
2840
3045
|
}
|
|
2841
3046
|
}
|
|
2842
3047
|
function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
|
|
2843
|
-
const key =
|
|
3048
|
+
const key = _chunkJNZDTE75cjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
|
|
2844
3049
|
let plan = cache.get(key);
|
|
2845
3050
|
if (!plan) {
|
|
2846
|
-
plan =
|
|
3051
|
+
plan = _chunkJNZDTE75cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2847
3052
|
cache.set(key, plan);
|
|
2848
3053
|
}
|
|
2849
3054
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2852,7 +3057,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2852
3057
|
if (!mobile) await _chunkE5UN4OWXcjs.removeFarmMobileClientManifest.call(void 0, _path2.default.dirname(outputDir));
|
|
2853
3058
|
const viteBuild = productionVite.build;
|
|
2854
3059
|
const { farmIslandContainersPlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
2855
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
3060
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-5BNPYCER.cjs");
|
|
2856
3061
|
const fs5 = await import("fs/promises");
|
|
2857
3062
|
const pluginManager = new PluginManager2({
|
|
2858
3063
|
config,
|
|
@@ -2861,25 +3066,25 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2861
3066
|
});
|
|
2862
3067
|
pluginManager.addPlugins(config.plugins || []);
|
|
2863
3068
|
const clientPages = [];
|
|
2864
|
-
const integrationProviders =
|
|
3069
|
+
const integrationProviders = _chunk6DBBMQWTcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
|
|
2865
3070
|
(provider) => provider.component || provider.type === "clerk"
|
|
2866
3071
|
);
|
|
2867
3072
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
2868
3073
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
2869
3074
|
);
|
|
2870
3075
|
if (_optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _93 => _93.experimental, 'optionalAccess', _94 => _94.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
2871
|
-
|
|
3076
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
2872
3077
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2873
3078
|
);
|
|
2874
3079
|
}
|
|
2875
|
-
const isolatedMode =
|
|
3080
|
+
const isolatedMode = _chunkJNZDTE75cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2876
3081
|
_optionalChain([config, 'access', _95 => _95.experimental, 'optionalAccess', _96 => _96.isolatedClientHydration]),
|
|
2877
3082
|
{
|
|
2878
3083
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _97 => _97.experimental, 'optionalAccess', _98 => _98.serverComponents])) === "rsc",
|
|
2879
3084
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2880
3085
|
}
|
|
2881
3086
|
);
|
|
2882
|
-
const planOptions =
|
|
3087
|
+
const planOptions = _chunkJNZDTE75cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2883
3088
|
config.renderer,
|
|
2884
3089
|
Boolean(unsupportedIntegrationProvider)
|
|
2885
3090
|
);
|
|
@@ -2891,13 +3096,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2891
3096
|
...planOptions,
|
|
2892
3097
|
serverTreeLayouts: pagePlanOptions.serverOwners
|
|
2893
3098
|
};
|
|
2894
|
-
const layoutAppliesToRoute =
|
|
3099
|
+
const layoutAppliesToRoute = _chunkXGDI4OUBcjs.routeBoundaryCoversDirectory;
|
|
2895
3100
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
2896
3101
|
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _101 => _101.experimental, 'optionalAccess', _102 => _102.serverComponents])) === "islands";
|
|
2897
3102
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2898
3103
|
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled]) && _optionalChain([config, 'access', _105 => _105.docs, 'access', _106 => _106.adapter, 'optionalAccess', _107 => _107.server]) && config.docs.adapter.react
|
|
2899
3104
|
);
|
|
2900
|
-
const docsEntries = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) ?
|
|
3105
|
+
const docsEntries = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) ? _chunk6D3CJFNUcjs.getFarmDocsRoots.call(void 0, config.docs).map(
|
|
2901
3106
|
(docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
|
|
2902
3107
|
) : [];
|
|
2903
3108
|
const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
|
|
@@ -2906,7 +3111,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2906
3111
|
);
|
|
2907
3112
|
const syntheticDocsEntry = _optionalChain([config, 'access', _110 => _110.docs, 'optionalAccess', _111 => _111.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2908
3113
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2909
|
-
const plan = (operation) => sourceSnapshot ?
|
|
3114
|
+
const plan = (operation) => sourceSnapshot ? _chunkJNZDTE75cjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunkJNZDTE75cjs.withFarmSourceSnapshot.call(void 0, operation);
|
|
2910
3115
|
const { clientLayouts, clientRouteSlots } = plan(() => {
|
|
2911
3116
|
const clientLayouts2 = layoutRoutes.map((layout) => {
|
|
2912
3117
|
try {
|
|
@@ -2934,7 +3139,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2934
3139
|
serverTreeLayout: metadata.serverTreeLayout
|
|
2935
3140
|
};
|
|
2936
3141
|
} catch (error) {
|
|
2937
|
-
|
|
3142
|
+
_chunkGC5ROI3Acjs.logger.warn(`\u26A0\uFE0F Could not inspect layout file ${layout.modulePath}: ${error}`);
|
|
2938
3143
|
return {
|
|
2939
3144
|
...layout,
|
|
2940
3145
|
shouldHydrate: false,
|
|
@@ -2953,7 +3158,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2953
3158
|
};
|
|
2954
3159
|
}
|
|
2955
3160
|
});
|
|
2956
|
-
const markdownPagePlan =
|
|
3161
|
+
const markdownPagePlan = _chunkJNZDTE75cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2957
3162
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2958
3163
|
root,
|
|
2959
3164
|
isolatedMode,
|
|
@@ -2961,7 +3166,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2961
3166
|
);
|
|
2962
3167
|
const routePlans = pageRoutes.map((route) => ({
|
|
2963
3168
|
route,
|
|
2964
|
-
metadata:
|
|
3169
|
+
metadata: _chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
2965
3170
|
route.modulePath,
|
|
2966
3171
|
root,
|
|
2967
3172
|
isolatedMode,
|
|
@@ -2969,7 +3174,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2969
3174
|
pagePlanOptions
|
|
2970
3175
|
)
|
|
2971
3176
|
}));
|
|
2972
|
-
|
|
3177
|
+
_chunkJNZDTE75cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2973
3178
|
clientLayouts2.map((layout) => ({
|
|
2974
3179
|
pattern: layout.pattern,
|
|
2975
3180
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2978,7 +3183,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2978
3183
|
[
|
|
2979
3184
|
...routePlans.map(({ route, metadata }) => ({
|
|
2980
3185
|
pattern: routeDirectory(route),
|
|
2981
|
-
depth:
|
|
3186
|
+
depth: _chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
2982
3187
|
metadata
|
|
2983
3188
|
})),
|
|
2984
3189
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -3002,8 +3207,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3002
3207
|
for (const layout of clientLayouts2) {
|
|
3003
3208
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
3004
3209
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
3005
|
-
|
|
3006
|
-
`\u26A0\uFE0F ${
|
|
3210
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
3211
|
+
`\u26A0\uFE0F ${_chunkJNZDTE75cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
|
|
3007
3212
|
);
|
|
3008
3213
|
}
|
|
3009
3214
|
}
|
|
@@ -3015,7 +3220,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3015
3220
|
if (!("isolatedHydrationEligible" in metadata) || !metadata.isolatedHydrationEligible) {
|
|
3016
3221
|
continue;
|
|
3017
3222
|
}
|
|
3018
|
-
|
|
3223
|
+
_chunkGC5ROI3Acjs.logger.info(
|
|
3019
3224
|
`\u{1F4CA} Isolated hydration analysis: ${entry.modulePath} can exclude its server owner and hydrate ${metadata.isolatedBoundaries.length} client ${metadata.isolatedBoundaries.length === 1 ? "boundary" : "boundaries"}.`
|
|
3020
3225
|
);
|
|
3021
3226
|
}
|
|
@@ -3037,8 +3242,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3037
3242
|
(layout) => (layout.shouldHydrate || layout.hasIsolatedClientBoundaries) && layoutAppliesToRoute(layout.pattern, routeDirectory(route))
|
|
3038
3243
|
);
|
|
3039
3244
|
if (metadata.suppressedAsyncHydration) {
|
|
3040
|
-
|
|
3041
|
-
`\u26A0\uFE0F ${
|
|
3245
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
3246
|
+
`\u26A0\uFE0F ${_chunkJNZDTE75cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
3042
3247
|
);
|
|
3043
3248
|
}
|
|
3044
3249
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -3046,7 +3251,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3046
3251
|
).flatMap(({ plan: plan2 }) => plan2.isolatedBoundaries);
|
|
3047
3252
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
3048
3253
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
3049
|
-
const islandStrategy =
|
|
3254
|
+
const islandStrategy = _chunkIK33N2ANcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3050
3255
|
route,
|
|
3051
3256
|
metadata,
|
|
3052
3257
|
clientLayouts2,
|
|
@@ -3065,12 +3270,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3065
3270
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
3066
3271
|
],
|
|
3067
3272
|
// The server renders a server tree only below a hydrating layout.
|
|
3068
|
-
...
|
|
3273
|
+
..._chunkJNZDTE75cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
3069
3274
|
});
|
|
3070
|
-
|
|
3275
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
3071
3276
|
}
|
|
3072
3277
|
} catch (error) {
|
|
3073
|
-
|
|
3278
|
+
_chunkGC5ROI3Acjs.logger.warn(`\u26A0\uFE0F Could not inspect route file ${route.modulePath}: ${error}`);
|
|
3074
3279
|
}
|
|
3075
3280
|
}
|
|
3076
3281
|
if (syntheticDocsEntry) {
|
|
@@ -3102,19 +3307,36 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3102
3307
|
}
|
|
3103
3308
|
const clientRouteSlots2 = routeSlots.filter((slot) => {
|
|
3104
3309
|
try {
|
|
3105
|
-
const metadata =
|
|
3310
|
+
const metadata = _chunkJNZDTE75cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
3106
3311
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
3107
3312
|
} catch (error) {
|
|
3108
|
-
|
|
3313
|
+
_chunkGC5ROI3Acjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
3109
3314
|
return false;
|
|
3110
3315
|
}
|
|
3111
3316
|
});
|
|
3112
3317
|
return { clientLayouts: clientLayouts2, clientRouteSlots: clientRouteSlots2 };
|
|
3113
3318
|
});
|
|
3114
|
-
|
|
3319
|
+
const docsEntryOwns = (pattern) => syntheticDocsEntry === "/" || pattern === syntheticDocsEntry || pattern.startsWith(`${syntheticDocsEntry}/`);
|
|
3320
|
+
if (syntheticDocsEntry && clientPages.some((page) => !page.docs && docsEntryOwns(page.pattern))) {
|
|
3321
|
+
const docsPagePaths = new Set(
|
|
3322
|
+
_chunk6D3CJFNUcjs.discoverFarmDocsPages.call(void 0,
|
|
3323
|
+
_chunk6D3CJFNUcjs.resolveFarmDocsContentDir.call(void 0, config.docs, { root: config.root, srcDir: config.srcDir }),
|
|
3324
|
+
config.docs
|
|
3325
|
+
).map((page) => page.href)
|
|
3326
|
+
);
|
|
3327
|
+
const resolved = resolveFarmDocsClientRoutes(clientPages, docsPagePaths);
|
|
3328
|
+
for (const page of resolved.shadowed) {
|
|
3329
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
3330
|
+
`\u26A0\uFE0F ${page.pattern} has the URL shape of the docs route ${syntheticDocsPatterns[1]}, whose pages answer first: the page renders only at paths without a docs page, and does not hydrate as a page there.`
|
|
3331
|
+
);
|
|
3332
|
+
}
|
|
3333
|
+
clientPages.splice(0, clientPages.length, ...resolved.pages);
|
|
3334
|
+
}
|
|
3335
|
+
_chunkGC5ROI3Acjs.logger.info(
|
|
3115
3336
|
`\u{1F4F1} Total hydratable routes detected: ${clientPages.length} pages, ${clientLayouts.filter((layout) => layout.shouldHydrate || layout.hasIsolatedClientBoundaries).length} layouts, and ${clientRouteSlots.length} slots`
|
|
3116
3337
|
);
|
|
3117
3338
|
const clientRouteTable = createFarmClientRouteTable(clientPages);
|
|
3339
|
+
_chunkO4JYMU5Ncjs.createFarmRouter.call(void 0, clientRouteTable.map((route) => ({ path: route.pattern, meta: route })));
|
|
3118
3340
|
await writeFarmClientRouteTable(_path2.default.dirname(outputDir), clientRouteTable);
|
|
3119
3341
|
const buildTarget = async (platform) => {
|
|
3120
3342
|
const clientEntryRoot = _path2.default.join(root, ".farm", "tmp");
|
|
@@ -3129,20 +3351,20 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3129
3351
|
srcDir,
|
|
3130
3352
|
adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
3131
3353
|
adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
3132
|
-
_optionalChain([config, 'access', _112 => _112.docs, 'optionalAccess', _113 => _113.enabled]) ?
|
|
3354
|
+
_optionalChain([config, 'access', _112 => _112.docs, 'optionalAccess', _113 => _113.enabled]) ? _chunk6D3CJFNUcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
|
|
3133
3355
|
adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _114 => _114.docs, 'access', _115 => _115.adapter, 'optionalAccess', _116 => _116.react]) : void 0,
|
|
3134
3356
|
config.i18n,
|
|
3135
3357
|
config.plugins,
|
|
3136
3358
|
config.renderer,
|
|
3137
3359
|
config.publicRuntimeConfig,
|
|
3138
3360
|
config.trailingSlash,
|
|
3139
|
-
|
|
3361
|
+
_chunk6DBBMQWTcjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
3140
3362
|
config.basePath,
|
|
3141
|
-
|
|
3363
|
+
_chunkIK33N2ANcjs.generateClientCachePersistenceCode.call(void 0, _chunkIK33N2ANcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
3142
3364
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
3143
3365
|
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _117 => _117.experimental, 'optionalAccess', _118 => _118.serverComponents])) === "islands",
|
|
3144
3366
|
platform,
|
|
3145
|
-
islandsMode ?
|
|
3367
|
+
islandsMode ? _chunkJNZDTE75cjs.collectFarmServerStylesheets.call(void 0,
|
|
3146
3368
|
[
|
|
3147
3369
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
3148
3370
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -3161,7 +3383,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3161
3383
|
await fs5.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
|
|
3162
3384
|
}
|
|
3163
3385
|
const clientInput = { [entryName]: clientEntryPath };
|
|
3164
|
-
if (platform === "web" &&
|
|
3386
|
+
if (platform === "web" && _chunkIK33N2ANcjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
3165
3387
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
3166
3388
|
await fs5.writeFile(
|
|
3167
3389
|
clientBootPath,
|
|
@@ -3177,12 +3399,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3177
3399
|
buildLifetime: rendererBuildLifetime
|
|
3178
3400
|
});
|
|
3179
3401
|
if (hasScopedPostcssConfig) {
|
|
3180
|
-
|
|
3402
|
+
_chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
|
|
3181
3403
|
} else {
|
|
3182
3404
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
3183
3405
|
await fs5.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
3184
3406
|
postcssSearchPath = clientEntryDir;
|
|
3185
|
-
tailwindVitePlugin = await
|
|
3407
|
+
tailwindVitePlugin = await _chunkHVJ7IACBcjs.loadTailwindVitePlugin.call(void 0, {
|
|
3186
3408
|
builder: productionVite.builder,
|
|
3187
3409
|
announce: true
|
|
3188
3410
|
});
|
|
@@ -3201,10 +3423,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3201
3423
|
// Preserve Farm's Vite 5 browser baseline when the production builder
|
|
3202
3424
|
// uses Vite 8, whose default target only covers newer browsers.
|
|
3203
3425
|
target: FARM_CLIENT_BUILD_TARGET,
|
|
3426
|
+
// Tailwind CSS 4 already requires newer browsers than that baseline. An app's own
|
|
3427
|
+
// `build.target` or `build.cssTarget` still decides, as Vite derives one from the other.
|
|
3428
|
+
..._optionalChain([config, 'access', _119 => _119.vite, 'optionalAccess', _120 => _120.build, 'optionalAccess', _121 => _121.target]) === void 0 && _optionalChain([config, 'access', _122 => _122.vite, 'optionalAccess', _123 => _123.build, 'optionalAccess', _124 => _124.cssTarget]) === void 0 && (_chunkHVJ7IACBcjs.includesTailwindVitePlugin.call(void 0, tailwindVitePlugin) || _chunkHVJ7IACBcjs.includesTailwindVitePlugin.call(void 0, _optionalChain([config, 'access', _125 => _125.vite, 'optionalAccess', _126 => _126.plugins]))) ? { cssTarget: _chunkHVJ7IACBcjs.TAILWIND_CSS_BROWSER_TARGET } : {},
|
|
3204
3429
|
outDir: outputDir,
|
|
3205
3430
|
emptyOutDir: platform === "web",
|
|
3206
3431
|
// Never public: see resolveFarmClientSourcemap.
|
|
3207
|
-
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access',
|
|
3432
|
+
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _127 => _127.vite, 'optionalAccess', _128 => _128.build, 'optionalAccess', _129 => _129.sourcemap])),
|
|
3208
3433
|
assetsInlineLimit: 0,
|
|
3209
3434
|
cssCodeSplit: false,
|
|
3210
3435
|
// Bundle all CSS into one file
|
|
@@ -3216,7 +3441,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3216
3441
|
hashCharacters: "hex",
|
|
3217
3442
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
3218
3443
|
assetFileNames: (assetInfo) => {
|
|
3219
|
-
if (_optionalChain([assetInfo, 'access',
|
|
3444
|
+
if (_optionalChain([assetInfo, 'access', _130 => _130.name, 'optionalAccess', _131 => _131.endsWith, 'call', _132 => _132(".css")])) {
|
|
3220
3445
|
return `${entryName}.css`;
|
|
3221
3446
|
}
|
|
3222
3447
|
return "assets/[name]-h[hash][extname]";
|
|
@@ -3233,7 +3458,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3233
3458
|
}
|
|
3234
3459
|
},
|
|
3235
3460
|
plugins: [
|
|
3236
|
-
|
|
3461
|
+
_chunkIK33N2ANcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
3237
3462
|
createFarmPrivateClientSourcemapsPlugin({
|
|
3238
3463
|
outDir: _path2.default.join(
|
|
3239
3464
|
_path2.default.dirname(outputDir),
|
|
@@ -3264,8 +3489,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3264
3489
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
3265
3490
|
...rendererVitePlugins,
|
|
3266
3491
|
...config.vite.plugins || [],
|
|
3267
|
-
farmServerOnlyEntriesPlugin({ platform }),
|
|
3268
|
-
|
|
3492
|
+
farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
|
|
3493
|
+
_chunkIK33N2ANcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3269
3494
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3270
3495
|
),
|
|
3271
3496
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3298,7 +3523,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3298
3523
|
},
|
|
3299
3524
|
load: {
|
|
3300
3525
|
filter: {
|
|
3301
|
-
id:
|
|
3526
|
+
id: _chunkIK33N2ANcjs.exactIdPattern.call(void 0, [
|
|
3302
3527
|
"\0empty-module",
|
|
3303
3528
|
"\0empty-api-route",
|
|
3304
3529
|
"\0farm-i18n-client-bridge",
|
|
@@ -3336,7 +3561,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3336
3561
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes, sourceSnapshot },
|
|
3337
3562
|
pluginManager
|
|
3338
3563
|
),
|
|
3339
|
-
|
|
3564
|
+
_chunkJNZDTE75cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
3340
3565
|
],
|
|
3341
3566
|
mode: "production",
|
|
3342
3567
|
css: postcssSearchPath ? {
|
|
@@ -3344,7 +3569,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3344
3569
|
} : void 0,
|
|
3345
3570
|
// Ensure React is bundled for client
|
|
3346
3571
|
resolve: {
|
|
3347
|
-
alias:
|
|
3572
|
+
alias: _chunkIK33N2ANcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
3348
3573
|
dedupe: [...config.renderer.dedupe || []]
|
|
3349
3574
|
},
|
|
3350
3575
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -3358,7 +3583,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3358
3583
|
}
|
|
3359
3584
|
};
|
|
3360
3585
|
await viteBuild(
|
|
3361
|
-
|
|
3586
|
+
_chunkIK33N2ANcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
|
|
3362
3587
|
);
|
|
3363
3588
|
if (platform === "mobile") {
|
|
3364
3589
|
await fs5.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
@@ -3381,15 +3606,6 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3381
3606
|
await buildTarget("web");
|
|
3382
3607
|
if (mobile) await buildTarget("mobile");
|
|
3383
3608
|
}
|
|
3384
|
-
function toBakedMarkdownSourcePath(root, filePath) {
|
|
3385
|
-
if (!filePath) return "";
|
|
3386
|
-
if (!_path2.default.isAbsolute(filePath)) return filePath.split(_path2.default.sep).join("/");
|
|
3387
|
-
const relative = _path2.default.relative(root, filePath);
|
|
3388
|
-
if (!relative || relative.startsWith("..") || _path2.default.isAbsolute(relative)) {
|
|
3389
|
-
return _path2.default.basename(filePath);
|
|
3390
|
-
}
|
|
3391
|
-
return relative.split(_path2.default.sep).join("/");
|
|
3392
|
-
}
|
|
3393
3609
|
function generateUniversalRouterStateRuntime(streamNavigations = false) {
|
|
3394
3610
|
return `
|
|
3395
3611
|
const FARM_PAGE_STATE_KEY = "__farmPageState";
|
|
@@ -3460,7 +3676,7 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
3460
3676
|
return response;
|
|
3461
3677
|
}
|
|
3462
3678
|
|
|
3463
|
-
${streamNavigations ?
|
|
3679
|
+
${streamNavigations ? _chunkIK33N2ANcjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
|
|
3464
3680
|
|
|
3465
3681
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
3466
3682
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -3491,6 +3707,35 @@ function historyScrollKey(state, path) {
|
|
|
3491
3707
|
return readHistoryKey(state) || path;
|
|
3492
3708
|
}
|
|
3493
3709
|
|
|
3710
|
+
// The URL a navigated page names as canonical (search.stripDefaults, search.temporary). A loaded
|
|
3711
|
+
// document applies it from its bootstrap script, which a navigation never runs, so a navigation
|
|
3712
|
+
// reads it from the same props and writes that URL to history. The fragment stays the link's.
|
|
3713
|
+
function resolveFarmCanonicalNavigationURL(html, url) {
|
|
3714
|
+
const prefix = "window.__FARM_PROPS__=";
|
|
3715
|
+
const separator = ";window.__FARM_INTEGRATION_API_MANIFEST__=";
|
|
3716
|
+
const start = typeof html === "string" ? html.indexOf(prefix) : -1;
|
|
3717
|
+
if (start === -1 || html.indexOf('"__farmCanonicalPath":', start) === -1) return url;
|
|
3718
|
+
for (
|
|
3719
|
+
let end = html.indexOf(separator, start + prefix.length);
|
|
3720
|
+
end !== -1;
|
|
3721
|
+
end = html.indexOf(separator, end + 1)
|
|
3722
|
+
) {
|
|
3723
|
+
let canonicalPath;
|
|
3724
|
+
try {
|
|
3725
|
+
canonicalPath = JSON.parse(html.slice(start + prefix.length, end)).__farmCanonicalPath;
|
|
3726
|
+
} catch {
|
|
3727
|
+
// The separator was inside a string value; try the next one.
|
|
3728
|
+
continue;
|
|
3729
|
+
}
|
|
3730
|
+
if (typeof canonicalPath !== "string" || !canonicalPath.startsWith("/")) return url;
|
|
3731
|
+
const canonical = new URL(canonicalPath, url);
|
|
3732
|
+
if (canonical.origin !== url.origin) return url;
|
|
3733
|
+
canonical.hash = url.hash;
|
|
3734
|
+
return canonical;
|
|
3735
|
+
}
|
|
3736
|
+
return url;
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3494
3739
|
/*farm-router-end*/
|
|
3495
3740
|
function hasAbsoluteNavigationHref(href) {
|
|
3496
3741
|
return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(href) || href.startsWith("//");
|
|
@@ -3612,7 +3857,10 @@ function generateClientPageDirectorySource() {
|
|
|
3612
3857
|
return `function getFarmPageDirectory(pathname) {
|
|
3613
3858
|
const path = getFarmRoutePathname(pathname);
|
|
3614
3859
|
let matched = clientRouteMatcher.match(path);
|
|
3615
|
-
if (matched && matched.route.meta.docs)
|
|
3860
|
+
if (matched && matched.route.meta.docs) {
|
|
3861
|
+
if (matched.route.meta.directory) return matched.route.meta.directory;
|
|
3862
|
+
matched = clientPageRouteMatcher.match(path);
|
|
3863
|
+
}
|
|
3616
3864
|
return matched ? matched.route.meta.directory || matched.route.meta.pattern : null;
|
|
3617
3865
|
}`;
|
|
3618
3866
|
}
|
|
@@ -4050,6 +4298,20 @@ ${streamNavigations ? ` // A streamed navigation swaps in the page's shell; its
|
|
|
4050
4298
|
!clientNavigation?.signal.aborted;
|
|
4051
4299
|
},
|
|
4052
4300
|
|
|
4301
|
+
// A prefetch made while a navigation swaps the page (an intent timer after the click, the
|
|
4302
|
+
// incoming page's links) would ask for it as the outgoing page shows it: its layouts, its React
|
|
4303
|
+
// root. It waits for the navigation to settle, and then skips the page it landed on.
|
|
4304
|
+
whenNavigationSettles: function() {
|
|
4305
|
+
return new Promise((resolve) => {
|
|
4306
|
+
const listener = (state) => {
|
|
4307
|
+
if (state.state !== "idle") return;
|
|
4308
|
+
this.navigationListeners.delete(listener);
|
|
4309
|
+
resolve();
|
|
4310
|
+
};
|
|
4311
|
+
this.navigationListeners.add(listener);
|
|
4312
|
+
});
|
|
4313
|
+
},
|
|
4314
|
+
|
|
4053
4315
|
finishNavigation: function(navigation) {
|
|
4054
4316
|
if (this.activeNavigation?.id !== navigation.id) return;
|
|
4055
4317
|
this.activeNavigation = null;
|
|
@@ -4468,7 +4730,7 @@ function readFarmEntryImports(source) {
|
|
|
4468
4730
|
for (const match of source.matchAll(/^import\s+([^"';]+?)\s+from\s+(["'][^"']+["'])/gm)) {
|
|
4469
4731
|
const from = match[2];
|
|
4470
4732
|
const named = /\{([^}]*)\}/.exec(match[1]);
|
|
4471
|
-
for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess',
|
|
4733
|
+
for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess', _133 => _133[1], 'optionalAccess', _134 => _134.split, 'call', _135 => _135(",")]), () => ( []))) {
|
|
4472
4734
|
const [imported, local] = specifier.trim().split(/\s+as\s+/);
|
|
4473
4735
|
if (imported)
|
|
4474
4736
|
bindings.push({ local: _nullishCoalesce(local, () => ( imported)), clause: `{ ${specifier.trim()} }`, from });
|
|
@@ -4563,7 +4825,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
4563
4825
|
direction: {}
|
|
4564
4826
|
}, plugins = [], renderer = _chunk67MZTLTFcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
|
|
4565
4827
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
4566
|
-
const clientPluginEntry =
|
|
4828
|
+
const clientPluginEntry = _chunkHVJ7IACBcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4567
4829
|
plugins,
|
|
4568
4830
|
root,
|
|
4569
4831
|
srcDir,
|
|
@@ -4572,10 +4834,11 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
4572
4834
|
);
|
|
4573
4835
|
const appSetupPath = _chunk67MZTLTFcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
4574
4836
|
const rendererClientImports = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
|
|
4575
|
-
import { createRoot, hydrateRoot } from "react-dom/client"
|
|
4576
|
-
import
|
|
4837
|
+
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
4838
|
+
import { restorePagePosition } from "@farm.js/core/internal/client-runtime";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
4839
|
+
import __farmAppSetup from ${JSON.stringify(_chunkGC5ROI3Acjs.toPosixPath.call(void 0, appSetupPath))};
|
|
4577
4840
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
4578
|
-
const providerClientCode =
|
|
4841
|
+
const providerClientCode = _chunkIK33N2ANcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4579
4842
|
integrationProviders,
|
|
4580
4843
|
root,
|
|
4581
4844
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -4598,18 +4861,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
|
|
|
4598
4861
|
const layoutImportStatements = [];
|
|
4599
4862
|
const layoutRegistrations = [];
|
|
4600
4863
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
4601
|
-
const treeLayoutPatterns = islandValues ?
|
|
4864
|
+
const treeLayoutPatterns = islandValues ? _chunkXGDI4OUBcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
|
|
4602
4865
|
layoutRoutes.forEach((layout, index) => {
|
|
4603
4866
|
const relativePath = toImportPath(layout.modulePath);
|
|
4604
4867
|
const treeLayout = treeLayoutPatterns.has(layout.pattern);
|
|
4605
4868
|
const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
|
|
4606
|
-
(pattern) =>
|
|
4869
|
+
(pattern) => _chunkXGDI4OUBcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
|
|
4607
4870
|
);
|
|
4608
4871
|
if (rendersOnClient && !treeLayout) {
|
|
4609
4872
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
4610
4873
|
}
|
|
4611
|
-
const groupScope =
|
|
4612
|
-
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(
|
|
4874
|
+
const groupScope = _chunkXGDI4OUBcjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
4875
|
+
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkXGDI4OUBcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
|
|
4613
4876
|
layoutRegistrations.push(
|
|
4614
4877
|
` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? treeLayout ? `getFarmTreeLayoutComponent(${JSON.stringify(layout.pattern)})` : `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)}${treeLayout ? ", serverTree: true" : ""} }`
|
|
4615
4878
|
);
|
|
@@ -4679,7 +4942,7 @@ function isFarmDocsPath() {
|
|
|
4679
4942
|
// Farm.js Client Runtime (no client components)
|
|
4680
4943
|
${cssImport}
|
|
4681
4944
|
${layoutImports}
|
|
4682
|
-
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
4945
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
4683
4946
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
4684
4947
|
${clientPluginEntry.imports}
|
|
4685
4948
|
${clientCachePersistence.imports}
|
|
@@ -4696,7 +4959,7 @@ mountFarmDocsSearch();
|
|
|
4696
4959
|
|
|
4697
4960
|
${generateUniversalRouterStateRuntime()}
|
|
4698
4961
|
|
|
4699
|
-
${
|
|
4962
|
+
${_chunkIK33N2ANcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
4700
4963
|
|
|
4701
4964
|
// SPA Router for server-rendered pages (HTML swap)
|
|
4702
4965
|
const spaRouter = {
|
|
@@ -4787,8 +5050,14 @@ ${generateUniversalRouterStateProperties()}
|
|
|
4787
5050
|
if (!this.swapContent(html)) {
|
|
4788
5051
|
throw new Error("Farm could not swap the target document");
|
|
4789
5052
|
}
|
|
4790
|
-
|
|
4791
|
-
this.
|
|
5053
|
+
const historyUrl = resolveFarmCanonicalNavigationURL(html, url);
|
|
5054
|
+
this.writeHistoryEntry(
|
|
5055
|
+
action,
|
|
5056
|
+
historyUrl.pathname + historyUrl.search,
|
|
5057
|
+
options.state,
|
|
5058
|
+
historyUrl,
|
|
5059
|
+
);
|
|
5060
|
+
this.currentPath = historyUrl.pathname + historyUrl.search;
|
|
4792
5061
|
if (options.scroll !== false) {
|
|
4793
5062
|
if (url.hash) getHashTargetElement(url.hash)?.scrollIntoView();
|
|
4794
5063
|
else window.scrollTo(0, 0);
|
|
@@ -4880,6 +5149,13 @@ ${generateUniversalRouterStateProperties()}
|
|
|
4880
5149
|
const url = new URL(href, window.location.href);
|
|
4881
5150
|
if (isFarmExternalNavigationURL(url, window.location.origin)) return;
|
|
4882
5151
|
if (isFarmDocsPath(url.pathname)) return;
|
|
5152
|
+
if (this.activeNavigation) {
|
|
5153
|
+
return this.whenNavigationSettles().then(() => {
|
|
5154
|
+
if (url.pathname + url.search !== window.location.pathname + window.location.search) {
|
|
5155
|
+
return this.prefetch(href);
|
|
5156
|
+
}
|
|
5157
|
+
});
|
|
5158
|
+
}
|
|
4883
5159
|
|
|
4884
5160
|
const pathname = url.pathname + url.search;
|
|
4885
5161
|
if (this.readFreshPrefetch(pathname) !== undefined) return;
|
|
@@ -4958,7 +5234,8 @@ document.addEventListener("click", function(e) {
|
|
|
4958
5234
|
if (e.defaultPrevented) return;
|
|
4959
5235
|
|
|
4960
5236
|
e.preventDefault();
|
|
4961
|
-
|
|
5237
|
+
rememberFarmLinkLocale(anchor);
|
|
5238
|
+
spaRouter.navigate(href, readFarmLinkNavigateOptions(anchor));
|
|
4962
5239
|
});
|
|
4963
5240
|
|
|
4964
5241
|
// Link anchors on a page that does not hydrate prefetch through the router as Link would.
|
|
@@ -4972,7 +5249,7 @@ installFarmLinkPrefetch();
|
|
|
4972
5249
|
clientPages.forEach((page) => {
|
|
4973
5250
|
for (const boundary of page.isolatedBoundaries) {
|
|
4974
5251
|
isolatedBoundaryModules.set(
|
|
4975
|
-
|
|
5252
|
+
_chunkGC5ROI3Acjs.toViteModuleId.call(void 0, boundary.modulePath, root),
|
|
4976
5253
|
toImportPath(boundary.modulePath)
|
|
4977
5254
|
);
|
|
4978
5255
|
}
|
|
@@ -5051,7 +5328,7 @@ ${layoutImports}
|
|
|
5051
5328
|
${rendererClientImports}
|
|
5052
5329
|
${isolatedHydrationImport}
|
|
5053
5330
|
${providerClientCode.imports}
|
|
5054
|
-
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5331
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5055
5332
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
5056
5333
|
import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
|
|
5057
5334
|
${clientPluginEntry.imports}
|
|
@@ -5130,7 +5407,7 @@ function hasHydratableLayout(pathname) {
|
|
|
5130
5407
|
});
|
|
5131
5408
|
}
|
|
5132
5409
|
|
|
5133
|
-
${
|
|
5410
|
+
${_chunkIK33N2ANcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5134
5411
|
// Wrap a page element with applicable layouts
|
|
5135
5412
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
5136
5413
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -5165,7 +5442,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
5165
5442
|
return React.createElement("div", props, pageElement);
|
|
5166
5443
|
}
|
|
5167
5444
|
let farmLastRouteState = null;
|
|
5168
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
5445
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkIK33N2ANcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
5169
5446
|
function farmTreeLayoutsOf(pathname) {
|
|
5170
5447
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
5171
5448
|
return layout.serverTree === true;
|
|
@@ -5221,7 +5498,7 @@ function reviveServerPageProps(serverProps) {
|
|
|
5221
5498
|
: serverProps;
|
|
5222
5499
|
}
|
|
5223
5500
|
|
|
5224
|
-
async function createMatchedHydrationRoute(matched, pathname, searchParams,
|
|
5501
|
+
async function createMatchedHydrationRoute(matched, pathname, searchParams, navigationPage, serverProps, layoutSource, hydrationContainer) {
|
|
5225
5502
|
const hydrateLayouts = hasHydratableLayout(pathname);
|
|
5226
5503
|
const params = matched.params;
|
|
5227
5504
|
let pageElement = null;
|
|
@@ -5258,24 +5535,30 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
|
|
|
5258
5535
|
pageElement = React.createElement(Component, props);
|
|
5259
5536
|
}
|
|
5260
5537
|
} else if (hydrateLayouts) {
|
|
5538
|
+
// A navigation passes the page element of the document it fetched, read as it is rather
|
|
5539
|
+
// than serialized and parsed again; hydration reads the page in this document.
|
|
5261
5540
|
const serverPage = document.getElementById("__farm_page__");
|
|
5262
|
-
const pageSource =
|
|
5541
|
+
const pageSource = navigationPage === undefined ? serverPage : navigationPage;
|
|
5263
5542
|
const serverTree = pageSource ? await createFarmServerTreePageElement(pageSource, pathname) : null;
|
|
5264
5543
|
// A payload-only page (islands mode) has no HTML to fall back to: fetch the whole document.
|
|
5265
|
-
if (
|
|
5544
|
+
if (
|
|
5545
|
+
!serverTree &&
|
|
5546
|
+
pageSource &&
|
|
5547
|
+
pageSource !== serverPage &&
|
|
5548
|
+
pageSource.querySelector('script[type="f/tree"][partial]')
|
|
5549
|
+
) {
|
|
5266
5550
|
return null;
|
|
5267
5551
|
}
|
|
5268
5552
|
pageElement = serverTree
|
|
5269
5553
|
? createLayoutPageBoundary(matched.route, serverTree)
|
|
5270
|
-
: createLayoutPageBoundary(
|
|
5271
|
-
matched.route,
|
|
5272
|
-
null,
|
|
5273
|
-
typeof serverHtml === "string" ? serverHtml : serverPage ? serverPage.innerHTML : "",
|
|
5274
|
-
);
|
|
5554
|
+
: createLayoutPageBoundary(matched.route, null, pageSource ? pageSource.innerHTML : "");
|
|
5275
5555
|
}
|
|
5276
5556
|
|
|
5277
5557
|
if (!pageElement) return null;
|
|
5278
|
-
if (!hydrateLayouts)
|
|
5558
|
+
if (!hydrateLayouts) {
|
|
5559
|
+
${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? "if (hydrationContainer) pageElement = restorePagePosition(React, hydrationContainer, pageElement);" : ""}
|
|
5560
|
+
return createFarmRouteState(pageElement, pathname, params, false);
|
|
5561
|
+
}
|
|
5279
5562
|
if (matched.route.pageShouldHydrate) {
|
|
5280
5563
|
pageElement = createLayoutPageBoundary(matched.route, pageElement);
|
|
5281
5564
|
}
|
|
@@ -5644,15 +5927,17 @@ async function hydrate() {
|
|
|
5644
5927
|
return;
|
|
5645
5928
|
}
|
|
5646
5929
|
const searchParams = searchParamsToObject(new URLSearchParams(window.location.search));
|
|
5930
|
+
const shouldHydrate = !isHydrated && Boolean(container.innerHTML.trim());
|
|
5647
5931
|
const routeState = await createMatchedHydrationRoute(
|
|
5648
5932
|
matched,
|
|
5649
5933
|
pathname,
|
|
5650
5934
|
searchParams,
|
|
5651
5935
|
undefined,
|
|
5652
5936
|
window.__FARM_PROPS__,
|
|
5937
|
+
undefined,
|
|
5938
|
+
shouldHydrate ? container : undefined,
|
|
5653
5939
|
);
|
|
5654
5940
|
if (!routeState) return;
|
|
5655
|
-
const shouldHydrate = !isHydrated && Boolean(container.innerHTML.trim());
|
|
5656
5941
|
const hydrationSession = await farmClientRuntime.beginHydration({
|
|
5657
5942
|
container,
|
|
5658
5943
|
mode: shouldHydrate ? "hydrate" : "render",
|
|
@@ -5731,7 +6016,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
5731
6016
|
return true;
|
|
5732
6017
|
}` : ""}
|
|
5733
6018
|
|
|
5734
|
-
${
|
|
6019
|
+
${_chunkIK33N2ANcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5735
6020
|
|
|
5736
6021
|
function activateNavigationScripts(root) {
|
|
5737
6022
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -5834,7 +6119,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
5834
6119
|
return shell.innerHTML;
|
|
5835
6120
|
}
|
|
5836
6121
|
|
|
5837
|
-
${islandValues ?
|
|
6122
|
+
${islandValues ? _chunkIK33N2ANcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
5838
6123
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
5839
6124
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
5840
6125
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -5901,9 +6186,14 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
5901
6186
|
partialNavigationHeaders: function() {
|
|
5902
6187
|
const root = document.getElementById("root") || document.body;
|
|
5903
6188
|
const layouts = getLayoutPatterns(root);
|
|
6189
|
+
// The root React owns, or one whose layouts hydrate together but have not yet: the
|
|
6190
|
+
// navigation creates it (swapContent).
|
|
6191
|
+
const rendersTree = reactRoot
|
|
6192
|
+
? reactRootContainer === root
|
|
6193
|
+
: root.id === "root" && hasHydratableLayout(window.location.pathname);
|
|
5904
6194
|
return {
|
|
5905
6195
|
...(layouts.length ? { "F-Layouts": JSON.stringify(layouts) } : {}),
|
|
5906
|
-
...(
|
|
6196
|
+
...(rendersTree ? { "F-Render": "tree" } : {}),
|
|
5907
6197
|
};
|
|
5908
6198
|
},
|
|
5909
6199
|
` : ""}
|
|
@@ -6112,8 +6402,14 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6112
6402
|
// The history entry comes first, as on the client-render path: swapContent shows the
|
|
6113
6403
|
// page and its title, then waits for its islands, and a Back pressed meanwhile must
|
|
6114
6404
|
// leave the page on screen, not the one before it. Its islands also hydrate at their URL.
|
|
6115
|
-
|
|
6116
|
-
this.
|
|
6405
|
+
const historyUrl = resolveFarmCanonicalNavigationURL(html, url);
|
|
6406
|
+
this.writeHistoryEntry(
|
|
6407
|
+
action,
|
|
6408
|
+
historyUrl.pathname + historyUrl.search,
|
|
6409
|
+
options.state,
|
|
6410
|
+
historyUrl,
|
|
6411
|
+
);
|
|
6412
|
+
this.currentPath = historyUrl.pathname + historyUrl.search;
|
|
6117
6413
|
let swappedHtml = html;
|
|
6118
6414
|
let swapped = await this.swapContent(
|
|
6119
6415
|
html,
|
|
@@ -6233,6 +6529,30 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6233
6529
|
const hydrateLayouts = hasHydratableLayout(newPathname);
|
|
6234
6530
|
const nextPage = newRoot.querySelector("#__farm_page__");
|
|
6235
6531
|
|
|
6532
|
+
${islandValues ? `// A layout that hydrates as one root but has not yet (its client components wait for a
|
|
6533
|
+
// click): its first navigation renders the page's payload in a new root, as later ones do.
|
|
6534
|
+
if (
|
|
6535
|
+
matched && hydrateLayouts && !reactRoot && currentRoot.id === "root" &&
|
|
6536
|
+
nextPage?.querySelector('script[type="f/tree"][partial]')
|
|
6537
|
+
) {
|
|
6538
|
+
const routeState = await createMatchedHydrationRoute(
|
|
6539
|
+
matched,
|
|
6540
|
+
newPathname,
|
|
6541
|
+
searchParamsToObject(targetUrl.searchParams),
|
|
6542
|
+
nextPage,
|
|
6543
|
+
nextPageProps,
|
|
6544
|
+
newRoot,
|
|
6545
|
+
);
|
|
6546
|
+
if (!isNavigationCurrent()) return false;
|
|
6547
|
+
if (!routeState) return "segment-mismatch";
|
|
6548
|
+
cancelPendingPageHydration();
|
|
6549
|
+
resetRouteSlotRoots();
|
|
6550
|
+
setFarmReactRoot(createRoot(currentRoot), currentRoot);
|
|
6551
|
+
renderFarmRoute(reactRoot, routeState);
|
|
6552
|
+
window.__FARM_ROUTE_SLOTS__ = nextRouteSlots;
|
|
6553
|
+
setFarmHydrated();
|
|
6554
|
+
return true;
|
|
6555
|
+
}` : ""}
|
|
6236
6556
|
// If React already owns the shared layout, update that root. React keeps
|
|
6237
6557
|
// matching layout component instances and their state mounted.
|
|
6238
6558
|
if (matched && hydrateLayouts && reactRoot && reactRootContainer === currentRoot) {
|
|
@@ -6241,7 +6561,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6241
6561
|
matched,
|
|
6242
6562
|
newPathname,
|
|
6243
6563
|
searchParams,
|
|
6244
|
-
nextPage
|
|
6564
|
+
nextPage,
|
|
6245
6565
|
nextPageProps,
|
|
6246
6566
|
newRoot,
|
|
6247
6567
|
);
|
|
@@ -6286,6 +6606,8 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6286
6606
|
searchParams,
|
|
6287
6607
|
undefined,
|
|
6288
6608
|
nextPageProps,
|
|
6609
|
+
undefined,
|
|
6610
|
+
pageContainer,
|
|
6289
6611
|
);
|
|
6290
6612
|
if (!isNavigationCurrent()) return false;
|
|
6291
6613
|
if (routeState) {
|
|
@@ -6336,6 +6658,13 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6336
6658
|
const url = new URL(href, window.location.href);
|
|
6337
6659
|
if (isFarmExternalNavigationURL(url, window.location.origin)) return;
|
|
6338
6660
|
if (isFarmDocsPath(url.pathname)) return;
|
|
6661
|
+
if (this.activeNavigation) {
|
|
6662
|
+
return this.whenNavigationSettles().then(() => {
|
|
6663
|
+
if (url.pathname + url.search !== window.location.pathname + window.location.search) {
|
|
6664
|
+
return this.prefetch(href);
|
|
6665
|
+
}
|
|
6666
|
+
});
|
|
6667
|
+
}
|
|
6339
6668
|
prefetchFarmClientRouteTable();
|
|
6340
6669
|
|
|
6341
6670
|
// A prefetch warms an ordinary future navigation, which reads the bare
|
|
@@ -6424,7 +6753,8 @@ document.addEventListener("click", function(e) {
|
|
|
6424
6753
|
if (e.defaultPrevented) return;
|
|
6425
6754
|
|
|
6426
6755
|
e.preventDefault();
|
|
6427
|
-
|
|
6756
|
+
rememberFarmLinkLocale(anchor);
|
|
6757
|
+
spaRouter.navigate(href, readFarmLinkNavigateOptions(anchor));
|
|
6428
6758
|
});
|
|
6429
6759
|
|
|
6430
6760
|
// Initial hydration
|
|
@@ -6437,7 +6767,7 @@ void hydrate();
|
|
|
6437
6767
|
async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime, sourceSnapshot) {
|
|
6438
6768
|
const viteBuild = productionVite.build;
|
|
6439
6769
|
const { farmIslandContainersPlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
6440
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
6770
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-5BNPYCER.cjs");
|
|
6441
6771
|
const fs5 = await import("fs/promises");
|
|
6442
6772
|
const pluginManager = new PluginManager2({
|
|
6443
6773
|
config,
|
|
@@ -6458,7 +6788,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6458
6788
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
6459
6789
|
"module.exports = { plugins: [] };\n"
|
|
6460
6790
|
);
|
|
6461
|
-
tailwindVitePlugin = await
|
|
6791
|
+
tailwindVitePlugin = await _chunkHVJ7IACBcjs.loadTailwindVitePlugin.call(void 0, {
|
|
6462
6792
|
builder: productionVite.builder,
|
|
6463
6793
|
label: "for SSR"
|
|
6464
6794
|
});
|
|
@@ -6540,7 +6870,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6540
6870
|
const appDirs = _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config);
|
|
6541
6871
|
let openAPIReference = null;
|
|
6542
6872
|
if (config.openapi.enabled && config.openapi.route) {
|
|
6543
|
-
const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-
|
|
6873
|
+
const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-R7FV4A56.cjs");
|
|
6544
6874
|
const openAPIManager = new OpenAPIManager(appDirs, config.openapi, {
|
|
6545
6875
|
mode: "production",
|
|
6546
6876
|
apiBaseURL: config.api.baseURL,
|
|
@@ -6565,14 +6895,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6565
6895
|
}))
|
|
6566
6896
|
);
|
|
6567
6897
|
const instrumentationPath = _chunk3GNHJ3RNcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
6568
|
-
const notFoundPath =
|
|
6569
|
-
if (notFoundPath)
|
|
6898
|
+
const notFoundPath = _chunkIK33N2ANcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
6899
|
+
if (notFoundPath) _chunkGC5ROI3Acjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
6570
6900
|
layoutRoutes.sort((a, b) => {
|
|
6571
6901
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
6572
6902
|
const depthB = b.pattern.split("/").filter(Boolean).length;
|
|
6573
6903
|
return depthA - depthB;
|
|
6574
6904
|
});
|
|
6575
|
-
|
|
6905
|
+
_chunkGC5ROI3Acjs.logger.info(
|
|
6576
6906
|
`\u{1F4CB} Found ${pageRoutes.length} page routes, ${layoutRoutes.length} layouts, ${apiRoutes.length} API routes, ${applicationMetadataRoutes.length} metadata routes, and ${middlewareRoutes.length} middleware files`
|
|
6577
6907
|
);
|
|
6578
6908
|
const configuredIntegrationValues = Object.values(config.integrations || {});
|
|
@@ -6582,14 +6912,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6582
6912
|
const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
|
|
6583
6913
|
(integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
|
|
6584
6914
|
);
|
|
6585
|
-
const hasIntegrationProviders =
|
|
6915
|
+
const hasIntegrationProviders = _chunk6DBBMQWTcjs.getIntegrationProviders.call(void 0, config.integrations).some(
|
|
6586
6916
|
(provider) => provider.component || provider.type === "clerk"
|
|
6587
6917
|
);
|
|
6588
6918
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
6589
|
-
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access',
|
|
6590
|
-
const hasMiddlewareConfig =
|
|
6591
|
-
const hasRouteContextConfig =
|
|
6592
|
-
const hasServerRuntimePlugins =
|
|
6919
|
+
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _136 => _136.mdx, 'optionalAccess', _137 => _137.components]));
|
|
6920
|
+
const hasMiddlewareConfig = _chunkXGDI4OUBcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
6921
|
+
const hasRouteContextConfig = _chunkNPGXX7HNcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
6922
|
+
const hasServerRuntimePlugins = _chunkHVJ7IACBcjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
|
|
6593
6923
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
6594
6924
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
6595
6925
|
const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasFarmServerStorageConfig(config.storage) || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
|
|
@@ -6598,9 +6928,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6598
6928
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
6599
6929
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
6600
6930
|
);
|
|
6601
|
-
if (
|
|
6931
|
+
if (_chunkZPCZWEU3cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
6602
6932
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
6603
|
-
|
|
6933
|
+
_chunkZPCZWEU3cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
6604
6934
|
config.docs,
|
|
6605
6935
|
{ root, srcDir: config.srcDir },
|
|
6606
6936
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
@@ -6608,9 +6938,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6608
6938
|
);
|
|
6609
6939
|
}
|
|
6610
6940
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
6611
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access',
|
|
6941
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _138 => _138.docs, 'optionalAccess', _139 => _139.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunk2RSVYJT6cjs._runWithFarmCspNonce.call(void 0,
|
|
6612
6942
|
farmDocsCspNonceMarker,
|
|
6613
|
-
async () => _optionalChain([config, 'access',
|
|
6943
|
+
async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await _chunkZPCZWEU3cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
6614
6944
|
root,
|
|
6615
6945
|
srcDir: config.srcDir,
|
|
6616
6946
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -6724,7 +7054,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6724
7054
|
// Adapters can render provider scripts by serializing function source.
|
|
6725
7055
|
// keepNames injects helper calls into those functions; after Nitro
|
|
6726
7056
|
// minifies the server chunk the helper is no longer in script scope.
|
|
6727
|
-
keepNames: !(_optionalChain([config, 'access',
|
|
7057
|
+
keepNames: !(_optionalChain([config, 'access', _143 => _143.docs, 'optionalAccess', _144 => _144.enabled]) && _optionalChain([config, 'access', _145 => _145.docs, 'access', _146 => _146.adapter, 'optionalAccess', _147 => _147.server])),
|
|
6728
7058
|
jsxDev: false
|
|
6729
7059
|
},
|
|
6730
7060
|
// SSR configuration to externalize problematic modules
|
|
@@ -6774,10 +7104,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6774
7104
|
define: {
|
|
6775
7105
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
6776
7106
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
6777
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
7107
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _148 => _148.env, 'optionalAccess', _149 => _149.public]) || {})
|
|
6778
7108
|
},
|
|
6779
7109
|
plugins: [
|
|
6780
|
-
|
|
7110
|
+
_chunkIK33N2ANcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6781
7111
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
6782
7112
|
...rendererVitePlugins,
|
|
6783
7113
|
...config.vite.plugins || [],
|
|
@@ -6798,7 +7128,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6798
7128
|
createVercelOgFontInlinePlugin(edgeMetadataImageRuntime.runtime)
|
|
6799
7129
|
] : [],
|
|
6800
7130
|
{ ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
|
|
6801
|
-
farmServerOnlyEntriesPlugin(),
|
|
7131
|
+
farmServerOnlyEntriesPlugin({ distDir: config.distDir || ".farm" }),
|
|
6802
7132
|
farmIslandContainersPlugin(config),
|
|
6803
7133
|
farmPlugin(
|
|
6804
7134
|
{
|
|
@@ -6808,7 +7138,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6808
7138
|
},
|
|
6809
7139
|
pluginManager
|
|
6810
7140
|
),
|
|
6811
|
-
|
|
7141
|
+
_chunkJNZDTE75cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
6812
7142
|
...hasRuntimeConfigModule ? [
|
|
6813
7143
|
farmStripPlatformConfigPlugin(
|
|
6814
7144
|
[
|
|
@@ -6820,7 +7150,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6820
7150
|
{
|
|
6821
7151
|
name: "farm-virtual-ssr-entry",
|
|
6822
7152
|
resolveId: {
|
|
6823
|
-
filter: { id:
|
|
7153
|
+
filter: { id: _chunkIK33N2ANcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
6824
7154
|
handler(id) {
|
|
6825
7155
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
6826
7156
|
return virtualEntryId;
|
|
@@ -6829,7 +7159,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6829
7159
|
}
|
|
6830
7160
|
},
|
|
6831
7161
|
load: {
|
|
6832
|
-
filter: { id:
|
|
7162
|
+
filter: { id: _chunkIK33N2ANcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
6833
7163
|
handler(id) {
|
|
6834
7164
|
if (id === virtualEntryId) {
|
|
6835
7165
|
return virtualEntryCode;
|
|
@@ -6861,7 +7191,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6861
7191
|
resolve: {
|
|
6862
7192
|
alias: [
|
|
6863
7193
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
6864
|
-
...Object.entries(
|
|
7194
|
+
...Object.entries(_chunkIK33N2ANcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
6865
7195
|
([find, replacement]) => ({ find, replacement })
|
|
6866
7196
|
)
|
|
6867
7197
|
],
|
|
@@ -6869,7 +7199,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6869
7199
|
dedupe: [...config.renderer.dedupe || []]
|
|
6870
7200
|
}
|
|
6871
7201
|
};
|
|
6872
|
-
await viteBuild(
|
|
7202
|
+
await viteBuild(_chunkIK33N2ANcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
6873
7203
|
} finally {
|
|
6874
7204
|
if (postcssConfigDir) {
|
|
6875
7205
|
try {
|
|
@@ -6905,26 +7235,26 @@ function readFarmPageLastModified(pageRoutes) {
|
|
|
6905
7235
|
return lastModified;
|
|
6906
7236
|
}
|
|
6907
7237
|
function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
6908
|
-
if (!_optionalChain([config, 'access',
|
|
7238
|
+
if (!_optionalChain([config, 'access', _150 => _150.docs, 'optionalAccess', _151 => _151.enabled])) return [];
|
|
6909
7239
|
const options = { root: config.root, srcDir: config.srcDir };
|
|
6910
7240
|
const guards = {
|
|
6911
7241
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
6912
7242
|
middlewareRoutes
|
|
6913
7243
|
};
|
|
6914
|
-
return
|
|
6915
|
-
(docsRoot) =>
|
|
6916
|
-
).flatMap((page) => [page.href,
|
|
7244
|
+
return _chunk6D3CJFNUcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
|
|
7245
|
+
(docsRoot) => _chunk6D3CJFNUcjs.discoverFarmDocsPages.call(void 0, _chunk6D3CJFNUcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
|
|
7246
|
+
).flatMap((page) => [page.href, _chunk6D3CJFNUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkXGDI4OUBcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
6917
7247
|
}
|
|
6918
7248
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
6919
|
-
const llmsTxt = _optionalChain([agent, 'optionalAccess',
|
|
7249
|
+
const llmsTxt = _optionalChain([agent, 'optionalAccess', _152 => _152.llmsTxt]);
|
|
6920
7250
|
const ownedByFile = (kind) => applicationMetadataRoutes.some(
|
|
6921
7251
|
(metadata) => metadata.kind === kind && metadata.pattern === "/"
|
|
6922
7252
|
);
|
|
6923
7253
|
return [
|
|
6924
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
6925
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
6926
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
6927
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
7254
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _153 => _153.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
|
|
7255
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _154 => _154.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
|
|
7256
|
+
..._optionalChain([agent, 'optionalAccess', _155 => _155.sitemap, 'optionalAccess', _156 => _156.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
|
|
7257
|
+
..._optionalChain([agent, 'optionalAccess', _157 => _157.crawlers, 'optionalAccess', _158 => _158.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
|
|
6928
7258
|
];
|
|
6929
7259
|
}
|
|
6930
7260
|
function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
@@ -6935,7 +7265,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
|
6935
7265
|
docsPath: ${root}.entry,
|
|
6936
7266
|
contentDir: ${root}.contentDir || ${root}.config?.contentDir,
|
|
6937
7267
|
}`;
|
|
6938
|
-
if (_optionalChain([docs, 'optionalAccess',
|
|
7268
|
+
if (_optionalChain([docs, 'optionalAccess', _159 => _159.roots, 'optionalAccess', _160 => _160.length])) {
|
|
6939
7269
|
return {
|
|
6940
7270
|
factory: "createFarmDocsAdapterMultiRuntimeHandler",
|
|
6941
7271
|
config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => (${runtimeConfig("farmDocsRoot")}))`
|
|
@@ -6948,7 +7278,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
|
6948
7278
|
}
|
|
6949
7279
|
function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
6950
7280
|
if (!docs.enabled) return "null";
|
|
6951
|
-
const serializableDocs = _optionalChain([docs, 'access',
|
|
7281
|
+
const serializableDocs = _optionalChain([docs, 'access', _161 => _161.roots, 'optionalAccess', _162 => _162.length]) ? {
|
|
6952
7282
|
...docs,
|
|
6953
7283
|
// React elements and functions do not survive JSON; see runtimeConfig below.
|
|
6954
7284
|
roots: docs.roots.map((docsRoot) => ({ ...docsRoot, runtimeConfig: void 0 }))
|
|
@@ -6982,7 +7312,7 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
|
6982
7312
|
},
|
|
6983
7313
|
}
|
|
6984
7314
|
: ${JSON.stringify({ ...serializableDocs, runtimeConfig: void 0 })}`;
|
|
6985
|
-
if (!_optionalChain([docs, 'access',
|
|
7315
|
+
if (!_optionalChain([docs, 'access', _163 => _163.roots, 'optionalAccess', _164 => _164.length])) return expression;
|
|
6986
7316
|
return `((farmDocs) => ({
|
|
6987
7317
|
...farmDocs,
|
|
6988
7318
|
roots: farmDocs.roots.map((farmDocsRoot, index) => {
|
|
@@ -6999,7 +7329,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
|
|
|
6999
7329
|
return JSON.stringify(modulePath.replace(/\\/g, "/"));
|
|
7000
7330
|
}
|
|
7001
7331
|
function generateNativeAuthIntegrationSource(auth) {
|
|
7002
|
-
if (_optionalChain([auth, 'optionalAccess',
|
|
7332
|
+
if (_optionalChain([auth, 'optionalAccess', _165 => _165.enabled]) !== true) {
|
|
7003
7333
|
return { importSource: "", registerSource: "" };
|
|
7004
7334
|
}
|
|
7005
7335
|
return {
|
|
@@ -7162,6 +7492,10 @@ function useFarmNodePageResponse(ResponseClass) {
|
|
|
7162
7492
|
// Web body the way reading response.body would.
|
|
7163
7493
|
const farmLazyBufferedHtml = new WeakMap();
|
|
7164
7494
|
|
|
7495
|
+
// Bind the stored shell to the response Farm built from it. A body replacement
|
|
7496
|
+
// gets a new response and takes the ordinary scan path.
|
|
7497
|
+
const farmPreloadShells = new WeakMap();
|
|
7498
|
+
|
|
7165
7499
|
function hasFarmContentType(headers) {
|
|
7166
7500
|
if (!headers) return false;
|
|
7167
7501
|
if (typeof headers.has === "function") return headers.has("content-type");
|
|
@@ -7269,7 +7603,8 @@ async function applyFarmPreloadBudget(response, pathname, request) {
|
|
|
7269
7603
|
// formatting), but do not consume and re-encode a proven preload-free body.
|
|
7270
7604
|
const ownedHtml = hasNoHtmlPreloads ? undefined : getFarmOwnedBufferedHtml(response);
|
|
7271
7605
|
const html = hasNoHtmlPreloads ? "" : (ownedHtml ?? await response.text());
|
|
7272
|
-
const managed = manageFarmDocumentPreloads(html, linkHeader, farmPreloadConfig
|
|
7606
|
+
const managed = manageFarmDocumentPreloads(html, linkHeader, farmPreloadConfig,
|
|
7607
|
+
ownedHtml === undefined ? undefined : farmPreloadShells.get(response));
|
|
7273
7608
|
// A remembered document the budget left unchanged keeps its unread body.
|
|
7274
7609
|
const reusesBody = hasNoHtmlPreloads || (ownedHtml !== undefined && managed.html === html);
|
|
7275
7610
|
if (ownedHtml !== undefined && !reusesBody && !isLazyPage) {
|
|
@@ -7301,7 +7636,7 @@ function generateFarmRendererAppSetupServerCode(config) {
|
|
|
7301
7636
|
const appSetupPath = _chunk67MZTLTFcjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
|
|
7302
7637
|
if (!appSetupPath) return "";
|
|
7303
7638
|
return `
|
|
7304
|
-
import __farmAppSetup from ${JSON.stringify(
|
|
7639
|
+
import __farmAppSetup from ${JSON.stringify(_chunkGC5ROI3Acjs.toPosixPath.call(void 0, appSetupPath))};
|
|
7305
7640
|
if (typeof ReactDOMServer.configureApp !== "function") {
|
|
7306
7641
|
throw new Error(${JSON.stringify(`Renderer \`${config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`)});
|
|
7307
7642
|
}
|
|
@@ -7309,26 +7644,30 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
|
7309
7644
|
}
|
|
7310
7645
|
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
|
|
7311
7646
|
const farmRendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
7312
|
-
const
|
|
7313
|
-
|
|
7647
|
+
const searchPreserveRoutes = pageRoutes.flatMap(
|
|
7648
|
+
(route) => route.searchPreserve ? [route.searchPreserve] : []
|
|
7649
|
+
);
|
|
7650
|
+
const searchPreserveRoutesSource = searchPreserveRoutes.length > 0 ? JSON.stringify(searchPreserveRoutes) : "";
|
|
7651
|
+
const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _166 => _166.experimental, 'optionalAccess', _167 => _167.serverComponents])) === "islands";
|
|
7652
|
+
const farmClientBoot = _chunkIK33N2ANcjs.canBootFarmIslandsClient.call(void 0, config);
|
|
7314
7653
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
7315
7654
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
7316
7655
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
7317
|
-
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access',
|
|
7656
|
+
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _168 => _168.agent, 'optionalAccess', _169 => _169.crawlers, 'optionalAccess', _170 => _170.enabled])) && !applicationMetadataRoutes.some(
|
|
7318
7657
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
7319
7658
|
);
|
|
7320
|
-
const servesAgentSitemap = Boolean(_optionalChain([config, 'access',
|
|
7659
|
+
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _171 => _171.agent, 'optionalAccess', _172 => _172.sitemap, 'optionalAccess', _173 => _173.enabled])) && !applicationMetadataRoutes.some(
|
|
7321
7660
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
7322
7661
|
);
|
|
7323
|
-
const servesDefaultMCP = _optionalChain([config, 'access',
|
|
7324
|
-
const servesAiCatalog = _optionalChain([config, 'access',
|
|
7662
|
+
const servesDefaultMCP = _optionalChain([config, 'access', _174 => _174.agent, 'optionalAccess', _175 => _175.mcp]) === true && !_chunkYRXPDKMMcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
|
|
7663
|
+
const servesAiCatalog = _optionalChain([config, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.aiCatalog]) !== false;
|
|
7325
7664
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
7326
7665
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
7327
7666
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
7328
7667
|
const adapterOwnsDocsRuntime = Boolean(
|
|
7329
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access',
|
|
7668
|
+
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) && _optionalChain([config, 'access', _180 => _180.docs, 'access', _181 => _181.adapter, 'optionalAccess', _182 => _182.server]) && config.docs.adapter.react
|
|
7330
7669
|
);
|
|
7331
|
-
if (_optionalChain([config, 'access',
|
|
7670
|
+
if (_optionalChain([config, 'access', _183 => _183.docs, 'optionalAccess', _184 => _184.enabled]) && _optionalChain([config, 'access', _185 => _185.docs, 'access', _186 => _186.roots, 'optionalAccess', _187 => _187.length]) && !adapterOwnsDocsRuntime) {
|
|
7332
7671
|
throw new Error(
|
|
7333
7672
|
"Several docs roots need the docs adapter, which serves the React renderer only; Farm's built-in docs renderer serves a single docs root."
|
|
7334
7673
|
);
|
|
@@ -7342,7 +7681,8 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
7342
7681
|
);
|
|
7343
7682
|
const hasReactSyncRender = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer);
|
|
7344
7683
|
const rendererServerImports = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
|
|
7345
|
-
import * as ReactDOMServer from "react-dom/server"
|
|
7684
|
+
import * as ReactDOMServer from "react-dom/server";
|
|
7685
|
+
import { markPagePosition, markLayoutPosition } from "@farm.js/core/internal/production-runtime";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage, renderFarmServerTreeLayout, withFarmIslandsRender } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : `import React, * as ReactDOMServer from ${JSON.stringify(config.renderer.server)};${generateFarmRendererAppSetupServerCode(config)}`;
|
|
7346
7686
|
const routeClientGraphServerRuntime = hasIsolatedClientGraphRuntime ? `function wrapFarmRouteClientGraph(element) {
|
|
7347
7687
|
return wrapFarmIsolatedClientGraph(React, element);
|
|
7348
7688
|
}
|
|
@@ -7378,9 +7718,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7378
7718
|
(image) => image.sourceType === "module"
|
|
7379
7719
|
);
|
|
7380
7720
|
const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
|
|
7381
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
7382
|
-
const farmDocsFontAssets = _optionalChain([config, 'access',
|
|
7383
|
-
const integrationProviders =
|
|
7721
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkXGDI4OUBcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
7722
|
+
const farmDocsFontAssets = _optionalChain([config, 'access', _188 => _188.docs, 'optionalAccess', _189 => _189.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
7723
|
+
const integrationProviders = _chunk6DBBMQWTcjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
7384
7724
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
7385
7725
|
(provider) => provider.component || provider.type === "clerk"
|
|
7386
7726
|
);
|
|
@@ -7389,16 +7729,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7389
7729
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
7390
7730
|
);
|
|
7391
7731
|
}
|
|
7392
|
-
const providerServerModules =
|
|
7732
|
+
const providerServerModules = _chunkIK33N2ANcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
7393
7733
|
renderedIntegrationProviders,
|
|
7394
7734
|
config.root,
|
|
7395
7735
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
7396
7736
|
);
|
|
7397
7737
|
const resolvedIntegrationProviderFallback = Object.fromEntries(
|
|
7398
7738
|
Object.entries(config.integrations).flatMap(([name, integration]) => {
|
|
7399
|
-
const configuredProviders = _optionalChain([integration, 'optionalAccess',
|
|
7739
|
+
const configuredProviders = _optionalChain([integration, 'optionalAccess', _190 => _190.providers]);
|
|
7400
7740
|
const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
|
|
7401
|
-
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess',
|
|
7741
|
+
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _191 => _191.component]) === "function")) {
|
|
7402
7742
|
throw new Error(
|
|
7403
7743
|
`Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
|
|
7404
7744
|
);
|
|
@@ -7409,22 +7749,22 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7409
7749
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
7410
7750
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
7411
7751
|
);
|
|
7412
|
-
const isolatedHydrationMode =
|
|
7413
|
-
_optionalChain([config, 'access',
|
|
7752
|
+
const isolatedHydrationMode = _chunkJNZDTE75cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
7753
|
+
_optionalChain([config, 'access', _192 => _192.experimental, 'optionalAccess', _193 => _193.isolatedClientHydration]),
|
|
7414
7754
|
{
|
|
7415
|
-
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
7755
|
+
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _194 => _194.experimental, 'optionalAccess', _195 => _195.serverComponents])) === "rsc",
|
|
7416
7756
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
7417
7757
|
}
|
|
7418
7758
|
);
|
|
7419
|
-
const hydrationPlanOptions =
|
|
7759
|
+
const hydrationPlanOptions = _chunkJNZDTE75cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
7420
7760
|
config.renderer,
|
|
7421
7761
|
Boolean(unsupportedIntegrationProvider)
|
|
7422
7762
|
);
|
|
7423
7763
|
const pageHydrationPlanOptions = {
|
|
7424
7764
|
...hydrationPlanOptions,
|
|
7425
|
-
serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
7765
|
+
serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _196 => _196.experimental, 'optionalAccess', _197 => _197.serverComponents])) === "islands"
|
|
7426
7766
|
};
|
|
7427
|
-
const { layoutHydrationPlans, pageHydrationPlans } =
|
|
7767
|
+
const { layoutHydrationPlans, pageHydrationPlans } = _chunkJNZDTE75cjs.withFarmSourceSnapshot.call(void 0, () => {
|
|
7428
7768
|
const layoutHydrationPlans2 = layoutRoutes.map((layout) => ({
|
|
7429
7769
|
...layout,
|
|
7430
7770
|
hydration: getCachedClientModuleHydrationPlan(
|
|
@@ -7435,7 +7775,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7435
7775
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
7436
7776
|
)
|
|
7437
7777
|
}));
|
|
7438
|
-
const markdownPagePlan =
|
|
7778
|
+
const markdownPagePlan = _chunkJNZDTE75cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
7439
7779
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
7440
7780
|
config.root,
|
|
7441
7781
|
isolatedHydrationMode,
|
|
@@ -7444,7 +7784,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7444
7784
|
const pageHydrationPlans2 = new Map(
|
|
7445
7785
|
pageRoutes.map((route) => [
|
|
7446
7786
|
route.modulePath,
|
|
7447
|
-
|
|
7787
|
+
_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
7448
7788
|
route.modulePath,
|
|
7449
7789
|
config.root,
|
|
7450
7790
|
isolatedHydrationMode,
|
|
@@ -7455,7 +7795,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7455
7795
|
);
|
|
7456
7796
|
return { layoutHydrationPlans: layoutHydrationPlans2, pageHydrationPlans: pageHydrationPlans2 };
|
|
7457
7797
|
});
|
|
7458
|
-
|
|
7798
|
+
_chunkJNZDTE75cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
7459
7799
|
layoutHydrationPlans.map((layout) => ({
|
|
7460
7800
|
pattern: layout.pattern,
|
|
7461
7801
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -7464,10 +7804,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7464
7804
|
pageRoutes.map((route) => ({
|
|
7465
7805
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
7466
7806
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
7467
|
-
depth:
|
|
7807
|
+
depth: _chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
7468
7808
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
7469
7809
|
})),
|
|
7470
|
-
|
|
7810
|
+
_chunkXGDI4OUBcjs.routeBoundaryCoversDirectory,
|
|
7471
7811
|
{ serverOwners: pageHydrationPlanOptions.serverOwners }
|
|
7472
7812
|
);
|
|
7473
7813
|
const providerServerImports = [
|
|
@@ -7485,7 +7825,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7485
7825
|
apiRegistrations.push(`
|
|
7486
7826
|
{
|
|
7487
7827
|
path: ${JSON.stringify(route.path)},
|
|
7488
|
-
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access',
|
|
7828
|
+
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _198 => _198.pluginMethods, 'optionalAccess', _199 => _199.includes, 'call', _200 => _200(method)])))},
|
|
7489
7829
|
endpoints: ${varName},
|
|
7490
7830
|
}`);
|
|
7491
7831
|
});
|
|
@@ -7493,14 +7833,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7493
7833
|
const pageRegistrations = [];
|
|
7494
7834
|
const hasMarkdownPages = pageRoutes.some((route) => route.source !== void 0);
|
|
7495
7835
|
const orderedPageRoutes = pageRoutes.map((route, index) => ({ route, index })).sort((left, right) => {
|
|
7496
|
-
const order =
|
|
7836
|
+
const order = _chunkML4TOUZPcjs.compareRoutePatternSpecificity.call(void 0, left.route.pattern, right.route.pattern);
|
|
7497
7837
|
return order || left.index - right.index;
|
|
7498
7838
|
}).map(({ route }) => route);
|
|
7499
7839
|
orderedPageRoutes.forEach((route, index) => {
|
|
7500
7840
|
const varName = `pageRoute${index}`;
|
|
7501
|
-
if (
|
|
7502
|
-
const renderingDirective2 =
|
|
7503
|
-
const markdownServerTree = pageHydrationPlanOptions.serverOwners &&
|
|
7841
|
+
if (_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
7842
|
+
const renderingDirective2 = _chunk7564NP5Zcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
7843
|
+
const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkJNZDTE75cjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
|
|
7504
7844
|
pageRegistrations.push(`
|
|
7505
7845
|
{
|
|
7506
7846
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -7508,14 +7848,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7508
7848
|
rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
|
|
7509
7849
|
module: createFarmMarkdownRouteModule({
|
|
7510
7850
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
7511
|
-
filePath: ${JSON.stringify(toBakedMarkdownSourcePath(config.root, route.modulePath))},
|
|
7851
|
+
filePath: ${JSON.stringify(_chunkIK33N2ANcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
|
|
7512
7852
|
components: farmMdxComponents,
|
|
7513
7853
|
config: farmMdxConfig,
|
|
7514
7854
|
}),
|
|
7515
7855
|
markdownSource: {
|
|
7516
7856
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
7517
7857
|
filePath: ${JSON.stringify(
|
|
7518
|
-
toBakedMarkdownSourcePath(config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
|
|
7858
|
+
_chunkIK33N2ANcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
|
|
7519
7859
|
)},
|
|
7520
7860
|
},
|
|
7521
7861
|
}`);
|
|
@@ -7525,16 +7865,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7525
7865
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
7526
7866
|
);
|
|
7527
7867
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
7528
|
-
const renderingDirective =
|
|
7868
|
+
const renderingDirective = _chunk7564NP5Zcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
7529
7869
|
pageRegistrations.push(`
|
|
7530
7870
|
{
|
|
7531
7871
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
7532
7872
|
directory: ${JSON.stringify(route.directory)},` : ""}
|
|
7533
7873
|
module: ${varName},
|
|
7534
7874
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
7535
|
-
clientModule: ${JSON.stringify(
|
|
7536
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
7537
|
-
const rootStrategy =
|
|
7875
|
+
clientModule: ${JSON.stringify(_chunkGC5ROI3Acjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
7876
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkJNZDTE75cjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
7877
|
+
const rootStrategy = _chunkIK33N2ANcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
7538
7878
|
route,
|
|
7539
7879
|
clientMetadata,
|
|
7540
7880
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -7547,13 +7887,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7547
7887
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
7548
7888
|
${route.source !== void 0 ? `markdownSource: {
|
|
7549
7889
|
source: ${JSON.stringify(route.source)},
|
|
7550
|
-
filePath: ${JSON.stringify(toBakedMarkdownSourcePath(config.root, route.markdownSourcePath))},
|
|
7890
|
+
filePath: ${JSON.stringify(_chunkIK33N2ANcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
|
|
7551
7891
|
},` : ""}
|
|
7552
7892
|
}`);
|
|
7553
7893
|
});
|
|
7554
7894
|
const layoutImports = [];
|
|
7555
7895
|
const layoutRegistrations = [];
|
|
7556
|
-
const treeLayoutPatterns = farmIslandsMode ?
|
|
7896
|
+
const treeLayoutPatterns = farmIslandsMode ? _chunkXGDI4OUBcjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
7557
7897
|
layoutHydrationPlans.map((layout) => ({
|
|
7558
7898
|
pattern: layout.pattern,
|
|
7559
7899
|
shouldHydrate: layout.hydration.shouldHydrate,
|
|
@@ -7571,7 +7911,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7571
7911
|
pattern: ${JSON.stringify(layout.pattern)},
|
|
7572
7912
|
module: ${varName},
|
|
7573
7913
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
|
|
7574
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}
|
|
7914
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkIK33N2ANcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
|
|
7915
|
+
// isolatedClientHydration, or an async layout): it wraps a docs page as an app page.
|
|
7916
|
+
clientMetadata.hasIsolatedClientBoundaries ? "\n islands: true," : ""}
|
|
7575
7917
|
}`);
|
|
7576
7918
|
});
|
|
7577
7919
|
const slotOwnerCounts = new Map(routeSlots.map((slot) => [slot.ownerPattern, 0]));
|
|
@@ -7597,7 +7939,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7597
7939
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
7598
7940
|
interception: ${JSON.stringify(slot.interception)},
|
|
7599
7941
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
7600
|
-
hydrates: ${!farmIslandsMode ||
|
|
7942
|
+
hydrates: ${!farmIslandsMode || _chunkJNZDTE75cjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
7601
7943
|
module: ${varName},
|
|
7602
7944
|
}`);
|
|
7603
7945
|
});
|
|
@@ -7608,12 +7950,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7608
7950
|
errorImports.push(
|
|
7609
7951
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
7610
7952
|
);
|
|
7611
|
-
const groupScope =
|
|
7953
|
+
const groupScope = _chunkXGDI4OUBcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
7612
7954
|
errorRegistrations.push(`
|
|
7613
7955
|
{
|
|
7614
|
-
pattern: ${JSON.stringify(
|
|
7956
|
+
pattern: ${JSON.stringify(_chunkXGDI4OUBcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
7615
7957
|
groupScope: ${JSON.stringify(groupScope)},
|
|
7616
|
-
directoryDepth: ${
|
|
7958
|
+
directoryDepth: ${_chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
7617
7959
|
module: ${varName},
|
|
7618
7960
|
}`);
|
|
7619
7961
|
});
|
|
@@ -7625,12 +7967,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7625
7967
|
loadingImports.push(
|
|
7626
7968
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
|
|
7627
7969
|
);
|
|
7628
|
-
const groupScope =
|
|
7970
|
+
const groupScope = _chunkXGDI4OUBcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
|
|
7629
7971
|
loadingRegistrations.push(`
|
|
7630
7972
|
{
|
|
7631
|
-
pattern: ${JSON.stringify(
|
|
7973
|
+
pattern: ${JSON.stringify(_chunkXGDI4OUBcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
|
|
7632
7974
|
groupScope: ${JSON.stringify(groupScope)},
|
|
7633
|
-
directoryDepth: ${
|
|
7975
|
+
directoryDepth: ${_chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
|
|
7634
7976
|
module: ${varName},
|
|
7635
7977
|
}`);
|
|
7636
7978
|
});
|
|
@@ -7687,6 +8029,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7687
8029
|
const notFoundImport = notFoundPath ? `import * as CustomNotFound from ${toVirtualEntryImportSpecifier(notFoundPath)};` : "";
|
|
7688
8030
|
const apiRouteHelpersImport = apiRoutes.length > 0 ? `import { mergePluginAPIRoutes, getAllowedAPIRouteMethods, invokeAPIRouteEndpoint, createStaticAPIRouteMatcherAtBasePath, resolveAPIRouteEndpoint } from "@farm.js/core/api/runtime";` : "";
|
|
7689
8031
|
const productionRuntimeImport = `import {
|
|
8032
|
+
_getRequestCookieReadCount,
|
|
7690
8033
|
_getRequestReadCount,
|
|
7691
8034
|
_runWithAfterRequest,
|
|
7692
8035
|
_resolveCurrentCspNonce,
|
|
@@ -7716,7 +8059,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7716
8059
|
createDefaultErrorMarkup,
|
|
7717
8060
|
createFarmInstrumentationLifecycle,
|
|
7718
8061
|
createFarmLayoutSelector,
|
|
8062
|
+
createFarmLayoutBoundary,${_optionalChain([config, 'access', _201 => _201.docs, 'optionalAccess', _202 => _202.enabled]) ? "\n createFarmDocsLayoutTree,\n farmDocsLayoutsWrapPage,\n placeFarmDocsLayoutRoot," : ""}
|
|
7719
8063
|
isInFarmRouteGroupScope,
|
|
8064
|
+
routeBoundaryCoversDirectory,
|
|
7720
8065
|
createFarmCacheKey,
|
|
7721
8066
|
createFarmMetadataRouteResponse,
|
|
7722
8067
|
createFarmAgentRobots,
|
|
@@ -7797,7 +8142,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7797
8142
|
createFarmDeploymentMismatchResponse,
|
|
7798
8143
|
FARM_DEPLOYMENT_ID_HEADER,
|
|
7799
8144
|
getFarmDeploymentMismatch,
|
|
7800
|
-
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access',
|
|
8145
|
+
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _203 => _203.md, 'optionalAccess', _204 => _204.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}${searchPreserveRoutesSource ? "\n _setFarmSearchPreserveRoutes," : ""}
|
|
7801
8146
|
} from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
|
|
7802
8147
|
import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
|
|
7803
8148
|
// The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
|
|
@@ -7854,7 +8199,7 @@ function resolveFarmMobileShellRender(request, route, routePathname) {
|
|
|
7854
8199
|
import { getFarmFormState as farmFormState, getSharedLayoutPrefixLength, handleFarmFormActionRequest, ignoreFarmHeldValues, installFarmIslandValues, parseFarmLayoutChainHeader, renderFarmFormStateScript as farmFormStateScript } from "@farm.js/core/internal/production-runtime";
|
|
7855
8200
|
import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server";
|
|
7856
8201
|
installFarmIslandsServer();
|
|
7857
|
-
const farmFormActionsConfig = ${JSON.stringify(
|
|
8202
|
+
const farmFormActionsConfig = ${JSON.stringify(_chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
|
|
7858
8203
|
installFarmIslandValues();
|
|
7859
8204
|
${islandsActionKeyCode()}
|
|
7860
8205
|
${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : `
|
|
@@ -7866,25 +8211,25 @@ function farmFormStateScript() { return ""; }`}`;
|
|
|
7866
8211
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
7867
8212
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
7868
8213
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
7869
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
8214
|
+
const docsHandlerImport = _optionalChain([config, 'access', _205 => _205.docs, 'optionalAccess', _206 => _206.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
7870
8215
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
7871
8216
|
const pathname = typeof requestOrPathname === "string"
|
|
7872
8217
|
? requestOrPathname
|
|
7873
8218
|
: new URL(requestOrPathname.url).pathname;
|
|
7874
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
8219
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _207 => _207.apiPath]) || "/api/docs")};
|
|
7875
8220
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
7876
8221
|
};` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
7877
|
-
import { ${_optionalChain([config, 'access',
|
|
8222
|
+
import { ${_optionalChain([config, 'access', _208 => _208.docs, 'access', _209 => _209.roots, 'optionalAccess', _210 => _210.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
|
|
7878
8223
|
import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
|
|
7879
8224
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
7880
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
7881
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
8225
|
+
const docsFontImport = _optionalChain([config, 'access', _211 => _211.docs, 'optionalAccess', _212 => _212.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
8226
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _213 => _213.docs, 'optionalAccess', _214 => _214.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
7882
8227
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
7883
8228
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
7884
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
8229
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _215 => _215.md, 'optionalAccess', _216 => _216.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
7885
8230
|
const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
|
|
7886
8231
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
7887
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
8232
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _217 => _217.mdx, 'optionalAccess', _218 => _218.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
7888
8233
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
7889
8234
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
7890
8235
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -7904,14 +8249,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
7904
8249
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
7905
8250
|
const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
7906
8251
|
const mobileSession = (config.plugins || []).some(
|
|
7907
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
8252
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _219 => _219.name]) === _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN
|
|
7908
8253
|
);
|
|
7909
8254
|
const nativeServerFns = (config.plugins || []).some(
|
|
7910
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
7911
|
-
) ?
|
|
8255
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _220 => _220.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
8256
|
+
) ? _chunkBNTRXJL4cjs.collectFarmNativeServerFns.call(void 0, {
|
|
7912
8257
|
root: config.root,
|
|
7913
8258
|
srcDir: config.srcDir,
|
|
7914
|
-
entries:
|
|
8259
|
+
entries: _chunkBNTRXJL4cjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
|
|
7915
8260
|
}) : void 0;
|
|
7916
8261
|
const integrationImports = `
|
|
7917
8262
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -7926,7 +8271,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
7926
8271
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
7927
8272
|
});` : ""}
|
|
7928
8273
|
`;
|
|
7929
|
-
const imageRuntime =
|
|
8274
|
+
const imageRuntime = _chunkIK33N2ANcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
7930
8275
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
7931
8276
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
7932
8277
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -8108,7 +8453,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
8108
8453
|
|
|
8109
8454
|
function renderFarmDefault404Page() {
|
|
8110
8455
|
return React.createElement(React.Fragment, null,
|
|
8111
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
8456
|
+
React.createElement("style", null, ${JSON.stringify(_chunkIK33N2ANcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
8112
8457
|
React.createElement("main", {
|
|
8113
8458
|
className: "farm-default-not-found",
|
|
8114
8459
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -8207,7 +8552,7 @@ const serverRuntimeIntegrations = Object.fromEntries(
|
|
|
8207
8552
|
);
|
|
8208
8553
|
const integrationRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs, {
|
|
8209
8554
|
integrations: configuredIntegrations,
|
|
8210
|
-
${JSON.stringify(
|
|
8555
|
+
${JSON.stringify(_chunkQKW6DLDTcjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
|
|
8211
8556
|
});
|
|
8212
8557
|
const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? hasPluginRuntime ? "createFarmInfraAnalyticsPlugin()" : "createFarmInfraAnalyticsRecorder()" : "null"};
|
|
8213
8558
|
const configuredPlugins = [
|
|
@@ -8251,24 +8596,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
8251
8596
|
validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
|
|
8252
8597
|
onError(error) { console.error("[Farm Image]", error); },
|
|
8253
8598
|
})`};
|
|
8254
|
-
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access',
|
|
8599
|
+
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _221 => _221.md, 'optionalAccess', _222 => _222.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
|
|
8255
8600
|
// A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
|
|
8256
8601
|
// ('/about/'), so the trailing-slash 308 never answers in its place.
|
|
8257
8602
|
const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
|
|
8258
8603
|
const toFarmMarkdownPageRequest = (request) => request;` : ""}
|
|
8259
|
-
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
8260
|
-
${_optionalChain([config, 'access',
|
|
8604
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _223 => _223.agent, 'optionalAccess', _224 => _224.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
8605
|
+
${_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.llmsTxt, 'optionalAccess', _227 => _227.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
8261
8606
|
const farmMdxConfig = ${JSON.stringify({
|
|
8262
8607
|
...config.mdx,
|
|
8263
|
-
components: typeof _optionalChain([config, 'access',
|
|
8608
|
+
components: typeof _optionalChain([config, 'access', _228 => _228.mdx, 'optionalAccess', _229 => _229.components]) === "string" ? config.mdx.components : void 0
|
|
8264
8609
|
})};
|
|
8265
8610
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
8266
|
-
${_optionalChain([config, 'access',
|
|
8611
|
+
${_optionalChain([config, 'access', _230 => _230.agent, 'optionalAccess', _231 => _231.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
8267
8612
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
8268
8613
|
// to the build.
|
|
8269
8614
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
8270
8615
|
globalThis.process?.env,
|
|
8271
|
-
${JSON.stringify(
|
|
8616
|
+
${JSON.stringify(_chunkKPYQ32BAcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
8272
8617
|
);` : ""}
|
|
8273
8618
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
8274
8619
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -8314,7 +8659,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
8314
8659
|
});
|
|
8315
8660
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
8316
8661
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
8317
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
8662
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _232 => _232.docs, 'optionalAccess', _233 => _233.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
8318
8663
|
try {
|
|
8319
8664
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
8320
8665
|
const candidates = [
|
|
@@ -8326,7 +8671,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _222 => _2
|
|
|
8326
8671
|
} catch {
|
|
8327
8672
|
return null;
|
|
8328
8673
|
}
|
|
8329
|
-
})()` : "null"};${_optionalChain([config, 'access',
|
|
8674
|
+
})()` : "null"};${_optionalChain([config, 'access', _234 => _234.docs, 'optionalAccess', _235 => _235.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _236 => _236.docs, 'access', _237 => _237.roots, 'optionalAccess', _238 => _238.length]) ? `
|
|
8330
8675
|
const farmDocsBundledRootsDir = (() => {
|
|
8331
8676
|
try {
|
|
8332
8677
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
@@ -8378,7 +8723,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
8378
8723
|
),
|
|
8379
8724
|
}
|
|
8380
8725
|
: undefined;
|
|
8381
|
-
const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
8726
|
+
const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, 'optionalAccess', _240 => _240.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
|
|
8382
8727
|
rootDir: farmDocsRuntimeRoot,
|
|
8383
8728
|
// A production build's content cannot change, so the adapter reads its
|
|
8384
8729
|
// navigation once instead of scanning the content directory per request.
|
|
@@ -8399,7 +8744,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _229 => _229.docs, '
|
|
|
8399
8744
|
registerMCPServer: registerFarmMCPServer,
|
|
8400
8745
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
8401
8746
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
8402
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
8747
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunkZPCZWEU3cjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
8403
8748
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
8404
8749
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
8405
8750
|
isPathGuarded: (pathname) =>
|
|
@@ -8425,11 +8770,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _229 => _229.docs, '
|
|
|
8425
8770
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
8426
8771
|
basePath: ${JSON.stringify(config.basePath)},
|
|
8427
8772
|
})` : "null"};
|
|
8428
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
8773
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
|
|
8429
8774
|
|
|
8430
8775
|
// API routes bundled at build time
|
|
8431
8776
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
8432
|
-
]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path:
|
|
8777
|
+
]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path18, methods }) => ({ path: path18, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
|
|
8433
8778
|
// A plugin calling an app endpoint (an MCP tool, say) goes through the whole
|
|
8434
8779
|
// pipeline, so the endpoint's middleware and integration guards run for it.
|
|
8435
8780
|
function dispatchFarmPluginAPIRequest(request) {
|
|
@@ -8451,18 +8796,21 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
8451
8796
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
8452
8797
|
// Deployment skew protection (see the deployment docs): documents embed this ID, page responses
|
|
8453
8798
|
// name it, and a page request from a browser holding another deployment's page is refused.
|
|
8454
|
-
const farmDeploymentId = ${JSON.stringify(config.deploymentId)}
|
|
8799
|
+
const farmDeploymentId = ${JSON.stringify(config.deploymentId)};${searchPreserveRoutesSource ? `
|
|
8800
|
+
// Pages with search.preserve: Farm links render the same href here and in the browser.
|
|
8801
|
+
const farmSearchPreserveRoutes = ${searchPreserveRoutesSource};
|
|
8802
|
+
_setFarmSearchPreserveRoutes(farmSearchPreserveRoutes);` : ""}
|
|
8455
8803
|
const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
|
|
8456
8804
|
// Reports a failure Farm answers itself (an API or integration route's 500) to the plugin
|
|
8457
8805
|
// runtime request.
|
|
8458
8806
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
8459
8807
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
8460
|
-
${_optionalChain([config, 'access',
|
|
8461
|
-
` : ""}${_optionalChain([config, 'access',
|
|
8462
|
-
|
|
8808
|
+
${_optionalChain([config, 'access', _243 => _243.agent, 'optionalAccess', _244 => _244.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkWJ5CCQBMcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
8809
|
+
` : ""}${_optionalChain([config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
8810
|
+
_chunkWJ5CCQBMcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
8463
8811
|
build: config.deploymentId,
|
|
8464
|
-
packages:
|
|
8465
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
8812
|
+
packages: _chunkIK33N2ANcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
8813
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkIK33N2ANcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
8466
8814
|
})
|
|
8467
8815
|
)};
|
|
8468
8816
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -8475,7 +8823,7 @@ farmAppManifestInput.guardCoversPath = (path) =>
|
|
|
8475
8823
|
path,
|
|
8476
8824
|
farmLocalAPIBasePath,
|
|
8477
8825
|
);
|
|
8478
|
-
${_optionalChain([config, 'access',
|
|
8826
|
+
${_optionalChain([config, 'access', _247 => _247.docs, 'optionalAccess', _248 => _248.enabled]) ? `// A docs runtime's MCP server lists its tools when asked over MCP, in process. A build
|
|
8479
8827
|
// can't change them, so they are read once.
|
|
8480
8828
|
if (farmDocsHandler) {
|
|
8481
8829
|
farmAppManifestInput.registeredMCP = (request) =>
|
|
@@ -8577,7 +8925,8 @@ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, page
|
|
|
8577
8925
|
';window.__FARM_INTEGRATION_API_MANIFEST__=' +
|
|
8578
8926
|
serializeFarmInlineValue(integrationManifest) +
|
|
8579
8927
|
';window.__FARM_ROUTE_SLOTS__=' + serializedRouteSlots +
|
|
8580
|
-
';window.__FARM_DEPLOYMENT_ID__=' + serializeFarmInlineValue(farmDeploymentId) + ';'
|
|
8928
|
+
';window.__FARM_DEPLOYMENT_ID__=' + serializeFarmInlineValue(farmDeploymentId) + ';'${searchPreserveRoutesSource ? ` +
|
|
8929
|
+
'window[Symbol.for("farm.searchPreserveRoutes")]=' + serializeFarmInlineValue(farmSearchPreserveRoutes) + ';'` : ""};
|
|
8581
8930
|
// The client boots at the canonical path when the script below moves it there.
|
|
8582
8931
|
const bootRoutes = getFarmClientBootRoutes(
|
|
8583
8932
|
typeof canonicalPath === "string" && canonicalPath.startsWith("/")
|
|
@@ -8669,6 +9018,13 @@ function createFarmFlushToken() {
|
|
|
8669
9018
|
}
|
|
8670
9019
|
|
|
8671
9020
|
async function farmKeptLayoutsRender(ReactDOMServer, layouts, keptCount, params) {
|
|
9021
|
+
// RFC 0007: the build proved these layouts cannot throw or read the request, so rendering them
|
|
9022
|
+
// again would only produce markup the browser already shows.
|
|
9023
|
+
let skip = true;
|
|
9024
|
+
for (let index = 0; index < keptCount; index++) {
|
|
9025
|
+
if (layouts[index].skipKeptRender !== true) skip = false;
|
|
9026
|
+
}
|
|
9027
|
+
if (skip) return true;
|
|
8672
9028
|
let element = null;
|
|
8673
9029
|
for (let index = keptCount - 1; index >= 0; index--) {
|
|
8674
9030
|
const Layout = layouts[index].module.default;
|
|
@@ -9235,7 +9591,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
9235
9591
|
let inner = markup.replace(/^\\s+/, "");
|
|
9236
9592
|
let hoisted = "";
|
|
9237
9593
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
9238
|
-
const hoistable = /${
|
|
9594
|
+
const hoistable = /${_chunkXGDI4OUBcjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
9239
9595
|
let match;
|
|
9240
9596
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
9241
9597
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -9264,7 +9620,7 @@ function opensFarmFullDocument(markup) {
|
|
|
9264
9620
|
// them: its own head takes them. Matches the dev renderer's takeFarmHoistedHead.
|
|
9265
9621
|
function takeFarmHoistedHead(markup) {
|
|
9266
9622
|
if (opensFarmFullDocument(markup)) return { head: "", body: markup };
|
|
9267
|
-
const hoistable = /${
|
|
9623
|
+
const hoistable = /${_chunkXGDI4OUBcjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
9268
9624
|
let head = "";
|
|
9269
9625
|
let body = markup;
|
|
9270
9626
|
let match;
|
|
@@ -9477,6 +9833,7 @@ function renderFarmI18nAlternateLinks(requestPath, snapshot, request, metadata)
|
|
|
9477
9833
|
return renderFarmLocaleAlternateLinks(routePathname, snapshot, {
|
|
9478
9834
|
metadataBase: metadata ? metadata.metadataBase : undefined,
|
|
9479
9835
|
origin: request ? resolveFarmI18nAlternateOrigin(request) : undefined,
|
|
9836
|
+
languages: metadata && metadata.alternates ? metadata.alternates.languages : undefined,
|
|
9480
9837
|
});
|
|
9481
9838
|
}
|
|
9482
9839
|
|
|
@@ -9793,7 +10150,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
9793
10150
|
// its nearest layout's.
|
|
9794
10151
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
9795
10152
|
pageRoutes.map((route) => route.pattern).filter(
|
|
9796
|
-
(pattern) => !pattern.includes("[") &&
|
|
10153
|
+
(pattern) => !pattern.includes("[") && _chunkXGDI4OUBcjs.farmPathGuardCoversPage.call(void 0,
|
|
9797
10154
|
{
|
|
9798
10155
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
9799
10156
|
middlewareRoutes
|
|
@@ -9848,12 +10205,12 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
9848
10205
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
9849
10206
|
// registered at runtime, such as the docs engine's.
|
|
9850
10207
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
9851
|
-
|
|
10208
|
+
_chunkYRXPDKMMcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkIVBDRAORcjs.FARM_VERSION)
|
|
9852
10209
|
)};
|
|
9853
10210
|
let farmDefaultMCPRouteFree;
|
|
9854
10211
|
function getFarmDefaultMCPServer() {
|
|
9855
10212
|
if (farmDefaultMCPRouteFree === undefined) {
|
|
9856
|
-
farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(
|
|
10213
|
+
farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkYRXPDKMMcjs.FARM_DEFAULT_MCP_PATH)});
|
|
9857
10214
|
}
|
|
9858
10215
|
return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
|
|
9859
10216
|
}
|
|
@@ -10042,7 +10399,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
10042
10399
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
10043
10400
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
10044
10401
|
const farmPrerendering =
|
|
10045
|
-
typeof process !== "undefined" && process.env?.${
|
|
10402
|
+
typeof process !== "undefined" && process.env?.${_chunkWHCNJVYUcjs.FARM_PRERENDER_ENV} === "1";
|
|
10046
10403
|
` : ""}
|
|
10047
10404
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
10048
10405
|
config: farmMiddlewareConfig,
|
|
@@ -10186,7 +10543,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
10186
10543
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
10187
10544
|
return true;
|
|
10188
10545
|
}
|
|
10189
|
-
${_optionalChain([config, 'access',
|
|
10546
|
+
${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
10190
10547
|
// The docs answer below the basePath; their API stays at /api/docs, as API routes do.
|
|
10191
10548
|
const docsRoutePathname = stripFarmBasePath(pathname);
|
|
10192
10549
|
if (
|
|
@@ -10214,7 +10571,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
10214
10571
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
10215
10572
|
};
|
|
10216
10573
|
}
|
|
10217
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
10574
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _251 => _251.docs, 'optionalAccess', _252 => _252.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
10218
10575
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
10219
10576
|
pathname,
|
|
10220
10577
|
method: request.method,
|
|
@@ -10298,7 +10655,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
10298
10655
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
10299
10656
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
10300
10657
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
10301
|
-
|
|
10658
|
+
_chunkWJ5CCQBMcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
10302
10659
|
agent: {
|
|
10303
10660
|
...config.agent,
|
|
10304
10661
|
aiCatalog: servesAiCatalog,
|
|
@@ -10309,9 +10666,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
10309
10666
|
openapi: openAPIReference
|
|
10310
10667
|
})
|
|
10311
10668
|
)});
|
|
10312
|
-
${_optionalChain([config, 'access',
|
|
10669
|
+
${_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
10313
10670
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
10314
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
10671
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _255 => _255.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _256 => _256.docs, 'access', _257 => _257.roots, 'optionalAccess', _258 => _258.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
|
|
10315
10672
|
pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
|
|
10316
10673
|
};
|
|
10317
10674
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
@@ -10327,11 +10684,11 @@ function labelFarmRequestOptions(options) {
|
|
|
10327
10684
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
10328
10685
|
return options;
|
|
10329
10686
|
}
|
|
10330
|
-
${_optionalChain([config, 'access',
|
|
10687
|
+
${_optionalChain([config, 'access', _259 => _259.docs, 'optionalAccess', _260 => _260.enabled]) ? `if (options.kind === "docs") {
|
|
10331
10688
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
10332
10689
|
return options;
|
|
10333
10690
|
}` : ""}
|
|
10334
|
-
${_optionalChain([config, 'access',
|
|
10691
|
+
${_optionalChain([config, 'access', _261 => _261.md, 'optionalAccess', _262 => _262.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
10335
10692
|
routePathname,
|
|
10336
10693
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
10337
10694
|
);
|
|
@@ -10366,15 +10723,16 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
10366
10723
|
return applicable;
|
|
10367
10724
|
}
|
|
10368
10725
|
|
|
10369
|
-
${_optionalChain([config, 'access',
|
|
10726
|
+
${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 => _264.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
10370
10727
|
if (request.method === "HEAD") return response;
|
|
10371
10728
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
10372
10729
|
|
|
10373
10730
|
const pathname = getFarmRoutePathname(new URL(request.url).pathname);
|
|
10374
10731
|
const applicableLayouts = getApplicableLayouts(pathname);
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10732
|
+
// Layouts with client components wrap the docs page: one that hydrates, or one whose client
|
|
10733
|
+
// components are islands of their own, as on an app page.
|
|
10734
|
+
if (!farmDocsLayoutsWrapPage(applicableLayouts)) return response;
|
|
10735
|
+
const shouldHydrateLayout = applicableLayouts.some((layout) => layout.shouldHydrate === true);
|
|
10378
10736
|
|
|
10379
10737
|
const source = await response.text();
|
|
10380
10738
|
const bodyMatch = source.match(/<body([^>]*)>([\\s\\S]*?)<\\/body>/i);
|
|
@@ -10388,39 +10746,34 @@ ${_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 =>
|
|
|
10388
10746
|
|
|
10389
10747
|
const matchedRoute = matchPageRoute(pathname);
|
|
10390
10748
|
const params = matchedRoute?.params || {};
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10749
|
+
// The docs page takes the place of an app page: the same page and layout boundaries, which the
|
|
10750
|
+
// browser draws around the docs HTML (createLayoutPageBoundary). Islands mode: a layout around a
|
|
10751
|
+
// client provider renders as a server tree, which the browser rebuilds with the docs page at its
|
|
10752
|
+
// outlet. The development server renders the same tree (docs-layout-tree.ts).
|
|
10753
|
+
const wrappedElement = await createFarmDocsLayoutTree(React, {
|
|
10754
|
+
pageHtml: bodyMatch[2],
|
|
10755
|
+
layouts: applicableLayouts.map((layout) => ({
|
|
10756
|
+
pattern: layout.pattern,
|
|
10757
|
+
Component: layout.module.default,
|
|
10758
|
+
shouldHydrate: layout.shouldHydrate,
|
|
10759
|
+
islandStrategy: layout.islandStrategy,
|
|
10760
|
+
serverTree: layout.serverTree,
|
|
10761
|
+
})),
|
|
10762
|
+
params,
|
|
10763
|
+
// Islands mode only: no other build marks a server-tree layout or imports this renderer.
|
|
10764
|
+
renderServerTreeLayout: ${farmIslandsMode ? "renderFarmServerTreeLayout" : "undefined"},
|
|
10765
|
+
layoutKey: ${farmIslandsMode ? "function(pattern) { return getFarmLayoutKey(pattern, params); }" : "undefined"},
|
|
10406
10766
|
});
|
|
10407
10767
|
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
wrappedElement = React.createElement(LayoutComponent, {
|
|
10412
|
-
children: wrappedElement,
|
|
10413
|
-
params,
|
|
10414
|
-
});
|
|
10415
|
-
}
|
|
10416
|
-
}
|
|
10417
|
-
|
|
10768
|
+
// Only a layout that hydrates renders as one client root; otherwise its client components
|
|
10769
|
+
// render as islands, as on an app page.
|
|
10770
|
+
const rootElement = wrapWithFarmIntegrationProviders(wrappedElement);
|
|
10418
10771
|
const renderedRoot = await renderFarmElement(
|
|
10419
10772
|
ReactDOMServer,
|
|
10420
10773
|
React.createElement(
|
|
10421
10774
|
"div",
|
|
10422
10775
|
{ id: "root" },
|
|
10423
|
-
wrapFarmRouteClientGraph(
|
|
10776
|
+
shouldHydrateLayout ? wrapFarmRouteClientGraph(rootElement) : rootElement,
|
|
10424
10777
|
),
|
|
10425
10778
|
);
|
|
10426
10779
|
let rootMarkup = renderedRoot.html;
|
|
@@ -10428,6 +10781,8 @@ ${_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 =>
|
|
|
10428
10781
|
rootMarkup = await new Response(renderedRoot.stream).text();
|
|
10429
10782
|
if (renderedRoot.streamErrors.length > 0) throw renderedRoot.streamErrors[0];
|
|
10430
10783
|
}
|
|
10784
|
+
// A root layout that renders the document gives #root its body; the docs runtime keeps its own.
|
|
10785
|
+
rootMarkup = placeFarmDocsLayoutRoot(rootMarkup);
|
|
10431
10786
|
let html = source.replace(
|
|
10432
10787
|
bodyMatch[0],
|
|
10433
10788
|
// Function replacement: rendered markup may contain $-sequences ($&, $', $$).
|
|
@@ -10474,7 +10829,7 @@ ${_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 =>
|
|
|
10474
10829
|
|
|
10475
10830
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
10476
10831
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
10477
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
10832
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _265 => _265.experimental, 'optionalAccess', _266 => _266.ppr]) === true)};
|
|
10478
10833
|
|
|
10479
10834
|
function resolveRouteRenderingView(route) {
|
|
10480
10835
|
// The same merge development uses: baked directive config under the
|
|
@@ -10499,7 +10854,6 @@ function getPPRShellBypassReason(request, middlewareData, middlewareContext) {
|
|
|
10499
10854
|
if (farmSecurityConfig.csp && farmSecurityConfig.csp.nonce) return "csp-nonce";
|
|
10500
10855
|
const method = request.method.toUpperCase();
|
|
10501
10856
|
if (method !== "GET" && method !== "HEAD") return "method";
|
|
10502
|
-
if (withoutFarmDeploymentCookie(request.headers.get("cookie"))) return "cookie";
|
|
10503
10857
|
if (request.headers.get("authorization")) return "authorization";
|
|
10504
10858
|
if (request.headers.get("x-farm-intercept-from")) return "route-interception";
|
|
10505
10859
|
if (request.headers.get("x-farm-ppr-refresh")) return "refresh";
|
|
@@ -10531,13 +10885,9 @@ function getPPRHeaders(status, config) {
|
|
|
10531
10885
|
|
|
10532
10886
|
if (status === "bypass") {
|
|
10533
10887
|
headers["Cache-Control"] = "private, no-store";
|
|
10534
|
-
return headers;
|
|
10535
|
-
}
|
|
10536
|
-
|
|
10537
|
-
if (typeof config.revalidate === "number" && config.revalidate > 0) {
|
|
10538
|
-
headers["Cache-Control"] = \`s-maxage=\${config.revalidate}, stale-while-revalidate\`;
|
|
10539
10888
|
}
|
|
10540
|
-
|
|
10889
|
+
// A shareable shell answers with the route's shared policy (getRouteSharedCacheControl), the
|
|
10890
|
+
// documented "public, s-maxage=<revalidate>, stale-while-revalidate=300", on a miss and a hit.
|
|
10541
10891
|
return headers;
|
|
10542
10892
|
}
|
|
10543
10893
|
|
|
@@ -10558,13 +10908,10 @@ function getRouteSharedCacheControl(route, pprCanCache) {
|
|
|
10558
10908
|
return resolveRouteSharedCacheControl(resolveRouteRenderingView(route), pprCanCache);
|
|
10559
10909
|
}
|
|
10560
10910
|
|
|
10911
|
+
// { html, cookieIndependent }: cookieIndependent marks a shell whose render read no cookies.
|
|
10561
10912
|
async function getCachedPPRShell(cacheKey) {
|
|
10562
10913
|
const entry = await pprShellCache.getEntryAsync(cacheKey);
|
|
10563
|
-
|
|
10564
|
-
return null;
|
|
10565
|
-
}
|
|
10566
|
-
|
|
10567
|
-
return entry.value.html;
|
|
10914
|
+
return entry ? entry.value : null;
|
|
10568
10915
|
}
|
|
10569
10916
|
|
|
10570
10917
|
/**
|
|
@@ -10602,7 +10949,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
10602
10949
|
},
|
|
10603
10950
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
10604
10951
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
10605
|
-
${_optionalChain([config, 'access',
|
|
10952
|
+
${_optionalChain([config, 'access', _267 => _267.md, 'optionalAccess', _268 => _268.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
10606
10953
|
if (matchPageRoute(pathname)) {
|
|
10607
10954
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
10608
10955
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -10819,7 +11166,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10819
11166
|
return renderFarmErrorJSONResponse();` : `
|
|
10820
11167
|
if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
|
|
10821
11168
|
// No page was selected, so only the root error boundary and layouts apply.
|
|
10822
|
-
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access',
|
|
11169
|
+
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _269 => _269.md, 'optionalAccess', _270 => _270.enabled]) ? `
|
|
10823
11170
|
// An agent asking for Markdown reads the error document as Markdown, as it
|
|
10824
11171
|
// does when a page throws. The helper answers null when Markdown is off.
|
|
10825
11172
|
const markdownErrorResponse = await createMarkdownMirrorResponse({
|
|
@@ -10861,7 +11208,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10861
11208
|
}
|
|
10862
11209
|
` : ""}
|
|
10863
11210
|
|
|
10864
|
-
${_optionalChain([config, 'access',
|
|
11211
|
+
${_optionalChain([config, 'access', _271 => _271.docs, 'optionalAccess', _272 => _272.enabled]) ? `
|
|
10865
11212
|
// Docs responses are served after app middleware so route guards and
|
|
10866
11213
|
// middleware headers apply to the docs engine like any other page content.
|
|
10867
11214
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -10977,7 +11324,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10977
11324
|
}
|
|
10978
11325
|
` : ""}
|
|
10979
11326
|
|
|
10980
|
-
${_optionalChain([config, 'access',
|
|
11327
|
+
${_optionalChain([config, 'access', _273 => _273.md, 'optionalAccess', _274 => _274.enabled]) ? `
|
|
10981
11328
|
if (farmMarkdownConfig?.enabled) {
|
|
10982
11329
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
10983
11330
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -11081,11 +11428,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11081
11428
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
11082
11429
|
}
|
|
11083
11430
|
` : ""}
|
|
11084
|
-
${_optionalChain([config, 'access',
|
|
11431
|
+
${_optionalChain([config, 'access', _275 => _275.agent, 'optionalAccess', _276 => _276.manifest]) !== false ? `
|
|
11085
11432
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
11086
11433
|
// public manifest, the same document for every request.
|
|
11087
11434
|
if (
|
|
11088
|
-
[${JSON.stringify(
|
|
11435
|
+
[${JSON.stringify(_chunkWJ5CCQBMcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkWJ5CCQBMcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
11089
11436
|
normalizeRuntimePath(routePathname),
|
|
11090
11437
|
)
|
|
11091
11438
|
) {
|
|
@@ -11095,9 +11442,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11095
11442
|
);
|
|
11096
11443
|
}
|
|
11097
11444
|
` : ""}
|
|
11098
|
-
${_optionalChain([config, 'access',
|
|
11445
|
+
${_optionalChain([config, 'access', _277 => _277.agent, 'optionalAccess', _278 => _278.apiCatalog]) ? `
|
|
11099
11446
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
11100
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
11447
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkWJ5CCQBMcjs.FARM_API_CATALOG_PATH)}) {
|
|
11101
11448
|
return applyProductionMiddlewareHeaders(
|
|
11102
11449
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
11103
11450
|
middlewareHeaders,
|
|
@@ -11122,11 +11469,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11122
11469
|
);
|
|
11123
11470
|
}
|
|
11124
11471
|
` : ""}
|
|
11125
|
-
${_optionalChain([config, 'access',
|
|
11472
|
+
${_optionalChain([config, 'access', _279 => _279.agent, 'optionalAccess', _280 => _280.llmsTxt, 'optionalAccess', _281 => _281.enabled]) ? `
|
|
11126
11473
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
11127
11474
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
11128
11475
|
? "llms"
|
|
11129
|
-
: ${_optionalChain([config, 'access',
|
|
11476
|
+
: ${_optionalChain([config, 'access', _282 => _282.agent, 'optionalAccess', _283 => _283.llmsTxt, 'optionalAccess', _284 => _284.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
11130
11477
|
if (farmGeneratedLlmsKind) {
|
|
11131
11478
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
11132
11479
|
// Renders are shared per origin the request reached, which is where pages are read.
|
|
@@ -11162,7 +11509,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11162
11509
|
}
|
|
11163
11510
|
` : ""}
|
|
11164
11511
|
|
|
11165
|
-
${_optionalChain([config, 'access',
|
|
11512
|
+
${_optionalChain([config, 'access', _285 => _285.docs, 'optionalAccess', _286 => _286.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
11166
11513
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
11167
11514
|
if (docsAPIResponse) {
|
|
11168
11515
|
return applyProductionMiddlewareHeaders(
|
|
@@ -11234,7 +11581,10 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11234
11581
|
}
|
|
11235
11582
|
: matchedRoute` : "matchedRoute"};
|
|
11236
11583
|
emitFarmEvent({ type: "route.matched", pathname, route: route.pattern, params });
|
|
11237
|
-
|
|
11584
|
+
// A shell started before the page reads its data: revalidatePath() during the render
|
|
11585
|
+
// leaves the stored shell stale (see FarmDataCache.startWriteAsync).
|
|
11586
|
+
let pprShellWrite = null;
|
|
11587
|
+
|
|
11238
11588
|
try {
|
|
11239
11589
|
${farmIslandsMode ? `// Islands mode: the layouts the navigating browser keeps, decided before the shell cache
|
|
11240
11590
|
// so a PPR route caches each segment under its own key. A static page, a layout that
|
|
@@ -11256,7 +11606,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11256
11606
|
? getPPRShellBypassReason(request, middlewareData, middlewareContext)
|
|
11257
11607
|
: undefined;
|
|
11258
11608
|
let pprCanCache = pprConfig.enabled && !pprBypassReason;
|
|
11259
|
-
|
|
11609
|
+
let pprCacheKey = pprCanCache
|
|
11260
11610
|
? getPPRShellCacheKey(
|
|
11261
11611
|
url,
|
|
11262
11612
|
farmLocaleResolution?.locale,
|
|
@@ -11272,8 +11622,18 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11272
11622
|
emitFarmEvent({ type: "ppr.refresh.start", route: pathname });
|
|
11273
11623
|
}
|
|
11274
11624
|
}
|
|
11625
|
+
const cachedPPRShellEntry = pprCacheKey ? await getCachedPPRShell(pprCacheKey) : null;
|
|
11626
|
+
const pprVisitorCookies = Boolean(withoutFarmDeploymentCookie(request.headers.get("cookie")));
|
|
11627
|
+
if (cachedPPRShellEntry && pprVisitorCookies && !cachedPPRShellEntry.cookieIndependent) {
|
|
11628
|
+
// The shell's render read cookies (the theme, an auth helper), so it is what a visitor
|
|
11629
|
+
// without them sees: this visitor's page renders on its own and is not stored.
|
|
11630
|
+
pprCanCache = false;
|
|
11631
|
+
pprCacheKey = null;
|
|
11632
|
+
emitFarmEvent({ type: "ppr.shell.bypass", route: pathname, reason: "cookie" });
|
|
11633
|
+
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "cookie" });
|
|
11634
|
+
}
|
|
11275
11635
|
if (pprCacheKey) {
|
|
11276
|
-
const cachedPPRShell =
|
|
11636
|
+
const cachedPPRShell = cachedPPRShellEntry?.html;
|
|
11277
11637
|
if (cachedPPRShell) {
|
|
11278
11638
|
emitFarmEvent({ type: "ppr.shell.hit", route: pathname, key: pprCacheKey });
|
|
11279
11639
|
emitFarmEvent({
|
|
@@ -11283,25 +11643,46 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11283
11643
|
status: 200,
|
|
11284
11644
|
durationMs: Date.now() - requestStartTime,
|
|
11285
11645
|
});
|
|
11286
|
-
|
|
11646
|
+
const response = rememberFarmBufferedHtml(applyProductionMiddlewareHeaders(farmOwnedHtmlResponse(cachedPPRShell, {
|
|
11287
11647
|
status: 200,
|
|
11288
11648
|
headers: {
|
|
11289
11649
|
"Content-Type": "text/html; charset=utf-8",
|
|
11290
|
-
"x-farm-preload-buffered":
|
|
11650
|
+
"x-farm-preload-buffered": "1",
|
|
11291
11651
|
...(farmFontPreloadHeader ? { "Link": farmFontPreloadHeader } : {}),
|
|
11292
11652
|
...getPPRHeaders("hit", pprConfig),
|
|
11653
|
+
// The policy the miss that stored this shell was sent with.
|
|
11654
|
+
...(getRouteSharedCacheControl(route, true)
|
|
11655
|
+
? { "Cache-Control": getRouteSharedCacheControl(route, true) }
|
|
11656
|
+
: {}),
|
|
11657
|
+
// A stored shell read no request state, so a visitor's cookies cannot change it, but
|
|
11658
|
+
// the response to a request with credentials stays out of shared caches.
|
|
11659
|
+
...(hasPrivateFarmRequestHeaders(request, farmLocaleResolution)
|
|
11660
|
+
? { "Cache-Control": "private, no-store" }
|
|
11661
|
+
: {}),
|
|
11293
11662
|
// A segment is one navigation's answer, never a CDN entry: some CDNs ignore Vary.
|
|
11294
11663
|
...(farmKeptLayouts
|
|
11295
11664
|
? { "Cache-Control": "private, no-store", "Vary": "F-Layouts" }
|
|
11296
11665
|
: {}),
|
|
11297
11666
|
},
|
|
11298
11667
|
}), middlewareHeaders), cachedPPRShell);
|
|
11668
|
+
farmPreloadShells.set(response, cachedPPRShellEntry);
|
|
11669
|
+
return response;
|
|
11299
11670
|
}
|
|
11300
11671
|
emitFarmEvent({ type: "ppr.shell.miss", route: pathname, key: pprCacheKey });
|
|
11672
|
+
if (request.method.toUpperCase() !== "HEAD") {
|
|
11673
|
+
pprShellWrite = await pprShellCache.startWriteAsync({
|
|
11674
|
+
// revalidatePath() takes the route path ("/pricing"), as the docs show, while the
|
|
11675
|
+
// shell answers the public one ("/console/fr/pricing"): either clears it.
|
|
11676
|
+
paths: [...new Set([pathname, getFarmRoutePathname(pathname)])],
|
|
11677
|
+
tags: ["ppr"],
|
|
11678
|
+
revalidate: pprConfig.revalidate ?? false,
|
|
11679
|
+
});
|
|
11680
|
+
}
|
|
11301
11681
|
}
|
|
11302
11682
|
|
|
11303
11683
|
// Reads from here on belong to the page render, not to middleware.
|
|
11304
11684
|
const requestReadsBeforeRender = _getRequestReadCount();
|
|
11685
|
+
const requestCookieReadsBeforeRender = _getRequestCookieReadCount();
|
|
11305
11686
|
// A swr or cache route rule stores this page by URL for every visitor. Nitro hands Farm the
|
|
11306
11687
|
// request without its cookies, Authorization, or any header the rule does not key on, so a
|
|
11307
11688
|
// render that reads nothing of the request is that shared page, whatever its route config.
|
|
@@ -11623,6 +12004,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11623
12004
|
pageElement,
|
|
11624
12005
|
);
|
|
11625
12006
|
|
|
12007
|
+
${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) pageElement = markPagePosition(React, pageElement);" : ""}
|
|
11626
12008
|
// Wrap with layouts (from innermost to outermost)
|
|
11627
12009
|
// Layouts are sorted by depth (root first), so we process in reverse
|
|
11628
12010
|
let wrappedElement = pageElement;
|
|
@@ -11678,19 +12060,13 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11678
12060
|
params,
|
|
11679
12061
|
...slotProps,
|
|
11680
12062
|
});
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
"data-farm-layout-key":
|
|
11689
|
-
farmLayoutKeyOf && !shouldHydrateLayout
|
|
11690
|
-
? farmLayoutKeyOf(layout.pattern, params)
|
|
11691
|
-
: undefined,
|
|
11692
|
-
style: { display: "contents" },
|
|
11693
|
-
},
|
|
12063
|
+
// A layout chain that hydrates renders whole anyway: it has no key.
|
|
12064
|
+
wrappedElement = createFarmLayoutBoundary(
|
|
12065
|
+
React,
|
|
12066
|
+
layout.pattern,
|
|
12067
|
+
farmLayoutKeyOf && !shouldHydrateLayout
|
|
12068
|
+
? farmLayoutKeyOf(layout.pattern, params)
|
|
12069
|
+
: undefined,
|
|
11694
12070
|
wrappedElement,
|
|
11695
12071
|
);
|
|
11696
12072
|
}
|
|
@@ -11700,6 +12076,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11700
12076
|
wrappedElement = wrapFarmRouteClientGraph(wrappedElement);
|
|
11701
12077
|
}
|
|
11702
12078
|
|
|
12079
|
+
${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) wrappedElement = markLayoutPosition(React, wrappedElement);" : ""}
|
|
11703
12080
|
wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
|
|
11704
12081
|
return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushToken);
|
|
11705
12082
|
};
|
|
@@ -11770,7 +12147,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11770
12147
|
);
|
|
11771
12148
|
}
|
|
11772
12149
|
}
|
|
11773
|
-
${_optionalChain([config, 'access',
|
|
12150
|
+
${_optionalChain([config, 'access', _287 => _287.md, 'optionalAccess', _288 => _288.enabled]) ? `
|
|
11774
12151
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
11775
12152
|
// using the public path the .md request will be resolved against.
|
|
11776
12153
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -11788,8 +12165,18 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11788
12165
|
emitFarmEvent({ type: "ppr.shell.bypass", route: pathname, reason: "request-read" });
|
|
11789
12166
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
|
|
11790
12167
|
}
|
|
12168
|
+
// An auth helper or integration client read this visitor's cookies: the shell a later
|
|
12169
|
+
// visitor gets must come from one without them.
|
|
12170
|
+
const renderReadCookies = () =>
|
|
12171
|
+
_getRequestCookieReadCount() !== requestCookieReadsBeforeRender;
|
|
12172
|
+
if (shouldCachePPRShell && pprVisitorCookies && renderReadCookies()) {
|
|
12173
|
+
shouldCachePPRShell = false;
|
|
12174
|
+
pprCanCache = false;
|
|
12175
|
+
emitFarmEvent({ type: "ppr.shell.bypass", route: pathname, reason: "cookie" });
|
|
12176
|
+
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "cookie" });
|
|
12177
|
+
}
|
|
11791
12178
|
|
|
11792
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
12179
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _289 => _289.agent, 'optionalAccess', _290 => _290.jsonLd]), () => ( false)))} });
|
|
11793
12180
|
const title = renderedMetadata.title;
|
|
11794
12181
|
const metaTags = renderedMetadata.tags;
|
|
11795
12182
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -12133,23 +12520,24 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12133
12520
|
pprCacheKey &&
|
|
12134
12521
|
request.method.toUpperCase() !== "HEAD"
|
|
12135
12522
|
) {
|
|
12136
|
-
|
|
12137
|
-
|
|
12138
|
-
|
|
12139
|
-
|
|
12140
|
-
|
|
12141
|
-
|
|
12142
|
-
|
|
12143
|
-
|
|
12144
|
-
|
|
12145
|
-
|
|
12146
|
-
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
|
|
12523
|
+
// The theme document above reads the theme cookie too. A render that read cookies
|
|
12524
|
+
// stores what a visitor without them sees, and only from such a visitor.
|
|
12525
|
+
const shellReadCookies = renderReadCookies();
|
|
12526
|
+
if (shellReadCookies && pprVisitorCookies) {
|
|
12527
|
+
emitFarmEvent({ type: "ppr.shell.bypass", route: pathname, reason: "cookie" });
|
|
12528
|
+
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "cookie" });
|
|
12529
|
+
} else {
|
|
12530
|
+
await pprShellWrite?.commit(pprCacheKey, {
|
|
12531
|
+
html: fullHtml,
|
|
12532
|
+
...(shellReadCookies ? {} : { cookieIndependent: true }),
|
|
12533
|
+
});
|
|
12534
|
+
emitFarmEvent({
|
|
12535
|
+
type: "ppr.shell.cached",
|
|
12536
|
+
route: pathname,
|
|
12537
|
+
key: pprCacheKey,
|
|
12538
|
+
revalidate: pprConfig.revalidate,
|
|
12539
|
+
});
|
|
12540
|
+
}
|
|
12153
12541
|
}
|
|
12154
12542
|
|
|
12155
12543
|
if (pprBypassReason === "refresh") {
|
|
@@ -12177,6 +12565,19 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12177
12565
|
), middlewareHeaders), fullHtml);
|
|
12178
12566
|
}
|
|
12179
12567
|
} catch (error) {
|
|
12568
|
+
// A Response the page, a layout, or generateMetadata throws answers the request as it is
|
|
12569
|
+
// (a 3xx redirect, a 401 with its WWW-Authenticate), as development sends it.
|
|
12570
|
+
if (error instanceof Response) {
|
|
12571
|
+
emitFarmEvent({
|
|
12572
|
+
type: "render.complete",
|
|
12573
|
+
route: pathname,
|
|
12574
|
+
pathname,
|
|
12575
|
+
status: error.status,
|
|
12576
|
+
durationMs: Date.now() - requestStartTime,
|
|
12577
|
+
});
|
|
12578
|
+
return applyProductionMiddlewareHeaders(error, middlewareHeaders);
|
|
12579
|
+
}
|
|
12580
|
+
|
|
12180
12581
|
if (isFarmRedirectError(error)) {
|
|
12181
12582
|
const redirect = getFarmRedirectError(error);
|
|
12182
12583
|
const redirectUrl =
|
|
@@ -12217,13 +12618,15 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12217
12618
|
emitFarmEvent({ type: "render.error", route: pathname, error });
|
|
12218
12619
|
console.error("SSR Error:", error);
|
|
12219
12620
|
return renderFarmErrorResponse(error, routePathname, params);
|
|
12621
|
+
} finally {
|
|
12622
|
+
pprShellWrite?.release();
|
|
12220
12623
|
}
|
|
12221
12624
|
}
|
|
12222
12625
|
|
|
12223
12626
|
${servesDefaultMCP ? `
|
|
12224
12627
|
// agent.mcp: no app route answered /mcp, so the default read-only server may.
|
|
12225
12628
|
if (
|
|
12226
|
-
normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
12629
|
+
normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkYRXPDKMMcjs.FARM_DEFAULT_MCP_PATH)} &&
|
|
12227
12630
|
getFarmDefaultMCPServer()
|
|
12228
12631
|
) {
|
|
12229
12632
|
return applyProductionMiddlewareHeaders(
|
|
@@ -12256,7 +12659,13 @@ ${servesDefaultMCP ? `
|
|
|
12256
12659
|
...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
|
|
12257
12660
|
});
|
|
12258
12661
|
|
|
12259
|
-
|
|
12662
|
+
// The boundary renders inside its own segment's layouts and those above it, never inside a
|
|
12663
|
+
// deeper layout: a layout below the boundary that throws would throw again inside it.
|
|
12664
|
+
const applicableLayouts = getApplicableLayouts(errorRoutePathname, errorDirectory).filter(
|
|
12665
|
+
function(layout) {
|
|
12666
|
+
return routeBoundaryCoversDirectory(layout.pattern, errorBoundaryMatch.route.pattern);
|
|
12667
|
+
}
|
|
12668
|
+
);
|
|
12260
12669
|
for (let i = applicableLayouts.length - 1; i >= 0; i--) {
|
|
12261
12670
|
const LayoutComponent = applicableLayouts[i].module.default;
|
|
12262
12671
|
if (LayoutComponent) {
|
|
@@ -12593,11 +13002,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
|
|
|
12593
13002
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
12594
13003
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
12595
13004
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
12596
|
-
${_optionalChain([config, 'access',
|
|
13005
|
+
${_optionalChain([config, 'access', _291 => _291.agent, 'optionalAccess', _292 => _292.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
12597
13006
|
basePath: farmLocalAPIBasePath,
|
|
12598
13007
|
dispatch: async (localRequest) =>
|
|
12599
13008
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
12600
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
13009
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _293 => _293.agent, 'optionalAccess', _294 => _294.noindexPreviews]) ? `
|
|
12601
13010
|
// Keep every response of a preview deployment out of search indexes.
|
|
12602
13011
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
12603
13012
|
}
|
|
@@ -12803,15 +13212,15 @@ function getManifestPageEntry(manifest, pathname) {
|
|
|
12803
13212
|
pages = manifest.routes.filter((entry) => entry.kind === "page").map((entry) => ({
|
|
12804
13213
|
entry,
|
|
12805
13214
|
matches: createMiddlewarePatternMatcher(entry.pattern),
|
|
12806
|
-
specificity:
|
|
12807
|
-
})).sort((left, right) =>
|
|
13215
|
+
specificity: _chunkML4TOUZPcjs.getRoutePatternSpecificity.call(void 0, entry.pattern)
|
|
13216
|
+
})).sort((left, right) => _chunkML4TOUZPcjs.compareRouteSpecificity.call(void 0, left.specificity, right.specificity)).map(({ entry, matches }) => ({ entry, matches }));
|
|
12808
13217
|
manifestPageMatchers.set(manifest.routes, pages);
|
|
12809
13218
|
}
|
|
12810
|
-
return _optionalChain([pages, 'access',
|
|
13219
|
+
return _optionalChain([pages, 'access', _295 => _295.find, 'call', _296 => _296((page) => page.matches(pathname)), 'optionalAccess', _297 => _297.entry]);
|
|
12811
13220
|
}
|
|
12812
13221
|
function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
12813
13222
|
if (!edgeGuarded) return headers;
|
|
12814
|
-
const cacheHeaders = /* @__PURE__ */ new Set(["cache-control", ...
|
|
13223
|
+
const cacheHeaders = /* @__PURE__ */ new Set(["cache-control", ..._chunk42EUEYW6cjs.CDN_CACHE_CONTROL_HEADERS]);
|
|
12815
13224
|
return {
|
|
12816
13225
|
...Object.fromEntries(
|
|
12817
13226
|
Object.entries(headers).filter(([name]) => !cacheHeaders.has(name.toLowerCase()))
|
|
@@ -12844,13 +13253,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12844
13253
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
12845
13254
|
return "rewrite";
|
|
12846
13255
|
}
|
|
12847
|
-
if (
|
|
12848
|
-
if (
|
|
12849
|
-
if (
|
|
13256
|
+
if (_chunkXGDI4OUBcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
13257
|
+
if (_chunkXGDI4OUBcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
13258
|
+
if (_chunkNPGXX7HNcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
12850
13259
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
12851
13260
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
12852
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
12853
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
13261
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _298 => _298.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
13262
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _299 => _299.regions, 'optionalAccess', _300 => _300.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
12854
13263
|
return "route runtime controls";
|
|
12855
13264
|
}
|
|
12856
13265
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -12863,34 +13272,34 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12863
13272
|
return void 0;
|
|
12864
13273
|
}
|
|
12865
13274
|
async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
12866
|
-
if (!_optionalChain([config, 'access',
|
|
13275
|
+
if (!_optionalChain([config, 'access', _301 => _301.docs, 'optionalAccess', _302 => _302.enabled]) || !config.docs.prerender) return [];
|
|
12867
13276
|
if (_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
|
|
12868
|
-
|
|
13277
|
+
_chunkGC5ROI3Acjs.logger.info(
|
|
12869
13278
|
`\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
|
|
12870
13279
|
);
|
|
12871
13280
|
return [];
|
|
12872
13281
|
}
|
|
12873
|
-
if (!
|
|
12874
|
-
const { pages: pages2, originDependent } =
|
|
13282
|
+
if (!_chunkZPCZWEU3cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
13283
|
+
const { pages: pages2, originDependent } = _chunk6D3CJFNUcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
|
|
12875
13284
|
root,
|
|
12876
13285
|
srcDir: config.srcDir
|
|
12877
13286
|
});
|
|
12878
13287
|
if (originDependent.length > 0) {
|
|
12879
|
-
|
|
13288
|
+
_chunkGC5ROI3Acjs.logger.info(
|
|
12880
13289
|
`\u21AA Keeping ${originDependent.length} docs page(s) rendering on request: their social image metadata is an absolute URL built from the request's origin. Set docs.socialImage.baseUrl to prerender them.`
|
|
12881
13290
|
);
|
|
12882
13291
|
}
|
|
12883
13292
|
return pages2;
|
|
12884
13293
|
}
|
|
12885
13294
|
if (!_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer)) {
|
|
12886
|
-
|
|
13295
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
12887
13296
|
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} renders with React; docs.prerender keeps its pages rendering on request with the "${config.renderer.name}" renderer.`
|
|
12888
13297
|
);
|
|
12889
13298
|
return [];
|
|
12890
13299
|
}
|
|
12891
|
-
const pages = await
|
|
13300
|
+
const pages = await _chunkZPCZWEU3cjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
12892
13301
|
if (!pages) {
|
|
12893
|
-
|
|
13302
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
12894
13303
|
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
|
|
12895
13304
|
);
|
|
12896
13305
|
return [];
|
|
@@ -12898,17 +13307,17 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
12898
13307
|
return pages;
|
|
12899
13308
|
}
|
|
12900
13309
|
async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
12901
|
-
if (!_optionalChain([config, 'access',
|
|
13310
|
+
if (!_optionalChain([config, 'access', _303 => _303.docs, 'optionalAccess', _304 => _304.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
|
|
12902
13311
|
return [];
|
|
12903
13312
|
}
|
|
12904
13313
|
try {
|
|
12905
|
-
return await
|
|
13314
|
+
return await _chunkZPCZWEU3cjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
12906
13315
|
root,
|
|
12907
13316
|
srcDir: config.srcDir,
|
|
12908
|
-
adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) &&
|
|
13317
|
+
adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunkZPCZWEU3cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
12909
13318
|
});
|
|
12910
13319
|
} catch (error) {
|
|
12911
|
-
|
|
13320
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
12912
13321
|
`Farm Infra analytics reports docs pages by the docs route, not each page's path: listing them failed (${error instanceof Error ? error.message : String(error)}).`
|
|
12913
13322
|
);
|
|
12914
13323
|
return [];
|
|
@@ -12916,9 +13325,9 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
|
12916
13325
|
}
|
|
12917
13326
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
12918
13327
|
return Object.values(routeRules || {}).some((rule) => {
|
|
12919
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
12920
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
12921
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
13328
|
+
const swr = _optionalChain([rule, 'optionalAccess', _305 => _305.swr]);
|
|
13329
|
+
const cache = _optionalChain([rule, 'optionalAccess', _306 => _306.cache]);
|
|
13330
|
+
const headers = _optionalChain([rule, 'optionalAccess', _307 => _307.headers]);
|
|
12922
13331
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
12923
13332
|
});
|
|
12924
13333
|
}
|
|
@@ -12931,10 +13340,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12931
13340
|
const nitroBuilder = nitroBuilderResult.value;
|
|
12932
13341
|
const isVercel = preset === "vercel";
|
|
12933
13342
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
12934
|
-
const outputDir =
|
|
13343
|
+
const outputDir = _chunkNPGXX7HNcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
12935
13344
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
12936
13345
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
12937
|
-
const imageRuntime =
|
|
13346
|
+
const imageRuntime = _chunkIK33N2ANcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
12938
13347
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
12939
13348
|
(image) => image.sourceType === "module"
|
|
12940
13349
|
);
|
|
@@ -12952,15 +13361,15 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12952
13361
|
(packageName) => copiedRuntimePackages.has(packageName)
|
|
12953
13362
|
);
|
|
12954
13363
|
const isPrebuiltSSRCandidate = preset === "node-server" && ssrExternalsArePackaged;
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
13364
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
|
|
13365
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
|
|
13366
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
|
|
12958
13367
|
const ssgCollectionPromise = routeManager.collectSSGPages();
|
|
12959
13368
|
const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config));
|
|
12960
13369
|
const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
|
|
12961
13370
|
const docsPrerenderPagesPromise = getFarmDocsPrerenderPages(config, root, preset);
|
|
12962
|
-
const farmWorkflows = await
|
|
12963
|
-
const farmCron = await
|
|
13371
|
+
const farmWorkflows = await _chunkQUEYL2WMcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
|
|
13372
|
+
const farmCron = await _chunkCYNQPKA4cjs.prepareFarmCronForNitro.call(void 0, config);
|
|
12964
13373
|
const [
|
|
12965
13374
|
{ ssg: ssgPages },
|
|
12966
13375
|
middlewareRoutes,
|
|
@@ -12990,7 +13399,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12990
13399
|
const edgeGuardedPrerenderRoutes = [];
|
|
12991
13400
|
const addPrerenderRoute = (pathname) => {
|
|
12992
13401
|
prerenderRoutes.push(pathname);
|
|
12993
|
-
if (
|
|
13402
|
+
if (_chunkXGDI4OUBcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
|
|
12994
13403
|
edgeGuardedPrerenderRoutes.push(pathname);
|
|
12995
13404
|
}
|
|
12996
13405
|
};
|
|
@@ -13032,29 +13441,29 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
13032
13441
|
addPrerenderRoute(pathname);
|
|
13033
13442
|
}
|
|
13034
13443
|
for (const skipped of skippedPrerenderRoutes) {
|
|
13035
|
-
|
|
13444
|
+
_chunkGC5ROI3Acjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
|
|
13036
13445
|
}
|
|
13037
13446
|
if (farmWorkflows.workflows.length > 0) {
|
|
13038
|
-
|
|
13447
|
+
_chunkGC5ROI3Acjs.logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
|
|
13039
13448
|
}
|
|
13040
13449
|
if (farmCron.jobs.length > 0 && farmCron.provider === "farmjs") {
|
|
13041
|
-
|
|
13450
|
+
_chunkGC5ROI3Acjs.logger.info(
|
|
13042
13451
|
`\u23F1\uFE0F ${farmCron.jobs.length} Farm cron job(s) for Infra; run farm cron sync after deployment`
|
|
13043
13452
|
);
|
|
13044
13453
|
} else if (farmCron.jobs.length > 0) {
|
|
13045
|
-
|
|
13454
|
+
_chunkGC5ROI3Acjs.logger.info(`\u23F1\uFE0F Configured ${farmCron.jobs.length} Farm cron route(s)`);
|
|
13046
13455
|
}
|
|
13047
13456
|
if (preset === "cloudflare-pages" && farmCron.jobs.length > 0 && farmCron.provider === "host") {
|
|
13048
|
-
|
|
13457
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
13049
13458
|
"Cloudflare Pages does not install Cron Triggers. Use the cloudflare-module preset or an external scheduler with .farm/cron-manifest.json."
|
|
13050
13459
|
);
|
|
13051
13460
|
}
|
|
13052
|
-
const portableScheduledTasks =
|
|
13461
|
+
const portableScheduledTasks = _chunkCYNQPKA4cjs.mergeScheduledTasks.call(void 0,
|
|
13053
13462
|
farmWorkflows.scheduledTasks,
|
|
13054
13463
|
farmCron.scheduledTasks
|
|
13055
13464
|
);
|
|
13056
|
-
const scheduledTasks = preset.startsWith("cloudflare") ?
|
|
13057
|
-
const cloudflareCronConfig = farmCron.provider === "host" ?
|
|
13465
|
+
const scheduledTasks = preset.startsWith("cloudflare") ? _chunkCYNQPKA4cjs.toFarmCronCloudflareScheduledTasks.call(void 0, portableScheduledTasks) : portableScheduledTasks;
|
|
13466
|
+
const cloudflareCronConfig = farmCron.provider === "host" ? _chunkCYNQPKA4cjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs) : void 0;
|
|
13058
13467
|
const [
|
|
13059
13468
|
clientCssHref,
|
|
13060
13469
|
clientJsSrc,
|
|
@@ -13081,7 +13490,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
13081
13490
|
webEntry: clientJsSrc,
|
|
13082
13491
|
webBoot: clientBootSrc,
|
|
13083
13492
|
stylesheet: clientCssHref,
|
|
13084
|
-
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess',
|
|
13493
|
+
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _308 => _308.files]), () => ( []))
|
|
13085
13494
|
})
|
|
13086
13495
|
) : null;
|
|
13087
13496
|
for (const output of Object.values(ssrBundle)) {
|
|
@@ -13400,11 +13809,11 @@ function toFarmNodeResponse(request, response) {
|
|
|
13400
13809
|
ssrOutputDir,
|
|
13401
13810
|
ssrEntryFile
|
|
13402
13811
|
);
|
|
13403
|
-
const configuredNitroRouteRules =
|
|
13404
|
-
varyFarmNitroCacheRules(
|
|
13812
|
+
const configuredNitroRouteRules = _chunkIIHZ2BEEcjs.nitroRouteRulesBelowBasePath.call(void 0,
|
|
13813
|
+
varyFarmNitroCacheRules(_chunkIIHZ2BEEcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
|
|
13405
13814
|
...config.md.enabled ? ["accept"] : [],
|
|
13406
13815
|
...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : [],
|
|
13407
|
-
..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
13816
|
+
..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _309 => _309.experimental, 'optionalAccess', _310 => _310.serverComponents])) === "islands" ? ["f-layouts"] : []
|
|
13408
13817
|
]),
|
|
13409
13818
|
config.basePath,
|
|
13410
13819
|
_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
|
|
@@ -13507,7 +13916,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
13507
13916
|
} : {},
|
|
13508
13917
|
// Use serverHandlers to define our workflow handler first, then the catch-all handler.
|
|
13509
13918
|
handlers: [
|
|
13510
|
-
...farmCloudflareEnvPath ? [{ route: "/**", middleware: true, handler:
|
|
13919
|
+
...farmCloudflareEnvPath ? [{ route: "/**", middleware: true, handler: _chunkGC5ROI3Acjs.toPosixPath.call(void 0, farmCloudflareEnvPath) }] : [],
|
|
13511
13920
|
...farmWorkflows.handlerPath ? [
|
|
13512
13921
|
{
|
|
13513
13922
|
route: `${config.workflows.route}/**`,
|
|
@@ -13516,7 +13925,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
13516
13925
|
] : [],
|
|
13517
13926
|
{
|
|
13518
13927
|
route: "/**",
|
|
13519
|
-
handler:
|
|
13928
|
+
handler: _chunkGC5ROI3Acjs.toPosixPath.call(void 0, nitroEntryPath)
|
|
13520
13929
|
}
|
|
13521
13930
|
],
|
|
13522
13931
|
routeRules: {
|
|
@@ -13565,31 +13974,38 @@ function toFarmNodeResponse(request, response) {
|
|
|
13565
13974
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
13566
13975
|
);
|
|
13567
13976
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
13568
|
-
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
13569
|
-
_optionalChain([nitroConfig, 'access',
|
|
13570
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
13977
|
+
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _311 => _311.rollupConfig, 'optionalAccess', _312 => _312.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.plugins])) && customRollupKeys.length === 0 && Boolean(
|
|
13978
|
+
_optionalChain([nitroConfig, 'access', _315 => _315.handlers, 'optionalAccess', _316 => _316.some, 'call', _317 => _317(
|
|
13979
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _318 => _318.handler]) || "") === nitroEntryPath
|
|
13571
13980
|
)])
|
|
13572
13981
|
);
|
|
13573
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access',
|
|
13982
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _319 => _319.output, 'optionalAccess', _320 => _320.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
|
|
13574
13983
|
const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
|
|
13575
13984
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
13576
13985
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
13577
13986
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
13578
13987
|
const shouldMinify = nitroConfig.minify !== false;
|
|
13579
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
13988
|
+
const keepServerNames = !(_optionalChain([config, 'access', _321 => _321.docs, 'optionalAccess', _322 => _322.enabled]) && _optionalChain([config, 'access', _323 => _323.docs, 'access', _324 => _324.adapter, 'optionalAccess', _325 => _325.server]));
|
|
13580
13989
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
13581
13990
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
13582
13991
|
const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
nitroConfig.rollupConfig
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
|
|
13589
|
-
|
|
13590
|
-
|
|
13591
|
-
|
|
13592
|
-
|
|
13992
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _326 => _326.rollupConfig, 'optionalAccess', _327 => _327.plugins]);
|
|
13993
|
+
nitroConfig.rollupConfig = {
|
|
13994
|
+
...nitroConfig.rollupConfig,
|
|
13995
|
+
plugins: [
|
|
13996
|
+
...Array.isArray(configuredRollupPlugins) ? configuredRollupPlugins : configuredRollupPlugins ? [configuredRollupPlugins] : [],
|
|
13997
|
+
...ssrRollupPlugin ? [ssrRollupPlugin] : [],
|
|
13998
|
+
// Added after the checks above: it changes no SSR output, only how public files answer
|
|
13999
|
+
// `Range` and how a prerendered page's other slash spelling redirects. Nitro's static
|
|
14000
|
+
// handler answers both spellings, and a route rule cannot redirect one of them: Nitro's
|
|
14001
|
+
// router matches the rule at the canonical URL too, which loops on h3 before 2.0.8.
|
|
14002
|
+
// Platform presets serve their own static files and redirects.
|
|
14003
|
+
createNitroStaticRangePlugin(
|
|
14004
|
+
resolveNitroPackageEntry(root),
|
|
14005
|
+
isVercel || preset.startsWith("cloudflare") || preset.startsWith("netlify") ? [] : prerenderRoutes.map(toPrerenderPublicPath)
|
|
14006
|
+
)
|
|
14007
|
+
]
|
|
14008
|
+
};
|
|
13593
14009
|
nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
|
|
13594
14010
|
const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
|
|
13595
14011
|
let prerenderOrder = /* @__PURE__ */ new Map();
|
|
@@ -13612,21 +14028,21 @@ function toFarmNodeResponse(request, response) {
|
|
|
13612
14028
|
let skippedNonHtmlPrerenderRoute = false;
|
|
13613
14029
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
13614
14030
|
if (route.error || !prerenderPagePaths.has(route.route)) return;
|
|
13615
|
-
if (_optionalChain([route, 'access',
|
|
14031
|
+
if (_optionalChain([route, 'access', _328 => _328.contentType, 'optionalAccess', _329 => _329.toLowerCase, 'call', _330 => _330(), 'access', _331 => _331.includes, 'call', _332 => _332("html")])) return;
|
|
13616
14032
|
route.skip = true;
|
|
13617
14033
|
skippedNonHtmlPrerenderRoute = true;
|
|
13618
14034
|
const configuredRule = configuredNitroRouteRules[route.route];
|
|
13619
14035
|
if (configuredRule) nitroInstance.options.routeRules[route.route] = configuredRule;
|
|
13620
14036
|
else delete nitroInstance.options.routeRules[route.route];
|
|
13621
|
-
|
|
14037
|
+
_chunkGC5ROI3Acjs.logger.info(`\u21AA Keeping SSG route ${route.route} server-handled (it does not render HTML)`);
|
|
13622
14038
|
});
|
|
13623
14039
|
nitroInstance.hooks.hook("prerender:done", () => {
|
|
13624
14040
|
if (skippedNonHtmlPrerenderRoute) nitroInstance.routing.sync();
|
|
13625
14041
|
});
|
|
13626
|
-
if (_optionalChain([config, 'access',
|
|
14042
|
+
if (_optionalChain([config, 'access', _333 => _333.md, 'optionalAccess', _334 => _334.enabled])) {
|
|
13627
14043
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
13628
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
13629
|
-
const alternatePath =
|
|
14044
|
+
if (!route.contents || !_optionalChain([route, 'access', _335 => _335.contentType, 'optionalAccess', _336 => _336.toLowerCase, 'call', _337 => _337(), 'access', _338 => _338.includes, 'call', _339 => _339("html")])) return;
|
|
14045
|
+
const alternatePath = _chunk2YJ4DHTDcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
|
|
13630
14046
|
routePathname: (pathname) => routeManager.toRoutePathname(pathname)
|
|
13631
14047
|
});
|
|
13632
14048
|
if (!alternatePath) return;
|
|
@@ -13648,7 +14064,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
13648
14064
|
}
|
|
13649
14065
|
if (config.security.csp && config.security.csp.nonce) {
|
|
13650
14066
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
13651
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
14067
|
+
if (!route.contents || !_optionalChain([route, 'access', _340 => _340.contentType, 'optionalAccess', _341 => _341.toLowerCase, 'call', _342 => _342(), 'access', _343 => _343.includes, 'call', _344 => _344("html")])) return;
|
|
13652
14068
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
13653
14069
|
if (!staticCsp) return;
|
|
13654
14070
|
route.contents = staticCsp.html;
|
|
@@ -13684,7 +14100,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
13684
14100
|
await nitroBuilder.copyPublicAssets(nitroInstance);
|
|
13685
14101
|
if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
|
|
13686
14102
|
nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
|
|
13687
|
-
const configuredPlugins = _optionalChain([prerendererConfig, 'access',
|
|
14103
|
+
const configuredPlugins = _optionalChain([prerendererConfig, 'access', _345 => _345.rollupConfig, 'optionalAccess', _346 => _346.plugins]);
|
|
13688
14104
|
const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
|
|
13689
14105
|
prerendererConfig.rollupConfig = {
|
|
13690
14106
|
...prerendererConfig.rollupConfig,
|
|
@@ -13740,14 +14156,14 @@ function toFarmNodeResponse(request, response) {
|
|
|
13740
14156
|
});
|
|
13741
14157
|
}
|
|
13742
14158
|
if (prerenderRoutes.length > 0) {
|
|
13743
|
-
|
|
13744
|
-
const previousPrerender = process.env[
|
|
13745
|
-
process.env[
|
|
14159
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
14160
|
+
const previousPrerender = process.env[_chunkWHCNJVYUcjs.FARM_PRERENDER_ENV];
|
|
14161
|
+
process.env[_chunkWHCNJVYUcjs.FARM_PRERENDER_ENV] = "1";
|
|
13746
14162
|
try {
|
|
13747
14163
|
await nitroBuilder.prerender(nitroInstance);
|
|
13748
14164
|
} finally {
|
|
13749
|
-
if (previousPrerender === void 0) delete process.env[
|
|
13750
|
-
else process.env[
|
|
14165
|
+
if (previousPrerender === void 0) delete process.env[_chunkWHCNJVYUcjs.FARM_PRERENDER_ENV];
|
|
14166
|
+
else process.env[_chunkWHCNJVYUcjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
13751
14167
|
}
|
|
13752
14168
|
}
|
|
13753
14169
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
|
|
@@ -13799,10 +14215,10 @@ function toFarmNodeResponse(request, response) {
|
|
|
13799
14215
|
if (failedCopy) throw failedCopy.reason;
|
|
13800
14216
|
if (canReusePrebuiltSSR) {
|
|
13801
14217
|
await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs5);
|
|
13802
|
-
|
|
14218
|
+
_chunkGC5ROI3Acjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
|
|
13803
14219
|
}
|
|
13804
14220
|
if (useRolldownBuilder) {
|
|
13805
|
-
|
|
14221
|
+
_chunkGC5ROI3Acjs.logger.info("\u26A1 Built the Node adapter with Rolldown");
|
|
13806
14222
|
}
|
|
13807
14223
|
if (preset === "node-server" && !desktopServerEntry) {
|
|
13808
14224
|
await installFarmCompileCacheLauncher(_path2.default.join(outputDir, "server"), fs5);
|
|
@@ -13835,7 +14251,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
13835
14251
|
prerenderRoutes.map(toPrerenderPublicPath)
|
|
13836
14252
|
);
|
|
13837
14253
|
}
|
|
13838
|
-
|
|
14254
|
+
_chunkGC5ROI3Acjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
|
|
13839
14255
|
}
|
|
13840
14256
|
function resolveFarmNitroOutputConfig(preset, outputDir) {
|
|
13841
14257
|
const isVercel = preset === "vercel";
|
|
@@ -13910,6 +14326,7 @@ async function registerPrebuiltSSRPackageImport(serverDir, ssrEntryFile, fs5) {
|
|
|
13910
14326
|
});
|
|
13911
14327
|
const existingImports = packageJSON.imports && typeof packageJSON.imports === "object" ? packageJSON.imports : {};
|
|
13912
14328
|
const outputEntry = `${FARM_SSR_OUTPUT_DIR}/${ssrEntryFile}`.replace(/\\/g, "/");
|
|
14329
|
+
_nullishCoalesce(packageJSON.type, () => ( (packageJSON.type = "module")));
|
|
13913
14330
|
packageJSON.imports = {
|
|
13914
14331
|
...existingImports,
|
|
13915
14332
|
[FARM_SSR_PACKAGE_IMPORT]: `./${outputEntry}`
|
|
@@ -13923,7 +14340,7 @@ async function moveVercelOutputPath(src, dest, fs5) {
|
|
|
13923
14340
|
await fs5.rename(src, dest);
|
|
13924
14341
|
return;
|
|
13925
14342
|
} catch (error) {
|
|
13926
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
14343
|
+
const code = _optionalChain([error, 'optionalAccess', _347 => _347.code]);
|
|
13927
14344
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
13928
14345
|
throw error;
|
|
13929
14346
|
}
|
|
@@ -13949,7 +14366,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
13949
14366
|
try {
|
|
13950
14367
|
await moveVercelOutputPath(publicDir, staticDir, fs5);
|
|
13951
14368
|
} catch (error) {
|
|
13952
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
14369
|
+
if (_optionalChain([error, 'optionalAccess', _348 => _348.code]) !== "ENOENT") throw error;
|
|
13953
14370
|
}
|
|
13954
14371
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5);
|
|
13955
14372
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs5);
|
|
@@ -13963,7 +14380,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
13963
14380
|
config.basePath
|
|
13964
14381
|
);
|
|
13965
14382
|
const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
|
|
13966
|
-
(route) => edgeMiddleware.guardedPages.some((pathname) =>
|
|
14383
|
+
(route) => edgeMiddleware.guardedPages.some((pathname) => _chunkXGDI4OUBcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
|
|
13967
14384
|
);
|
|
13968
14385
|
if (edgeMiddlewareRoutes.length > 0) {
|
|
13969
14386
|
await writeFarmVercelEdgeMiddlewareFunction({
|
|
@@ -13982,17 +14399,17 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
13982
14399
|
middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? createFarmVercelEdgeMiddlewareRoutes(edgeMiddleware.guardedPages, config.basePath) : [],
|
|
13983
14400
|
canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
|
|
13984
14401
|
});
|
|
13985
|
-
const vercelConfigWithWorkflowCrons =
|
|
14402
|
+
const vercelConfigWithWorkflowCrons = _chunkQUEYL2WMcjs.applyFarmWorkflowVercelCrons.call(void 0,
|
|
13986
14403
|
vercelConfig,
|
|
13987
14404
|
farmWorkflows.workflows
|
|
13988
14405
|
);
|
|
13989
|
-
const vercelConfigWithCrons =
|
|
14406
|
+
const vercelConfigWithCrons = _chunkCYNQPKA4cjs.applyFarmCronVercelCrons.call(void 0, vercelConfigWithWorkflowCrons, cronJobs);
|
|
13990
14407
|
await fs5.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
|
|
13991
|
-
|
|
14408
|
+
_chunkGC5ROI3Acjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
13992
14409
|
}
|
|
13993
14410
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
|
|
13994
|
-
if (!_optionalChain([config, 'access',
|
|
13995
|
-
const [mainRoot, ...extraRoots] =
|
|
14411
|
+
if (!_optionalChain([config, 'access', _349 => _349.docs, 'optionalAccess', _350 => _350.enabled])) return;
|
|
14412
|
+
const [mainRoot, ...extraRoots] = _chunk6D3CJFNUcjs.getFarmDocsRoots.call(void 0, config.docs);
|
|
13996
14413
|
await copyFarmDocsRootContent(
|
|
13997
14414
|
mainRoot,
|
|
13998
14415
|
root,
|
|
@@ -14013,12 +14430,12 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
|
|
|
14013
14430
|
async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs5) {
|
|
14014
14431
|
const docsContentDir = resolveBuildDocsContentDir(docs, root, srcDir);
|
|
14015
14432
|
if (!docsContentDir) return;
|
|
14016
|
-
const lastModifiedManifest =
|
|
14433
|
+
const lastModifiedManifest = _chunk6D3CJFNUcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
14017
14434
|
fallback: "now"
|
|
14018
14435
|
});
|
|
14019
|
-
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access',
|
|
14436
|
+
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _351 => _351.unknown, 'optionalAccess', _352 => _352.length]), () => ( 0));
|
|
14020
14437
|
if (undatedPages > 0) {
|
|
14021
|
-
|
|
14438
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
14022
14439
|
`${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
|
|
14023
14440
|
);
|
|
14024
14441
|
}
|
|
@@ -14030,11 +14447,11 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
|
|
|
14030
14447
|
dereference: true
|
|
14031
14448
|
});
|
|
14032
14449
|
await fs5.writeFile(
|
|
14033
|
-
_path2.default.join(bundledContentDir,
|
|
14450
|
+
_path2.default.join(bundledContentDir, _chunk6D3CJFNUcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
|
|
14034
14451
|
`${JSON.stringify(lastModifiedManifest, null, 2)}
|
|
14035
14452
|
`
|
|
14036
14453
|
);
|
|
14037
|
-
|
|
14454
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${_path2.default.relative(root, docsContentDir)}`);
|
|
14038
14455
|
}
|
|
14039
14456
|
function resolveServerFunctionPlatform(preset) {
|
|
14040
14457
|
return preset === "vercel" || preset === "netlify" ? { os: "linux", cpu: "x64", libc: "glibc" } : null;
|
|
@@ -14101,7 +14518,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
|
|
|
14101
14518
|
try {
|
|
14102
14519
|
await copyPackage("sharp", sharpRequire);
|
|
14103
14520
|
if (!copiedPackages.has("sharp")) {
|
|
14104
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
14521
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkIK33N2ANcjs.SHARP_INSTALL_HINT}`);
|
|
14105
14522
|
}
|
|
14106
14523
|
} catch (error) {
|
|
14107
14524
|
await fs5.rm(stageDir, { recursive: true, force: true });
|
|
@@ -14128,7 +14545,7 @@ async function installStagedSharpRuntime(staged, nitroFuncDir, fs5) {
|
|
|
14128
14545
|
} finally {
|
|
14129
14546
|
await fs5.rm(staged.stageDir, { recursive: true, force: true });
|
|
14130
14547
|
}
|
|
14131
|
-
|
|
14548
|
+
_chunkGC5ROI3Acjs.logger.info(
|
|
14132
14549
|
`\u{1F5BC}\uFE0F Bundled Sharp image runtime (${Object.keys(staged.dependencies).length} packages)`
|
|
14133
14550
|
);
|
|
14134
14551
|
}
|
|
@@ -14172,7 +14589,7 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs5) {
|
|
|
14172
14589
|
function assertMetadataImageRuntimeInstalled(root, metadataImageRoutes) {
|
|
14173
14590
|
const generated = metadataImageRoutes.find((image) => image.sourceType === "module");
|
|
14174
14591
|
if (!generated || resolveMetadataImageRuntimePackageJson(root)) return;
|
|
14175
|
-
const file = generated.modulePath ?
|
|
14592
|
+
const file = generated.modulePath ? _chunkGC5ROI3Acjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
|
|
14176
14593
|
throw new Error(
|
|
14177
14594
|
`${file || "A generated metadata image"} renders with @vercel/og, which is not installed. ${_chunkKORZ6PREcjs.VERCEL_OG_INSTALL_HINT}`
|
|
14178
14595
|
);
|
|
@@ -14206,7 +14623,7 @@ async function copyMetadataImageRuntime(root, nitroFuncDir, fs5) {
|
|
|
14206
14623
|
"@vercel/og": String(packageJson.version || "0.11.1")
|
|
14207
14624
|
};
|
|
14208
14625
|
await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs5);
|
|
14209
|
-
|
|
14626
|
+
_chunkGC5ROI3Acjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
|
|
14210
14627
|
}
|
|
14211
14628
|
async function readNitroOutputPackage(outputDir, fs5) {
|
|
14212
14629
|
const packagePath = _path2.default.join(outputDir, "package.json");
|
|
@@ -14265,6 +14682,7 @@ async function resolveProjectInstalledPackageDir(root, packageName, fs5) {
|
|
|
14265
14682
|
directory = parent;
|
|
14266
14683
|
}
|
|
14267
14684
|
}
|
|
14685
|
+
var PRISMA_RUNTIME_GENERATE_ONLY_FILE = /^query_(?:engine|compiler)_bg\.|\.map$|\.d\.m?ts$/;
|
|
14268
14686
|
async function copyPrismaClientForVercel(root, nitroFuncDir, fs5) {
|
|
14269
14687
|
const prismaClientDir = await resolveProjectInstalledPackageDir(root, "@prisma/client", fs5);
|
|
14270
14688
|
if (!prismaClientDir) return;
|
|
@@ -14278,10 +14696,12 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs5) {
|
|
|
14278
14696
|
const targetPrismaScopeDir = _path2.default.join(targetNodeModules, "@prisma");
|
|
14279
14697
|
const targetGeneratedDir = _path2.default.join(targetNodeModules, ".prisma", "client");
|
|
14280
14698
|
const targetClientDir = _path2.default.join(targetPrismaScopeDir, "client");
|
|
14699
|
+
const runtimeDir = _path2.default.join(prismaClientDir, "runtime");
|
|
14281
14700
|
await fs5.mkdir(targetPrismaScopeDir, { recursive: true });
|
|
14282
14701
|
await fs5.cp(prismaClientDir, targetClientDir, {
|
|
14283
14702
|
recursive: true,
|
|
14284
|
-
force: true
|
|
14703
|
+
force: true,
|
|
14704
|
+
filter: (source) => _path2.default.dirname(source) !== runtimeDir || !PRISMA_RUNTIME_GENERATE_ONLY_FILE.test(_path2.default.basename(source))
|
|
14285
14705
|
});
|
|
14286
14706
|
await fs5.cp(generatedClientDir, targetGeneratedDir, {
|
|
14287
14707
|
recursive: true,
|
|
@@ -14331,7 +14751,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
14331
14751
|
// src/build/index.ts
|
|
14332
14752
|
async function build(config, options = {}) {
|
|
14333
14753
|
return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
|
|
14334
|
-
() =>
|
|
14754
|
+
() => _chunkJNZDTE75cjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
14335
14755
|
);
|
|
14336
14756
|
}
|
|
14337
14757
|
function createBuildTargetBaseline(config) {
|
|
@@ -14342,7 +14762,7 @@ function createBuildTargetBaseline(config) {
|
|
|
14342
14762
|
preset,
|
|
14343
14763
|
distDir,
|
|
14344
14764
|
outputDir,
|
|
14345
|
-
outputWasDerived: outputDir ===
|
|
14765
|
+
outputWasDerived: outputDir === _chunkNPGXX7HNcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
14346
14766
|
};
|
|
14347
14767
|
}
|
|
14348
14768
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -14351,8 +14771,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
14351
14771
|
const distDir = config.distDir || ".farm";
|
|
14352
14772
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
14353
14773
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
14354
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
14355
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
14774
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkNPGXX7HNcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
14775
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkNPGXX7HNcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
14356
14776
|
return {
|
|
14357
14777
|
root,
|
|
14358
14778
|
preset,
|
|
@@ -14360,7 +14780,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
14360
14780
|
distDir,
|
|
14361
14781
|
deployTarget,
|
|
14362
14782
|
outputDir,
|
|
14363
|
-
deployOutputDir:
|
|
14783
|
+
deployOutputDir: _chunkNPGXX7HNcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
14364
14784
|
};
|
|
14365
14785
|
}
|
|
14366
14786
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -14397,16 +14817,16 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
14397
14817
|
};
|
|
14398
14818
|
config = {
|
|
14399
14819
|
...config,
|
|
14400
|
-
images:
|
|
14820
|
+
images: _chunkIK33N2ANcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
14401
14821
|
root: targets.root,
|
|
14402
14822
|
preset: targets.preset
|
|
14403
14823
|
})
|
|
14404
14824
|
};
|
|
14405
|
-
if (_optionalChain([config, 'access',
|
|
14825
|
+
if (_optionalChain([config, 'access', _353 => _353.docs, 'optionalAccess', _354 => _354.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
|
|
14406
14826
|
pluginManager.updateContext({ config });
|
|
14407
14827
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
14408
|
-
|
|
14409
|
-
|
|
14828
|
+
_chunkJNZDTE75cjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkJNZDTE75cjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
14829
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
14410
14830
|
await pluginManager.setupPlugins();
|
|
14411
14831
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
14412
14832
|
root,
|
|
@@ -14415,10 +14835,10 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
14415
14835
|
distDir,
|
|
14416
14836
|
outputDir: deployOutputDir
|
|
14417
14837
|
});
|
|
14418
|
-
|
|
14838
|
+
_chunkGC5ROI3Acjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
14419
14839
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
14420
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
14421
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
14840
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _355 => _355.status]) === "rejected") throw productionViteResult.reason;
|
|
14841
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _356 => _356.value]);
|
|
14422
14842
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
14423
14843
|
projectModuleServer = await createProjectModuleServer(
|
|
14424
14844
|
createViteServer,
|
|
@@ -14426,28 +14846,28 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
14426
14846
|
root,
|
|
14427
14847
|
rendererBuild.signal
|
|
14428
14848
|
);
|
|
14429
|
-
const farmApp =
|
|
14849
|
+
const farmApp = _chunkIK33N2ANcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
14430
14850
|
if (options.universal !== false) farmApp.getRouteManager().keepBuildSourceSnapshot();
|
|
14431
14851
|
await farmApp.initialize();
|
|
14432
14852
|
const routeManager = farmApp.getRouteManager();
|
|
14433
14853
|
const serverRenderer = farmApp.getServerRenderer();
|
|
14434
|
-
const typeArtifacts =
|
|
14854
|
+
const typeArtifacts = _chunk7564NP5Zcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
14435
14855
|
root,
|
|
14436
14856
|
srcDir,
|
|
14437
14857
|
layers: config.layers,
|
|
14438
14858
|
plugins: config.plugins,
|
|
14439
14859
|
extraRoutes: [
|
|
14440
|
-
..._optionalChain([config, 'access',
|
|
14441
|
-
...
|
|
14860
|
+
..._optionalChain([config, 'access', _357 => _357.openapi, 'optionalAccess', _358 => _358.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
14861
|
+
..._chunk6D3CJFNUcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
14442
14862
|
],
|
|
14443
14863
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
14444
14864
|
componentExtensions: config.renderer.componentExtensions,
|
|
14445
14865
|
i18nConfig: config.i18n
|
|
14446
14866
|
}).catch((error) => {
|
|
14447
14867
|
const message = error instanceof Error ? error.message : String(error);
|
|
14448
|
-
|
|
14868
|
+
_chunkGC5ROI3Acjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
14449
14869
|
});
|
|
14450
|
-
const apiRouteManager = new (0,
|
|
14870
|
+
const apiRouteManager = new (0, _chunkHFJLMALCcjs.APIRouteManager)(
|
|
14451
14871
|
_chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config),
|
|
14452
14872
|
projectModuleServer,
|
|
14453
14873
|
{
|
|
@@ -14473,11 +14893,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
14473
14893
|
});
|
|
14474
14894
|
} else {
|
|
14475
14895
|
const { build: legacyViteBuild } = await import("vite");
|
|
14476
|
-
|
|
14896
|
+
_chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Building client bundle...");
|
|
14477
14897
|
await buildClient2(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "client"));
|
|
14478
|
-
|
|
14898
|
+
_chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Building SSR bundle...");
|
|
14479
14899
|
await buildSSR(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "server"));
|
|
14480
|
-
|
|
14900
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
|
|
14481
14901
|
await buildNitro(
|
|
14482
14902
|
config,
|
|
14483
14903
|
routeManager,
|
|
@@ -14498,8 +14918,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
14498
14918
|
outputDir: deployOutputDir,
|
|
14499
14919
|
success: true
|
|
14500
14920
|
});
|
|
14501
|
-
|
|
14502
|
-
|
|
14921
|
+
_chunkGC5ROI3Acjs.logger.success(`\u2705 Build completed successfully! (preset: ${preset})`);
|
|
14922
|
+
_chunkGC5ROI3Acjs.logger.info(`\u{1F4C1} Output directory: ${deployOutputDir}`);
|
|
14503
14923
|
} catch (error) {
|
|
14504
14924
|
const { root, preset, distDir, deployOutputDir } = _nullishCoalesce(targets, () => ( resolveBuildTargets(config, options, targetBaseline)));
|
|
14505
14925
|
await pluginManager.runHookParallel("onError", {
|
|
@@ -14518,11 +14938,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
14518
14938
|
outputDir: deployOutputDir,
|
|
14519
14939
|
success: false
|
|
14520
14940
|
});
|
|
14521
|
-
|
|
14941
|
+
_chunkGC5ROI3Acjs.logger.error(`\u274C Build failed: ${error}`);
|
|
14522
14942
|
throw error;
|
|
14523
14943
|
} finally {
|
|
14524
14944
|
try {
|
|
14525
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
14945
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _359 => _359.close, 'call', _360 => _360()]);
|
|
14526
14946
|
} finally {
|
|
14527
14947
|
rendererBuild.abort();
|
|
14528
14948
|
}
|
|
@@ -14534,7 +14954,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
14534
14954
|
ssr: true,
|
|
14535
14955
|
buildLifetime
|
|
14536
14956
|
});
|
|
14537
|
-
const viteConfig =
|
|
14957
|
+
const viteConfig = _chunkIK33N2ANcjs.mergeFarmViteConfig.call(void 0,
|
|
14538
14958
|
{
|
|
14539
14959
|
root,
|
|
14540
14960
|
appType: "custom",
|
|
@@ -14546,24 +14966,27 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
14546
14966
|
},
|
|
14547
14967
|
plugins: [
|
|
14548
14968
|
...rendererVitePlugins,
|
|
14549
|
-
|
|
14969
|
+
_chunkIK33N2ANcjs.farmFontImportsPlugin.call(void 0, {
|
|
14550
14970
|
root,
|
|
14551
14971
|
basePath: config.basePath,
|
|
14552
14972
|
publicDir: config.publicDir
|
|
14553
14973
|
}),
|
|
14554
|
-
|
|
14974
|
+
_chunkJNZDTE75cjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
|
|
14555
14975
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
14556
14976
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
14557
14977
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
14558
14978
|
// which a docs build waited on after its bundles.
|
|
14559
|
-
farmServerOnlyEntriesPlugin({
|
|
14979
|
+
farmServerOnlyEntriesPlugin({
|
|
14980
|
+
prebundleServerPackages: true,
|
|
14981
|
+
distDir: config.distDir || ".farm"
|
|
14982
|
+
})
|
|
14560
14983
|
],
|
|
14561
14984
|
server: {
|
|
14562
14985
|
middlewareMode: true,
|
|
14563
14986
|
hmr: false
|
|
14564
14987
|
},
|
|
14565
14988
|
resolve: {
|
|
14566
|
-
alias:
|
|
14989
|
+
alias: _chunkIK33N2ANcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
14567
14990
|
dedupe: [...config.renderer.dedupe || []]
|
|
14568
14991
|
},
|
|
14569
14992
|
optimizeDeps: {
|
|
@@ -14602,10 +15025,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
14602
15025
|
noDiscovery: true
|
|
14603
15026
|
},
|
|
14604
15027
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
14605
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
15028
|
+
environments: _optionalChain([viteConfig, 'access', _361 => _361.environments, 'optionalAccess', _362 => _362.ssr, 'optionalAccess', _363 => _363.dev, 'optionalAccess', _364 => _364.createEnvironment]) ? viteConfig.environments : {
|
|
14606
15029
|
...viteConfig.environments,
|
|
14607
15030
|
ssr: {
|
|
14608
|
-
..._optionalChain([viteConfig, 'access',
|
|
15031
|
+
..._optionalChain([viteConfig, 'access', _365 => _365.environments, 'optionalAccess', _366 => _366.ssr]),
|
|
14609
15032
|
...await createFarmProjectModuleSsrEnvironment()
|
|
14610
15033
|
}
|
|
14611
15034
|
}
|
|
@@ -14618,7 +15041,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
14618
15041
|
farmPlugin,
|
|
14619
15042
|
farmServerOnlyEntriesPlugin
|
|
14620
15043
|
} = await import("./vite.cjs");
|
|
14621
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15044
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-5BNPYCER.cjs");
|
|
14622
15045
|
const pluginManager = new PluginManager2({
|
|
14623
15046
|
config,
|
|
14624
15047
|
isDev: false,
|
|
@@ -14636,17 +15059,17 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
14636
15059
|
},
|
|
14637
15060
|
plugins: [
|
|
14638
15061
|
farmI18nClientBridgePlugin(),
|
|
14639
|
-
farmServerOnlyEntriesPlugin(),
|
|
15062
|
+
farmServerOnlyEntriesPlugin({ distDir: config.distDir || ".farm" }),
|
|
14640
15063
|
farmIslandContainersPlugin(config),
|
|
14641
15064
|
farmPlugin(config, pluginManager),
|
|
14642
|
-
|
|
15065
|
+
_chunkJNZDTE75cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
14643
15066
|
],
|
|
14644
15067
|
mode: "production"
|
|
14645
15068
|
});
|
|
14646
15069
|
}
|
|
14647
15070
|
async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
14648
15071
|
const { farmI18nClientBridgePlugin, farmIslandContainersPlugin, farmPlugin } = await import("./vite.cjs");
|
|
14649
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15072
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-5BNPYCER.cjs");
|
|
14650
15073
|
const pluginManager = new PluginManager2({
|
|
14651
15074
|
config,
|
|
14652
15075
|
isDev: false,
|
|
@@ -14667,13 +15090,13 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
14667
15090
|
define: {
|
|
14668
15091
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
14669
15092
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
14670
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
15093
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _367 => _367.env, 'optionalAccess', _368 => _368.public]) || {})
|
|
14671
15094
|
},
|
|
14672
15095
|
plugins: [
|
|
14673
15096
|
farmI18nClientBridgePlugin(),
|
|
14674
15097
|
farmIslandContainersPlugin(config),
|
|
14675
15098
|
farmPlugin(config, pluginManager),
|
|
14676
|
-
|
|
15099
|
+
_chunkJNZDTE75cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
14677
15100
|
],
|
|
14678
15101
|
mode: "production"
|
|
14679
15102
|
});
|
|
@@ -14688,7 +15111,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
|
|
|
14688
15111
|
}
|
|
14689
15112
|
async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
|
|
14690
15113
|
const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
|
|
14691
|
-
import("./nitro-
|
|
15114
|
+
import("./nitro-HKMVYIXY.cjs"),
|
|
14692
15115
|
import("nitro/builder")
|
|
14693
15116
|
]);
|
|
14694
15117
|
let nitroConfig = await createNitroConfig(
|
|
@@ -14701,7 +15124,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
14701
15124
|
if (pluginManager) {
|
|
14702
15125
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
14703
15126
|
}
|
|
14704
|
-
const outputDir =
|
|
15127
|
+
const outputDir = _chunkNPGXX7HNcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
14705
15128
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
14706
15129
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
14707
15130
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -14711,7 +15134,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
14711
15134
|
try {
|
|
14712
15135
|
await mkdir(publicOutputDir, { recursive: true });
|
|
14713
15136
|
await cp(clientDir, publicOutputDir, { recursive: true });
|
|
14714
|
-
|
|
15137
|
+
_chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Copied client assets to public directory");
|
|
14715
15138
|
const manifestPath = _path2.default.join(publicOutputDir, "farm-client-manifest.json");
|
|
14716
15139
|
const assetsDir = _path2.default.join(publicOutputDir, "assets");
|
|
14717
15140
|
const manifestExists = await import("fs/promises").then(
|
|
@@ -14721,12 +15144,12 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
14721
15144
|
(fs5) => fs5.access(assetsDir).then(() => true).catch(() => false)
|
|
14722
15145
|
);
|
|
14723
15146
|
if (manifestExists && assetsExist) {
|
|
14724
|
-
|
|
15147
|
+
_chunkGC5ROI3Acjs.logger.info("\u2705 Verified client assets are present");
|
|
14725
15148
|
} else {
|
|
14726
|
-
|
|
15149
|
+
_chunkGC5ROI3Acjs.logger.warn("\u26A0\uFE0F Some client assets may be missing");
|
|
14727
15150
|
}
|
|
14728
15151
|
} catch (error) {
|
|
14729
|
-
|
|
15152
|
+
_chunkGC5ROI3Acjs.logger.error(`\u274C Failed to copy client assets: ${error}`);
|
|
14730
15153
|
throw error;
|
|
14731
15154
|
}
|
|
14732
15155
|
const serverDir = _path2.default.join(root, distDir, "server");
|
|
@@ -14734,9 +15157,9 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
14734
15157
|
try {
|
|
14735
15158
|
await mkdir(nitroServerDir, { recursive: true });
|
|
14736
15159
|
await cp(serverDir, nitroServerDir, { recursive: true });
|
|
14737
|
-
|
|
15160
|
+
_chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Copied SSR bundles to Nitro server directory");
|
|
14738
15161
|
} catch (error) {
|
|
14739
|
-
|
|
15162
|
+
_chunkGC5ROI3Acjs.logger.warn(`Could not copy SSR bundles: ${error}`);
|
|
14740
15163
|
}
|
|
14741
15164
|
const nitro = await createNitro(nitroConfig);
|
|
14742
15165
|
const registryPath = _path2.default.join(root, distDir, ".nitro", "server", "farm-registry.ts");
|
|
@@ -14764,7 +15187,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
14764
15187
|
farmRegistry.clientManifest = {};
|
|
14765
15188
|
}
|
|
14766
15189
|
} catch (error) {
|
|
14767
|
-
|
|
15190
|
+
_chunkGC5ROI3Acjs.logger.warn(`Could not populate registry: ${error}`);
|
|
14768
15191
|
}
|
|
14769
15192
|
await nitroBuild(nitro);
|
|
14770
15193
|
if (pluginManager) {
|
|
@@ -14772,7 +15195,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
14772
15195
|
root,
|
|
14773
15196
|
preset,
|
|
14774
15197
|
distDir,
|
|
14775
|
-
outputDir:
|
|
15198
|
+
outputDir: _chunkNPGXX7HNcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
14776
15199
|
});
|
|
14777
15200
|
}
|
|
14778
15201
|
}
|