powerlines 0.28.0 → 0.30.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 (664) hide show
  1. package/README.md +8 -2
  2. package/dist/{api-D-3EvHyy.d.cts → api-2c6P7OLq.d.cts} +1 -1
  3. package/dist/{api-BgDfE1J3.d.ts → api-D6eCzojg.d.ts} +1 -1
  4. package/dist/api.cjs +4 -4
  5. package/dist/api.d.cts +3 -2
  6. package/dist/api.d.ts +3 -2
  7. package/dist/api.js +3 -3
  8. package/dist/astro.cjs +6 -6
  9. package/dist/astro.d.cts +2 -1
  10. package/dist/astro.d.ts +2 -1
  11. package/dist/astro.js +5 -5
  12. package/dist/babel-types.d.ts +292 -0
  13. package/dist/{chunk-DD4XJNKQ.cjs → chunk-2LSP523Q.cjs} +5 -5
  14. package/dist/{chunk-XMYY4XUM.cjs → chunk-2TMERZSM.cjs} +4 -4
  15. package/dist/{chunk-FZ6J2GMT.js → chunk-575Z57QD.js} +2 -2
  16. package/dist/{chunk-6MQ6LCVC.js → chunk-5GOXUZPZ.js} +2 -2
  17. package/dist/{chunk-QRE6JMCD.js → chunk-7DOCWJ76.js} +423 -142
  18. package/dist/{chunk-T3T6WSX2.cjs → chunk-BXKRABQU.cjs} +2 -2
  19. package/dist/chunk-HRAVYQI4.cjs +12 -0
  20. package/dist/{chunk-NHZBSVDJ.js → chunk-IBPL4XRD.js} +3 -3
  21. package/dist/{chunk-Z3HPP53Q.js → chunk-K3D4TTN5.js} +3 -3
  22. package/dist/{chunk-FJ67PPIW.cjs → chunk-NP2ZVRIF.cjs} +4 -4
  23. package/dist/chunk-OXST2CTF.cjs +12 -0
  24. package/dist/{chunk-ERZWC77E.cjs → chunk-PYLCLJKJ.cjs} +421 -140
  25. package/dist/{chunk-ON3LABX3.cjs → chunk-SALASTMK.cjs} +2 -2
  26. package/dist/chunk-TFHWUEMM.js +9 -0
  27. package/dist/{chunk-5CV2NNIR.js → chunk-VYLFOZVJ.js} +3 -3
  28. package/dist/{chunk-VJ26HHRE.js → chunk-W2BP7RBB.js} +3 -3
  29. package/dist/{chunk-MRHWIMY2.cjs → chunk-YFKHICPO.cjs} +2 -2
  30. package/dist/{chunk-UMZ2WNMA.js → chunk-ZFMDBIE2.js} +2 -2
  31. package/dist/{context-CcPf9RC_.d.ts → context-CRJ4Zq86.d.ts} +26 -10
  32. package/dist/{context-CDZY3RHt.d.cts → context-D5kPamM6.d.cts} +26 -10
  33. package/dist/esbuild.cjs +8 -8
  34. package/dist/esbuild.d.cts +2 -1
  35. package/dist/esbuild.d.ts +2 -1
  36. package/dist/esbuild.js +5 -5
  37. package/dist/farm.cjs +5 -5
  38. package/dist/farm.d.cts +2 -1
  39. package/dist/farm.d.ts +2 -1
  40. package/dist/farm.js +4 -4
  41. package/dist/index.cjs +18 -18
  42. package/dist/index.d.cts +5 -4
  43. package/dist/index.d.ts +5 -4
  44. package/dist/index.js +6 -6
  45. package/dist/lib/{api-BIHEKpyq.d.ts → api-DPyF-O8S.d.ts} +1 -1
  46. package/dist/lib/{api-Wawenasn.d.cts → api-DzuW_qQS.d.cts} +1 -1
  47. package/dist/lib/build/esbuild.cjs +9 -7
  48. package/dist/lib/build/esbuild.cjs.map +1 -0
  49. package/dist/lib/build/esbuild.d.cts +3 -2
  50. package/dist/lib/build/esbuild.d.ts +3 -2
  51. package/dist/lib/build/esbuild.js +6 -4
  52. package/dist/lib/build/esbuild.js.map +1 -0
  53. package/dist/lib/build/index.cjs +47 -28
  54. package/dist/lib/build/index.cjs.map +1 -0
  55. package/dist/lib/build/index.d.cts +6 -4
  56. package/dist/lib/build/index.d.ts +6 -4
  57. package/dist/lib/build/index.js +15 -12
  58. package/dist/lib/build/index.js.map +1 -0
  59. package/dist/lib/build/rolldown.cjs +6 -4
  60. package/dist/lib/build/rolldown.cjs.map +1 -0
  61. package/dist/lib/build/rolldown.d.cts +3 -2
  62. package/dist/lib/build/rolldown.d.ts +3 -2
  63. package/dist/lib/build/rolldown.js +5 -3
  64. package/dist/lib/build/rolldown.js.map +1 -0
  65. package/dist/lib/build/rollup.cjs +6 -4
  66. package/dist/lib/build/rollup.cjs.map +1 -0
  67. package/dist/lib/build/rollup.d.cts +3 -2
  68. package/dist/lib/build/rollup.d.ts +3 -2
  69. package/dist/lib/build/rollup.js +4 -2
  70. package/dist/lib/build/rollup.js.map +1 -0
  71. package/dist/lib/build/rspack.cjs +5 -3
  72. package/dist/lib/build/rspack.cjs.map +1 -0
  73. package/dist/lib/build/rspack.d.cts +3 -2
  74. package/dist/lib/build/rspack.d.ts +3 -2
  75. package/dist/lib/build/rspack.js +4 -2
  76. package/dist/lib/build/rspack.js.map +1 -0
  77. package/dist/lib/build/tsdown.cjs +25 -0
  78. package/dist/lib/build/tsdown.cjs.map +1 -0
  79. package/dist/lib/build/tsdown.d.cts +60 -0
  80. package/dist/lib/build/tsdown.d.ts +60 -0
  81. package/dist/lib/build/tsdown.js +4 -0
  82. package/dist/lib/build/tsdown.js.map +1 -0
  83. package/dist/lib/build/tsup.cjs +10 -8
  84. package/dist/lib/build/tsup.cjs.map +1 -0
  85. package/dist/lib/build/tsup.d.cts +3 -2
  86. package/dist/lib/build/tsup.d.ts +3 -2
  87. package/dist/lib/build/tsup.js +7 -5
  88. package/dist/lib/build/tsup.js.map +1 -0
  89. package/dist/lib/build/unbuild.cjs +9 -7
  90. package/dist/lib/build/unbuild.cjs.map +1 -0
  91. package/dist/lib/build/unbuild.d.cts +5 -4
  92. package/dist/lib/build/unbuild.d.ts +5 -4
  93. package/dist/lib/build/unbuild.js +6 -4
  94. package/dist/lib/build/unbuild.js.map +1 -0
  95. package/dist/lib/build/vite.cjs +9 -7
  96. package/dist/lib/build/vite.cjs.map +1 -0
  97. package/dist/lib/build/vite.d.cts +3 -2
  98. package/dist/lib/build/vite.d.ts +3 -2
  99. package/dist/lib/build/vite.js +7 -5
  100. package/dist/lib/build/vite.js.map +1 -0
  101. package/dist/lib/build/webpack.cjs +5 -3
  102. package/dist/lib/build/webpack.cjs.map +1 -0
  103. package/dist/lib/build/webpack.d.cts +3 -2
  104. package/dist/lib/build/webpack.d.ts +3 -2
  105. package/dist/lib/build/webpack.js +4 -2
  106. package/dist/lib/build/webpack.js.map +1 -0
  107. package/dist/lib/{chunk-3Y4F37CB.cjs → chunk-23BFL3LB.cjs} +6 -4
  108. package/dist/lib/chunk-23BFL3LB.cjs.map +1 -0
  109. package/dist/lib/{chunk-26M3IUSK.js → chunk-26JHNKA7.js} +3 -1
  110. package/dist/lib/chunk-26JHNKA7.js.map +1 -0
  111. package/dist/lib/{chunk-Z6BSDYUR.cjs → chunk-2HAOX4Q2.cjs} +155 -85
  112. package/dist/lib/chunk-2HAOX4Q2.cjs.map +1 -0
  113. package/dist/lib/{chunk-2RHE4SGK.js → chunk-2IXO6SBG.js} +3 -1
  114. package/dist/lib/chunk-2IXO6SBG.js.map +1 -0
  115. package/dist/lib/{chunk-K3NBD5LL.cjs → chunk-2JR645O3.cjs} +5 -3
  116. package/dist/lib/chunk-2JR645O3.cjs.map +1 -0
  117. package/dist/lib/{chunk-S4OH7KW6.cjs → chunk-2OMOKN7Y.cjs} +93 -58
  118. package/dist/lib/chunk-2OMOKN7Y.cjs.map +1 -0
  119. package/dist/lib/{chunk-ENRLU4UR.js → chunk-35EO5Y7R.js} +3 -1
  120. package/dist/lib/chunk-35EO5Y7R.js.map +1 -0
  121. package/dist/lib/{chunk-NDYKRNPQ.js → chunk-367E23MI.js} +3 -1
  122. package/dist/lib/chunk-367E23MI.js.map +1 -0
  123. package/dist/lib/{chunk-PURLNHXG.cjs → chunk-3DKBH67A.cjs} +16 -14
  124. package/dist/lib/chunk-3DKBH67A.cjs.map +1 -0
  125. package/dist/lib/chunk-3GMJQ5G3.cjs +4 -0
  126. package/dist/lib/chunk-3GMJQ5G3.cjs.map +1 -0
  127. package/dist/lib/{chunk-OEF6EHQV.js → chunk-45D4XIOK.js} +3 -1
  128. package/dist/lib/chunk-45D4XIOK.js.map +1 -0
  129. package/dist/lib/chunk-4BPHC6QQ.js +3 -0
  130. package/dist/lib/chunk-4BPHC6QQ.js.map +1 -0
  131. package/dist/lib/{chunk-7VRXU4F7.cjs → chunk-4NBEK7BB.cjs} +8 -7
  132. package/dist/lib/chunk-4NBEK7BB.cjs.map +1 -0
  133. package/dist/lib/{chunk-XBSGDSV3.cjs → chunk-4UN7FLKQ.cjs} +6 -4
  134. package/dist/lib/chunk-4UN7FLKQ.cjs.map +1 -0
  135. package/dist/lib/{chunk-NZ6NCXM2.js → chunk-5QJRVWP3.js} +4 -2
  136. package/dist/lib/chunk-5QJRVWP3.js.map +1 -0
  137. package/dist/lib/{chunk-ONETLSPO.js → chunk-5QMQ5G73.js} +4 -2
  138. package/dist/lib/chunk-5QMQ5G73.js.map +1 -0
  139. package/dist/lib/{chunk-H7A5QVLY.cjs → chunk-62ZJYXT3.cjs} +7 -5
  140. package/dist/lib/chunk-62ZJYXT3.cjs.map +1 -0
  141. package/dist/lib/{chunk-JA4HSQRN.cjs → chunk-632PWWU7.cjs} +5 -3
  142. package/dist/lib/chunk-632PWWU7.cjs.map +1 -0
  143. package/dist/lib/{chunk-PIFNMTKN.cjs → chunk-63DAS6TJ.cjs} +6 -4
  144. package/dist/lib/chunk-63DAS6TJ.cjs.map +1 -0
  145. package/dist/lib/chunk-65ANDTTL.cjs +203 -0
  146. package/dist/lib/chunk-65ANDTTL.cjs.map +1 -0
  147. package/dist/lib/{chunk-OL35IC6Z.js → chunk-6OGQTUXF.js} +3 -1
  148. package/dist/lib/chunk-6OGQTUXF.js.map +1 -0
  149. package/dist/lib/{chunk-Y2DPOC4G.js → chunk-76DBMONS.js} +52 -32
  150. package/dist/lib/chunk-76DBMONS.js.map +1 -0
  151. package/dist/lib/{chunk-GSGF6RL2.js → chunk-7CDTHZ3R.js} +58 -23
  152. package/dist/lib/chunk-7CDTHZ3R.js.map +1 -0
  153. package/dist/lib/{chunk-R3XAVNPY.cjs → chunk-7OO4SKFN.cjs} +6 -4
  154. package/dist/lib/chunk-7OO4SKFN.cjs.map +1 -0
  155. package/dist/{plugin-utils/chunk-SHUYVCID.js → lib/chunk-7QVYU63E.js} +2 -0
  156. package/dist/lib/chunk-7QVYU63E.js.map +1 -0
  157. package/dist/lib/{chunk-GANVMM73.js → chunk-7R23HVGQ.js} +3 -1
  158. package/dist/lib/chunk-7R23HVGQ.js.map +1 -0
  159. package/dist/lib/chunk-A4RSMLXW.cjs +13 -0
  160. package/dist/lib/chunk-A4RSMLXW.cjs.map +1 -0
  161. package/dist/lib/{chunk-6OYSDQXE.cjs → chunk-AQNUFK3L.cjs} +47 -9
  162. package/dist/lib/chunk-AQNUFK3L.cjs.map +1 -0
  163. package/dist/lib/{chunk-HRRI4KOM.cjs → chunk-BJGMF356.cjs} +8 -6
  164. package/dist/lib/chunk-BJGMF356.cjs.map +1 -0
  165. package/dist/lib/{chunk-GLFOKUTH.cjs → chunk-BQA4H72F.cjs} +12 -10
  166. package/dist/lib/chunk-BQA4H72F.cjs.map +1 -0
  167. package/dist/lib/chunk-CLOW34EQ.js +3 -0
  168. package/dist/lib/chunk-CLOW34EQ.js.map +1 -0
  169. package/dist/lib/{chunk-VHCBD2IS.js → chunk-CTMPQSK7.js} +54 -1
  170. package/dist/lib/chunk-CTMPQSK7.js.map +1 -0
  171. package/dist/lib/{chunk-M263EZ4F.js → chunk-D55ZAZCX.js} +3 -1
  172. package/dist/lib/chunk-D55ZAZCX.js.map +1 -0
  173. package/dist/lib/{chunk-XIK3Y6BP.js → chunk-D5IEZABI.js} +4 -2
  174. package/dist/lib/chunk-D5IEZABI.js.map +1 -0
  175. package/dist/lib/chunk-DQJCGJ5P.js +3 -0
  176. package/dist/lib/chunk-DQJCGJ5P.js.map +1 -0
  177. package/dist/lib/{chunk-KFDNKOXM.js → chunk-EBBGE5FN.js} +20 -2
  178. package/dist/lib/chunk-EBBGE5FN.js.map +1 -0
  179. package/dist/lib/chunk-EXAOCEQF.cjs +112 -0
  180. package/dist/lib/chunk-EXAOCEQF.cjs.map +1 -0
  181. package/dist/lib/{chunk-T35JQHYE.js → chunk-FFATMOAQ.js} +3 -1
  182. package/dist/lib/chunk-FFATMOAQ.js.map +1 -0
  183. package/dist/lib/{chunk-VKFXVPY6.js → chunk-FHSSBMCC.js} +70 -14
  184. package/dist/lib/chunk-FHSSBMCC.js.map +1 -0
  185. package/dist/lib/chunk-FJMP4CXA.js +3 -0
  186. package/dist/lib/chunk-FJMP4CXA.js.map +1 -0
  187. package/dist/lib/{chunk-4PTER5EV.js → chunk-FKPVNUDU.js} +3 -1
  188. package/dist/lib/chunk-FKPVNUDU.js.map +1 -0
  189. package/dist/lib/{chunk-ZGMEHSNN.js → chunk-FPFPUYXS.js} +3 -1
  190. package/dist/lib/chunk-FPFPUYXS.js.map +1 -0
  191. package/dist/lib/{chunk-QF3UTBJE.cjs → chunk-FQZQA4EJ.cjs} +13 -11
  192. package/dist/lib/chunk-FQZQA4EJ.cjs.map +1 -0
  193. package/dist/lib/{chunk-3T56KQ7U.cjs → chunk-GDODHF3Y.cjs} +6 -4
  194. package/dist/lib/chunk-GDODHF3Y.cjs.map +1 -0
  195. package/dist/lib/{chunk-LBR46BPB.cjs → chunk-GEMGC7W6.cjs} +97 -77
  196. package/dist/lib/chunk-GEMGC7W6.cjs.map +1 -0
  197. package/dist/lib/chunk-GTNYRHTO.js +3 -0
  198. package/dist/lib/chunk-GTNYRHTO.js.map +1 -0
  199. package/dist/lib/{chunk-32Q2PG5D.js → chunk-HDUSUF6L.js} +3 -1
  200. package/dist/lib/chunk-HDUSUF6L.js.map +1 -0
  201. package/dist/lib/{chunk-TANQDHYY.js → chunk-HQ6TGY34.js} +3 -1
  202. package/dist/lib/chunk-HQ6TGY34.js.map +1 -0
  203. package/dist/lib/{chunk-JG4IL7XL.cjs → chunk-HYQXPNVP.cjs} +4 -2
  204. package/dist/lib/chunk-HYQXPNVP.cjs.map +1 -0
  205. package/dist/lib/{chunk-GK75G3OD.cjs → chunk-JSU4O5TH.cjs} +7 -5
  206. package/dist/lib/chunk-JSU4O5TH.cjs.map +1 -0
  207. package/dist/lib/chunk-K3FDM5F3.cjs +4 -0
  208. package/dist/lib/chunk-K3FDM5F3.cjs.map +1 -0
  209. package/dist/lib/{chunk-DYGQQI74.js → chunk-KLU5DWCZ.js} +4 -2
  210. package/dist/lib/chunk-KLU5DWCZ.js.map +1 -0
  211. package/dist/lib/{chunk-V2523R33.cjs → chunk-KOD33DBU.cjs} +37 -10
  212. package/dist/lib/chunk-KOD33DBU.cjs.map +1 -0
  213. package/dist/lib/{chunk-OYLWPIBP.cjs → chunk-LIZRGQES.cjs} +7 -5
  214. package/dist/lib/chunk-LIZRGQES.cjs.map +1 -0
  215. package/dist/lib/{chunk-GLWPZDAR.js → chunk-LSSLZECF.js} +4 -2
  216. package/dist/lib/chunk-LSSLZECF.js.map +1 -0
  217. package/dist/lib/{chunk-GD7KTLPU.js → chunk-M7SU453W.js} +31 -4
  218. package/dist/lib/chunk-M7SU453W.js.map +1 -0
  219. package/dist/lib/{chunk-4NHFXDTQ.cjs → chunk-MFC7UJHT.cjs} +5 -3
  220. package/dist/lib/chunk-MFC7UJHT.cjs.map +1 -0
  221. package/dist/lib/{chunk-6RLV3FIS.js → chunk-MJ6WN3XA.js} +4 -2
  222. package/dist/lib/chunk-MJ6WN3XA.js.map +1 -0
  223. package/dist/lib/{chunk-T6KEXFRH.cjs → chunk-NPSC73QO.cjs} +10 -8
  224. package/dist/lib/chunk-NPSC73QO.cjs.map +1 -0
  225. package/dist/lib/{chunk-NST5TNW6.js → chunk-OC2AD37X.js} +3 -1
  226. package/dist/lib/chunk-OC2AD37X.js.map +1 -0
  227. package/dist/lib/{chunk-WUE7NTBW.cjs → chunk-OGEFARN2.cjs} +12 -10
  228. package/dist/lib/chunk-OGEFARN2.cjs.map +1 -0
  229. package/dist/lib/{chunk-3OCI4TH7.cjs → chunk-OXOTWH3L.cjs} +6 -4
  230. package/dist/lib/chunk-OXOTWH3L.cjs.map +1 -0
  231. package/dist/lib/{chunk-USNT2KNT.cjs → chunk-PK6SKIKE.cjs} +2 -0
  232. package/dist/lib/chunk-PK6SKIKE.cjs.map +1 -0
  233. package/dist/lib/{chunk-XBM7FHNK.js → chunk-Q25ZPXA7.js} +3 -1
  234. package/dist/lib/chunk-Q25ZPXA7.js.map +1 -0
  235. package/dist/lib/chunk-Q7C3YOFX.js +103 -0
  236. package/dist/lib/chunk-Q7C3YOFX.js.map +1 -0
  237. package/dist/lib/{chunk-XUYQYUWZ.cjs → chunk-QBE4SZN6.cjs} +6 -4
  238. package/dist/lib/chunk-QBE4SZN6.cjs.map +1 -0
  239. package/dist/lib/{chunk-GA3RXX4R.cjs → chunk-QHTL2U3L.cjs} +10 -8
  240. package/dist/lib/chunk-QHTL2U3L.cjs.map +1 -0
  241. package/dist/lib/chunk-QMKA57N4.cjs +4 -0
  242. package/dist/lib/chunk-QMKA57N4.cjs.map +1 -0
  243. package/dist/lib/{chunk-MRAGQ33T.js → chunk-RHADQ6HA.js} +4 -2
  244. package/dist/lib/chunk-RHADQ6HA.js.map +1 -0
  245. package/dist/lib/{chunk-KG4HFVJU.js → chunk-RNSQODBR.js} +136 -66
  246. package/dist/lib/chunk-RNSQODBR.js.map +1 -0
  247. package/dist/lib/{chunk-2NZADVP5.cjs → chunk-RQICHHZM.cjs} +4 -2
  248. package/dist/lib/chunk-RQICHHZM.cjs.map +1 -0
  249. package/dist/lib/{chunk-S6WYOXLM.js → chunk-RTFLBGJI.js} +4 -3
  250. package/dist/lib/chunk-RTFLBGJI.js.map +1 -0
  251. package/dist/lib/{chunk-67DW5UDQ.js → chunk-SUABYS33.js} +5 -3
  252. package/dist/lib/chunk-SUABYS33.js.map +1 -0
  253. package/dist/lib/chunk-UYDY7RRQ.cjs +4 -0
  254. package/dist/lib/chunk-UYDY7RRQ.cjs.map +1 -0
  255. package/dist/lib/{chunk-AHK7GRPM.js → chunk-W2KADD56.js} +4 -2
  256. package/dist/lib/chunk-W2KADD56.js.map +1 -0
  257. package/dist/lib/chunk-XBOHJTOI.cjs +4 -0
  258. package/dist/lib/chunk-XBOHJTOI.cjs.map +1 -0
  259. package/dist/lib/{chunk-XLHFUATD.cjs → chunk-Y5KONJVR.cjs} +55 -2
  260. package/dist/lib/chunk-Y5KONJVR.cjs.map +1 -0
  261. package/dist/lib/{chunk-YXJJCE6V.cjs → chunk-YF57WETC.cjs} +4 -2
  262. package/dist/lib/chunk-YF57WETC.cjs.map +1 -0
  263. package/dist/lib/{chunk-OKXWWMEF.js → chunk-YFB6OGXJ.js} +4 -2
  264. package/dist/lib/chunk-YFB6OGXJ.js.map +1 -0
  265. package/dist/lib/{chunk-L56XA427.js → chunk-YJEZASNU.js} +41 -3
  266. package/dist/lib/chunk-YJEZASNU.js.map +1 -0
  267. package/dist/lib/{chunk-A2NW7WAN.js → chunk-YMEXAI6M.js} +3 -1
  268. package/dist/lib/chunk-YMEXAI6M.js.map +1 -0
  269. package/dist/lib/{chunk-YYEAV24J.cjs → chunk-YYG2XJQN.cjs} +30 -11
  270. package/dist/lib/chunk-YYG2XJQN.cjs.map +1 -0
  271. package/dist/lib/{chunk-NDC5BKCD.cjs → chunk-YZ2NKI4K.cjs} +4 -2
  272. package/dist/lib/chunk-YZ2NKI4K.cjs.map +1 -0
  273. package/dist/lib/{chunk-YYN6TKSY.cjs → chunk-ZFOPHCGK.cjs} +4 -2
  274. package/dist/lib/chunk-ZFOPHCGK.cjs.map +1 -0
  275. package/dist/lib/{chunk-HL4KTZDB.cjs → chunk-ZGTXKPKZ.cjs} +5 -3
  276. package/dist/lib/chunk-ZGTXKPKZ.cjs.map +1 -0
  277. package/dist/lib/{chunk-4W6WV35V.js → chunk-ZLWW2MXD.js} +21 -15
  278. package/dist/lib/chunk-ZLWW2MXD.js.map +1 -0
  279. package/dist/lib/{chunk-N22WOZ3U.js → chunk-ZVZFMMNL.js} +7 -5
  280. package/dist/lib/chunk-ZVZFMMNL.js.map +1 -0
  281. package/dist/lib/{chunk-D6MI2V6R.cjs → chunk-ZWLSNYIN.cjs} +23 -17
  282. package/dist/lib/chunk-ZWLSNYIN.cjs.map +1 -0
  283. package/dist/lib/{config-D2dTFLlQ.d.cts → config-CHOLTlno.d.cts} +32 -19
  284. package/dist/lib/{config-Dzk6j2mr.d.ts → config-Cf85ts8m.d.ts} +32 -19
  285. package/dist/lib/config-file.cjs +6 -4
  286. package/dist/lib/config-file.cjs.map +1 -0
  287. package/dist/lib/config-file.d.cts +3 -2
  288. package/dist/lib/config-file.d.ts +3 -2
  289. package/dist/lib/config-file.js +4 -2
  290. package/dist/lib/config-file.js.map +1 -0
  291. package/dist/lib/contexts/api-context.cjs +20 -18
  292. package/dist/lib/contexts/api-context.cjs.map +1 -0
  293. package/dist/lib/contexts/api-context.d.cts +25 -6
  294. package/dist/lib/contexts/api-context.d.ts +25 -6
  295. package/dist/lib/contexts/api-context.js +19 -17
  296. package/dist/lib/contexts/api-context.js.map +1 -0
  297. package/dist/lib/contexts/context.cjs +17 -15
  298. package/dist/lib/contexts/context.cjs.map +1 -0
  299. package/dist/lib/contexts/context.d.cts +17 -4
  300. package/dist/lib/contexts/context.d.ts +17 -4
  301. package/dist/lib/contexts/context.js +16 -14
  302. package/dist/lib/contexts/context.js.map +1 -0
  303. package/dist/lib/contexts/environment-context.cjs +19 -17
  304. package/dist/lib/contexts/environment-context.cjs.map +1 -0
  305. package/dist/lib/contexts/environment-context.d.cts +6 -5
  306. package/dist/lib/contexts/environment-context.d.ts +6 -5
  307. package/dist/lib/contexts/environment-context.js +18 -16
  308. package/dist/lib/contexts/environment-context.js.map +1 -0
  309. package/dist/lib/contexts/index.cjs +24 -22
  310. package/dist/lib/contexts/index.cjs.map +1 -0
  311. package/dist/lib/contexts/index.d.cts +5 -4
  312. package/dist/lib/contexts/index.d.ts +5 -4
  313. package/dist/lib/contexts/index.js +20 -18
  314. package/dist/lib/contexts/index.js.map +1 -0
  315. package/dist/lib/contexts/plugin-context.cjs +5 -3
  316. package/dist/lib/contexts/plugin-context.cjs.map +1 -0
  317. package/dist/lib/contexts/plugin-context.d.cts +5 -4
  318. package/dist/lib/contexts/plugin-context.d.ts +5 -4
  319. package/dist/lib/contexts/plugin-context.js +4 -2
  320. package/dist/lib/contexts/plugin-context.js.map +1 -0
  321. package/dist/lib/entry.cjs +13 -11
  322. package/dist/lib/entry.cjs.map +1 -0
  323. package/dist/lib/entry.d.cts +3 -2
  324. package/dist/lib/entry.d.ts +3 -2
  325. package/dist/lib/entry.js +5 -3
  326. package/dist/lib/entry.js.map +1 -0
  327. package/dist/lib/fs/helpers.cjs +18 -12
  328. package/dist/lib/fs/helpers.cjs.map +1 -0
  329. package/dist/lib/fs/helpers.d.cts +10 -1
  330. package/dist/lib/fs/helpers.d.ts +10 -1
  331. package/dist/lib/fs/helpers.js +4 -2
  332. package/dist/lib/fs/helpers.js.map +1 -0
  333. package/dist/lib/fs/index.cjs +12 -10
  334. package/dist/lib/fs/index.cjs.map +1 -0
  335. package/dist/lib/fs/index.d.cts +4 -3
  336. package/dist/lib/fs/index.d.ts +4 -3
  337. package/dist/lib/fs/index.js +11 -9
  338. package/dist/lib/fs/index.js.map +1 -0
  339. package/dist/lib/fs/storage/base.cjs +5 -3
  340. package/dist/lib/fs/storage/base.cjs.map +1 -0
  341. package/dist/lib/fs/storage/base.d.cts +42 -1
  342. package/dist/lib/fs/storage/base.d.ts +42 -1
  343. package/dist/lib/fs/storage/base.js +4 -2
  344. package/dist/lib/fs/storage/base.js.map +1 -0
  345. package/dist/lib/fs/storage/file-system.cjs +7 -5
  346. package/dist/lib/fs/storage/file-system.cjs.map +1 -0
  347. package/dist/lib/fs/storage/file-system.d.cts +34 -2
  348. package/dist/lib/fs/storage/file-system.d.ts +34 -2
  349. package/dist/lib/fs/storage/file-system.js +6 -4
  350. package/dist/lib/fs/storage/file-system.js.map +1 -0
  351. package/dist/lib/fs/storage/index.cjs +10 -8
  352. package/dist/lib/fs/storage/index.cjs.map +1 -0
  353. package/dist/lib/fs/storage/index.d.cts +4 -2
  354. package/dist/lib/fs/storage/index.d.ts +4 -2
  355. package/dist/lib/fs/storage/index.js +7 -5
  356. package/dist/lib/fs/storage/index.js.map +1 -0
  357. package/dist/lib/fs/storage/virtual.cjs +6 -4
  358. package/dist/lib/fs/storage/virtual.cjs.map +1 -0
  359. package/dist/lib/fs/storage/virtual.d.cts +2 -1
  360. package/dist/lib/fs/storage/virtual.d.ts +2 -1
  361. package/dist/lib/fs/storage/virtual.js +5 -3
  362. package/dist/lib/fs/storage/virtual.js.map +1 -0
  363. package/dist/lib/fs/vfs.cjs +11 -9
  364. package/dist/lib/fs/vfs.cjs.map +1 -0
  365. package/dist/lib/fs/vfs.d.cts +48 -7
  366. package/dist/lib/fs/vfs.d.ts +48 -7
  367. package/dist/lib/fs/vfs.js +10 -8
  368. package/dist/lib/fs/vfs.js.map +1 -0
  369. package/dist/lib/{fs-Dg-aTfiN.d.cts → fs-abWbkR69.d.cts} +85 -4
  370. package/dist/lib/{fs-Dg-aTfiN.d.ts → fs-abWbkR69.d.ts} +85 -4
  371. package/dist/lib/index.cjs +98 -96
  372. package/dist/lib/index.cjs.map +1 -0
  373. package/dist/lib/index.d.cts +6 -5
  374. package/dist/lib/index.d.ts +6 -5
  375. package/dist/lib/index.js +38 -36
  376. package/dist/lib/index.js.map +1 -0
  377. package/dist/lib/{internal-DC9vYMIn.d.cts → internal-CJEi85Up.d.cts} +2 -2
  378. package/dist/lib/{internal-Cgp0NF-t.d.ts → internal-CgJbkA5Y.d.ts} +2 -2
  379. package/dist/lib/logger.cjs +6 -4
  380. package/dist/lib/logger.cjs.map +1 -0
  381. package/dist/lib/logger.d.cts +3 -2
  382. package/dist/lib/logger.d.ts +3 -2
  383. package/dist/lib/logger.js +4 -2
  384. package/dist/lib/logger.js.map +1 -0
  385. package/dist/lib/typescript/import-transformer.cjs +5 -3
  386. package/dist/lib/typescript/import-transformer.cjs.map +1 -0
  387. package/dist/lib/typescript/import-transformer.d.cts +3 -2
  388. package/dist/lib/typescript/import-transformer.d.ts +3 -2
  389. package/dist/lib/typescript/import-transformer.js +4 -2
  390. package/dist/lib/typescript/import-transformer.js.map +1 -0
  391. package/dist/lib/typescript/index.cjs +21 -19
  392. package/dist/lib/typescript/index.cjs.map +1 -0
  393. package/dist/lib/typescript/index.d.cts +3 -2
  394. package/dist/lib/typescript/index.d.ts +3 -2
  395. package/dist/lib/typescript/index.js +8 -6
  396. package/dist/lib/typescript/index.js.map +1 -0
  397. package/dist/lib/typescript/isolated-decl.cjs +5 -3
  398. package/dist/lib/typescript/isolated-decl.cjs.map +1 -0
  399. package/dist/lib/typescript/isolated-decl.js +4 -2
  400. package/dist/lib/typescript/isolated-decl.js.map +1 -0
  401. package/dist/lib/typescript/ts-morph.cjs +6 -4
  402. package/dist/lib/typescript/ts-morph.cjs.map +1 -0
  403. package/dist/lib/typescript/ts-morph.d.cts +5 -4
  404. package/dist/lib/typescript/ts-morph.d.ts +5 -4
  405. package/dist/lib/typescript/ts-morph.js +4 -2
  406. package/dist/lib/typescript/ts-morph.js.map +1 -0
  407. package/dist/lib/typescript/tsconfig.cjs +11 -9
  408. package/dist/lib/typescript/tsconfig.cjs.map +1 -0
  409. package/dist/lib/typescript/tsconfig.js +4 -2
  410. package/dist/lib/typescript/tsconfig.js.map +1 -0
  411. package/dist/lib/unplugin/factory.cjs +23 -21
  412. package/dist/lib/unplugin/factory.cjs.map +1 -0
  413. package/dist/lib/unplugin/factory.d.cts +5 -4
  414. package/dist/lib/unplugin/factory.d.ts +5 -4
  415. package/dist/lib/unplugin/factory.js +22 -20
  416. package/dist/lib/unplugin/factory.js.map +1 -0
  417. package/dist/lib/unplugin/helpers.cjs +5 -3
  418. package/dist/lib/unplugin/helpers.cjs.map +1 -0
  419. package/dist/lib/unplugin/helpers.d.cts +3 -2
  420. package/dist/lib/unplugin/helpers.d.ts +3 -2
  421. package/dist/lib/unplugin/helpers.js +4 -2
  422. package/dist/lib/unplugin/helpers.js.map +1 -0
  423. package/dist/lib/unplugin/index.cjs +28 -26
  424. package/dist/lib/unplugin/index.cjs.map +1 -0
  425. package/dist/lib/unplugin/index.d.cts +5 -4
  426. package/dist/lib/unplugin/index.d.ts +5 -4
  427. package/dist/lib/unplugin/index.js +25 -23
  428. package/dist/lib/unplugin/index.js.map +1 -0
  429. package/dist/lib/unplugin/plugin.cjs +8 -6
  430. package/dist/lib/unplugin/plugin.cjs.map +1 -0
  431. package/dist/lib/unplugin/plugin.d.cts +5 -4
  432. package/dist/lib/unplugin/plugin.d.ts +5 -4
  433. package/dist/lib/unplugin/plugin.js +7 -5
  434. package/dist/lib/unplugin/plugin.js.map +1 -0
  435. package/dist/lib/{unplugin-CvYjC7ZL.d.cts → unplugin-B_IjyAl1.d.cts} +2 -2
  436. package/dist/lib/{unplugin-D7lpyIpN.d.ts → unplugin-CzkNGCn5.d.ts} +2 -2
  437. package/dist/lib/utilities/bundle.cjs +8 -6
  438. package/dist/lib/utilities/bundle.cjs.map +1 -0
  439. package/dist/lib/utilities/bundle.d.cts +3 -2
  440. package/dist/lib/utilities/bundle.d.ts +3 -2
  441. package/dist/lib/utilities/bundle.js +7 -5
  442. package/dist/lib/utilities/bundle.js.map +1 -0
  443. package/dist/lib/utilities/cache.cjs +7 -5
  444. package/dist/lib/utilities/cache.cjs.map +1 -0
  445. package/dist/lib/utilities/cache.d.cts +3 -2
  446. package/dist/lib/utilities/cache.d.ts +3 -2
  447. package/dist/lib/utilities/cache.js +5 -3
  448. package/dist/lib/utilities/cache.js.map +1 -0
  449. package/dist/lib/utilities/file-header.cjs +6 -4
  450. package/dist/lib/utilities/file-header.cjs.map +1 -0
  451. package/dist/lib/utilities/file-header.d.cts +3 -2
  452. package/dist/lib/utilities/file-header.d.ts +3 -2
  453. package/dist/lib/utilities/file-header.js +4 -2
  454. package/dist/lib/utilities/file-header.js.map +1 -0
  455. package/dist/lib/utilities/index.cjs +45 -43
  456. package/dist/lib/utilities/index.cjs.map +1 -0
  457. package/dist/lib/utilities/index.d.cts +3 -2
  458. package/dist/lib/utilities/index.d.ts +3 -2
  459. package/dist/lib/utilities/index.js +17 -15
  460. package/dist/lib/utilities/index.js.map +1 -0
  461. package/dist/lib/utilities/meta.cjs +10 -8
  462. package/dist/lib/utilities/meta.cjs.map +1 -0
  463. package/dist/lib/utilities/meta.d.cts +3 -2
  464. package/dist/lib/utilities/meta.d.ts +3 -2
  465. package/dist/lib/utilities/meta.js +4 -2
  466. package/dist/lib/utilities/meta.js.map +1 -0
  467. package/dist/lib/utilities/resolve.cjs +9 -7
  468. package/dist/lib/utilities/resolve.cjs.map +1 -0
  469. package/dist/lib/utilities/resolve.d.cts +3 -2
  470. package/dist/lib/utilities/resolve.d.ts +3 -2
  471. package/dist/lib/utilities/resolve.js +8 -6
  472. package/dist/lib/utilities/resolve.js.map +1 -0
  473. package/dist/lib/utilities/source-file.cjs +7 -5
  474. package/dist/lib/utilities/source-file.cjs.map +1 -0
  475. package/dist/lib/utilities/source-file.d.cts +3 -2
  476. package/dist/lib/utilities/source-file.d.ts +3 -2
  477. package/dist/lib/utilities/source-file.js +4 -2
  478. package/dist/lib/utilities/source-file.js.map +1 -0
  479. package/dist/lib/utilities/source-map.cjs +5 -3
  480. package/dist/lib/utilities/source-map.cjs.map +1 -0
  481. package/dist/lib/utilities/source-map.d.cts +3 -2
  482. package/dist/lib/utilities/source-map.d.ts +3 -2
  483. package/dist/lib/utilities/source-map.js +4 -2
  484. package/dist/lib/utilities/source-map.js.map +1 -0
  485. package/dist/lib/utilities/worker.cjs +7 -5
  486. package/dist/lib/utilities/worker.cjs.map +1 -0
  487. package/dist/lib/utilities/worker.d.cts +3 -2
  488. package/dist/lib/utilities/worker.d.ts +3 -2
  489. package/dist/lib/utilities/worker.js +5 -3
  490. package/dist/lib/utilities/worker.js.map +1 -0
  491. package/dist/lib/utilities/write-file.cjs +5 -3
  492. package/dist/lib/utilities/write-file.cjs.map +1 -0
  493. package/dist/lib/utilities/write-file.d.cts +3 -2
  494. package/dist/lib/utilities/write-file.d.ts +3 -2
  495. package/dist/lib/utilities/write-file.js +4 -2
  496. package/dist/lib/utilities/write-file.js.map +1 -0
  497. package/dist/next.cjs +6 -6
  498. package/dist/next.js +5 -5
  499. package/dist/nuxt.cjs +8 -8
  500. package/dist/nuxt.js +6 -6
  501. package/dist/plugin-utils/{chunk-GV7O3E7P.js → chunk-36OM2X4L.js} +4 -2
  502. package/dist/plugin-utils/chunk-36OM2X4L.js.map +1 -0
  503. package/dist/{lib/chunk-SHUYVCID.js → plugin-utils/chunk-7QVYU63E.js} +2 -0
  504. package/dist/plugin-utils/chunk-7QVYU63E.js.map +1 -0
  505. package/dist/plugin-utils/{chunk-XIXI67PY.js → chunk-7YN6UEMJ.js} +4 -2
  506. package/dist/plugin-utils/chunk-7YN6UEMJ.js.map +1 -0
  507. package/dist/plugin-utils/{chunk-DZZPNO5H.cjs → chunk-B2V5OVYF.cjs} +6 -4
  508. package/dist/plugin-utils/chunk-B2V5OVYF.cjs.map +1 -0
  509. package/dist/plugin-utils/{chunk-NFXNZFMN.cjs → chunk-DUIPLC7F.cjs} +5 -3
  510. package/dist/plugin-utils/chunk-DUIPLC7F.cjs.map +1 -0
  511. package/dist/plugin-utils/{chunk-SEH3RVMF.js → chunk-G32M72GJ.js} +3 -1
  512. package/dist/plugin-utils/chunk-G32M72GJ.js.map +1 -0
  513. package/dist/plugin-utils/{chunk-5MO4BCOW.cjs → chunk-GH7PPING.cjs} +4 -2
  514. package/dist/plugin-utils/chunk-GH7PPING.cjs.map +1 -0
  515. package/dist/plugin-utils/{chunk-CYVV2MB7.js → chunk-H7GJUBNY.js} +3 -1
  516. package/dist/plugin-utils/chunk-H7GJUBNY.js.map +1 -0
  517. package/dist/plugin-utils/{chunk-ECFS7DPV.cjs → chunk-ID47RJFS.cjs} +9 -7
  518. package/dist/plugin-utils/chunk-ID47RJFS.cjs.map +1 -0
  519. package/dist/plugin-utils/{chunk-FBLNGP3S.js → chunk-NRJ5QYX2.js} +3 -1
  520. package/dist/plugin-utils/chunk-NRJ5QYX2.js.map +1 -0
  521. package/dist/plugin-utils/{chunk-USNT2KNT.cjs → chunk-PK6SKIKE.cjs} +2 -0
  522. package/dist/plugin-utils/chunk-PK6SKIKE.cjs.map +1 -0
  523. package/dist/plugin-utils/{chunk-QKMG6ZAU.js → chunk-QQ63YK2G.js} +4 -2
  524. package/dist/plugin-utils/chunk-QQ63YK2G.js.map +1 -0
  525. package/dist/plugin-utils/{chunk-DCJAIIJ5.cjs → chunk-RBMEE2JC.cjs} +4 -2
  526. package/dist/plugin-utils/chunk-RBMEE2JC.cjs.map +1 -0
  527. package/dist/plugin-utils/{chunk-UNAGYQRB.cjs → chunk-UXLKUCEY.cjs} +9 -7
  528. package/dist/plugin-utils/chunk-UXLKUCEY.cjs.map +1 -0
  529. package/dist/plugin-utils/{chunk-F65J5WOX.cjs → chunk-VJGI676W.cjs} +16 -14
  530. package/dist/plugin-utils/chunk-VJGI676W.cjs.map +1 -0
  531. package/dist/plugin-utils/{chunk-L277XSSN.js → chunk-X4BI25Z5.js} +3 -1
  532. package/dist/plugin-utils/chunk-X4BI25Z5.js.map +1 -0
  533. package/dist/plugin-utils/{context-iOcgJtAf.d.cts → context-DDQIG3fZ.d.cts} +96 -9
  534. package/dist/plugin-utils/{context-iOcgJtAf.d.ts → context-DDQIG3fZ.d.ts} +96 -9
  535. package/dist/plugin-utils/context-helpers.cjs +6 -4
  536. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  537. package/dist/plugin-utils/context-helpers.d.cts +1 -1
  538. package/dist/plugin-utils/context-helpers.d.ts +1 -1
  539. package/dist/plugin-utils/context-helpers.js +4 -2
  540. package/dist/plugin-utils/context-helpers.js.map +1 -0
  541. package/dist/plugin-utils/enforce.cjs +8 -6
  542. package/dist/plugin-utils/enforce.cjs.map +1 -0
  543. package/dist/plugin-utils/enforce.d.cts +1 -1
  544. package/dist/plugin-utils/enforce.d.ts +1 -1
  545. package/dist/plugin-utils/enforce.js +7 -5
  546. package/dist/plugin-utils/enforce.js.map +1 -0
  547. package/dist/plugin-utils/extend.cjs +7 -5
  548. package/dist/plugin-utils/extend.cjs.map +1 -0
  549. package/dist/plugin-utils/extend.d.cts +1 -1
  550. package/dist/plugin-utils/extend.d.ts +1 -1
  551. package/dist/plugin-utils/extend.js +6 -4
  552. package/dist/plugin-utils/extend.js.map +1 -0
  553. package/dist/plugin-utils/get-config-path.cjs +5 -3
  554. package/dist/plugin-utils/get-config-path.cjs.map +1 -0
  555. package/dist/plugin-utils/get-config-path.d.cts +1 -1
  556. package/dist/plugin-utils/get-config-path.d.ts +1 -1
  557. package/dist/plugin-utils/get-config-path.js +4 -2
  558. package/dist/plugin-utils/get-config-path.js.map +1 -0
  559. package/dist/plugin-utils/helpers.cjs +17 -15
  560. package/dist/plugin-utils/helpers.cjs.map +1 -0
  561. package/dist/plugin-utils/helpers.d.cts +3 -3
  562. package/dist/plugin-utils/helpers.d.ts +3 -3
  563. package/dist/plugin-utils/helpers.js +4 -2
  564. package/dist/plugin-utils/helpers.js.map +1 -0
  565. package/dist/plugin-utils/index.cjs +30 -28
  566. package/dist/plugin-utils/index.cjs.map +1 -0
  567. package/dist/plugin-utils/index.d.cts +1 -1
  568. package/dist/plugin-utils/index.d.ts +1 -1
  569. package/dist/plugin-utils/index.js +10 -8
  570. package/dist/plugin-utils/index.js.map +1 -0
  571. package/dist/plugin-utils/merge.cjs +6 -4
  572. package/dist/plugin-utils/merge.cjs.map +1 -0
  573. package/dist/plugin-utils/merge.d.cts +1 -1
  574. package/dist/plugin-utils/merge.d.ts +1 -1
  575. package/dist/plugin-utils/merge.js +5 -3
  576. package/dist/plugin-utils/merge.js.map +1 -0
  577. package/dist/plugin-utils/paths.cjs +5 -3
  578. package/dist/plugin-utils/paths.cjs.map +1 -0
  579. package/dist/plugin-utils/paths.d.cts +1 -1
  580. package/dist/plugin-utils/paths.d.ts +1 -1
  581. package/dist/plugin-utils/paths.js +4 -2
  582. package/dist/plugin-utils/paths.js.map +1 -0
  583. package/dist/rolldown.cjs +18 -10
  584. package/dist/rolldown.d.cts +2 -1
  585. package/dist/rolldown.d.ts +2 -1
  586. package/dist/rolldown.js +5 -10
  587. package/dist/rollup.cjs +5 -5
  588. package/dist/rollup.d.cts +2 -1
  589. package/dist/rollup.d.ts +2 -1
  590. package/dist/rollup.js +4 -4
  591. package/dist/rspack.cjs +5 -5
  592. package/dist/rspack.d.cts +2 -1
  593. package/dist/rspack.d.ts +2 -1
  594. package/dist/rspack.js +4 -4
  595. package/dist/tsdown.cjs +114 -0
  596. package/dist/tsdown.d.cts +28 -0
  597. package/dist/tsdown.d.ts +28 -0
  598. package/dist/tsdown.js +108 -0
  599. package/dist/tsup.cjs +6 -6
  600. package/dist/tsup.js +5 -5
  601. package/dist/types/api.d.cts +3 -2
  602. package/dist/types/api.d.ts +3 -2
  603. package/dist/types/babel.d.cts +2 -1
  604. package/dist/types/babel.d.ts +2 -1
  605. package/dist/types/build.d.cts +11 -10
  606. package/dist/types/build.d.ts +11 -10
  607. package/dist/types/commands.d.cts +2 -1
  608. package/dist/types/commands.d.ts +2 -1
  609. package/dist/types/config.d.cts +2 -1
  610. package/dist/types/config.d.ts +2 -1
  611. package/dist/types/context.cjs +2 -2
  612. package/dist/types/context.d.cts +2 -1
  613. package/dist/types/context.d.ts +2 -1
  614. package/dist/types/context.js +1 -1
  615. package/dist/types/fs.cjs +4 -4
  616. package/dist/types/fs.d.cts +85 -4
  617. package/dist/types/fs.d.ts +85 -4
  618. package/dist/types/fs.js +1 -1
  619. package/dist/types/hooks.d.cts +2 -1
  620. package/dist/types/hooks.d.ts +2 -1
  621. package/dist/types/index.cjs +9 -9
  622. package/dist/types/index.d.cts +4 -3
  623. package/dist/types/index.d.ts +4 -3
  624. package/dist/types/index.js +4 -4
  625. package/dist/types/internal.d.cts +3 -2
  626. package/dist/types/internal.d.ts +3 -2
  627. package/dist/types/plugin.cjs +2 -2
  628. package/dist/types/plugin.d.cts +2 -1
  629. package/dist/types/plugin.d.ts +2 -1
  630. package/dist/types/plugin.js +1 -1
  631. package/dist/types/resolved.d.cts +2 -1
  632. package/dist/types/resolved.d.ts +2 -1
  633. package/dist/types/unplugin.d.cts +3 -2
  634. package/dist/types/unplugin.d.ts +3 -2
  635. package/dist/unloader.cjs +5 -5
  636. package/dist/unloader.d.cts +2 -1
  637. package/dist/unloader.d.ts +2 -1
  638. package/dist/unloader.js +4 -4
  639. package/dist/unplugin.cjs +8 -8
  640. package/dist/unplugin.d.cts +3 -2
  641. package/dist/unplugin.d.ts +3 -2
  642. package/dist/unplugin.js +6 -6
  643. package/dist/vite.cjs +8 -8
  644. package/dist/vite.d.cts +2 -1
  645. package/dist/vite.d.ts +2 -1
  646. package/dist/vite.js +5 -5
  647. package/dist/webpack.cjs +8 -8
  648. package/dist/webpack.d.cts +2 -1
  649. package/dist/webpack.d.ts +2 -1
  650. package/dist/webpack.js +5 -5
  651. package/package.json +71 -50
  652. package/dist/chunk-C3APS65S.cjs +0 -12
  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-H5JWMXTZ.js +0 -1
  657. package/dist/lib/chunk-I2DQRMX3.js +0 -1
  658. package/dist/lib/chunk-K2SFTPN3.cjs +0 -2
  659. package/dist/lib/chunk-MVIKYHBX.cjs +0 -2
  660. package/dist/lib/chunk-NQAHFTUW.js +0 -1
  661. package/dist/lib/chunk-NYNHNTHT.js +0 -1
  662. package/dist/lib/chunk-TWABN364.cjs +0 -147
  663. package/dist/lib/chunk-VVSEE3JE.cjs +0 -2
  664. package/dist/lib/chunk-YK4PYVLM.cjs +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/build/unbuild.ts"],"names":["DEFAULT_UNBUILD_CONFIG","dts","clean","includeSrc","treeShaking","splitting","stub","watchOptions","outputPath","generatePackageJson","banner","rollup","emitCJS","replace","resolve","json","esbuild","target","commonjs","alias","unbuildLoader","context","input","options","test","path","output","contents","getContents","declaration","srcPath","match","cm","extension","push","transformed","result","$$internal","callHook","sequential","order","getString","includes","transform","Object","fromEntries","entries","filter","key","loader","then","r","code","isCjs","format","resolver","source","retainLines","ext","startsWith","extractUnbuildConfig","defu","builtins","reduce","ret","id","fs","ids","config","build","Array","isArray","find","toString","replacement","variant","override","omit","projectName","name","orgName","isObject","workspaceConfig","organization","sourceRoot","projectRoot","buildPath","platform","external","loaders","jiti","interopDefault","fsCache","joinPaths","envPaths","cache","moduleCache","extractRollupConfig","debug","mode","minify","sourcemap"],"mappings":";;;;;;;;;;;;;;;AAkCO,IAAMA,sBAAAA,GAAyB;EACpCC,GAAAA,EAAK,IAAA;EACLC,KAAAA,EAAO,KAAA;EACPC,UAAAA,EAAY,KAAA;EACZC,WAAAA,EAAa,IAAA;EACbC,SAAAA,EAAW,IAAA;EACXC,IAAAA,EAAM,KAAA;AACNC,EAAAA,YAAAA,EAAc,EAAC;EACfC,UAAAA,EAAY,MAAA;EACZC,mBAAAA,EAAqB,IAAA;EACrBC,MAAAA,EAAQ,GAAA;EACRC,MAAAA,EAAQ;AACNV,IAAAA,GAAAA,EAAK,EAAC;IACNW,OAAAA,EAAS,IAAA;AACTC,IAAAA,OAAAA,EAAS,EAAC;AACVC,IAAAA,OAAAA,EAAS,EAAC;AACVC,IAAAA,IAAAA,EAAM,EAAC;IACPC,OAAAA,EAAS;MAAEC,MAAAA,EAAQ;AAAS,KAAA;AAC5BC,IAAAA,QAAAA,EAAU,EAAC;AACXC,IAAAA,KAAAA,EAAO;AACT;AACF;AAEO,IAAMC,aAAAA,6CAAiBC,OAAAA,KAAAA;AAC5B,EAAA,OAAO,OAAOC,KAAAA,EAAO,EAAEC,OAAAA,EAAO,KAAE;AAC9B,IAAA,IACE,CAAC,oBAAA,CAAqBC,IAAAA,CAAKF,KAAAA,CAAMG,IAAI,KACrC,eAAA,CAAgBD,IAAAA,CAAKF,KAAAA,CAAMG,IAAI,CAAA,EAC/B;AACA,MAAA;AACF,I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A,CAAQ+C,OAAO+B,IAAAA,KAAS,aAAA;IAChCE,SAAAA,EAAWhF,OAAAA,CAAQ+C,OAAO+B,IAAAA,KAAS;AACrC,GAAA,EACAnG,sBAAAA,CAAAA;AAEJ;AApEgB4D,wBAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA","file":"chunk-BQA4H72F.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Loader, LoaderResult } from \"@storm-software/unbuild/types\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport defu from \"defu\";\nimport { transform } from \"esbuild\";\nimport { TransformResult } from \"unplugin\";\nimport {\n UnbuildBuildConfig,\n UnbuildResolvedBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { UNSAFE_PluginContext } from \"../../types/internal\";\nimport { getString } from \"../utilities/source-file\";\nimport { extractRollupConfig } from \"./rollup\";\n\nexport const DEFAULT_UNBUILD_CONFIG = {\n dts: true,\n clean: false,\n includeSrc: false,\n treeShaking: true,\n splitting: true,\n stub: false,\n watchOptions: {},\n outputPath: \"dist\",\n generatePackageJson: true,\n banner: \" \",\n rollup: {\n dts: {},\n emitCJS: true,\n replace: {},\n resolve: {},\n json: {},\n esbuild: { target: \"es2020\" },\n commonjs: {},\n alias: {}\n }\n} as Partial<UnbuildBuildConfig>;\n\nexport const unbuildLoader = (context: UNSAFE_PluginContext): Loader => {\n return async (input, { options }) => {\n if (\n !/\\.(?:c|m)?[jt]sx?$/.test(input.path) ||\n /\\.d\\.[cm]?ts$/.test(input.path)\n ) {\n return;\n }\n\n const output: LoaderResult = [];\n\n let contents = await input.getContents();\n\n // declaration\n if (options.declaration && !input.srcPath?.match(/\\.d\\.[cm]?ts$/)) {\n const cm = input.srcPath?.match(/(?<=\\.)(?:c|m)(?=[jt]s$)/)?.[0] || \"\";\n const extension = `.d.${cm}ts`;\n output.push({\n contents,\n srcPath: input.srcPath,\n path: input.path,\n extension,\n declaration: true\n });\n }\n\n let transformed: TransformResult | string = contents;\n\n let result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"pre\"\n },\n transformed,\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"normal\"\n },\n getString(transformed),\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"post\"\n },\n getString(transformed),\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n // typescript => js\n if ([\".ts\", \".mts\", \".cts\"].includes(input.extension)) {\n contents = await transform(getString(transformed), {\n ...Object.fromEntries(\n Object.entries(options.esbuild ?? {}).filter(\n ([key]) => key !== \"absPaths\"\n )\n ),\n loader: \"ts\"\n }).then(r => r.code);\n } else if ([\".tsx\", \".jsx\"].includes(input.extension)) {\n contents = await transform(getString(transformed), {\n loader: input.extension === \".tsx\" ? \"tsx\" : \"jsx\",\n ...Object.fromEntries(\n Object.entries(options.esbuild ?? {}).filter(\n ([key]) => key !== \"absPaths\"\n )\n )\n }).then(r => r.code);\n }\n\n // esm => cjs\n const isCjs = options.format === \"cjs\";\n if (isCjs) {\n contents = context.resolver\n .transform({\n source: contents,\n retainLines: false\n })\n .replace(/^exports.default = /gm, \"module.exports = \")\n .replace(/^var _default = exports.default = /gm, \"module.exports = \")\n .replace(\"module.exports = void 0;\", \"\");\n }\n\n let extension = isCjs ? \".js\" : \".mjs\"; // TODO: Default to .cjs in next major version\n if (options.ext) {\n extension = options.ext.startsWith(\".\") ? options.ext : `.${options.ext}`;\n }\n\n output.push({\n contents,\n path: input.path,\n extension\n });\n\n return output;\n };\n};\n\n/**\n * Extracts the unbuild configuration from the context.\n *\n * @param context - The build context.\n * @returns The resolved unbuild configuration.\n */\nexport function extractUnbuildConfig(\n context: Context\n): UnbuildResolvedBuildConfig {\n return defu(\n {\n alias: context.builtins.reduce(\n (ret, id) => {\n if (!ret[id]) {\n const path = context.fs.ids[id];\n if (path) {\n ret[id] = path;\n }\n }\n\n return ret;\n },\n context.config.build.alias\n ? Array.isArray(context.config.build.alias)\n ? context.config.build.alias.reduce(\n (ret, alias) => {\n if (!ret[alias.find.toString()]) {\n ret[alias.find.toString()] = alias.replacement;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n : context.config.build.alias\n : {}\n )\n },\n context.config.build.variant === \"unbuild\"\n ? context.config.build.override\n : {},\n context.config.build.variant === \"unbuild\"\n ? omit(context.config.build, [\"override\", \"variant\"])\n : {},\n {\n projectName: context.config.name,\n name: context.config.name,\n orgName: isObject(context.workspaceConfig.organization)\n ? context.workspaceConfig.organization.name\n : context.workspaceConfig.organization,\n sourceRoot: context.config.sourceRoot,\n projectRoot: context.config.projectRoot,\n outputPath: context.config.output.buildPath || \"dist\",\n platform: context.config.build.platform,\n external: context.builtins.reduce((ret, id) => {\n if (!ret.includes(id)) {\n ret.push(id);\n }\n\n return ret;\n }, context.config.build.external ?? []) as string[],\n loaders: [unbuildLoader(context as UNSAFE_PluginContext)],\n jiti: {\n interopDefault: true,\n fsCache: joinPaths(context.envPaths.cache, \"jiti\"),\n moduleCache: true\n },\n rollup: extractRollupConfig(context) as any,\n debug: context.config.mode === \"development\",\n minify: context.config.mode !== \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_UNBUILD_CONFIG\n );\n}\n"]}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=chunk-CLOW34EQ.js.map
