@powerlines/plugin-env 0.15.121 → 0.15.123
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/_virtual/rolldown_runtime.cjs +0 -4
- package/dist/babel/plugin.d.cts +2 -2
- package/dist/babel/plugin.d.mts +2 -3
- package/dist/components/docs.cjs +2 -2
- package/dist/components/docs.d.cts +1 -1
- package/dist/components/docs.d.mts +1 -1
- package/dist/components/docs.mjs +1 -1
- package/dist/components/env.cjs +3 -2
- package/dist/components/env.d.cts +2 -2
- package/dist/components/env.d.mts +2 -2
- package/dist/components/env.mjs +1 -1
- package/dist/helpers/automd-generator.cjs +2 -2
- package/dist/helpers/automd-generator.d.cts +1 -1
- package/dist/helpers/automd-generator.d.mts +1 -1
- package/dist/helpers/automd-generator.mjs +1 -1
- package/dist/helpers/docs-helper.cjs +3 -2
- package/dist/helpers/docs-helper.mjs +1 -1
- package/dist/helpers/load.cjs +10 -9
- package/dist/helpers/load.mjs +3 -3
- package/dist/helpers/persistence.cjs +3 -3
- package/dist/helpers/persistence.d.cts +1 -1
- package/dist/helpers/persistence.d.mts +1 -1
- package/dist/helpers/persistence.mjs +1 -1
- package/dist/helpers/reflect.cjs +4 -4
- package/dist/helpers/reflect.mjs +2 -2
- package/dist/index.cjs +18 -17
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +5 -5
- package/dist/types/plugin.d.cts +5 -6
- package/dist/types/plugin.d.mts +4 -6
- package/package.json +7 -7
- package/dist/_virtual/rolldown_runtime.mjs +0 -33
- package/dist/deepkit/schemas/reflection.d.cts +0 -1560
- package/dist/deepkit/src/types.d.cts +0 -10
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/parse-type-definition.cjs +0 -37
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/parse-type-definition.mjs +0 -37
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/to-array.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/to-array.mjs +0 -14
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs +0 -14
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/index.cjs +0 -3
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/index.mjs +0 -5
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.cjs +0 -6
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs +0 -6
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-collection.cjs +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-collection.mjs +0 -3
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-object.cjs +0 -19
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs +0 -19
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.cjs +0 -63
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs +0 -63
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-string.cjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs +0 -11
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/type-detect.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.35/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs +0 -16
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/is-parent-path.cjs +0 -32
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/is-parent-path.mjs +0 -32
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/is-type.cjs +0 -28
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/is-type.mjs +0 -28
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/join-paths.cjs +0 -106
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/join-paths.mjs +0 -106
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/regex.cjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/regex.mjs +0 -8
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/slash.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/slash.mjs +0 -14
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.cjs +0 -346
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs +0 -346
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.cjs +0 -786
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.mjs +0 -786
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.cjs +0 -3
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.mjs +0 -3
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs +0 -23
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs +0 -22
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs +0 -405
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs +0 -404
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.cjs +0 -657
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.mjs +0 -657
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.cjs +0 -1054
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.mjs +0 -1054
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +0 -43
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +0 -42
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +0 -46
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +0 -45
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.cjs +0 -288
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.mjs +0 -285
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.cjs +0 -71
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.mjs +0 -68
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +0 -1013
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +0 -1007
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +0 -23
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +0 -13
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +0 -2698
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -2685
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs +0 -4457
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs +0 -4454
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +0 -29
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +0 -29
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -181
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -176
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +0 -22
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +0 -17
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +0 -3967
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +0 -3962
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +0 -11768
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +0 -11763
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -25
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +0 -20
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +0 -20
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +0 -17
- package/dist/node_modules/.pnpm/nypm@0.6.4/node_modules/nypm/dist/index.cjs +0 -194
- package/dist/node_modules/.pnpm/nypm@0.6.4/node_modules/nypm/dist/index.mjs +0 -191
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs +0 -13
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs +0 -12
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.cjs +0 -3
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs +0 -3
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +0 -145
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -138
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +0 -127
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +0 -125
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +0 -138
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +0 -136
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +0 -629
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +0 -627
- package/dist/packages/deepkit/schemas/reflection.d.mts +0 -1560
- package/dist/packages/deepkit/src/types.d.mts +0 -10
- package/dist/packages/plugin-alloy/src/core/components/source-file.d.mts +0 -23
- package/dist/packages/plugin-alloy/src/markdown/components/markdown-file.d.mts +0 -8
- package/dist/packages/plugin-alloy/src/types/components.d.mts +0 -21
- package/dist/packages/plugin-alloy/src/types/index.d.mts +0 -2
- package/dist/packages/plugin-alloy/src/types/plugin.d.mts +0 -36
- package/dist/packages/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
- package/dist/packages/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -37
- package/dist/packages/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -16
- package/dist/packages/plugin-alloy/src/typescript/components/typescript-interface.d.mts +0 -12
- package/dist/packages/plugin-automd/src/types/plugin.d.mts +0 -40
- package/dist/packages/plugin-automd/src/types/toc.d.mts +0 -33
- package/dist/packages/plugin-babel/src/types/index.d.mts +0 -1
- package/dist/packages/plugin-babel/src/types/plugin.d.mts +0 -15
- package/dist/packages/powerlines/src/internal/helpers/hooks.d.mts +0 -49
- package/dist/packages/powerlines/src/types/api.d.mts +0 -104
- package/dist/packages/powerlines/src/types/babel.d.mts +0 -23
- package/dist/packages/powerlines/src/types/build.d.mts +0 -185
- package/dist/packages/powerlines/src/types/commands.d.mts +0 -9
- package/dist/packages/powerlines/src/types/config.d.mts +0 -435
- package/dist/packages/powerlines/src/types/context.d.mts +0 -514
- package/dist/packages/powerlines/src/types/fs.d.mts +0 -486
- package/dist/packages/powerlines/src/types/hooks.d.mts +0 -32
- package/dist/packages/powerlines/src/types/index.d.mts +0 -12
- package/dist/packages/powerlines/src/types/plugin.d.mts +0 -205
- package/dist/packages/powerlines/src/types/resolved.d.mts +0 -94
- package/dist/packages/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/packages/powerlines/src/types/unplugin.d.mts +0 -23
- package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
- package/dist/plugin-alloy/src/markdown/components/markdown-file.d.cts +0 -8
- package/dist/plugin-alloy/src/types/components.d.cts +0 -20
- package/dist/plugin-alloy/src/types/index.d.cts +0 -2
- package/dist/plugin-alloy/src/types/plugin.d.cts +0 -36
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -26
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -37
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -16
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +0 -12
- package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
- package/dist/plugin-automd/src/types/toc.d.cts +0 -33
- package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
- package/dist/powerlines/src/types/api.d.cts +0 -104
- package/dist/powerlines/src/types/babel.d.cts +0 -23
- package/dist/powerlines/src/types/build.d.cts +0 -185
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/config.d.cts +0 -435
- package/dist/powerlines/src/types/context.d.cts +0 -514
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/hooks.d.cts +0 -32
- package/dist/powerlines/src/types/plugin.d.cts +0 -205
- package/dist/powerlines/src/types/resolved.d.cts +0 -94
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/unplugin.d.cts +0 -22
package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/join-paths.mjs
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX } from "./regex.mjs";
|
|
2
|
-
import { isAbsolute } from "./is-type.mjs";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/@stryke+path@0.26.0/node_modules/@stryke/path/dist/join-paths.mjs
|
|
5
|
-
function normalizeWindowsPath(input = "") {
|
|
6
|
-
if (!input) return input;
|
|
7
|
-
return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
|
|
8
|
-
}
|
|
9
|
-
function correctPaths(path) {
|
|
10
|
-
if (!path || path.length === 0) return ".";
|
|
11
|
-
path = normalizeWindowsPath(path);
|
|
12
|
-
const isUNCPath = path.match(UNC_REGEX);
|
|
13
|
-
const isPathAbsolute = isAbsolute(path);
|
|
14
|
-
const trailingSeparator = path[path.length - 1] === "/";
|
|
15
|
-
path = normalizeString(path, !isPathAbsolute);
|
|
16
|
-
if (path.length === 0) {
|
|
17
|
-
if (isPathAbsolute) return "/";
|
|
18
|
-
return trailingSeparator ? "./" : ".";
|
|
19
|
-
}
|
|
20
|
-
if (trailingSeparator) path += "/";
|
|
21
|
-
if (DRIVE_LETTER_REGEX.test(path)) path += "/";
|
|
22
|
-
if (isUNCPath) {
|
|
23
|
-
if (!isPathAbsolute) return `//./${path}`;
|
|
24
|
-
return `//${path}`;
|
|
25
|
-
}
|
|
26
|
-
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Joins all given path segments together using the platform-specific separator as a delimiter.
|
|
30
|
-
* The resulting path is normalized to remove any redundant or unnecessary segments.
|
|
31
|
-
*
|
|
32
|
-
* @param segments - The path segments to join.
|
|
33
|
-
* @returns The joined and normalized path string.
|
|
34
|
-
*/
|
|
35
|
-
function joinPaths(...segments) {
|
|
36
|
-
let path = "";
|
|
37
|
-
for (const seg of segments) {
|
|
38
|
-
if (!seg) continue;
|
|
39
|
-
if (path.length > 0) {
|
|
40
|
-
const pathTrailing = path[path.length - 1] === "/";
|
|
41
|
-
const segLeading = seg[0] === "/";
|
|
42
|
-
if (pathTrailing && segLeading) path += seg.slice(1);
|
|
43
|
-
else path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
44
|
-
} else path += seg;
|
|
45
|
-
}
|
|
46
|
-
return correctPaths(path);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
|
50
|
-
*
|
|
51
|
-
* @param path - The path to normalize.
|
|
52
|
-
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
|
53
|
-
* @returns the normalized path string.
|
|
54
|
-
*/
|
|
55
|
-
function normalizeString(path, allowAboveRoot) {
|
|
56
|
-
let res = "";
|
|
57
|
-
let lastSegmentLength = 0;
|
|
58
|
-
let lastSlash = -1;
|
|
59
|
-
let dots = 0;
|
|
60
|
-
let char = null;
|
|
61
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
62
|
-
if (index < path.length) char = path[index];
|
|
63
|
-
else if (char === "/") break;
|
|
64
|
-
else char = "/";
|
|
65
|
-
if (char === "/") {
|
|
66
|
-
if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
|
|
67
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
68
|
-
if (res.length > 2) {
|
|
69
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
70
|
-
if (lastSlashIndex === -1) {
|
|
71
|
-
res = "";
|
|
72
|
-
lastSegmentLength = 0;
|
|
73
|
-
} else {
|
|
74
|
-
res = res.slice(0, lastSlashIndex);
|
|
75
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
76
|
-
}
|
|
77
|
-
lastSlash = index;
|
|
78
|
-
dots = 0;
|
|
79
|
-
continue;
|
|
80
|
-
} else if (res.length > 0) {
|
|
81
|
-
res = "";
|
|
82
|
-
lastSegmentLength = 0;
|
|
83
|
-
lastSlash = index;
|
|
84
|
-
dots = 0;
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (allowAboveRoot) {
|
|
89
|
-
res += res.length > 0 ? "/.." : "..";
|
|
90
|
-
lastSegmentLength = 2;
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
94
|
-
else res = path.slice(lastSlash + 1, index);
|
|
95
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
96
|
-
}
|
|
97
|
-
lastSlash = index;
|
|
98
|
-
dots = 0;
|
|
99
|
-
} else if (char === "." && dots !== -1) ++dots;
|
|
100
|
-
else dots = -1;
|
|
101
|
-
}
|
|
102
|
-
return res;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
//#endregion
|
|
106
|
-
export { joinPaths };
|
package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/regex.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../../node_modules/.pnpm/@stryke+path@0.26.0/node_modules/@stryke/path/dist/regex.mjs
|
|
3
|
-
const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
|
|
4
|
-
const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
|
|
5
|
-
const UNC_REGEX = /^[/\\]{2}/;
|
|
6
|
-
const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.ABSOLUTE_PATH_REGEX = ABSOLUTE_PATH_REGEX;
|
|
10
|
-
exports.DRIVE_LETTER_REGEX = DRIVE_LETTER_REGEX;
|
|
11
|
-
exports.DRIVE_LETTER_START_REGEX = DRIVE_LETTER_START_REGEX;
|
|
12
|
-
exports.UNC_REGEX = UNC_REGEX;
|
package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/regex.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@stryke+path@0.26.0/node_modules/@stryke/path/dist/regex.mjs
|
|
2
|
-
const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
|
|
3
|
-
const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
|
|
4
|
-
const UNC_REGEX = /^[/\\]{2}/;
|
|
5
|
-
const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX };
|
package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/slash.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../../node_modules/.pnpm/@stryke+path@0.26.0/node_modules/@stryke/path/dist/slash.mjs
|
|
3
|
-
/**
|
|
4
|
-
* Replace backslash to slash
|
|
5
|
-
*
|
|
6
|
-
* @param path - The string to replace
|
|
7
|
-
* @returns The string with replaced backslashes
|
|
8
|
-
*/
|
|
9
|
-
function slash(path) {
|
|
10
|
-
if (path.startsWith("\\\\?\\")) return path;
|
|
11
|
-
return path.replace(/\\/g, "/");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
exports.slash = slash;
|
package/dist/node_modules/.pnpm/@stryke_path@0.26.0/node_modules/@stryke/path/dist/slash.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@stryke+path@0.26.0/node_modules/@stryke/path/dist/slash.mjs
|
|
2
|
-
/**
|
|
3
|
-
* Replace backslash to slash
|
|
4
|
-
*
|
|
5
|
-
* @param path - The string to replace
|
|
6
|
-
* @returns The string with replaced backslashes
|
|
7
|
-
*/
|
|
8
|
-
function slash(path) {
|
|
9
|
-
if (path.startsWith("\\\\?\\")) return path;
|
|
10
|
-
return path.replace(/\\/g, "/");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { slash };
|
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_pathe_M_eThtNZ = require('../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs');
|
|
3
|
-
const require_main$1 = require('../../../../dotenv@17.2.3/node_modules/dotenv/lib/main.cjs');
|
|
4
|
-
const require_index = require('../../../../exsolve@1.0.8/node_modules/exsolve/dist/index.cjs');
|
|
5
|
-
const require_jiti = require('../../../../jiti@2.6.1/node_modules/jiti/lib/jiti.cjs');
|
|
6
|
-
const require_defu = require('../../../../defu@6.1.4/node_modules/defu/dist/defu.cjs');
|
|
7
|
-
const require_index$1 = require('../../../../rc9@2.1.2/node_modules/rc9/dist/index.cjs');
|
|
8
|
-
const require_index$2 = require('../../../../pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs');
|
|
9
|
-
let node_fs = require("node:fs");
|
|
10
|
-
let node_os = require("node:os");
|
|
11
|
-
let node_fs_promises = require("node:fs/promises");
|
|
12
|
-
let node_url = require("node:url");
|
|
13
|
-
|
|
14
|
-
//#region ../../node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs
|
|
15
|
-
var import_main = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_main$1.default, 1);
|
|
16
|
-
/**
|
|
17
|
-
* Load and interpolate environment variables into `process.env`.
|
|
18
|
-
* If you need more control (or access to the values), consider using `loadDotenv` instead
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
async function setupDotenv(options) {
|
|
22
|
-
const targetEnvironment = options.env ?? process.env;
|
|
23
|
-
const environment = await loadDotenv({
|
|
24
|
-
cwd: options.cwd,
|
|
25
|
-
fileName: options.fileName ?? ".env",
|
|
26
|
-
env: targetEnvironment,
|
|
27
|
-
interpolate: options.interpolate ?? true
|
|
28
|
-
});
|
|
29
|
-
const dotenvVars = getDotEnvVars(targetEnvironment);
|
|
30
|
-
for (const key in environment) {
|
|
31
|
-
if (key.startsWith("_")) continue;
|
|
32
|
-
if (targetEnvironment[key] === void 0 || dotenvVars.has(key)) targetEnvironment[key] = environment[key];
|
|
33
|
-
}
|
|
34
|
-
return environment;
|
|
35
|
-
}
|
|
36
|
-
/** Load environment variables into an object. */
|
|
37
|
-
async function loadDotenv(options) {
|
|
38
|
-
const environment = Object.create(null);
|
|
39
|
-
const cwd = require_pathe_M_eThtNZ.resolve(options.cwd || ".");
|
|
40
|
-
const _fileName = options.fileName || ".env";
|
|
41
|
-
const dotenvFiles = typeof _fileName === "string" ? [_fileName] : _fileName;
|
|
42
|
-
const dotenvVars = getDotEnvVars(options.env || {});
|
|
43
|
-
Object.assign(environment, options.env);
|
|
44
|
-
for (const file of dotenvFiles) {
|
|
45
|
-
const dotenvFile = require_pathe_M_eThtNZ.resolve(cwd, file);
|
|
46
|
-
if (!(0, node_fs.statSync)(dotenvFile, { throwIfNoEntry: false })?.isFile()) continue;
|
|
47
|
-
const parsed = import_main.parse(await node_fs.promises.readFile(dotenvFile, "utf8"));
|
|
48
|
-
for (const key in parsed) {
|
|
49
|
-
if (key in environment && !dotenvVars.has(key)) continue;
|
|
50
|
-
environment[key] = parsed[key];
|
|
51
|
-
dotenvVars.add(key);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (options.interpolate) interpolate(environment);
|
|
55
|
-
return environment;
|
|
56
|
-
}
|
|
57
|
-
function interpolate(target, source = {}, parse = (v) => v) {
|
|
58
|
-
function getValue(key) {
|
|
59
|
-
return source[key] === void 0 ? target[key] : source[key];
|
|
60
|
-
}
|
|
61
|
-
function interpolate$1(value, parents = []) {
|
|
62
|
-
if (typeof value !== "string") return value;
|
|
63
|
-
return parse((value.match(/(.?\${?(?:[\w:]+)?}?)/g) || []).reduce((newValue, match) => {
|
|
64
|
-
const parts = /(.?)\${?([\w:]+)?}?/g.exec(match) || [];
|
|
65
|
-
const prefix = parts[1];
|
|
66
|
-
let value$1, replacePart;
|
|
67
|
-
if (prefix === "\\") {
|
|
68
|
-
replacePart = parts[0] || "";
|
|
69
|
-
value$1 = replacePart.replace(String.raw`\$`, "$");
|
|
70
|
-
} else {
|
|
71
|
-
const key = parts[2];
|
|
72
|
-
replacePart = (parts[0] || "").slice(prefix.length);
|
|
73
|
-
if (parents.includes(key)) {
|
|
74
|
-
console.warn(`Please avoid recursive environment variables ( loop: ${parents.join(" > ")} > ${key} )`);
|
|
75
|
-
return "";
|
|
76
|
-
}
|
|
77
|
-
value$1 = getValue(key);
|
|
78
|
-
value$1 = interpolate$1(value$1, [...parents, key]);
|
|
79
|
-
}
|
|
80
|
-
return value$1 === void 0 ? newValue : newValue.replace(replacePart, value$1);
|
|
81
|
-
}, value));
|
|
82
|
-
}
|
|
83
|
-
for (const key in target) target[key] = interpolate$1(getValue(key));
|
|
84
|
-
}
|
|
85
|
-
function getDotEnvVars(targetEnvironment) {
|
|
86
|
-
const globalRegistry = globalThis.__c12_dotenv_vars__ ||= /* @__PURE__ */ new Map();
|
|
87
|
-
if (!globalRegistry.has(targetEnvironment)) globalRegistry.set(targetEnvironment, /* @__PURE__ */ new Set());
|
|
88
|
-
return globalRegistry.get(targetEnvironment);
|
|
89
|
-
}
|
|
90
|
-
const _normalize = (p) => p?.replace(/\\/g, "/");
|
|
91
|
-
const ASYNC_LOADERS = {
|
|
92
|
-
".yaml": () => Promise.resolve().then(() => require("../../../../confbox@0.2.2/node_modules/confbox/dist/yaml.cjs")).then((r) => r.parseYAML),
|
|
93
|
-
".yml": () => Promise.resolve().then(() => require("../../../../confbox@0.2.2/node_modules/confbox/dist/yaml.cjs")).then((r) => r.parseYAML),
|
|
94
|
-
".jsonc": () => Promise.resolve().then(() => require("../../../../confbox@0.2.2/node_modules/confbox/dist/jsonc.cjs")).then((r) => r.parseJSONC),
|
|
95
|
-
".json5": () => Promise.resolve().then(() => require("../../../../confbox@0.2.2/node_modules/confbox/dist/json5.cjs")).then((r) => r.parseJSON5),
|
|
96
|
-
".toml": () => Promise.resolve().then(() => require("../../../../confbox@0.2.2/node_modules/confbox/dist/toml.cjs")).then((r) => r.parseTOML)
|
|
97
|
-
};
|
|
98
|
-
const SUPPORTED_EXTENSIONS = Object.freeze([
|
|
99
|
-
".js",
|
|
100
|
-
".ts",
|
|
101
|
-
".mjs",
|
|
102
|
-
".cjs",
|
|
103
|
-
".mts",
|
|
104
|
-
".cts",
|
|
105
|
-
".json",
|
|
106
|
-
".jsonc",
|
|
107
|
-
".json5",
|
|
108
|
-
".yaml",
|
|
109
|
-
".yml",
|
|
110
|
-
".toml"
|
|
111
|
-
]);
|
|
112
|
-
async function loadConfig(options) {
|
|
113
|
-
options.cwd = require_pathe_M_eThtNZ.resolve(process.cwd(), options.cwd || ".");
|
|
114
|
-
options.name = options.name || "config";
|
|
115
|
-
options.envName = options.envName ?? process.env.NODE_ENV;
|
|
116
|
-
options.configFile = options.configFile ?? (options.name === "config" ? "config" : `${options.name}.config`);
|
|
117
|
-
options.rcFile = options.rcFile ?? `.${options.name}rc`;
|
|
118
|
-
if (options.extend !== false) options.extend = {
|
|
119
|
-
extendKey: "extends",
|
|
120
|
-
...options.extend
|
|
121
|
-
};
|
|
122
|
-
const _merger = options.merger || require_defu.defu;
|
|
123
|
-
options.jiti = options.jiti || require_jiti.createJiti(require_pathe_M_eThtNZ.join(options.cwd, options.configFile), {
|
|
124
|
-
interopDefault: true,
|
|
125
|
-
moduleCache: false,
|
|
126
|
-
extensions: [...SUPPORTED_EXTENSIONS],
|
|
127
|
-
...options.jitiOptions
|
|
128
|
-
});
|
|
129
|
-
const r = {
|
|
130
|
-
config: {},
|
|
131
|
-
cwd: options.cwd,
|
|
132
|
-
configFile: require_pathe_M_eThtNZ.resolve(options.cwd, options.configFile),
|
|
133
|
-
layers: [],
|
|
134
|
-
_configFile: void 0
|
|
135
|
-
};
|
|
136
|
-
const rawConfigs = {
|
|
137
|
-
overrides: options.overrides,
|
|
138
|
-
main: void 0,
|
|
139
|
-
rc: void 0,
|
|
140
|
-
packageJson: void 0,
|
|
141
|
-
defaultConfig: options.defaultConfig
|
|
142
|
-
};
|
|
143
|
-
if (options.dotenv) await setupDotenv({
|
|
144
|
-
cwd: options.cwd,
|
|
145
|
-
...options.dotenv === true ? {} : options.dotenv
|
|
146
|
-
});
|
|
147
|
-
const _mainConfig = await resolveConfig(".", options);
|
|
148
|
-
if (_mainConfig.configFile) {
|
|
149
|
-
rawConfigs.main = _mainConfig.config;
|
|
150
|
-
r.configFile = _mainConfig.configFile;
|
|
151
|
-
r._configFile = _mainConfig._configFile;
|
|
152
|
-
}
|
|
153
|
-
if (_mainConfig.meta) r.meta = _mainConfig.meta;
|
|
154
|
-
if (options.rcFile) {
|
|
155
|
-
const rcSources = [];
|
|
156
|
-
rcSources.push(require_index$1.read({
|
|
157
|
-
name: options.rcFile,
|
|
158
|
-
dir: options.cwd
|
|
159
|
-
}));
|
|
160
|
-
if (options.globalRc) {
|
|
161
|
-
const workspaceDir = await require_index$2.findWorkspaceDir(options.cwd).catch(() => {});
|
|
162
|
-
if (workspaceDir) rcSources.push(require_index$1.read({
|
|
163
|
-
name: options.rcFile,
|
|
164
|
-
dir: workspaceDir
|
|
165
|
-
}));
|
|
166
|
-
rcSources.push(require_index$1.readUser({
|
|
167
|
-
name: options.rcFile,
|
|
168
|
-
dir: options.cwd
|
|
169
|
-
}));
|
|
170
|
-
}
|
|
171
|
-
rawConfigs.rc = _merger({}, ...rcSources);
|
|
172
|
-
}
|
|
173
|
-
if (options.packageJson) {
|
|
174
|
-
const keys = (Array.isArray(options.packageJson) ? options.packageJson : [typeof options.packageJson === "string" ? options.packageJson : options.name]).filter((t) => t && typeof t === "string");
|
|
175
|
-
const pkgJsonFile = await require_index$2.readPackageJSON(options.cwd).catch(() => {});
|
|
176
|
-
rawConfigs.packageJson = _merger({}, ...keys.map((key) => pkgJsonFile?.[key]));
|
|
177
|
-
}
|
|
178
|
-
const configs = {};
|
|
179
|
-
for (const key in rawConfigs) {
|
|
180
|
-
const value = rawConfigs[key];
|
|
181
|
-
configs[key] = await (typeof value === "function" ? value({
|
|
182
|
-
configs,
|
|
183
|
-
rawConfigs
|
|
184
|
-
}) : value);
|
|
185
|
-
}
|
|
186
|
-
if (Array.isArray(configs.main)) r.config = configs.main;
|
|
187
|
-
else {
|
|
188
|
-
r.config = _merger(configs.overrides, configs.main, configs.rc, configs.packageJson, configs.defaultConfig);
|
|
189
|
-
if (options.extend) {
|
|
190
|
-
await extendConfig(r.config, options);
|
|
191
|
-
r.layers = r.config._layers;
|
|
192
|
-
delete r.config._layers;
|
|
193
|
-
r.config = _merger(r.config, ...r.layers.map((e) => e.config));
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
r.layers = [...[
|
|
197
|
-
configs.overrides && {
|
|
198
|
-
config: configs.overrides,
|
|
199
|
-
configFile: void 0,
|
|
200
|
-
cwd: void 0
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
config: configs.main,
|
|
204
|
-
configFile: options.configFile,
|
|
205
|
-
cwd: options.cwd
|
|
206
|
-
},
|
|
207
|
-
configs.rc && {
|
|
208
|
-
config: configs.rc,
|
|
209
|
-
configFile: options.rcFile
|
|
210
|
-
},
|
|
211
|
-
configs.packageJson && {
|
|
212
|
-
config: configs.packageJson,
|
|
213
|
-
configFile: "package.json"
|
|
214
|
-
}
|
|
215
|
-
].filter((l) => l && l.config), ...r.layers];
|
|
216
|
-
if (options.defaults) r.config = _merger(r.config, options.defaults);
|
|
217
|
-
if (options.omit$Keys) {
|
|
218
|
-
for (const key in r.config) if (key.startsWith("$")) delete r.config[key];
|
|
219
|
-
}
|
|
220
|
-
if (options.configFileRequired && !r._configFile) throw new Error(`Required config (${r.configFile}) cannot be resolved.`);
|
|
221
|
-
return r;
|
|
222
|
-
}
|
|
223
|
-
async function extendConfig(config, options) {
|
|
224
|
-
config._layers = config._layers || [];
|
|
225
|
-
if (!options.extend) return;
|
|
226
|
-
let keys = options.extend.extendKey;
|
|
227
|
-
if (typeof keys === "string") keys = [keys];
|
|
228
|
-
const extendSources = [];
|
|
229
|
-
for (const key of keys) {
|
|
230
|
-
extendSources.push(...(Array.isArray(config[key]) ? config[key] : [config[key]]).filter(Boolean));
|
|
231
|
-
delete config[key];
|
|
232
|
-
}
|
|
233
|
-
for (let extendSource of extendSources) {
|
|
234
|
-
const originalExtendSource = extendSource;
|
|
235
|
-
let sourceOptions = {};
|
|
236
|
-
if (extendSource.source) {
|
|
237
|
-
sourceOptions = extendSource.options || {};
|
|
238
|
-
extendSource = extendSource.source;
|
|
239
|
-
}
|
|
240
|
-
if (Array.isArray(extendSource)) {
|
|
241
|
-
sourceOptions = extendSource[1] || {};
|
|
242
|
-
extendSource = extendSource[0];
|
|
243
|
-
}
|
|
244
|
-
if (typeof extendSource !== "string") {
|
|
245
|
-
console.warn(`Cannot extend config from \`${JSON.stringify(originalExtendSource)}\` in ${options.cwd}`);
|
|
246
|
-
continue;
|
|
247
|
-
}
|
|
248
|
-
const _config = await resolveConfig(extendSource, options, sourceOptions);
|
|
249
|
-
if (!_config.config) {
|
|
250
|
-
console.warn(`Cannot extend config from \`${extendSource}\` in ${options.cwd}`);
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
await extendConfig(_config.config, {
|
|
254
|
-
...options,
|
|
255
|
-
cwd: _config.cwd
|
|
256
|
-
});
|
|
257
|
-
config._layers.push(_config);
|
|
258
|
-
if (_config.config._layers) {
|
|
259
|
-
config._layers.push(..._config.config._layers);
|
|
260
|
-
delete _config.config._layers;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
const GIGET_PREFIXES = [
|
|
265
|
-
"gh:",
|
|
266
|
-
"github:",
|
|
267
|
-
"gitlab:",
|
|
268
|
-
"bitbucket:",
|
|
269
|
-
"https://",
|
|
270
|
-
"http://"
|
|
271
|
-
];
|
|
272
|
-
const NPM_PACKAGE_RE = /^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/;
|
|
273
|
-
async function resolveConfig(source, options, sourceOptions = {}) {
|
|
274
|
-
if (options.resolve) {
|
|
275
|
-
const res$1 = await options.resolve(source, options);
|
|
276
|
-
if (res$1) return res$1;
|
|
277
|
-
}
|
|
278
|
-
const _merger = options.merger || require_defu.defu;
|
|
279
|
-
const customProviderKeys = Object.keys(sourceOptions.giget?.providers || {}).map((key) => `${key}:`);
|
|
280
|
-
const gigetPrefixes = customProviderKeys.length > 0 ? [...new Set([...customProviderKeys, ...GIGET_PREFIXES])] : GIGET_PREFIXES;
|
|
281
|
-
if (options.giget !== false && gigetPrefixes.some((prefix) => source.startsWith(prefix))) {
|
|
282
|
-
const { downloadTemplate } = await Promise.resolve().then(() => require("../../../../giget@2.0.0/node_modules/giget/dist/index.cjs"));
|
|
283
|
-
const { digest } = await Promise.resolve().then(() => require("../../../../ohash@2.0.11/node_modules/ohash/dist/index.cjs"));
|
|
284
|
-
const cloneName = source.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + digest(source).slice(0, 10).replace(/[-_]/g, "");
|
|
285
|
-
let cloneDir;
|
|
286
|
-
const localNodeModules = require_pathe_M_eThtNZ.resolve(options.cwd, "node_modules");
|
|
287
|
-
const parentDir = require_pathe_M_eThtNZ.dirname(options.cwd);
|
|
288
|
-
if (require_pathe_M_eThtNZ.basename(parentDir) === ".c12") cloneDir = require_pathe_M_eThtNZ.join(parentDir, cloneName);
|
|
289
|
-
else if ((0, node_fs.existsSync)(localNodeModules)) cloneDir = require_pathe_M_eThtNZ.join(localNodeModules, ".c12", cloneName);
|
|
290
|
-
else cloneDir = process.env.XDG_CACHE_HOME ? require_pathe_M_eThtNZ.resolve(process.env.XDG_CACHE_HOME, "c12", cloneName) : require_pathe_M_eThtNZ.resolve((0, node_os.homedir)(), ".cache/c12", cloneName);
|
|
291
|
-
if ((0, node_fs.existsSync)(cloneDir) && !sourceOptions.install) await (0, node_fs_promises.rm)(cloneDir, { recursive: true });
|
|
292
|
-
source = (await downloadTemplate(source, {
|
|
293
|
-
dir: cloneDir,
|
|
294
|
-
install: sourceOptions.install,
|
|
295
|
-
force: sourceOptions.install,
|
|
296
|
-
auth: sourceOptions.auth,
|
|
297
|
-
...options.giget,
|
|
298
|
-
...sourceOptions.giget
|
|
299
|
-
})).dir;
|
|
300
|
-
}
|
|
301
|
-
if (NPM_PACKAGE_RE.test(source)) source = tryResolve(source, options) || source;
|
|
302
|
-
const ext = require_pathe_M_eThtNZ.extname(source);
|
|
303
|
-
const isDir = !ext || ext === require_pathe_M_eThtNZ.basename(source);
|
|
304
|
-
const cwd = require_pathe_M_eThtNZ.resolve(options.cwd, isDir ? source : require_pathe_M_eThtNZ.dirname(source));
|
|
305
|
-
if (isDir) source = options.configFile;
|
|
306
|
-
const res = {
|
|
307
|
-
config: void 0,
|
|
308
|
-
configFile: void 0,
|
|
309
|
-
cwd,
|
|
310
|
-
source,
|
|
311
|
-
sourceOptions
|
|
312
|
-
};
|
|
313
|
-
res.configFile = tryResolve(require_pathe_M_eThtNZ.resolve(cwd, source), options) || tryResolve(require_pathe_M_eThtNZ.resolve(cwd, ".config", source.replace(/\.config$/, "")), options) || tryResolve(require_pathe_M_eThtNZ.resolve(cwd, ".config", source), options) || source;
|
|
314
|
-
if (!(0, node_fs.existsSync)(res.configFile)) return res;
|
|
315
|
-
res._configFile = res.configFile;
|
|
316
|
-
const configFileExt = require_pathe_M_eThtNZ.extname(res.configFile) || "";
|
|
317
|
-
if (configFileExt in ASYNC_LOADERS) res.config = (await ASYNC_LOADERS[configFileExt]())(await (0, node_fs_promises.readFile)(res.configFile, "utf8"));
|
|
318
|
-
else res.config = await options.jiti.import(res.configFile, { default: true });
|
|
319
|
-
if (typeof res.config === "function") res.config = await res.config(options.context);
|
|
320
|
-
if (options.envName) {
|
|
321
|
-
const envConfig = {
|
|
322
|
-
...res.config["$" + options.envName],
|
|
323
|
-
...res.config.$env?.[options.envName]
|
|
324
|
-
};
|
|
325
|
-
if (Object.keys(envConfig).length > 0) res.config = _merger(envConfig, res.config);
|
|
326
|
-
}
|
|
327
|
-
res.meta = require_defu.defu(res.sourceOptions.meta, res.config.$meta);
|
|
328
|
-
delete res.config.$meta;
|
|
329
|
-
if (res.sourceOptions.overrides) res.config = _merger(res.sourceOptions.overrides, res.config);
|
|
330
|
-
res.configFile = _normalize(res.configFile);
|
|
331
|
-
res.source = _normalize(res.source);
|
|
332
|
-
return res;
|
|
333
|
-
}
|
|
334
|
-
function tryResolve(id, options) {
|
|
335
|
-
const res = require_index.resolveModulePath(id, {
|
|
336
|
-
try: true,
|
|
337
|
-
from: (0, node_url.pathToFileURL)(require_pathe_M_eThtNZ.join(options.cwd || ".", options.configFile || "/")),
|
|
338
|
-
suffixes: ["", "/index"],
|
|
339
|
-
extensions: SUPPORTED_EXTENSIONS,
|
|
340
|
-
cache: false
|
|
341
|
-
});
|
|
342
|
-
return res ? require_pathe_M_eThtNZ.normalize(res) : void 0;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
//#endregion
|
|
346
|
-
exports.loadConfig = loadConfig;
|