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.
Files changed (666) hide show
  1. package/dist/{api-CHbGX3BG.d.ts → api-DE9Ixr0u.d.cts} +2 -2
  2. package/dist/{api-DGMQopJ5.d.cts → api-S471id5Y.d.ts} +2 -2
  3. package/dist/api.cjs +3 -3
  4. package/dist/api.d.cts +6 -2
  5. package/dist/api.d.ts +6 -2
  6. package/dist/api.js +2 -2
  7. package/dist/astro.cjs +5 -5
  8. package/dist/astro.d.cts +5 -1
  9. package/dist/astro.d.ts +5 -1
  10. package/dist/astro.js +4 -4
  11. package/dist/{chunk-RCYXXBJ3.cjs → chunk-246ZHDQL.cjs} +667 -231
  12. package/dist/{chunk-FZ6J2GMT.js → chunk-575Z57QD.js} +2 -2
  13. package/dist/{chunk-CF7B5HOG.cjs → chunk-57GCROWS.cjs} +4 -4
  14. package/dist/{chunk-KW66GUWJ.cjs → chunk-AGFJZWS3.cjs} +4 -4
  15. package/dist/{chunk-BH4JSKPK.js → chunk-FCZMWEL7.js} +3 -3
  16. package/dist/chunk-LRZLY3R7.cjs +12 -0
  17. package/dist/{chunk-PYID3NKT.js → chunk-M7SQJLGB.js} +6 -5
  18. package/dist/{chunk-HG7JY6AQ.cjs → chunk-N6UOEGTC.cjs} +7 -6
  19. package/dist/{chunk-ISPXQBOL.js → chunk-O5PLPU55.js} +3 -3
  20. package/dist/{chunk-2DWFEC7G.js → chunk-Q4ZLKJS2.js} +668 -232
  21. package/dist/{chunk-ON3LABX3.cjs → chunk-SALASTMK.cjs} +2 -2
  22. package/dist/{chunk-CSJMUAPJ.js → chunk-TARQ5ZEQ.js} +3 -3
  23. package/dist/chunk-X56DYZYO.js +9 -0
  24. package/dist/chunk-YEBH46ZU.cjs +12 -0
  25. package/dist/{chunk-YULFP33E.cjs → chunk-YFKHICPO.cjs} +2 -2
  26. package/dist/{chunk-P647W2BA.js → chunk-ZFMDBIE2.js} +2 -2
  27. package/dist/{context-BjOICcQB.d.cts → context-BwnxICfB.d.cts} +100 -25
  28. package/dist/{context-BqTYt9FC.d.ts → context-p7xgIm3D.d.ts} +100 -25
  29. package/dist/esbuild.cjs +7 -7
  30. package/dist/esbuild.d.cts +5 -1
  31. package/dist/esbuild.d.ts +5 -1
  32. package/dist/esbuild.js +4 -4
  33. package/dist/farm.cjs +4 -4
  34. package/dist/farm.d.cts +5 -1
  35. package/dist/farm.d.ts +5 -1
  36. package/dist/farm.js +3 -3
  37. package/dist/index.cjs +21 -21
  38. package/dist/index.d.cts +17 -5
  39. package/dist/index.d.ts +17 -5
  40. package/dist/index.js +10 -7
  41. package/dist/lib/{api-Cxmk8sFc.d.ts → api-1xCU-974.d.ts} +2 -2
  42. package/dist/lib/{api-_rRpguWX.d.cts → api-BvkhY-MU.d.cts} +2 -2
  43. package/dist/lib/build/esbuild.cjs +9 -6
  44. package/dist/lib/build/esbuild.cjs.map +1 -0
  45. package/dist/lib/build/esbuild.d.cts +6 -2
  46. package/dist/lib/build/esbuild.d.ts +6 -2
  47. package/dist/lib/build/esbuild.js +6 -3
  48. package/dist/lib/build/esbuild.js.map +1 -0
  49. package/dist/lib/build/index.cjs +47 -27
  50. package/dist/lib/build/index.cjs.map +1 -0
  51. package/dist/lib/build/index.d.cts +9 -4
  52. package/dist/lib/build/index.d.ts +9 -4
  53. package/dist/lib/build/index.js +15 -11
  54. package/dist/lib/build/index.js.map +1 -0
  55. package/dist/lib/build/rolldown.cjs +6 -4
  56. package/dist/lib/build/rolldown.cjs.map +1 -0
  57. package/dist/lib/build/rolldown.d.cts +6 -2
  58. package/dist/lib/build/rolldown.d.ts +6 -2
  59. package/dist/lib/build/rolldown.js +5 -3
  60. package/dist/lib/build/rolldown.js.map +1 -0
  61. package/dist/lib/build/rollup.cjs +6 -4
  62. package/dist/lib/build/rollup.cjs.map +1 -0
  63. package/dist/lib/build/rollup.d.cts +6 -2
  64. package/dist/lib/build/rollup.d.ts +6 -2
  65. package/dist/lib/build/rollup.js +4 -2
  66. package/dist/lib/build/rollup.js.map +1 -0
  67. package/dist/lib/build/rspack.cjs +5 -3
  68. package/dist/lib/build/rspack.cjs.map +1 -0
  69. package/dist/lib/build/rspack.d.cts +6 -2
  70. package/dist/lib/build/rspack.d.ts +6 -2
  71. package/dist/lib/build/rspack.js +4 -2
  72. package/dist/lib/build/rspack.js.map +1 -0
  73. package/dist/lib/build/tsdown.cjs +25 -0
  74. package/dist/lib/build/tsdown.cjs.map +1 -0
  75. package/dist/lib/build/tsdown.d.cts +60 -0
  76. package/dist/lib/build/tsdown.d.ts +60 -0
  77. package/dist/lib/build/tsdown.js +4 -0
  78. package/dist/lib/build/tsdown.js.map +1 -0
  79. package/dist/lib/build/tsup.cjs +10 -7
  80. package/dist/lib/build/tsup.cjs.map +1 -0
  81. package/dist/lib/build/tsup.d.cts +6 -2
  82. package/dist/lib/build/tsup.d.ts +6 -2
  83. package/dist/lib/build/tsup.js +7 -4
  84. package/dist/lib/build/tsup.js.map +1 -0
  85. package/dist/lib/build/unbuild.cjs +9 -7
  86. package/dist/lib/build/unbuild.cjs.map +1 -0
  87. package/dist/lib/build/unbuild.d.cts +8 -4
  88. package/dist/lib/build/unbuild.d.ts +8 -4
  89. package/dist/lib/build/unbuild.js +6 -4
  90. package/dist/lib/build/unbuild.js.map +1 -0
  91. package/dist/lib/build/vite.cjs +9 -6
  92. package/dist/lib/build/vite.cjs.map +1 -0
  93. package/dist/lib/build/vite.d.cts +6 -2
  94. package/dist/lib/build/vite.d.ts +6 -2
  95. package/dist/lib/build/vite.js +7 -4
  96. package/dist/lib/build/vite.js.map +1 -0
  97. package/dist/lib/build/webpack.cjs +5 -3
  98. package/dist/lib/build/webpack.cjs.map +1 -0
  99. package/dist/lib/build/webpack.d.cts +6 -2
  100. package/dist/lib/build/webpack.d.ts +6 -2
  101. package/dist/lib/build/webpack.js +4 -2
  102. package/dist/lib/build/webpack.js.map +1 -0
  103. package/dist/lib/{chunk-UNUP4XMO.cjs → chunk-23BFL3LB.cjs} +6 -4
  104. package/dist/lib/chunk-23BFL3LB.cjs.map +1 -0
  105. package/dist/lib/{chunk-26M3IUSK.js → chunk-26JHNKA7.js} +3 -1
  106. package/dist/lib/chunk-26JHNKA7.js.map +1 -0
  107. package/dist/lib/{chunk-4V5OI73E.cjs → chunk-2HAOX4Q2.cjs} +205 -124
  108. package/dist/lib/chunk-2HAOX4Q2.cjs.map +1 -0
  109. package/dist/lib/{chunk-2RHE4SGK.js → chunk-2IXO6SBG.js} +3 -1
  110. package/dist/lib/chunk-2IXO6SBG.js.map +1 -0
  111. package/dist/lib/{chunk-K3NBD5LL.cjs → chunk-2JR645O3.cjs} +5 -3
  112. package/dist/lib/chunk-2JR645O3.cjs.map +1 -0
  113. package/dist/lib/{chunk-Z5JKSYRP.cjs → chunk-2OMOKN7Y.cjs} +236 -73
  114. package/dist/lib/chunk-2OMOKN7Y.cjs.map +1 -0
  115. package/dist/lib/{chunk-ENRLU4UR.js → chunk-35EO5Y7R.js} +3 -1
  116. package/dist/lib/chunk-35EO5Y7R.js.map +1 -0
  117. package/dist/lib/{chunk-NDYKRNPQ.js → chunk-367E23MI.js} +3 -1
  118. package/dist/lib/chunk-367E23MI.js.map +1 -0
  119. package/dist/lib/{chunk-I76RI47U.cjs → chunk-3DKBH67A.cjs} +19 -15
  120. package/dist/lib/chunk-3DKBH67A.cjs.map +1 -0
  121. package/dist/lib/chunk-3GMJQ5G3.cjs +4 -0
  122. package/dist/lib/chunk-3GMJQ5G3.cjs.map +1 -0
  123. package/dist/lib/{chunk-OEF6EHQV.js → chunk-45D4XIOK.js} +3 -1
  124. package/dist/lib/chunk-45D4XIOK.js.map +1 -0
  125. package/dist/lib/chunk-4BPHC6QQ.js +3 -0
  126. package/dist/lib/chunk-4BPHC6QQ.js.map +1 -0
  127. package/dist/lib/{chunk-Q4D2L67H.cjs → chunk-4NBEK7BB.cjs} +8 -7
  128. package/dist/lib/chunk-4NBEK7BB.cjs.map +1 -0
  129. package/dist/lib/{chunk-AJDYMANR.cjs → chunk-4UN7FLKQ.cjs} +6 -4
  130. package/dist/lib/chunk-4UN7FLKQ.cjs.map +1 -0
  131. package/dist/lib/{chunk-QR2N3DPP.js → chunk-5QJRVWP3.js} +4 -2
  132. package/dist/lib/chunk-5QJRVWP3.js.map +1 -0
  133. package/dist/lib/{chunk-ONETLSPO.js → chunk-5QMQ5G73.js} +4 -2
  134. package/dist/lib/chunk-5QMQ5G73.js.map +1 -0
  135. package/dist/lib/{chunk-H7A5QVLY.cjs → chunk-62ZJYXT3.cjs} +7 -5
  136. package/dist/lib/chunk-62ZJYXT3.cjs.map +1 -0
  137. package/dist/lib/{chunk-JA4HSQRN.cjs → chunk-632PWWU7.cjs} +5 -3
  138. package/dist/lib/chunk-632PWWU7.cjs.map +1 -0
  139. package/dist/lib/{chunk-PIFNMTKN.cjs → chunk-63DAS6TJ.cjs} +6 -4
  140. package/dist/lib/chunk-63DAS6TJ.cjs.map +1 -0
  141. package/dist/lib/{chunk-OL35IC6Z.js → chunk-6OGQTUXF.js} +3 -1
  142. package/dist/lib/chunk-6OGQTUXF.js.map +1 -0
  143. package/dist/lib/{chunk-HE6HOGLS.js → chunk-7CDTHZ3R.js} +200 -37
  144. package/dist/lib/chunk-7CDTHZ3R.js.map +1 -0
  145. package/dist/lib/{chunk-QDRITYHV.cjs → chunk-7OO4SKFN.cjs} +6 -4
  146. package/dist/lib/chunk-7OO4SKFN.cjs.map +1 -0
  147. package/dist/lib/{chunk-SHUYVCID.js → chunk-7QVYU63E.js} +2 -0
  148. package/dist/lib/chunk-7QVYU63E.js.map +1 -0
  149. package/dist/lib/{chunk-GANVMM73.js → chunk-7R23HVGQ.js} +3 -1
  150. package/dist/lib/chunk-7R23HVGQ.js.map +1 -0
  151. package/dist/lib/chunk-A4RSMLXW.cjs +13 -0
  152. package/dist/lib/chunk-A4RSMLXW.cjs.map +1 -0
  153. package/dist/lib/{chunk-6OYSDQXE.cjs → chunk-AQNUFK3L.cjs} +47 -9
  154. package/dist/lib/chunk-AQNUFK3L.cjs.map +1 -0
  155. package/dist/lib/{chunk-HRRI4KOM.cjs → chunk-BJGMF356.cjs} +8 -6
  156. package/dist/lib/chunk-BJGMF356.cjs.map +1 -0
  157. package/dist/lib/{chunk-GLFOKUTH.cjs → chunk-BQA4H72F.cjs} +12 -10
  158. package/dist/lib/chunk-BQA4H72F.cjs.map +1 -0
  159. package/dist/lib/chunk-CLOW34EQ.js +3 -0
  160. package/dist/lib/chunk-CLOW34EQ.js.map +1 -0
  161. package/dist/lib/{chunk-VHCBD2IS.js → chunk-CTMPQSK7.js} +54 -1
  162. package/dist/lib/chunk-CTMPQSK7.js.map +1 -0
  163. package/dist/lib/{chunk-M263EZ4F.js → chunk-D55ZAZCX.js} +3 -1
  164. package/dist/lib/chunk-D55ZAZCX.js.map +1 -0
  165. package/dist/lib/{chunk-7GCAHOJK.js → chunk-D5IEZABI.js} +4 -2
  166. package/dist/lib/chunk-D5IEZABI.js.map +1 -0
  167. package/dist/lib/chunk-DQJCGJ5P.js +3 -0
  168. package/dist/lib/chunk-DQJCGJ5P.js.map +1 -0
  169. package/dist/lib/{chunk-KFDNKOXM.js → chunk-EBBGE5FN.js} +20 -2
  170. package/dist/lib/chunk-EBBGE5FN.js.map +1 -0
  171. package/dist/lib/chunk-FFATMOAQ.js +14 -0
  172. package/dist/lib/chunk-FFATMOAQ.js.map +1 -0
  173. package/dist/lib/chunk-FJMP4CXA.js +3 -0
  174. package/dist/lib/chunk-FJMP4CXA.js.map +1 -0
  175. package/dist/lib/{chunk-4PTER5EV.js → chunk-FKPVNUDU.js} +3 -1
  176. package/dist/lib/chunk-FKPVNUDU.js.map +1 -0
  177. package/dist/lib/{chunk-ZGMEHSNN.js → chunk-FPFPUYXS.js} +3 -1
  178. package/dist/lib/chunk-FPFPUYXS.js.map +1 -0
  179. package/dist/lib/{chunk-N5XEKCVW.cjs → chunk-FQZQA4EJ.cjs} +13 -20
  180. package/dist/lib/chunk-FQZQA4EJ.cjs.map +1 -0
  181. package/dist/lib/{chunk-3T56KQ7U.cjs → chunk-GDODHF3Y.cjs} +6 -4
  182. package/dist/lib/chunk-GDODHF3Y.cjs.map +1 -0
  183. package/dist/lib/chunk-GTNYRHTO.js +3 -0
  184. package/dist/lib/chunk-GTNYRHTO.js.map +1 -0
  185. package/dist/lib/chunk-HCJQJ2NV.cjs +203 -0
  186. package/dist/lib/chunk-HCJQJ2NV.cjs.map +1 -0
  187. package/dist/lib/{chunk-32Q2PG5D.js → chunk-HDUSUF6L.js} +3 -1
  188. package/dist/lib/chunk-HDUSUF6L.js.map +1 -0
  189. package/dist/lib/{chunk-TANQDHYY.js → chunk-HQ6TGY34.js} +3 -1
  190. package/dist/lib/chunk-HQ6TGY34.js.map +1 -0
  191. package/dist/lib/{chunk-JG4IL7XL.cjs → chunk-HYQXPNVP.cjs} +4 -2
  192. package/dist/lib/chunk-HYQXPNVP.cjs.map +1 -0
  193. package/dist/lib/{chunk-KJDASLW3.js → chunk-JEB4OVD5.js} +70 -14
  194. package/dist/lib/chunk-JEB4OVD5.js.map +1 -0
  195. package/dist/lib/{chunk-GK75G3OD.cjs → chunk-JSU4O5TH.cjs} +7 -5
  196. package/dist/lib/chunk-JSU4O5TH.cjs.map +1 -0
  197. package/dist/lib/chunk-K3FDM5F3.cjs +4 -0
  198. package/dist/lib/chunk-K3FDM5F3.cjs.map +1 -0
  199. package/dist/lib/{chunk-ZDBHX3VV.cjs → chunk-K7EXK3ZX.cjs} +142 -85
  200. package/dist/lib/chunk-K7EXK3ZX.cjs.map +1 -0
  201. package/dist/lib/{chunk-N5YLKWC2.js → chunk-KLU5DWCZ.js} +5 -11
  202. package/dist/lib/chunk-KLU5DWCZ.js.map +1 -0
  203. package/dist/lib/{chunk-R3E56AJ4.cjs → chunk-LIZRGQES.cjs} +7 -5
  204. package/dist/lib/chunk-LIZRGQES.cjs.map +1 -0
  205. package/dist/lib/{chunk-UJYCAW2D.cjs → chunk-LQMUXGB5.cjs} +37 -10
  206. package/dist/lib/chunk-LQMUXGB5.cjs.map +1 -0
  207. package/dist/lib/{chunk-CU23POMD.js → chunk-LSSLZECF.js} +4 -2
  208. package/dist/lib/chunk-LSSLZECF.js.map +1 -0
  209. package/dist/lib/{chunk-4NHFXDTQ.cjs → chunk-MFC7UJHT.cjs} +5 -3
  210. package/dist/lib/chunk-MFC7UJHT.cjs.map +1 -0
  211. package/dist/lib/{chunk-6RLV3FIS.js → chunk-MJ6WN3XA.js} +4 -2
  212. package/dist/lib/chunk-MJ6WN3XA.js.map +1 -0
  213. package/dist/lib/{chunk-HM52GHX3.js → chunk-MZ3GS5X3.js} +31 -4
  214. package/dist/lib/chunk-MZ3GS5X3.js.map +1 -0
  215. package/dist/lib/{chunk-T6KEXFRH.cjs → chunk-NPSC73QO.cjs} +10 -8
  216. package/dist/lib/chunk-NPSC73QO.cjs.map +1 -0
  217. package/dist/lib/{chunk-NST5TNW6.js → chunk-OC2AD37X.js} +3 -1
  218. package/dist/lib/chunk-OC2AD37X.js.map +1 -0
  219. package/dist/lib/{chunk-WUE7NTBW.cjs → chunk-OGEFARN2.cjs} +12 -10
  220. package/dist/lib/chunk-OGEFARN2.cjs.map +1 -0
  221. package/dist/lib/{chunk-3OCI4TH7.cjs → chunk-OXOTWH3L.cjs} +6 -4
  222. package/dist/lib/chunk-OXOTWH3L.cjs.map +1 -0
  223. package/dist/{plugin-utils/chunk-USNT2KNT.cjs → lib/chunk-PK6SKIKE.cjs} +2 -0
  224. package/dist/lib/chunk-PK6SKIKE.cjs.map +1 -0
  225. package/dist/lib/{chunk-XBM7FHNK.js → chunk-Q25ZPXA7.js} +3 -1
  226. package/dist/lib/chunk-Q25ZPXA7.js.map +1 -0
  227. package/dist/lib/{chunk-XUYQYUWZ.cjs → chunk-QBE4SZN6.cjs} +6 -4
  228. package/dist/lib/chunk-QBE4SZN6.cjs.map +1 -0
  229. package/dist/lib/{chunk-GA3RXX4R.cjs → chunk-QHTL2U3L.cjs} +10 -8
  230. package/dist/lib/chunk-QHTL2U3L.cjs.map +1 -0
  231. package/dist/lib/chunk-QMKA57N4.cjs +4 -0
  232. package/dist/lib/chunk-QMKA57N4.cjs.map +1 -0
  233. package/dist/lib/{chunk-MRAGQ33T.js → chunk-RHADQ6HA.js} +4 -2
  234. package/dist/lib/chunk-RHADQ6HA.js.map +1 -0
  235. package/dist/lib/{chunk-4SULM54S.js → chunk-RNSQODBR.js} +190 -109
  236. package/dist/lib/chunk-RNSQODBR.js.map +1 -0
  237. package/dist/lib/{chunk-2NZADVP5.cjs → chunk-RQICHHZM.cjs} +4 -2
  238. package/dist/lib/chunk-RQICHHZM.cjs.map +1 -0
  239. package/dist/lib/{chunk-YGSXCTX2.js → chunk-RTFLBGJI.js} +4 -3
  240. package/dist/lib/chunk-RTFLBGJI.js.map +1 -0
  241. package/dist/lib/chunk-SIYSGNDD.js +100 -0
  242. package/dist/lib/chunk-SIYSGNDD.js.map +1 -0
  243. package/dist/lib/chunk-SP5FOE5B.cjs +109 -0
  244. package/dist/lib/chunk-SP5FOE5B.cjs.map +1 -0
  245. package/dist/lib/{chunk-67DW5UDQ.js → chunk-SUABYS33.js} +5 -3
  246. package/dist/lib/chunk-SUABYS33.js.map +1 -0
  247. package/dist/lib/{chunk-CP77I6WM.js → chunk-US6LDIXH.js} +100 -43
  248. package/dist/lib/chunk-US6LDIXH.js.map +1 -0
  249. package/dist/lib/chunk-UYDY7RRQ.cjs +4 -0
  250. package/dist/lib/chunk-UYDY7RRQ.cjs.map +1 -0
  251. package/dist/lib/{chunk-AHK7GRPM.js → chunk-W2KADD56.js} +4 -2
  252. package/dist/lib/chunk-W2KADD56.js.map +1 -0
  253. package/dist/lib/chunk-XBOHJTOI.cjs +4 -0
  254. package/dist/lib/chunk-XBOHJTOI.cjs.map +1 -0
  255. package/dist/lib/{chunk-XLHFUATD.cjs → chunk-Y5KONJVR.cjs} +55 -2
  256. package/dist/lib/chunk-Y5KONJVR.cjs.map +1 -0
  257. package/dist/lib/chunk-YF57WETC.cjs +16 -0
  258. package/dist/lib/chunk-YF57WETC.cjs.map +1 -0
  259. package/dist/lib/{chunk-AFLI3CLM.js → chunk-YFB6OGXJ.js} +4 -2
  260. package/dist/lib/chunk-YFB6OGXJ.js.map +1 -0
  261. package/dist/lib/{chunk-L56XA427.js → chunk-YJEZASNU.js} +41 -3
  262. package/dist/lib/chunk-YJEZASNU.js.map +1 -0
  263. package/dist/lib/{chunk-A2NW7WAN.js → chunk-YMEXAI6M.js} +3 -1
  264. package/dist/lib/chunk-YMEXAI6M.js.map +1 -0
  265. package/dist/lib/{chunk-YYEAV24J.cjs → chunk-YYG2XJQN.cjs} +30 -11
  266. package/dist/lib/chunk-YYG2XJQN.cjs.map +1 -0
  267. package/dist/lib/{chunk-NDC5BKCD.cjs → chunk-YZ2NKI4K.cjs} +4 -2
  268. package/dist/lib/chunk-YZ2NKI4K.cjs.map +1 -0
  269. package/dist/lib/{chunk-YYN6TKSY.cjs → chunk-ZFOPHCGK.cjs} +4 -2
  270. package/dist/lib/chunk-ZFOPHCGK.cjs.map +1 -0
  271. package/dist/lib/{chunk-HL4KTZDB.cjs → chunk-ZGTXKPKZ.cjs} +5 -3
  272. package/dist/lib/chunk-ZGTXKPKZ.cjs.map +1 -0
  273. package/dist/lib/{chunk-4W6WV35V.js → chunk-ZLWW2MXD.js} +21 -15
  274. package/dist/lib/chunk-ZLWW2MXD.js.map +1 -0
  275. package/dist/lib/{chunk-YB54H3SQ.js → chunk-ZVZFMMNL.js} +10 -6
  276. package/dist/lib/chunk-ZVZFMMNL.js.map +1 -0
  277. package/dist/lib/{chunk-D6MI2V6R.cjs → chunk-ZWLSNYIN.cjs} +23 -17
  278. package/dist/lib/chunk-ZWLSNYIN.cjs.map +1 -0
  279. package/dist/lib/{config-DMXVnKGF.d.cts → config-CFT-8XXu.d.cts} +104 -21
  280. package/dist/lib/{config-B2q8Me0M.d.ts → config-CwebNcAh.d.ts} +104 -21
  281. package/dist/lib/config-file.cjs +6 -4
  282. package/dist/lib/config-file.cjs.map +1 -0
  283. package/dist/lib/config-file.d.cts +6 -2
  284. package/dist/lib/config-file.d.ts +6 -2
  285. package/dist/lib/config-file.js +4 -2
  286. package/dist/lib/config-file.js.map +1 -0
  287. package/dist/lib/contexts/api-context.cjs +20 -17
  288. package/dist/lib/contexts/api-context.cjs.map +1 -0
  289. package/dist/lib/contexts/api-context.d.cts +29 -6
  290. package/dist/lib/contexts/api-context.d.ts +29 -6
  291. package/dist/lib/contexts/api-context.js +19 -16
  292. package/dist/lib/contexts/api-context.js.map +1 -0
  293. package/dist/lib/contexts/context.cjs +17 -14
  294. package/dist/lib/contexts/context.cjs.map +1 -0
  295. package/dist/lib/contexts/context.d.cts +78 -11
  296. package/dist/lib/contexts/context.d.ts +78 -11
  297. package/dist/lib/contexts/context.js +16 -13
  298. package/dist/lib/contexts/context.js.map +1 -0
  299. package/dist/lib/contexts/environment-context.cjs +19 -16
  300. package/dist/lib/contexts/environment-context.cjs.map +1 -0
  301. package/dist/lib/contexts/environment-context.d.cts +10 -5
  302. package/dist/lib/contexts/environment-context.d.ts +10 -5
  303. package/dist/lib/contexts/environment-context.js +18 -15
  304. package/dist/lib/contexts/environment-context.js.map +1 -0
  305. package/dist/lib/contexts/index.cjs +24 -21
  306. package/dist/lib/contexts/index.cjs.map +1 -0
  307. package/dist/lib/contexts/index.d.cts +9 -4
  308. package/dist/lib/contexts/index.d.ts +9 -4
  309. package/dist/lib/contexts/index.js +20 -17
  310. package/dist/lib/contexts/index.js.map +1 -0
  311. package/dist/lib/contexts/plugin-context.cjs +5 -3
  312. package/dist/lib/contexts/plugin-context.cjs.map +1 -0
  313. package/dist/lib/contexts/plugin-context.d.cts +8 -4
  314. package/dist/lib/contexts/plugin-context.d.ts +8 -4
  315. package/dist/lib/contexts/plugin-context.js +4 -2
  316. package/dist/lib/contexts/plugin-context.js.map +1 -0
  317. package/dist/lib/entry.cjs +13 -10
  318. package/dist/lib/entry.cjs.map +1 -0
  319. package/dist/lib/entry.d.cts +6 -2
  320. package/dist/lib/entry.d.ts +6 -2
  321. package/dist/lib/entry.js +5 -2
  322. package/dist/lib/entry.js.map +1 -0
  323. package/dist/lib/fs/helpers.cjs +18 -12
  324. package/dist/lib/fs/helpers.cjs.map +1 -0
  325. package/dist/lib/fs/helpers.d.cts +10 -1
  326. package/dist/lib/fs/helpers.d.ts +10 -1
  327. package/dist/lib/fs/helpers.js +4 -2
  328. package/dist/lib/fs/helpers.js.map +1 -0
  329. package/dist/lib/fs/index.cjs +12 -9
  330. package/dist/lib/fs/index.cjs.map +1 -0
  331. package/dist/lib/fs/index.d.cts +7 -3
  332. package/dist/lib/fs/index.d.ts +7 -3
  333. package/dist/lib/fs/index.js +11 -8
  334. package/dist/lib/fs/index.js.map +1 -0
  335. package/dist/lib/fs/storage/base.cjs +5 -3
  336. package/dist/lib/fs/storage/base.cjs.map +1 -0
  337. package/dist/lib/fs/storage/base.d.cts +42 -1
  338. package/dist/lib/fs/storage/base.d.ts +42 -1
  339. package/dist/lib/fs/storage/base.js +4 -2
  340. package/dist/lib/fs/storage/base.js.map +1 -0
  341. package/dist/lib/fs/storage/file-system.cjs +7 -5
  342. package/dist/lib/fs/storage/file-system.cjs.map +1 -0
  343. package/dist/lib/fs/storage/file-system.d.cts +34 -2
  344. package/dist/lib/fs/storage/file-system.d.ts +34 -2
  345. package/dist/lib/fs/storage/file-system.js +6 -4
  346. package/dist/lib/fs/storage/file-system.js.map +1 -0
  347. package/dist/lib/fs/storage/index.cjs +10 -8
  348. package/dist/lib/fs/storage/index.cjs.map +1 -0
  349. package/dist/lib/fs/storage/index.d.cts +4 -2
  350. package/dist/lib/fs/storage/index.d.ts +4 -2
  351. package/dist/lib/fs/storage/index.js +7 -5
  352. package/dist/lib/fs/storage/index.js.map +1 -0
  353. package/dist/lib/fs/storage/virtual.cjs +6 -4
  354. package/dist/lib/fs/storage/virtual.cjs.map +1 -0
  355. package/dist/lib/fs/storage/virtual.d.cts +2 -1
  356. package/dist/lib/fs/storage/virtual.d.ts +2 -1
  357. package/dist/lib/fs/storage/virtual.js +5 -3
  358. package/dist/lib/fs/storage/virtual.js.map +1 -0
  359. package/dist/lib/fs/vfs.cjs +11 -8
  360. package/dist/lib/fs/vfs.cjs.map +1 -0
  361. package/dist/lib/fs/vfs.d.cts +51 -7
  362. package/dist/lib/fs/vfs.d.ts +51 -7
  363. package/dist/lib/fs/vfs.js +10 -7
  364. package/dist/lib/fs/vfs.js.map +1 -0
  365. package/dist/lib/{fs-Dg-aTfiN.d.cts → fs-abWbkR69.d.cts} +85 -4
  366. package/dist/lib/{fs-Dg-aTfiN.d.ts → fs-abWbkR69.d.ts} +85 -4
  367. package/dist/lib/index.cjs +98 -95
  368. package/dist/lib/index.cjs.map +1 -0
  369. package/dist/lib/index.d.cts +10 -6
  370. package/dist/lib/index.d.ts +10 -6
  371. package/dist/lib/index.js +38 -35
  372. package/dist/lib/index.js.map +1 -0
  373. package/dist/lib/{internal-CfIJWv8T.d.cts → internal-BavTJeC5.d.cts} +2 -2
  374. package/dist/lib/{internal-CGIi3MOX.d.ts → internal-DxQ28691.d.ts} +2 -2
  375. package/dist/lib/logger.cjs +6 -4
  376. package/dist/lib/logger.cjs.map +1 -0
  377. package/dist/lib/logger.d.cts +6 -2
  378. package/dist/lib/logger.d.ts +6 -2
  379. package/dist/lib/logger.js +4 -2
  380. package/dist/lib/logger.js.map +1 -0
  381. package/dist/lib/typescript/import-transformer.cjs +5 -3
  382. package/dist/lib/typescript/import-transformer.cjs.map +1 -0
  383. package/dist/lib/typescript/import-transformer.d.cts +6 -2
  384. package/dist/lib/typescript/import-transformer.d.ts +6 -2
  385. package/dist/lib/typescript/import-transformer.js +4 -2
  386. package/dist/lib/typescript/import-transformer.js.map +1 -0
  387. package/dist/lib/typescript/index.cjs +21 -19
  388. package/dist/lib/typescript/index.cjs.map +1 -0
  389. package/dist/lib/typescript/index.d.cts +6 -2
  390. package/dist/lib/typescript/index.d.ts +6 -2
  391. package/dist/lib/typescript/index.js +8 -6
  392. package/dist/lib/typescript/index.js.map +1 -0
  393. package/dist/lib/typescript/isolated-decl.cjs +5 -3
  394. package/dist/lib/typescript/isolated-decl.cjs.map +1 -0
  395. package/dist/lib/typescript/isolated-decl.js +4 -2
  396. package/dist/lib/typescript/isolated-decl.js.map +1 -0
  397. package/dist/lib/typescript/ts-morph.cjs +6 -4
  398. package/dist/lib/typescript/ts-morph.cjs.map +1 -0
  399. package/dist/lib/typescript/ts-morph.d.cts +8 -4
  400. package/dist/lib/typescript/ts-morph.d.ts +8 -4
  401. package/dist/lib/typescript/ts-morph.js +4 -2
  402. package/dist/lib/typescript/ts-morph.js.map +1 -0
  403. package/dist/lib/typescript/tsconfig.cjs +11 -9
  404. package/dist/lib/typescript/tsconfig.cjs.map +1 -0
  405. package/dist/lib/typescript/tsconfig.js +4 -2
  406. package/dist/lib/typescript/tsconfig.js.map +1 -0
  407. package/dist/lib/unplugin/factory.cjs +23 -21
  408. package/dist/lib/unplugin/factory.cjs.map +1 -0
  409. package/dist/lib/unplugin/factory.d.cts +8 -4
  410. package/dist/lib/unplugin/factory.d.ts +8 -4
  411. package/dist/lib/unplugin/factory.js +22 -20
  412. package/dist/lib/unplugin/factory.js.map +1 -0
  413. package/dist/lib/unplugin/helpers.cjs +5 -3
  414. package/dist/lib/unplugin/helpers.cjs.map +1 -0
  415. package/dist/lib/unplugin/helpers.d.cts +6 -2
  416. package/dist/lib/unplugin/helpers.d.ts +6 -2
  417. package/dist/lib/unplugin/helpers.js +4 -2
  418. package/dist/lib/unplugin/helpers.js.map +1 -0
  419. package/dist/lib/unplugin/index.cjs +28 -26
  420. package/dist/lib/unplugin/index.cjs.map +1 -0
  421. package/dist/lib/unplugin/index.d.cts +9 -5
  422. package/dist/lib/unplugin/index.d.ts +9 -5
  423. package/dist/lib/unplugin/index.js +25 -23
  424. package/dist/lib/unplugin/index.js.map +1 -0
  425. package/dist/lib/unplugin/plugin.cjs +8 -6
  426. package/dist/lib/unplugin/plugin.cjs.map +1 -0
  427. package/dist/lib/unplugin/plugin.d.cts +10 -19
  428. package/dist/lib/unplugin/plugin.d.ts +10 -19
  429. package/dist/lib/unplugin/plugin.js +7 -5
  430. package/dist/lib/unplugin/plugin.js.map +1 -0
  431. package/dist/lib/{unplugin-Da9GAj4a.d.ts → unplugin-CpYxomBB.d.ts} +2 -2
  432. package/dist/lib/{unplugin-B_F1TZK4.d.cts → unplugin-DVAN82cd.d.cts} +2 -2
  433. package/dist/lib/utilities/bundle.cjs +8 -5
  434. package/dist/lib/utilities/bundle.cjs.map +1 -0
  435. package/dist/lib/utilities/bundle.d.cts +6 -2
  436. package/dist/lib/utilities/bundle.d.ts +6 -2
  437. package/dist/lib/utilities/bundle.js +7 -4
  438. package/dist/lib/utilities/bundle.js.map +1 -0
  439. package/dist/lib/utilities/cache.cjs +7 -5
  440. package/dist/lib/utilities/cache.cjs.map +1 -0
  441. package/dist/lib/utilities/cache.d.cts +6 -2
  442. package/dist/lib/utilities/cache.d.ts +6 -2
  443. package/dist/lib/utilities/cache.js +5 -3
  444. package/dist/lib/utilities/cache.js.map +1 -0
  445. package/dist/lib/utilities/file-header.cjs +6 -4
  446. package/dist/lib/utilities/file-header.cjs.map +1 -0
  447. package/dist/lib/utilities/file-header.d.cts +6 -2
  448. package/dist/lib/utilities/file-header.d.ts +6 -2
  449. package/dist/lib/utilities/file-header.js +4 -2
  450. package/dist/lib/utilities/file-header.js.map +1 -0
  451. package/dist/lib/utilities/index.cjs +45 -42
  452. package/dist/lib/utilities/index.cjs.map +1 -0
  453. package/dist/lib/utilities/index.d.cts +6 -2
  454. package/dist/lib/utilities/index.d.ts +6 -2
  455. package/dist/lib/utilities/index.js +17 -14
  456. package/dist/lib/utilities/index.js.map +1 -0
  457. package/dist/lib/utilities/meta.cjs +10 -8
  458. package/dist/lib/utilities/meta.cjs.map +1 -0
  459. package/dist/lib/utilities/meta.d.cts +6 -2
  460. package/dist/lib/utilities/meta.d.ts +6 -2
  461. package/dist/lib/utilities/meta.js +4 -2
  462. package/dist/lib/utilities/meta.js.map +1 -0
  463. package/dist/lib/utilities/resolve.cjs +9 -6
  464. package/dist/lib/utilities/resolve.cjs.map +1 -0
  465. package/dist/lib/utilities/resolve.d.cts +6 -2
  466. package/dist/lib/utilities/resolve.d.ts +6 -2
  467. package/dist/lib/utilities/resolve.js +8 -5
  468. package/dist/lib/utilities/resolve.js.map +1 -0
  469. package/dist/lib/utilities/source-file.cjs +7 -5
  470. package/dist/lib/utilities/source-file.cjs.map +1 -0
  471. package/dist/lib/utilities/source-file.d.cts +6 -2
  472. package/dist/lib/utilities/source-file.d.ts +6 -2
  473. package/dist/lib/utilities/source-file.js +4 -2
  474. package/dist/lib/utilities/source-file.js.map +1 -0
  475. package/dist/lib/utilities/source-map.cjs +5 -3
  476. package/dist/lib/utilities/source-map.cjs.map +1 -0
  477. package/dist/lib/utilities/source-map.d.cts +6 -2
  478. package/dist/lib/utilities/source-map.d.ts +6 -2
  479. package/dist/lib/utilities/source-map.js +4 -2
  480. package/dist/lib/utilities/source-map.js.map +1 -0
  481. package/dist/lib/utilities/worker.cjs +7 -5
  482. package/dist/lib/utilities/worker.cjs.map +1 -0
  483. package/dist/lib/utilities/worker.d.cts +6 -2
  484. package/dist/lib/utilities/worker.d.ts +6 -2
  485. package/dist/lib/utilities/worker.js +5 -3
  486. package/dist/lib/utilities/worker.js.map +1 -0
  487. package/dist/lib/utilities/write-file.cjs +5 -3
  488. package/dist/lib/utilities/write-file.cjs.map +1 -0
  489. package/dist/lib/utilities/write-file.d.cts +6 -2
  490. package/dist/lib/utilities/write-file.d.ts +6 -2
  491. package/dist/lib/utilities/write-file.js +4 -2
  492. package/dist/lib/utilities/write-file.js.map +1 -0
  493. package/dist/next.cjs +5 -5
  494. package/dist/next.js +4 -4
  495. package/dist/nuxt.cjs +7 -7
  496. package/dist/nuxt.js +5 -5
  497. package/dist/plugin-utils/{chunk-GV7O3E7P.js → chunk-36OM2X4L.js} +4 -2
  498. package/dist/plugin-utils/chunk-36OM2X4L.js.map +1 -0
  499. package/dist/plugin-utils/{chunk-SHUYVCID.js → chunk-7QVYU63E.js} +2 -0
  500. package/dist/plugin-utils/chunk-7QVYU63E.js.map +1 -0
  501. package/dist/plugin-utils/{chunk-XIXI67PY.js → chunk-7YN6UEMJ.js} +4 -2
  502. package/dist/plugin-utils/chunk-7YN6UEMJ.js.map +1 -0
  503. package/dist/plugin-utils/{chunk-DZZPNO5H.cjs → chunk-B2V5OVYF.cjs} +6 -4
  504. package/dist/plugin-utils/chunk-B2V5OVYF.cjs.map +1 -0
  505. package/dist/plugin-utils/{chunk-NFXNZFMN.cjs → chunk-DUIPLC7F.cjs} +5 -3
  506. package/dist/plugin-utils/chunk-DUIPLC7F.cjs.map +1 -0
  507. package/dist/plugin-utils/{chunk-SEH3RVMF.js → chunk-G32M72GJ.js} +3 -1
  508. package/dist/plugin-utils/chunk-G32M72GJ.js.map +1 -0
  509. package/dist/plugin-utils/{chunk-5MO4BCOW.cjs → chunk-GH7PPING.cjs} +4 -2
  510. package/dist/plugin-utils/chunk-GH7PPING.cjs.map +1 -0
  511. package/dist/plugin-utils/{chunk-CYVV2MB7.js → chunk-H7GJUBNY.js} +3 -1
  512. package/dist/plugin-utils/chunk-H7GJUBNY.js.map +1 -0
  513. package/dist/plugin-utils/{chunk-ECFS7DPV.cjs → chunk-ID47RJFS.cjs} +9 -7
  514. package/dist/plugin-utils/chunk-ID47RJFS.cjs.map +1 -0
  515. package/dist/plugin-utils/chunk-NRJ5QYX2.js +14 -0
  516. package/dist/plugin-utils/chunk-NRJ5QYX2.js.map +1 -0
  517. package/dist/{lib/chunk-USNT2KNT.cjs → plugin-utils/chunk-PK6SKIKE.cjs} +2 -0
  518. package/dist/plugin-utils/chunk-PK6SKIKE.cjs.map +1 -0
  519. package/dist/plugin-utils/{chunk-QKMG6ZAU.js → chunk-QQ63YK2G.js} +4 -2
  520. package/dist/plugin-utils/chunk-QQ63YK2G.js.map +1 -0
  521. package/dist/plugin-utils/chunk-RBMEE2JC.cjs +16 -0
  522. package/dist/plugin-utils/chunk-RBMEE2JC.cjs.map +1 -0
  523. package/dist/plugin-utils/{chunk-UNAGYQRB.cjs → chunk-UXLKUCEY.cjs} +9 -7
  524. package/dist/plugin-utils/chunk-UXLKUCEY.cjs.map +1 -0
  525. package/dist/plugin-utils/{chunk-F65J5WOX.cjs → chunk-VJGI676W.cjs} +16 -14
  526. package/dist/plugin-utils/chunk-VJGI676W.cjs.map +1 -0
  527. package/dist/plugin-utils/{chunk-L277XSSN.js → chunk-X4BI25Z5.js} +3 -1
  528. package/dist/plugin-utils/chunk-X4BI25Z5.js.map +1 -0
  529. package/dist/plugin-utils/{context-y3G_SQPM.d.cts → context-BwokDIBz.d.cts} +167 -10
  530. package/dist/plugin-utils/{context-y3G_SQPM.d.ts → context-BwokDIBz.d.ts} +167 -10
  531. package/dist/plugin-utils/context-helpers.cjs +6 -4
  532. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  533. package/dist/plugin-utils/context-helpers.d.cts +4 -1
  534. package/dist/plugin-utils/context-helpers.d.ts +4 -1
  535. package/dist/plugin-utils/context-helpers.js +4 -2
  536. package/dist/plugin-utils/context-helpers.js.map +1 -0
  537. package/dist/plugin-utils/enforce.cjs +8 -6
  538. package/dist/plugin-utils/enforce.cjs.map +1 -0
  539. package/dist/plugin-utils/enforce.d.cts +4 -1
  540. package/dist/plugin-utils/enforce.d.ts +4 -1
  541. package/dist/plugin-utils/enforce.js +7 -5
  542. package/dist/plugin-utils/enforce.js.map +1 -0
  543. package/dist/plugin-utils/extend.cjs +7 -5
  544. package/dist/plugin-utils/extend.cjs.map +1 -0
  545. package/dist/plugin-utils/extend.d.cts +4 -1
  546. package/dist/plugin-utils/extend.d.ts +4 -1
  547. package/dist/plugin-utils/extend.js +6 -4
  548. package/dist/plugin-utils/extend.js.map +1 -0
  549. package/dist/plugin-utils/get-config-path.cjs +5 -3
  550. package/dist/plugin-utils/get-config-path.cjs.map +1 -0
  551. package/dist/plugin-utils/get-config-path.d.cts +4 -1
  552. package/dist/plugin-utils/get-config-path.d.ts +4 -1
  553. package/dist/plugin-utils/get-config-path.js +4 -2
  554. package/dist/plugin-utils/get-config-path.js.map +1 -0
  555. package/dist/plugin-utils/helpers.cjs +17 -15
  556. package/dist/plugin-utils/helpers.cjs.map +1 -0
  557. package/dist/plugin-utils/helpers.d.cts +14 -11
  558. package/dist/plugin-utils/helpers.d.ts +14 -11
  559. package/dist/plugin-utils/helpers.js +4 -2
  560. package/dist/plugin-utils/helpers.js.map +1 -0
  561. package/dist/plugin-utils/index.cjs +30 -28
  562. package/dist/plugin-utils/index.cjs.map +1 -0
  563. package/dist/plugin-utils/index.d.cts +4 -1
  564. package/dist/plugin-utils/index.d.ts +4 -1
  565. package/dist/plugin-utils/index.js +10 -8
  566. package/dist/plugin-utils/index.js.map +1 -0
  567. package/dist/plugin-utils/merge.cjs +6 -4
  568. package/dist/plugin-utils/merge.cjs.map +1 -0
  569. package/dist/plugin-utils/merge.d.cts +4 -1
  570. package/dist/plugin-utils/merge.d.ts +4 -1
  571. package/dist/plugin-utils/merge.js +5 -3
  572. package/dist/plugin-utils/merge.js.map +1 -0
  573. package/dist/plugin-utils/paths.cjs +5 -3
  574. package/dist/plugin-utils/paths.cjs.map +1 -0
  575. package/dist/plugin-utils/paths.d.cts +5 -1
  576. package/dist/plugin-utils/paths.d.ts +5 -1
  577. package/dist/plugin-utils/paths.js +4 -2
  578. package/dist/plugin-utils/paths.js.map +1 -0
  579. package/dist/rolldown.cjs +17 -9
  580. package/dist/rolldown.d.cts +5 -1
  581. package/dist/rolldown.d.ts +5 -1
  582. package/dist/rolldown.js +4 -9
  583. package/dist/rollup.cjs +4 -4
  584. package/dist/rollup.d.cts +5 -1
  585. package/dist/rollup.d.ts +5 -1
  586. package/dist/rollup.js +3 -3
  587. package/dist/rspack.cjs +4 -4
  588. package/dist/rspack.d.cts +5 -1
  589. package/dist/rspack.d.ts +5 -1
  590. package/dist/rspack.js +3 -3
  591. package/dist/tsdown.cjs +114 -0
  592. package/dist/tsdown.d.cts +28 -0
  593. package/dist/tsdown.d.ts +28 -0
  594. package/dist/tsdown.js +108 -0
  595. package/dist/tsup.cjs +5 -5
  596. package/dist/tsup.js +4 -4
  597. package/dist/types/api.d.cts +6 -2
  598. package/dist/types/api.d.ts +6 -2
  599. package/dist/types/babel.d.cts +5 -1
  600. package/dist/types/babel.d.ts +5 -1
  601. package/dist/types/build.d.cts +11 -10
  602. package/dist/types/build.d.ts +11 -10
  603. package/dist/types/commands.d.cts +5 -1
  604. package/dist/types/commands.d.ts +5 -1
  605. package/dist/types/config.d.cts +5 -1
  606. package/dist/types/config.d.ts +5 -1
  607. package/dist/types/context.cjs +2 -2
  608. package/dist/types/context.d.cts +5 -1
  609. package/dist/types/context.d.ts +5 -1
  610. package/dist/types/context.js +1 -1
  611. package/dist/types/fs.cjs +4 -4
  612. package/dist/types/fs.d.cts +85 -4
  613. package/dist/types/fs.d.ts +85 -4
  614. package/dist/types/fs.js +1 -1
  615. package/dist/types/hooks.d.cts +5 -1
  616. package/dist/types/hooks.d.ts +5 -1
  617. package/dist/types/index.cjs +6 -6
  618. package/dist/types/index.d.cts +7 -3
  619. package/dist/types/index.d.ts +7 -3
  620. package/dist/types/index.js +2 -2
  621. package/dist/types/internal.d.cts +6 -2
  622. package/dist/types/internal.d.ts +6 -2
  623. package/dist/types/plugin.d.cts +5 -1
  624. package/dist/types/plugin.d.ts +5 -1
  625. package/dist/types/resolved.d.cts +5 -1
  626. package/dist/types/resolved.d.ts +5 -1
  627. package/dist/types/unplugin.d.cts +6 -2
  628. package/dist/types/unplugin.d.ts +6 -2
  629. package/dist/unloader.cjs +4 -4
  630. package/dist/unloader.d.cts +5 -1
  631. package/dist/unloader.d.ts +5 -1
  632. package/dist/unloader.js +3 -3
  633. package/dist/unplugin.cjs +10 -8
  634. package/dist/unplugin.d.cts +8 -17
  635. package/dist/unplugin.d.ts +8 -17
  636. package/dist/unplugin.js +8 -6
  637. package/dist/vite.cjs +7 -7
  638. package/dist/vite.d.cts +5 -1
  639. package/dist/vite.d.ts +5 -1
  640. package/dist/vite.js +4 -4
  641. package/dist/webpack.cjs +7 -7
  642. package/dist/webpack.d.cts +5 -1
  643. package/dist/webpack.d.ts +5 -1
  644. package/dist/webpack.js +4 -4
  645. package/package.json +72 -48
  646. package/dist/chunk-GBIIAZH5.cjs +0 -13
  647. package/dist/chunk-QXHINXRM.js +0 -11
  648. package/dist/chunk-UWLQNNZE.cjs +0 -12
  649. package/dist/config.cjs +0 -13
  650. package/dist/config.d.cts +0 -45
  651. package/dist/config.d.ts +0 -45
  652. package/dist/config.js +0 -4
  653. package/dist/lib/chunk-35FGUJFD.cjs +0 -2
  654. package/dist/lib/chunk-DX2VAXZB.cjs +0 -11
  655. package/dist/lib/chunk-FFT4PWRM.js +0 -1
  656. package/dist/lib/chunk-GKCWJVF7.cjs +0 -147
  657. package/dist/lib/chunk-H5JWMXTZ.js +0 -1
  658. package/dist/lib/chunk-I2DQRMX3.js +0 -1
  659. package/dist/lib/chunk-K2SFTPN3.cjs +0 -2
  660. package/dist/lib/chunk-MVIKYHBX.cjs +0 -2
  661. package/dist/lib/chunk-NQAHFTUW.js +0 -1
  662. package/dist/lib/chunk-NYNHNTHT.js +0 -1
  663. package/dist/lib/chunk-VVSEE3JE.cjs +0 -2
  664. package/dist/lib/chunk-YK4PYVLM.cjs +0 -2
  665. package/dist/plugin-utils/chunk-K2GWRZPV.js +0 -12
  666. package/dist/plugin-utils/chunk-VWFJOPKC.cjs +0 -14
