powerlines 0.9.0 → 0.10.1

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 (365) hide show
  1. package/dist/astro.cjs +9 -9
  2. package/dist/astro.d.cts +2 -1
  3. package/dist/astro.d.ts +2 -1
  4. package/dist/astro.js +6 -6
  5. package/dist/{chunk-3L4KRPXQ.cjs → chunk-2RHPFVYT.cjs} +17 -18
  6. package/dist/{chunk-VQ5O5N7V.js → chunk-3Y5CCIJR.js} +3 -3
  7. package/dist/{chunk-YE56I7CZ.cjs → chunk-5XYGZ3DC.cjs} +2 -2
  8. package/dist/{chunk-V4TNA6HX.js → chunk-5Y4JYQ66.js} +3 -3
  9. package/dist/{chunk-WM76YQJH.cjs → chunk-66GXB2UY.cjs} +4 -4
  10. package/dist/{chunk-VOB62ELC.js → chunk-6TJGZR5X.js} +4 -4
  11. package/dist/{chunk-OKC6TA7P.js → chunk-6UDHGAAI.js} +3 -3
  12. package/dist/{chunk-ETEQKM36.cjs → chunk-7IWH37DY.cjs} +2 -2
  13. package/dist/{chunk-BDTLKRKQ.js → chunk-EGSEJQCE.js} +3 -3
  14. package/dist/{chunk-ILVCZATT.js → chunk-GPPJ2CRE.js} +2 -2
  15. package/dist/{chunk-RGJMMCOR.js → chunk-HVT7PBFF.js} +3 -3
  16. package/dist/chunk-IJBH5OUN.cjs +12 -0
  17. package/dist/chunk-JBTSAOIQ.js +31 -0
  18. package/dist/{chunk-W3NQCDUN.js → chunk-KYGEWAEG.js} +3 -3
  19. package/dist/{chunk-FOLQTZUP.cjs → chunk-L2SAK2JC.cjs} +4 -4
  20. package/dist/chunk-LXMNDUPG.cjs +12 -0
  21. package/dist/{chunk-GHW2FUF5.js → chunk-N7NE3VOU.js} +4 -4
  22. package/dist/{chunk-OEL3BTQP.js → chunk-OYIM2M74.js} +547 -522
  23. package/dist/{chunk-QK36ULYT.cjs → chunk-QHGPZK2H.cjs} +4 -4
  24. package/dist/chunk-RQ4CHMPO.cjs +12 -0
  25. package/dist/chunk-S5QFX2GM.cjs +12 -0
  26. package/dist/{chunk-IOBFVFH2.js → chunk-S746E63M.js} +3 -3
  27. package/dist/{chunk-MKZOY5EV.js → chunk-SDEBJQDT.js} +12 -13
  28. package/dist/chunk-SL3CXJWD.cjs +34 -0
  29. package/dist/{chunk-KC4VY5X4.cjs → chunk-UHCRNFFC.cjs} +9 -9
  30. package/dist/{chunk-ZQZ5ZUGG.cjs → chunk-UTVZVGM3.cjs} +555 -530
  31. package/dist/{chunk-QIKKQQF7.cjs → chunk-UZQYBO6Z.cjs} +4 -4
  32. package/dist/{chunk-65PSZQFC.js → chunk-VIRKTIPK.js} +3 -3
  33. package/dist/{chunk-UYS3BU6I.js → chunk-WCPY7HPU.js} +4 -4
  34. package/dist/{chunk-MMDBMHAW.js → chunk-WPVIF35O.js} +2 -2
  35. package/dist/chunk-YG7U2GIR.cjs +24 -0
  36. package/dist/{chunk-BY4UTCHZ.cjs → chunk-ZBDP43LG.cjs} +6 -6
  37. package/dist/chunk-ZFATNDSY.cjs +12 -0
  38. package/dist/{chunk-C3I5QEF5.js → chunk-ZU4IRZSQ.js} +7 -7
  39. package/dist/define-config.d.cts +2 -1
  40. package/dist/define-config.d.ts +2 -1
  41. package/dist/esbuild.cjs +8 -8
  42. package/dist/esbuild.d.cts +2 -1
  43. package/dist/esbuild.d.ts +2 -1
  44. package/dist/esbuild.js +5 -5
  45. package/dist/extend-plugin.d.cts +2 -1
  46. package/dist/extend-plugin.d.ts +2 -1
  47. package/dist/farm.cjs +4 -4
  48. package/dist/farm.d.cts +2 -1
  49. package/dist/farm.d.ts +2 -1
  50. package/dist/farm.js +3 -3
  51. package/dist/{hooks-D0gf1nT3.d.ts → hooks-BGYnc61f.d.ts} +1 -1
  52. package/dist/{hooks-fVJu9DCF.d.cts → hooks-gk8S8LFP.d.cts} +1 -1
  53. package/dist/index.cjs +27 -27
  54. package/dist/index.d.cts +4 -3
  55. package/dist/index.d.ts +4 -3
  56. package/dist/index.js +18 -18
  57. package/dist/internal/api.cjs +3 -3
  58. package/dist/internal/api.d.cts +3 -2
  59. package/dist/internal/api.d.ts +3 -2
  60. package/dist/internal/api.js +2 -2
  61. package/dist/lib/build/esbuild.cjs +4 -4
  62. package/dist/lib/build/esbuild.d.cts +2 -1
  63. package/dist/lib/build/esbuild.d.ts +2 -1
  64. package/dist/lib/build/esbuild.js +1 -1
  65. package/dist/lib/build/index.cjs +25 -25
  66. package/dist/lib/build/index.d.cts +3 -2
  67. package/dist/lib/build/index.d.ts +3 -2
  68. package/dist/lib/build/index.js +9 -9
  69. package/dist/lib/build/rolldown.cjs +3 -3
  70. package/dist/lib/build/rolldown.d.cts +2 -1
  71. package/dist/lib/build/rolldown.d.ts +2 -1
  72. package/dist/lib/build/rolldown.js +2 -2
  73. package/dist/lib/build/rollup.cjs +3 -3
  74. package/dist/lib/build/rollup.d.cts +2 -1
  75. package/dist/lib/build/rollup.d.ts +2 -1
  76. package/dist/lib/build/rollup.js +1 -1
  77. package/dist/lib/build/rspack.cjs +2 -2
  78. package/dist/lib/build/rspack.d.cts +2 -1
  79. package/dist/lib/build/rspack.d.ts +2 -1
  80. package/dist/lib/build/rspack.js +1 -1
  81. package/dist/lib/build/tsup.cjs +5 -5
  82. package/dist/lib/build/tsup.d.cts +2 -1
  83. package/dist/lib/build/tsup.d.ts +2 -1
  84. package/dist/lib/build/tsup.js +2 -2
  85. package/dist/lib/build/unbuild.cjs +6 -6
  86. package/dist/lib/build/unbuild.d.cts +3 -2
  87. package/dist/lib/build/unbuild.d.ts +3 -2
  88. package/dist/lib/build/unbuild.js +3 -3
  89. package/dist/lib/build/vite.cjs +4 -4
  90. package/dist/lib/build/vite.d.cts +2 -1
  91. package/dist/lib/build/vite.d.ts +2 -1
  92. package/dist/lib/build/vite.js +2 -2
  93. package/dist/lib/build/webpack.cjs +2 -2
  94. package/dist/lib/build/webpack.d.cts +2 -1
  95. package/dist/lib/build/webpack.d.ts +2 -1
  96. package/dist/lib/build/webpack.js +1 -1
  97. package/dist/lib/{chunk-7CZ2QZEV.js → chunk-3I2YOM2E.js} +4 -4
  98. package/dist/lib/chunk-3I2YOM2E.js.map +1 -0
  99. package/dist/lib/{chunk-KAOWUIFH.cjs → chunk-4XUVP2LL.cjs} +3 -3
  100. package/dist/lib/chunk-4XUVP2LL.cjs.map +1 -0
  101. package/dist/lib/{chunk-ZKYZWEHY.cjs → chunk-6U2UX2PX.cjs} +4 -4
  102. package/dist/lib/chunk-6U2UX2PX.cjs.map +1 -0
  103. package/dist/lib/{chunk-VRNWPH35.cjs → chunk-7EAV6Q7B.cjs} +10 -9
  104. package/dist/lib/chunk-7EAV6Q7B.cjs.map +1 -0
  105. package/dist/lib/{chunk-ZYBUJ2HE.js → chunk-CAPN4FSS.js} +7 -7
  106. package/dist/lib/chunk-CAPN4FSS.js.map +1 -0
  107. package/dist/lib/{chunk-LTBRHAQ2.cjs → chunk-GJNFAFKR.cjs} +4 -4
  108. package/dist/lib/chunk-GJNFAFKR.cjs.map +1 -0
  109. package/dist/lib/{chunk-VANFTXBT.cjs → chunk-GWYTWFZE.cjs} +7 -7
  110. package/dist/lib/chunk-GWYTWFZE.cjs.map +1 -0
  111. package/dist/lib/{chunk-DKE25WTL.js → chunk-HQ6TGY34.js} +2 -2
  112. package/dist/lib/chunk-HQ6TGY34.js.map +1 -0
  113. package/dist/lib/{chunk-QSBORJCS.js → chunk-HZDOJWUO.js} +6 -6
  114. package/dist/lib/chunk-HZDOJWUO.js.map +1 -0
  115. package/dist/lib/{chunk-ECJPGNXE.cjs → chunk-IK3ABDPP.cjs} +2 -2
  116. package/dist/lib/chunk-IK3ABDPP.cjs.map +1 -0
  117. package/dist/lib/{chunk-G5DJO4HA.cjs → chunk-JTUL3477.cjs} +5 -5
  118. package/dist/lib/chunk-JTUL3477.cjs.map +1 -0
  119. package/dist/lib/{chunk-E7UTFXPP.js → chunk-KFE2IR3Y.js} +4 -4
  120. package/dist/lib/chunk-KFE2IR3Y.js.map +1 -0
  121. package/dist/lib/{chunk-RY67J24J.js → chunk-KSBESEOF.js} +2 -2
  122. package/dist/lib/chunk-KSBESEOF.js.map +1 -0
  123. package/dist/lib/{chunk-26W3IQT6.js → chunk-LTVWU4J2.js} +5 -5
  124. package/dist/lib/chunk-LTVWU4J2.js.map +1 -0
  125. package/dist/lib/{chunk-GWAVDFOE.js → chunk-M7U5RMK7.js} +8 -6
  126. package/dist/lib/chunk-M7U5RMK7.js.map +1 -0
  127. package/dist/lib/{chunk-YQG6JE5R.cjs → chunk-M7WHFUKR.cjs} +549 -527
  128. package/dist/lib/chunk-M7WHFUKR.cjs.map +1 -0
  129. package/dist/lib/{chunk-EOO7IRCI.js → chunk-MAHHHINV.js} +3 -3
  130. package/dist/lib/chunk-MAHHHINV.js.map +1 -0
  131. package/dist/lib/{chunk-7FQQFIHR.cjs → chunk-NANLYIUO.cjs} +4 -4
  132. package/dist/lib/chunk-NANLYIUO.cjs.map +1 -0
  133. package/dist/lib/{chunk-TNCZYSNV.js → chunk-NE46WXNJ.js} +2 -2
  134. package/dist/lib/chunk-NE46WXNJ.js.map +1 -0
  135. package/dist/lib/{chunk-QGJVGFY4.js → chunk-OF5IJ4WG.js} +6 -6
  136. package/dist/lib/chunk-OF5IJ4WG.js.map +1 -0
  137. package/dist/lib/{chunk-6IEUZ5DZ.js → chunk-PIFE7MUZ.js} +525 -503
  138. package/dist/lib/chunk-PIFE7MUZ.js.map +1 -0
  139. package/dist/lib/{chunk-2ZYHO243.js → chunk-PXSRMP4E.js} +2 -2
  140. package/dist/lib/chunk-PXSRMP4E.js.map +1 -0
  141. package/dist/lib/{chunk-CXYZENE4.js → chunk-Q2L3FNJO.js} +13 -7
  142. package/dist/lib/chunk-Q2L3FNJO.js.map +1 -0
  143. package/dist/lib/{chunk-XFIGAAKN.cjs → chunk-Q2RUDKWY.cjs} +8 -6
  144. package/dist/lib/chunk-Q2RUDKWY.cjs.map +1 -0
  145. package/dist/lib/{chunk-NFDRIBCM.js → chunk-Q3KJZ3B5.js} +5 -7
  146. package/dist/lib/chunk-Q3KJZ3B5.js.map +1 -0
  147. package/dist/lib/{chunk-FHZJQZOE.cjs → chunk-QXJHCA3E.cjs} +7 -7
  148. package/dist/lib/chunk-QXJHCA3E.cjs.map +1 -0
  149. package/dist/lib/{chunk-TZFBE35T.cjs → chunk-RQICHHZM.cjs} +2 -2
  150. package/dist/lib/chunk-RQICHHZM.cjs.map +1 -0
  151. package/dist/lib/{chunk-7MXG5EG2.js → chunk-RXQWNSZX.js} +3 -3
  152. package/dist/lib/chunk-RXQWNSZX.js.map +1 -0
  153. package/dist/lib/{chunk-I6A564OE.cjs → chunk-U36VZLW6.cjs} +2 -2
  154. package/dist/lib/chunk-U36VZLW6.cjs.map +1 -0
  155. package/dist/lib/{chunk-65DUUIIF.cjs → chunk-UQJWVRRE.cjs} +2 -2
  156. package/dist/lib/chunk-UQJWVRRE.cjs.map +1 -0
  157. package/dist/lib/{chunk-XHCRXNQ3.cjs → chunk-V5OY4ALI.cjs} +5 -5
  158. package/dist/lib/chunk-V5OY4ALI.cjs.map +1 -0
  159. package/dist/lib/{chunk-I3I4BYJ4.js → chunk-VJN72T2O.js} +5 -5
  160. package/dist/lib/chunk-VJN72T2O.js.map +1 -0
  161. package/dist/lib/{chunk-KACTPBW2.cjs → chunk-W4OMKQ7W.cjs} +14 -8
  162. package/dist/lib/chunk-W4OMKQ7W.cjs.map +1 -0
  163. package/dist/lib/{chunk-SB3NFYXT.cjs → chunk-XZD7S5TU.cjs} +5 -5
  164. package/dist/lib/chunk-XZD7S5TU.cjs.map +1 -0
  165. package/dist/lib/{chunk-PJKWY74P.js → chunk-YBIWVB66.js} +10 -9
  166. package/dist/lib/chunk-YBIWVB66.js.map +1 -0
  167. package/dist/lib/{chunk-JXIRUV56.js → chunk-YF3YHK4X.js} +5 -5
  168. package/dist/lib/chunk-YF3YHK4X.js.map +1 -0
  169. package/dist/lib/{chunk-TJQEGHJA.cjs → chunk-YVDJCVE5.cjs} +12 -12
  170. package/dist/lib/chunk-YVDJCVE5.cjs.map +1 -0
  171. package/dist/lib/{chunk-M2TB43VG.cjs → chunk-ZP7PDTVE.cjs} +7 -9
  172. package/dist/lib/chunk-ZP7PDTVE.cjs.map +1 -0
  173. package/dist/lib/{config-BOPIY57U.d.cts → config-AuIGsUck.d.cts} +110 -106
  174. package/dist/lib/{config-Chd_3Uh3.d.ts → config-B_WTwd49.d.ts} +110 -106
  175. package/dist/lib/config-file.d.cts +2 -1
  176. package/dist/lib/config-file.d.ts +2 -1
  177. package/dist/lib/entry.d.cts +2 -1
  178. package/dist/lib/entry.d.ts +2 -1
  179. package/dist/lib/{hooks-DkVRKYVN.d.cts → hooks-4KkL9GD2.d.cts} +1 -1
  180. package/dist/lib/{hooks-56fQP2HY.d.ts → hooks-DErK4Fv4.d.ts} +1 -1
  181. package/dist/lib/index.cjs +36 -36
  182. package/dist/lib/index.d.cts +3 -2
  183. package/dist/lib/index.d.ts +3 -2
  184. package/dist/lib/index.js +11 -11
  185. package/dist/lib/logger.d.cts +2 -1
  186. package/dist/lib/logger.d.ts +2 -1
  187. package/dist/lib/typescript/compiler-host.cjs +6 -6
  188. package/dist/lib/typescript/compiler-host.cjs.map +1 -1
  189. package/dist/lib/typescript/compiler-host.d.cts +2 -1
  190. package/dist/lib/typescript/compiler-host.d.ts +2 -1
  191. package/dist/lib/typescript/compiler-host.js +5 -5
  192. package/dist/lib/typescript/compiler-host.js.map +1 -1
  193. package/dist/lib/typescript/import-transformer.cjs +1 -1
  194. package/dist/lib/typescript/import-transformer.cjs.map +1 -1
  195. package/dist/lib/typescript/import-transformer.d.cts +2 -1
  196. package/dist/lib/typescript/import-transformer.d.ts +2 -1
  197. package/dist/lib/typescript/import-transformer.js +1 -1
  198. package/dist/lib/typescript/import-transformer.js.map +1 -1
  199. package/dist/lib/typescript/index.cjs +6 -6
  200. package/dist/lib/typescript/index.d.cts +2 -1
  201. package/dist/lib/typescript/index.d.ts +2 -1
  202. package/dist/lib/typescript/index.js +1 -1
  203. package/dist/lib/typescript/program.cjs +6 -6
  204. package/dist/lib/typescript/program.d.cts +2 -1
  205. package/dist/lib/typescript/program.d.ts +2 -1
  206. package/dist/lib/typescript/program.js +1 -1
  207. package/dist/lib/unplugin/factory.cjs +6 -6
  208. package/dist/lib/unplugin/factory.d.cts +3 -2
  209. package/dist/lib/unplugin/factory.d.ts +3 -2
  210. package/dist/lib/unplugin/factory.js +5 -5
  211. package/dist/lib/unplugin/index.cjs +9 -9
  212. package/dist/lib/unplugin/index.d.cts +3 -2
  213. package/dist/lib/unplugin/index.d.ts +3 -2
  214. package/dist/lib/unplugin/index.js +6 -6
  215. package/dist/lib/unplugin/plugin.cjs +4 -4
  216. package/dist/lib/unplugin/plugin.d.cts +2 -1
  217. package/dist/lib/unplugin/plugin.d.ts +2 -1
  218. package/dist/lib/unplugin/plugin.js +3 -3
  219. package/dist/lib/unplugin/resolve-id.cjs +2 -2
  220. package/dist/lib/unplugin/resolve-id.d.cts +2 -1
  221. package/dist/lib/unplugin/resolve-id.d.ts +2 -1
  222. package/dist/lib/unplugin/resolve-id.js +1 -1
  223. package/dist/lib/utilities/cache.cjs +4 -4
  224. package/dist/lib/utilities/cache.js +2 -2
  225. package/dist/lib/utilities/file-header.d.cts +2 -1
  226. package/dist/lib/utilities/file-header.d.ts +2 -1
  227. package/dist/lib/utilities/index.cjs +24 -24
  228. package/dist/lib/utilities/index.d.cts +2 -1
  229. package/dist/lib/utilities/index.d.ts +2 -1
  230. package/dist/lib/utilities/index.js +7 -7
  231. package/dist/lib/utilities/meta.cjs +8 -8
  232. package/dist/lib/utilities/meta.d.cts +2 -1
  233. package/dist/lib/utilities/meta.d.ts +2 -1
  234. package/dist/lib/utilities/meta.js +1 -1
  235. package/dist/lib/utilities/plugin-helpers.d.cts +2 -1
  236. package/dist/lib/utilities/plugin-helpers.d.ts +2 -1
  237. package/dist/lib/utilities/resolve-path.cjs +2 -2
  238. package/dist/lib/utilities/resolve-path.d.cts +2 -1
  239. package/dist/lib/utilities/resolve-path.d.ts +2 -1
  240. package/dist/lib/utilities/resolve-path.js +1 -1
  241. package/dist/lib/utilities/source-file.cjs +4 -4
  242. package/dist/lib/utilities/source-file.js +1 -1
  243. package/dist/lib/utilities/source-map.cjs +2 -2
  244. package/dist/lib/utilities/source-map.js +1 -1
  245. package/dist/lib/utilities/worker.cjs +3 -3
  246. package/dist/lib/utilities/worker.d.cts +2 -1
  247. package/dist/lib/utilities/worker.d.ts +2 -1
  248. package/dist/lib/utilities/worker.js +1 -1
  249. package/dist/lib/utilities/write-file.cjs +2 -2
  250. package/dist/lib/utilities/write-file.d.cts +2 -1
  251. package/dist/lib/utilities/write-file.d.ts +2 -1
  252. package/dist/lib/utilities/write-file.js +1 -1
  253. package/dist/next.cjs +8 -8
  254. package/dist/next.js +5 -5
  255. package/dist/nuxt.cjs +10 -10
  256. package/dist/nuxt.js +7 -7
  257. package/dist/{resolved-NZTd64-O.d.cts → resolved-CcuVqMqc.d.cts} +28 -3
  258. package/dist/{resolved-DhHHMnUD.d.ts → resolved-Dhscmo3z.d.ts} +28 -3
  259. package/dist/rolldown.cjs +7 -7
  260. package/dist/rolldown.d.cts +2 -1
  261. package/dist/rolldown.d.ts +2 -1
  262. package/dist/rolldown.js +4 -4
  263. package/dist/rollup.cjs +7 -7
  264. package/dist/rollup.d.cts +2 -1
  265. package/dist/rollup.d.ts +2 -1
  266. package/dist/rollup.js +4 -4
  267. package/dist/rspack.cjs +7 -7
  268. package/dist/rspack.d.cts +2 -1
  269. package/dist/rspack.d.ts +2 -1
  270. package/dist/rspack.js +4 -4
  271. package/dist/tsup.cjs +9 -9
  272. package/dist/tsup.js +6 -6
  273. package/dist/types/babel.d.cts +2 -1
  274. package/dist/types/babel.d.ts +2 -1
  275. package/dist/types/commands.d.cts +2 -1
  276. package/dist/types/commands.d.ts +2 -1
  277. package/dist/types/compiler.d.cts +2 -1
  278. package/dist/types/compiler.d.ts +2 -1
  279. package/dist/types/config.d.cts +2 -1
  280. package/dist/types/config.d.ts +2 -1
  281. package/dist/types/context.cjs +2 -2
  282. package/dist/types/context.d.cts +2 -1
  283. package/dist/types/context.d.ts +2 -1
  284. package/dist/types/context.js +1 -1
  285. package/dist/types/hooks.d.cts +2 -1
  286. package/dist/types/hooks.d.ts +2 -1
  287. package/dist/types/index.cjs +9 -9
  288. package/dist/types/index.d.cts +3 -2
  289. package/dist/types/index.d.ts +3 -2
  290. package/dist/types/index.js +2 -2
  291. package/dist/types/internal.d.cts +3 -2
  292. package/dist/types/internal.d.ts +3 -2
  293. package/dist/types/plugin.d.cts +2 -1
  294. package/dist/types/plugin.d.ts +2 -1
  295. package/dist/types/resolved.d.cts +2 -1
  296. package/dist/types/resolved.d.ts +2 -1
  297. package/dist/types/unplugin.d.cts +2 -1
  298. package/dist/types/unplugin.d.ts +2 -1
  299. package/dist/types/vfs.cjs +7 -7
  300. package/dist/types/vfs.d.cts +93 -111
  301. package/dist/types/vfs.d.ts +93 -111
  302. package/dist/types/vfs.js +1 -1
  303. package/dist/unloader.cjs +7 -7
  304. package/dist/unloader.d.cts +2 -1
  305. package/dist/unloader.d.ts +2 -1
  306. package/dist/unloader.js +4 -4
  307. package/dist/unplugin.cjs +19 -19
  308. package/dist/unplugin.d.cts +3 -2
  309. package/dist/unplugin.d.ts +3 -2
  310. package/dist/unplugin.js +16 -16
  311. package/dist/vite.cjs +8 -8
  312. package/dist/vite.d.cts +2 -1
  313. package/dist/vite.d.ts +2 -1
  314. package/dist/vite.js +5 -5
  315. package/dist/webpack.cjs +7 -7
  316. package/dist/webpack.d.cts +2 -1
  317. package/dist/webpack.d.ts +2 -1
  318. package/dist/webpack.js +4 -4
  319. package/package.json +9 -9
  320. package/dist/chunk-4JUWHOFJ.cjs +0 -12
  321. package/dist/chunk-ARHKVB3S.cjs +0 -12
  322. package/dist/chunk-JCXSBKRJ.js +0 -31
  323. package/dist/chunk-NRMXL6VA.cjs +0 -34
  324. package/dist/chunk-QKXJRYA5.cjs +0 -12
  325. package/dist/chunk-STLRGAW6.cjs +0 -24
  326. package/dist/chunk-TJIHTRP5.cjs +0 -12
  327. package/dist/chunk-VES34CLG.cjs +0 -12
  328. package/dist/lib/chunk-26W3IQT6.js.map +0 -1
  329. package/dist/lib/chunk-2ZYHO243.js.map +0 -1
  330. package/dist/lib/chunk-65DUUIIF.cjs.map +0 -1
  331. package/dist/lib/chunk-6IEUZ5DZ.js.map +0 -1
  332. package/dist/lib/chunk-7CZ2QZEV.js.map +0 -1
  333. package/dist/lib/chunk-7FQQFIHR.cjs.map +0 -1
  334. package/dist/lib/chunk-7MXG5EG2.js.map +0 -1
  335. package/dist/lib/chunk-CXYZENE4.js.map +0 -1
  336. package/dist/lib/chunk-DKE25WTL.js.map +0 -1
  337. package/dist/lib/chunk-E7UTFXPP.js.map +0 -1
  338. package/dist/lib/chunk-ECJPGNXE.cjs.map +0 -1
  339. package/dist/lib/chunk-EOO7IRCI.js.map +0 -1
  340. package/dist/lib/chunk-FHZJQZOE.cjs.map +0 -1
  341. package/dist/lib/chunk-G5DJO4HA.cjs.map +0 -1
  342. package/dist/lib/chunk-GWAVDFOE.js.map +0 -1
  343. package/dist/lib/chunk-I3I4BYJ4.js.map +0 -1
  344. package/dist/lib/chunk-I6A564OE.cjs.map +0 -1
  345. package/dist/lib/chunk-JXIRUV56.js.map +0 -1
  346. package/dist/lib/chunk-KACTPBW2.cjs.map +0 -1
  347. package/dist/lib/chunk-KAOWUIFH.cjs.map +0 -1
  348. package/dist/lib/chunk-LTBRHAQ2.cjs.map +0 -1
  349. package/dist/lib/chunk-M2TB43VG.cjs.map +0 -1
  350. package/dist/lib/chunk-NFDRIBCM.js.map +0 -1
  351. package/dist/lib/chunk-PJKWY74P.js.map +0 -1
  352. package/dist/lib/chunk-QGJVGFY4.js.map +0 -1
  353. package/dist/lib/chunk-QSBORJCS.js.map +0 -1
  354. package/dist/lib/chunk-RY67J24J.js.map +0 -1
  355. package/dist/lib/chunk-SB3NFYXT.cjs.map +0 -1
  356. package/dist/lib/chunk-TJQEGHJA.cjs.map +0 -1
  357. package/dist/lib/chunk-TNCZYSNV.js.map +0 -1
  358. package/dist/lib/chunk-TZFBE35T.cjs.map +0 -1
  359. package/dist/lib/chunk-VANFTXBT.cjs.map +0 -1
  360. package/dist/lib/chunk-VRNWPH35.cjs.map +0 -1
  361. package/dist/lib/chunk-XFIGAAKN.cjs.map +0 -1
  362. package/dist/lib/chunk-XHCRXNQ3.cjs.map +0 -1
  363. package/dist/lib/chunk-YQG6JE5R.cjs.map +0 -1
  364. package/dist/lib/chunk-ZKYZWEHY.cjs.map +0 -1
  365. package/dist/lib/chunk-ZYBUJ2HE.js.map +0 -1
