powerlines 0.24.8 → 0.25.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 (460) hide show
  1. package/dist/{api-C32Buv5_.d.ts → api-BTK8aYwE.d.cts} +1 -1
  2. package/dist/{api-wzd5AREv.d.cts → api-eyrYBmQh.d.ts} +1 -1
  3. package/dist/api.cjs +8 -6
  4. package/dist/api.d.cts +20 -22
  5. package/dist/api.d.ts +20 -22
  6. package/dist/api.js +7 -5
  7. package/dist/astro.cjs +12 -10
  8. package/dist/astro.d.cts +19 -21
  9. package/dist/astro.d.ts +19 -21
  10. package/dist/astro.js +10 -8
  11. package/dist/{chunk-JKBJF3UI.js → chunk-2MYPFASJ.js} +2 -0
  12. package/dist/chunk-2VIXD2XB.js +3 -0
  13. package/dist/{chunk-OB7MYWHE.js → chunk-44PO64SX.js} +4 -2
  14. package/dist/chunk-4JCNAKOE.cjs +4 -0
  15. package/dist/{chunk-QH4TS5V4.cjs → chunk-6MFZ436T.cjs} +978 -1032
  16. package/dist/chunk-6ZGIV2SU.cjs +4 -0
  17. package/dist/chunk-7BZQBW77.cjs +4 -0
  18. package/dist/{chunk-JQCWV4DT.js → chunk-7LKYXMB3.js} +2 -0
  19. package/dist/{chunk-SHUYVCID.js → chunk-7QVYU63E.js} +2 -0
  20. package/dist/chunk-AFJCY3R6.js +3 -0
  21. package/dist/chunk-AXIRZAL7.js +3 -0
  22. package/dist/chunk-BTNHSS2P.cjs +13 -0
  23. package/dist/{chunk-FQXHIKCM.cjs → chunk-C2U4ATHO.cjs} +9 -7
  24. package/dist/chunk-DFLNRC3B.cjs +4 -0
  25. package/dist/chunk-DS7OM4NX.cjs +4 -0
  26. package/dist/{chunk-W5X3ZEZ5.js → chunk-EBXVKPUX.js} +2 -0
  27. package/dist/{chunk-X74SYWFL.cjs → chunk-G2EHTXK6.cjs} +9 -7
  28. package/dist/chunk-GIE6OE3X.js +3 -0
  29. package/dist/chunk-HJW7OH6E.js +3 -0
  30. package/dist/{chunk-MOXO6WJO.js → chunk-HSIMIWOH.js} +3 -1
  31. package/dist/{chunk-5IBA5HC2.cjs → chunk-HTJKPEWU.cjs} +6 -4
  32. package/dist/chunk-IHUNA3MO.cjs +4 -0
  33. package/dist/chunk-JU2HWIWS.js +12 -0
  34. package/dist/{chunk-BCHFSOQ4.js → chunk-LQXE5JHF.js} +906 -957
  35. package/dist/chunk-MBBNZS6K.cjs +16 -0
  36. package/dist/{chunk-3TNZWTLG.js → chunk-NNADGQRN.js} +5 -3
  37. package/dist/chunk-OYASPHNL.js +3 -0
  38. package/dist/chunk-PCCFAZML.js +3 -0
  39. package/dist/{chunk-USNT2KNT.cjs → chunk-PK6SKIKE.cjs} +2 -0
  40. package/dist/{chunk-ETKZMGLN.cjs → chunk-PSTCR335.cjs} +2 -0
  41. package/dist/chunk-Q7EJVZVI.cjs +4 -0
  42. package/dist/{chunk-CJSGAITR.js → chunk-S7MXT5A2.js} +3 -1
  43. package/dist/{chunk-7RWEBVQC.cjs → chunk-SDVEUTY2.cjs} +13 -11
  44. package/dist/{chunk-OLCL34MI.js → chunk-SYDUPBME.js} +6 -4
  45. package/dist/chunk-TLHFXGYV.js +3 -0
  46. package/dist/chunk-TP5MEMLG.cjs +12 -0
  47. package/dist/chunk-VNRXLY2T.js +3 -0
  48. package/dist/chunk-VQCQRLGM.cjs +4 -0
  49. package/dist/chunk-XZO6ZJQP.cjs +4 -0
  50. package/dist/{chunk-XP7OML7S.cjs → chunk-YUX7LOBU.cjs} +2 -0
  51. package/dist/chunk-YZZUOOPS.cjs +4 -0
  52. package/dist/chunk-Z5H7LD6W.js +3 -0
  53. package/dist/{chunk-VBR53KGY.js → chunk-Z5UEYORO.js} +5 -3
  54. package/dist/{chunk-PAMSESZV.cjs → chunk-Z6ARQDHR.cjs} +2 -0
  55. package/dist/config.cjs +5 -3
  56. package/dist/config.d.cts +19 -21
  57. package/dist/config.d.ts +19 -21
  58. package/dist/config.js +4 -2
  59. package/dist/{resolved-CSqGKlA5.d.cts → context-TizkCfOv.d.cts} +848 -849
  60. package/dist/{resolved-BABoCnXm.d.ts → context-jhcT1Vi1.d.ts} +848 -849
  61. package/dist/esbuild.cjs +13 -11
  62. package/dist/esbuild.d.cts +19 -21
  63. package/dist/esbuild.d.ts +19 -21
  64. package/dist/esbuild.js +10 -8
  65. package/dist/farm.cjs +9 -7
  66. package/dist/farm.d.cts +19 -21
  67. package/dist/farm.d.ts +19 -21
  68. package/dist/farm.js +8 -6
  69. package/dist/index.cjs +39 -41
  70. package/dist/index.d.cts +30 -55
  71. package/dist/index.d.ts +30 -55
  72. package/dist/index.js +20 -18
  73. package/dist/lib/{api-CDUN9en8.d.ts → api-CCOhyMZo.d.cts} +1 -1
  74. package/dist/lib/{api-BRMITKt-.d.cts → api-CpJJXdtL.d.ts} +1 -1
  75. package/dist/lib/build/esbuild.cjs +5 -5
  76. package/dist/lib/build/esbuild.d.cts +2 -2
  77. package/dist/lib/build/esbuild.d.ts +2 -2
  78. package/dist/lib/build/esbuild.js +2 -2
  79. package/dist/lib/build/index.cjs +25 -25
  80. package/dist/lib/build/index.d.cts +4 -4
  81. package/dist/lib/build/index.d.ts +4 -4
  82. package/dist/lib/build/index.js +9 -9
  83. package/dist/lib/build/rolldown.cjs +3 -3
  84. package/dist/lib/build/rolldown.d.cts +2 -2
  85. package/dist/lib/build/rolldown.d.ts +2 -2
  86. package/dist/lib/build/rolldown.js +2 -2
  87. package/dist/lib/build/rollup.cjs +3 -3
  88. package/dist/lib/build/rollup.d.cts +2 -2
  89. package/dist/lib/build/rollup.d.ts +2 -2
  90. package/dist/lib/build/rollup.js +1 -1
  91. package/dist/lib/build/rspack.cjs +2 -2
  92. package/dist/lib/build/rspack.d.cts +2 -2
  93. package/dist/lib/build/rspack.d.ts +2 -2
  94. package/dist/lib/build/rspack.js +1 -1
  95. package/dist/lib/build/tsup.cjs +6 -6
  96. package/dist/lib/build/tsup.d.cts +2 -2
  97. package/dist/lib/build/tsup.d.ts +2 -2
  98. package/dist/lib/build/tsup.js +3 -3
  99. package/dist/lib/build/unbuild.cjs +5 -5
  100. package/dist/lib/build/unbuild.d.cts +4 -4
  101. package/dist/lib/build/unbuild.d.ts +4 -4
  102. package/dist/lib/build/unbuild.js +2 -2
  103. package/dist/lib/build/vite.cjs +5 -5
  104. package/dist/lib/build/vite.d.cts +2 -2
  105. package/dist/lib/build/vite.d.ts +2 -2
  106. package/dist/lib/build/vite.js +3 -3
  107. package/dist/lib/build/webpack.cjs +2 -2
  108. package/dist/lib/build/webpack.d.cts +2 -2
  109. package/dist/lib/build/webpack.d.ts +2 -2
  110. package/dist/lib/build/webpack.js +1 -1
  111. package/dist/lib/chunk-3T56KQ7U.cjs +49 -0
  112. package/dist/lib/{chunk-PZLO6FZW.js → chunk-3W53W5J2.js} +2 -2
  113. package/dist/lib/chunk-4W6WV35V.js +108 -0
  114. package/dist/lib/chunk-6OYSDQXE.cjs +139 -0
  115. package/dist/lib/{chunk-EV357RFB.cjs → chunk-7MHUTBEC.cjs} +1 -3
  116. package/dist/lib/{chunk-A2NFSQ5K.js → chunk-7OVZZWGY.js} +1 -1
  117. package/dist/lib/chunk-A2NW7WAN.js +47 -0
  118. package/dist/lib/chunk-D6MI2V6R.cjs +115 -0
  119. package/dist/lib/{chunk-VHLINWXG.js → chunk-DLVVEHMU.js} +1 -1
  120. package/dist/lib/{chunk-XLYMVIVD.cjs → chunk-DNQBXFNE.cjs} +10 -10
  121. package/dist/lib/{chunk-UGVHYKKN.js → chunk-DYLE5FD3.js} +39 -2
  122. package/dist/lib/{chunk-AKBAX4FH.js → chunk-EN52JYUK.js} +1 -1
  123. package/dist/lib/{chunk-JYDGFQIV.cjs → chunk-F2CXZUSB.cjs} +1 -1
  124. package/dist/lib/{chunk-7VJ42H2I.cjs → chunk-HRRI4KOM.cjs} +1 -3
  125. package/dist/lib/{chunk-LPRZ3HD4.cjs → chunk-IXTLRVAK.cjs} +3 -3
  126. package/dist/lib/{chunk-SYF7QG2J.js → chunk-J3BW52BU.js} +1 -1
  127. package/dist/lib/chunk-KFDNKOXM.js +56 -0
  128. package/dist/lib/chunk-L56XA427.js +137 -0
  129. package/dist/lib/{chunk-6PPZCPME.cjs → chunk-LOW2TIQ6.cjs} +2 -2
  130. package/dist/lib/{chunk-TMZCGC5U.js → chunk-MI55FDCZ.js} +1 -1
  131. package/dist/lib/{chunk-DUZJ7ZF2.cjs → chunk-MKKWFHGE.cjs} +2 -2
  132. package/dist/lib/{chunk-ISBHXSDH.cjs → chunk-N5XEKCVW.cjs} +1 -1
  133. package/dist/lib/{chunk-XZFEHPYE.js → chunk-N5YLKWC2.js} +1 -1
  134. package/dist/lib/chunk-NIRFKQAD.js +845 -0
  135. package/dist/lib/{chunk-YMHOAMCU.cjs → chunk-NLJR4WIX.cjs} +41 -4
  136. package/dist/lib/{chunk-L3HESXYF.cjs → chunk-NUE5DIH3.cjs} +3 -3
  137. package/dist/lib/chunk-OBA5U4Y2.js +1059 -0
  138. package/dist/lib/{chunk-FQLZZYYO.js → chunk-OEF6EHQV.js} +1 -3
  139. package/dist/lib/{chunk-WTTBXYFQ.js → chunk-OFXWRM3U.js} +2 -2
  140. package/dist/lib/chunk-ONETLSPO.js +85 -0
  141. package/dist/lib/{chunk-2OV26JXJ.cjs → chunk-PQRWG64T.cjs} +3 -3
  142. package/dist/lib/chunk-R33US3PV.cjs +1081 -0
  143. package/dist/lib/{chunk-OA7OL7HF.cjs → chunk-SFEEJZLK.cjs} +38 -66
  144. package/dist/lib/{chunk-H6EOZSIZ.js → chunk-TAVG226Z.js} +1 -1
  145. package/dist/lib/{chunk-DALRRHB4.cjs → chunk-TSFG3WEA.cjs} +1 -1
  146. package/dist/lib/{chunk-RMA2PMP7.cjs → chunk-TZCC5IWH.cjs} +3 -3
  147. package/dist/lib/chunk-VHCBD2IS.js +149 -0
  148. package/dist/lib/{chunk-HY6DNFCT.js → chunk-VODWHWD6.js} +2 -2
  149. package/dist/lib/{chunk-2X5DUDNT.js → chunk-W6GWSJ22.js} +2 -2
  150. package/dist/lib/chunk-WBSA6OG6.cjs +860 -0
  151. package/dist/lib/{chunk-TOCNXURI.cjs → chunk-WCXA5WFX.cjs} +4 -4
  152. package/dist/lib/{chunk-6I5PL7H2.js → chunk-WGSZ4X6N.js} +1 -3
  153. package/dist/lib/{chunk-T2KQZC5K.js → chunk-WLDQUTFD.js} +27 -54
  154. package/dist/lib/{chunk-AOHJEL2Q.js → chunk-WOKPJMGJ.js} +3 -3
  155. package/dist/lib/{chunk-TDJNFAOV.cjs → chunk-X6JDYLWM.cjs} +1 -1
  156. package/dist/lib/chunk-XLHFUATD.cjs +151 -0
  157. package/dist/lib/chunk-XUYQYUWZ.cjs +87 -0
  158. package/dist/lib/chunk-YYEAV24J.cjs +67 -0
  159. package/dist/lib/{config-D8KrE7SZ.d.cts → config-Cqxh4V21.d.cts} +58 -475
  160. package/dist/lib/{config-DBIFdRoq.d.ts → config-D-WwQL-4.d.ts} +58 -475
  161. package/dist/lib/config-file.d.cts +2 -2
  162. package/dist/lib/config-file.d.ts +2 -2
  163. package/dist/lib/contexts/api-context.cjs +12 -7
  164. package/dist/lib/contexts/api-context.d.cts +27 -4
  165. package/dist/lib/contexts/api-context.d.ts +27 -4
  166. package/dist/lib/contexts/api-context.js +11 -6
  167. package/dist/lib/contexts/context.cjs +10 -5
  168. package/dist/lib/contexts/context.d.cts +7 -7
  169. package/dist/lib/contexts/context.d.ts +7 -7
  170. package/dist/lib/contexts/context.js +9 -4
  171. package/dist/lib/contexts/environment-context.cjs +11 -6
  172. package/dist/lib/contexts/environment-context.d.cts +4 -4
  173. package/dist/lib/contexts/environment-context.d.ts +4 -4
  174. package/dist/lib/contexts/environment-context.js +10 -5
  175. package/dist/lib/contexts/index.cjs +14 -9
  176. package/dist/lib/contexts/index.d.cts +4 -4
  177. package/dist/lib/contexts/index.d.ts +4 -4
  178. package/dist/lib/contexts/index.js +11 -6
  179. package/dist/lib/contexts/plugin-context.d.cts +4 -4
  180. package/dist/lib/contexts/plugin-context.d.ts +4 -4
  181. package/dist/lib/entry.cjs +9 -9
  182. package/dist/lib/entry.d.cts +2 -2
  183. package/dist/lib/entry.d.ts +2 -2
  184. package/dist/lib/entry.js +1 -1
  185. package/dist/lib/fs/helpers.cjs +47 -0
  186. package/dist/lib/fs/helpers.d.cts +74 -0
  187. package/dist/lib/fs/helpers.d.ts +74 -0
  188. package/dist/lib/fs/helpers.js +2 -0
  189. package/dist/lib/fs/index.cjs +17 -0
  190. package/dist/lib/fs/index.d.cts +33 -0
  191. package/dist/lib/fs/index.d.ts +33 -0
  192. package/dist/lib/fs/index.js +8 -0
  193. package/dist/lib/fs/storage/base.cjs +11 -0
  194. package/dist/lib/fs/storage/base.d.cts +138 -0
  195. package/dist/lib/fs/storage/base.d.ts +138 -0
  196. package/dist/lib/fs/storage/base.js +2 -0
  197. package/dist/lib/fs/storage/file-system.cjs +13 -0
  198. package/dist/lib/fs/storage/file-system.d.cts +90 -0
  199. package/dist/lib/fs/storage/file-system.d.ts +90 -0
  200. package/dist/lib/fs/storage/file-system.js +4 -0
  201. package/dist/lib/fs/storage/index.cjs +22 -0
  202. package/dist/lib/fs/storage/index.d.cts +6 -0
  203. package/dist/lib/fs/storage/index.d.ts +6 -0
  204. package/dist/lib/fs/storage/index.js +5 -0
  205. package/dist/lib/fs/storage/virtual.cjs +12 -0
  206. package/dist/lib/fs/storage/virtual.d.cts +66 -0
  207. package/dist/lib/fs/storage/virtual.d.ts +66 -0
  208. package/dist/lib/fs/storage/virtual.js +3 -0
  209. package/dist/lib/fs/vfs.cjs +16 -0
  210. package/dist/lib/fs/vfs.d.cts +247 -0
  211. package/dist/lib/fs/vfs.d.ts +247 -0
  212. package/dist/lib/fs/vfs.js +7 -0
  213. package/dist/lib/fs-Dg-aTfiN.d.cts +378 -0
  214. package/dist/lib/fs-Dg-aTfiN.d.ts +378 -0
  215. package/dist/lib/index.cjs +62 -68
  216. package/dist/lib/index.d.cts +18 -356
  217. package/dist/lib/index.d.ts +18 -356
  218. package/dist/lib/index.js +19 -13
  219. package/dist/lib/{internal-CaGANOWK.d.cts → internal-Cl7s1iAA.d.cts} +2 -2
  220. package/dist/lib/{internal-1qCyw7bA.d.ts → internal-W5pvS6e9.d.ts} +2 -2
  221. package/dist/lib/logger.d.cts +2 -2
  222. package/dist/lib/logger.d.ts +2 -2
  223. package/dist/lib/typescript/import-transformer.cjs +7 -45
  224. package/dist/lib/typescript/import-transformer.d.cts +2 -2
  225. package/dist/lib/typescript/import-transformer.d.ts +2 -2
  226. package/dist/lib/typescript/import-transformer.js +2 -47
  227. package/dist/lib/typescript/index.cjs +10 -22
  228. package/dist/lib/typescript/index.d.cts +4 -4
  229. package/dist/lib/typescript/index.d.ts +4 -4
  230. package/dist/lib/typescript/index.js +2 -2
  231. package/dist/lib/typescript/ts-morph.cjs +6 -2
  232. package/dist/lib/typescript/ts-morph.d.cts +28 -4
  233. package/dist/lib/typescript/ts-morph.d.ts +28 -4
  234. package/dist/lib/typescript/ts-morph.js +1 -1
  235. package/dist/lib/unplugin/factory.cjs +14 -9
  236. package/dist/lib/unplugin/factory.d.cts +4 -4
  237. package/dist/lib/unplugin/factory.d.ts +4 -4
  238. package/dist/lib/unplugin/factory.js +13 -8
  239. package/dist/lib/unplugin/helpers.d.cts +2 -2
  240. package/dist/lib/unplugin/helpers.d.ts +2 -2
  241. package/dist/lib/unplugin/index.cjs +16 -11
  242. package/dist/lib/unplugin/index.d.cts +4 -4
  243. package/dist/lib/unplugin/index.d.ts +4 -4
  244. package/dist/lib/unplugin/index.js +14 -9
  245. package/dist/lib/unplugin/plugin.cjs +2 -2
  246. package/dist/lib/unplugin/plugin.d.cts +4 -4
  247. package/dist/lib/unplugin/plugin.d.ts +4 -4
  248. package/dist/lib/unplugin/plugin.js +1 -1
  249. package/dist/lib/{unplugin-CEeJqADD.d.ts → unplugin-Cg2NoKj0.d.ts} +2 -2
  250. package/dist/lib/{unplugin-bUSyjd0S.d.cts → unplugin-trF-VLnO.d.cts} +2 -2
  251. package/dist/lib/utilities/bundle.cjs +4 -4
  252. package/dist/lib/utilities/bundle.d.cts +2 -2
  253. package/dist/lib/utilities/bundle.d.ts +2 -2
  254. package/dist/lib/utilities/bundle.js +3 -3
  255. package/dist/lib/utilities/cache.d.cts +2 -2
  256. package/dist/lib/utilities/cache.d.ts +2 -2
  257. package/dist/lib/utilities/file-header.d.cts +2 -2
  258. package/dist/lib/utilities/file-header.d.ts +2 -2
  259. package/dist/lib/utilities/index.cjs +22 -22
  260. package/dist/lib/utilities/index.d.cts +2 -2
  261. package/dist/lib/utilities/index.d.ts +2 -2
  262. package/dist/lib/utilities/index.js +6 -6
  263. package/dist/lib/utilities/meta.cjs +7 -7
  264. package/dist/lib/utilities/meta.d.cts +2 -2
  265. package/dist/lib/utilities/meta.d.ts +2 -2
  266. package/dist/lib/utilities/meta.js +1 -1
  267. package/dist/lib/utilities/resolve.cjs +5 -5
  268. package/dist/lib/utilities/resolve.d.cts +2 -2
  269. package/dist/lib/utilities/resolve.d.ts +2 -2
  270. package/dist/lib/utilities/resolve.js +4 -4
  271. package/dist/lib/utilities/source-file.d.cts +2 -2
  272. package/dist/lib/utilities/source-file.d.ts +2 -2
  273. package/dist/lib/utilities/source-map.d.cts +2 -2
  274. package/dist/lib/utilities/source-map.d.ts +2 -2
  275. package/dist/lib/utilities/worker.d.cts +2 -2
  276. package/dist/lib/utilities/worker.d.ts +2 -2
  277. package/dist/lib/utilities/write-file.d.cts +2 -2
  278. package/dist/lib/utilities/write-file.d.ts +2 -2
  279. package/dist/next.cjs +11 -9
  280. package/dist/next.js +9 -7
  281. package/dist/nuxt.cjs +13 -11
  282. package/dist/nuxt.js +11 -9
  283. package/dist/plugin-utils/{chunk-JHTLGE4X.js → chunk-K2GWRZPV.js} +1 -1
  284. package/dist/plugin-utils/{chunk-HSYQWNIH.cjs → chunk-VWFJOPKC.cjs} +1 -1
  285. package/dist/plugin-utils/{context-BITGF5LZ.d.cts → context-PtfEjz3_.d.cts} +187 -230
  286. package/dist/plugin-utils/{context-BITGF5LZ.d.ts → context-PtfEjz3_.d.ts} +187 -230
  287. package/dist/plugin-utils/context-helpers.d.cts +1 -2
  288. package/dist/plugin-utils/context-helpers.d.ts +1 -2
  289. package/dist/plugin-utils/enforce.d.cts +1 -2
  290. package/dist/plugin-utils/enforce.d.ts +1 -2
  291. package/dist/plugin-utils/extend.d.cts +1 -2
  292. package/dist/plugin-utils/extend.d.ts +1 -2
  293. package/dist/plugin-utils/get-config-path.d.cts +1 -2
  294. package/dist/plugin-utils/get-config-path.d.ts +1 -2
  295. package/dist/plugin-utils/helpers.d.cts +1 -2
  296. package/dist/plugin-utils/helpers.d.ts +1 -2
  297. package/dist/plugin-utils/index.cjs +2 -2
  298. package/dist/plugin-utils/index.d.cts +1 -2
  299. package/dist/plugin-utils/index.d.ts +1 -2
  300. package/dist/plugin-utils/index.js +1 -1
  301. package/dist/plugin-utils/merge.d.cts +1 -2
  302. package/dist/plugin-utils/merge.d.ts +1 -2
  303. package/dist/plugin-utils/paths.cjs +2 -2
  304. package/dist/plugin-utils/paths.d.cts +2 -3
  305. package/dist/plugin-utils/paths.d.ts +2 -3
  306. package/dist/plugin-utils/paths.js +1 -1
  307. package/dist/rolldown.cjs +9 -7
  308. package/dist/rolldown.d.cts +19 -21
  309. package/dist/rolldown.d.ts +19 -21
  310. package/dist/rolldown.js +8 -6
  311. package/dist/rollup.cjs +9 -7
  312. package/dist/rollup.d.cts +19 -21
  313. package/dist/rollup.d.ts +19 -21
  314. package/dist/rollup.js +8 -6
  315. package/dist/rspack.cjs +9 -7
  316. package/dist/rspack.d.cts +18 -20
  317. package/dist/rspack.d.ts +18 -20
  318. package/dist/rspack.js +8 -6
  319. package/dist/tsup.cjs +12 -10
  320. package/dist/tsup.js +10 -8
  321. package/dist/types/api.cjs +3 -1
  322. package/dist/types/api.cjs.map +1 -0
  323. package/dist/types/api.d.cts +20 -22
  324. package/dist/types/api.d.ts +20 -22
  325. package/dist/types/api.js +3 -1
  326. package/dist/types/api.js.map +1 -0
  327. package/dist/types/babel.cjs +3 -1
  328. package/dist/types/babel.cjs.map +1 -0
  329. package/dist/types/babel.d.cts +17 -19
  330. package/dist/types/babel.d.ts +17 -19
  331. package/dist/types/babel.js +3 -1
  332. package/dist/types/babel.js.map +1 -0
  333. package/dist/types/build.cjs +3 -1
  334. package/dist/types/build.cjs.map +1 -0
  335. package/dist/types/build.js +3 -1
  336. package/dist/types/build.js.map +1 -0
  337. package/dist/types/commands.cjs +5 -3
  338. package/dist/types/commands.cjs.map +1 -0
  339. package/dist/types/commands.d.cts +18 -20
  340. package/dist/types/commands.d.ts +18 -20
  341. package/dist/types/commands.js +4 -2
  342. package/dist/types/commands.js.map +1 -0
  343. package/dist/types/config.cjs +3 -1
  344. package/dist/types/config.cjs.map +1 -0
  345. package/dist/types/config.d.cts +2 -4
  346. package/dist/types/config.d.ts +2 -4
  347. package/dist/types/config.js +3 -1
  348. package/dist/types/config.js.map +1 -0
  349. package/dist/types/context.cjs +5 -3
  350. package/dist/types/context.cjs.map +1 -0
  351. package/dist/types/context.d.cts +8 -10
  352. package/dist/types/context.d.ts +8 -10
  353. package/dist/types/context.js +4 -2
  354. package/dist/types/context.js.map +1 -0
  355. package/dist/types/fs.cjs +10 -4
  356. package/dist/types/fs.cjs.map +1 -0
  357. package/dist/types/fs.d.cts +138 -184
  358. package/dist/types/fs.d.ts +138 -184
  359. package/dist/types/fs.js +4 -2
  360. package/dist/types/fs.js.map +1 -0
  361. package/dist/types/hooks.cjs +3 -1
  362. package/dist/types/hooks.cjs.map +1 -0
  363. package/dist/types/hooks.d.cts +19 -21
  364. package/dist/types/hooks.d.ts +19 -21
  365. package/dist/types/hooks.js +3 -1
  366. package/dist/types/hooks.js.map +1 -0
  367. package/dist/types/index.cjs +26 -20
  368. package/dist/types/index.cjs.map +1 -0
  369. package/dist/types/index.d.cts +13 -15
  370. package/dist/types/index.d.ts +13 -15
  371. package/dist/types/index.js +17 -15
  372. package/dist/types/index.js.map +1 -0
  373. package/dist/types/internal.cjs +2 -0
  374. package/dist/types/internal.cjs.map +1 -0
  375. package/dist/types/internal.d.cts +20 -22
  376. package/dist/types/internal.d.ts +20 -22
  377. package/dist/types/internal.js +2 -0
  378. package/dist/types/internal.js.map +1 -0
  379. package/dist/types/plugin.cjs +5 -3
  380. package/dist/types/plugin.cjs.map +1 -0
  381. package/dist/types/plugin.d.cts +9 -11
  382. package/dist/types/plugin.d.ts +9 -11
  383. package/dist/types/plugin.js +4 -2
  384. package/dist/types/plugin.js.map +1 -0
  385. package/dist/types/resolved.cjs +3 -1
  386. package/dist/types/resolved.cjs.map +1 -0
  387. package/dist/types/resolved.d.cts +7 -9
  388. package/dist/types/resolved.d.ts +7 -9
  389. package/dist/types/resolved.js +3 -1
  390. package/dist/types/resolved.js.map +1 -0
  391. package/dist/types/tsconfig.cjs +3 -1
  392. package/dist/types/tsconfig.cjs.map +1 -0
  393. package/dist/types/tsconfig.js +3 -1
  394. package/dist/types/tsconfig.js.map +1 -0
  395. package/dist/types/typedoc.cjs +3 -1
  396. package/dist/types/typedoc.cjs.map +1 -0
  397. package/dist/types/typedoc.js +3 -1
  398. package/dist/types/typedoc.js.map +1 -0
  399. package/dist/types/unplugin.cjs +3 -1
  400. package/dist/types/unplugin.cjs.map +1 -0
  401. package/dist/types/unplugin.d.cts +11 -13
  402. package/dist/types/unplugin.d.ts +11 -13
  403. package/dist/types/unplugin.js +3 -1
  404. package/dist/types/unplugin.js.map +1 -0
  405. package/dist/unloader.cjs +9 -7
  406. package/dist/unloader.d.cts +19 -21
  407. package/dist/unloader.d.ts +19 -21
  408. package/dist/unloader.js +8 -6
  409. package/dist/unplugin.cjs +20 -20
  410. package/dist/unplugin.d.cts +19 -21
  411. package/dist/unplugin.d.ts +19 -21
  412. package/dist/unplugin.js +10 -10
  413. package/dist/vite.cjs +13 -11
  414. package/dist/vite.d.cts +19 -21
  415. package/dist/vite.d.ts +19 -21
  416. package/dist/vite.js +10 -8
  417. package/dist/webpack.cjs +12 -10
  418. package/dist/webpack.d.cts +19 -21
  419. package/dist/webpack.d.ts +19 -21
  420. package/dist/webpack.js +9 -7
  421. package/package.json +72 -19
  422. package/schemas/fs.capnp +4 -59
  423. package/dist/chunk-2NO7N5OW.cjs +0 -2
  424. package/dist/chunk-7GYTTM4M.cjs +0 -2
  425. package/dist/chunk-AENPRFWJ.cjs +0 -2
  426. package/dist/chunk-AYKZK666.cjs +0 -8
  427. package/dist/chunk-BUR2JQ6G.cjs +0 -11
  428. package/dist/chunk-DRXFQCNC.js +0 -1
  429. package/dist/chunk-FNZDWE4L.js +0 -1
  430. package/dist/chunk-GHJU2KGP.cjs +0 -2
  431. package/dist/chunk-GRU7B3QM.cjs +0 -2
  432. package/dist/chunk-HQFZ64VC.cjs +0 -2
  433. package/dist/chunk-J4BQZHTQ.js +0 -1
  434. package/dist/chunk-JGB5YQ2U.js +0 -1
  435. package/dist/chunk-KALR2O2F.cjs +0 -2
  436. package/dist/chunk-LOUZXJFY.cjs +0 -10
  437. package/dist/chunk-OO3YXM72.js +0 -1
  438. package/dist/chunk-QE3WGMAP.js +0 -1
  439. package/dist/chunk-SMNKPH4T.js +0 -1
  440. package/dist/chunk-T2P533I5.js +0 -1
  441. package/dist/chunk-V3MLQDZQ.js +0 -1
  442. package/dist/chunk-VT7NVLLU.js +0 -5
  443. package/dist/chunk-YRJ4MLVL.cjs +0 -2
  444. package/dist/chunk-ZC43PZXS.cjs +0 -2
  445. package/dist/lib/chunk-3MZQ4MQX.cjs +0 -2360
  446. package/dist/lib/chunk-5JAFU45Z.js +0 -2324
  447. package/dist/lib/chunk-HAXL7QE7.js +0 -154
  448. package/dist/lib/chunk-SAS5EPBD.cjs +0 -107
  449. package/dist/lib/chunk-WUYK74EH.cjs +0 -165
  450. package/dist/lib/chunk-YQ3ODCHV.js +0 -105
  451. package/dist/lib/typescript/compiler-host.cjs +0 -164
  452. package/dist/lib/typescript/compiler-host.d.cts +0 -63
  453. package/dist/lib/typescript/compiler-host.d.ts +0 -63
  454. package/dist/lib/typescript/compiler-host.js +0 -156
  455. package/dist/lib/typescript/program.cjs +0 -27
  456. package/dist/lib/typescript/program.d.cts +0 -68
  457. package/dist/lib/typescript/program.d.ts +0 -68
  458. package/dist/lib/typescript/program.js +0 -2
  459. /package/dist/{chunk-2NCILNCH.cjs → lib/chunk-K2SFTPN3.cjs} +0 -0
  460. /package/dist/{chunk-BLNT5INX.js → lib/chunk-NQAHFTUW.js} +0 -0
