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.
- package/dist/astro.cjs +8 -8
- package/dist/astro.d.cts +1 -1
- package/dist/astro.d.ts +1 -1
- package/dist/astro.js +5 -5
- package/dist/{chunk-5XYGZ3DC.cjs → chunk-22K72CJ5.cjs} +2 -2
- package/dist/{chunk-GPPJ2CRE.js → chunk-4HGQJ4KR.js} +2 -2
- package/dist/chunk-7MTW3KR2.cjs +12 -0
- package/dist/{chunk-VIRKTIPK.js → chunk-7UIYU6SC.js} +3 -3
- package/dist/chunk-7WMWRX2S.cjs +12 -0
- package/dist/{chunk-HVT7PBFF.js → chunk-A3BBPLTY.js} +3 -3
- package/dist/{chunk-S746E63M.js → chunk-BHP6KBGK.js} +3 -3
- package/dist/{chunk-ZU4IRZSQ.js → chunk-BOIEJ5I6.js} +3 -3
- package/dist/chunk-DELRP3WY.js +31 -0
- package/dist/{chunk-ZBDP43LG.cjs → chunk-ELHJY5WG.cjs} +4 -4
- package/dist/{chunk-UHCRNFFC.cjs → chunk-FANQC345.cjs} +4 -4
- package/dist/chunk-GV3S7ZR3.cjs +34 -0
- package/dist/{chunk-WCPY7HPU.js → chunk-L3DAMAEC.js} +4 -4
- package/dist/chunk-LC6FLEJS.cjs +12 -0
- package/dist/{chunk-N7NE3VOU.js → chunk-MAEKW52U.js} +3 -3
- package/dist/chunk-MXJWCZDP.cjs +12 -0
- package/dist/{chunk-EGSEJQCE.js → chunk-NGKWITCO.js} +3 -3
- package/dist/{chunk-L2SAK2JC.cjs → chunk-OC7CCD5M.cjs} +4 -4
- package/dist/{chunk-OYIM2M74.js → chunk-P4BOYWXT.js} +195 -6
- package/dist/{chunk-UTVZVGM3.cjs → chunk-PJRHRDLS.cjs} +204 -15
- package/dist/{chunk-5Y4JYQ66.js → chunk-RBRFT2R6.js} +3 -3
- package/dist/{chunk-66GXB2UY.cjs → chunk-RU6BHTIP.cjs} +4 -4
- package/dist/{chunk-WPVIF35O.js → chunk-SIZKRND7.js} +2 -2
- package/dist/chunk-SNARILEC.cjs +24 -0
- package/dist/{chunk-6UDHGAAI.js → chunk-SY7N6FC3.js} +3 -3
- package/dist/{chunk-QHGPZK2H.cjs → chunk-V5D5NVV7.cjs} +4 -4
- package/dist/{chunk-SDEBJQDT.js → chunk-V7LXFIGK.js} +3 -3
- package/dist/{chunk-2RHPFVYT.cjs → chunk-WCTOTE3T.cjs} +8 -8
- package/dist/chunk-WD4363UW.cjs +12 -0
- package/dist/{chunk-7IWH37DY.cjs → chunk-YIWHO6SW.cjs} +2 -2
- package/dist/{chunk-3Y5CCIJR.js → chunk-ZP5QLZQ2.js} +3 -3
- package/dist/{chunk-KYGEWAEG.js → chunk-ZQ7U35QZ.js} +3 -3
- package/dist/define-config.d.cts +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/esbuild.cjs +7 -7
- package/dist/esbuild.d.cts +1 -1
- package/dist/esbuild.d.ts +1 -1
- package/dist/esbuild.js +4 -4
- package/dist/extend-plugin.d.cts +1 -1
- package/dist/extend-plugin.d.ts +1 -1
- package/dist/farm.cjs +4 -4
- package/dist/farm.d.cts +1 -1
- package/dist/farm.d.ts +1 -1
- package/dist/farm.js +3 -3
- package/dist/{hooks-BGYnc61f.d.ts → hooks-BmvalJZ4.d.ts} +1 -1
- package/dist/{hooks-gk8S8LFP.d.cts → hooks-BzFKq34L.d.cts} +1 -1
- package/dist/index.cjs +26 -26
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -17
- package/dist/internal/api.cjs +3 -3
- package/dist/internal/api.d.cts +2 -2
- package/dist/internal/api.d.ts +2 -2
- package/dist/internal/api.js +2 -2
- package/dist/lib/build/esbuild.d.cts +12 -12
- package/dist/lib/build/esbuild.d.ts +12 -12
- package/dist/lib/build/index.cjs +18 -18
- package/dist/lib/build/index.d.cts +13 -13
- package/dist/lib/build/index.d.ts +13 -13
- package/dist/lib/build/index.js +3 -3
- package/dist/lib/build/rolldown.d.cts +12 -12
- package/dist/lib/build/rolldown.d.ts +12 -12
- package/dist/lib/build/rollup.d.cts +12 -12
- package/dist/lib/build/rollup.d.ts +12 -12
- package/dist/lib/build/rspack.d.cts +12 -12
- package/dist/lib/build/rspack.d.ts +12 -12
- package/dist/lib/build/tsup.d.cts +11 -11
- package/dist/lib/build/tsup.d.ts +11 -11
- package/dist/lib/build/unbuild.cjs +5 -5
- package/dist/lib/build/unbuild.d.cts +13 -13
- package/dist/lib/build/unbuild.d.ts +13 -13
- package/dist/lib/build/unbuild.js +2 -2
- package/dist/lib/build/vite.d.cts +12 -12
- package/dist/lib/build/vite.d.ts +12 -12
- package/dist/lib/build/webpack.d.cts +12 -12
- package/dist/lib/build/webpack.d.ts +12 -12
- package/dist/lib/bundle.cjs +16 -0
- package/dist/lib/bundle.cjs.map +1 -0
- package/dist/lib/bundle.d.cts +44 -0
- package/dist/lib/bundle.d.ts +44 -0
- package/dist/lib/bundle.js +7 -0
- package/dist/lib/bundle.js.map +1 -0
- package/dist/lib/chunk-2625RJNJ.cjs +41 -0
- package/dist/lib/chunk-2625RJNJ.cjs.map +1 -0
- package/dist/lib/{chunk-PIFE7MUZ.js → chunk-6BRTJXZ2.js} +195 -6
- package/dist/lib/chunk-6BRTJXZ2.js.map +1 -0
- package/dist/lib/chunk-6IJTWIVJ.cjs +107 -0
- package/dist/lib/chunk-6IJTWIVJ.cjs.map +1 -0
- package/dist/lib/{chunk-YVDJCVE5.cjs → chunk-BAC4AJEP.cjs} +3 -3
- package/dist/lib/{chunk-YVDJCVE5.cjs.map → chunk-BAC4AJEP.cjs.map} +1 -1
- package/dist/lib/{chunk-Q2RUDKWY.cjs → chunk-BW3VFCTS.cjs} +2 -2
- package/dist/lib/chunk-BW3VFCTS.cjs.map +1 -0
- package/dist/lib/chunk-ESYYL5UH.js +105 -0
- package/dist/lib/chunk-ESYYL5UH.js.map +1 -0
- package/dist/lib/chunk-GTQZYDA7.js +39 -0
- package/dist/lib/chunk-GTQZYDA7.js.map +1 -0
- package/dist/lib/{chunk-M7U5RMK7.js → chunk-KOCDKJDJ.js} +2 -2
- package/dist/lib/chunk-KOCDKJDJ.js.map +1 -0
- package/dist/lib/{chunk-M7WHFUKR.cjs → chunk-LYD5OTBI.cjs} +210 -21
- package/dist/lib/chunk-LYD5OTBI.cjs.map +1 -0
- package/dist/lib/{chunk-6U2UX2PX.cjs → chunk-RLMEYZ5I.cjs} +11 -15
- package/dist/lib/chunk-RLMEYZ5I.cjs.map +1 -0
- package/dist/lib/{chunk-CAPN4FSS.js → chunk-S4TGQD45.js} +3 -3
- package/dist/lib/{chunk-CAPN4FSS.js.map → chunk-S4TGQD45.js.map} +1 -1
- package/dist/lib/{chunk-KFE2IR3Y.js → chunk-V2T4H24I.js} +11 -15
- package/dist/lib/chunk-V2T4H24I.js.map +1 -0
- package/dist/lib/config-file.d.cts +11 -11
- package/dist/lib/config-file.d.ts +11 -11
- package/dist/lib/{config-AuIGsUck.d.cts → context-BI46yeFZ.d.cts} +617 -557
- package/dist/lib/{config-B_WTwd49.d.ts → context-tEqvC3yI.d.ts} +617 -557
- package/dist/lib/create-program.cjs +13 -0
- package/dist/lib/create-program.cjs.map +1 -0
- package/dist/lib/create-program.d.cts +42 -0
- package/dist/lib/create-program.d.ts +42 -0
- package/dist/lib/create-program.js +4 -0
- package/dist/lib/create-program.js.map +1 -0
- package/dist/lib/entry.d.cts +12 -12
- package/dist/lib/entry.d.ts +12 -12
- package/dist/lib/{hooks-DErK4Fv4.d.ts → hooks-C9_XPS6c.d.cts} +1 -1
- package/dist/lib/{hooks-4KkL9GD2.d.cts → hooks-DESiFNA6.d.ts} +1 -1
- package/dist/lib/index.cjs +47 -36
- package/dist/lib/index.d.cts +16 -13
- package/dist/lib/index.d.ts +16 -13
- package/dist/lib/index.js +10 -7
- package/dist/lib/logger.d.cts +12 -12
- package/dist/lib/logger.d.ts +12 -12
- package/dist/lib/typescript/compiler-host.cjs +46 -2
- package/dist/lib/typescript/compiler-host.cjs.map +1 -1
- package/dist/lib/typescript/compiler-host.d.cts +18 -13
- package/dist/lib/typescript/compiler-host.d.ts +18 -13
- package/dist/lib/typescript/compiler-host.js +45 -2
- package/dist/lib/typescript/compiler-host.js.map +1 -1
- package/dist/lib/typescript/import-transformer.d.cts +12 -12
- package/dist/lib/typescript/import-transformer.d.ts +12 -12
- package/dist/lib/typescript/index.cjs +6 -6
- package/dist/lib/typescript/index.d.cts +12 -12
- package/dist/lib/typescript/index.d.ts +12 -12
- package/dist/lib/typescript/index.js +1 -1
- package/dist/lib/typescript/program.cjs +6 -6
- package/dist/lib/typescript/program.d.cts +13 -13
- package/dist/lib/typescript/program.d.ts +13 -13
- package/dist/lib/typescript/program.js +1 -1
- package/dist/lib/unplugin/factory.cjs +3 -3
- package/dist/lib/unplugin/factory.d.cts +12 -12
- package/dist/lib/unplugin/factory.d.ts +12 -12
- package/dist/lib/unplugin/factory.js +2 -2
- package/dist/lib/unplugin/index.cjs +3 -3
- package/dist/lib/unplugin/index.d.cts +12 -12
- package/dist/lib/unplugin/index.d.ts +12 -12
- package/dist/lib/unplugin/index.js +2 -2
- package/dist/lib/unplugin/plugin.d.cts +11 -11
- package/dist/lib/unplugin/plugin.d.ts +11 -11
- package/dist/lib/unplugin/resolve-id.d.cts +11 -11
- package/dist/lib/unplugin/resolve-id.d.ts +11 -11
- package/dist/lib/utilities/file-header.d.cts +12 -12
- package/dist/lib/utilities/file-header.d.ts +12 -12
- package/dist/lib/utilities/index.cjs +20 -20
- package/dist/lib/utilities/index.d.cts +12 -12
- package/dist/lib/utilities/index.d.ts +12 -12
- package/dist/lib/utilities/index.js +3 -3
- package/dist/lib/utilities/meta.cjs +8 -8
- package/dist/lib/utilities/meta.d.cts +12 -12
- package/dist/lib/utilities/meta.d.ts +12 -12
- package/dist/lib/utilities/meta.js +1 -1
- package/dist/lib/utilities/plugin-helpers.d.cts +11 -11
- package/dist/lib/utilities/plugin-helpers.d.ts +11 -11
- package/dist/lib/utilities/resolve-path.d.cts +12 -12
- package/dist/lib/utilities/resolve-path.d.ts +12 -12
- package/dist/lib/utilities/worker.d.cts +11 -11
- package/dist/lib/utilities/worker.d.ts +11 -11
- package/dist/lib/utilities/write-file.d.cts +12 -12
- package/dist/lib/utilities/write-file.d.ts +12 -12
- package/dist/next.cjs +8 -8
- package/dist/next.js +5 -5
- package/dist/nuxt.cjs +9 -9
- package/dist/nuxt.js +6 -6
- package/dist/{resolved-Dhscmo3z.d.ts → resolved-BS8bJ6b1.d.ts} +21 -17
- package/dist/{resolved-CcuVqMqc.d.cts → resolved-CjkYiKA1.d.cts} +21 -17
- package/dist/rolldown.cjs +7 -7
- package/dist/rolldown.d.cts +1 -1
- package/dist/rolldown.d.ts +1 -1
- package/dist/rolldown.js +4 -4
- package/dist/rollup.cjs +7 -7
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +4 -4
- package/dist/rspack.cjs +7 -7
- package/dist/rspack.d.cts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/rspack.js +4 -4
- package/dist/tsup.cjs +8 -8
- package/dist/tsup.js +5 -5
- package/dist/types/babel.d.cts +1 -1
- package/dist/types/babel.d.ts +1 -1
- package/dist/types/commands.d.cts +1 -1
- package/dist/types/commands.d.ts +1 -1
- package/dist/types/compiler.d.cts +1 -1
- package/dist/types/compiler.d.ts +1 -1
- package/dist/types/config.d.cts +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/context.cjs +2 -2
- package/dist/types/context.d.cts +1 -1
- package/dist/types/context.d.ts +1 -1
- package/dist/types/context.js +1 -1
- package/dist/types/hooks.d.cts +1 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/index.cjs +9 -9
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/internal.d.cts +2 -2
- package/dist/types/internal.d.ts +2 -2
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/resolved.d.cts +1 -1
- package/dist/types/resolved.d.ts +1 -1
- package/dist/types/unplugin.d.cts +1 -1
- package/dist/types/unplugin.d.ts +1 -1
- package/dist/types/vfs.cjs +7 -7
- package/dist/types/vfs.d.cts +61 -5
- package/dist/types/vfs.d.ts +61 -5
- package/dist/types/vfs.js +1 -1
- package/dist/unloader.cjs +7 -7
- package/dist/unloader.d.cts +1 -1
- package/dist/unloader.d.ts +1 -1
- package/dist/unloader.js +4 -4
- package/dist/unplugin.cjs +18 -18
- package/dist/unplugin.d.cts +2 -2
- package/dist/unplugin.d.ts +2 -2
- package/dist/unplugin.js +15 -15
- package/dist/vite.cjs +7 -7
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +4 -4
- package/dist/webpack.cjs +7 -7
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +4 -4
- package/package.json +11 -9
- package/dist/chunk-IJBH5OUN.cjs +0 -12
- package/dist/chunk-JBTSAOIQ.js +0 -31
- package/dist/chunk-LXMNDUPG.cjs +0 -12
- package/dist/chunk-RQ4CHMPO.cjs +0 -12
- package/dist/chunk-S5QFX2GM.cjs +0 -12
- package/dist/chunk-SL3CXJWD.cjs +0 -34
- package/dist/chunk-YG7U2GIR.cjs +0 -24
- package/dist/chunk-ZFATNDSY.cjs +0 -12
- package/dist/lib/chunk-6U2UX2PX.cjs.map +0 -1
- package/dist/lib/chunk-KFE2IR3Y.js.map +0 -1
- package/dist/lib/chunk-M7U5RMK7.js.map +0 -1
- package/dist/lib/chunk-M7WHFUKR.cjs.map +0 -1
- package/dist/lib/chunk-PIFE7MUZ.js.map +0 -1
- package/dist/lib/chunk-Q2RUDKWY.cjs.map +0 -1
|
@@ -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
|
|
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 [
|
|
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 [
|
|
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 [
|
|
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 [
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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.
|
|
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:
|
|
1545
|
+
maxLength: chunkBW3VFCTS_cjs.PROJECT_ROOT_HASH_LENGTH
|
|
1357
1546
|
}),
|
|
1358
1547
|
configHash: murmurhash.murmurhash(this.config, {
|
|
1359
|
-
maxLength:
|
|
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",
|
|
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:
|
|
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
|
|
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[
|
|
2611
|
-
await
|
|
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
|
|
2633
|
-
context.fs[
|
|
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[
|
|
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-
|
|
3173
|
-
//# sourceMappingURL=chunk-
|
|
3361
|
+
//# sourceMappingURL=chunk-LYD5OTBI.cjs.map
|
|
3362
|
+
//# sourceMappingURL=chunk-LYD5OTBI.cjs.map
|