powerlines 0.10.2 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/dist/astro.cjs +8 -8
  2. package/dist/astro.d.cts +1 -1
  3. package/dist/astro.d.ts +1 -1
  4. package/dist/astro.js +5 -5
  5. package/dist/{chunk-5XYGZ3DC.cjs → chunk-22K72CJ5.cjs} +2 -2
  6. package/dist/{chunk-GPPJ2CRE.js → chunk-4HGQJ4KR.js} +2 -2
  7. package/dist/chunk-7MTW3KR2.cjs +12 -0
  8. package/dist/{chunk-VIRKTIPK.js → chunk-7UIYU6SC.js} +3 -3
  9. package/dist/chunk-7WMWRX2S.cjs +12 -0
  10. package/dist/{chunk-HVT7PBFF.js → chunk-A3BBPLTY.js} +3 -3
  11. package/dist/{chunk-S746E63M.js → chunk-BHP6KBGK.js} +3 -3
  12. package/dist/{chunk-ZU4IRZSQ.js → chunk-BOIEJ5I6.js} +3 -3
  13. package/dist/chunk-DELRP3WY.js +31 -0
  14. package/dist/{chunk-ZBDP43LG.cjs → chunk-ELHJY5WG.cjs} +4 -4
  15. package/dist/{chunk-UHCRNFFC.cjs → chunk-FANQC345.cjs} +4 -4
  16. package/dist/chunk-GV3S7ZR3.cjs +34 -0
  17. package/dist/{chunk-WCPY7HPU.js → chunk-L3DAMAEC.js} +4 -4
  18. package/dist/chunk-LC6FLEJS.cjs +12 -0
  19. package/dist/{chunk-N7NE3VOU.js → chunk-MAEKW52U.js} +3 -3
  20. package/dist/chunk-MXJWCZDP.cjs +12 -0
  21. package/dist/{chunk-EGSEJQCE.js → chunk-NGKWITCO.js} +3 -3
  22. package/dist/{chunk-L2SAK2JC.cjs → chunk-OC7CCD5M.cjs} +4 -4
  23. package/dist/{chunk-OYIM2M74.js → chunk-P4BOYWXT.js} +195 -6
  24. package/dist/{chunk-UTVZVGM3.cjs → chunk-PJRHRDLS.cjs} +204 -15
  25. package/dist/{chunk-5Y4JYQ66.js → chunk-RBRFT2R6.js} +3 -3
  26. package/dist/{chunk-66GXB2UY.cjs → chunk-RU6BHTIP.cjs} +4 -4
  27. package/dist/{chunk-WPVIF35O.js → chunk-SIZKRND7.js} +2 -2
  28. package/dist/chunk-SNARILEC.cjs +24 -0
  29. package/dist/{chunk-6UDHGAAI.js → chunk-SY7N6FC3.js} +3 -3
  30. package/dist/{chunk-QHGPZK2H.cjs → chunk-V5D5NVV7.cjs} +4 -4
  31. package/dist/{chunk-SDEBJQDT.js → chunk-V7LXFIGK.js} +3 -3
  32. package/dist/{chunk-2RHPFVYT.cjs → chunk-WCTOTE3T.cjs} +8 -8
  33. package/dist/chunk-WD4363UW.cjs +12 -0
  34. package/dist/{chunk-7IWH37DY.cjs → chunk-YIWHO6SW.cjs} +2 -2
  35. package/dist/{chunk-3Y5CCIJR.js → chunk-ZP5QLZQ2.js} +3 -3
  36. package/dist/{chunk-KYGEWAEG.js → chunk-ZQ7U35QZ.js} +3 -3
  37. package/dist/define-config.d.cts +1 -1
  38. package/dist/define-config.d.ts +1 -1
  39. package/dist/esbuild.cjs +7 -7
  40. package/dist/esbuild.d.cts +1 -1
  41. package/dist/esbuild.d.ts +1 -1
  42. package/dist/esbuild.js +4 -4
  43. package/dist/extend-plugin.d.cts +1 -1
  44. package/dist/extend-plugin.d.ts +1 -1
  45. package/dist/farm.cjs +4 -4
  46. package/dist/farm.d.cts +1 -1
  47. package/dist/farm.d.ts +1 -1
  48. package/dist/farm.js +3 -3
  49. package/dist/{hooks-BGYnc61f.d.ts → hooks-BmvalJZ4.d.ts} +1 -1
  50. package/dist/{hooks-gk8S8LFP.d.cts → hooks-BzFKq34L.d.cts} +1 -1
  51. package/dist/index.cjs +26 -26
  52. package/dist/index.d.cts +2 -2
  53. package/dist/index.d.ts +2 -2
  54. package/dist/index.js +17 -17
  55. package/dist/internal/api.cjs +3 -3
  56. package/dist/internal/api.d.cts +2 -2
  57. package/dist/internal/api.d.ts +2 -2
  58. package/dist/internal/api.js +2 -2
  59. package/dist/lib/build/esbuild.d.cts +12 -12
  60. package/dist/lib/build/esbuild.d.ts +12 -12
  61. package/dist/lib/build/index.cjs +18 -18
  62. package/dist/lib/build/index.d.cts +13 -13
  63. package/dist/lib/build/index.d.ts +13 -13
  64. package/dist/lib/build/index.js +3 -3
  65. package/dist/lib/build/rolldown.d.cts +12 -12
  66. package/dist/lib/build/rolldown.d.ts +12 -12
  67. package/dist/lib/build/rollup.d.cts +12 -12
  68. package/dist/lib/build/rollup.d.ts +12 -12
  69. package/dist/lib/build/rspack.d.cts +12 -12
  70. package/dist/lib/build/rspack.d.ts +12 -12
  71. package/dist/lib/build/tsup.d.cts +11 -11
  72. package/dist/lib/build/tsup.d.ts +11 -11
  73. package/dist/lib/build/unbuild.cjs +5 -5
  74. package/dist/lib/build/unbuild.d.cts +13 -13
  75. package/dist/lib/build/unbuild.d.ts +13 -13
  76. package/dist/lib/build/unbuild.js +2 -2
  77. package/dist/lib/build/vite.d.cts +12 -12
  78. package/dist/lib/build/vite.d.ts +12 -12
  79. package/dist/lib/build/webpack.d.cts +12 -12
  80. package/dist/lib/build/webpack.d.ts +12 -12
  81. package/dist/lib/bundle.cjs +16 -0
  82. package/dist/lib/bundle.cjs.map +1 -0
  83. package/dist/lib/bundle.d.cts +44 -0
  84. package/dist/lib/bundle.d.ts +44 -0
  85. package/dist/lib/bundle.js +7 -0
  86. package/dist/lib/bundle.js.map +1 -0
  87. package/dist/lib/chunk-2625RJNJ.cjs +41 -0
  88. package/dist/lib/chunk-2625RJNJ.cjs.map +1 -0
  89. package/dist/lib/{chunk-PIFE7MUZ.js → chunk-6BRTJXZ2.js} +195 -6
  90. package/dist/lib/chunk-6BRTJXZ2.js.map +1 -0
  91. package/dist/lib/chunk-6IJTWIVJ.cjs +107 -0
  92. package/dist/lib/chunk-6IJTWIVJ.cjs.map +1 -0
  93. package/dist/lib/{chunk-YVDJCVE5.cjs → chunk-BAC4AJEP.cjs} +3 -3
  94. package/dist/lib/{chunk-YVDJCVE5.cjs.map → chunk-BAC4AJEP.cjs.map} +1 -1
  95. package/dist/lib/{chunk-Q2RUDKWY.cjs → chunk-BW3VFCTS.cjs} +2 -2
  96. package/dist/lib/chunk-BW3VFCTS.cjs.map +1 -0
  97. package/dist/lib/chunk-ESYYL5UH.js +105 -0
  98. package/dist/lib/chunk-ESYYL5UH.js.map +1 -0
  99. package/dist/lib/chunk-GTQZYDA7.js +39 -0
  100. package/dist/lib/chunk-GTQZYDA7.js.map +1 -0
  101. package/dist/lib/{chunk-M7U5RMK7.js → chunk-KOCDKJDJ.js} +2 -2
  102. package/dist/lib/chunk-KOCDKJDJ.js.map +1 -0
  103. package/dist/lib/{chunk-M7WHFUKR.cjs → chunk-LYD5OTBI.cjs} +210 -21
  104. package/dist/lib/chunk-LYD5OTBI.cjs.map +1 -0
  105. package/dist/lib/{chunk-6U2UX2PX.cjs → chunk-RLMEYZ5I.cjs} +11 -15
  106. package/dist/lib/chunk-RLMEYZ5I.cjs.map +1 -0
  107. package/dist/lib/{chunk-CAPN4FSS.js → chunk-S4TGQD45.js} +3 -3
  108. package/dist/lib/{chunk-CAPN4FSS.js.map → chunk-S4TGQD45.js.map} +1 -1
  109. package/dist/lib/{chunk-KFE2IR3Y.js → chunk-V2T4H24I.js} +11 -15
  110. package/dist/lib/chunk-V2T4H24I.js.map +1 -0
  111. package/dist/lib/config-file.d.cts +11 -11
  112. package/dist/lib/config-file.d.ts +11 -11
  113. package/dist/lib/{config-AuIGsUck.d.cts → context-BI46yeFZ.d.cts} +617 -557
  114. package/dist/lib/{config-B_WTwd49.d.ts → context-tEqvC3yI.d.ts} +617 -557
  115. package/dist/lib/create-program.cjs +13 -0
  116. package/dist/lib/create-program.cjs.map +1 -0
  117. package/dist/lib/create-program.d.cts +42 -0
  118. package/dist/lib/create-program.d.ts +42 -0
  119. package/dist/lib/create-program.js +4 -0
  120. package/dist/lib/create-program.js.map +1 -0
  121. package/dist/lib/entry.d.cts +12 -12
  122. package/dist/lib/entry.d.ts +12 -12
  123. package/dist/lib/{hooks-DErK4Fv4.d.ts → hooks-C9_XPS6c.d.cts} +1 -1
  124. package/dist/lib/{hooks-4KkL9GD2.d.cts → hooks-DESiFNA6.d.ts} +1 -1
  125. package/dist/lib/index.cjs +47 -36
  126. package/dist/lib/index.d.cts +16 -13
  127. package/dist/lib/index.d.ts +16 -13
  128. package/dist/lib/index.js +10 -7
  129. package/dist/lib/logger.d.cts +12 -12
  130. package/dist/lib/logger.d.ts +12 -12
  131. package/dist/lib/typescript/compiler-host.cjs +46 -2
  132. package/dist/lib/typescript/compiler-host.cjs.map +1 -1
  133. package/dist/lib/typescript/compiler-host.d.cts +18 -13
  134. package/dist/lib/typescript/compiler-host.d.ts +18 -13
  135. package/dist/lib/typescript/compiler-host.js +45 -2
  136. package/dist/lib/typescript/compiler-host.js.map +1 -1
  137. package/dist/lib/typescript/import-transformer.d.cts +12 -12
  138. package/dist/lib/typescript/import-transformer.d.ts +12 -12
  139. package/dist/lib/typescript/index.cjs +6 -6
  140. package/dist/lib/typescript/index.d.cts +12 -12
  141. package/dist/lib/typescript/index.d.ts +12 -12
  142. package/dist/lib/typescript/index.js +1 -1
  143. package/dist/lib/typescript/program.cjs +6 -6
  144. package/dist/lib/typescript/program.d.cts +13 -13
  145. package/dist/lib/typescript/program.d.ts +13 -13
  146. package/dist/lib/typescript/program.js +1 -1
  147. package/dist/lib/unplugin/factory.cjs +3 -3
  148. package/dist/lib/unplugin/factory.d.cts +12 -12
  149. package/dist/lib/unplugin/factory.d.ts +12 -12
  150. package/dist/lib/unplugin/factory.js +2 -2
  151. package/dist/lib/unplugin/index.cjs +3 -3
  152. package/dist/lib/unplugin/index.d.cts +12 -12
  153. package/dist/lib/unplugin/index.d.ts +12 -12
  154. package/dist/lib/unplugin/index.js +2 -2
  155. package/dist/lib/unplugin/plugin.d.cts +11 -11
  156. package/dist/lib/unplugin/plugin.d.ts +11 -11
  157. package/dist/lib/unplugin/resolve-id.d.cts +11 -11
  158. package/dist/lib/unplugin/resolve-id.d.ts +11 -11
  159. package/dist/lib/utilities/file-header.d.cts +12 -12
  160. package/dist/lib/utilities/file-header.d.ts +12 -12
  161. package/dist/lib/utilities/index.cjs +20 -20
  162. package/dist/lib/utilities/index.d.cts +12 -12
  163. package/dist/lib/utilities/index.d.ts +12 -12
  164. package/dist/lib/utilities/index.js +3 -3
  165. package/dist/lib/utilities/meta.cjs +8 -8
  166. package/dist/lib/utilities/meta.d.cts +12 -12
  167. package/dist/lib/utilities/meta.d.ts +12 -12
  168. package/dist/lib/utilities/meta.js +1 -1
  169. package/dist/lib/utilities/plugin-helpers.d.cts +11 -11
  170. package/dist/lib/utilities/plugin-helpers.d.ts +11 -11
  171. package/dist/lib/utilities/resolve-path.d.cts +12 -12
  172. package/dist/lib/utilities/resolve-path.d.ts +12 -12
  173. package/dist/lib/utilities/worker.d.cts +11 -11
  174. package/dist/lib/utilities/worker.d.ts +11 -11
  175. package/dist/lib/utilities/write-file.d.cts +12 -12
  176. package/dist/lib/utilities/write-file.d.ts +12 -12
  177. package/dist/next.cjs +8 -8
  178. package/dist/next.js +5 -5
  179. package/dist/nuxt.cjs +9 -9
  180. package/dist/nuxt.js +6 -6
  181. package/dist/{resolved-Dhscmo3z.d.ts → resolved-BS8bJ6b1.d.ts} +21 -17
  182. package/dist/{resolved-CcuVqMqc.d.cts → resolved-CjkYiKA1.d.cts} +21 -17
  183. package/dist/rolldown.cjs +7 -7
  184. package/dist/rolldown.d.cts +1 -1
  185. package/dist/rolldown.d.ts +1 -1
  186. package/dist/rolldown.js +4 -4
  187. package/dist/rollup.cjs +7 -7
  188. package/dist/rollup.d.cts +1 -1
  189. package/dist/rollup.d.ts +1 -1
  190. package/dist/rollup.js +4 -4
  191. package/dist/rspack.cjs +7 -7
  192. package/dist/rspack.d.cts +1 -1
  193. package/dist/rspack.d.ts +1 -1
  194. package/dist/rspack.js +4 -4
  195. package/dist/tsup.cjs +8 -8
  196. package/dist/tsup.js +5 -5
  197. package/dist/types/babel.d.cts +1 -1
  198. package/dist/types/babel.d.ts +1 -1
  199. package/dist/types/commands.d.cts +1 -1
  200. package/dist/types/commands.d.ts +1 -1
  201. package/dist/types/compiler.d.cts +1 -1
  202. package/dist/types/compiler.d.ts +1 -1
  203. package/dist/types/config.d.cts +1 -1
  204. package/dist/types/config.d.ts +1 -1
  205. package/dist/types/context.cjs +2 -2
  206. package/dist/types/context.d.cts +1 -1
  207. package/dist/types/context.d.ts +1 -1
  208. package/dist/types/context.js +1 -1
  209. package/dist/types/hooks.d.cts +1 -1
  210. package/dist/types/hooks.d.ts +1 -1
  211. package/dist/types/index.cjs +9 -9
  212. package/dist/types/index.d.cts +1 -1
  213. package/dist/types/index.d.ts +1 -1
  214. package/dist/types/index.js +2 -2
  215. package/dist/types/internal.d.cts +2 -2
  216. package/dist/types/internal.d.ts +2 -2
  217. package/dist/types/plugin.d.cts +1 -1
  218. package/dist/types/plugin.d.ts +1 -1
  219. package/dist/types/resolved.d.cts +1 -1
  220. package/dist/types/resolved.d.ts +1 -1
  221. package/dist/types/unplugin.d.cts +1 -1
  222. package/dist/types/unplugin.d.ts +1 -1
  223. package/dist/types/vfs.cjs +7 -7
  224. package/dist/types/vfs.d.cts +61 -5
  225. package/dist/types/vfs.d.ts +61 -5
  226. package/dist/types/vfs.js +1 -1
  227. package/dist/unloader.cjs +7 -7
  228. package/dist/unloader.d.cts +1 -1
  229. package/dist/unloader.d.ts +1 -1
  230. package/dist/unloader.js +4 -4
  231. package/dist/unplugin.cjs +18 -18
  232. package/dist/unplugin.d.cts +2 -2
  233. package/dist/unplugin.d.ts +2 -2
  234. package/dist/unplugin.js +15 -15
  235. package/dist/vite.cjs +7 -7
  236. package/dist/vite.d.cts +1 -1
  237. package/dist/vite.d.ts +1 -1
  238. package/dist/vite.js +4 -4
  239. package/dist/webpack.cjs +7 -7
  240. package/dist/webpack.d.cts +1 -1
  241. package/dist/webpack.d.ts +1 -1
  242. package/dist/webpack.js +4 -4
  243. package/package.json +11 -9
  244. package/dist/chunk-IJBH5OUN.cjs +0 -12
  245. package/dist/chunk-JBTSAOIQ.js +0 -31
  246. package/dist/chunk-LXMNDUPG.cjs +0 -12
  247. package/dist/chunk-RQ4CHMPO.cjs +0 -12
  248. package/dist/chunk-S5QFX2GM.cjs +0 -12
  249. package/dist/chunk-SL3CXJWD.cjs +0 -34
  250. package/dist/chunk-YG7U2GIR.cjs +0 -24
  251. package/dist/chunk-ZFATNDSY.cjs +0 -12
  252. package/dist/lib/chunk-6U2UX2PX.cjs.map +0 -1
  253. package/dist/lib/chunk-KFE2IR3Y.js.map +0 -1
  254. package/dist/lib/chunk-M7U5RMK7.js.map +0 -1
  255. package/dist/lib/chunk-M7WHFUKR.cjs.map +0 -1
  256. package/dist/lib/chunk-PIFE7MUZ.js.map +0 -1
  257. package/dist/lib/chunk-Q2RUDKWY.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"bundle.cjs"}