@@ -0,0 +1,860 @@
1
+ 'use strict';
2
+
3
+ var chunkHRRI4KOM_cjs = require('./chunk-HRRI4KOM.cjs');
4
+ var chunkR33US3PV_cjs = require('./chunk-R33US3PV.cjs');
5
+ var chunkD6MI2V6R_cjs = require('./chunk-D6MI2V6R.cjs');
6
+ var chunkGA3RXX4R_cjs = require('./chunk-GA3RXX4R.cjs');
7
+ var chunkK3NBD5LL_cjs = require('./chunk-K3NBD5LL.cjs');
8
+ var chunkJA4HSQRN_cjs = require('./chunk-JA4HSQRN.cjs');
9
+ var chunkN5XEKCVW_cjs = require('./chunk-N5XEKCVW.cjs');
10
+ var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
11
+ var types = require('@storm-software/config-tools/types');
12
+ var toArray = require('@stryke/convert/to-array');
13
+ var getEnvPaths = require('@stryke/env/get-env-paths');
14
+ var exists = require('@stryke/fs/exists');
15
+ var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
16
+ var json = require('@stryke/fs/json');
17
+ var resolve = require('@stryke/fs/resolve');
18
+ var hashFiles = require('@stryke/hash/hash-files');
19
+ var murmurhash = require('@stryke/hash/murmurhash');
20
+ var getUnique = require('@stryke/helpers/get-unique');
21
+ var omit = require('@stryke/helpers/omit');
22
+ var stormJson = require('@stryke/json/storm-json');
23
+ var append = require('@stryke/path/append');
24
+ var isType = require('@stryke/path/is-type');
25
+ var join = require('@stryke/path/join');
26
+ var replace = require('@stryke/path/replace');
27
+ var titleCase = require('@stryke/string-format/title-case');
28
+ var isNull = require('@stryke/type-checks/is-null');
29
+ var isSetObject = require('@stryke/type-checks/is-set-object');
30
+ var isSetString = require('@stryke/type-checks/is-set-string');
31
+ var isString = require('@stryke/type-checks/is-string');
32
+ var uuid = require('@stryke/unique-id/uuid');
33
+ var bundleRequire = require('bundle-require');
34
+ var defu2 = require('defu');
35
+ var joinPaths = require('@stryke/path/join-paths');
36
+ var jiti = require('jiti');
37
+ var isFunction = require('@stryke/type-checks/is-function');
38
+ var isUndefined = require('@stryke/type-checks/is-undefined');
39
+
40
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
41
+
42
+ var defu2__default = /*#__PURE__*/_interopDefault(defu2);
43
+
44
+ function resolveOptions(options) {
45
+ return defu2__default.default(options, {
46
+ interopDefault: true,
47
+ fsCache: options.mode !== "development" ? joinPaths.joinPaths(options.cacheDir, "jiti") : false,
48
+ moduleCache: options.mode !== "development"
49
+ });
50
+ }
51
+ chunkUSNT2KNT_cjs.__name(resolveOptions, "resolveOptions");
52
+ function createPluginResolver(options) {
53
+ return jiti.createJiti(joinPaths.joinPaths(options.workspaceRoot, options.projectRoot), resolveOptions({
54
+ ...options
55
+ }));
56
+ }
57
+ chunkUSNT2KNT_cjs.__name(createPluginResolver, "createPluginResolver");
58
+ function createResolver(options) {
59
+ const baseResolver = jiti.createJiti(joinPaths.joinPaths(options.workspaceRoot, options.projectRoot), resolveOptions(options));
60
+ baseResolver.plugin = createPluginResolver(options);
61
+ return baseResolver;
62
+ }
63
+ chunkUSNT2KNT_cjs.__name(createResolver, "createResolver");
64
+
65
+ // src/types/commands.ts
66
+ var SUPPORTED_COMMANDS = [
67
+ "new",
68
+ "clean",
69
+ "prepare",
70
+ "lint",
71
+ "test",
72
+ "build",
73
+ "docs",
74
+ "deploy",
75
+ "finalize"
76
+ ];
77
+
78
+ // src/plugin-utils/helpers.ts
79
+ function isPlugin(value) {
80
+ return isSetObject.isSetObject(value) && "name" in value && isSetString.isSetString(value.name) && (isUndefined.isUndefined(value.applyToEnvironment) || "applyToEnvironment" in value && isFunction.isFunction(value.applyToEnvironment)) && (isUndefined.isUndefined(value.dedupe) || "dedupe" in value && isFunction.isFunction(value.dedupe)) && (isUndefined.isUndefined(value.dependsOn) || "dependsOn" in value && Array.isArray(value.dependsOn) && value.dependsOn.every(isPluginConfig)) && SUPPORTED_COMMANDS.every((command) => isUndefined.isUndefined(value[command]) || command in value && (isFunction.isFunction(value[command]) || isSetObject.isSetObject(value[command]) && "handler" in value[command] && isFunction.isFunction(value[command].handler)));
81
+ }
82
+ chunkUSNT2KNT_cjs.__name(isPlugin, "isPlugin");
83
+ function isPluginConfigObject(value) {
84
+ return isSetObject.isSetObject(value) && "plugin" in value && ((isSetString.isSetString(value.plugin) || isFunction.isFunction(value.plugin)) && "options" in value && isSetObject.isSetObject(value.options) || isPlugin(value.plugin));
85
+ }
86
+ chunkUSNT2KNT_cjs.__name(isPluginConfigObject, "isPluginConfigObject");
87
+ function isPluginConfigTuple(value) {
88
+ return Array.isArray(value) && (value.length === 1 || value.length === 2) && ((isSetString.isSetString(value[0]) || isFunction.isFunction(value[0])) && value.length > 1 && isSetObject.isSetObject(value[1]) || isPlugin(value[0]));
89
+ }
90
+ chunkUSNT2KNT_cjs.__name(isPluginConfigTuple, "isPluginConfigTuple");
91
+ function isPluginConfig(value) {
92
+ return isSetString.isSetString(value) || isFunction.isFunction(value) || isPlugin(value) || isPluginConfigObject(value) || isPluginConfigTuple(value);
93
+ }
94
+ chunkUSNT2KNT_cjs.__name(isPluginConfig, "isPluginConfig");
95
+ function isPluginHookFunction(value) {
96
+ return isFunction.isFunction(value) || isSetObject.isSetObject(value) && "handler" in value && isFunction.isFunction(value.handler);
97
+ }
98
+ chunkUSNT2KNT_cjs.__name(isPluginHookFunction, "isPluginHookFunction");
99
+ function isPluginHookObject(value) {
100
+ return isSetObject.isSetObject(value) && "handler" in value && isFunction.isFunction(value.handler);
101
+ }
102
+ chunkUSNT2KNT_cjs.__name(isPluginHookObject, "isPluginHookObject");
103
+ function isPluginHook(value) {
104
+ return isPluginHookFunction(value) || isPluginHookObject(value);
105
+ }
106
+ chunkUSNT2KNT_cjs.__name(isPluginHook, "isPluginHook");
107
+ function getHookHandler(pluginHook) {
108
+ return isFunction.isFunction(pluginHook) ? pluginHook : pluginHook.handler;
109
+ }
110
+ chunkUSNT2KNT_cjs.__name(getHookHandler, "getHookHandler");
111
+ function isHookExternal(hook) {
112
+ return hook.startsWith("vite:") || hook.startsWith("esbuild:") || hook.startsWith("rolldown:") || hook.startsWith("rollup:") || hook.startsWith("webpack:") || hook.startsWith("rspack:") || hook.startsWith("farm:");
113
+ }
114
+ chunkUSNT2KNT_cjs.__name(isHookExternal, "isHookExternal");
115
+ function checkDedupe(plugin, plugins) {
116
+ return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && (isFunction.isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
117
+ }
118
+ chunkUSNT2KNT_cjs.__name(checkDedupe, "checkDedupe");
119
+ function addPluginHook(context, plugin, pluginHook, hooksList) {
120
+ if (!checkDedupe(plugin, hooksList.map((hook) => hook.plugin))) {
121
+ hooksList.push(isFunction.isFunction(pluginHook) ? {
122
+ plugin,
123
+ handler: getHookHandler(pluginHook).bind(context)
124
+ } : {
125
+ plugin,
126
+ ...pluginHook,
127
+ handler: getHookHandler(pluginHook).bind(context)
128
+ });
129
+ }
130
+ }
131
+ chunkUSNT2KNT_cjs.__name(addPluginHook, "addPluginHook");
132
+
133
+ // src/lib/contexts/context.ts
134
+ var configCache = /* @__PURE__ */ new WeakMap();
135
+ var PowerlinesContext = class _PowerlinesContext {
136
+ static {
137
+ chunkUSNT2KNT_cjs.__name(this, "PowerlinesContext");
138
+ }
139
+ /**
140
+ * Internal reference to the API instance
141
+ *
142
+ * @internal
143
+ */
144
+ #api;
145
+ #workspaceConfig;
146
+ #checksum = null;
147
+ #buildId = uuid.uuid();
148
+ #releaseId = uuid.uuid();
149
+ #timestamp = Date.now();
150
+ #envPaths;
151
+ #fs;
152
+ #tsconfig;
153
+ #program;
154
+ #resolvePatterns = [];
155
+ #getConfigProps(config = {}) {
156
+ return {
157
+ variant: config.build?.variant,
158
+ projectType: config.type,
159
+ projectRoot: config.root,
160
+ name: config.name,
161
+ title: config.title,
162
+ description: config.description,
163
+ sourceRoot: config.sourceRoot,
164
+ configFile: config.configFile,
165
+ customLogger: config.customLogger,
166
+ logLevel: config.logLevel,
167
+ tsconfig: config.tsconfig,
168
+ tsconfigRaw: config.tsconfigRaw,
169
+ skipCache: config.skipCache,
170
+ skipInstalls: config.skipInstalls,
171
+ entry: config.entry,
172
+ output: config.output,
173
+ plugins: config.plugins,
174
+ mode: config.mode,
175
+ lint: config.lint,
176
+ transform: config.transform,
177
+ build: config.build,
178
+ framework: config.framework
179
+ };
180
+ }
181
+ /**
182
+ * Create a new Storm context from the workspace root and user config.
183
+ *
184
+ * @param workspaceRoot - The root directory of the workspace.
185
+ * @param config - The user configuration options.
186
+ * @returns A promise that resolves to the new context.
187
+ */
188
+ static async from(workspaceRoot, config) {
189
+ const context = new _PowerlinesContext(await chunkK3NBD5LL_cjs.loadWorkspaceConfig(workspaceRoot, config.root));
190
+ await context.withUserConfig(config);
191
+ context.powerlinesPath = await resolve.resolvePackage("powerlines");
192
+ if (!context.powerlinesPath) {
193
+ throw new Error("Could not resolve `powerlines` package location.");
194
+ }
195
+ return context;
196
+ }
197
+ /**
198
+ * An object containing the dependencies that should be installed for the project
199
+ */
200
+ dependencies = {};
201
+ /**
202
+ * An object containing the development dependencies that should be installed for the project
203
+ */
204
+ devDependencies = {};
205
+ /**
206
+ * The persisted meta information about the current build
207
+ */
208
+ persistedMeta = void 0;
209
+ /**
210
+ * The path to the Powerlines package
211
+ */
212
+ powerlinesPath;
213
+ /**
214
+ * The parsed `package.json` file for the project
215
+ */
216
+ packageJson;
217
+ /**
218
+ * The parsed `project.json` file for the project
219
+ */
220
+ projectJson = void 0;
221
+ /**
222
+ * The module resolver for the project
223
+ */
224
+ resolver;
225
+ /**
226
+ * Internal context fields and methods
227
+ *
228
+ * @internal
229
+ */
230
+ get $$internal() {
231
+ return {
232
+ api: this.#api
233
+ };
234
+ }
235
+ /**
236
+ * The resolved entry type definitions for the project
237
+ */
238
+ get entry() {
239
+ return chunkN5XEKCVW_cjs.resolveEntriesSync(this, toArray.toArray(this.config.entry));
240
+ }
241
+ /**
242
+ * The TypeScript configuration parsed from the tsconfig file
243
+ */
244
+ get tsconfig() {
245
+ if (!this.#tsconfig) {
246
+ this.tsconfig = {
247
+ tsconfigFilePath: this.config.tsconfig
248
+ };
249
+ }
250
+ return this.#tsconfig;
251
+ }
252
+ /**
253
+ * Sets the TypeScript configuration parsed from the tsconfig file
254
+ */
255
+ set tsconfig(value) {
256
+ this.#tsconfig = value;
257
+ this.#resolvePatterns = bundleRequire.tsconfigPathsToRegExp(value?.options?.paths ?? {});
258
+ }
259
+ /**
260
+ * The virtual file system interface for the project
261
+ */
262
+ get fs() {
263
+ if (!this.#fs) {
264
+ this.#fs = chunkR33US3PV_cjs.VirtualFileSystem.createSync(this);
265
+ }
266
+ return this.#fs;
267
+ }
268
+ /**
269
+ * Get the checksum of the project's current state
270
+ */
271
+ get checksum() {
272
+ return this.#checksum;
273
+ }
274
+ /**
275
+ * The meta information about the current build
276
+ */
277
+ get meta() {
278
+ return {
279
+ buildId: this.#buildId,
280
+ releaseId: this.#releaseId,
281
+ checksum: this.#checksum,
282
+ timestamp: this.#timestamp,
283
+ projectRootHash: murmurhash.murmurhash({
284
+ workspaceRoot: this.workspaceConfig?.workspaceRoot,
285
+ projectRoot: this.config?.projectRoot
286
+ }, {
287
+ maxLength: chunkHRRI4KOM_cjs.PROJECT_ROOT_HASH_LENGTH
288
+ }),
289
+ configHash: murmurhash.murmurhash(this.config, {
290
+ maxLength: chunkHRRI4KOM_cjs.CACHE_HASH_LENGTH
291
+ })
292
+ };
293
+ }
294
+ /**
295
+ * The resolved configuration options
296
+ */
297
+ get config() {
298
+ return this.resolvedConfig ?? {};
299
+ }
300
+ /**
301
+ * The logger function
302
+ */
303
+ get log() {
304
+ if (!this.logFn) {
305
+ this.logFn = this.createLog();
306
+ }
307
+ return this.logFn;
308
+ }
309
+ /**
310
+ * The workspace configuration
311
+ */
312
+ get workspaceConfig() {
313
+ return this.#workspaceConfig;
314
+ }
315
+ /**
316
+ * The environment paths for the project
317
+ */
318
+ get envPaths() {
319
+ if (!this.#envPaths) {
320
+ this.#envPaths = getEnvPaths.getEnvPaths({
321
+ orgId: "storm-software",
322
+ appId: "powerlines",
323
+ workspaceRoot: this.workspaceConfig.workspaceRoot
324
+ });
325
+ }
326
+ return this.#envPaths;
327
+ }
328
+ /**
329
+ * Get the path to the artifacts directory for the project
330
+ */
331
+ get artifactsPath() {
332
+ return join.joinPaths(this.workspaceConfig.workspaceRoot, this.config.projectRoot, this.config.output.artifactsPath);
333
+ }
334
+ /**
335
+ * Get the path to the builtin modules used by the project
336
+ */
337
+ get builtinsPath() {
338
+ return join.joinPaths(this.artifactsPath, "builtins");
339
+ }
340
+ /**
341
+ * Get the path to the entry directory for the project
342
+ */
343
+ get entryPath() {
344
+ return join.joinPaths(this.artifactsPath, "entry");
345
+ }
346
+ /**
347
+ * Get the path to the data directory for the project
348
+ */
349
+ get dataPath() {
350
+ return join.joinPaths(this.envPaths.data, "projects", chunkHRRI4KOM_cjs.getPrefixedProjectRootHash(this.config.name, this.meta.projectRootHash));
351
+ }
352
+ /**
353
+ * Get the path to the cache directory for the project
354
+ */
355
+ get cachePath() {
356
+ return join.joinPaths(this.envPaths.cache, "projects", murmurhash.murmurhash({
357
+ checksum: this.#checksum,
358
+ config: this.meta.configHash
359
+ }, {
360
+ maxLength: chunkHRRI4KOM_cjs.CACHE_HASH_LENGTH
361
+ }));
362
+ }
363
+ /**
364
+ * Get the path to the generated declaration file for the project
365
+ */
366
+ get dtsPath() {
367
+ return this.config.output.dts ? append.appendPath(this.config.output.dts, this.workspaceConfig.workspaceRoot) : join.joinPaths(this.workspaceConfig.workspaceRoot, this.config.projectRoot, "powerlines.d.ts");
368
+ }
369
+ /**
370
+ * Get the project root relative to the workspace root
371
+ */
372
+ get relativeToWorkspaceRoot() {
373
+ return getWorkspaceRoot.relativeToWorkspaceRoot(this.config.projectRoot);
374
+ }
375
+ /**
376
+ * The builtin module id that exist in the Powerlines virtual file system
377
+ */
378
+ get builtins() {
379
+ return Object.values(this.fs.metadata).filter((meta) => meta && meta.type === "builtin").map((meta) => meta?.id).filter(Boolean);
380
+ }
381
+ /**
382
+ * The {@link Project} instance used for type reflection and module manipulation
383
+ *
384
+ * @see https://ts-morph.com/
385
+ *
386
+ * @remarks
387
+ * This instance is created lazily on first access.
388
+ */
389
+ get program() {
390
+ if (!this.#program) {
391
+ this.#program = chunkD6MI2V6R_cjs.createProgram(this, {
392
+ skipAddingFilesFromTsConfig: true
393
+ });
394
+ }
395
+ return this.#program;
396
+ }
397
+ /**
398
+ * A helper function to resolve modules in the Virtual File System
399
+ *
400
+ * @remarks
401
+ * This function can be used to resolve modules relative to the project root directory.
402
+ *
403
+ * @example
404
+ * ```ts
405
+ * const resolved = await context.resolve("some-module", "/path/to/importer");
406
+ * ```
407
+ *
408
+ * @param id - The module to resolve.
409
+ * @param importer - An optional path to the importer module.
410
+ * @param options - Additional resolution options.
411
+ * @returns A promise that resolves to the resolved module path.
412
+ */
413
+ async resolveId(id, importer, options = {}) {
414
+ if (this.fs.isVirtual(id)) {
415
+ const result = await this.fs.resolve(id, importer, options);
416
+ if (!result) {
417
+ return void 0;
418
+ }
419
+ return {
420
+ id: `\0${result}`,
421
+ external: this.config.projectType !== "application"
422
+ };
423
+ }
424
+ if (this.config.build.skipNodeModulesBundle) {
425
+ if (bundleRequire.match(id, this.#resolvePatterns) || bundleRequire.match(id, this.config.build.noExternal)) {
426
+ return void 0;
427
+ }
428
+ if (bundleRequire.match(id, this.config.build.external) || id.startsWith("node:")) {
429
+ return {
430
+ id,
431
+ external: true
432
+ };
433
+ }
434
+ if (!/^[A-Z]:[/\\]|^\.{0,2}\/|^\.{1,2}$/.test(id)) {
435
+ return {
436
+ id,
437
+ external: true
438
+ };
439
+ }
440
+ } else {
441
+ if (bundleRequire.match(id, this.config.build.noExternal)) {
442
+ return void 0;
443
+ }
444
+ if (bundleRequire.match(id, this.config.build.external) || id.startsWith("node:")) {
445
+ return {
446
+ id,
447
+ external: true
448
+ };
449
+ }
450
+ }
451
+ return void 0;
452
+ }
453
+ /**
454
+ * A helper function to load modules from the Virtual File System
455
+ *
456
+ * @remarks
457
+ * This function can be used to load modules relative to the project root directory.
458
+ *
459
+ * @example
460
+ * ```ts
461
+ * const module = await context.load("some-module", "/path/to/importer");
462
+ * ```
463
+ *
464
+ * @param id - The module to load.
465
+ * @returns A promise that resolves to the loaded module.
466
+ */
467
+ async load(id) {
468
+ const resolvedId = await this.fs.resolve(id);
469
+ if (!resolvedId) {
470
+ return void 0;
471
+ }
472
+ const code = await this.fs.read(resolvedId);
473
+ if (!code) {
474
+ return void 0;
475
+ }
476
+ return {
477
+ code,
478
+ map: null
479
+ };
480
+ }
481
+ /**
482
+ * Get the builtin virtual files that exist in the Powerlines virtual file system
483
+ */
484
+ async getBuiltins() {
485
+ return Promise.all(Object.entries(this.fs.metadata).filter(([, meta]) => meta && meta.type === "builtin").map(async ([path, meta]) => {
486
+ const code = await this.fs.read(path);
487
+ return {
488
+ ...meta,
489
+ path,
490
+ code
491
+ };
492
+ }));
493
+ }
494
+ /**
495
+ * Resolves a entry virtual file and writes it to the VFS if it does not already exist
496
+ *
497
+ * @param code - The source code of the entry file
498
+ * @param path - A path to write the entry file to
499
+ * @param options - Optional write file options
500
+ */
501
+ async emitEntry(code, path, options = {}) {
502
+ return this.fs.write(isType.isAbsolute(path) ? path : append.appendPath(path, this.entryPath), code, defu2__default.default(options, {
503
+ type: "entry"
504
+ }));
505
+ }
506
+ /**
507
+ * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
508
+ *
509
+ * @param code - The source code of the builtin file
510
+ * @param id - The unique identifier of the builtin file
511
+ * @param path - An optional path to write the builtin file to
512
+ * @param options - Optional write file options
513
+ */
514
+ async emitBuiltin(code, id, path, options = {}) {
515
+ return this.fs.write(path ? isType.isAbsolute(path) ? path : join.joinPaths(this.builtinsPath, path) : append.appendPath(id, this.builtinsPath), code, defu2__default.default(options, {
516
+ type: "builtin"
517
+ }));
518
+ }
519
+ /**
520
+ * Update the context using a new user configuration options
521
+ *
522
+ * @param userConfig - The new user configuration options.
523
+ */
524
+ async withUserConfig(userConfig, options = {
525
+ isHighPriority: true
526
+ }) {
527
+ this.mergeUserConfig(userConfig);
528
+ await this.init(this.config.userConfig, options);
529
+ }
530
+ /**
531
+ * Update the context using a new inline configuration options
532
+ *
533
+ * @param inlineConfig - The new inline configuration options.
534
+ */
535
+ async withInlineConfig(inlineConfig, options = {
536
+ isHighPriority: true
537
+ }) {
538
+ this.config.inlineConfig = inlineConfig;
539
+ if (inlineConfig.command === "new") {
540
+ const workspacePackageJsonPath = join.joinPaths(this.workspaceConfig.workspaceRoot, "package.json");
541
+ if (!exists.existsSync(workspacePackageJsonPath)) {
542
+ throw new Error(`The workspace package.json file could not be found at ${workspacePackageJsonPath}`);
543
+ }
544
+ this.packageJson = await json.readJsonFile(workspacePackageJsonPath);
545
+ this.workspaceConfig.repository ??= isSetString.isSetString(this.packageJson?.repository) ? this.packageJson.repository : this.packageJson?.repository?.url;
546
+ }
547
+ await this.init(this.config.inlineConfig, options);
548
+ }
549
+ /**
550
+ * A logging function for fatal messages
551
+ *
552
+ * @param message - The message to log.
553
+ */
554
+ fatal(message) {
555
+ this.log(types.LogLevelLabel.FATAL, isString.isString(message) ? message : stormJson.StormJSON.stringify(message));
556
+ }
557
+ /**
558
+ * A logging function for error messages
559
+ *
560
+ * @param message - The message to log.
561
+ */
562
+ error(message) {
563
+ this.log(types.LogLevelLabel.ERROR, isString.isString(message) ? message : stormJson.StormJSON.stringify(message));
564
+ }
565
+ /**
566
+ * A logging function for warning messages
567
+ *
568
+ * @param message - The message to log.
569
+ */
570
+ warn(message) {
571
+ this.log(types.LogLevelLabel.WARN, isString.isString(message) ? message : stormJson.StormJSON.stringify(message));
572
+ }
573
+ /**
574
+ * A logging function for informational messages
575
+ *
576
+ * @param message - The message to log.
577
+ */
578
+ info(message) {
579
+ this.log(types.LogLevelLabel.INFO, isString.isString(message) ? message : stormJson.StormJSON.stringify(message));
580
+ }
581
+ /**
582
+ * A logging function for debug messages
583
+ *
584
+ * @param message - The message to log.
585
+ */
586
+ debug(message) {
587
+ this.log(types.LogLevelLabel.DEBUG, isString.isString(message) ? message : stormJson.StormJSON.stringify(message));
588
+ }
589
+ /**
590
+ * A logging function for trace messages
591
+ *
592
+ * @param message - The message to log.
593
+ */
594
+ trace(message) {
595
+ this.log(types.LogLevelLabel.TRACE, isString.isString(message) ? message : stormJson.StormJSON.stringify(message));
596
+ }
597
+ /**
598
+ * Create a new logger instance
599
+ *
600
+ * @param name - The name to use for the logger instance
601
+ * @returns A logger function
602
+ */
603
+ createLog(name = null) {
604
+ return chunkJA4HSQRN_cjs.createLog(name, {
605
+ ...this.config,
606
+ logLevel: isNull.isNull(this.config.logLevel) ? "silent" : this.config.logLevel
607
+ });
608
+ }
609
+ /**
610
+ * Extend the current logger instance with a new name
611
+ *
612
+ * @param name - The name to use for the extended logger instance
613
+ * @returns A logger function
614
+ */
615
+ extendLog(name) {
616
+ return chunkJA4HSQRN_cjs.extendLog(this.log, name);
617
+ }
618
+ /**
619
+ * Creates a new StormContext instance.
620
+ *
621
+ * @param workspaceConfig - The workspace configuration.
622
+ */
623
+ constructor(workspaceConfig) {
624
+ this.#workspaceConfig = workspaceConfig;
625
+ this.#envPaths = getEnvPaths.getEnvPaths({
626
+ orgId: "storm-software",
627
+ appId: "powerlines",
628
+ workspaceRoot: workspaceConfig.workspaceRoot
629
+ });
630
+ }
631
+ /**
632
+ * The resolved configuration for this context
633
+ */
634
+ resolvedConfig = {};
635
+ /**
636
+ * A logger function specific to this context
637
+ */
638
+ logFn;
639
+ /**
640
+ * Generates a checksum representing the current context state
641
+ *
642
+ * @param root - The root directory of the project to generate the checksum for
643
+ * @returns A promise that resolves to a string representing the checksum
644
+ */
645
+ async generateChecksum(root = this.config.projectRoot) {
646
+ this.#checksum = await hashFiles.hashDirectory(root, {
647
+ ignore: [
648
+ "node_modules",
649
+ ".git",
650
+ ".nx",
651
+ ".cache",
652
+ ".storm",
653
+ "tmp",
654
+ "dist"
655
+ ]
656
+ });
657
+ return this.#checksum;
658
+ }
659
+ /**
660
+ * Initialize the context with the provided configuration options
661
+ *
662
+ * @param config - The partial user configuration to use for initialization.
663
+ */
664
+ async init(config = {}, options = {
665
+ isHighPriority: true
666
+ }) {
667
+ const cacheKey = {
668
+ projectRoot: config.root ?? this.config.projectRoot ?? this.config.userConfig?.root ?? this.config.inlineConfig?.root,
669
+ mode: (config.mode ?? this.config.mode) || this.workspaceConfig.mode,
670
+ skipCache: config.skipCache ?? this.config.skipCache ?? false,
671
+ configFile: config.configFile ?? this.config.configFile,
672
+ framework: config.framework ?? this.config.framework ?? "powerlines",
673
+ command: this.config.inlineConfig?.command
674
+ };
675
+ if (configCache.has(cacheKey)) {
676
+ const result = configCache.get(cacheKey);
677
+ this.projectJson = result.projectJson;
678
+ this.packageJson = result.packageJson;
679
+ this.#checksum = result.checksum;
680
+ this.resolver = result.resolver;
681
+ this.mergeUserConfig(result.userConfig.config, this.config.userConfig);
682
+ } else {
683
+ const projectJsonPath = join.joinPaths(cacheKey.projectRoot, "project.json");
684
+ if (exists.existsSync(projectJsonPath)) {
685
+ this.projectJson = await json.readJsonFile(projectJsonPath);
686
+ }
687
+ const packageJsonPath = join.joinPaths(cacheKey.projectRoot, "package.json");
688
+ if (exists.existsSync(packageJsonPath)) {
689
+ this.packageJson = await json.readJsonFile(packageJsonPath);
690
+ }
691
+ this.#checksum = await this.generateChecksum(cacheKey.projectRoot);
692
+ this.resolver = createResolver({
693
+ workspaceRoot: this.workspaceConfig.workspaceRoot,
694
+ projectRoot: cacheKey.projectRoot,
695
+ cacheDir: this.cachePath,
696
+ mode: cacheKey.mode,
697
+ logLevel: config.logLevel || this.config?.logLevel || this.workspaceConfig.logLevel || "info",
698
+ skipCache: cacheKey.skipCache
699
+ });
700
+ const userConfig = await chunkK3NBD5LL_cjs.loadUserConfigFile(cacheKey.projectRoot, this.workspaceConfig.workspaceRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
701
+ this.mergeUserConfig(userConfig.config);
702
+ configCache.set(cacheKey, {
703
+ projectJson: this.projectJson,
704
+ packageJson: this.packageJson,
705
+ checksum: this.#checksum,
706
+ resolver: this.resolver,
707
+ userConfig
708
+ });
709
+ }
710
+ config.tsconfig ??= chunkGA3RXX4R_cjs.getTsconfigFilePath(this.workspaceConfig.workspaceRoot, cacheKey.projectRoot, config.tsconfig);
711
+ if (isSetObject.isSetObject(config)) {
712
+ this.resolvedConfig = defu2__default.default({
713
+ inlineConfig: this.config.inlineConfig,
714
+ userConfig: this.config.userConfig
715
+ }, options.isHighPriority ? this.#getConfigProps(config) : {}, {
716
+ command: this.config.inlineConfig?.command,
717
+ ...this.#getConfigProps(this.config.inlineConfig)
718
+ }, this.#getConfigProps(this.config.userConfig), {
719
+ mode: this.workspaceConfig?.mode,
720
+ logLevel: this.workspaceConfig?.logLevel,
721
+ skipCache: this.workspaceConfig?.skipCache
722
+ }, {
723
+ name: this.projectJson?.name || this.packageJson?.name,
724
+ version: this.packageJson?.version,
725
+ description: this.packageJson?.description,
726
+ sourceRoot: this.projectJson?.sourceRoot || append.appendPath("src", cacheKey.projectRoot),
727
+ output: defu2__default.default(config.output ?? {}, {
728
+ outputPath: cacheKey.projectRoot ? join.joinPaths(this.workspaceConfig?.directories?.build || "dist", cacheKey.projectRoot) : this.workspaceConfig?.directories?.build || "dist",
729
+ artifactsPath: join.joinPaths(cacheKey.projectRoot, `.${config.framework ?? "powerlines"}`),
730
+ dts: join.joinPaths(cacheKey.projectRoot, `${config.framework ?? "powerlines"}.d.ts`),
731
+ builtinPrefix: config.framework ?? "powerlines",
732
+ assets: [
733
+ {
734
+ glob: "LICENSE"
735
+ },
736
+ {
737
+ input: cacheKey.projectRoot,
738
+ glob: "*.md"
739
+ },
740
+ {
741
+ input: cacheKey.projectRoot,
742
+ glob: "package.json"
743
+ }
744
+ ]
745
+ })
746
+ }, options.isHighPriority ? {} : this.#getConfigProps(config), {
747
+ inlineConfig: {},
748
+ userConfig: {},
749
+ framework: "powerlines",
750
+ platform: "neutral",
751
+ mode: "production",
752
+ projectType: "application",
753
+ logLevel: "info",
754
+ preview: false,
755
+ environments: {},
756
+ transform: {
757
+ babel: {
758
+ plugins: [],
759
+ presets: []
760
+ }
761
+ },
762
+ lint: {
763
+ eslint: {}
764
+ },
765
+ build: {
766
+ target: "esnext",
767
+ override: {}
768
+ }
769
+ });
770
+ }
771
+ this.config.entry = chunkN5XEKCVW_cjs.getUniqueEntries(this.config.entry);
772
+ if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) {
773
+ this.config.name = this.config.name.split("/").filter(Boolean)[1];
774
+ }
775
+ this.config.title ??= titleCase.titleCase(this.config.name);
776
+ if (this.config.build.external) {
777
+ this.config.build.external = getUnique.getUnique(this.config.build.external);
778
+ }
779
+ if (this.config.build.noExternal) {
780
+ this.config.build.noExternal = getUnique.getUnique(this.config.build.noExternal);
781
+ }
782
+ this.config.output.format = getUnique.getUnique(toArray.toArray(this.config.output?.format ?? (this.config.projectType === "library" ? [
783
+ "cjs",
784
+ "esm"
785
+ ] : [
786
+ "esm"
787
+ ])));
788
+ if (this.config.projectRoot && this.config.projectRoot !== "." && this.config.projectRoot !== "./" && this.config.projectRoot !== this.workspaceConfig.workspaceRoot) {
789
+ this.config.output.outputPath ??= join.joinPaths("dist", this.config.projectRoot);
790
+ this.config.output.buildPath ??= join.joinPaths(this.config.projectRoot, "dist");
791
+ } else {
792
+ this.config.output.outputPath ??= "dist";
793
+ this.config.output.buildPath ??= "dist";
794
+ }
795
+ this.config.output.assets = getUnique.getUnique(this.config.output.assets.map((asset) => {
796
+ return {
797
+ glob: isSetObject.isSetObject(asset) ? asset.glob : asset,
798
+ input: isString.isString(asset) || !asset.input || asset.input === "." || asset.input === "/" || asset.input === "./" ? this.workspaceConfig.workspaceRoot : append.appendPath(asset.input, this.workspaceConfig.workspaceRoot),
799
+ output: append.appendPath(isSetObject.isSetObject(asset) && asset.output ? join.joinPaths(this.config.output.outputPath, replace.replacePath(asset.output, this.config.output.outputPath)) : this.config.output.outputPath, this.workspaceConfig.workspaceRoot),
800
+ ignore: isSetObject.isSetObject(asset) && asset.ignore ? toArray.toArray(asset.ignore) : void 0
801
+ };
802
+ }));
803
+ this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
804
+ if (isPlugin(plugin) && checkDedupe(plugin, ret.filter((p) => isPlugin(p)))) {
805
+ return ret;
806
+ }
807
+ ret.push(plugin);
808
+ return ret;
809
+ }, []);
810
+ if (this.config.tsconfig) {
811
+ this.config.tsconfig = chunkN5XEKCVW_cjs.replacePathTokens(this, this.config.tsconfig);
812
+ }
813
+ if (this.config.output.dts) {
814
+ this.config.output.dts = chunkN5XEKCVW_cjs.replacePathTokens(this, this.config.output.dts);
815
+ }
816
+ if (this.config.build.polyfill) {
817
+ this.config.build.polyfill = this.config.build.polyfill.map((polyfill) => chunkN5XEKCVW_cjs.replacePathTokens(this, polyfill));
818
+ }
819
+ if (this.config.output.assets) {
820
+ this.config.output.assets = this.config.output.assets.map((asset) => ({
821
+ ...asset,
822
+ glob: chunkN5XEKCVW_cjs.replacePathTokens(this, asset.glob),
823
+ ignore: asset.ignore ? asset.ignore.map((ignore) => chunkN5XEKCVW_cjs.replacePathTokens(this, ignore)) : void 0,
824
+ input: chunkN5XEKCVW_cjs.replacePathTokens(this, asset.input),
825
+ output: chunkN5XEKCVW_cjs.replacePathTokens(this, asset.output)
826
+ }));
827
+ }
828
+ this.#fs ??= await chunkR33US3PV_cjs.VirtualFileSystem.create(this);
829
+ }
830
+ mergeUserConfig(from = {}, into = this.config.userConfig ?? {}) {
831
+ this.config.userConfig = defu2__default.default({
832
+ entry: Array.isArray(from.entry) && from.entry.length > 0 ? from.entry : Array.isArray(into?.entry) && into.entry.length > 0 ? into.entry : []
833
+ }, omit.omit(from ?? {}, [
834
+ "entry"
835
+ ]), omit.omit(into ?? {}, [
836
+ "entry"
837
+ ]));
838
+ if (this.config.userConfig.output?.format) {
839
+ this.config.userConfig.output.format = getUnique.getUnique(toArray.toArray(this.config.userConfig.output?.format));
840
+ }
841
+ this.config.userConfig.plugins = (this.config.userConfig.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
842
+ if (isPlugin(plugin) && checkDedupe(plugin, ret.filter((p) => isPlugin(p)))) {
843
+ return ret;
844
+ }
845
+ ret.push(plugin);
846
+ return ret;
847
+ }, []);
848
+ }
849
+ };
850
+
851
+ exports.PowerlinesContext = PowerlinesContext;
852
+ exports.addPluginHook = addPluginHook;
853
+ exports.checkDedupe = checkDedupe;
854
+ exports.getHookHandler = getHookHandler;
855
+ exports.isHookExternal = isHookExternal;
856
+ exports.isPlugin = isPlugin;
857
+ exports.isPluginConfig = isPluginConfig;
858
+ exports.isPluginConfigObject = isPluginConfigObject;
859
+ exports.isPluginConfigTuple = isPluginConfigTuple;
860
+ exports.isPluginHook = isPluginHook;