@glubean/cli 0.8.2 → 0.8.4

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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/lib/env.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAWjC;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,WAAW,SAAS,GACnB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CASjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQxB"}
package/dist/lib/env.js DELETED
@@ -1,59 +0,0 @@
1
- /**
2
- * Shared .env file loading for the Glubean CLI.
3
- */
4
- import { resolve } from "node:path";
5
- import { readFile } from "node:fs/promises";
6
- import { parse as parseDotenv } from "dotenv";
7
- /**
8
- * Load a single .env file and return its key-value pairs.
9
- * Returns an empty object if the file doesn't exist or can't be read.
10
- */
11
- export async function loadEnvFile(envPath) {
12
- try {
13
- const content = await readFile(envPath, "utf-8");
14
- return parseDotenv(content);
15
- }
16
- catch (error) {
17
- if (error.code === "ENOENT") {
18
- return {};
19
- }
20
- console.warn(`Warning: Could not read env file ${envPath}: ${error.message}`);
21
- return {};
22
- }
23
- }
24
- /**
25
- * Load `.env` + `.env.secrets` from a project root directory.
26
- *
27
- * The secrets file path follows the env file name:
28
- * `.env` → `.env.secrets`
29
- * `.env.staging` → `.env.staging.secrets`
30
- *
31
- * Secrets overlay env vars (later values win).
32
- */
33
- export async function loadProjectEnv(rootDir, envFileName = ".env") {
34
- const envPath = resolve(rootDir, envFileName);
35
- const secretsPath = resolve(rootDir, `${envFileName}.secrets`);
36
- const envVars = await loadEnvFile(envPath);
37
- const secrets = await loadEnvFile(secretsPath);
38
- const merged = { ...envVars, ...secrets };
39
- return expandVars(merged);
40
- }
41
- /**
42
- * Expand `${NAME}` references in env values.
43
- *
44
- * Lookup order:
45
- * 1. Already-resolved values from the same pass (supports forward references
46
- * only if the referenced key appears earlier in the file).
47
- * 2. `process.env`
48
- * 3. Empty string if not found.
49
- */
50
- export function expandVars(vars) {
51
- const result = {};
52
- for (const [key, value] of Object.entries(vars)) {
53
- result[key] = value.replace(/\$\{(\w+)\}/g, (_, name) => {
54
- return result[name] ?? process.env[name] ?? "";
55
- });
56
- }
57
- return result;
58
- }
59
- //# sourceMappingURL=env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/lib/env.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAe;IAEf,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,oCAAoC,OAAO,KAAM,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QACzF,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;;;GAQ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