@@ -0,0 +1,44 @@
1
+ import { OutputFile } from 'esbuild';
2
+ import { C as Context, E as ESBuildResolvedBuildConfig } from './context-BI46yeFZ.cjs';
3
+ import '@stryke/env/get-env-paths';
4
+ import '@stryke/types/package-json';
5
+ import 'jest-worker';
6
+ import 'jiti';
7
+ import 'oxc-parser';
8
+ import 'semver';
9
+ import 'unplugin';
10
+ import '@storm-software/config-tools/types';
11
+ import '@stryke/types/base';
12
+ import '@stryke/types/configuration';
13
+ import '@stryke/types/file';
14
+ import 'vite';
15
+ import '@farmfe/core';
16
+ import '@rspack/core';
17
+ import '@storm-software/esbuild/types';
18
+ import '@storm-software/unbuild/types';
19
+ import 'rolldown';
20
+ import 'rollup';
21
+ import 'webpack';
22
+ import '@storm-software/build-tools/types';
23
+ import '@storm-software/config/types';
24
+ import 'c12';
25
+ import './tsconfig-Bz-CiFqD.cjs';
26
+ import '@stryke/types/tsconfig';
27
+ import 'typescript';
28
+ import '@stryke/types/array';
29
+ import '@stryke/json/types';
30
+ import 'memfs';
31
+ import 'node:fs';
32
+ import 'unionfs';
33
+
34
+ /**
35
+ * Bundle a type definition to a module.
36
+ *
37
+ * @param context - The context object containing the environment paths.
38
+ * @param file - The file path to bundle.
39
+ * @param overrides - Optional overrides for the ESBuild configuration.
40
+ * @returns A promise that resolves to the bundled module.
41
+ */
42
+ declare function bundle(context: Context, file: string, overrides?: Partial<ESBuildResolvedBuildConfig>): Promise<OutputFile>;
43
+
44
+ export { bundle };
@@ -0,0 +1,44 @@
1
+ import { OutputFile } from 'esbuild';
2
+ import { C as Context, E as ESBuildResolvedBuildConfig } from './context-tEqvC3yI.js';
3
+ import '@stryke/env/get-env-paths';
4
+ import '@stryke/types/package-json';
5
+ import 'jest-worker';
6
+ import 'jiti';
7
+ import 'oxc-parser';
8
+ import 'semver';
9
+ import 'unplugin';
10
+ import '@storm-software/config-tools/types';
11
+ import '@stryke/types/base';
12
+ import '@stryke/types/configuration';
13
+ import '@stryke/types/file';
14
+ import 'vite';
15
+ import '@farmfe/core';
16
+ import '@rspack/core';
17
+ import '@storm-software/esbuild/types';
18
+ import '@storm-software/unbuild/types';
19
+ import 'rolldown';
20
+ import 'rollup';
21
+ import 'webpack';
22
+ import '@storm-software/build-tools/types';
23
+ import '@storm-software/config/types';
24
+ import 'c12';
25
+ import './tsconfig-Bz-CiFqD.js';
26
+ import '@stryke/types/tsconfig';
27
+ import 'typescript';
28
+ import '@stryke/types/array';
29
+ import '@stryke/json/types';
30
+ import 'memfs';
31
+ import 'node:fs';
32
+ import 'unionfs';
33
+
34
+ /**
35
+ * Bundle a type definition to a module.
36
+ *
37
+ * @param context - The context object containing the environment paths.
38
+ * @param file - The file path to bundle.
39
+ * @param overrides - Optional overrides for the ESBuild configuration.
40
+ * @returns A promise that resolves to the bundled module.
41
+ */
42
+ declare function bundle(context: Context, file: string, overrides?: Partial<ESBuildResolvedBuildConfig>): Promise<OutputFile>;
43
+
44
+ export { bundle };
@@ -0,0 +1,7 @@
1
+ export { bundle } from './chunk-GTQZYDA7.js';
2
+ import './chunk-RXQWNSZX.js';
3
+ import './chunk-3I2YOM2E.js';
4
+ import './chunk-STAKGAWR.js';
5
+ import './chunk-7QVYU63E.js';
6
+ //# sourceMappingURL=bundle.js.map
7
+ //# sourceMappingURL=bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"bundle.js"}
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ var chunk4XUVP2LL_cjs = require('./chunk-4XUVP2LL.cjs');
4
+ var chunkGJNFAFKR_cjs = require('./chunk-GJNFAFKR.cjs');
5
+ var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
6
+ var types = require('@storm-software/config-tools/types');
7
+ var esbuild = require('esbuild');
8
+
9
+ async function bundle(context, file, overrides = {}) {
10
+ const path = await chunk4XUVP2LL_cjs.resolvePath(context, file);
11
+ if (!path || !context.fs.existsSync(path)) {
12
+ throw new Error(`Module not found: "${file}". Please check the path and try again.`);
13
+ }
14
+ const result = await esbuild.build({
15
+ ...chunkGJNFAFKR_cjs.extractESBuildConfig(context),
16
+ entry: [
17
+ path
18
+ ],
19
+ write: false,
20
+ sourcemap: false,
21
+ splitting: false,
22
+ treeShaking: false,
23
+ bundle: true,
24
+ ...overrides
25
+ });
26
+ if (result.errors.length > 0) {
27
+ throw new Error(`Failed to transpile ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
28
+ }
29
+ if (result.warnings.length > 0) {
30
+ context.log(types.LogLevelLabel.WARN, `Warnings while transpiling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
31
+ }
32
+ if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {
33
+ throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
34
+ }
35
+ return result.outputFiles.filter(Boolean)[0];
36
+ }
37
+ chunkPK6SKIKE_cjs.__name(bundle, "bundle");
38
+
39
+ exports.bundle = bundle;
40
+ //# sourceMappingURL=chunk-2625RJNJ.cjs.map
41
+ //# sourceMappingURL=chunk-2625RJNJ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/bundle.ts"],"names":["bundle","context","file","overrides","path","resolvePath","fs","existsSync","Error","result","build","extractESBuildConfig","entry","write","sourcemap","splitting","treeShaking","errors","length","map","error","text","join","warnings","log","LogLevelLabel","WARN","warning","outputFiles","filter","Boolean"],"mappings":";;;;;;;;AAiCA,eAAsBA,MAAAA,CACpBC,OAAAA,EACAC,IAAAA,EACAC,SAAAA,GAAiD,EAAC,EAAC;AAEnD,EAAA,MAAMC,IAAAA,GAAO,MAAMC,6BAAAA,CAAYJ,OAAAA,EAASC,IAAAA,CAAAA;AACxC,EAAA,IAAI,CAACE,IAAAA,IAAQ,CAACH,QAAQK,EAAAA,CAAGC,UAAAA,CAAWH,IAAAA,CAAAA,EAAO;AACzC,IAAA,MAAM,IAAII,KAAAA,CACR,CAAA,mBAAA,EAAsBN,IAAAA,CAAAA,uCAAAA,CAA6C,CAAA;AAEvE,EAAA;AAEA,EAAA,MAAMO,MAAAA,GAAS,MAAMC,aAAAA,CAAM;AACzB,IAAA,GAAGC,uCAAqBV,OAAAA,CAAAA;IACxBW,KAAAA,EAAO;AAACR,MAAAA;;IACRS,KAAAA,EAAO,KAAA;IACPC,SAAAA,EAAW,KAAA;IACXC,SAAAA,EAAW,KAAA;IACXC,WAAAA,EAAa,KAAA;IACbhB,MAAAA,EAAQ,IAAA;IACR,GAAGG;GACL,CAAA;AACA,EAAA,IAAIM,MAAAA,CAAOQ,MAAAA,CAAOC,MAAAA,GAAS,CAAA,EAAG;AAC5B,IAAA,MAAM,IAAIV,KAAAA,CACR,CAAA,oBAAA,EAAuBN,IAAAA,CAAAA,EAAAA,EAASO,OAAOQ,MAAAA,CACpCE,GAAAA,CAAIC,CAAAA,KAAAA,KAASA,MAAMC,IAAI,CAAA,CACvBC,IAAAA,CAAK,IAAA,CAAA,CAAA,CAAO,CAAA;AAEnB,EAAA;AACA,EAAA,IAAIb,MAAAA,CAAOc,QAAAA,CAASL,MAAAA,GAAS,CAAA,EAAG;AAC9BjB,IAAAA,OAAAA,CAAQuB,IACNC,mBAAAA,CAAcC,IAAAA,EACd,CAAA,2BAAA,EAA8BxB,IAAAA,KAASO,MAAAA,CAAOc,QAAAA,CAC3CJ,GAAAA,CAAIQ,CAAAA,YAAWA,OAAAA,CAAQN,IAAI,EAC3BC,IAAAA,CAAK,IAAA,CAAA,CAAA,CAAO,CAAA;AAEnB,EAAA;AACA,EAAA,IAAI,CAACb,OAAOmB,WAAAA,IAAenB,MAAAA,CAAOmB,YAAYC,MAAAA,CAAOC,OAAAA,CAAAA,CAASZ,MAAAA,KAAW,CAAA,EAAG;AAC1E,IAAA,MAAM,IAAIV,KAAAA,CACR,CAAA,8BAAA,EACEN,IAAAA,CAAAA,+CAAAA,CAC+C,CAAA;AAErD,EAAA;AAEA,EAAA,OAAOO,MAAAA,CAAOmB,WAAAA,CAAYC,MAAAA,CAAOC,OAAAA,EAAS,CAAA,CAAA;AAC5C;AA9CsB9B,wBAAAA,CAAAA,MAAAA,EAAAA,QAAAA,CAAAA","file":"chunk-2625RJNJ.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 { build, BuildOptions, OutputFile } from \"esbuild\";\nimport { ESBuildResolvedBuildConfig } from \"powerlines/types/build\";\nimport { Context } from \"../types/context\";\nimport { extractESBuildConfig } from \"./build/esbuild\";\nimport { resolvePath } from \"./utilities/resolve-path\";\n\n/**\n * Bundle a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to bundle.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the bundled module.\n */\nexport async function bundle(\n context: Context,\n file: string,\n overrides: Partial<ESBuildResolvedBuildConfig> = {}\n): Promise<OutputFile> {\n const path = await resolvePath(context, file);\n if (!path || !context.fs.existsSync(path)) {\n throw new Error(\n `Module not found: \"${file}\". Please check the path and try again.`\n );\n }\n\n const result = await build({\n ...extractESBuildConfig(context),\n entry: [path],\n write: false,\n sourcemap: false,\n splitting: false,\n treeShaking: false,\n bundle: true,\n ...overrides\n } as BuildOptions);\n if (result.errors.length > 0) {\n throw new Error(\n `Failed to transpile ${file}: ${result.errors\n .map(error => error.text)\n .join(\", \")}`\n );\n }\n if (result.warnings.length > 0) {\n context.log(\n LogLevelLabel.WARN,\n `Warnings while transpiling ${file}: ${result.warnings\n .map(warning => warning.text)\n .join(\", \")}`\n );\n }\n if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {\n throw new Error(\n `No output files generated for ${\n file\n }. Please check the configuration and try again.`\n );\n }\n\n return result.outputFiles.filter(Boolean)[0]!;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { writeFile } from './chunk-HQ6TGY34.js';
2
2
  import { getFileHeader } from './chunk-7R23HVGQ.js';
3
- import { __VFS_CACHE__, __VFS_RESOLVER__, __VFS_VIRTUAL__, __VFS_UNIFIED__, __VFS_INIT__, __VFS_REVERT__, CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, getPrefixedProjectRootHash, getChecksum, writeMetaFile } from './chunk-M7U5RMK7.js';
3
+ import { __VFS_CACHE__, __VFS_RESOLVER__, __VFS_VIRTUAL__, __VFS_UNIFIED__, __VFS_INIT__, __VFS_REVERT__, CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, getPrefixedProjectRootHash, getChecksum, writeMetaFile } from './chunk-KOCDKJDJ.js';
4
4
  import { isPlugin, checkDedupe, isPluginHook, isHookExternal, addPluginHook, getHookHandler, isPluginConfig, isPluginConfigTuple, isPluginConfigObject } from './chunk-UGRFAVAJ.js';
5
5
  import { handleResolveId } from './chunk-YBIWVB66.js';
6
6
  import { getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound } from './chunk-OO4BIM7N.js';
@@ -40,7 +40,7 @@ import { murmurhash } from '@stryke/hash/murmurhash';
40
40
  import { getUnique } from '@stryke/helpers/get-unique';
41
41
  import { omit } from '@stryke/helpers/omit';
42
42
  import { appendPath } from '@stryke/path/append';
43
- import { findFilePath, findFileExtensionSafe, hasFileExtension, relativePath, findFileName } from '@stryke/path/file-path-fns';
43
+ import { findFilePath, findFileDotExtensionSafe, hasFileExtension, relativePath, findFileName } from '@stryke/path/file-path-fns';
44
44
  import { isAbsolutePath, isAbsolute } from '@stryke/path/is-type';
45
45
  import { joinPaths as joinPaths$1 } from '@stryke/path/join';
46
46
  import { isNull } from '@stryke/type-checks/is-null';
@@ -650,6 +650,19 @@ var VirtualFileSystem = class {
650
650
  return this.unlink(path, options);
651
651
  }
652
652
  /**
653
+ * Synchronously removes a file or directory in the virtual file system (VFS).
654
+ *
655
+ * @param path - The path to the file or directory to remove.
656
+ * @param options - Options for removing the file or directory.
657
+ */
658
+ rmSync(path, options = {}) {
659
+ this.#log(LogLevelLabel.TRACE, `Removing: ${toFilePath(path)}`);
660
+ if (this.isDirectory(path)) {
661
+ return this.rmdirSync(path, options);
662
+ }
663
+ return this.unlinkSync(path, options);
664
+ }
665
+ /**
653
666
  * Creates a directory in the virtual file system (VFS).
654
667
  *
655
668
  * @param path - The path to create the directory at.
@@ -686,6 +699,166 @@ var VirtualFileSystem = class {
686
699
  return result;
687
700
  }
688
701
  /**
702
+ * Glob files in the virtual file system (VFS) based on the provided pattern(s).
703
+ *
704
+ * @param patterns - A pattern (or multiple patterns) to use to determine the file paths to return
705
+ * @returns An array of file paths matching the provided pattern(s)
706
+ */
707
+ async glob(patterns) {
708
+ const results = [];
709
+ for (const pattern of toArray(patterns)) {
710
+ const normalized = this.formatPath(pattern);
711
+ if (!/[*?[\]{}]/.test(normalized) && !normalized.includes("**")) {
712
+ const resolved = this.resolve(normalized, {
713
+ type: "file"
714
+ });
715
+ if (resolved && !results.includes(resolved)) {
716
+ results.push(resolved);
717
+ }
718
+ continue;
719
+ }
720
+ const absPattern = isAbsolutePath(normalized) ? normalized : this.formatPath(joinPaths(this.#context.workspaceConfig.workspaceRoot, normalized));
721
+ const firstGlobIdx = absPattern.search(/[*?[\]{}]/);
722
+ const baseDir = firstGlobIdx === -1 ? findFilePath(absPattern) : absPattern.slice(0, Math.max(0, absPattern.lastIndexOf("/", firstGlobIdx)));
723
+ const stack = [
724
+ baseDir && isAbsolutePath(baseDir) ? baseDir : this.#context.workspaceConfig.workspaceRoot
725
+ ];
726
+ while (stack.length) {
727
+ const dir = stack.pop();
728
+ let entries = [];
729
+ try {
730
+ entries = await this.readdir(dir);
731
+ } catch {
732
+ continue;
733
+ }
734
+ for (const entry of entries) {
735
+ const full = this.formatPath(joinPaths(dir, entry));
736
+ let stats;
737
+ try {
738
+ stats = this.#unifiedFS.lstatSync(full);
739
+ } catch {
740
+ stats = void 0;
741
+ }
742
+ if (!stats) continue;
743
+ if (stats.isDirectory()) {
744
+ stack.push(full);
745
+ } else if (stats.isFile()) {
746
+ if (this.buildRegex(absPattern).test(full)) {
747
+ const resolved = this.resolve(full, {
748
+ type: "file"
749
+ });
750
+ if (resolved && !results.includes(resolved)) {
751
+ results.push(resolved);
752
+ }
753
+ }
754
+ }
755
+ }
756
+ }
757
+ }
758
+ return results;
759
+ }
760
+ /**
761
+ * Synchronously glob files in the virtual file system (VFS) based on the provided pattern(s).
762
+ *
763
+ * @param patterns - A pattern (or multiple patterns) to use to determine the file paths to return
764
+ * @returns An array of file paths matching the provided pattern(s)
765
+ */
766
+ globSync(patterns) {
767
+ const results = [];
768
+ for (const pattern of toArray(patterns)) {
769
+ const normalized = this.formatPath(pattern);
770
+ if (!/[*?[\]{}]/.test(normalized) && !normalized.includes("**")) {
771
+ const resolved = this.resolve(normalized, {
772
+ type: "file"
773
+ });
774
+ if (resolved && !results.includes(resolved)) {
775
+ results.push(resolved);
776
+ }
777
+ continue;
778
+ }
779
+ const absPattern = isAbsolutePath(normalized) ? normalized : this.formatPath(joinPaths(this.#context.workspaceConfig.workspaceRoot, normalized));
780
+ const firstGlobIdx = absPattern.search(/[*?[\]{}]/);
781
+ const baseDir = firstGlobIdx === -1 ? findFilePath(absPattern) : absPattern.slice(0, Math.max(0, absPattern.lastIndexOf("/", firstGlobIdx)));
782
+ const stack = [
783
+ baseDir && isAbsolutePath(baseDir) ? baseDir : this.#context.workspaceConfig.workspaceRoot
784
+ ];
785
+ while (stack.length) {
786
+ const dir = stack.pop();
787
+ let entries = [];
788
+ try {
789
+ entries = this.readdirSync(dir);
790
+ } catch {
791
+ continue;
792
+ }
793
+ for (const entry of entries) {
794
+ const full = this.formatPath(joinPaths(dir, entry));
795
+ let stats;
796
+ try {
797
+ stats = this.#unifiedFS.lstatSync(full);
798
+ } catch {
799
+ stats = void 0;
800
+ }
801
+ if (!stats) continue;
802
+ if (stats.isDirectory()) {
803
+ stack.push(full);
804
+ } else if (stats.isFile()) {
805
+ if (this.buildRegex(absPattern).test(full)) {
806
+ const resolved = this.resolve(full, {
807
+ type: "file"
808
+ });
809
+ if (resolved && !results.includes(resolved)) {
810
+ results.push(resolved);
811
+ }
812
+ }
813
+ }
814
+ }
815
+ }
816
+ }
817
+ return results;
818
+ }
819
+ /**
820
+ * Moves a file from one path to another in the virtual file system (VFS).
821
+ *
822
+ * @param srcPath - The source path to move
823
+ * @param destPath - The destination path to move to
824
+ */
825
+ async move(srcPath, destPath) {
826
+ const content = await this.readFile(srcPath);
827
+ await this.writeFile(destPath, content);
828
+ await this.rm(srcPath);
829
+ }
830
+ /**
831
+ * Synchronously moves a file from one path to another in the virtual file system (VFS).
832
+ *
833
+ * @param srcPath - The source path to move
834
+ * @param destPath - The destination path to move to
835
+ */
836
+ moveSync(srcPath, destPath) {
837
+ const content = this.readFileSync(srcPath);
838
+ this.writeFileSync(destPath, content);
839
+ this.rmSync(srcPath);
840
+ }
841
+ /**
842
+ * Copies a file from one path to another in the virtual file system (VFS).
843
+ *
844
+ * @param srcPath - The source path to copy
845
+ * @param destPath - The destination path to copy to
846
+ */
847
+ async copy(srcPath, destPath) {
848
+ const content = await this.readFile(srcPath);
849
+ await this.writeFile(destPath, content);
850
+ }
851
+ /**
852
+ * Synchronously copies a file from one path to another in the virtual file system (VFS).
853
+ *
854
+ * @param srcPath - The source path to copy
855
+ * @param destPath - The destination path to copy to
856
+ */
857
+ copySync(srcPath, destPath) {
858
+ const content = this.readFileSync(srcPath);
859
+ this.writeFileSync(destPath, content);
860
+ }
861
+ /**
689
862
  * Lists files in a given path.
690
863
  *
691
864
  * @param pathOrId - The path to list files from.
@@ -827,6 +1000,19 @@ var VirtualFileSystem = class {
827
1000
  return this.resolve(pathOrId) !== false;
828
1001
  }
829
1002
  /**
1003
+ * Retrieves the metadata of a file in the virtual file system (VFS).
1004
+ *
1005
+ * @param pathOrId - The path or ID of the file to retrieve metadata for.
1006
+ * @returns The metadata of the file, or undefined if the file does not exist.
1007
+ */
1008
+ getMetadata(pathOrId) {
1009
+ const resolved = this.resolve(pathOrId);
1010
+ if (resolved && this.meta[resolved]) {
1011
+ return this.meta[resolved];
1012
+ }
1013
+ return void 0;
1014
+ }
1015
+ /**
830
1016
  * Checks if a file exists in the virtual file system (VFS).
831
1017
  *
832
1018
  * @remarks
@@ -968,6 +1154,10 @@ var VirtualFileSystem = class {
968
1154
  getPartialMeta() {
969
1155
  return Object.fromEntries(Object.entries(this.#meta).filter(([_, data]) => isSetObject(data)));
970
1156
  }
1157
+ buildRegex(strPattern) {
1158
+ const token = "::GLOBSTAR::";
1159
+ return new RegExp(`^${this.formatPath(strPattern).replace(/\*\*/g, token).replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]").replace(new RegExp(token, "g"), ".*")}$`);
1160
+ }
971
1161
  /**
972
1162
  * Converts a relative path to an absolute path based on the workspace and project root.
973
1163
  *
@@ -991,7 +1181,7 @@ var VirtualFileSystem = class {
991
1181
  */
992
1182
  formatId(id) {
993
1183
  const formattedId = toFilePath(id);
994
- return `${this.#context.config.output.builtinPrefix}:${formattedId.replace(new RegExp(`^${this.#context.config.output.builtinPrefix}:`), "").replace(/^\\0/, "").replace(findFileExtensionSafe(formattedId), "")}`;
1184
+ return `${this.#context.config.output.builtinPrefix}:${formattedId.replace(new RegExp(`^${this.#context.config.output.builtinPrefix}:`), "").replace(/^\\0/, "").replace(findFileDotExtensionSafe(formattedId), "")}`;
995
1185
  }
996
1186
  /**
997
1187
  * Resolves an id parameter to a corresponding virtual file path in the virtual file system (VFS).
@@ -1201,7 +1391,6 @@ var PowerlinesContext = class _PowerlinesContext {
1201
1391
  #envPaths;
1202
1392
  #fs;
1203
1393
  #tsconfig;
1204
- // #entry: ResolvedEntryTypeDefinition[] = [] as ResolvedEntryTypeDefinition[];
1205
1394
  #getConfigProps(config = {}) {
1206
1395
  return {
1207
1396
  variant: config.build?.variant,
@@ -3140,5 +3329,5 @@ function createUnpluginFactory(variant, decorate) {
3140
3329
  __name(createUnpluginFactory, "createUnpluginFactory");
3141
3330
 
3142
3331
  export { createUnpluginFactory };
3143
- //# sourceMappingURL=chunk-PIFE7MUZ.js.map
3144
- //# sourceMappingURL=chunk-PIFE7MUZ.js.map
3332
+ //# sourceMappingURL=chunk-6BRTJXZ2.js.map
3333
+ //# sourceMappingURL=chunk-6BRTJXZ2.js.map