@@ -2,13 +2,12 @@
2
2
 
3
3
  var chunkT3T6WSX2_cjs = require('./chunk-T3T6WSX2.cjs');
4
4
  var chunkZ6ARQDHR_cjs = require('./chunk-Z6ARQDHR.cjs');
5
- var chunkON3LABX3_cjs = require('./chunk-ON3LABX3.cjs');
5
+ var chunkSALASTMK_cjs = require('./chunk-SALASTMK.cjs');
6
6
  var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
7
7
  var core = require('@babel/core');
8
8
  var console = require('@storm-software/config-tools/logger/console');
9
9
  var types = require('@storm-software/config-tools/types');
10
10
  var toArray = require('@stryke/convert/to-array');
11
- var copyFile = require('@stryke/fs/copy-file');
12
11
  var helpers = require('@stryke/fs/helpers');
13
12
  var install = require('@stryke/fs/install');
14
13
  var listFiles = require('@stryke/fs/list-files');
@@ -20,6 +19,7 @@ var replace = require('@stryke/path/replace');
20
19
  var isError = require('@stryke/type-checks/is-error');
21
20
  var isFunction = require('@stryke/type-checks/is-function');
22
21
  var isNumber = require('@stryke/type-checks/is-number');
22
+ var isObject = require('@stryke/type-checks/is-object');
23
23
  var isPromise = require('@stryke/type-checks/is-promise');
