@farm.js/core 0.1.74 → 0.1.76
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-Cftp2kFv.d.ts} +24 -2
- package/dist/{agent-mcp.d-BEhDfdWc.d.mts → agent-mcp.d-D0FMmqi0.d.mts} +24 -2
- package/dist/agent-runtime.cjs +7 -7
- package/dist/agent-runtime.d.mts +7 -5
- package/dist/agent-runtime.d.ts +7 -5
- package/dist/agent-runtime.mjs +6 -6
- package/dist/analyzer-KFJGYJS7.cjs +16 -0
- package/dist/{analyzer-2K35LIQZ.mjs → analyzer-NLQKPN74.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 +9 -7
- package/dist/api/node.d.ts +9 -7
- package/dist/api/node.mjs +11 -11
- package/dist/api/route-manager.cjs +20 -20
- package/dist/api/route-manager.d.mts +9 -7
- package/dist/api/route-manager.d.ts +9 -7
- package/dist/api/route-manager.mjs +19 -19
- package/dist/api/runtime.cjs +11 -11
- package/dist/api/runtime.d.mts +8 -6
- package/dist/api/runtime.d.ts +8 -6
- package/dist/api/runtime.mjs +10 -10
- package/dist/api.cjs +23 -23
- package/dist/api.d.mts +10 -8
- package/dist/api.d.ts +10 -8
- package/dist/api.mjs +22 -22
- package/dist/{app-manifest.d-CVEx1CFB.d.ts → app-manifest.d-7PmA_9hm.d.ts} +1 -1
- package/dist/{app-manifest.d-BcXt2yCx.d.mts → app-manifest.d-cpOw_sV5.d.mts} +1 -1
- package/dist/app-markdown.cjs +7 -7
- package/dist/app-markdown.d.mts +8 -6
- package/dist/app-markdown.d.ts +8 -6
- package/dist/app-markdown.mjs +6 -6
- package/dist/{app.d-DowzSmT5.d.mts → app.d-DUZvwnFF.d.mts} +30 -4
- package/dist/{app.d-B6i8CSrx.d.ts → app.d-wOkxXre8.d.ts} +30 -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-BFOMCSZ2.mjs → chunk-2GZZVIXY.mjs} +184 -27
- package/dist/{chunk-4BS3HSY7.cjs → chunk-2JEXQAIR.cjs} +2 -2
- package/dist/{chunk-GWXZS7K5.mjs → chunk-2LKUR5QJ.mjs} +1 -1
- package/dist/chunk-2PJVEL56.cjs +90 -0
- package/dist/{chunk-4M5ESTJ2.cjs → chunk-2RSVYJT6.cjs} +19 -3
- package/dist/{chunk-Q3MVNRAO.cjs → chunk-2WKGQCAV.cjs} +1010 -587
- 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-B4CWYGCG.mjs → chunk-3OYFMOBY.mjs} +1 -1
- 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-KMYOKQPP.cjs → chunk-4VLXQ55O.cjs} +27 -22
- package/dist/{chunk-XGJVRPYL.cjs → chunk-52LTENRE.cjs} +3 -3
- package/dist/{chunk-RQ4UZJPR.cjs → chunk-5AMH6AFA.cjs} +5 -3
- package/dist/{chunk-FEQ72ZHD.mjs → chunk-5EEQNZLU.mjs} +6 -6
- package/dist/{chunk-AYP2YFVN.mjs → chunk-5KAEGBIL.mjs} +75 -42
- 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-FCBUNILW.mjs → chunk-6MNDFNZW.mjs} +4 -4
- package/dist/{chunk-O2A6HE76.cjs → chunk-6ZFGWB75.cjs} +115 -21
- 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-IP2R2TAE.mjs → chunk-A2VFKOQL.mjs} +1 -1
- package/dist/chunk-A3LNXQJJ.cjs +265 -0
- 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-FYV6DTAG.cjs → chunk-BBRSPKFI.cjs} +585 -601
- package/dist/{chunk-R6Q6VSGU.mjs → chunk-BGUTIQII.mjs} +1 -1
- package/dist/{chunk-3OMLZLDE.cjs → chunk-BNCKXPCU.cjs} +44 -0
- package/dist/{chunk-BPAXGCKX.mjs → chunk-BRNPLD22.mjs} +30 -17
- package/dist/{chunk-35GBGSQZ.cjs → chunk-BYJPBJ4E.cjs} +3 -3
- package/dist/{chunk-V6T3UJAH.cjs → chunk-CCQZDOQR.cjs} +17 -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-JI6N4W2I.mjs → chunk-CKBBKRBO.mjs} +840 -228
- 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-56HHUSR5.cjs → chunk-DTNWLRRF.cjs} +1308 -696
- package/dist/{chunk-AL6E63FZ.mjs → chunk-DUSTJ6A5.mjs} +20 -17
- package/dist/{chunk-BUC3FDYC.cjs → chunk-DVW6SKHA.cjs} +2 -2
- package/dist/{chunk-EWIEJQP6.cjs → chunk-DZ3AZ7UK.cjs} +52 -52
- package/dist/{chunk-6YFC3ZFX.mjs → chunk-DZXD6CYJ.mjs} +1 -1
- package/dist/{chunk-BIX46FTI.mjs → chunk-E77ZKNPN.mjs} +10 -2
- 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-GUZC226X.mjs → chunk-GLVDXRG2.mjs} +1 -1
- package/dist/{chunk-JZ43UD6S.mjs → chunk-GP5BWTO7.mjs} +13 -13
- package/dist/{chunk-OWQV6MLM.cjs → chunk-GYJT2U7J.cjs} +2 -1
- package/dist/{chunk-LHFGTR7F.mjs → chunk-H76C5AOU.mjs} +104 -10
- package/dist/{chunk-XZPI44Q7.cjs → chunk-H7OFZJCV.cjs} +8 -8
- package/dist/{chunk-2TZ3F6TN.cjs → chunk-HFJLMALC.cjs} +25 -25
- package/dist/{chunk-NET6PBUH.cjs → chunk-HKGU2X4I.cjs} +2 -2
- package/dist/{chunk-CROAFCMW.mjs → chunk-HONTCUK6.mjs} +1 -1
- package/dist/{chunk-7PJARAQQ.mjs → chunk-HQ2VAJLW.mjs} +1 -1
- package/dist/{chunk-FN5UEC7I.mjs → chunk-IG2JE6WJ.mjs} +1 -1
- package/dist/{chunk-MQ4DYVFS.cjs → chunk-IIHZ2BEE.cjs} +3 -3
- 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-UHAARKF3.mjs → chunk-JL6XHQZF.mjs} +5 -5
- 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-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-YTVSWXEZ.cjs → chunk-ML4TOUZP.cjs} +76 -43
- package/dist/{chunk-6JEXH7N6.mjs → chunk-MOS2N377.mjs} +1 -1
- package/dist/{chunk-ZD7JUTBY.mjs → chunk-NLATR3T3.mjs} +2 -2
- package/dist/{chunk-3BUJIPKE.cjs → chunk-NSNQLBHR.cjs} +2 -2
- package/dist/chunk-NUWUEXUD.mjs +55 -0
- package/dist/{chunk-WS4SLJW5.mjs → chunk-O225GNEU.mjs} +186 -202
- 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-CXQZQK6R.mjs → chunk-OVUU2RCQ.mjs} +2 -2
- package/dist/{chunk-65OS2TOT.cjs → chunk-OWO7KDZ3.cjs} +34 -34
- package/dist/{chunk-HBLYSWIJ.cjs → chunk-PBJ7MEOV.cjs} +9 -9
- 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-P3EZKU6L.cjs → chunk-PSNYVBWC.cjs} +38 -38
- package/dist/chunk-PWHF2C6A.mjs +134 -0
- package/dist/{chunk-77SVUQM5.cjs → chunk-PXXG5BID.cjs} +10 -10
- package/dist/{chunk-JWHRVBCZ.cjs → chunk-Q2EKSSEG.cjs} +21 -21
- package/dist/{chunk-TJVUTGED.mjs → chunk-Q4X3MX4J.mjs} +201 -3
- package/dist/{chunk-XXKMAHYE.mjs → chunk-Q7JMHO5U.mjs} +2 -2
- package/dist/{chunk-EHJOSIXM.cjs → chunk-QDHR54S6.cjs} +11 -11
- package/dist/{chunk-ZOYKJBP5.cjs → chunk-QKW6DLDT.cjs} +2 -2
- package/dist/{chunk-NXGQIXR7.cjs → chunk-QP4GYVRR.cjs} +313 -156
- package/dist/{chunk-3ODLJRA6.mjs → chunk-QSLGE2ZC.mjs} +1 -1
- package/dist/{chunk-ENYBDM4U.cjs → chunk-QTDIOZV6.cjs} +15 -7
- 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-VFPFXMTF.mjs → chunk-SGQXJVFX.mjs} +1 -1
- 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-D4TYE6MY.cjs → chunk-TMVVBK5S.cjs} +2 -2
- package/dist/{chunk-BSJMWCWM.cjs → chunk-TZ2YPXLB.cjs} +7 -7
- package/dist/{chunk-JMYXO572.cjs → chunk-UBXNTZCY.cjs} +205 -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-B3XY6FMC.mjs → chunk-VDJ3CLBR.mjs} +3 -3
- 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-DM2YGTRH.cjs → chunk-WILPJVQE.cjs} +23 -23
- package/dist/{chunk-4AB62NMW.cjs → chunk-WJDMH3E7.cjs} +4 -4
- package/dist/chunk-WKVYF2B5.cjs +17 -0
- package/dist/{chunk-737MIVX3.cjs → chunk-WMJQNVKX.cjs} +24 -24
- package/dist/{chunk-MKQ27TGW.cjs → chunk-WRWJ7IWT.cjs} +7 -7
- package/dist/{chunk-Y4FEQBKY.cjs → chunk-WW62HKA2.cjs} +47 -26
- package/dist/{chunk-IG4IQMIW.mjs → chunk-X3HUT4JU.mjs} +1 -1
- package/dist/{chunk-XVSBALOY.cjs → chunk-X3Y6JWJG.cjs} +3 -3
- package/dist/{chunk-RSL3YFJG.cjs → chunk-XLOORES5.cjs} +1 -1
- 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-YWDRWG4L.mjs → chunk-YHE7HH2I.mjs} +875 -452
- package/dist/{chunk-G7S6XG6X.cjs → chunk-YN7G22MP.cjs} +6 -6
- package/dist/{chunk-4MU4QCX4.mjs → chunk-YONTMPZ6.mjs} +1 -1
- package/dist/{chunk-AU5UPNOD.mjs → chunk-YQXJY7E7.mjs} +3 -3
- package/dist/{chunk-VKRMO3EZ.cjs → chunk-YRXPDKMM.cjs} +10 -10
- 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/cli-runtime.d-D84CwyPI.d.ts +535 -0
- package/dist/cli-runtime.d-OQY2pgwK.d.mts +535 -0
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-component.d-DYOwmq0c.d.ts → client-component.d-Bf8jZqW7.d.ts} +2 -137
- package/dist/{client-component.d-edV76QvU.d.mts → client-component.d-Bh6CfC5z.d.mts} +2 -137
- package/dist/{client-plugins.d-BmJYW2FY.d.ts → client-plugins.d-DuujrC8d.d.ts} +27 -6
- package/dist/{client-plugins.d-DwvqqGsU.d.mts → client-plugins.d-r3K2oQ6w.d.mts} +27 -6
- package/dist/client-plugins.d.mts +7 -5
- package/dist/client-plugins.d.ts +7 -5
- package/dist/client.cjs +15 -13
- package/dist/client.d.mts +12 -10
- package/dist/client.d.ts +12 -10
- package/dist/client.mjs +14 -12
- package/dist/config.d.mts +7 -5
- package/dist/config.d.ts +7 -5
- package/dist/cron.cjs +4 -4
- package/dist/cron.mjs +3 -3
- package/dist/desktop.d.mts +8 -6
- package/dist/desktop.d.ts +8 -6
- package/dist/{devtools-YMDS7PUA.cjs → devtools-3WZIZ7KK.cjs} +20 -20
- package/dist/{devtools-WPX62NG2.mjs → devtools-MBZPUH3U.mjs} +18 -18
- package/dist/docs.cjs +27 -21
- package/dist/docs.d.mts +15 -56
- package/dist/docs.d.ts +15 -56
- package/dist/docs.mjs +26 -20
- package/dist/environment/vite.cjs +6 -6
- package/dist/environment/vite.mjs +5 -5
- package/dist/handler.d-Bd5lRSvb.d.ts +62 -0
- package/dist/handler.d-SRH-AKzf.d.mts +62 -0
- package/dist/headers.cjs +3 -3
- package/dist/{headers.d-BtNxFc2s.d.mts → headers.d-CHHvyaIG.d.mts} +1 -1
- package/dist/{headers.d-BIbQyAxJ.d.ts → headers.d-D-OvGikv.d.ts} +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 +105 -97
- package/dist/index.d-BOPsgMlI.d.mts +16 -0
- package/dist/index.d-BiUtYJUG.d.ts +16 -0
- package/dist/index.d.mts +40 -557
- package/dist/index.d.ts +40 -557
- package/dist/index.mjs +102 -94
- package/dist/integrations/orm.cjs +3 -3
- package/dist/integrations/orm.d.mts +6 -4
- package/dist/integrations/orm.d.ts +6 -4
- package/dist/integrations/orm.mjs +2 -2
- package/dist/integrations.cjs +7 -7
- package/dist/integrations.d.mts +7 -5
- package/dist/integrations.d.ts +7 -5
- package/dist/integrations.mjs +6 -6
- package/dist/internal/app-markdown-runtime.cjs +6 -6
- package/dist/internal/app-markdown-runtime.d.mts +8 -6
- package/dist/internal/app-markdown-runtime.d.ts +8 -6
- package/dist/internal/app-markdown-runtime.mjs +5 -5
- package/dist/internal/build-runtime.cjs +71 -69
- package/dist/internal/build-runtime.d.mts +10 -7
- package/dist/internal/build-runtime.d.ts +10 -7
- package/dist/internal/build-runtime.mjs +70 -68
- package/dist/internal/cli-runtime.cjs +40 -35
- package/dist/internal/cli-runtime.d.mts +45 -0
- package/dist/internal/cli-runtime.d.ts +45 -0
- package/dist/internal/cli-runtime.mjs +39 -34
- 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 +36 -13
- package/dist/internal/client-runtime.d.ts +36 -13
- package/dist/internal/client-runtime.mjs +23 -2
- package/dist/internal/compression-runtime.d.mts +7 -5
- package/dist/internal/compression-runtime.d.ts +7 -5
- package/dist/internal/config-runtime.cjs +20 -20
- package/dist/internal/config-runtime.d.mts +9 -7
- package/dist/internal/config-runtime.d.ts +9 -7
- 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 +65 -42
- package/dist/internal/production-runtime.d.mts +86 -17
- package/dist/internal/production-runtime.d.ts +86 -17
- package/dist/internal/production-runtime.mjs +68 -45
- 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 +45 -0
- package/dist/internal/start-manifest.d.ts +45 -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/{lifecycle.d-OtGWAvJT.d.mts → lifecycle.d-VzcXyEyn.d.mts} +1 -1
- package/dist/{lifecycle.d-OtGWAvJT.d.ts → lifecycle.d-VzcXyEyn.d.ts} +1 -1
- 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 +7 -5
- package/dist/markdown.d.ts +7 -5
- package/dist/markdown.mjs +4 -4
- package/dist/middleware.cjs +14 -14
- package/dist/middleware.d.mts +7 -5
- package/dist/middleware.d.ts +7 -5
- package/dist/middleware.mjs +13 -13
- package/dist/{mount.d-C-u7rFkM.d.ts → mount.d-C2yq0Zzz.d.ts} +1 -1
- package/dist/{mount.d-6bhpBQQB.d.mts → mount.d-vq1HTq5u.d.mts} +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-xsG4T1x-.d.ts → navigation-delegate.d-D7xIin3i.d.ts} +1 -1
- package/dist/{navigation-delegate.d-nx6gtsY4.d.mts → navigation-delegate.d-DS2Sqm7E.d.mts} +1 -1
- package/dist/navigation.cjs +13 -11
- package/dist/navigation.d.mts +10 -8
- package/dist/navigation.d.ts +10 -8
- 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-QZT747YW.mjs → plugin-6CHZBFJD.mjs} +2 -2
- package/dist/{plugin-5PIQQVRP.cjs → plugin-YXPIS3XX.cjs} +3 -3
- package/dist/plugin.cjs +64 -62
- package/dist/plugin.d.mts +11 -8
- package/dist/plugin.d.ts +11 -8
- package/dist/plugin.mjs +63 -61
- 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-BCq0nfdw.d.ts} +1 -1
- package/dist/{render-plan.d-B5y3h97B.d.mts → render-plan.d-X6KqerAM.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 +10 -8
- package/dist/renderer-client.d.ts +10 -8
- package/dist/renderer-client.mjs +15 -16
- package/dist/request.cjs +2 -2
- package/dist/{request.d-B0ugAadD.d.ts → request.d-Be9rWboC.d.mts} +7 -2
- package/dist/{request.d-DLq33nYo.d.mts → request.d-CPdq2_kC.d.ts} +7 -2
- package/dist/request.d.mts +8 -6
- package/dist/request.d.ts +8 -6
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-DSeIV7yV.d.mts → route-rendering.d-CIPli7Ve.d.mts} +1 -1
- package/dist/{route-rendering.d-ytaqDQD6.d.ts → route-rendering.d-CKB5GhQr.d.ts} +1 -1
- package/dist/router.cjs +4 -4
- package/dist/{router.d-BaEAEGPg.d.ts → router.d-CvrbOXzF.d.ts} +1 -1
- package/dist/{router.d-Chd5cpe3.d.mts → router.d-VxTgLGxN.d.mts} +1 -1
- package/dist/router.mjs +3 -3
- package/dist/routes.cjs +6 -6
- package/dist/routes.d.mts +7 -5
- package/dist/routes.d.ts +7 -5
- package/dist/routes.mjs +5 -5
- package/dist/{rsc-pipeline-DPMYONEV.mjs → rsc-pipeline-FPE4OL57.mjs} +22 -22
- package/dist/{rsc-pipeline-XIUUMMG5.cjs → rsc-pipeline-TPHK74VE.cjs} +23 -23
- package/dist/{runtime-XIUJZTZ3.mjs → runtime-45BD33OJ.mjs} +27 -27
- package/dist/{runtime-WD77S3C5.cjs → runtime-UBG657UC.cjs} +38 -38
- package/dist/{runtime.d-DpCs0eAO.d.mts → runtime.d-Cn1jiDNI.d.mts} +1 -1
- package/dist/{runtime.d-h2USyQsz.d.ts → runtime.d-Ps54JWpo.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/{schema.d-Dny9pnrm.d.mts → schema.d-BM-uVGpx.d.mts} +1 -1
- package/dist/{schema.d-Dny9pnrm.d.ts → schema.d-BM-uVGpx.d.ts} +1 -1
- package/dist/schema.d.mts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/server-action-security.cjs +5 -5
- package/dist/server-action-security.mjs +4 -4
- package/dist/{index.d-CQ_wUzOV.d.ts → server-components-status.d-Dhtbs5lC.d.ts} +2 -15
- package/dist/{index.d-CQdDRXd1.d.mts → server-components-status.d-DnmipSb3.d.mts} +2 -15
- 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 +9 -7
- package/dist/server-plugins.d.ts +9 -7
- 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 +107 -98
- package/dist/server.d.mts +20 -17
- package/dist/server.d.ts +20 -17
- package/dist/server.mjs +78 -69
- package/dist/session-ACVUJ5XV.cjs +23 -0
- package/dist/{session-QZXZOPR2.mjs → session-ASQTJNBK.mjs} +2 -2
- package/dist/{spa-router.d-DCQVtEaE.d.mts → spa-router.d-DXm5J9rM.d.mts} +4 -3
- package/dist/{spa-router.d-DpdJHs1q.d.ts → spa-router.d-cppVufl2.d.ts} +4 -3
- package/dist/ssg.d-CI5OFl8H.d.ts +138 -0
- package/dist/ssg.d-Duzy1wQc.d.mts +138 -0
- package/dist/storage.cjs +4 -2
- package/dist/storage.d.mts +14 -4
- package/dist/storage.d.ts +14 -4
- package/dist/storage.mjs +3 -1
- package/dist/testing.cjs +31 -31
- package/dist/testing.d.mts +7 -5
- package/dist/testing.d.ts +7 -5
- package/dist/testing.mjs +23 -23
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/{types.d-BnIqOn9w.d.ts → types.d-D5cY6XjK.d.mts} +43 -2
- package/dist/{types.d-BnIqOn9w.d.mts → types.d-D5cY6XjK.d.ts} +43 -2
- package/dist/{utils.d-DKDZtAY5.d.mts → utils.d-CNI-I8ZV.d.mts} +1 -1
- package/dist/{utils.d-DmicwMvS.d.ts → utils.d-D3dfy8zh.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +64 -62
- package/dist/vite.d.mts +17 -9
- package/dist/vite.d.ts +17 -9
- package/dist/vite.mjs +63 -61
- package/dist/workflows.cjs +7 -7
- package/dist/workflows.mjs +6 -6
- package/package.json +27 -3
- 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
- package/dist/session-2Q72D4QV.cjs +0 -23
- /package/dist/{chunk-PMU4U2W2.cjs → chunk-22T75EML.cjs} +0 -0
- /package/dist/{chunk-Z5ZZAGIH.mjs → chunk-LSHUCNIF.mjs} +0 -0
|
@@ -15,13 +15,13 @@ var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkYUCU6XB4cjs = require('./chunk-YUCU6XB4.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkGC5ROI3Acjs = require('./chunk-GC5ROI3A.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkXLOORES5cjs = require('./chunk-XLOORES5.cjs');
|
|
25
25
|
|
|
26
26
|
// src/environment-vite.ts
|
|
27
27
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
@@ -142,6 +142,7 @@ function createFarmSourceLocator(code, getCombinedSourcemap) {
|
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
var _parseAst = require('rolldown/parseAst');
|
|
145
|
+
var _utils = require('rolldown/utils');
|
|
145
146
|
|
|
146
147
|
// src/utils/source-snapshot.ts
|
|
147
148
|
|
|
@@ -370,6 +371,10 @@ function resolveFarmReactServerExport(importer, specifier) {
|
|
|
370
371
|
cache.set(key, resolved);
|
|
371
372
|
return resolved;
|
|
372
373
|
}
|
|
374
|
+
function parseLang(file) {
|
|
375
|
+
const extension = _path2.default.extname(file).slice(1);
|
|
376
|
+
return extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
|
|
377
|
+
}
|
|
373
378
|
var parsedModules = /* @__PURE__ */ new Map();
|
|
374
379
|
function readModule(file) {
|
|
375
380
|
let stat;
|
|
@@ -384,9 +389,7 @@ function readModule(file) {
|
|
|
384
389
|
let program = null;
|
|
385
390
|
try {
|
|
386
391
|
const code = _fs2.default.readFileSync(file, "utf8");
|
|
387
|
-
|
|
388
|
-
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
|
|
389
|
-
program = _parseAst.parseAst.call(void 0, code, { lang });
|
|
392
|
+
program = _parseAst.parseAst.call(void 0, code, { lang: parseLang(file) });
|
|
390
393
|
} catch (e5) {
|
|
391
394
|
program = null;
|
|
392
395
|
}
|
|
@@ -511,8 +514,7 @@ function isFarmPackageClientExport(importer, specifier, name) {
|
|
|
511
514
|
);
|
|
512
515
|
}
|
|
513
516
|
function parseCode(code, file) {
|
|
514
|
-
const
|
|
515
|
-
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
|
|
517
|
+
const lang = parseLang(file);
|
|
516
518
|
return memoizeInFarmSourceSnapshot(`ast:${lang}`, code, () => {
|
|
517
519
|
try {
|
|
518
520
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
@@ -715,6 +717,66 @@ function staticImportSources(program) {
|
|
|
715
717
|
}
|
|
716
718
|
return sources;
|
|
717
719
|
}
|
|
720
|
+
var GAP = String.raw`(?:\s|\/\*[\s\S]*?\*\/|\/\/[^\n\r\u2028\u2029]*)*`;
|
|
721
|
+
var EMPTY_EXPORT_LIST = new RegExp(String.raw`\bexport${GAP}\{${GAP}\}`);
|
|
722
|
+
function scanFarmStaticImports(code, lang) {
|
|
723
|
+
let result;
|
|
724
|
+
try {
|
|
725
|
+
result = _utils.parseSync.call(void 0, "file.js", code, { lang, preserveParens: false });
|
|
726
|
+
} catch (e8) {
|
|
727
|
+
return null;
|
|
728
|
+
}
|
|
729
|
+
if (result.errors.length > 0) return null;
|
|
730
|
+
const fromProgram = () => {
|
|
731
|
+
const program = result.program;
|
|
732
|
+
return { sources: staticImportSources(program), client: isClientModule(program) };
|
|
733
|
+
};
|
|
734
|
+
const statements = [];
|
|
735
|
+
for (const entry of result.module.staticImports) {
|
|
736
|
+
if (entry.entries.some((binding) => binding.isType)) return fromProgram();
|
|
737
|
+
statements.push({ start: entry.start, source: entry.moduleRequest.value });
|
|
738
|
+
}
|
|
739
|
+
const imported = new Set(statements.map((statement) => statement.start));
|
|
740
|
+
for (const entry of result.module.staticExports) {
|
|
741
|
+
if (entry.entries.some((binding) => binding.isType)) return fromProgram();
|
|
742
|
+
const request = _optionalChain([entry, 'access', _58 => _58.entries, 'access', _59 => _59[0], 'optionalAccess', _60 => _60.moduleRequest]);
|
|
743
|
+
if (request && !imported.has(entry.start) && request.start >= entry.start && request.end <= entry.end) {
|
|
744
|
+
statements.push({ start: entry.start, source: request.value });
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
if (EMPTY_EXPORT_LIST.test(code)) return fromProgram();
|
|
748
|
+
statements.sort((left, right) => left.start - right.start);
|
|
749
|
+
const prologueEnd = _nullishCoalesce(_optionalChain([statements, 'access', _61 => _61[0], 'optionalAccess', _62 => _62.start]), () => ( code.length));
|
|
750
|
+
if (code.slice(0, prologueEnd).includes("use client")) return fromProgram();
|
|
751
|
+
return { sources: statements.map((statement) => statement.source), client: false };
|
|
752
|
+
}
|
|
753
|
+
var scannedModules = /* @__PURE__ */ new Map();
|
|
754
|
+
function readModuleImports(file) {
|
|
755
|
+
let stat;
|
|
756
|
+
try {
|
|
757
|
+
stat = _fs2.default.statSync(file);
|
|
758
|
+
} catch (e9) {
|
|
759
|
+
return null;
|
|
760
|
+
}
|
|
761
|
+
noteFarmSourceRead(file);
|
|
762
|
+
const cached = scannedModules.get(file);
|
|
763
|
+
if (cached && cached.size === stat.size && cached.mtimeMs === stat.mtimeMs) return cached.imports;
|
|
764
|
+
const parsed = parsedModules.get(file);
|
|
765
|
+
let imports;
|
|
766
|
+
if (parsed && parsed.size === stat.size && parsed.mtimeMs === stat.mtimeMs) {
|
|
767
|
+
imports = parsed.program ? { sources: staticImportSources(parsed.program), client: isClientModule(parsed.program) } : null;
|
|
768
|
+
} else {
|
|
769
|
+
let code;
|
|
770
|
+
try {
|
|
771
|
+
code = _fs2.default.readFileSync(file, "utf8");
|
|
772
|
+
} catch (e10) {
|
|
773
|
+
code = void 0;
|
|
774
|
+
}
|
|
775
|
+
imports = code === void 0 ? null : scanFarmStaticImports(code, parseLang(file));
|
|
776
|
+
}
|
|
777
|
+
scannedModules.set(file, { size: stat.size, mtimeMs: stat.mtimeMs, imports });
|
|
778
|
+
return imports;
|
|
779
|
+
}
|
|
718
780
|
var clientOnlyFreeFiles = /* @__PURE__ */ new Set();
|
|
719
781
|
function invalidateFarmClientOnlyScan() {
|
|
720
782
|
clientOnlyFreeFiles.clear();
|
|
@@ -726,28 +788,34 @@ function resolveServerEntry(importer, specifier) {
|
|
|
726
788
|
}
|
|
727
789
|
return _nullishCoalesce(resolveFarmReactServerExport(importer, specifier), () => ( resolveFarmPackageDefaultEntry(importer, specifier, DEFAULT_CONDITIONS)));
|
|
728
790
|
}
|
|
729
|
-
function walkToClientOnly(file, seen) {
|
|
791
|
+
function walkToClientOnly(file, seen, resolved) {
|
|
730
792
|
if (seen.has(file) || clientOnlyFreeFiles.has(file)) return null;
|
|
731
793
|
seen.add(file);
|
|
732
|
-
const
|
|
733
|
-
if (!
|
|
734
|
-
for (const source of
|
|
794
|
+
const imports = readModuleImports(file);
|
|
795
|
+
if (!imports || imports.client) return null;
|
|
796
|
+
for (const source of imports.sources) {
|
|
735
797
|
if (source === CLIENT_ONLY_PACKAGE) return [file];
|
|
736
|
-
const
|
|
737
|
-
|
|
798
|
+
const key = `${_path2.default.dirname(file)}\0${source}`;
|
|
799
|
+
let child = resolved.get(key);
|
|
800
|
+
if (child === void 0) {
|
|
801
|
+
child = source.startsWith(".") ? resolveRelative(file, source) : resolveServerEntry(file, source);
|
|
802
|
+
resolved.set(key, child);
|
|
803
|
+
}
|
|
804
|
+
const chain = child && walkToClientOnly(child, seen, resolved);
|
|
738
805
|
if (chain) return [file, ...chain];
|
|
739
806
|
}
|
|
740
807
|
return null;
|
|
741
808
|
}
|
|
742
809
|
function findFarmClientOnlyImport(code, file) {
|
|
743
810
|
if (!code.includes("import") && !code.includes("export")) return null;
|
|
744
|
-
const
|
|
745
|
-
if (!
|
|
746
|
-
|
|
811
|
+
const imports = scanFarmStaticImports(code, parseLang(file));
|
|
812
|
+
if (!imports) return null;
|
|
813
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
814
|
+
for (const specifier of imports.sources) {
|
|
747
815
|
const entry = resolveServerEntry(file, specifier);
|
|
748
816
|
if (!entry) continue;
|
|
749
817
|
const seen = /* @__PURE__ */ new Set();
|
|
750
|
-
const chain = walkToClientOnly(entry, seen);
|
|
818
|
+
const chain = walkToClientOnly(entry, seen, resolved);
|
|
751
819
|
if (chain) return { specifier, chain };
|
|
752
820
|
for (const walked of seen) clientOnlyFreeFiles.add(walked);
|
|
753
821
|
}
|
|
@@ -758,7 +826,7 @@ function farmRelativeImportFiles(code, file) {
|
|
|
758
826
|
if (!program) return [];
|
|
759
827
|
const files = [];
|
|
760
828
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
761
|
-
const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access',
|
|
829
|
+
const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _63 => _63.source, 'optionalAccess', _64 => _64.value]);
|
|
762
830
|
if (typeof source !== "string" || !source.startsWith(".")) continue;
|
|
763
831
|
const resolved = resolveRelative(file, source);
|
|
764
832
|
if (resolved) files.push(resolved);
|
|
@@ -776,7 +844,7 @@ function farmReactServerBuildReachesClientModules(importer, specifier, serverImp
|
|
|
776
844
|
if (!program) return false;
|
|
777
845
|
if (depth > 0 && isClientModule(program)) return true;
|
|
778
846
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
779
|
-
const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access',
|
|
847
|
+
const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access', _65 => _65.source, 'optionalAccess', _66 => _66.value]);
|
|
780
848
|
if (typeof source !== "string" || !source.startsWith(".")) continue;
|
|
781
849
|
const child = resolveRelative(file, source);
|
|
782
850
|
if (child && reaches(child, depth + 1)) return true;
|
|
@@ -789,18 +857,88 @@ var IMPORT_SPECIFIER = /(?:\bfrom\s*|\bimport\s*\(?\s*)["']([^"'./][^"']*)["']/g
|
|
|
789
857
|
var STYLESHEET_IMPORT = /(?:\bfrom\s*|\bimport\s*\(?\s*|\brequire\s*\(\s*)["'][^"']+\.(?:css|scss|sass|less|styl)["']/;
|
|
790
858
|
var MAX_SCANNED_FILES = 2e3;
|
|
791
859
|
var packageScans = /* @__PURE__ */ new Map();
|
|
860
|
+
var PACKAGE_SCAN_CACHE_SCHEMA = 1;
|
|
861
|
+
var packageScanStamps = /* @__PURE__ */ new Map();
|
|
862
|
+
var packageScanCache;
|
|
863
|
+
function stampScannedPath(directory, target) {
|
|
864
|
+
try {
|
|
865
|
+
const stat = _fs2.default.statSync(target, { throwIfNoEntry: false });
|
|
866
|
+
if (!stat) return void 0;
|
|
867
|
+
return [_path2.default.relative(directory, target), stat.size, stat.mtimeMs, stat.ctimeMs];
|
|
868
|
+
} catch (e11) {
|
|
869
|
+
return void 0;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
function isUnchangedScanStamp(directory, stamp) {
|
|
873
|
+
const current = stampScannedPath(directory, _path2.default.join(directory, stamp[0]));
|
|
874
|
+
return current !== void 0 && current[1] === stamp[1] && current[2] === stamp[2] && current[3] === stamp[3];
|
|
875
|
+
}
|
|
876
|
+
function usePackageScanCacheFile(file) {
|
|
877
|
+
if (_optionalChain([packageScanCache, 'optionalAccess', _67 => _67.file]) === file) return;
|
|
878
|
+
const stored = /* @__PURE__ */ new Map();
|
|
879
|
+
try {
|
|
880
|
+
const value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
|
|
881
|
+
if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm === _chunkXLOORES5cjs.FARM_VERSION && value.scans && typeof value.scans === "object") {
|
|
882
|
+
for (const [directory, scan] of Object.entries(value.scans)) {
|
|
883
|
+
if (isStoredPackageScan(scan)) stored.set(directory, scan);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
} catch (e12) {
|
|
887
|
+
}
|
|
888
|
+
packageScanCache = { file, stored, dirty: false };
|
|
889
|
+
}
|
|
890
|
+
function isStoredPackageScan(value) {
|
|
891
|
+
const scan = value;
|
|
892
|
+
return !!scan && Array.isArray(scan.imports) && scan.imports.every((item) => typeof item === "string") && typeof scan.stylesheets === "boolean" && Array.isArray(scan.paths) && scan.paths.every(
|
|
893
|
+
(stamp) => Array.isArray(stamp) && stamp.length === 4 && typeof stamp[0] === "string" && stamp.slice(1).every((part) => typeof part === "number")
|
|
894
|
+
);
|
|
895
|
+
}
|
|
896
|
+
function persistPackageScanCache() {
|
|
897
|
+
const cache2 = packageScanCache;
|
|
898
|
+
if (!_optionalChain([cache2, 'optionalAccess', _69 => _69.dirty])) return;
|
|
899
|
+
const scans = {};
|
|
900
|
+
for (const [directory, paths] of packageScanStamps) {
|
|
901
|
+
const scan = packageScans.get(directory);
|
|
902
|
+
if (scan)
|
|
903
|
+
scans[directory] = { imports: [...scan.imports], stylesheets: scan.stylesheets, paths };
|
|
904
|
+
}
|
|
905
|
+
const temporary = `${cache2.file}.${process.pid}.${Date.now()}.tmp`;
|
|
906
|
+
try {
|
|
907
|
+
_fs2.default.mkdirSync(_path2.default.dirname(cache2.file), { recursive: true });
|
|
908
|
+
_fs2.default.writeFileSync(
|
|
909
|
+
temporary,
|
|
910
|
+
JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm: _chunkXLOORES5cjs.FARM_VERSION, scans })
|
|
911
|
+
);
|
|
912
|
+
_fs2.default.renameSync(temporary, cache2.file);
|
|
913
|
+
cache2.dirty = false;
|
|
914
|
+
} catch (e13) {
|
|
915
|
+
try {
|
|
916
|
+
_fs2.default.rmSync(temporary, { force: true });
|
|
917
|
+
} catch (e14) {
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
792
921
|
function scanPackage(directory) {
|
|
793
922
|
const cached = packageScans.get(directory);
|
|
794
923
|
if (cached) return cached;
|
|
924
|
+
const stored = _optionalChain([packageScanCache, 'optionalAccess', _70 => _70.stored, 'access', _71 => _71.get, 'call', _72 => _72(directory)]);
|
|
925
|
+
if (stored && stored.paths.every((stamp) => isUnchangedScanStamp(directory, stamp))) {
|
|
926
|
+
const scan2 = { imports: new Set(stored.imports), stylesheets: stored.stylesheets };
|
|
927
|
+
packageScans.set(directory, scan2);
|
|
928
|
+
packageScanStamps.set(directory, stored.paths);
|
|
929
|
+
return scan2;
|
|
930
|
+
}
|
|
795
931
|
const scan = { imports: /* @__PURE__ */ new Set(), stylesheets: false };
|
|
932
|
+
const stamps = [];
|
|
796
933
|
const pending = [directory];
|
|
797
934
|
let scanned = 0;
|
|
798
935
|
while (pending.length > 0 && scanned < MAX_SCANNED_FILES) {
|
|
799
936
|
const current = pending.pop();
|
|
800
937
|
let entries;
|
|
938
|
+
stamps.push(stampScannedPath(directory, current));
|
|
801
939
|
try {
|
|
802
940
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
803
|
-
} catch (
|
|
941
|
+
} catch (e15) {
|
|
804
942
|
continue;
|
|
805
943
|
}
|
|
806
944
|
for (const entry of entries) {
|
|
@@ -809,9 +947,10 @@ function scanPackage(directory) {
|
|
|
809
947
|
if (entry.isDirectory()) pending.push(file);
|
|
810
948
|
else if (/\.(?:[cm]?js|jsx)$/.test(entry.name) && scanned++ < MAX_SCANNED_FILES) {
|
|
811
949
|
let code;
|
|
950
|
+
stamps.push(stampScannedPath(directory, file));
|
|
812
951
|
try {
|
|
813
952
|
code = _fs2.default.readFileSync(file, "utf8");
|
|
814
|
-
} catch (
|
|
953
|
+
} catch (e16) {
|
|
815
954
|
continue;
|
|
816
955
|
}
|
|
817
956
|
for (const match of code.matchAll(IMPORT_SPECIFIER)) scan.imports.add(match[1]);
|
|
@@ -820,6 +959,10 @@ function scanPackage(directory) {
|
|
|
820
959
|
}
|
|
821
960
|
}
|
|
822
961
|
packageScans.set(directory, scan);
|
|
962
|
+
if (stamps.every((stamp) => stamp !== void 0)) {
|
|
963
|
+
packageScanStamps.set(directory, stamps);
|
|
964
|
+
if (packageScanCache) packageScanCache.dirty = true;
|
|
965
|
+
}
|
|
823
966
|
return scan;
|
|
824
967
|
}
|
|
825
968
|
function findFarmServerBundledPackage(importer, specifier) {
|
|
@@ -834,7 +977,7 @@ function findFarmServerBundledPackage(importer, specifier) {
|
|
|
834
977
|
if (manifest.exports === void 0 && manifest.type !== "module" && typeof manifest.module === "string" && typeof manifest.main === "string" && _path2.default.resolve(directory, manifest.main) !== _path2.default.resolve(directory, manifest.module)) {
|
|
835
978
|
return { name: parsed.name, prebundle: isSelfContainedPackage(manifest, importer) };
|
|
836
979
|
}
|
|
837
|
-
} catch (
|
|
980
|
+
} catch (e17) {
|
|
838
981
|
return null;
|
|
839
982
|
}
|
|
840
983
|
return scanPackage(directory).stylesheets ? { name: parsed.name, prebundle: false } : null;
|
|
@@ -842,7 +985,7 @@ function findFarmServerBundledPackage(importer, specifier) {
|
|
|
842
985
|
function isSelfContainedPackage(manifest, importer) {
|
|
843
986
|
if (Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))).length > 0) return false;
|
|
844
987
|
return Object.keys(_nullishCoalesce(manifest.peerDependencies, () => ( {}))).every(
|
|
845
|
-
(peer) => _optionalChain([manifest, 'access',
|
|
988
|
+
(peer) => _optionalChain([manifest, 'access', _73 => _73.peerDependenciesMeta, 'optionalAccess', _74 => _74[peer], 'optionalAccess', _75 => _75.optional]) === true || findPackageDirectory(importer, peer) !== null
|
|
846
989
|
);
|
|
847
990
|
}
|
|
848
991
|
function findFarmPackageManifest(importer, specifier) {
|
|
@@ -854,11 +997,11 @@ function findFarmPackageManifest(importer, specifier) {
|
|
|
854
997
|
try {
|
|
855
998
|
const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(directory, "package.json"), "utf8"));
|
|
856
999
|
names = new Set(Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))));
|
|
857
|
-
} catch (
|
|
1000
|
+
} catch (e18) {
|
|
858
1001
|
return null;
|
|
859
1002
|
}
|
|
860
1003
|
const dependencies = [...scanPackage(directory).imports].filter((imported) => {
|
|
861
|
-
const name = _optionalChain([packageNameOf, 'call',
|
|
1004
|
+
const name = _optionalChain([packageNameOf, 'call', _76 => _76(imported), 'optionalAccess', _77 => _77.name]);
|
|
862
1005
|
return name !== void 0 && names.has(name);
|
|
863
1006
|
});
|
|
864
1007
|
return { name: parsed.name, dependencies: dependencies.sort() };
|
|
@@ -891,9 +1034,9 @@ function listFarmModuleExports(entry) {
|
|
|
891
1034
|
const name = exportedName(specifier.exported);
|
|
892
1035
|
if (name) names.add(name);
|
|
893
1036
|
}
|
|
894
|
-
if (_optionalChain([node, 'access',
|
|
895
|
-
for (const declarator of _nullishCoalesce(_optionalChain([node, 'access',
|
|
896
|
-
if (_optionalChain([declarator, 'access',
|
|
1037
|
+
if (_optionalChain([node, 'access', _78 => _78.declaration, 'optionalAccess', _79 => _79.id, 'optionalAccess', _80 => _80.name])) names.add(node.declaration.id.name);
|
|
1038
|
+
for (const declarator of _nullishCoalesce(_optionalChain([node, 'access', _81 => _81.declaration, 'optionalAccess', _82 => _82.declarations]), () => ( []))) {
|
|
1039
|
+
if (_optionalChain([declarator, 'access', _83 => _83.id, 'optionalAccess', _84 => _84.type]) === "Identifier") names.add(declarator.id.name);
|
|
897
1040
|
}
|
|
898
1041
|
} else if (node.type === "ExportDefaultDeclaration") {
|
|
899
1042
|
esm = true;
|
|
@@ -984,8 +1127,8 @@ function resolveProgrammaticClientRoutes(options) {
|
|
|
984
1127
|
let untraced = false;
|
|
985
1128
|
const definedIn = /* @__PURE__ */ new Map();
|
|
986
1129
|
for (const route of definitions) {
|
|
987
|
-
const source =
|
|
988
|
-
const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess',
|
|
1130
|
+
const source = _chunkYUCU6XB4cjs.getProgrammaticRouteDefinitionSource.call(void 0, route);
|
|
1131
|
+
const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _85 => _85.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
|
|
989
1132
|
for (const caller of callers.flat()) caller.routeSource = true;
|
|
990
1133
|
definedIn.set(route, callers.flat());
|
|
991
1134
|
if (!source || source.raw || (_nullishCoalesce(callers[0], () => ( []))).length === 0) untraced = true;
|
|
@@ -1082,7 +1225,7 @@ function resolveProgrammaticClientRoutes(options) {
|
|
|
1082
1225
|
return { routes, routeSourceFiles };
|
|
1083
1226
|
}
|
|
1084
1227
|
function createEvaluatedRouteGraph(server) {
|
|
1085
|
-
const evaluated = _optionalChain([server, 'access',
|
|
1228
|
+
const evaluated = _optionalChain([server, 'access', _86 => _86.environments, 'optionalAccess', _87 => _87.ssr, 'optionalAccess', _88 => _88.runner, 'optionalAccess', _89 => _89.evaluatedModules]);
|
|
1086
1229
|
if (!evaluated) return void 0;
|
|
1087
1230
|
const toGraphModule = (node) => ({
|
|
1088
1231
|
id: node.id,
|
|
@@ -1206,7 +1349,7 @@ function isNodeBuiltinId(id) {
|
|
|
1206
1349
|
return bare.startsWith("node:") || NODE_BUILTINS.has(bare);
|
|
1207
1350
|
}
|
|
1208
1351
|
function isProgrammaticRouteActionProxy(code) {
|
|
1209
|
-
return Boolean(_optionalChain([code, 'optionalAccess',
|
|
1352
|
+
return Boolean(_optionalChain([code, 'optionalAccess', _90 => _90.includes, 'call', _91 => _91("__farmRouteActionTarget: true")]));
|
|
1210
1353
|
}
|
|
1211
1354
|
function collectGraph(graph, routesFile) {
|
|
1212
1355
|
const modules = /* @__PURE__ */ new Map();
|
|
@@ -1300,7 +1443,7 @@ function holdsRouteDefinition(value, definitions) {
|
|
|
1300
1443
|
if (descriptor && "value" in descriptor) next(descriptor.value);
|
|
1301
1444
|
}
|
|
1302
1445
|
}
|
|
1303
|
-
} catch (
|
|
1446
|
+
} catch (e19) {
|
|
1304
1447
|
}
|
|
1305
1448
|
}
|
|
1306
1449
|
return false;
|
|
@@ -1393,7 +1536,7 @@ function readJsonString(text) {
|
|
|
1393
1536
|
try {
|
|
1394
1537
|
const value = JSON.parse(text);
|
|
1395
1538
|
return typeof value === "string" ? value : void 0;
|
|
1396
|
-
} catch (
|
|
1539
|
+
} catch (e20) {
|
|
1397
1540
|
return void 0;
|
|
1398
1541
|
}
|
|
1399
1542
|
}
|
|
@@ -1401,7 +1544,7 @@ function readJsonArray(text) {
|
|
|
1401
1544
|
try {
|
|
1402
1545
|
const value = JSON.parse(text);
|
|
1403
1546
|
return Array.isArray(value) ? value : void 0;
|
|
1404
|
-
} catch (
|
|
1547
|
+
} catch (e21) {
|
|
1405
1548
|
return void 0;
|
|
1406
1549
|
}
|
|
1407
1550
|
}
|
|
@@ -1411,13 +1554,13 @@ function readExports(namespace) {
|
|
|
1411
1554
|
let keys;
|
|
1412
1555
|
try {
|
|
1413
1556
|
keys = Object.keys(namespace);
|
|
1414
|
-
} catch (
|
|
1557
|
+
} catch (e22) {
|
|
1415
1558
|
return [];
|
|
1416
1559
|
}
|
|
1417
1560
|
for (const key of keys) {
|
|
1418
1561
|
try {
|
|
1419
1562
|
entries.push([key, namespace[key]]);
|
|
1420
|
-
} catch (
|
|
1563
|
+
} catch (e23) {
|
|
1421
1564
|
}
|
|
1422
1565
|
}
|
|
1423
1566
|
return entries;
|
|
@@ -1450,7 +1593,7 @@ function toModuleFile(file) {
|
|
|
1450
1593
|
if (file.startsWith("file://")) {
|
|
1451
1594
|
try {
|
|
1452
1595
|
return toPosixPath(_url.fileURLToPath.call(void 0, file));
|
|
1453
|
-
} catch (
|
|
1596
|
+
} catch (e24) {
|
|
1454
1597
|
return toPosixPath(file);
|
|
1455
1598
|
}
|
|
1456
1599
|
}
|
|
@@ -1469,7 +1612,7 @@ var _crypto = require('crypto');
|
|
|
1469
1612
|
|
|
1470
1613
|
var IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
1471
1614
|
var moduleName = (node) => {
|
|
1472
|
-
const name = _optionalChain([node, 'optionalAccess',
|
|
1615
|
+
const name = _optionalChain([node, 'optionalAccess', _92 => _92.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _93 => _93.value]);
|
|
1473
1616
|
return typeof name === "string" ? name : null;
|
|
1474
1617
|
};
|
|
1475
1618
|
function parse(code, file) {
|
|
@@ -1480,7 +1623,7 @@ function parse(code, file) {
|
|
|
1480
1623
|
function parseAs(code, lang) {
|
|
1481
1624
|
try {
|
|
1482
1625
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
1483
|
-
} catch (
|
|
1626
|
+
} catch (e25) {
|
|
1484
1627
|
return null;
|
|
1485
1628
|
}
|
|
1486
1629
|
}
|
|
@@ -1505,8 +1648,8 @@ function namespaceMembers2(program, local, declaration) {
|
|
|
1505
1648
|
if (opaque || node === declaration) return;
|
|
1506
1649
|
const name = node.type === "Identifier" || node.type === "JSXIdentifier" ? node.name : null;
|
|
1507
1650
|
if (name !== local) return;
|
|
1508
|
-
if (_optionalChain([parent, 'optionalAccess',
|
|
1509
|
-
const member = (_optionalChain([parent, 'optionalAccess',
|
|
1651
|
+
if (_optionalChain([parent, 'optionalAccess', _94 => _94.type]) === "ImportNamespaceSpecifier") return;
|
|
1652
|
+
const member = (_optionalChain([parent, 'optionalAccess', _95 => _95.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _96 => _96.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
|
|
1510
1653
|
const property = member && !parent.computed && (member.type === "Identifier" || member.type === "JSXIdentifier") ? member.name : null;
|
|
1511
1654
|
if (property) members.add(property);
|
|
1512
1655
|
else opaque = true;
|
|
@@ -1522,7 +1665,7 @@ function findFarmPackageClientImports(code, file, isClientPackage) {
|
|
|
1522
1665
|
const reexport = node.type === "ExportNamedDeclaration" && node.source != null;
|
|
1523
1666
|
if (node.type !== "ImportDeclaration" && !reexport) continue;
|
|
1524
1667
|
if (node.importKind === "type" || node.exportKind === "type") continue;
|
|
1525
|
-
const specifier = _optionalChain([node, 'access',
|
|
1668
|
+
const specifier = _optionalChain([node, 'access', _97 => _97.source, 'optionalAccess', _98 => _98.value]);
|
|
1526
1669
|
if (typeof specifier !== "string" || specifier.startsWith(".") || specifier.startsWith("/"))
|
|
1527
1670
|
continue;
|
|
1528
1671
|
const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
|
|
@@ -1579,7 +1722,7 @@ function farmPackageClientImportExports(entry) {
|
|
|
1579
1722
|
return [
|
|
1580
1723
|
...entry.defaultLocal ? ["default"] : [],
|
|
1581
1724
|
...entry.named.map((binding) => binding.imported),
|
|
1582
|
-
..._nullishCoalesce(_optionalChain([entry, 'access',
|
|
1725
|
+
..._nullishCoalesce(_optionalChain([entry, 'access', _99 => _99.namespace, 'optionalAccess', _100 => _100.members]), () => ( []))
|
|
1583
1726
|
];
|
|
1584
1727
|
}
|
|
1585
1728
|
var FARM_CLIENT_REFERENCE_PRAGMA = "// @farm-client-reference";
|
|
@@ -1620,7 +1763,7 @@ function packageLookup(directory, packageName) {
|
|
|
1620
1763
|
const candidate = _path2.default.join(current, "node_modules", packageName);
|
|
1621
1764
|
try {
|
|
1622
1765
|
return { from: current, real: _fs2.default.realpathSync(candidate) };
|
|
1623
|
-
} catch (
|
|
1766
|
+
} catch (e26) {
|
|
1624
1767
|
}
|
|
1625
1768
|
}
|
|
1626
1769
|
if (_path2.default.dirname(current) === current) return null;
|
|
@@ -1631,10 +1774,10 @@ function referenceResolveFrom(root, specifier, importer) {
|
|
|
1631
1774
|
const own = packageLookup(_path2.default.dirname(importer), packageName);
|
|
1632
1775
|
if (!own) return null;
|
|
1633
1776
|
const app = packageLookup(_path2.default.join(root, ".farm", "client-references"), packageName);
|
|
1634
|
-
if (_optionalChain([app, 'optionalAccess',
|
|
1777
|
+
if (_optionalChain([app, 'optionalAccess', _101 => _101.real]) === own.real) return null;
|
|
1635
1778
|
try {
|
|
1636
1779
|
return _fs2.default.realpathSync(own.from);
|
|
1637
|
-
} catch (
|
|
1780
|
+
} catch (e27) {
|
|
1638
1781
|
return own.from;
|
|
1639
1782
|
}
|
|
1640
1783
|
}
|
|
@@ -1660,7 +1803,7 @@ function ensureFarmPackageClientReference(root, specifier, exportName, importer)
|
|
|
1660
1803
|
let current = null;
|
|
1661
1804
|
try {
|
|
1662
1805
|
current = _fs2.default.readFileSync(file, "utf8");
|
|
1663
|
-
} catch (
|
|
1806
|
+
} catch (e28) {
|
|
1664
1807
|
}
|
|
1665
1808
|
if (current !== source) {
|
|
1666
1809
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
@@ -1672,7 +1815,7 @@ function writeIfChanged(file, source) {
|
|
|
1672
1815
|
let current = null;
|
|
1673
1816
|
try {
|
|
1674
1817
|
current = _fs2.default.readFileSync(file, "utf8");
|
|
1675
|
-
} catch (
|
|
1818
|
+
} catch (e29) {
|
|
1676
1819
|
}
|
|
1677
1820
|
if (current !== source) {
|
|
1678
1821
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
@@ -1684,7 +1827,7 @@ function owningPackage(file) {
|
|
|
1684
1827
|
try {
|
|
1685
1828
|
const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(current, "package.json"), "utf8"));
|
|
1686
1829
|
if (typeof manifest.name === "string") return { directory: current, name: manifest.name };
|
|
1687
|
-
} catch (
|
|
1830
|
+
} catch (e30) {
|
|
1688
1831
|
}
|
|
1689
1832
|
if (_path2.default.dirname(current) === current) return null;
|
|
1690
1833
|
}
|
|
@@ -1755,7 +1898,7 @@ function rewriteFarmPackageClientImports(options) {
|
|
|
1755
1898
|
lines.push(`import { ${member} as ${local} } from ${reference(entry.specifier, member)};`);
|
|
1756
1899
|
fields.push(`${member}: ${local}`);
|
|
1757
1900
|
}
|
|
1758
|
-
if (_optionalChain([entry, 'access',
|
|
1901
|
+
if (_optionalChain([entry, 'access', _102 => _102.namespace, 'access', _103 => _103.values, 'optionalAccess', _104 => _104.length])) {
|
|
1759
1902
|
const local = `__farm_package_values_${next++}__`;
|
|
1760
1903
|
lines.push(`import * as ${local} from ${JSON.stringify(entry.specifier)};`);
|
|
1761
1904
|
for (const value of entry.namespace.values) fields.push(`${value}: ${local}.${value}`);
|
|
@@ -1804,7 +1947,7 @@ function ensureFarmIslandContainerReference(root) {
|
|
|
1804
1947
|
let current = null;
|
|
1805
1948
|
try {
|
|
1806
1949
|
current = _fs2.default.readFileSync(file, "utf8");
|
|
1807
|
-
} catch (
|
|
1950
|
+
} catch (e31) {
|
|
1808
1951
|
}
|
|
1809
1952
|
if (current !== source) {
|
|
1810
1953
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
@@ -1818,7 +1961,7 @@ function parse2(code, file) {
|
|
|
1818
1961
|
return memoizeInFarmSourceSnapshot(`ast:${lang}`, code, () => {
|
|
1819
1962
|
try {
|
|
1820
1963
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
1821
|
-
} catch (
|
|
1964
|
+
} catch (e32) {
|
|
1822
1965
|
return null;
|
|
1823
1966
|
}
|
|
1824
1967
|
});
|
|
@@ -1852,7 +1995,7 @@ function findFarmIslandContainers(code, file, bindings) {
|
|
|
1852
1995
|
const current = node;
|
|
1853
1996
|
if (typeof current.type !== "string") return;
|
|
1854
1997
|
if (current.type === "JSXElement") {
|
|
1855
|
-
const name = jsxName(_optionalChain([current, 'access',
|
|
1998
|
+
const name = jsxName(_optionalChain([current, 'access', _105 => _105.openingElement, 'optionalAccess', _106 => _106.name]));
|
|
1856
1999
|
if (name && names.has(name)) {
|
|
1857
2000
|
let container;
|
|
1858
2001
|
for (let depth = open.length - 1; depth >= 0; depth--) {
|
|
@@ -1868,9 +2011,9 @@ function findFarmIslandContainers(code, file, bindings) {
|
|
|
1868
2011
|
});
|
|
1869
2012
|
}
|
|
1870
2013
|
}
|
|
1871
|
-
const host = _optionalChain([current, 'access',
|
|
2014
|
+
const host = _optionalChain([current, 'access', _107 => _107.openingElement, 'optionalAccess', _108 => _108.name, 'optionalAccess', _109 => _109.type]) === "JSXIdentifier" && (ISLAND_CONTAINER_TAGS.has(name) || FLOW_CONTENT_TAGS.has(name));
|
|
1872
2015
|
if (host) open.push(current);
|
|
1873
|
-
visit(_optionalChain([current, 'access',
|
|
2016
|
+
visit(_optionalChain([current, 'access', _110 => _110.openingElement, 'optionalAccess', _111 => _111.attributes]));
|
|
1874
2017
|
visit(current.children);
|
|
1875
2018
|
if (host) open.pop();
|
|
1876
2019
|
return;
|
|
@@ -1901,7 +2044,7 @@ function wrapFarmIslandContainers(options) {
|
|
|
1901
2044
|
const declaration = `import { ${FARM_ISLAND_CONTAINER_EXPORT} as ${CONTAINER_LOCAL} } from ${specifier};
|
|
1902
2045
|
`;
|
|
1903
2046
|
let prologueEnd = 0;
|
|
1904
|
-
for (const statement of _nullishCoalesce(_optionalChain([parse2, 'call',
|
|
2047
|
+
for (const statement of _nullishCoalesce(_optionalChain([parse2, 'call', _112 => _112(options.code, options.file), 'optionalAccess', _113 => _113.body]), () => ( []))) {
|
|
1905
2048
|
if (statement.type !== "ExpressionStatement" || typeof statement.directive !== "string") break;
|
|
1906
2049
|
prologueEnd = statement.end;
|
|
1907
2050
|
}
|
|
@@ -1957,7 +2100,7 @@ function stampPackagePath(target, kind) {
|
|
|
1957
2100
|
const stat = _fs2.default.statSync(target, { throwIfNoEntry: false });
|
|
1958
2101
|
if (!stat || (kind === "file" ? !stat.isFile() : !stat.isDirectory())) return void 0;
|
|
1959
2102
|
return [target, stat.size, stat.mtimeMs, stat.ctimeMs];
|
|
1960
|
-
} catch (
|
|
2103
|
+
} catch (e33) {
|
|
1961
2104
|
return void 0;
|
|
1962
2105
|
}
|
|
1963
2106
|
}
|
|
@@ -1993,7 +2136,7 @@ var PackageClientBoundaryCache = class {
|
|
|
1993
2136
|
else this.dirty = true;
|
|
1994
2137
|
}
|
|
1995
2138
|
}
|
|
1996
|
-
return _optionalChain([entries, 'optionalAccess',
|
|
2139
|
+
return _optionalChain([entries, 'optionalAccess', _114 => _114.find, 'call', _115 => _115(
|
|
1997
2140
|
(entry) => entry.stops.every((file) => visited.has(file)) && !entry.files.some((file) => visited.has(file))
|
|
1998
2141
|
)]);
|
|
1999
2142
|
}
|
|
@@ -2012,7 +2155,7 @@ var PackageClientBoundaryCache = class {
|
|
|
2012
2155
|
await _fs2.default.promises.mkdir(_path2.default.dirname(file), { recursive: true });
|
|
2013
2156
|
await _fs2.default.promises.writeFile(temporary, contents);
|
|
2014
2157
|
await _fs2.default.promises.rename(temporary, file);
|
|
2015
|
-
} catch (
|
|
2158
|
+
} catch (e34) {
|
|
2016
2159
|
await _fs2.default.promises.rm(temporary, { force: true }).catch(() => {
|
|
2017
2160
|
});
|
|
2018
2161
|
}
|
|
@@ -2027,10 +2170,10 @@ var PackageClientBoundaryCache = class {
|
|
|
2027
2170
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
2028
2171
|
_fs2.default.writeFileSync(temporary, contents);
|
|
2029
2172
|
_fs2.default.renameSync(temporary, file);
|
|
2030
|
-
} catch (
|
|
2173
|
+
} catch (e35) {
|
|
2031
2174
|
try {
|
|
2032
2175
|
_fs2.default.rmSync(temporary, { force: true });
|
|
2033
|
-
} catch (
|
|
2176
|
+
} catch (e36) {
|
|
2034
2177
|
}
|
|
2035
2178
|
}
|
|
2036
2179
|
}
|
|
@@ -2064,7 +2207,7 @@ var PackageClientBoundaryCache = class {
|
|
|
2064
2207
|
}
|
|
2065
2208
|
const contents = JSON.stringify({
|
|
2066
2209
|
schema: SCHEMA_VERSION,
|
|
2067
|
-
farm:
|
|
2210
|
+
farm: _chunkXLOORES5cjs.FARM_VERSION,
|
|
2068
2211
|
paths,
|
|
2069
2212
|
entries
|
|
2070
2213
|
});
|
|
@@ -2101,10 +2244,10 @@ function readStoredCache(file) {
|
|
|
2101
2244
|
let value;
|
|
2102
2245
|
try {
|
|
2103
2246
|
value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
|
|
2104
|
-
} catch (
|
|
2247
|
+
} catch (e37) {
|
|
2105
2248
|
return null;
|
|
2106
2249
|
}
|
|
2107
|
-
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !==
|
|
2250
|
+
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkXLOORES5cjs.FARM_VERSION) {
|
|
2108
2251
|
return null;
|
|
2109
2252
|
}
|
|
2110
2253
|
const { paths, entries } = value;
|
|
@@ -2115,7 +2258,7 @@ function readStoredCache(file) {
|
|
|
2115
2258
|
const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
|
|
2116
2259
|
if (usable.length > 0) valid[key] = usable;
|
|
2117
2260
|
}
|
|
2118
|
-
return { schema: SCHEMA_VERSION, farm:
|
|
2261
|
+
return { schema: SCHEMA_VERSION, farm: _chunkXLOORES5cjs.FARM_VERSION, paths, entries: valid };
|
|
2119
2262
|
}
|
|
2120
2263
|
function isRecord(value) {
|
|
2121
2264
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -2154,7 +2297,7 @@ async function withPackageClientBoundaryCache(operation) {
|
|
|
2154
2297
|
}
|
|
2155
2298
|
}
|
|
2156
2299
|
function usePackageClientBoundaryCacheFile(file) {
|
|
2157
|
-
_optionalChain([getPackageClientBoundaryCache, 'call',
|
|
2300
|
+
_optionalChain([getPackageClientBoundaryCache, 'call', _116 => _116(), 'optionalAccess', _117 => _117.load, 'call', _118 => _118(file)]);
|
|
2158
2301
|
}
|
|
2159
2302
|
function resolvePackageClientBoundaryCacheFile(root, distDir) {
|
|
2160
2303
|
return _path2.default.resolve(root, distDir, "cache", "client-boundaries.json");
|
|
@@ -2171,7 +2314,7 @@ function runWithPackageClientBoundaryCacheFile(file, operation) {
|
|
|
2171
2314
|
var latestDevCache;
|
|
2172
2315
|
function runWithLatestPackageClientBoundaryCache(file, operation) {
|
|
2173
2316
|
if (getPackageClientBoundaryCache()) return operation();
|
|
2174
|
-
if (_optionalChain([latestDevCache, 'optionalAccess',
|
|
2317
|
+
if (_optionalChain([latestDevCache, 'optionalAccess', _119 => _119.file]) !== file) {
|
|
2175
2318
|
const cache2 = new PackageClientBoundaryCache();
|
|
2176
2319
|
cache2.load(file);
|
|
2177
2320
|
latestDevCache = { file, cache: cache2 };
|
|
@@ -2205,7 +2348,7 @@ function readSourceFileContents(filePath) {
|
|
|
2205
2348
|
return null;
|
|
2206
2349
|
}
|
|
2207
2350
|
return _fs2.default.readFileSync(filePath, "utf-8");
|
|
2208
|
-
} catch (
|
|
2351
|
+
} catch (e38) {
|
|
2209
2352
|
return null;
|
|
2210
2353
|
}
|
|
2211
2354
|
}
|
|
@@ -2218,7 +2361,7 @@ function resolveModuleSourcePath(modulePath, root) {
|
|
|
2218
2361
|
if (modulePath.startsWith("file://")) {
|
|
2219
2362
|
try {
|
|
2220
2363
|
candidates.add(_url.fileURLToPath.call(void 0, modulePath));
|
|
2221
|
-
} catch (
|
|
2364
|
+
} catch (e39) {
|
|
2222
2365
|
}
|
|
2223
2366
|
}
|
|
2224
2367
|
if (modulePath.startsWith("/@fs/")) {
|
|
@@ -2231,7 +2374,7 @@ function resolveModuleSourcePath(modulePath, root) {
|
|
|
2231
2374
|
candidates.add(_path2.default.join(root, normalized));
|
|
2232
2375
|
candidates.add(_path2.default.resolve(root, normalized));
|
|
2233
2376
|
}
|
|
2234
|
-
if (_optionalChain([withoutQuery, 'optionalAccess',
|
|
2377
|
+
if (_optionalChain([withoutQuery, 'optionalAccess', _120 => _120.startsWith, 'call', _121 => _121("/src/")])) {
|
|
2235
2378
|
const normalized = withoutQuery.replace(/^\/+/, "");
|
|
2236
2379
|
candidates.add(_path2.default.join(process.cwd(), normalized));
|
|
2237
2380
|
candidates.add(_path2.default.resolve(process.cwd(), normalized));
|
|
@@ -2310,7 +2453,7 @@ function hasHydrateExport(content) {
|
|
|
2310
2453
|
for (const match of content.matchAll(/\bexport\s*\{([^}]*)\}/g)) {
|
|
2311
2454
|
for (const specifier of match[1].split(",")) {
|
|
2312
2455
|
const parts = specifier.trim().split(/\s+as\s+/);
|
|
2313
|
-
const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess',
|
|
2456
|
+
const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]);
|
|
2314
2457
|
if (exportedName2 === "hydrate") {
|
|
2315
2458
|
return true;
|
|
2316
2459
|
}
|
|
@@ -2505,7 +2648,7 @@ function isIslandExportStart(tokens, index) {
|
|
|
2505
2648
|
const token = tokens[index];
|
|
2506
2649
|
const previous = tokens[index - 1];
|
|
2507
2650
|
const startsStatement = !previous || previous.value === ";" || previous.value === "{" || previous.value === "}" || token.line > previous.line;
|
|
2508
|
-
return startsStatement && token.value === "export" && _optionalChain([tokens, 'access',
|
|
2651
|
+
return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _124 => _124[index + 1], 'optionalAccess', _125 => _125.value]) === "const" && _optionalChain([tokens, 'access', _126 => _126[index + 2], 'optionalAccess', _127 => _127.value]) === "island";
|
|
2509
2652
|
}
|
|
2510
2653
|
function getIslandStrategyExport(content) {
|
|
2511
2654
|
if (!content) return null;
|
|
@@ -2513,15 +2656,15 @@ function getIslandStrategyExport(content) {
|
|
|
2513
2656
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2514
2657
|
if (!isIslandExportStart(tokens, index)) continue;
|
|
2515
2658
|
let valueIndex = index + 3;
|
|
2516
|
-
if (_optionalChain([tokens, 'access',
|
|
2659
|
+
if (_optionalChain([tokens, 'access', _128 => _128[valueIndex], 'optionalAccess', _129 => _129.value]) === ":") {
|
|
2517
2660
|
while (valueIndex < tokens.length && tokens[valueIndex].value !== "=") valueIndex++;
|
|
2518
2661
|
}
|
|
2519
|
-
if (_optionalChain([tokens, 'access',
|
|
2662
|
+
if (_optionalChain([tokens, 'access', _130 => _130[valueIndex], 'optionalAccess', _131 => _131.value]) !== "=") break;
|
|
2520
2663
|
valueIndex++;
|
|
2521
2664
|
const literal = tokens[valueIndex];
|
|
2522
2665
|
if (!literal || literal.kind !== "string" || !_chunk7KJJ4SBScjs.isFarmIslandStrategy.call(void 0, literal.value)) break;
|
|
2523
2666
|
let trailingIndex = valueIndex + 1;
|
|
2524
|
-
if (_optionalChain([tokens, 'access',
|
|
2667
|
+
if (_optionalChain([tokens, 'access', _132 => _132[trailingIndex], 'optionalAccess', _133 => _133.value]) === "as" && _optionalChain([tokens, 'access', _134 => _134[trailingIndex + 1], 'optionalAccess', _135 => _135.value]) === "const") {
|
|
2525
2668
|
trailingIndex += 2;
|
|
2526
2669
|
}
|
|
2527
2670
|
const trailing = tokens[trailingIndex];
|
|
@@ -2547,13 +2690,13 @@ function hasAsyncDefaultExport(content) {
|
|
|
2547
2690
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2548
2691
|
const token = tokens[index];
|
|
2549
2692
|
if (token.kind !== "identifier" || token.value !== "export") continue;
|
|
2550
|
-
if (_optionalChain([tokens, 'access',
|
|
2551
|
-
if (_optionalChain([tokens, 'access',
|
|
2693
|
+
if (_optionalChain([tokens, 'access', _136 => _136[index - 1], 'optionalAccess', _137 => _137.value]) === ".") continue;
|
|
2694
|
+
if (_optionalChain([tokens, 'access', _138 => _138[index + 1], 'optionalAccess', _139 => _139.value]) !== "default") continue;
|
|
2552
2695
|
const exported = tokens[index + 2];
|
|
2553
2696
|
if (exported.kind === "identifier" && exported.value === "async") {
|
|
2554
2697
|
return true;
|
|
2555
2698
|
}
|
|
2556
|
-
if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access',
|
|
2699
|
+
if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _140 => _140[index + 3], 'optionalAccess', _141 => _141.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
|
|
2557
2700
|
return true;
|
|
2558
2701
|
}
|
|
2559
2702
|
}
|
|
@@ -2561,10 +2704,10 @@ function hasAsyncDefaultExport(content) {
|
|
|
2561
2704
|
}
|
|
2562
2705
|
function isAsyncLocalDeclaration(tokens, name) {
|
|
2563
2706
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2564
|
-
if (tokens[index].value === "async" && _optionalChain([tokens, 'access',
|
|
2707
|
+
if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _142 => _142[index + 1], 'optionalAccess', _143 => _143.value]) === "function" && _optionalChain([tokens, 'access', _144 => _144[index + 2], 'optionalAccess', _145 => _145.value]) === name) {
|
|
2565
2708
|
return true;
|
|
2566
2709
|
}
|
|
2567
|
-
if (tokens[index].value === name && _optionalChain([tokens, 'access',
|
|
2710
|
+
if (tokens[index].value === name && _optionalChain([tokens, 'access', _146 => _146[index + 1], 'optionalAccess', _147 => _147.value]) === "=" && _optionalChain([tokens, 'access', _148 => _148[index + 2], 'optionalAccess', _149 => _149.value]) === "async") {
|
|
2568
2711
|
return true;
|
|
2569
2712
|
}
|
|
2570
2713
|
}
|
|
@@ -2778,7 +2921,7 @@ function planClientModuleHydration(modulePath, root, mode, options) {
|
|
|
2778
2921
|
return plan;
|
|
2779
2922
|
}
|
|
2780
2923
|
function usesFarmServerTree(plan) {
|
|
2781
|
-
return _optionalChain([plan, 'optionalAccess',
|
|
2924
|
+
return _optionalChain([plan, 'optionalAccess', _150 => _150.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0;
|
|
2782
2925
|
}
|
|
2783
2926
|
function getMarkdownPageHydrationPlan(componentsModulePath, root, mode = "off", options = {}) {
|
|
2784
2927
|
const plan = {
|
|
@@ -2908,7 +3051,7 @@ function clientModulePlanSignature(content) {
|
|
|
2908
3051
|
isIsolatableClientBoundarySource(content),
|
|
2909
3052
|
getImportSpecifiers(content).sort()
|
|
2910
3053
|
]);
|
|
2911
|
-
} catch (
|
|
3054
|
+
} catch (e40) {
|
|
2912
3055
|
return null;
|
|
2913
3056
|
}
|
|
2914
3057
|
}
|
|
@@ -2933,7 +3076,7 @@ function getStaticImportBindings(content) {
|
|
|
2933
3076
|
if (!content) return bindings;
|
|
2934
3077
|
const tokens = tokenizeModuleSource(content);
|
|
2935
3078
|
for (let index = 0; index < tokens.length; index++) {
|
|
2936
|
-
if (tokens[index].value !== "import" || _optionalChain([tokens, 'access',
|
|
3079
|
+
if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _151 => _151[index - 1], 'optionalAccess', _152 => _152.value]) === ".") continue;
|
|
2937
3080
|
const first = tokens[index + 1];
|
|
2938
3081
|
if (!first || first.value === "type" || first.value === "(" || first.kind === "string") {
|
|
2939
3082
|
continue;
|
|
@@ -2941,7 +3084,7 @@ function getStaticImportBindings(content) {
|
|
|
2941
3084
|
let fromIndex = -1;
|
|
2942
3085
|
for (let cursor = index + 1; cursor < tokens.length; cursor++) {
|
|
2943
3086
|
if (tokens[cursor].value === ";") break;
|
|
2944
|
-
if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access',
|
|
3087
|
+
if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _153 => _153[cursor + 1], 'optionalAccess', _154 => _154.kind]) === "string") {
|
|
2945
3088
|
fromIndex = cursor;
|
|
2946
3089
|
break;
|
|
2947
3090
|
}
|
|
@@ -2950,13 +3093,13 @@ function getStaticImportBindings(content) {
|
|
|
2950
3093
|
const specifier = tokens[fromIndex + 1].value;
|
|
2951
3094
|
const clause = tokens.slice(index + 1, fromIndex);
|
|
2952
3095
|
const localNames = [];
|
|
2953
|
-
if (_optionalChain([clause, 'access',
|
|
3096
|
+
if (_optionalChain([clause, 'access', _155 => _155[0], 'optionalAccess', _156 => _156.kind]) === "identifier" && clause[0].value !== "type") {
|
|
2954
3097
|
localNames.push(clause[0].value);
|
|
2955
3098
|
}
|
|
2956
3099
|
const namespaceAs = clause.findIndex(
|
|
2957
|
-
(token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access',
|
|
3100
|
+
(token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _157 => _157[clauseIndex + 1], 'optionalAccess', _158 => _158.value]) === "as"
|
|
2958
3101
|
);
|
|
2959
|
-
if (namespaceAs !== -1 && _optionalChain([clause, 'access',
|
|
3102
|
+
if (namespaceAs !== -1 && _optionalChain([clause, 'access', _159 => _159[namespaceAs + 2], 'optionalAccess', _160 => _160.kind]) === "identifier") {
|
|
2960
3103
|
localNames.push(clause[namespaceAs + 2].value);
|
|
2961
3104
|
}
|
|
2962
3105
|
const openingBrace = clause.findIndex((token) => token.value === "{");
|
|
@@ -2966,11 +3109,11 @@ function getStaticImportBindings(content) {
|
|
|
2966
3109
|
if (openingBrace !== -1 && closingBrace !== -1) {
|
|
2967
3110
|
let entryStart = openingBrace + 1;
|
|
2968
3111
|
for (let cursor = entryStart; cursor <= closingBrace; cursor++) {
|
|
2969
|
-
if (cursor !== closingBrace && _optionalChain([clause, 'access',
|
|
3112
|
+
if (cursor !== closingBrace && _optionalChain([clause, 'access', _161 => _161[cursor], 'optionalAccess', _162 => _162.value]) !== ",") continue;
|
|
2970
3113
|
const entry = clause.slice(entryStart, cursor).filter((token) => token.value !== "type");
|
|
2971
3114
|
const asIndex = entry.findIndex((token) => token.value === "as");
|
|
2972
3115
|
const local = asIndex === -1 ? entry[0] : entry[asIndex + 1];
|
|
2973
|
-
if (_optionalChain([local, 'optionalAccess',
|
|
3116
|
+
if (_optionalChain([local, 'optionalAccess', _163 => _163.kind]) === "identifier") localNames.push(local.value);
|
|
2974
3117
|
entryStart = cursor + 1;
|
|
2975
3118
|
}
|
|
2976
3119
|
}
|
|
@@ -3007,14 +3150,14 @@ function findParserSensitiveJsxContainer(content, localBindings) {
|
|
|
3007
3150
|
const open = [];
|
|
3008
3151
|
const isSelfClosing = (openingIndex) => {
|
|
3009
3152
|
for (let index = openingIndex; index < tokens.length; index++) {
|
|
3010
|
-
if (tokens[index].value === ">") return _optionalChain([tokens, 'access',
|
|
3153
|
+
if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _164 => _164[index - 1], 'optionalAccess', _165 => _165.value]) === "/";
|
|
3011
3154
|
}
|
|
3012
3155
|
return false;
|
|
3013
3156
|
};
|
|
3014
3157
|
for (let index = 0; index < tokens.length - 1; index++) {
|
|
3015
3158
|
if (tokens[index].value !== "<") continue;
|
|
3016
3159
|
if (tokens[index + 1].value === "/") {
|
|
3017
|
-
const closing = _optionalChain([tokens, 'access',
|
|
3160
|
+
const closing = _optionalChain([tokens, 'access', _166 => _166[index + 2], 'optionalAccess', _167 => _167.value]);
|
|
3018
3161
|
const at = closing ? open.lastIndexOf(closing) : -1;
|
|
3019
3162
|
if (at !== -1) open.length = at;
|
|
3020
3163
|
continue;
|
|
@@ -3057,7 +3200,7 @@ function findMatchingToken(tokens, openingIndex, opening, closing) {
|
|
|
3057
3200
|
}
|
|
3058
3201
|
function containsClientJsx(tokens, start, end, clientBindings) {
|
|
3059
3202
|
for (let index = start; index < end; index++) {
|
|
3060
|
-
if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access',
|
|
3203
|
+
if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _168 => _168[index + 1], 'optionalAccess', _169 => _169.value]))) return true;
|
|
3061
3204
|
}
|
|
3062
3205
|
return false;
|
|
3063
3206
|
}
|
|
@@ -3095,7 +3238,7 @@ function getClientRenderingHelpers(tokens, clientBindings) {
|
|
|
3095
3238
|
let helperName;
|
|
3096
3239
|
let bodyStart = -1;
|
|
3097
3240
|
let bodyEnd = -1;
|
|
3098
|
-
if (tokens[index].value === "function" && _optionalChain([tokens, 'access',
|
|
3241
|
+
if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _170 => _170[index + 1], 'optionalAccess', _171 => _171.kind]) === "identifier") {
|
|
3099
3242
|
helperName = tokens[index + 1].value;
|
|
3100
3243
|
const parametersStart = tokens.findIndex(
|
|
3101
3244
|
(token, tokenIndex) => tokenIndex > index + 1 && token.value === "("
|
|
@@ -3105,21 +3248,21 @@ function getClientRenderingHelpers(tokens, clientBindings) {
|
|
|
3105
3248
|
(token, tokenIndex) => tokenIndex > parametersEnd && token.value === "{"
|
|
3106
3249
|
);
|
|
3107
3250
|
if (bodyStart !== -1) bodyEnd = findMatchingToken(tokens, bodyStart, "{", "}");
|
|
3108
|
-
} else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access',
|
|
3251
|
+
} else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _172 => _172[index + 1], 'optionalAccess', _173 => _173.kind]) === "identifier") {
|
|
3109
3252
|
helperName = tokens[index + 1].value;
|
|
3110
3253
|
let assignmentIndex = -1;
|
|
3111
3254
|
let arrowIndex = -1;
|
|
3112
3255
|
for (let cursor = index + 2; cursor < tokens.length; cursor++) {
|
|
3113
3256
|
if (tokens[cursor].value === ";") break;
|
|
3114
3257
|
if (assignmentIndex === -1 && tokens[cursor].value === "=") assignmentIndex = cursor;
|
|
3115
|
-
if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access',
|
|
3258
|
+
if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _174 => _174[cursor + 1], 'optionalAccess', _175 => _175.value]) === ">") {
|
|
3116
3259
|
arrowIndex = cursor;
|
|
3117
3260
|
break;
|
|
3118
3261
|
}
|
|
3119
3262
|
}
|
|
3120
3263
|
if (arrowIndex !== -1) {
|
|
3121
3264
|
bodyStart = arrowIndex + 2;
|
|
3122
|
-
bodyEnd = _optionalChain([tokens, 'access',
|
|
3265
|
+
bodyEnd = _optionalChain([tokens, 'access', _176 => _176[bodyStart], 'optionalAccess', _177 => _177.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
|
|
3123
3266
|
} else if (assignmentIndex !== -1) {
|
|
3124
3267
|
bodyStart = assignmentIndex + 1;
|
|
3125
3268
|
bodyEnd = findStatementEnd(tokens, bodyStart);
|
|
@@ -3159,14 +3302,14 @@ function passesElementValuedProps(content, localBindings) {
|
|
|
3159
3302
|
else if (value === "}") braceDepth--;
|
|
3160
3303
|
else if (value === "<" && braceDepth > 0) return true;
|
|
3161
3304
|
else if (value === ">" && braceDepth === 0) {
|
|
3162
|
-
selfClosing = _optionalChain([tokens, 'access',
|
|
3305
|
+
selfClosing = _optionalChain([tokens, 'access', _178 => _178[cursor - 1], 'optionalAccess', _179 => _179.value]) === "/";
|
|
3163
3306
|
break;
|
|
3164
3307
|
}
|
|
3165
3308
|
}
|
|
3166
3309
|
if (selfClosing || cursor >= tokens.length) continue;
|
|
3167
3310
|
for (let child = cursor + 1; child < tokens.length; child++) {
|
|
3168
3311
|
if (tokens[child].value !== "<") continue;
|
|
3169
|
-
const closesBoundary = _optionalChain([tokens, 'access',
|
|
3312
|
+
const closesBoundary = _optionalChain([tokens, 'access', _180 => _180[child + 1], 'optionalAccess', _181 => _181.value]) === "/" && _optionalChain([tokens, 'access', _182 => _182[child + 2], 'optionalAccess', _183 => _183.value]) === name;
|
|
3170
3313
|
if (!closesBoundary) return true;
|
|
3171
3314
|
break;
|
|
3172
3315
|
}
|
|
@@ -3188,7 +3331,7 @@ function rendersOnlyLeafElements(content, localBindings) {
|
|
|
3188
3331
|
else if (value === "<" && braceDepth > 0) return false;
|
|
3189
3332
|
else if (value === ">" && braceDepth === 0) break;
|
|
3190
3333
|
}
|
|
3191
|
-
if (cursor >= tokens.length || _optionalChain([tokens, 'access',
|
|
3334
|
+
if (cursor >= tokens.length || _optionalChain([tokens, 'access', _184 => _184[cursor - 1], 'optionalAccess', _185 => _185.value]) !== "/") return false;
|
|
3192
3335
|
}
|
|
3193
3336
|
return true;
|
|
3194
3337
|
}
|
|
@@ -3200,9 +3343,9 @@ function hasDynamicJsxCardinality(content, localBindings) {
|
|
|
3200
3343
|
const containsDynamicRenderer = (start, end) => containsClientJsx(tokens, start, end, clientBindings) || tokens.slice(start, end).some((token) => renderingHelpers.has(token.value));
|
|
3201
3344
|
for (let index = 0; index < tokens.length; index++) {
|
|
3202
3345
|
let callStart = -1;
|
|
3203
|
-
if (tokens[index].value === "." && (_optionalChain([tokens, 'access',
|
|
3346
|
+
if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _186 => _186[index + 1], 'optionalAccess', _187 => _187.value]) === "map" || _optionalChain([tokens, 'access', _188 => _188[index + 1], 'optionalAccess', _189 => _189.value]) === "flatMap") && _optionalChain([tokens, 'access', _190 => _190[index + 2], 'optionalAccess', _191 => _191.value]) === "(") {
|
|
3204
3347
|
callStart = index + 2;
|
|
3205
|
-
} else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access',
|
|
3348
|
+
} else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _192 => _192[index + 1], 'optionalAccess', _193 => _193.value]) === "." && _optionalChain([tokens, 'access', _194 => _194[index + 2], 'optionalAccess', _195 => _195.value]) === "from" && _optionalChain([tokens, 'access', _196 => _196[index + 3], 'optionalAccess', _197 => _197.value]) === "(") {
|
|
3206
3349
|
callStart = index + 3;
|
|
3207
3350
|
}
|
|
3208
3351
|
if (callStart !== -1) {
|
|
@@ -3211,10 +3354,10 @@ function hasDynamicJsxCardinality(content, localBindings) {
|
|
|
3211
3354
|
index = callEnd;
|
|
3212
3355
|
continue;
|
|
3213
3356
|
}
|
|
3214
|
-
if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access',
|
|
3357
|
+
if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _198 => _198[index + 1], 'optionalAccess', _199 => _199.value]) === "(") {
|
|
3215
3358
|
const conditionEnd = findMatchingToken(tokens, index + 1, "(", ")");
|
|
3216
3359
|
const bodyStart = conditionEnd + 1;
|
|
3217
|
-
const bodyEnd = _optionalChain([tokens, 'access',
|
|
3360
|
+
const bodyEnd = _optionalChain([tokens, 'access', _200 => _200[bodyStart], 'optionalAccess', _201 => _201.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
|
|
3218
3361
|
if (containsDynamicRenderer(bodyStart, bodyEnd === -1 ? tokens.length : bodyEnd)) return true;
|
|
3219
3362
|
}
|
|
3220
3363
|
}
|
|
@@ -3326,7 +3469,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
|
|
|
3326
3469
|
const localBindings = _nullishCoalesce(importedBindings.get(specifier), () => ( []));
|
|
3327
3470
|
const staticUses = countStaticJsxUses(content, localBindings);
|
|
3328
3471
|
if (staticUses > 0) {
|
|
3329
|
-
const grows = options.packageReferences === true && projectRoot !== void 0 && (_nullishCoalesce(_optionalChain([findFarmIslandContainers, 'call',
|
|
3472
|
+
const grows = options.packageReferences === true && projectRoot !== void 0 && (_nullishCoalesce(_optionalChain([findFarmIslandContainers, 'call', _202 => _202(_nullishCoalesce(content, () => ( "")), moduleSourcePath, localBindings), 'optionalAccess', _203 => _203.length]), () => ( 0))) > 0;
|
|
3330
3473
|
if (grows) visit(ensureFarmIslandContainerReference(projectRoot));
|
|
3331
3474
|
const container = grows ? void 0 : findParserSensitiveJsxContainer(content, localBindings);
|
|
3332
3475
|
if (container) {
|
|
@@ -3422,7 +3565,7 @@ function farmWorkspaceServerEntry(entry) {
|
|
|
3422
3565
|
function realpathOrSelf(file) {
|
|
3423
3566
|
try {
|
|
3424
3567
|
return _fs2.default.realpathSync(file);
|
|
3425
|
-
} catch (
|
|
3568
|
+
} catch (e41) {
|
|
3426
3569
|
return file;
|
|
3427
3570
|
}
|
|
3428
3571
|
}
|
|
@@ -3452,7 +3595,7 @@ function inspectPackageClientBoundary(resolvedPath, root, visited) {
|
|
|
3452
3595
|
}
|
|
3453
3596
|
function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
|
|
3454
3597
|
if (!resolvedPath || visited.has(resolvedPath)) {
|
|
3455
|
-
if (resolvedPath) _optionalChain([trace2, 'optionalAccess',
|
|
3598
|
+
if (resolvedPath) _optionalChain([trace2, 'optionalAccess', _204 => _204.stop, 'call', _205 => _205(resolvedPath)]);
|
|
3456
3599
|
return {
|
|
3457
3600
|
isClientComponent: false,
|
|
3458
3601
|
shouldHydrate: false,
|
|
@@ -3460,7 +3603,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
|
|
|
3460
3603
|
};
|
|
3461
3604
|
}
|
|
3462
3605
|
visited.add(resolvedPath);
|
|
3463
|
-
_optionalChain([trace2, 'optionalAccess',
|
|
3606
|
+
_optionalChain([trace2, 'optionalAccess', _206 => _206.visit, 'call', _207 => _207(resolvedPath)]);
|
|
3464
3607
|
const content = readIfExists(resolvedPath);
|
|
3465
3608
|
const parsed = parseClientModuleMetadata(content, false);
|
|
3466
3609
|
let importsClientBoundary = false;
|
|
@@ -3518,7 +3661,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3518
3661
|
braceDepth = Math.max(0, braceDepth - 1);
|
|
3519
3662
|
continue;
|
|
3520
3663
|
}
|
|
3521
|
-
if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access',
|
|
3664
|
+
if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _208 => _208[index - 1], 'optionalAccess', _209 => _209.value]) !== "." && _optionalChain([tokens, 'access', _210 => _210[index + 1], 'optionalAccess', _211 => _211.value]) === "(" && _optionalChain([tokens, 'access', _212 => _212[index + 2], 'optionalAccess', _213 => _213.kind]) === "string") {
|
|
3522
3665
|
matches.add(tokens[index + 2].value);
|
|
3523
3666
|
continue;
|
|
3524
3667
|
}
|
|
@@ -3528,7 +3671,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3528
3671
|
}
|
|
3529
3672
|
if (reexportsOnly && keyword.value !== "export") continue;
|
|
3530
3673
|
const previous = tokens[index - 1];
|
|
3531
|
-
if (_optionalChain([previous, 'optionalAccess',
|
|
3674
|
+
if (_optionalChain([previous, 'optionalAccess', _214 => _214.value]) === ".") continue;
|
|
3532
3675
|
const first = tokens[index + 1];
|
|
3533
3676
|
if (!first || first.value === "type" || first.value === "(" || first.value === ".") {
|
|
3534
3677
|
continue;
|
|
@@ -3544,7 +3687,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3544
3687
|
for (let cursor = index + 1; cursor < tokens.length; cursor++) {
|
|
3545
3688
|
const token = tokens[cursor];
|
|
3546
3689
|
if (token.value === ";") break;
|
|
3547
|
-
if (token.value === "from" && _optionalChain([tokens, 'access',
|
|
3690
|
+
if (token.value === "from" && _optionalChain([tokens, 'access', _215 => _215[cursor + 1], 'optionalAccess', _216 => _216.kind]) === "string") {
|
|
3548
3691
|
fromIndex = cursor;
|
|
3549
3692
|
break;
|
|
3550
3693
|
}
|
|
@@ -3562,14 +3705,14 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3562
3705
|
return Array.from(matches);
|
|
3563
3706
|
}
|
|
3564
3707
|
function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
|
|
3565
|
-
if (_optionalChain([tokens, 'access',
|
|
3708
|
+
if (_optionalChain([tokens, 'access', _217 => _217[startIndex], 'optionalAccess', _218 => _218.value]) !== "{") return false;
|
|
3566
3709
|
const closingBraceIndex = tokens.findIndex(
|
|
3567
3710
|
(token, index) => index > startIndex && index < endIndex && token.value === "}"
|
|
3568
3711
|
);
|
|
3569
3712
|
if (closingBraceIndex === -1) return false;
|
|
3570
3713
|
let entryStartsAt = startIndex + 1;
|
|
3571
3714
|
for (let index = entryStartsAt; index <= closingBraceIndex; index++) {
|
|
3572
|
-
if (index !== closingBraceIndex && _optionalChain([tokens, 'access',
|
|
3715
|
+
if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _219 => _219[index], 'optionalAccess', _220 => _220.value]) !== ",") continue;
|
|
3573
3716
|
const entry = tokens.slice(entryStartsAt, index);
|
|
3574
3717
|
if (entry.length > 0 && entry[0].value !== "type") return false;
|
|
3575
3718
|
entryStartsAt = index + 1;
|
|
@@ -3609,7 +3752,7 @@ function warnUnresolvedAliasImport(importerPath, specifier, root) {
|
|
|
3609
3752
|
if (!ALIAS_IMPORT.test(specifier) || warnedUnresolvedAliasImports.has(specifier)) return;
|
|
3610
3753
|
warnedUnresolvedAliasImports.add(specifier);
|
|
3611
3754
|
const importer = root ? _path2.default.relative(root, importerPath) : importerPath;
|
|
3612
|
-
|
|
3755
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
3613
3756
|
`Could not resolve "${specifier}" (imported by ${importer}) while checking which pages need client JavaScript. If it holds client components, they will not hydrate. Map the alias in tsconfig.json "paths" or package.json "imports".`
|
|
3614
3757
|
);
|
|
3615
3758
|
}
|
|
@@ -3643,14 +3786,14 @@ function getProjectImportAliases(projectRoot) {
|
|
|
3643
3786
|
const stamp = PROJECT_ALIAS_FILES.map((file) => {
|
|
3644
3787
|
try {
|
|
3645
3788
|
return String(_fs2.default.statSync(_path2.default.join(projectRoot, file)).mtimeMs);
|
|
3646
|
-
} catch (
|
|
3789
|
+
} catch (e42) {
|
|
3647
3790
|
return "-";
|
|
3648
3791
|
}
|
|
3649
3792
|
}).join(":");
|
|
3650
3793
|
const sourceDir = _chunkRE5E2G5Scjs.getFarmProjectSourceDir.call(void 0, projectRoot);
|
|
3651
3794
|
const cacheStamp = `${stamp}:${sourceDir}`;
|
|
3652
3795
|
const cached = projectImportAliasCache.get(projectRoot);
|
|
3653
|
-
if (_optionalChain([cached, 'optionalAccess',
|
|
3796
|
+
if (_optionalChain([cached, 'optionalAccess', _221 => _221.stamp]) === cacheStamp) return cached.aliases;
|
|
3654
3797
|
const aliases = [
|
|
3655
3798
|
...readTsconfigPathAliases(projectRoot),
|
|
3656
3799
|
...readPackageImportAliases(projectRoot)
|
|
@@ -3671,7 +3814,7 @@ function readTsconfigPathAliases(projectRoot) {
|
|
|
3671
3814
|
const configPath = _path2.default.join(projectRoot, name);
|
|
3672
3815
|
if (!_fs2.default.existsSync(configPath)) continue;
|
|
3673
3816
|
const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
|
|
3674
|
-
if (!_optionalChain([resolved, 'optionalAccess',
|
|
3817
|
+
if (!_optionalChain([resolved, 'optionalAccess', _222 => _222.paths])) return [];
|
|
3675
3818
|
const base2 = _nullishCoalesce(resolved.baseUrl, () => ( resolved.pathsDirectory));
|
|
3676
3819
|
return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
|
|
3677
3820
|
if (!Array.isArray(targets)) return [];
|
|
@@ -3706,18 +3849,18 @@ function readTsconfigPaths(configPath, visited) {
|
|
|
3706
3849
|
inherited = _nullishCoalesce(readTsconfigPaths(parentPath, visited), () => ( inherited));
|
|
3707
3850
|
}
|
|
3708
3851
|
const options = _nullishCoalesce(config.compilerOptions, () => ( {}));
|
|
3709
|
-
const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess',
|
|
3852
|
+
const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _223 => _223.baseUrl]);
|
|
3710
3853
|
if (options.paths && typeof options.paths === "object") {
|
|
3711
3854
|
return { paths: options.paths, pathsDirectory: directory, baseUrl };
|
|
3712
3855
|
}
|
|
3713
3856
|
return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
|
|
3714
3857
|
}
|
|
3715
3858
|
function readPackageImportAliases(projectRoot) {
|
|
3716
|
-
const imports = _optionalChain([readPackageJson, 'call',
|
|
3859
|
+
const imports = _optionalChain([readPackageJson, 'call', _224 => _224(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _225 => _225.imports]);
|
|
3717
3860
|
if (!imports || typeof imports !== "object") return [];
|
|
3718
3861
|
return Object.entries(imports).flatMap(([pattern, value]) => {
|
|
3719
3862
|
const target = resolveConditionalExportTarget(value);
|
|
3720
|
-
if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess',
|
|
3863
|
+
if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _226 => _226.startsWith, 'call', _227 => _227("./")])) return [];
|
|
3721
3864
|
const wildcardIndex = pattern.indexOf("*");
|
|
3722
3865
|
return [
|
|
3723
3866
|
{
|
|
@@ -3733,7 +3876,7 @@ function readJsonWithComments(filePath) {
|
|
|
3733
3876
|
let source;
|
|
3734
3877
|
try {
|
|
3735
3878
|
source = _fs2.default.readFileSync(filePath, "utf8");
|
|
3736
|
-
} catch (
|
|
3879
|
+
} catch (e43) {
|
|
3737
3880
|
return null;
|
|
3738
3881
|
}
|
|
3739
3882
|
let output = "";
|
|
@@ -3761,7 +3904,7 @@ function readJsonWithComments(filePath) {
|
|
|
3761
3904
|
}
|
|
3762
3905
|
try {
|
|
3763
3906
|
return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
|
|
3764
|
-
} catch (
|
|
3907
|
+
} catch (e44) {
|
|
3765
3908
|
return null;
|
|
3766
3909
|
}
|
|
3767
3910
|
}
|
|
@@ -3783,15 +3926,15 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
|
|
|
3783
3926
|
const packageJsonPath = _path2.default.join(packageDirectory, "package.json");
|
|
3784
3927
|
const packageJson = readPackageJson(packageJsonPath);
|
|
3785
3928
|
const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
|
|
3786
|
-
const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess',
|
|
3929
|
+
const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _228 => _228.exports]), exportKey);
|
|
3787
3930
|
const candidates = /* @__PURE__ */ new Set();
|
|
3788
|
-
if (_optionalChain([exportTarget, 'optionalAccess',
|
|
3931
|
+
if (_optionalChain([exportTarget, 'optionalAccess', _229 => _229.startsWith, 'call', _230 => _230("./")])) {
|
|
3789
3932
|
candidates.add(_path2.default.resolve(packageDirectory, exportTarget));
|
|
3790
3933
|
}
|
|
3791
3934
|
if (packageSubpath) {
|
|
3792
3935
|
candidates.add(_path2.default.join(packageDirectory, packageSubpath));
|
|
3793
3936
|
} else {
|
|
3794
|
-
for (const entry of [_optionalChain([packageJson, 'optionalAccess',
|
|
3937
|
+
for (const entry of [_optionalChain([packageJson, 'optionalAccess', _231 => _231.browser]), _optionalChain([packageJson, 'optionalAccess', _232 => _232.module]), _optionalChain([packageJson, 'optionalAccess', _233 => _233.main])]) {
|
|
3795
3938
|
if (typeof entry === "string") candidates.add(_path2.default.resolve(packageDirectory, entry));
|
|
3796
3939
|
}
|
|
3797
3940
|
candidates.add(_path2.default.join(packageDirectory, "index"));
|
|
@@ -3827,7 +3970,7 @@ function findPackageDirectory2(importerPath, packageName, root) {
|
|
|
3827
3970
|
function readPackageJson(packageJsonPath) {
|
|
3828
3971
|
try {
|
|
3829
3972
|
return JSON.parse(_fs2.default.readFileSync(packageJsonPath, "utf8"));
|
|
3830
|
-
} catch (
|
|
3973
|
+
} catch (e45) {
|
|
3831
3974
|
return null;
|
|
3832
3975
|
}
|
|
3833
3976
|
}
|
|
@@ -3856,7 +3999,7 @@ function resolvePackageExport(exportsField, exportKey) {
|
|
|
3856
3999
|
if (!exportKey.startsWith(prefix) || !exportKey.endsWith(suffix)) continue;
|
|
3857
4000
|
const wildcard = exportKey.slice(prefix.length, exportKey.length - suffix.length);
|
|
3858
4001
|
const target = resolveConditionalExportTarget(value);
|
|
3859
|
-
return _nullishCoalesce(_optionalChain([target, 'optionalAccess',
|
|
4002
|
+
return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _234 => _234.replace, 'call', _235 => _235("*", wildcard)]), () => ( null));
|
|
3860
4003
|
}
|
|
3861
4004
|
return null;
|
|
3862
4005
|
}
|
|
@@ -3882,15 +4025,25 @@ function resolveConditionalExportTarget(value) {
|
|
|
3882
4025
|
}
|
|
3883
4026
|
function resolveSourceCandidate(candidates) {
|
|
3884
4027
|
for (const candidate of candidates) {
|
|
3885
|
-
const
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
4028
|
+
const resolved = memoizeInFarmSourceSnapshot(
|
|
4029
|
+
"source-candidate",
|
|
4030
|
+
farmSourceSnapshotPathKey(candidate),
|
|
4031
|
+
() => resolveSourceCandidatePath(candidate),
|
|
4032
|
+
(result) => result !== null
|
|
4033
|
+
);
|
|
4034
|
+
if (resolved) return resolved;
|
|
4035
|
+
}
|
|
4036
|
+
return null;
|
|
4037
|
+
}
|
|
4038
|
+
function resolveSourceCandidatePath(candidate) {
|
|
4039
|
+
const paths = [candidate];
|
|
4040
|
+
for (const extension of RESOLVABLE_SOURCE_EXTENSIONS) {
|
|
4041
|
+
paths.push(`${candidate}${extension}`, _path2.default.join(candidate, `index${extension}`));
|
|
4042
|
+
}
|
|
4043
|
+
for (const sourcePath of paths) {
|
|
4044
|
+
try {
|
|
4045
|
+
if (_optionalChain([_fs2.default, 'access', _236 => _236.statSync, 'call', _237 => _237(sourcePath, { throwIfNoEntry: false }), 'optionalAccess', _238 => _238.isFile, 'call', _239 => _239()])) return sourcePath;
|
|
4046
|
+
} catch (e46) {
|
|
3894
4047
|
}
|
|
3895
4048
|
}
|
|
3896
4049
|
return null;
|
|
@@ -3932,7 +4085,7 @@ function scanFarmPackageImports(directory, root) {
|
|
|
3932
4085
|
let entries;
|
|
3933
4086
|
try {
|
|
3934
4087
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
3935
|
-
} catch (
|
|
4088
|
+
} catch (e47) {
|
|
3936
4089
|
return;
|
|
3937
4090
|
}
|
|
3938
4091
|
for (const entry of entries) {
|
|
@@ -3965,7 +4118,7 @@ function collectFarmServerBundledPackageInfo(directory) {
|
|
|
3965
4118
|
let entries;
|
|
3966
4119
|
try {
|
|
3967
4120
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
3968
|
-
} catch (
|
|
4121
|
+
} catch (e48) {
|
|
3969
4122
|
return;
|
|
3970
4123
|
}
|
|
3971
4124
|
for (const entry of entries) {
|
|
@@ -4004,7 +4157,7 @@ function getFarmClientReachableModules(directory, root) {
|
|
|
4004
4157
|
let entries;
|
|
4005
4158
|
try {
|
|
4006
4159
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
4007
|
-
} catch (
|
|
4160
|
+
} catch (e49) {
|
|
4008
4161
|
return;
|
|
4009
4162
|
}
|
|
4010
4163
|
for (const entry of entries) {
|
|
@@ -4107,13 +4260,13 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4107
4260
|
let projectRoot = process.cwd();
|
|
4108
4261
|
let sources;
|
|
4109
4262
|
const routeSourceFiles = () => {
|
|
4110
|
-
const clientRoutes = _optionalChain([farmApi, 'optionalAccess',
|
|
4111
|
-
if (_optionalChain([sources, 'optionalAccess',
|
|
4263
|
+
const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _240 => _240.getProgrammaticClientRoutes, 'call', _241 => _241()]);
|
|
4264
|
+
if (_optionalChain([sources, 'optionalAccess', _242 => _242.for]) !== clientRoutes || !sources) {
|
|
4112
4265
|
sources = {
|
|
4113
4266
|
for: clientRoutes,
|
|
4114
4267
|
files: /* @__PURE__ */ new Set([
|
|
4115
4268
|
...routesFiles,
|
|
4116
|
-
...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess',
|
|
4269
|
+
...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _243 => _243.routeSourceFiles]), () => ( []))].map(resolvedFile)
|
|
4117
4270
|
])
|
|
4118
4271
|
};
|
|
4119
4272
|
}
|
|
@@ -4134,11 +4287,11 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4134
4287
|
configResolved(config) {
|
|
4135
4288
|
isBuild = config.command === "build";
|
|
4136
4289
|
projectRoot = config.root;
|
|
4137
|
-
farmApi = _optionalChain([config, 'access',
|
|
4290
|
+
farmApi = _optionalChain([config, 'access', _244 => _244.plugins, 'access', _245 => _245.find, 'call', _246 => _246((plugin) => plugin.name === "farm"), 'optionalAccess', _247 => _247.api]);
|
|
4138
4291
|
sources = void 0;
|
|
4139
4292
|
routesFiles = new Set(
|
|
4140
4293
|
_chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
|
|
4141
|
-
(source) =>
|
|
4294
|
+
(source) => _chunkYUCU6XB4cjs.PROGRAMMATIC_ROUTE_FILE_NAMES.map(
|
|
4142
4295
|
(name) => resolvedFile(_path2.default.resolve(source.root, source.srcDir, name))
|
|
4143
4296
|
)
|
|
4144
4297
|
)
|
|
@@ -4147,14 +4300,14 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4147
4300
|
transform(code, id, transformOptions) {
|
|
4148
4301
|
const environment = resolveBuildEnvironment(
|
|
4149
4302
|
this,
|
|
4150
|
-
_optionalChain([transformOptions, 'optionalAccess',
|
|
4303
|
+
_optionalChain([transformOptions, 'optionalAccess', _248 => _248.ssr])
|
|
4151
4304
|
);
|
|
4152
4305
|
const parse3 = (source) => this.parse(source);
|
|
4153
4306
|
const result = transformEnvironmentFunctions({ code, id, environment, parse: parse3 });
|
|
4154
|
-
if (environment === "client" && !isBuild && !
|
|
4307
|
+
if (environment === "client" && !isBuild && !_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
|
|
4155
4308
|
this.error(routeSourceError(moduleFile(id)));
|
|
4156
4309
|
}
|
|
4157
|
-
if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access',
|
|
4310
|
+
if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _249 => _249.experimental, 'optionalAccess', _250 => _250.serverComponents])) === "islands" && isApplicationScript(id)) {
|
|
4158
4311
|
const file = id.split("?", 1)[0];
|
|
4159
4312
|
const root = _fs.realpathSync.call(void 0, _nullishCoalesce(options.root, () => ( projectRoot)));
|
|
4160
4313
|
const clientCode = getFarmClientReachableModules(root, root).has(_path2.default.resolve(file)) || _fs.existsSync.call(void 0, file) && hasUseClientDirective(_fs.readFileSync.call(void 0, file, "utf8"));
|
|
@@ -4186,9 +4339,9 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4186
4339
|
if (resolveBuildEnvironment(context, false) !== "client") return;
|
|
4187
4340
|
const forbidden = routeSourceFiles();
|
|
4188
4341
|
for (const id of this.getModuleIds()) {
|
|
4189
|
-
if (
|
|
4342
|
+
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4190
4343
|
const chain = findClientNodeBuiltinChain(id, (moduleId) => {
|
|
4191
|
-
return _optionalChain([this, 'access',
|
|
4344
|
+
return _optionalChain([this, 'access', _251 => _251.getModuleInfo, 'call', _252 => _252(moduleId), 'optionalAccess', _253 => _253.importedIds]);
|
|
4192
4345
|
});
|
|
4193
4346
|
if (chain) {
|
|
4194
4347
|
this.error(
|
|
@@ -4206,8 +4359,8 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4206
4359
|
}
|
|
4207
4360
|
if (!forbidden.has(moduleFile(id))) continue;
|
|
4208
4361
|
const info = this.getModuleInfo(id);
|
|
4209
|
-
if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess',
|
|
4210
|
-
this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess',
|
|
4362
|
+
if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _254 => _254.code]))) continue;
|
|
4363
|
+
this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _255 => _255.importers, 'access', _256 => _256.map, 'call', _257 => _257(moduleFile)])));
|
|
4211
4364
|
}
|
|
4212
4365
|
}
|
|
4213
4366
|
};
|
|
@@ -4221,13 +4374,13 @@ function moduleFile(id) {
|
|
|
4221
4374
|
function resolvedFile(filePath) {
|
|
4222
4375
|
try {
|
|
4223
4376
|
return moduleFile(_fs.realpathSync.call(void 0, filePath));
|
|
4224
|
-
} catch (
|
|
4377
|
+
} catch (e50) {
|
|
4225
4378
|
return moduleFile(filePath);
|
|
4226
4379
|
}
|
|
4227
4380
|
}
|
|
4228
4381
|
function resolveBuildEnvironment(context, ssr) {
|
|
4229
|
-
if (_optionalChain([context, 'access',
|
|
4230
|
-
if (_optionalChain([context, 'access',
|
|
4382
|
+
if (_optionalChain([context, 'access', _258 => _258.environment, 'optionalAccess', _259 => _259.name]) === "client") return "client";
|
|
4383
|
+
if (_optionalChain([context, 'access', _260 => _260.environment, 'optionalAccess', _261 => _261.name]) === "rsc" || _optionalChain([context, 'access', _262 => _262.environment, 'optionalAccess', _263 => _263.name]) === "ssr") {
|
|
4231
4384
|
return "server";
|
|
4232
4385
|
}
|
|
4233
4386
|
return ssr ? "server" : "client";
|
|
@@ -4547,4 +4700,8 @@ function transformError(id, message) {
|
|
|
4547
4700
|
|
|
4548
4701
|
|
|
4549
4702
|
|
|
4550
|
-
|
|
4703
|
+
|
|
4704
|
+
|
|
4705
|
+
|
|
4706
|
+
|
|
4707
|
+
exports.FARM_BROWSER_BUILTIN_PREFIX = FARM_BROWSER_BUILTIN_PREFIX; exports.resolveFarmBrowserBuiltin = resolveFarmBrowserBuiltin; exports.loadFarmBrowserBuiltin = loadFarmBrowserBuiltin; exports.farmBrowserBuiltinsOptimizerPlugin = farmBrowserBuiltinsOptimizerPlugin; exports.programmaticClientRouteKey = programmaticClientRouteKey; exports.resolveProgrammaticClientRoutes = resolveProgrammaticClientRoutes; exports.createEvaluatedRouteGraph = createEvaluatedRouteGraph; exports.mergeProgrammaticClientRoutes = mergeProgrammaticClientRoutes; exports.generateProgrammaticClientRouteModule = generateProgrammaticClientRouteModule; exports.getFarmSourceStamp = getFarmSourceStamp; exports.FarmSourceSnapshotStore = FarmSourceSnapshotStore; exports.withFarmSourceSnapshot = withFarmSourceSnapshot; exports.withFarmSourceSnapshotOf = withFarmSourceSnapshotOf; exports.memoizeInFarmSourceSnapshot = memoizeInFarmSourceSnapshot; exports.noteFarmSourceRead = noteFarmSourceRead; exports.traceFarmSourceReads = traceFarmSourceReads; exports.rewriteFarmReactServerClientModuleImports = rewriteFarmReactServerClientModuleImports; exports.rewriteFarmReactServerImports = rewriteFarmReactServerImports; exports.invalidateFarmClientOnlyScan = invalidateFarmClientOnlyScan; exports.farmRelativeImportFiles = farmRelativeImportFiles; exports.usePackageScanCacheFile = usePackageScanCacheFile; exports.persistPackageScanCache = persistPackageScanCache; exports.FARM_CLIENT_REFERENCE_PRAGMA = FARM_CLIENT_REFERENCE_PRAGMA; exports.FARM_CLIENT_REFERENCE_DIRECTORY = FARM_CLIENT_REFERENCE_DIRECTORY; exports.FARM_RESOLVE_FROM_PREFIX = FARM_RESOLVE_FROM_PREFIX; exports.parseFarmResolveFrom = parseFarmResolveFrom; exports.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.farmIslandContainerReferencePath = farmIslandContainerReferencePath; exports.ensureFarmIslandContainerReference = ensureFarmIslandContainerReference; exports.wrapFarmIslandContainers = wrapFarmIslandContainers; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.runWithLatestPackageClientBoundaryCache = runWithLatestPackageClientBoundaryCache; exports.dropLatestPackageClientBoundaryCache = dropLatestPackageClientBoundaryCache; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; exports.getFarmClientRenderingBindings = getFarmClientRenderingBindings; exports.collectFarmRenderedClientModules = collectFarmRenderedClientModules; exports.collectFarmServerStylesheets = collectFarmServerStylesheets; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlanKey = getClientModuleHydrationPlanKey; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.usesFarmServerTree = usesFarmServerTree; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.isIsolatableClientBoundarySource = isIsolatableClientBoundarySource; exports.isFarmClientModulePlanUnchanged = isFarmClientModulePlanUnchanged; exports.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackageInfo = collectFarmServerBundledPackageInfo; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.createFarmDiagnostic = createFarmDiagnostic; exports.formatFarmDiagnostic = formatFarmDiagnostic; exports.createFarmSourceLocator = createFarmSourceLocator; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;
|