powerlines 0.10.0 → 0.10.2

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-UESICHEO.cjs → chunk-2RHPFVYT.cjs} +17 -18
  6. package/dist/{chunk-75B5EPR4.js → chunk-3Y5CCIJR.js} +3 -3
  7. package/dist/{chunk-YE56I7CZ.cjs → chunk-5XYGZ3DC.cjs} +2 -2
  8. package/dist/{chunk-PFCQFK7H.js → chunk-5Y4JYQ66.js} +3 -3
  9. package/dist/{chunk-H2SX5ZYF.cjs → chunk-66GXB2UY.cjs} +4 -4
  10. package/dist/{chunk-VOB62ELC.js → chunk-6TJGZR5X.js} +4 -4
  11. package/dist/{chunk-BWZCYCIF.js → chunk-6UDHGAAI.js} +3 -3
  12. package/dist/{chunk-ETEQKM36.cjs → chunk-7IWH37DY.cjs} +2 -2
  13. package/dist/{chunk-GI35XXXH.js → chunk-EGSEJQCE.js} +3 -3
  14. package/dist/{chunk-ILVCZATT.js → chunk-GPPJ2CRE.js} +2 -2
  15. package/dist/{chunk-54SOH6E5.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-MXYZKFOD.js → chunk-KYGEWAEG.js} +3 -3
  19. package/dist/{chunk-6X6QQH33.cjs → chunk-L2SAK2JC.cjs} +4 -4
  20. package/dist/chunk-LXMNDUPG.cjs +12 -0
  21. package/dist/{chunk-V56DIXOO.js → chunk-N7NE3VOU.js} +4 -4
  22. package/dist/{chunk-D55IOUF3.js → chunk-OYIM2M74.js} +522 -517
  23. package/dist/{chunk-RRGXS7GZ.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-KCDZ3LCF.js → chunk-S746E63M.js} +3 -3
  27. package/dist/{chunk-FBBWXUGK.js → chunk-SDEBJQDT.js} +12 -13
  28. package/dist/chunk-SL3CXJWD.cjs +34 -0
  29. package/dist/{chunk-I5D3SVUH.cjs → chunk-UHCRNFFC.cjs} +9 -9
  30. package/dist/{chunk-5ST7UKJF.cjs → chunk-UTVZVGM3.cjs} +530 -525
  31. package/dist/{chunk-QIKKQQF7.cjs → chunk-UZQYBO6Z.cjs} +4 -4
  32. package/dist/{chunk-YOHDGH77.js → chunk-VIRKTIPK.js} +3 -3
  33. package/dist/{chunk-WAWIGYB4.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-DOBCIS3U.cjs → chunk-ZBDP43LG.cjs} +6 -6
  37. package/dist/chunk-ZFATNDSY.cjs +12 -0
  38. package/dist/{chunk-4R6CQNB2.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-2D74QBNW.cjs → chunk-M7WHFUKR.cjs} +524 -522
  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-WDNYOFEH.js → chunk-PIFE7MUZ.js} +500 -498
  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 -13
  320. package/dist/chunk-6FRFYMLC.cjs +0 -12
  321. package/dist/chunk-6M3HIMSG.cjs +0 -12
  322. package/dist/chunk-6ODSQSQL.cjs +0 -34
  323. package/dist/chunk-HPXUAQCU.cjs +0 -12
  324. package/dist/chunk-KJHDE76P.cjs +0 -24
  325. package/dist/chunk-R5CZG7XN.js +0 -31
  326. package/dist/chunk-RGMGFYXY.cjs +0 -12
  327. package/dist/chunk-TZ4Y7R4G.cjs +0 -12
  328. package/dist/lib/chunk-26W3IQT6.js.map +0 -1
  329. package/dist/lib/chunk-2D74QBNW.cjs.map +0 -1
  330. package/dist/lib/chunk-2ZYHO243.js.map +0 -1
  331. package/dist/lib/chunk-65DUUIIF.cjs.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-WDNYOFEH.js.map +0 -1
  362. package/dist/lib/chunk-XFIGAAKN.cjs.map +0 -1
  363. package/dist/lib/chunk-XHCRXNQ3.cjs.map +0 -1
  364. package/dist/lib/chunk-ZKYZWEHY.cjs.map +0 -1
  365. package/dist/lib/chunk-ZYBUJ2HE.js.map +0 -1