24
24
  var isSet = require('@stryke/type-checks/is-set');
25
25
  var isSetObject = require('@stryke/type-checks/is-set-object');
@@ -29,9 +29,9 @@ var Handlebars = require('handlebars');
29
29
  var helperPluginUtils = require('@babel/helper-plugin-utils');
30
30
  var t = require('@babel/types');
31
31
  var ts = require('typescript');
32
- var join = require('@stryke/path/join');
33
32
  var defu7 = require('defu');
34
33
  var tsMorph = require('ts-morph');
34
+ var isString = require('@stryke/type-checks/is-string');
35
35
  var _package = require('@stryke/string-format/package');
36
36
  var superdiff = require('@donedeal0/superdiff');
37
37
  var json = require('@stryke/fs/json');
@@ -39,8 +39,6 @@ var stormJson = require('@stryke/json/storm-json');
39
39
  var filePathFns = require('@stryke/path/file-path-fns');
40
40
  var titleCase = require('@stryke/string-format/title-case');
41
41
  var exists = require('@stryke/fs/exists');
42
- var writeFile$1 = require('@stryke/fs/write-file');
43
- var prettier = require('prettier');
44
42
  var getConfig = require('@storm-software/config-tools/get-config');
45
43
  var c12 = require('c12');
46
44
  var getEnvPaths = require('@stryke/env/get-env-paths');
