powerlines 0.40.9 → 0.40.11
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/{api-BCnLkGu9.mjs → api-BK_ItDEV.mjs} +152 -87
- package/dist/api-BK_ItDEV.mjs.map +1 -0
- package/dist/{api-5cmWHacj.cjs → api-CFjo00HQ.cjs} +151 -86
- package/dist/astro.cjs +2 -2
- package/dist/astro.d.cts +1 -1
- package/dist/astro.d.mts +5 -5
- package/dist/astro.mjs +2 -2
- package/dist/{config-C60sAYU4.d.cts → config-BS54DOEG.d.mts} +2 -2
- package/dist/{config-C60sAYU4.d.cts.map → config-BS54DOEG.d.mts.map} +1 -1
- package/dist/{config-CzpJjE2i.d.mts → config-BXRlCZ9z.d.cts} +2 -2
- package/dist/{config-CzpJjE2i.d.mts.map → config-BXRlCZ9z.d.cts.map} +1 -1
- package/dist/{config-B3Xvipn4.d.cts → config-CqsFCFR8.d.cts} +5 -1
- package/dist/config-CqsFCFR8.d.cts.map +1 -0
- package/dist/{config-BLihpN3D.d.mts → config-zlkThEoC.d.mts} +5 -1
- package/dist/config-zlkThEoC.d.mts.map +1 -0
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.d.cts +1 -1
- package/dist/context/index.d.mts +4 -4
- package/dist/context/index.mjs +1 -1
- package/dist/{esbuild-BsoRHGIH.mjs → esbuild-Bk-Zggsg.mjs} +2 -2
- package/dist/{esbuild-BsoRHGIH.mjs.map → esbuild-Bk-Zggsg.mjs.map} +1 -1
- package/dist/{esbuild-DiRy3ZaC.cjs → esbuild-qIA7SJ08.cjs} +1 -1
- package/dist/esbuild.cjs +2 -2
- package/dist/esbuild.d.cts +1 -1
- package/dist/esbuild.d.mts +4 -4
- package/dist/esbuild.mjs +2 -2
- package/dist/farm.cjs +1 -1
- package/dist/farm.d.cts +1 -1
- package/dist/farm.d.mts +4 -4
- package/dist/farm.mjs +1 -1
- package/dist/{index-DQR_ke3L.d.mts → index-BPdDWzbp.d.cts} +2 -2
- package/dist/{index-DQR_ke3L.d.mts.map → index-BPdDWzbp.d.cts.map} +1 -1
- package/dist/{index-Dv0-yJZY.d.cts → index-CRLhknww.d.mts} +2 -2
- package/dist/{index-Dv0-yJZY.d.cts.map → index-CRLhknww.d.mts.map} +1 -1
- package/dist/{index-DT3dtimM.d.mts → index-DjfS4slR.d.mts} +2 -2
- package/dist/{index-DT3dtimM.d.mts.map → index-DjfS4slR.d.mts.map} +1 -1
- package/dist/{index-Ct46ECR2.d.mts → index-PJqBw8CG.d.mts} +2 -2
- package/dist/{index-Ct46ECR2.d.mts.map → index-PJqBw8CG.d.mts.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +1 -1
- package/dist/next.cjs +2 -2
- package/dist/next.mjs +2 -2
- package/dist/nuxt.cjs +3 -3
- package/dist/nuxt.d.cts +1 -1
- package/dist/nuxt.d.mts +4 -4
- package/dist/nuxt.mjs +3 -3
- package/dist/{plugin-CiMsERtX.d.mts → plugin-CUXcGRD_.d.mts} +2 -2
- package/dist/{plugin-CiMsERtX.d.mts.map → plugin-CUXcGRD_.d.mts.map} +1 -1
- package/dist/{plugin-DtbGNmRb.d.cts → plugin-jeRiyjfy.d.cts} +2 -2
- package/dist/{plugin-DtbGNmRb.d.cts.map → plugin-jeRiyjfy.d.cts.map} +1 -1
- package/dist/plugin-utils.d.cts +1 -1
- package/dist/plugin-utils.d.mts +5 -5
- package/dist/{plugin-D6FK1hDg.d.cts → plugin-yR7bwKa_.d.cts} +2 -2
- package/dist/{plugin-D6FK1hDg.d.cts.map → plugin-yR7bwKa_.d.cts.map} +1 -1
- package/dist/{rolldown-B2ExPgjq.cjs → rolldown-BCRS1pSC.cjs} +1 -1
- package/dist/{rolldown-KnzE_4YL.mjs → rolldown-DzX9Vdwj.mjs} +2 -2
- package/dist/{rolldown-KnzE_4YL.mjs.map → rolldown-DzX9Vdwj.mjs.map} +1 -1
- package/dist/rolldown.cjs +2 -2
- package/dist/rolldown.d.cts +1 -1
- package/dist/rolldown.d.mts +4 -4
- package/dist/rolldown.mjs +2 -2
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.d.mts +4 -4
- package/dist/rollup.mjs +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.d.cts +1 -1
- package/dist/rspack.d.mts +4 -4
- package/dist/rspack.mjs +1 -1
- package/dist/storage/index.d.cts +1 -1
- package/dist/storage/index.d.mts +4 -4
- package/dist/tsdown.cjs +2 -2
- package/dist/tsdown.d.cts +1 -1
- package/dist/tsdown.d.mts +4 -4
- package/dist/tsdown.mjs +2 -2
- package/dist/tsup.cjs +2 -2
- package/dist/tsup.d.cts +1 -1
- package/dist/tsup.d.mts +4 -4
- package/dist/tsup.mjs +2 -2
- package/dist/typescript/index.d.cts +1 -1
- package/dist/typescript/index.d.mts +4 -4
- package/dist/unloader.cjs +1 -1
- package/dist/unloader.d.cts +1 -1
- package/dist/unloader.d.mts +4 -4
- package/dist/unloader.mjs +1 -1
- package/dist/unplugin.cjs +1 -1
- package/dist/unplugin.d.cts +2 -2
- package/dist/unplugin.d.mts +4 -4
- package/dist/unplugin.mjs +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.mts +2 -2
- package/dist/{vite-BJrqgN0s.mjs → vite-CAjumvM9.mjs} +2 -2
- package/dist/{vite-BJrqgN0s.mjs.map → vite-CAjumvM9.mjs.map} +1 -1
- package/dist/{vite-DRuqHJOi.cjs → vite-D7bANtZB.cjs} +1 -1
- package/dist/vite.cjs +2 -2
- package/dist/vite.d.cts +2 -2
- package/dist/vite.d.mts +5 -5
- package/dist/vite.mjs +2 -2
- package/dist/{webpack-Ubo4zeKP.cjs → webpack-dxWvtRFT.cjs} +1 -1
- package/dist/{webpack-Cd5Mx3qz.mjs → webpack-wXVZwOaB.mjs} +2 -2
- package/dist/{webpack-Cd5Mx3qz.mjs.map → webpack-wXVZwOaB.mjs.map} +1 -1
- package/dist/webpack.cjs +2 -2
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.mts +4 -4
- package/dist/webpack.mjs +2 -2
- package/dist/{write-file-BXi3LP7l.d.cts → write-file-D9MsaQ36.d.cts} +2 -2
- package/dist/{write-file-BXi3LP7l.d.cts.map → write-file-D9MsaQ36.d.cts.map} +1 -1
- package/package.json +28 -28
- package/dist/api-BCnLkGu9.mjs.map +0 -1
- package/dist/config-B3Xvipn4.d.cts.map +0 -1
- package/dist/config-BLihpN3D.d.mts.map +0 -1
|
@@ -70,7 +70,7 @@ import { setParseImpl } from "unplugin";
|
|
|
70
70
|
|
|
71
71
|
//#region package.json
|
|
72
72
|
var name = "powerlines";
|
|
73
|
-
var version = "0.40.
|
|
73
|
+
var version = "0.40.11";
|
|
74
74
|
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region src/_internal/helpers/generate-types.ts
|
|
@@ -663,6 +663,24 @@ FileSystem._Ids = $.CompositeList(FileId);
|
|
|
663
663
|
FileSystem._Storage = $.CompositeList(FileStorage);
|
|
664
664
|
FileSystem._Metadata = $.CompositeList(FileMetadata);
|
|
665
665
|
|
|
666
|
+
//#endregion
|
|
667
|
+
//#region src/_internal/helpers/constants.ts
|
|
668
|
+
const DEFAULT_EXTENSIONS = [
|
|
669
|
+
"js",
|
|
670
|
+
"ts",
|
|
671
|
+
"cjs",
|
|
672
|
+
"cts",
|
|
673
|
+
"mjs",
|
|
674
|
+
"mts",
|
|
675
|
+
"tsx",
|
|
676
|
+
"jsx",
|
|
677
|
+
"json",
|
|
678
|
+
"json5",
|
|
679
|
+
"jsonc",
|
|
680
|
+
"md",
|
|
681
|
+
"mdx"
|
|
682
|
+
];
|
|
683
|
+
|
|
666
684
|
//#endregion
|
|
667
685
|
//#region src/_internal/vfs.ts
|
|
668
686
|
function toFilePath(path) {
|
|
@@ -819,6 +837,113 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
819
837
|
}));
|
|
820
838
|
}
|
|
821
839
|
/**
|
|
840
|
+
* A helper function to resolve modules in the virtual file system (VFS).
|
|
841
|
+
*
|
|
842
|
+
* @remarks
|
|
843
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
844
|
+
*
|
|
845
|
+
* @example
|
|
846
|
+
* ```ts
|
|
847
|
+
* const resolved = await context.resolvePath("some-module", "/path/to/importer");
|
|
848
|
+
* ```
|
|
849
|
+
*
|
|
850
|
+
* @param id - The module to resolve.
|
|
851
|
+
* @param importer - An optional path to the importer module.
|
|
852
|
+
* @param options - Additional resolution options.
|
|
853
|
+
* @returns A promise that resolves to the resolved module path.
|
|
854
|
+
*/
|
|
855
|
+
#innerResolve = async (id, importer, options = {}) => {
|
|
856
|
+
let path = id;
|
|
857
|
+
if (path.includes("{") || path.includes("}")) path = replacePathTokens(this.#context, path);
|
|
858
|
+
if (options.skipAlias !== true) path = this.resolveAlias(path);
|
|
859
|
+
if (isAbsolutePath(path)) return path;
|
|
860
|
+
const resolverCacheKey = murmurhash({
|
|
861
|
+
path: this.#normalizeId(path),
|
|
862
|
+
importer,
|
|
863
|
+
options
|
|
864
|
+
});
|
|
865
|
+
let result;
|
|
866
|
+
if (!this.#context.config.skipCache) {
|
|
867
|
+
result = this.resolverCache.get(resolverCacheKey);
|
|
868
|
+
if (result) return result;
|
|
869
|
+
}
|
|
870
|
+
result = this.paths[this.#normalizeId(path)];
|
|
871
|
+
if (!result) {
|
|
872
|
+
const paths = options.paths ?? [];
|
|
873
|
+
if (importer && !paths.includes(importer)) paths.push(importer);
|
|
874
|
+
paths.push(this.#context.workspaceConfig.workspaceRoot);
|
|
875
|
+
paths.push(appendPath(this.#context.config.root, this.#context.workspaceConfig.workspaceRoot));
|
|
876
|
+
paths.push(appendPath(joinPaths$1(this.#context.config.root, "src"), this.#context.workspaceConfig.workspaceRoot));
|
|
877
|
+
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
|
|
878
|
+
for (const combination of getResolutionCombinations(path, { paths })) {
|
|
879
|
+
const { relativeKey, adapter } = this.#getStorage(combination);
|
|
880
|
+
if (await adapter.exists(relativeKey)) {
|
|
881
|
+
result = combination;
|
|
882
|
+
break;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
if (!result) try {
|
|
886
|
+
result = await resolve(path, {
|
|
887
|
+
...options,
|
|
888
|
+
paths
|
|
889
|
+
});
|
|
890
|
+
} catch {}
|
|
891
|
+
}
|
|
892
|
+
if (result && !this.#context.config.skipCache) this.resolverCache.set(resolverCacheKey, result);
|
|
893
|
+
return result;
|
|
894
|
+
};
|
|
895
|
+
/**
|
|
896
|
+
* A synchronous helper function to resolve modules using the Jiti resolver
|
|
897
|
+
*
|
|
898
|
+
* @remarks
|
|
899
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
900
|
+
*
|
|
901
|
+
* @example
|
|
902
|
+
* ```ts
|
|
903
|
+
* const resolvedPath = context.resolveSync("some-module", "/path/to/importer");
|
|
904
|
+
* ```
|
|
905
|
+
*
|
|
906
|
+
* @param id - The module to resolve.
|
|
907
|
+
* @param importer - An optional path to the importer module.
|
|
908
|
+
* @param options - Additional resolution options.
|
|
909
|
+
* @returns The resolved module path.
|
|
910
|
+
*/
|
|
911
|
+
#innerResolveSync = (id, importer, options = {}) => {
|
|
912
|
+
let path = id;
|
|
913
|
+
if (path.includes("{") || path.includes("}")) path = replacePathTokens(this.#context, path);
|
|
914
|
+
if (options.skipAlias !== true) path = this.resolveAlias(path);
|
|
915
|
+
if (isAbsolutePath(path)) return path;
|
|
916
|
+
let result;
|
|
917
|
+
if (!this.#context.config.skipCache) {
|
|
918
|
+
result = this.resolverCache.get(this.#normalizeId(path));
|
|
919
|
+
if (result) return result;
|
|
920
|
+
}
|
|
921
|
+
result = this.paths[this.#normalizeId(path)];
|
|
922
|
+
if (!result) {
|
|
923
|
+
const paths = options.paths ?? [];
|
|
924
|
+
if (importer && !paths.includes(importer)) paths.push(importer);
|
|
925
|
+
paths.push(this.#context.workspaceConfig.workspaceRoot);
|
|
926
|
+
paths.push(appendPath(this.#context.config.root, this.#context.workspaceConfig.workspaceRoot));
|
|
927
|
+
paths.push(appendPath(joinPaths$1(this.#context.config.root, "src"), this.#context.workspaceConfig.workspaceRoot));
|
|
928
|
+
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
|
|
929
|
+
for (const combination of getResolutionCombinations(path, { paths })) {
|
|
930
|
+
const { relativeKey, adapter } = this.#getStorage(combination);
|
|
931
|
+
if (adapter.existsSync(relativeKey)) {
|
|
932
|
+
result = combination;
|
|
933
|
+
break;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
if (!result) try {
|
|
937
|
+
result = resolveSync(path, {
|
|
938
|
+
...options,
|
|
939
|
+
paths
|
|
940
|
+
});
|
|
941
|
+
} catch {}
|
|
942
|
+
}
|
|
943
|
+
if (result && !this.#context.config.skipCache) this.resolverCache.set(this.#normalizeId(path), result);
|
|
944
|
+
return result;
|
|
945
|
+
};
|
|
946
|
+
/**
|
|
822
947
|
* Creates a virtual file system (VFS) that is backed up to a Cap'n Proto message buffer.
|
|
823
948
|
*
|
|
824
949
|
* @param context - The context of the virtual file system, typically containing options and logging functions.
|
|
@@ -1290,7 +1415,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1290
1415
|
* @returns A promise that resolves to the contents of the file as a string, or undefined if the file does not exist.
|
|
1291
1416
|
*/
|
|
1292
1417
|
async read(path) {
|
|
1293
|
-
const filePath = await this.resolve(path);
|
|
1418
|
+
const filePath = await this.resolve(path, void 0, { isFile: true });
|
|
1294
1419
|
if (!filePath || !this.existsSync(filePath)) return;
|
|
1295
1420
|
const { adapter } = this.#getStorage(filePath);
|
|
1296
1421
|
this.#log(LogLevelLabel.TRACE, `Reading ${adapter.name} file: ${filePath}`);
|
|
@@ -1303,7 +1428,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1303
1428
|
* @returns The contents of the file as a string, or undefined if the file does not exist.
|
|
1304
1429
|
*/
|
|
1305
1430
|
readSync(path) {
|
|
1306
|
-
const filePath = this.resolveSync(path);
|
|
1431
|
+
const filePath = this.resolveSync(path, void 0, { isFile: true });
|
|
1307
1432
|
if (!filePath || !this.existsSync(filePath)) return;
|
|
1308
1433
|
const { adapter } = this.#getStorage(filePath);
|
|
1309
1434
|
this.#log(LogLevelLabel.TRACE, `Reading ${adapter.name} file: ${filePath}`);
|
|
@@ -1326,21 +1451,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1326
1451
|
try {
|
|
1327
1452
|
if (!options.skipFormat) code = await format(this.#context, resolvedPath, data);
|
|
1328
1453
|
} catch (err) {
|
|
1329
|
-
if (
|
|
1330
|
-
"js",
|
|
1331
|
-
"ts",
|
|
1332
|
-
"cjs",
|
|
1333
|
-
"cts",
|
|
1334
|
-
"mjs",
|
|
1335
|
-
"mts",
|
|
1336
|
-
"tsx",
|
|
1337
|
-
"jsx",
|
|
1338
|
-
"json",
|
|
1339
|
-
"json5",
|
|
1340
|
-
"jsonc",
|
|
1341
|
-
"md",
|
|
1342
|
-
"mdx"
|
|
1343
|
-
].includes(findFileExtensionSafe(resolvedPath, { fullExtension: true }))) this.#log(LogLevelLabel.WARN, `Failed to format file ${resolvedPath} before writing: ${err.message}`);
|
|
1454
|
+
if (DEFAULT_EXTENSIONS.includes(findFileExtensionSafe(resolvedPath, { fullExtension: true }))) this.#log(LogLevelLabel.WARN, `Failed to format file ${resolvedPath} before writing: ${err.message}`);
|
|
1344
1455
|
code = data;
|
|
1345
1456
|
}
|
|
1346
1457
|
this.#log(LogLevelLabel.TRACE, `Writing ${resolvedPath} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob$1(toArray(code)).size)})`);
|
|
@@ -1454,44 +1565,17 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1454
1565
|
* @returns A promise that resolves to the resolved module path.
|
|
1455
1566
|
*/
|
|
1456
1567
|
async resolve(id, importer, options = {}) {
|
|
1457
|
-
|
|
1458
|
-
if (
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
options
|
|
1465
|
-
});
|
|
1466
|
-
let result;
|
|
1467
|
-
if (!this.#context.config.skipCache) {
|
|
1468
|
-
result = this.resolverCache.get(resolverCacheKey);
|
|
1469
|
-
if (result) return result;
|
|
1470
|
-
}
|
|
1471
|
-
result = this.paths[this.#normalizeId(path)];
|
|
1472
|
-
if (!result) {
|
|
1473
|
-
const paths = options.paths ?? [];
|
|
1474
|
-
if (importer && !paths.includes(importer)) paths.push(importer);
|
|
1475
|
-
paths.push(this.#context.workspaceConfig.workspaceRoot);
|
|
1476
|
-
paths.push(appendPath(this.#context.config.root, this.#context.workspaceConfig.workspaceRoot));
|
|
1477
|
-
paths.push(appendPath(joinPaths$1(this.#context.config.root, "src"), this.#context.workspaceConfig.workspaceRoot));
|
|
1478
|
-
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
|
|
1479
|
-
for (const combination of getResolutionCombinations(path, { paths })) {
|
|
1480
|
-
const { relativeKey, adapter } = this.#getStorage(combination);
|
|
1481
|
-
if (await adapter.exists(relativeKey)) {
|
|
1482
|
-
result = combination;
|
|
1483
|
-
break;
|
|
1484
|
-
}
|
|
1568
|
+
const origResult = await this.#innerResolve(id, importer, options);
|
|
1569
|
+
if (origResult && options.isFile && await this.isDirectory(origResult)) {
|
|
1570
|
+
const indexResult = await this.resolve(joinPaths$1(origResult, "index"), importer, options);
|
|
1571
|
+
if (indexResult) return indexResult;
|
|
1572
|
+
if (!hasFileExtension(origResult)) for (const ext of DEFAULT_EXTENSIONS) {
|
|
1573
|
+
const extResult = await this.resolve(`${origResult}.${ext}`, importer, options);
|
|
1574
|
+
if (extResult) return extResult;
|
|
1485
1575
|
}
|
|
1486
|
-
|
|
1487
|
-
result = await resolve(path, {
|
|
1488
|
-
...options,
|
|
1489
|
-
paths
|
|
1490
|
-
});
|
|
1491
|
-
} catch {}
|
|
1576
|
+
return;
|
|
1492
1577
|
}
|
|
1493
|
-
|
|
1494
|
-
return result;
|
|
1578
|
+
return origResult;
|
|
1495
1579
|
}
|
|
1496
1580
|
/**
|
|
1497
1581
|
* A synchronous helper function to resolve modules using the Jiti resolver
|
|
@@ -1510,39 +1594,17 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1510
1594
|
* @returns The resolved module path.
|
|
1511
1595
|
*/
|
|
1512
1596
|
resolveSync(id, importer, options = {}) {
|
|
1513
|
-
|
|
1514
|
-
if (
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
if (result) return result;
|
|
1521
|
-
}
|
|
1522
|
-
result = this.paths[this.#normalizeId(path)];
|
|
1523
|
-
if (!result) {
|
|
1524
|
-
const paths = options.paths ?? [];
|
|
1525
|
-
if (importer && !paths.includes(importer)) paths.push(importer);
|
|
1526
|
-
paths.push(this.#context.workspaceConfig.workspaceRoot);
|
|
1527
|
-
paths.push(appendPath(this.#context.config.root, this.#context.workspaceConfig.workspaceRoot));
|
|
1528
|
-
paths.push(appendPath(joinPaths$1(this.#context.config.root, "src"), this.#context.workspaceConfig.workspaceRoot));
|
|
1529
|
-
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
|
|
1530
|
-
for (const combination of getResolutionCombinations(path, { paths })) {
|
|
1531
|
-
const { relativeKey, adapter } = this.#getStorage(combination);
|
|
1532
|
-
if (adapter.existsSync(relativeKey)) {
|
|
1533
|
-
result = combination;
|
|
1534
|
-
break;
|
|
1535
|
-
}
|
|
1597
|
+
const origResult = this.#innerResolveSync(id, importer, options);
|
|
1598
|
+
if (origResult && options.isFile && this.isDirectorySync(origResult)) {
|
|
1599
|
+
const indexResult = this.resolveSync(joinPaths$1(origResult, "index"), importer, options);
|
|
1600
|
+
if (indexResult) return indexResult;
|
|
1601
|
+
if (!hasFileExtension(origResult)) for (const ext of DEFAULT_EXTENSIONS) {
|
|
1602
|
+
const extResult = this.resolveSync(`${origResult}.${ext}`, importer, options);
|
|
1603
|
+
if (extResult) return extResult;
|
|
1536
1604
|
}
|
|
1537
|
-
|
|
1538
|
-
result = resolveSync(path, {
|
|
1539
|
-
...options,
|
|
1540
|
-
paths
|
|
1541
|
-
});
|
|
1542
|
-
} catch {}
|
|
1605
|
+
return;
|
|
1543
1606
|
}
|
|
1544
|
-
|
|
1545
|
-
return result;
|
|
1607
|
+
return origResult;
|
|
1546
1608
|
}
|
|
1547
1609
|
/**
|
|
1548
1610
|
* Disposes of the virtual file system (VFS) by saving its state to disk.
|
|
@@ -2593,7 +2655,10 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
2593
2655
|
...result,
|
|
2594
2656
|
id: `${prefix}${result.id}`
|
|
2595
2657
|
};
|
|
2596
|
-
result = await ctx.resolve(id, importer,
|
|
2658
|
+
result = await ctx.resolve(id, importer, {
|
|
2659
|
+
isFile: true,
|
|
2660
|
+
...opts
|
|
2661
|
+
});
|
|
2597
2662
|
if (isSetString(result)) return `${prefix}${result}`;
|
|
2598
2663
|
else if (isSetObject(result)) return {
|
|
2599
2664
|
...result,
|
|
@@ -3785,4 +3850,4 @@ Note: Please ensure the plugin package's default export is a class that extends
|
|
|
3785
3850
|
|
|
3786
3851
|
//#endregion
|
|
3787
3852
|
export { _capnpFileId as _, createUnpluginFactory as a, createUnpluginModuleResolutionFunctions as c, PowerlinesContext as d, FileId as f, FileSystem as g, FileStorage as h, createPluginContext as i, combineContexts as l, FileMetadata_KeyValuePair as m, PowerlinesAPIContext as n, createUnplugin as o, FileMetadata as p, PowerlinesEnvironmentContext as r, createUnpluginResolver as s, PowerlinesAPI as t, isUnpluginBuilderVariant as u, name as v, version as y };
|
|
3788
|
-
//# sourceMappingURL=api-
|
|
3853
|
+
//# sourceMappingURL=api-BK_ItDEV.mjs.map
|