@@ -1 +0,0 @@
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","writeFileToDisk","JSON","stringify","meta","builtinIdMap","Object","fromEntries","entries","virtualFiles","toJSON","artifactsPath"],"mappings":";;;;;;;;;;;;;;;AAmCO,IAAMA,YAAAA,GAAe;AAGrB,IAAMC,cAAAA,GAAiB;AAGvB,IAAMC,aAAAA,GAAgB;AAGtB,IAAMC,gBAAAA,GAAmB;AAGzB,IAAMC,eAAAA,GAAkB;AAGxB,IAAMC,eAAAA,GAAkB;;;ACfxB,IAAMC,wBAAAA,GAA2B;AACjC,IAAMC,iBAAAA,GAAoB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A","file":"chunk-XFIGAAKN.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { 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 interface VirtualFile {\n /**\n * A virtual path to the file in the virtual file system.\n */\n path: string;\n\n /**\n * The contents of the virtual file.\n */\n contents: string;\n}\n\nexport interface VirtualBuiltinFile extends VirtualFile {\n /**\n * The unique identifier for the virtual file.\n *\n * @remarks\n * This property is read-only and is set when the file is created.\n */\n id: string;\n}\n\nexport type OutputModeType = \"fs\" | \"virtual\";\n\nexport interface ResolveFSOptions {\n mode?: OutputModeType;\n}\n\nexport type MakeDirectoryOptions = (Mode | FsMakeDirectoryOptions) &\n ResolveFSOptions;\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 type WriteFileOptions = FsWriteFileOptions & ResolveFSOptions;\n\nexport interface WriteBuiltinFileOptions extends ResolveFSOptions {\n skipFormat?: boolean;\n}\n\nexport interface VirtualFileSystemInterface {\n [__VFS_INIT__]: () => void;\n [__VFS_REVERT__]: () => void;\n\n /**\n * The underlying builtin module Ids.\n */\n builtinIdMap: Map<string, string>;\n\n /**\n * Checks if a path or ID corresponds to a builtin file.\n *\n * @param id - The id of the builtin file to check against.\n * @param pathOrId - The path or id of the file to check.\n * @returns Whether the path or ID corresponds to a builtin file.\n */\n isMatchingBuiltinId: (id: string, pathOrId: string) => boolean;\n\n /**\n * Checks if a provided string is a valid builtin ID (does not need to already be created in the file system).\n *\n * @param id - The ID to check.\n * @returns Whether the ID is a valid builtin ID.\n */\n isValidBuiltinId: (id: string) => boolean;\n\n /**\n * Check if a path or ID corresponds to a virtual file.\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.\n */\n isVirtualFile: (pathOrId: string, options?: ResolvePathOptions) => 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 given path or ID corresponds to a builtin module file.\n */\n isBuiltinFile: (pathOrID: string, options?: ResolvePathOptions) => boolean;\n\n /**\n * Returns a list of builtin module files in the virtual file system.\n */\n listBuiltinFiles: () => Promise<VirtualBuiltinFile[]>;\n\n /**\n * Checks if a file exists in the virtual file system (VFS).\n */\n existsSync: (pathOrId: string) => 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 fileExistsSync: (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 directoryExistsSync: (path: string) => boolean;\n\n /**\n * Checks if a path exists in the virtual file system (VFS).\n *\n * @param path - The path to check.\n * @returns `true` if the path exists, otherwise `false`.\n */\n pathExistsSync: (path: 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 file - 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 file: PathOrFileDescriptor,\n data: string | NodeJS.ArrayBufferView,\n options?: WriteFileOptions\n ) => Promise<void>;\n\n /**\n * Writes a file to the virtual file system (VFS).\n *\n * @param file - 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 file: PathOrFileDescriptor,\n data: string | NodeJS.ArrayBufferView,\n options?: WriteFileOptions\n ) => void;\n\n /**\n * Adds a builtin module file to the virtual file system.\n *\n * @param id - The unique identifier for the builtin module file.\n * @param path - The path to the builtin module file.\n * @param contents - The contents of the builtin module file.\n * @param options - Optional parameters for writing the builtin module file.\n */\n writeBuiltinFile: (\n id: string,\n path: string,\n contents: string,\n options?: WriteBuiltinFileOptions\n ) => Promise<void>;\n\n /**\n * Adds an entry file to the virtual file system.\n *\n * @param name - The unique identifier for the entry file.\n * @param contents - The contents of the entry file.\n * @param options - Optional parameters for writing the entry file.\n */\n writeEntryFile: (\n name: string,\n contents: string,\n options?: WriteBuiltinFileOptions\n ) => Promise<void>;\n\n /**\n * Writes a file to disk from the physical file system (on disk).\n *\n * @param path - The path to the file to write.\n * @param contents - The contents of the file to write.\n * @param options - Optional parameters for writing the file.\n * @returns A promise that resolves when the file is written.\n */\n writeFileToDisk: (\n path: string,\n contents: string,\n options?: { skipFormat?: boolean }\n ) => Promise<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 resolvePath: (\n pathOrId: string,\n options?: ResolvePathOptions\n ) => 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 * Resolves a path or ID to a builtin module file id in the virtual file system.\n *\n * @param pathOrId - The path or id of the file to resolve.\n * @param paths - Optional array of paths to search for the file.\n * @returns The resolved id of the builtin module file if it exists, otherwise false.\n */\n resolveId: (pathOrId: string) => 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 * 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.writeFileToDisk(\n metaFilePath,\n JSON.stringify(\n {\n ...context.meta,\n builtinIdMap: Object.fromEntries(context.fs.builtinIdMap.entries()),\n virtualFiles: context.fs[__VFS_VIRTUAL__].toJSON(context.artifactsPath)\n },\n null,\n 2\n )\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/build/webpack.ts"],"names":["extractWebpackConfig","context","defu","resolve","alias","fs","builtinIdMap","keys","reduce","ret","id","path","get","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","Array","from","devtool","optimization","minimize"],"mappings":";;;;;;;;;;AA6BO,SAASA,qBAAqBC,OAAAA,EAAgB;AACnD,EAAA,OAAOC,qBAAAA,CACL;IACEC,OAAAA,EAAS;MACPC,KAAAA,EAAOH,OAAAA,CAAQI,GAAGC,YAAAA,CAAaC,IAAAA,GAAOC,MAAAA,CACpC,CAACC,KAAKC,EAAAA,KAAAA;AACJ,QAAA,MAAMC,IAAAA,GAAOV,OAAAA,CAAQI,EAAAA,CAAGC,YAAAA,CAAaM,IAAIF,EAAAA,CAAAA;AACzC,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,EACAR,OAAAA,CAAQY,OAAOC,KAAAA,CAAMC,OAAAA,KAAY,YAAYd,OAAAA,CAAQY,MAAAA,CAAOG,QAAAA,GAAW,EAAC,EACxE;IACEC,QAAAA,EAAUhB,OAAAA,CAAQY,OAAOC,KAAAA,CAAMG,QAAAA;IAC/BC,UAAAA,EAAYjB,OAAAA,CAAQY,OAAOC,KAAAA,CAAMI,UAAAA;IACjCC,qBAAAA,EAAuB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,EAAC,EACrE;AACE2B,IAAAA,OAAAA,EAAUxC,OAAAA,CAAQY,MAAAA,CAAOkB,IAAAA,KAAS,aAAA,GAC9B,KAAA,GACA,YAAA;IACJW,YAAAA,EAAc;MACZC,QAAAA,EAAU1C,OAAAA,CAAQY,OAAOkB,IAAAA,KAAS;AACpC;GACF,CAAA;AAEJ;AAzEgB/B,wBAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA","file":"chunk-XHCRXNQ3.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.fs.builtinIdMap.keys().reduce(\n (ret, id) => {\n const path = context.fs.builtinIdMap.get(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: Array.from(context.fs.builtinIdMap.keys())\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 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/typescript/program.ts"],"names":["SourcesMap","Map","loadLibFiles","libLocation","resolvePackage","Error","libFiles","listFiles","joinPaths","length","lib","file","set","findFileName","readFile","getDefaultCompilerOptions","ts","jsx","JsxEmit","React","strict","esModuleInterop","module","ModuleKind","ESNext","suppressOutputPathCheck","skipLibCheck","skipDefaultLibCheck","moduleResolution","ModuleResolutionKind","Node10","createVirtualProgram","rootNames","context","compilerOptions","options","defu","host","name","root","workspaceConfig","workspaceRoot","sys","realpath","path","fs","existsSync","resolvePath","getCurrentDirectory","getCanonicalFileName","fileName","getDefaultLibFileName","_options","getDefaultLibLocation","getNewLine","useCaseSensitiveFileNames","fileExists","readFileSync","undefined","readDirectory","__name","extensions","exclude","include","results","readdirSync","encoding","recursive","filter","some","ext","endsWith","startsWith","pattern","minimatch","writeFile","data","writeFileSync","getSourceFile","languageVersionOrOptions","_","shouldCreateNewSourceFile","createSourceFile","target","sourceFile","text","createProgram","createVirtualCompilerHost","sourceFiles","save","vHost","compilerHost","newLine","get","updateFile","alreadyExists","has","deleteFile","delete"],"mappings":";;;;;;;;;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ACT,CAAA,EALYX,YAAAA;AAMd,GAAA;AAEA,EAAA,OAAOM,KAAAA;AACT;AAhDgBH,wBAAAA,CAAAA,yBAAAA,EAAAA,2BAAAA,CAAAA","file":"chunk-ZKYZWEHY.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 { listFiles } from \"@stryke/fs/list-files\";\nimport { readFile } from \"@stryke/fs/read-file\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { minimatch } from \"minimatch\";\nimport ts, { CompilerOptions } from \"typescript\";\nimport { Context } from \"../../types/context\";\n\nexport const SourcesMap = Map<string, string>;\n// eslint-disable-next-line ts/no-redeclare\nexport type SourcesMap = InstanceType<typeof SourcesMap>;\n\nexport async function loadLibFiles(): Promise<SourcesMap> {\n const libLocation = await resolvePackage(\"typescript\");\n if (!libLocation) {\n throw new Error(\"Could not resolve TypeScript package location.\");\n }\n\n const libFiles = await listFiles(\n joinPaths(libLocation, \"lib\", \"**\", \"lib.*.d.ts\")\n );\n if (libFiles.length === 0) {\n throw new Error(\"No TypeScript library files found.\");\n }\n\n const lib: SourcesMap = new Map();\n for (const file of libFiles) {\n lib.set(\n `/node_modules/typescript/lib/${findFileName(file)}`,\n await readFile(file)\n );\n }\n\n return lib;\n}\n\n/** The default compiler options if TypeScript could ever change the compiler options */\nexport function getDefaultCompilerOptions(): CompilerOptions {\n return {\n ...ts.getDefaultCompilerOptions(),\n jsx: ts.JsxEmit.React,\n strict: true,\n esModuleInterop: true,\n module: ts.ModuleKind.ESNext,\n suppressOutputPathCheck: true,\n skipLibCheck: true,\n skipDefaultLibCheck: true,\n moduleResolution: ts.ModuleResolutionKind.Node10\n };\n}\n\n/**\n * Creates a TypeScript program from in-memory, virtual source files.\n *\n * @param rootNames - An array of root file names to include in the program.\n * @param context - The context containing options and environment paths.\n * @param compilerOptions - Optional TypeScript compiler options. Defaults to the standard TypeScript options\n * @returns A TypeScript program instance that can be used for type checking, emitting, etc.\n * @throws If the provided library files are not in the expected format or if the TypeScript package cannot be resolved.\n */\nexport async function createVirtualProgram(\n rootNames: readonly string[],\n context: Context,\n compilerOptions: ts.CompilerOptions = {}\n): Promise<ts.Program> {\n const options = defu(compilerOptions, getDefaultCompilerOptions());\n\n const host = {\n name: \"storm-vfs\",\n root: context.workspaceConfig.workspaceRoot,\n ...ts.sys,\n realpath: (path: string) => {\n if (context.fs.existsSync(path)) {\n return context.fs.resolvePath(path);\n }\n\n return ts.sys.realpath?.(path) ?? path;\n },\n getCurrentDirectory(): string {\n return context.workspaceConfig.workspaceRoot;\n },\n getCanonicalFileName(fileName: string): string {\n return fileName;\n },\n getDefaultLibFileName(_options: ts.CompilerOptions): string {\n return ts.getDefaultLibFileName(options);\n },\n getDefaultLibLocation(): string {\n return \"/\";\n },\n getNewLine(): string {\n return \"\\n\";\n },\n useCaseSensitiveFileNames(): boolean {\n return true;\n },\n fileExists(fileName: string): boolean {\n return context.fs.existsSync(fileName);\n },\n readFile(fileName: string): string | undefined {\n if (context.fs.existsSync(fileName)) {\n return context.fs.readFileSync(fileName);\n }\n\n return undefined;\n },\n readDirectory: (\n path: string,\n extensions: readonly string[] = [],\n exclude: readonly string[] = [],\n include: readonly string[] = []\n ) => {\n let results = [] as string[];\n if (context.fs.existsSync(path)) {\n results = context.fs.readdirSync(path, {\n encoding: \"utf8\",\n recursive: true\n });\n\n if (extensions.length > 0) {\n results = results.filter(file =>\n extensions.some(ext =>\n file.endsWith(ext.startsWith(\".\") ? ext : `.${ext}`)\n )\n );\n }\n\n if (exclude.length > 0) {\n results = results.filter(\n file => !exclude.some(pattern => minimatch(file, pattern))\n );\n }\n\n if (include.length > 0) {\n results = results.filter(file =>\n include.some(pattern => minimatch(file, pattern))\n );\n }\n }\n\n return results;\n },\n writeFile(fileName: string, data: string): void {\n context.fs.writeFileSync(fileName, data);\n },\n resolvePath: (fileName: string): string => {\n if (context.fs.existsSync(fileName)) {\n return context.fs.resolvePath(fileName) as string;\n }\n\n return ts.sys.resolvePath(fileName);\n },\n getSourceFile(\n fileName: string,\n languageVersionOrOptions: ts.ScriptTarget | ts.CreateSourceFileOptions,\n _?: (message: string) => void,\n shouldCreateNewSourceFile?: boolean\n ): ts.SourceFile | undefined {\n if (context.fs.existsSync(fileName)) {\n return ts.createSourceFile(\n fileName,\n context.fs.readFileSync(fileName)!,\n languageVersionOrOptions ??\n compilerOptions.target ??\n getDefaultCompilerOptions().target!,\n false\n );\n } else if (shouldCreateNewSourceFile) {\n const sourceFile = ts.createSourceFile(\n fileName,\n \"\",\n languageVersionOrOptions ??\n compilerOptions.target ??\n getDefaultCompilerOptions().target!,\n false\n );\n context.fs.writeFileSync(fileName, sourceFile.text);\n return sourceFile;\n }\n\n return undefined;\n }\n } as ts.CompilerHost;\n\n return ts.createProgram(rootNames, options, host);\n}\n\ninterface VirtualCompilerHostReturn {\n compilerHost: ts.CompilerHost;\n updateFile: (sourceFile: ts.SourceFile) => boolean;\n deleteFile: (sourceFile: ts.SourceFile) => boolean;\n}\n\n/**\n * Creates an in-memory CompilerHost -which is essentially an extra wrapper to System\n * which works with TypeScript objects - returns both a compiler host, and a way to add new SourceFile\n * instances to the in-memory file system.\n */\nexport function createVirtualCompilerHost(\n sys: ts.System,\n compilerOptions: ts.CompilerOptions\n) {\n const sourceFiles = new Map<string, ts.SourceFile>();\n const save = (sourceFile: ts.SourceFile) => {\n sourceFiles.set(sourceFile.fileName, sourceFile);\n return sourceFile;\n };\n\n const vHost: VirtualCompilerHostReturn = {\n compilerHost: {\n ...sys,\n getCanonicalFileName: fileName => fileName,\n getDefaultLibFileName: () =>\n `/${ts.getDefaultLibFileName(compilerOptions)}`, // '/lib.d.ts',\n // getDefaultLibLocation: () => '/',\n getNewLine: () => sys.newLine,\n getSourceFile: (fileName, languageVersionOrOptions) => {\n return (\n sourceFiles.get(fileName) ??\n save(\n ts.createSourceFile(\n fileName,\n sys.readFile(fileName)!,\n languageVersionOrOptions ?? compilerOptions.target,\n false\n )\n )\n );\n },\n useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames\n },\n updateFile: sourceFile => {\n const alreadyExists = sourceFiles.has(sourceFile.fileName);\n sys.writeFile(sourceFile.fileName, sourceFile.text);\n sourceFiles.set(sourceFile.fileName, sourceFile);\n return alreadyExists;\n },\n deleteFile: sourceFile => {\n const alreadyExists = sourceFiles.has(sourceFile.fileName);\n sourceFiles.delete(sourceFile.fileName);\n sys.deleteFile!(sourceFile.fileName);\n return alreadyExists;\n }\n };\n\n return vHost;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/build/unbuild.ts"],"names":["DEFAULT_UNBUILD_CONFIG","dts","clean","includeSrc","treeShaking","splitting","stub","watchOptions","outputPath","generatePackageJson","banner","rollup","emitCJS","replace","resolve","json","esbuild","target","commonjs","alias","unbuildLoader","context","input","options","test","path","output","contents","getContents","declaration","srcPath","match","cm","extension","push","transformed","result","$$internal","callHook","sequential","order","getString","includes","transform","Object","fromEntries","entries","filter","key","loader","then","r","code","isCjs","format","resolver","source","retainLines","ext","startsWith","extractUnbuildConfig","defu","fs","builtinIdMap","keys","reduce","ret","id","get","config","build","variant","override","projectName","name","orgName","isObject","workspaceConfig","organization","sourceRoot","projectRoot","platform","external","loaders","jiti","interopDefault","fsCache","joinPaths","envPaths","cache","moduleCache","extractRollupConfig","debug","mode","minify","sourcemap"],"mappings":";;;;;;;;AAiCO,IAAMA,sBAAAA,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AA,CAAQgD,MAAAA,CAAOC,KAAAA,GAAQ,EAAC,EACrE;IACEsB,KAAAA,EAAOvE,OAAAA,CAAQgD,OAAOwB,IAAAA,KAAS,aAAA;IAC/BC,MAAAA,EAAQzE,OAAAA,CAAQgD,OAAOwB,IAAAA,KAAS,aAAA;IAChCE,SAAAA,EAAW1E,OAAAA,CAAQgD,OAAOwB,IAAAA,KAAS;AACrC,GAAA,EACA7F,sBAAAA,CAAAA;AAEJ;AApDgB4D,MAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA","file":"chunk-ZYBUJ2HE.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 type { Loader, LoaderResult } from \"@storm-software/unbuild/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport defu from \"defu\";\nimport { transform } from \"esbuild\";\nimport { TransformResult } from \"unplugin\";\nimport {\n UnbuildBuildConfig,\n UnbuildResolvedBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { UNSAFE_PluginContext } from \"../../types/internal\";\nimport { getString } from \"../utilities/source-file\";\nimport { extractRollupConfig } from \"./rollup\";\n\nexport const DEFAULT_UNBUILD_CONFIG = {\n dts: true,\n clean: false,\n includeSrc: false,\n treeShaking: true,\n splitting: true,\n stub: false,\n watchOptions: {},\n outputPath: \"dist\",\n generatePackageJson: true,\n banner: \" \",\n rollup: {\n dts: {},\n emitCJS: true,\n replace: {},\n resolve: {},\n json: {},\n esbuild: { target: \"es2020\" },\n commonjs: {},\n alias: {}\n }\n} as Partial<UnbuildBuildConfig>;\n\nexport const unbuildLoader = (context: UNSAFE_PluginContext): Loader => {\n return async (input, { options }) => {\n if (\n !/\\.(?:c|m)?[jt]sx?$/.test(input.path) ||\n /\\.d\\.[cm]?ts$/.test(input.path)\n ) {\n return;\n }\n\n const output: LoaderResult = [];\n\n let contents = await input.getContents();\n\n // declaration\n if (options.declaration && !input.srcPath?.match(/\\.d\\.[cm]?ts$/)) {\n const cm = input.srcPath?.match(/(?<=\\.)(?:c|m)(?=[jt]s$)/)?.[0] || \"\";\n const extension = `.d.${cm}ts`;\n output.push({\n contents,\n srcPath: input.srcPath,\n path: input.path,\n extension,\n declaration: true\n });\n }\n\n let transformed: TransformResult | string = contents;\n\n let result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"pre\"\n },\n transformed,\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"normal\"\n },\n getString(transformed),\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"post\"\n },\n getString(transformed),\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n // typescript => js\n if ([\".ts\", \".mts\", \".cts\"].includes(input.extension)) {\n contents = await transform(getString(transformed), {\n ...Object.fromEntries(\n Object.entries(options.esbuild ?? {}).filter(\n ([key]) => key !== \"absPaths\"\n )\n ),\n loader: \"ts\"\n }).then(r => r.code);\n } else if ([\".tsx\", \".jsx\"].includes(input.extension)) {\n contents = await transform(getString(transformed), {\n loader: input.extension === \".tsx\" ? \"tsx\" : \"jsx\",\n ...Object.fromEntries(\n Object.entries(options.esbuild ?? {}).filter(\n ([key]) => key !== \"absPaths\"\n )\n )\n }).then(r => r.code);\n }\n\n // esm => cjs\n const isCjs = options.format === \"cjs\";\n if (isCjs) {\n contents = context.resolver\n .transform({\n source: contents,\n retainLines: false\n })\n .replace(/^exports.default = /gm, \"module.exports = \")\n .replace(/^var _default = exports.default = /gm, \"module.exports = \")\n .replace(\"module.exports = void 0;\", \"\");\n }\n\n let extension = isCjs ? \".js\" : \".mjs\"; // TODO: Default to .cjs in next major version\n if (options.ext) {\n extension = options.ext.startsWith(\".\") ? options.ext : `.${options.ext}`;\n }\n\n output.push({\n contents,\n path: input.path,\n extension\n });\n\n return output;\n };\n};\n\n/**\n * Extracts the unbuild configuration from the context.\n *\n * @param context - The build context.\n * @returns The resolved unbuild configuration.\n */\nexport function extractUnbuildConfig(\n context: Context\n): UnbuildResolvedBuildConfig {\n return defu(\n {\n alias: context.fs.builtinIdMap.keys().reduce(\n (ret, id) => {\n const path = context.fs.builtinIdMap.get(id);\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n },\n context.config.build.variant === \"unbuild\" ? context.config.override : {},\n {\n projectName: context.config.name,\n name: context.config.name,\n orgName: isObject(context.workspaceConfig.organization)\n ? context.workspaceConfig.organization.name\n : context.workspaceConfig.organization,\n sourceRoot: context.config.sourceRoot,\n projectRoot: context.config.projectRoot,\n outputPath: context.config.output.outputPath || \"dist\",\n platform: context.config.build.platform,\n external: context.fs.builtinIdMap.keys().reduce((ret, id) => {\n if (!ret.includes(id)) {\n ret.push(id);\n }\n\n return ret;\n }, context.config.build.external ?? []) as string[],\n\n loaders: [unbuildLoader(context as UNSAFE_PluginContext)],\n jiti: {\n interopDefault: true,\n fsCache: joinPaths(context.envPaths.cache, \"jiti\"),\n moduleCache: true\n },\n rollup: extractRollupConfig(context) as any\n },\n context.config.build.variant === \"unbuild\" ? context.config.build : {},\n {\n debug: context.config.mode === \"development\",\n minify: context.config.mode !== \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_UNBUILD_CONFIG\n );\n}\n"]}