powerlines 0.10.1 → 0.11.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-gk8S8LFP.d.cts → hooks-H3i0YxVa.d.cts} +1 -1
  50. package/dist/{hooks-BGYnc61f.d.ts → hooks-QG1Q6zBM.d.ts} +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-B481RQbf.d.cts} +615 -559
  114. package/dist/lib/{config-B_WTwd49.d.ts → context-efHKG-wc.d.ts} +615 -559
  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-CdvPHbFZ.d.cts} +1 -1
  124. package/dist/lib/{hooks-4KkL9GD2.d.cts → hooks-JhMVguVh.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/rolldown.cjs +7 -7
  182. package/dist/rolldown.d.cts +1 -1
  183. package/dist/rolldown.d.ts +1 -1
  184. package/dist/rolldown.js +4 -4
  185. package/dist/rollup.cjs +7 -7
  186. package/dist/rollup.d.cts +1 -1
  187. package/dist/rollup.d.ts +1 -1
  188. package/dist/rollup.js +4 -4
  189. package/dist/rspack.cjs +7 -7
  190. package/dist/rspack.d.cts +1 -1
  191. package/dist/rspack.d.ts +1 -1
  192. package/dist/rspack.js +4 -4
  193. package/dist/tsup.cjs +8 -8
  194. package/dist/tsup.js +5 -5
  195. package/dist/types/babel.d.cts +1 -1
  196. package/dist/types/babel.d.ts +1 -1
  197. package/dist/types/commands.d.cts +1 -1
  198. package/dist/types/commands.d.ts +1 -1
  199. package/dist/types/compiler.d.cts +1 -1
  200. package/dist/types/compiler.d.ts +1 -1
  201. package/dist/types/config.d.cts +1 -1
  202. package/dist/types/config.d.ts +1 -1
  203. package/dist/types/context.cjs +2 -2
  204. package/dist/types/context.d.cts +1 -1
  205. package/dist/types/context.d.ts +1 -1
  206. package/dist/types/context.js +1 -1
  207. package/dist/types/hooks.d.cts +1 -1
  208. package/dist/types/hooks.d.ts +1 -1
  209. package/dist/types/index.cjs +9 -9
  210. package/dist/types/index.d.cts +1 -1
  211. package/dist/types/index.d.ts +1 -1
  212. package/dist/types/index.js +2 -2
  213. package/dist/types/internal.d.cts +2 -2
  214. package/dist/types/internal.d.ts +2 -2
  215. package/dist/types/plugin.d.cts +1 -1
  216. package/dist/types/plugin.d.ts +1 -1
  217. package/dist/types/resolved.d.cts +1 -1
  218. package/dist/types/resolved.d.ts +1 -1
  219. package/dist/types/unplugin.d.cts +1 -1
  220. package/dist/types/unplugin.d.ts +1 -1
  221. package/dist/types/vfs.cjs +7 -7
  222. package/dist/types/vfs.d.cts +61 -5
  223. package/dist/types/vfs.d.ts +61 -5
  224. package/dist/types/vfs.js +1 -1
  225. package/dist/unloader.cjs +7 -7
  226. package/dist/unloader.d.cts +1 -1
  227. package/dist/unloader.d.ts +1 -1
  228. package/dist/unloader.js +4 -4
  229. package/dist/unplugin.cjs +18 -18
  230. package/dist/unplugin.d.cts +2 -2
  231. package/dist/unplugin.d.ts +2 -2
  232. package/dist/unplugin.js +15 -15
  233. package/dist/vite.cjs +7 -7
  234. package/dist/vite.d.cts +1 -1
  235. package/dist/vite.d.ts +1 -1
  236. package/dist/vite.js +4 -4
  237. package/dist/webpack.cjs +7 -7
  238. package/dist/webpack.d.cts +1 -1
  239. package/dist/webpack.d.ts +1 -1
  240. package/dist/webpack.js +4 -4
  241. package/package.json +9 -11
  242. package/dist/chunk-IJBH5OUN.cjs +0 -12
  243. package/dist/chunk-JBTSAOIQ.js +0 -31
  244. package/dist/chunk-LXMNDUPG.cjs +0 -12
  245. package/dist/chunk-RQ4CHMPO.cjs +0 -12
  246. package/dist/chunk-S5QFX2GM.cjs +0 -12
  247. package/dist/chunk-SL3CXJWD.cjs +0 -34
  248. package/dist/chunk-YG7U2GIR.cjs +0 -24
  249. package/dist/chunk-ZFATNDSY.cjs +0 -12
  250. package/dist/lib/chunk-6U2UX2PX.cjs.map +0 -1
  251. package/dist/lib/chunk-KFE2IR3Y.js.map +0 -1
  252. package/dist/lib/chunk-M7U5RMK7.js.map +0 -1
  253. package/dist/lib/chunk-M7WHFUKR.cjs.map +0 -1
  254. package/dist/lib/chunk-PIFE7MUZ.js.map +0 -1
  255. package/dist/lib/chunk-Q2RUDKWY.cjs.map +0 -1
  256. package/dist/{resolved-CcuVqMqc.d.cts → resolved-3RFshyDy.d.cts} +16 -16
  257. package/dist/{resolved-Dhscmo3z.d.ts → resolved-BzyBMgQG.d.ts} +16 -16
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkRQICHHZM_cjs = require('./chunk-RQICHHZM.cjs');
4
4
  var chunkMFC7UJHT_cjs = require('./chunk-MFC7UJHT.cjs');
5
- var chunkQ2RUDKWY_cjs = require('./chunk-Q2RUDKWY.cjs');
5
+ var chunkBW3VFCTS_cjs = require('./chunk-BW3VFCTS.cjs');
6
6
  var chunkRK2VVGL6_cjs = require('./chunk-RK2VVGL6.cjs');
7
7
  var chunk7EAV6Q7B_cjs = require('./chunk-7EAV6Q7B.cjs');
8
8
  var chunkLJZEN4HP_cjs = require('./chunk-LJZEN4HP.cjs');
@@ -374,25 +374,25 @@ var VirtualFileSystem = class {
374
374
  /**
375
375
  * Exposes the internal VFS map for advanced usage.
376
376
  */
377
- get [chunkQ2RUDKWY_cjs.__VFS_CACHE__]() {
377
+ get [chunkBW3VFCTS_cjs.__VFS_CACHE__]() {
378
378
  return this.#cachedFS;
379
379
  }
380
380
  /**
381
381
  * Exposes the internal VFS resolver cache for advanced usage.
382
382
  */
383
- get [chunkQ2RUDKWY_cjs.__VFS_RESOLVER__]() {
383
+ get [chunkBW3VFCTS_cjs.__VFS_RESOLVER__]() {
384
384
  return this.#cachedResolver;
385
385
  }
386
386
  /**
387
387
  * Exposes the internal VFS map for advanced usage.
388
388
  */
389
- get [chunkQ2RUDKWY_cjs.__VFS_VIRTUAL__]() {
389
+ get [chunkBW3VFCTS_cjs.__VFS_VIRTUAL__]() {
390
390
  return this.#virtualFS;
391
391
  }
392
392
  /**
393
393
  * Exposes the internal UFS map for advanced usage.
394
394
  */
395
- get [chunkQ2RUDKWY_cjs.__VFS_UNIFIED__]() {
395
+ get [chunkBW3VFCTS_cjs.__VFS_UNIFIED__]() {
396
396
  return this.#unifiedFS;
397
397
  }
398
398
  /**
@@ -509,13 +509,13 @@ var VirtualFileSystem = class {
509
509
  }
510
510
  this.#log = chunk632PWWU7_cjs.extendLog(this.#context.log, "virtual-file-system");
511
511
  }
512
- [chunkQ2RUDKWY_cjs.__VFS_INIT__]() {
512
+ [chunkBW3VFCTS_cjs.__VFS_INIT__]() {
513
513
  if (!this.#isPatched && this.#context.config.output.mode !== "fs") {
514
514
  this.#revert = patchFS(fs__default.default, this);
515
515
  this.#isPatched = true;
516
516
  }
517
517
  }
518
- [chunkQ2RUDKWY_cjs.__VFS_REVERT__]() {
518
+ [chunkBW3VFCTS_cjs.__VFS_REVERT__]() {
519
519
  if (this.#isPatched && this.#context.config.output.mode !== "fs") {
520
520
  if (!this.#revert) {
521
521
  throw new Error("Attempting to revert File System patch prior to calling `__init__` function");
@@ -679,6 +679,19 @@ var VirtualFileSystem = class {
679
679
  return this.unlink(path, options);
680
680
  }
681
681
  /**
682
+ * Synchronously removes a file or directory in the virtual file system (VFS).
683
+ *
684
+ * @param path - The path to the file or directory to remove.
685
+ * @param options - Options for removing the file or directory.
686
+ */
687
+ rmSync(path, options = {}) {
688
+ this.#log(types.LogLevelLabel.TRACE, `Removing: ${toFilePath(path)}`);
689
+ if (this.isDirectory(path)) {
690
+ return this.rmdirSync(path, options);
691
+ }
692
+ return this.unlinkSync(path, options);
693
+ }
694
+ /**
682
695
  * Creates a directory in the virtual file system (VFS).
683
696
  *
684
697
  * @param path - The path to create the directory at.
@@ -715,6 +728,166 @@ var VirtualFileSystem = class {
715
728
  return result;
716
729
  }
717
730
  /**
731
+ * Glob files in the virtual file system (VFS) based on the provided pattern(s).
732
+ *
733
+ * @param patterns - A pattern (or multiple patterns) to use to determine the file paths to return
734
+ * @returns An array of file paths matching the provided pattern(s)
735
+ */
736
+ async glob(patterns) {
737
+ const results = [];
738
+ for (const pattern of toArray.toArray(patterns)) {
739
+ const normalized = this.formatPath(pattern);
740
+ if (!/[*?[\]{}]/.test(normalized) && !normalized.includes("**")) {
741
+ const resolved = this.resolve(normalized, {
742
+ type: "file"
743
+ });
744
+ if (resolved && !results.includes(resolved)) {
745
+ results.push(resolved);
746
+ }
747
+ continue;
748
+ }
749
+ const absPattern = isType.isAbsolutePath(normalized) ? normalized : this.formatPath(joinPaths.joinPaths(this.#context.workspaceConfig.workspaceRoot, normalized));
750
+ const firstGlobIdx = absPattern.search(/[*?[\]{}]/);
751
+ const baseDir = firstGlobIdx === -1 ? filePathFns.findFilePath(absPattern) : absPattern.slice(0, Math.max(0, absPattern.lastIndexOf("/", firstGlobIdx)));
752
+ const stack = [
753
+ baseDir && isType.isAbsolutePath(baseDir) ? baseDir : this.#context.workspaceConfig.workspaceRoot
754
+ ];
755
+ while (stack.length) {
756
+ const dir = stack.pop();
757
+ let entries = [];
758
+ try {
759
+ entries = await this.readdir(dir);
760
+ } catch {
761
+ continue;
762
+ }
763
+ for (const entry of entries) {
764
+ const full = this.formatPath(joinPaths.joinPaths(dir, entry));
765
+ let stats;
766
+ try {
767
+ stats = this.#unifiedFS.lstatSync(full);
768
+ } catch {
769
+ stats = void 0;
770
+ }
771
+ if (!stats) continue;
772
+ if (stats.isDirectory()) {
773
+ stack.push(full);
774
+ } else if (stats.isFile()) {
775
+ if (this.buildRegex(absPattern).test(full)) {
776
+ const resolved = this.resolve(full, {
777
+ type: "file"
778
+ });
779
+ if (resolved && !results.includes(resolved)) {
780
+ results.push(resolved);
781
+ }
782
+ }
783
+ }
784
+ }
785
+ }
786
+ }
787
+ return results;
788
+ }
789
+ /**
790
+ * Synchronously glob files in the virtual file system (VFS) based on the provided pattern(s).
791
+ *
792
+ * @param patterns - A pattern (or multiple patterns) to use to determine the file paths to return
793
+ * @returns An array of file paths matching the provided pattern(s)
794
+ */
795
+ globSync(patterns) {
796
+ const results = [];
797
+ for (const pattern of toArray.toArray(patterns)) {
798
+ const normalized = this.formatPath(pattern);
799
+ if (!/[*?[\]{}]/.test(normalized) && !normalized.includes("**")) {
800
+ const resolved = this.resolve(normalized, {
801
+ type: "file"
802
+ });
803
+ if (resolved && !results.includes(resolved)) {
804
+ results.push(resolved);
805
+ }
806
+ continue;
807
+ }
808
+ const absPattern = isType.isAbsolutePath(normalized) ? normalized : this.formatPath(joinPaths.joinPaths(this.#context.workspaceConfig.workspaceRoot, normalized));
809
+ const firstGlobIdx = absPattern.search(/[*?[\]{}]/);
810
+ const baseDir = firstGlobIdx === -1 ? filePathFns.findFilePath(absPattern) : absPattern.slice(0, Math.max(0, absPattern.lastIndexOf("/", firstGlobIdx)));
811
+ const stack = [
812
+ baseDir && isType.isAbsolutePath(baseDir) ? baseDir : this.#context.workspaceConfig.workspaceRoot
813
+ ];
814
+ while (stack.length) {
815
+ const dir = stack.pop();
816
+ let entries = [];
817
+ try {
818
+ entries = this.readdirSync(dir);
819
+ } catch {
820
+ continue;
821
+ }
822
+ for (const entry of entries) {
823
+ const full = this.formatPath(joinPaths.joinPaths(dir, entry));
824
+ let stats;
825
+ try {
826
+ stats = this.#unifiedFS.lstatSync(full);
827
+ } catch {
828
+ stats = void 0;
829
+ }
830
+ if (!stats) continue;
831
+ if (stats.isDirectory()) {
832
+ stack.push(full);
833
+ } else if (stats.isFile()) {
834
+ if (this.buildRegex(absPattern).test(full)) {
835
+ const resolved = this.resolve(full, {
836
+ type: "file"
837
+ });
838
+ if (resolved && !results.includes(resolved)) {
839
+ results.push(resolved);
840
+ }
841
+ }
842
+ }
843
+ }
844
+ }
845
+ }
846
+ return results;
847
+ }
848
+ /**
849
+ * Moves a file from one path to another in the virtual file system (VFS).
850
+ *
851
+ * @param srcPath - The source path to move
852
+ * @param destPath - The destination path to move to
853
+ */
854
+ async move(srcPath, destPath) {
855
+ const content = await this.readFile(srcPath);
856
+ await this.writeFile(destPath, content);
857
+ await this.rm(srcPath);
858
+ }
859
+ /**
860
+ * Synchronously moves a file from one path to another in the virtual file system (VFS).
861
+ *
862
+ * @param srcPath - The source path to move
863
+ * @param destPath - The destination path to move to
864
+ */
865
+ moveSync(srcPath, destPath) {
866
+ const content = this.readFileSync(srcPath);
867
+ this.writeFileSync(destPath, content);
868
+ this.rmSync(srcPath);
869
+ }
870
+ /**
871
+ * Copies a file from one path to another in the virtual file system (VFS).
872
+ *
873
+ * @param srcPath - The source path to copy
874
+ * @param destPath - The destination path to copy to
875
+ */
876
+ async copy(srcPath, destPath) {
877
+ const content = await this.readFile(srcPath);
878
+ await this.writeFile(destPath, content);
879
+ }
880
+ /**
881
+ * Synchronously copies a file from one path to another in the virtual file system (VFS).
882
+ *
883
+ * @param srcPath - The source path to copy
884
+ * @param destPath - The destination path to copy to
885
+ */
886
+ copySync(srcPath, destPath) {
887
+ const content = this.readFileSync(srcPath);
888
+ this.writeFileSync(destPath, content);
889
+ }
890
+ /**
718
891
  * Lists files in a given path.
719
892
  *
720
893
  * @param pathOrId - The path to list files from.
@@ -856,6 +1029,19 @@ var VirtualFileSystem = class {
856
1029
  return this.resolve(pathOrId) !== false;
857
1030
  }
858
1031
  /**
1032
+ * Retrieves the metadata of a file in the virtual file system (VFS).
1033
+ *
1034
+ * @param pathOrId - The path or ID of the file to retrieve metadata for.
1035
+ * @returns The metadata of the file, or undefined if the file does not exist.
1036
+ */
1037
+ getMetadata(pathOrId) {
1038
+ const resolved = this.resolve(pathOrId);
1039
+ if (resolved && this.meta[resolved]) {
1040
+ return this.meta[resolved];
1041
+ }
1042
+ return void 0;
1043
+ }
1044
+ /**
859
1045
  * Checks if a file exists in the virtual file system (VFS).
860
1046
  *
861
1047
  * @remarks
@@ -997,6 +1183,10 @@ var VirtualFileSystem = class {
997
1183
  getPartialMeta() {
998
1184
  return Object.fromEntries(Object.entries(this.#meta).filter(([_, data]) => isSetObject.isSetObject(data)));
999
1185
  }
1186
+ buildRegex(strPattern) {
1187
+ const token = "::GLOBSTAR::";
1188
+ return new RegExp(`^${this.formatPath(strPattern).replace(/\*\*/g, token).replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]").replace(new RegExp(token, "g"), ".*")}$`);
1189
+ }
1000
1190
  /**
1001
1191
  * Converts a relative path to an absolute path based on the workspace and project root.
1002
1192
  *
@@ -1020,7 +1210,7 @@ var VirtualFileSystem = class {
1020
1210
  */
1021
1211
  formatId(id) {
1022
1212
  const formattedId = toFilePath(id);
1023
- return `${this.#context.config.output.builtinPrefix}:${formattedId.replace(new RegExp(`^${this.#context.config.output.builtinPrefix}:`), "").replace(/^\\0/, "").replace(filePathFns.findFileExtensionSafe(formattedId), "")}`;
1213
+ return `${this.#context.config.output.builtinPrefix}:${formattedId.replace(new RegExp(`^${this.#context.config.output.builtinPrefix}:`), "").replace(/^\\0/, "").replace(filePathFns.findFileDotExtensionSafe(formattedId), "")}`;
1024
1214
  }
1025
1215
  /**
1026
1216
  * Resolves an id parameter to a corresponding virtual file path in the virtual file system (VFS).
@@ -1230,7 +1420,6 @@ var PowerlinesContext = class _PowerlinesContext {
1230
1420
  #envPaths;
1231
1421
  #fs;
1232
1422
  #tsconfig;
1233
- // #entry: ResolvedEntryTypeDefinition[] = [] as ResolvedEntryTypeDefinition[];
1234
1423
  #getConfigProps(config = {}) {
1235
1424
  return {
1236
1425
  variant: config.build?.variant,
@@ -1353,10 +1542,10 @@ var PowerlinesContext = class _PowerlinesContext {
1353
1542
  workspaceRoot: this.workspaceConfig?.workspaceRoot,
1354
1543
  projectRoot: this.config?.projectRoot
1355
1544
  }, {
1356
- maxLength: chunkQ2RUDKWY_cjs.PROJECT_ROOT_HASH_LENGTH
1545
+ maxLength: chunkBW3VFCTS_cjs.PROJECT_ROOT_HASH_LENGTH
1357
1546
  }),
1358
1547
  configHash: murmurhash.murmurhash(this.config, {
1359
- maxLength: chunkQ2RUDKWY_cjs.CACHE_HASH_LENGTH
1548
+ maxLength: chunkBW3VFCTS_cjs.CACHE_HASH_LENGTH
1360
1549
  }),
1361
1550
  builtinIdMap: {},
1362
1551
  virtualFiles: {}
@@ -1418,7 +1607,7 @@ var PowerlinesContext = class _PowerlinesContext {
1418
1607
  * Get the path to the data directory for the project
1419
1608
  */
1420
1609
  get dataPath() {
1421
- return join.joinPaths(this.envPaths.data, "projects", chunkQ2RUDKWY_cjs.getPrefixedProjectRootHash(this.config.name, this.meta.projectRootHash));
1610
+ return join.joinPaths(this.envPaths.data, "projects", chunkBW3VFCTS_cjs.getPrefixedProjectRootHash(this.config.name, this.meta.projectRootHash));
1422
1611
  }
1423
1612
  /**
1424
1613
  * Get the path to the cache directory for the project
@@ -1428,7 +1617,7 @@ var PowerlinesContext = class _PowerlinesContext {
1428
1617
  checksum: this.#checksum,
1429
1618
  config: this.meta.configHash
1430
1619
  }, {
1431
- maxLength: chunkQ2RUDKWY_cjs.CACHE_HASH_LENGTH
1620
+ maxLength: chunkBW3VFCTS_cjs.CACHE_HASH_LENGTH
1432
1621
  }));
1433
1622
  }
1434
1623
  /**
@@ -1632,7 +1821,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
1632
1821
  if (exists.existsSync(packageJsonPath)) {
1633
1822
  this.packageJson = await json.readJsonFile(packageJsonPath);
1634
1823
  }
1635
- this.#checksum = await chunkQ2RUDKWY_cjs.getChecksum(cacheKey.projectRoot);
1824
+ this.#checksum = await chunkBW3VFCTS_cjs.getChecksum(cacheKey.projectRoot);
1636
1825
  this.resolver = createResolver({
1637
1826
  workspaceRoot: this.workspaceConfig.workspaceRoot,
1638
1827
  projectRoot: cacheKey.projectRoot,
@@ -2607,8 +2796,8 @@ ${context.entry.map((entry) => `- ${entry.input.file || entry.file}${entry.outpu
2607
2796
  context.log(types.LogLevelLabel.TRACE, `Powerlines configuration has been resolved:
2608
2797
 
2609
2798
  ${console.formatLogMessage(context.config)}`);
2610
- context.fs[chunkQ2RUDKWY_cjs.__VFS_INIT__]();
2611
- await chunkQ2RUDKWY_cjs.writeMetaFile(context);
2799
+ context.fs[chunkBW3VFCTS_cjs.__VFS_INIT__]();
2800
+ await chunkBW3VFCTS_cjs.writeMetaFile(context);
2612
2801
  context.persistedMeta = context.meta;
2613
2802
  if (!exists.existsSync(context.cachePath)) {
2614
2803
  await helpers.createDirectory(context.cachePath);
@@ -2629,8 +2818,8 @@ ${console.formatLogMessage(context.config)}`);
2629
2818
  throw new Error("Failed to parse the TypeScript configuration file.");
2630
2819
  }
2631
2820
  await this.callPostHook(context, "prepare");
2632
- await chunkQ2RUDKWY_cjs.writeMetaFile(context);
2633
- context.fs[chunkQ2RUDKWY_cjs.__VFS_REVERT__]();
2821
+ await chunkBW3VFCTS_cjs.writeMetaFile(context);
2822
+ context.fs[chunkBW3VFCTS_cjs.__VFS_REVERT__]();
2634
2823
  });
2635
2824
  this.context.log(types.LogLevelLabel.INFO, "Powerlines API has been prepared successfully");
2636
2825
  }
@@ -2789,7 +2978,7 @@ ${console.formatLogMessage(context.config)}`);
2789
2978
  this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution started");
2790
2979
  await this.#executeEnvironments(async (context) => {
2791
2980
  await this.callHook(context, "finalize");
2792
- context.fs[chunkQ2RUDKWY_cjs.__VFS_REVERT__]();
2981
+ context.fs[chunkBW3VFCTS_cjs.__VFS_REVERT__]();
2793
2982
  });
2794
2983
  this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution completed");
2795
2984
  }
@@ -3169,5 +3358,5 @@ function createUnpluginFactory(variant, decorate) {
3169
3358
  chunkPK6SKIKE_cjs.__name(createUnpluginFactory, "createUnpluginFactory");
3170
3359
 
3171
3360
  exports.createUnpluginFactory = createUnpluginFactory;
3172
- //# sourceMappingURL=chunk-M7WHFUKR.cjs.map
3173
- //# sourceMappingURL=chunk-M7WHFUKR.cjs.map
3361
+ //# sourceMappingURL=chunk-LYD5OTBI.cjs.map
3362
+ //# sourceMappingURL=chunk-LYD5OTBI.cjs.map