@@ -49,33 +47,38 @@ var hashFiles = require('@stryke/hash/hash-files');
49
47
  var murmurhash = require('@stryke/hash/murmurhash');
50
48
  var getUnique = require('@stryke/helpers/get-unique');
51
49
  var omit = require('@stryke/helpers/omit');
50
+ var fetch = require('@stryke/http/fetch');
52
51
  var isType = require('@stryke/path/is-type');
52
+ var join = require('@stryke/path/join');
53
53
  var isNull = require('@stryke/type-checks/is-null');
54
- var isString = require('@stryke/type-checks/is-string');
55
54
  var uuid = require('@stryke/unique-id/uuid');
56
55
  var bundleRequire = require('bundle-require');
56
+ var flatCache = require('flat-cache');
57
+ var oxcParser = require('oxc-parser');
58
+ var undici = require('undici');
57
59
  var jiti = require('jiti');
58
60
  var isUndefined = require('@stryke/type-checks/is-undefined');
59
61
  var parseTypeDefinition = require('@stryke/convert/parse-type-definition');
60
62
  var isFile = require('@stryke/fs/is-file');
61
63
  var $ = require('@stryke/capnp');
62
64
  var buffer = require('@stryke/fs/buffer');
63
- var correctPath = require('@stryke/path/correct-path');
64
65
  var isParentPath = require('@stryke/path/is-parent-path');
65
66
  var prettyBytes = require('@stryke/string-format/pretty-bytes');
66
- var flatCache = require('flat-cache');
67
67
  var buffer$1 = require('buffer');
68
+ var url = require('url');
69
+ var prettier = require('prettier');
68
70
  var logger = require('@storm-software/config-tools/logger');
69
71
  var colors = require('@storm-software/config-tools/utilities/colors');
70
72
  var noop = require('@stryke/helpers/noop');
73
+ var correctPath = require('@stryke/path/correct-path');
71
74
  var slash = require('@stryke/path/slash');
72
75
  var readFile = require('@stryke/fs/read-file');
76
+ var writeFile = require('@stryke/fs/write-file');
73
77
  var fs = require('fs');
74
78
  var promises = require('fs/promises');
75
79
  var path = require('path');
76
80
  require('@stryke/fs/remove-file');
77
81
  var kebabCase = require('@stryke/string-format/kebab-case');
78
- var isObject = require('@stryke/type-checks/is-object');
79
82
 
80
83
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
81
84
 
@@ -218,13 +221,16 @@ var VirtualFileSystemHost = class extends tsMorph.InMemoryFileSystemHost {
218
221
  this.#context.fs.removeSync(path);
219
222
  }
220
223
  readDirSync(dirPath) {
224
+ if (!this.#context.fs.isDirectorySync(dirPath)) {
225
+ return [];
226
+ }
221
227
  return this.#context.fs.listSync(dirPath).reduce((ret, entry) => {
222
- const fullPath = this.#context.fs.resolveSync(join.joinPaths(dirPath, entry));
228
+ const fullPath = this.#context.fs.resolveSync(entry);
223
229
  if (fullPath) {
224
230
  ret.push({
225
231
  name: entry,
226
- isDirectory: this.#context.fs.existsSync(fullPath),
227
- isFile: this.#context.fs.existsSync(fullPath),
232
+ isDirectory: this.#context.fs.isDirectorySync(fullPath),
233
+ isFile: this.#context.fs.isFileSync(fullPath),
228
234
  isSymlink: false
229
235
  });
230
236
  }
@@ -232,14 +238,14 @@ var VirtualFileSystemHost = class extends tsMorph.InMemoryFileSystemHost {
232
238
  }, []);
233
239
  }
