@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
|
@@ -7,10 +7,10 @@ var _chunk3QM74STYcjs = require('./chunk-3QM74STY.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkVJ6L7TIIcjs = require('./chunk-VJ6L7TII.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkRDADQG5Scjs = require('./chunk-RDADQG5S.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -38,12 +38,14 @@ var _chunkO47W53D3cjs = require('./chunk-O47W53D3.cjs');
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
var _chunk56HHUSR5cjs = require('./chunk-56HHUSR5.cjs');
|
|
42
41
|
|
|
43
42
|
|
|
43
|
+
var _chunkIK33N2ANcjs = require('./chunk-IK33N2AN.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
var _chunkHVJ7IACBcjs = require('./chunk-HVJ7IACB.cjs');
|
|
47
49
|
|
|
48
50
|
|
|
49
51
|
var _chunkPMU4U2W2cjs = require('./chunk-PMU4U2W2.cjs');
|
|
@@ -53,24 +55,23 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
|
|
56
|
-
var
|
|
58
|
+
var _chunk7564NP5Zcjs = require('./chunk-7564NP5Z.cjs');
|
|
57
59
|
|
|
58
60
|
|
|
59
61
|
|
|
60
62
|
|
|
61
|
-
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
62
63
|
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
|
|
67
|
+
var _chunkXGDI4OUBcjs = require('./chunk-XGDI4OUB.cjs');
|
|
66
68
|
|
|
67
69
|
|
|
70
|
+
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
68
71
|
|
|
69
72
|
|
|
70
|
-
var _chunkO2A6HE76cjs = require('./chunk-O2A6HE76.cjs');
|
|
71
73
|
|
|
72
74
|
|
|
73
|
-
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
74
75
|
|
|
75
76
|
|
|
76
77
|
|
|
@@ -81,17 +82,18 @@ var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
|
81
82
|
|
|
82
83
|
|
|
83
84
|
|
|
85
|
+
var _chunkWJ5CCQBMcjs = require('./chunk-WJ5CCQBM.cjs');
|
|
84
86
|
|
|
85
87
|
|
|
88
|
+
var _chunkYRXPDKMMcjs = require('./chunk-YRXPDKMM.cjs');
|
|
86
89
|
|
|
87
90
|
|
|
88
|
-
var
|
|
91
|
+
var _chunkKPYQ32BAcjs = require('./chunk-KPYQ32BA.cjs');
|
|
89
92
|
|
|
90
93
|
|
|
91
|
-
var _chunkVKRMO3EZcjs = require('./chunk-VKRMO3EZ.cjs');
|
|
92
94
|
|
|
93
95
|
|
|
94
|
-
var
|
|
96
|
+
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
95
97
|
|
|
96
98
|
|
|
97
99
|
var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
@@ -135,7 +137,9 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
135
137
|
|
|
136
138
|
|
|
137
139
|
|
|
138
|
-
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
var _chunkJNZDTE75cjs = require('./chunk-JNZDTE75.cjs');
|
|
139
143
|
|
|
140
144
|
|
|
141
145
|
|
|
@@ -149,7 +153,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
|
|
|
149
153
|
var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
|
|
150
154
|
|
|
151
155
|
|
|
152
|
-
var
|
|
156
|
+
var _chunkIIHZ2BEEcjs = require('./chunk-IIHZ2BEE.cjs');
|
|
153
157
|
|
|
154
158
|
|
|
155
159
|
|
|
@@ -159,10 +163,10 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
159
163
|
|
|
160
164
|
|
|
161
165
|
|
|
162
|
-
var
|
|
166
|
+
var _chunkF4ID7BGOcjs = require('./chunk-F4ID7BGO.cjs');
|
|
163
167
|
|
|
164
168
|
|
|
165
|
-
var
|
|
169
|
+
var _chunkWRWJ7IWTcjs = require('./chunk-WRWJ7IWT.cjs');
|
|
166
170
|
|
|
167
171
|
|
|
168
172
|
var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
|
|
@@ -192,7 +196,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
|
192
196
|
|
|
193
197
|
|
|
194
198
|
|
|
195
|
-
var
|
|
199
|
+
var _chunkPG7J7XYTcjs = require('./chunk-PG7J7XYT.cjs');
|
|
196
200
|
|
|
197
201
|
|
|
198
202
|
|
|
@@ -204,21 +208,21 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
|
204
208
|
|
|
205
209
|
|
|
206
210
|
|
|
207
|
-
var
|
|
211
|
+
var _chunk2YJ4DHTDcjs = require('./chunk-2YJ4DHTD.cjs');
|
|
208
212
|
|
|
209
213
|
|
|
210
214
|
|
|
211
215
|
|
|
212
216
|
|
|
213
217
|
|
|
214
|
-
var
|
|
218
|
+
var _chunk6DBBMQWTcjs = require('./chunk-6DBBMQWT.cjs');
|
|
215
219
|
|
|
216
220
|
|
|
217
221
|
|
|
218
222
|
var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
|
|
219
223
|
|
|
220
224
|
|
|
221
|
-
var
|
|
225
|
+
var _chunkWW62HKA2cjs = require('./chunk-WW62HKA2.cjs');
|
|
222
226
|
|
|
223
227
|
|
|
224
228
|
|
|
@@ -234,10 +238,10 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
|
|
|
234
238
|
var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
|
|
235
239
|
|
|
236
240
|
|
|
237
|
-
var
|
|
241
|
+
var _chunkHFJLMALCcjs = require('./chunk-HFJLMALC.cjs');
|
|
238
242
|
|
|
239
243
|
|
|
240
|
-
var
|
|
244
|
+
var _chunkSXXSQVKKcjs = require('./chunk-SXXSQVKK.cjs');
|
|
241
245
|
|
|
242
246
|
|
|
243
247
|
|
|
@@ -246,15 +250,15 @@ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
|
|
|
246
250
|
|
|
247
251
|
|
|
248
252
|
|
|
249
|
-
var
|
|
253
|
+
var _chunk4VLXQ55Ocjs = require('./chunk-4VLXQ55O.cjs');
|
|
250
254
|
|
|
251
255
|
|
|
252
|
-
var
|
|
256
|
+
var _chunkRKQOMG2Xcjs = require('./chunk-RKQOMG2X.cjs');
|
|
253
257
|
|
|
254
258
|
|
|
255
259
|
|
|
256
260
|
|
|
257
|
-
var
|
|
261
|
+
var _chunkYUCU6XB4cjs = require('./chunk-YUCU6XB4.cjs');
|
|
258
262
|
|
|
259
263
|
|
|
260
264
|
var _chunkY3WG64CPcjs = require('./chunk-Y3WG64CP.cjs');
|
|
@@ -267,7 +271,7 @@ var _chunkJRGR5Z4Kcjs = require('./chunk-JRGR5Z4K.cjs');
|
|
|
267
271
|
|
|
268
272
|
|
|
269
273
|
|
|
270
|
-
var
|
|
274
|
+
var _chunk25JGHAGHcjs = require('./chunk-25JGHAGH.cjs');
|
|
271
275
|
|
|
272
276
|
|
|
273
277
|
|
|
@@ -276,7 +280,7 @@ var _chunkZMSVKVI3cjs = require('./chunk-ZMSVKVI3.cjs');
|
|
|
276
280
|
|
|
277
281
|
|
|
278
282
|
|
|
279
|
-
var
|
|
283
|
+
var _chunkGC5ROI3Acjs = require('./chunk-GC5ROI3A.cjs');
|
|
280
284
|
|
|
281
285
|
|
|
282
286
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
@@ -286,7 +290,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
|
286
290
|
|
|
287
291
|
|
|
288
292
|
|
|
289
|
-
var
|
|
293
|
+
var _chunk7Q7UB4TLcjs = require('./chunk-7Q7UB4TL.cjs');
|
|
290
294
|
|
|
291
295
|
|
|
292
296
|
|
|
@@ -297,7 +301,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
297
301
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
298
302
|
|
|
299
303
|
|
|
300
|
-
var
|
|
304
|
+
var _chunkIVBDRAORcjs = require('./chunk-IVBDRAOR.cjs');
|
|
301
305
|
|
|
302
306
|
|
|
303
307
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -309,7 +313,8 @@ var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
|
|
|
309
313
|
|
|
310
314
|
|
|
311
315
|
|
|
312
|
-
|
|
316
|
+
|
|
317
|
+
var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
|
|
313
318
|
|
|
314
319
|
|
|
315
320
|
var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
|
|
@@ -321,18 +326,19 @@ var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
|
|
|
321
326
|
var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
|
|
322
327
|
|
|
323
328
|
|
|
329
|
+
|
|
324
330
|
var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
325
331
|
|
|
326
332
|
|
|
327
333
|
|
|
328
334
|
|
|
329
335
|
|
|
330
|
-
var
|
|
336
|
+
var _chunkH7OFZJCVcjs = require('./chunk-H7OFZJCV.cjs');
|
|
331
337
|
|
|
332
338
|
|
|
333
339
|
|
|
334
340
|
|
|
335
|
-
var
|
|
341
|
+
var _chunk2RSVYJT6cjs = require('./chunk-2RSVYJT6.cjs');
|
|
336
342
|
|
|
337
343
|
|
|
338
344
|
var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
@@ -621,7 +627,8 @@ var VITE_MODULE_QUERY_FLAGS = [
|
|
|
621
627
|
];
|
|
622
628
|
var SCRIPT_FETCH_DESTINATIONS = /* @__PURE__ */ new Set(["script", "worker", "sharedworker", "serviceworker"]);
|
|
623
629
|
function isViteModuleRequest(url, headers) {
|
|
624
|
-
if (VITE_MODULE_QUERY_FLAGS.some((flag) => url.searchParams.
|
|
630
|
+
if (VITE_MODULE_QUERY_FLAGS.some((flag) => url.searchParams.getAll(flag).includes("")))
|
|
631
|
+
return true;
|
|
625
632
|
const destination = headers["sec-fetch-dest"];
|
|
626
633
|
const value = Array.isArray(destination) ? destination[0] : destination;
|
|
627
634
|
return value !== void 0 && SCRIPT_FETCH_DESTINATIONS.has(value.toLowerCase());
|
|
@@ -693,7 +700,7 @@ function findClientServerFnViolation(code, id) {
|
|
|
693
700
|
return null;
|
|
694
701
|
}
|
|
695
702
|
function createServerFnBoundaryDiagnostic(violation, id, location) {
|
|
696
|
-
return
|
|
703
|
+
return _chunkJNZDTE75cjs.createFarmDiagnostic.call(void 0,
|
|
697
704
|
"CLIENT_SERVER_FUNCTION",
|
|
698
705
|
id,
|
|
699
706
|
`${violation.factory} handlers run only on the server, but this module is bundled into the client, so the handler and its Node-only imports would run in the browser.`,
|
|
@@ -952,21 +959,21 @@ function readPropertyKey(property) {
|
|
|
952
959
|
function createClientBoundaryDiagnostic(file, finding, location) {
|
|
953
960
|
switch (finding.kind) {
|
|
954
961
|
case "server-env":
|
|
955
|
-
return
|
|
962
|
+
return _chunkJNZDTE75cjs.createFarmDiagnostic.call(void 0,
|
|
956
963
|
"CLIENT_SERVER_ENV",
|
|
957
964
|
file,
|
|
958
965
|
`process.env.${finding.name} is read at module scope in a module compiled for the browser, where it is undefined.`,
|
|
959
966
|
location
|
|
960
967
|
);
|
|
961
968
|
case "public-env":
|
|
962
|
-
return
|
|
969
|
+
return _chunkJNZDTE75cjs.createFarmDiagnostic.call(void 0,
|
|
963
970
|
"CLIENT_PROCESS_ENV_PUBLIC",
|
|
964
971
|
file,
|
|
965
972
|
`process.env.${finding.name} is declared public, but process.env is not populated in the browser, so this module-scope read is undefined there.`,
|
|
966
973
|
location
|
|
967
974
|
);
|
|
968
975
|
case "builtin":
|
|
969
|
-
return
|
|
976
|
+
return _chunkJNZDTE75cjs.createFarmDiagnostic.call(void 0,
|
|
970
977
|
"CLIENT_NODE_BUILTIN",
|
|
971
978
|
file,
|
|
972
979
|
`"${finding.name}" is imported into a module compiled for the browser, which gets a stub whose exports without a Web API equivalent are undefined.`,
|
|
@@ -1205,7 +1212,7 @@ function resolveFarmPageDataFailure(error) {
|
|
|
1205
1212
|
}
|
|
1206
1213
|
|
|
1207
1214
|
// src/openapi/dev-status.ts
|
|
1208
|
-
function reportOpenAPIDevGenerationResult(spec, output =
|
|
1215
|
+
function reportOpenAPIDevGenerationResult(spec, output = _chunkGC5ROI3Acjs.logger) {
|
|
1209
1216
|
if (spec) {
|
|
1210
1217
|
output.success("\u2705 OpenAPI documentation enabled");
|
|
1211
1218
|
return;
|
|
@@ -1216,13 +1223,13 @@ function reportOpenAPIDevGenerationResult(spec, output = _chunkQMNWKQL4cjs.logge
|
|
|
1216
1223
|
// src/vite.ts
|
|
1217
1224
|
var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
|
|
1218
1225
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
1219
|
-
const llms =
|
|
1226
|
+
const llms = _chunkWRWJ7IWTcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _62 => _62.agent, 'optionalAccess', _63 => _63.llmsTxt]));
|
|
1220
1227
|
if (!llms.enabled) return [];
|
|
1221
1228
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
1222
1229
|
}
|
|
1223
1230
|
function farmAgentGeneratedPaths(config) {
|
|
1224
|
-
const crawlers =
|
|
1225
|
-
const sitemap =
|
|
1231
|
+
const crawlers = _chunkF4ID7BGOcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _64 => _64.agent, 'optionalAccess', _65 => _65.crawlers]));
|
|
1232
|
+
const sitemap = _chunkF4ID7BGOcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _66 => _66.agent, 'optionalAccess', _67 => _67.sitemap]));
|
|
1226
1233
|
return [
|
|
1227
1234
|
...farmLlmsTxtGeneratedPaths(config),
|
|
1228
1235
|
...sitemap.enabled ? ["/sitemap.xml"] : [],
|
|
@@ -1261,13 +1268,13 @@ function loadFarmDocsSearchDevRuntime() {
|
|
|
1261
1268
|
return import("./search-client-ZZLKVO5R.cjs");
|
|
1262
1269
|
}
|
|
1263
1270
|
function loadFarmOpenAPIDevRuntime() {
|
|
1264
|
-
return import("./manager-
|
|
1271
|
+
return import("./manager-R7FV4A56.cjs");
|
|
1265
1272
|
}
|
|
1266
1273
|
function loadFarmWorkflowsDevRuntime() {
|
|
1267
1274
|
return import("./workflows.cjs");
|
|
1268
1275
|
}
|
|
1269
1276
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
1270
|
-
return import("./devtools-
|
|
1277
|
+
return import("./devtools-T5I2WHRX.cjs");
|
|
1271
1278
|
}
|
|
1272
1279
|
function loadFarmDevtoolsUIRuntime() {
|
|
1273
1280
|
return import("./devtools-ui-SYRUXUA7.cjs");
|
|
@@ -1298,16 +1305,16 @@ var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
|
|
|
1298
1305
|
var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
|
|
1299
1306
|
var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
|
|
1300
1307
|
var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
|
|
1301
|
-
|
|
1302
|
-
new RegExp(`^${
|
|
1308
|
+
_chunkIK33N2ANcjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
|
|
1309
|
+
new RegExp(`^${_chunkJNZDTE75cjs.FARM_RESOLVE_FROM_PREFIX}`),
|
|
1303
1310
|
// What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
|
|
1304
1311
|
// included.
|
|
1305
1312
|
/^node:/,
|
|
1306
|
-
|
|
1313
|
+
_chunkIK33N2ANcjs.exactIdPattern.call(void 0, _module.builtinModules)
|
|
1307
1314
|
];
|
|
1308
1315
|
var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
|
|
1309
|
-
|
|
1310
|
-
new RegExp(`^${
|
|
1316
|
+
_chunkIK33N2ANcjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
|
|
1317
|
+
new RegExp(`^${_chunkJNZDTE75cjs.FARM_BROWSER_BUILTIN_PREFIX}`)
|
|
1311
1318
|
];
|
|
1312
1319
|
function createFarmPlatformClientModule(platform) {
|
|
1313
1320
|
return `export function platform() { return ${JSON.stringify(platform)}; }
|
|
@@ -1343,18 +1350,18 @@ function farmIslandContainersPlugin(config) {
|
|
|
1343
1350
|
if (id.startsWith("\0") || id.includes("/node_modules/") || !/\.[jt]sx(?:$|\?)/.test(id)) {
|
|
1344
1351
|
return null;
|
|
1345
1352
|
}
|
|
1346
|
-
if (
|
|
1353
|
+
if (_chunkJNZDTE75cjs.hasUseClientDirective.call(void 0, code)) return null;
|
|
1347
1354
|
const file = id.split("?", 1)[0];
|
|
1348
|
-
const bindings =
|
|
1355
|
+
const bindings = _chunkJNZDTE75cjs.getFarmClientRenderingBindings.call(void 0, code, file, root);
|
|
1349
1356
|
if (bindings.length === 0) return null;
|
|
1350
|
-
const grown =
|
|
1357
|
+
const grown = _chunkJNZDTE75cjs.wrapFarmIslandContainers.call(void 0, {
|
|
1351
1358
|
code,
|
|
1352
1359
|
file,
|
|
1353
1360
|
bindings,
|
|
1354
|
-
reference:
|
|
1361
|
+
reference: _chunkJNZDTE75cjs.farmIslandContainerReferencePath.call(void 0, root)
|
|
1355
1362
|
});
|
|
1356
1363
|
if (grown === null) return null;
|
|
1357
|
-
|
|
1364
|
+
_chunkJNZDTE75cjs.ensureFarmIslandContainerReference.call(void 0, root);
|
|
1358
1365
|
return { code: grown, map: null };
|
|
1359
1366
|
}
|
|
1360
1367
|
};
|
|
@@ -1366,11 +1373,17 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1366
1373
|
name: "farm:server-only-entries",
|
|
1367
1374
|
enforce: "pre",
|
|
1368
1375
|
config(config) {
|
|
1369
|
-
const
|
|
1370
|
-
|
|
1371
|
-
|
|
1376
|
+
const appRoot = path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())));
|
|
1377
|
+
if (options.distDir) {
|
|
1378
|
+
_chunkJNZDTE75cjs.usePackageScanCacheFile.call(void 0,
|
|
1379
|
+
path6.resolve(appRoot, options.distDir, "cache", "package-scans.json")
|
|
1380
|
+
);
|
|
1381
|
+
}
|
|
1382
|
+
const bundledPackages = _chunkJNZDTE75cjs.collectFarmServerBundledPackageInfo.call(void 0, appRoot);
|
|
1383
|
+
const prebundle = options.prebundleServerPackages ? createFarmServerPrebundleConfig(bundledPackages) : {};
|
|
1384
|
+
_chunkJNZDTE75cjs.persistPackageScanCache.call(void 0, );
|
|
1372
1385
|
return {
|
|
1373
|
-
optimizeDeps: { rolldownOptions: { plugins: [
|
|
1386
|
+
optimizeDeps: { rolldownOptions: { plugins: [_chunkJNZDTE75cjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
|
|
1374
1387
|
ssr: {
|
|
1375
1388
|
noExternal: [
|
|
1376
1389
|
// Resolve `server-only` here rather than in Node, which would load its throwing build.
|
|
@@ -1378,7 +1391,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1378
1391
|
// Packages Node cannot load as a bundler does (stylesheet imports, `module`-only ESM).
|
|
1379
1392
|
...bundledPackages.map(({ name }) => name)
|
|
1380
1393
|
],
|
|
1381
|
-
...
|
|
1394
|
+
...prebundle
|
|
1382
1395
|
}
|
|
1383
1396
|
};
|
|
1384
1397
|
},
|
|
@@ -1394,8 +1407,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1394
1407
|
return FARM_SERVER_ONLY_PACKAGE_ID;
|
|
1395
1408
|
}
|
|
1396
1409
|
this.error(
|
|
1397
|
-
|
|
1398
|
-
|
|
1410
|
+
_chunkJNZDTE75cjs.formatFarmDiagnostic.call(void 0,
|
|
1411
|
+
_chunkJNZDTE75cjs.createFarmDiagnostic.call(void 0,
|
|
1399
1412
|
"CLIENT_SERVER_ONLY_IMPORT",
|
|
1400
1413
|
_nullishCoalesce(importer, () => ( "<unknown module>")),
|
|
1401
1414
|
`${importer ? "This module" : "A module"} imports "server-only", so it must not reach the browser, but client code imports it.`
|
|
@@ -1405,9 +1418,9 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1405
1418
|
);
|
|
1406
1419
|
}
|
|
1407
1420
|
if (!_optionalChain([options2, 'optionalAccess', _74 => _74.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
1408
|
-
return
|
|
1421
|
+
return _chunkJNZDTE75cjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
1409
1422
|
}
|
|
1410
|
-
const resolveFrom = importer ?
|
|
1423
|
+
const resolveFrom = importer ? _chunkJNZDTE75cjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
|
|
1411
1424
|
if (resolveFrom) {
|
|
1412
1425
|
const directory = path6.dirname(resolveFrom.importer);
|
|
1413
1426
|
return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
|
|
@@ -1424,8 +1437,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1424
1437
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
1425
1438
|
if (!_optionalChain([options2, 'optionalAccess', _75 => _75.ssr])) {
|
|
1426
1439
|
this.error(
|
|
1427
|
-
|
|
1428
|
-
|
|
1440
|
+
_chunkJNZDTE75cjs.formatFarmDiagnostic.call(void 0,
|
|
1441
|
+
_chunkJNZDTE75cjs.createFarmDiagnostic.call(void 0,
|
|
1429
1442
|
"CLIENT_SERVER_ONLY_ENTRY",
|
|
1430
1443
|
_nullishCoalesce(importer, () => ( id)),
|
|
1431
1444
|
`${id} is server-only and cannot be imported into client code.`
|
|
@@ -1450,7 +1463,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1450
1463
|
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
1451
1464
|
return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
|
|
1452
1465
|
}
|
|
1453
|
-
return _nullishCoalesce(
|
|
1466
|
+
return _nullishCoalesce(_chunkJNZDTE75cjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
1454
1467
|
}
|
|
1455
1468
|
}
|
|
1456
1469
|
};
|
|
@@ -1483,7 +1496,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
1483
1496
|
if (!snapshot) return "";
|
|
1484
1497
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
1485
1498
|
if (snapshot.routing === "none") return runtime;
|
|
1486
|
-
return `${
|
|
1499
|
+
return `${_chunkXGDI4OUBcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
1487
1500
|
}
|
|
1488
1501
|
function getPublicEnvDefine(config) {
|
|
1489
1502
|
const publicEnv = _optionalChain([config, 'access', _76 => _76.env, 'optionalAccess', _77 => _77.public]);
|
|
@@ -1507,7 +1520,7 @@ function createRequestFromNodeRequest(req, url, signal) {
|
|
|
1507
1520
|
signal
|
|
1508
1521
|
});
|
|
1509
1522
|
}
|
|
1510
|
-
function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request) =>
|
|
1523
|
+
function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request) => _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, request)) {
|
|
1511
1524
|
const middleware = _chunkP2355C6Ecjs._withAfterNodeMiddleware.call(void 0, handler);
|
|
1512
1525
|
return (req, res, next) => {
|
|
1513
1526
|
const traceUrl = resolveTraceUrl(req);
|
|
@@ -1530,7 +1543,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request)
|
|
|
1530
1543
|
}
|
|
1531
1544
|
res.statusCode = 500;
|
|
1532
1545
|
res.setHeader("Content-Type", "application/json");
|
|
1533
|
-
res.end(
|
|
1546
|
+
res.end(_chunk4VLXQ55Ocjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
1534
1547
|
});
|
|
1535
1548
|
};
|
|
1536
1549
|
}
|
|
@@ -1538,10 +1551,10 @@ function sendFarmDevErrorJSON(res) {
|
|
|
1538
1551
|
res.statusCode = 500;
|
|
1539
1552
|
res.setHeader("Content-Type", "application/json");
|
|
1540
1553
|
res.setHeader("Cache-Control", "private, no-store");
|
|
1541
|
-
res.end(
|
|
1554
|
+
res.end(_chunk4VLXQ55Ocjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
1542
1555
|
}
|
|
1543
1556
|
function createFarmDevMiddlewareErrorResponse() {
|
|
1544
|
-
return new Response(
|
|
1557
|
+
return new Response(_chunk4VLXQ55Ocjs.FARM_INTERNAL_SERVER_ERROR_BODY, {
|
|
1545
1558
|
status: 500,
|
|
1546
1559
|
headers: { "Content-Type": "application/json", "Cache-Control": "private, no-store" }
|
|
1547
1560
|
});
|
|
@@ -1553,15 +1566,15 @@ function setFarmDevRuntimeHookErrorHead(res, json) {
|
|
|
1553
1566
|
}
|
|
1554
1567
|
function sendFarmDevRuntimeHookError(res, json) {
|
|
1555
1568
|
setFarmDevRuntimeHookErrorHead(res, json);
|
|
1556
|
-
res.end(json ?
|
|
1569
|
+
res.end(json ? _chunk4VLXQ55Ocjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
|
|
1557
1570
|
}
|
|
1558
1571
|
function opensFarmDevRuntimeSession(pm) {
|
|
1559
|
-
return pm.hasRuntimeRequestHooks() ||
|
|
1572
|
+
return pm.hasRuntimeRequestHooks() || _chunkHVJ7IACBcjs.hasFarmServerRuntimePlugins.call(void 0, pm.getPlugins());
|
|
1560
1573
|
}
|
|
1561
1574
|
var FARM_CONFIG_ROUTE_PLUGIN_NAMES = /* @__PURE__ */ new Set([
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1575
|
+
_chunkH7OFZJCVcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
1576
|
+
_chunkH7OFZJCVcjs.FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
|
|
1577
|
+
_chunkH7OFZJCVcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME
|
|
1565
1578
|
]);
|
|
1566
1579
|
function isFarmConfigRoutePlugin(plugin) {
|
|
1567
1580
|
return FARM_CONFIG_ROUTE_PLUGIN_NAMES.has(plugin.name);
|
|
@@ -1572,7 +1585,7 @@ async function proxyFarmExternalRewrite(req, res, bodySizeLimit) {
|
|
|
1572
1585
|
if (!destination || !/^https?:\/\//i.test(destination)) return false;
|
|
1573
1586
|
let request = createRequestFromNodeRequest(req, new URL(destination));
|
|
1574
1587
|
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
1575
|
-
const body = await
|
|
1588
|
+
const body = await _chunk7Q7UB4TLcjs.readNodeRequestBody.call(void 0, req, bodySizeLimit);
|
|
1576
1589
|
request = new Request(request, { method: request.method, body: toRequestBody(body) });
|
|
1577
1590
|
}
|
|
1578
1591
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, await _chunkJRGR5Z4Kcjs.fetchFarmExternalRewrite.call(void 0, request));
|
|
@@ -1683,7 +1696,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1683
1696
|
const writeRuntimeHookFailure = () => {
|
|
1684
1697
|
setFarmDevRuntimeHookErrorHead(res, Boolean(options.jsonError));
|
|
1685
1698
|
originalWriteHead(500);
|
|
1686
|
-
originalWrite(options.jsonError ?
|
|
1699
|
+
originalWrite(options.jsonError ? _chunk4VLXQ55Ocjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
|
|
1687
1700
|
};
|
|
1688
1701
|
const htmlChunks = [];
|
|
1689
1702
|
const responseChunks = [];
|
|
@@ -1961,7 +1974,7 @@ function fileContainsProgrammaticPageRoute(file) {
|
|
|
1961
1974
|
return false;
|
|
1962
1975
|
}
|
|
1963
1976
|
try {
|
|
1964
|
-
return
|
|
1977
|
+
return _chunkYUCU6XB4cjs.scanProgrammaticPagePaths.call(void 0, fs2.readFileSync(file, "utf8")).length > 0;
|
|
1965
1978
|
} catch (e15) {
|
|
1966
1979
|
return false;
|
|
1967
1980
|
}
|
|
@@ -2021,8 +2034,8 @@ function rewriteEarlySsrRelativeImports(options) {
|
|
|
2021
2034
|
const sourcePath = suffixIndex === -1 ? source.value : source.value.slice(0, suffixIndex);
|
|
2022
2035
|
const suffix = suffixIndex === -1 ? "" : source.value.slice(suffixIndex);
|
|
2023
2036
|
const resolvedPath = path6.resolve(path6.dirname(cleanId), sourcePath);
|
|
2024
|
-
const moduleId =
|
|
2025
|
-
const specifier = moduleId.startsWith("/@fs/") ?
|
|
2037
|
+
const moduleId = _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, resolvedPath, options.root);
|
|
2038
|
+
const specifier = moduleId.startsWith("/@fs/") ? _chunkGC5ROI3Acjs.toPosixPath.call(void 0, resolvedPath) : moduleId;
|
|
2026
2039
|
replacements.push({
|
|
2027
2040
|
start: source.start,
|
|
2028
2041
|
end: source.end,
|
|
@@ -2064,7 +2077,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
2064
2077
|
return null;
|
|
2065
2078
|
}
|
|
2066
2079
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
2067
|
-
const everyExportIsComponent = options.code.includes(
|
|
2080
|
+
const everyExportIsComponent = options.code.includes(_chunkJNZDTE75cjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkJNZDTE75cjs.FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
2068
2081
|
const replacements = [];
|
|
2069
2082
|
const wrapperStatements = [];
|
|
2070
2083
|
const originalEntries = [];
|
|
@@ -2215,16 +2228,16 @@ async function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
2215
2228
|
for (const finding of analyzeClientBoundary(program, publicKeys)) {
|
|
2216
2229
|
if (finding.kind === "builtin" && !finding.name.startsWith("node:")) {
|
|
2217
2230
|
const resolved = await context.resolve(finding.name, id).catch(() => null);
|
|
2218
|
-
if (!_optionalChain([resolved, 'optionalAccess', _102 => _102.id, 'access', _103 => _103.startsWith, 'call', _104 => _104(
|
|
2231
|
+
if (!_optionalChain([resolved, 'optionalAccess', _102 => _102.id, 'access', _103 => _103.startsWith, 'call', _104 => _104(_chunkJNZDTE75cjs.FARM_BROWSER_BUILTIN_PREFIX)])) continue;
|
|
2219
2232
|
}
|
|
2220
2233
|
findings.push(finding);
|
|
2221
2234
|
}
|
|
2222
2235
|
if (findings.length === 0) return;
|
|
2223
2236
|
warnedClientBoundaryIds.add(id);
|
|
2224
|
-
const locate =
|
|
2225
|
-
|
|
2237
|
+
const locate = _chunkJNZDTE75cjs.createFarmSourceLocator.call(void 0, code, () => context.getCombinedSourcemap());
|
|
2238
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
2226
2239
|
findings.map(
|
|
2227
|
-
(finding) =>
|
|
2240
|
+
(finding) => _chunkJNZDTE75cjs.formatFarmDiagnostic.call(void 0,
|
|
2228
2241
|
createClientBoundaryDiagnostic(id, finding, locate(finding.start)),
|
|
2229
2242
|
config.root
|
|
2230
2243
|
)
|
|
@@ -2265,7 +2278,7 @@ function hasFarmSourceAliasOverride(alias) {
|
|
|
2265
2278
|
function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
2266
2279
|
const rendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, options.renderer);
|
|
2267
2280
|
const imageImports = farmImageImportsPlugin();
|
|
2268
|
-
const fontImports =
|
|
2281
|
+
const fontImports = _chunkIK33N2ANcjs.farmFontImportsPlugin.call(void 0, {
|
|
2269
2282
|
root: options.root,
|
|
2270
2283
|
basePath: options.basePath,
|
|
2271
2284
|
publicDir: options.publicDir
|
|
@@ -2274,7 +2287,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2274
2287
|
const isFarmGeneratedOutput = (file) => {
|
|
2275
2288
|
const root = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _105 => _105.getConfig, 'call', _106 => _106(), 'access', _107 => _107.root]), () => ( options.root));
|
|
2276
2289
|
if (!root) return file.includes("/.farm/");
|
|
2277
|
-
const output =
|
|
2290
|
+
const output = _chunkGC5ROI3Acjs.toPosixPath.call(void 0, path6.resolve(root, options.distDir || ".farm"));
|
|
2278
2291
|
return file === output || file.startsWith(`${output}/`);
|
|
2279
2292
|
};
|
|
2280
2293
|
let serverFnTransformActive = false;
|
|
@@ -2344,11 +2357,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2344
2357
|
isBuild = configEnv.command === "build";
|
|
2345
2358
|
const farmAliases = {
|
|
2346
2359
|
..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, options.layers),
|
|
2347
|
-
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _125 => _125.resolve, 'optionalAccess', _126 => _126.alias])) ? {} :
|
|
2360
|
+
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _125 => _125.resolve, 'optionalAccess', _126 => _126.alias])) ? {} : _chunkIK33N2ANcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
|
|
2348
2361
|
};
|
|
2349
2362
|
if (Object.keys(farmAliases).length > 0) {
|
|
2350
2363
|
_nullishCoalesce(userConfig.resolve, () => ( (userConfig.resolve = {})));
|
|
2351
|
-
userConfig.resolve.alias =
|
|
2364
|
+
userConfig.resolve.alias = _chunkIK33N2ANcjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
|
|
2352
2365
|
}
|
|
2353
2366
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
2354
2367
|
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _127 => _127.server, 'optionalAccess', _128 => _128.cors]) === void 0;
|
|
@@ -2390,7 +2403,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2390
2403
|
);
|
|
2391
2404
|
reactRefreshActive = _chunk3QM74STYcjs.isFarmReactRefreshActive.call(void 0, config);
|
|
2392
2405
|
if (_optionalChain([options, 'access', _134 => _134.experimental, 'optionalAccess', _135 => _135.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
|
|
2393
|
-
|
|
2406
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
2394
2407
|
"experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
|
|
2395
2408
|
);
|
|
2396
2409
|
}
|
|
@@ -2412,7 +2425,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2412
2425
|
_optionalChain([pm, 'optionalAccess', _142 => _142.getPlugins, 'call', _143 => _143(), 'access', _144 => _144.filter, 'call', _145 => _145(isFarmConfigRoutePlugin), 'access', _146 => _146.map, 'call', _147 => _147((plugin2) => plugin2.name)])
|
|
2413
2426
|
);
|
|
2414
2427
|
const configRedirectMatchers = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _148 => _148.getPlugins, 'call', _149 => _149()]), () => ( []))).flatMap((plugin2) => {
|
|
2415
|
-
const matcher =
|
|
2428
|
+
const matcher = _chunkH7OFZJCVcjs.getConfigRedirectMatcher.call(void 0, plugin2);
|
|
2416
2429
|
return matcher ? [matcher] : [];
|
|
2417
2430
|
});
|
|
2418
2431
|
const emitPluginError = async (phase, error, meta) => {
|
|
@@ -2422,7 +2435,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2422
2435
|
} catch (e21) {
|
|
2423
2436
|
}
|
|
2424
2437
|
};
|
|
2425
|
-
farmApp = new (0,
|
|
2438
|
+
farmApp = new (0, _chunkIK33N2ANcjs.FarmApp)(
|
|
2426
2439
|
{
|
|
2427
2440
|
...options,
|
|
2428
2441
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -2430,7 +2443,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2430
2443
|
server
|
|
2431
2444
|
);
|
|
2432
2445
|
farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
|
|
2433
|
-
|
|
2446
|
+
_chunkJNZDTE75cjs.resolvePackageClientBoundaryCacheFile.call(void 0,
|
|
2434
2447
|
farmApp.getConfig().root,
|
|
2435
2448
|
options.distDir || ".farm"
|
|
2436
2449
|
)
|
|
@@ -2441,15 +2454,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2441
2454
|
let farmAppPackages;
|
|
2442
2455
|
if (_optionalChain([farmConfig, 'access', _150 => _150.agent, 'optionalAccess', _151 => _151.noindexPreviews])) {
|
|
2443
2456
|
farmMiddlewares.use((_req, res, next) => {
|
|
2444
|
-
if (
|
|
2445
|
-
res.setHeader("X-Robots-Tag",
|
|
2457
|
+
if (_chunkKPYQ32BAcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
2458
|
+
res.setHeader("X-Robots-Tag", _chunkF4ID7BGOcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
2446
2459
|
}
|
|
2447
2460
|
next();
|
|
2448
2461
|
});
|
|
2449
2462
|
}
|
|
2450
2463
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
2451
2464
|
const devBuiltInRoutePaths = new Set(
|
|
2452
|
-
|
|
2465
|
+
_chunkWJ5CCQBMcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
2453
2466
|
agent: {
|
|
2454
2467
|
apiCatalog: true,
|
|
2455
2468
|
mcp: true,
|
|
@@ -2460,12 +2473,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2460
2473
|
openapi: options.openapi
|
|
2461
2474
|
})
|
|
2462
2475
|
);
|
|
2463
|
-
const serverConfig =
|
|
2476
|
+
const serverConfig = _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, farmConfig.server);
|
|
2464
2477
|
globalThis.__FARM_IMAGE_CONFIG__ = _chunkMCSRMEQVcjs.getPublicFarmImageConfig.call(void 0, farmConfig.images);
|
|
2465
2478
|
let imageHandler = null;
|
|
2466
2479
|
if (farmConfig.images.provider !== "none") {
|
|
2467
2480
|
const { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } = await import("./image/sharp.cjs");
|
|
2468
|
-
imageHandler =
|
|
2481
|
+
imageHandler = _chunkRDADQG5Scjs.createFarmImageHandler.call(void 0, farmConfig.images, {
|
|
2469
2482
|
transform: createSharpImageTransformer(),
|
|
2470
2483
|
fetchRemote: createNodeImageFetcher(farmConfig.images),
|
|
2471
2484
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
@@ -2473,7 +2486,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2473
2486
|
// a caller-controlled Host header.
|
|
2474
2487
|
trustedLocalOrigin: () => _optionalChain([server, 'access', _152 => _152.resolvedUrls, 'optionalAccess', _153 => _153.local, 'access', _154 => _154[0]]),
|
|
2475
2488
|
onError(error) {
|
|
2476
|
-
|
|
2489
|
+
_chunkGC5ROI3Acjs.logger.error(
|
|
2477
2490
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
2478
2491
|
);
|
|
2479
2492
|
}
|
|
@@ -2499,7 +2512,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2499
2512
|
);
|
|
2500
2513
|
const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
2501
2514
|
try {
|
|
2502
|
-
const result = await
|
|
2515
|
+
const result = await _chunk7564NP5Zcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
2503
2516
|
root: farmConfig.root,
|
|
2504
2517
|
srcDir: farmConfig.srcDir,
|
|
2505
2518
|
layers: farmConfig.layers,
|
|
@@ -2528,7 +2541,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2528
2541
|
}
|
|
2529
2542
|
} catch (e) {
|
|
2530
2543
|
const message = e instanceof Error ? e.message : String(e);
|
|
2531
|
-
|
|
2544
|
+
_chunkGC5ROI3Acjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
2532
2545
|
if (pm) {
|
|
2533
2546
|
await emitPluginError("type-artifact-generation", e, { reason });
|
|
2534
2547
|
}
|
|
@@ -2557,7 +2570,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2557
2570
|
};
|
|
2558
2571
|
const isProgrammaticRouteFile = (file) => {
|
|
2559
2572
|
const normalized = file.replace(/\\/g, "/");
|
|
2560
|
-
return srcDirSlugs.some((srcDir) => normalized.startsWith(`${srcDir}/`)) &&
|
|
2573
|
+
return srcDirSlugs.some((srcDir) => normalized.startsWith(`${srcDir}/`)) && _chunkYUCU6XB4cjs.isProgrammaticRoutesFileName.call(void 0, normalized);
|
|
2561
2574
|
};
|
|
2562
2575
|
const isProgrammaticRouteSourceFile = (file) => {
|
|
2563
2576
|
const normalized = file.replace(/\\/g, "/");
|
|
@@ -2581,7 +2594,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2581
2594
|
let routeRefreshScheduled = null;
|
|
2582
2595
|
let pendingRouteRefreshIncludesMiddleware = false;
|
|
2583
2596
|
const scheduleTypeArtifactGen = (file, event, selection) => {
|
|
2584
|
-
const normalizedFile =
|
|
2597
|
+
const normalizedFile = _chunkGC5ROI3Acjs.toPosixPath.call(void 0, file);
|
|
2585
2598
|
for (const [artifact, enabled] of Object.entries(selection)) {
|
|
2586
2599
|
if (enabled) {
|
|
2587
2600
|
pendingTypeArtifacts[artifact] = true;
|
|
@@ -2602,7 +2615,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2602
2615
|
["add", "change", "unlink"].forEach((ev) => {
|
|
2603
2616
|
server.watcher.on(ev, (file) => {
|
|
2604
2617
|
if (ev === "add") {
|
|
2605
|
-
|
|
2618
|
+
_chunk25JGHAGHcjs.invalidateFailedFarmDevModules.call(void 0, server);
|
|
2606
2619
|
}
|
|
2607
2620
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
2608
2621
|
const configChanged = isFarmConfigFile(file, farmConfig.root) || layerConfigFiles.has(normalizedFile);
|
|
@@ -2618,7 +2631,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2618
2631
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
2619
2632
|
}
|
|
2620
2633
|
if (isI18nCatalogFile(file)) {
|
|
2621
|
-
_optionalChain([farmApp, 'optionalAccess', _162 => _162.getI18nRuntime, 'call', _163 => _163(), 'access', _164 => _164.reload, 'call', _165 => _165(), 'access', _166 => _166.then, 'call', _167 => _167(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _168 => _168.catch, 'call', _169 => _169((error) =>
|
|
2634
|
+
_optionalChain([farmApp, 'optionalAccess', _162 => _162.getI18nRuntime, 'call', _163 => _163(), 'access', _164 => _164.reload, 'call', _165 => _165(), 'access', _166 => _166.then, 'call', _167 => _167(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _168 => _168.catch, 'call', _169 => _169((error) => _chunkGC5ROI3Acjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
2622
2635
|
}
|
|
2623
2636
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
2624
2637
|
if (isRouteRefreshEvent) {
|
|
@@ -2633,7 +2646,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2633
2646
|
Promise.all([
|
|
2634
2647
|
_optionalChain([refreshRouteDiscovery, 'optionalCall', _170 => _170(`${ev} ${file}`)]),
|
|
2635
2648
|
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _171 => _171.reload, 'call', _172 => _172()]) : void 0
|
|
2636
|
-
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) =>
|
|
2649
|
+
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunkGC5ROI3Acjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
2637
2650
|
}, 50);
|
|
2638
2651
|
}
|
|
2639
2652
|
}
|
|
@@ -2669,7 +2682,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2669
2682
|
const dispatchToDevServer = _chunkBNH53KOTcjs.createFarmDevServerDispatch.call(void 0, server);
|
|
2670
2683
|
if (options.mobileClient) {
|
|
2671
2684
|
const { FARM_DEV_SERVER_MODULE_LOADER } = await import("./internal/native-server-fns.cjs");
|
|
2672
|
-
const load = (file) =>
|
|
2685
|
+
const load = (file) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, server, file);
|
|
2673
2686
|
globalThis[FARM_DEV_SERVER_MODULE_LOADER] = load;
|
|
2674
2687
|
_optionalChain([server, 'access', _173 => _173.httpServer, 'optionalAccess', _174 => _174.once, 'call', _175 => _175("close", () => {
|
|
2675
2688
|
const globals = globalThis;
|
|
@@ -2678,7 +2691,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2678
2691
|
}
|
|
2679
2692
|
})]);
|
|
2680
2693
|
}
|
|
2681
|
-
apiRouteManager = new (0,
|
|
2694
|
+
apiRouteManager = new (0, _chunkHFJLMALCcjs.APIRouteManager)(appDirs, server, {
|
|
2682
2695
|
plugins: farmConfig.plugins,
|
|
2683
2696
|
i18n: farmApp.getI18nRuntime(),
|
|
2684
2697
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
@@ -2702,17 +2715,17 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2702
2715
|
discoveredWorkflows = await discoverFarmWorkflows(
|
|
2703
2716
|
{ ...farmConfig, workflows: workflowConfig },
|
|
2704
2717
|
{
|
|
2705
|
-
loadModule: async (filePath) =>
|
|
2718
|
+
loadModule: async (filePath) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, server, filePath)
|
|
2706
2719
|
}
|
|
2707
2720
|
);
|
|
2708
2721
|
if (discoveredWorkflows.length > 0) {
|
|
2709
2722
|
workflowHandler = createFarmWorkflowRequestHandler({
|
|
2710
2723
|
workflows: discoveredWorkflows,
|
|
2711
2724
|
config: workflowConfig,
|
|
2712
|
-
loadModule: async (workflow) =>
|
|
2725
|
+
loadModule: async (workflow) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, server, workflow.filePath),
|
|
2713
2726
|
server: farmConfig.server
|
|
2714
2727
|
});
|
|
2715
|
-
|
|
2728
|
+
_chunkGC5ROI3Acjs.logger.success(`\u2705 Discovered ${discoveredWorkflows.length} Farm workflow task(s)`);
|
|
2716
2729
|
}
|
|
2717
2730
|
}
|
|
2718
2731
|
if (pm) {
|
|
@@ -2724,7 +2737,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2724
2737
|
});
|
|
2725
2738
|
}
|
|
2726
2739
|
}
|
|
2727
|
-
middlewareManager = new (0,
|
|
2740
|
+
middlewareManager = new (0, _chunkWW62HKA2cjs.MiddlewareManager)(
|
|
2728
2741
|
appDirs,
|
|
2729
2742
|
server,
|
|
2730
2743
|
farmConfig.middleware,
|
|
@@ -2768,7 +2781,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2768
2781
|
await openAPIManager.invalidateCache();
|
|
2769
2782
|
}
|
|
2770
2783
|
if (process.env.FARM_VERBOSE) {
|
|
2771
|
-
|
|
2784
|
+
_chunkGC5ROI3Acjs.logger.info(`Refreshed routes: ${reason}`);
|
|
2772
2785
|
}
|
|
2773
2786
|
};
|
|
2774
2787
|
const farmDocsFontAssetList = farmDocsDevRuntime ? _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, farmConfig.root) : [];
|
|
@@ -2780,7 +2793,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2780
2793
|
return _chunk7EPYN7GWcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
|
|
2781
2794
|
};
|
|
2782
2795
|
releaseDocsMCPServers();
|
|
2783
|
-
const isFarmDocsPathGuarded = (href) =>
|
|
2796
|
+
const isFarmDocsPathGuarded = (href) => _chunkXGDI4OUBcjs.farmPathGuardCoversPage.call(void 0,
|
|
2784
2797
|
{
|
|
2785
2798
|
config: farmConfig,
|
|
2786
2799
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -2793,7 +2806,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2793
2806
|
clientEntry: "/@farm/client.js",
|
|
2794
2807
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2795
2808
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2796
|
-
globalStylesheetHref:
|
|
2809
|
+
globalStylesheetHref: _chunkIK33N2ANcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2797
2810
|
farmConfig.root,
|
|
2798
2811
|
farmConfig.srcDir
|
|
2799
2812
|
),
|
|
@@ -2806,10 +2819,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2806
2819
|
_url.pathToFileURL.call(void 0, file).href
|
|
2807
2820
|
);
|
|
2808
2821
|
}
|
|
2809
|
-
return
|
|
2822
|
+
return _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _184 => _184.id]), () => ( specifier)));
|
|
2810
2823
|
},
|
|
2811
2824
|
registerMCPServer: (mcpServer) => {
|
|
2812
|
-
const dispose =
|
|
2825
|
+
const dispose = _chunkRKQOMG2Xcjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
2813
2826
|
docsMCPServerDisposers.add(dispose);
|
|
2814
2827
|
return () => {
|
|
2815
2828
|
docsMCPServerDisposers.delete(dispose);
|
|
@@ -2824,7 +2837,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2824
2837
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
2825
2838
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2826
2839
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2827
|
-
globalStylesheetHref:
|
|
2840
|
+
globalStylesheetHref: _chunkIK33N2ANcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2828
2841
|
farmConfig.root,
|
|
2829
2842
|
farmConfig.srcDir
|
|
2830
2843
|
),
|
|
@@ -2844,7 +2857,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2844
2857
|
}).then(
|
|
2845
2858
|
(pages) => new Set(pages),
|
|
2846
2859
|
(error) => {
|
|
2847
|
-
|
|
2860
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
2848
2861
|
`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)}).`
|
|
2849
2862
|
);
|
|
2850
2863
|
return void 0;
|
|
@@ -2859,108 +2872,32 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2859
2872
|
});
|
|
2860
2873
|
}
|
|
2861
2874
|
}
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
const pathname = new URL(request.url).pathname;
|
|
2867
|
-
const matchedRoute = routeManager.matchRoute(pathname);
|
|
2868
|
-
const layoutEntries = matchedRoute.layouts.map((layout) => ({
|
|
2869
|
-
...layout,
|
|
2870
|
-
metadata: _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
|
|
2871
|
-
}));
|
|
2872
|
-
if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
|
|
2873
|
-
return response;
|
|
2874
|
-
}
|
|
2875
|
-
const source = await response.text();
|
|
2876
|
-
const bodyMatch = source.match(/<body([^>]*)>([\s\S]*?)<\/body>/i);
|
|
2877
|
-
if (!bodyMatch) {
|
|
2878
|
-
return new Response(source, {
|
|
2879
|
-
status: response.status,
|
|
2880
|
-
statusText: response.statusText,
|
|
2881
|
-
headers: response.headers
|
|
2882
|
-
});
|
|
2883
|
-
}
|
|
2884
|
-
const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _196 => _196.getConfig, 'call', _197 => _197()]), () => ( options))).renderer);
|
|
2885
|
-
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
2886
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
2887
|
-
Promise.all(
|
|
2888
|
-
layoutEntries.map((layout) => routeManager.loadLayoutModule(layout.modulePath))
|
|
2889
|
-
)
|
|
2890
|
-
]);
|
|
2891
|
-
const hydrationStrategies = layoutEntries.flatMap(
|
|
2892
|
-
(layout) => layout.metadata.shouldHydrate && layout.metadata.islandStrategy ? [layout.metadata.islandStrategy] : []
|
|
2893
|
-
);
|
|
2894
|
-
const islandStrategy = hydrationStrategies.every(
|
|
2895
|
-
(strategy) => strategy === hydrationStrategies[0]
|
|
2896
|
-
) ? _nullishCoalesce(hydrationStrategies[0], () => ( "load")) : "load";
|
|
2897
|
-
const params = matchedRoute.params || {};
|
|
2898
|
-
const toUrlPath = (absolutePath) => _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, absolutePath, farmConfig.root);
|
|
2899
|
-
const clientLayouts = Object.fromEntries(
|
|
2900
|
-
layoutEntries.map((layout) => [
|
|
2901
|
-
layout.pattern,
|
|
2902
|
-
{
|
|
2903
|
-
modulePath: toUrlPath(layout.modulePath),
|
|
2904
|
-
pattern: layout.pattern,
|
|
2905
|
-
shouldHydrate: layout.metadata.shouldHydrate,
|
|
2906
|
-
islandStrategy: layout.metadata.islandStrategy,
|
|
2907
|
-
preloads: [toUrlPath(layout.modulePath)],
|
|
2908
|
-
assets: []
|
|
2909
|
-
}
|
|
2910
|
-
])
|
|
2911
|
-
);
|
|
2912
|
-
const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
2913
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access', _198 => _198.route, 'optionalAccess', _199 => _199.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
2914
|
-
const bootstrapScript = `<script>
|
|
2915
|
-
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
2916
|
-
window.__FARM_ROUTE_SLOTS__ = [];
|
|
2917
|
-
window.__FARM_DEPLOYMENT_ID__ = ${inlineValue(farmConfig.deploymentId)};
|
|
2918
|
-
window.__FARM_PATH__ = ${inlineValue(pathname)};
|
|
2919
|
-
window.__FARM_IS_CLIENT__ = false;
|
|
2920
|
-
window.__FARM_PAGE_SHOULD_HYDRATE__ = false;
|
|
2921
|
-
window.__FARM_LAYOUT_SHOULD_HYDRATE__ = true;
|
|
2922
|
-
window.__FARM_SHOULD_HYDRATE__ = true;
|
|
2923
|
-
window.__FARM_ISLAND_STRATEGY__ = ${inlineValue(islandStrategy)};
|
|
2924
|
-
window.__FARM_PAGE_MODULE__ = ${inlineValue(pageModulePath)};
|
|
2925
|
-
window.__FARM_LOADING_MODULE__ = null;
|
|
2926
|
-
window.__FARM_MANIFEST__ = ${inlineValue({
|
|
2927
|
-
routes: {},
|
|
2928
|
-
layouts: clientLayouts,
|
|
2929
|
-
slots: [],
|
|
2930
|
-
clientEntry: "/@farm/client.js",
|
|
2931
|
-
sharedAssets: []
|
|
2932
|
-
})};
|
|
2933
|
-
</script>`;
|
|
2934
|
-
let wrappedElement = rendererRuntime.createElement("div", {
|
|
2935
|
-
id: "__farm_page__",
|
|
2936
|
-
"data-farm-client": "false",
|
|
2937
|
-
"data-farm-layout-client": "true",
|
|
2938
|
-
"data-farm-island": "page",
|
|
2939
|
-
"data-farm-island-strategy": islandStrategy,
|
|
2940
|
-
dangerouslySetInnerHTML: { __html: bootstrapScript + bodyMatch[2] }
|
|
2875
|
+
if (farmDocsDevRuntime && !farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs)) {
|
|
2876
|
+
const docsContentDirs = farmDocsDevRuntime.getFarmDocsContentDirs(farmConfig.docs, {
|
|
2877
|
+
root: farmConfig.root,
|
|
2878
|
+
srcDir: farmConfig.srcDir
|
|
2941
2879
|
});
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2880
|
+
server.watcher.add(docsContentDirs);
|
|
2881
|
+
for (const event of ["add", "change", "unlink"]) {
|
|
2882
|
+
server.watcher.on(event, (file) => {
|
|
2883
|
+
const normalizedFile = _chunkGC5ROI3Acjs.toPosixPath.call(void 0, file);
|
|
2884
|
+
if (appDirSlugs.some((appDir) => normalizedFile.startsWith(`${appDir}/`))) return;
|
|
2885
|
+
const contentDirs = docsContentDirs.filter(
|
|
2886
|
+
(contentDir) => farmDocsDevRuntime.isFarmDocsContentFile(contentDir, file)
|
|
2887
|
+
);
|
|
2888
|
+
if (contentDirs.length === 0) return;
|
|
2889
|
+
for (const contentDir of contentDirs) {
|
|
2890
|
+
farmDocsDevRuntime.invalidateFarmDocsLastModified(contentDir);
|
|
2891
|
+
}
|
|
2892
|
+
logUpdate(
|
|
2893
|
+
"PAGE",
|
|
2894
|
+
`${event === "add" ? "added" : event === "unlink" ? "removed" : "updated"} ${_chunkGC5ROI3Acjs.toPosixPath.call(void 0, path6.relative(farmConfig.root, file))}`
|
|
2895
|
+
);
|
|
2896
|
+
server.ws.send({ type: "full-reload", path: "*" });
|
|
2897
|
+
});
|
|
2950
2898
|
}
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
);
|
|
2954
|
-
const html = source.replace(bodyMatch[0], `<body${bodyMatch[1]}>${rootMarkup}</body>`);
|
|
2955
|
-
const headers = new Headers(response.headers);
|
|
2956
|
-
headers.delete("content-length");
|
|
2957
|
-
headers.delete("etag");
|
|
2958
|
-
return new Response(html, {
|
|
2959
|
-
status: response.status,
|
|
2960
|
-
statusText: response.statusText,
|
|
2961
|
-
headers
|
|
2962
|
-
});
|
|
2963
|
-
};
|
|
2899
|
+
}
|
|
2900
|
+
const wrapFarmDocsResponseWithLayouts = (request, response) => farmApp.getServerRenderer().wrapDocsResponseWithLayouts(request, response);
|
|
2964
2901
|
const farmDocsAPIHandler = farmDocsDevRuntime && !farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs) ? farmDocsDevRuntime.createFarmDocsAPIHandler({
|
|
2965
2902
|
rootDir: farmConfig.root,
|
|
2966
2903
|
srcDir: farmConfig.srcDir,
|
|
@@ -3007,9 +2944,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3007
2944
|
}
|
|
3008
2945
|
},
|
|
3009
2946
|
(request) => {
|
|
3010
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3011
|
-
const currentServerConfig =
|
|
3012
|
-
return
|
|
2947
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _189 => _189.getConfig, 'call', _190 => _190()]), () => ( options));
|
|
2948
|
+
const currentServerConfig = _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2949
|
+
return _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, request, {
|
|
3013
2950
|
trustProxy: currentServerConfig.trustProxy
|
|
3014
2951
|
});
|
|
3015
2952
|
}
|
|
@@ -3023,9 +2960,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3023
2960
|
withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
|
|
3024
2961
|
const requestUrl = req.url || "/";
|
|
3025
2962
|
const requestMethod = req.method || "GET";
|
|
3026
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3027
|
-
const currentServerConfig =
|
|
3028
|
-
const parsedRequestUrl =
|
|
2963
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _191 => _191.getConfig, 'call', _192 => _192()]), () => ( options));
|
|
2964
|
+
const currentServerConfig = _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2965
|
+
const parsedRequestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
3029
2966
|
trustProxy: currentServerConfig.trustProxy
|
|
3030
2967
|
});
|
|
3031
2968
|
const fullUrl = parsedRequestUrl.toString();
|
|
@@ -3046,7 +2983,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3046
2983
|
}
|
|
3047
2984
|
}
|
|
3048
2985
|
if (requestMethod === "OPTIONS" && req.headers.origin && req.headers["access-control-request-method"]) {
|
|
3049
|
-
const preflightHeaders =
|
|
2986
|
+
const preflightHeaders = _chunkIIHZ2BEEcjs.resolveRouteRuleCorsPreflightHeaders.call(void 0,
|
|
3050
2987
|
currentConfig.routeRules,
|
|
3051
2988
|
requestPathname
|
|
3052
2989
|
);
|
|
@@ -3065,6 +3002,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3065
3002
|
return;
|
|
3066
3003
|
}
|
|
3067
3004
|
}
|
|
3005
|
+
if (!rendererDisabled && (requestMethod === "GET" || requestMethod === "HEAD") && requestPathname === _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH) {
|
|
3006
|
+
res.statusCode = 200;
|
|
3007
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
3008
|
+
res.end(requestMethod === "HEAD" ? void 0 : _chunkIK33N2ANcjs.FARM_VIDEO_PLAYER_HTML);
|
|
3009
|
+
return;
|
|
3010
|
+
}
|
|
3068
3011
|
const farmDocsFontPath = farmDocsFontAssets.get(requestPathname);
|
|
3069
3012
|
if ((requestMethod === "GET" || requestMethod === "HEAD") && farmDocsFontPath && fs2.existsSync(farmDocsFontPath)) {
|
|
3070
3013
|
res.statusCode = 200;
|
|
@@ -3117,7 +3060,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3117
3060
|
openapi: options.openapi
|
|
3118
3061
|
},
|
|
3119
3062
|
workflows: discoveredWorkflows,
|
|
3120
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
3063
|
+
plugins: _optionalChain([pm, 'optionalAccess', _193 => _193.getSortedPlugins, 'call', _194 => _194()])
|
|
3121
3064
|
});
|
|
3122
3065
|
res.statusCode = 200;
|
|
3123
3066
|
res.setHeader(
|
|
@@ -3130,7 +3073,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3130
3073
|
} else {
|
|
3131
3074
|
if (!warnedDeprecatedDevtoolsDashboard) {
|
|
3132
3075
|
warnedDeprecatedDevtoolsDashboard = true;
|
|
3133
|
-
|
|
3076
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
3134
3077
|
"The built-in DevTools dashboard is deprecated. Install @farm.js/devtools and add devtools() to plugins in farm.config.ts."
|
|
3135
3078
|
);
|
|
3136
3079
|
}
|
|
@@ -3141,7 +3084,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3141
3084
|
}
|
|
3142
3085
|
const isViteOwnedRequest = () => requestUrl.startsWith("/@") || requestUrl.startsWith("/node_modules/") || requestUrl.startsWith("/__farm/") || isViteModuleRequest(parsedRequestUrl, req.headers) || (requestMethod === "GET" || requestMethod === "HEAD") && requestPathname.includes(".") && (devServableFileExists(requestPathname, [server.config.publicDir]) || isViteDevClientRequest(parsedRequestUrl, req.headers) && devServableFileExists(requestPathname, [server.config.root]));
|
|
3143
3086
|
const configRewriteSource = req[FARM_DEV_CONFIG_REWRITE_SOURCE];
|
|
3144
|
-
const runtimeHookErrorAnswersJSON = rendererDisabled ||
|
|
3087
|
+
const runtimeHookErrorAnswersJSON = rendererDisabled || _chunk4VLXQ55Ocjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath);
|
|
3145
3088
|
const requestedPagePathname = configRewriteSource === void 0 ? requestPathname : new URL(configRewriteSource).pathname;
|
|
3146
3089
|
let pageHookRouteMatch;
|
|
3147
3090
|
const pageHookRoute = () => {
|
|
@@ -3152,10 +3095,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3152
3095
|
render: {
|
|
3153
3096
|
pathname: pathname2,
|
|
3154
3097
|
method: requestMethod,
|
|
3155
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
3156
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
3098
|
+
routePattern: _optionalChain([match, 'optionalAccess', _195 => _195.route, 'optionalAccess', _196 => _196.pattern]) || null,
|
|
3099
|
+
params: _optionalChain([match, 'optionalAccess', _197 => _197.params]) || {}
|
|
3157
3100
|
},
|
|
3158
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3101
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _198 => _198.layouts]) || []).map((layout) => layout.pattern)
|
|
3159
3102
|
};
|
|
3160
3103
|
return pageHookRouteMatch;
|
|
3161
3104
|
};
|
|
@@ -3190,13 +3133,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3190
3133
|
};
|
|
3191
3134
|
const meetsRequestedURLRoutes = configRewriteSource === void 0 && !deferredDottedRequests.has(req);
|
|
3192
3135
|
const routeRedirect = meetsRequestedURLRoutes ? farmApp.getRouteManager().matchRedirect(requestPathname, parsedRequestUrl.search) : null;
|
|
3193
|
-
if (meetsRequestedURLRoutes && (routeRedirect || pm && (configRoutePlugins.has(
|
|
3136
|
+
if (meetsRequestedURLRoutes && (routeRedirect || pm && (configRoutePlugins.has(_chunkH7OFZJCVcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME) || configRedirectMatchers.length > 0)) && !isViteOwnedRequest()) {
|
|
3194
3137
|
let redirect = routeRedirect;
|
|
3195
3138
|
try {
|
|
3196
3139
|
if (pm) {
|
|
3197
3140
|
await pm.runHookParallelFiltered(
|
|
3198
3141
|
"beforeRequest",
|
|
3199
|
-
(plugin2) => plugin2.name ===
|
|
3142
|
+
(plugin2) => plugin2.name === _chunkH7OFZJCVcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
3200
3143
|
req,
|
|
3201
3144
|
res
|
|
3202
3145
|
);
|
|
@@ -3222,7 +3165,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3222
3165
|
const redirectResponse = response;
|
|
3223
3166
|
try {
|
|
3224
3167
|
const metadataRoute = matchAppMetadataRoute(requestPathname);
|
|
3225
|
-
const kind = metadataRoute ? "asset" :
|
|
3168
|
+
const kind = metadataRoute ? "asset" : _chunk4VLXQ55Ocjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath) ? "api" : requestMethod === "GET" || requestMethod === "HEAD" ? "page" : "request";
|
|
3226
3169
|
response = await pm.runRuntimeRequest(
|
|
3227
3170
|
createRequestFromNodeRequest(req, parsedRequestUrl),
|
|
3228
3171
|
async () => {
|
|
@@ -3243,7 +3186,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3243
3186
|
}
|
|
3244
3187
|
}
|
|
3245
3188
|
const runAppMiddlewareForContentRoute = async () => {
|
|
3246
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
3189
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _199 => _199.hasMiddleware, 'call', _200 => _200()])) return false;
|
|
3247
3190
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3248
3191
|
return runFarmMiddlewareWithNavigation(
|
|
3249
3192
|
farmApp.getServerRenderer(),
|
|
@@ -3281,7 +3224,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3281
3224
|
return response.status;
|
|
3282
3225
|
};
|
|
3283
3226
|
const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
|
|
3284
|
-
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess',
|
|
3227
|
+
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _201 => _201.hasRuntimeHook, 'call', _202 => _202("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _203 => _203.hasMiddleware, 'call', _204 => _204()]) ? interceptFarmDevPageResponse({
|
|
3285
3228
|
req,
|
|
3286
3229
|
res,
|
|
3287
3230
|
pm,
|
|
@@ -3294,7 +3237,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3294
3237
|
urlPath: requestUrl,
|
|
3295
3238
|
pathname: requestPathname,
|
|
3296
3239
|
startTime: Date.now(),
|
|
3297
|
-
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall',
|
|
3240
|
+
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _205 => _205(status)]),
|
|
3298
3241
|
// The runtime reports a runtime.after failure itself.
|
|
3299
3242
|
emitError: async () => {
|
|
3300
3243
|
},
|
|
@@ -3305,7 +3248,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3305
3248
|
handled = await runAppMiddlewareForContentRoute();
|
|
3306
3249
|
} catch (error) {
|
|
3307
3250
|
if (runtimeHookErrorAnswersJSON || res.headersSent) {
|
|
3308
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3251
|
+
_optionalChain([interceptor, 'optionalAccess', _206 => _206.release, 'call', _207 => _207()]);
|
|
3309
3252
|
throw error;
|
|
3310
3253
|
}
|
|
3311
3254
|
if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
|
|
@@ -3313,10 +3256,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3313
3256
|
return true;
|
|
3314
3257
|
}
|
|
3315
3258
|
if (!handled) {
|
|
3316
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3259
|
+
_optionalChain([interceptor, 'optionalAccess', _208 => _208.release, 'call', _209 => _209()]);
|
|
3317
3260
|
return false;
|
|
3318
3261
|
}
|
|
3319
|
-
if (!_optionalChain([interceptor, 'optionalAccess',
|
|
3262
|
+
if (!_optionalChain([interceptor, 'optionalAccess', _210 => _210.isEnded, 'call', _211 => _211()])) _optionalChain([logResponse2, 'optionalCall', _212 => _212(res.statusCode || 200)]);
|
|
3320
3263
|
return true;
|
|
3321
3264
|
};
|
|
3322
3265
|
const serveBuiltInRoute = async (respond, {
|
|
@@ -3325,7 +3268,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3325
3268
|
label
|
|
3326
3269
|
} = {}) => {
|
|
3327
3270
|
const discard = async () => {
|
|
3328
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
3271
|
+
await _optionalChain([computed, 'optionalAccess', _213 => _213.body, 'optionalAccess', _214 => _214.cancel, 'call', _215 => _215(), 'access', _216 => _216.catch, 'call', _217 => _217(() => {
|
|
3329
3272
|
})]);
|
|
3330
3273
|
};
|
|
3331
3274
|
const sendRuntimeResponse = async (runtimeSession3, response2) => {
|
|
@@ -3342,9 +3285,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3342
3285
|
if (pm && opensFarmDevRuntimeSession(pm)) {
|
|
3343
3286
|
try {
|
|
3344
3287
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
3345
|
-
const route =
|
|
3288
|
+
const route = _chunkWJ5CCQBMcjs.setFarmRouteLabel.call(void 0,
|
|
3346
3289
|
{ pathname: requestPathname },
|
|
3347
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
3290
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkWJ5CCQBMcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
3348
3291
|
);
|
|
3349
3292
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
3350
3293
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -3382,11 +3325,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3382
3325
|
}
|
|
3383
3326
|
responding = true;
|
|
3384
3327
|
response = await respond(
|
|
3385
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
3328
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _218 => _218.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
3386
3329
|
);
|
|
3387
3330
|
} catch (error) {
|
|
3388
3331
|
if (!responding && !res.headersSent) {
|
|
3389
|
-
|
|
3332
|
+
_chunkGC5ROI3Acjs.logger.error(`Middleware error: ${error}`);
|
|
3390
3333
|
await discard();
|
|
3391
3334
|
await sendMiddlewareErrorJSON(runtimeSession2, error);
|
|
3392
3335
|
return;
|
|
@@ -3402,7 +3345,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3402
3345
|
else await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
3403
3346
|
};
|
|
3404
3347
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
3405
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
3348
|
+
if (openAPIManager && _optionalChain([options, 'access', _219 => _219.openapi, 'optionalAccess', _220 => _220.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
3406
3349
|
const specManager = openAPIManager;
|
|
3407
3350
|
await serveBuiltInRoute(async () => {
|
|
3408
3351
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -3422,7 +3365,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3422
3365
|
});
|
|
3423
3366
|
return;
|
|
3424
3367
|
}
|
|
3425
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
3368
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _221 => _221.openapi, 'optionalAccess', _222 => _222.route])) {
|
|
3426
3369
|
const docsManager = openAPIManager;
|
|
3427
3370
|
await serveBuiltInRoute(
|
|
3428
3371
|
async () => {
|
|
@@ -3433,8 +3376,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3433
3376
|
);
|
|
3434
3377
|
return;
|
|
3435
3378
|
}
|
|
3436
|
-
if (_optionalChain([options, 'access',
|
|
3437
|
-
const manifestGuardCoversPath = (path7) =>
|
|
3379
|
+
if (_optionalChain([options, 'access', _223 => _223.agent, 'optionalAccess', _224 => _224.manifest]) !== false && _chunkWJ5CCQBMcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
3380
|
+
const manifestGuardCoversPath = (path7) => _chunkXGDI4OUBcjs.farmPathGuardCoversEndpoint.call(void 0,
|
|
3438
3381
|
{
|
|
3439
3382
|
config: farmConfig,
|
|
3440
3383
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -3443,25 +3386,25 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3443
3386
|
apiServerBasePath
|
|
3444
3387
|
);
|
|
3445
3388
|
await serveBuiltInRoute(async () => {
|
|
3446
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
3447
|
-
const manifest = await
|
|
3389
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkIK33N2ANcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
3390
|
+
const manifest = await _chunkWJ5CCQBMcjs.createFarmAppManifestResponse.call(void 0,
|
|
3448
3391
|
new Request(parsedRequestUrl, {
|
|
3449
3392
|
method: requestMethod,
|
|
3450
3393
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
3451
3394
|
}),
|
|
3452
3395
|
{
|
|
3453
|
-
...
|
|
3396
|
+
..._chunkWJ5CCQBMcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
3454
3397
|
build: "development",
|
|
3455
3398
|
packages: farmAppPackages,
|
|
3456
3399
|
// Read again on each request; unchanged files come from a cache.
|
|
3457
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
3400
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _225 => _225.plugins, 'optionalAccess', _226 => _226.some, 'call', _227 => _227(({ name }) => name === "farm:webmcp")]) ? _chunkIK33N2ANcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
3458
3401
|
}),
|
|
3459
3402
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
3460
3403
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
3461
3404
|
guardCoversPath: manifestGuardCoversPath,
|
|
3462
3405
|
// A docs runtime's MCP server lists its tools when asked, read on each request.
|
|
3463
3406
|
...farmDocsHandler ? {
|
|
3464
|
-
registeredMCP: (request) =>
|
|
3407
|
+
registeredMCP: (request) => _chunkVJ6L7TIIcjs._listFarmRegisteredMCPServerTools.call(void 0, farmDocsHandler, request, {
|
|
3465
3408
|
basePath: farmConfig.basePath,
|
|
3466
3409
|
guardCoversPath: manifestGuardCoversPath
|
|
3467
3410
|
})
|
|
@@ -3472,11 +3415,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3472
3415
|
});
|
|
3473
3416
|
return;
|
|
3474
3417
|
}
|
|
3475
|
-
if (_optionalChain([options, 'access',
|
|
3418
|
+
if (_optionalChain([options, 'access', _228 => _228.agent, 'optionalAccess', _229 => _229.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkWJ5CCQBMcjs.FARM_API_CATALOG_PATH) {
|
|
3476
3419
|
await serveBuiltInRoute(
|
|
3477
|
-
() =>
|
|
3420
|
+
() => _chunkWJ5CCQBMcjs.createFarmApiCatalogResponse.call(void 0,
|
|
3478
3421
|
requestMethod,
|
|
3479
|
-
|
|
3422
|
+
_chunkWJ5CCQBMcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
3480
3423
|
new Request(parsedRequestUrl, {
|
|
3481
3424
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
3482
3425
|
})
|
|
@@ -3484,8 +3427,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3484
3427
|
);
|
|
3485
3428
|
return;
|
|
3486
3429
|
}
|
|
3487
|
-
if (_optionalChain([options, 'access',
|
|
3488
|
-
const aiCatalog =
|
|
3430
|
+
if (_optionalChain([options, 'access', _230 => _230.agent, 'optionalAccess', _231 => _231.aiCatalog]) !== false) {
|
|
3431
|
+
const aiCatalog = _chunkWJ5CCQBMcjs.createFarmAiCatalogResponse.call(void 0,
|
|
3489
3432
|
new Request(parsedRequestUrl, {
|
|
3490
3433
|
method: requestMethod,
|
|
3491
3434
|
headers: {
|
|
@@ -3525,15 +3468,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3525
3468
|
method: requestMethod,
|
|
3526
3469
|
headers: docsHeaders
|
|
3527
3470
|
});
|
|
3528
|
-
const docsBodyInit = requestMethod === "GET" || requestMethod === "HEAD" ? {} : { body:
|
|
3471
|
+
const docsBodyInit = requestMethod === "GET" || requestMethod === "HEAD" ? {} : { body: _chunk7Q7UB4TLcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" };
|
|
3529
3472
|
const docsHandlerRequest = new Request(docsRequest, docsBodyInit);
|
|
3530
|
-
const registeredMCPCalls = await
|
|
3473
|
+
const registeredMCPCalls = await _chunkVJ6L7TIIcjs._readFarmRegisteredMCPCalls.call(void 0,
|
|
3531
3474
|
docsHandlerRequest,
|
|
3532
3475
|
farmConfig.basePath
|
|
3533
3476
|
);
|
|
3534
3477
|
const docsResponse = await farmDocsHandler(docsHandlerRequest);
|
|
3535
3478
|
if (docsResponse) {
|
|
3536
|
-
const docsPage = _optionalChain([docsResponse, 'access',
|
|
3479
|
+
const docsPage = _optionalChain([docsResponse, 'access', _232 => _232.headers, 'access', _233 => _233.get, 'call', _234 => _234("content-type"), 'optionalAccess', _235 => _235.toLowerCase, 'call', _236 => _236(), 'access', _237 => _237.includes, 'call', _238 => _238("text/html")]);
|
|
3537
3480
|
await serveBuiltInRoute(
|
|
3538
3481
|
async (request) => {
|
|
3539
3482
|
if (!docsPage) {
|
|
@@ -3541,9 +3484,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3541
3484
|
docsRequest,
|
|
3542
3485
|
docsResponse
|
|
3543
3486
|
);
|
|
3544
|
-
return
|
|
3487
|
+
return _chunk2RSVYJT6cjs._runWithCurrentRequest.call(void 0,
|
|
3545
3488
|
request,
|
|
3546
|
-
() =>
|
|
3489
|
+
() => _chunkVJ6L7TIIcjs._observeFarmRegisteredMCPResponse.call(void 0, response, registeredMCPCalls)
|
|
3547
3490
|
);
|
|
3548
3491
|
}
|
|
3549
3492
|
const deploymentMismatch = _chunkNLBHLPEOcjs.getFarmDeploymentMismatch.call(void 0,
|
|
@@ -3551,7 +3494,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3551
3494
|
farmConfig.deploymentId
|
|
3552
3495
|
);
|
|
3553
3496
|
if (deploymentMismatch) {
|
|
3554
|
-
await _optionalChain([docsResponse, 'access',
|
|
3497
|
+
await _optionalChain([docsResponse, 'access', _239 => _239.body, 'optionalAccess', _240 => _240.cancel, 'call', _241 => _241()]);
|
|
3555
3498
|
return _chunkNLBHLPEOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch);
|
|
3556
3499
|
}
|
|
3557
3500
|
return _chunkNLBHLPEOcjs.withFarmDeploymentResponse.call(void 0,
|
|
@@ -3567,11 +3510,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3567
3510
|
{
|
|
3568
3511
|
kind: "docs",
|
|
3569
3512
|
computed: docsResponse,
|
|
3570
|
-
label:
|
|
3513
|
+
label: _chunkWJ5CCQBMcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
3571
3514
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
3572
3515
|
{
|
|
3573
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3574
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3516
|
+
path: _optionalChain([farmConfig, 'access', _242 => _242.docs, 'optionalAccess', _243 => _243.entry]) || "/docs",
|
|
3517
|
+
roots: _optionalChain([farmConfig, 'access', _244 => _244.docs, 'optionalAccess', _245 => _245.roots, 'optionalAccess', _246 => _246.map, 'call', _247 => _247((root) => root.entry)]),
|
|
3575
3518
|
pages: await getFarmDocsPagePaths()
|
|
3576
3519
|
}
|
|
3577
3520
|
)
|
|
@@ -3580,9 +3523,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3580
3523
|
return;
|
|
3581
3524
|
}
|
|
3582
3525
|
}
|
|
3583
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access',
|
|
3584
|
-
const { createFarmNativeTreeResponse } = await import("./native-tree-
|
|
3585
|
-
const treeBodyInit = requestMethod === "POST" ? { body:
|
|
3526
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _248 => _248.headers, 'access', _249 => _249.accept, 'optionalAccess', _250 => _250.includes, 'call', _251 => _251(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
3527
|
+
const { createFarmNativeTreeResponse } = await import("./native-tree-D3PW64ZL.cjs");
|
|
3528
|
+
const treeBodyInit = requestMethod === "POST" ? { body: _chunk7Q7UB4TLcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
3586
3529
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
3587
3530
|
request: new Request(fullUrl, {
|
|
3588
3531
|
method: requestMethod,
|
|
@@ -3592,24 +3535,24 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3592
3535
|
// As for the Markdown mirror: this server's own listener, redirects not followed.
|
|
3593
3536
|
renderPage: (request) => _chunkBNH53KOTcjs.createFarmDevServerDispatch.call(void 0, server)(
|
|
3594
3537
|
new Request(request, {
|
|
3595
|
-
signal: res.destroyed ? AbortSignal.abort() :
|
|
3538
|
+
signal: res.destroyed ? AbortSignal.abort() : _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
3596
3539
|
})
|
|
3597
3540
|
)
|
|
3598
3541
|
});
|
|
3599
3542
|
await serveBuiltInRoute(() => treeResponse, {
|
|
3600
3543
|
computed: treeResponse,
|
|
3601
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
3544
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _252 => _252.getRouteManager, 'call', _253 => _253(), 'access', _254 => _254.matchRoute, 'call', _255 => _255(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _256 => _256.route, 'optionalAccess', _257 => _257.pattern]), () => ( null))
|
|
3602
3545
|
});
|
|
3603
3546
|
return;
|
|
3604
3547
|
}
|
|
3605
3548
|
const markdownRouteLabel = () => (
|
|
3606
3549
|
// On the route path, as production labels it: /fr/index.md is /index.md.
|
|
3607
|
-
|
|
3550
|
+
_chunkWJ5CCQBMcjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
3608
3551
|
toRoutePathname(requestPathname),
|
|
3609
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
3552
|
+
(page) => _optionalChain([farmApp, 'access', _258 => _258.getRouteManager, 'call', _259 => _259(), 'access', _260 => _260.matchRoute, 'call', _261 => _261(page), 'access', _262 => _262.route, 'optionalAccess', _263 => _263.pattern])
|
|
3610
3553
|
)
|
|
3611
3554
|
);
|
|
3612
|
-
const markdownSourceResponse = viteModuleRequest ? null : await
|
|
3555
|
+
const markdownSourceResponse = viteModuleRequest ? null : await _chunkPG7J7XYTcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
3613
3556
|
request: new Request(fullUrl, {
|
|
3614
3557
|
method: requestMethod,
|
|
3615
3558
|
headers: docsHeaders
|
|
@@ -3618,13 +3561,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3618
3561
|
routePathname: toRoutePathname,
|
|
3619
3562
|
resolveSource: async (pathname2) => {
|
|
3620
3563
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
3621
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
3564
|
+
const sourcePath = _optionalChain([match, 'access', _264 => _264.route, 'optionalAccess', _265 => _265.markdownSourcePath]) || (match.route && _chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
3622
3565
|
if (!sourcePath) {
|
|
3623
3566
|
return null;
|
|
3624
3567
|
}
|
|
3625
3568
|
return {
|
|
3626
3569
|
source: await fs2.promises.readFile(sourcePath, "utf8"),
|
|
3627
|
-
|
|
3570
|
+
// Project-relative, as production sends it: never the machine's path.
|
|
3571
|
+
filePath: _chunkIK33N2ANcjs.toBakedMarkdownSourcePath.call(void 0, farmApp.getConfig().root, sourcePath)
|
|
3628
3572
|
};
|
|
3629
3573
|
},
|
|
3630
3574
|
// The anonymous check goes through this server, so its guards and
|
|
@@ -3638,7 +3582,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3638
3582
|
farmApp.getConfig().trailingSlash === true
|
|
3639
3583
|
),
|
|
3640
3584
|
{
|
|
3641
|
-
signal: res.destroyed ? AbortSignal.abort() :
|
|
3585
|
+
signal: res.destroyed ? AbortSignal.abort() : _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
3642
3586
|
}
|
|
3643
3587
|
)
|
|
3644
3588
|
)
|
|
@@ -3650,7 +3594,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3650
3594
|
});
|
|
3651
3595
|
return;
|
|
3652
3596
|
}
|
|
3653
|
-
const markdownResponse = viteModuleRequest ? null : await
|
|
3597
|
+
const markdownResponse = viteModuleRequest ? null : await _chunk2YJ4DHTDcjs.createMarkdownMirrorResponse.call(void 0, {
|
|
3654
3598
|
request: new Request(fullUrl, {
|
|
3655
3599
|
method: requestMethod,
|
|
3656
3600
|
headers: docsHeaders
|
|
@@ -3675,7 +3619,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3675
3619
|
headers,
|
|
3676
3620
|
// Only accepted mirrors need disconnect listeners. An earlier
|
|
3677
3621
|
// close (for example while the docs handler ran) must also abort.
|
|
3678
|
-
signal: res.destroyed ? AbortSignal.abort() :
|
|
3622
|
+
signal: res.destroyed ? AbortSignal.abort() : _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
3679
3623
|
}
|
|
3680
3624
|
)
|
|
3681
3625
|
);
|
|
@@ -3689,16 +3633,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3689
3633
|
});
|
|
3690
3634
|
return;
|
|
3691
3635
|
}
|
|
3692
|
-
if (!viteModuleRequest &&
|
|
3693
|
-
const markdownRoute = farmApp.getRouteManager().matchRoute(
|
|
3636
|
+
if (!viteModuleRequest && _chunk2YJ4DHTDcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
|
|
3637
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkPG7J7XYTcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname, toRoutePathname));
|
|
3694
3638
|
if (!markdownRoute.route) {
|
|
3695
3639
|
await serveBuiltInRoute(
|
|
3696
3640
|
() => new Response(
|
|
3697
|
-
|
|
3641
|
+
_chunk2YJ4DHTDcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/"),
|
|
3698
3642
|
{
|
|
3699
3643
|
status: 404,
|
|
3700
3644
|
headers: {
|
|
3701
|
-
"Content-Type":
|
|
3645
|
+
"Content-Type": _chunk2YJ4DHTDcjs.FARM_MARKDOWN_CONTENT_TYPE,
|
|
3702
3646
|
"X-Farm-Markdown-Error": "404",
|
|
3703
3647
|
"Cache-Control": "no-store"
|
|
3704
3648
|
}
|
|
@@ -3708,7 +3652,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3708
3652
|
return;
|
|
3709
3653
|
}
|
|
3710
3654
|
}
|
|
3711
|
-
const markdownPageTarget =
|
|
3655
|
+
const markdownPageTarget = _chunk2YJ4DHTDcjs.resolveMarkdownMirrorTarget.call(void 0,
|
|
3712
3656
|
farmApp.getConfig().md,
|
|
3713
3657
|
requestPathname,
|
|
3714
3658
|
{
|
|
@@ -3733,13 +3677,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3733
3677
|
let workflowBody;
|
|
3734
3678
|
try {
|
|
3735
3679
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
3736
|
-
workflowBody = await
|
|
3680
|
+
workflowBody = await _chunk7Q7UB4TLcjs.readNodeRequestBody.call(void 0,
|
|
3737
3681
|
req,
|
|
3738
3682
|
currentServerConfig.bodySizeLimit
|
|
3739
3683
|
);
|
|
3740
3684
|
}
|
|
3741
3685
|
} catch (error) {
|
|
3742
|
-
const response =
|
|
3686
|
+
const response = _chunk7Q7UB4TLcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
3743
3687
|
if (!response) throw error;
|
|
3744
3688
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
3745
3689
|
return;
|
|
@@ -3749,7 +3693,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3749
3693
|
method: requestMethod,
|
|
3750
3694
|
headers: docsHeaders,
|
|
3751
3695
|
body: toRequestBody(workflowBody),
|
|
3752
|
-
signal:
|
|
3696
|
+
signal: _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
3753
3697
|
})
|
|
3754
3698
|
);
|
|
3755
3699
|
if (workflowResponse) {
|
|
@@ -3759,7 +3703,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3759
3703
|
}
|
|
3760
3704
|
const configuredIntegrations = currentConfig.integrations;
|
|
3761
3705
|
const tryConfiguredIntegrationRoute = async () => {
|
|
3762
|
-
const matchedRoute =
|
|
3706
|
+
const matchedRoute = _chunk6DBBMQWTcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3763
3707
|
pathname: requestPathname,
|
|
3764
3708
|
method: requestMethod
|
|
3765
3709
|
});
|
|
@@ -3773,8 +3717,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3773
3717
|
await pm.runHookParallelFiltered(
|
|
3774
3718
|
"beforeRequest",
|
|
3775
3719
|
(plugin2) => {
|
|
3776
|
-
const owner =
|
|
3777
|
-
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess',
|
|
3720
|
+
const owner = _chunk6DBBMQWTcjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
|
|
3721
|
+
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _266 => _266.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
3778
3722
|
},
|
|
3779
3723
|
req,
|
|
3780
3724
|
res
|
|
@@ -3793,17 +3737,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3793
3737
|
}
|
|
3794
3738
|
let body;
|
|
3795
3739
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
3796
|
-
body = await
|
|
3740
|
+
body = await _chunk7Q7UB4TLcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
|
|
3797
3741
|
}
|
|
3798
3742
|
const integrationRequest = new Request(fullUrl, {
|
|
3799
3743
|
method: req.method,
|
|
3800
3744
|
headers,
|
|
3801
3745
|
body: toRequestBody(body),
|
|
3802
|
-
signal:
|
|
3746
|
+
signal: _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
3803
3747
|
});
|
|
3804
3748
|
const dispatchIntegration = async (request, runtime) => {
|
|
3805
3749
|
try {
|
|
3806
|
-
const result = await
|
|
3750
|
+
const result = await _chunk6DBBMQWTcjs.dispatchIntegrationRequest.call(void 0,
|
|
3807
3751
|
{
|
|
3808
3752
|
integration: matchedRoute.integration,
|
|
3809
3753
|
config: currentConfig,
|
|
@@ -3811,16 +3755,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3811
3755
|
isProd: false
|
|
3812
3756
|
},
|
|
3813
3757
|
request,
|
|
3814
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
3758
|
+
{ clientAddress: _optionalChain([req, 'access', _267 => _267.socket, 'optionalAccess', _268 => _268.remoteAddress]) }
|
|
3815
3759
|
);
|
|
3816
3760
|
if (!result) {
|
|
3817
3761
|
throw new Error(`Matched integration route did not return a response`);
|
|
3818
3762
|
}
|
|
3819
3763
|
return result;
|
|
3820
3764
|
} catch (error) {
|
|
3821
|
-
|
|
3822
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
3823
|
-
return
|
|
3765
|
+
_chunkGC5ROI3Acjs.logger.error(`Integration route error: ${error}`);
|
|
3766
|
+
await _optionalChain([runtime, 'optionalAccess', _269 => _269.reportError, 'call', _270 => _270(error)]);
|
|
3767
|
+
return _chunk4VLXQ55Ocjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
3824
3768
|
}
|
|
3825
3769
|
};
|
|
3826
3770
|
runtimeReportsErrors = Boolean(pm);
|
|
@@ -3839,7 +3783,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3839
3783
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
3840
3784
|
return true;
|
|
3841
3785
|
} catch (error) {
|
|
3842
|
-
const bodyErrorResponse =
|
|
3786
|
+
const bodyErrorResponse = _chunk7Q7UB4TLcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
3843
3787
|
if (bodyErrorResponse) {
|
|
3844
3788
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
|
|
3845
3789
|
return true;
|
|
@@ -3854,32 +3798,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3854
3798
|
integration: matchedRoute.key
|
|
3855
3799
|
});
|
|
3856
3800
|
}
|
|
3857
|
-
|
|
3801
|
+
_chunkGC5ROI3Acjs.logger.error(`Integration route error: ${error}`);
|
|
3858
3802
|
if (runtimeReportsErrors) {
|
|
3859
3803
|
if (!res.headersSent) sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
3860
3804
|
else if (!res.writableEnded) res.end();
|
|
3861
3805
|
} else if (!res.writableEnded) {
|
|
3862
3806
|
res.statusCode = 500;
|
|
3863
3807
|
res.setHeader("Content-Type", "application/json");
|
|
3864
|
-
res.end(
|
|
3808
|
+
res.end(_chunk4VLXQ55Ocjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3865
3809
|
}
|
|
3866
3810
|
return true;
|
|
3867
3811
|
}
|
|
3868
3812
|
};
|
|
3869
|
-
if (pm && configRewriteSource === void 0 && configRoutePlugins.has(
|
|
3813
|
+
if (pm && configRewriteSource === void 0 && configRoutePlugins.has(_chunkH7OFZJCVcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME)) {
|
|
3870
3814
|
const hasLocalDevRoute = () => {
|
|
3871
3815
|
const routeManager3 = farmApp.getRouteManager();
|
|
3872
3816
|
return Boolean(
|
|
3873
|
-
|
|
3817
|
+
_chunk6DBBMQWTcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3874
3818
|
pathname: requestPathname,
|
|
3875
3819
|
method: requestMethod
|
|
3876
|
-
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3820
|
+
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _271 => _271.isFarmDocsAPIRequest, 'call', _272 => _272(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
|
|
3877
3821
|
);
|
|
3878
3822
|
};
|
|
3879
3823
|
try {
|
|
3880
3824
|
await pm.runHookParallelFiltered(
|
|
3881
3825
|
"beforeRequest",
|
|
3882
|
-
(plugin2) => plugin2.name ===
|
|
3826
|
+
(plugin2) => plugin2.name === _chunkH7OFZJCVcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
3883
3827
|
req,
|
|
3884
3828
|
res
|
|
3885
3829
|
);
|
|
@@ -3907,11 +3851,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3907
3851
|
}
|
|
3908
3852
|
const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
|
|
3909
3853
|
const hasMatchedApiRoute = Boolean(matchedApiRoute);
|
|
3910
|
-
if (hasMatchedApiRoute ||
|
|
3854
|
+
if (hasMatchedApiRoute || _chunk4VLXQ55Ocjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
|
|
3911
3855
|
const startTime2 = Date.now();
|
|
3912
3856
|
const method2 = req.method || "GET";
|
|
3913
3857
|
const urlPath2 = req.url || "/";
|
|
3914
|
-
const pathname2 =
|
|
3858
|
+
const pathname2 = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
3915
3859
|
trustProxy: currentServerConfig.trustProxy
|
|
3916
3860
|
}).pathname;
|
|
3917
3861
|
try {
|
|
@@ -3933,10 +3877,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3933
3877
|
urlPath: urlPath2,
|
|
3934
3878
|
method: method2
|
|
3935
3879
|
});
|
|
3936
|
-
|
|
3880
|
+
_chunkGC5ROI3Acjs.logger.error(`Request hook error: ${error}`);
|
|
3937
3881
|
res.statusCode = 500;
|
|
3938
3882
|
res.setHeader("Content-Type", "application/json");
|
|
3939
|
-
res.end(
|
|
3883
|
+
res.end(_chunk4VLXQ55Ocjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3940
3884
|
return;
|
|
3941
3885
|
}
|
|
3942
3886
|
const createAPIRequest = async () => {
|
|
@@ -3948,30 +3892,30 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3948
3892
|
}
|
|
3949
3893
|
let body;
|
|
3950
3894
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
3951
|
-
body = await
|
|
3895
|
+
body = await _chunk7Q7UB4TLcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
|
|
3952
3896
|
}
|
|
3953
3897
|
return new Request(
|
|
3954
|
-
|
|
3898
|
+
_chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
3955
3899
|
trustProxy: currentServerConfig.trustProxy
|
|
3956
3900
|
}),
|
|
3957
3901
|
{
|
|
3958
3902
|
method: req.method,
|
|
3959
3903
|
headers,
|
|
3960
3904
|
body: toRequestBody(body),
|
|
3961
|
-
signal:
|
|
3905
|
+
signal: _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
3962
3906
|
}
|
|
3963
3907
|
);
|
|
3964
3908
|
};
|
|
3965
3909
|
const isDocsAPIRequest = Boolean(
|
|
3966
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3910
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _273 => _273.isFarmDocsAPIRequest, 'call', _274 => _274(pathname2)])
|
|
3967
3911
|
);
|
|
3968
3912
|
const docsRuntimeOptions = () => ({
|
|
3969
3913
|
kind: "docs",
|
|
3970
|
-
route:
|
|
3914
|
+
route: _chunkWJ5CCQBMcjs.setFarmRouteLabel.call(void 0,
|
|
3971
3915
|
{ pathname: pathname2, pattern: urlPath2 },
|
|
3972
|
-
|
|
3973
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3974
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3916
|
+
_chunkWJ5CCQBMcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
3917
|
+
path: _optionalChain([farmConfig, 'access', _275 => _275.docs, 'optionalAccess', _276 => _276.entry]) || "/docs",
|
|
3918
|
+
roots: _optionalChain([farmConfig, 'access', _277 => _277.docs, 'optionalAccess', _278 => _278.roots, 'optionalAccess', _279 => _279.map, 'call', _280 => _280((root) => root.entry)])
|
|
3975
3919
|
})
|
|
3976
3920
|
)
|
|
3977
3921
|
});
|
|
@@ -3996,7 +3940,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3996
3940
|
return;
|
|
3997
3941
|
}
|
|
3998
3942
|
} catch (error) {
|
|
3999
|
-
const bodyErrorResponse =
|
|
3943
|
+
const bodyErrorResponse = _chunk7Q7UB4TLcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
4000
3944
|
if (bodyErrorResponse) {
|
|
4001
3945
|
logResponse(
|
|
4002
3946
|
method2,
|
|
@@ -4008,7 +3952,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4008
3952
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
|
|
4009
3953
|
return;
|
|
4010
3954
|
}
|
|
4011
|
-
|
|
3955
|
+
_chunkGC5ROI3Acjs.logger.error(`API route error: ${error}`);
|
|
4012
3956
|
sendFarmDevRuntimeHookError(res, true);
|
|
4013
3957
|
return;
|
|
4014
3958
|
}
|
|
@@ -4028,7 +3972,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4028
3972
|
if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
|
|
4029
3973
|
throw error;
|
|
4030
3974
|
}
|
|
4031
|
-
|
|
3975
|
+
_chunkGC5ROI3Acjs.logger.error(`Middleware error: ${error}`);
|
|
4032
3976
|
const status = await sendMiddlewareErrorJSON(runtimeSession2, error);
|
|
4033
3977
|
logResponse(method2, urlPath2, status, Date.now() - startTime2, "API");
|
|
4034
3978
|
return;
|
|
@@ -4046,14 +3990,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4046
3990
|
(_request, runtime) => handler(request, runtime)
|
|
4047
3991
|
) : pm ? pm.runRuntimeRequest(request, handler, options2) : handler(request);
|
|
4048
3992
|
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
4049
|
-
const routedPathname =
|
|
3993
|
+
const routedPathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
4050
3994
|
trustProxy: currentServerConfig.trustProxy
|
|
4051
3995
|
}).pathname;
|
|
4052
3996
|
const rewritten = routedPathname !== pathname2;
|
|
4053
3997
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
4054
3998
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
4055
3999
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
4056
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
4000
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _281 => _281.route, 'access', _282 => _282.path]) || urlPath2;
|
|
4057
4001
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
4058
4002
|
type: "route.matched",
|
|
4059
4003
|
pathname: pathname2,
|
|
@@ -4102,9 +4046,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4102
4046
|
durationMs: Date.now() - startTime2,
|
|
4103
4047
|
error
|
|
4104
4048
|
});
|
|
4105
|
-
|
|
4106
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
4107
|
-
response =
|
|
4049
|
+
_chunkGC5ROI3Acjs.logger.error(`API route error: ${error}`);
|
|
4050
|
+
await _optionalChain([runtime, 'optionalAccess', _283 => _283.reportError, 'call', _284 => _284(error)]);
|
|
4051
|
+
response = _chunk4VLXQ55Ocjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
4108
4052
|
}
|
|
4109
4053
|
return pm ? await pm.runHookSerial("afterApiHandler", response, apiLifecyclePayload) : response;
|
|
4110
4054
|
};
|
|
@@ -4131,13 +4075,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4131
4075
|
error
|
|
4132
4076
|
});
|
|
4133
4077
|
}
|
|
4134
|
-
const bodyErrorResponse =
|
|
4078
|
+
const bodyErrorResponse = _chunk7Q7UB4TLcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
4135
4079
|
if (bodyErrorResponse) {
|
|
4136
4080
|
logResponse(method2, urlPath2, bodyErrorResponse.status, duration, "API");
|
|
4137
4081
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
|
|
4138
4082
|
return;
|
|
4139
4083
|
}
|
|
4140
|
-
|
|
4084
|
+
_chunkGC5ROI3Acjs.logger.error(`API route error: ${error}`);
|
|
4141
4085
|
sendFarmDevRuntimeHookError(res, true);
|
|
4142
4086
|
return;
|
|
4143
4087
|
}
|
|
@@ -4174,12 +4118,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4174
4118
|
return;
|
|
4175
4119
|
}
|
|
4176
4120
|
} catch (error) {
|
|
4177
|
-
const bodyErrorResponse =
|
|
4121
|
+
const bodyErrorResponse = _chunk7Q7UB4TLcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
4178
4122
|
if (bodyErrorResponse) {
|
|
4179
4123
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
|
|
4180
4124
|
return;
|
|
4181
4125
|
}
|
|
4182
|
-
|
|
4126
|
+
_chunkGC5ROI3Acjs.logger.error(`Docs API route error: ${error}`);
|
|
4183
4127
|
sendFarmDevRuntimeHookError(res, true);
|
|
4184
4128
|
return;
|
|
4185
4129
|
}
|
|
@@ -4203,17 +4147,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4203
4147
|
logResponse(method2, urlPath2, response.status, Date.now() - startTime2, "API");
|
|
4204
4148
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
4205
4149
|
} catch (error) {
|
|
4206
|
-
|
|
4150
|
+
_chunkGC5ROI3Acjs.logger.error(`API route error: ${error}`);
|
|
4207
4151
|
sendFarmDevRuntimeHookError(res, true);
|
|
4208
4152
|
}
|
|
4209
4153
|
return;
|
|
4210
4154
|
}
|
|
4211
|
-
if (_optionalChain([req, 'access',
|
|
4155
|
+
if (_optionalChain([req, 'access', _285 => _285.url, 'optionalAccess', _286 => _286.startsWith, 'call', _287 => _287("/@")]) || _optionalChain([req, 'access', _288 => _288.url, 'optionalAccess', _289 => _289.startsWith, 'call', _290 => _290("/node_modules")])) {
|
|
4212
4156
|
return next();
|
|
4213
4157
|
}
|
|
4214
4158
|
if (!deferredDottedRequests.has(req) && shouldBypassFarmRouterForDottedPath(
|
|
4215
4159
|
requestPathname,
|
|
4216
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4160
|
+
_optionalChain([farmApp, 'optionalAccess', _291 => _291.getRouteManager, 'call', _292 => _292()]),
|
|
4217
4161
|
[server.config.publicDir, server.config.root],
|
|
4218
4162
|
farmAgentGeneratedPaths(farmConfig),
|
|
4219
4163
|
requestMethod
|
|
@@ -4221,7 +4165,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4221
4165
|
if (!viteModuleRequest) deferredDottedRequests.set(req, requestUrl);
|
|
4222
4166
|
return next();
|
|
4223
4167
|
}
|
|
4224
|
-
if (_optionalChain([req, 'access',
|
|
4168
|
+
if (_optionalChain([req, 'access', _293 => _293.url, 'optionalAccess', _294 => _294.startsWith, 'call', _295 => _295("/__farm/page-data")])) {
|
|
4225
4169
|
const urlObj = parsedRequestUrl;
|
|
4226
4170
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
4227
4171
|
let renderedRequest;
|
|
@@ -4229,7 +4173,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4229
4173
|
const request = createRequestFromNodeRequest(
|
|
4230
4174
|
req,
|
|
4231
4175
|
urlObj,
|
|
4232
|
-
|
|
4176
|
+
_chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
4233
4177
|
);
|
|
4234
4178
|
const deploymentMismatch = _chunkNLBHLPEOcjs.getFarmDeploymentMismatch.call(void 0,
|
|
4235
4179
|
request,
|
|
@@ -4251,7 +4195,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4251
4195
|
renderedRequest = targetRequest;
|
|
4252
4196
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
4253
4197
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
4254
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4198
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _296 => _296.hasMiddleware, 'call', _297 => _297()])) {
|
|
4255
4199
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
4256
4200
|
const targetNodeResponse = createPageDataMiddlewareResponse(res);
|
|
4257
4201
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
@@ -4285,10 +4229,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4285
4229
|
if (pm) {
|
|
4286
4230
|
await pm.runHookParallel("afterRouteMatch", {
|
|
4287
4231
|
pathname: targetPath,
|
|
4288
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
4289
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
4290
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4291
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
4232
|
+
matched: !!_optionalChain([match, 'optionalAccess', _298 => _298.route]),
|
|
4233
|
+
routePattern: _optionalChain([match, 'optionalAccess', _299 => _299.route, 'optionalAccess', _300 => _300.pattern]) || null,
|
|
4234
|
+
params: _optionalChain([match, 'optionalAccess', _301 => _301.params]) || {},
|
|
4235
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _302 => _302.layouts]) || []).map((l) => l.pattern)
|
|
4292
4236
|
});
|
|
4293
4237
|
}
|
|
4294
4238
|
if (!match) {
|
|
@@ -4304,6 +4248,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4304
4248
|
res.end(JSON.stringify({ error: "Route not found" }));
|
|
4305
4249
|
return;
|
|
4306
4250
|
}
|
|
4251
|
+
const trailingSlashLocation = _chunkDVJM55D2cjs.resolveFarmTrailingSlashRedirect.call(void 0,
|
|
4252
|
+
targetRequestUrl,
|
|
4253
|
+
farmApp.getConfig().trailingSlash === true
|
|
4254
|
+
);
|
|
4255
|
+
if (trailingSlashLocation) {
|
|
4256
|
+
await sendFarmPageDataRedirect(
|
|
4257
|
+
res,
|
|
4258
|
+
{ location: trailingSlashLocation, status: 308 },
|
|
4259
|
+
farmConfig.deploymentId
|
|
4260
|
+
);
|
|
4261
|
+
return;
|
|
4262
|
+
}
|
|
4307
4263
|
const routeModule = await routeManager3.loadRouteModule(route.modulePath);
|
|
4308
4264
|
const loadingBoundary = routeManager3.getMatchingLoading(
|
|
4309
4265
|
targetRequestUrl.pathname,
|
|
@@ -4311,7 +4267,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4311
4267
|
);
|
|
4312
4268
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
4313
4269
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
4314
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
4270
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkJNZDTE75cjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
4315
4271
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
4316
4272
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
4317
4273
|
let mergedMetadata = {};
|
|
@@ -4319,7 +4275,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4319
4275
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
4320
4276
|
);
|
|
4321
4277
|
const layoutHydrationMetadata = layouts.map(
|
|
4322
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
4278
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkJNZDTE75cjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
4323
4279
|
);
|
|
4324
4280
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
4325
4281
|
(metadata) => metadata.shouldHydrate
|
|
@@ -4331,17 +4287,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4331
4287
|
)
|
|
4332
4288
|
];
|
|
4333
4289
|
const hydrationIslandStrategy = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0,
|
|
4334
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4335
|
-
) === "islands" ?
|
|
4290
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _303 => _303.getConfig, 'call', _304 => _304()]), () => ( options))), 'access', _305 => _305.experimental, 'optionalAccess', _306 => _306.serverComponents])
|
|
4291
|
+
) === "islands" ? _chunkIK33N2ANcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
4336
4292
|
route,
|
|
4337
4293
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
4338
4294
|
layouts.map((layout, index) => ({
|
|
4339
4295
|
pattern: layout.pattern,
|
|
4340
4296
|
modulePath: layout.modulePath,
|
|
4341
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4297
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _307 => _307[index], 'optionalAccess', _308 => _308.shouldHydrate]) === true,
|
|
4342
4298
|
// Manifest entries carry it; metadata read from source does not.
|
|
4343
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4344
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
4299
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _309 => _309[index], 'optionalAccess', _310 => _310.hasIsolatedClientBoundaries]) === true,
|
|
4300
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _311 => _311[index], 'optionalAccess', _312 => _312.islandStrategy]), () => ( null))
|
|
4345
4301
|
})),
|
|
4346
4302
|
server.config.root,
|
|
4347
4303
|
true
|
|
@@ -4368,28 +4324,28 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4368
4324
|
routePath: route.pattern
|
|
4369
4325
|
});
|
|
4370
4326
|
for (const layoutModule of layoutModules) {
|
|
4371
|
-
mergedMetadata =
|
|
4327
|
+
mergedMetadata = _chunkY3DO7BIJcjs.mergeMetadata.call(void 0, mergedMetadata, layoutModule.metadata);
|
|
4372
4328
|
if (typeof layoutModule.generateMetadata === "function") {
|
|
4373
|
-
mergedMetadata =
|
|
4329
|
+
mergedMetadata = _chunkY3DO7BIJcjs.mergeMetadata.call(void 0,
|
|
4374
4330
|
mergedMetadata,
|
|
4375
4331
|
await layoutModule.generateMetadata({ params: routeProps.params })
|
|
4376
4332
|
);
|
|
4377
4333
|
}
|
|
4378
|
-
mergedMetadata = await
|
|
4334
|
+
mergedMetadata = await _chunkY3DO7BIJcjs.mergeModuleViewport.call(void 0, mergedMetadata, layoutModule, {
|
|
4379
4335
|
params: routeProps.params
|
|
4380
4336
|
});
|
|
4381
4337
|
}
|
|
4382
|
-
mergedMetadata =
|
|
4338
|
+
mergedMetadata = _chunkY3DO7BIJcjs.mergeMetadata.call(void 0, mergedMetadata, routeModule.metadata);
|
|
4383
4339
|
if (typeof routeModule.generateMetadata === "function") {
|
|
4384
|
-
mergedMetadata =
|
|
4340
|
+
mergedMetadata = _chunkY3DO7BIJcjs.mergeMetadata.call(void 0,
|
|
4385
4341
|
mergedMetadata,
|
|
4386
4342
|
await routeModule.generateMetadata(routeProps)
|
|
4387
4343
|
);
|
|
4388
4344
|
}
|
|
4389
|
-
mergedMetadata = await
|
|
4390
|
-
mergedMetadata =
|
|
4345
|
+
mergedMetadata = await _chunkY3DO7BIJcjs.mergeModuleViewport.call(void 0, mergedMetadata, routeModule, routeProps);
|
|
4346
|
+
mergedMetadata = _chunkY3DO7BIJcjs.addMetadataMarkdownAlternate.call(void 0,
|
|
4391
4347
|
mergedMetadata,
|
|
4392
|
-
|
|
4348
|
+
_chunk2YJ4DHTDcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname, {
|
|
4393
4349
|
routePathname: (pathname2) => routeManager3.toRoutePathname(pathname2)
|
|
4394
4350
|
})
|
|
4395
4351
|
);
|
|
@@ -4398,7 +4354,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4398
4354
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
4399
4355
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
4400
4356
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
4401
|
-
), () => (
|
|
4357
|
+
), () => ( _chunkJNZDTE75cjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
4402
4358
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
4403
4359
|
request: targetRequest,
|
|
4404
4360
|
params: slot.params,
|
|
@@ -4443,16 +4399,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4443
4399
|
})
|
|
4444
4400
|
);
|
|
4445
4401
|
const projectRoot = server.config.root;
|
|
4446
|
-
const toUrlPath = (absolutePath) =>
|
|
4447
|
-
const renderPlan =
|
|
4402
|
+
const toUrlPath = (absolutePath) => _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, absolutePath, projectRoot);
|
|
4403
|
+
const renderPlan = _chunkXGDI4OUBcjs.createFarmRouteRenderPlan.call(void 0, {
|
|
4448
4404
|
pageShouldHydrate: shouldHydrate,
|
|
4449
4405
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
4450
4406
|
islandStrategy: hydrationIslandStrategy,
|
|
4451
|
-
rendering:
|
|
4407
|
+
rendering: _chunk7564NP5Zcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
4452
4408
|
});
|
|
4453
4409
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
4454
|
-
const layoutStartIndex =
|
|
4455
|
-
|
|
4410
|
+
const layoutStartIndex = _chunkXGDI4OUBcjs.getSharedLayoutPrefixLength.call(void 0,
|
|
4411
|
+
_chunkXGDI4OUBcjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
|
|
4456
4412
|
destinationLayoutPatterns
|
|
4457
4413
|
);
|
|
4458
4414
|
const renderer = farmApp.getServerRenderer();
|
|
@@ -4462,7 +4418,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4462
4418
|
middlewareContext,
|
|
4463
4419
|
() => renderer.renderNavigationFragment({
|
|
4464
4420
|
PageComponent: routeModule.default,
|
|
4465
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
4421
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _313 => _313.default]),
|
|
4466
4422
|
pageProps: routeProps,
|
|
4467
4423
|
params,
|
|
4468
4424
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -4524,7 +4480,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4524
4480
|
from: interceptFromHeader,
|
|
4525
4481
|
slots: routeSlots.filter((slot) => slot.interception).map((slot) => slot.name)
|
|
4526
4482
|
} : void 0,
|
|
4527
|
-
i18n:
|
|
4483
|
+
i18n: _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, )
|
|
4528
4484
|
};
|
|
4529
4485
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
4530
4486
|
res,
|
|
@@ -4533,7 +4489,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4533
4489
|
{
|
|
4534
4490
|
status: 200,
|
|
4535
4491
|
headers: {
|
|
4536
|
-
"Cache-Control":
|
|
4492
|
+
"Cache-Control": _chunkXGDI4OUBcjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
|
|
4537
4493
|
"X-Farm-Navigation": "html-fragment",
|
|
4538
4494
|
Vary: "X-Farm-Layout-Chain",
|
|
4539
4495
|
[_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
|
|
@@ -4541,7 +4497,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4541
4497
|
},
|
|
4542
4498
|
{
|
|
4543
4499
|
onError(error, id) {
|
|
4544
|
-
|
|
4500
|
+
_chunkGC5ROI3Acjs.logger.error(`Deferred route data ${id} failed: ${error}`);
|
|
4545
4501
|
}
|
|
4546
4502
|
}
|
|
4547
4503
|
)
|
|
@@ -4571,33 +4527,33 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4571
4527
|
const startTime = Date.now();
|
|
4572
4528
|
const method = req.method || "GET";
|
|
4573
4529
|
const urlPath = req.url || "/";
|
|
4574
|
-
const requestedPathname =
|
|
4530
|
+
const requestedPathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
4575
4531
|
trustProxy: currentServerConfig.trustProxy
|
|
4576
4532
|
}).pathname;
|
|
4577
4533
|
const routeManager2 = farmApp.getRouteManager();
|
|
4578
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4579
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4580
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4534
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _314 => _314.hasHook, 'call', _315 => _315("beforeRequest")]), () => ( false));
|
|
4535
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _316 => _316.hasHook, 'call', _317 => _317("afterResponse")]), () => ( false));
|
|
4536
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _318 => _318.hasHook, 'call', _319 => _319("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _320 => _320.hasHook, 'call', _321 => _321("afterRender")]), () => ( false)));
|
|
4581
4537
|
const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
|
|
4582
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4538
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _322 => _322.hasRuntimeHook, 'call', _323 => _323("after")]), () => ( false));
|
|
4583
4539
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
4584
4540
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
4585
|
-
const mcpLabel =
|
|
4541
|
+
const mcpLabel = _chunkWJ5CCQBMcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
4586
4542
|
if (mcpLabel) return mcpLabel;
|
|
4587
4543
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
4588
|
-
return routePathname ===
|
|
4544
|
+
return routePathname === _chunkYRXPDKMMcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkYRXPDKMMcjs.FARM_DEFAULT_MCP_PATH : null;
|
|
4589
4545
|
};
|
|
4590
4546
|
const pageRuntimeOptions = (pathname2) => {
|
|
4591
4547
|
const match = routeManager2.matchRoute(pathname2);
|
|
4592
4548
|
return {
|
|
4593
4549
|
kind: "page",
|
|
4594
|
-
route:
|
|
4550
|
+
route: _chunkWJ5CCQBMcjs.setFarmRouteLabel.call(void 0,
|
|
4595
4551
|
{
|
|
4596
4552
|
pathname: pathname2,
|
|
4597
|
-
pattern: _optionalChain([match, 'optionalAccess',
|
|
4598
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4553
|
+
pattern: _optionalChain([match, 'optionalAccess', _324 => _324.route, 'optionalAccess', _325 => _325.pattern]) || null,
|
|
4554
|
+
params: _optionalChain([match, 'optionalAccess', _326 => _326.params]) || {}
|
|
4599
4555
|
},
|
|
4600
|
-
_optionalChain([match, 'optionalAccess',
|
|
4556
|
+
_optionalChain([match, 'optionalAccess', _327 => _327.route]) ? null : pageBuiltInRouteLabel(pathname2)
|
|
4601
4557
|
)
|
|
4602
4558
|
};
|
|
4603
4559
|
};
|
|
@@ -4677,7 +4633,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4677
4633
|
}) : void 0;
|
|
4678
4634
|
let middlewareFailed = false;
|
|
4679
4635
|
try {
|
|
4680
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4636
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _328 => _328.hasMiddleware, 'call', _329 => _329()])) {
|
|
4681
4637
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
4682
4638
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
4683
4639
|
farmApp.getServerRenderer(),
|
|
@@ -4690,7 +4646,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4690
4646
|
throw error;
|
|
4691
4647
|
});
|
|
4692
4648
|
if (handled) {
|
|
4693
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4649
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _330 => _330.isEnded, 'call', _331 => _331()])) {
|
|
4694
4650
|
const duration = Date.now() - startTime;
|
|
4695
4651
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4696
4652
|
}
|
|
@@ -4705,8 +4661,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4705
4661
|
res
|
|
4706
4662
|
);
|
|
4707
4663
|
}
|
|
4708
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
4709
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4664
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _332 => _332.isEnded, 'call', _333 => _333()])) {
|
|
4665
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _334 => _334.isEnded, 'call', _335 => _335()])) {
|
|
4710
4666
|
const duration = Date.now() - startTime;
|
|
4711
4667
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4712
4668
|
}
|
|
@@ -4725,8 +4681,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4725
4681
|
await pm.reportRuntimeRequestError(runtimeSession, error);
|
|
4726
4682
|
} else {
|
|
4727
4683
|
await pm.failRuntimeRequest(runtimeSession, error);
|
|
4728
|
-
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4729
|
-
_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4684
|
+
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _336 => _336.isEnded, 'call', _337 => _337()])) {
|
|
4685
|
+
_optionalChain([responseInterceptor, 'optionalAccess', _338 => _338.release, 'call', _339 => _339()]);
|
|
4730
4686
|
console.error("[FARM] Page error:", error);
|
|
4731
4687
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
4732
4688
|
return;
|
|
@@ -4743,7 +4699,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4743
4699
|
}
|
|
4744
4700
|
})
|
|
4745
4701
|
);
|
|
4746
|
-
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access',
|
|
4702
|
+
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _340 => _340.stack, 'access', _341 => _341.at, 'call', _342 => _342(-1), 'optionalAccess', _343 => _343.handle]);
|
|
4747
4703
|
if (farmOwnsDevCors && viteServer.config.server.cors === false) {
|
|
4748
4704
|
farmMiddlewares.use(createFarmDevViteCorsMiddleware());
|
|
4749
4705
|
}
|
|
@@ -4757,7 +4713,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4757
4713
|
}
|
|
4758
4714
|
if (!rendererDisabled) return next();
|
|
4759
4715
|
const requested = _nullishCoalesce(_nullishCoalesce(req.originalUrl, () => ( req.url)), () => ( "/"));
|
|
4760
|
-
const pathname =
|
|
4716
|
+
const pathname = _chunk2RSVYJT6cjs.parseFarmRequestTarget.call(void 0, requested, "http://localhost").pathname;
|
|
4761
4717
|
res.statusCode = 404;
|
|
4762
4718
|
res.setHeader("Content-Type", "application/json");
|
|
4763
4719
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
@@ -4772,7 +4728,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4772
4728
|
});
|
|
4773
4729
|
}
|
|
4774
4730
|
if (id.startsWith("@farm.js/core/internal/") && importer && isOutsideAppRoot(importer)) {
|
|
4775
|
-
const root = _optionalChain([farmApp, 'optionalAccess',
|
|
4731
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _344 => _344.getConfig, 'call', _345 => _345(), 'access', _346 => _346.root]) || _optionalChain([server, 'optionalAccess', _347 => _347.config, 'access', _348 => _348.root]) || options.root;
|
|
4776
4732
|
return this.resolve(id, path6.join(root, "package.json"), {
|
|
4777
4733
|
...resolveOptions,
|
|
4778
4734
|
skipSelf: true
|
|
@@ -4786,7 +4742,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4786
4742
|
const imageId = await imageImports.resolveId.call(this, id, importer, resolveOptions);
|
|
4787
4743
|
if (imageId) return imageId;
|
|
4788
4744
|
}
|
|
4789
|
-
if (
|
|
4745
|
+
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4790
4746
|
return id;
|
|
4791
4747
|
}
|
|
4792
4748
|
if (isFarmClientVirtualId(id) || id === FARM_DEV_CLIENT_BOOT_ID) {
|
|
@@ -4800,7 +4756,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4800
4756
|
}
|
|
4801
4757
|
},
|
|
4802
4758
|
async load(id, loadOptions) {
|
|
4803
|
-
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess',
|
|
4759
|
+
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _349 => _349.ssr]) && !farmSetupContext.getStore()) {
|
|
4804
4760
|
await pendingClientSetup;
|
|
4805
4761
|
}
|
|
4806
4762
|
if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
|
|
@@ -4817,9 +4773,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4817
4773
|
const imageModule = await imageImports.load.call(this, id);
|
|
4818
4774
|
if (imageModule) return imageModule;
|
|
4819
4775
|
}
|
|
4820
|
-
if (
|
|
4821
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
4822
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
4776
|
+
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4777
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _350 => _350.getConfig, 'call', _351 => _351(), 'access', _352 => _352.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4778
|
+
const root = _optionalChain([server, 'optionalAccess', _353 => _353.config, 'access', _354 => _354.root]) || options.root;
|
|
4823
4779
|
if (isClientEnvironment(this, loadOptions)) {
|
|
4824
4780
|
return generateProgrammaticClientRouteModuleForId(
|
|
4825
4781
|
id,
|
|
@@ -4835,65 +4791,65 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4835
4791
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
4836
4792
|
}
|
|
4837
4793
|
if (isFarmClientVirtualId(id)) {
|
|
4838
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4839
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4840
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4841
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4842
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4794
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _355 => _355.getConfig, 'call', _356 => _356()]);
|
|
4795
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _357 => _357.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4796
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _358 => _358.integrations]) || options.integrations;
|
|
4797
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _359 => _359.root]) || _optionalChain([server, 'optionalAccess', _360 => _360.config, 'access', _361 => _361.root]) || process.cwd();
|
|
4798
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _362 => _362.docs]);
|
|
4843
4799
|
const adapterOwnsDocsRuntime = Boolean(
|
|
4844
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
4800
|
+
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _363 => _363.adapter, 'optionalAccess', _364 => _364.server]) && docs.adapter.react
|
|
4845
4801
|
);
|
|
4846
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4802
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _365 => _365.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
4847
4803
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
4848
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4849
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4804
|
+
_optionalChain([docs, 'optionalAccess', _366 => _366.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
4805
|
+
_optionalChain([docs, 'optionalAccess', _367 => _367.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
4850
4806
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
4851
4807
|
]);
|
|
4852
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
4808
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _368 => _368.isFarmDocsSearchEnabled, 'call', _369 => _369(docs)]), () => ( false));
|
|
4853
4809
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
4854
4810
|
docsSearchEnabled,
|
|
4855
4811
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
4856
4812
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
4857
4813
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
4858
4814
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkUVV3I5QAcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
4859
|
-
const integrationProviders = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ?
|
|
4860
|
-
const isolatedHydrationMode =
|
|
4861
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4815
|
+
const integrationProviders = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunk6DBBMQWTcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
4816
|
+
const isolatedHydrationMode = _chunkJNZDTE75cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
4817
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _370 => _370.experimental, 'optionalAccess', _371 => _371.isolatedClientHydration]),
|
|
4862
4818
|
{
|
|
4863
|
-
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4819
|
+
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _372 => _372.experimental, 'optionalAccess', _373 => _373.serverComponents])) === "rsc",
|
|
4864
4820
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
4865
4821
|
}
|
|
4866
4822
|
);
|
|
4867
4823
|
return generateClientCode(
|
|
4868
4824
|
integrationProviders,
|
|
4869
4825
|
[
|
|
4870
|
-
...
|
|
4871
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
4826
|
+
..._chunk6DBBMQWTcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
4827
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _374 => _374.getFarmDocsDocumentNavigationMatchers, 'call', _375 => _375(docs)]), () => ( []))
|
|
4872
4828
|
],
|
|
4873
4829
|
generatedDocsSearchRuntime,
|
|
4874
4830
|
`${generatedDevtoolsClientRuntime}
|
|
4875
4831
|
${generatedDevIndicatorsClientRuntime}`,
|
|
4876
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4832
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _376 => _376.plugins]) || [],
|
|
4877
4833
|
root,
|
|
4878
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4879
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4880
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
4834
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _377 => _377.srcDir]) || options.srcDir || "src",
|
|
4835
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _378 => _378.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
4836
|
+
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _379 => _379.adapter, 'optionalAccess', _380 => _380.react]) : void 0,
|
|
4881
4837
|
renderer,
|
|
4882
|
-
isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
4883
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4884
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4885
|
-
|
|
4886
|
-
|
|
4838
|
+
isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _381 => _381.getRouteManager, 'call', _382 => _382(), 'access', _383 => _383.getIsolatedClientBoundaryModules, 'call', _384 => _384(root)])))), 'optionalAccess', _385 => _385.size]) > 0,
|
|
4839
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _386 => _386.trailingSlash]), () => ( false)),
|
|
4840
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _387 => _387.basePath]), () => ( "/")),
|
|
4841
|
+
_chunkIK33N2ANcjs.generateClientCachePersistenceCode.call(void 0,
|
|
4842
|
+
_chunkIK33N2ANcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _388 => _388.cache]))
|
|
4887
4843
|
),
|
|
4888
4844
|
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
4889
|
-
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4845
|
+
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _389 => _389.experimental, 'optionalAccess', _390 => _390.serverComponents])) === "islands"
|
|
4890
4846
|
);
|
|
4891
4847
|
}
|
|
4892
4848
|
if (id === "/@farm/server") {
|
|
4893
4849
|
return generateServerCode();
|
|
4894
4850
|
}
|
|
4895
4851
|
if (id === "/@farm/manifest") {
|
|
4896
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4852
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _391 => _391.getRouteManager, 'call', _392 => _392()]);
|
|
4897
4853
|
if (!routeManager) {
|
|
4898
4854
|
return `
|
|
4899
4855
|
export const getManifest = () => ({
|
|
@@ -4905,11 +4861,11 @@ export const getManifest = () => ({
|
|
|
4905
4861
|
});
|
|
4906
4862
|
`;
|
|
4907
4863
|
}
|
|
4908
|
-
const globalStylesheetHref =
|
|
4864
|
+
const globalStylesheetHref = _chunkIK33N2ANcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
4909
4865
|
server.config.root,
|
|
4910
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4866
|
+
_optionalChain([farmApp, 'optionalAccess', _393 => _393.getConfig, 'call', _394 => _394(), 'access', _395 => _395.srcDir])
|
|
4911
4867
|
);
|
|
4912
|
-
const fullManifest =
|
|
4868
|
+
const fullManifest = _chunkIK33N2ANcjs.createFarmDevClientManifest.call(void 0,
|
|
4913
4869
|
routeManager.generateClientManifest(server.config.root),
|
|
4914
4870
|
{
|
|
4915
4871
|
sharedAssets: globalStylesheetHref ? [{ tag: "link", attrs: { rel: "stylesheet", href: globalStylesheetHref } }] : []
|
|
@@ -4925,64 +4881,64 @@ export { manifest };
|
|
|
4925
4881
|
}
|
|
4926
4882
|
},
|
|
4927
4883
|
async transform(code, id, transformOptions) {
|
|
4928
|
-
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess',
|
|
4884
|
+
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _396 => _396.ssr]) && !farmSetupContext.getStore()) {
|
|
4929
4885
|
await pendingClientSetup;
|
|
4930
4886
|
}
|
|
4931
|
-
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess',
|
|
4932
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4887
|
+
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _397 => _397.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
|
|
4888
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _398 => _398.getConfig, 'call', _399 => _399()]), () => ( options));
|
|
4933
4889
|
let rewrotePackageImports = false;
|
|
4934
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
4890
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _400 => _400.experimental, 'optionalAccess', _401 => _401.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _402 => _402.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkJNZDTE75cjs.hasUseClientDirective.call(void 0, code)) {
|
|
4935
4891
|
const file = id.split("?", 1)[0];
|
|
4936
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4892
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _403 => _403.config, 'access', _404 => _404.root]) || process.cwd();
|
|
4937
4893
|
const buildSnapshot = isBuild ? options.sourceSnapshot : void 0;
|
|
4938
4894
|
const rewrite = () => {
|
|
4939
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4895
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _405 => _405.ssr]) === true) {
|
|
4940
4896
|
if (farmReactServerFiles.has(file)) {
|
|
4941
|
-
for (const child of
|
|
4897
|
+
for (const child of _chunkJNZDTE75cjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
4942
4898
|
farmReactServerFiles.add(child);
|
|
4943
4899
|
}
|
|
4944
|
-
const serverModule = farmReactServerFiles.has(file) || !
|
|
4900
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunkJNZDTE75cjs.getFarmClientReachableModules.call(void 0,
|
|
4945
4901
|
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
4946
4902
|
projectRoot
|
|
4947
4903
|
).has(path6.resolve(file));
|
|
4948
|
-
const reactServer = !serverModule ? null :
|
|
4904
|
+
const reactServer = !serverModule ? null : _chunkJNZDTE75cjs.rewriteFarmReactServerImports.call(void 0, {
|
|
4949
4905
|
code,
|
|
4950
4906
|
file,
|
|
4951
|
-
reference: (specifier, exportName) =>
|
|
4907
|
+
reference: (specifier, exportName) => _chunkJNZDTE75cjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
|
|
4952
4908
|
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
4953
4909
|
});
|
|
4954
4910
|
if (reactServer !== null) {
|
|
4955
4911
|
code = reactServer;
|
|
4956
4912
|
rewrotePackageImports = true;
|
|
4957
4913
|
}
|
|
4958
|
-
const internal = farmReactServerFiles.has(file) ?
|
|
4914
|
+
const internal = farmReactServerFiles.has(file) ? _chunkJNZDTE75cjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
|
|
4959
4915
|
code,
|
|
4960
4916
|
file,
|
|
4961
|
-
reference: (clientFile) =>
|
|
4917
|
+
reference: (clientFile) => _chunkJNZDTE75cjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
|
|
4962
4918
|
}) : null;
|
|
4963
4919
|
if (internal !== null) {
|
|
4964
4920
|
code = internal;
|
|
4965
4921
|
rewrotePackageImports = true;
|
|
4966
4922
|
}
|
|
4967
4923
|
}
|
|
4968
|
-
const rewritePackageImports = (source2) =>
|
|
4924
|
+
const rewritePackageImports = (source2) => _chunkJNZDTE75cjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
4969
4925
|
code: source2,
|
|
4970
4926
|
file,
|
|
4971
4927
|
root: projectRoot,
|
|
4972
|
-
isClientPackage: (specifier) =>
|
|
4928
|
+
isClientPackage: (specifier) => _chunkJNZDTE75cjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
4973
4929
|
});
|
|
4974
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4930
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _406 => _406.getRouteManager, 'call', _407 => _407()]);
|
|
4975
4931
|
const source = code;
|
|
4976
4932
|
const referenced = routeManager ? routeManager.inspectPackages(() => rewritePackageImports(source)) : rewritePackageImports(source);
|
|
4977
4933
|
if (referenced !== null) {
|
|
4978
4934
|
code = referenced;
|
|
4979
4935
|
rewrotePackageImports = true;
|
|
4980
4936
|
}
|
|
4981
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4937
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _408 => _408.ssr]) === true) {
|
|
4982
4938
|
const cached = rewriteFarmReactCacheImport(
|
|
4983
4939
|
code,
|
|
4984
4940
|
file,
|
|
4985
|
-
_optionalChain([runtimeModule, 'optionalCall',
|
|
4941
|
+
_optionalChain([runtimeModule, 'optionalCall', _409 => _409(FARM_REACT_CACHE_MODULE)])
|
|
4986
4942
|
);
|
|
4987
4943
|
if (cached !== null) {
|
|
4988
4944
|
code = cached;
|
|
@@ -4990,46 +4946,46 @@ export { manifest };
|
|
|
4990
4946
|
}
|
|
4991
4947
|
}
|
|
4992
4948
|
};
|
|
4993
|
-
if (buildSnapshot)
|
|
4949
|
+
if (buildSnapshot) _chunkJNZDTE75cjs.withFarmSourceSnapshotOf.call(void 0, buildSnapshot, rewrite);
|
|
4994
4950
|
else rewrite();
|
|
4995
4951
|
}
|
|
4996
4952
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
4997
4953
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
4998
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
4954
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _410 => _410.ssr]) === true ? "rsc" : "client"
|
|
4999
4955
|
});
|
|
5000
4956
|
if (serverFns) {
|
|
5001
4957
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
5002
4958
|
code = serverFns.code;
|
|
5003
4959
|
}
|
|
5004
4960
|
}
|
|
5005
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
4961
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _411 => _411.experimental, 'optionalAccess', _412 => _412.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
5006
4962
|
const file = id.split("?", 1)[0];
|
|
5007
4963
|
const actionModule = transformFarmFormActionModule({
|
|
5008
4964
|
code,
|
|
5009
4965
|
id,
|
|
5010
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5011
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
4966
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _413 => _413.config, 'access', _414 => _414.root]) || process.cwd(),
|
|
4967
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _415 => _415.ssr]) === true,
|
|
5012
4968
|
// Parsed by file type: page components are TSX.
|
|
5013
4969
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program,
|
|
5014
4970
|
runtimeModule
|
|
5015
4971
|
});
|
|
5016
4972
|
if (actionModule) return { code: actionModule, map: null };
|
|
5017
4973
|
}
|
|
5018
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5019
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
5020
|
-
if (
|
|
5021
|
-
const redacted =
|
|
4974
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _416 => _416.ssr])) {
|
|
4975
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _417 => _417.getConfig, 'call', _418 => _418(), 'optionalAccess', _419 => _419.docs]));
|
|
4976
|
+
if (_chunkIK33N2ANcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
4977
|
+
const redacted = _chunkIK33N2ANcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
5022
4978
|
if (redacted !== null) return { code: redacted, map: null };
|
|
5023
4979
|
}
|
|
5024
4980
|
}
|
|
5025
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5026
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5027
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
4981
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _420 => _420.ssr])) {
|
|
4982
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _421 => _421.getConfig, 'call', _422 => _422()]), () => ( options));
|
|
4983
|
+
if ((_optionalChain([currentConfig, 'access', _423 => _423.experimental, 'optionalAccess', _424 => _424.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
5028
4984
|
const violation = findClientServerFnViolation(code, id);
|
|
5029
4985
|
if (violation) {
|
|
5030
|
-
const locate =
|
|
4986
|
+
const locate = _chunkJNZDTE75cjs.createFarmSourceLocator.call(void 0, code, () => this.getCombinedSourcemap());
|
|
5031
4987
|
this.error(
|
|
5032
|
-
|
|
4988
|
+
_chunkJNZDTE75cjs.formatFarmDiagnostic.call(void 0,
|
|
5033
4989
|
createServerFnBoundaryDiagnostic(violation, id, locate(violation.start)),
|
|
5034
4990
|
currentConfig.root
|
|
5035
4991
|
)
|
|
@@ -5037,8 +4993,8 @@ export { manifest };
|
|
|
5037
4993
|
}
|
|
5038
4994
|
}
|
|
5039
4995
|
}
|
|
5040
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5041
|
-
await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4996
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _425 => _425.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
4997
|
+
await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _426 => _426.getConfig, 'call', _427 => _427()]), () => ( options)));
|
|
5042
4998
|
}
|
|
5043
4999
|
if (typeof imageImports.transform === "function") {
|
|
5044
5000
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -5053,13 +5009,13 @@ export { manifest };
|
|
|
5053
5009
|
id,
|
|
5054
5010
|
transformOptions
|
|
5055
5011
|
);
|
|
5056
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
5012
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _428 => _428.code, 'optionalAccess', _429 => _429.toString, 'call', _430 => _430()]);
|
|
5057
5013
|
if (fontCode) {
|
|
5058
5014
|
transformedCode = fontCode;
|
|
5059
5015
|
transformed = true;
|
|
5060
5016
|
}
|
|
5061
5017
|
}
|
|
5062
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5018
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _431 => _431.ssr]) && server) {
|
|
5063
5019
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
5064
5020
|
code: transformedCode,
|
|
5065
5021
|
id,
|
|
@@ -5071,26 +5027,26 @@ export { manifest };
|
|
|
5071
5027
|
transformed = true;
|
|
5072
5028
|
}
|
|
5073
5029
|
}
|
|
5074
|
-
if (
|
|
5030
|
+
if (_chunkJNZDTE75cjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
5075
5031
|
const clientBoundarySource = transformedCode;
|
|
5076
5032
|
const moduleInfo = this.getModuleInfo(id);
|
|
5077
5033
|
if (moduleInfo) {
|
|
5078
5034
|
moduleInfo.isClientComponent = true;
|
|
5079
5035
|
}
|
|
5080
|
-
transformedCode =
|
|
5036
|
+
transformedCode = _chunkJNZDTE75cjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
5081
5037
|
transformed = true;
|
|
5082
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5038
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _432 => _432.getConfig, 'call', _433 => _433()]), () => ( options));
|
|
5083
5039
|
let isolatedModuleReference = null;
|
|
5084
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5040
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _434 => _434.config, 'access', _435 => _435.root]) || process.cwd();
|
|
5085
5041
|
const cleanId = id.split("?", 1)[0];
|
|
5086
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
5087
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
5088
|
-
if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (
|
|
5089
|
-
cleanId.replace(/\\/g, "/").includes(
|
|
5090
|
-
isolatedModuleReference =
|
|
5091
|
-
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access',
|
|
5092
|
-
const explicitStrategy =
|
|
5093
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
5042
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _436 => _436.getRouteManager, 'call', _437 => _437(), 'access', _438 => _438.getIsolatedClientBoundaryModules, 'call', _439 => _439(root)])));
|
|
5043
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _440 => _440.has, 'call', _441 => _441(path6.resolve(cleanId))]) === true;
|
|
5044
|
+
if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkJNZDTE75cjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
5045
|
+
cleanId.replace(/\\/g, "/").includes(_chunkJNZDTE75cjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
5046
|
+
isolatedModuleReference = _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, cleanId, root);
|
|
5047
|
+
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _442 => _442.experimental, 'optionalAccess', _443 => _443.serverComponents])) === "islands";
|
|
5048
|
+
const explicitStrategy = _chunkJNZDTE75cjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
5049
|
+
const inference = islandsMode && explicitStrategy === null ? _chunkIK33N2ANcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
5094
5050
|
if (inference) {
|
|
5095
5051
|
for (const file of inference.files) {
|
|
5096
5052
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -5103,8 +5059,8 @@ export { manifest };
|
|
|
5103
5059
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
5104
5060
|
parse: (source) => this.parse(source),
|
|
5105
5061
|
slots: islandsMode,
|
|
5106
|
-
browser: _optionalChain([transformOptions, 'optionalAccess',
|
|
5107
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
5062
|
+
browser: _optionalChain([transformOptions, 'optionalAccess', _444 => _444.ssr]) !== true,
|
|
5063
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _445 => _445.strategy]) === "interaction",
|
|
5108
5064
|
runtimeModule
|
|
5109
5065
|
});
|
|
5110
5066
|
if (!transformedBoundary) {
|
|
@@ -5135,7 +5091,7 @@ export { manifest };
|
|
|
5135
5091
|
);
|
|
5136
5092
|
return;
|
|
5137
5093
|
}` : "";
|
|
5138
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
5094
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _446 => _446.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
5139
5095
|
if (import.meta.hot) {
|
|
5140
5096
|
import.meta.hot.accept((newModule) => {
|
|
5141
5097
|
${isolatedHmrUpdate}
|
|
@@ -5186,19 +5142,19 @@ if (import.meta.hot) {
|
|
|
5186
5142
|
if (!routeManager) return;
|
|
5187
5143
|
const { ssg: ssgPages, ssr: ssrRoutes } = await routeManager.collectSSGPages();
|
|
5188
5144
|
if (ssgPages.length === 0) {
|
|
5189
|
-
|
|
5145
|
+
_chunkGC5ROI3Acjs.logger.info("No SSG pages found - all pages will use SSR");
|
|
5190
5146
|
return;
|
|
5191
5147
|
}
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
5148
|
+
_chunkGC5ROI3Acjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
5149
|
+
_chunkGC5ROI3Acjs.logger.info("Pre-rendering SSG pages...");
|
|
5150
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _447 => _447.config, 'access', _448 => _448.root]) || process.cwd(), options.outDir || "dist");
|
|
5195
5151
|
const clientDir = path6.join(outDir, "client");
|
|
5196
5152
|
for (const page of ssgPages) {
|
|
5197
5153
|
try {
|
|
5198
5154
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
5199
5155
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
5200
5156
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
5201
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
5157
|
+
if (!_optionalChain([mod, 'optionalAccess', _449 => _449.default])) return;
|
|
5202
5158
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
5203
5159
|
const layoutModules = await Promise.all(
|
|
5204
5160
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -5227,10 +5183,10 @@ if (import.meta.hot) {
|
|
|
5227
5183
|
);
|
|
5228
5184
|
}
|
|
5229
5185
|
const html = renderToString(pageElement);
|
|
5230
|
-
const i18nSnapshot =
|
|
5186
|
+
const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
5231
5187
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
5232
5188
|
const fullHtml = `<!DOCTYPE html>
|
|
5233
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
5189
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _450 => _450.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
5234
5190
|
<head>
|
|
5235
5191
|
<meta charset="utf-8">
|
|
5236
5192
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -5248,10 +5204,10 @@ if (import.meta.hot) {
|
|
|
5248
5204
|
fs2.mkdirSync(path6.dirname(outputPath), { recursive: true });
|
|
5249
5205
|
fs2.writeFileSync(outputPath, fullHtml);
|
|
5250
5206
|
const revalidateInfo = page.revalidate ? ` (revalidate: ${page.revalidate}s)` : "";
|
|
5251
|
-
|
|
5207
|
+
_chunkGC5ROI3Acjs.logger.success(` \u2713 ${page.urlPath}${revalidateInfo}`);
|
|
5252
5208
|
});
|
|
5253
5209
|
} catch (error) {
|
|
5254
|
-
|
|
5210
|
+
_chunkGC5ROI3Acjs.logger.error(` \u2717 ${page.urlPath}: ${error}`);
|
|
5255
5211
|
}
|
|
5256
5212
|
}
|
|
5257
5213
|
const manifestPath = path6.join(outDir, "__ssg_manifest.json");
|
|
@@ -5267,20 +5223,20 @@ if (import.meta.hot) {
|
|
|
5267
5223
|
2
|
|
5268
5224
|
)
|
|
5269
5225
|
);
|
|
5270
|
-
|
|
5226
|
+
_chunkGC5ROI3Acjs.logger.success(`SSG complete: ${ssgPages.length} pages pre-rendered`);
|
|
5271
5227
|
} catch (error) {
|
|
5272
|
-
|
|
5228
|
+
_chunkGC5ROI3Acjs.logger.error(`SSG build failed: ${error}`);
|
|
5273
5229
|
}
|
|
5274
5230
|
},
|
|
5275
5231
|
watchChange(id, change) {
|
|
5276
|
-
const watched =
|
|
5232
|
+
const watched = _chunkGC5ROI3Acjs.toPosixPath.call(void 0, id);
|
|
5277
5233
|
if (!watched.includes("/node_modules/") && !isFarmGeneratedOutput(watched)) {
|
|
5278
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
5234
|
+
_optionalChain([farmApp, 'optionalAccess', _451 => _451.getRouteManager, 'call', _452 => _452(), 'access', _453 => _453.noteSourceChange, 'call', _454 => _454(id, change.event)]);
|
|
5279
5235
|
}
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5236
|
+
_chunkJNZDTE75cjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
5237
|
+
_chunkJNZDTE75cjs.invalidateFarmClientOnlyScan.call(void 0, );
|
|
5238
|
+
_chunkIK33N2ANcjs.invalidateFarmRouteRootInferences.call(void 0, );
|
|
5239
|
+
_chunkJNZDTE75cjs.dropLatestPackageClientBoundaryCache.call(void 0, );
|
|
5284
5240
|
},
|
|
5285
5241
|
async handleHotUpdate(ctx) {
|
|
5286
5242
|
if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
|
|
@@ -5301,27 +5257,34 @@ if (import.meta.hot) {
|
|
|
5301
5257
|
}
|
|
5302
5258
|
for (const island of _nullishCoalesce(farmIslandInferenceDependents.get(path6.resolve(file)), () => ( []))) {
|
|
5303
5259
|
if (island === path6.resolve(file)) continue;
|
|
5304
|
-
for (const mod of _nullishCoalesce(server2.moduleGraph.getModulesByFile(
|
|
5260
|
+
for (const mod of _nullishCoalesce(server2.moduleGraph.getModulesByFile(_chunkGC5ROI3Acjs.toPosixPath.call(void 0, island)), () => ( []))) {
|
|
5305
5261
|
server2.moduleGraph.invalidateModule(mod);
|
|
5306
5262
|
}
|
|
5307
5263
|
}
|
|
5308
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
5264
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _455 => _455.getConfig, 'call', _456 => _456()]);
|
|
5309
5265
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
5266
|
+
if (normalizedFile.includes(_chunkJNZDTE75cjs.FARM_CLIENT_REFERENCE_DIRECTORY) && normalizedFile.startsWith(
|
|
5267
|
+
path6.posix.join(
|
|
5268
|
+
_chunkGC5ROI3Acjs.toPosixPath.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _457 => _457.root]) || options.root || server2.config.root),
|
|
5269
|
+
_chunkJNZDTE75cjs.FARM_CLIENT_REFERENCE_DIRECTORY
|
|
5270
|
+
)
|
|
5271
|
+
))
|
|
5272
|
+
return modules;
|
|
5310
5273
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
5311
|
-
(appDir) => normalizedFile.startsWith(`${
|
|
5274
|
+
(appDir) => normalizedFile.startsWith(`${_chunkGC5ROI3Acjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
5312
5275
|
)) {
|
|
5313
5276
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
5314
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5277
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _458 => _458(`updated ${file}`)]);
|
|
5315
5278
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
5316
5279
|
return [];
|
|
5317
5280
|
}
|
|
5318
5281
|
const currentSrcRoot = currentFarmConfig ? _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
|
|
5319
|
-
if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) &&
|
|
5282
|
+
if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) && _chunkYUCU6XB4cjs.isProgrammaticRoutesFileName.call(void 0, normalizedFile)) {
|
|
5320
5283
|
logUpdate("PAGE", `updated ${path6.basename(file)}`);
|
|
5321
5284
|
for (const mod of modules) {
|
|
5322
5285
|
server2.moduleGraph.invalidateModule(mod);
|
|
5323
5286
|
}
|
|
5324
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5287
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _459 => _459(`updated ${file}`)]);
|
|
5325
5288
|
server2.ws.send({
|
|
5326
5289
|
type: "full-reload",
|
|
5327
5290
|
path: "*"
|
|
@@ -5334,24 +5297,24 @@ if (import.meta.hot) {
|
|
|
5334
5297
|
for (const mod of modules) {
|
|
5335
5298
|
server2.moduleGraph.invalidateModule(mod);
|
|
5336
5299
|
}
|
|
5337
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5300
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _460 => _460(`updated ${file}`)]);
|
|
5338
5301
|
server2.ws.send({
|
|
5339
5302
|
type: "full-reload",
|
|
5340
5303
|
path: "*"
|
|
5341
5304
|
});
|
|
5342
5305
|
return [];
|
|
5343
5306
|
}
|
|
5344
|
-
if (apiRouteManager &&
|
|
5345
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5307
|
+
if (apiRouteManager && _chunk25JGHAGHcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
5308
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _461 => _461(`updated ${file}`)]);
|
|
5346
5309
|
}
|
|
5347
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5348
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
5310
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _462 => _462.experimental, 'optionalAccess', _463 => _463.isolatedClientHydration]);
|
|
5311
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _464 => _464.getRouteManager, 'call', _465 => _465()]);
|
|
5349
5312
|
const isHydrationPlanSource = /\.[cm]?[jt]sx?$/.test(normalizedFile) && !normalizedFile.includes("/node_modules/") && !isFarmGeneratedOutput(normalizedFile);
|
|
5350
|
-
const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5313
|
+
const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _466 => _466.renderer])) && planRouteManager !== void 0;
|
|
5351
5314
|
let clientPlanCurrent = false;
|
|
5352
5315
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
5353
5316
|
const routeManager = planRouteManager;
|
|
5354
|
-
if (_optionalChain([routeManager, 'optionalAccess',
|
|
5317
|
+
if (_optionalChain([routeManager, 'optionalAccess', _467 => _467.isEditPlanNeutral, 'call', _468 => _468(file)])) {
|
|
5355
5318
|
clientPlanCurrent = true;
|
|
5356
5319
|
} else if (routeManager) {
|
|
5357
5320
|
routeManager.noteSourceChange(file, "update");
|
|
@@ -5375,7 +5338,7 @@ if (import.meta.hot) {
|
|
|
5375
5338
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
5376
5339
|
for (const boundary of /* @__PURE__ */ new Set([...previousBoundaries, ...nextBoundaries])) {
|
|
5377
5340
|
if (previousBoundaries.has(boundary) === nextBoundaries.has(boundary)) continue;
|
|
5378
|
-
for (const mod of _nullishCoalesce(server2.moduleGraph.getModulesByFile(
|
|
5341
|
+
for (const mod of _nullishCoalesce(server2.moduleGraph.getModulesByFile(_chunkGC5ROI3Acjs.toPosixPath.call(void 0, boundary)), () => ( []))) {
|
|
5379
5342
|
server2.moduleGraph.invalidateModule(mod);
|
|
5380
5343
|
}
|
|
5381
5344
|
}
|
|
@@ -5388,7 +5351,7 @@ if (import.meta.hot) {
|
|
|
5388
5351
|
}
|
|
5389
5352
|
clientPlanCurrent = true;
|
|
5390
5353
|
} catch (error) {
|
|
5391
|
-
|
|
5354
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
5392
5355
|
`[Farm.js] Could not refresh the client hydration plan after ${file}: ${error instanceof Error ? error.message : String(error)}`
|
|
5393
5356
|
);
|
|
5394
5357
|
return modules;
|
|
@@ -5399,7 +5362,7 @@ if (import.meta.hot) {
|
|
|
5399
5362
|
if (normalizedFile.includes("middleware.")) {
|
|
5400
5363
|
if (middlewareManager) {
|
|
5401
5364
|
await middlewareManager.reload();
|
|
5402
|
-
|
|
5365
|
+
_chunkGC5ROI3Acjs.logger.success("\u2705 Middleware reloaded!");
|
|
5403
5366
|
if (initialPluginManager) {
|
|
5404
5367
|
for (const middleware of middlewareManager.getMiddlewares()) {
|
|
5405
5368
|
await initialPluginManager.runHookParallel("middlewareDiscovered", {
|
|
@@ -5412,7 +5375,7 @@ if (import.meta.hot) {
|
|
|
5412
5375
|
}
|
|
5413
5376
|
return [];
|
|
5414
5377
|
}
|
|
5415
|
-
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess',
|
|
5378
|
+
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _469 => _469.getRouteManager, 'call', _470 => _470(), 'access', _471 => _471.invalidateClientManifest, 'call', _472 => _472()]);
|
|
5416
5379
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
5417
5380
|
if (manifestModule) {
|
|
5418
5381
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -5430,7 +5393,7 @@ if (import.meta.hot) {
|
|
|
5430
5393
|
return [];
|
|
5431
5394
|
}
|
|
5432
5395
|
}
|
|
5433
|
-
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access',
|
|
5396
|
+
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access', _473 => _473.environments, 'access', _474 => _474.client, 'optionalAccess', _475 => _475.moduleGraph, 'access', _476 => _476.getModulesByFile, 'call', _477 => _477(normalizedFile), 'optionalAccess', _478 => _478.size]) && _chunk25JGHAGHcjs.invalidateFarmDevDependents.call(void 0, server2, file, getFarmRenderedServerModules()).length > 0) {
|
|
5434
5397
|
logUpdate("PAGE", `updated ${path6.basename(file)}`);
|
|
5435
5398
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
5436
5399
|
return [];
|
|
@@ -5528,7 +5491,7 @@ function createPageDataMiddlewareResponse(res) {
|
|
|
5528
5491
|
return (...args) => {
|
|
5529
5492
|
if (captures(target.statusCode, target.getHeader("location"))) {
|
|
5530
5493
|
const callback = args.find((arg) => typeof arg === "function");
|
|
5531
|
-
_optionalChain([callback, 'optionalCall',
|
|
5494
|
+
_optionalChain([callback, 'optionalCall', _479 => _479()]);
|
|
5532
5495
|
return property === "write" ? true : response;
|
|
5533
5496
|
}
|
|
5534
5497
|
return target[property](...args);
|
|
@@ -5592,42 +5555,42 @@ function isFarmClientVirtualId(id) {
|
|
|
5592
5555
|
}
|
|
5593
5556
|
function isClientEnvironment(context, loadOptions) {
|
|
5594
5557
|
const environment = context.environment;
|
|
5595
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5596
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5597
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
5558
|
+
if (_optionalChain([environment, 'optionalAccess', _480 => _480.config, 'optionalAccess', _481 => _481.consumer])) return environment.config.consumer === "client";
|
|
5559
|
+
if (_optionalChain([environment, 'optionalAccess', _482 => _482.name])) return environment.name === "client";
|
|
5560
|
+
return _optionalChain([loadOptions, 'optionalAccess', _483 => _483.ssr]) !== true;
|
|
5598
5561
|
}
|
|
5599
5562
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
5600
|
-
const graph = _optionalChain([server, 'access',
|
|
5563
|
+
const graph = _optionalChain([server, 'access', _484 => _484.environments, 'optionalAccess', _485 => _485.client, 'optionalAccess', _486 => _486.moduleGraph]);
|
|
5601
5564
|
if (!graph) return;
|
|
5602
5565
|
for (const [id, module] of graph.idToModuleMap) {
|
|
5603
|
-
if (
|
|
5566
|
+
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
5604
5567
|
}
|
|
5605
5568
|
}
|
|
5606
5569
|
function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, clientRoutes, watchFile) {
|
|
5607
|
-
const parsed =
|
|
5570
|
+
const parsed = _chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5608
5571
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
5609
5572
|
watchFile(routesFile);
|
|
5610
|
-
return
|
|
5573
|
+
return _chunkJNZDTE75cjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
5611
5574
|
kind: parsed.kind,
|
|
5612
5575
|
routePath: parsed.routePath,
|
|
5613
5576
|
routesFile,
|
|
5614
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
5615
|
-
|
|
5577
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _487 => _487.routes, 'access', _488 => _488.get, 'call', _489 => _489(
|
|
5578
|
+
_chunkJNZDTE75cjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
5616
5579
|
)]),
|
|
5617
5580
|
rendererServer: renderer.server,
|
|
5618
5581
|
toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
|
|
5619
5582
|
});
|
|
5620
5583
|
}
|
|
5621
5584
|
function resolveRealModuleFile(filePath, root) {
|
|
5622
|
-
const resolved = _nullishCoalesce(
|
|
5585
|
+
const resolved = _nullishCoalesce(_chunkJNZDTE75cjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
5623
5586
|
try {
|
|
5624
|
-
return
|
|
5587
|
+
return _chunkGC5ROI3Acjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
5625
5588
|
} catch (e28) {
|
|
5626
|
-
return
|
|
5589
|
+
return _chunkGC5ROI3Acjs.toPosixPath.call(void 0, resolved);
|
|
5627
5590
|
}
|
|
5628
5591
|
}
|
|
5629
5592
|
function generateProgrammaticRouteModule(moduleId, root, renderer = _chunk67MZTLTFcjs.REACT_RENDERER) {
|
|
5630
|
-
const parsed =
|
|
5593
|
+
const parsed = _chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5631
5594
|
if (!parsed) {
|
|
5632
5595
|
return "";
|
|
5633
5596
|
}
|
|
@@ -5919,7 +5882,7 @@ export const OPTIONS = __farmRoute.methods.OPTIONS;
|
|
|
5919
5882
|
`.trim();
|
|
5920
5883
|
}
|
|
5921
5884
|
function toProgrammaticRouteImportSpecifier(filePath, root) {
|
|
5922
|
-
return root ?
|
|
5885
|
+
return root ? _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, filePath, root) : filePath;
|
|
5923
5886
|
}
|
|
5924
5887
|
async function parseRouteModuleProps(routeModule, input) {
|
|
5925
5888
|
if (typeof routeModule.__farmResolveRouteProps === "function") {
|
|
@@ -5933,12 +5896,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
5933
5896
|
}
|
|
5934
5897
|
const schemas = routeModule.__farmRouteSchemas;
|
|
5935
5898
|
const params = parseRouteModuleSchema(
|
|
5936
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
5899
|
+
_optionalChain([schemas, 'optionalAccess', _490 => _490.params]),
|
|
5937
5900
|
input.props.params,
|
|
5938
5901
|
"params",
|
|
5939
5902
|
input.routePath
|
|
5940
5903
|
);
|
|
5941
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
5904
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _491 => _491.search]), input.search, "search", input.routePath);
|
|
5942
5905
|
return {
|
|
5943
5906
|
...input.props,
|
|
5944
5907
|
params,
|
|
@@ -5958,12 +5921,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
5958
5921
|
}
|
|
5959
5922
|
}
|
|
5960
5923
|
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunk67MZTLTFcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
5961
|
-
const providerClientCode =
|
|
5924
|
+
const providerClientCode = _chunkIK33N2ANcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5962
5925
|
integrationProviders,
|
|
5963
5926
|
root,
|
|
5964
5927
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
5965
5928
|
);
|
|
5966
|
-
const clientPluginEntry =
|
|
5929
|
+
const clientPluginEntry = _chunkHVJ7IACBcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
5967
5930
|
plugins,
|
|
5968
5931
|
root,
|
|
5969
5932
|
srcDir,
|
|
@@ -5971,8 +5934,9 @@ function generateClientCode(integrationProviders = [], documentNavigationMatcher
|
|
|
5971
5934
|
);
|
|
5972
5935
|
const appSetupPath = _chunk67MZTLTFcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
5973
5936
|
const rendererClientImports = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? `import React from 'react'
|
|
5974
|
-
import { hydrateRoot, createRoot } from 'react-dom/client'
|
|
5975
|
-
import
|
|
5937
|
+
import { hydrateRoot, createRoot } from 'react-dom/client'
|
|
5938
|
+
import { restorePagePosition } from '@farm.js/core/internal/client-runtime'` : appSetupPath ? `import React, { hydrateRoot, createRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)}
|
|
5939
|
+
import __farmAppSetup from ${JSON.stringify(_chunkGC5ROI3Acjs.toViteModuleId.call(void 0, appSetupPath, root))}
|
|
5976
5940
|
__farmConfigureApp(__farmAppSetup)` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
|
|
5977
5941
|
const isolatedHydrationImport = isolatedHydrationEnabled ? `${islandValues ? "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement, createFarmServerTreeLayout } from '@farm.js/core/internal/islands-runtime'" : "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'\nimport { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'"}` : "";
|
|
5978
5942
|
const docsAdapterImportBlock = _chunkSM2SYWARcjs.generateFarmDocsAdapterClientRuntime.call(void 0,
|
|
@@ -6012,7 +5976,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
6012
5976
|
return null;
|
|
6013
5977
|
}
|
|
6014
5978
|
}
|
|
6015
|
-
${islandValues ? `${
|
|
5979
|
+
${islandValues ? `${_chunkIK33N2ANcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
6016
5980
|
let farmLastRouteState = null;
|
|
6017
5981
|
|
|
6018
5982
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -6032,7 +5996,7 @@ ${isolatedHydrationImport}
|
|
|
6032
5996
|
import { installChunkErrorRecovery, SPARouter } from '@farm.js/core/client'
|
|
6033
5997
|
import { createClientPluginManager } from '@farm.js/core/plugin/client'
|
|
6034
5998
|
import { isFarmRouteActive } from '@farm.js/core/router'
|
|
6035
|
-
import { installFarmLinkPrefetch, isFarmBlockedNavigationURL, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
5999
|
+
import { installFarmLinkPrefetch, isFarmBlockedNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
6036
6000
|
import { reviveDeferredData } from '@farm.js/core/deferred'
|
|
6037
6001
|
import {
|
|
6038
6002
|
createFarmDeploymentMismatchError,
|
|
@@ -6852,7 +6816,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
6852
6816
|
return loadedLayouts;
|
|
6853
6817
|
}
|
|
6854
6818
|
|
|
6855
|
-
${
|
|
6819
|
+
${_chunkIK33N2ANcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
6856
6820
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
6857
6821
|
let wrapped = element;
|
|
6858
6822
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -6977,12 +6941,13 @@ async function tryHydrateImportedPage(
|
|
|
6977
6941
|
hydrationOptions = {},
|
|
6978
6942
|
) {
|
|
6979
6943
|
const modulePath = route?.modulePath;
|
|
6980
|
-
|
|
6944
|
+
const pageShouldHydrate = hydrationOptions.pageShouldHydrate !== false;
|
|
6945
|
+
const layoutShouldHydrate = hydrationOptions.layoutShouldHydrate === true;
|
|
6946
|
+
// Layouts that hydrate around server HTML need no page module: a docs runtime page has none.
|
|
6947
|
+
if ((!modulePath && (pageShouldHydrate || !layoutShouldHydrate)) || signal?.aborted) {
|
|
6981
6948
|
return false;
|
|
6982
6949
|
}
|
|
6983
6950
|
|
|
6984
|
-
const pageShouldHydrate = hydrationOptions.pageShouldHydrate !== false;
|
|
6985
|
-
const layoutShouldHydrate = hydrationOptions.layoutShouldHydrate === true;
|
|
6986
6951
|
const islandStrategy = hydrationOptions.islandStrategy || route.islandStrategy || 'load';
|
|
6987
6952
|
let pageElement = null;
|
|
6988
6953
|
// Import layouts before the page, root first, so Vite injects their CSS in the same
|
|
@@ -7037,10 +7002,12 @@ async function tryHydrateImportedPage(
|
|
|
7037
7002
|
);
|
|
7038
7003
|
} else if (layoutShouldHydrate) {
|
|
7039
7004
|
currentPageProps = existingProps || { params };
|
|
7005
|
+
// A navigation passes the page element of the document it fetched, read as it is rather
|
|
7006
|
+
// than serialized and parsed again; hydration reads the page in this document.
|
|
7040
7007
|
const serverPage = document.getElementById('__farm_page__');
|
|
7041
|
-
const pageSource =
|
|
7042
|
-
?
|
|
7043
|
-
:
|
|
7008
|
+
const pageSource = hydrationOptions.navigationPage === undefined
|
|
7009
|
+
? serverPage
|
|
7010
|
+
: hydrationOptions.navigationPage;
|
|
7044
7011
|
const serverTree = pageSource
|
|
7045
7012
|
? await createFarmServerTreePageElement(pageSource, window.location.pathname)
|
|
7046
7013
|
: null;
|
|
@@ -7051,9 +7018,7 @@ async function tryHydrateImportedPage(
|
|
|
7051
7018
|
false,
|
|
7052
7019
|
islandStrategy,
|
|
7053
7020
|
null,
|
|
7054
|
-
|
|
7055
|
-
? hydrationOptions.serverHtml
|
|
7056
|
-
: serverPage ? serverPage.innerHTML : '',
|
|
7021
|
+
pageSource ? pageSource.innerHTML : '',
|
|
7057
7022
|
);
|
|
7058
7023
|
}
|
|
7059
7024
|
if (signal?.aborted || !container?.isConnected || !pageElement) return false;
|
|
@@ -7074,7 +7039,7 @@ async function tryHydrateImportedPage(
|
|
|
7074
7039
|
wrap: wrapFarmClientRouteGraph,
|
|
7075
7040
|
};
|
|
7076
7041
|
} else if (useHydrate && container?.id === '__farm_page__') {
|
|
7077
|
-
wrappedElement = wrapFarmClientRouteGraph(pageElement);
|
|
7042
|
+
wrappedElement = wrapFarmClientRouteGraph(${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? "restorePagePosition(React, container, pageElement)" : "pageElement"});
|
|
7078
7043
|
} else {
|
|
7079
7044
|
wrappedElement = await buildWrappedHydrationElement(
|
|
7080
7045
|
currentPageComponent,
|
|
@@ -7131,13 +7096,25 @@ function findLayoutBoundary(root, pattern) {
|
|
|
7131
7096
|
return null;
|
|
7132
7097
|
}
|
|
7133
7098
|
|
|
7099
|
+
// A layout that renders the document itself has no boundary element: the document names it.
|
|
7100
|
+
function readDocumentLayoutPatterns() {
|
|
7101
|
+
try {
|
|
7102
|
+
const patterns = JSON.parse(document.documentElement.getAttribute('data-farm-document-layouts') || '[]');
|
|
7103
|
+
return Array.isArray(patterns) ? patterns.filter((pattern) => typeof pattern === 'string') : [];
|
|
7104
|
+
} catch {
|
|
7105
|
+
return [];
|
|
7106
|
+
}
|
|
7107
|
+
}
|
|
7108
|
+
|
|
7134
7109
|
function readActiveLayoutPatterns() {
|
|
7135
|
-
return
|
|
7136
|
-
.
|
|
7137
|
-
|
|
7110
|
+
return readDocumentLayoutPatterns().concat(
|
|
7111
|
+
Array.from(document.querySelectorAll('[data-farm-layout-boundary="true"]'))
|
|
7112
|
+
.map((element) => element.getAttribute('data-farm-layout-pattern'))
|
|
7113
|
+
.filter(Boolean),
|
|
7114
|
+
);
|
|
7138
7115
|
}
|
|
7139
7116
|
|
|
7140
|
-
${
|
|
7117
|
+
${_chunkIK33N2ANcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
7141
7118
|
|
|
7142
7119
|
function activateFragmentScripts(root) {
|
|
7143
7120
|
for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
|
|
@@ -7196,7 +7173,7 @@ function getLayoutShell(root, patterns, index, find) {
|
|
|
7196
7173
|
return shell.innerHTML;
|
|
7197
7174
|
}
|
|
7198
7175
|
|
|
7199
|
-
${islandValues ?
|
|
7176
|
+
${islandValues ? _chunkIK33N2ANcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
|
|
7200
7177
|
container,
|
|
7201
7178
|
fragment,
|
|
7202
7179
|
currentPatterns,
|
|
@@ -7269,7 +7246,7 @@ ${islandValues ? `
|
|
|
7269
7246
|
return nextTarget;
|
|
7270
7247
|
}
|
|
7271
7248
|
|
|
7272
|
-
${islandValues ? `${
|
|
7249
|
+
${islandValues ? `${_chunkIK33N2ANcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
7273
7250
|
|
|
7274
7251
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
7275
7252
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -7578,7 +7555,7 @@ async function renderPage(pageData, info) {
|
|
|
7578
7555
|
pageShouldHydrate,
|
|
7579
7556
|
layoutShouldHydrate,
|
|
7580
7557
|
islandStrategy: route.islandStrategy,
|
|
7581
|
-
|
|
7558
|
+
navigationPage: nextPage,
|
|
7582
7559
|
layoutSource: fragment,
|
|
7583
7560
|
loadingModulePath: route.loadingModulePath,
|
|
7584
7561
|
},
|
|
@@ -7760,7 +7737,8 @@ function farmIslandsOnlyDocument() {
|
|
|
7760
7737
|
if (hydratedSlots) replayPreHydrationClicks();
|
|
7761
7738
|
return
|
|
7762
7739
|
}
|
|
7763
|
-
|
|
7740
|
+
// Layouts that hydrate around server HTML need no page module: a docs runtime page has none.
|
|
7741
|
+
if (!modulePath && (pageShouldHydrate || !layoutShouldHydrate)) {
|
|
7764
7742
|
console.error('[Farm.js] No page module path found')
|
|
7765
7743
|
return
|
|
7766
7744
|
}
|
|
@@ -7928,14 +7906,8 @@ document.addEventListener('click', function(event) {
|
|
|
7928
7906
|
|
|
7929
7907
|
// Use SPA router
|
|
7930
7908
|
event.preventDefault();
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
const viewTransitionValue = target.getAttribute('data-view-transition');
|
|
7934
|
-
const viewTransition = viewTransitionValue === 'auto'
|
|
7935
|
-
? 'auto'
|
|
7936
|
-
: viewTransitionValue === 'true';
|
|
7937
|
-
|
|
7938
|
-
spaRouter.navigate(href, { replace, scroll, viewTransition });
|
|
7909
|
+
rememberFarmLinkLocale(target);
|
|
7910
|
+
spaRouter.navigate(href, readFarmLinkNavigateOptions(target));
|
|
7939
7911
|
});
|
|
7940
7912
|
|
|
7941
7913
|
// Link anchors on a page that does not hydrate prefetch through the router as Link would.
|
|
@@ -7971,9 +7943,9 @@ function generateClientManifest(bundle) {
|
|
|
7971
7943
|
return manifest;
|
|
7972
7944
|
}
|
|
7973
7945
|
async function defineConfig(config = {}) {
|
|
7974
|
-
const tailwindVitePlugin = await
|
|
7946
|
+
const tailwindVitePlugin = await _chunkHVJ7IACBcjs.loadTailwindVitePlugin.call(void 0, );
|
|
7975
7947
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
7976
|
-
if (_optionalChain([config, 'access',
|
|
7948
|
+
if (_optionalChain([config, 'access', _492 => _492.extends, 'optionalAccess', _493 => _493.length])) {
|
|
7977
7949
|
const { config: layeredConfig } = await import("./layers-7P4RLKVX.cjs").then(
|
|
7978
7950
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
7979
7951
|
root: appRoot,
|
|
@@ -7983,7 +7955,7 @@ async function defineConfig(config = {}) {
|
|
|
7983
7955
|
config = layeredConfig;
|
|
7984
7956
|
}
|
|
7985
7957
|
config.renderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
7986
|
-
config.images =
|
|
7958
|
+
config.images = _chunkIK33N2ANcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
7987
7959
|
const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
7988
7960
|
ssr: true
|
|
7989
7961
|
});
|
|
@@ -8075,13 +8047,13 @@ async function defineConfig(config = {}) {
|
|
|
8075
8047
|
if (!serverStarted) {
|
|
8076
8048
|
serverStarted = true;
|
|
8077
8049
|
const elapsed = Date.now() - startTime;
|
|
8078
|
-
const address = _optionalChain([server, 'access',
|
|
8050
|
+
const address = _optionalChain([server, 'access', _494 => _494.httpServer, 'optionalAccess', _495 => _495.address, 'call', _496 => _496()]);
|
|
8079
8051
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
8080
8052
|
const hostConfig = server.config.server.host;
|
|
8081
8053
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
8082
8054
|
console.log("");
|
|
8083
8055
|
console.log(
|
|
8084
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
8056
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkIVBDRAORcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
8085
8057
|
);
|
|
8086
8058
|
console.log("");
|
|
8087
8059
|
console.log(
|
|
@@ -8115,23 +8087,23 @@ async function defineConfig(config = {}) {
|
|
|
8115
8087
|
plugins: [
|
|
8116
8088
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
8117
8089
|
_chunk3QM74STYcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
8118
|
-
|
|
8090
|
+
_chunkIK33N2ANcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
8119
8091
|
tailwindVitePlugin,
|
|
8120
8092
|
...rendererVitePlugins,
|
|
8121
8093
|
...reactRefreshPlugins,
|
|
8122
8094
|
viteBrowserExternalPlugin,
|
|
8123
8095
|
farmI18nClientBridgePlugin(),
|
|
8124
|
-
farmServerOnlyEntriesPlugin(),
|
|
8096
|
+
farmServerOnlyEntriesPlugin({ distDir: config.distDir || ".farm" }),
|
|
8125
8097
|
farmIslandContainersPlugin(config),
|
|
8126
8098
|
farmPlugin(config),
|
|
8127
|
-
|
|
8099
|
+
_chunkJNZDTE75cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
8128
8100
|
farmBrandingPlugin
|
|
8129
8101
|
],
|
|
8130
8102
|
customLogger: farmLogger,
|
|
8131
8103
|
clearScreen: false,
|
|
8132
8104
|
optimizeDeps: {
|
|
8133
|
-
...
|
|
8134
|
-
|
|
8105
|
+
..._chunkIK33N2ANcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
8106
|
+
_chunkIK33N2ANcjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
8135
8107
|
appRoot,
|
|
8136
8108
|
_chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
8137
8109
|
),
|
|
@@ -8174,7 +8146,7 @@ async function defineConfig(config = {}) {
|
|
|
8174
8146
|
// Stub out problematic server-only modules during dev mode
|
|
8175
8147
|
alias: {
|
|
8176
8148
|
..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
8177
|
-
...
|
|
8149
|
+
..._chunkIK33N2ANcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
8178
8150
|
// Nitro internals that should not be resolved in browser
|
|
8179
8151
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
8180
8152
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|