varlock 0.7.2 → 0.7.3
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/chunk-4JWJZ4P3.js +86 -0
- package/dist/chunk-4JWJZ4P3.js.map +1 -0
- package/dist/{chunk-G2GPGCAP.js → chunk-5LNYCOEO.js} +62 -12
- package/dist/chunk-5LNYCOEO.js.map +1 -0
- package/dist/{chunk-P4WZ2JXY.js → chunk-ANZNVJLY.js} +17 -7
- package/dist/chunk-ANZNVJLY.js.map +1 -0
- package/dist/{chunk-LQ25CRHF.js → chunk-CNDSEDGU.js} +10 -4
- package/dist/chunk-CNDSEDGU.js.map +1 -0
- package/dist/{chunk-U3UHTU2X.js → chunk-CS57IAAJ.js} +6 -6
- package/dist/{chunk-U3UHTU2X.js.map → chunk-CS57IAAJ.js.map} +1 -1
- package/dist/{chunk-D5YM4IWS.js → chunk-EC3NKELX.js} +5 -5
- package/dist/{chunk-D5YM4IWS.js.map → chunk-EC3NKELX.js.map} +1 -1
- package/dist/{chunk-AJCLNVYI.js → chunk-FVFI4EQN.js} +5 -5
- package/dist/{chunk-AJCLNVYI.js.map → chunk-FVFI4EQN.js.map} +1 -1
- package/dist/{chunk-TY6CHCQK.js → chunk-HMMDVPDG.js} +5 -5
- package/dist/{chunk-TY6CHCQK.js.map → chunk-HMMDVPDG.js.map} +1 -1
- package/dist/{chunk-3I5FHXMJ.js → chunk-J4PGGBUP.js} +6 -6
- package/dist/{chunk-3I5FHXMJ.js.map → chunk-J4PGGBUP.js.map} +1 -1
- package/dist/{chunk-WUI34NTD.js → chunk-NTGBMXQQ.js} +5 -5
- package/dist/{chunk-WUI34NTD.js.map → chunk-NTGBMXQQ.js.map} +1 -1
- package/dist/{chunk-EPWHAD6X.js → chunk-QLNQ3KVC.js} +4 -4
- package/dist/{chunk-EPWHAD6X.js.map → chunk-QLNQ3KVC.js.map} +1 -1
- package/dist/{chunk-EBOBYFMY.js → chunk-R54KUFZA.js} +4 -4
- package/dist/{chunk-EBOBYFMY.js.map → chunk-R54KUFZA.js.map} +1 -1
- package/dist/{chunk-MOXREUY6.js → chunk-RYMTOGGL.js} +3 -3
- package/dist/{chunk-MOXREUY6.js.map → chunk-RYMTOGGL.js.map} +1 -1
- package/dist/{chunk-AKWP77PS.js → chunk-W4CM34OJ.js} +8 -8
- package/dist/chunk-W4CM34OJ.js.map +1 -0
- package/dist/{chunk-3LT4WWHG.js → chunk-ZB2JSJLY.js} +5 -5
- package/dist/{chunk-3LT4WWHG.js.map → chunk-ZB2JSJLY.js.map} +1 -1
- package/dist/cli/cli-executable.js +25 -25
- package/dist/cli/cli-executable.js.map +1 -1
- package/dist/config-item-IYYV4PO6.js +5 -0
- package/dist/{config-item-I7ZL2FXU.js.map → config-item-IYYV4PO6.js.map} +1 -1
- package/dist/{env-graph-CwJhXKDk.d.ts → env-graph-BxA2OztA.d.ts} +11 -2
- package/dist/explain.command-VFR5SUW3.js +12 -0
- package/dist/{explain.command-IQOZKKSF.js.map → explain.command-VFR5SUW3.js.map} +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +5 -5
- package/dist/init.command-HRY74HHU.js +12 -0
- package/dist/{init.command-NVADFQ55.js.map → init.command-HRY74HHU.js.map} +1 -1
- package/dist/install-plugin.command-WDCWQWT7.js +11 -0
- package/dist/{install-plugin.command-WE66PLU2.js.map → install-plugin.command-WDCWQWT7.js.map} +1 -1
- package/dist/load.command-FNMIEIJB.js +12 -0
- package/dist/{load.command-NKKZAEE5.js.map → load.command-FNMIEIJB.js.map} +1 -1
- package/dist/plugin-lib.d.ts +2 -2
- package/dist/printenv.command-3HLXLNHS.js +12 -0
- package/dist/{printenv.command-TY5KCVC3.js.map → printenv.command-3HLXLNHS.js.map} +1 -1
- package/dist/run.command-SXM3J6GI.js +13 -0
- package/dist/{run.command-PI2VAO7M.js.map → run.command-SXM3J6GI.js.map} +1 -1
- package/dist/runtime/env.d.ts +1 -1
- package/dist/{scan.command-YIYJ6NTJ.js → scan.command-PW7HYURX.js} +7 -7
- package/dist/{scan.command-YIYJ6NTJ.js.map → scan.command-PW7HYURX.js.map} +1 -1
- package/dist/telemetry.command-4HKKZK7N.js +11 -0
- package/dist/{telemetry.command-WYD4SOWI.js.map → telemetry.command-4HKKZK7N.js.map} +1 -1
- package/dist/typegen.command-O6OXWCVX.js +12 -0
- package/dist/{typegen.command-5WQGI3CE.js.map → typegen.command-O6OXWCVX.js.map} +1 -1
- package/package.json +2 -2
- package/dist/chunk-AKWP77PS.js.map +0 -1
- package/dist/chunk-BIIYEXRU.js +0 -60
- package/dist/chunk-BIIYEXRU.js.map +0 -1
- package/dist/chunk-G2GPGCAP.js.map +0 -1
- package/dist/chunk-LQ25CRHF.js.map +0 -1
- package/dist/chunk-P4WZ2JXY.js.map +0 -1
- package/dist/config-item-I7ZL2FXU.js +0 -5
- package/dist/explain.command-IQOZKKSF.js +0 -12
- package/dist/init.command-NVADFQ55.js +0 -12
- package/dist/install-plugin.command-WE66PLU2.js +0 -11
- package/dist/load.command-NKKZAEE5.js +0 -12
- package/dist/printenv.command-TY5KCVC3.js +0 -12
- package/dist/run.command-PI2VAO7M.js +0 -13
- package/dist/telemetry.command-WYD4SOWI.js +0 -11
- package/dist/typegen.command-5WQGI3CE.js +0 -12
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { CliExitError, loadEnvGraph } from './chunk-CNDSEDGU.js';
|
|
2
|
+
import { runWithWorkspaceInfo } from './chunk-5LNYCOEO.js';
|
|
3
|
+
import { createDebug } from './chunk-6CCHLM3U.js';
|
|
4
|
+
import { __name } from './chunk-6PEHRAEP.js';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import path2 from 'path';
|
|
7
|
+
|
|
8
|
+
function readVarlockPackageJsonConfig(opts) {
|
|
9
|
+
const cwd = opts?.cwd ?? process.cwd();
|
|
10
|
+
const pkgPath = path2.join(cwd, "package.json");
|
|
11
|
+
if (!fs.existsSync(pkgPath)) return void 0;
|
|
12
|
+
try {
|
|
13
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
14
|
+
if (pkg.varlock && typeof pkg.varlock === "object") {
|
|
15
|
+
return pkg.varlock;
|
|
16
|
+
}
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
return void 0;
|
|
20
|
+
}
|
|
21
|
+
__name(readVarlockPackageJsonConfig, "readVarlockPackageJsonConfig");
|
|
22
|
+
|
|
23
|
+
// src/lib/load-graph.ts
|
|
24
|
+
var debug = createDebug("varlock:load");
|
|
25
|
+
function loadVarlockEnvGraph(opts) {
|
|
26
|
+
const pkgLoadPath = readVarlockPackageJsonConfig()?.loadPath;
|
|
27
|
+
if (opts?.entryFilePath) {
|
|
28
|
+
debug("using path from --path flag: %s", path2.resolve(opts.entryFilePath));
|
|
29
|
+
const resolvedPath = path2.resolve(opts.entryFilePath);
|
|
30
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
31
|
+
throw new CliExitError(`The --path value does not exist: ${resolvedPath}`, {
|
|
32
|
+
suggestion: "Use `--path` to specify a valid file or directory."
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return runWithWorkspaceInfo(() => loadEnvGraph({
|
|
36
|
+
...opts,
|
|
37
|
+
entryFilePath: opts.entryFilePath,
|
|
38
|
+
afterInit: /* @__PURE__ */ __name(async (_g) => {
|
|
39
|
+
}, "afterInit")
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
let pkgLoadPaths;
|
|
43
|
+
if (pkgLoadPath) {
|
|
44
|
+
pkgLoadPaths = Array.isArray(pkgLoadPath) ? pkgLoadPath : [pkgLoadPath];
|
|
45
|
+
}
|
|
46
|
+
if (pkgLoadPaths) {
|
|
47
|
+
const resolvedLoadPaths = pkgLoadPaths.map((p) => path2.resolve(p));
|
|
48
|
+
if (resolvedLoadPaths.length === 1) {
|
|
49
|
+
debug("using path from package.json varlock.loadPath: %s", resolvedLoadPaths[0]);
|
|
50
|
+
} else {
|
|
51
|
+
debug(
|
|
52
|
+
"using %d paths from package.json varlock.loadPath: %s",
|
|
53
|
+
resolvedLoadPaths.length,
|
|
54
|
+
resolvedLoadPaths.join(", ")
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
for (const resolvedPath of resolvedLoadPaths) {
|
|
58
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
59
|
+
throw new CliExitError(
|
|
60
|
+
`A path in \`varlock.loadPath\` configured in package.json does not exist: ${resolvedPath}`,
|
|
61
|
+
{ suggestion: "Update `varlock.loadPath` in your package.json to point to valid files or directories." }
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return runWithWorkspaceInfo(() => loadEnvGraph({
|
|
66
|
+
...opts,
|
|
67
|
+
// For a single path, use the existing entryFilePath option for backward compatibility
|
|
68
|
+
entryFilePath: resolvedLoadPaths.length === 1 ? resolvedLoadPaths[0] : void 0,
|
|
69
|
+
// For multiple paths, use entryFilePaths to trigger the multi-path container
|
|
70
|
+
entryFilePaths: resolvedLoadPaths.length > 1 ? resolvedLoadPaths : void 0,
|
|
71
|
+
afterInit: /* @__PURE__ */ __name(async (_g) => {
|
|
72
|
+
}, "afterInit")
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
debug("no path configured, using cwd: %s", process.cwd());
|
|
76
|
+
return runWithWorkspaceInfo(() => loadEnvGraph({
|
|
77
|
+
...opts,
|
|
78
|
+
afterInit: /* @__PURE__ */ __name(async (_g) => {
|
|
79
|
+
}, "afterInit")
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
__name(loadVarlockEnvGraph, "loadVarlockEnvGraph");
|
|
83
|
+
|
|
84
|
+
export { loadVarlockEnvGraph };
|
|
85
|
+
//# sourceMappingURL=chunk-4JWJZ4P3.js.map
|
|
86
|
+
//# sourceMappingURL=chunk-4JWJZ4P3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/package-json-config.ts","../src/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,CAAkB,MAAA,GAAS,CAAA,GAAI,iBAAA,GAAoB,MAAA;AAAA,MACnE,SAAA,gCAAkB,EAAA,KAAO;AAAA,MAEzB,CAAA,EAFW,WAAA;AAAA,KAGZ,CAAC,CAAA;AAAA,EACJ;AAEA,EAAA,KAAA,CAAM,mCAAA,EAAqC,OAAA,CAAQ,GAAA,EAAK,CAAA;AAExD,EAAA,OAAO,oBAAA,CAAqB,MAAM,YAAA,CAAa;AAAA,IAC7C,GAAG,IAAA;AAAA,IACH,SAAA,gCAAkB,EAAA,KAAO;AAAA,IAEzB,CAAA,EAFW,WAAA;AAAA,GAGZ,CAAC,CAAA;AACJ;AA5EgB,MAAA,CAAA,mBAAA,EAAA,qBAAA,CAAA","file":"chunk-4JWJZ4P3.js","sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs';\n\nexport type VarlockPackageJsonConfig = {\n /** Path (or array of paths) to a specific .env file or directory to use as the entry point for loading */\n loadPath?: string | Array<string>;\n};\n\n/**\n * Reads varlock configuration from the `package.json` in `cwd`.\n * Returns undefined if no `package.json` exists or it has no `varlock` key.\n */\nexport function readVarlockPackageJsonConfig(opts?: { cwd?: string }): VarlockPackageJsonConfig | undefined {\n const cwd = opts?.cwd ?? process.cwd();\n const pkgPath = path.join(cwd, 'package.json');\n if (!fs.existsSync(pkgPath)) return undefined;\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));\n if (pkg.varlock && typeof pkg.varlock === 'object') {\n return pkg.varlock as VarlockPackageJsonConfig;\n }\n } catch { /* ignore parse errors */ }\n return undefined;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { loadEnvGraph } from '../env-graph';\nimport { CliExitError } from '../cli/helpers/exit-error';\nimport { runWithWorkspaceInfo } from './workspace-utils';\nimport { readVarlockPackageJsonConfig } from './package-json-config';\nimport { createDebug } from './debug';\n\nconst debug = createDebug('varlock:load');\n\nexport function loadVarlockEnvGraph(opts?: {\n currentEnvFallback?: string,\n /** Explicit entry file path - overrides package.json config */\n entryFilePath?: string,\n}) {\n const pkgLoadPath = readVarlockPackageJsonConfig()?.loadPath;\n\n // If --path flag is provided, it takes precedence over package.json config\n if (opts?.entryFilePath) {\n debug('using path from --path flag: %s', path.resolve(opts.entryFilePath));\n\n const resolvedPath = path.resolve(opts.entryFilePath);\n if (!fs.existsSync(resolvedPath)) {\n throw new CliExitError(`The --path value does not exist: ${resolvedPath}`, {\n suggestion: 'Use `--path` to specify a valid file or directory.',\n });\n }\n\n return runWithWorkspaceInfo(() => loadEnvGraph({\n ...opts,\n entryFilePath: opts.entryFilePath,\n afterInit: async (_g) => {\n // TODO: register varlock resolver\n },\n }));\n }\n\n // Normalize package.json loadPath to an array (or undefined)\n let pkgLoadPaths: Array<string> | undefined;\n if (pkgLoadPath) {\n pkgLoadPaths = Array.isArray(pkgLoadPath) ? pkgLoadPath : [pkgLoadPath];\n }\n\n if (pkgLoadPaths) {\n const resolvedLoadPaths = pkgLoadPaths.map((p) => path.resolve(p));\n\n if (resolvedLoadPaths.length === 1) {\n debug('using path from package.json varlock.loadPath: %s', resolvedLoadPaths[0]);\n } else {\n debug(\n 'using %d paths from package.json varlock.loadPath: %s',\n resolvedLoadPaths.length,\n resolvedLoadPaths.join(', '),\n );\n }\n\n // Validate that all paths exist\n for (const resolvedPath of resolvedLoadPaths) {\n if (!fs.existsSync(resolvedPath)) {\n throw new CliExitError(\n `A path in \\`varlock.loadPath\\` configured in package.json does not exist: ${resolvedPath}`,\n { suggestion: 'Update `varlock.loadPath` in your package.json to point to valid files or directories.' },\n );\n }\n }\n\n return runWithWorkspaceInfo(() => loadEnvGraph({\n ...opts,\n // For a single path, use the existing entryFilePath option for backward compatibility\n entryFilePath: resolvedLoadPaths.length === 1 ? resolvedLoadPaths[0] : undefined,\n // For multiple paths, use entryFilePaths to trigger the multi-path container\n entryFilePaths: resolvedLoadPaths.length > 1 ? resolvedLoadPaths : undefined,\n afterInit: async (_g) => {\n // TODO: register varlock resolver\n },\n }));\n }\n\n debug('no path configured, using cwd: %s', process.cwd());\n\n return runWithWorkspaceInfo(() => loadEnvGraph({\n ...opts,\n afterInit: async (_g) => {\n // TODO: register varlock resolver\n },\n }));\n}\n"]}
|
|
@@ -8617,7 +8617,7 @@ var builtInRootDecorators = [
|
|
|
8617
8617
|
dataSource._loadingError = err instanceof SchemaError ? err : new SchemaError(err);
|
|
8618
8618
|
return;
|
|
8619
8619
|
}
|
|
8620
|
-
const { ConfigItem: ConfigItem2 } = await import('./config-item-
|
|
8620
|
+
const { ConfigItem: ConfigItem2 } = await import('./config-item-IYYV4PO6.js');
|
|
8621
8621
|
for (const [key, entry] of Object.entries(entries)) {
|
|
8622
8622
|
const existsInSchema = key in graph.configSchema;
|
|
8623
8623
|
if (!existsInSchema && !createMissing) {
|
|
@@ -8684,6 +8684,7 @@ function refToBranch(ref) {
|
|
|
8684
8684
|
const s = ref.trim();
|
|
8685
8685
|
if (s.startsWith("refs/heads/")) return s.slice("refs/heads/".length);
|
|
8686
8686
|
if (s.startsWith("refs/head/")) return s.slice("refs/head/".length);
|
|
8687
|
+
if (s.startsWith("refs/pull/")) return void 0;
|
|
8687
8688
|
return s;
|
|
8688
8689
|
}
|
|
8689
8690
|
__name(refToBranch, "refToBranch");
|
|
@@ -8777,7 +8778,7 @@ var PLATFORMS = [
|
|
|
8777
8778
|
isPR: /* @__PURE__ */ __name((env) => env.GITHUB_EVENT_NAME === "pull_request", "isPR"),
|
|
8778
8779
|
prNumber: /* @__PURE__ */ __name((env) => parsePrNumber(env.GITHUB_EVENT_NUMBER), "prNumber"),
|
|
8779
8780
|
repo: /* @__PURE__ */ __name((env) => parseRepoSlug(env.GITHUB_REPOSITORY), "repo"),
|
|
8780
|
-
branch: /* @__PURE__ */ __name((env) => refToBranch(env.GITHUB_REF), "branch"),
|
|
8781
|
+
branch: /* @__PURE__ */ __name((env) => env.GITHUB_HEAD_REF || refToBranch(env.GITHUB_REF), "branch"),
|
|
8781
8782
|
commitSha: "GITHUB_SHA",
|
|
8782
8783
|
runId: "GITHUB_RUN_ID",
|
|
8783
8784
|
buildUrl: /* @__PURE__ */ __name((env) => {
|
|
@@ -9235,8 +9236,9 @@ var BUILTIN_VARS = {
|
|
|
9235
9236
|
},
|
|
9236
9237
|
VARLOCK_IS_CI: {
|
|
9237
9238
|
name: "VARLOCK_IS_CI",
|
|
9238
|
-
description:
|
|
9239
|
-
|
|
9239
|
+
description: "Whether running in a CI environment",
|
|
9240
|
+
type: "boolean",
|
|
9241
|
+
resolver: /* @__PURE__ */ __name((ciEnv) => ciEnv.isCI, "resolver")
|
|
9240
9242
|
},
|
|
9241
9243
|
VARLOCK_BRANCH: {
|
|
9242
9244
|
name: "VARLOCK_BRANCH",
|
|
@@ -9266,6 +9268,7 @@ var BUILTIN_VARS = {
|
|
|
9266
9268
|
VARLOCK_BUILD_URL: {
|
|
9267
9269
|
name: "VARLOCK_BUILD_URL",
|
|
9268
9270
|
description: "Link to the CI build/deploy",
|
|
9271
|
+
type: "url",
|
|
9269
9272
|
resolver: /* @__PURE__ */ __name((ciEnv) => ciEnv.buildUrl, "resolver")
|
|
9270
9273
|
},
|
|
9271
9274
|
VARLOCK_REPO: {
|
|
@@ -10637,6 +10640,14 @@ var EnvGraphDataSource2 = class {
|
|
|
10637
10640
|
await this._initChild(child, importMeta);
|
|
10638
10641
|
await child._processImports();
|
|
10639
10642
|
}
|
|
10643
|
+
/**
|
|
10644
|
+
* When true, direct children of this data source are treated as top-level entry points:
|
|
10645
|
+
* they inherit the "no parent" semantics and are never classified as env-specific
|
|
10646
|
+
* solely because of their filename (e.g. `.env.production` used as an explicit entry
|
|
10647
|
+
* point would not be env-specific, but one auto-loaded inside a directory would be).
|
|
10648
|
+
* Only `MultiplePathsContainerDataSource` sets this to true.
|
|
10649
|
+
*/
|
|
10650
|
+
childrenAreRoots;
|
|
10640
10651
|
/**
|
|
10641
10652
|
* Whether this data source is environment-specific.
|
|
10642
10653
|
* A source is env-specific if:
|
|
@@ -10649,11 +10660,12 @@ var EnvGraphDataSource2 = class {
|
|
|
10649
10660
|
* Note: `applyForEnv` from filename parsing is only relevant for auto-loaded files.
|
|
10650
10661
|
* Explicitly imported files (via `@import`) are controlled by the import mechanism,
|
|
10651
10662
|
* not the auto-load-by-env logic, so their `applyForEnv` is ignored here.
|
|
10652
|
-
* Similarly, a file that is the explicit root entry point (no parent
|
|
10653
|
-
* treated as env-specific even if its filename
|
|
10663
|
+
* Similarly, a file that is the explicit root entry point (no parent, or whose parent
|
|
10664
|
+
* has `childrenAreRoots` set) is never treated as env-specific even if its filename
|
|
10665
|
+
* contains an env qualifier.
|
|
10654
10666
|
*/
|
|
10655
10667
|
get isEnvSpecific() {
|
|
10656
|
-
if (this.applyForEnv && !this.isImport && this.parent) return true;
|
|
10668
|
+
if (this.applyForEnv && !this.isImport && this.parent && !this.parent?.childrenAreRoots) return true;
|
|
10657
10669
|
if (this.type === "overrides") return true;
|
|
10658
10670
|
if (this._hasConditionalDisable) return true;
|
|
10659
10671
|
if (this.importMeta?.isConditionallyEnabled) return true;
|
|
@@ -11252,6 +11264,43 @@ var DirectoryDataSource = class extends EnvGraphDataSource2 {
|
|
|
11252
11264
|
}
|
|
11253
11265
|
}
|
|
11254
11266
|
};
|
|
11267
|
+
var MultiplePathsContainerDataSource = class extends EnvGraphDataSource2 {
|
|
11268
|
+
constructor(paths) {
|
|
11269
|
+
super();
|
|
11270
|
+
this.paths = paths;
|
|
11271
|
+
}
|
|
11272
|
+
static {
|
|
11273
|
+
__name(this, "MultiplePathsContainerDataSource");
|
|
11274
|
+
}
|
|
11275
|
+
type = "container";
|
|
11276
|
+
typeLabel = "multi-path-container";
|
|
11277
|
+
get label() {
|
|
11278
|
+
return `multi-path container (${this.paths.length} paths)`;
|
|
11279
|
+
}
|
|
11280
|
+
/**
|
|
11281
|
+
* Direct children of this container are treated as top-level entry points,
|
|
11282
|
+
* inheriting root semantics (never classified as env-specific due to filename).
|
|
11283
|
+
*/
|
|
11284
|
+
childrenAreRoots = true;
|
|
11285
|
+
async _finishInit() {
|
|
11286
|
+
if (!this.graph) throw new Error("expected graph to be set");
|
|
11287
|
+
for (const entryPath of this.paths) {
|
|
11288
|
+
const isDirectory = entryPath.endsWith("/") || entryPath.endsWith(path2.sep) || !this.graph.virtualImports && await fs2.stat(entryPath).then((s) => s.isDirectory()).catch(() => false);
|
|
11289
|
+
let child;
|
|
11290
|
+
if (isDirectory) {
|
|
11291
|
+
child = new DirectoryDataSource(entryPath);
|
|
11292
|
+
} else {
|
|
11293
|
+
const virtualContents = this.graph.virtualImports?.[entryPath];
|
|
11294
|
+
child = new DotEnvFileDataSource(
|
|
11295
|
+
entryPath,
|
|
11296
|
+
virtualContents ? { overrideContents: virtualContents } : void 0
|
|
11297
|
+
);
|
|
11298
|
+
}
|
|
11299
|
+
await this._initChild(child);
|
|
11300
|
+
await child._processImports();
|
|
11301
|
+
}
|
|
11302
|
+
}
|
|
11303
|
+
};
|
|
11255
11304
|
|
|
11256
11305
|
// src/env-graph/lib/graph-utils.ts
|
|
11257
11306
|
function getTransitiveDeps(key, adjacencyList) {
|
|
@@ -11639,10 +11688,10 @@ var EnvGraph2 = class {
|
|
|
11639
11688
|
let item = this.configSchema[key];
|
|
11640
11689
|
if (item?._internalDefs.length) return;
|
|
11641
11690
|
const graph = this;
|
|
11691
|
+
const builtinType = builtinDef.type || "string";
|
|
11642
11692
|
const BuiltinVarResolver = createResolver({
|
|
11643
11693
|
name: `\0builtin:${key}`,
|
|
11644
11694
|
description: builtinDef.description,
|
|
11645
|
-
inferredType: "string",
|
|
11646
11695
|
async resolve() {
|
|
11647
11696
|
return builtinDef.resolver(graph.ciEnvInfo, graph.processEnvForBuiltins);
|
|
11648
11697
|
}
|
|
@@ -11651,7 +11700,8 @@ var EnvGraph2 = class {
|
|
|
11651
11700
|
item = new ConfigItem(this, key);
|
|
11652
11701
|
item._isRequired = false;
|
|
11653
11702
|
item._isSensitive = false;
|
|
11654
|
-
|
|
11703
|
+
const dataTypeFactory = this.dataTypesRegistry[builtinType] ?? this.dataTypesRegistry.string;
|
|
11704
|
+
item.dataType = dataTypeFactory();
|
|
11655
11705
|
this.configSchema[key] = item;
|
|
11656
11706
|
}
|
|
11657
11707
|
item.isBuiltin = true;
|
|
@@ -12532,6 +12582,6 @@ var ConfigItem = class {
|
|
|
12532
12582
|
}
|
|
12533
12583
|
};
|
|
12534
12584
|
|
|
12535
|
-
export { ConfigItem, Ct, DirectoryDataSource, DotEnvFileDataSource, EnvGraph2 as EnvGraph, FileBasedDataSource, Jt, ParsedEnvSpecStaticValue, StaticValueResolver, ansis_default, detectWorkspaceInfo, downloadPluginToCache, envSpecUpdater, getUserVarlockDir, parseEnvSpecDotEnvFile, pathExists, prompts_default, require_semver2 as require_semver, runWithWorkspaceInfo, tryCatch };
|
|
12536
|
-
//# sourceMappingURL=chunk-
|
|
12537
|
-
//# sourceMappingURL=chunk-
|
|
12585
|
+
export { ConfigItem, Ct, DirectoryDataSource, DotEnvFileDataSource, EnvGraph2 as EnvGraph, FileBasedDataSource, Jt, MultiplePathsContainerDataSource, ParsedEnvSpecStaticValue, StaticValueResolver, ansis_default, detectWorkspaceInfo, downloadPluginToCache, envSpecUpdater, getUserVarlockDir, parseEnvSpecDotEnvFile, pathExists, prompts_default, require_semver2 as require_semver, runWithWorkspaceInfo, tryCatch };
|
|
12586
|
+
//# sourceMappingURL=chunk-5LNYCOEO.js.map
|
|
12587
|
+
//# sourceMappingURL=chunk-5LNYCOEO.js.map
|