234
240
  async readFile(filePath) {
235
- if (!this.#context.fs.existsSync(filePath)) {
236
- throw new Error(`File not found: '${filePath}'. Please check the path and try again.`);
241
+ if (!this.#context.fs.isFileSync(filePath)) {
242
+ return "";
237
243
  }
238
244
  return await this.#context.fs.read(filePath);
239
245
  }
240
246
  readFileSync(filePath) {
241
- if (!this.#context.fs.existsSync(filePath)) {
242
- throw new Error(`File not found: '${filePath}'. Please check the path and try again.`);
247
+ if (!this.#context.fs.isFileSync(filePath)) {
248
+ return "";
243
249
  }
244
250
  return this.#context.fs.readSync(filePath);
245
251
  }
@@ -249,9 +255,11 @@ var VirtualFileSystemHost = class extends tsMorph.InMemoryFileSystemHost {
249
255
  writeFileSync(filePath, fileText) {
250
256
  this.#context.fs.writeSync(filePath, fileText);
251
257
  }
252
- async mkdir(_dirPath) {
258
+ async mkdir(dirPath) {
259
+ await this.#context.fs.mkdir(dirPath);
253
260
  }
254
- mkdirSync(_dirPath) {
261
+ mkdirSync(dirPath) {
262
+ this.#context.fs.mkdirSync(dirPath);
255
263
  }
256
264
  async move(srcPath, destPath) {
257
265
  await this.#context.fs.move(srcPath, destPath);
@@ -266,16 +274,16 @@ var VirtualFileSystemHost = class extends tsMorph.InMemoryFileSystemHost {
266
274
  this.#context.fs.copySync(srcPath, destPath);
267
275
  }
268
276
  async fileExists(filePath) {
269
- return this.#context.fs.exists(filePath);
277
+ return this.#context.fs.isFile(filePath);
270
278
  }
271
279
  fileExistsSync(filePath) {
272
- return this.#context.fs.existsSync(filePath);
280
+ return this.#context.fs.isFileSync(filePath);
273
281
  }
274
282
  async directoryExists(dirPath) {
275
- return this.#context.fs.exists(dirPath);
283
+ return this.#context.fs.isDirectory(dirPath);
276
284
  }
277
285
  directoryExistsSync(dirPath) {
278
- return this.#context.fs.existsSync(dirPath);
286
+ return this.#context.fs.isDirectorySync(dirPath);
279
287
  }
280
288
  realpathSync(path) {
281
289
  return this.#context.fs.resolveSync(path) || path;
@@ -354,6 +362,14 @@ ${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : dia
354
362
  return formatTypes(builtinModules);
355
363
  }
356
364
  chunkPK6SKIKE_cjs.__name(emitTypes, "emitTypes");
365
+ var mergeResults = defu7.createDefu((obj, key, value) => {
366
+ if (isString.isString(obj[key]) && isString.isString(value)) {
367
+ obj[key] = `${obj[key] || ""}
368
+ ${value || ""}`.trim();
369
+ return true;
370
+ }
371
+ return false;
372
+ });
357
373
  async function callHook(context, hook, options, ...args) {
358
374
  const handlers = context.selectHooks(hook, options);
359
375
  if (handlers.length > 0) {
@@ -361,18 +377,28 @@ async function callHook(context, hook, options, ...args) {
361
377
  let results = [];
362
378
  if (options?.sequential === false) {
363
379
  results = await Promise.all(handlers.map(async (handler) => {
364
- if (!isFunction.isFunction(handler)) {
380
+ if (!isFunction.isFunction(handler.handle)) {
365
381
  throw new Error(`Plugin hook handler for hook "${hook}" is not a function.`);
366
382
  }
367
- return Promise.resolve(handler.apply(null, ...args));
383
+ return Promise.resolve(
384
+ // eslint-disable-next-line ts/no-unsafe-call
385
+ handler.handle.apply(handler.context, [
386
+ ...args
387
+ ])
388
+ );
368
389
  }));
369
390
  } else {
370
391
  for (const handler of handlers) {
371
- if (!isFunction.isFunction(handler)) {
392
+ if (!isFunction.isFunction(handler.handle)) {
372
393
  throw new Error(`Plugin hook handler for hook "${hook}" is not a function.`);
373
394
  }
374
395
  if (options?.result === "first" || options?.asNextParam === false) {
375
- results.push(await Promise.resolve(handler.apply(null, ...args)));
396
+ results.push(await Promise.resolve(
397
+ // eslint-disable-next-line ts/no-unsafe-call
398
+ handler.handle.apply(handler.context, [
399
+ ...args
400
+ ])
401
+ ));
376
402
  if (options?.result === "first" && isSet.isSet(results[results.length - 1])) {
377
403
  break;
378
404
  }
@@ -385,11 +411,26 @@ async function callHook(context, hook, options, ...args) {
385
411
  }
386
412
  const result = await Promise.resolve(
387
413
  // eslint-disable-next-line ts/no-unsafe-call
388
- handler.apply(null, ...sequenceArgs)
414
+ handler.handle.apply(handler.context, [
415
+ ...sequenceArgs
416
+ ])
389
417
  );
390
- results = [
391
- result
392
- ];
418
+ if (result) {
419
+ if (options?.result === "last") {
420
+ results = [
421
+ result
422
+ ];
423
+ } else if (isString.isString(result)) {
424
+ results = [
425
+ `${isString.isString(results[0]) ? results[0] || "" : ""}
426
+ ${result || ""}`.trim()
427
+ ];
428
+ } else if (isObject.isObject(result)) {
429
+ results = [
430
+ mergeResults(result, results[0] ?? {})
431
+ ];
432
+ }
433
+ }
393
434
  }
394
435
  }
395
436
  }
@@ -555,33 +596,20 @@ ${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && err
555
596
  };
556
597
  }
557
598
  chunkPK6SKIKE_cjs.__name(getParsedTypeScriptConfig, "getParsedTypeScriptConfig");
558
- async function writeFile(log, filepath, content, skipFormat = false) {
559
- try {
560
- if (skipFormat) {
561
- await writeFile$1.writeFile(filepath, content);
562
- } else {
563
- const config = await prettier.resolveConfig(filepath);
564
- const formatted = await prettier.format(content, {
565
- ...config ?? {},
566
- filepath
567
- });
568
- await writeFile$1.writeFile(filepath, formatted || "");
569
- }
570
- } catch (error) {
571
- log(types.LogLevelLabel.ERROR, `Failed to write file ${filepath} to disk
572
- ${error?.message ? error.message : ""}`);
573
- }
574
- }
575
- chunkPK6SKIKE_cjs.__name(writeFile, "writeFile");
576
599
 
577
600
  // src/internal/helpers/resolve-tsconfig.ts
601
+ function getTsconfigDtsPath(context) {
602
+ const dtsRelativePath = joinPaths.joinPaths(filePathFns.relativePath(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), filePathFns.findFilePath(context.dtsPath)), filePathFns.findFileName(context.dtsPath));
603
+ return dtsRelativePath;
604
+ }
605
+ chunkPK6SKIKE_cjs.__name(getTsconfigDtsPath, "getTsconfigDtsPath");
578
606
  async function resolveTsconfigChanges(context) {
579
607
  const tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
580
608
  const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
581
609
  const tsconfigJson = await json.readJsonFile(tsconfigFilePath);
582
610
  tsconfigJson.compilerOptions ??= {};
583
611
  if (context.config.output.dts !== false) {
584
- const dtsRelativePath = joinPaths.joinPaths(filePathFns.relativePath(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), filePathFns.findFilePath(context.dtsPath)), filePathFns.findFileName(context.dtsPath));
612
+ const dtsRelativePath = getTsconfigDtsPath(context);
585
613
  if (!tsconfigJson.include?.some((filePattern) => isIncludeMatchFound(filePattern, [
586
614
  context.dtsPath,
587
615
  dtsRelativePath
@@ -623,7 +651,7 @@ async function initializeTsconfig(context) {
623
651
  context.tsconfig.originalTsconfigJson = await json.readJsonFile(tsconfigFilePath);
624
652
  context.tsconfig.tsconfigJson = await resolveTsconfigChanges(context);
625
653
  context.log(types.LogLevelLabel.TRACE, "Writing updated TypeScript configuration (tsconfig.json) file to disk.");
626
- await writeFile(context.log, tsconfigFilePath, stormJson.StormJSON.stringify(context.tsconfig.tsconfigJson));
654
+ await context.fs.write(tsconfigFilePath, stormJson.StormJSON.stringify(context.tsconfig.tsconfigJson));
627
655
  context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw, context.tsconfig.originalTsconfigJson);
628
656
  }
629
657
  chunkPK6SKIKE_cjs.__name(initializeTsconfig, "initializeTsconfig");
@@ -672,13 +700,11 @@ async function resolveTsconfig(context) {
672
700
  `).join("\n")}
673
701
  `);
674
702
  }
675
- await writeFile(context.log, context.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(updateTsconfigJson));
703
+ await context.fs.write(context.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(updateTsconfigJson));
676
704
  context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
677
705
  if (!context.tsconfig) {
678
706
  throw new Error("Failed to parse the TypeScript configuration file.");
679
707
  }
680
- context.tsconfig.tsconfigJson.compilerOptions ??= {};
681
- context.tsconfig.tsconfigJson.compilerOptions.strict = false;
682
708
  }
683
709
  chunkPK6SKIKE_cjs.__name(resolveTsconfig, "resolveTsconfig");
684
710
  var DEFAULT_ENVIRONMENT = "default";
@@ -858,7 +884,7 @@ function replacePathTokens(context, path) {
858
884
  if (!path) {
859
885
  return path;
860
886
  }
861
- 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}", replace.replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replace.replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replace.replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
887
+ 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}", replace.replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replace.replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replace.replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
862
888
  }
863
889
  chunkPK6SKIKE_cjs.__name(replacePathTokens, "replacePathTokens");
864
890
  function resolveEntryInputFile(context, typeDefinition) {
@@ -1192,20 +1218,17 @@ function normalizePath(path, builtinsPath, prefix = "powerlines") {
1192
1218
  return isType.isAbsolutePath(path) ? path : isValidId(toFilePath(path), prefix) ? normalizeId(toFilePath(path), prefix).replace(new RegExp(`^${prefix.replace(/:$/, "")}:`), builtinsPath) : toFilePath(path);
1193
1219
  }
1194
1220
  chunkPK6SKIKE_cjs.__name(normalizePath, "normalizePath");
1195
- function normalizeKey(key, sep = ":") {
1196
- if (!key) {
1197
- return "";
1198
- }
1199
- return key.replace(/[:/\\]/g, sep).replace(/^[:/\\]|[:/\\]$/g, "");
1200
- }
1201
- chunkPK6SKIKE_cjs.__name(normalizeKey, "normalizeKey");
1202
- function filterKeyByBase(key, base) {
1203
- if (base) {
1204
- return key.startsWith(base) && key[key.length - 1] !== "$";
1205
- }
1206
- return key[key.length - 1] !== "$";
1221
+ function normalizeGlobPatterns(workspaceRoot, patterns) {
1222
+ return getUnique.getUnique(toArray.toArray(patterns).map((pattern) => {
1223
+ if (isSetObject.isSetObject(pattern) && (isSetString.isSetString(pattern.input) || isSetString.isSetString(pattern.glob))) {
1224
+ return join.joinPaths(pattern.input || workspaceRoot, pattern.glob || "**/*");
1225
+ } else if (!isSetString.isSetString(pattern)) {
1226
+ return void 0;
1227
+ }
1228
+ return pattern;
1229
+ }).filter(isSetString.isSetString));
1207
1230
  }
1208
- chunkPK6SKIKE_cjs.__name(filterKeyByBase, "filterKeyByBase");
1231
+ chunkPK6SKIKE_cjs.__name(normalizeGlobPatterns, "normalizeGlobPatterns");
1209
1232
  var BaseStorageAdapter = class {
1210
1233
  static {
1211
1234
  chunkPK6SKIKE_cjs.__name(this, "BaseStorageAdapter");
@@ -1260,6 +1283,21 @@ var BaseStorageAdapter = class {
1260
1283
  }
1261
1284
  }
1262
1285
  /**
1286
+ * Synchronously creates a directory at the specified path.
1287
+ *
1288
+ * @param _ - The path of the directory to create.
1289
+ */
1290
+ mkdirSync(_) {
1291
+ }
1292
+ /**
1293
+ * Creates a directory at the specified path.
1294
+ *
1295
+ * @param dirPath - The path of the directory to create.
1296
+ */
1297
+ async mkdir(dirPath) {
1298
+ return Promise.resolve(this.mkdirSync(dirPath));
1299
+ }
1300
+ /**
1263
1301
  * Asynchronously removes a key from the storage.
1264
1302
  *
1265
1303
  * @param key - The key to remove.
@@ -1308,6 +1346,42 @@ var BaseStorageAdapter = class {
1308
1346
  return this.listSync(base);
1309
1347
  }
1310
1348
  /**
1349
+ * Synchronously checks if the given key is a directory.
1350
+ *
1351
+ * @param _ - The key to check.
1352
+ * @returns `true` if the key is a directory, otherwise `false`.
1353
+ */
1354
+ isDirectorySync(_) {
1355
+ return false;
1356
+ }
1357
+ /**
1358
+ * Checks if the given key is a directory.
1359
+ *
1360
+ * @param key - The key to check.
1361
+ * @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
1362
+ */
1363
+ async isDirectory(key) {
1364
+ return Promise.resolve(this.isDirectorySync(key));
1365
+ }
1366
+ /**
1367
+ * Synchronously checks if the given key is a file.
1368
+ *
1369
+ * @param key - The key to check.
1370
+ * @returns `true` if the key is a file, otherwise `false`.
1371
+ */
1372
+ isFileSync(key) {
1373
+ return this.existsSync(key) && !this.isDirectorySync(key);
1374
+ }
1375
+ /**
1376
+ * Checks if the given key is a file.
1377
+ *
1378
+ * @param key - The key to check.
1379
+ * @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
1380
+ */
1381
+ async isFile(key) {
1382
+ return Promise.resolve(this.isFileSync(key));
1383
+ }
1384
+ /**
1311
1385
  * Disposes of the storage adapter, releasing any held resources.
1312
1386
  *
1313
1387
  * @returns A promise that resolves when the disposal is complete.
@@ -1409,7 +1483,7 @@ var FileSystemStorageAdapter = class extends BaseStorageAdapter {
1409
1483
  */
1410
1484
  setSync(key, value) {
1411
1485
  if (!this.options.isReadOnly) {
1412
- return writeFile$1.writeFileSync(this.resolve(key), value);
1486
+ return writeFile.writeFileSync(this.resolve(key), value);
1413
1487
  }
1414
1488
  }
1415
1489
  /**
@@ -1420,7 +1494,7 @@ var FileSystemStorageAdapter = class extends BaseStorageAdapter {
1420
1494
  */
1421
1495
  async set(key, value) {
1422
1496
  if (!this.options.isReadOnly) {
1423
- return writeFile$1.writeFile(this.resolve(key), value);
1497
+ return writeFile.writeFile(this.resolve(key), value);
1424
1498
  }
1425
1499
  }
1426
1500
  /**
@@ -1448,6 +1522,22 @@ var FileSystemStorageAdapter = class extends BaseStorageAdapter {
1448
1522
  }
1449
1523
  }
1450
1524
  /**
1525
+ * Synchronously creates a directory at the specified path.
1526
+ *
1527
+ * @param dirPath - The path of the directory to create.
1528
+ */
1529
+ mkdirSync(dirPath) {
1530
+ helpers.createDirectorySync(this.resolve(dirPath));
1531
+ }
1532
+ /**
1533
+ * Creates a directory at the specified path.
1534
+ *
1535
+ * @param dirPath - The path of the directory to create.
1536
+ */
1537
+ async mkdir(dirPath) {
1538
+ await helpers.createDirectory(this.resolve(dirPath));
1539
+ }
1540
+ /**
1451
1541
  * Lists all keys under a given base path synchronously.
1452
1542
  *
1453
1543
  * @param base - The base path to list keys from.
@@ -1473,6 +1563,24 @@ var FileSystemStorageAdapter = class extends BaseStorageAdapter {
1473
1563
  ignore: this.options.ignore
1474
1564
  }).catch(ignoreNotfound).then((r) => r || []);
1475
1565
  }
1566
+ /**
1567
+ * Synchronously checks if the given key is a directory.
1568
+ *
1569
+ * @param key - The key to check.
1570
+ * @returns `true` if the key is a directory, otherwise `false`.
1571
+ */
1572
+ isDirectorySync(key) {
1573
+ return isFile.isDirectory(this.resolve(key));
1574
+ }
1575
+ /**
1576
+ * Synchronously checks if the given key is a file.
1577
+ *
1578
+ * @param key - The key to check.
1579
+ * @returns `true` if the key is a file, otherwise `false`.
1580
+ */
1581
+ isFileSync(key) {
1582
+ return !isFile.isFile(this.resolve(key));
1583
+ }
1476
1584
  };
1477
1585
  var VirtualStorageAdapter = class extends BaseStorageAdapter {
1478
1586
  static {
@@ -1603,7 +1711,11 @@ var VirtualFileSystem = class _VirtualFileSystem {
1603
1711
  * @returns The normalized module id.
1604
1712
  */
1605
1713
  #normalizeId(id) {
1606
- return normalizeId(id, this.#context.config.output.builtinPrefix);
1714
+ let normalized = id;
1715
+ if (isParentPath.isParentPath(normalized, this.#context.builtinsPath)) {
1716
+ normalized = replace.replacePath(normalized, this.#context.builtinsPath);
1717
+ }
1718
+ return normalizeId(normalized, this.#context.config.output.builtinPrefix);
1607
1719
  }
1608
1720
  /**
1609
1721
  * Normalizes a given path by resolving it against the project root, workspace root, and built-ins path.
@@ -1612,7 +1724,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
1612
1724
  * @returns The normalized path.
1613
1725
  */
1614
1726
  #normalizePath(path) {
1615
- return normalizePath(path, this.#context.builtinsPath, this.#context.config.output.builtinPrefix);
1727
+ return normalizePath(path.includes("{") || path.includes("}") ? replacePathTokens(this.#context, path) : path, this.#context.builtinsPath, this.#context.config.output.builtinPrefix);
1616
1728
  }
1617
1729
  /**
1618
1730
  * Builds a regular expression from a string pattern for path matching.
@@ -1765,7 +1877,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
1765
1877
  this.#storage.virtual ??= new VirtualStorageAdapter({
1766
1878
  base: "/_virtual"
1767
1879
  });
1768
- if (this.#context.config.output.storage !== chunkON3LABX3_cjs.StoragePreset.FS) {
1880
+ if (this.#context.config.output.storage !== chunkSALASTMK_cjs.StoragePreset.FS) {
1769
1881
  this.#storage[this.#context.artifactsPath] ??= new VirtualStorageAdapter({
1770
1882
  base: this.#context.artifactsPath
1771
1883
  });
@@ -1839,26 +1951,65 @@ var VirtualFileSystem = class _VirtualFileSystem {
1839
1951
  return this.#getStorage(resolved)?.adapter?.name === "virtual";
1840
1952
  }
1841
1953
  /**
1954
+ * Checks if a path is a directory in the virtual file system (VFS).
1955
+ *
1956
+ * @param path - The path to check.
1957
+ * @returns `true` if the path is a directory, otherwise `false`.
1958
+ */
1959
+ isDirectorySync(path) {
1960
+ const resolved = this.resolveSync(path);
1961
+ if (!resolved) {
1962
+ return false;
1963
+ }
1964
+ return !!(this.existsSync(resolved) && this.#getStorage(resolved)?.adapter?.isDirectorySync(resolved));
1965
+ }
1966
+ /**
1967
+ * Checks if a path is a directory in the virtual file system (VFS).
1968
+ *
1969
+ * @param path - The path to check.
1970
+ * @returns `true` if the path is a directory, otherwise `false`.
1971
+ */
1972
+ async isDirectory(path) {
1973
+ const resolved = await this.resolve(path);
1974
+ if (!resolved) {
1975
+ return false;
1976
+ }
1977
+ return !!(await this.exists(resolved) && await this.#getStorage(resolved)?.adapter?.isDirectory(resolved));
1978
+ }
1979
+ /**
1980
+ * Checks if a path is a file in the virtual file system (VFS).
1981
+ *
1982
+ * @param path - The path to check.
1983
+ * @returns `true` if the path is a file, otherwise `false`.
1984
+ */
1985
+ isFileSync(path) {
1986
+ const resolved = this.resolveSync(path);
1987
+ if (!resolved) {
1988
+ return false;
1989
+ }
1990
+ return this.#getStorage(resolved)?.adapter?.isFileSync(resolved) ?? false;
1991
+ }
1992
+ /**
1993
+ * Checks if a path is a file in the virtual file system (VFS).
1994
+ *
1995
+ * @param path - The path to check.
1996
+ * @returns `true` if the path is a file, otherwise `false`.
1997
+ */
1998
+ async isFile(path) {
1999
+ const resolved = await this.resolve(path);
2000
+ if (!resolved) {
2001
+ return false;
2002
+ }
2003
+ return await this.#getStorage(resolved)?.adapter?.isFile(resolved) ?? false;
2004
+ }
2005
+ /**
1842
2006
  * Lists files in a given path.
1843
2007
  *
1844
2008
  * @param path - The path to list files from.
1845
2009
  * @returns An array of file names in the specified path.
1846
2010
  */
1847
2011
  listSync(path) {
1848
- let maskedMounts = [];
1849
- const allKeys = [];
1850
- for (const storage of this.#getStorages(path, true)) {
1851
- for (const key of storage.adapter.listSync(storage.relativeBase)) {
1852
- if (!maskedMounts.some((p) => `${storage.base}${normalizeKey(key)}`.startsWith(p))) {
1853
- allKeys.push(`${storage.base}${normalizeKey(key)}`);
1854
- }
1855
- }
1856
- maskedMounts = [
1857
- storage.base,
1858
- ...maskedMounts.filter((p) => !p.startsWith(storage.base))
1859
- ];
1860
- }
1861
- return allKeys.filter((key) => filterKeyByBase(key, path));
2012
+ return getUnique.getUnique(this.#getStorages(path, true).map((storage) => storage.adapter.listSync(storage.relativeBase ? storage.base ? append.appendPath(storage.relativeBase, storage.base) : storage.relativeBase : storage.base)).flat());
1862
2013
  }
1863
2014
  /**
1864
2015
  * Lists files in a given path.
@@ -1867,20 +2018,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
1867
2018
  * @returns An array of file names in the specified path.
1868
2019
  */
1869
2020
  async list(path) {
1870
- let maskedMounts = [];
1871
- const allKeys = [];
1872
- for (const storage of this.#getStorages(path, true)) {
1873
- for (const key of await storage.adapter.list(storage.relativeBase)) {
1874
- if (!maskedMounts.some((p) => `${storage.base}${normalizeKey(key)}`.startsWith(p))) {
1875
- allKeys.push(`${storage.base}${normalizeKey(key)}`);
1876
- }
1877
- }
1878
- maskedMounts = [
1879
- storage.base,
1880
- ...maskedMounts.filter((p) => !p.startsWith(storage.base))
1881
- ];
1882
- }
1883
- return allKeys.filter((key) => filterKeyByBase(key, path));
2021
+ return getUnique.getUnique((await Promise.all(this.#getStorages(path, true).map(async (storage) => storage.adapter.list(storage.relativeBase ? storage.base ? append.appendPath(storage.relativeBase, storage.base) : storage.relativeBase : storage.base)))).flat());
1884
2022
  }
1885
2023
  /**
1886
2024
  * Removes a file in the virtual file system (VFS).
@@ -1932,12 +2070,16 @@ var VirtualFileSystem = class _VirtualFileSystem {
1932
2070
  */
1933
2071
  async glob(patterns) {
1934
2072
  const results = [];
1935
- for (const pattern of toArray.toArray(patterns)) {
2073
+ for (const pattern of normalizeGlobPatterns(this.#context.workspaceConfig.workspaceRoot, patterns)) {
1936
2074
  const normalized = this.#normalizePath(pattern);
1937
2075
  if (!/[*?[\]{}]/.test(normalized) && !normalized.includes("**")) {
1938
- const resolved = this.resolveSync(normalized);
1939
- if (resolved && !results.includes(resolved)) {
1940
- results.push(resolved);
2076
+ if (this.isDirectorySync(normalized)) {
2077
+ results.push(...await this.list(normalized));
2078
+ } else {
2079
+ const resolved = await this.resolve(normalized);
2080
+ if (resolved && !results.includes(resolved)) {
2081
+ results.push(resolved);
2082
+ }
1941
2083
  }
1942
2084
  continue;
1943
2085
  }
@@ -1963,12 +2105,16 @@ var VirtualFileSystem = class _VirtualFileSystem {
1963
2105
  */
1964
2106
  globSync(patterns) {
1965
2107
  const results = [];
1966
- for (const pattern of toArray.toArray(patterns)) {
2108
+ for (const pattern of normalizeGlobPatterns(this.#context.workspaceConfig.workspaceRoot, patterns)) {
1967
2109
  const normalized = this.#normalizePath(pattern);
1968
2110
  if (!/[*?[\]{}]/.test(normalized) && !normalized.includes("**")) {
1969
- const resolved = this.resolveSync(normalized);
1970
- if (resolved && !results.includes(resolved)) {
1971
- results.push(resolved);
2111
+ if (this.isDirectorySync(normalized)) {
2112
+ results.push(...this.listSync(normalized));
2113
+ } else {
2114
+ const resolved = this.resolveSync(normalized);
2115
+ if (resolved && !results.includes(resolved)) {
2116
+ results.push(resolved);
2117
+ }
1972
2118
  }
1973
2119
  continue;
1974
2120
  }
@@ -1994,20 +2140,27 @@ var VirtualFileSystem = class _VirtualFileSystem {
1994
2140
  * @param destPath - The destination path to copy to
1995
2141
  */
1996
2142
  async copy(srcPath, destPath) {
1997
- if (filePathFns.hasFileExtension(srcPath)) {
1998
- const content = await this.read(srcPath);
2143
+ const src = srcPath instanceof URL ? url.fileURLToPath(srcPath) : srcPath;
2144
+ const dest = destPath instanceof URL ? url.fileURLToPath(destPath) : destPath;
2145
+ if (!isSetString.isSetString(src) && (!isSetObject.isSetObject(src) || !isSetString.isSetString(src.input)) || !isSetString.isSetString(dest)) {
2146
+ return;
2147
+ }
2148
+ const sourceStr = isString.isString(src) ? src : src.input ? src.input : this.#context.workspaceConfig.workspaceRoot;
2149
+ const source = await this.resolve(sourceStr);
2150
+ if (!source) {
2151
+ return;
2152
+ }
2153
+ if (this.isDirectorySync(source) || isSetString.isSetString(src) && src.includes("*") || isSetObject.isSetObject(src) && isSetString.isSetString(src.glob)) {
2154
+ await Promise.all((await this.glob(src)).map(async (file) => {
2155
+ return this.copy(file, append.appendPath(replace.replacePath(file, sourceStr), dest));
2156
+ }));
2157
+ } else {
2158
+ const content = await this.read(source);
1999
2159
  if (content !== void 0) {
2000
- await this.write(filePathFns.hasFileExtension(destPath) ? destPath : joinPaths.joinPaths(destPath, filePathFns.findFileName(srcPath)), content);
2160
+ await this.write(this.#normalizePath(dest), content, {
2161
+ skipFormat: true
2162
+ });
2001
2163
  }
2002
- } else {
2003
- await Promise.all((await this.list(srcPath)).map(async (file) => {
2004
- const relativePath2 = file.replace(this.#normalizePath(srcPath), "");
2005
- const destinationPath = this.#normalizePath(append.appendPath(destPath, relativePath2));
2006
- const content = await this.read(file);
2007
- if (content !== void 0) {
2008
- await this.write(destinationPath, content);
2009
- }
2010
- }));
2011
2164
  }
2012
2165
  }
2013
2166
  /**
@@ -2017,20 +2170,27 @@ var VirtualFileSystem = class _VirtualFileSystem {
2017
2170
  * @param destPath - The destination path to copy to
2018
2171
  */
2019
2172
  copySync(srcPath, destPath) {
2020
- if (filePathFns.hasFileExtension(srcPath)) {
2021
- const content = this.readSync(srcPath);
2173
+ const src = srcPath instanceof URL ? url.fileURLToPath(srcPath) : srcPath;
2174
+ const dest = destPath instanceof URL ? url.fileURLToPath(destPath) : destPath;
2175
+ if (!isSetString.isSetString(src) && (!isSetObject.isSetObject(src) || !isSetString.isSetString(src.input)) || !isSetString.isSetString(dest)) {
2176
+ return;
2177
+ }
2178
+ const sourceStr = isString.isString(src) ? src : src.input ? src.input : this.#context.workspaceConfig.workspaceRoot;
2179
+ const source = this.resolveSync(sourceStr);
2180
+ if (!source) {
2181
+ return;
2182
+ }
2183
+ if (this.isDirectorySync(source) || isSetString.isSetString(src) && src.includes("*") || isSetObject.isSetObject(src) && isSetString.isSetString(src.glob)) {
2184
+ this.globSync(src).map((file) => {
2185
+ return this.copySync(file, append.appendPath(filePathFns.findFilePath(replace.replacePath(file, sourceStr)), dest));
2186
+ });
2187
+ } else {
2188
+ const content = this.readSync(source);
2022
2189
  if (content !== void 0) {
2023
- this.writeSync(filePathFns.hasFileExtension(destPath) ? destPath : joinPaths.joinPaths(destPath, filePathFns.findFileName(srcPath)), content);
2190
+ this.writeSync(this.#normalizePath(filePathFns.hasFileExtension(dest) ? dest : append.appendPath(filePathFns.findFileName(source), dest)), content, {
2191
+ skipFormat: true
2192
+ });
2024
2193
  }
2025
- } else {
2026
- this.listSync(srcPath).forEach((file) => {
2027
- const relativePath2 = file.replace(this.#normalizePath(srcPath), "");
2028
- const destinationPath = this.#normalizePath(append.appendPath(destPath, relativePath2));
2029
- const content = this.readSync(file);
2030
- if (content !== void 0) {
2031
- this.writeSync(destinationPath, content);
2032
- }
2033
- });
2034
2194
  }
2035
2195
  }
2036
2196
  /**
@@ -2117,15 +2277,15 @@ var VirtualFileSystem = class _VirtualFileSystem {
2117
2277
  }
2118
2278
  }
2119
2279
  const { relativeKey, adapter } = this.#getStorage(path);
2120
- this.#log(types.LogLevelLabel.TRACE, `Writing ${this.#normalizePath(path)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes.prettyBytes(new buffer$1.Blob(toArray.toArray(code)).size)})`);
2121
- const id = options?.meta?.id || this.#normalizeId(path);
2280
+ this.#log(types.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.prettyBytes(new buffer$1.Blob(toArray.toArray(code)).size)})`);
2281
+ const id = options?.meta?.id || this.#normalizeId(relativeKey);
2122
2282
  this.#metadata[id] = {
2123
2283
  variant: "normal",
2124
2284
  timestamp: Date.now(),
2125
2285
  ...options.meta ?? {}
2126
2286
  };
2127
- this.#paths[id] = this.#normalizePath(path);
2128
- this.#ids[this.#normalizePath(path)] = id;
2287
+ this.#paths[id] = this.#normalizePath(relativeKey);
2288
+ this.#ids[this.#normalizePath(relativeKey)] = id;
2129
2289
  return adapter.set(relativeKey, code);
2130
2290
  }
2131
2291
  /**
@@ -2137,18 +2297,34 @@ var VirtualFileSystem = class _VirtualFileSystem {
2137
2297
  */
2138
2298
  writeSync(path, data = "", options = {}) {
2139
2299
  const { relativeKey, adapter } = this.#getStorage(path);
2140
- this.#log(types.LogLevelLabel.TRACE, `Writing ${this.#normalizePath(path)} file to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes.prettyBytes(new buffer$1.Blob(toArray.toArray(data)).size)})`);
2141
- const id = options?.meta?.id || this.#normalizeId(path);
2300
+ this.#log(types.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.prettyBytes(new buffer$1.Blob(toArray.toArray(data)).size)})`);
2301
+ const id = options?.meta?.id || this.#normalizeId(relativeKey);
2142
2302
  this.#metadata[id] = {
2143
2303
  variant: "normal",
2144
2304
  timestamp: Date.now(),
2145
2305
  ...options.meta ?? {}
2146
2306
  };
2147
- this.#paths[id] = this.#normalizePath(path);
2148
- this.#ids[this.#normalizePath(path)] = id;
2307
+ this.#paths[id] = this.#normalizePath(relativeKey);
2308
+ this.#ids[this.#normalizePath(relativeKey)] = id;
2149
2309
  return adapter.setSync(relativeKey, data);
2150
2310
  }
2151
2311
  /**
2312
+ * Synchronously creates a directory at the specified path.
2313
+ *
2314
+ * @param dirPath - The path of the directory to create.
2315
+ */
2316
+ mkdirSync(dirPath) {
2317
+ return this.#getStorage(dirPath)?.adapter?.mkdirSync(dirPath);
2318
+ }
2319
+ /**
2320
+ * Creates a directory at the specified path.
2321
+ *
2322
+ * @param path - The path of the directory to create.
2323
+ */
2324
+ async mkdir(path) {
2325
+ return this.#getStorage(path)?.adapter?.mkdir(path);
2326
+ }
2327
+ /**
2152
2328
  * Retrieves the metadata of a file in the virtual file system (VFS).
2153
2329
  *
2154
2330
  * @param pathOrId - The path or ID of the file to retrieve metadata for.
@@ -2178,11 +2354,15 @@ var VirtualFileSystem = class _VirtualFileSystem {
2178
2354
  * @returns A promise that resolves to the resolved module path.
2179
2355
  */
2180
2356
  async resolve(id, importer, options = {}) {
2181
- if (isType.isAbsolutePath(id)) {
2182
- return id;
2357
+ let path = id;
2358
+ if (path.includes("{") || path.includes("}")) {
2359
+ path = replacePathTokens(this.#context, path);
2360
+ }
2361
+ if (isType.isAbsolutePath(path)) {
2362
+ return path;
2183
2363
  }
2184
2364
  const resolverCacheKey = murmurhash.murmurhash({
2185
- id: this.#normalizeId(id),
2365
+ path: this.#normalizeId(path),
2186
2366
  importer,
2187
2367
  options
2188
2368
  });
@@ -2193,7 +2373,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
2193
2373
  return result;
2194
2374
  }
2195
2375
  }
2196
- result = this.paths[this.#normalizeId(id)];
2376
+ result = this.paths[this.#normalizeId(path)];
2197
2377
  if (!result) {
2198
2378
  const paths = options.paths ?? [];
2199
2379
  if (importer && !paths.includes(importer)) {
@@ -2202,8 +2382,8 @@ var VirtualFileSystem = class _VirtualFileSystem {
2202
2382
  paths.push(this.#context.workspaceConfig.workspaceRoot);
2203
2383
  paths.push(append.appendPath(this.#context.config.projectRoot, this.#context.workspaceConfig.workspaceRoot));
2204
2384
  paths.push(append.appendPath(this.#context.config.sourceRoot, this.#context.workspaceConfig.workspaceRoot));
2205
- paths.push(...Object.keys(this.#context.tsconfig.options.paths ?? {}).filter((tsconfigPath) => id.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig.options.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => append.appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
2206
- for (const combination of resolve.getResolutionCombinations(id, {
2385
+ 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) => append.appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
2386
+ for (const combination of resolve.getResolutionCombinations(path, {
2207
2387
  paths
2208
2388
  })) {
2209
2389
  const { relativeKey, adapter } = this.#getStorage(combination);
@@ -2212,19 +2392,18 @@ var VirtualFileSystem = class _VirtualFileSystem {
2212
2392
  break;
2213
2393
  }
2214
2394
  }
2215
- try {
2216
- result = await resolve.resolve(id, {
2217
- ...options,
2218
- paths
2219
- });
2220
- } catch {
2395
+ if (!result) {
2396
+ try {
2397
+ result = await resolve.resolve(path, {
2398
+ ...options,
2399
+ paths
2400
+ });
2401
+ } catch {
2402
+ }
2221
2403
  }
2222
2404
  }
2223
- if (result) {
2224
- result = correctPath.toAbsolutePath(append.appendPath(result, this.#context.config.projectRoot), this.#context.workspaceConfig.workspaceRoot);
2225
- if (!this.#context.config.skipCache) {
2226
- this.resolverCache.set(resolverCacheKey, result);
2227
- }
2405
+ if (result && !this.#context.config.skipCache) {
2406
+ this.resolverCache.set(resolverCacheKey, result);
2228
2407
  }
2229
2408
  return result;
2230
2409
  }
@@ -2245,17 +2424,21 @@ var VirtualFileSystem = class _VirtualFileSystem {
2245
2424
  * @returns The resolved module path.
2246
2425
  */
2247
2426
  resolveSync(id, importer, options = {}) {
2248
- if (isType.isAbsolutePath(id)) {
2249
- return id;
2427
+ let path = id;
2428
+ if (path.includes("{") || path.includes("}")) {
2429
+ path = replacePathTokens(this.#context, path);
2430
+ }
2431
+ if (isType.isAbsolutePath(path)) {
2432
+ return path;
2250
2433
  }
2251
2434
  let result;
2252
2435
  if (!this.#context.config.skipCache) {
2253
- result = this.resolverCache.get(this.#normalizeId(id));
2436
+ result = this.resolverCache.get(this.#normalizeId(path));
2254
2437
  if (result) {
2255
2438
  return result;
2256
2439
  }
2257
2440
  }
2258
- result = this.paths[this.#normalizeId(id)];
2441
+ result = this.paths[this.#normalizeId(path)];
2259
2442
  if (!result) {
2260
2443
  const paths = options.paths ?? [];
2261
2444
  if (importer && !paths.includes(importer)) {
@@ -2264,8 +2447,8 @@ var VirtualFileSystem = class _VirtualFileSystem {
2264
2447
  paths.push(this.#context.workspaceConfig.workspaceRoot);
2265
2448
  paths.push(append.appendPath(this.#context.config.projectRoot, this.#context.workspaceConfig.workspaceRoot));
2266
2449
  paths.push(append.appendPath(this.#context.config.sourceRoot, this.#context.workspaceConfig.workspaceRoot));
2267
- paths.push(...Object.keys(this.#context.tsconfig.options.paths ?? {}).filter((tsconfigPath) => id.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig.options.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => append.appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
2268
- for (const combination of resolve.getResolutionCombinations(id, {
2450
+ 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) => append.appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
2451
+ for (const combination of resolve.getResolutionCombinations(path, {
2269
2452
  paths
2270
2453
  })) {
2271
2454
  const { relativeKey, adapter } = this.#getStorage(combination);
@@ -2274,18 +2457,18 @@ var VirtualFileSystem = class _VirtualFileSystem {
2274
2457
  break;
2275
2458
  }
2276
2459
  }
2277
- try {
2278
- result = resolve.resolveSync(id, {
2279
- paths
2280
- });
2281
- } catch {
2460
+ if (!result) {
2461
+ try {
2462
+ result = resolve.resolveSync(path, {
2463
+ ...options,
2464
+ paths
2465
+ });
2466
+ } catch {
2467
+ }
2282
2468
  }
2283
2469
  }
2284
- if (result) {
2285
- result = correctPath.toAbsolutePath(append.appendPath(result, this.#context.config.projectRoot), this.#context.workspaceConfig.workspaceRoot);
2286
- if (!this.#context.config.skipCache) {
2287
- this.resolverCache.set(this.#normalizeId(id), result);
2288
- }
2470
+ if (result && !this.#context.config.skipCache) {
2471
+ this.resolverCache.set(this.#normalizeId(path), result);
2289
2472
  }
2290
2473
  return result;
2291
2474
  }
@@ -2379,16 +2562,29 @@ chunkPK6SKIKE_cjs.__name(writeMetaFile, "writeMetaFile");
2379
2562
 
2380
2563
  // src/lib/contexts/context.ts
2381
2564
  var configCache = /* @__PURE__ */ new WeakMap();
2565
+ var agent = new undici.Agent({
2566
+ keepAliveTimeout: 1e4
2567
+ });
2568
+ undici.setGlobalDispatcher(agent.compose(undici.interceptors.retry({
2569
+ maxRetries: 3,
2570
+ minTimeout: 1e3,
2571
+ maxTimeout: 1e4,
2572
+ timeoutFactor: 2,
2573
+ retryAfter: true
2574
+ })));
2382
2575
  var PowerlinesContext = class _PowerlinesContext {
2383
2576
  static {
2384
2577
  chunkPK6SKIKE_cjs.__name(this, "PowerlinesContext");
2385
2578
  }
2386
2579
  /**
2387
- * Internal reference to the API instance
2580
+ * Internal references storage
2581
+ *
2582
+ * @danger
2583
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
2388
2584
  *
2389
2585
  * @internal
2390
2586
  */
2391
- #api;
2587
+ #internal = {};
2392
2588
  #workspaceConfig;
2393
2589
  #checksum = null;
2394
2590
  #buildId = uuid.uuid();
@@ -2398,7 +2594,8 @@ var PowerlinesContext = class _PowerlinesContext {
2398
2594
  #fs;
2399
2595
  #tsconfig;
2400
2596
  #program;
2401
- #resolvePatterns = [];
2597
+ #parserCache;
2598
+ #requestCache;
2402
2599
  #getConfigProps(config = {}) {
2403
2600
  return {
2404
2601
  variant: config.build?.variant,
@@ -2422,7 +2619,8 @@ var PowerlinesContext = class _PowerlinesContext {
2422
2619
  lint: config.lint,
2423
2620
  transform: config.transform,
2424
2621
  build: config.build,
2425
- framework: config.framework
2622
+ framework: config.framework,
2623
+ ...config
2426
2624
  };
2427
2625
  }
2428
2626
  /**
@@ -2470,14 +2668,30 @@ var PowerlinesContext = class _PowerlinesContext {
2470
2668
  */
2471
2669
  resolver;
2472
2670
  /**
2671
+ * The resolved configuration options
2672
+ */
2673
+ resolvePatterns = [];
2674
+ /**
2473
2675
  * Internal context fields and methods
2474
2676
  *
2677
+ * @danger
2678
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
2679
+ *
2475
2680
  * @internal
2476
2681
  */
2477
2682
  get $$internal() {
2478
- return {
2479
- api: this.#api
2480
- };
2683
+ return this.#internal;
2684
+ }
2685
+ /**
2686
+ * Internal context fields and methods
2687
+ *
2688
+ * @danger
2689
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
2690
+ *
2691
+ * @internal
2692
+ */
2693
+ set $$internal(value) {
2694
+ this.#internal = value;
2481
2695
  }
2482
2696
  /**
2483
2697
  * The resolved entry type definitions for the project
@@ -2501,7 +2715,7 @@ var PowerlinesContext = class _PowerlinesContext {
2501
2715
  */
2502
2716
  set tsconfig(value) {
2503
2717
  this.#tsconfig = value;
2504
- this.#resolvePatterns = bundleRequire.tsconfigPathsToRegExp(value?.options?.paths ?? {});
2718
+ this.resolvePatterns = bundleRequire.tsconfigPathsToRegExp(value?.options?.paths ?? {});
2505
2719
  }
2506
2720
  /**
2507
2721
  * The virtual file system interface for the project
@@ -2642,6 +2856,131 @@ var PowerlinesContext = class _PowerlinesContext {
2642
2856
  return this.#program;
2643
2857
  }
2644
2858
  /**
2859
+ * Gets the parser cache.
2860
+ */
2861
+ get parserCache() {
2862
+ if (!this.#parserCache) {
2863
+ this.#parserCache = flatCache.create({
2864
+ cacheId: "parser",
2865
+ cacheDir: this.cachePath,
2866
+ ttl: 2 * 60 * 60 * 1e3,
2867
+ lruSize: 5e3,
2868
+ persistInterval: 250
2869
+ });
2870
+ }
2871
+ return this.#parserCache;
2872
+ }
2873
+ /**
2874
+ * Gets the request cache.
2875
+ */
2876
+ get requestCache() {
2877
+ if (!this.#requestCache) {
2878
+ this.#requestCache = flatCache.create({
2879
+ cacheId: "http",
2880
+ cacheDir: this.cachePath,
2881
+ ttl: 5 * 60 * 1e3,
2882
+ lruSize: 5e3,
2883
+ persistInterval: 250
2884
+ });
2885
+ }
2886
+ return this.#requestCache;
2887
+ }
2888
+ /**
2889
+ * A function to perform HTTP fetch requests
2890
+ *
2891
+ * @remarks
2892
+ * This function uses a caching layer to avoid duplicate requests during the Powerlines process.
2893
+ *
2894
+ * @example
2895
+ * ```ts
2896
+ * const response = await context.fetch("https://api.example.com/data");
2897
+ * const data = await response.json();
2898
+ * ```
2899
+ *
2900
+ * @see https://github.com/nodejs/undici
2901
+ *
2902
+ * @param input - The URL to fetch.
2903
+ * @param options - The fetch request options.
2904
+ * @returns A promise that resolves to a response returned by the fetch.
2905
+ */
2906
+ async fetch(input, options = {}) {
2907
+ const cacheKey = murmurhash.murmurhash({
2908
+ input: input.toString(),
2909
+ options: JSON.stringify(options)
2910
+ });
2911
+ if (!this.config.skipCache && !options.skipCache) {
2912
+ const cached = this.requestCache.get(cacheKey);
2913
+ if (cached) {
2914
+ return new undici.Response(cached.body, {
2915
+ status: cached.status,
2916
+ statusText: cached.statusText,
2917
+ headers: cached.headers
2918
+ });
2919
+ }
2920
+ }
2921
+ const response = await fetch.fetchRequest(input, {
2922
+ timeout: 12e3,
2923
+ ...options
2924
+ });
2925
+ const result = {
2926
+ body: await response.text(),
2927
+ status: response.status,
2928
+ statusText: response.statusText,
2929
+ headers: Object.fromEntries(response.headers.entries())
2930
+ };
2931
+ if (!this.config.skipCache && !options.skipCache) {
2932
+ try {
2933
+ this.requestCache.set(cacheKey, result);
2934
+ } catch {
2935
+ }
2936
+ }
2937
+ return new undici.Response(result.body, {
2938
+ status: result.status,
2939
+ statusText: result.statusText,
2940
+ headers: result.headers
2941
+ });
2942
+ }
2943
+ /**
2944
+ * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
2945
+ *
2946
+ * @remarks
2947
+ * This function can be used to parse TypeScript code into an AST for further analysis or transformation.
2948
+ *
2949
+ * @example
2950
+ * ```ts
2951
+ * const ast = context.parse("const x: number = 42;");
2952
+ * ```
2953
+ *
2954
+ * @see https://rollupjs.org/plugin-development/#this-parse
2955
+ * @see https://github.com/oxc/oxc
2956
+ *
2957
+ * @param code - The source code to parse.
2958
+ * @param options - The options to pass to the parser.
2959
+ * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
2960
+ */
2961
+ async parse(code, options = {}) {
2962
+ const cacheKey = murmurhash.murmurhash({
2963
+ code,
2964
+ options
2965
+ });
2966
+ let result;
2967
+ if (!this.config.skipCache) {
2968
+ result = this.parserCache.get(cacheKey);
2969
+ if (result) {
2970
+ return result;
2971
+ }
2972
+ }
2973
+ result = await oxcParser.parse(`source.${options.lang || "ts"}`, code, {
2974
+ ...options,
2975
+ sourceType: "module",
2976
+ showSemanticErrors: this.config.mode === "development"
2977
+ });
2978
+ if (!this.config.skipCache) {
2979
+ this.parserCache.set(cacheKey, result);
2980
+ }
2981
+ return result;
2982
+ }
2983
+ /**
2645
2984
  * A helper function to resolve modules in the Virtual File System
2646
2985
  *
2647
2986
  * @remarks
@@ -2686,7 +3025,7 @@ var PowerlinesContext = class _PowerlinesContext {
2686
3025
  };
2687
3026
  }
2688
3027
  if (this.config.build.skipNodeModulesBundle) {
2689
- if (bundleRequire.match(moduleId, this.#resolvePatterns) || bundleRequire.match(moduleId, this.config.build.noExternal)) {
3028
+ if (bundleRequire.match(moduleId, this.resolvePatterns) || bundleRequire.match(moduleId, this.config.build.noExternal)) {
2690
3029
  return void 0;
2691
3030
  }
2692
3031
  if (bundleRequire.match(moduleId, this.config.build.external) || moduleId.startsWith("node:")) {
@@ -2880,6 +3219,26 @@ var PowerlinesContext = class _PowerlinesContext {
2880
3219
  return extendLog(this.log, name);
2881
3220
  }
2882
3221
  /**
3222
+ * Generates a checksum representing the current context state
3223
+ *
3224
+ * @param root - The root directory of the project to generate the checksum for
3225
+ * @returns A promise that resolves to a string representing the checksum
3226
+ */
3227
+ async generateChecksum(root = this.config.projectRoot) {
3228
+ this.#checksum = await hashFiles.hashDirectory(root, {
3229
+ ignore: [
3230
+ "node_modules",
3231
+ ".git",
3232
+ ".nx",
3233
+ ".cache",
3234
+ ".storm",
3235
+ "tmp",
3236
+ "dist"
3237
+ ]
3238
+ });
3239
+ return this.#checksum;
3240
+ }
3241
+ /**
2883
3242
  * Creates a new StormContext instance.
2884
3243
  *
2885
3244
  * @param workspaceConfig - The workspace configuration.
@@ -2901,26 +3260,6 @@ var PowerlinesContext = class _PowerlinesContext {
2901
3260
  */
2902
3261
  logFn;
2903
3262
  /**
2904
- * Generates a checksum representing the current context state
2905
- *
2906
- * @param root - The root directory of the project to generate the checksum for
2907
- * @returns A promise that resolves to a string representing the checksum
2908
- */
2909
- async generateChecksum(root = this.config.projectRoot) {
2910
- this.#checksum = await hashFiles.hashDirectory(root, {
2911
- ignore: [
2912
- "node_modules",
2913
- ".git",
2914
- ".nx",
2915
- ".cache",
2916
- ".storm",
2917
- "tmp",
2918
- "dist"
2919
- ]
2920
- });
2921
- return this.#checksum;
2922
- }
2923
- /**
2924
3263
  * Initialize the context with the provided configuration options
2925
3264
  *
2926
3265
  * @param config - The partial user configuration to use for initialization.
@@ -3283,36 +3622,90 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
3283
3622
  * Retrieves the hook handlers for a specific hook name
3284
3623
  */
3285
3624
  selectHooks(hook, options) {
3286
- const handlers = [];
3625
+ const result = [];
3287
3626
  if (this.hooks[hook]) {
3288
3627
  if (!isHookExternal(hook)) {
3289
3628
  const hooks = this.hooks[hook];
3290
3629
  if (options?.order) {
3291
3630
  if (options?.order === "pre") {
3292
- handlers.push(...(hooks.preOrdered ?? []).map((h) => h.handler));
3293
- handlers.push(...(hooks.preEnforced ?? []).map((h) => h.handler));
3631
+ result.push(...(hooks.preOrdered ?? []).map((h) => {
3632
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
3633
+ if (!plugin) {
3634
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
3635
+ }
3636
+ return {
3637
+ handle: h.handler,
3638
+ context: plugin.context
3639
+ };
3640
+ }));
3641
+ result.push(...(hooks.preEnforced ?? []).map((h) => {
3642
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
3643
+ if (!plugin) {
3644
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
3645
+ }
3646
+ return {
3647
+ handle: h.handler,
3648
+ context: plugin.context
3649
+ };
3650
+ }));
3294
3651
  } else if (options?.order === "post") {
3295
- handlers.push(...(hooks.postOrdered ?? []).map((h) => h.handler));
3296
- handlers.push(...(hooks.postEnforced ?? []).map((h) => h.handler));
3652
+ result.push(...(hooks.postOrdered ?? []).map((h) => {
3653
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
3654
+ if (!plugin) {
3655
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
3656
+ }
3657
+ return {
3658
+ handle: h.handler,
3659
+ context: plugin.context
3660
+ };
3661
+ }));
3662
+ result.push(...(hooks.postEnforced ?? []).map((h) => {
3663
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
3664
+ if (!plugin) {
3665
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
3666
+ }
3667
+ return {
3668
+ handle: h.handler,
3669
+ context: plugin.context
3670
+ };
3671
+ }));
3297
3672
  } else {
3298
- handlers.push(...(hooks.normal ?? []).map((h) => h.handler));
3673
+ result.push(...(hooks.normal ?? []).map((h) => {
3674
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
3675
+ if (!plugin) {
3676
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
3677
+ }
3678
+ return {
3679
+ handle: h.handler,
3680
+ context: plugin.context
3681
+ };
3682
+ }));
3299
3683
  }
3300
3684
  } else {
3301
- handlers.push(...this.selectHooks(hook, {
3685
+ result.push(...this.selectHooks(hook, {
3302
3686
  order: "pre"
3303
3687
  }));
3304
- handlers.push(...this.selectHooks(hook, {
3688
+ result.push(...this.selectHooks(hook, {
3305
3689
  order: "normal"
3306
3690
  }));
3307
- handlers.push(...this.selectHooks(hook, {
3691
+ result.push(...this.selectHooks(hook, {
3308
3692
  order: "post"
3309
3693
  }));
3310
3694
  }
3311
3695
  } else {
3312
- handlers.push(...this.hooks[hook].map((h) => h.handler));
3696
+ result.push(...this.hooks[hook].map((h) => {
3697
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
3698
+ if (!plugin) {
3699
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
3700
+ }
3701
+ return {
3702
+ handle: h.handler,
3703
+ context: plugin.context
3704
+ };
3705
+ }));
3313
3706
  }
3314
3707
  }
3315
- return handlers;
3708
+ return result;
3316
3709
  }
3317
3710
  constructor(config, workspaceConfig) {
3318
3711
  super(workspaceConfig);
@@ -3345,6 +3738,31 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext
3345
3738
  return context;
3346
3739
  }
3347
3740
  /**
3741
+ * Internal context fields and methods
3742
+ *
3743
+ * @danger
3744
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
3745
+ *
3746
+ * @internal
3747
+ */
3748
+ get $$internal() {
3749
+ return super.$$internal;
3750
+ }
3751
+ /**
3752
+ * Internal context fields and methods
3753
+ *
3754
+ * @danger
3755
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
3756
+ *
3757
+ * @internal
3758
+ */
3759
+ set $$internal(value) {
3760
+ super.$$internal = value;
3761
+ for (const environment of Object.values(this.environments)) {
3762
+ environment.$$internal = super.$$internal;
3763
+ }
3764
+ }
3765
+ /**
3348
3766
  * A record of all environments by name
3349
3767
  */
3350
3768
  get environments() {
@@ -3518,7 +3936,9 @@ var PowerlinesAPI = class _PowerlinesAPI {
3518
3936
  */
3519
3937
  static async from(workspaceRoot, config) {
3520
3938
  const api = new _PowerlinesAPI(await PowerlinesAPIContext.from(workspaceRoot, config));
3521
- api.#context.$$internal.api = api;
3939
+ api.#context.$$internal = {
3940
+ api
3941
+ };
3522
3942
  for (const plugin of api.context.config.plugins ?? []) {
3523
3943
  await api.#addPlugin(plugin);
3524
3944
  }
@@ -3642,9 +4062,13 @@ ${console.formatLogMessage(context.config)}`);
3642
4062
  let generatedTypes = await emitTypes(context, files);
3643
4063
  context.log(types.LogLevelLabel.TRACE, `Generating TypeScript declaration file ${context.dtsPath}.`);
3644
4064
  const directives = [];
4065
+ const asNextParam = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((previousResult) => isObject.isObject(previousResult) ? previousResult.code : previousResult, "asNextParam");
3645
4066
  let result = await this.callHook("generateTypes", {
3646
4067
  environment: context,
3647
- order: "pre"
4068
+ sequential: true,
4069
+ order: "pre",
4070
+ result: "merge",
4071
+ asNextParam
3648
4072
  }, generatedTypes);
3649
4073
  if (result) {
3650
4074
  if (isSetObject.isSetObject(result)) {
@@ -3658,7 +4082,10 @@ ${console.formatLogMessage(context.config)}`);
3658
4082
  }
3659
4083
  result = await this.callHook("generateTypes", {
3660
4084
  environment: context,
3661
- order: "normal"
4085
+ sequential: true,
4086
+ order: "normal",
4087
+ result: "merge",
4088
+ asNextParam
3662
4089
  }, generatedTypes);
3663
4090
  if (result) {
3664
4091
  if (isSetObject.isSetObject(result)) {
@@ -3672,7 +4099,10 @@ ${console.formatLogMessage(context.config)}`);
3672
4099
  }
3673
4100
  result = await this.callHook("generateTypes", {
3674
4101
  environment: context,
3675
- order: "post"
4102
+ sequential: true,
4103
+ order: "post",
4104
+ result: "merge",
4105
+ asNextParam
3676
4106
  }, generatedTypes);
3677
4107
  if (result) {
3678
4108
  if (isSetObject.isSetObject(result)) {
@@ -3684,15 +4114,24 @@ ${console.formatLogMessage(context.config)}`);
3684
4114
  generatedTypes = result;
3685
4115
  }
3686
4116
  }
3687
- await context.fs.write(context.dtsPath, `${directives ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
4117
+ if (generatedTypes?.trim() || directives.length > 0) {
4118
+ await context.fs.write(context.dtsPath, `${directives ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
3688
4119
 
3689
4120
  ` : ""}${getFileHeader(context, {
3690
- directive: null,
3691
- prettierIgnore: false
3692
- })}
4121
+ directive: null,
4122
+ prettierIgnore: false
4123
+ })}
3693
4124
 
3694
4125
  ${formatTypes(generatedTypes)}
3695
4126
  `);
4127
+ } else {
4128
+ const dtsRelativePath = getTsconfigDtsPath(context);
4129
+ if (context.tsconfig.tsconfigJson.include && isIncludeMatchFound(dtsRelativePath, context.tsconfig.tsconfigJson.include)) {
4130
+ const normalizedDtsRelativePath = dtsRelativePath.startsWith("./") ? dtsRelativePath.slice(2) : dtsRelativePath;
4131
+ context.tsconfig.tsconfigJson.include = context.tsconfig.tsconfigJson.include.filter((includeValue) => includeValue?.toString() !== normalizedDtsRelativePath);
4132
+ await context.fs.write(context.tsconfig.tsconfigFilePath, JSON.stringify(context.tsconfig.tsconfigJson, null, 2));
4133
+ }
4134
+ }
3696
4135
  }
3697
4136
  context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
3698
4137
  if (!context.tsconfig) {
@@ -3729,7 +4168,7 @@ ${formatTypes(generatedTypes)}
3729
4168
  for (const file of files) {
3730
4169
  context.log(types.LogLevelLabel.TRACE, `Adding template file: ${file}`);
3731
4170
  const template = Handlebars__default.default.compile(file);
3732
- await writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
4171
+ await context.fs.write(joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
3733
4172
  }
3734
4173
  await this.callHook("new", {
3735
4174
  environment: context,
@@ -3740,14 +4179,14 @@ ${formatTypes(generatedTypes)}
3740
4179
  for (const file of files2) {
3741
4180
  context.log(types.LogLevelLabel.TRACE, `Adding application template file: ${file}`);
3742
4181
  const template = Handlebars__default.default.compile(file);
3743
- await writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
4182
+ await context.fs.write(joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
3744
4183
  }
3745
4184
  } else {
3746
4185
  const files2 = await listFiles.listFiles(joinPaths.joinPaths(context.powerlinesPath, "files/library/**/*.hbs"));
3747
4186
  for (const file of files2) {
3748
4187
  context.log(types.LogLevelLabel.TRACE, `Adding library template file: ${file}`);
3749
4188
  const template = Handlebars__default.default.compile(file);
3750
- await writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
4189
+ await context.fs.write(joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
3751
4190
  }
3752
4191
  }
3753
4192
  await this.callHook("new", {
@@ -3831,15 +4270,12 @@ ${formatTypes(generatedTypes)}
3831
4270
  const destinationPath = joinPaths.joinPaths(append.appendPath(context.config.output.outputPath, context.workspaceConfig.workspaceRoot), "dist");
3832
4271
  if (sourcePath !== destinationPath) {
3833
4272
  context.log(types.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}).`);
3834
- await copyFile.copyFiles({
3835
- input: sourcePath,
3836
- glob: "**/*"
3837
- }, destinationPath);
4273
+ await context.fs.copy(sourcePath, destinationPath);
3838
4274
  }
3839
4275
  }
3840
4276
  await Promise.all(context.config.output.assets.map(async (asset) => {
3841
4277
  context.log(types.LogLevelLabel.DEBUG, `Copying asset(s): ${chalk5__default.default.redBright(context.workspaceConfig.workspaceRoot === asset.input ? asset.glob : joinPaths.joinPaths(replace.replacePath(asset.input, context.workspaceConfig.workspaceRoot), asset.glob))} -> ${chalk5__default.default.greenBright(joinPaths.joinPaths(replace.replacePath(asset.output, context.workspaceConfig.workspaceRoot), asset.glob))} ${Array.isArray(asset.ignore) && asset.ignore.length > 0 ? ` (ignoring: ${asset.ignore.map((i) => chalk5__default.default.yellowBright(i)).join(", ")})` : ""}`);
3842
- await copyFile.copyFiles(asset, asset.output);
4278
+ await context.fs.copy(asset, asset.output);
3843
4279
  }));
3844
4280
  await this.callHook("build", {
3845
4281
  environment: context,
@@ -4112,5 +4548,5 @@ exports.PowerlinesAPI = PowerlinesAPI;
4112
4548
  exports._capnpFileId = _capnpFileId;
4113
4549
  exports.createLog = createLog;
4114
4550
  exports.extendLog = extendLog;
4115
- //# sourceMappingURL=chunk-RCYXXBJ3.cjs.map
4116
- //# sourceMappingURL=chunk-RCYXXBJ3.cjs.map
4551
+ //# sourceMappingURL=chunk-246ZHDQL.cjs.map
4552
+ //# sourceMappingURL=chunk-246ZHDQL.cjs.map