@farm.js/core 0.1.73 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-handler-VBCA3WZ6.cjs → agent-mcp-handler-73SGWVZT.cjs} +9 -9
- package/dist/{agent-mcp-handler-RK7LDYEL.mjs → agent-mcp-handler-PJKZHYSA.mjs} +8 -8
- package/dist/{agent-mcp.d-D_gHjCAE.d.ts → agent-mcp.d-Djvao5eV.d.ts} +24 -2
- package/dist/{agent-mcp.d-PvEf-1mi.d.mts → agent-mcp.d-wA13pwmS.d.mts} +24 -2
- package/dist/agent-runtime.cjs +9 -9
- package/dist/agent-runtime.d.mts +4 -4
- package/dist/agent-runtime.d.ts +4 -4
- package/dist/agent-runtime.mjs +8 -8
- package/dist/analyzer-23GCBYFI.cjs +16 -0
- package/dist/{analyzer-MFYCJT75.mjs → analyzer-LJHMFCDW.mjs} +2 -2
- package/dist/api/client.cjs +4 -4
- package/dist/api/client.d.mts +3 -3
- package/dist/api/client.d.ts +3 -3
- package/dist/api/client.mjs +3 -3
- package/dist/api/client.native.cjs +6 -6
- package/dist/api/client.native.d.mts +4 -4
- package/dist/api/client.native.d.ts +4 -4
- package/dist/api/client.native.mjs +3 -3
- package/dist/api/node.cjs +14 -13
- package/dist/api/node.d.mts +6 -6
- package/dist/api/node.d.ts +6 -6
- package/dist/api/node.mjs +13 -12
- package/dist/api/route-manager.cjs +23 -21
- package/dist/api/route-manager.d.mts +9 -7
- package/dist/api/route-manager.d.ts +9 -7
- package/dist/api/route-manager.mjs +22 -20
- package/dist/api/runtime.cjs +13 -12
- package/dist/api/runtime.d.mts +5 -5
- package/dist/api/runtime.d.ts +5 -5
- package/dist/api/runtime.mjs +12 -11
- package/dist/{api-client.d-Bp35zMqR.d.mts → api-client.d-CyVmI4Di.d.mts} +2 -2
- package/dist/{api-client.d-CFI_xL0V.d.ts → api-client.d-DrTM7BdH.d.ts} +2 -2
- package/dist/api.cjs +26 -24
- package/dist/api.d.mts +9 -9
- package/dist/api.d.ts +9 -9
- package/dist/api.mjs +25 -23
- package/dist/{app-manifest.d-BpVTg43i.d.ts → app-manifest.d-BukcP_EV.d.ts} +10 -1
- package/dist/{app-manifest.d-CN7cEWHX.d.mts → app-manifest.d-DIuqSi9k.d.mts} +10 -1
- package/dist/app-markdown.cjs +11 -7
- package/dist/app-markdown.d.mts +6 -6
- package/dist/app-markdown.d.ts +6 -6
- package/dist/app-markdown.mjs +10 -6
- package/dist/{app.d-DO4PTCWm.d.ts → app.d-BQqmM6Gy.d.ts} +55 -4
- package/dist/{app.d-BFWzAdTe.d.mts → app.d-YVuFb10p.d.mts} +55 -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 +22 -1
- package/dist/cache.d.ts +22 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-JYNNIGQO.cjs → chunk-25JGHAGH.cjs} +11 -1
- package/dist/{chunk-GWXZS7K5.mjs → chunk-2LKUR5QJ.mjs} +1 -1
- package/dist/{chunk-Z3IN6GEX.mjs → chunk-2NQ3S2SJ.mjs} +69 -12
- package/dist/chunk-2PJVEL56.cjs +90 -0
- package/dist/{chunk-HDPT6OYE.cjs → chunk-2RSVYJT6.cjs} +28 -4
- package/dist/{chunk-HGB4PM2C.cjs → chunk-2YJ4DHTD.cjs} +104 -32
- package/dist/{chunk-MGZVDX4R.mjs → chunk-3AJQFVWW.mjs} +3 -3
- package/dist/{chunk-E3HDJCWF.mjs → chunk-3GMD2E4Q.mjs} +3 -3
- package/dist/{chunk-JWY66PID.cjs → chunk-42EUEYW6.cjs} +21 -13
- package/dist/{chunk-255J7K4X.mjs → chunk-47R7CX4A.mjs} +6 -6
- package/dist/chunk-4PWGLPL6.mjs +284 -0
- package/dist/{chunk-7S7AAK2D.mjs → chunk-4QBFYEDC.mjs} +2 -1
- package/dist/{chunk-6O6PAZZR.mjs → chunk-4T2RB4JA.mjs} +5 -5
- package/dist/{chunk-XGTFLG73.cjs → chunk-4VLXQ55O.cjs} +37 -25
- package/dist/{chunk-KTDG4THT.cjs → chunk-4ZSZI6XL.cjs} +17 -17
- package/dist/{chunk-XGJVRPYL.cjs → chunk-52LTENRE.cjs} +3 -3
- package/dist/{chunk-QIXEU2WV.cjs → chunk-5AMH6AFA.cjs} +5 -3
- package/dist/{chunk-AYP2YFVN.mjs → chunk-5KAEGBIL.mjs} +75 -42
- package/dist/{chunk-WW3LRNQV.mjs → chunk-5O3SK3ZC.mjs} +5 -5
- package/dist/{chunk-GPO3LJDJ.cjs → chunk-5QZT2EQN.cjs} +2 -2
- package/dist/{chunk-RLFGKJQ6.mjs → chunk-5WFPZG7K.mjs} +20 -8
- package/dist/chunk-5XD2ULJG.mjs +114 -0
- package/dist/{chunk-4HGLJOXZ.cjs → chunk-62DZHPDK.cjs} +16 -11
- package/dist/{chunk-YXIQYWOK.cjs → chunk-63EFR2WF.cjs} +27 -8
- package/dist/{chunk-2RCCFB2Y.cjs → chunk-6B44ZU5P.cjs} +11 -11
- package/dist/{chunk-HFUOLILA.cjs → chunk-6D3CJFNU.cjs} +37 -21
- package/dist/{chunk-JX5VOLAV.cjs → chunk-6DBBMQWT.cjs} +38 -38
- package/dist/{chunk-FRO4BB2T.mjs → chunk-6MATGOEF.mjs} +1 -1
- package/dist/{chunk-CLEWORVY.cjs → chunk-7564NP5Z.cjs} +40 -43
- 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-ICFPTHXM.mjs → chunk-7FQFK3OA.mjs} +7 -3
- 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-GJEC5S4V.mjs → chunk-7VCLTNED.mjs} +1 -1
- package/dist/chunk-A3LNXQJJ.cjs +265 -0
- package/dist/{chunk-IBVN7SW5.mjs → chunk-A5F55ZFA.mjs} +472 -143
- 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-OIP62QEL.mjs → chunk-BGUTIQII.mjs} +24 -9
- package/dist/{chunk-DMAP4RND.cjs → chunk-BNCKXPCU.cjs} +98 -16
- package/dist/{chunk-TDCP3Z4T.cjs → chunk-BNTRXJL4.cjs} +3 -3
- package/dist/{chunk-BPAXGCKX.mjs → chunk-BRNPLD22.mjs} +30 -17
- package/dist/{chunk-JZGL2PIH.mjs → chunk-CDT7CGQT.mjs} +2 -2
- package/dist/{chunk-FEFCISOX.cjs → chunk-CEVXKJKF.cjs} +2 -2
- package/dist/{chunk-YZLEOMMA.mjs → chunk-CF74ABRI.mjs} +10 -10
- package/dist/chunk-CIY74JLV.cjs +134 -0
- package/dist/{chunk-FETMUBIA.mjs → chunk-CLM73YYD.mjs} +2 -2
- package/dist/{chunk-ME7RVELR.mjs → chunk-CSAIIMY3.mjs} +21 -2
- package/dist/{chunk-YAEN3L2F.cjs → chunk-CYNQPKA4.cjs} +23 -4
- package/dist/{chunk-M53MIIXY.mjs → chunk-CZOXZ6WQ.mjs} +1 -1
- package/dist/{chunk-Y2LU4LE5.mjs → chunk-DASQJ5UD.mjs} +2 -2
- package/dist/{chunk-WVQNXXNE.cjs → chunk-DD22NQFX.cjs} +2 -2
- package/dist/{chunk-OBYM5S5G.mjs → chunk-DUSTJ6A5.mjs} +20 -17
- package/dist/{chunk-ZFEJ2SF2.cjs → chunk-DZ3AZ7UK.cjs} +52 -52
- package/dist/{chunk-6YFC3ZFX.mjs → chunk-DZXD6CYJ.mjs} +1 -1
- package/dist/{chunk-AZ6IW6SF.mjs → chunk-EMTN5ABC.mjs} +1 -1
- package/dist/{chunk-AQIO3RNL.mjs → chunk-ERT6HQAI.mjs} +8 -3
- package/dist/{chunk-JDO346NV.mjs → chunk-F35C3TJZ.mjs} +1 -1
- package/dist/{chunk-ODBM54RT.cjs → chunk-F4ID7BGO.cjs} +33 -30
- package/dist/{chunk-C7GJDVN4.mjs → chunk-F7MJWW6A.mjs} +1 -1
- package/dist/{chunk-5OFNUETM.mjs → chunk-FCAYYLAE.mjs} +27 -3
- 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-IHTDLCDJ.cjs → chunk-G7B6NU4X.cjs} +23 -10
- package/dist/{chunk-JZQS3ZOI.mjs → chunk-GAAK3HDZ.mjs} +36 -7
- package/dist/{chunk-QMNWKQL4.cjs → chunk-GC5ROI3A.cjs} +4 -4
- package/dist/{chunk-JXIYH2NO.cjs → chunk-GCJ4GNMC.cjs} +4 -4
- package/dist/{chunk-WX63N6C5.mjs → chunk-GFXKO4UW.mjs} +106 -37
- package/dist/{chunk-CYRIIVD4.mjs → chunk-GLF44JKY.mjs} +3 -3
- package/dist/{chunk-GUZC226X.mjs → chunk-GLVDXRG2.mjs} +1 -1
- package/dist/{chunk-GZOKWJIW.mjs → chunk-GNY7BO7R.mjs} +18 -11
- package/dist/{chunk-OWQV6MLM.cjs → chunk-GYJT2U7J.cjs} +2 -1
- package/dist/{chunk-MBCRWU3P.cjs → chunk-H7OFZJCV.cjs} +8 -8
- package/dist/{chunk-JMOCMXTQ.mjs → chunk-H7QY7ZE4.mjs} +1 -1
- package/dist/{chunk-5LOARKDP.cjs → chunk-HFJLMALC.cjs} +42 -30
- package/dist/{chunk-CROAFCMW.mjs → chunk-HONTCUK6.mjs} +1 -1
- package/dist/{chunk-7PJARAQQ.mjs → chunk-HQ2VAJLW.mjs} +1 -1
- package/dist/{chunk-SVQX5HYW.mjs → chunk-HT2SZKXG.mjs} +92 -10
- package/dist/{chunk-7GMBETHM.mjs → chunk-HV2WZFUW.mjs} +1 -1
- package/dist/{chunk-DMXMIE2C.cjs → chunk-HVJ7IACB.cjs} +15 -7
- package/dist/{chunk-S7MWSFFP.cjs → chunk-IBEHVSU4.cjs} +2 -2
- package/dist/{chunk-QGCSUC5O.mjs → chunk-IDOUCM2X.mjs} +521 -296
- package/dist/{chunk-FN5UEC7I.mjs → chunk-IG2JE6WJ.mjs} +1 -1
- package/dist/{chunk-MQ4DYVFS.cjs → chunk-IIHZ2BEE.cjs} +3 -3
- package/dist/{chunk-TAU3OF5B.cjs → chunk-IK33N2AN.cjs} +1373 -694
- package/dist/{chunk-UVQRMUAR.cjs → chunk-IVBDRAOR.cjs} +1 -1
- package/dist/{chunk-2AFW7673.cjs → chunk-IXO6O2EL.cjs} +8 -7
- package/dist/{chunk-U7VH3Q5E.cjs → chunk-IYFBLWXU.cjs} +56 -25
- package/dist/{chunk-NDDRTFN4.mjs → chunk-J7EUGGTY.mjs} +2 -2
- package/dist/{chunk-UVZMSRHF.mjs → chunk-JA6RML7C.mjs} +3 -3
- package/dist/{chunk-CL52PD6D.cjs → chunk-JHZ6HULQ.cjs} +12 -9
- package/dist/{chunk-HTXKSREF.cjs → chunk-JNZDTE75.cjs} +532 -203
- package/dist/{chunk-VT25ERQK.mjs → chunk-JRBWBMP2.mjs} +24 -5
- package/dist/{chunk-4CTCSKAF.mjs → chunk-K6DXKHFE.mjs} +1 -1
- package/dist/{chunk-AXVRUDMB.cjs → chunk-K6PGK7DC.cjs} +2 -2
- package/dist/{chunk-TY5KCYDE.mjs → chunk-KHS3T3E5.mjs} +20 -8
- package/dist/{chunk-ILQ5DKYF.cjs → chunk-KPYQ32BA.cjs} +2 -2
- package/dist/{chunk-CSLHNBPS.cjs → chunk-KQS27YN7.cjs} +6 -6
- package/dist/{chunk-XI3OXOMK.mjs → chunk-KUXEII7V.mjs} +1 -1
- package/dist/{chunk-CA7DNRHO.cjs → chunk-L6E5BSNU.cjs} +3 -3
- package/dist/{chunk-VNBDN5W2.cjs → chunk-L7Y65BQU.cjs} +128 -59
- package/dist/{chunk-73K53YPP.mjs → chunk-LPXJEZJK.mjs} +30 -14
- package/dist/{chunk-B67CW2LM.mjs → chunk-LQBV2Y37.mjs} +34 -37
- package/dist/chunk-LQWIIBI2.cjs +86 -0
- package/dist/chunk-LXTYJ2HW.mjs +139 -0
- package/dist/{chunk-I4KPA2C6.mjs → chunk-MFU7SXAB.mjs} +10 -2
- package/dist/{chunk-YTVSWXEZ.cjs → chunk-ML4TOUZP.cjs} +76 -43
- package/dist/{chunk-E46NXBNJ.mjs → chunk-NLATR3T3.mjs} +12 -7
- package/dist/{chunk-OXNZUCHN.cjs → chunk-NPGXX7HN.cjs} +37 -37
- package/dist/chunk-NRWEY2CM.mjs +25 -0
- package/dist/{chunk-VPETSSWN.cjs → chunk-NSNQLBHR.cjs} +2 -2
- package/dist/chunk-NU5XLYRN.cjs +139 -0
- package/dist/chunk-NUWUEXUD.mjs +55 -0
- package/dist/{chunk-53EHWHT2.cjs → chunk-O4JYMU5N.cjs} +35 -22
- package/dist/{chunk-TNYC3TYP.mjs → chunk-O7JEFGUV.mjs} +2 -2
- package/dist/{chunk-62ZRA7XU.mjs → chunk-OCLCA3X3.mjs} +1 -1
- package/dist/{chunk-MJEKMT6B.mjs → chunk-OFIFRB62.mjs} +917 -238
- package/dist/{chunk-OB45EAQL.mjs → chunk-OVUU2RCQ.mjs} +4 -3
- package/dist/{chunk-YZK64PZT.cjs → chunk-OZARLCYQ.cjs} +1742 -898
- package/dist/{chunk-W44X6IC2.cjs → chunk-PBJ7MEOV.cjs} +13 -9
- package/dist/{chunk-2W4GNXGX.cjs → chunk-PBQGIA27.cjs} +2 -2
- package/dist/{chunk-B6RBJJ5G.mjs → chunk-PDACTAVX.mjs} +16 -3
- package/dist/{chunk-DQ2DI3Y7.mjs → chunk-PE2LEWXA.mjs} +6 -3
- package/dist/{chunk-LGR7565L.cjs → chunk-PG7J7XYT.cjs} +39 -24
- package/dist/{chunk-MMK4MZUN.mjs → chunk-PKXGFQZS.mjs} +1 -1
- package/dist/{chunk-YBY34UHB.mjs → chunk-PL7MCYYD.mjs} +47 -16
- package/dist/chunk-PWHF2C6A.mjs +134 -0
- package/dist/{chunk-DZHTNSQ5.cjs → chunk-Q2EKSSEG.cjs} +21 -21
- package/dist/{chunk-SPP3EZTJ.cjs → chunk-QDHR54S6.cjs} +139 -69
- package/dist/{chunk-REK6HZSU.mjs → chunk-QGYHE6VJ.mjs} +1565 -721
- package/dist/{chunk-ZOYKJBP5.cjs → chunk-QKW6DLDT.cjs} +2 -2
- package/dist/{chunk-Y5LEPEVH.mjs → chunk-QSLGE2ZC.mjs} +1 -1
- package/dist/{chunk-FSODPZRT.cjs → chunk-QUEYL2WM.cjs} +10 -10
- package/dist/{chunk-ZDAEHG2O.cjs → chunk-QYOAGT3E.cjs} +3 -3
- package/dist/{chunk-CPMME66W.mjs → chunk-R5X7FDOG.mjs} +73 -1
- package/dist/{chunk-O47W53D3.cjs → chunk-RDADQG5S.cjs} +7 -77
- package/dist/chunk-RDSHEHBA.mjs +82 -0
- package/dist/{chunk-C6CUUBY5.cjs → chunk-RHI67C2V.cjs} +5 -5
- package/dist/chunk-RK3YYUX6.cjs +114 -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-HY6IVQ54.mjs → chunk-S7QEQCVV.mjs} +2 -2
- package/dist/{chunk-EGIY4A7V.cjs → chunk-SFSTZ7TB.cjs} +8 -8
- package/dist/{chunk-4Z3YLMSW.cjs → chunk-SX535SU5.cjs} +12 -12
- package/dist/{chunk-NLBK37HI.cjs → chunk-SXXSQVKK.cjs} +4 -4
- package/dist/{chunk-JZBU7V4D.mjs → chunk-SYPEMXW2.mjs} +126 -56
- package/dist/{chunk-5CFHQ7HM.mjs → chunk-TFEODQLG.mjs} +1 -1
- package/dist/{chunk-3GNVIYPO.cjs → chunk-TZ2YPXLB.cjs} +7 -7
- package/dist/{chunk-OEL5EPOJ.mjs → chunk-UD6KTSJS.mjs} +6 -76
- package/dist/{chunk-2EVESLP3.mjs → chunk-UJIBSFUE.mjs} +4 -4
- package/dist/{chunk-QSTRBKHZ.mjs → chunk-UJWRXBVP.mjs} +2 -2
- package/dist/chunk-UNOXV37V.cjs +55 -0
- package/dist/{chunk-TXE4SAMV.mjs → chunk-UOE6ZZZP.mjs} +1 -1
- package/dist/{chunk-OAEDVXVE.mjs → chunk-URQW27KO.mjs} +14 -6
- package/dist/chunk-VDQZV6BX.mjs +17 -0
- package/dist/chunk-VJ6L7TII.cjs +284 -0
- package/dist/{chunk-TPYAYFMF.cjs → chunk-VJI2LWTL.cjs} +2 -2
- package/dist/chunk-VWIW47FW.cjs +25 -0
- package/dist/{chunk-CKQAQFF6.mjs → chunk-WGNGM6MJ.mjs} +2 -2
- package/dist/{chunk-ROCF6UQD.cjs → chunk-WHCNJVYU.cjs} +74 -17
- package/dist/{chunk-4YHGQDTT.cjs → chunk-WJ5CCQBM.cjs} +35 -28
- package/dist/chunk-WKVYF2B5.cjs +17 -0
- package/dist/{chunk-5PDMBWAF.cjs → chunk-WRWJ7IWT.cjs} +7 -7
- package/dist/{chunk-ACGBXN3U.cjs → chunk-WW62HKA2.cjs} +55 -26
- package/dist/{chunk-XVSBALOY.cjs → chunk-X3Y6JWJG.cjs} +3 -3
- package/dist/{chunk-PXAHSCR6.cjs → chunk-XGDI4OUB.cjs} +103 -21
- package/dist/{chunk-4P5634G6.cjs → chunk-XRFGOYXG.cjs} +16 -11
- 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-462MUII7.mjs → chunk-YCNKS6SD.mjs} +12 -12
- package/dist/{chunk-XUSJVHHD.cjs → chunk-YL7BKHYE.cjs} +935 -710
- package/dist/{chunk-7PPLTD3P.cjs → chunk-YN7G22MP.cjs} +6 -6
- package/dist/{chunk-TU6VAH4V.cjs → chunk-YRXPDKMM.cjs} +10 -10
- package/dist/{chunk-IXZSBO76.mjs → chunk-YSTKSZD2.mjs} +1 -1
- package/dist/{chunk-QDWMCFTH.mjs → chunk-YT2ZMLXK.mjs} +1 -1
- package/dist/{chunk-QEJWNXRI.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-SUQACHER.mjs → chunk-Z2FFLTF5.mjs} +3 -3
- package/dist/{chunk-JSDV2NUN.mjs → chunk-Z3QXQN4U.mjs} +1 -1
- package/dist/{chunk-EYPSKXO4.mjs → chunk-Z4IRG4RG.mjs} +96 -9
- package/dist/{chunk-GJ7QVFAG.mjs → chunk-ZEWWZJPZ.mjs} +3 -1
- package/dist/chunk-ZIAWO6BC.mjs +86 -0
- package/dist/{chunk-JWLRBDDC.cjs → chunk-ZIOFRBIU.cjs} +100 -13
- package/dist/{chunk-3OJNNCDL.cjs → chunk-ZNXU4E6A.cjs} +8 -8
- package/dist/{chunk-RLEALQEN.mjs → chunk-ZO6TOLHL.mjs} +87 -5
- package/dist/{chunk-KDOZORJD.cjs → chunk-ZPCZWEU3.cjs} +24 -24
- package/dist/{chunk-QKEZLYON.cjs → chunk-ZV76IQG7.cjs} +2 -2
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-component.d-C71rMuHF.d.mts → client-component.d-BeqVuqy2.d.mts} +80 -3
- package/dist/{client-component.d-sF-Znk0j.d.ts → client-component.d-CZ1NpHAY.d.ts} +80 -3
- package/dist/{client-plugins.d-B-Gd9mWR.d.mts → client-plugins.d-ChceYO9t.d.mts} +42 -8
- package/dist/{client-plugins.d-MFibjgBg.d.ts → client-plugins.d-D9kWC0QB.d.ts} +42 -8
- package/dist/client-plugins.d.mts +4 -4
- package/dist/client-plugins.d.ts +4 -4
- package/dist/client.cjs +17 -14
- package/dist/client.d.mts +11 -11
- package/dist/client.d.ts +11 -11
- package/dist/client.mjs +16 -13
- package/dist/config.d.mts +4 -4
- package/dist/config.d.ts +4 -4
- package/dist/cron.cjs +8 -4
- package/dist/cron.d.mts +11 -2
- package/dist/cron.d.ts +11 -2
- package/dist/cron.mjs +9 -5
- package/dist/desktop.d.mts +5 -5
- package/dist/desktop.d.ts +5 -5
- package/dist/{devtools-TDIJ6HVC.mjs → devtools-B3W3DLPG.mjs} +20 -19
- package/dist/{devtools-6K4QXFRL.cjs → devtools-T5I2WHRX.cjs} +22 -21
- package/dist/docs.cjs +29 -22
- package/dist/docs.d.mts +20 -6
- package/dist/docs.d.ts +20 -6
- package/dist/docs.mjs +28 -21
- package/dist/{endpoint.d-BkMSCRf6.d.mts → endpoint.d-BXbBpKoh.d.mts} +42 -1
- package/dist/{endpoint.d-BgHn0lhl.d.ts → endpoint.d-Dx_1k6Du.d.ts} +42 -1
- package/dist/environment/vite.cjs +6 -6
- package/dist/environment/vite.mjs +5 -5
- package/dist/headers.cjs +3 -3
- package/dist/{headers.d-uQ6BR59u.d.ts → headers.d-Aux4JVnm.d.ts} +1 -1
- package/dist/{headers.d-BUxGJTsj.d.mts → headers.d-BawakaPv.d.mts} +1 -1
- package/dist/headers.mjs +2 -2
- package/dist/i18n/client.cjs +15 -16
- package/dist/i18n/client.mjs +5 -6
- package/dist/i18n/index.cjs +4 -4
- package/dist/i18n/index.mjs +3 -3
- package/dist/i18n/server.cjs +5 -5
- package/dist/i18n/server.mjs +4 -4
- package/dist/image/server.cjs +5 -4
- package/dist/image/server.d.mts +5 -1
- package/dist/image/server.d.ts +5 -1
- package/dist/image/server.mjs +4 -3
- package/dist/image/sharp.cjs +53 -89
- package/dist/image/sharp.d.mts +2 -1
- package/dist/image/sharp.d.ts +2 -1
- package/dist/image/sharp.mjs +50 -86
- package/dist/index.cjs +113 -96
- package/dist/{index.d-CuWOJ-un.d.mts → index.d-Ccq42CPU.d.mts} +1 -1
- package/dist/{index.d-BCGfxCXY.d.ts → index.d-r1MLpgeE.d.ts} +1 -1
- package/dist/index.d.mts +64 -30
- package/dist/index.d.ts +64 -30
- package/dist/index.mjs +111 -94
- package/dist/integrations/orm.d.mts +4 -4
- package/dist/integrations/orm.d.ts +4 -4
- package/dist/integrations.cjs +9 -9
- package/dist/integrations.d.mts +4 -4
- package/dist/integrations.d.ts +4 -4
- package/dist/integrations.mjs +8 -8
- package/dist/internal/app-markdown-runtime.cjs +10 -6
- package/dist/internal/app-markdown-runtime.d.mts +17 -6
- package/dist/internal/app-markdown-runtime.d.ts +17 -6
- package/dist/internal/app-markdown-runtime.mjs +9 -5
- package/dist/internal/build-runtime.cjs +71 -67
- package/dist/internal/build-runtime.d.mts +6 -6
- package/dist/internal/build-runtime.d.ts +6 -6
- package/dist/internal/build-runtime.mjs +70 -66
- package/dist/internal/cli-runtime.cjs +35 -34
- package/dist/internal/cli-runtime.mjs +34 -33
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +28 -3
- package/dist/internal/client-runtime.d.mts +45 -12
- package/dist/internal/client-runtime.d.ts +45 -12
- package/dist/internal/client-runtime.mjs +28 -3
- package/dist/internal/compression-runtime.d.mts +4 -4
- package/dist/internal/compression-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.cjs +22 -21
- package/dist/internal/config-runtime.d.mts +6 -6
- package/dist/internal/config-runtime.d.ts +6 -6
- package/dist/internal/config-runtime.mjs +21 -20
- package/dist/internal/form-actions.cjs +7 -6
- package/dist/internal/form-actions.d.mts +2 -2
- package/dist/internal/form-actions.d.ts +2 -2
- package/dist/internal/form-actions.mjs +6 -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 +73 -40
- package/dist/internal/production-runtime.d.mts +133 -15
- package/dist/internal/production-runtime.d.ts +133 -15
- package/dist/internal/production-runtime.mjs +76 -43
- package/dist/internal/react-cache.cjs +3 -3
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/internal/start-manifest.cjs +54 -0
- package/dist/internal/start-manifest.d.mts +43 -0
- package/dist/internal/start-manifest.d.ts +43 -0
- package/dist/internal/start-manifest.mjs +54 -0
- package/dist/internal/vercel-edge-middleware.cjs +8 -8
- package/dist/internal/vercel-edge-middleware.mjs +7 -7
- package/dist/{lifecycle.d-keQs5Swc.d.mts → lifecycle.d-OtGWAvJT.d.mts} +4 -0
- package/dist/{lifecycle.d-keQs5Swc.d.ts → lifecycle.d-OtGWAvJT.d.ts} +4 -0
- package/dist/manager-R7FV4A56.cjs +18 -0
- package/dist/{manager-JIA66YJ2.mjs → manager-YO2RHDYU.mjs} +7 -4
- package/dist/markdown.cjs +5 -5
- package/dist/markdown.d.mts +4 -4
- package/dist/markdown.d.ts +4 -4
- package/dist/markdown.mjs +4 -4
- package/dist/middleware.cjs +14 -14
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +13 -13
- package/dist/{mount.d-BIYmcGGg.d.mts → mount.d-BomEt2kV.d.mts} +1 -1
- package/dist/{mount.d-q8k0cJV0.d.ts → mount.d-Ca8eb9GB.d.ts} +1 -1
- package/dist/{native-server-fn-handler-QRTXGZA4.cjs → native-server-fn-handler-IWNKQEXK.cjs} +10 -8
- package/dist/{native-server-fn-handler-EP5AFJYE.mjs → native-server-fn-handler-LII4MDRR.mjs} +9 -7
- package/dist/native-tree-D3PW64ZL.cjs +28 -0
- package/dist/{native-tree-OYGKP2NZ.mjs → native-tree-G6ZWS7IR.mjs} +5 -5
- package/dist/{navigation-delegate.d-CYBUupsv.d.mts → navigation-delegate.d-B1ujRkYo.d.mts} +1 -1
- package/dist/{navigation-delegate.d-Btfs6Uoa.d.ts → navigation-delegate.d-DJCC2jXF.d.ts} +1 -1
- package/dist/navigation.cjs +13 -11
- package/dist/navigation.d.mts +7 -7
- package/dist/navigation.d.ts +7 -7
- package/dist/navigation.mjs +12 -10
- package/dist/{nitro-2LMOMIST.cjs → nitro-HKMVYIXY.cjs} +13 -13
- package/dist/{nitro-72TFIGGO.mjs → nitro-RHLKLYXH.mjs} +8 -8
- package/dist/{plugin-5PIQQVRP.cjs → plugin-5BNPYCER.cjs} +2 -2
- package/dist/{plugin-QZT747YW.mjs → plugin-FD4S2QEJ.mjs} +1 -1
- package/dist/plugin.cjs +65 -60
- package/dist/plugin.d.mts +7 -7
- package/dist/plugin.d.ts +7 -7
- package/dist/plugin.mjs +64 -59
- package/dist/query/client.cjs +20 -9
- package/dist/query/client.mjs +16 -5
- package/dist/{render-plan.d-0FHusf1D.d.ts → render-plan.d-BxRbaxYA.d.ts} +1 -1
- package/dist/{render-plan.d-BlyxqKMu.d.mts → render-plan.d-CFod_Zf-.d.mts} +1 -1
- package/dist/renderer/react/server.cjs +9 -1
- package/dist/renderer/react/server.d.mts +9 -1
- package/dist/renderer/react/server.d.ts +9 -1
- package/dist/renderer/react/server.mjs +8 -0
- package/dist/renderer-client.cjs +25 -26
- package/dist/renderer-client.d.mts +7 -7
- package/dist/renderer-client.d.ts +7 -7
- package/dist/renderer-client.mjs +15 -16
- package/dist/request.cjs +2 -2
- package/dist/{request.d-CPdVjssg.d.ts → request.d-DG4TeXMM.d.mts} +14 -2
- package/dist/{request.d-CX-gks1l.d.mts → request.d-DRQgaXGG.d.ts} +14 -2
- package/dist/request.d.mts +5 -5
- package/dist/request.d.ts +5 -5
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-CcvZ_4N2.d.mts → route-rendering.d-BXtZKgqu.d.mts} +1 -1
- package/dist/{route-rendering.d-DcOoSNoG.d.ts → route-rendering.d-Db07UNVG.d.ts} +1 -1
- package/dist/{route.d-DrXkpvcg.d.mts → route.d-Cd4Fi6BA.d.ts} +3 -1
- package/dist/{route.d-hs-_cyHn.d.ts → route.d-ShmtqqVQ.d.mts} +3 -1
- package/dist/router.cjs +4 -4
- package/dist/{router.d-C8RHma4A.d.mts → router.d-B61kXqxJ.d.mts} +1 -1
- package/dist/{router.d-D2QnK8cM.d.ts → router.d-BC3hyjf0.d.ts} +1 -1
- package/dist/router.mjs +3 -3
- package/dist/routes.cjs +7 -5
- package/dist/routes.d.mts +4 -4
- package/dist/routes.d.ts +4 -4
- package/dist/routes.mjs +6 -4
- package/dist/{rsc-pipeline-LC2FBZAR.mjs → rsc-pipeline-LJ7YCGY6.mjs} +24 -23
- package/dist/{rsc-pipeline-NTAM65NT.cjs → rsc-pipeline-VENBFYXW.cjs} +25 -24
- package/dist/{runtime-MWAC7NWR.mjs → runtime-4DWUXZHS.mjs} +29 -29
- package/dist/{runtime-U4PAMTVH.cjs → runtime-UNDTYGQS.cjs} +40 -40
- package/dist/{runtime.d-BQUHHq8M.d.mts → runtime.d-Cl6EBGmC.d.mts} +3 -3
- package/dist/{runtime.d-1l_1bLrL.d.ts → runtime.d-SC95yDzr.d.ts} +3 -3
- package/dist/safe-fetch.cjs +15 -0
- package/dist/safe-fetch.d.mts +61 -0
- package/dist/safe-fetch.d.ts +61 -0
- package/dist/safe-fetch.mjs +15 -0
- package/dist/{schema-dev-notice-C2JINRZI.mjs → schema-dev-notice-CA55V57L.mjs} +2 -2
- package/dist/{schema-dev-notice-X7GG7QVB.cjs → schema-dev-notice-RWA2UTR6.cjs} +3 -3
- package/dist/server-action-security.cjs +7 -5
- package/dist/server-action-security.d.mts +11 -3
- package/dist/server-action-security.d.ts +11 -3
- package/dist/server-action-security.mjs +6 -4
- package/dist/server-fn-client.d.mts +3 -3
- package/dist/server-fn-client.d.ts +3 -3
- package/dist/server-fn.cjs +9 -7
- package/dist/server-fn.d.mts +1 -1
- package/dist/server-fn.d.ts +1 -1
- package/dist/server-fn.mjs +8 -6
- package/dist/server-plugins.cjs +8 -8
- package/dist/server-plugins.d.mts +53 -9
- package/dist/server-plugins.d.ts +53 -9
- package/dist/server-plugins.mjs +7 -7
- package/dist/server-query-client.d.mts +1 -1
- package/dist/server-query-client.d.ts +1 -1
- package/dist/server-query.cjs +10 -8
- package/dist/server-query.d.mts +1 -1
- package/dist/server-query.d.ts +1 -1
- package/dist/server-query.mjs +9 -7
- package/dist/server.cjs +105 -103
- package/dist/server.d.mts +17 -17
- package/dist/server.d.ts +17 -17
- package/dist/server.mjs +78 -76
- package/dist/{spa-router.d-BzPdi48R.d.mts → spa-router.d-DrlXgDqY.d.mts} +13 -6
- package/dist/{spa-router.d-BJtXNeqo.d.ts → spa-router.d-DwM02Mwd.d.ts} +13 -6
- package/dist/testing.cjs +34 -32
- package/dist/testing.d.mts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.mjs +26 -24
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/{utils.d-DquC6qxy.d.ts → utils.d-C6KXz3uB.d.ts} +1 -1
- package/dist/{utils.d-B4ZW-6z6.d.mts → utils.d-CHzxAshz.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +65 -60
- package/dist/vite.d.mts +18 -8
- package/dist/vite.d.ts +18 -8
- package/dist/vite.mjs +64 -59
- package/dist/workflows.cjs +7 -7
- package/dist/workflows.mjs +6 -6
- package/package.json +18 -1
- package/dist/analyzer-V5ZMRIIY.cjs +0 -16
- package/dist/chunk-6I4BFRE7.cjs +0 -51
- package/dist/chunk-D4XGKF67.cjs +0 -127
- package/dist/chunk-EIVGPQN5.mjs +0 -51
- 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-JOHU6BQI.cjs +0 -15
- package/dist/native-tree-R6CQMDTI.cjs +0 -28
|
@@ -15,38 +15,160 @@ 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 _chunkIVBDRAORcjs = require('./chunk-IVBDRAOR.cjs');
|
|
25
25
|
|
|
26
26
|
// src/environment-vite.ts
|
|
27
27
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
28
28
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
29
29
|
|
|
30
|
+
// src/diagnostics.ts
|
|
31
|
+
var _tracemapping = require('@jridgewell/trace-mapping');
|
|
32
|
+
|
|
33
|
+
var BOUNDARY_DOCS = "/docs/environment-functions#boundary-diagnostics";
|
|
34
|
+
var FARM_DIAGNOSTIC_RULES = {
|
|
35
|
+
CLIENT_SERVER_ENV: {
|
|
36
|
+
severity: "warning",
|
|
37
|
+
fix: "Read it on the server (a server function, API route, or server component), or declare it in env.public in farm.config.ts and read it through publicEnv.",
|
|
38
|
+
docs: BOUNDARY_DOCS
|
|
39
|
+
},
|
|
40
|
+
CLIENT_PROCESS_ENV_PUBLIC: {
|
|
41
|
+
severity: "warning",
|
|
42
|
+
fix: 'Read it through publicEnv from "@farm.js/core/env".',
|
|
43
|
+
docs: BOUNDARY_DOCS
|
|
44
|
+
},
|
|
45
|
+
CLIENT_NODE_BUILTIN: {
|
|
46
|
+
severity: "warning",
|
|
47
|
+
fix: "Move the import into server-only code, or import it lazily inside a function that runs only on the server.",
|
|
48
|
+
docs: BOUNDARY_DOCS
|
|
49
|
+
},
|
|
50
|
+
CLIENT_SERVER_FUNCTION: {
|
|
51
|
+
severity: "error",
|
|
52
|
+
fix: "Add @farm.js/plugin/rsc and set experimental.serverActions: true so client imports become server references, or call it from server code, or expose an API route and call it with createAPIClient.",
|
|
53
|
+
docs: BOUNDARY_DOCS
|
|
54
|
+
},
|
|
55
|
+
CLIENT_SERVER_ONLY_IMPORT: {
|
|
56
|
+
severity: "error",
|
|
57
|
+
fix: "Move what the client needs out of that module, or call it from a server component, server function, or API route.",
|
|
58
|
+
docs: BOUNDARY_DOCS
|
|
59
|
+
},
|
|
60
|
+
CLIENT_SERVER_ONLY_ENTRY: {
|
|
61
|
+
severity: "error",
|
|
62
|
+
fix: "Use it from an API route or another server module.",
|
|
63
|
+
docs: BOUNDARY_DOCS
|
|
64
|
+
},
|
|
65
|
+
CLIENT_ROUTES_FILE: {
|
|
66
|
+
severity: "error",
|
|
67
|
+
fix: "Import the component, server function, or helper from its own module instead of from the module that defines routes.",
|
|
68
|
+
docs: BOUNDARY_DOCS
|
|
69
|
+
},
|
|
70
|
+
CLIENT_ROUTE_SERVER_IMPORT: {
|
|
71
|
+
severity: "error",
|
|
72
|
+
fix: "Keep server-only imports in the routes file, or in modules only its guard, data, and API handlers use.",
|
|
73
|
+
docs: BOUNDARY_DOCS
|
|
74
|
+
},
|
|
75
|
+
SERVER_CLIENT_ONLY_IMPORT: {
|
|
76
|
+
severity: "error",
|
|
77
|
+
fix: 'Add "use client" to this module, or import the package from a "use client" module.',
|
|
78
|
+
docs: BOUNDARY_DOCS
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var FARM_DOCS_ORIGIN = "https://farmjs.dev";
|
|
82
|
+
function createFarmDiagnostic(code, file, message, location) {
|
|
83
|
+
const rule = FARM_DIAGNOSTIC_RULES[code];
|
|
84
|
+
return {
|
|
85
|
+
code,
|
|
86
|
+
severity: rule.severity,
|
|
87
|
+
file: file.split("?", 1)[0].replace(/\\/g, "/"),
|
|
88
|
+
...location,
|
|
89
|
+
message,
|
|
90
|
+
fix: rule.fix,
|
|
91
|
+
docs: FARM_DOCS_ORIGIN + rule.docs
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function formatFarmDiagnostic(diagnostic, root) {
|
|
95
|
+
let file = diagnostic.file;
|
|
96
|
+
if (root) {
|
|
97
|
+
const relative = _path2.default.relative(root, file).replace(/\\/g, "/");
|
|
98
|
+
if (relative && !relative.startsWith("../") && !_path2.default.isAbsolute(relative)) file = relative;
|
|
99
|
+
}
|
|
100
|
+
const position = diagnostic.line === void 0 ? "" : `:${diagnostic.line}:${_nullishCoalesce(diagnostic.column, () => ( 1))}`;
|
|
101
|
+
return [
|
|
102
|
+
`${file}${position} - ${diagnostic.severity} ${diagnostic.code}: ${diagnostic.message}`,
|
|
103
|
+
` fix: ${diagnostic.fix}`,
|
|
104
|
+
` docs: ${diagnostic.docs}`
|
|
105
|
+
].join("\n");
|
|
106
|
+
}
|
|
107
|
+
function createFarmSourceLocator(code, getCombinedSourcemap) {
|
|
108
|
+
let trace2;
|
|
109
|
+
let lineStarts;
|
|
110
|
+
return (offset) => {
|
|
111
|
+
if (trace2 === void 0) {
|
|
112
|
+
try {
|
|
113
|
+
const map = getCombinedSourcemap();
|
|
114
|
+
trace2 = map ? new (0, _tracemapping.TraceMap)(map) : null;
|
|
115
|
+
} catch (e) {
|
|
116
|
+
trace2 = null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (!trace2) return void 0;
|
|
120
|
+
if (!lineStarts) {
|
|
121
|
+
lineStarts = [0];
|
|
122
|
+
for (let index = code.indexOf("\n"); index !== -1; index = code.indexOf("\n", index + 1)) {
|
|
123
|
+
lineStarts.push(index + 1);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
let low = 0;
|
|
127
|
+
let high = lineStarts.length - 1;
|
|
128
|
+
while (low < high) {
|
|
129
|
+
const middle = low + high + 1 >> 1;
|
|
130
|
+
if (lineStarts[middle] <= offset) low = middle;
|
|
131
|
+
else high = middle - 1;
|
|
132
|
+
}
|
|
133
|
+
const original = _tracemapping.originalPositionFor.call(void 0, trace2, {
|
|
134
|
+
line: low + 1,
|
|
135
|
+
column: offset - lineStarts[low]
|
|
136
|
+
});
|
|
137
|
+
return original.line === null ? void 0 : { line: original.line, column: (_nullishCoalesce(original.column, () => ( 0))) + 1 };
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
30
141
|
// src/islands-react-server-exports.ts
|
|
31
142
|
|
|
32
143
|
|
|
33
144
|
var _parseAst = require('rolldown/parseAst');
|
|
145
|
+
var _utils = require('rolldown/utils');
|
|
34
146
|
|
|
35
147
|
// src/utils/source-snapshot.ts
|
|
36
148
|
|
|
149
|
+
|
|
37
150
|
var snapshot;
|
|
151
|
+
var base;
|
|
38
152
|
var volatile;
|
|
39
153
|
var trace;
|
|
40
|
-
function
|
|
154
|
+
function farmSourceSnapshotPathKey(file, paths = _path2.default) {
|
|
155
|
+
return paths.resolve(file);
|
|
156
|
+
}
|
|
157
|
+
function getFarmSourceStamp(file) {
|
|
41
158
|
try {
|
|
42
159
|
const stat = _fs2.default.statSync(file);
|
|
43
160
|
return `${stat.mtimeMs}:${stat.size}`;
|
|
44
|
-
} catch (
|
|
161
|
+
} catch (e2) {
|
|
45
162
|
return "missing";
|
|
46
163
|
}
|
|
47
164
|
}
|
|
48
165
|
var FarmSourceSnapshotStore = class {
|
|
49
|
-
|
|
166
|
+
/**
|
|
167
|
+
* `tracked: false` keeps entries for a process that edits no sources while it runs, a production
|
|
168
|
+
* build: nothing is stamped, so each plan does not stat every file the snapshot holds.
|
|
169
|
+
*/
|
|
170
|
+
constructor(tracked = true) {
|
|
171
|
+
this.tracked = tracked;
|
|
50
172
|
this.entries = /* @__PURE__ */ new Map();
|
|
51
173
|
this.stamps = /* @__PURE__ */ new Map();
|
|
52
174
|
}
|
|
@@ -59,7 +181,7 @@ var FarmSourceSnapshotStore = class {
|
|
|
59
181
|
const changed = /* @__PURE__ */ new Map();
|
|
60
182
|
for (const file of edited) changed.set(file, void 0);
|
|
61
183
|
for (const [file, stamp] of this.stamps) {
|
|
62
|
-
if (
|
|
184
|
+
if (getFarmSourceStamp(file) !== stamp) changed.set(file, void 0);
|
|
63
185
|
}
|
|
64
186
|
if (changed.size === 0) return changed;
|
|
65
187
|
const replaced = /* @__PURE__ */ new Set();
|
|
@@ -85,10 +207,11 @@ var FarmSourceSnapshotStore = class {
|
|
|
85
207
|
}
|
|
86
208
|
/** Records the stamp of every file an entry read that has none yet. */
|
|
87
209
|
stamp() {
|
|
210
|
+
if (!this.tracked) return;
|
|
88
211
|
for (const entries of this.entries.values()) {
|
|
89
212
|
for (const entry of entries.values()) {
|
|
90
213
|
for (const file of entry.files) {
|
|
91
|
-
if (!this.stamps.has(file)) this.stamps.set(file,
|
|
214
|
+
if (!this.stamps.has(file)) this.stamps.set(file, getFarmSourceStamp(file));
|
|
92
215
|
}
|
|
93
216
|
}
|
|
94
217
|
}
|
|
@@ -112,22 +235,31 @@ function withFarmSourceSnapshot(operation, store) {
|
|
|
112
235
|
_optionalChain([store, 'optionalAccess', _12 => _12.stamp, 'call', _13 => _13()]);
|
|
113
236
|
}
|
|
114
237
|
}
|
|
238
|
+
function withFarmSourceSnapshotOf(store, operation) {
|
|
239
|
+
if (snapshot) return operation();
|
|
240
|
+
base = store.entries;
|
|
241
|
+
try {
|
|
242
|
+
return withFarmSourceSnapshot(operation);
|
|
243
|
+
} finally {
|
|
244
|
+
base = void 0;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
115
247
|
function memoizeInFarmSourceSnapshot(scope, key, compute, lasting) {
|
|
116
248
|
if (!snapshot) return compute();
|
|
117
249
|
let entries = snapshot.get(scope);
|
|
118
250
|
if (!entries) snapshot.set(scope, entries = /* @__PURE__ */ new Map());
|
|
119
|
-
const memoized = entries.get(key);
|
|
251
|
+
const memoized = _nullishCoalesce(entries.get(key), () => ( _optionalChain([base, 'optionalAccess', _14 => _14.get, 'call', _15 => _15(scope), 'optionalAccess', _16 => _16.get, 'call', _17 => _17(key)])));
|
|
120
252
|
if (memoized) {
|
|
121
253
|
if (trace) for (const file of memoized.files) trace.add(file);
|
|
122
254
|
return memoized.value;
|
|
123
255
|
}
|
|
124
256
|
const { result, files } = traceFarmSourceReads(compute);
|
|
125
257
|
entries.set(key, { value: result, files });
|
|
126
|
-
if (lasting && !lasting(result)) _optionalChain([volatile, 'optionalAccess',
|
|
258
|
+
if (lasting && !lasting(result)) _optionalChain([volatile, 'optionalAccess', _18 => _18.push, 'call', _19 => _19([scope, key])]);
|
|
127
259
|
return result;
|
|
128
260
|
}
|
|
129
261
|
function noteFarmSourceRead(file) {
|
|
130
|
-
_optionalChain([trace, 'optionalAccess',
|
|
262
|
+
_optionalChain([trace, 'optionalAccess', _20 => _20.add, 'call', _21 => _21(file)]);
|
|
131
263
|
}
|
|
132
264
|
function traceFarmSourceReads(operation) {
|
|
133
265
|
const outer = trace;
|
|
@@ -233,18 +365,22 @@ function resolveFarmReactServerExport(importer, specifier) {
|
|
|
233
365
|
const file = _path2.default.resolve(directory, server);
|
|
234
366
|
if (_fs2.default.existsSync(file)) resolved = file;
|
|
235
367
|
}
|
|
236
|
-
} catch (
|
|
368
|
+
} catch (e3) {
|
|
237
369
|
resolved = null;
|
|
238
370
|
}
|
|
239
371
|
cache.set(key, resolved);
|
|
240
372
|
return resolved;
|
|
241
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
|
+
}
|
|
242
378
|
var parsedModules = /* @__PURE__ */ new Map();
|
|
243
379
|
function readModule(file) {
|
|
244
380
|
let stat;
|
|
245
381
|
try {
|
|
246
382
|
stat = _fs2.default.statSync(file);
|
|
247
|
-
} catch (
|
|
383
|
+
} catch (e4) {
|
|
248
384
|
return null;
|
|
249
385
|
}
|
|
250
386
|
noteFarmSourceRead(file);
|
|
@@ -253,10 +389,8 @@ function readModule(file) {
|
|
|
253
389
|
let program = null;
|
|
254
390
|
try {
|
|
255
391
|
const code = _fs2.default.readFileSync(file, "utf8");
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
program = _parseAst.parseAst.call(void 0, code, { lang });
|
|
259
|
-
} catch (e4) {
|
|
392
|
+
program = _parseAst.parseAst.call(void 0, code, { lang: parseLang(file) });
|
|
393
|
+
} catch (e5) {
|
|
260
394
|
program = null;
|
|
261
395
|
}
|
|
262
396
|
parsedModules.set(file, { size: stat.size, mtimeMs: stat.mtimeMs, program });
|
|
@@ -270,19 +404,19 @@ function isClientModule(program) {
|
|
|
270
404
|
return false;
|
|
271
405
|
}
|
|
272
406
|
function resolveRelative(from, specifier) {
|
|
273
|
-
const
|
|
407
|
+
const base2 = _path2.default.resolve(_path2.default.dirname(from), specifier);
|
|
274
408
|
for (const extension of SCRIPT_EXTENSIONS) {
|
|
275
|
-
const file = `${
|
|
409
|
+
const file = `${base2}${extension}`;
|
|
276
410
|
if (_fs2.default.existsSync(file) && _fs2.default.statSync(file).isFile()) return file;
|
|
277
411
|
}
|
|
278
412
|
for (const index of INDEX_FILES) {
|
|
279
|
-
const file = _path2.default.join(
|
|
413
|
+
const file = _path2.default.join(base2, index);
|
|
280
414
|
if (_fs2.default.existsSync(file)) return file;
|
|
281
415
|
}
|
|
282
416
|
return null;
|
|
283
417
|
}
|
|
284
418
|
function exportedName(node) {
|
|
285
|
-
return _optionalChain([node, 'optionalAccess',
|
|
419
|
+
return _optionalChain([node, 'optionalAccess', _22 => _22.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _23 => _23.value]);
|
|
286
420
|
}
|
|
287
421
|
function resolveFarmPackageDefaultEntry(importer, specifier, conditions = ["browser", ...DEFAULT_CONDITIONS]) {
|
|
288
422
|
const parsed = packageNameOf(specifier);
|
|
@@ -296,7 +430,7 @@ function resolveFarmPackageDefaultEntry(importer, specifier, conditions = ["brow
|
|
|
296
430
|
_path2.default.join(directory, "package.json"),
|
|
297
431
|
`./${String(target).replace(/^\.\//, "")}`
|
|
298
432
|
);
|
|
299
|
-
} catch (
|
|
433
|
+
} catch (e6) {
|
|
300
434
|
return null;
|
|
301
435
|
}
|
|
302
436
|
}
|
|
@@ -319,7 +453,7 @@ function traceExport(file, name, depth) {
|
|
|
319
453
|
};
|
|
320
454
|
const imports = /* @__PURE__ */ new Map();
|
|
321
455
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
322
|
-
if (node.type !== "ImportDeclaration" || typeof _optionalChain([node, 'access',
|
|
456
|
+
if (node.type !== "ImportDeclaration" || typeof _optionalChain([node, 'access', _24 => _24.source, 'optionalAccess', _25 => _25.value]) !== "string") continue;
|
|
323
457
|
for (const specifier of _nullishCoalesce(node.specifiers, () => ( []))) {
|
|
324
458
|
if (specifier.type === "ImportNamespaceSpecifier") continue;
|
|
325
459
|
const imported = specifier.type === "ImportDefaultSpecifier" ? "default" : _nullishCoalesce(exportedName(specifier.imported), () => ( specifier.local.name));
|
|
@@ -347,13 +481,13 @@ function traceExport(file, name, depth) {
|
|
|
347
481
|
}
|
|
348
482
|
}
|
|
349
483
|
const declared = [
|
|
350
|
-
..._optionalChain([node, 'access',
|
|
351
|
-
...(_nullishCoalesce(_optionalChain([node, 'access',
|
|
484
|
+
..._optionalChain([node, 'access', _26 => _26.declaration, 'optionalAccess', _27 => _27.id]) ? [node.declaration.id.name] : [],
|
|
485
|
+
...(_nullishCoalesce(_optionalChain([node, 'access', _28 => _28.declaration, 'optionalAccess', _29 => _29.declarations]), () => ( []))).map((declarator) => _optionalChain([declarator, 'access', _30 => _30.id, 'optionalAccess', _31 => _31.name]))
|
|
352
486
|
];
|
|
353
487
|
if (declared.includes(name)) return here(client ? "client" : "server");
|
|
354
488
|
} else if (node.type === "ExportDefaultDeclaration" && name === "default") {
|
|
355
489
|
return own(
|
|
356
|
-
() => _optionalChain([node, 'access',
|
|
490
|
+
() => _optionalChain([node, 'access', _32 => _32.declaration, 'optionalAccess', _33 => _33.type]) === "Identifier" ? local(node.declaration.name) : here("server")
|
|
357
491
|
);
|
|
358
492
|
}
|
|
359
493
|
}
|
|
@@ -364,7 +498,7 @@ function traceExport(file, name, depth) {
|
|
|
364
498
|
return void 0;
|
|
365
499
|
}
|
|
366
500
|
function traceFarmExport(file, name) {
|
|
367
|
-
return _optionalChain([traceExport, 'call',
|
|
501
|
+
return _optionalChain([traceExport, 'call', _34 => _34(file, name, 0), 'optionalAccess', _35 => _35.kind]);
|
|
368
502
|
}
|
|
369
503
|
function isFarmClientExport(file, name) {
|
|
370
504
|
return traceFarmExport(file, name) === "client";
|
|
@@ -372,7 +506,7 @@ function isFarmClientExport(file, name) {
|
|
|
372
506
|
function isFarmPackageClientExport(importer, specifier, name) {
|
|
373
507
|
return memoizeInFarmSourceSnapshot(
|
|
374
508
|
"package-client-export",
|
|
375
|
-
`${_path2.default.dirname(importer)}\0${specifier}\0${name}`,
|
|
509
|
+
`${farmSourceSnapshotPathKey(_path2.default.dirname(importer))}\0${specifier}\0${name}`,
|
|
376
510
|
() => {
|
|
377
511
|
const entry = resolveFarmPackageDefaultEntry(importer, specifier);
|
|
378
512
|
return !entry || traceFarmExport(entry, name) !== "server";
|
|
@@ -380,13 +514,14 @@ function isFarmPackageClientExport(importer, specifier, name) {
|
|
|
380
514
|
);
|
|
381
515
|
}
|
|
382
516
|
function parseCode(code, file) {
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
517
|
+
const lang = parseLang(file);
|
|
518
|
+
return memoizeInFarmSourceSnapshot(`ast:${lang}`, code, () => {
|
|
519
|
+
try {
|
|
520
|
+
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
521
|
+
} catch (e7) {
|
|
522
|
+
return null;
|
|
523
|
+
}
|
|
524
|
+
});
|
|
390
525
|
}
|
|
391
526
|
function namespaceMembers(program, local) {
|
|
392
527
|
const members = /* @__PURE__ */ new Set();
|
|
@@ -399,8 +534,8 @@ function namespaceMembers(program, local) {
|
|
|
399
534
|
}
|
|
400
535
|
const current = node;
|
|
401
536
|
if (typeof current.type !== "string") return;
|
|
402
|
-
if ((current.type === "Identifier" || current.type === "JSXIdentifier") && current.name === local && _optionalChain([parent, 'optionalAccess',
|
|
403
|
-
const property = (_optionalChain([parent, 'optionalAccess',
|
|
537
|
+
if ((current.type === "Identifier" || current.type === "JSXIdentifier") && current.name === local && _optionalChain([parent, 'optionalAccess', _36 => _36.type]) !== "ImportNamespaceSpecifier") {
|
|
538
|
+
const property = (_optionalChain([parent, 'optionalAccess', _37 => _37.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _38 => _38.type]) === "JSXMemberExpression") && parent.object === current && !parent.computed ? _optionalChain([parent, 'access', _39 => _39.property, 'optionalAccess', _40 => _40.name]) : void 0;
|
|
404
539
|
if (property) members.add(property);
|
|
405
540
|
else opaque = true;
|
|
406
541
|
return;
|
|
@@ -417,7 +552,7 @@ function findPackageImports(program, accept) {
|
|
|
417
552
|
const found = [];
|
|
418
553
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
419
554
|
if (node.type !== "ImportDeclaration" || node.importKind === "type") continue;
|
|
420
|
-
const specifier = _optionalChain([node, 'access',
|
|
555
|
+
const specifier = _optionalChain([node, 'access', _41 => _41.source, 'optionalAccess', _42 => _42.value]);
|
|
421
556
|
if (typeof specifier !== "string" || !accept(specifier)) continue;
|
|
422
557
|
const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
|
|
423
558
|
(entry2) => entry2.importKind !== "type"
|
|
@@ -456,7 +591,7 @@ function findFarmReactServerClientNames(code, file, specifier) {
|
|
|
456
591
|
const wanted = [
|
|
457
592
|
...entry.defaultLocal ? ["default"] : [],
|
|
458
593
|
...entry.named.map((binding) => binding.imported),
|
|
459
|
-
..._nullishCoalesce(_optionalChain([entry, 'access',
|
|
594
|
+
..._nullishCoalesce(_optionalChain([entry, 'access', _43 => _43.namespace, 'optionalAccess', _44 => _44.members]), () => ( []))
|
|
460
595
|
];
|
|
461
596
|
for (const name of wanted) if (isFarmClientExport(target, name)) names.add(name);
|
|
462
597
|
}
|
|
@@ -464,7 +599,7 @@ function findFarmReactServerClientNames(code, file, specifier) {
|
|
|
464
599
|
}
|
|
465
600
|
function clientModuleSource(node) {
|
|
466
601
|
if (node.importKind === "type" || node.exportKind === "type") return null;
|
|
467
|
-
const source = (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access',
|
|
602
|
+
const source = (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _45 => _45.source, 'optionalAccess', _46 => _46.value]);
|
|
468
603
|
return typeof source === "string" && source.startsWith(".") ? source : null;
|
|
469
604
|
}
|
|
470
605
|
function isClientModuleFile(file) {
|
|
@@ -484,8 +619,8 @@ function findFarmReactServerClientModules(code, file, specifier) {
|
|
|
484
619
|
const module = readModule(current);
|
|
485
620
|
if (!module || isClientModule(module)) return;
|
|
486
621
|
for (const node of _nullishCoalesce(module.body, () => ( []))) {
|
|
487
|
-
const source = _nullishCoalesce(clientModuleSource(node), () => ( (node.type === "ExportAllDeclaration" && typeof _optionalChain([node, 'access',
|
|
488
|
-
if (!_optionalChain([source, 'optionalAccess',
|
|
622
|
+
const source = _nullishCoalesce(clientModuleSource(node), () => ( (node.type === "ExportAllDeclaration" && typeof _optionalChain([node, 'access', _47 => _47.source, 'optionalAccess', _48 => _48.value]) === "string" ? node.source.value : null)));
|
|
623
|
+
if (!_optionalChain([source, 'optionalAccess', _49 => _49.startsWith, 'call', _50 => _50(".")])) continue;
|
|
489
624
|
const child = resolveRelative(current, source);
|
|
490
625
|
if (!child) continue;
|
|
491
626
|
if (isClientModuleFile(child)) {
|
|
@@ -497,11 +632,11 @@ function findFarmReactServerClientModules(code, file, specifier) {
|
|
|
497
632
|
const wanted = [
|
|
498
633
|
...entry.defaultLocal ? ["default"] : [],
|
|
499
634
|
...entry.named.map((binding) => binding.imported),
|
|
500
|
-
..._nullishCoalesce(_optionalChain([entry, 'access',
|
|
635
|
+
..._nullishCoalesce(_optionalChain([entry, 'access', _51 => _51.namespace, 'optionalAccess', _52 => _52.members]), () => ( []))
|
|
501
636
|
];
|
|
502
637
|
for (const name of wanted) {
|
|
503
638
|
const traced = traceExport(target, name, 0);
|
|
504
|
-
if (_optionalChain([traced, 'optionalAccess',
|
|
639
|
+
if (_optionalChain([traced, 'optionalAccess', _53 => _53.kind]) === "server") walk2(traced.file, 0);
|
|
505
640
|
}
|
|
506
641
|
}
|
|
507
642
|
return [...found].sort();
|
|
@@ -541,7 +676,7 @@ function rewriteFarmReactServerImports(options) {
|
|
|
541
676
|
let next = 0;
|
|
542
677
|
for (const entry of [...imports].sort((left, right) => right.start - left.start)) {
|
|
543
678
|
const target = targets.get(entry.specifier);
|
|
544
|
-
_optionalChain([options, 'access',
|
|
679
|
+
_optionalChain([options, 'access', _54 => _54.onServerFile, 'optionalCall', _55 => _55(target)]);
|
|
545
680
|
const server = JSON.stringify(target);
|
|
546
681
|
const lines = [];
|
|
547
682
|
const bind = (name, local) => {
|
|
@@ -578,10 +713,70 @@ function staticImportSources(program) {
|
|
|
578
713
|
continue;
|
|
579
714
|
}
|
|
580
715
|
if (node.importKind === "type" || node.exportKind === "type") continue;
|
|
581
|
-
if (typeof _optionalChain([node, 'access',
|
|
716
|
+
if (typeof _optionalChain([node, 'access', _56 => _56.source, 'optionalAccess', _57 => _57.value]) === "string") sources.push(node.source.value);
|
|
582
717
|
}
|
|
583
718
|
return sources;
|
|
584
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
|
+
}
|
|
585
780
|
var clientOnlyFreeFiles = /* @__PURE__ */ new Set();
|
|
586
781
|
function invalidateFarmClientOnlyScan() {
|
|
587
782
|
clientOnlyFreeFiles.clear();
|
|
@@ -593,28 +788,34 @@ function resolveServerEntry(importer, specifier) {
|
|
|
593
788
|
}
|
|
594
789
|
return _nullishCoalesce(resolveFarmReactServerExport(importer, specifier), () => ( resolveFarmPackageDefaultEntry(importer, specifier, DEFAULT_CONDITIONS)));
|
|
595
790
|
}
|
|
596
|
-
function walkToClientOnly(file, seen) {
|
|
791
|
+
function walkToClientOnly(file, seen, resolved) {
|
|
597
792
|
if (seen.has(file) || clientOnlyFreeFiles.has(file)) return null;
|
|
598
793
|
seen.add(file);
|
|
599
|
-
const
|
|
600
|
-
if (!
|
|
601
|
-
for (const source of
|
|
794
|
+
const imports = readModuleImports(file);
|
|
795
|
+
if (!imports || imports.client) return null;
|
|
796
|
+
for (const source of imports.sources) {
|
|
602
797
|
if (source === CLIENT_ONLY_PACKAGE) return [file];
|
|
603
|
-
const
|
|
604
|
-
|
|
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);
|
|
605
805
|
if (chain) return [file, ...chain];
|
|
606
806
|
}
|
|
607
807
|
return null;
|
|
608
808
|
}
|
|
609
809
|
function findFarmClientOnlyImport(code, file) {
|
|
610
810
|
if (!code.includes("import") && !code.includes("export")) return null;
|
|
611
|
-
const
|
|
612
|
-
if (!
|
|
613
|
-
|
|
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) {
|
|
614
815
|
const entry = resolveServerEntry(file, specifier);
|
|
615
816
|
if (!entry) continue;
|
|
616
817
|
const seen = /* @__PURE__ */ new Set();
|
|
617
|
-
const chain = walkToClientOnly(entry, seen);
|
|
818
|
+
const chain = walkToClientOnly(entry, seen, resolved);
|
|
618
819
|
if (chain) return { specifier, chain };
|
|
619
820
|
for (const walked of seen) clientOnlyFreeFiles.add(walked);
|
|
620
821
|
}
|
|
@@ -625,7 +826,7 @@ function farmRelativeImportFiles(code, file) {
|
|
|
625
826
|
if (!program) return [];
|
|
626
827
|
const files = [];
|
|
627
828
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
628
|
-
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]);
|
|
629
830
|
if (typeof source !== "string" || !source.startsWith(".")) continue;
|
|
630
831
|
const resolved = resolveRelative(file, source);
|
|
631
832
|
if (resolved) files.push(resolved);
|
|
@@ -643,7 +844,7 @@ function farmReactServerBuildReachesClientModules(importer, specifier, serverImp
|
|
|
643
844
|
if (!program) return false;
|
|
644
845
|
if (depth > 0 && isClientModule(program)) return true;
|
|
645
846
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
646
|
-
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]);
|
|
647
848
|
if (typeof source !== "string" || !source.startsWith(".")) continue;
|
|
648
849
|
const child = resolveRelative(file, source);
|
|
649
850
|
if (child && reaches(child, depth + 1)) return true;
|
|
@@ -656,18 +857,88 @@ var IMPORT_SPECIFIER = /(?:\bfrom\s*|\bimport\s*\(?\s*)["']([^"'./][^"']*)["']/g
|
|
|
656
857
|
var STYLESHEET_IMPORT = /(?:\bfrom\s*|\bimport\s*\(?\s*|\brequire\s*\(\s*)["'][^"']+\.(?:css|scss|sass|less|styl)["']/;
|
|
657
858
|
var MAX_SCANNED_FILES = 2e3;
|
|
658
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 === _chunkIVBDRAORcjs.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: _chunkIVBDRAORcjs.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
|
+
}
|
|
659
921
|
function scanPackage(directory) {
|
|
660
922
|
const cached = packageScans.get(directory);
|
|
661
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
|
+
}
|
|
662
931
|
const scan = { imports: /* @__PURE__ */ new Set(), stylesheets: false };
|
|
932
|
+
const stamps = [];
|
|
663
933
|
const pending = [directory];
|
|
664
934
|
let scanned = 0;
|
|
665
935
|
while (pending.length > 0 && scanned < MAX_SCANNED_FILES) {
|
|
666
936
|
const current = pending.pop();
|
|
667
937
|
let entries;
|
|
938
|
+
stamps.push(stampScannedPath(directory, current));
|
|
668
939
|
try {
|
|
669
940
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
670
|
-
} catch (
|
|
941
|
+
} catch (e15) {
|
|
671
942
|
continue;
|
|
672
943
|
}
|
|
673
944
|
for (const entry of entries) {
|
|
@@ -676,9 +947,10 @@ function scanPackage(directory) {
|
|
|
676
947
|
if (entry.isDirectory()) pending.push(file);
|
|
677
948
|
else if (/\.(?:[cm]?js|jsx)$/.test(entry.name) && scanned++ < MAX_SCANNED_FILES) {
|
|
678
949
|
let code;
|
|
950
|
+
stamps.push(stampScannedPath(directory, file));
|
|
679
951
|
try {
|
|
680
952
|
code = _fs2.default.readFileSync(file, "utf8");
|
|
681
|
-
} catch (
|
|
953
|
+
} catch (e16) {
|
|
682
954
|
continue;
|
|
683
955
|
}
|
|
684
956
|
for (const match of code.matchAll(IMPORT_SPECIFIER)) scan.imports.add(match[1]);
|
|
@@ -687,6 +959,10 @@ function scanPackage(directory) {
|
|
|
687
959
|
}
|
|
688
960
|
}
|
|
689
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
|
+
}
|
|
690
966
|
return scan;
|
|
691
967
|
}
|
|
692
968
|
function findFarmServerBundledPackage(importer, specifier) {
|
|
@@ -701,7 +977,7 @@ function findFarmServerBundledPackage(importer, specifier) {
|
|
|
701
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)) {
|
|
702
978
|
return { name: parsed.name, prebundle: isSelfContainedPackage(manifest, importer) };
|
|
703
979
|
}
|
|
704
|
-
} catch (
|
|
980
|
+
} catch (e17) {
|
|
705
981
|
return null;
|
|
706
982
|
}
|
|
707
983
|
return scanPackage(directory).stylesheets ? { name: parsed.name, prebundle: false } : null;
|
|
@@ -709,7 +985,7 @@ function findFarmServerBundledPackage(importer, specifier) {
|
|
|
709
985
|
function isSelfContainedPackage(manifest, importer) {
|
|
710
986
|
if (Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))).length > 0) return false;
|
|
711
987
|
return Object.keys(_nullishCoalesce(manifest.peerDependencies, () => ( {}))).every(
|
|
712
|
-
(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
|
|
713
989
|
);
|
|
714
990
|
}
|
|
715
991
|
function findFarmPackageManifest(importer, specifier) {
|
|
@@ -721,11 +997,11 @@ function findFarmPackageManifest(importer, specifier) {
|
|
|
721
997
|
try {
|
|
722
998
|
const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(directory, "package.json"), "utf8"));
|
|
723
999
|
names = new Set(Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))));
|
|
724
|
-
} catch (
|
|
1000
|
+
} catch (e18) {
|
|
725
1001
|
return null;
|
|
726
1002
|
}
|
|
727
1003
|
const dependencies = [...scanPackage(directory).imports].filter((imported) => {
|
|
728
|
-
const name = _optionalChain([packageNameOf, 'call',
|
|
1004
|
+
const name = _optionalChain([packageNameOf, 'call', _76 => _76(imported), 'optionalAccess', _77 => _77.name]);
|
|
729
1005
|
return name !== void 0 && names.has(name);
|
|
730
1006
|
});
|
|
731
1007
|
return { name: parsed.name, dependencies: dependencies.sort() };
|
|
@@ -758,9 +1034,9 @@ function listFarmModuleExports(entry) {
|
|
|
758
1034
|
const name = exportedName(specifier.exported);
|
|
759
1035
|
if (name) names.add(name);
|
|
760
1036
|
}
|
|
761
|
-
if (_optionalChain([node, 'access',
|
|
762
|
-
for (const declarator of _nullishCoalesce(_optionalChain([node, 'access',
|
|
763
|
-
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);
|
|
764
1040
|
}
|
|
765
1041
|
} else if (node.type === "ExportDefaultDeclaration") {
|
|
766
1042
|
esm = true;
|
|
@@ -851,8 +1127,8 @@ function resolveProgrammaticClientRoutes(options) {
|
|
|
851
1127
|
let untraced = false;
|
|
852
1128
|
const definedIn = /* @__PURE__ */ new Map();
|
|
853
1129
|
for (const route of definitions) {
|
|
854
|
-
const source =
|
|
855
|
-
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));
|
|
856
1132
|
for (const caller of callers.flat()) caller.routeSource = true;
|
|
857
1133
|
definedIn.set(route, callers.flat());
|
|
858
1134
|
if (!source || source.raw || (_nullishCoalesce(callers[0], () => ( []))).length === 0) untraced = true;
|
|
@@ -949,7 +1225,7 @@ function resolveProgrammaticClientRoutes(options) {
|
|
|
949
1225
|
return { routes, routeSourceFiles };
|
|
950
1226
|
}
|
|
951
1227
|
function createEvaluatedRouteGraph(server) {
|
|
952
|
-
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]);
|
|
953
1229
|
if (!evaluated) return void 0;
|
|
954
1230
|
const toGraphModule = (node) => ({
|
|
955
1231
|
id: node.id,
|
|
@@ -1073,7 +1349,7 @@ function isNodeBuiltinId(id) {
|
|
|
1073
1349
|
return bare.startsWith("node:") || NODE_BUILTINS.has(bare);
|
|
1074
1350
|
}
|
|
1075
1351
|
function isProgrammaticRouteActionProxy(code) {
|
|
1076
|
-
return Boolean(_optionalChain([code, 'optionalAccess',
|
|
1352
|
+
return Boolean(_optionalChain([code, 'optionalAccess', _90 => _90.includes, 'call', _91 => _91("__farmRouteActionTarget: true")]));
|
|
1077
1353
|
}
|
|
1078
1354
|
function collectGraph(graph, routesFile) {
|
|
1079
1355
|
const modules = /* @__PURE__ */ new Map();
|
|
@@ -1167,7 +1443,7 @@ function holdsRouteDefinition(value, definitions) {
|
|
|
1167
1443
|
if (descriptor && "value" in descriptor) next(descriptor.value);
|
|
1168
1444
|
}
|
|
1169
1445
|
}
|
|
1170
|
-
} catch (
|
|
1446
|
+
} catch (e19) {
|
|
1171
1447
|
}
|
|
1172
1448
|
}
|
|
1173
1449
|
return false;
|
|
@@ -1260,7 +1536,7 @@ function readJsonString(text) {
|
|
|
1260
1536
|
try {
|
|
1261
1537
|
const value = JSON.parse(text);
|
|
1262
1538
|
return typeof value === "string" ? value : void 0;
|
|
1263
|
-
} catch (
|
|
1539
|
+
} catch (e20) {
|
|
1264
1540
|
return void 0;
|
|
1265
1541
|
}
|
|
1266
1542
|
}
|
|
@@ -1268,7 +1544,7 @@ function readJsonArray(text) {
|
|
|
1268
1544
|
try {
|
|
1269
1545
|
const value = JSON.parse(text);
|
|
1270
1546
|
return Array.isArray(value) ? value : void 0;
|
|
1271
|
-
} catch (
|
|
1547
|
+
} catch (e21) {
|
|
1272
1548
|
return void 0;
|
|
1273
1549
|
}
|
|
1274
1550
|
}
|
|
@@ -1278,13 +1554,13 @@ function readExports(namespace) {
|
|
|
1278
1554
|
let keys;
|
|
1279
1555
|
try {
|
|
1280
1556
|
keys = Object.keys(namespace);
|
|
1281
|
-
} catch (
|
|
1557
|
+
} catch (e22) {
|
|
1282
1558
|
return [];
|
|
1283
1559
|
}
|
|
1284
1560
|
for (const key of keys) {
|
|
1285
1561
|
try {
|
|
1286
1562
|
entries.push([key, namespace[key]]);
|
|
1287
|
-
} catch (
|
|
1563
|
+
} catch (e23) {
|
|
1288
1564
|
}
|
|
1289
1565
|
}
|
|
1290
1566
|
return entries;
|
|
@@ -1317,7 +1593,7 @@ function toModuleFile(file) {
|
|
|
1317
1593
|
if (file.startsWith("file://")) {
|
|
1318
1594
|
try {
|
|
1319
1595
|
return toPosixPath(_url.fileURLToPath.call(void 0, file));
|
|
1320
|
-
} catch (
|
|
1596
|
+
} catch (e24) {
|
|
1321
1597
|
return toPosixPath(file);
|
|
1322
1598
|
}
|
|
1323
1599
|
}
|
|
@@ -1336,7 +1612,7 @@ var _crypto = require('crypto');
|
|
|
1336
1612
|
|
|
1337
1613
|
var IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
1338
1614
|
var moduleName = (node) => {
|
|
1339
|
-
const name = _optionalChain([node, 'optionalAccess',
|
|
1615
|
+
const name = _optionalChain([node, 'optionalAccess', _92 => _92.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _93 => _93.value]);
|
|
1340
1616
|
return typeof name === "string" ? name : null;
|
|
1341
1617
|
};
|
|
1342
1618
|
function parse(code, file) {
|
|
@@ -1347,7 +1623,7 @@ function parse(code, file) {
|
|
|
1347
1623
|
function parseAs(code, lang) {
|
|
1348
1624
|
try {
|
|
1349
1625
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
1350
|
-
} catch (
|
|
1626
|
+
} catch (e25) {
|
|
1351
1627
|
return null;
|
|
1352
1628
|
}
|
|
1353
1629
|
}
|
|
@@ -1372,8 +1648,8 @@ function namespaceMembers2(program, local, declaration) {
|
|
|
1372
1648
|
if (opaque || node === declaration) return;
|
|
1373
1649
|
const name = node.type === "Identifier" || node.type === "JSXIdentifier" ? node.name : null;
|
|
1374
1650
|
if (name !== local) return;
|
|
1375
|
-
if (_optionalChain([parent, 'optionalAccess',
|
|
1376
|
-
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;
|
|
1377
1653
|
const property = member && !parent.computed && (member.type === "Identifier" || member.type === "JSXIdentifier") ? member.name : null;
|
|
1378
1654
|
if (property) members.add(property);
|
|
1379
1655
|
else opaque = true;
|
|
@@ -1389,7 +1665,7 @@ function findFarmPackageClientImports(code, file, isClientPackage) {
|
|
|
1389
1665
|
const reexport = node.type === "ExportNamedDeclaration" && node.source != null;
|
|
1390
1666
|
if (node.type !== "ImportDeclaration" && !reexport) continue;
|
|
1391
1667
|
if (node.importKind === "type" || node.exportKind === "type") continue;
|
|
1392
|
-
const specifier = _optionalChain([node, 'access',
|
|
1668
|
+
const specifier = _optionalChain([node, 'access', _97 => _97.source, 'optionalAccess', _98 => _98.value]);
|
|
1393
1669
|
if (typeof specifier !== "string" || specifier.startsWith(".") || specifier.startsWith("/"))
|
|
1394
1670
|
continue;
|
|
1395
1671
|
const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
|
|
@@ -1446,7 +1722,7 @@ function farmPackageClientImportExports(entry) {
|
|
|
1446
1722
|
return [
|
|
1447
1723
|
...entry.defaultLocal ? ["default"] : [],
|
|
1448
1724
|
...entry.named.map((binding) => binding.imported),
|
|
1449
|
-
..._nullishCoalesce(_optionalChain([entry, 'access',
|
|
1725
|
+
..._nullishCoalesce(_optionalChain([entry, 'access', _99 => _99.namespace, 'optionalAccess', _100 => _100.members]), () => ( []))
|
|
1450
1726
|
];
|
|
1451
1727
|
}
|
|
1452
1728
|
var FARM_CLIENT_REFERENCE_PRAGMA = "// @farm-client-reference";
|
|
@@ -1487,7 +1763,7 @@ function packageLookup(directory, packageName) {
|
|
|
1487
1763
|
const candidate = _path2.default.join(current, "node_modules", packageName);
|
|
1488
1764
|
try {
|
|
1489
1765
|
return { from: current, real: _fs2.default.realpathSync(candidate) };
|
|
1490
|
-
} catch (
|
|
1766
|
+
} catch (e26) {
|
|
1491
1767
|
}
|
|
1492
1768
|
}
|
|
1493
1769
|
if (_path2.default.dirname(current) === current) return null;
|
|
@@ -1498,10 +1774,10 @@ function referenceResolveFrom(root, specifier, importer) {
|
|
|
1498
1774
|
const own = packageLookup(_path2.default.dirname(importer), packageName);
|
|
1499
1775
|
if (!own) return null;
|
|
1500
1776
|
const app = packageLookup(_path2.default.join(root, ".farm", "client-references"), packageName);
|
|
1501
|
-
if (_optionalChain([app, 'optionalAccess',
|
|
1777
|
+
if (_optionalChain([app, 'optionalAccess', _101 => _101.real]) === own.real) return null;
|
|
1502
1778
|
try {
|
|
1503
1779
|
return _fs2.default.realpathSync(own.from);
|
|
1504
|
-
} catch (
|
|
1780
|
+
} catch (e27) {
|
|
1505
1781
|
return own.from;
|
|
1506
1782
|
}
|
|
1507
1783
|
}
|
|
@@ -1527,7 +1803,7 @@ function ensureFarmPackageClientReference(root, specifier, exportName, importer)
|
|
|
1527
1803
|
let current = null;
|
|
1528
1804
|
try {
|
|
1529
1805
|
current = _fs2.default.readFileSync(file, "utf8");
|
|
1530
|
-
} catch (
|
|
1806
|
+
} catch (e28) {
|
|
1531
1807
|
}
|
|
1532
1808
|
if (current !== source) {
|
|
1533
1809
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
@@ -1539,7 +1815,7 @@ function writeIfChanged(file, source) {
|
|
|
1539
1815
|
let current = null;
|
|
1540
1816
|
try {
|
|
1541
1817
|
current = _fs2.default.readFileSync(file, "utf8");
|
|
1542
|
-
} catch (
|
|
1818
|
+
} catch (e29) {
|
|
1543
1819
|
}
|
|
1544
1820
|
if (current !== source) {
|
|
1545
1821
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
@@ -1551,7 +1827,7 @@ function owningPackage(file) {
|
|
|
1551
1827
|
try {
|
|
1552
1828
|
const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(current, "package.json"), "utf8"));
|
|
1553
1829
|
if (typeof manifest.name === "string") return { directory: current, name: manifest.name };
|
|
1554
|
-
} catch (
|
|
1830
|
+
} catch (e30) {
|
|
1555
1831
|
}
|
|
1556
1832
|
if (_path2.default.dirname(current) === current) return null;
|
|
1557
1833
|
}
|
|
@@ -1622,7 +1898,7 @@ function rewriteFarmPackageClientImports(options) {
|
|
|
1622
1898
|
lines.push(`import { ${member} as ${local} } from ${reference(entry.specifier, member)};`);
|
|
1623
1899
|
fields.push(`${member}: ${local}`);
|
|
1624
1900
|
}
|
|
1625
|
-
if (_optionalChain([entry, 'access',
|
|
1901
|
+
if (_optionalChain([entry, 'access', _102 => _102.namespace, 'access', _103 => _103.values, 'optionalAccess', _104 => _104.length])) {
|
|
1626
1902
|
const local = `__farm_package_values_${next++}__`;
|
|
1627
1903
|
lines.push(`import * as ${local} from ${JSON.stringify(entry.specifier)};`);
|
|
1628
1904
|
for (const value of entry.namespace.values) fields.push(`${value}: ${local}.${value}`);
|
|
@@ -1671,7 +1947,7 @@ function ensureFarmIslandContainerReference(root) {
|
|
|
1671
1947
|
let current = null;
|
|
1672
1948
|
try {
|
|
1673
1949
|
current = _fs2.default.readFileSync(file, "utf8");
|
|
1674
|
-
} catch (
|
|
1950
|
+
} catch (e31) {
|
|
1675
1951
|
}
|
|
1676
1952
|
if (current !== source) {
|
|
1677
1953
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
@@ -1685,7 +1961,7 @@ function parse2(code, file) {
|
|
|
1685
1961
|
return memoizeInFarmSourceSnapshot(`ast:${lang}`, code, () => {
|
|
1686
1962
|
try {
|
|
1687
1963
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
1688
|
-
} catch (
|
|
1964
|
+
} catch (e32) {
|
|
1689
1965
|
return null;
|
|
1690
1966
|
}
|
|
1691
1967
|
});
|
|
@@ -1719,7 +1995,7 @@ function findFarmIslandContainers(code, file, bindings) {
|
|
|
1719
1995
|
const current = node;
|
|
1720
1996
|
if (typeof current.type !== "string") return;
|
|
1721
1997
|
if (current.type === "JSXElement") {
|
|
1722
|
-
const name = jsxName(_optionalChain([current, 'access',
|
|
1998
|
+
const name = jsxName(_optionalChain([current, 'access', _105 => _105.openingElement, 'optionalAccess', _106 => _106.name]));
|
|
1723
1999
|
if (name && names.has(name)) {
|
|
1724
2000
|
let container;
|
|
1725
2001
|
for (let depth = open.length - 1; depth >= 0; depth--) {
|
|
@@ -1735,9 +2011,9 @@ function findFarmIslandContainers(code, file, bindings) {
|
|
|
1735
2011
|
});
|
|
1736
2012
|
}
|
|
1737
2013
|
}
|
|
1738
|
-
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));
|
|
1739
2015
|
if (host) open.push(current);
|
|
1740
|
-
visit(_optionalChain([current, 'access',
|
|
2016
|
+
visit(_optionalChain([current, 'access', _110 => _110.openingElement, 'optionalAccess', _111 => _111.attributes]));
|
|
1741
2017
|
visit(current.children);
|
|
1742
2018
|
if (host) open.pop();
|
|
1743
2019
|
return;
|
|
@@ -1768,7 +2044,7 @@ function wrapFarmIslandContainers(options) {
|
|
|
1768
2044
|
const declaration = `import { ${FARM_ISLAND_CONTAINER_EXPORT} as ${CONTAINER_LOCAL} } from ${specifier};
|
|
1769
2045
|
`;
|
|
1770
2046
|
let prologueEnd = 0;
|
|
1771
|
-
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]), () => ( []))) {
|
|
1772
2048
|
if (statement.type !== "ExpressionStatement" || typeof statement.directive !== "string") break;
|
|
1773
2049
|
prologueEnd = statement.end;
|
|
1774
2050
|
}
|
|
@@ -1824,7 +2100,7 @@ function stampPackagePath(target, kind) {
|
|
|
1824
2100
|
const stat = _fs2.default.statSync(target, { throwIfNoEntry: false });
|
|
1825
2101
|
if (!stat || (kind === "file" ? !stat.isFile() : !stat.isDirectory())) return void 0;
|
|
1826
2102
|
return [target, stat.size, stat.mtimeMs, stat.ctimeMs];
|
|
1827
|
-
} catch (
|
|
2103
|
+
} catch (e33) {
|
|
1828
2104
|
return void 0;
|
|
1829
2105
|
}
|
|
1830
2106
|
}
|
|
@@ -1860,7 +2136,7 @@ var PackageClientBoundaryCache = class {
|
|
|
1860
2136
|
else this.dirty = true;
|
|
1861
2137
|
}
|
|
1862
2138
|
}
|
|
1863
|
-
return _optionalChain([entries, 'optionalAccess',
|
|
2139
|
+
return _optionalChain([entries, 'optionalAccess', _114 => _114.find, 'call', _115 => _115(
|
|
1864
2140
|
(entry) => entry.stops.every((file) => visited.has(file)) && !entry.files.some((file) => visited.has(file))
|
|
1865
2141
|
)]);
|
|
1866
2142
|
}
|
|
@@ -1879,7 +2155,7 @@ var PackageClientBoundaryCache = class {
|
|
|
1879
2155
|
await _fs2.default.promises.mkdir(_path2.default.dirname(file), { recursive: true });
|
|
1880
2156
|
await _fs2.default.promises.writeFile(temporary, contents);
|
|
1881
2157
|
await _fs2.default.promises.rename(temporary, file);
|
|
1882
|
-
} catch (
|
|
2158
|
+
} catch (e34) {
|
|
1883
2159
|
await _fs2.default.promises.rm(temporary, { force: true }).catch(() => {
|
|
1884
2160
|
});
|
|
1885
2161
|
}
|
|
@@ -1894,10 +2170,10 @@ var PackageClientBoundaryCache = class {
|
|
|
1894
2170
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
1895
2171
|
_fs2.default.writeFileSync(temporary, contents);
|
|
1896
2172
|
_fs2.default.renameSync(temporary, file);
|
|
1897
|
-
} catch (
|
|
2173
|
+
} catch (e35) {
|
|
1898
2174
|
try {
|
|
1899
2175
|
_fs2.default.rmSync(temporary, { force: true });
|
|
1900
|
-
} catch (
|
|
2176
|
+
} catch (e36) {
|
|
1901
2177
|
}
|
|
1902
2178
|
}
|
|
1903
2179
|
}
|
|
@@ -1931,7 +2207,7 @@ var PackageClientBoundaryCache = class {
|
|
|
1931
2207
|
}
|
|
1932
2208
|
const contents = JSON.stringify({
|
|
1933
2209
|
schema: SCHEMA_VERSION,
|
|
1934
|
-
farm:
|
|
2210
|
+
farm: _chunkIVBDRAORcjs.FARM_VERSION,
|
|
1935
2211
|
paths,
|
|
1936
2212
|
entries
|
|
1937
2213
|
});
|
|
@@ -1968,10 +2244,10 @@ function readStoredCache(file) {
|
|
|
1968
2244
|
let value;
|
|
1969
2245
|
try {
|
|
1970
2246
|
value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
|
|
1971
|
-
} catch (
|
|
2247
|
+
} catch (e37) {
|
|
1972
2248
|
return null;
|
|
1973
2249
|
}
|
|
1974
|
-
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !==
|
|
2250
|
+
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkIVBDRAORcjs.FARM_VERSION) {
|
|
1975
2251
|
return null;
|
|
1976
2252
|
}
|
|
1977
2253
|
const { paths, entries } = value;
|
|
@@ -1982,7 +2258,7 @@ function readStoredCache(file) {
|
|
|
1982
2258
|
const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
|
|
1983
2259
|
if (usable.length > 0) valid[key] = usable;
|
|
1984
2260
|
}
|
|
1985
|
-
return { schema: SCHEMA_VERSION, farm:
|
|
2261
|
+
return { schema: SCHEMA_VERSION, farm: _chunkIVBDRAORcjs.FARM_VERSION, paths, entries: valid };
|
|
1986
2262
|
}
|
|
1987
2263
|
function isRecord(value) {
|
|
1988
2264
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -2021,7 +2297,7 @@ async function withPackageClientBoundaryCache(operation) {
|
|
|
2021
2297
|
}
|
|
2022
2298
|
}
|
|
2023
2299
|
function usePackageClientBoundaryCacheFile(file) {
|
|
2024
|
-
_optionalChain([getPackageClientBoundaryCache, 'call',
|
|
2300
|
+
_optionalChain([getPackageClientBoundaryCache, 'call', _116 => _116(), 'optionalAccess', _117 => _117.load, 'call', _118 => _118(file)]);
|
|
2025
2301
|
}
|
|
2026
2302
|
function resolvePackageClientBoundaryCacheFile(root, distDir) {
|
|
2027
2303
|
return _path2.default.resolve(root, distDir, "cache", "client-boundaries.json");
|
|
@@ -2038,7 +2314,7 @@ function runWithPackageClientBoundaryCacheFile(file, operation) {
|
|
|
2038
2314
|
var latestDevCache;
|
|
2039
2315
|
function runWithLatestPackageClientBoundaryCache(file, operation) {
|
|
2040
2316
|
if (getPackageClientBoundaryCache()) return operation();
|
|
2041
|
-
if (_optionalChain([latestDevCache, 'optionalAccess',
|
|
2317
|
+
if (_optionalChain([latestDevCache, 'optionalAccess', _119 => _119.file]) !== file) {
|
|
2042
2318
|
const cache2 = new PackageClientBoundaryCache();
|
|
2043
2319
|
cache2.load(file);
|
|
2044
2320
|
latestDevCache = { file, cache: cache2 };
|
|
@@ -2072,7 +2348,7 @@ function readSourceFileContents(filePath) {
|
|
|
2072
2348
|
return null;
|
|
2073
2349
|
}
|
|
2074
2350
|
return _fs2.default.readFileSync(filePath, "utf-8");
|
|
2075
|
-
} catch (
|
|
2351
|
+
} catch (e38) {
|
|
2076
2352
|
return null;
|
|
2077
2353
|
}
|
|
2078
2354
|
}
|
|
@@ -2085,7 +2361,7 @@ function resolveModuleSourcePath(modulePath, root) {
|
|
|
2085
2361
|
if (modulePath.startsWith("file://")) {
|
|
2086
2362
|
try {
|
|
2087
2363
|
candidates.add(_url.fileURLToPath.call(void 0, modulePath));
|
|
2088
|
-
} catch (
|
|
2364
|
+
} catch (e39) {
|
|
2089
2365
|
}
|
|
2090
2366
|
}
|
|
2091
2367
|
if (modulePath.startsWith("/@fs/")) {
|
|
@@ -2098,7 +2374,7 @@ function resolveModuleSourcePath(modulePath, root) {
|
|
|
2098
2374
|
candidates.add(_path2.default.join(root, normalized));
|
|
2099
2375
|
candidates.add(_path2.default.resolve(root, normalized));
|
|
2100
2376
|
}
|
|
2101
|
-
if (_optionalChain([withoutQuery, 'optionalAccess',
|
|
2377
|
+
if (_optionalChain([withoutQuery, 'optionalAccess', _120 => _120.startsWith, 'call', _121 => _121("/src/")])) {
|
|
2102
2378
|
const normalized = withoutQuery.replace(/^\/+/, "");
|
|
2103
2379
|
candidates.add(_path2.default.join(process.cwd(), normalized));
|
|
2104
2380
|
candidates.add(_path2.default.resolve(process.cwd(), normalized));
|
|
@@ -2153,7 +2429,7 @@ function hasUseClientDirective(content) {
|
|
|
2153
2429
|
if (!normalized.includes("use client")) {
|
|
2154
2430
|
return false;
|
|
2155
2431
|
}
|
|
2156
|
-
for (const token of
|
|
2432
|
+
for (const token of scanModuleSourceTokens(content, true)) {
|
|
2157
2433
|
if (token.kind === "string") {
|
|
2158
2434
|
if (token.value === "use client") {
|
|
2159
2435
|
return true;
|
|
@@ -2177,7 +2453,7 @@ function hasHydrateExport(content) {
|
|
|
2177
2453
|
for (const match of content.matchAll(/\bexport\s*\{([^}]*)\}/g)) {
|
|
2178
2454
|
for (const specifier of match[1].split(",")) {
|
|
2179
2455
|
const parts = specifier.trim().split(/\s+as\s+/);
|
|
2180
|
-
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()]);
|
|
2181
2457
|
if (exportedName2 === "hydrate") {
|
|
2182
2458
|
return true;
|
|
2183
2459
|
}
|
|
@@ -2279,7 +2555,7 @@ function isIdentifierStartCode(code) {
|
|
|
2279
2555
|
function isIdentifierPartCode(code) {
|
|
2280
2556
|
return isIdentifierStartCode(code) || code >= 48 && code <= 57;
|
|
2281
2557
|
}
|
|
2282
|
-
function scanModuleSourceTokens(content) {
|
|
2558
|
+
function scanModuleSourceTokens(content, prologueOnly = false) {
|
|
2283
2559
|
const tokens = [];
|
|
2284
2560
|
let index = 0;
|
|
2285
2561
|
let line = 1;
|
|
@@ -2359,9 +2635,11 @@ function scanModuleSourceTokens(content) {
|
|
|
2359
2635
|
const start = index++;
|
|
2360
2636
|
while (index < content.length && isIdentifierPartCode(content.charCodeAt(index))) index++;
|
|
2361
2637
|
tokens.push({ kind: "identifier", value: content.slice(start, index), line });
|
|
2638
|
+
if (prologueOnly) return tokens;
|
|
2362
2639
|
continue;
|
|
2363
2640
|
}
|
|
2364
2641
|
tokens.push({ kind: "punctuation", value: character, line });
|
|
2642
|
+
if (prologueOnly && character !== ";") return tokens;
|
|
2365
2643
|
index++;
|
|
2366
2644
|
}
|
|
2367
2645
|
return tokens;
|
|
@@ -2370,7 +2648,7 @@ function isIslandExportStart(tokens, index) {
|
|
|
2370
2648
|
const token = tokens[index];
|
|
2371
2649
|
const previous = tokens[index - 1];
|
|
2372
2650
|
const startsStatement = !previous || previous.value === ";" || previous.value === "{" || previous.value === "}" || token.line > previous.line;
|
|
2373
|
-
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";
|
|
2374
2652
|
}
|
|
2375
2653
|
function getIslandStrategyExport(content) {
|
|
2376
2654
|
if (!content) return null;
|
|
@@ -2378,15 +2656,15 @@ function getIslandStrategyExport(content) {
|
|
|
2378
2656
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2379
2657
|
if (!isIslandExportStart(tokens, index)) continue;
|
|
2380
2658
|
let valueIndex = index + 3;
|
|
2381
|
-
if (_optionalChain([tokens, 'access',
|
|
2659
|
+
if (_optionalChain([tokens, 'access', _128 => _128[valueIndex], 'optionalAccess', _129 => _129.value]) === ":") {
|
|
2382
2660
|
while (valueIndex < tokens.length && tokens[valueIndex].value !== "=") valueIndex++;
|
|
2383
2661
|
}
|
|
2384
|
-
if (_optionalChain([tokens, 'access',
|
|
2662
|
+
if (_optionalChain([tokens, 'access', _130 => _130[valueIndex], 'optionalAccess', _131 => _131.value]) !== "=") break;
|
|
2385
2663
|
valueIndex++;
|
|
2386
2664
|
const literal = tokens[valueIndex];
|
|
2387
2665
|
if (!literal || literal.kind !== "string" || !_chunk7KJJ4SBScjs.isFarmIslandStrategy.call(void 0, literal.value)) break;
|
|
2388
2666
|
let trailingIndex = valueIndex + 1;
|
|
2389
|
-
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") {
|
|
2390
2668
|
trailingIndex += 2;
|
|
2391
2669
|
}
|
|
2392
2670
|
const trailing = tokens[trailingIndex];
|
|
@@ -2412,13 +2690,13 @@ function hasAsyncDefaultExport(content) {
|
|
|
2412
2690
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2413
2691
|
const token = tokens[index];
|
|
2414
2692
|
if (token.kind !== "identifier" || token.value !== "export") continue;
|
|
2415
|
-
if (_optionalChain([tokens, 'access',
|
|
2416
|
-
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;
|
|
2417
2695
|
const exported = tokens[index + 2];
|
|
2418
2696
|
if (exported.kind === "identifier" && exported.value === "async") {
|
|
2419
2697
|
return true;
|
|
2420
2698
|
}
|
|
2421
|
-
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)) {
|
|
2422
2700
|
return true;
|
|
2423
2701
|
}
|
|
2424
2702
|
}
|
|
@@ -2426,10 +2704,10 @@ function hasAsyncDefaultExport(content) {
|
|
|
2426
2704
|
}
|
|
2427
2705
|
function isAsyncLocalDeclaration(tokens, name) {
|
|
2428
2706
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2429
|
-
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) {
|
|
2430
2708
|
return true;
|
|
2431
2709
|
}
|
|
2432
|
-
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") {
|
|
2433
2711
|
return true;
|
|
2434
2712
|
}
|
|
2435
2713
|
}
|
|
@@ -2518,6 +2796,9 @@ function getClientModuleMetadata(modulePath, root) {
|
|
|
2518
2796
|
const resolvedPath = resolveModuleSourcePath(modulePath, root);
|
|
2519
2797
|
return inspectClientModuleMetadata(resolvedPath, root, /* @__PURE__ */ new Set(), true);
|
|
2520
2798
|
}
|
|
2799
|
+
function getClientModuleHydrationPlanKey(modulePath, root, mode, options = {}) {
|
|
2800
|
+
return `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${options.packageReferences === true}\0${_path2.default.resolve(modulePath)}`;
|
|
2801
|
+
}
|
|
2521
2802
|
function getClientModuleHydrationPlan(modulePath, root, mode = "off", options = {}) {
|
|
2522
2803
|
const plan = planClientModuleHydration(modulePath, root, mode, options);
|
|
2523
2804
|
if (options.serverTreeLayouts !== true || options.asyncOwnerIslands !== true || !plan.shouldHydrate || plan.isClientComponent || plan.asyncOwnerIslands) {
|
|
@@ -2640,7 +2921,7 @@ function planClientModuleHydration(modulePath, root, mode, options) {
|
|
|
2640
2921
|
return plan;
|
|
2641
2922
|
}
|
|
2642
2923
|
function usesFarmServerTree(plan) {
|
|
2643
|
-
return _optionalChain([plan, 'optionalAccess',
|
|
2924
|
+
return _optionalChain([plan, 'optionalAccess', _150 => _150.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0;
|
|
2644
2925
|
}
|
|
2645
2926
|
function getMarkdownPageHydrationPlan(componentsModulePath, root, mode = "off", options = {}) {
|
|
2646
2927
|
const plan = {
|
|
@@ -2770,7 +3051,7 @@ function clientModulePlanSignature(content) {
|
|
|
2770
3051
|
isIsolatableClientBoundarySource(content),
|
|
2771
3052
|
getImportSpecifiers(content).sort()
|
|
2772
3053
|
]);
|
|
2773
|
-
} catch (
|
|
3054
|
+
} catch (e40) {
|
|
2774
3055
|
return null;
|
|
2775
3056
|
}
|
|
2776
3057
|
}
|
|
@@ -2795,7 +3076,7 @@ function getStaticImportBindings(content) {
|
|
|
2795
3076
|
if (!content) return bindings;
|
|
2796
3077
|
const tokens = tokenizeModuleSource(content);
|
|
2797
3078
|
for (let index = 0; index < tokens.length; index++) {
|
|
2798
|
-
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;
|
|
2799
3080
|
const first = tokens[index + 1];
|
|
2800
3081
|
if (!first || first.value === "type" || first.value === "(" || first.kind === "string") {
|
|
2801
3082
|
continue;
|
|
@@ -2803,7 +3084,7 @@ function getStaticImportBindings(content) {
|
|
|
2803
3084
|
let fromIndex = -1;
|
|
2804
3085
|
for (let cursor = index + 1; cursor < tokens.length; cursor++) {
|
|
2805
3086
|
if (tokens[cursor].value === ";") break;
|
|
2806
|
-
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") {
|
|
2807
3088
|
fromIndex = cursor;
|
|
2808
3089
|
break;
|
|
2809
3090
|
}
|
|
@@ -2812,13 +3093,13 @@ function getStaticImportBindings(content) {
|
|
|
2812
3093
|
const specifier = tokens[fromIndex + 1].value;
|
|
2813
3094
|
const clause = tokens.slice(index + 1, fromIndex);
|
|
2814
3095
|
const localNames = [];
|
|
2815
|
-
if (_optionalChain([clause, 'access',
|
|
3096
|
+
if (_optionalChain([clause, 'access', _155 => _155[0], 'optionalAccess', _156 => _156.kind]) === "identifier" && clause[0].value !== "type") {
|
|
2816
3097
|
localNames.push(clause[0].value);
|
|
2817
3098
|
}
|
|
2818
3099
|
const namespaceAs = clause.findIndex(
|
|
2819
|
-
(token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access',
|
|
3100
|
+
(token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _157 => _157[clauseIndex + 1], 'optionalAccess', _158 => _158.value]) === "as"
|
|
2820
3101
|
);
|
|
2821
|
-
if (namespaceAs !== -1 && _optionalChain([clause, 'access',
|
|
3102
|
+
if (namespaceAs !== -1 && _optionalChain([clause, 'access', _159 => _159[namespaceAs + 2], 'optionalAccess', _160 => _160.kind]) === "identifier") {
|
|
2822
3103
|
localNames.push(clause[namespaceAs + 2].value);
|
|
2823
3104
|
}
|
|
2824
3105
|
const openingBrace = clause.findIndex((token) => token.value === "{");
|
|
@@ -2828,11 +3109,11 @@ function getStaticImportBindings(content) {
|
|
|
2828
3109
|
if (openingBrace !== -1 && closingBrace !== -1) {
|
|
2829
3110
|
let entryStart = openingBrace + 1;
|
|
2830
3111
|
for (let cursor = entryStart; cursor <= closingBrace; cursor++) {
|
|
2831
|
-
if (cursor !== closingBrace && _optionalChain([clause, 'access',
|
|
3112
|
+
if (cursor !== closingBrace && _optionalChain([clause, 'access', _161 => _161[cursor], 'optionalAccess', _162 => _162.value]) !== ",") continue;
|
|
2832
3113
|
const entry = clause.slice(entryStart, cursor).filter((token) => token.value !== "type");
|
|
2833
3114
|
const asIndex = entry.findIndex((token) => token.value === "as");
|
|
2834
3115
|
const local = asIndex === -1 ? entry[0] : entry[asIndex + 1];
|
|
2835
|
-
if (_optionalChain([local, 'optionalAccess',
|
|
3116
|
+
if (_optionalChain([local, 'optionalAccess', _163 => _163.kind]) === "identifier") localNames.push(local.value);
|
|
2836
3117
|
entryStart = cursor + 1;
|
|
2837
3118
|
}
|
|
2838
3119
|
}
|
|
@@ -2869,14 +3150,14 @@ function findParserSensitiveJsxContainer(content, localBindings) {
|
|
|
2869
3150
|
const open = [];
|
|
2870
3151
|
const isSelfClosing = (openingIndex) => {
|
|
2871
3152
|
for (let index = openingIndex; index < tokens.length; index++) {
|
|
2872
|
-
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]) === "/";
|
|
2873
3154
|
}
|
|
2874
3155
|
return false;
|
|
2875
3156
|
};
|
|
2876
3157
|
for (let index = 0; index < tokens.length - 1; index++) {
|
|
2877
3158
|
if (tokens[index].value !== "<") continue;
|
|
2878
3159
|
if (tokens[index + 1].value === "/") {
|
|
2879
|
-
const closing = _optionalChain([tokens, 'access',
|
|
3160
|
+
const closing = _optionalChain([tokens, 'access', _166 => _166[index + 2], 'optionalAccess', _167 => _167.value]);
|
|
2880
3161
|
const at = closing ? open.lastIndexOf(closing) : -1;
|
|
2881
3162
|
if (at !== -1) open.length = at;
|
|
2882
3163
|
continue;
|
|
@@ -2919,7 +3200,7 @@ function findMatchingToken(tokens, openingIndex, opening, closing) {
|
|
|
2919
3200
|
}
|
|
2920
3201
|
function containsClientJsx(tokens, start, end, clientBindings) {
|
|
2921
3202
|
for (let index = start; index < end; index++) {
|
|
2922
|
-
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;
|
|
2923
3204
|
}
|
|
2924
3205
|
return false;
|
|
2925
3206
|
}
|
|
@@ -2957,7 +3238,7 @@ function getClientRenderingHelpers(tokens, clientBindings) {
|
|
|
2957
3238
|
let helperName;
|
|
2958
3239
|
let bodyStart = -1;
|
|
2959
3240
|
let bodyEnd = -1;
|
|
2960
|
-
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") {
|
|
2961
3242
|
helperName = tokens[index + 1].value;
|
|
2962
3243
|
const parametersStart = tokens.findIndex(
|
|
2963
3244
|
(token, tokenIndex) => tokenIndex > index + 1 && token.value === "("
|
|
@@ -2967,21 +3248,21 @@ function getClientRenderingHelpers(tokens, clientBindings) {
|
|
|
2967
3248
|
(token, tokenIndex) => tokenIndex > parametersEnd && token.value === "{"
|
|
2968
3249
|
);
|
|
2969
3250
|
if (bodyStart !== -1) bodyEnd = findMatchingToken(tokens, bodyStart, "{", "}");
|
|
2970
|
-
} 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") {
|
|
2971
3252
|
helperName = tokens[index + 1].value;
|
|
2972
3253
|
let assignmentIndex = -1;
|
|
2973
3254
|
let arrowIndex = -1;
|
|
2974
3255
|
for (let cursor = index + 2; cursor < tokens.length; cursor++) {
|
|
2975
3256
|
if (tokens[cursor].value === ";") break;
|
|
2976
3257
|
if (assignmentIndex === -1 && tokens[cursor].value === "=") assignmentIndex = cursor;
|
|
2977
|
-
if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access',
|
|
3258
|
+
if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _174 => _174[cursor + 1], 'optionalAccess', _175 => _175.value]) === ">") {
|
|
2978
3259
|
arrowIndex = cursor;
|
|
2979
3260
|
break;
|
|
2980
3261
|
}
|
|
2981
3262
|
}
|
|
2982
3263
|
if (arrowIndex !== -1) {
|
|
2983
3264
|
bodyStart = arrowIndex + 2;
|
|
2984
|
-
bodyEnd = _optionalChain([tokens, 'access',
|
|
3265
|
+
bodyEnd = _optionalChain([tokens, 'access', _176 => _176[bodyStart], 'optionalAccess', _177 => _177.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
|
|
2985
3266
|
} else if (assignmentIndex !== -1) {
|
|
2986
3267
|
bodyStart = assignmentIndex + 1;
|
|
2987
3268
|
bodyEnd = findStatementEnd(tokens, bodyStart);
|
|
@@ -3021,14 +3302,14 @@ function passesElementValuedProps(content, localBindings) {
|
|
|
3021
3302
|
else if (value === "}") braceDepth--;
|
|
3022
3303
|
else if (value === "<" && braceDepth > 0) return true;
|
|
3023
3304
|
else if (value === ">" && braceDepth === 0) {
|
|
3024
|
-
selfClosing = _optionalChain([tokens, 'access',
|
|
3305
|
+
selfClosing = _optionalChain([tokens, 'access', _178 => _178[cursor - 1], 'optionalAccess', _179 => _179.value]) === "/";
|
|
3025
3306
|
break;
|
|
3026
3307
|
}
|
|
3027
3308
|
}
|
|
3028
3309
|
if (selfClosing || cursor >= tokens.length) continue;
|
|
3029
3310
|
for (let child = cursor + 1; child < tokens.length; child++) {
|
|
3030
3311
|
if (tokens[child].value !== "<") continue;
|
|
3031
|
-
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;
|
|
3032
3313
|
if (!closesBoundary) return true;
|
|
3033
3314
|
break;
|
|
3034
3315
|
}
|
|
@@ -3050,7 +3331,7 @@ function rendersOnlyLeafElements(content, localBindings) {
|
|
|
3050
3331
|
else if (value === "<" && braceDepth > 0) return false;
|
|
3051
3332
|
else if (value === ">" && braceDepth === 0) break;
|
|
3052
3333
|
}
|
|
3053
|
-
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;
|
|
3054
3335
|
}
|
|
3055
3336
|
return true;
|
|
3056
3337
|
}
|
|
@@ -3062,9 +3343,9 @@ function hasDynamicJsxCardinality(content, localBindings) {
|
|
|
3062
3343
|
const containsDynamicRenderer = (start, end) => containsClientJsx(tokens, start, end, clientBindings) || tokens.slice(start, end).some((token) => renderingHelpers.has(token.value));
|
|
3063
3344
|
for (let index = 0; index < tokens.length; index++) {
|
|
3064
3345
|
let callStart = -1;
|
|
3065
|
-
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]) === "(") {
|
|
3066
3347
|
callStart = index + 2;
|
|
3067
|
-
} 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]) === "(") {
|
|
3068
3349
|
callStart = index + 3;
|
|
3069
3350
|
}
|
|
3070
3351
|
if (callStart !== -1) {
|
|
@@ -3073,10 +3354,10 @@ function hasDynamicJsxCardinality(content, localBindings) {
|
|
|
3073
3354
|
index = callEnd;
|
|
3074
3355
|
continue;
|
|
3075
3356
|
}
|
|
3076
|
-
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]) === "(") {
|
|
3077
3358
|
const conditionEnd = findMatchingToken(tokens, index + 1, "(", ")");
|
|
3078
3359
|
const bodyStart = conditionEnd + 1;
|
|
3079
|
-
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 === ";");
|
|
3080
3361
|
if (containsDynamicRenderer(bodyStart, bodyEnd === -1 ? tokens.length : bodyEnd)) return true;
|
|
3081
3362
|
}
|
|
3082
3363
|
}
|
|
@@ -3188,7 +3469,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
|
|
|
3188
3469
|
const localBindings = _nullishCoalesce(importedBindings.get(specifier), () => ( []));
|
|
3189
3470
|
const staticUses = countStaticJsxUses(content, localBindings);
|
|
3190
3471
|
if (staticUses > 0) {
|
|
3191
|
-
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;
|
|
3192
3473
|
if (grows) visit(ensureFarmIslandContainerReference(projectRoot));
|
|
3193
3474
|
const container = grows ? void 0 : findParserSensitiveJsxContainer(content, localBindings);
|
|
3194
3475
|
if (container) {
|
|
@@ -3284,7 +3565,7 @@ function farmWorkspaceServerEntry(entry) {
|
|
|
3284
3565
|
function realpathOrSelf(file) {
|
|
3285
3566
|
try {
|
|
3286
3567
|
return _fs2.default.realpathSync(file);
|
|
3287
|
-
} catch (
|
|
3568
|
+
} catch (e41) {
|
|
3288
3569
|
return file;
|
|
3289
3570
|
}
|
|
3290
3571
|
}
|
|
@@ -3314,7 +3595,7 @@ function inspectPackageClientBoundary(resolvedPath, root, visited) {
|
|
|
3314
3595
|
}
|
|
3315
3596
|
function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
|
|
3316
3597
|
if (!resolvedPath || visited.has(resolvedPath)) {
|
|
3317
|
-
if (resolvedPath) _optionalChain([trace2, 'optionalAccess',
|
|
3598
|
+
if (resolvedPath) _optionalChain([trace2, 'optionalAccess', _204 => _204.stop, 'call', _205 => _205(resolvedPath)]);
|
|
3318
3599
|
return {
|
|
3319
3600
|
isClientComponent: false,
|
|
3320
3601
|
shouldHydrate: false,
|
|
@@ -3322,7 +3603,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
|
|
|
3322
3603
|
};
|
|
3323
3604
|
}
|
|
3324
3605
|
visited.add(resolvedPath);
|
|
3325
|
-
_optionalChain([trace2, 'optionalAccess',
|
|
3606
|
+
_optionalChain([trace2, 'optionalAccess', _206 => _206.visit, 'call', _207 => _207(resolvedPath)]);
|
|
3326
3607
|
const content = readIfExists(resolvedPath);
|
|
3327
3608
|
const parsed = parseClientModuleMetadata(content, false);
|
|
3328
3609
|
let importsClientBoundary = false;
|
|
@@ -3380,7 +3661,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3380
3661
|
braceDepth = Math.max(0, braceDepth - 1);
|
|
3381
3662
|
continue;
|
|
3382
3663
|
}
|
|
3383
|
-
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") {
|
|
3384
3665
|
matches.add(tokens[index + 2].value);
|
|
3385
3666
|
continue;
|
|
3386
3667
|
}
|
|
@@ -3390,7 +3671,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3390
3671
|
}
|
|
3391
3672
|
if (reexportsOnly && keyword.value !== "export") continue;
|
|
3392
3673
|
const previous = tokens[index - 1];
|
|
3393
|
-
if (_optionalChain([previous, 'optionalAccess',
|
|
3674
|
+
if (_optionalChain([previous, 'optionalAccess', _214 => _214.value]) === ".") continue;
|
|
3394
3675
|
const first = tokens[index + 1];
|
|
3395
3676
|
if (!first || first.value === "type" || first.value === "(" || first.value === ".") {
|
|
3396
3677
|
continue;
|
|
@@ -3406,7 +3687,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3406
3687
|
for (let cursor = index + 1; cursor < tokens.length; cursor++) {
|
|
3407
3688
|
const token = tokens[cursor];
|
|
3408
3689
|
if (token.value === ";") break;
|
|
3409
|
-
if (token.value === "from" && _optionalChain([tokens, 'access',
|
|
3690
|
+
if (token.value === "from" && _optionalChain([tokens, 'access', _215 => _215[cursor + 1], 'optionalAccess', _216 => _216.kind]) === "string") {
|
|
3410
3691
|
fromIndex = cursor;
|
|
3411
3692
|
break;
|
|
3412
3693
|
}
|
|
@@ -3424,14 +3705,14 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3424
3705
|
return Array.from(matches);
|
|
3425
3706
|
}
|
|
3426
3707
|
function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
|
|
3427
|
-
if (_optionalChain([tokens, 'access',
|
|
3708
|
+
if (_optionalChain([tokens, 'access', _217 => _217[startIndex], 'optionalAccess', _218 => _218.value]) !== "{") return false;
|
|
3428
3709
|
const closingBraceIndex = tokens.findIndex(
|
|
3429
3710
|
(token, index) => index > startIndex && index < endIndex && token.value === "}"
|
|
3430
3711
|
);
|
|
3431
3712
|
if (closingBraceIndex === -1) return false;
|
|
3432
3713
|
let entryStartsAt = startIndex + 1;
|
|
3433
3714
|
for (let index = entryStartsAt; index <= closingBraceIndex; index++) {
|
|
3434
|
-
if (index !== closingBraceIndex && _optionalChain([tokens, 'access',
|
|
3715
|
+
if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _219 => _219[index], 'optionalAccess', _220 => _220.value]) !== ",") continue;
|
|
3435
3716
|
const entry = tokens.slice(entryStartsAt, index);
|
|
3436
3717
|
if (entry.length > 0 && entry[0].value !== "type") return false;
|
|
3437
3718
|
entryStartsAt = index + 1;
|
|
@@ -3441,7 +3722,7 @@ function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
|
|
|
3441
3722
|
function resolveImportedModule(importerPath, specifier, root) {
|
|
3442
3723
|
const resolved = memoizeInFarmSourceSnapshot(
|
|
3443
3724
|
"resolution",
|
|
3444
|
-
`${
|
|
3725
|
+
`${root ? farmSourceSnapshotPathKey(root) : ""}\0${farmSourceSnapshotPathKey(importerPath)}\0${specifier}`,
|
|
3445
3726
|
() => resolveImportedModuleUncached(importerPath, specifier, root),
|
|
3446
3727
|
// A file added later may resolve an import that does not resolve now.
|
|
3447
3728
|
(result) => result.path !== null
|
|
@@ -3471,7 +3752,7 @@ function warnUnresolvedAliasImport(importerPath, specifier, root) {
|
|
|
3471
3752
|
if (!ALIAS_IMPORT.test(specifier) || warnedUnresolvedAliasImports.has(specifier)) return;
|
|
3472
3753
|
warnedUnresolvedAliasImports.add(specifier);
|
|
3473
3754
|
const importer = root ? _path2.default.relative(root, importerPath) : importerPath;
|
|
3474
|
-
|
|
3755
|
+
_chunkGC5ROI3Acjs.logger.warn(
|
|
3475
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".`
|
|
3476
3757
|
);
|
|
3477
3758
|
}
|
|
@@ -3505,14 +3786,14 @@ function getProjectImportAliases(projectRoot) {
|
|
|
3505
3786
|
const stamp = PROJECT_ALIAS_FILES.map((file) => {
|
|
3506
3787
|
try {
|
|
3507
3788
|
return String(_fs2.default.statSync(_path2.default.join(projectRoot, file)).mtimeMs);
|
|
3508
|
-
} catch (
|
|
3789
|
+
} catch (e42) {
|
|
3509
3790
|
return "-";
|
|
3510
3791
|
}
|
|
3511
3792
|
}).join(":");
|
|
3512
3793
|
const sourceDir = _chunkRE5E2G5Scjs.getFarmProjectSourceDir.call(void 0, projectRoot);
|
|
3513
3794
|
const cacheStamp = `${stamp}:${sourceDir}`;
|
|
3514
3795
|
const cached = projectImportAliasCache.get(projectRoot);
|
|
3515
|
-
if (_optionalChain([cached, 'optionalAccess',
|
|
3796
|
+
if (_optionalChain([cached, 'optionalAccess', _221 => _221.stamp]) === cacheStamp) return cached.aliases;
|
|
3516
3797
|
const aliases = [
|
|
3517
3798
|
...readTsconfigPathAliases(projectRoot),
|
|
3518
3799
|
...readPackageImportAliases(projectRoot)
|
|
@@ -3533,8 +3814,8 @@ function readTsconfigPathAliases(projectRoot) {
|
|
|
3533
3814
|
const configPath = _path2.default.join(projectRoot, name);
|
|
3534
3815
|
if (!_fs2.default.existsSync(configPath)) continue;
|
|
3535
3816
|
const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
|
|
3536
|
-
if (!_optionalChain([resolved, 'optionalAccess',
|
|
3537
|
-
const
|
|
3817
|
+
if (!_optionalChain([resolved, 'optionalAccess', _222 => _222.paths])) return [];
|
|
3818
|
+
const base2 = _nullishCoalesce(resolved.baseUrl, () => ( resolved.pathsDirectory));
|
|
3538
3819
|
return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
|
|
3539
3820
|
if (!Array.isArray(targets)) return [];
|
|
3540
3821
|
const wildcardIndex = pattern.indexOf("*");
|
|
@@ -3543,7 +3824,7 @@ function readTsconfigPathAliases(projectRoot) {
|
|
|
3543
3824
|
prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
|
|
3544
3825
|
suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
|
|
3545
3826
|
wildcard: wildcardIndex !== -1,
|
|
3546
|
-
targets: targets.filter((target) => typeof target === "string").map((target) => _path2.default.resolve(
|
|
3827
|
+
targets: targets.filter((target) => typeof target === "string").map((target) => _path2.default.resolve(base2, target))
|
|
3547
3828
|
}
|
|
3548
3829
|
];
|
|
3549
3830
|
});
|
|
@@ -3568,18 +3849,18 @@ function readTsconfigPaths(configPath, visited) {
|
|
|
3568
3849
|
inherited = _nullishCoalesce(readTsconfigPaths(parentPath, visited), () => ( inherited));
|
|
3569
3850
|
}
|
|
3570
3851
|
const options = _nullishCoalesce(config.compilerOptions, () => ( {}));
|
|
3571
|
-
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]);
|
|
3572
3853
|
if (options.paths && typeof options.paths === "object") {
|
|
3573
3854
|
return { paths: options.paths, pathsDirectory: directory, baseUrl };
|
|
3574
3855
|
}
|
|
3575
3856
|
return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
|
|
3576
3857
|
}
|
|
3577
3858
|
function readPackageImportAliases(projectRoot) {
|
|
3578
|
-
const imports = _optionalChain([readPackageJson, 'call',
|
|
3859
|
+
const imports = _optionalChain([readPackageJson, 'call', _224 => _224(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _225 => _225.imports]);
|
|
3579
3860
|
if (!imports || typeof imports !== "object") return [];
|
|
3580
3861
|
return Object.entries(imports).flatMap(([pattern, value]) => {
|
|
3581
3862
|
const target = resolveConditionalExportTarget(value);
|
|
3582
|
-
if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess',
|
|
3863
|
+
if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _226 => _226.startsWith, 'call', _227 => _227("./")])) return [];
|
|
3583
3864
|
const wildcardIndex = pattern.indexOf("*");
|
|
3584
3865
|
return [
|
|
3585
3866
|
{
|
|
@@ -3595,7 +3876,7 @@ function readJsonWithComments(filePath) {
|
|
|
3595
3876
|
let source;
|
|
3596
3877
|
try {
|
|
3597
3878
|
source = _fs2.default.readFileSync(filePath, "utf8");
|
|
3598
|
-
} catch (
|
|
3879
|
+
} catch (e43) {
|
|
3599
3880
|
return null;
|
|
3600
3881
|
}
|
|
3601
3882
|
let output = "";
|
|
@@ -3623,7 +3904,7 @@ function readJsonWithComments(filePath) {
|
|
|
3623
3904
|
}
|
|
3624
3905
|
try {
|
|
3625
3906
|
return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
|
|
3626
|
-
} catch (
|
|
3907
|
+
} catch (e44) {
|
|
3627
3908
|
return null;
|
|
3628
3909
|
}
|
|
3629
3910
|
}
|
|
@@ -3645,15 +3926,15 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
|
|
|
3645
3926
|
const packageJsonPath = _path2.default.join(packageDirectory, "package.json");
|
|
3646
3927
|
const packageJson = readPackageJson(packageJsonPath);
|
|
3647
3928
|
const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
|
|
3648
|
-
const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess',
|
|
3929
|
+
const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _228 => _228.exports]), exportKey);
|
|
3649
3930
|
const candidates = /* @__PURE__ */ new Set();
|
|
3650
|
-
if (_optionalChain([exportTarget, 'optionalAccess',
|
|
3931
|
+
if (_optionalChain([exportTarget, 'optionalAccess', _229 => _229.startsWith, 'call', _230 => _230("./")])) {
|
|
3651
3932
|
candidates.add(_path2.default.resolve(packageDirectory, exportTarget));
|
|
3652
3933
|
}
|
|
3653
3934
|
if (packageSubpath) {
|
|
3654
3935
|
candidates.add(_path2.default.join(packageDirectory, packageSubpath));
|
|
3655
3936
|
} else {
|
|
3656
|
-
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])]) {
|
|
3657
3938
|
if (typeof entry === "string") candidates.add(_path2.default.resolve(packageDirectory, entry));
|
|
3658
3939
|
}
|
|
3659
3940
|
candidates.add(_path2.default.join(packageDirectory, "index"));
|
|
@@ -3689,7 +3970,7 @@ function findPackageDirectory2(importerPath, packageName, root) {
|
|
|
3689
3970
|
function readPackageJson(packageJsonPath) {
|
|
3690
3971
|
try {
|
|
3691
3972
|
return JSON.parse(_fs2.default.readFileSync(packageJsonPath, "utf8"));
|
|
3692
|
-
} catch (
|
|
3973
|
+
} catch (e45) {
|
|
3693
3974
|
return null;
|
|
3694
3975
|
}
|
|
3695
3976
|
}
|
|
@@ -3718,7 +3999,7 @@ function resolvePackageExport(exportsField, exportKey) {
|
|
|
3718
3999
|
if (!exportKey.startsWith(prefix) || !exportKey.endsWith(suffix)) continue;
|
|
3719
4000
|
const wildcard = exportKey.slice(prefix.length, exportKey.length - suffix.length);
|
|
3720
4001
|
const target = resolveConditionalExportTarget(value);
|
|
3721
|
-
return _nullishCoalesce(_optionalChain([target, 'optionalAccess',
|
|
4002
|
+
return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _234 => _234.replace, 'call', _235 => _235("*", wildcard)]), () => ( null));
|
|
3722
4003
|
}
|
|
3723
4004
|
return null;
|
|
3724
4005
|
}
|
|
@@ -3744,15 +4025,25 @@ function resolveConditionalExportTarget(value) {
|
|
|
3744
4025
|
}
|
|
3745
4026
|
function resolveSourceCandidate(candidates) {
|
|
3746
4027
|
for (const candidate of candidates) {
|
|
3747
|
-
const
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
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) {
|
|
3756
4047
|
}
|
|
3757
4048
|
}
|
|
3758
4049
|
return null;
|
|
@@ -3794,7 +4085,7 @@ function scanFarmPackageImports(directory, root) {
|
|
|
3794
4085
|
let entries;
|
|
3795
4086
|
try {
|
|
3796
4087
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
3797
|
-
} catch (
|
|
4088
|
+
} catch (e47) {
|
|
3798
4089
|
return;
|
|
3799
4090
|
}
|
|
3800
4091
|
for (const entry of entries) {
|
|
@@ -3827,7 +4118,7 @@ function collectFarmServerBundledPackageInfo(directory) {
|
|
|
3827
4118
|
let entries;
|
|
3828
4119
|
try {
|
|
3829
4120
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
3830
|
-
} catch (
|
|
4121
|
+
} catch (e48) {
|
|
3831
4122
|
return;
|
|
3832
4123
|
}
|
|
3833
4124
|
for (const entry of entries) {
|
|
@@ -3866,7 +4157,7 @@ function getFarmClientReachableModules(directory, root) {
|
|
|
3866
4157
|
let entries;
|
|
3867
4158
|
try {
|
|
3868
4159
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
3869
|
-
} catch (
|
|
4160
|
+
} catch (e49) {
|
|
3870
4161
|
return;
|
|
3871
4162
|
}
|
|
3872
4163
|
for (const entry of entries) {
|
|
@@ -3969,30 +4260,38 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
3969
4260
|
let projectRoot = process.cwd();
|
|
3970
4261
|
let sources;
|
|
3971
4262
|
const routeSourceFiles = () => {
|
|
3972
|
-
const clientRoutes = _optionalChain([farmApi, 'optionalAccess',
|
|
3973
|
-
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) {
|
|
3974
4265
|
sources = {
|
|
3975
4266
|
for: clientRoutes,
|
|
3976
4267
|
files: /* @__PURE__ */ new Set([
|
|
3977
4268
|
...routesFiles,
|
|
3978
|
-
...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess',
|
|
4269
|
+
...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _243 => _243.routeSourceFiles]), () => ( []))].map(resolvedFile)
|
|
3979
4270
|
])
|
|
3980
4271
|
};
|
|
3981
4272
|
}
|
|
3982
4273
|
return sources.files;
|
|
3983
4274
|
};
|
|
3984
|
-
const
|
|
4275
|
+
const relativeFile = (file) => _path2.default.isAbsolute(file) ? _path2.default.relative(projectRoot, file).replace(/\\/g, "/") || file : file;
|
|
4276
|
+
const routeSourceError = (file, importers = []) => formatFarmDiagnostic(
|
|
4277
|
+
createFarmDiagnostic(
|
|
4278
|
+
"CLIENT_ROUTES_FILE",
|
|
4279
|
+
file,
|
|
4280
|
+
"This module defines programmatic routes, but the browser bundle imports it" + (importers.length > 0 ? ` (from ${importers.map(relativeFile).join(", ")})` : "") + ". Routes files and the modules that define routes carry server-only guards, data hooks, and API handlers, so they never reach the browser."
|
|
4281
|
+
),
|
|
4282
|
+
projectRoot
|
|
4283
|
+
);
|
|
3985
4284
|
return {
|
|
3986
4285
|
name: "farm:environment-functions",
|
|
3987
4286
|
enforce: "post",
|
|
3988
4287
|
configResolved(config) {
|
|
3989
4288
|
isBuild = config.command === "build";
|
|
3990
4289
|
projectRoot = config.root;
|
|
3991
|
-
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]);
|
|
3992
4291
|
sources = void 0;
|
|
3993
4292
|
routesFiles = new Set(
|
|
3994
4293
|
_chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
|
|
3995
|
-
(source) =>
|
|
4294
|
+
(source) => _chunkYUCU6XB4cjs.PROGRAMMATIC_ROUTE_FILE_NAMES.map(
|
|
3996
4295
|
(name) => resolvedFile(_path2.default.resolve(source.root, source.srcDir, name))
|
|
3997
4296
|
)
|
|
3998
4297
|
)
|
|
@@ -4001,22 +4300,35 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4001
4300
|
transform(code, id, transformOptions) {
|
|
4002
4301
|
const environment = resolveBuildEnvironment(
|
|
4003
4302
|
this,
|
|
4004
|
-
_optionalChain([transformOptions, 'optionalAccess',
|
|
4303
|
+
_optionalChain([transformOptions, 'optionalAccess', _248 => _248.ssr])
|
|
4005
4304
|
);
|
|
4006
4305
|
const parse3 = (source) => this.parse(source);
|
|
4007
4306
|
const result = transformEnvironmentFunctions({ code, id, environment, parse: parse3 });
|
|
4008
|
-
if (environment === "client" && !isBuild && !
|
|
4307
|
+
if (environment === "client" && !isBuild && !_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
|
|
4009
4308
|
this.error(routeSourceError(moduleFile(id)));
|
|
4010
4309
|
}
|
|
4011
|
-
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)) {
|
|
4012
4311
|
const file = id.split("?", 1)[0];
|
|
4013
4312
|
const root = _fs.realpathSync.call(void 0, _nullishCoalesce(options.root, () => ( projectRoot)));
|
|
4014
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"));
|
|
4015
4314
|
const reached = clientCode ? null : findFarmClientOnlyImport(code, file);
|
|
4016
4315
|
if (reached) {
|
|
4017
|
-
const chain = reached.chain.map((step) => _path2.default.relative(root, step)).join(" -> ");
|
|
4316
|
+
const chain = reached.chain.map((step) => _path2.default.relative(root, step).replace(/\\/g, "/")).join(" -> ");
|
|
4317
|
+
const importMatch = new RegExp(
|
|
4318
|
+
String.raw`\b(?:from|import)\s*["']` + reached.specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + `["']`
|
|
4319
|
+
).exec(code);
|
|
4320
|
+
const importAt = importMatch ? importMatch.index + importMatch[0].search(/["']/) : void 0;
|
|
4321
|
+
const locate = createFarmSourceLocator(code, () => this.getCombinedSourcemap());
|
|
4018
4322
|
this.error(
|
|
4019
|
-
|
|
4323
|
+
formatFarmDiagnostic(
|
|
4324
|
+
createFarmDiagnostic(
|
|
4325
|
+
"SERVER_CLIENT_ONLY_IMPORT",
|
|
4326
|
+
file,
|
|
4327
|
+
`This module is server code, but its import of "${reached.specifier}" reaches "client-only" (${chain}), so that package can only run in the browser.`,
|
|
4328
|
+
importAt === void 0 ? void 0 : locate(importAt)
|
|
4329
|
+
),
|
|
4330
|
+
root
|
|
4331
|
+
)
|
|
4020
4332
|
);
|
|
4021
4333
|
}
|
|
4022
4334
|
}
|
|
@@ -4027,21 +4339,28 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4027
4339
|
if (resolveBuildEnvironment(context, false) !== "client") return;
|
|
4028
4340
|
const forbidden = routeSourceFiles();
|
|
4029
4341
|
for (const id of this.getModuleIds()) {
|
|
4030
|
-
if (
|
|
4342
|
+
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4031
4343
|
const chain = findClientNodeBuiltinChain(id, (moduleId) => {
|
|
4032
|
-
return _optionalChain([this, 'access',
|
|
4344
|
+
return _optionalChain([this, 'access', _251 => _251.getModuleInfo, 'call', _252 => _252(moduleId), 'optionalAccess', _253 => _253.importedIds]);
|
|
4033
4345
|
});
|
|
4034
4346
|
if (chain) {
|
|
4035
4347
|
this.error(
|
|
4036
|
-
|
|
4348
|
+
formatFarmDiagnostic(
|
|
4349
|
+
createFarmDiagnostic(
|
|
4350
|
+
"CLIENT_ROUTE_SERVER_IMPORT",
|
|
4351
|
+
moduleFile(id),
|
|
4352
|
+
`The browser bundle reaches the server-only module "${chain.at(-1)}" through this programmatic route module: ${chain.map((step) => relativeFile(moduleFile(step))).join(" -> ")}.`
|
|
4353
|
+
),
|
|
4354
|
+
projectRoot
|
|
4355
|
+
)
|
|
4037
4356
|
);
|
|
4038
4357
|
}
|
|
4039
4358
|
continue;
|
|
4040
4359
|
}
|
|
4041
4360
|
if (!forbidden.has(moduleFile(id))) continue;
|
|
4042
4361
|
const info = this.getModuleInfo(id);
|
|
4043
|
-
if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess',
|
|
4044
|
-
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)])));
|
|
4045
4364
|
}
|
|
4046
4365
|
}
|
|
4047
4366
|
};
|
|
@@ -4055,13 +4374,13 @@ function moduleFile(id) {
|
|
|
4055
4374
|
function resolvedFile(filePath) {
|
|
4056
4375
|
try {
|
|
4057
4376
|
return moduleFile(_fs.realpathSync.call(void 0, filePath));
|
|
4058
|
-
} catch (
|
|
4377
|
+
} catch (e50) {
|
|
4059
4378
|
return moduleFile(filePath);
|
|
4060
4379
|
}
|
|
4061
4380
|
}
|
|
4062
4381
|
function resolveBuildEnvironment(context, ssr) {
|
|
4063
|
-
if (_optionalChain([context, 'access',
|
|
4064
|
-
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") {
|
|
4065
4384
|
return "server";
|
|
4066
4385
|
}
|
|
4067
4386
|
return ssr ? "server" : "client";
|
|
@@ -4375,4 +4694,14 @@ function transformError(id, message) {
|
|
|
4375
4694
|
|
|
4376
4695
|
|
|
4377
4696
|
|
|
4378
|
-
|
|
4697
|
+
|
|
4698
|
+
|
|
4699
|
+
|
|
4700
|
+
|
|
4701
|
+
|
|
4702
|
+
|
|
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;
|