@@ -35,5 +35,5 @@ function getSourceFile(code, id) {
35
35
  __name(getSourceFile, "getSourceFile");
36
36
 
37
37
  export { getMagicString, getSourceFile, getString };
38
- //# sourceMappingURL=chunk-2ZYHO243.js.map
39
- //# sourceMappingURL=chunk-2ZYHO243.js.map
38
+ //# sourceMappingURL=chunk-PXSRMP4E.js.map
39
+ //# sourceMappingURL=chunk-PXSRMP4E.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-PXSRMP4E.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/compiler\";\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,4 +1,4 @@
1
- import { dtsBundlePlugin } from './chunk-JXIRUV56.js';
1
+ import { dtsBundlePlugin } from './chunk-YF3YHK4X.js';
2
2
  import { __name } from './chunk-7QVYU63E.js';
3
3
  import { getBabelInputPlugin } from '@rollup/plugin-babel';
4
4
  import resolve from '@rollup/plugin-node-resolve';
@@ -25,7 +25,7 @@ function extractRolldownConfig(context) {
25
25
  if (context.config.build.noExternal && toArray(context.config.build.noExternal).includes(source)) {
26
26
  return false;
27
27
  }
28
- if (Array.from(context.fs.builtinIdMap.keys()).includes(source)) {
28
+ if (context.builtins.includes(source)) {
29
29
  return context.config.projectType !== "application";
30
30
  }
31
31
  return !context.config.build.skipNodeModulesBundle;
@@ -36,9 +36,9 @@ function extractRolldownConfig(context) {
36
36
  tsconfig: context.tsconfig.tsconfigFilePath
37
37
  }),
38
38
  aliasPlugin({
39
- entries: context.fs.builtinIdMap.keys().reduce((ret, id) => {
39
+ entries: context.builtins.reduce((ret, id) => {
40
40
  if (!ret.find((e) => e.find === id)) {
41
- const path = context.fs.builtinIdMap.get(id);
41
+ const path = context.fs.ids[id];
42
42
  if (path) {
43
43
  ret.push({
44
44
  find: id,
@@ -76,7 +76,13 @@ function extractRolldownConfig(context) {
76
76
  ]
77
77
  }, context.config.build.variant === "rolldown" || context.config.build.variant === "rollup" ? context.config.override : {}, context.config.build.variant === "vite" ? context.config.override.build?.rollupOptions : {}, {
78
78
  resolve: {
79
- alias: Object.fromEntries(context.fs.builtinIdMap.entries())
79
+ alias: context.builtins.reduce((ret, id) => {
80
+ const path = context.fs.ids[id];
81
+ if (path) {
82
+ ret[id] = path;
83
+ }
84
+ return ret;
85
+ }, {})
80
86
  },
81
87
  platform: context.config.build.platform,
82
88
  tsconfig: context.tsconfig.tsconfigFilePath,
@@ -110,5 +116,5 @@ function extractRolldownConfig(context) {
110
116
  __name(extractRolldownConfig, "extractRolldownConfig");
111
117
 
112
118
  export { extractRolldownConfig };
113
- //# sourceMappingURL=chunk-CXYZENE4.js.map
114
- //# sourceMappingURL=chunk-CXYZENE4.js.map
119
+ //# sourceMappingURL=chunk-Q2L3FNJO.js.map
120
+ //# sourceMappingURL=chunk-Q2L3FNJO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/build/rolldown.ts"],"names":["extractRolldownConfig","context","defu","input","globSync","toArray","config","entry","map","isString","file","flat","external","source","importer","isResolved","externalFn","build","variant","override","isFunction","id","includes","rollupOptions","undefined","noExternal","builtins","projectType","skipNodeModulesBundle","plugins","typescriptPlugin","check","tsconfig","tsconfigFilePath","aliasPlugin","entries","reduce","ret","find","e","path","fs","ids","push","replacement","getBabelInputPlugin","transform","babel","caller","name","supportsStaticESM","cwd","projectRoot","babelrc","extensions","babelHelpers","skipPreflightCheck","exclude","resolve","moduleDirectories","preferBuiltins","dtsBundlePlugin","alias","platform","cache","skipCache","joinPaths","cachePath","output","dir","outputPath","logLevel","sourcemap","mode","minify","jsx","keepNames","treeshake","format","preserveModules"],"mappings":";;;;;;;;;;;;;AA4CO,SAASA,sBACdC,OAAAA,EAAgB;AAEhB,EAAA,OAAOC,IAAAA,CACL;AACEC,IAAAA,KAAAA,EAAOC,SACLC,OAAAA,CAAQJ,OAAAA,CAAQK,MAAAA,CAAOC,KAAK,EAAEC,GAAAA,CAAID,CAAAA,KAAAA,KAChCE,QAAAA,CAASF,KAAAA,CAAAA,GAASA,KAAAA,GAAQA,MA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A,EAAO,CAAC/D,QAAQK,MAAAA,CAAO2D,SAAAA,GACnBC,UAAUjE,OAAAA,CAAQkE,SAAAA,EAAW,UAAA,CAAA,GAC7B,KAAA;IACJC,MAAAA,EAAQ;MACNC,GAAAA,EAAKpE,OAAAA,CAAQK,OAAO8D,MAAAA,CAAOE;AAC7B,KAAA;AACAC,IAAAA,QAAAA,EAAUtE,QAAQK,MAAAA,CAAOiE;GAC3B,EACAtE,OAAAA,CAAQK,MAAAA,CAAOW,KAAAA,CAAMC,OAAAA,KAAY,UAAA,IAC/BjB,QAAQK,MAAAA,CAAOW,KAAAA,CAAMC,OAAAA,KAAY,QAAA,GAC/BjB,OAAAA,CAAQK,MAAAA,CAAOW,QACf,EAAC,EACLhB,OAAAA,CAAQK,MAAAA,CAAOW,KAAAA,CAAMC,OAAAA,KAAY,MAAA,GAC5BjB,OAAAA,CAAQK,MAAAA,CAAOW,KAAAA,CAAkCA,KAAAA,GAClD,EAAC,EACL;IACEmD,MAAAA,EAAQ;MACNI,SAAAA,EAAWvE,OAAAA,CAAQK,OAAOmE,IAAAA,KAAS;AACrC,KAAA;IACAC,MAAAA,EAAQzE,OAAAA,CAAQK,OAAOmE,IAAAA,KAAS;GAClC,EACA;IACEE,GAAAA,EAAK,WAAA;IACLJ,QAAAA,EAAU,QAAA;IACVK,SAAAA,EAAW,IAAA;IACXC,SAAAA,EAAW,IAAA;IACXT,MAAAA,EAAQ;AACN,MAAA;QACEU,MAAAA,EAAQ,IAAA;QACRC,eAAAA,EAAiB;AACnB,OAAA;AACA,MAAA;QACED,MAAAA,EAAQ,KAAA;QACRC,eAAAA,EAAiB;AACnB;;GAEJ,CAAA;AAEJ;AAnMgB/E,MAAAA,CAAAA,qBAAAA,EAAAA,uBAAAA,CAAAA","file":"chunk-Q2L3FNJO.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 {\n getBabelInputPlugin,\n RollupBabelInputPluginOptions\n} from \"@rollup/plugin-babel\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { globSync } from \"node:fs\";\nimport { aliasPlugin } from \"rolldown/experimental\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport {\n RolldownResolvedBuildConfig,\n ViteResolvedBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { dtsBundlePlugin } from \"./rollup\";\n\n/**\n * Resolves the options for [rolldown](https://rolldown.rs).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function extractRolldownConfig(\n context: Context\n): RolldownResolvedBuildConfig {\n return defu(\n {\n input: globSync(\n toArray(context.config.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (\n source: string,\n importer: string | undefined,\n isResolved: boolean\n ) => {\n const externalFn =\n context.config.build.variant === \"rollup\" &&\n context.config.override.external\n ? isFunction(context.config.override.external)\n ? context.config.override.external\n : (id: string) =>\n toArray(\n (\n context.config\n .override as Partial<RolldownResolvedBuildConfig>\n ).external\n ).includes(id)\n : context.config.build.variant === \"vite\" &&\n (context.config.override as ViteResolvedBuildConfig)?.build\n ?.rollupOptions?.external\n ? isFunction(\n (context.config.override as ViteResolvedBuildConfig)?.build\n ?.rollupOptions?.external\n )\n ? (context.config.override as ViteResolvedBuildConfig)?.build\n ?.rollupOptions?.external\n : (id: string) =>\n toArray(\n (context.config.build as ViteResolvedBuildConfig)?.build\n ?.rollupOptions?.external\n ).includes(id)\n : context.config.build.variant === \"rollup\" &&\n context.config.build.external\n ? isFunction(context.config.build.external)\n ? context.config.build.external\n : (id: string) =>\n toArray(\n (context.config.build as RolldownResolvedBuildConfig)\n .external\n ).includes(id)\n : context.config.build.variant === \"vite\" &&\n (context.config.build as ViteResolvedBuildConfig).build\n ?.rollupOptions?.external\n ? isFunction(\n (context.config.build as ViteResolvedBuildConfig).build\n ?.rollupOptions?.external\n )\n ? (context.config.build as ViteResolvedBuildConfig).build\n ?.rollupOptions?.external\n : (id: string) =>\n toArray(\n (context.config.build as ViteResolvedBuildConfig)\n ?.build?.rollupOptions?.external\n ).includes(id)\n : undefined;\n if (\n isFunction(externalFn) &&\n externalFn(source, importer, isResolved)\n ) {\n return true;\n }\n\n if (\n context.config.build.external &&\n toArray(context.config.build.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.build.noExternal &&\n toArray(context.config.build.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.build.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n aliasPlugin({\n entries: context.builtins.reduce(\n (ret, id) => {\n if (!ret.find(e => e.find === id)) {\n const path = context.fs.ids[id];\n if (path) {\n ret.push({ find: id, replacement: path });\n }\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n )\n }),\n getBabelInputPlugin(\n defu(context.config.transform.babel, {\n caller: {\n name: \"powerlines\",\n supportsStaticESM: true\n },\n cwd: context.config.projectRoot,\n babelrc: false,\n extensions: [\".js\", \".jsx\", \".ts\", \".tsx\"],\n babelHelpers: \"bundled\",\n skipPreflightCheck: true,\n exclude: /node_modules/\n }) as RollupBabelInputPluginOptions\n ),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n dtsBundlePlugin\n ]\n },\n context.config.build.variant === \"rolldown\" ||\n context.config.build.variant === \"rollup\"\n ? context.config.override\n : {},\n context.config.build.variant === \"vite\"\n ? (context.config.override as ViteResolvedBuildConfig).build\n ?.rollupOptions\n : {},\n {\n resolve: {\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 },\n platform: context.config.build.platform,\n tsconfig: context.tsconfig.tsconfigFilePath,\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rolldown\")\n : false,\n output: {\n dir: context.config.output.outputPath\n },\n logLevel: context.config.logLevel\n },\n context.config.build.variant === \"rolldown\" ||\n context.config.build.variant === \"rollup\"\n ? context.config.build\n : {},\n context.config.build.variant === \"vite\"\n ? (context.config.build as ViteResolvedBuildConfig).build\n : {},\n {\n output: {\n sourcemap: context.config.mode === \"development\"\n },\n minify: context.config.mode === \"production\"\n },\n {\n jsx: \"automatic\",\n logLevel: \"silent\",\n keepNames: true,\n treeshake: true,\n output: [\n {\n format: \"es\",\n preserveModules: true\n },\n {\n format: \"cjs\",\n preserveModules: true\n }\n ]\n }\n ) as RolldownResolvedBuildConfig;\n}\n"]}
@@ -83,11 +83,13 @@ chunkPK6SKIKE_cjs.__name(getPersistedMeta, "getPersistedMeta");
83
83
  async function writeMetaFile(context) {
84
84
  const metaFilePath = joinPaths.joinPaths(context.dataPath, "meta.json");
85
85
  context.log(types.LogLevelLabel.DEBUG, `Writing runtime metadata to ${metaFilePath}`);
86
- await context.fs.writeFileToDisk(metaFilePath, JSON.stringify({
86
+ await context.fs.writeFile(metaFilePath, JSON.stringify({
87
87
  ...context.meta,
88
- builtinIdMap: Object.fromEntries(context.fs.builtinIdMap.entries()),
89
- virtualFiles: context.fs[__VFS_VIRTUAL__].toJSON(context.artifactsPath)
90
- }, null, 2));
88
+ virtualFiles: context.fs[__VFS_VIRTUAL__].toJSON(context.artifactsPath),
89
+ virtualFilesMeta: context.fs.getPartialMeta()
90
+ }, null, 2), {
91
+ mode: "fs"
92
+ });
91
93
  }
92
94
  chunkPK6SKIKE_cjs.__name(writeMetaFile, "writeMetaFile");
93
95
 
@@ -104,5 +106,5 @@ exports.getChecksum = getChecksum;
104
106
  exports.getPersistedMeta = getPersistedMeta;
105
107
  exports.getPrefixedProjectRootHash = getPrefixedProjectRootHash;
106
108
  exports.writeMetaFile = writeMetaFile;
107
- //# sourceMappingURL=chunk-XFIGAAKN.cjs.map
108
- //# sourceMappingURL=chunk-XFIGAAKN.cjs.map
109
+ //# sourceMappingURL=chunk-Q2RUDKWY.cjs.map
110
+ //# sourceMappingURL=chunk-Q2RUDKWY.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/vfs.ts","../../src/lib/utilities/meta.ts"],"names":["__VFS_INIT__","__VFS_REVERT__","__VFS_CACHE__","__VFS_RESOLVER__","__VFS_VIRTUAL__","__VFS_UNIFIED__","PROJECT_ROOT_HASH_LENGTH","CACHE_HASH_LENGTH","getPrefixedProjectRootHash","name","projectRootHash","combined","kebabCase","length","slice","discoverTemplatePath","path","Promise","all","resolve","test","includes","hasFileExtension","joinPaths","listFiles","flat","filter","Boolean","discoverTemplates","context","paths","getUnique","map","config","sourceRoot","envPaths","projectRoot","reduce","ret","existsSync","push","getChecksum","hashDirectory","ignore","getPersistedMeta","metaFilePath","dataPath","readJsonFile","log","LogLevelLabel","WARN","removeFile","persistedMeta","undefined","writeMetaFile","DEBUG","fs","writeFile","JSON","stringify","meta","virtualFiles","toJSON","artifactsPath","virtualFilesMeta","getPartialMeta","mode"],"mappings":";;;;;;;;;;;;;;;AAoCO,IAAMA,YAAAA,GAAe;AAGrB,IAAMC,cAAAA,GAAiB;AAGvB,IAAMC,aAAAA,GAAgB;AAGtB,IAAMC,gBAAAA,GAAmB;AAGzB,IAAMC,eAAAA,GAAkB;AAGxB,IAAMC,eAAAA,GAAkB;;;AChBxB,IAAMC,wBAA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AAAA,EAAAA,eAAAA,CAAAA","file":"chunk-Q2RUDKWY.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 { PrimitiveJsonValue } from \"@stryke/json/types\";\nimport type { Volume } from \"memfs\";\nimport type {\n MakeDirectoryOptions as FsMakeDirectoryOptions,\n WriteFileOptions as FsWriteFileOptions,\n Mode,\n PathLike,\n PathOrFileDescriptor,\n RmDirOptions,\n RmOptions,\n Stats,\n StatSyncOptions\n} from \"node:fs\";\nimport type { IUnionFs } from \"unionfs\";\n\nexport type VirtualFileExtension = \"js\" | \"ts\" | \"jsx\" | \"tsx\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_INIT__ = \"__VFS_INIT__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_REVERT__ = \"__VFS_REVERT__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_CACHE__ = \"__VFS_CACHE__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_RESOLVER__ = \"__VFS_RESOLVER__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_VIRTUAL__ = \"__VFS_VIRTUAL__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_UNIFIED__ = \"__VFS_UNIFIED__\";\n\nexport type OutputModeType = \"fs\" | \"virtual\";\n\nexport interface VirtualFile {\n /**\n * The unique identifier for the virtual file.\n *\n * @remarks\n * If no specific id is provided, it defaults to the file's {@link path}.\n */\n id: string;\n\n /**\n * Additional metadata associated with the virtual file.\n */\n details: Record<string, PrimitiveJsonValue>;\n\n /**\n * The variant of the file.\n *\n * @remarks\n * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:\n * - `builtin`: Indicates that the file is a built-in module provided by the system.\n * - `entry`: Indicates that the file is an entry point for execution.\n * - `normal`: Indicates that the file is a standard file without any special role.\n */\n variant: string;\n\n /**\n * The output mode of the file.\n *\n * @remarks\n * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).\n */\n mode: OutputModeType;\n\n /**\n * A virtual (or actual) path to the file in the file system.\n */\n path: string;\n\n /**\n * The contents of the file.\n */\n code: string | NodeJS.ArrayBufferView;\n}\n\nexport type VirtualFileSystemMetadata = Pick<\n VirtualFile,\n \"id\" | \"details\" | \"variant\" | \"mode\"\n>;\n\nexport interface ResolveFSOptions {\n mode?: OutputModeType;\n}\n\nexport type MakeDirectoryOptions = (Mode | FsMakeDirectoryOptions) &\n ResolveFSOptions;\n\nexport interface PowerlinesWriteFileOptions extends ResolveFSOptions {\n skipFormat?: boolean;\n}\n\nexport type NodeWriteFileOptions = FsWriteFileOptions;\n\nexport type WriteFileOptions =\n | NodeWriteFileOptions\n | PowerlinesWriteFileOptions;\n\nexport type PowerLinesWriteFileData = Partial<\n Omit<VirtualFile, \"path\" | \"mode\" | \"code\">\n> &\n Pick<VirtualFile, \"code\">;\n\nexport type WriteFileData =\n | string\n | NodeJS.ArrayBufferView\n | PowerLinesWriteFileData;\n\nexport interface ResolvePathOptions extends ResolveFSOptions {\n /**\n * Should the resolved path include the file extension?\n *\n * @defaultValue true\n */\n withExtension?: boolean;\n\n /**\n * The paths to search for the file.\n */\n paths?: string[];\n\n /**\n * The type of the path to resolve.\n */\n type?: \"file\" | \"directory\";\n}\n\nexport interface VirtualFileSystemInterface {\n [__VFS_INIT__]: () => void;\n [__VFS_REVERT__]: () => void;\n\n /**\n * The underlying file metadata.\n */\n meta: Record<string, VirtualFileSystemMetadata | undefined>;\n\n /**\n * A map of module ids to their file paths.\n */\n ids: Record<string, string>;\n\n /**\n * Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.\n *\n * @param pathOrId - The path or id to check.\n * @param options - Optional parameters for resolving the path.\n * @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.\n */\n isVirtual: (pathOrId: string, options?: ResolvePathOptions) => boolean;\n\n /**\n * Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.\n *\n * @param pathOrId - The path or id to check.\n * @param options - Optional parameters for resolving the path.\n * @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.\n */\n isFs: (pathOrId: string, options?: ResolvePathOptions) => boolean;\n\n /**\n * Checks if a file exists in the virtual file system (VFS).\n *\n * @param path - The path of the file to check.\n * @returns `true` if the file exists, otherwise `false`.\n */\n isFile: (path: string) => boolean;\n\n /**\n * Checks if a directory exists in the virtual file system (VFS).\n *\n * @param path - The path of the directory to check.\n * @returns `true` if the directory exists, otherwise `false`.\n */\n isDirectory: (path: string) => boolean;\n\n /**\n * Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.\n *\n * @see https://www.typescriptlang.org/tsconfig#paths\n *\n * @param pathOrId - The path or id to check.\n * @returns Whether the path or id corresponds to a virtual file.\n */\n isTsconfigPath: (pathOrId: string) => boolean;\n\n /**\n * Checks if a file exists in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns `true` if the file exists, otherwise `false`.\n */\n existsSync: (pathOrId: string) => boolean;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @param options - Optional parameters for getting the stats.\n * @returns The stats of the file if it exists, otherwise undefined.\n */\n lstat: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Promise<Stats>;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @param options - Optional parameters for getting the stats.\n * @returns The stats of the file if it exists, otherwise undefined.\n */\n lstatSync: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Stats | undefined;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The stats of the file if it exists, otherwise false.\n */\n stat: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Promise<Stats>;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The stats of the file if it exists, otherwise false.\n */\n statSync: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Stats | undefined;\n\n /**\n * Lists files in a given path.\n *\n * @param path - The path to list files from.\n * @param options - Options for listing files, such as encoding and recursion.\n * @returns An array of file names in the specified path.\n */\n readdirSync: (\n path: string,\n options?:\n | {\n encoding: BufferEncoding | null;\n withFileTypes?: false | undefined;\n recursive?: boolean | undefined;\n }\n | BufferEncoding\n ) => string[];\n\n /**\n * Lists files in a given path.\n *\n * @param path - The path to list files from.\n * @param options - Options for listing files, such as encoding and recursion.\n * @returns An array of file names in the specified path.\n */\n readdir: (\n path: string,\n options?:\n | {\n encoding: BufferEncoding | null;\n withFileTypes?: false | undefined;\n recursive?: boolean | undefined;\n }\n | BufferEncoding\n ) => Promise<string[]>;\n\n /**\n * Removes a file or symbolic link in the virtual file system (VFS).\n *\n * @param path - The path to the file to remove.\n * @returns A promise that resolves when the file is removed.\n */\n unlinkSync: (path: PathLike, options?: ResolveFSOptions) => void;\n\n /**\n * Asynchronously removes a file or symbolic link in the virtual file system (VFS).\n *\n * @param path - The path to the file to remove.\n * @returns A promise that resolves when the file is removed.\n */\n unlink: (path: string, options?: ResolveFSOptions) => Promise<void>;\n\n /**\n * Removes a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n */\n rmdirSync: (path: PathLike, options?: RmDirOptions & ResolveFSOptions) => any;\n\n /**\n * Removes a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.\n */\n rmdir: (\n path: PathLike,\n options?: RmDirOptions & ResolveFSOptions\n ) => Promise<void>;\n\n /**\n * Removes a file in the virtual file system (VFS).\n *\n * @param path - The path to the file to remove.\n * @param options - Options for removing the file.\n * @returns A promise that resolves when the file is removed.\n */\n rm: (path: PathLike, options?: RmOptions & ResolveFSOptions) => Promise<void>;\n\n /**\n * Creates a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.\n */\n mkdirSync: (\n path: PathLike,\n options?: MakeDirectoryOptions\n ) => string | undefined;\n\n /**\n * Creates a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.\n */\n mkdir: (\n path: PathLike,\n options?: MakeDirectoryOptions\n ) => Promise<string | undefined>;\n\n /**\n * Reads a file from the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The contents of the file if it exists, otherwise undefined.\n */\n readFile: (pathOrId: string) => Promise<string | undefined>;\n\n /**\n * Reads a file from the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n */\n readFileSync: (pathOrId: string) => string | undefined;\n\n /**\n * Writes a file to the virtual file system (VFS).\n *\n * @param path - The path to the file.\n * @param data - The contents of the file.\n * @param options - Optional parameters for writing the file.\n * @returns A promise that resolves when the file is written.\n */\n writeFile: (\n path: PathOrFileDescriptor,\n data?: WriteFileData,\n options?: WriteFileOptions\n ) => Promise<void>;\n\n /**\n * Writes a file to the virtual file system (VFS).\n *\n * @param path - The path to the file.\n * @param data - The contents of the file.\n * @param options - Optional parameters for writing the file.\n */\n writeFileSync: (\n path: PathOrFileDescriptor,\n data?: WriteFileData,\n options?: WriteFileOptions\n ) => void;\n\n /**\n * Resolves a path or id to a file path in the virtual file system.\n *\n * @param pathOrId - The path or id of the file to resolve.\n * @param options - Optional parameters for resolving the path.\n * @returns The resolved path of the file if it exists, otherwise false.\n */\n resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;\n\n /**\n * Resolves a path based on TypeScript's `tsconfig.json` paths.\n *\n * @see https://www.typescriptlang.org/tsconfig#paths\n *\n * @param path - The path to check.\n * @returns The resolved file path if it exists, otherwise undefined.\n */\n resolveTsconfigPath: (path: string) => string | false;\n\n /**\n * Resolves a package name based on TypeScript's `tsconfig.json` paths.\n *\n * @see https://www.typescriptlang.org/tsconfig#paths\n *\n * @param path - The path to check.\n * @returns The resolved package name if it exists, otherwise undefined.\n */\n resolveTsconfigPathPackage: (path: string) => string | false;\n\n /**\n * Resolves a path or id to a file path in the virtual file system.\n *\n * @param pathOrId - The path or id of the file to resolve.\n * @returns The resolved path of the file if it exists, otherwise false.\n */\n realpathSync: (pathOrId: string) => string;\n\n /**\n * Retrieves a partial metadata mapping of all files in the virtual file system (VFS).\n *\n * @returns A record mapping file paths to their partial metadata.\n */\n getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;\n\n /**\n * A map of cached file paths to their underlying file content.\n */\n [__VFS_CACHE__]: Map<string, string>;\n\n /**\n * A reference to the underlying virtual file system.\n */\n [__VFS_VIRTUAL__]: Volume;\n\n /**\n * A reference to the underlying unified file system.\n */\n [__VFS_UNIFIED__]: IUnionFs;\n}\n","/* -------------------------------------------------------------------\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 { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFile } from \"@stryke/fs/json\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { removeFile } from \"@stryke/fs/remove-file\";\nimport { hashDirectory } from \"@stryke/hash/hash-files\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { Context, MetaInfo } from \"../../types/context\";\nimport { __VFS_VIRTUAL__ } from \"../../types/vfs\";\n\nexport interface CreateContextOptions {\n name?: string;\n}\n\nexport const PROJECT_ROOT_HASH_LENGTH = 45;\nexport const CACHE_HASH_LENGTH = 62;\n\n/**\n * Generates a prefixed project root hash object.\n *\n * @remarks\n * This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.\n *\n * @param name - The name of the project.\n * @param projectRootHash - The hash of the project root.\n * @returns An object containing the name and project root hash.\n */\nexport function getPrefixedProjectRootHash(\n name: string,\n projectRootHash: string\n): string {\n const combined = `${kebabCase(name)}_${projectRootHash}`;\n\n return combined.length > PROJECT_ROOT_HASH_LENGTH\n ? combined.slice(0, PROJECT_ROOT_HASH_LENGTH)\n : combined;\n}\n\nasync function discoverTemplatePath(path: string): Promise<string[]> {\n return (\n await Promise.all([\n Promise.resolve(/.tsx?$/.test(path) && !path.includes(\"*\") && path),\n Promise.resolve(!hasFileExtension(path) && joinPaths(path, \".ts\")),\n Promise.resolve(!hasFileExtension(path) && joinPaths(path, \".tsx\")),\n Promise.resolve(\n !hasFileExtension(path) && listFiles(joinPaths(path, \"**/*.ts\"))\n ),\n Promise.resolve(\n !hasFileExtension(path) && listFiles(joinPaths(path, \"**/*.tsx\"))\n )\n ])\n )\n .flat()\n .filter(Boolean) as string[];\n}\n\nexport async function discoverTemplates(\n context: Context,\n paths: string[] = []\n): Promise<string[]> {\n return getUnique(\n (\n await Promise.all([\n ...paths.map(discoverTemplatePath),\n discoverTemplatePath(joinPaths(context.config.sourceRoot, \"plugin\")),\n discoverTemplatePath(joinPaths(context.envPaths.config, \"templates\")),\n discoverTemplatePath(joinPaths(context.config.projectRoot, \"templates\"))\n ])\n )\n .flat()\n .reduce((ret, path) => {\n if (existsSync(path)) {\n ret.push(path);\n }\n\n return ret;\n }, [] as string[])\n );\n}\n\nexport async function getChecksum(path: string): Promise<string> {\n return hashDirectory(path, {\n ignore: [\"node_modules\", \".git\", \".nx\", \".cache\", \".storm\", \"tmp\", \"dist\"]\n });\n}\n\n/**\n * Retrieves the persisted meta information from the context's data path.\n *\n * @param context - The build context.\n * @returns A promise that resolves to the persisted meta information, or undefined if not found.\n */\nexport async function getPersistedMeta(\n context: Context\n): Promise<MetaInfo | undefined> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n if (existsSync(metaFilePath)) {\n try {\n return await readJsonFile<MetaInfo>(metaFilePath);\n } catch {\n context.log(\n LogLevelLabel.WARN,\n `Failed to read meta file at ${metaFilePath}. It may be corrupted.`\n );\n await removeFile(metaFilePath);\n\n context.persistedMeta = undefined;\n }\n }\n\n return undefined;\n}\n\n/**\n * Writes the meta file for the context.\n *\n * @param context - The context to write the meta file for.\n * @returns A promise that resolves when the meta file has been written.\n */\nexport async function writeMetaFile(context: Context): Promise<void> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n\n context.log(\n LogLevelLabel.DEBUG,\n `Writing runtime metadata to ${metaFilePath}`\n );\n\n await context.fs.writeFile(\n metaFilePath,\n JSON.stringify(\n {\n ...context.meta,\n virtualFiles: context.fs[__VFS_VIRTUAL__].toJSON(context.artifactsPath),\n virtualFilesMeta: context.fs.getPartialMeta()\n },\n null,\n 2\n ),\n {\n mode: \"fs\"\n }\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { handleResolveId } from './chunk-PJKWY74P.js';
1
+ import { handleResolveId } from './chunk-YBIWVB66.js';
2
2
  import { extendLog } from './chunk-35EO5Y7R.js';
3
- import { getString } from './chunk-2ZYHO243.js';
3
+ import { getString } from './chunk-PXSRMP4E.js';
4
4
  import { __name } from './chunk-7QVYU63E.js';
5
5
  import { LogLevelLabel } from '@storm-software/config-tools/types';
6
6
  import { omit } from '@stryke/helpers/omit';
@@ -76,9 +76,7 @@ function createUnplugin(context, options = {}) {
76
76
  return result;
77
77
  }
78
78
  if (id) {
79
- const resolvedPath = ctx.fs.resolvePath(id, {
80
- type: "file"
81
- });
79
+ const resolvedPath = ctx.fs.resolve(id);
82
80
  if (resolvedPath) {
83
81
  return ctx.fs.readFile(resolvedPath);
84
82
  }
@@ -159,5 +157,5 @@ function createUnplugin(context, options = {}) {
159
157
  __name(createUnplugin, "createUnplugin");
160
158
 
161
159
  export { createUnplugin };
162
- //# sourceMappingURL=chunk-NFDRIBCM.js.map
163
- //# sourceMappingURL=chunk-NFDRIBCM.js.map
160
+ //# sourceMappingURL=chunk-Q3KJZ3B5.js.map
161
+ //# sourceMappingURL=chunk-Q3KJZ3B5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/unplugin/plugin.ts"],"names":["createUnplugin","context","options","ctx","log","extendLog","LogLevelLabel","DEBUG","buildStart","$$internal","callHook","sequential","resolveId","id","importer","opts","isEntry","result","order","handleResolveId","skipResolve","skipNodeModulesBundle","config","build","external","noExternal","load","resolvedPath","fs","resolve","readFile","transform","code","transformed","handler","environment","selectHooks","apply","defu","omit","getString","buildFinish","writeBundle","name","filter","include","vite","sharedDuringBuild","error","FATAL","message"],"mappings":";;;;;;;;AAqDO,SAASA,cAAAA,CACdC,OAAAA,EACAC,OAAAA,GAAiC,EAAC,EAAC;AAEnC,EAAA,MAAMC,GAAAA,GAAMF,OAAAA;AAEZ,EAAA,OAAO,MAAA;AACL,IAAA,MAAMG,GAAA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AAAA,CAAAA,WAAAA,EAAAA,aAAAA,CAAAA;AAQf,MAAA,eAAeC,WAAAA,GAAAA;AACbtC,QAAAA,GAAAA,CAAIE,aAAAA,CAAcC,OAAO,yCAAA,CAAA;AAEzB,QAAA,OAAOJ,GAAAA,CAAIM,UAAAA,CAAWC,QAAAA,CAAS,aAAA,EAAe;UAC5CC,UAAAA,EAAY;SACd,CAAA;AACF,MAAA;AANe+B,MAAAA,MAAAA,CAAAA,WAAAA,EAAAA,aAAAA,CAAAA;AAQf,MAAA,OAAO;QACLC,IAAAA,EAAM,YAAA;QACN/B,SAAAA,EAAW;UACTgC,MAAAA,EAAQ;YACN/B,EAAAA,EAAI;cACFgC,OAAAA,EAAS;AAAC,gBAAA;;AACZ;AACF,WAAA;UACAX,OAAAA,EAAStB;AACX,SAAA;QACAc,IAAAA,EAAM;UACJkB,MAAAA,EAAQ;YACN/B,EAAAA,EAAI;cACFgC,OAAAA,EAAS;AAAC,gBAAA;;AACZ;AACF,WAAA;UACAX,OAAAA,EAASR;AACX,SAAA;AACAK,QAAAA,SAAAA;AACAvB,QAAAA,UAAAA;AACAiC,QAAAA,WAAAA;AACAC,QAAAA,WAAAA;QACAI,IAAAA,EAAM;UACJC,iBAAAA,EAAmB;AACrB;AACF,OAAA;AACF,IAAA,CAAA,CAAA,OAASC,KAAAA,EAAO;AACd5C,MAAAA,GAAAA,CAAIE,aAAAA,CAAc2C,KAAAA,EAAQD,KAAAA,EAAiBE,OAAAA,CAAAA;AAE3C,MAAA,MAAMF,KAAAA;AACR,IAAA;AACF,EAAA,CAAA;AACF;AA/MgBhD,MAAAA,CAAAA,cAAAA,EAAAA,gBAAAA,CAAAA","file":"chunk-Q3KJZ3B5.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 { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport defu from \"defu\";\nimport type {\n ExternalIdResult,\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext,\n UnpluginFactory\n} from \"unplugin\";\nimport { PluginContext } from \"../../types/context\";\nimport { UNSAFE_PluginContext } from \"../../types/internal\";\nimport { extendLog } from \"../logger\";\nimport { getString } from \"../utilities/source-file\";\nimport { handleResolveId } from \"./resolve-id\";\n\nexport interface CreateUnpluginOptions {\n /**\n * If true, skips the plugin resolution step.\n *\n * @remarks\n * This value should be set to `true` when using a build tool that handles `external` and `noExternal` options itself (for example `tsup`).\n *\n * @defaultValue false\n */\n skipResolve?: boolean;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @param options - Options for creating the unplugin.\n * @returns The unplugin instance.\n */\nexport function createUnplugin<TContext extends PluginContext = PluginContext>(\n context: TContext,\n options: CreateUnpluginOptions = {}\n): UnpluginFactory<object> {\n const ctx = context as unknown as UNSAFE_PluginContext;\n\n return () => {\n const log = extendLog(ctx.log, \"unplugin\");\n log(LogLevelLabel.DEBUG, \"Initializing Unplugin\");\n\n try {\n async function buildStart(this: UnpluginBuildContext) {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin starting...\");\n\n await ctx.$$internal.callHook(\"buildStart\", {\n sequential: true\n });\n }\n\n async function resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ): Promise<string | ExternalIdResult | null | undefined> {\n let result = await ctx.$$internal.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n id,\n importer,\n opts\n );\n if (result) {\n return result;\n }\n\n result = await ctx.$$internal.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n id,\n importer,\n opts\n );\n if (result) {\n return result;\n }\n\n result = await handleResolveId(\n ctx,\n {\n id,\n importer,\n options: opts\n },\n {\n skipResolve: options.skipResolve,\n skipNodeModulesBundle: ctx.config.build.skipNodeModulesBundle,\n external: ctx.config.build.external,\n noExternal: ctx.config.build.noExternal\n }\n );\n if (result) {\n return result;\n }\n\n return ctx.$$internal.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n id,\n importer,\n opts\n );\n }\n\n async function load(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let result = await ctx.$$internal.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n id\n );\n if (result) {\n return result;\n }\n\n result = await ctx.$$internal.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n id\n );\n if (result) {\n return result;\n }\n\n if (id) {\n const resolvedPath = ctx.fs.resolve(id);\n if (resolvedPath) {\n return ctx.fs.readFile(resolvedPath);\n }\n }\n\n return ctx.$$internal.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n id\n );\n }\n\n async function transform(\n this: UnpluginBuildContext & UnpluginContext,\n code: string,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let transformed: TransformResult | string = code;\n\n for (const handler of ctx.$$internal.environment.selectHooks(\n \"transform\"\n )) {\n const result: TransformResult | string | undefined =\n await handler.apply(defu(ctx, omit(this, [\"parse\"])), [\n getString(transformed),\n id\n ]);\n if (result) {\n transformed = result;\n }\n }\n\n return transformed;\n }\n\n async function buildFinish(this: UnpluginBuildContext): Promise<void> {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin finishing...\");\n\n return ctx.$$internal.callHook(\"buildFinish\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n log(LogLevelLabel.DEBUG, \"Finalizing Powerlines project output...\");\n\n return ctx.$$internal.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return {\n name: \"powerlines\",\n resolveId: {\n filter: {\n id: {\n include: [/.*/]\n }\n },\n handler: resolveId\n },\n load: {\n filter: {\n id: {\n include: [/.*/]\n }\n },\n handler: load\n },\n transform,\n buildStart,\n buildFinish,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkLTBRHAQ2_cjs = require('./chunk-LTBRHAQ2.cjs');
3
+ var chunkGJNFAFKR_cjs = require('./chunk-GJNFAFKR.cjs');
4
4
  var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
5
5
  var constants = require('@storm-software/tsup/constants');
6
6
  var defu = require('defu');
@@ -28,19 +28,19 @@ var DEFAULT_TSUP_CONFIG = {
28
28
  banner: {}
29
29
  };
30
30
  function resolveTsupEntry(context, entryPoints) {
31
- return chunkLTBRHAQ2_cjs.resolveESBuildEntry(context, entryPoints);
31
+ return chunkGJNFAFKR_cjs.resolveESBuildEntry(context, entryPoints);
32
32
  }
33
33
  chunkPK6SKIKE_cjs.__name(resolveTsupEntry, "resolveTsupEntry");
34
34
  function extractTsupConfig(context) {
35
35
  return defu__default.default({
36
- alias: context.fs.builtinIdMap.keys().reduce((ret, id) => {
37
- const path = context.fs.builtinIdMap.get(id);
36
+ alias: context.builtins.reduce((ret, id) => {
37
+ const path = context.fs.ids[id];
38
38
  if (path) {
39
39
  ret[id] = path;
40
40
  }
41
41
  return ret;
42
42
  }, {}),
43
- noExternal: Array.from(context.fs.builtinIdMap.keys())
43
+ noExternal: context.builtins
44
44
  }, context.config.build.variant === "tsup" ? context.config.override : {}, {
45
45
  name: context.config.name,
46
46
  assets: context.config.output.assets,
@@ -69,5 +69,5 @@ chunkPK6SKIKE_cjs.__name(extractTsupConfig, "extractTsupConfig");
69
69
  exports.DEFAULT_TSUP_CONFIG = DEFAULT_TSUP_CONFIG;
70
70
  exports.extractTsupConfig = extractTsupConfig;
71
71
  exports.resolveTsupEntry = resolveTsupEntry;
72
- //# sourceMappingURL=chunk-FHZJQZOE.cjs.map
73
- //# sourceMappingURL=chunk-FHZJQZOE.cjs.map
72
+ //# sourceMappingURL=chunk-QXJHCA3E.cjs.map
73
+ //# sourceMappingURL=chunk-QXJHCA3E.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/build/tsup.ts"],"names":["DEFAULT_TSUP_CONFIG","DEFAULT_BUILD_OPTIONS","platform","target","config","clean","minify","sourcemap","cjsInterop","bundle","dts","shims","silent","treeshake","keepNames","splitting","banner","resolveTsupEntry","context","entryPoints","resolveESBuildEntry","extractTsupConfig","defu","alias","builtins","reduce","ret","id","path","fs","ids","noExternal","build","variant","override","name","assets","output","external","skipNodeModulesBundle","outputPath","projectRoot","tsconfig","tsconfigFilePath","tsconfigRaw","tsconfigJson","format","mode","treeShaking","undefined","metafile","projectType","logLevel","verbose"],"mappings":";;;;;;;;;;;AA8BO,IAAMA,mBAAAA,GAAgD;EAC3D,GAAGC,+BAAAA;EACHC,QAAAA,EAAU,SAAA;EACVC,MAAAA,EAAQ,QAAA;EACRC,MAAAA,EAAQ,KAAA;EACRC,KAAAA,EAAO,KAAA;EACPC,MAAAA,EAAQ,IAAA;EACRC,SAAAA,EAAW,KAAA;EACXC,UAAAA,EAAY,IAAA;EACZC,MAAAA,EAAQ,IAAA;EACRC,GAAAA,EAAK,IAAA;EACLC,KAAAA,EAAO,IAAA;EACPC,MAAAA,EAAQ,IAAA;EACRC,SAAAA,EAAW,IAAA;EACXC,SAAAA,EAAW,IAAA;EACXC,SAAAA,EAAW,IAAA;AACXC,EAAAA,MAAAA,EAAQ;AACV;AASO,SAASC,gBAAAA,CACdC,SACAC,W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,EACA/C,mBAAAA,CAAAA;AAEJ;AArDgBqB,wBAAAA,CAAAA,iBAAAA,EAAAA,mBAAAA,CAAAA","file":"chunk-QXJHCA3E.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 { AssetGlob, Entry } from \"@storm-software/build-tools/types\";\nimport { DEFAULT_BUILD_OPTIONS } from \"@storm-software/tsup/constants\";\nimport defu from \"defu\";\nimport {\n ESBuildBuildConfig,\n TsupBuildConfig,\n TsupResolvedBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { ResolvedEntryTypeDefinition } from \"../../types/resolved\";\nimport { resolveESBuildEntry } from \"./esbuild\";\n\nexport const DEFAULT_TSUP_CONFIG: Partial<TsupBuildConfig> = {\n ...DEFAULT_BUILD_OPTIONS,\n platform: \"neutral\",\n target: \"esnext\",\n config: false,\n clean: false,\n minify: true,\n sourcemap: false,\n cjsInterop: true,\n bundle: true,\n dts: true,\n shims: true,\n silent: true,\n treeshake: true,\n keepNames: true,\n splitting: true,\n banner: {}\n};\n\n/**\n * Resolves the entry options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveTsupEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[]\n): Entry {\n return resolveESBuildEntry(context, entryPoints) as Entry;\n}\n\n/**\n * Resolves the options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function extractTsupConfig(context: Context): TsupResolvedBuildConfig {\n return defu(\n {\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 === \"tsup\" ? context.config.override : {},\n {\n name: context.config.name,\n assets: context.config.output.assets as (string | AssetGlob)[],\n external: context.config.build.external,\n noExternal: context.config.build.noExternal,\n skipNodeModulesBundle: context.config.build.skipNodeModulesBundle,\n outputPath: context.config.output.outputPath,\n projectRoot: context.config.projectRoot,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson,\n format: context.config.output.format,\n mode: context.config.mode,\n platform: context.config.build.platform,\n treeshake:\n context.config.build.variant === \"tsup\"\n ? (context.config.build as TsupBuildConfig)?.treeshake\n : context.config.build.variant === \"tsup\"\n ? (context.config.build as ESBuildBuildConfig)?.treeShaking\n : undefined\n },\n context.config.build.variant === \"tsup\" ? context.config.build : {},\n {\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n dts: context.config.projectType !== \"application\",\n silent:\n context.config.logLevel === \"silent\" ||\n context.config.mode === \"production\",\n verbose:\n context.config.logLevel === \"all\" ||\n context.config.logLevel === \"trace\" ||\n context.config.mode === \"development\"\n },\n DEFAULT_TSUP_CONFIG\n );\n}\n"]}
@@ -25,5 +25,5 @@ ${error?.message ? error.message : ""}`);
25
25
  chunkPK6SKIKE_cjs.__name(writeFile, "writeFile");
26
26
 
27
27
  exports.writeFile = writeFile;
28
- //# sourceMappingURL=chunk-TZFBE35T.cjs.map
29
- //# sourceMappingURL=chunk-TZFBE35T.cjs.map
28
+ //# sourceMappingURL=chunk-RQICHHZM.cjs.map
29
+ //# sourceMappingURL=chunk-RQICHHZM.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utilities/write-file.ts"],"names":["writeFile","log","filepath","content","skipFormat","writeFileBase","config","resolveConfig","formatted","format","error","LogLevelLabel","ERROR","message"],"mappings":";;;;;;;AA+BA,eAAsBA,SAAAA,CACpBC,GAAAA,EACAC,QAAAA,EACAC,OAAAA,EACAC,aAAa,KAAA,EAAK;AAElB,EAAA,IAAI;AACF,IAAA,IAAIA,UAAAA,EAAY;AACd,MAAA,MAAMC,qBAAAA,CAAcH,UAAUC,OAAAA,CAAAA;IAChC,CAAA,MAAO;AACL,MAAA,MAAMG,MAAAA,GAAS,MAAMC,sBAAAA,CAAcL,QAAAA,CAAAA;AACnC,MAAA,MAAMM,SAAAA,GAAY,MAAMC,eAAAA,CAAON,OAAAA,EAAS;AACtC,QAAA,GAAIG,UAAU,EAAC;AACfJ,QAAAA;OACF,CAAA;AAEA,MAAA,MAAMG,qBAAAA,CAAcH,QAAAA,EAAUM,SAAAA,IAAa,EAAA,CAAA;AAC7C,IAAA;AACF,EAAA,CAAA,CAAA,OAASE,KAAAA,EAAO;AACdT,IAAAA,GAAAA,CACEU,mBAAAA,CAAcC,KAAAA,EACd,CAAA,qBAAA,EAAwBV,QAAAA,CAAAA;AAAuBQ,EAAAA,KAAAA,EAAiBG,OAAAA,GAAWH,KAAAA,CAAgBG,OAAAA,GAAU,EAAA,CAAA,CAAI,CAAA;AAE7G,EAAA;AACF;AAxBsBb,wBAAAA,CAAAA,SAAAA,EAAAA,WAAAA,CAAAA","file":"chunk-RQICHHZM.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 { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { writeFile as writeFileBase } from \"@stryke/fs/write-file\";\nimport { format, resolveConfig } from \"prettier\";\nimport type { LogFn } from \"../../types/config\";\n\n/**\n * Writes and formats a file to the file system\n *\n * @param log - The logging function to use for logging errors\n * @param filepath - The file path to write the file\n * @param content - The content to write to the file\n * @param skipFormat - Should the plugin skip formatting the `content` string with Prettier\n */\nexport async function writeFile(\n log: LogFn,\n filepath: string,\n content: string,\n skipFormat = false\n) {\n try {\n if (skipFormat) {\n await writeFileBase(filepath, content);\n } else {\n const config = await resolveConfig(filepath);\n const formatted = await format(content, {\n ...(config ?? {}),\n filepath\n });\n\n await writeFileBase(filepath, formatted || \"\");\n }\n } catch (error) {\n log(\n LogLevelLabel.ERROR,\n `Failed to write file ${filepath} to disk \\n${(error as Error)?.message ? (error as Error).message : \"\"}`\n );\n }\n}\n"]}
@@ -3,7 +3,7 @@ import { resolvePackage } from '@stryke/fs/resolve';
3
3
  import { joinPaths } from '@stryke/path/join-paths';
4
4
 
5
5
  async function resolvePath(context, file) {
6
- let path = context.fs.resolvePath(file);
6
+ let path = context.fs.resolve(file);
7
7
  if (path) {
8
8
  return path;
9
9
  }
@@ -33,5 +33,5 @@ async function resolvePath(context, file) {
33
33
  __name(resolvePath, "resolvePath");
34
34
 
35
35
  export { resolvePath };
36
- //# sourceMappingURL=chunk-7MXG5EG2.js.map
37
- //# sourceMappingURL=chunk-7MXG5EG2.js.map
36
+ //# sourceMappingURL=chunk-RXQWNSZX.js.map
37
+ //# sourceMappingURL=chunk-RXQWNSZX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utilities/resolve-path.ts"],"names":["resolvePath","context","file","path","fs","resolve","existsSync","joinPaths","workspaceConfig","workspaceRoot","config","projectRoot","resolvePackage","paths"],"mappings":";;;;AA6BA,eAAsBA,WAAAA,CACpBC,SACAC,IAAAA,EAAY;AAEZ,EAAA,IAAIC,IAAAA,GAAOF,OAAAA,CAAQG,EAAA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AA","file":"chunk-RXQWNSZX.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 { resolvePackage } from \"@stryke/fs/resolve\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { Context } from \"../../types/context\";\n\n/**\n * Resolves the path of a file in the workspace or project root.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to resolve.\n * @returns A promise that resolves to the resolved path.\n */\nexport async function resolvePath(\n context: Context,\n file: string\n): Promise<string | undefined> {\n let path = context.fs.resolve(file);\n if (path) {\n return path;\n }\n\n path = file;\n if (context.fs.existsSync(path)) {\n return path;\n }\n\n path = joinPaths(context.workspaceConfig.workspaceRoot, file);\n if (context.fs.existsSync(path)) {\n return path;\n }\n\n path = joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n file\n );\n if (context.fs.existsSync(path)) {\n return path;\n }\n\n path = joinPaths(context.config.projectRoot, file);\n if (context.fs.existsSync(path)) {\n return path;\n }\n\n return resolvePackage(file, {\n paths: [\n context.workspaceConfig.workspaceRoot,\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot\n )\n ]\n });\n}\n"]}
@@ -168,5 +168,5 @@ chunkPK6SKIKE_cjs.__name(createWorker, "createWorker");
168
168
 
169
169
  exports.Worker = Worker;
170
170
  exports.createWorker = createWorker;
171
- //# sourceMappingURL=chunk-I6A564OE.cjs.map
172
- //# sourceMappingURL=chunk-I6A564OE.cjs.map
171
+ //# sourceMappingURL=chunk-U36VZLW6.cjs.map
172
+ //# sourceMappingURL=chunk-U36VZLW6.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utilities/worker.ts"],"names":["RESTARTED","Symbol","cleanupWorkers","worker","curWorker","_workerPool","_workers","_child","kill","Worker","workerPath","options","timeout","onRestart","name","context","farmOptions","createLog","restartPromise","resolveRestartPromise","activeTasks","undefined","process","on","close","createWorker","__name","JestWorker","forkOptions","env","POWERLINES_LOCAL","maxRetries","Promise","resolve","enableWorkerThreads","code","signal","LogLevelLabel","ERROR","exit","data","type","onActivity","aborted","onActivityAbort","abortActivityStreamOnLog","Transform","transform","_chunk","_encoding","callback","getStdout","pipe","getStderr","stdout","stderr","onHanging","WARN","end","then","hangingTimer","clearTimeout","setTimeout","method","exposedMethods","startsWith","args","attempts","params","defu","length","result","race","bind","Error","numWorkers","findFileName","withExtension"],"mappings":";;;;;;;;;;AAuCA,IAAMA,SAAAA,GAAYC,OAAO,WAAA,CAAA;AAEzB,IAAMC,cAAAA,6CAAkBC,MAAAA,KAAAA;AACtB,EAAA,KAAA,MAAWC,SAAAA,IAAeD,MAAAA,CAAeE,WAAAA,EAAaC,QAAAA,IAAY,EAAA,EAE7D;AACHF,IAAAA,SAAAA,CAAUG,MAAAA,EAAQC,KAAK,QAAA,CAAA;AACzB,EAAA;AACF,CAAA,EANuB,gBAAA,CAAA;AAQhB,IAAMC,SAAN,MAAMA;EAjDb;;;;;AAkDE,EAAA,OAAA;AAEA,EAAA,IAAA;AAEA,EAAA,WAAA,CACYC,YACAC,OAAAA,EACV;SAFUD,UAAAA,GAAAA,UAAAA;SACAC,OAAAA,GAAAA,OAAAA;AAEV,IAAA,MAAM,EAAEC,SAASC,SAAAA,EAAWC,IAAAA,EAAMC,SAAS,GAAGC,WAAAA,KAAgB,IAAA,CAAKL,OAAAA;AAEnE,IAAA,IAAA,CAAK,IAAA,GAAOM,2BAAAA,CAAUH,IAAAA,IAAQJ,UAAAA,CAAAA;AAE9B,IAAA,IAAIQ,cAAAA;AACJ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AAEAxE,IAAAA,cAAAA,CAAeC,MAAAA,CAAAA;AACf,IAAA,IAAA,CAAK,OAAA,GAAUkB,MAAAA;AACf,IAAA,OAAOlB,OAAOuD,GAAAA,EAAG;AACnB,EAAA;;;;EAKOlC,KAAAA,GAAc;AACnB,IAAA,IAAI,KAAK,OAAA,EAAS;AAChBtB,MAAAA,cAAAA,CAAe,KAAK,OAAO,CAAA;AAC3B,MAAA,KAAK,IAAA,CAAK,QAAQwD,GAAAA,EAAG;AACvB,IAAA;AACF,EAAA;AACF;AAEO,SAASjC,YAAAA,CAGdf,UAAAA,EACAsD,cAAAA,EACAW,UAAAA,GAAa,CAAA,EAAC;AAEd,EAAA,OAAO,IAAIlE,OAAOC,UAAAA,EAAY;AAC5BI,IAAAA,IAAAA,EAAM8D,yBAAalE,UAAAA,EAAY;MAC7BmE,aAAAA,EAAe;KACjB,CAAA;AACAb,IAAAA,cAAAA;AACAW,IAAAA;GACF,CAAA;AACF;AAdgBlD,wBAAAA,CAAAA,YAAAA,EAAAA,cAAAA,CAAAA","file":"chunk-U36VZLW6.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 { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { defu } from \"defu\";\nimport { Worker as JestWorker } from \"jest-worker\";\nimport type { ChildProcess } from \"node:child_process\";\nimport { Transform } from \"node:stream\";\nimport { LogFn } from \"../../types/config\";\nimport { WorkerProcess } from \"../../types/context\";\nimport { createLog } from \"../logger\";\n\nexport type WorkerOptions = ConstructorParameters<typeof JestWorker>[1] & {\n name?: string;\n timeout?: number;\n onActivity?: () => void;\n onActivityAbort?: () => void;\n onRestart?: (method: string, args: any[], attempts: number) => void;\n exposedMethods: ReadonlyArray<string>;\n enableWorkerThreads?: boolean;\n context?: Record<string, any>;\n};\n\nconst RESTARTED = Symbol(\"restarted\");\n\nconst cleanupWorkers = (worker: JestWorker) => {\n for (const curWorker of ((worker as any)._workerPool?._workers || []) as {\n _child?: ChildProcess;\n }[]) {\n curWorker._child?.kill(\"SIGINT\");\n }\n};\n\nexport class Worker {\n #worker: JestWorker | undefined;\n\n #log: LogFn;\n\n public constructor(\n protected workerPath: string,\n protected options: WorkerOptions\n ) {\n const { timeout, onRestart, name, context, ...farmOptions } = this.options;\n\n this.#log = createLog(name || workerPath);\n\n let restartPromise: Promise<typeof RESTARTED>;\n let resolveRestartPromise: (arg: typeof RESTARTED) => void;\n let activeTasks = 0;\n\n this.#worker = undefined;\n\n // ensure we end workers if they weren't before exit\n process.on(\"exit\", () => {\n this.close();\n });\n\n const createWorker = () => {\n this.#worker = new JestWorker(workerPath, {\n ...farmOptions,\n forkOptions: {\n ...farmOptions.forkOptions,\n env: {\n ...((farmOptions.forkOptions?.env ?? {}) as any),\n ...process.env,\n POWERLINES_LOCAL: process.env.POWERLINES_LOCAL || \"0\"\n }\n },\n maxRetries: 0\n });\n restartPromise = new Promise(resolve => {\n resolveRestartPromise = resolve;\n });\n\n /**\n * Jest Worker has two worker types, ChildProcessWorker (uses child_process) and NodeThreadWorker (uses worker_threads)\n * Powerlines uses ChildProcessWorker by default, but it can be switched to NodeThreadWorker with an experimental flag\n *\n * We only want to handle ChildProcessWorker's orphan process issue, so we access the private property \"_child\":\n * https://github.com/facebook/jest/blob/b38d7d345a81d97d1dc3b68b8458b1837fbf19be/packages/jest-worker/src/workers/ChildProcessWorker.ts\n *\n * But this property is not available in NodeThreadWorker, so we need to check if we are using ChildProcessWorker\n */\n if (!farmOptions.enableWorkerThreads) {\n for (const worker of ((this.#worker as any)._workerPool?._workers ||\n []) as {\n _child?: ChildProcess;\n }[]) {\n worker._child?.on(\"exit\", (code, signal) => {\n if ((code || (signal && signal !== \"SIGINT\")) && this.#worker) {\n this.#log(\n LogLevelLabel.ERROR,\n `${this.options.name} worker exited with code: ${code} and signal: ${signal}`\n );\n\n // if a child process doesn't exit gracefully, we want to bubble up the exit code to the parent process\n process.exit(code ?? 1);\n }\n });\n\n // if a child process emits a particular message, we track that as activity\n // so the parent process can keep track of progress\n worker._child?.on(\"message\", ([, data]: [number, unknown]) => {\n if (\n data &&\n typeof data === \"object\" &&\n \"type\" in data &&\n data.type === \"activity\"\n ) {\n // eslint-disable-next-line ts/no-use-before-define\n onActivity();\n }\n });\n }\n }\n\n let aborted = false;\n const onActivityAbort = () => {\n if (!aborted) {\n this.options.onActivityAbort?.();\n aborted = true;\n }\n };\n\n // Listen to the worker's stdout and stderr, if there's any thing logged, abort the activity first\n const abortActivityStreamOnLog = new Transform({\n transform(_chunk, _encoding, callback) {\n onActivityAbort();\n callback();\n }\n });\n // Stop the activity if there's any output from the worker\n this.#worker.getStdout().pipe(abortActivityStreamOnLog);\n this.#worker.getStderr().pipe(abortActivityStreamOnLog);\n\n // Pipe the worker's stdout and stderr to the parent process\n this.#worker.getStdout().pipe(process.stdout);\n this.#worker.getStderr().pipe(process.stderr);\n };\n createWorker();\n\n const onHanging = () => {\n const worker = this.#worker;\n if (!worker) {\n return;\n }\n\n const resolve = resolveRestartPromise;\n createWorker();\n\n this.#log(\n LogLevelLabel.WARN,\n `Sending SIGTERM signal to static worker due to timeout${\n timeout ? ` of ${timeout / 1000} seconds` : \"\"\n }. Subsequent errors may be a result of the worker exiting.`\n );\n\n void worker.end().then(() => {\n resolve(RESTARTED);\n });\n };\n\n let hangingTimer: NodeJS.Timeout | false = false;\n\n const onActivity = () => {\n if (hangingTimer) {\n clearTimeout(hangingTimer);\n }\n if (this.options.onActivity) {\n this.options.onActivity();\n }\n\n hangingTimer = activeTasks > 0 && setTimeout(onHanging, timeout);\n };\n\n for (const method of farmOptions.exposedMethods) {\n if (method.startsWith(\"_\")) {\n continue;\n }\n\n (this as any)[method] = timeout\n ? async (...args: any[]) => {\n activeTasks++;\n try {\n let attempts = 0;\n for (;;) {\n onActivity();\n\n const params = defu(\n args.length > 0 && args[0] ? args[0] : {},\n context ?? {}\n );\n\n const result = await Promise.race([\n // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method](...params),\n restartPromise\n ]);\n if (result !== RESTARTED) {\n return result;\n }\n if (onRestart) {\n onRestart(method, args, ++attempts);\n }\n }\n } finally {\n activeTasks--;\n onActivity();\n }\n }\n : // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method].bind(this.#worker);\n }\n }\n\n public async end(): ReturnType<JestWorker[\"end\"]> {\n const worker = this.#worker;\n if (!worker) {\n throw new Error(\"Farm is ended, no more calls can be done to it\");\n }\n\n cleanupWorkers(worker);\n this.#worker = undefined;\n return worker.end();\n }\n\n /**\n * Quietly end the worker if it exists\n */\n public close(): void {\n if (this.#worker) {\n cleanupWorkers(this.#worker);\n void this.#worker.end();\n }\n }\n}\n\nexport function createWorker<\n TExposedMethods extends ReadonlyArray<string> = ReadonlyArray<string>\n>(\n workerPath: string,\n exposedMethods: TExposedMethods,\n numWorkers = 1\n): WorkerProcess<TExposedMethods> {\n return new Worker(workerPath, {\n name: findFileName(workerPath, {\n withExtension: false\n }),\n exposedMethods,\n numWorkers\n }) as WorkerProcess<TExposedMethods>;\n}\n"]}
@@ -43,5 +43,5 @@ chunkPK6SKIKE_cjs.__name(getSourceFile, "getSourceFile");
43
43
  exports.getMagicString = getMagicString;
44
44
  exports.getSourceFile = getSourceFile;
45
45
  exports.getString = getString;
46
- //# sourceMappingURL=chunk-65DUUIIF.cjs.map
47
- //# sourceMappingURL=chunk-65DUUIIF.cjs.map
46
+ //# sourceMappingURL=chunk-UQJWVRRE.cjs.map
47
+ //# sourceMappingURL=chunk-UQJWVRRE.cjs.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,iBAAAA,CAASD,IAAAA,CAAAA,EAAO;AAClB,IAAA,OAAOA,IAAAA;AACT,EAAA;AAEA,EAAA,IAAIE,uBAAAA,CAAYF,IAAAA,CAAAA,IAAS,MAAA,IAAUA,IAAAA,EAAM;AACvC,IAAA,OAAOA,IAAAA,CAAKA,IAAAA;AACd,EAAA;AAEA,EAAA,OAAOA,KAAKG,QAAAA,EAAQ;AACtB;AAhBgBJ,wBAAAA,CAAAA,SAAAA,EAAAA,WAAAA,CAAAA;AAwBT,SAASK,eAAeJ,IAAAA,EAA0B;AACvD,EAAA,IAAIC,iBAAAA,CAASD,IAAAA,CAAAA,EAAO;AAClB,IAAA,OAAO,IAAIK,6BAAYL,IAAAA,CAAAA;AACzB,EAAA;AAEA,EAAA,OAAOA,IAAAA;AACT;AANgBI,wBAAAA,CAAAA,cAAAA,EAAAA,gBAAAA,CAAAA;AAeT,SAASE,aAAAA,CACdN,MACAO,EAAAA,EAAU;AAEV,EAAA,MAAMC,OAAAA,GAAUR,IAAAA,IAAQS,+BAAAA,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,wBAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"chunk-UQJWVRRE.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 { 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/compiler\";\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"]}
@@ -11,8 +11,8 @@ var defu__default = /*#__PURE__*/_interopDefault(defu);
11
11
  function extractWebpackConfig(context) {
12
12
  return defu__default.default({
13
13
  resolve: {
14
- alias: context.fs.builtinIdMap.keys().reduce((ret, id) => {
15
- const path = context.fs.builtinIdMap.get(id);
14
+ alias: context.builtins.reduce((ret, id) => {
15
+ const path = context.fs.ids[id];
16
16
  if (path) {
17
17
  ret[id] = path;
18
18
  }
@@ -41,7 +41,7 @@ function extractWebpackConfig(context) {
41
41
  recordsInputPath: joinPaths.joinPaths(context.cachePath, "webpack", ".webpack-records.json"),
42
42
  recordsOutputPath: joinPaths.joinPaths(context.cachePath, "webpack", ".webpack-records.json"),
43
43
  context: joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot),
44
- noExternal: Array.from(context.fs.builtinIdMap.keys())
44
+ noExternal: context.builtins
45
45
  }, context.config.build.variant === "webpack" ? context.config.build : {}, {
46
46
  devtool: context.config.mode !== "development" ? false : "source-map",
47
47
  optimization: {
@@ -52,5 +52,5 @@ function extractWebpackConfig(context) {
52
52
  chunkPK6SKIKE_cjs.__name(extractWebpackConfig, "extractWebpackConfig");
53
53
 
54
54
  exports.extractWebpackConfig = extractWebpackConfig;
55
- //# sourceMappingURL=chunk-XHCRXNQ3.cjs.map
56
- //# sourceMappingURL=chunk-XHCRXNQ3.cjs.map
55
+ //# sourceMappingURL=chunk-V5OY4ALI.cjs.map
56
+ //# sourceMappingURL=chunk-V5OY4ALI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/build/webpack.ts"],"names":["extractWebpackConfig","context","defu","resolve","alias","builtins","reduce","ret","id","path","fs","ids","config","build","variant","override","external","noExternal","skipNodeModulesBundle","output","joinPaths","workspaceConfig","workspaceRoot","outputPath","name","node","platform","__dirname","__filename","global","mode","cache","type","cacheDirectory","cachePath","recordsInputPath","recordsOutputPath","projectRoot","devtool","optimization","minimize"],"mappings":";;;;;;;;;;AA6BO,SAASA,qBAAqBC,OAAAA,EAAgB;AACnD,EAAA,OAAOC,qBAAAA,CACL;IACEC,OAAAA,EAAS;AACPC,MAAAA,KAAAA,EAAOH,OAAAA,CAAQI,QAAAA,CAASC,MAAAA,CACtB,CAACC,KAAKC,EAAAA,KAAAA;AACJ,QAAA,MAAMC,IAAAA,GAAOR,OAAAA,CAAQS,EAAAA,CAAGC,GAAAA,CAAIH,EAAAA,CAAAA;AAC5B,QAAA,IAAIC,IAAAA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BhB,mBAAAA,CACjBnB,OAAAA,CAAQiC,SAAAA,EACR,SAAA,EACA,uBAAA,CAAA;AAEFjC,IAAAA,OAAAA,EAASmB,oBACPnB,OAAAA,CAAQoB,eAAAA,CAAgBC,aAAAA,EACxBrB,OAAAA,CAAQW,OAAOyB,WAAW,CAAA;AAE5BpB,IAAAA,UAAAA,EAAYhB,OAAAA,CAAQI;GACtB,EACAJ,OAAAA,CAAQW,OAAOC,KAAAA,CAAMC,OAAAA,KAAY,YAAYb,OAAAA,CAAQW,MAAAA,CAAOC,KAAAA,GAAQ,EAAC,EACrE;AACEyB,IAAAA,OAAAA,EAAUrC,OAAAA,CAAQW,MAAAA,CAAOkB,IAAAA,KAAS,aAAA,GAC9B,KAAA,GACA,YAAA;IACJS,YAAAA,EAAc;MACZC,QAAAA,EAAUvC,OAAAA,CAAQW,OAAOkB,IAAAA,KAAS;AACpC;GACF,CAAA;AAEJ;AAzEgB9B,wBAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA","file":"chunk-V5OY4ALI.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 { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport type { Configuration as ExternalWebpackOptions } from \"webpack\";\nimport { Context } from \"../../types/context\";\n\n/**\n * Resolves the options for [webpack](https://webpack.js.org/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function extractWebpackConfig(context: Context): ExternalWebpackOptions {\n return defu(\n {\n resolve: {\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 }\n },\n context.config.build.variant === \"webpack\" ? context.config.override : {},\n {\n external: context.config.build.external,\n noExternal: context.config.build.noExternal,\n skipNodeModulesBundle: context.config.build.skipNodeModulesBundle\n },\n {\n output: {\n path: joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.output.outputPath\n )\n },\n name: context.config.name,\n node:\n context.config.build.platform === \"node\"\n ? ({\n __dirname: true,\n __filename: true,\n global: true\n } as ExternalWebpackOptions[\"node\"])\n : false,\n mode:\n context.config.mode === \"development\"\n ? (\"development\" as const)\n : (\"production\" as const),\n cache: {\n type: \"filesystem\" as const,\n cacheDirectory: joinPaths(context.cachePath, \"webpack\", \"cache\")\n },\n recordsInputPath: joinPaths(\n context.cachePath,\n \"webpack\",\n \".webpack-records.json\"\n ),\n recordsOutputPath: joinPaths(\n context.cachePath,\n \"webpack\",\n \".webpack-records.json\"\n ),\n context: joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot\n ),\n noExternal: context.builtins\n },\n context.config.build.variant === \"webpack\" ? context.config.build : {},\n {\n devtool: (context.config.mode !== \"development\"\n ? false\n : \"source-map\") as string | false,\n optimization: {\n minimize: context.config.mode !== \"development\"\n }\n }\n );\n}\n"]}
@@ -5,8 +5,8 @@ import defu from 'defu';
5
5
  function extractWebpackConfig(context) {
6
6
  return defu({
7
7
  resolve: {
8
- alias: context.fs.builtinIdMap.keys().reduce((ret, id) => {
9
- const path = context.fs.builtinIdMap.get(id);
8
+ alias: context.builtins.reduce((ret, id) => {
9
+ const path = context.fs.ids[id];
10
10
  if (path) {
11
11
  ret[id] = path;
12
12
  }
@@ -35,7 +35,7 @@ function extractWebpackConfig(context) {
35
35
  recordsInputPath: joinPaths(context.cachePath, "webpack", ".webpack-records.json"),
36
36
  recordsOutputPath: joinPaths(context.cachePath, "webpack", ".webpack-records.json"),
37
37
  context: joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot),
38
- noExternal: Array.from(context.fs.builtinIdMap.keys())
38
+ noExternal: context.builtins
39
39
  }, context.config.build.variant === "webpack" ? context.config.build : {}, {
40
40
  devtool: context.config.mode !== "development" ? false : "source-map",
41
41
  optimization: {
@@ -46,5 +46,5 @@ function extractWebpackConfig(context) {
46
46
  __name(extractWebpackConfig, "extractWebpackConfig");
47
47
 
48
48
  export { extractWebpackConfig };
49
- //# sourceMappingURL=chunk-I3I4BYJ4.js.map
50
- //# sourceMappingURL=chunk-I3I4BYJ4.js.map
49
+ //# sourceMappingURL=chunk-VJN72T2O.js.map
50
+ //# sourceMappingURL=chunk-VJN72T2O.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/build/webpack.ts"],"names":["extractWebpackConfig","context","defu","resolve","alias","builtins","reduce","ret","id","path","fs","ids","config","build","variant","override","external","noExternal","skipNodeModulesBundle","output","joinPaths","workspaceConfig","workspaceRoot","outputPath","name","node","platform","__dirname","__filename","global","mode","cache","type","cacheDirectory","cachePath","recordsInputPath","recordsOutputPath","projectRoot","devtool","optimization","minimize"],"mappings":";;;;AA6BO,SAASA,qBAAqBC,OAAAA,EAAgB;AACnD,EAAA,OAAOC,IAAAA,CACL;IACEC,OAAAA,EAAS;AACPC,MAAAA,KAAAA,EAAOH,OAAAA,CAAQI,QAAAA,CAASC,MAAAA,CACtB,CAACC,KAAKC,EAAAA,KAAAA;AACJ,QAAA,MAAMC,IAAAA,GAAOR,OAAAA,CAAQS,EAAAA,CAAGC,GAAAA,CAAIH,EAAAA,CAAAA;AAC5B,QAAA,IAAIC,IAAAA,EAAM;AACRF,UAAAA,GAAAA,CAAIC,EAAAA,CAAAA,GAAMC,IAAAA;AACZ,QAAA;AAEA,QAAA,OAAOF,GAAAA;AACT,MAAA,CAAA,EACA,EAAC;AAEL;GACF,EACAN,OAAAA,CAAQW,OAAOC,KAAAA,CAAMC,OAAAA,KAAY,YAAYb,OAAAA,CA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AAYhB,OAAAA,CAAQI;GACtB,EACAJ,OAAAA,CAAQW,OAAOC,KAAAA,CAAMC,OAAAA,KAAY,YAAYb,OAAAA,CAAQW,MAAAA,CAAOC,KAAAA,GAAQ,EAAC,EACrE;AACEyB,IAAAA,OAAAA,EAAUrC,OAAAA,CAAQW,MAAAA,CAAOkB,IAAAA,KAAS,aAAA,GAC9B,KAAA,GACA,YAAA;IACJS,YAAAA,EAAc;MACZC,QAAAA,EAAUvC,OAAAA,CAAQW,OAAOkB,IAAAA,KAAS;AACpC;GACF,CAAA;AAEJ;AAzEgB9B,MAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA","file":"chunk-VJN72T2O.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 { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport type { Configuration as ExternalWebpackOptions } from \"webpack\";\nimport { Context } from \"../../types/context\";\n\n/**\n * Resolves the options for [webpack](https://webpack.js.org/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function extractWebpackConfig(context: Context): ExternalWebpackOptions {\n return defu(\n {\n resolve: {\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 }\n },\n context.config.build.variant === \"webpack\" ? context.config.override : {},\n {\n external: context.config.build.external,\n noExternal: context.config.build.noExternal,\n skipNodeModulesBundle: context.config.build.skipNodeModulesBundle\n },\n {\n output: {\n path: joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.output.outputPath\n )\n },\n name: context.config.name,\n node:\n context.config.build.platform === \"node\"\n ? ({\n __dirname: true,\n __filename: true,\n global: true\n } as ExternalWebpackOptions[\"node\"])\n : false,\n mode:\n context.config.mode === \"development\"\n ? (\"development\" as const)\n : (\"production\" as const),\n cache: {\n type: \"filesystem\" as const,\n cacheDirectory: joinPaths(context.cachePath, \"webpack\", \"cache\")\n },\n recordsInputPath: joinPaths(\n context.cachePath,\n \"webpack\",\n \".webpack-records.json\"\n ),\n recordsOutputPath: joinPaths(\n context.cachePath,\n \"webpack\",\n \".webpack-records.json\"\n ),\n context: joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot\n ),\n noExternal: context.builtins\n },\n context.config.build.variant === \"webpack\" ? context.config.build : {},\n {\n devtool: (context.config.mode !== \"development\"\n ? false\n : \"source-map\") as string | false,\n optimization: {\n minimize: context.config.mode !== \"development\"\n }\n }\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkG5DJO4HA_cjs = require('./chunk-G5DJO4HA.cjs');
3
+ var chunkJTUL3477_cjs = require('./chunk-JTUL3477.cjs');
4
4
  var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
5
5
  var pluginBabel = require('@rollup/plugin-babel');
6
6
  var resolve = require('@rollup/plugin-node-resolve');
@@ -33,7 +33,7 @@ function extractRolldownConfig(context) {
33
33
  if (context.config.build.noExternal && toArray.toArray(context.config.build.noExternal).includes(source)) {
34
34
  return false;
35
35
  }
36
- if (Array.from(context.fs.builtinIdMap.keys()).includes(source)) {
36
+ if (context.builtins.includes(source)) {
37
37
  return context.config.projectType !== "application";
38
38
  }
39
39
  return !context.config.build.skipNodeModulesBundle;
@@ -44,9 +44,9 @@ function extractRolldownConfig(context) {
44
44
  tsconfig: context.tsconfig.tsconfigFilePath
45
45
  }),
46
46
  experimental.aliasPlugin({
47
- entries: context.fs.builtinIdMap.keys().reduce((ret, id) => {
47
+ entries: context.builtins.reduce((ret, id) => {
48
48
  if (!ret.find((e) => e.find === id)) {
49
- const path = context.fs.builtinIdMap.get(id);
49
+ const path = context.fs.ids[id];
50
50
  if (path) {
51
51
  ret.push({
52
52
  find: id,
@@ -80,11 +80,17 @@ function extractRolldownConfig(context) {
80
80
  ],
81
81
  preferBuiltins: true
82
82
  }),
83
- chunkG5DJO4HA_cjs.dtsBundlePlugin
83
+ chunkJTUL3477_cjs.dtsBundlePlugin
84
84
  ]
85
85
  }, context.config.build.variant === "rolldown" || context.config.build.variant === "rollup" ? context.config.override : {}, context.config.build.variant === "vite" ? context.config.override.build?.rollupOptions : {}, {
86
86
  resolve: {
87
- alias: Object.fromEntries(context.fs.builtinIdMap.entries())
87
+ alias: context.builtins.reduce((ret, id) => {
88
+ const path = context.fs.ids[id];
89
+ if (path) {
90
+ ret[id] = path;
91
+ }
92
+ return ret;
93
+ }, {})
88
94
  },
89
95
  platform: context.config.build.platform,
90
96
  tsconfig: context.tsconfig.tsconfigFilePath,
@@ -118,5 +124,5 @@ function extractRolldownConfig(context) {
118
124
  chunkPK6SKIKE_cjs.__name(extractRolldownConfig, "extractRolldownConfig");
119
125
 
120
126
  exports.extractRolldownConfig = extractRolldownConfig;
121
- //# sourceMappingURL=chunk-KACTPBW2.cjs.map
122
- //# sourceMappingURL=chunk-KACTPBW2.cjs.map
127
+ //# sourceMappingURL=chunk-W4OMKQ7W.cjs.map
128
+ //# sourceMappingURL=chunk-W4OMKQ7W.cjs.map