3
+ //# sourceMappingURL=chunk-CLOW34EQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-CLOW34EQ.js"}
@@ -1,4 +1,4 @@
1
- import { __name } from './chunk-SHUYVCID.js';
1
+ import { __name } from './chunk-7QVYU63E.js';
2
2
  import { appendPath } from '@stryke/path/append';
3
3
  import { correctPath } from '@stryke/path/correct-path';
4
4
  import { joinPaths } from '@stryke/path/join';
@@ -58,6 +58,21 @@ var BaseStorageAdapter = class {
58
58
  }
59
59
  }
60
60
  /**
61
+ * Synchronously creates a directory at the specified path.
62
+ *
63
+ * @param _ - The path of the directory to create.
64
+ */
65
+ mkdirSync(_) {
66
+ }
67
+ /**
68
+ * Creates a directory at the specified path.
69
+ *
70
+ * @param dirPath - The path of the directory to create.
71
+ */
72
+ async mkdir(dirPath) {
73
+ return Promise.resolve(this.mkdirSync(dirPath));
74
+ }
75
+ /**
61
76
  * Asynchronously removes a key from the storage.
62
77
  *
63
78
  * @param key - The key to remove.
@@ -106,6 +121,42 @@ var BaseStorageAdapter = class {
106
121
  return this.listSync(base);
107
122
  }
108
123
  /**
124
+ * Synchronously checks if the given key is a directory.
125
+ *
126
+ * @param _ - The key to check.
127
+ * @returns `true` if the key is a directory, otherwise `false`.
128
+ */
129
+ isDirectorySync(_) {
130
+ return false;
131
+ }
132
+ /**
133
+ * Checks if the given key is a directory.
134
+ *
135
+ * @param key - The key to check.
136
+ * @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
137
+ */
138
+ async isDirectory(key) {
139
+ return Promise.resolve(this.isDirectorySync(key));
140
+ }
141
+ /**
142
+ * Synchronously checks if the given key is a file.
143
+ *
144
+ * @param key - The key to check.
145
+ * @returns `true` if the key is a file, otherwise `false`.
146
+ */
147
+ isFileSync(key) {
148
+ return this.existsSync(key) && !this.isDirectorySync(key);
149
+ }
150
+ /**
151
+ * Checks if the given key is a file.
152
+ *
153
+ * @param key - The key to check.
154
+ * @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
155
+ */
156
+ async isFile(key) {
157
+ return Promise.resolve(this.isFileSync(key));
158
+ }
159
+ /**
109
160
  * Disposes of the storage adapter, releasing any held resources.
110
161
  *
111
162
  * @returns A promise that resolves when the disposal is complete.
@@ -147,3 +198,5 @@ var BaseStorageAdapter = class {
147
198
  };
148
199
 
149
200
  export { BaseStorageAdapter };
201
+ //# sourceMappingURL=chunk-CTMPQSK7.js.map
202
+ //# sourceMappingURL=chunk-CTMPQSK7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/fs/storage/base.ts"],"names":["BaseStorageAdapter","options","base","resolve","isReadOnly","exists","key","existsSync","get","getSync","set","value","setSync","mkdirSync","_","mkdir","dirPath","Promise","remove","removeSync","clearSync","keys","listSync","length","map","startsWith","joinPaths","clear","list","all","isDirectorySync","isDirectory","isFileSync","isFile","dispose","Symbol","asyncDispose","_dispose","test","Error","name","JSON","stringify","appendPath","correctPath","replace"],"mappings":";;;;;;AAkCO,IAAeA,qBAAf,MAAeA;EAlCtB;;;;;;EAwCE,WAAA,GAAc,KAAA;;;;AAUPC,EAAAA,OAAAA;;;;;;AAOP,EAAA,WAAA,CAAmBA,OAAAA,GAAoB;IAAEC,IAAAA,EAAM;GAAI,EAAe;AAChE,IAAA,IAAA,CAAKD,OAAAA,GAAUA,OAAAA;AACf,IAAA,IAAA,CAAKA,OAAAA,CAAQC,IAAAA,GAAOC,OAAAA,CAAQF,OAAAA,CAAQC,IAAI,CAAA;AACxC,IAAA,IAAA,CAAKD,OAAAA,CAAQG,UAAAA,GAAa,CAAC,CAACH,OAAAA,CAAQG,UAAAA;AACtC,EAAA;;;;;;;AAgBA,EAAA,MAAaC,OAAOC,GAAAA,EAA+B;AACjD,IAAA,OAAO,IAAA,CAAKC,WAAWD,GAAAA,CAAAA;AACzB,EAAA;;;;;;;AAgBA,EAAA,MAAaE,IAAIF,GAAAA,EAAqC;AACpD,IAAA,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4B,OAAAA,GAA8B;AACnC,IAAA,OAAOjB,QAAQd,OAAAA,EAAO;AACxB,EAAA;;;;;;EAOA,OAAcgC,MAAAA,CAAOC,YAAY,CAAA,GAAI;AACnC,IAAA,OAAO,KAAKC,QAAAA,EAAQ;AACtB,EAAA;;;;;;;EAQUlC,OAAAA,CAAQG,GAAAA,GAAc,IAAA,CAAKL,OAAAA,CAAQC,IAAAA,EAAM;AACjD,IAAA,IAAI,aAAA,CAAcoC,IAAAA,CAAKhC,GAAAA,CAAAA,EAAM;AAC3B,MAAA,MAAM,IAAIiC,KAAAA,CACR,CAAA,CAAA,EAAI,IAAA,CAAKC,IAAI,mBAAmBC,IAAAA,CAAKC,SAAAA,CAAUpC,GAAAA,CAAAA,CAAAA,6BAAAA,CAAmC,CAAA;AAEtF,IAAA;AAEA,IAAA,OAAOqC,UAAAA,CAAWC,WAAAA,CAAYtC,GAAAA,CAAAA,CAAKuC,OAAAA,CAAQ,MAAM,GAAA,CAAA,EAAM,IAAA,CAAK5C,OAAAA,CAAQC,IAAI,CAAA;AAC1E,EAAA;;;;;;AAOA,EAAA,MAAgBmC,QAAAA,GAA0B;AACxC,IAAA,IAAI,CAAC,KAAK,WAAA,EAAa;AACrB,MAAA,MAAMpB,OAAAA,CAAQd,OAAAA,CAAQ,IAAA,CAAK+B,OAAAA,EAAO,CAAA;AAClC,MAAA,IAAA,CAAK,WAAA,GAAc,IAAA;AACrB,IAAA;AACF,EAAA;AACF","file":"chunk-CTMPQSK7.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { appendPath } from \"@stryke/path/append\";\nimport { correctPath } from \"@stryke/path/correct-path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport { resolve } from \"node:path\";\nimport { StorageAdapter } from \"../../../types/fs\";\n\nexport interface StorageAdapterOptions {\n base: string;\n isReadOnly?: boolean;\n ignore?: string | string[];\n}\n\n/**\n * Abstract base class for storage adapters, providing a template for storage operations.\n */\nexport abstract class BaseStorageAdapter<\n TOptions extends StorageAdapterOptions = StorageAdapterOptions\n> implements StorageAdapter {\n /**\n * Indicates whether the storage adapter has been disposed.\n */\n #isDisposed = false;\n\n /**\n * A name identifying the storage adapter type.\n */\n public abstract name: string;\n\n /**\n * Configuration options for the storage adapter.\n */\n public options: TOptions;\n\n /**\n * Constructor for the BaseStorageAdapter.\n *\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(options: TOptions = { base: \"/\" } as TOptions) {\n this.options = options;\n this.options.base = resolve(options.base);\n this.options.isReadOnly = !!options.isReadOnly;\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public abstract existsSync(key: string): boolean;\n\n /**\n * Asynchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns A promise that resolves to `true` if the key exists, otherwise `false`.\n */\n public async exists(key: string): Promise<boolean> {\n return this.existsSync(key);\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public abstract getSync(key: string): string | null;\n\n /**\n * Asynchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.\n */\n public async get(key: string): Promise<string | null> {\n return this.getSync(key);\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public abstract setSync(key: string, value: string): void;\n\n /**\n * Asynchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public async set(key: string, value: string): Promise<void> {\n if (!this.options.isReadOnly) {\n this.setSync(key, value);\n }\n }\n\n /**\n * Synchronously creates a directory at the specified path.\n *\n * @param _ - The path of the directory to create.\n */\n public mkdirSync(_: string) {}\n\n /**\n * Creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public async mkdir(dirPath: string): Promise<void> {\n return Promise.resolve(this.mkdirSync(dirPath));\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public abstract removeSync(key: string): void;\n\n /**\n * Asynchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public async remove(key: string): Promise<void> {\n if (!this.options.isReadOnly) {\n this.removeSync(key);\n }\n }\n\n /**\n * Synchronously removes all entries from the storage that match the provided base path.\n *\n * @param base - The base path to clear keys from.\n */\n public clearSync(base?: string) {\n if (!this.options.isReadOnly) {\n const keys = this.listSync(base || this.options.base);\n if (!keys.length) {\n return;\n }\n\n keys.map(key =>\n this.removeSync(\n base && !key.startsWith(base) ? joinPaths(base, key) : key\n )\n );\n }\n }\n\n /**\n * Asynchronously removes all entries from the storage that match the provided base path.\n *\n * @param base - The base path to clear keys from.\n * @returns A promise that resolves when the operation is complete.\n */\n public async clear(base?: string): Promise<void> {\n if (!this.options.isReadOnly) {\n const keys = await this.list(base || this.options.base);\n if (!keys.length) {\n return;\n }\n\n await Promise.all(\n keys.map(async key =>\n this.remove(\n base && !key.startsWith(base) ? joinPaths(base, key) : key\n )\n )\n );\n }\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public abstract listSync(base?: string): string[];\n\n /**\n * Asynchronously lists all keys under a given base path.\n *\n * @param base - The base path to list keys from.\n * @returns A promise that resolves to an array of keys under the specified base path.\n */\n public async list(base?: string): Promise<string[]> {\n return this.listSync(base);\n }\n\n /**\n * Synchronously checks if the given key is a directory.\n *\n * @param _ - The key to check.\n * @returns `true` if the key is a directory, otherwise `false`.\n */\n public isDirectorySync(_: string): boolean {\n return false;\n }\n\n /**\n * Checks if the given key is a directory.\n *\n * @param key - The key to check.\n * @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.\n */\n public async isDirectory(key: string) {\n return Promise.resolve(this.isDirectorySync(key));\n }\n\n /**\n * Synchronously checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a file, otherwise `false`.\n */\n public isFileSync(key: string): boolean {\n return this.existsSync(key) && !this.isDirectorySync(key);\n }\n\n /**\n * Checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns A promise that resolves to `true` if the key is a file, otherwise `false`.\n */\n public async isFile(key: string) {\n return Promise.resolve(this.isFileSync(key));\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n public dispose(): MaybePromise<void> {\n return Promise.resolve();\n }\n\n /**\n * Async dispose method to clean up resources.\n *\n * @returns A promise that resolves when disposal is complete.\n */\n public async [Symbol.asyncDispose]() {\n return this._dispose();\n }\n\n /**\n * Resolves a given key to its full path within the storage adapter.\n *\n * @param key - The key to resolve.\n * @returns The resolved full path for the key.\n */\n protected resolve(key: string = this.options.base) {\n if (/\\.\\.:|\\.\\.$/.test(key)) {\n throw new Error(\n `[${this.name}]: Invalid key: ${JSON.stringify(key)} provided to storage adapter.`\n );\n }\n\n return appendPath(correctPath(key).replace(/:/g, \"/\"), this.options.base);\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n protected async _dispose(): Promise<void> {\n if (!this.#isDisposed) {\n await Promise.resolve(this.dispose());\n this.#isDisposed = true;\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { __name } from './chunk-SHUYVCID.js';
1
+ import { __name } from './chunk-7QVYU63E.js';
2
2
  import { readFileIfExistingSync } from '@stryke/fs/read-file';
3
3
  import { isSetObject } from '@stryke/type-checks/is-set-object';
4
4
  import { isString } from '@stryke/type-checks/is-string';
@@ -35,3 +35,5 @@ function getSourceFile(code, id) {
35
35
  __name(getSourceFile, "getSourceFile");
36
36
 
37
37
  export { getMagicString, getSourceFile, getString };
38
+ //# sourceMappingURL=chunk-D55ZAZCX.js.map
39
+ //# sourceMappingURL=chunk-D55ZAZCX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utilities/source-file.ts"],"names":["getString","code","isString","isSetObject","toString","getMagicString","MagicString","getSourceFile","id","content","readFileIfExistingSync","env"],"mappings":";;;;;;AA+BO,SAASA,UACdC,IAAAA,EAA4C;AAE5C,EAAA,IAAI,CAACA,IAAAA,EAAM;AACT,IAAA,OAAO,EAAA;AACT,EAAA;AAEA,EAAA,IAAIC,QAAAA,CAASD,IAAAA,CAAAA,EAAO;AAClB,IAAA,OAAOA,IAAAA;AACT,EAAA;AAEA,EAAA,IAAIE,WAAAA,CAAYF,IAAAA,CAAAA,IAAS,MAAA,IAAUA,IAAAA,EAAM;AACvC,IAAA,OAAOA,IAAAA,CAAKA,IAAAA;AACd,EAAA;AAEA,EAAA,OAAOA,KAAKG,QAAAA,EAAQ;AACtB;AAhBgBJ,MAAAA,CAAAA,SAAAA,EAAAA,WAAAA,CAAAA;AAwBT,SAASK,eAAeJ,IAAAA,EAA0B;AACvD,EAAA,IAAIC,QAAAA,CAASD,IAAAA,CAAAA,EAAO;AAClB,IAAA,OAAO,IAAIK,YAAYL,IAAAA,CAAAA;AACzB,EAAA;AAEA,EAAA,OAAOA,IAAAA;AACT;AANgBI,MAAAA,CAAAA,cAAAA,EAAAA,gBAAAA,CAAAA;AAeT,SAASE,aAAAA,CACdN,MACAO,EAAAA,EAAU;AAEV,EAAA,MAAMC,OAAAA,GAAUR,IAAAA,IAAQS,sBAAAA,CAAuBF,EAAAA,CAAAA;AAE/C,EAAA,OAAO;AACLA,IAAAA,EAAAA;AACAP,IAAAA,IAAAA,EAAMI,eAAeI,OAAAA,CAAAA;AACrBE,IAAAA,GAAAA,EAAK;AACP,GAAA;AACF;AAXgBJ,MAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"chunk-D55ZAZCX.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { readFileIfExistingSync } from \"@stryke/fs/read-file\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport MagicString from \"magic-string\";\nimport { TransformResult } from \"unplugin\";\nimport { SourceFile } from \"../../types/context\";\n\n/**\n * Get the string from the source.\n *\n * @param code - The source string or magic string.\n * @returns The source string.\n */\nexport function getString(\n code: string | MagicString | TransformResult\n): string {\n if (!code) {\n return \"\";\n }\n\n if (isString(code)) {\n return code;\n }\n\n if (isSetObject(code) && \"code\" in code) {\n return code.code;\n }\n\n return code.toString();\n}\n\n/**\n * Get the magic string.\n *\n * @param code - The source string or magic string.\n * @returns The magic string.\n */\nexport function getMagicString(code: string | MagicString): MagicString {\n if (isString(code)) {\n return new MagicString(code);\n }\n\n return code;\n}\n\n/**\n * Get the source file.\n *\n * @param code - The source code.\n * @param id - The name of the file.\n * @returns The source file.\n */\nexport function getSourceFile(\n code: string | MagicString,\n id: string\n): SourceFile {\n const content = code ?? readFileIfExistingSync(id);\n\n return {\n id,\n code: getMagicString(content),\n env: []\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { resolveEntryInputFile, resolveEntryOutput } from './chunk-DYGQQI74.js';
2
- import { __name } from './chunk-SHUYVCID.js';
1
+ import { resolveEntryInputFile, resolveEntryOutput } from './chunk-KLU5DWCZ.js';
2
+ import { __name } from './chunk-7QVYU63E.js';
3
3
  import { omit } from '@stryke/helpers/omit';
4
4
  import { joinPaths } from '@stryke/path/join-paths';
5
5
  import { replacePath, replaceExtension } from '@stryke/path/replace';
@@ -123,3 +123,5 @@ export { ${key} };`;
123
123
  __name(extractESBuildConfig, "extractESBuildConfig");
124
124
 
125
125
  export { DEFAULT_ESBUILD_CONFIG, extractESBuildConfig, resolveESBuildEntry };
126
+ //# sourceMappingURL=chunk-D5IEZABI.js.map
127
+ //# sourceMappingURL=chunk-D5IEZABI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/build/esbuild.ts"],"names":["DEFAULT_ESBUILD_CONFIG","target","platform","format","write","minify","sourcemap","bundle","treeShaking","keepNames","splitting","logLevel","resolveESBuildEntry","context","entryPoints","reduce","ret","entry","isString","replaceExtension","replacePath","config","sourceRoot","projectRoot","output","resolveEntryOutput","input","resolveEntryInputFile","extractESBuildConfig","inject","build","override","Object","keys","length","fs","writeSync","joinPaths","workspaceConfig","workspaceRoot","artifactsPath","entries","map","key","value","Array","isArray","camelCase","join","defu","alias","builtins","id","path","ids","find","toString","replacement","undefined","variant","omit","mainFields","conditions","define","resolveExtensions","extensions","packages","skipNodeModulesBundle","Boolean","treeshake","outdir","buildPath","tsconfig","tsconfigFilePath","tsconfigRaw","tsconfigJson","mode","metafile"],"mappings":";;;;;;;;;AAuFO,IAAMA,sBAAAA,GAA8D;EACzEC,MAAAA,EAAQ,QAAA;EACRC,QAAAA,EAAU,SAAA;EACVC,MAAAA,EAAQ,KAAA;EACRC,KAAAA,EAAO,IAAA;EACPC,MAAAA,EAAQ,IAAA;EACRC,SAAAA,EAAW,KAAA;EACXC,MAAAA,EAAQ,IAAA;EACRC,WAAAA,EAAa,IAAA;EACbC,SA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MAAAA,EAAQzD,OAAAA,CAAQQ,OAAOG,MAAAA,CAAO+C,SAAAA;AAC9BC,IAAAA,QAAAA,EAAU3D,QAAQ2D,QAAAA,CAASC,gBAAAA;AAC3BC,IAAAA,WAAAA,EAAa7D,QAAQ2D,QAAAA,CAASG,YAAAA;IAC9BtE,MAAAA,EAAQQ,OAAAA,CAAQQ,OAAOuD,IAAAA,KAAS,aAAA;IAChCC,QAAAA,EAAUhE,OAAAA,CAAQQ,OAAOuD,IAAAA,KAAS,aAAA;IAClCtE,SAAAA,EAAWO,OAAAA,CAAQQ,OAAOuD,IAAAA,KAAS;AACrC,GAAA,EACA5E,sBAAAA,CAAAA;AAEJ;AA3IgB4B,MAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA","file":"chunk-D5IEZABI.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { omit } from \"@stryke/helpers/omit\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { BuildOptions, Format, LogLevel, Platform } from \"esbuild\";\nimport {\n ESBuildBuildConfig,\n ESBuildResolvedBuildConfig,\n TsupBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport type { ResolvedEntryTypeDefinition } from \"../../types/resolved\";\nimport { resolveEntryInputFile, resolveEntryOutput } from \"../entry\";\n\n// const resolverPlugin = (\n// context: Context,\n// options: Pick<\n// BuildResolvedConfig,\n// \"external\" | \"noExternal\" | \"skipNodeModulesBundle\"\n// > = {}\n// ): Plugin => {\n// return {\n// name: \"powerlines:resolver\",\n// setup(build) {\n// const skipNodeModulesBundle =\n// options.skipNodeModulesBundle ??\n// context.config.build.skipNodeModulesBundle;\n// const external = options.external ?? context.config.build.external ?? [];\n// const noExternal =\n// options.noExternal ?? context.config.build.noExternal ?? [];\n// const resolvePatterns = skipNodeModulesBundle\n// ? tsconfigPathsToRegExp(context.tsconfig.options.paths ?? [])\n// : [];\n\n// const handle = async (args: OnResolveArgs) => {\n// const result = await handleResolveId(\n// context,\n// {\n// id: args.path,\n// importer: args.importer,\n// options: {\n// isEntry: false\n// }\n// },\n// {\n// skipNodeModulesBundle,\n// external,\n// noExternal,\n// resolvePatterns\n// }\n// );\n// if (!result) {\n// return;\n// }\n\n// return {\n// path: result?.id,\n// external: result?.external\n// };\n// };\n\n// build.onResolve({ filter: /.*/ }, handle);\n// build.onResolve({ filter: /^storm:/ }, handle);\n// }\n// };\n// };\n\nexport const DEFAULT_ESBUILD_CONFIG: Partial<ESBuildResolvedBuildConfig> = {\n target: \"esnext\",\n platform: \"neutral\" as Platform,\n format: \"esm\" as Format,\n write: true,\n minify: true,\n sourcemap: false,\n bundle: true,\n treeShaking: true,\n keepNames: true,\n splitting: true,\n logLevel: \"silent\" as LogLevel\n};\n\n/**\n * Resolves the entry options for esbuild.\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveESBuildEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[] = []\n): ESBuildResolvedBuildConfig[\"entryPoints\"] {\n return entryPoints.reduce(\n (ret, entry) => {\n if (isString(entry)) {\n ret[\n replaceExtension(\n replacePath(\n entry,\n context.config.sourceRoot || context.config.projectRoot\n )\n )\n ] = replacePath(\n entry,\n context.config.sourceRoot || context.config.projectRoot\n );\n } else {\n ret[entry.output || resolveEntryOutput(context, entry.input || entry)] =\n resolveEntryInputFile(context, entry.input || entry);\n }\n\n return ret;\n },\n {} as Record<string, string>\n );\n}\n\n/**\n * Resolves the esbuild options.\n *\n * @param context - The build context.\n * @returns The resolved esbuild options.\n */\nexport function extractESBuildConfig(context: Context): BuildOptions {\n const inject =\n context.config.build.override.inject ?? context.config.build.inject;\n if (inject && Object.keys(inject).length > 0) {\n context.fs.writeSync(\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n context.artifactsPath,\n \"inject-shim.js\"\n ),\n Object.entries(inject)\n .map(([key, value]) => {\n if (value) {\n if (Array.isArray(value)) {\n if (camelCase(key) !== key) {\n if (value.length === 1) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n }\n } else if (value.length === 1) {\n return `\nimport ${key} from \"${value[0]}\";\nexport { ${key} };`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from \"${value[0]}\";\nexport { ${key} };`;\n }\n } else if (camelCase(key) !== key) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else {\n return `\nimport ${key} from \"${value}\";\nexport { ${key} };`;\n }\n }\n\n return \"\";\n })\n .join(\"\\n\")\n );\n }\n\n return defu(\n {\n alias: context.builtins.reduce(\n (ret, id) => {\n if (!ret[id]) {\n const path = context.fs.ids[id];\n if (path) {\n ret[id] = path;\n }\n }\n\n return ret;\n },\n context.config.build.alias\n ? Array.isArray(context.config.build.alias)\n ? context.config.build.alias.reduce(\n (ret, alias) => {\n if (!ret[alias.find.toString()]) {\n ret[alias.find.toString()] = alias.replacement;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n : context.config.build.alias\n : {}\n ),\n inject:\n inject && Object.keys(inject).length > 0\n ? [\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n context.artifactsPath,\n \"inject-shim.js\"\n )\n ]\n : undefined\n },\n context.config.build.variant === \"esbuild\"\n ? (omit(context.config.build.override, [\n \"alias\",\n \"inject\",\n \"external\",\n \"noExternal\",\n \"skipNodeModulesBundle\",\n \"extensions\"\n ]) as BuildOptions)\n : {},\n context.config.build.variant === \"esbuild\"\n ? (omit(context.config.build, [\n \"alias\",\n \"inject\",\n \"external\",\n \"noExternal\",\n \"skipNodeModulesBundle\",\n \"extensions\",\n \"variant\",\n \"override\"\n ]) as BuildOptions)\n : {},\n {\n mainFields: context.config.build.mainFields,\n conditions: context.config.build.conditions,\n define: context.config.build.define,\n resolveExtensions: context.config.build.extensions,\n packages: context.config.build.skipNodeModulesBundle\n ? \"external\"\n : context.config.build.variant === \"esbuild\"\n ? (context.config.build as ESBuildBuildConfig).packages\n : undefined,\n format: (Array.isArray(context.config.output.format)\n ? context.config.output.format[0]\n : context.config.output.format) as Format,\n platform: context.config.build.platform,\n treeShaking:\n Boolean((context.config.build as TsupBuildConfig)?.treeshake) ||\n (context.config.build as ESBuildBuildConfig)?.treeShaking,\n outdir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson,\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_ESBUILD_CONFIG\n ) as BuildOptions;\n}\n"]}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=chunk-DQJCGJ5P.js.map
3
+ //# sourceMappingURL=chunk-DQJCGJ5P.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-DQJCGJ5P.js"}
@@ -1,9 +1,14 @@
1
- import { __name } from './chunk-SHUYVCID.js';
1
+ import { __name } from './chunk-7QVYU63E.js';
2
+ import { toArray } from '@stryke/convert/to-array';
3
+ import { getUnique } from '@stryke/helpers/get-unique';
2
4
  import { correctPath } from '@stryke/path/correct-path';
