powerlines 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{api-CHbGX3BG.d.ts → api-DE9Ixr0u.d.cts} +2 -2
- package/dist/{api-DGMQopJ5.d.cts → api-S471id5Y.d.ts} +2 -2
- package/dist/api.cjs +3 -3
- package/dist/api.d.cts +6 -2
- package/dist/api.d.ts +6 -2
- package/dist/api.js +2 -2
- package/dist/astro.cjs +5 -5
- package/dist/astro.d.cts +5 -1
- package/dist/astro.d.ts +5 -1
- package/dist/astro.js +4 -4
- package/dist/{chunk-RCYXXBJ3.cjs → chunk-246ZHDQL.cjs} +667 -231
- package/dist/{chunk-FZ6J2GMT.js → chunk-575Z57QD.js} +2 -2
- package/dist/{chunk-CF7B5HOG.cjs → chunk-57GCROWS.cjs} +4 -4
- package/dist/{chunk-KW66GUWJ.cjs → chunk-AGFJZWS3.cjs} +4 -4
- package/dist/{chunk-BH4JSKPK.js → chunk-FCZMWEL7.js} +3 -3
- package/dist/chunk-LRZLY3R7.cjs +12 -0
- package/dist/{chunk-PYID3NKT.js → chunk-M7SQJLGB.js} +6 -5
- package/dist/{chunk-HG7JY6AQ.cjs → chunk-N6UOEGTC.cjs} +7 -6
- package/dist/{chunk-ISPXQBOL.js → chunk-O5PLPU55.js} +3 -3
- package/dist/{chunk-2DWFEC7G.js → chunk-Q4ZLKJS2.js} +668 -232
- package/dist/{chunk-ON3LABX3.cjs → chunk-SALASTMK.cjs} +2 -2
- package/dist/{chunk-CSJMUAPJ.js → chunk-TARQ5ZEQ.js} +3 -3
- package/dist/chunk-X56DYZYO.js +9 -0
- package/dist/chunk-YEBH46ZU.cjs +12 -0
- package/dist/{chunk-YULFP33E.cjs → chunk-YFKHICPO.cjs} +2 -2
- package/dist/{chunk-P647W2BA.js → chunk-ZFMDBIE2.js} +2 -2
- package/dist/{context-BjOICcQB.d.cts → context-BwnxICfB.d.cts} +100 -25
- package/dist/{context-BqTYt9FC.d.ts → context-p7xgIm3D.d.ts} +100 -25
- package/dist/esbuild.cjs +7 -7
- package/dist/esbuild.d.cts +5 -1
- package/dist/esbuild.d.ts +5 -1
- package/dist/esbuild.js +4 -4
- package/dist/farm.cjs +4 -4
- package/dist/farm.d.cts +5 -1
- package/dist/farm.d.ts +5 -1
- package/dist/farm.js +3 -3
- package/dist/index.cjs +21 -21
- package/dist/index.d.cts +17 -5
- package/dist/index.d.ts +17 -5
- package/dist/index.js +10 -7
- package/dist/lib/{api-Cxmk8sFc.d.ts → api-1xCU-974.d.ts} +2 -2
- package/dist/lib/{api-_rRpguWX.d.cts → api-BvkhY-MU.d.cts} +2 -2
- package/dist/lib/build/esbuild.cjs +9 -6
- package/dist/lib/build/esbuild.cjs.map +1 -0
- package/dist/lib/build/esbuild.d.cts +6 -2
- package/dist/lib/build/esbuild.d.ts +6 -2
- package/dist/lib/build/esbuild.js +6 -3
- package/dist/lib/build/esbuild.js.map +1 -0
- package/dist/lib/build/index.cjs +47 -27
- package/dist/lib/build/index.cjs.map +1 -0
- package/dist/lib/build/index.d.cts +9 -4
- package/dist/lib/build/index.d.ts +9 -4
- package/dist/lib/build/index.js +15 -11
- package/dist/lib/build/index.js.map +1 -0
- package/dist/lib/build/rolldown.cjs +6 -4
- package/dist/lib/build/rolldown.cjs.map +1 -0
- package/dist/lib/build/rolldown.d.cts +6 -2
- package/dist/lib/build/rolldown.d.ts +6 -2
- package/dist/lib/build/rolldown.js +5 -3
- package/dist/lib/build/rolldown.js.map +1 -0
- package/dist/lib/build/rollup.cjs +6 -4
- package/dist/lib/build/rollup.cjs.map +1 -0
- package/dist/lib/build/rollup.d.cts +6 -2
- package/dist/lib/build/rollup.d.ts +6 -2
- package/dist/lib/build/rollup.js +4 -2
- package/dist/lib/build/rollup.js.map +1 -0
- package/dist/lib/build/rspack.cjs +5 -3
- package/dist/lib/build/rspack.cjs.map +1 -0
- package/dist/lib/build/rspack.d.cts +6 -2
- package/dist/lib/build/rspack.d.ts +6 -2
- package/dist/lib/build/rspack.js +4 -2
- package/dist/lib/build/rspack.js.map +1 -0
- package/dist/lib/build/tsdown.cjs +25 -0
- package/dist/lib/build/tsdown.cjs.map +1 -0
- package/dist/lib/build/tsdown.d.cts +60 -0
- package/dist/lib/build/tsdown.d.ts +60 -0
- package/dist/lib/build/tsdown.js +4 -0
- package/dist/lib/build/tsdown.js.map +1 -0
- package/dist/lib/build/tsup.cjs +10 -7
- package/dist/lib/build/tsup.cjs.map +1 -0
- package/dist/lib/build/tsup.d.cts +6 -2
- package/dist/lib/build/tsup.d.ts +6 -2
- package/dist/lib/build/tsup.js +7 -4
- package/dist/lib/build/tsup.js.map +1 -0
- package/dist/lib/build/unbuild.cjs +9 -7
- package/dist/lib/build/unbuild.cjs.map +1 -0
- package/dist/lib/build/unbuild.d.cts +8 -4
- package/dist/lib/build/unbuild.d.ts +8 -4
- package/dist/lib/build/unbuild.js +6 -4
- package/dist/lib/build/unbuild.js.map +1 -0
- package/dist/lib/build/vite.cjs +9 -6
- package/dist/lib/build/vite.cjs.map +1 -0
- package/dist/lib/build/vite.d.cts +6 -2
- package/dist/lib/build/vite.d.ts +6 -2
- package/dist/lib/build/vite.js +7 -4
- package/dist/lib/build/vite.js.map +1 -0
- package/dist/lib/build/webpack.cjs +5 -3
- package/dist/lib/build/webpack.cjs.map +1 -0
- package/dist/lib/build/webpack.d.cts +6 -2
- package/dist/lib/build/webpack.d.ts +6 -2
- package/dist/lib/build/webpack.js +4 -2
- package/dist/lib/build/webpack.js.map +1 -0
- package/dist/lib/{chunk-UNUP4XMO.cjs → chunk-23BFL3LB.cjs} +6 -4
- package/dist/lib/chunk-23BFL3LB.cjs.map +1 -0
- package/dist/lib/{chunk-26M3IUSK.js → chunk-26JHNKA7.js} +3 -1
- package/dist/lib/chunk-26JHNKA7.js.map +1 -0
- package/dist/lib/{chunk-4V5OI73E.cjs → chunk-2HAOX4Q2.cjs} +205 -124
- package/dist/lib/chunk-2HAOX4Q2.cjs.map +1 -0
- package/dist/lib/{chunk-2RHE4SGK.js → chunk-2IXO6SBG.js} +3 -1
- package/dist/lib/chunk-2IXO6SBG.js.map +1 -0
- package/dist/lib/{chunk-K3NBD5LL.cjs → chunk-2JR645O3.cjs} +5 -3
- package/dist/lib/chunk-2JR645O3.cjs.map +1 -0
- package/dist/lib/{chunk-Z5JKSYRP.cjs → chunk-2OMOKN7Y.cjs} +236 -73
- package/dist/lib/chunk-2OMOKN7Y.cjs.map +1 -0
- package/dist/lib/{chunk-ENRLU4UR.js → chunk-35EO5Y7R.js} +3 -1
- package/dist/lib/chunk-35EO5Y7R.js.map +1 -0
- package/dist/lib/{chunk-NDYKRNPQ.js → chunk-367E23MI.js} +3 -1
- package/dist/lib/chunk-367E23MI.js.map +1 -0
- package/dist/lib/{chunk-I76RI47U.cjs → chunk-3DKBH67A.cjs} +19 -15
- package/dist/lib/chunk-3DKBH67A.cjs.map +1 -0
- package/dist/lib/chunk-3GMJQ5G3.cjs +4 -0
- package/dist/lib/chunk-3GMJQ5G3.cjs.map +1 -0
- package/dist/lib/{chunk-OEF6EHQV.js → chunk-45D4XIOK.js} +3 -1
- package/dist/lib/chunk-45D4XIOK.js.map +1 -0
- package/dist/lib/chunk-4BPHC6QQ.js +3 -0
- package/dist/lib/chunk-4BPHC6QQ.js.map +1 -0
- package/dist/lib/{chunk-Q4D2L67H.cjs → chunk-4NBEK7BB.cjs} +8 -7
- package/dist/lib/chunk-4NBEK7BB.cjs.map +1 -0
- package/dist/lib/{chunk-AJDYMANR.cjs → chunk-4UN7FLKQ.cjs} +6 -4
- package/dist/lib/chunk-4UN7FLKQ.cjs.map +1 -0
- package/dist/lib/{chunk-QR2N3DPP.js → chunk-5QJRVWP3.js} +4 -2
- package/dist/lib/chunk-5QJRVWP3.js.map +1 -0
- package/dist/lib/{chunk-ONETLSPO.js → chunk-5QMQ5G73.js} +4 -2
- package/dist/lib/chunk-5QMQ5G73.js.map +1 -0
- package/dist/lib/{chunk-H7A5QVLY.cjs → chunk-62ZJYXT3.cjs} +7 -5
- package/dist/lib/chunk-62ZJYXT3.cjs.map +1 -0
- package/dist/lib/{chunk-JA4HSQRN.cjs → chunk-632PWWU7.cjs} +5 -3
- package/dist/lib/chunk-632PWWU7.cjs.map +1 -0
- package/dist/lib/{chunk-PIFNMTKN.cjs → chunk-63DAS6TJ.cjs} +6 -4
- package/dist/lib/chunk-63DAS6TJ.cjs.map +1 -0
- package/dist/lib/{chunk-OL35IC6Z.js → chunk-6OGQTUXF.js} +3 -1
- package/dist/lib/chunk-6OGQTUXF.js.map +1 -0
- package/dist/lib/{chunk-HE6HOGLS.js → chunk-7CDTHZ3R.js} +200 -37
- package/dist/lib/chunk-7CDTHZ3R.js.map +1 -0
- package/dist/lib/{chunk-QDRITYHV.cjs → chunk-7OO4SKFN.cjs} +6 -4
- package/dist/lib/chunk-7OO4SKFN.cjs.map +1 -0
- package/dist/lib/{chunk-SHUYVCID.js → chunk-7QVYU63E.js} +2 -0
- package/dist/lib/chunk-7QVYU63E.js.map +1 -0
- package/dist/lib/{chunk-GANVMM73.js → chunk-7R23HVGQ.js} +3 -1
- package/dist/lib/chunk-7R23HVGQ.js.map +1 -0
- package/dist/lib/chunk-A4RSMLXW.cjs +13 -0
- package/dist/lib/chunk-A4RSMLXW.cjs.map +1 -0
- package/dist/lib/{chunk-6OYSDQXE.cjs → chunk-AQNUFK3L.cjs} +47 -9
- package/dist/lib/chunk-AQNUFK3L.cjs.map +1 -0
- package/dist/lib/{chunk-HRRI4KOM.cjs → chunk-BJGMF356.cjs} +8 -6
- package/dist/lib/chunk-BJGMF356.cjs.map +1 -0
- package/dist/lib/{chunk-GLFOKUTH.cjs → chunk-BQA4H72F.cjs} +12 -10
- package/dist/lib/chunk-BQA4H72F.cjs.map +1 -0
- package/dist/lib/chunk-CLOW34EQ.js +3 -0
- package/dist/lib/chunk-CLOW34EQ.js.map +1 -0
- package/dist/lib/{chunk-VHCBD2IS.js → chunk-CTMPQSK7.js} +54 -1
- package/dist/lib/chunk-CTMPQSK7.js.map +1 -0
- package/dist/lib/{chunk-M263EZ4F.js → chunk-D55ZAZCX.js} +3 -1
- package/dist/lib/chunk-D55ZAZCX.js.map +1 -0
- package/dist/lib/{chunk-7GCAHOJK.js → chunk-D5IEZABI.js} +4 -2
- package/dist/lib/chunk-D5IEZABI.js.map +1 -0
- package/dist/lib/chunk-DQJCGJ5P.js +3 -0
- package/dist/lib/chunk-DQJCGJ5P.js.map +1 -0
- package/dist/lib/{chunk-KFDNKOXM.js → chunk-EBBGE5FN.js} +20 -2
- package/dist/lib/chunk-EBBGE5FN.js.map +1 -0
- package/dist/lib/chunk-FFATMOAQ.js +14 -0
- package/dist/lib/chunk-FFATMOAQ.js.map +1 -0
- package/dist/lib/chunk-FJMP4CXA.js +3 -0
- package/dist/lib/chunk-FJMP4CXA.js.map +1 -0
- package/dist/lib/{chunk-4PTER5EV.js → chunk-FKPVNUDU.js} +3 -1
- package/dist/lib/chunk-FKPVNUDU.js.map +1 -0
- package/dist/lib/{chunk-ZGMEHSNN.js → chunk-FPFPUYXS.js} +3 -1
- package/dist/lib/chunk-FPFPUYXS.js.map +1 -0
- package/dist/lib/{chunk-N5XEKCVW.cjs → chunk-FQZQA4EJ.cjs} +13 -20
- package/dist/lib/chunk-FQZQA4EJ.cjs.map +1 -0
- package/dist/lib/{chunk-3T56KQ7U.cjs → chunk-GDODHF3Y.cjs} +6 -4
- package/dist/lib/chunk-GDODHF3Y.cjs.map +1 -0
- package/dist/lib/chunk-GTNYRHTO.js +3 -0
- package/dist/lib/chunk-GTNYRHTO.js.map +1 -0
- package/dist/lib/chunk-HCJQJ2NV.cjs +203 -0
- package/dist/lib/chunk-HCJQJ2NV.cjs.map +1 -0
- package/dist/lib/{chunk-32Q2PG5D.js → chunk-HDUSUF6L.js} +3 -1
- package/dist/lib/chunk-HDUSUF6L.js.map +1 -0
- package/dist/lib/{chunk-TANQDHYY.js → chunk-HQ6TGY34.js} +3 -1
- package/dist/lib/chunk-HQ6TGY34.js.map +1 -0
- package/dist/lib/{chunk-JG4IL7XL.cjs → chunk-HYQXPNVP.cjs} +4 -2
- package/dist/lib/chunk-HYQXPNVP.cjs.map +1 -0
- package/dist/lib/{chunk-KJDASLW3.js → chunk-JEB4OVD5.js} +70 -14
- package/dist/lib/chunk-JEB4OVD5.js.map +1 -0
- package/dist/lib/{chunk-GK75G3OD.cjs → chunk-JSU4O5TH.cjs} +7 -5
- package/dist/lib/chunk-JSU4O5TH.cjs.map +1 -0
- package/dist/lib/chunk-K3FDM5F3.cjs +4 -0
- package/dist/lib/chunk-K3FDM5F3.cjs.map +1 -0
- package/dist/lib/{chunk-ZDBHX3VV.cjs → chunk-K7EXK3ZX.cjs} +142 -85
- package/dist/lib/chunk-K7EXK3ZX.cjs.map +1 -0
- package/dist/lib/{chunk-N5YLKWC2.js → chunk-KLU5DWCZ.js} +5 -11
- package/dist/lib/chunk-KLU5DWCZ.js.map +1 -0
- package/dist/lib/{chunk-R3E56AJ4.cjs → chunk-LIZRGQES.cjs} +7 -5
- package/dist/lib/chunk-LIZRGQES.cjs.map +1 -0
- package/dist/lib/{chunk-UJYCAW2D.cjs → chunk-LQMUXGB5.cjs} +37 -10
- package/dist/lib/chunk-LQMUXGB5.cjs.map +1 -0
- package/dist/lib/{chunk-CU23POMD.js → chunk-LSSLZECF.js} +4 -2
- package/dist/lib/chunk-LSSLZECF.js.map +1 -0
- package/dist/lib/{chunk-4NHFXDTQ.cjs → chunk-MFC7UJHT.cjs} +5 -3
- package/dist/lib/chunk-MFC7UJHT.cjs.map +1 -0
- package/dist/lib/{chunk-6RLV3FIS.js → chunk-MJ6WN3XA.js} +4 -2
- package/dist/lib/chunk-MJ6WN3XA.js.map +1 -0
- package/dist/lib/{chunk-HM52GHX3.js → chunk-MZ3GS5X3.js} +31 -4
- package/dist/lib/chunk-MZ3GS5X3.js.map +1 -0
- package/dist/lib/{chunk-T6KEXFRH.cjs → chunk-NPSC73QO.cjs} +10 -8
- package/dist/lib/chunk-NPSC73QO.cjs.map +1 -0
- package/dist/lib/{chunk-NST5TNW6.js → chunk-OC2AD37X.js} +3 -1
- package/dist/lib/chunk-OC2AD37X.js.map +1 -0
- package/dist/lib/{chunk-WUE7NTBW.cjs → chunk-OGEFARN2.cjs} +12 -10
- package/dist/lib/chunk-OGEFARN2.cjs.map +1 -0
- package/dist/lib/{chunk-3OCI4TH7.cjs → chunk-OXOTWH3L.cjs} +6 -4
- package/dist/lib/chunk-OXOTWH3L.cjs.map +1 -0
- package/dist/{plugin-utils/chunk-USNT2KNT.cjs → lib/chunk-PK6SKIKE.cjs} +2 -0
- package/dist/lib/chunk-PK6SKIKE.cjs.map +1 -0
- package/dist/lib/{chunk-XBM7FHNK.js → chunk-Q25ZPXA7.js} +3 -1
- package/dist/lib/chunk-Q25ZPXA7.js.map +1 -0
- package/dist/lib/{chunk-XUYQYUWZ.cjs → chunk-QBE4SZN6.cjs} +6 -4
- package/dist/lib/chunk-QBE4SZN6.cjs.map +1 -0
- package/dist/lib/{chunk-GA3RXX4R.cjs → chunk-QHTL2U3L.cjs} +10 -8
- package/dist/lib/chunk-QHTL2U3L.cjs.map +1 -0
- package/dist/lib/chunk-QMKA57N4.cjs +4 -0
- package/dist/lib/chunk-QMKA57N4.cjs.map +1 -0
- package/dist/lib/{chunk-MRAGQ33T.js → chunk-RHADQ6HA.js} +4 -2
- package/dist/lib/chunk-RHADQ6HA.js.map +1 -0
- package/dist/lib/{chunk-4SULM54S.js → chunk-RNSQODBR.js} +190 -109
- package/dist/lib/chunk-RNSQODBR.js.map +1 -0
- package/dist/lib/{chunk-2NZADVP5.cjs → chunk-RQICHHZM.cjs} +4 -2
- package/dist/lib/chunk-RQICHHZM.cjs.map +1 -0
- package/dist/lib/{chunk-YGSXCTX2.js → chunk-RTFLBGJI.js} +4 -3
- package/dist/lib/chunk-RTFLBGJI.js.map +1 -0
- package/dist/lib/chunk-SIYSGNDD.js +100 -0
- package/dist/lib/chunk-SIYSGNDD.js.map +1 -0
- package/dist/lib/chunk-SP5FOE5B.cjs +109 -0
- package/dist/lib/chunk-SP5FOE5B.cjs.map +1 -0
- package/dist/lib/{chunk-67DW5UDQ.js → chunk-SUABYS33.js} +5 -3
- package/dist/lib/chunk-SUABYS33.js.map +1 -0
- package/dist/lib/{chunk-CP77I6WM.js → chunk-US6LDIXH.js} +100 -43
- package/dist/lib/chunk-US6LDIXH.js.map +1 -0
- package/dist/lib/chunk-UYDY7RRQ.cjs +4 -0
- package/dist/lib/chunk-UYDY7RRQ.cjs.map +1 -0
- package/dist/lib/{chunk-AHK7GRPM.js → chunk-W2KADD56.js} +4 -2
- package/dist/lib/chunk-W2KADD56.js.map +1 -0
- package/dist/lib/chunk-XBOHJTOI.cjs +4 -0
- package/dist/lib/chunk-XBOHJTOI.cjs.map +1 -0
- package/dist/lib/{chunk-XLHFUATD.cjs → chunk-Y5KONJVR.cjs} +55 -2
- package/dist/lib/chunk-Y5KONJVR.cjs.map +1 -0
- package/dist/lib/chunk-YF57WETC.cjs +16 -0
- package/dist/lib/chunk-YF57WETC.cjs.map +1 -0
- package/dist/lib/{chunk-AFLI3CLM.js → chunk-YFB6OGXJ.js} +4 -2
- package/dist/lib/chunk-YFB6OGXJ.js.map +1 -0
- package/dist/lib/{chunk-L56XA427.js → chunk-YJEZASNU.js} +41 -3
- package/dist/lib/chunk-YJEZASNU.js.map +1 -0
- package/dist/lib/{chunk-A2NW7WAN.js → chunk-YMEXAI6M.js} +3 -1
- package/dist/lib/chunk-YMEXAI6M.js.map +1 -0
- package/dist/lib/{chunk-YYEAV24J.cjs → chunk-YYG2XJQN.cjs} +30 -11
- package/dist/lib/chunk-YYG2XJQN.cjs.map +1 -0
- package/dist/lib/{chunk-NDC5BKCD.cjs → chunk-YZ2NKI4K.cjs} +4 -2
- package/dist/lib/chunk-YZ2NKI4K.cjs.map +1 -0
- package/dist/lib/{chunk-YYN6TKSY.cjs → chunk-ZFOPHCGK.cjs} +4 -2
- package/dist/lib/chunk-ZFOPHCGK.cjs.map +1 -0
- package/dist/lib/{chunk-HL4KTZDB.cjs → chunk-ZGTXKPKZ.cjs} +5 -3
- package/dist/lib/chunk-ZGTXKPKZ.cjs.map +1 -0
- package/dist/lib/{chunk-4W6WV35V.js → chunk-ZLWW2MXD.js} +21 -15
- package/dist/lib/chunk-ZLWW2MXD.js.map +1 -0
- package/dist/lib/{chunk-YB54H3SQ.js → chunk-ZVZFMMNL.js} +10 -6
- package/dist/lib/chunk-ZVZFMMNL.js.map +1 -0
- package/dist/lib/{chunk-D6MI2V6R.cjs → chunk-ZWLSNYIN.cjs} +23 -17
- package/dist/lib/chunk-ZWLSNYIN.cjs.map +1 -0
- package/dist/lib/{config-DMXVnKGF.d.cts → config-CFT-8XXu.d.cts} +104 -21
- package/dist/lib/{config-B2q8Me0M.d.ts → config-CwebNcAh.d.ts} +104 -21
- package/dist/lib/config-file.cjs +6 -4
- package/dist/lib/config-file.cjs.map +1 -0
- package/dist/lib/config-file.d.cts +6 -2
- package/dist/lib/config-file.d.ts +6 -2
- package/dist/lib/config-file.js +4 -2
- package/dist/lib/config-file.js.map +1 -0
- package/dist/lib/contexts/api-context.cjs +20 -17
- package/dist/lib/contexts/api-context.cjs.map +1 -0
- package/dist/lib/contexts/api-context.d.cts +29 -6
- package/dist/lib/contexts/api-context.d.ts +29 -6
- package/dist/lib/contexts/api-context.js +19 -16
- package/dist/lib/contexts/api-context.js.map +1 -0
- package/dist/lib/contexts/context.cjs +17 -14
- package/dist/lib/contexts/context.cjs.map +1 -0
- package/dist/lib/contexts/context.d.cts +78 -11
- package/dist/lib/contexts/context.d.ts +78 -11
- package/dist/lib/contexts/context.js +16 -13
- package/dist/lib/contexts/context.js.map +1 -0
- package/dist/lib/contexts/environment-context.cjs +19 -16
- package/dist/lib/contexts/environment-context.cjs.map +1 -0
- package/dist/lib/contexts/environment-context.d.cts +10 -5
- package/dist/lib/contexts/environment-context.d.ts +10 -5
- package/dist/lib/contexts/environment-context.js +18 -15
- package/dist/lib/contexts/environment-context.js.map +1 -0
- package/dist/lib/contexts/index.cjs +24 -21
- package/dist/lib/contexts/index.cjs.map +1 -0
- package/dist/lib/contexts/index.d.cts +9 -4
- package/dist/lib/contexts/index.d.ts +9 -4
- package/dist/lib/contexts/index.js +20 -17
- package/dist/lib/contexts/index.js.map +1 -0
- package/dist/lib/contexts/plugin-context.cjs +5 -3
- package/dist/lib/contexts/plugin-context.cjs.map +1 -0
- package/dist/lib/contexts/plugin-context.d.cts +8 -4
- package/dist/lib/contexts/plugin-context.d.ts +8 -4
- package/dist/lib/contexts/plugin-context.js +4 -2
- package/dist/lib/contexts/plugin-context.js.map +1 -0
- package/dist/lib/entry.cjs +13 -10
- package/dist/lib/entry.cjs.map +1 -0
- package/dist/lib/entry.d.cts +6 -2
- package/dist/lib/entry.d.ts +6 -2
- package/dist/lib/entry.js +5 -2
- package/dist/lib/entry.js.map +1 -0
- package/dist/lib/fs/helpers.cjs +18 -12
- package/dist/lib/fs/helpers.cjs.map +1 -0
- package/dist/lib/fs/helpers.d.cts +10 -1
- package/dist/lib/fs/helpers.d.ts +10 -1
- package/dist/lib/fs/helpers.js +4 -2
- package/dist/lib/fs/helpers.js.map +1 -0
- package/dist/lib/fs/index.cjs +12 -9
- package/dist/lib/fs/index.cjs.map +1 -0
- package/dist/lib/fs/index.d.cts +7 -3
- package/dist/lib/fs/index.d.ts +7 -3
- package/dist/lib/fs/index.js +11 -8
- package/dist/lib/fs/index.js.map +1 -0
- package/dist/lib/fs/storage/base.cjs +5 -3
- package/dist/lib/fs/storage/base.cjs.map +1 -0
- package/dist/lib/fs/storage/base.d.cts +42 -1
- package/dist/lib/fs/storage/base.d.ts +42 -1
- package/dist/lib/fs/storage/base.js +4 -2
- package/dist/lib/fs/storage/base.js.map +1 -0
- package/dist/lib/fs/storage/file-system.cjs +7 -5
- package/dist/lib/fs/storage/file-system.cjs.map +1 -0
- package/dist/lib/fs/storage/file-system.d.cts +34 -2
- package/dist/lib/fs/storage/file-system.d.ts +34 -2
- package/dist/lib/fs/storage/file-system.js +6 -4
- package/dist/lib/fs/storage/file-system.js.map +1 -0
- package/dist/lib/fs/storage/index.cjs +10 -8
- package/dist/lib/fs/storage/index.cjs.map +1 -0
- package/dist/lib/fs/storage/index.d.cts +4 -2
- package/dist/lib/fs/storage/index.d.ts +4 -2
- package/dist/lib/fs/storage/index.js +7 -5
- package/dist/lib/fs/storage/index.js.map +1 -0
- package/dist/lib/fs/storage/virtual.cjs +6 -4
- package/dist/lib/fs/storage/virtual.cjs.map +1 -0
- package/dist/lib/fs/storage/virtual.d.cts +2 -1
- package/dist/lib/fs/storage/virtual.d.ts +2 -1
- package/dist/lib/fs/storage/virtual.js +5 -3
- package/dist/lib/fs/storage/virtual.js.map +1 -0
- package/dist/lib/fs/vfs.cjs +11 -8
- package/dist/lib/fs/vfs.cjs.map +1 -0
- package/dist/lib/fs/vfs.d.cts +51 -7
- package/dist/lib/fs/vfs.d.ts +51 -7
- package/dist/lib/fs/vfs.js +10 -7
- package/dist/lib/fs/vfs.js.map +1 -0
- package/dist/lib/{fs-Dg-aTfiN.d.cts → fs-abWbkR69.d.cts} +85 -4
- package/dist/lib/{fs-Dg-aTfiN.d.ts → fs-abWbkR69.d.ts} +85 -4
- package/dist/lib/index.cjs +98 -95
- package/dist/lib/index.cjs.map +1 -0
- package/dist/lib/index.d.cts +10 -6
- package/dist/lib/index.d.ts +10 -6
- package/dist/lib/index.js +38 -35
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/{internal-CfIJWv8T.d.cts → internal-BavTJeC5.d.cts} +2 -2
- package/dist/lib/{internal-CGIi3MOX.d.ts → internal-DxQ28691.d.ts} +2 -2
- package/dist/lib/logger.cjs +6 -4
- package/dist/lib/logger.cjs.map +1 -0
- package/dist/lib/logger.d.cts +6 -2
- package/dist/lib/logger.d.ts +6 -2
- package/dist/lib/logger.js +4 -2
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/typescript/import-transformer.cjs +5 -3
- package/dist/lib/typescript/import-transformer.cjs.map +1 -0
- package/dist/lib/typescript/import-transformer.d.cts +6 -2
- package/dist/lib/typescript/import-transformer.d.ts +6 -2
- package/dist/lib/typescript/import-transformer.js +4 -2
- package/dist/lib/typescript/import-transformer.js.map +1 -0
- package/dist/lib/typescript/index.cjs +21 -19
- package/dist/lib/typescript/index.cjs.map +1 -0
- package/dist/lib/typescript/index.d.cts +6 -2
- package/dist/lib/typescript/index.d.ts +6 -2
- package/dist/lib/typescript/index.js +8 -6
- package/dist/lib/typescript/index.js.map +1 -0
- package/dist/lib/typescript/isolated-decl.cjs +5 -3
- package/dist/lib/typescript/isolated-decl.cjs.map +1 -0
- package/dist/lib/typescript/isolated-decl.js +4 -2
- package/dist/lib/typescript/isolated-decl.js.map +1 -0
- package/dist/lib/typescript/ts-morph.cjs +6 -4
- package/dist/lib/typescript/ts-morph.cjs.map +1 -0
- package/dist/lib/typescript/ts-morph.d.cts +8 -4
- package/dist/lib/typescript/ts-morph.d.ts +8 -4
- package/dist/lib/typescript/ts-morph.js +4 -2
- package/dist/lib/typescript/ts-morph.js.map +1 -0
- package/dist/lib/typescript/tsconfig.cjs +11 -9
- package/dist/lib/typescript/tsconfig.cjs.map +1 -0
- package/dist/lib/typescript/tsconfig.js +4 -2
- package/dist/lib/typescript/tsconfig.js.map +1 -0
- package/dist/lib/unplugin/factory.cjs +23 -21
- package/dist/lib/unplugin/factory.cjs.map +1 -0
- package/dist/lib/unplugin/factory.d.cts +8 -4
- package/dist/lib/unplugin/factory.d.ts +8 -4
- package/dist/lib/unplugin/factory.js +22 -20
- package/dist/lib/unplugin/factory.js.map +1 -0
- package/dist/lib/unplugin/helpers.cjs +5 -3
- package/dist/lib/unplugin/helpers.cjs.map +1 -0
- package/dist/lib/unplugin/helpers.d.cts +6 -2
- package/dist/lib/unplugin/helpers.d.ts +6 -2
- package/dist/lib/unplugin/helpers.js +4 -2
- package/dist/lib/unplugin/helpers.js.map +1 -0
- package/dist/lib/unplugin/index.cjs +28 -26
- package/dist/lib/unplugin/index.cjs.map +1 -0
- package/dist/lib/unplugin/index.d.cts +9 -5
- package/dist/lib/unplugin/index.d.ts +9 -5
- package/dist/lib/unplugin/index.js +25 -23
- package/dist/lib/unplugin/index.js.map +1 -0
- package/dist/lib/unplugin/plugin.cjs +8 -6
- package/dist/lib/unplugin/plugin.cjs.map +1 -0
- package/dist/lib/unplugin/plugin.d.cts +10 -19
- package/dist/lib/unplugin/plugin.d.ts +10 -19
- package/dist/lib/unplugin/plugin.js +7 -5
- package/dist/lib/unplugin/plugin.js.map +1 -0
- package/dist/lib/{unplugin-Da9GAj4a.d.ts → unplugin-CpYxomBB.d.ts} +2 -2
- package/dist/lib/{unplugin-B_F1TZK4.d.cts → unplugin-DVAN82cd.d.cts} +2 -2
- package/dist/lib/utilities/bundle.cjs +8 -5
- package/dist/lib/utilities/bundle.cjs.map +1 -0
- package/dist/lib/utilities/bundle.d.cts +6 -2
- package/dist/lib/utilities/bundle.d.ts +6 -2
- package/dist/lib/utilities/bundle.js +7 -4
- package/dist/lib/utilities/bundle.js.map +1 -0
- package/dist/lib/utilities/cache.cjs +7 -5
- package/dist/lib/utilities/cache.cjs.map +1 -0
- package/dist/lib/utilities/cache.d.cts +6 -2
- package/dist/lib/utilities/cache.d.ts +6 -2
- package/dist/lib/utilities/cache.js +5 -3
- package/dist/lib/utilities/cache.js.map +1 -0
- package/dist/lib/utilities/file-header.cjs +6 -4
- package/dist/lib/utilities/file-header.cjs.map +1 -0
- package/dist/lib/utilities/file-header.d.cts +6 -2
- package/dist/lib/utilities/file-header.d.ts +6 -2
- package/dist/lib/utilities/file-header.js +4 -2
- package/dist/lib/utilities/file-header.js.map +1 -0
- package/dist/lib/utilities/index.cjs +45 -42
- package/dist/lib/utilities/index.cjs.map +1 -0
- package/dist/lib/utilities/index.d.cts +6 -2
- package/dist/lib/utilities/index.d.ts +6 -2
- package/dist/lib/utilities/index.js +17 -14
- package/dist/lib/utilities/index.js.map +1 -0
- package/dist/lib/utilities/meta.cjs +10 -8
- package/dist/lib/utilities/meta.cjs.map +1 -0
- package/dist/lib/utilities/meta.d.cts +6 -2
- package/dist/lib/utilities/meta.d.ts +6 -2
- package/dist/lib/utilities/meta.js +4 -2
- package/dist/lib/utilities/meta.js.map +1 -0
- package/dist/lib/utilities/resolve.cjs +9 -6
- package/dist/lib/utilities/resolve.cjs.map +1 -0
- package/dist/lib/utilities/resolve.d.cts +6 -2
- package/dist/lib/utilities/resolve.d.ts +6 -2
- package/dist/lib/utilities/resolve.js +8 -5
- package/dist/lib/utilities/resolve.js.map +1 -0
- package/dist/lib/utilities/source-file.cjs +7 -5
- package/dist/lib/utilities/source-file.cjs.map +1 -0
- package/dist/lib/utilities/source-file.d.cts +6 -2
- package/dist/lib/utilities/source-file.d.ts +6 -2
- package/dist/lib/utilities/source-file.js +4 -2
- package/dist/lib/utilities/source-file.js.map +1 -0
- package/dist/lib/utilities/source-map.cjs +5 -3
- package/dist/lib/utilities/source-map.cjs.map +1 -0
- package/dist/lib/utilities/source-map.d.cts +6 -2
- package/dist/lib/utilities/source-map.d.ts +6 -2
- package/dist/lib/utilities/source-map.js +4 -2
- package/dist/lib/utilities/source-map.js.map +1 -0
- package/dist/lib/utilities/worker.cjs +7 -5
- package/dist/lib/utilities/worker.cjs.map +1 -0
- package/dist/lib/utilities/worker.d.cts +6 -2
- package/dist/lib/utilities/worker.d.ts +6 -2
- package/dist/lib/utilities/worker.js +5 -3
- package/dist/lib/utilities/worker.js.map +1 -0
- package/dist/lib/utilities/write-file.cjs +5 -3
- package/dist/lib/utilities/write-file.cjs.map +1 -0
- package/dist/lib/utilities/write-file.d.cts +6 -2
- package/dist/lib/utilities/write-file.d.ts +6 -2
- package/dist/lib/utilities/write-file.js +4 -2
- package/dist/lib/utilities/write-file.js.map +1 -0
- package/dist/next.cjs +5 -5
- package/dist/next.js +4 -4
- package/dist/nuxt.cjs +7 -7
- package/dist/nuxt.js +5 -5
- package/dist/plugin-utils/{chunk-GV7O3E7P.js → chunk-36OM2X4L.js} +4 -2
- package/dist/plugin-utils/chunk-36OM2X4L.js.map +1 -0
- package/dist/plugin-utils/{chunk-SHUYVCID.js → chunk-7QVYU63E.js} +2 -0
- package/dist/plugin-utils/chunk-7QVYU63E.js.map +1 -0
- package/dist/plugin-utils/{chunk-XIXI67PY.js → chunk-7YN6UEMJ.js} +4 -2
- package/dist/plugin-utils/chunk-7YN6UEMJ.js.map +1 -0
- package/dist/plugin-utils/{chunk-DZZPNO5H.cjs → chunk-B2V5OVYF.cjs} +6 -4
- package/dist/plugin-utils/chunk-B2V5OVYF.cjs.map +1 -0
- package/dist/plugin-utils/{chunk-NFXNZFMN.cjs → chunk-DUIPLC7F.cjs} +5 -3
- package/dist/plugin-utils/chunk-DUIPLC7F.cjs.map +1 -0
- package/dist/plugin-utils/{chunk-SEH3RVMF.js → chunk-G32M72GJ.js} +3 -1
- package/dist/plugin-utils/chunk-G32M72GJ.js.map +1 -0
- package/dist/plugin-utils/{chunk-5MO4BCOW.cjs → chunk-GH7PPING.cjs} +4 -2
- package/dist/plugin-utils/chunk-GH7PPING.cjs.map +1 -0
- package/dist/plugin-utils/{chunk-CYVV2MB7.js → chunk-H7GJUBNY.js} +3 -1
- package/dist/plugin-utils/chunk-H7GJUBNY.js.map +1 -0
- package/dist/plugin-utils/{chunk-ECFS7DPV.cjs → chunk-ID47RJFS.cjs} +9 -7
- package/dist/plugin-utils/chunk-ID47RJFS.cjs.map +1 -0
- package/dist/plugin-utils/chunk-NRJ5QYX2.js +14 -0
- package/dist/plugin-utils/chunk-NRJ5QYX2.js.map +1 -0
- package/dist/{lib/chunk-USNT2KNT.cjs → plugin-utils/chunk-PK6SKIKE.cjs} +2 -0
- package/dist/plugin-utils/chunk-PK6SKIKE.cjs.map +1 -0
- package/dist/plugin-utils/{chunk-QKMG6ZAU.js → chunk-QQ63YK2G.js} +4 -2
- package/dist/plugin-utils/chunk-QQ63YK2G.js.map +1 -0
- package/dist/plugin-utils/chunk-RBMEE2JC.cjs +16 -0
- package/dist/plugin-utils/chunk-RBMEE2JC.cjs.map +1 -0
- package/dist/plugin-utils/{chunk-UNAGYQRB.cjs → chunk-UXLKUCEY.cjs} +9 -7
- package/dist/plugin-utils/chunk-UXLKUCEY.cjs.map +1 -0
- package/dist/plugin-utils/{chunk-F65J5WOX.cjs → chunk-VJGI676W.cjs} +16 -14
- package/dist/plugin-utils/chunk-VJGI676W.cjs.map +1 -0
- package/dist/plugin-utils/{chunk-L277XSSN.js → chunk-X4BI25Z5.js} +3 -1
- package/dist/plugin-utils/chunk-X4BI25Z5.js.map +1 -0
- package/dist/plugin-utils/{context-y3G_SQPM.d.cts → context-BwokDIBz.d.cts} +167 -10
- package/dist/plugin-utils/{context-y3G_SQPM.d.ts → context-BwokDIBz.d.ts} +167 -10
- package/dist/plugin-utils/context-helpers.cjs +6 -4
- package/dist/plugin-utils/context-helpers.cjs.map +1 -0
- package/dist/plugin-utils/context-helpers.d.cts +4 -1
- package/dist/plugin-utils/context-helpers.d.ts +4 -1
- package/dist/plugin-utils/context-helpers.js +4 -2
- package/dist/plugin-utils/context-helpers.js.map +1 -0
- package/dist/plugin-utils/enforce.cjs +8 -6
- package/dist/plugin-utils/enforce.cjs.map +1 -0
- package/dist/plugin-utils/enforce.d.cts +4 -1
- package/dist/plugin-utils/enforce.d.ts +4 -1
- package/dist/plugin-utils/enforce.js +7 -5
- package/dist/plugin-utils/enforce.js.map +1 -0
- package/dist/plugin-utils/extend.cjs +7 -5
- package/dist/plugin-utils/extend.cjs.map +1 -0
- package/dist/plugin-utils/extend.d.cts +4 -1
- package/dist/plugin-utils/extend.d.ts +4 -1
- package/dist/plugin-utils/extend.js +6 -4
- package/dist/plugin-utils/extend.js.map +1 -0
- package/dist/plugin-utils/get-config-path.cjs +5 -3
- package/dist/plugin-utils/get-config-path.cjs.map +1 -0
- package/dist/plugin-utils/get-config-path.d.cts +4 -1
- package/dist/plugin-utils/get-config-path.d.ts +4 -1
- package/dist/plugin-utils/get-config-path.js +4 -2
- package/dist/plugin-utils/get-config-path.js.map +1 -0
- package/dist/plugin-utils/helpers.cjs +17 -15
- package/dist/plugin-utils/helpers.cjs.map +1 -0
- package/dist/plugin-utils/helpers.d.cts +14 -11
- package/dist/plugin-utils/helpers.d.ts +14 -11
- package/dist/plugin-utils/helpers.js +4 -2
- package/dist/plugin-utils/helpers.js.map +1 -0
- package/dist/plugin-utils/index.cjs +30 -28
- package/dist/plugin-utils/index.cjs.map +1 -0
- package/dist/plugin-utils/index.d.cts +4 -1
- package/dist/plugin-utils/index.d.ts +4 -1
- package/dist/plugin-utils/index.js +10 -8
- package/dist/plugin-utils/index.js.map +1 -0
- package/dist/plugin-utils/merge.cjs +6 -4
- package/dist/plugin-utils/merge.cjs.map +1 -0
- package/dist/plugin-utils/merge.d.cts +4 -1
- package/dist/plugin-utils/merge.d.ts +4 -1
- package/dist/plugin-utils/merge.js +5 -3
- package/dist/plugin-utils/merge.js.map +1 -0
- package/dist/plugin-utils/paths.cjs +5 -3
- package/dist/plugin-utils/paths.cjs.map +1 -0
- package/dist/plugin-utils/paths.d.cts +5 -1
- package/dist/plugin-utils/paths.d.ts +5 -1
- package/dist/plugin-utils/paths.js +4 -2
- package/dist/plugin-utils/paths.js.map +1 -0
- package/dist/rolldown.cjs +17 -9
- package/dist/rolldown.d.cts +5 -1
- package/dist/rolldown.d.ts +5 -1
- package/dist/rolldown.js +4 -9
- package/dist/rollup.cjs +4 -4
- package/dist/rollup.d.cts +5 -1
- package/dist/rollup.d.ts +5 -1
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +4 -4
- package/dist/rspack.d.cts +5 -1
- package/dist/rspack.d.ts +5 -1
- package/dist/rspack.js +3 -3
- package/dist/tsdown.cjs +114 -0
- package/dist/tsdown.d.cts +28 -0
- package/dist/tsdown.d.ts +28 -0
- package/dist/tsdown.js +108 -0
- package/dist/tsup.cjs +5 -5
- package/dist/tsup.js +4 -4
- package/dist/types/api.d.cts +6 -2
- package/dist/types/api.d.ts +6 -2
- package/dist/types/babel.d.cts +5 -1
- package/dist/types/babel.d.ts +5 -1
- package/dist/types/build.d.cts +11 -10
- package/dist/types/build.d.ts +11 -10
- package/dist/types/commands.d.cts +5 -1
- package/dist/types/commands.d.ts +5 -1
- package/dist/types/config.d.cts +5 -1
- package/dist/types/config.d.ts +5 -1
- package/dist/types/context.cjs +2 -2
- package/dist/types/context.d.cts +5 -1
- package/dist/types/context.d.ts +5 -1
- package/dist/types/context.js +1 -1
- package/dist/types/fs.cjs +4 -4
- package/dist/types/fs.d.cts +85 -4
- package/dist/types/fs.d.ts +85 -4
- package/dist/types/fs.js +1 -1
- package/dist/types/hooks.d.cts +5 -1
- package/dist/types/hooks.d.ts +5 -1
- package/dist/types/index.cjs +6 -6
- package/dist/types/index.d.cts +7 -3
- package/dist/types/index.d.ts +7 -3
- package/dist/types/index.js +2 -2
- package/dist/types/internal.d.cts +6 -2
- package/dist/types/internal.d.ts +6 -2
- package/dist/types/plugin.d.cts +5 -1
- package/dist/types/plugin.d.ts +5 -1
- package/dist/types/resolved.d.cts +5 -1
- package/dist/types/resolved.d.ts +5 -1
- package/dist/types/unplugin.d.cts +6 -2
- package/dist/types/unplugin.d.ts +6 -2
- package/dist/unloader.cjs +4 -4
- package/dist/unloader.d.cts +5 -1
- package/dist/unloader.d.ts +5 -1
- package/dist/unloader.js +3 -3
- package/dist/unplugin.cjs +10 -8
- package/dist/unplugin.d.cts +8 -17
- package/dist/unplugin.d.ts +8 -17
- package/dist/unplugin.js +8 -6
- package/dist/vite.cjs +7 -7
- package/dist/vite.d.cts +5 -1
- package/dist/vite.d.ts +5 -1
- package/dist/vite.js +4 -4
- package/dist/webpack.cjs +7 -7
- package/dist/webpack.d.cts +5 -1
- package/dist/webpack.d.ts +5 -1
- package/dist/webpack.js +4 -4
- package/package.json +72 -48
- package/dist/chunk-GBIIAZH5.cjs +0 -13
- package/dist/chunk-QXHINXRM.js +0 -11
- package/dist/chunk-UWLQNNZE.cjs +0 -12
- package/dist/config.cjs +0 -13
- package/dist/config.d.cts +0 -45
- package/dist/config.d.ts +0 -45
- package/dist/config.js +0 -4
- package/dist/lib/chunk-35FGUJFD.cjs +0 -2
- package/dist/lib/chunk-DX2VAXZB.cjs +0 -11
- package/dist/lib/chunk-FFT4PWRM.js +0 -1
- package/dist/lib/chunk-GKCWJVF7.cjs +0 -147
- package/dist/lib/chunk-H5JWMXTZ.js +0 -1
- package/dist/lib/chunk-I2DQRMX3.js +0 -1
- package/dist/lib/chunk-K2SFTPN3.cjs +0 -2
- package/dist/lib/chunk-MVIKYHBX.cjs +0 -2
- package/dist/lib/chunk-NQAHFTUW.js +0 -1
- package/dist/lib/chunk-NYNHNTHT.js +0 -1
- package/dist/lib/chunk-VVSEE3JE.cjs +0 -2
- package/dist/lib/chunk-YK4PYVLM.cjs +0 -2
- package/dist/plugin-utils/chunk-K2GWRZPV.js +0 -12
- package/dist/plugin-utils/chunk-VWFJOPKC.cjs +0 -14
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { PLUGIN_NON_HOOK_FIELDS } from './chunk-6MQ6LCVC.js';
|
|
2
2
|
import { SUPPORTED_COMMANDS } from './chunk-2MYPFASJ.js';
|
|
3
|
-
import { StoragePreset } from './chunk-
|
|
3
|
+
import { StoragePreset } from './chunk-575Z57QD.js';
|
|
4
4
|
import { __name } from './chunk-7QVYU63E.js';
|
|
5
5
|
import { transformAsync } from '@babel/core';
|
|
6
6
|
import { formatLogMessage } from '@storm-software/config-tools/logger/console';
|
|
7
7
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
8
8
|
import { toArray } from '@stryke/convert/to-array';
|
|
9
|
-
import {
|
|
10
|
-
import { createDirectory } from '@stryke/fs/helpers';
|
|
9
|
+
import { createDirectorySync, createDirectory } from '@stryke/fs/helpers';
|
|
11
10
|
import { install } from '@stryke/fs/install';
|
|
12
11
|
import { listFilesSync, listFiles } from '@stryke/fs/list-files';
|
|
13
12
|
import { isPackageExists, isPackageListed, doesPackageMatch, getPackageListing } from '@stryke/fs/package-fns';
|
|
@@ -18,6 +17,7 @@ import { replacePath, replaceExtension } from '@stryke/path/replace';
|
|
|
18
17
|
import { isError } from '@stryke/type-checks/is-error';
|
|
19
18
|
import { isFunction } from '@stryke/type-checks/is-function';
|
|
20
19
|
import { isNumber } from '@stryke/type-checks/is-number';
|
|
20
|
+
import { isObject } from '@stryke/type-checks/is-object';
|
|
21
21
|
import { isPromiseLike } from '@stryke/type-checks/is-promise';
|
|
22
22
|
import { isSet } from '@stryke/type-checks/is-set';
|
|
23
23
|
import { isSetObject } from '@stryke/type-checks/is-set-object';
|
|
@@ -27,9 +27,9 @@ import Handlebars from 'handlebars';
|
|
|
27
27
|
import { declare } from '@babel/helper-plugin-utils';
|
|
28
28
|
import * as t from '@babel/types';
|
|
29
29
|
import ts, { flattenDiagnosticMessageText } from 'typescript';
|
|
30
|
-
import {
|
|
31
|
-
import defu7, { defu } from 'defu';
|
|
30
|
+
import defu7, { createDefu, defu } from 'defu';
|
|
32
31
|
import { InMemoryFileSystemHost, Project } from 'ts-morph';
|
|
32
|
+
import { isString } from '@stryke/type-checks/is-string';
|
|
33
33
|
import { getPackageName, hasPackageVersion, getPackageVersion } from '@stryke/string-format/package';
|
|
34
34
|
import { getObjectDiff } from '@donedeal0/superdiff';
|
|
35
35
|
import { readJsonFile, readJsonFileSync } from '@stryke/fs/json';
|
|
@@ -37,8 +37,6 @@ import { StormJSON } from '@stryke/json/storm-json';
|
|
|
37
37
|
import { hasFileExtension, findFilePath, findFileName, relativePath, findFileDotExtensionSafe } from '@stryke/path/file-path-fns';
|
|
38
38
|
import { titleCase } from '@stryke/string-format/title-case';
|
|
39
39
|
import { existsSync, exists } from '@stryke/fs/exists';
|
|
40
|
-
import { writeFileSync, writeFile as writeFile$1 } from '@stryke/fs/write-file';
|
|
41
|
-
import { resolveConfig, format } from 'prettier';
|
|
42
40
|
import { getWorkspaceConfig } from '@storm-software/config-tools/get-config';
|
|
43
41
|
import { loadConfig } from 'c12';
|
|
44
42
|
import { getEnvPaths } from '@stryke/env/get-env-paths';
|
|
@@ -47,33 +45,38 @@ import { hashDirectory } from '@stryke/hash/hash-files';
|
|
|
47
45
|
import { murmurhash } from '@stryke/hash/murmurhash';
|
|
48
46
|
import { getUnique, getUniqueBy } from '@stryke/helpers/get-unique';
|
|
49
47
|
import { omit } from '@stryke/helpers/omit';
|
|
48
|
+
import { fetchRequest } from '@stryke/http/fetch';
|
|
50
49
|
import { isAbsolutePath, isAbsolute } from '@stryke/path/is-type';
|
|
50
|
+
import { joinPaths } from '@stryke/path/join';
|
|
51
51
|
import { isNull } from '@stryke/type-checks/is-null';
|
|
52
|
-
import { isString } from '@stryke/type-checks/is-string';
|
|
53
52
|
import { uuid } from '@stryke/unique-id/uuid';
|
|
54
53
|
import { tsconfigPathsToRegExp, match } from 'bundle-require';
|
|
54
|
+
import { create } from 'flat-cache';
|
|
55
|
+
import { parse } from 'oxc-parser';
|
|
56
|
+
import { Agent, setGlobalDispatcher, interceptors, Response } from 'undici';
|
|
55
57
|
import { createJiti } from 'jiti';
|
|
56
58
|
import { isUndefined } from '@stryke/type-checks/is-undefined';
|
|
57
59
|
import { parseTypeDefinition } from '@stryke/convert/parse-type-definition';
|
|
58
|
-
import { isFile } from '@stryke/fs/is-file';
|
|
60
|
+
import { isDirectory, isFile } from '@stryke/fs/is-file';
|
|
59
61
|
import * as $ from '@stryke/capnp';
|
|
60
62
|
import { readFileBuffer, readFileBufferSync, writeFileBuffer } from '@stryke/fs/buffer';
|
|
61
|
-
import { correctPath, toAbsolutePath } from '@stryke/path/correct-path';
|
|
62
63
|
import { isParentPath } from '@stryke/path/is-parent-path';
|
|
63
64
|
import { prettyBytes } from '@stryke/string-format/pretty-bytes';
|
|
64
|
-
import { create } from 'flat-cache';
|
|
65
65
|
import { Blob } from 'node:buffer';
|
|
66
|
+
import { fileURLToPath } from 'node:url';
|
|
67
|
+
import { resolveConfig, format } from 'prettier';
|
|
66
68
|
import { getLogFn, getLogLevel } from '@storm-software/config-tools/logger';
|
|
67
69
|
import { getColor } from '@storm-software/config-tools/utilities/colors';
|
|
68
70
|
import { noop } from '@stryke/helpers/noop';
|
|
71
|
+
import { correctPath } from '@stryke/path/correct-path';
|
|
69
72
|
import { slash } from '@stryke/path/slash';
|
|
70
73
|
import { readFileSync, readFile } from '@stryke/fs/read-file';
|
|
74
|
+
import { writeFileSync, writeFile } from '@stryke/fs/write-file';
|
|
71
75
|
import { unlinkSync } from 'node:fs';
|
|
72
76
|
import { unlink } from 'node:fs/promises';
|
|
73
77
|
import { resolve } from 'node:path';
|
|
74
78
|
import '@stryke/fs/remove-file';
|
|
75
79
|
import { kebabCase } from '@stryke/string-format/kebab-case';
|
|
76
|
-
import { isObject } from '@stryke/type-checks/is-object';
|
|
77
80
|
|
|
78
81
|
function resolveModulePath(nodePath, state) {
|
|
79
82
|
if (!t.isStringLiteral(nodePath.node)) {
|
|
@@ -189,13 +192,16 @@ var VirtualFileSystemHost = class extends InMemoryFileSystemHost {
|
|
|
189
192
|
this.#context.fs.removeSync(path);
|
|
190
193
|
}
|
|
191
194
|
readDirSync(dirPath) {
|
|
195
|
+
if (!this.#context.fs.isDirectorySync(dirPath)) {
|
|
196
|
+
return [];
|
|
197
|
+
}
|
|
192
198
|
return this.#context.fs.listSync(dirPath).reduce((ret, entry) => {
|
|
193
|
-
const fullPath = this.#context.fs.resolveSync(
|
|
199
|
+
const fullPath = this.#context.fs.resolveSync(entry);
|
|
194
200
|
if (fullPath) {
|
|
195
201
|
ret.push({
|
|
196
202
|
name: entry,
|
|
197
|
-
isDirectory: this.#context.fs.
|
|
198
|
-
isFile: this.#context.fs.
|
|
203
|
+
isDirectory: this.#context.fs.isDirectorySync(fullPath),
|
|
204
|
+
isFile: this.#context.fs.isFileSync(fullPath),
|
|
199
205
|
isSymlink: false
|
|
200
206
|
});
|
|
201
207
|
}
|
|
@@ -203,14 +209,14 @@ var VirtualFileSystemHost = class extends InMemoryFileSystemHost {
|
|
|
203
209
|
}, []);
|
|
204
210
|
}
|
|
205
211
|
async readFile(filePath) {
|
|
206
|
-
if (!this.#context.fs.
|
|
207
|
-
|
|
212
|
+
if (!this.#context.fs.isFileSync(filePath)) {
|
|
213
|
+
return "";
|
|
208
214
|
}
|
|
209
215
|
return await this.#context.fs.read(filePath);
|
|
210
216
|
}
|
|
211
217
|
readFileSync(filePath) {
|
|
212
|
-
if (!this.#context.fs.
|
|
213
|
-
|
|
218
|
+
if (!this.#context.fs.isFileSync(filePath)) {
|
|
219
|
+
return "";
|
|
214
220
|
}
|
|
215
221
|
return this.#context.fs.readSync(filePath);
|
|
216
222
|
}
|
|
@@ -220,9 +226,11 @@ var VirtualFileSystemHost = class extends InMemoryFileSystemHost {
|
|
|
220
226
|
writeFileSync(filePath, fileText) {
|
|
221
227
|
this.#context.fs.writeSync(filePath, fileText);
|
|
222
228
|
}
|
|
223
|
-
async mkdir(
|
|
229
|
+
async mkdir(dirPath) {
|
|
230
|
+
await this.#context.fs.mkdir(dirPath);
|
|
224
231
|
}
|
|
225
|
-
mkdirSync(
|
|
232
|
+
mkdirSync(dirPath) {
|
|
233
|
+
this.#context.fs.mkdirSync(dirPath);
|
|
226
234
|
}
|
|
227
235
|
async move(srcPath, destPath) {
|
|
228
236
|
await this.#context.fs.move(srcPath, destPath);
|
|
@@ -237,16 +245,16 @@ var VirtualFileSystemHost = class extends InMemoryFileSystemHost {
|
|
|
237
245
|
this.#context.fs.copySync(srcPath, destPath);
|
|
238
246
|
}
|
|
239
247
|
async fileExists(filePath) {
|
|
240
|
-
return this.#context.fs.
|
|
248
|
+
return this.#context.fs.isFile(filePath);
|
|
241
249
|
}
|
|
242
250
|
fileExistsSync(filePath) {
|
|
243
|
-
return this.#context.fs.
|
|
251
|
+
return this.#context.fs.isFileSync(filePath);
|
|
244
252
|
}
|
|
245
253
|
async directoryExists(dirPath) {
|
|
246
|
-
return this.#context.fs.
|
|
254
|
+
return this.#context.fs.isDirectory(dirPath);
|
|
247
255
|
}
|
|
248
256
|
directoryExistsSync(dirPath) {
|
|
249
|
-
return this.#context.fs.
|
|
257
|
+
return this.#context.fs.isDirectorySync(dirPath);
|
|
250
258
|
}
|
|
251
259
|
realpathSync(path) {
|
|
252
260
|
return this.#context.fs.resolveSync(path) || path;
|
|
@@ -325,6 +333,14 @@ ${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : dia
|
|
|
325
333
|
return formatTypes(builtinModules);
|
|
326
334
|
}
|
|
327
335
|
__name(emitTypes, "emitTypes");
|
|
336
|
+
var mergeResults = createDefu((obj, key, value) => {
|
|
337
|
+
if (isString(obj[key]) && isString(value)) {
|
|
338
|
+
obj[key] = `${obj[key] || ""}
|
|
339
|
+
${value || ""}`.trim();
|
|
340
|
+
return true;
|
|
341
|
+
}
|
|
342
|
+
return false;
|
|
343
|
+
});
|
|
328
344
|
async function callHook(context, hook, options, ...args) {
|
|
329
345
|
const handlers = context.selectHooks(hook, options);
|
|
330
346
|
if (handlers.length > 0) {
|
|
@@ -332,18 +348,28 @@ async function callHook(context, hook, options, ...args) {
|
|
|
332
348
|
let results = [];
|
|
333
349
|
if (options?.sequential === false) {
|
|
334
350
|
results = await Promise.all(handlers.map(async (handler) => {
|
|
335
|
-
if (!isFunction(handler)) {
|
|
351
|
+
if (!isFunction(handler.handle)) {
|
|
336
352
|
throw new Error(`Plugin hook handler for hook "${hook}" is not a function.`);
|
|
337
353
|
}
|
|
338
|
-
return Promise.resolve(
|
|
354
|
+
return Promise.resolve(
|
|
355
|
+
// eslint-disable-next-line ts/no-unsafe-call
|
|
356
|
+
handler.handle.apply(handler.context, [
|
|
357
|
+
...args
|
|
358
|
+
])
|
|
359
|
+
);
|
|
339
360
|
}));
|
|
340
361
|
} else {
|
|
341
362
|
for (const handler of handlers) {
|
|
342
|
-
if (!isFunction(handler)) {
|
|
363
|
+
if (!isFunction(handler.handle)) {
|
|
343
364
|
throw new Error(`Plugin hook handler for hook "${hook}" is not a function.`);
|
|
344
365
|
}
|
|
345
366
|
if (options?.result === "first" || options?.asNextParam === false) {
|
|
346
|
-
results.push(await Promise.resolve(
|
|
367
|
+
results.push(await Promise.resolve(
|
|
368
|
+
// eslint-disable-next-line ts/no-unsafe-call
|
|
369
|
+
handler.handle.apply(handler.context, [
|
|
370
|
+
...args
|
|
371
|
+
])
|
|
372
|
+
));
|
|
347
373
|
if (options?.result === "first" && isSet(results[results.length - 1])) {
|
|
348
374
|
break;
|
|
349
375
|
}
|
|
@@ -356,11 +382,26 @@ async function callHook(context, hook, options, ...args) {
|
|
|
356
382
|
}
|
|
357
383
|
const result = await Promise.resolve(
|
|
358
384
|
// eslint-disable-next-line ts/no-unsafe-call
|
|
359
|
-
handler.apply(
|
|
385
|
+
handler.handle.apply(handler.context, [
|
|
386
|
+
...sequenceArgs
|
|
387
|
+
])
|
|
360
388
|
);
|
|
361
|
-
|
|
362
|
-
result
|
|
363
|
-
|
|
389
|
+
if (result) {
|
|
390
|
+
if (options?.result === "last") {
|
|
391
|
+
results = [
|
|
392
|
+
result
|
|
393
|
+
];
|
|
394
|
+
} else if (isString(result)) {
|
|
395
|
+
results = [
|
|
396
|
+
`${isString(results[0]) ? results[0] || "" : ""}
|
|
397
|
+
${result || ""}`.trim()
|
|
398
|
+
];
|
|
399
|
+
} else if (isObject(result)) {
|
|
400
|
+
results = [
|
|
401
|
+
mergeResults(result, results[0] ?? {})
|
|
402
|
+
];
|
|
403
|
+
}
|
|
404
|
+
}
|
|
364
405
|
}
|
|
365
406
|
}
|
|
366
407
|
}
|
|
@@ -526,33 +567,20 @@ ${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && err
|
|
|
526
567
|
};
|
|
527
568
|
}
|
|
528
569
|
__name(getParsedTypeScriptConfig, "getParsedTypeScriptConfig");
|
|
529
|
-
async function writeFile(log, filepath, content, skipFormat = false) {
|
|
530
|
-
try {
|
|
531
|
-
if (skipFormat) {
|
|
532
|
-
await writeFile$1(filepath, content);
|
|
533
|
-
} else {
|
|
534
|
-
const config = await resolveConfig(filepath);
|
|
535
|
-
const formatted = await format(content, {
|
|
536
|
-
...config ?? {},
|
|
537
|
-
filepath
|
|
538
|
-
});
|
|
539
|
-
await writeFile$1(filepath, formatted || "");
|
|
540
|
-
}
|
|
541
|
-
} catch (error) {
|
|
542
|
-
log(LogLevelLabel.ERROR, `Failed to write file ${filepath} to disk
|
|
543
|
-
${error?.message ? error.message : ""}`);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
__name(writeFile, "writeFile");
|
|
547
570
|
|
|
548
571
|
// src/internal/helpers/resolve-tsconfig.ts
|
|
572
|
+
function getTsconfigDtsPath(context) {
|
|
573
|
+
const dtsRelativePath = joinPaths$1(relativePath(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot), findFilePath(context.dtsPath)), findFileName(context.dtsPath));
|
|
574
|
+
return dtsRelativePath;
|
|
575
|
+
}
|
|
576
|
+
__name(getTsconfigDtsPath, "getTsconfigDtsPath");
|
|
549
577
|
async function resolveTsconfigChanges(context) {
|
|
550
578
|
const tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
|
|
551
579
|
const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
552
580
|
const tsconfigJson = await readJsonFile(tsconfigFilePath);
|
|
553
581
|
tsconfigJson.compilerOptions ??= {};
|
|
554
582
|
if (context.config.output.dts !== false) {
|
|
555
|
-
const dtsRelativePath =
|
|
583
|
+
const dtsRelativePath = getTsconfigDtsPath(context);
|
|
556
584
|
if (!tsconfigJson.include?.some((filePattern) => isIncludeMatchFound(filePattern, [
|
|
557
585
|
context.dtsPath,
|
|
558
586
|
dtsRelativePath
|
|
@@ -594,7 +622,7 @@ async function initializeTsconfig(context) {
|
|
|
594
622
|
context.tsconfig.originalTsconfigJson = await readJsonFile(tsconfigFilePath);
|
|
595
623
|
context.tsconfig.tsconfigJson = await resolveTsconfigChanges(context);
|
|
596
624
|
context.log(LogLevelLabel.TRACE, "Writing updated TypeScript configuration (tsconfig.json) file to disk.");
|
|
597
|
-
await
|
|
625
|
+
await context.fs.write(tsconfigFilePath, StormJSON.stringify(context.tsconfig.tsconfigJson));
|
|
598
626
|
context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw, context.tsconfig.originalTsconfigJson);
|
|
599
627
|
}
|
|
600
628
|
__name(initializeTsconfig, "initializeTsconfig");
|
|
@@ -643,13 +671,11 @@ async function resolveTsconfig(context) {
|
|
|
643
671
|
`).join("\n")}
|
|
644
672
|
`);
|
|
645
673
|
}
|
|
646
|
-
await
|
|
674
|
+
await context.fs.write(context.tsconfig.tsconfigFilePath, StormJSON.stringify(updateTsconfigJson));
|
|
647
675
|
context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
648
676
|
if (!context.tsconfig) {
|
|
649
677
|
throw new Error("Failed to parse the TypeScript configuration file.");
|
|
650
678
|
}
|
|
651
|
-
context.tsconfig.tsconfigJson.compilerOptions ??= {};
|
|
652
|
-
context.tsconfig.tsconfigJson.compilerOptions.strict = false;
|
|
653
679
|
}
|
|
654
680
|
__name(resolveTsconfig, "resolveTsconfig");
|
|
655
681
|
var DEFAULT_ENVIRONMENT = "default";
|
|
@@ -829,7 +855,7 @@ function replacePathTokens(context, path) {
|
|
|
829
855
|
if (!path) {
|
|
830
856
|
return path;
|
|
831
857
|
}
|
|
832
|
-
return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
|
|
858
|
+
return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
|
|
833
859
|
}
|
|
834
860
|
__name(replacePathTokens, "replacePathTokens");
|
|
835
861
|
function resolveEntryInputFile(context, typeDefinition) {
|
|
@@ -1163,20 +1189,17 @@ function normalizePath(path, builtinsPath, prefix = "powerlines") {
|
|
|
1163
1189
|
return isAbsolutePath(path) ? path : isValidId(toFilePath(path), prefix) ? normalizeId(toFilePath(path), prefix).replace(new RegExp(`^${prefix.replace(/:$/, "")}:`), builtinsPath) : toFilePath(path);
|
|
1164
1190
|
}
|
|
1165
1191
|
__name(normalizePath, "normalizePath");
|
|
1166
|
-
function
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
return key.startsWith(base) && key[key.length - 1] !== "$";
|
|
1176
|
-
}
|
|
1177
|
-
return key[key.length - 1] !== "$";
|
|
1192
|
+
function normalizeGlobPatterns(workspaceRoot, patterns) {
|
|
1193
|
+
return getUnique(toArray(patterns).map((pattern) => {
|
|
1194
|
+
if (isSetObject(pattern) && (isSetString(pattern.input) || isSetString(pattern.glob))) {
|
|
1195
|
+
return joinPaths(pattern.input || workspaceRoot, pattern.glob || "**/*");
|
|
1196
|
+
} else if (!isSetString(pattern)) {
|
|
1197
|
+
return void 0;
|
|
1198
|
+
}
|
|
1199
|
+
return pattern;
|
|
1200
|
+
}).filter(isSetString));
|
|
1178
1201
|
}
|
|
1179
|
-
__name(
|
|
1202
|
+
__name(normalizeGlobPatterns, "normalizeGlobPatterns");
|
|
1180
1203
|
var BaseStorageAdapter = class {
|
|
1181
1204
|
static {
|
|
1182
1205
|
__name(this, "BaseStorageAdapter");
|
|
@@ -1231,6 +1254,21 @@ var BaseStorageAdapter = class {
|
|
|
1231
1254
|
}
|
|
1232
1255
|
}
|
|
1233
1256
|
/**
|
|
1257
|
+
* Synchronously creates a directory at the specified path.
|
|
1258
|
+
*
|
|
1259
|
+
* @param _ - The path of the directory to create.
|
|
1260
|
+
*/
|
|
1261
|
+
mkdirSync(_) {
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* Creates a directory at the specified path.
|
|
1265
|
+
*
|
|
1266
|
+
* @param dirPath - The path of the directory to create.
|
|
1267
|
+
*/
|
|
1268
|
+
async mkdir(dirPath) {
|
|
1269
|
+
return Promise.resolve(this.mkdirSync(dirPath));
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1234
1272
|
* Asynchronously removes a key from the storage.
|
|
1235
1273
|
*
|
|
1236
1274
|
* @param key - The key to remove.
|
|
@@ -1279,6 +1317,42 @@ var BaseStorageAdapter = class {
|
|
|
1279
1317
|
return this.listSync(base);
|
|
1280
1318
|
}
|
|
1281
1319
|
/**
|
|
1320
|
+
* Synchronously checks if the given key is a directory.
|
|
1321
|
+
*
|
|
1322
|
+
* @param _ - The key to check.
|
|
1323
|
+
* @returns `true` if the key is a directory, otherwise `false`.
|
|
1324
|
+
*/
|
|
1325
|
+
isDirectorySync(_) {
|
|
1326
|
+
return false;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Checks if the given key is a directory.
|
|
1330
|
+
*
|
|
1331
|
+
* @param key - The key to check.
|
|
1332
|
+
* @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
|
|
1333
|
+
*/
|
|
1334
|
+
async isDirectory(key) {
|
|
1335
|
+
return Promise.resolve(this.isDirectorySync(key));
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* Synchronously checks if the given key is a file.
|
|
1339
|
+
*
|
|
1340
|
+
* @param key - The key to check.
|
|
1341
|
+
* @returns `true` if the key is a file, otherwise `false`.
|
|
1342
|
+
*/
|
|
1343
|
+
isFileSync(key) {
|
|
1344
|
+
return this.existsSync(key) && !this.isDirectorySync(key);
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Checks if the given key is a file.
|
|
1348
|
+
*
|
|
1349
|
+
* @param key - The key to check.
|
|
1350
|
+
* @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
|
|
1351
|
+
*/
|
|
1352
|
+
async isFile(key) {
|
|
1353
|
+
return Promise.resolve(this.isFileSync(key));
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1282
1356
|
* Disposes of the storage adapter, releasing any held resources.
|
|
1283
1357
|
*
|
|
1284
1358
|
* @returns A promise that resolves when the disposal is complete.
|
|
@@ -1391,7 +1465,7 @@ var FileSystemStorageAdapter = class extends BaseStorageAdapter {
|
|
|
1391
1465
|
*/
|
|
1392
1466
|
async set(key, value) {
|
|
1393
1467
|
if (!this.options.isReadOnly) {
|
|
1394
|
-
return writeFile
|
|
1468
|
+
return writeFile(this.resolve(key), value);
|
|
1395
1469
|
}
|
|
1396
1470
|
}
|
|
1397
1471
|
/**
|
|
@@ -1419,6 +1493,22 @@ var FileSystemStorageAdapter = class extends BaseStorageAdapter {
|
|
|
1419
1493
|
}
|
|
1420
1494
|
}
|
|
1421
1495
|
/**
|
|
1496
|
+
* Synchronously creates a directory at the specified path.
|
|
1497
|
+
*
|
|
1498
|
+
* @param dirPath - The path of the directory to create.
|
|
1499
|
+
*/
|
|
1500
|
+
mkdirSync(dirPath) {
|
|
1501
|
+
createDirectorySync(this.resolve(dirPath));
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Creates a directory at the specified path.
|
|
1505
|
+
*
|
|
1506
|
+
* @param dirPath - The path of the directory to create.
|
|
1507
|
+
*/
|
|
1508
|
+
async mkdir(dirPath) {
|
|
1509
|
+
await createDirectory(this.resolve(dirPath));
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1422
1512
|
* Lists all keys under a given base path synchronously.
|
|
1423
1513
|
*
|
|
1424
1514
|
* @param base - The base path to list keys from.
|
|
@@ -1444,6 +1534,24 @@ var FileSystemStorageAdapter = class extends BaseStorageAdapter {
|
|
|
1444
1534
|
ignore: this.options.ignore
|
|
1445
1535
|
}).catch(ignoreNotfound).then((r) => r || []);
|
|
1446
1536
|
}
|
|
1537
|
+
/**
|
|
1538
|
+
* Synchronously checks if the given key is a directory.
|
|
1539
|
+
*
|
|
1540
|
+
* @param key - The key to check.
|
|
1541
|
+
* @returns `true` if the key is a directory, otherwise `false`.
|
|
1542
|
+
*/
|
|
1543
|
+
isDirectorySync(key) {
|
|
1544
|
+
return isDirectory(this.resolve(key));
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Synchronously checks if the given key is a file.
|
|
1548
|
+
*
|
|
1549
|
+
* @param key - The key to check.
|
|
1550
|
+
* @returns `true` if the key is a file, otherwise `false`.
|
|
1551
|
+
*/
|
|
1552
|
+
isFileSync(key) {
|
|
1553
|
+
return !isFile(this.resolve(key));
|
|
1554
|
+
}
|
|
1447
1555
|
};
|
|
1448
1556
|
var VirtualStorageAdapter = class extends BaseStorageAdapter {
|
|
1449
1557
|
static {
|
|
@@ -1574,7 +1682,11 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
1574
1682
|
* @returns The normalized module id.
|
|
1575
1683
|
*/
|
|
1576
1684
|
#normalizeId(id) {
|
|
1577
|
-
|
|
1685
|
+
let normalized = id;
|
|
1686
|
+
if (isParentPath(normalized, this.#context.builtinsPath)) {
|
|
1687
|
+
normalized = replacePath(normalized, this.#context.builtinsPath);
|
|
1688
|
+
}
|
|
1689
|
+
return normalizeId(normalized, this.#context.config.output.builtinPrefix);
|
|
1578
1690
|
}
|
|
1579
1691
|
/**
|
|
1580
1692
|
* Normalizes a given path by resolving it against the project root, workspace root, and built-ins path.
|
|
@@ -1583,7 +1695,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
1583
1695
|
* @returns The normalized path.
|
|
1584
1696
|
*/
|
|
1585
1697
|
#normalizePath(path) {
|
|
1586
|
-
return normalizePath(path, this.#context.builtinsPath, this.#context.config.output.builtinPrefix);
|
|
1698
|
+
return normalizePath(path.includes("{") || path.includes("}") ? replacePathTokens(this.#context, path) : path, this.#context.builtinsPath, this.#context.config.output.builtinPrefix);
|
|
1587
1699
|
}
|
|
1588
1700
|
/**
|
|
1589
1701
|
* Builds a regular expression from a string pattern for path matching.
|
|
@@ -1810,26 +1922,65 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
1810
1922
|
return this.#getStorage(resolved)?.adapter?.name === "virtual";
|
|
1811
1923
|
}
|
|
1812
1924
|
/**
|
|
1925
|
+
* Checks if a path is a directory in the virtual file system (VFS).
|
|
1926
|
+
*
|
|
1927
|
+
* @param path - The path to check.
|
|
1928
|
+
* @returns `true` if the path is a directory, otherwise `false`.
|
|
1929
|
+
*/
|
|
1930
|
+
isDirectorySync(path) {
|
|
1931
|
+
const resolved = this.resolveSync(path);
|
|
1932
|
+
if (!resolved) {
|
|
1933
|
+
return false;
|
|
1934
|
+
}
|
|
1935
|
+
return !!(this.existsSync(resolved) && this.#getStorage(resolved)?.adapter?.isDirectorySync(resolved));
|
|
1936
|
+
}
|
|
1937
|
+
/**
|
|
1938
|
+
* Checks if a path is a directory in the virtual file system (VFS).
|
|
1939
|
+
*
|
|
1940
|
+
* @param path - The path to check.
|
|
1941
|
+
* @returns `true` if the path is a directory, otherwise `false`.
|
|
1942
|
+
*/
|
|
1943
|
+
async isDirectory(path) {
|
|
1944
|
+
const resolved = await this.resolve(path);
|
|
1945
|
+
if (!resolved) {
|
|
1946
|
+
return false;
|
|
1947
|
+
}
|
|
1948
|
+
return !!(await this.exists(resolved) && await this.#getStorage(resolved)?.adapter?.isDirectory(resolved));
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* Checks if a path is a file in the virtual file system (VFS).
|
|
1952
|
+
*
|
|
1953
|
+
* @param path - The path to check.
|
|
1954
|
+
* @returns `true` if the path is a file, otherwise `false`.
|
|
1955
|
+
*/
|
|
1956
|
+
isFileSync(path) {
|
|
1957
|
+
const resolved = this.resolveSync(path);
|
|
1958
|
+
if (!resolved) {
|
|
1959
|
+
return false;
|
|
1960
|
+
}
|
|
1961
|
+
return this.#getStorage(resolved)?.adapter?.isFileSync(resolved) ?? false;
|
|
1962
|
+
}
|
|
1963
|
+
/**
|
|
1964
|
+
* Checks if a path is a file in the virtual file system (VFS).
|
|
1965
|
+
*
|
|
1966
|
+
* @param path - The path to check.
|
|
1967
|
+
* @returns `true` if the path is a file, otherwise `false`.
|
|
1968
|
+
*/
|
|
1969
|
+
async isFile(path) {
|
|
1970
|
+
const resolved = await this.resolve(path);
|
|
1971
|
+
if (!resolved) {
|
|
1972
|
+
return false;
|
|
1973
|
+
}
|
|
1974
|
+
return await this.#getStorage(resolved)?.adapter?.isFile(resolved) ?? false;
|
|
1975
|
+
}
|
|
1976
|
+
/**
|
|
1813
1977
|
* Lists files in a given path.
|
|
1814
1978
|
*
|
|
1815
1979
|
* @param path - The path to list files from.
|
|
1816
1980
|
* @returns An array of file names in the specified path.
|
|
1817
1981
|
*/
|
|
1818
1982
|
listSync(path) {
|
|
1819
|
-
|
|
1820
|
-
const allKeys = [];
|
|
1821
|
-
for (const storage of this.#getStorages(path, true)) {
|
|
1822
|
-
for (const key of storage.adapter.listSync(storage.relativeBase)) {
|
|
1823
|
-
if (!maskedMounts.some((p) => `${storage.base}${normalizeKey(key)}`.startsWith(p))) {
|
|
1824
|
-
allKeys.push(`${storage.base}${normalizeKey(key)}`);
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
maskedMounts = [
|
|
1828
|
-
storage.base,
|
|
1829
|
-
...maskedMounts.filter((p) => !p.startsWith(storage.base))
|
|
1830
|
-
];
|
|
1831
|
-
}
|
|
1832
|
-
return allKeys.filter((key) => filterKeyByBase(key, path));
|
|
1983
|
+
return getUnique(this.#getStorages(path, true).map((storage) => storage.adapter.listSync(storage.relativeBase ? storage.base ? appendPath(storage.relativeBase, storage.base) : storage.relativeBase : storage.base)).flat());
|
|
1833
1984
|
}
|
|
1834
1985
|
/**
|
|
1835
1986
|
* Lists files in a given path.
|
|
@@ -1838,20 +1989,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
1838
1989
|
* @returns An array of file names in the specified path.
|
|
1839
1990
|
*/
|
|
1840
1991
|
async list(path) {
|
|
1841
|
-
|
|
1842
|
-
const allKeys = [];
|
|
1843
|
-
for (const storage of this.#getStorages(path, true)) {
|
|
1844
|
-
for (const key of await storage.adapter.list(storage.relativeBase)) {
|
|
1845
|
-
if (!maskedMounts.some((p) => `${storage.base}${normalizeKey(key)}`.startsWith(p))) {
|
|
1846
|
-
allKeys.push(`${storage.base}${normalizeKey(key)}`);
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
maskedMounts = [
|
|
1850
|
-
storage.base,
|
|
1851
|
-
...maskedMounts.filter((p) => !p.startsWith(storage.base))
|
|
1852
|
-
];
|
|
1853
|
-
}
|
|
1854
|
-
return allKeys.filter((key) => filterKeyByBase(key, path));
|
|
1992
|
+
return getUnique((await Promise.all(this.#getStorages(path, true).map(async (storage) => storage.adapter.list(storage.relativeBase ? storage.base ? appendPath(storage.relativeBase, storage.base) : storage.relativeBase : storage.base)))).flat());
|
|
1855
1993
|
}
|
|
1856
1994
|
/**
|
|
1857
1995
|
* Removes a file in the virtual file system (VFS).
|
|
@@ -1903,12 +2041,16 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
1903
2041
|
*/
|
|
1904
2042
|
async glob(patterns) {
|
|
1905
2043
|
const results = [];
|
|
1906
|
-
for (const pattern of
|
|
2044
|
+
for (const pattern of normalizeGlobPatterns(this.#context.workspaceConfig.workspaceRoot, patterns)) {
|
|
1907
2045
|
const normalized = this.#normalizePath(pattern);
|
|
1908
2046
|
if (!/[*?[\]{}]/.test(normalized) && !normalized.includes("**")) {
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
2047
|
+
if (this.isDirectorySync(normalized)) {
|
|
2048
|
+
results.push(...await this.list(normalized));
|
|
2049
|
+
} else {
|
|
2050
|
+
const resolved = await this.resolve(normalized);
|
|
2051
|
+
if (resolved && !results.includes(resolved)) {
|
|
2052
|
+
results.push(resolved);
|
|
2053
|
+
}
|
|
1912
2054
|
}
|
|
1913
2055
|
continue;
|
|
1914
2056
|
}
|
|
@@ -1934,12 +2076,16 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
1934
2076
|
*/
|
|
1935
2077
|
globSync(patterns) {
|
|
1936
2078
|
const results = [];
|
|
1937
|
-
for (const pattern of
|
|
2079
|
+
for (const pattern of normalizeGlobPatterns(this.#context.workspaceConfig.workspaceRoot, patterns)) {
|
|
1938
2080
|
const normalized = this.#normalizePath(pattern);
|
|
1939
2081
|
if (!/[*?[\]{}]/.test(normalized) && !normalized.includes("**")) {
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
2082
|
+
if (this.isDirectorySync(normalized)) {
|
|
2083
|
+
results.push(...this.listSync(normalized));
|
|
2084
|
+
} else {
|
|
2085
|
+
const resolved = this.resolveSync(normalized);
|
|
2086
|
+
if (resolved && !results.includes(resolved)) {
|
|
2087
|
+
results.push(resolved);
|
|
2088
|
+
}
|
|
1943
2089
|
}
|
|
1944
2090
|
continue;
|
|
1945
2091
|
}
|
|
@@ -1965,20 +2111,27 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
1965
2111
|
* @param destPath - The destination path to copy to
|
|
1966
2112
|
*/
|
|
1967
2113
|
async copy(srcPath, destPath) {
|
|
1968
|
-
|
|
1969
|
-
|
|
2114
|
+
const src = srcPath instanceof URL ? fileURLToPath(srcPath) : srcPath;
|
|
2115
|
+
const dest = destPath instanceof URL ? fileURLToPath(destPath) : destPath;
|
|
2116
|
+
if (!isSetString(src) && (!isSetObject(src) || !isSetString(src.input)) || !isSetString(dest)) {
|
|
2117
|
+
return;
|
|
2118
|
+
}
|
|
2119
|
+
const sourceStr = isString(src) ? src : src.input ? src.input : this.#context.workspaceConfig.workspaceRoot;
|
|
2120
|
+
const source = await this.resolve(sourceStr);
|
|
2121
|
+
if (!source) {
|
|
2122
|
+
return;
|
|
2123
|
+
}
|
|
2124
|
+
if (this.isDirectorySync(source) || isSetString(src) && src.includes("*") || isSetObject(src) && isSetString(src.glob)) {
|
|
2125
|
+
await Promise.all((await this.glob(src)).map(async (file) => {
|
|
2126
|
+
return this.copy(file, appendPath(replacePath(file, sourceStr), dest));
|
|
2127
|
+
}));
|
|
2128
|
+
} else {
|
|
2129
|
+
const content = await this.read(source);
|
|
1970
2130
|
if (content !== void 0) {
|
|
1971
|
-
await this.write(
|
|
2131
|
+
await this.write(this.#normalizePath(dest), content, {
|
|
2132
|
+
skipFormat: true
|
|
2133
|
+
});
|
|
1972
2134
|
}
|
|
1973
|
-
} else {
|
|
1974
|
-
await Promise.all((await this.list(srcPath)).map(async (file) => {
|
|
1975
|
-
const relativePath2 = file.replace(this.#normalizePath(srcPath), "");
|
|
1976
|
-
const destinationPath = this.#normalizePath(appendPath(destPath, relativePath2));
|
|
1977
|
-
const content = await this.read(file);
|
|
1978
|
-
if (content !== void 0) {
|
|
1979
|
-
await this.write(destinationPath, content);
|
|
1980
|
-
}
|
|
1981
|
-
}));
|
|
1982
2135
|
}
|
|
1983
2136
|
}
|
|
1984
2137
|
/**
|
|
@@ -1988,20 +2141,27 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
1988
2141
|
* @param destPath - The destination path to copy to
|
|
1989
2142
|
*/
|
|
1990
2143
|
copySync(srcPath, destPath) {
|
|
1991
|
-
|
|
1992
|
-
|
|
2144
|
+
const src = srcPath instanceof URL ? fileURLToPath(srcPath) : srcPath;
|
|
2145
|
+
const dest = destPath instanceof URL ? fileURLToPath(destPath) : destPath;
|
|
2146
|
+
if (!isSetString(src) && (!isSetObject(src) || !isSetString(src.input)) || !isSetString(dest)) {
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
const sourceStr = isString(src) ? src : src.input ? src.input : this.#context.workspaceConfig.workspaceRoot;
|
|
2150
|
+
const source = this.resolveSync(sourceStr);
|
|
2151
|
+
if (!source) {
|
|
2152
|
+
return;
|
|
2153
|
+
}
|
|
2154
|
+
if (this.isDirectorySync(source) || isSetString(src) && src.includes("*") || isSetObject(src) && isSetString(src.glob)) {
|
|
2155
|
+
this.globSync(src).map((file) => {
|
|
2156
|
+
return this.copySync(file, appendPath(findFilePath(replacePath(file, sourceStr)), dest));
|
|
2157
|
+
});
|
|
2158
|
+
} else {
|
|
2159
|
+
const content = this.readSync(source);
|
|
1993
2160
|
if (content !== void 0) {
|
|
1994
|
-
this.writeSync(hasFileExtension(
|
|
2161
|
+
this.writeSync(this.#normalizePath(hasFileExtension(dest) ? dest : appendPath(findFileName(source), dest)), content, {
|
|
2162
|
+
skipFormat: true
|
|
2163
|
+
});
|
|
1995
2164
|
}
|
|
1996
|
-
} else {
|
|
1997
|
-
this.listSync(srcPath).forEach((file) => {
|
|
1998
|
-
const relativePath2 = file.replace(this.#normalizePath(srcPath), "");
|
|
1999
|
-
const destinationPath = this.#normalizePath(appendPath(destPath, relativePath2));
|
|
2000
|
-
const content = this.readSync(file);
|
|
2001
|
-
if (content !== void 0) {
|
|
2002
|
-
this.writeSync(destinationPath, content);
|
|
2003
|
-
}
|
|
2004
|
-
});
|
|
2005
2165
|
}
|
|
2006
2166
|
}
|
|
2007
2167
|
/**
|
|
@@ -2088,15 +2248,15 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2088
2248
|
}
|
|
2089
2249
|
}
|
|
2090
2250
|
const { relativeKey, adapter } = this.#getStorage(path);
|
|
2091
|
-
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(
|
|
2092
|
-
const id = options?.meta?.id || this.#normalizeId(
|
|
2251
|
+
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob(toArray(code)).size)})`);
|
|
2252
|
+
const id = options?.meta?.id || this.#normalizeId(relativeKey);
|
|
2093
2253
|
this.#metadata[id] = {
|
|
2094
2254
|
variant: "normal",
|
|
2095
2255
|
timestamp: Date.now(),
|
|
2096
2256
|
...options.meta ?? {}
|
|
2097
2257
|
};
|
|
2098
|
-
this.#paths[id] = this.#normalizePath(
|
|
2099
|
-
this.#ids[this.#normalizePath(
|
|
2258
|
+
this.#paths[id] = this.#normalizePath(relativeKey);
|
|
2259
|
+
this.#ids[this.#normalizePath(relativeKey)] = id;
|
|
2100
2260
|
return adapter.set(relativeKey, code);
|
|
2101
2261
|
}
|
|
2102
2262
|
/**
|
|
@@ -2108,18 +2268,34 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2108
2268
|
*/
|
|
2109
2269
|
writeSync(path, data = "", options = {}) {
|
|
2110
2270
|
const { relativeKey, adapter } = this.#getStorage(path);
|
|
2111
|
-
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(
|
|
2112
|
-
const id = options?.meta?.id || this.#normalizeId(
|
|
2271
|
+
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} file to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob(toArray(data)).size)})`);
|
|
2272
|
+
const id = options?.meta?.id || this.#normalizeId(relativeKey);
|
|
2113
2273
|
this.#metadata[id] = {
|
|
2114
2274
|
variant: "normal",
|
|
2115
2275
|
timestamp: Date.now(),
|
|
2116
2276
|
...options.meta ?? {}
|
|
2117
2277
|
};
|
|
2118
|
-
this.#paths[id] = this.#normalizePath(
|
|
2119
|
-
this.#ids[this.#normalizePath(
|
|
2278
|
+
this.#paths[id] = this.#normalizePath(relativeKey);
|
|
2279
|
+
this.#ids[this.#normalizePath(relativeKey)] = id;
|
|
2120
2280
|
return adapter.setSync(relativeKey, data);
|
|
2121
2281
|
}
|
|
2122
2282
|
/**
|
|
2283
|
+
* Synchronously creates a directory at the specified path.
|
|
2284
|
+
*
|
|
2285
|
+
* @param dirPath - The path of the directory to create.
|
|
2286
|
+
*/
|
|
2287
|
+
mkdirSync(dirPath) {
|
|
2288
|
+
return this.#getStorage(dirPath)?.adapter?.mkdirSync(dirPath);
|
|
2289
|
+
}
|
|
2290
|
+
/**
|
|
2291
|
+
* Creates a directory at the specified path.
|
|
2292
|
+
*
|
|
2293
|
+
* @param path - The path of the directory to create.
|
|
2294
|
+
*/
|
|
2295
|
+
async mkdir(path) {
|
|
2296
|
+
return this.#getStorage(path)?.adapter?.mkdir(path);
|
|
2297
|
+
}
|
|
2298
|
+
/**
|
|
2123
2299
|
* Retrieves the metadata of a file in the virtual file system (VFS).
|
|
2124
2300
|
*
|
|
2125
2301
|
* @param pathOrId - The path or ID of the file to retrieve metadata for.
|
|
@@ -2149,11 +2325,15 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2149
2325
|
* @returns A promise that resolves to the resolved module path.
|
|
2150
2326
|
*/
|
|
2151
2327
|
async resolve(id, importer, options = {}) {
|
|
2152
|
-
|
|
2153
|
-
|
|
2328
|
+
let path = id;
|
|
2329
|
+
if (path.includes("{") || path.includes("}")) {
|
|
2330
|
+
path = replacePathTokens(this.#context, path);
|
|
2331
|
+
}
|
|
2332
|
+
if (isAbsolutePath(path)) {
|
|
2333
|
+
return path;
|
|
2154
2334
|
}
|
|
2155
2335
|
const resolverCacheKey = murmurhash({
|
|
2156
|
-
|
|
2336
|
+
path: this.#normalizeId(path),
|
|
2157
2337
|
importer,
|
|
2158
2338
|
options
|
|
2159
2339
|
});
|
|
@@ -2164,7 +2344,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2164
2344
|
return result;
|
|
2165
2345
|
}
|
|
2166
2346
|
}
|
|
2167
|
-
result = this.paths[this.#normalizeId(
|
|
2347
|
+
result = this.paths[this.#normalizeId(path)];
|
|
2168
2348
|
if (!result) {
|
|
2169
2349
|
const paths = options.paths ?? [];
|
|
2170
2350
|
if (importer && !paths.includes(importer)) {
|
|
@@ -2173,8 +2353,8 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2173
2353
|
paths.push(this.#context.workspaceConfig.workspaceRoot);
|
|
2174
2354
|
paths.push(appendPath(this.#context.config.projectRoot, this.#context.workspaceConfig.workspaceRoot));
|
|
2175
2355
|
paths.push(appendPath(this.#context.config.sourceRoot, this.#context.workspaceConfig.workspaceRoot));
|
|
2176
|
-
paths.push(...Object.keys(this.#context.tsconfig
|
|
2177
|
-
for (const combination of getResolutionCombinations(
|
|
2356
|
+
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
|
|
2357
|
+
for (const combination of getResolutionCombinations(path, {
|
|
2178
2358
|
paths
|
|
2179
2359
|
})) {
|
|
2180
2360
|
const { relativeKey, adapter } = this.#getStorage(combination);
|
|
@@ -2183,19 +2363,18 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2183
2363
|
break;
|
|
2184
2364
|
}
|
|
2185
2365
|
}
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2366
|
+
if (!result) {
|
|
2367
|
+
try {
|
|
2368
|
+
result = await resolve$1(path, {
|
|
2369
|
+
...options,
|
|
2370
|
+
paths
|
|
2371
|
+
});
|
|
2372
|
+
} catch {
|
|
2373
|
+
}
|
|
2192
2374
|
}
|
|
2193
2375
|
}
|
|
2194
|
-
if (result) {
|
|
2195
|
-
|
|
2196
|
-
if (!this.#context.config.skipCache) {
|
|
2197
|
-
this.resolverCache.set(resolverCacheKey, result);
|
|
2198
|
-
}
|
|
2376
|
+
if (result && !this.#context.config.skipCache) {
|
|
2377
|
+
this.resolverCache.set(resolverCacheKey, result);
|
|
2199
2378
|
}
|
|
2200
2379
|
return result;
|
|
2201
2380
|
}
|
|
@@ -2216,17 +2395,21 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2216
2395
|
* @returns The resolved module path.
|
|
2217
2396
|
*/
|
|
2218
2397
|
resolveSync(id, importer, options = {}) {
|
|
2219
|
-
|
|
2220
|
-
|
|
2398
|
+
let path = id;
|
|
2399
|
+
if (path.includes("{") || path.includes("}")) {
|
|
2400
|
+
path = replacePathTokens(this.#context, path);
|
|
2401
|
+
}
|
|
2402
|
+
if (isAbsolutePath(path)) {
|
|
2403
|
+
return path;
|
|
2221
2404
|
}
|
|
2222
2405
|
let result;
|
|
2223
2406
|
if (!this.#context.config.skipCache) {
|
|
2224
|
-
result = this.resolverCache.get(this.#normalizeId(
|
|
2407
|
+
result = this.resolverCache.get(this.#normalizeId(path));
|
|
2225
2408
|
if (result) {
|
|
2226
2409
|
return result;
|
|
2227
2410
|
}
|
|
2228
2411
|
}
|
|
2229
|
-
result = this.paths[this.#normalizeId(
|
|
2412
|
+
result = this.paths[this.#normalizeId(path)];
|
|
2230
2413
|
if (!result) {
|
|
2231
2414
|
const paths = options.paths ?? [];
|
|
2232
2415
|
if (importer && !paths.includes(importer)) {
|
|
@@ -2235,8 +2418,8 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2235
2418
|
paths.push(this.#context.workspaceConfig.workspaceRoot);
|
|
2236
2419
|
paths.push(appendPath(this.#context.config.projectRoot, this.#context.workspaceConfig.workspaceRoot));
|
|
2237
2420
|
paths.push(appendPath(this.#context.config.sourceRoot, this.#context.workspaceConfig.workspaceRoot));
|
|
2238
|
-
paths.push(...Object.keys(this.#context.tsconfig
|
|
2239
|
-
for (const combination of getResolutionCombinations(
|
|
2421
|
+
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
|
|
2422
|
+
for (const combination of getResolutionCombinations(path, {
|
|
2240
2423
|
paths
|
|
2241
2424
|
})) {
|
|
2242
2425
|
const { relativeKey, adapter } = this.#getStorage(combination);
|
|
@@ -2245,18 +2428,18 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2245
2428
|
break;
|
|
2246
2429
|
}
|
|
2247
2430
|
}
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2431
|
+
if (!result) {
|
|
2432
|
+
try {
|
|
2433
|
+
result = resolveSync(path, {
|
|
2434
|
+
...options,
|
|
2435
|
+
paths
|
|
2436
|
+
});
|
|
2437
|
+
} catch {
|
|
2438
|
+
}
|
|
2253
2439
|
}
|
|
2254
2440
|
}
|
|
2255
|
-
if (result) {
|
|
2256
|
-
|
|
2257
|
-
if (!this.#context.config.skipCache) {
|
|
2258
|
-
this.resolverCache.set(this.#normalizeId(id), result);
|
|
2259
|
-
}
|
|
2441
|
+
if (result && !this.#context.config.skipCache) {
|
|
2442
|
+
this.resolverCache.set(this.#normalizeId(path), result);
|
|
2260
2443
|
}
|
|
2261
2444
|
return result;
|
|
2262
2445
|
}
|
|
@@ -2350,16 +2533,29 @@ __name(writeMetaFile, "writeMetaFile");
|
|
|
2350
2533
|
|
|
2351
2534
|
// src/lib/contexts/context.ts
|
|
2352
2535
|
var configCache = /* @__PURE__ */ new WeakMap();
|
|
2536
|
+
var agent = new Agent({
|
|
2537
|
+
keepAliveTimeout: 1e4
|
|
2538
|
+
});
|
|
2539
|
+
setGlobalDispatcher(agent.compose(interceptors.retry({
|
|
2540
|
+
maxRetries: 3,
|
|
2541
|
+
minTimeout: 1e3,
|
|
2542
|
+
maxTimeout: 1e4,
|
|
2543
|
+
timeoutFactor: 2,
|
|
2544
|
+
retryAfter: true
|
|
2545
|
+
})));
|
|
2353
2546
|
var PowerlinesContext = class _PowerlinesContext {
|
|
2354
2547
|
static {
|
|
2355
2548
|
__name(this, "PowerlinesContext");
|
|
2356
2549
|
}
|
|
2357
2550
|
/**
|
|
2358
|
-
* Internal
|
|
2551
|
+
* Internal references storage
|
|
2552
|
+
*
|
|
2553
|
+
* @danger
|
|
2554
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
2359
2555
|
*
|
|
2360
2556
|
* @internal
|
|
2361
2557
|
*/
|
|
2362
|
-
#
|
|
2558
|
+
#internal = {};
|
|
2363
2559
|
#workspaceConfig;
|
|
2364
2560
|
#checksum = null;
|
|
2365
2561
|
#buildId = uuid();
|
|
@@ -2369,7 +2565,8 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2369
2565
|
#fs;
|
|
2370
2566
|
#tsconfig;
|
|
2371
2567
|
#program;
|
|
2372
|
-
#
|
|
2568
|
+
#parserCache;
|
|
2569
|
+
#requestCache;
|
|
2373
2570
|
#getConfigProps(config = {}) {
|
|
2374
2571
|
return {
|
|
2375
2572
|
variant: config.build?.variant,
|
|
@@ -2393,7 +2590,8 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2393
2590
|
lint: config.lint,
|
|
2394
2591
|
transform: config.transform,
|
|
2395
2592
|
build: config.build,
|
|
2396
|
-
framework: config.framework
|
|
2593
|
+
framework: config.framework,
|
|
2594
|
+
...config
|
|
2397
2595
|
};
|
|
2398
2596
|
}
|
|
2399
2597
|
/**
|
|
@@ -2441,14 +2639,30 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2441
2639
|
*/
|
|
2442
2640
|
resolver;
|
|
2443
2641
|
/**
|
|
2642
|
+
* The resolved configuration options
|
|
2643
|
+
*/
|
|
2644
|
+
resolvePatterns = [];
|
|
2645
|
+
/**
|
|
2444
2646
|
* Internal context fields and methods
|
|
2445
2647
|
*
|
|
2648
|
+
* @danger
|
|
2649
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
2650
|
+
*
|
|
2446
2651
|
* @internal
|
|
2447
2652
|
*/
|
|
2448
2653
|
get $$internal() {
|
|
2449
|
-
return
|
|
2450
|
-
|
|
2451
|
-
|
|
2654
|
+
return this.#internal;
|
|
2655
|
+
}
|
|
2656
|
+
/**
|
|
2657
|
+
* Internal context fields and methods
|
|
2658
|
+
*
|
|
2659
|
+
* @danger
|
|
2660
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
2661
|
+
*
|
|
2662
|
+
* @internal
|
|
2663
|
+
*/
|
|
2664
|
+
set $$internal(value) {
|
|
2665
|
+
this.#internal = value;
|
|
2452
2666
|
}
|
|
2453
2667
|
/**
|
|
2454
2668
|
* The resolved entry type definitions for the project
|
|
@@ -2472,7 +2686,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2472
2686
|
*/
|
|
2473
2687
|
set tsconfig(value) {
|
|
2474
2688
|
this.#tsconfig = value;
|
|
2475
|
-
this
|
|
2689
|
+
this.resolvePatterns = tsconfigPathsToRegExp(value?.options?.paths ?? {});
|
|
2476
2690
|
}
|
|
2477
2691
|
/**
|
|
2478
2692
|
* The virtual file system interface for the project
|
|
@@ -2613,6 +2827,131 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2613
2827
|
return this.#program;
|
|
2614
2828
|
}
|
|
2615
2829
|
/**
|
|
2830
|
+
* Gets the parser cache.
|
|
2831
|
+
*/
|
|
2832
|
+
get parserCache() {
|
|
2833
|
+
if (!this.#parserCache) {
|
|
2834
|
+
this.#parserCache = create({
|
|
2835
|
+
cacheId: "parser",
|
|
2836
|
+
cacheDir: this.cachePath,
|
|
2837
|
+
ttl: 2 * 60 * 60 * 1e3,
|
|
2838
|
+
lruSize: 5e3,
|
|
2839
|
+
persistInterval: 250
|
|
2840
|
+
});
|
|
2841
|
+
}
|
|
2842
|
+
return this.#parserCache;
|
|
2843
|
+
}
|
|
2844
|
+
/**
|
|
2845
|
+
* Gets the request cache.
|
|
2846
|
+
*/
|
|
2847
|
+
get requestCache() {
|
|
2848
|
+
if (!this.#requestCache) {
|
|
2849
|
+
this.#requestCache = create({
|
|
2850
|
+
cacheId: "http",
|
|
2851
|
+
cacheDir: this.cachePath,
|
|
2852
|
+
ttl: 5 * 60 * 1e3,
|
|
2853
|
+
lruSize: 5e3,
|
|
2854
|
+
persistInterval: 250
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2857
|
+
return this.#requestCache;
|
|
2858
|
+
}
|
|
2859
|
+
/**
|
|
2860
|
+
* A function to perform HTTP fetch requests
|
|
2861
|
+
*
|
|
2862
|
+
* @remarks
|
|
2863
|
+
* This function uses a caching layer to avoid duplicate requests during the Powerlines process.
|
|
2864
|
+
*
|
|
2865
|
+
* @example
|
|
2866
|
+
* ```ts
|
|
2867
|
+
* const response = await context.fetch("https://api.example.com/data");
|
|
2868
|
+
* const data = await response.json();
|
|
2869
|
+
* ```
|
|
2870
|
+
*
|
|
2871
|
+
* @see https://github.com/nodejs/undici
|
|
2872
|
+
*
|
|
2873
|
+
* @param input - The URL to fetch.
|
|
2874
|
+
* @param options - The fetch request options.
|
|
2875
|
+
* @returns A promise that resolves to a response returned by the fetch.
|
|
2876
|
+
*/
|
|
2877
|
+
async fetch(input, options = {}) {
|
|
2878
|
+
const cacheKey = murmurhash({
|
|
2879
|
+
input: input.toString(),
|
|
2880
|
+
options: JSON.stringify(options)
|
|
2881
|
+
});
|
|
2882
|
+
if (!this.config.skipCache && !options.skipCache) {
|
|
2883
|
+
const cached = this.requestCache.get(cacheKey);
|
|
2884
|
+
if (cached) {
|
|
2885
|
+
return new Response(cached.body, {
|
|
2886
|
+
status: cached.status,
|
|
2887
|
+
statusText: cached.statusText,
|
|
2888
|
+
headers: cached.headers
|
|
2889
|
+
});
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
const response = await fetchRequest(input, {
|
|
2893
|
+
timeout: 12e3,
|
|
2894
|
+
...options
|
|
2895
|
+
});
|
|
2896
|
+
const result = {
|
|
2897
|
+
body: await response.text(),
|
|
2898
|
+
status: response.status,
|
|
2899
|
+
statusText: response.statusText,
|
|
2900
|
+
headers: Object.fromEntries(response.headers.entries())
|
|
2901
|
+
};
|
|
2902
|
+
if (!this.config.skipCache && !options.skipCache) {
|
|
2903
|
+
try {
|
|
2904
|
+
this.requestCache.set(cacheKey, result);
|
|
2905
|
+
} catch {
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
return new Response(result.body, {
|
|
2909
|
+
status: result.status,
|
|
2910
|
+
statusText: result.statusText,
|
|
2911
|
+
headers: result.headers
|
|
2912
|
+
});
|
|
2913
|
+
}
|
|
2914
|
+
/**
|
|
2915
|
+
* Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
2916
|
+
*
|
|
2917
|
+
* @remarks
|
|
2918
|
+
* This function can be used to parse TypeScript code into an AST for further analysis or transformation.
|
|
2919
|
+
*
|
|
2920
|
+
* @example
|
|
2921
|
+
* ```ts
|
|
2922
|
+
* const ast = context.parse("const x: number = 42;");
|
|
2923
|
+
* ```
|
|
2924
|
+
*
|
|
2925
|
+
* @see https://rollupjs.org/plugin-development/#this-parse
|
|
2926
|
+
* @see https://github.com/oxc/oxc
|
|
2927
|
+
*
|
|
2928
|
+
* @param code - The source code to parse.
|
|
2929
|
+
* @param options - The options to pass to the parser.
|
|
2930
|
+
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
2931
|
+
*/
|
|
2932
|
+
async parse(code, options = {}) {
|
|
2933
|
+
const cacheKey = murmurhash({
|
|
2934
|
+
code,
|
|
2935
|
+
options
|
|
2936
|
+
});
|
|
2937
|
+
let result;
|
|
2938
|
+
if (!this.config.skipCache) {
|
|
2939
|
+
result = this.parserCache.get(cacheKey);
|
|
2940
|
+
if (result) {
|
|
2941
|
+
return result;
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
result = await parse(`source.${options.lang || "ts"}`, code, {
|
|
2945
|
+
...options,
|
|
2946
|
+
sourceType: "module",
|
|
2947
|
+
showSemanticErrors: this.config.mode === "development"
|
|
2948
|
+
});
|
|
2949
|
+
if (!this.config.skipCache) {
|
|
2950
|
+
this.parserCache.set(cacheKey, result);
|
|
2951
|
+
}
|
|
2952
|
+
return result;
|
|
2953
|
+
}
|
|
2954
|
+
/**
|
|
2616
2955
|
* A helper function to resolve modules in the Virtual File System
|
|
2617
2956
|
*
|
|
2618
2957
|
* @remarks
|
|
@@ -2657,7 +2996,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2657
2996
|
};
|
|
2658
2997
|
}
|
|
2659
2998
|
if (this.config.build.skipNodeModulesBundle) {
|
|
2660
|
-
if (match(moduleId, this
|
|
2999
|
+
if (match(moduleId, this.resolvePatterns) || match(moduleId, this.config.build.noExternal)) {
|
|
2661
3000
|
return void 0;
|
|
2662
3001
|
}
|
|
2663
3002
|
if (match(moduleId, this.config.build.external) || moduleId.startsWith("node:")) {
|
|
@@ -2851,6 +3190,26 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2851
3190
|
return extendLog(this.log, name);
|
|
2852
3191
|
}
|
|
2853
3192
|
/**
|
|
3193
|
+
* Generates a checksum representing the current context state
|
|
3194
|
+
*
|
|
3195
|
+
* @param root - The root directory of the project to generate the checksum for
|
|
3196
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
3197
|
+
*/
|
|
3198
|
+
async generateChecksum(root = this.config.projectRoot) {
|
|
3199
|
+
this.#checksum = await hashDirectory(root, {
|
|
3200
|
+
ignore: [
|
|
3201
|
+
"node_modules",
|
|
3202
|
+
".git",
|
|
3203
|
+
".nx",
|
|
3204
|
+
".cache",
|
|
3205
|
+
".storm",
|
|
3206
|
+
"tmp",
|
|
3207
|
+
"dist"
|
|
3208
|
+
]
|
|
3209
|
+
});
|
|
3210
|
+
return this.#checksum;
|
|
3211
|
+
}
|
|
3212
|
+
/**
|
|
2854
3213
|
* Creates a new StormContext instance.
|
|
2855
3214
|
*
|
|
2856
3215
|
* @param workspaceConfig - The workspace configuration.
|
|
@@ -2872,26 +3231,6 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2872
3231
|
*/
|
|
2873
3232
|
logFn;
|
|
2874
3233
|
/**
|
|
2875
|
-
* Generates a checksum representing the current context state
|
|
2876
|
-
*
|
|
2877
|
-
* @param root - The root directory of the project to generate the checksum for
|
|
2878
|
-
* @returns A promise that resolves to a string representing the checksum
|
|
2879
|
-
*/
|
|
2880
|
-
async generateChecksum(root = this.config.projectRoot) {
|
|
2881
|
-
this.#checksum = await hashDirectory(root, {
|
|
2882
|
-
ignore: [
|
|
2883
|
-
"node_modules",
|
|
2884
|
-
".git",
|
|
2885
|
-
".nx",
|
|
2886
|
-
".cache",
|
|
2887
|
-
".storm",
|
|
2888
|
-
"tmp",
|
|
2889
|
-
"dist"
|
|
2890
|
-
]
|
|
2891
|
-
});
|
|
2892
|
-
return this.#checksum;
|
|
2893
|
-
}
|
|
2894
|
-
/**
|
|
2895
3234
|
* Initialize the context with the provided configuration options
|
|
2896
3235
|
*
|
|
2897
3236
|
* @param config - The partial user configuration to use for initialization.
|
|
@@ -3254,36 +3593,90 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
|
|
|
3254
3593
|
* Retrieves the hook handlers for a specific hook name
|
|
3255
3594
|
*/
|
|
3256
3595
|
selectHooks(hook, options) {
|
|
3257
|
-
const
|
|
3596
|
+
const result = [];
|
|
3258
3597
|
if (this.hooks[hook]) {
|
|
3259
3598
|
if (!isHookExternal(hook)) {
|
|
3260
3599
|
const hooks = this.hooks[hook];
|
|
3261
3600
|
if (options?.order) {
|
|
3262
3601
|
if (options?.order === "pre") {
|
|
3263
|
-
|
|
3264
|
-
|
|
3602
|
+
result.push(...(hooks.preOrdered ?? []).map((h) => {
|
|
3603
|
+
const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
|
|
3604
|
+
if (!plugin) {
|
|
3605
|
+
throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
|
|
3606
|
+
}
|
|
3607
|
+
return {
|
|
3608
|
+
handle: h.handler,
|
|
3609
|
+
context: plugin.context
|
|
3610
|
+
};
|
|
3611
|
+
}));
|
|
3612
|
+
result.push(...(hooks.preEnforced ?? []).map((h) => {
|
|
3613
|
+
const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
|
|
3614
|
+
if (!plugin) {
|
|
3615
|
+
throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
|
|
3616
|
+
}
|
|
3617
|
+
return {
|
|
3618
|
+
handle: h.handler,
|
|
3619
|
+
context: plugin.context
|
|
3620
|
+
};
|
|
3621
|
+
}));
|
|
3265
3622
|
} else if (options?.order === "post") {
|
|
3266
|
-
|
|
3267
|
-
|
|
3623
|
+
result.push(...(hooks.postOrdered ?? []).map((h) => {
|
|
3624
|
+
const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
|
|
3625
|
+
if (!plugin) {
|
|
3626
|
+
throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
|
|
3627
|
+
}
|
|
3628
|
+
return {
|
|
3629
|
+
handle: h.handler,
|
|
3630
|
+
context: plugin.context
|
|
3631
|
+
};
|
|
3632
|
+
}));
|
|
3633
|
+
result.push(...(hooks.postEnforced ?? []).map((h) => {
|
|
3634
|
+
const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
|
|
3635
|
+
if (!plugin) {
|
|
3636
|
+
throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
|
|
3637
|
+
}
|
|
3638
|
+
return {
|
|
3639
|
+
handle: h.handler,
|
|
3640
|
+
context: plugin.context
|
|
3641
|
+
};
|
|
3642
|
+
}));
|
|
3268
3643
|
} else {
|
|
3269
|
-
|
|
3644
|
+
result.push(...(hooks.normal ?? []).map((h) => {
|
|
3645
|
+
const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
|
|
3646
|
+
if (!plugin) {
|
|
3647
|
+
throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
|
|
3648
|
+
}
|
|
3649
|
+
return {
|
|
3650
|
+
handle: h.handler,
|
|
3651
|
+
context: plugin.context
|
|
3652
|
+
};
|
|
3653
|
+
}));
|
|
3270
3654
|
}
|
|
3271
3655
|
} else {
|
|
3272
|
-
|
|
3656
|
+
result.push(...this.selectHooks(hook, {
|
|
3273
3657
|
order: "pre"
|
|
3274
3658
|
}));
|
|
3275
|
-
|
|
3659
|
+
result.push(...this.selectHooks(hook, {
|
|
3276
3660
|
order: "normal"
|
|
3277
3661
|
}));
|
|
3278
|
-
|
|
3662
|
+
result.push(...this.selectHooks(hook, {
|
|
3279
3663
|
order: "post"
|
|
3280
3664
|
}));
|
|
3281
3665
|
}
|
|
3282
3666
|
} else {
|
|
3283
|
-
|
|
3667
|
+
result.push(...this.hooks[hook].map((h) => {
|
|
3668
|
+
const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
|
|
3669
|
+
if (!plugin) {
|
|
3670
|
+
throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
|
|
3671
|
+
}
|
|
3672
|
+
return {
|
|
3673
|
+
handle: h.handler,
|
|
3674
|
+
context: plugin.context
|
|
3675
|
+
};
|
|
3676
|
+
}));
|
|
3284
3677
|
}
|
|
3285
3678
|
}
|
|
3286
|
-
return
|
|
3679
|
+
return result;
|
|
3287
3680
|
}
|
|
3288
3681
|
constructor(config, workspaceConfig) {
|
|
3289
3682
|
super(workspaceConfig);
|
|
@@ -3316,6 +3709,31 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext
|
|
|
3316
3709
|
return context;
|
|
3317
3710
|
}
|
|
3318
3711
|
/**
|
|
3712
|
+
* Internal context fields and methods
|
|
3713
|
+
*
|
|
3714
|
+
* @danger
|
|
3715
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
3716
|
+
*
|
|
3717
|
+
* @internal
|
|
3718
|
+
*/
|
|
3719
|
+
get $$internal() {
|
|
3720
|
+
return super.$$internal;
|
|
3721
|
+
}
|
|
3722
|
+
/**
|
|
3723
|
+
* Internal context fields and methods
|
|
3724
|
+
*
|
|
3725
|
+
* @danger
|
|
3726
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
3727
|
+
*
|
|
3728
|
+
* @internal
|
|
3729
|
+
*/
|
|
3730
|
+
set $$internal(value) {
|
|
3731
|
+
super.$$internal = value;
|
|
3732
|
+
for (const environment of Object.values(this.environments)) {
|
|
3733
|
+
environment.$$internal = super.$$internal;
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
/**
|
|
3319
3737
|
* A record of all environments by name
|
|
3320
3738
|
*/
|
|
3321
3739
|
get environments() {
|
|
@@ -3489,7 +3907,9 @@ var PowerlinesAPI = class _PowerlinesAPI {
|
|
|
3489
3907
|
*/
|
|
3490
3908
|
static async from(workspaceRoot, config) {
|
|
3491
3909
|
const api = new _PowerlinesAPI(await PowerlinesAPIContext.from(workspaceRoot, config));
|
|
3492
|
-
api.#context.$$internal
|
|
3910
|
+
api.#context.$$internal = {
|
|
3911
|
+
api
|
|
3912
|
+
};
|
|
3493
3913
|
for (const plugin of api.context.config.plugins ?? []) {
|
|
3494
3914
|
await api.#addPlugin(plugin);
|
|
3495
3915
|
}
|
|
@@ -3613,9 +4033,13 @@ ${formatLogMessage(context.config)}`);
|
|
|
3613
4033
|
let generatedTypes = await emitTypes(context, files);
|
|
3614
4034
|
context.log(LogLevelLabel.TRACE, `Generating TypeScript declaration file ${context.dtsPath}.`);
|
|
3615
4035
|
const directives = [];
|
|
4036
|
+
const asNextParam = /* @__PURE__ */ __name((previousResult) => isObject(previousResult) ? previousResult.code : previousResult, "asNextParam");
|
|
3616
4037
|
let result = await this.callHook("generateTypes", {
|
|
3617
4038
|
environment: context,
|
|
3618
|
-
|
|
4039
|
+
sequential: true,
|
|
4040
|
+
order: "pre",
|
|
4041
|
+
result: "merge",
|
|
4042
|
+
asNextParam
|
|
3619
4043
|
}, generatedTypes);
|
|
3620
4044
|
if (result) {
|
|
3621
4045
|
if (isSetObject(result)) {
|
|
@@ -3629,7 +4053,10 @@ ${formatLogMessage(context.config)}`);
|
|
|
3629
4053
|
}
|
|
3630
4054
|
result = await this.callHook("generateTypes", {
|
|
3631
4055
|
environment: context,
|
|
3632
|
-
|
|
4056
|
+
sequential: true,
|
|
4057
|
+
order: "normal",
|
|
4058
|
+
result: "merge",
|
|
4059
|
+
asNextParam
|
|
3633
4060
|
}, generatedTypes);
|
|
3634
4061
|
if (result) {
|
|
3635
4062
|
if (isSetObject(result)) {
|
|
@@ -3643,7 +4070,10 @@ ${formatLogMessage(context.config)}`);
|
|
|
3643
4070
|
}
|
|
3644
4071
|
result = await this.callHook("generateTypes", {
|
|
3645
4072
|
environment: context,
|
|
3646
|
-
|
|
4073
|
+
sequential: true,
|
|
4074
|
+
order: "post",
|
|
4075
|
+
result: "merge",
|
|
4076
|
+
asNextParam
|
|
3647
4077
|
}, generatedTypes);
|
|
3648
4078
|
if (result) {
|
|
3649
4079
|
if (isSetObject(result)) {
|
|
@@ -3655,15 +4085,24 @@ ${formatLogMessage(context.config)}`);
|
|
|
3655
4085
|
generatedTypes = result;
|
|
3656
4086
|
}
|
|
3657
4087
|
}
|
|
3658
|
-
|
|
4088
|
+
if (generatedTypes?.trim() || directives.length > 0) {
|
|
4089
|
+
await context.fs.write(context.dtsPath, `${directives ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
|
|
3659
4090
|
|
|
3660
4091
|
` : ""}${getFileHeader(context, {
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
4092
|
+
directive: null,
|
|
4093
|
+
prettierIgnore: false
|
|
4094
|
+
})}
|
|
3664
4095
|
|
|
3665
4096
|
${formatTypes(generatedTypes)}
|
|
3666
4097
|
`);
|
|
4098
|
+
} else {
|
|
4099
|
+
const dtsRelativePath = getTsconfigDtsPath(context);
|
|
4100
|
+
if (context.tsconfig.tsconfigJson.include && isIncludeMatchFound(dtsRelativePath, context.tsconfig.tsconfigJson.include)) {
|
|
4101
|
+
const normalizedDtsRelativePath = dtsRelativePath.startsWith("./") ? dtsRelativePath.slice(2) : dtsRelativePath;
|
|
4102
|
+
context.tsconfig.tsconfigJson.include = context.tsconfig.tsconfigJson.include.filter((includeValue) => includeValue?.toString() !== normalizedDtsRelativePath);
|
|
4103
|
+
await context.fs.write(context.tsconfig.tsconfigFilePath, JSON.stringify(context.tsconfig.tsconfigJson, null, 2));
|
|
4104
|
+
}
|
|
4105
|
+
}
|
|
3667
4106
|
}
|
|
3668
4107
|
context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
3669
4108
|
if (!context.tsconfig) {
|
|
@@ -3700,7 +4139,7 @@ ${formatTypes(generatedTypes)}
|
|
|
3700
4139
|
for (const file of files) {
|
|
3701
4140
|
context.log(LogLevelLabel.TRACE, `Adding template file: ${file}`);
|
|
3702
4141
|
const template = Handlebars.compile(file);
|
|
3703
|
-
await
|
|
4142
|
+
await context.fs.write(joinPaths$1(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
3704
4143
|
}
|
|
3705
4144
|
await this.callHook("new", {
|
|
3706
4145
|
environment: context,
|
|
@@ -3711,14 +4150,14 @@ ${formatTypes(generatedTypes)}
|
|
|
3711
4150
|
for (const file of files2) {
|
|
3712
4151
|
context.log(LogLevelLabel.TRACE, `Adding application template file: ${file}`);
|
|
3713
4152
|
const template = Handlebars.compile(file);
|
|
3714
|
-
await
|
|
4153
|
+
await context.fs.write(joinPaths$1(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
3715
4154
|
}
|
|
3716
4155
|
} else {
|
|
3717
4156
|
const files2 = await listFiles(joinPaths$1(context.powerlinesPath, "files/library/**/*.hbs"));
|
|
3718
4157
|
for (const file of files2) {
|
|
3719
4158
|
context.log(LogLevelLabel.TRACE, `Adding library template file: ${file}`);
|
|
3720
4159
|
const template = Handlebars.compile(file);
|
|
3721
|
-
await
|
|
4160
|
+
await context.fs.write(joinPaths$1(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
3722
4161
|
}
|
|
3723
4162
|
}
|
|
3724
4163
|
await this.callHook("new", {
|
|
@@ -3802,15 +4241,12 @@ ${formatTypes(generatedTypes)}
|
|
|
3802
4241
|
const destinationPath = joinPaths$1(appendPath(context.config.output.outputPath, context.workspaceConfig.workspaceRoot), "dist");
|
|
3803
4242
|
if (sourcePath !== destinationPath) {
|
|
3804
4243
|
context.log(LogLevelLabel.INFO, `Copying build output files from project's build directory (${context.config.output.buildPath}) to the workspace's output directory (${context.config.output.outputPath}).`);
|
|
3805
|
-
await
|
|
3806
|
-
input: sourcePath,
|
|
3807
|
-
glob: "**/*"
|
|
3808
|
-
}, destinationPath);
|
|
4244
|
+
await context.fs.copy(sourcePath, destinationPath);
|
|
3809
4245
|
}
|
|
3810
4246
|
}
|
|
3811
4247
|
await Promise.all(context.config.output.assets.map(async (asset) => {
|
|
3812
4248
|
context.log(LogLevelLabel.DEBUG, `Copying asset(s): ${chalk5.redBright(context.workspaceConfig.workspaceRoot === asset.input ? asset.glob : joinPaths$1(replacePath(asset.input, context.workspaceConfig.workspaceRoot), asset.glob))} -> ${chalk5.greenBright(joinPaths$1(replacePath(asset.output, context.workspaceConfig.workspaceRoot), asset.glob))} ${Array.isArray(asset.ignore) && asset.ignore.length > 0 ? ` (ignoring: ${asset.ignore.map((i) => chalk5.yellowBright(i)).join(", ")})` : ""}`);
|
|
3813
|
-
await
|
|
4249
|
+
await context.fs.copy(asset, asset.output);
|
|
3814
4250
|
}));
|
|
3815
4251
|
await this.callHook("build", {
|
|
3816
4252
|
environment: context,
|
|
@@ -4075,5 +4511,5 @@ Note: Please ensure the plugin package's default export is a class that extends
|
|
|
4075
4511
|
};
|
|
4076
4512
|
|
|
4077
4513
|
export { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PowerlinesAPI, _capnpFileId, createLog, extendLog };
|
|
4078
|
-
//# sourceMappingURL=chunk-
|
|
4079
|
-
//# sourceMappingURL=chunk-
|
|
4514
|
+
//# sourceMappingURL=chunk-Q4ZLKJS2.js.map
|
|
4515
|
+
//# sourceMappingURL=chunk-Q4ZLKJS2.js.map
|