3
5
  import { findFileDotExtensionSafe } from '@stryke/path/file-path-fns';
4
6
  import { isAbsolutePath } from '@stryke/path/is-type';
7
+ import { joinPaths } from '@stryke/path/join';
5
8
  import { slash } from '@stryke/path/slash';
6
9
  import { isError } from '@stryke/type-checks/is-error';
10
+ import { isSetObject } from '@stryke/type-checks/is-set-object';
11
+ import { isSetString } from '@stryke/type-checks/is-set-string';
7
12
 
8
13
  function isFileError(err) {
9
14
  return isError(err) && "code" in err && err.code;
@@ -52,5 +57,18 @@ function filterKeyByBase(key, base) {
52
57
  return key[key.length - 1] !== "$";
53
58
  }
54
59
  __name(filterKeyByBase, "filterKeyByBase");
60
+ function normalizeGlobPatterns(workspaceRoot, patterns) {
61
+ return getUnique(toArray(patterns).map((pattern) => {
62
+ if (isSetObject(pattern) && (isSetString(pattern.input) || isSetString(pattern.glob))) {
63
+ return joinPaths(pattern.input || workspaceRoot, pattern.glob || "**/*");
64
+ } else if (!isSetString(pattern)) {
65
+ return void 0;
66
+ }
67
+ return pattern;
68
+ }).filter(isSetString));
69
+ }
70
+ __name(normalizeGlobPatterns, "normalizeGlobPatterns");
55
71
 
56
- export { filterKeyByBase, ignoreExists, ignoreNotfound, isFileError, isValidId, normalizeBaseKey, normalizeId, normalizeKey, normalizePath, toFilePath };
72
+ export { filterKeyByBase, ignoreExists, ignoreNotfound, isFileError, isValidId, normalizeBaseKey, normalizeGlobPatterns, normalizeId, normalizeKey, normalizePath, toFilePath };
73
+ //# sourceMappingURL=chunk-EBBGE5FN.js.map
74
+ //# sourceMappingURL=chunk-EBBGE5FN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/fs/helpers.ts"],"names":["isFileError","err","isError","code","ignoreNotfound","ignoreExists","toFilePath","path","correctPath","slash","toString","replace","isValidId","id","prefix","startsWith","normalizeId","RegExp","findFileDotExtensionSafe","normalizePath","builtinsPath","isAbsolutePath","normalizeKey","key","sep","normalizeBaseKey","base","filterKeyByBase","length","normalizeGlobPatterns","workspaceRoot","patterns","getUnique","toArray","map","pattern","isSetObject","isSetString","input","glob","joinPaths","undefined","filter"],"mappings":";;;;;;;;;;;;AAqCO,SAASA,YAAYC,GAAAA,EAAQ;AAClC,EAAA,OAAOC,OAAAA,CAAQD,GAAAA,CAAAA,IAAQ,MAAA,IAAUA,OAAOA,GAAAA,CAAIE,IAAAA;AAC9C;AAFgBH,MAAAA,CAAAA,WAAAA,EAAAA,aAAAA,CAAAA;AAUT,SAASI,eAAeH,GAAAA,EAAQ;AACrC,EAAA,OACED,WAAAA,CAAYC,GAAAA,CAAAA,KACXA,GAAAA,CAAIE,SAAS,QAAA,IAAYF,GAAAA,CAAIE,IAAAA,KAAS,QAAA,GAAW,IAAA,GAAOF,GAAAA,CAAAA;AAE7D;AALgBG,MAAAA,CAAAA,cAAAA,EAAAA,gBAAAA,CAAAA;AAaT,SAASC,aAAaJ,GAAAA,EAAQ;AACnC,EAAA,OAAOD,YAAYC,GAAAA,CAAAA,IAAQA,GAAAA,CAAIE,IAAAA,KAAS,WAAW,IAAA,GAAOF,GAAAA;AAC5D;AAFgBI,MAAAA,CAAAA,YAAAA,EAAAA,cAAAA,CAAAA;AAIT,SAASC,WAAWC,IAAAA,EAA0B;AACnD,EAAA,OAAOC,WAAAA,CAAYC,KAAAA,CAAMF,IAAAA,EAAMG,QAAAA,EAAAA,IAAc,GAAA,CAAA,CAAKC,OAAAA,CAAQ,YAAA,EAAc,EAAA,CAAA,CAAA;AAC1E;AAFgBL,MAAAA,CAAAA,UAAAA,EAAAA,YAAAA,CAAAA;AAWT,SAASM,SAAAA,CAAUC,EAAAA,EAAYC,MAAAA,GAAS,YAAA,EAAY;AACzD,EAAA,OAAOD,EAAAA,CAAGF,OAAAA,CAAQ,MAAA,EAAQ,EAAA,C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QG,KAAAA,IAASR,aAAAA,EACjBK,OAAAA,CAAQI,QAAQ,MAAA,CAAA;IAEpB,CAAA,MAAA,IAAW,CAACF,WAAAA,CAAYF,OAAAA,CAAAA,EAAU;AAChC,MAAA,OAAOM,MAAAA;AACT,IAAA;AAEA,IAAA,OAAON,OAAAA;EACT,CAAA,CAAA,CACCO,MAAAA,CAAOL,WAAAA,CAAAA,CAAAA;AAEd;AA1BgBR,MAAAA,CAAAA,qBAAAA,EAAAA,uBAAAA,CAAAA","file":"chunk-EBBGE5FN.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { correctPath } from \"@stryke/path/correct-path\";\nimport { findFileDotExtensionSafe } from \"@stryke/path/file-path-fns\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { slash } from \"@stryke/path/slash\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { AssetGlob } from \"@stryke/types/file\";\nimport { PathOrFileDescriptor } from \"node:fs\";\n\n/**\n * Checks if an error is a file system error.\n *\n * @param err - The error to check.\n * @returns `true` if the error is a file system error, otherwise `false`.\n */\nexport function isFileError(err: any) {\n return isError(err) && \"code\" in err && err.code;\n}\n\n/**\n * Ignores file not found errors.\n *\n * @param err - The error to check.\n * @returns `null` if the error is a file not found error, otherwise returns the error.\n */\nexport function ignoreNotfound(err: any) {\n return (\n isFileError(err) &&\n (err.code === \"ENOENT\" || err.code === \"EISDIR\" ? null : err)\n );\n}\n\n/**\n * Ignores file exists errors.\n *\n * @param err - The error to check.\n * @returns `null` if the error is a file exists error, otherwise returns the error.\n */\nexport function ignoreExists(err: any) {\n return isFileError(err) && err.code === \"EEXIST\" ? null : err;\n}\n\nexport function toFilePath(path: PathOrFileDescriptor): string {\n return correctPath(slash(path?.toString() || \".\").replace(/^file:\\/\\//, \"\"));\n}\n\n/**\n * Checks if a given file id is valid based on the specified prefix.\n *\n * @param id - The file ID to check.\n * @param prefix - The prefix to use for built-in files. Default is \"powerlines\".\n * @returns `true` if the file ID is valid, otherwise `false`.\n */\nexport function isValidId(id: string, prefix = \"powerlines\"): boolean {\n return id.replace(/^\\\\0/, \"\").startsWith(`${prefix.replace(/:$/, \"\")}`);\n}\n\n/**\n * Formats a file id by removing the file extension and prepending the runtime prefix.\n *\n * @param id - The file ID to format.\n * @param prefix - The prefix to use for built-in files. Default is \"powerlines\".\n * @returns The formatted file ID.\n */\nexport function normalizeId(id: string, prefix = \"powerlines\"): string {\n return `${prefix.replace(/:$/, \"\")}:${toFilePath(id)\n .replace(new RegExp(`^${prefix.replace(/:$/, \"\")}:`), \"\")\n .replace(/^\\\\0/, \"\")\n .replace(findFileDotExtensionSafe(toFilePath(id)), \"\")}`;\n}\n\n/**\n * Normalizes a given path by resolving it against the project root, workspace root, and built-ins path.\n *\n * @param path - The path to normalize.\n * @param builtinsPath - The path to built-in files.\n * @param prefix - The prefix to use for built-in files. Default is \"powerlines\".\n * @returns The normalized path.\n */\nexport function normalizePath(\n path: string,\n builtinsPath: string,\n prefix = \"powerlines\"\n): string {\n return isAbsolutePath(path)\n ? path\n : isValidId(toFilePath(path), prefix)\n ? normalizeId(toFilePath(path), prefix).replace(\n new RegExp(`^${prefix.replace(/:$/, \"\")}:`),\n builtinsPath\n )\n : toFilePath(path);\n}\n\n/**\n * Normalizes a storage key by replacing all path separators with the specified separator.\n *\n * @param key - The storage key to normalize.\n * @param sep - The separator to use for normalization. Default is \":\".\n * @returns The normalized storage key.\n */\nexport function normalizeKey(\n key: string | undefined,\n sep: \":\" | \"/\" = \":\"\n): string {\n if (!key) {\n return \"\";\n }\n return key.replace(/[:/\\\\]/g, sep).replace(/^[:/\\\\]|[:/\\\\]$/g, \"\");\n}\n\n/**\n * Normalizes the base key for storage operations.\n *\n * @param base - The base key to normalize.\n * @returns The normalized base key with a trailing colon if not empty.\n */\nexport function normalizeBaseKey(base?: string) {\n base = normalizeKey(base);\n return base ? `${base}:` : \"\";\n}\n\n/**\n * Filters a storage key based on the specified base path.\n *\n * @param key - The storage key to filter.\n * @param base - The base path to filter by.\n * @returns `true` if the key matches the base path criteria, otherwise `false`.\n */\nexport function filterKeyByBase(\n key: string,\n base: string | undefined\n): boolean {\n if (base) {\n return key.startsWith(base) && key[key.length - 1] !== \"$\";\n }\n\n return key[key.length - 1] !== \"$\";\n}\n\n/**\n * Normalizes glob patterns by resolving them against the workspace root.\n *\n * @param workspaceRoot - The root directory of the workspace.\n * @param patterns - The glob patterns to normalize.\n * @returns An array of normalized glob patterns.\n */\nexport function normalizeGlobPatterns(\n workspaceRoot: string,\n patterns:\n | string\n | Omit<AssetGlob, \"output\">\n | (string | Omit<AssetGlob, \"output\">)[]\n): string[] {\n return getUnique(\n toArray(patterns)\n .map(pattern => {\n if (\n isSetObject(pattern) &&\n (isSetString(pattern.input) || isSetString(pattern.glob))\n ) {\n return joinPaths(\n pattern.input || workspaceRoot,\n pattern.glob || \"**/*\"\n );\n } else if (!isSetString(pattern)) {\n return undefined;\n }\n\n return pattern;\n })\n .filter(isSetString)\n );\n}\n"]}
@@ -0,0 +1,112 @@
1
+ 'use strict';
2
+
3
+ var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
4
+ var parseTypeDefinition = require('@stryke/convert/parse-type-definition');
5
+ var toArray = require('@stryke/convert/to-array');
6
+ var omit = require('@stryke/helpers/omit');
7
+ var append = require('@stryke/path/append');
8
+ var replace = require('@stryke/path/replace');
9
+ var defu = require('defu');
10
+
11
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
+
13
+ var defu__default = /*#__PURE__*/_interopDefault(defu);
14
+
15
+ var DEFAULT_TSDOWN_CONFIG = {
16
+ platform: "neutral",
17
+ target: "esnext",
18
+ minify: true,
19
+ sourcemap: false,
20
+ cjsDefault: true,
21
+ dts: {
22
+ parallel: true,
23
+ newContext: true
24
+ },
25
+ shims: true,
26
+ silent: true,
27
+ treeshake: true,
28
+ fixedExtension: true,
29
+ nodeProtocol: false
30
+ };
31
+ function resolveTsdownFormat(formats) {
32
+ return toArray.toArray(formats).map((format) => {
33
+ switch (format) {
34
+ case "cjs":
35
+ return "cjs";
36
+ case "iife":
37
+ return "iife";
38
+ case "esm":
39
+ default:
40
+ return "esm";
41
+ }
42
+ });
43
+ }
44
+ chunkPK6SKIKE_cjs.__name(resolveTsdownFormat, "resolveTsdownFormat");
45
+ function resolveFromTsdownFormat(formats) {
46
+ return toArray.toArray(formats).map((format) => {
47
+ switch (format) {
48
+ case "cjs":
49
+ case "commonjs":
50
+ return "cjs";
51
+ case "iife":
52
+ return "iife";
53
+ case "esm":
54
+ case "es":
55
+ case "module":
56
+ case "umd":
57
+ default:
58
+ return "esm";
59
+ }
60
+ });
61
+ }
62
+ chunkPK6SKIKE_cjs.__name(resolveFromTsdownFormat, "resolveFromTsdownFormat");
63
+ var formatMessage = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((context, message) => message.replace(new RegExp(`\\[${context.config.name}\\]`, "g"), "").trim(), "formatMessage");
64
+ function extractTsdownConfig(context) {
65
+ return defu__default.default({
66
+ entry: toArray.toArray(context.config.entry).map((entry) => {
67
+ const typeDef = parseTypeDefinition.parseTypeDefinition(entry);
68
+ return typeDef?.file;
69
+ }).filter(Boolean),
70
+ alias: context.builtins.reduce((ret, id) => {
71
+ const path = context.fs.ids[id];
72
+ if (path) {
73
+ ret[id] = path;
74
+ }
75
+ return ret;
76
+ }, {}),
77
+ noExternal: context.builtins
78
+ }, context.config.build.variant === "tsdown" ? context.config.build.override : {}, context.config.build.variant === "tsdown" ? omit.omit(context.config.build, [
79
+ "override",
80
+ "variant"
81
+ ]) : {}, {
82
+ name: context.config.name,
83
+ cwd: append.appendPath(context.config.projectRoot, context.workspaceConfig.workspaceRoot),
84
+ outDir: replace.replacePath(append.appendPath(context.config.output.buildPath, context.workspaceConfig.workspaceRoot), append.appendPath(context.config.projectRoot, context.workspaceConfig.workspaceRoot)),
85
+ tsconfig: append.appendPath(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
86
+ format: toArray.toArray(context.config.output.format).map((format) => format === "esm" ? "es" : format).filter(Boolean),
87
+ mode: context.config.mode,
88
+ treeshake: context.config.build.variant === "tsdown" ? context.config.build?.treeshake : context.config.build.variant === "tsup" ? context.config.build?.treeshake : context.config.build.variant === "esbuild" ? context.config.build?.treeShaking : void 0,
89
+ minify: context.config.mode !== "development",
90
+ metafile: context.config.mode === "development",
91
+ sourcemap: context.config.mode === "development",
92
+ debug: context.config.mode === "development",
93
+ silent: context.config.logLevel === null || context.config.mode === "production",
94
+ logLevel: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
95
+ customLogger: {
96
+ level: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
97
+ info: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((message) => formatMessage(context, message).replace(/\s+/g, "").length > 5 && context.info(formatMessage(context, message)), "info"),
98
+ warn: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((message) => formatMessage(context, message).replace(/\s+/g, "").length > 5 && context.warn(formatMessage(context, message)), "warn"),
99
+ warnOnce: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((message) => formatMessage(context, message).replace(/\s+/g, "").length > 5 && context.warn(formatMessage(context, message)), "warnOnce"),
100
+ error: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((message) => formatMessage(context, message).replace(/\s+/g, "").length > 5 && context.error(formatMessage(context, message)), "error"),
101
+ success: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((message) => formatMessage(context, message).replace(/\s+/g, "").length > 5 && context.info(formatMessage(context, message)), "success")
102
+ }
103
+ }, DEFAULT_TSDOWN_CONFIG);
104
+ }
105
+ chunkPK6SKIKE_cjs.__name(extractTsdownConfig, "extractTsdownConfig");
106
+
107
+ exports.DEFAULT_TSDOWN_CONFIG = DEFAULT_TSDOWN_CONFIG;
108
+ exports.extractTsdownConfig = extractTsdownConfig;
109
+ exports.resolveFromTsdownFormat = resolveFromTsdownFormat;
110
+ exports.resolveTsdownFormat = resolveTsdownFormat;
111
+ //# sourceMappingURL=chunk-EXAOCEQF.cjs.map
112
+ //# sourceMappingURL=chunk-EXAOCEQF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/build/tsdown.ts"],"names":["DEFAULT_TSDOWN_CONFIG","platform","target","minify","sourcemap","cjsDefault","dts","parallel","newContext","shims","silent","treeshake","fixedExtension","nodeProtocol","resolveTsdownFormat","formats","toArray","map","format","resolveFromTsdownFormat","formatMessage","__name","context","message","replace","RegExp","config","name","trim","extractTsdownConfig","defu","entry","typeDef","parseTypeDefinition","file","filter","Boolean","alias","builtins","reduce","ret","id","path","fs","ids","noExternal","build","variant","override","omit","cwd","appendPath","projectRoot","workspaceConfig","workspaceRoot","outDir","replacePath","output","buildPath","tsconfig","tsconfigFilePath","mode","treeShaking","undefined","metafile","debug","logLevel","customLogger","level","info","length","warn","warnOnce","error","success"],"mappings":";;;;;;;;;;;;;;AAkCO,IAAMA,qBAAAA,GAA4D;EACvEC,QAAAA,EAAU,SAAA;EACVC,MAAAA,EAAQ,QAAA;EACRC,MAAAA,EAAQ,IAAA;EACRC,SAAAA,EAAW,KAAA;EACXC,UAAAA,EAAY,IAAA;EACZC,GAAAA,EAAK;IACHC,QAAAA,EAAU,IAAA;IACVC,UAA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OAAAA,KACNH,aAAAA,CAAcE,SAASC,OAAAA,CAAAA,CAASC,QAAQ,MAAA,EAAQ,EAAA,CAAA,CAAI8C,MAAAA,GAAS,KAC7DhD,OAAAA,CAAQmD,KAAAA,CAAMrD,cAAcE,OAAAA,EAASC,OAAAA,CAAAA,CAAAA,EAFhC,OAAA,CAAA;AAGPmD,MAAAA,OAAAA,4CAAUnD,OAAAA,KACRH,aAAAA,CAAcE,SAASC,OAAAA,CAAAA,CAASC,QAAQ,MAAA,EAAQ,EAAA,CAAA,CAAI8C,MAAAA,GAAS,KAC7DhD,OAAAA,CAAQ+C,IAAAA,CAAKjD,cAAcE,OAAAA,EAASC,OAAAA,CAAAA,CAAAA,EAF7B,SAAA;AAGX;AACF,GAAA,EACAvB,qBAAAA,CAAAA;AAEJ;AAhGgB6B,wBAAAA,CAAAA,mBAAAA,EAAAA,qBAAAA,CAAAA","file":"chunk-EXAOCEQF.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Format } from \"@storm-software/build-tools/types\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { Format as TsdownFormat } from \"tsdown\";\nimport {\n ESBuildBuildConfig,\n TsdownBuildConfig,\n TsdownResolvedBuildConfig,\n TsupBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\n\nexport const DEFAULT_TSDOWN_CONFIG: Partial<TsdownResolvedBuildConfig> = {\n platform: \"neutral\",\n target: \"esnext\",\n minify: true,\n sourcemap: false,\n cjsDefault: true,\n dts: {\n parallel: true,\n newContext: true\n },\n shims: true,\n silent: true,\n treeshake: true,\n fixedExtension: true,\n nodeProtocol: false\n} as const;\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveTsdownFormat(\n formats?: Format | Format[]\n): TsdownFormat[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n default:\n return \"esm\";\n }\n });\n}\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFromTsdownFormat(\n formats?: TsdownFormat | TsdownFormat[]\n): Format[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n case \"commonjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n case \"es\":\n case \"module\":\n case \"umd\":\n default:\n return \"esm\";\n }\n });\n}\n\nconst formatMessage = (context: Context, message: string) =>\n message.replace(new RegExp(`\\\\[${context.config.name}\\\\]`, \"g\"), \"\").trim();\n\n/**\n * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function extractTsdownConfig(\n context: Context\n): TsdownResolvedBuildConfig {\n return defu(\n {\n entry: toArray(context.config.entry)\n .map(entry => {\n const typeDef = parseTypeDefinition(entry);\n\n return typeDef?.file;\n })\n .filter(Boolean) as string[],\n alias: context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.ids[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n ),\n noExternal: context.builtins\n },\n context.config.build.variant === \"tsdown\"\n ? context.config.build.override\n : {},\n context.config.build.variant === \"tsdown\"\n ? omit(context.config.build, [\"override\", \"variant\"])\n : {},\n {\n name: context.config.name,\n cwd: appendPath(\n context.config.projectRoot,\n context.workspaceConfig.workspaceRoot\n ),\n outDir: replacePath(\n appendPath(\n context.config.output.buildPath,\n context.workspaceConfig.workspaceRoot\n ),\n appendPath(\n context.config.projectRoot,\n context.workspaceConfig.workspaceRoot\n )\n ),\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.workspaceConfig.workspaceRoot\n ),\n format: toArray(context.config.output.format)\n .map(format => (format === \"esm\" ? \"es\" : format))\n .filter(Boolean) as TsdownFormat[],\n mode: context.config.mode,\n treeshake:\n context.config.build.variant === \"tsdown\"\n ? (context.config.build as TsdownBuildConfig)?.treeshake\n : context.config.build.variant === \"tsup\"\n ? (context.config.build as TsupBuildConfig)?.treeshake\n : context.config.build.variant === \"esbuild\"\n ? (context.config.build as ESBuildBuildConfig)?.treeShaking\n : undefined,\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n debug: context.config.mode === \"development\",\n silent:\n context.config.logLevel === null ||\n context.config.mode === \"production\",\n logLevel:\n context.config.logLevel === \"trace\" ? \"debug\" : context.config.logLevel,\n customLogger: {\n level:\n context.config.logLevel === \"trace\"\n ? \"debug\"\n : context.config.logLevel,\n info: (message: string) =>\n formatMessage(context, message).replace(/\\s+/g, \"\").length > 5 &&\n context.info(formatMessage(context, message)),\n warn: (message: string) =>\n formatMessage(context, message).replace(/\\s+/g, \"\").length > 5 &&\n context.warn(formatMessage(context, message)),\n warnOnce: (message: string) =>\n formatMessage(context, message).replace(/\\s+/g, \"\").length > 5 &&\n context.warn(formatMessage(context, message)),\n error: (message: string) =>\n formatMessage(context, message).replace(/\\s+/g, \"\").length > 5 &&\n context.error(formatMessage(context, message)),\n success: (message: string) =>\n formatMessage(context, message).replace(/\\s+/g, \"\").length > 5 &&\n context.info(formatMessage(context, message))\n }\n } as TsdownResolvedBuildConfig,\n DEFAULT_TSDOWN_CONFIG\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { __name } from './chunk-SHUYVCID.js';
1
+ import { __name } from './chunk-7QVYU63E.js';
2
2
  import { replacePath } from '@stryke/path/replace';
3
3
 
4
4
  function replacePathTokens(context, path) {
@@ -10,3 +10,5 @@ function replacePathTokens(context, path) {
10
10
  __name(replacePathTokens, "replacePathTokens");
11
11
 
12
12
  export { replacePathTokens };
13
+ //# sourceMappingURL=chunk-FFATMOAQ.js.map
14
+ //# sourceMappingURL=chunk-FFATMOAQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/plugin-utils/paths.ts"],"names":["replacePathTokens","context","path","replaceAll","workspaceConfig","workspaceRoot","config","projectRoot","sourceRoot","powerlinesPath","cachePath","dataPath","envPaths","log","temp","output","outputPath","buildPath","replacePath","artifactsPath","builtinsPath","entryPath"],"mappings":";;;AA+CO,SAASA,iBAAAA,CACdC,SACAC,IAAAA,EAAa;AAEb,EAAA,IAAI,CAACA,IAAAA,EAAM;AACT,IAAA,OAAOA,IAAAA;AACT,EAAA;AAEA,EAAA,OAAOA,IAAAA,CACJC,WAAW,iBAAA,EAAmBF,OAAAA,CAAQG,gBAAgBC,aAAa,CAAA,CACnEF,UAAAA,CAAW,QAAA,EAAUF,OAAAA,CAAQK,MAAAA,CAAOC,WAAW,CAAA,CAC/CJ,UAAAA,CAAW,iBAAiBF,OAAAA,CAAQK,MAAAA,CAAOC,WAAW,CAAA,CACtDJ,UAAAA,CAAW,cAAA,EAAgBF,OAAAA,CAAQK,MAAAA,CAAOE,UAAU,EACpDL,UAAAA,CAAW,kBAAA,EAAoBF,QAAQQ,cAAc,CAAA,CACrDN,WAAW,aAAA,EAAeF,OAAAA,CAAQS,SAAS,CAAA,CAC3CP,UAAAA,CAAW,YAAA,EAAcF,QAAQU,QAAQ,CAAA,CACzCR,WAAW,WAAA,EAAaF,OAAAA,CAAQW,SAASC,GAAG,CAAA,CAC5CV,UAAAA,CAAW,YAAA,EAAcF,OAAAA,CAAQW,QAAAA,CAASE,IAAI,CAAA,CAC9CX,UAAAA,CAAW,gBAAgBF,OAAAA,CAAQW,QAAAA,CAASN,MAAM,CAAA,CAClDH,UAAAA,CAAW,cAAA,EAAgBF,OAAAA,CAAQK,MAAAA,CAAOS,MAAAA,CAAOC,UAAU,CAAA,CAC3Db,UAAAA,CAAW,eAAeF,OAAAA,CAAQK,MAAAA,CAAOS,OAAOE,SAAS,CAAA,CACzDd,UAAAA,CACC,iBAAA,EACAe,WAAAA,CAAYjB,OAAAA,CAAQkB,eAAelB,OAAAA,CAAQG,eAAAA,CAAgBC,aAAa,CAAA,CAAA,CAEzEF,WACC,eAAA,EACAe,WAAAA,CAAYjB,OAAAA,CAAQmB,YAAAA,EAAcnB,OAAAA,CAAQG,eAAAA,CAAgBC,aAAa,CAAA,CAAA,CAExEF,WACC,aAAA,EACAe,WAAAA,CAAYjB,QAAQoB,SAAAA,EAAWpB,OAAAA,CAAQG,eAAAA,CAAgBC,aAAa,CAAA,CAAA;AAE1E;AAjCgBL,MAAAA,CAAAA,iBAAAA,EAAAA,mBAAAA,CAAAA","file":"chunk-FFATMOAQ.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { replacePath } from \"@stryke/path/replace\";\nimport { IsUndefined } from \"@stryke/types/base\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Replaces tokens in the given path string with their corresponding values from the context.\n *\n * @remarks\n * The following tokens are supported:\n * - `{workspaceRoot}` - The root directory of the workspace.\n * - `{root}` - The root directory of the project (same as `{projectRoot}`).\n * - `{projectRoot}` - The root directory of the project (same as `{root}`).\n * - `{sourceRoot}` - The source root directory of the project (usually `./src`).\n * - `{powerlinesPath}` - The directory where Powerlines is installed.\n * - `{cachePath}` - The environment's directory for cached files.\n * - `{dataPath}` - The environment's directory for data files.\n * - `{logPath}` - The environment's directory for log files.\n * - `{tempPath}` - The environment's directory for temporary files.\n * - `{configPath}` - The environment's directory for configuration files.\n * - `{outputPath}` - The configured output directory for the project.\n * - `{buildPath}` - The configured distribution directory for the project.\n * - `{artifactsPath}` - The configured directory for build artifacts.\n * - `{builtinPath}` - The configured directory for generated built-in plugins.\n * - `{entryPath}` - The configured directory for generated entry files.\n *\n * @param context - The context containing the values for the path tokens.\n * @param path - The path string with tokens to replace.\n * @returns The path string with tokens replaced by their corresponding values from the context.\n */\nexport function replacePathTokens(\n context: UnresolvedContext,\n path?: string\n): IsUndefined<typeof path> extends true ? undefined : string {\n if (!path) {\n return path as IsUndefined<typeof path> extends true ? undefined : string;\n }\n\n return path\n .replaceAll(\"{workspaceRoot}\", context.workspaceConfig.workspaceRoot)\n .replaceAll(\"{root}\", context.config.projectRoot)\n .replaceAll(\"{projectRoot}\", context.config.projectRoot)\n .replaceAll(\"{sourceRoot}\", context.config.sourceRoot)\n .replaceAll(\"{powerlinesPath}\", context.powerlinesPath)\n .replaceAll(\"{cachePath}\", context.cachePath)\n .replaceAll(\"{dataPath}\", context.dataPath)\n .replaceAll(\"{logPath}\", context.envPaths.log)\n .replaceAll(\"{tempPath}\", context.envPaths.temp)\n .replaceAll(\"{configPath}\", context.envPaths.config)\n .replaceAll(\"{outputPath}\", context.config.output.outputPath)\n .replaceAll(\"{buildPath}\", context.config.output.buildPath)\n .replaceAll(\n \"{artifactsPath}\",\n replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)\n )\n .replaceAll(\n \"{builtinPath}\",\n replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)\n )\n .replaceAll(\n \"{entryPath}\",\n replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { createPluginContext } from './chunk-OL35IC6Z.js';
2
- import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-GSGF6RL2.js';
3
- import { __name } from './chunk-SHUYVCID.js';
1
+ import { createPluginContext } from './chunk-6OGQTUXF.js';
2
+ import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-7CDTHZ3R.js';
3
+ import { __name } from './chunk-7QVYU63E.js';
4
4
  import { resolvePackage } from '@stryke/fs/resolve';
5
5
  import { isFunction } from '@stryke/type-checks/is-function';
6
6
  import { isObject } from '@stryke/type-checks/is-object';
@@ -105,36 +105,90 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
105
105
  * Retrieves the hook handlers for a specific hook name
106
106
  */
107
107
  selectHooks(hook, options) {
108
- const handlers = [];
108
+ const result = [];
109
109
  if (this.hooks[hook]) {
110
110
  if (!isHookExternal(hook)) {
111
111
  const hooks = this.hooks[hook];
112
112
  if (options?.order) {
113
113
  if (options?.order === "pre") {
114
- handlers.push(...(hooks.preOrdered ?? []).map((h) => h.handler));
115
- handlers.push(...(hooks.preEnforced ?? []).map((h) => h.handler));
114
+ result.push(...(hooks.preOrdered ?? []).map((h) => {
115
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
116
+ if (!plugin) {
117
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
118
+ }
119
+ return {
120
+ handle: h.handler,
121
+ context: plugin.context
122
+ };
123
+ }));
124
+ result.push(...(hooks.preEnforced ?? []).map((h) => {
125
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
126
+ if (!plugin) {
127
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
128
+ }
129
+ return {
130
+ handle: h.handler,
131
+ context: plugin.context
132
+ };
133
+ }));
116
134
  } else if (options?.order === "post") {
117
- handlers.push(...(hooks.postOrdered ?? []).map((h) => h.handler));
118
- handlers.push(...(hooks.postEnforced ?? []).map((h) => h.handler));
135
+ result.push(...(hooks.postOrdered ?? []).map((h) => {
136
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
137
+ if (!plugin) {
138
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
139
+ }
140
+ return {
141
+ handle: h.handler,
142
+ context: plugin.context
143
+ };
144
+ }));
145
+ result.push(...(hooks.postEnforced ?? []).map((h) => {
146
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
147
+ if (!plugin) {
148
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
149
+ }
150
+ return {
151
+ handle: h.handler,
152
+ context: plugin.context
153
+ };
154
+ }));
119
155
  } else {
120
- handlers.push(...(hooks.normal ?? []).map((h) => h.handler));
156
+ result.push(...(hooks.normal ?? []).map((h) => {
157
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
158
+ if (!plugin) {
159
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
160
+ }
161
+ return {
162
+ handle: h.handler,
163
+ context: plugin.context
164
+ };
165
+ }));
121
166
  }
122
167
  } else {
123
- handlers.push(...this.selectHooks(hook, {
168
+ result.push(...this.selectHooks(hook, {
124
169
  order: "pre"
125
170
  }));
126
- handlers.push(...this.selectHooks(hook, {
171
+ result.push(...this.selectHooks(hook, {
127
172
  order: "normal"
128
173
  }));
129
- handlers.push(...this.selectHooks(hook, {
174
+ result.push(...this.selectHooks(hook, {
130
175
  order: "post"
131
176
  }));
132
177
  }
133
178
  } else {
134
- handlers.push(...this.hooks[hook].map((h) => h.handler));
179
+ result.push(...this.hooks[hook].map((h) => {
180
+ const plugin = this.plugins.find((p) => p.plugin.name === h.plugin.name);
181
+ if (!plugin) {
182
+ throw new Error(`Could not find plugin context for plugin "${h.plugin.name}".`);
183
+ }
184
+ return {
185
+ handle: h.handler,
186
+ context: plugin.context
187
+ };
188
+ }));
135
189
  }
136
190
  }
137
- return handlers;
191
+ return result;
138
192
  }
139
193
  constructor(config, workspaceConfig) {
140
194
  super(workspaceConfig);
@@ -143,3 +197,5 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
143
197
  };
144
198
 
145
199
  export { PowerlinesEnvironmentContext };
200
+ //# sourceMappingURL=chunk-FHSSBMCC.js.map
201
+ //# sourceMappingURL=chunk-FHSSBMCC.js.map