@karmaniverous/get-dotenv 5.1.0 → 5.2.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/README.md +14 -0
- package/dist/cliHost.cjs +222 -19
- package/dist/cliHost.d.cts +17 -0
- package/dist/cliHost.d.mts +17 -0
- package/dist/cliHost.d.ts +17 -0
- package/dist/cliHost.mjs +222 -19
- package/dist/config.cjs +10 -5
- package/dist/config.d.cts +2 -0
- package/dist/config.d.mts +2 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.mjs +10 -5
- package/dist/env-overlay.d.cts +2 -0
- package/dist/env-overlay.d.mts +2 -0
- package/dist/env-overlay.d.ts +2 -0
- package/dist/getdotenv.cli.mjs +479 -36
- package/dist/index.cjs +579 -245
- package/dist/index.d.cts +36 -1
- package/dist/index.d.mts +36 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.mjs +579 -246
- package/dist/plugins-aws.cjs +43 -1
- package/dist/plugins-aws.d.cts +17 -0
- package/dist/plugins-aws.d.mts +17 -0
- package/dist/plugins-aws.d.ts +17 -0
- package/dist/plugins-aws.mjs +43 -1
- package/dist/plugins-batch.cjs +46 -6
- package/dist/plugins-batch.d.cts +17 -0
- package/dist/plugins-batch.d.mts +17 -0
- package/dist/plugins-batch.d.ts +17 -0
- package/dist/plugins-batch.mjs +46 -6
- package/dist/plugins-init.d.cts +17 -0
- package/dist/plugins-init.d.mts +17 -0
- package/dist/plugins-init.d.ts +17 -0
- package/package.json +25 -24
package/dist/plugins-aws.cjs
CHANGED
|
@@ -194,6 +194,48 @@ const runCommand = async (command, shell, opts) => {
|
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
196
|
|
|
197
|
+
const dropUndefined = (bag) => Object.fromEntries(Object.entries(bag).filter((e) => typeof e[1] === 'string'));
|
|
198
|
+
/** Build a sanitized env for child processes from base + overlay. */
|
|
199
|
+
const buildSpawnEnv = (base, overlay) => {
|
|
200
|
+
const raw = {
|
|
201
|
+
...(base ?? {}),
|
|
202
|
+
...(overlay ?? {}),
|
|
203
|
+
};
|
|
204
|
+
// Drop undefined first
|
|
205
|
+
const entries = Object.entries(dropUndefined(raw));
|
|
206
|
+
if (process.platform === 'win32') {
|
|
207
|
+
// Windows: keys are case-insensitive; collapse duplicates
|
|
208
|
+
const byLower = new Map();
|
|
209
|
+
for (const [k, v] of entries) {
|
|
210
|
+
byLower.set(k.toLowerCase(), [k, v]); // last wins; preserve latest casing
|
|
211
|
+
}
|
|
212
|
+
const out = {};
|
|
213
|
+
for (const [, [k, v]] of byLower)
|
|
214
|
+
out[k] = v;
|
|
215
|
+
// HOME fallback from USERPROFILE (common expectation)
|
|
216
|
+
if (!Object.prototype.hasOwnProperty.call(out, 'HOME')) {
|
|
217
|
+
const up = out['USERPROFILE'];
|
|
218
|
+
if (typeof up === 'string' && up.length > 0)
|
|
219
|
+
out['HOME'] = up;
|
|
220
|
+
}
|
|
221
|
+
// Normalize TMP/TEMP coherence (pick any present; reflect to both)
|
|
222
|
+
const tmp = out['TMP'] ?? out['TEMP'];
|
|
223
|
+
if (typeof tmp === 'string' && tmp.length > 0) {
|
|
224
|
+
out['TMP'] = tmp;
|
|
225
|
+
out['TEMP'] = tmp;
|
|
226
|
+
}
|
|
227
|
+
return out;
|
|
228
|
+
}
|
|
229
|
+
// POSIX: keep keys as-is
|
|
230
|
+
const out = Object.fromEntries(entries);
|
|
231
|
+
// Ensure TMPDIR exists when any temp key is present (best-effort)
|
|
232
|
+
const tmpdir = out['TMPDIR'] ?? out['TMP'] ?? out['TEMP'];
|
|
233
|
+
if (typeof tmpdir === 'string' && tmpdir.length > 0) {
|
|
234
|
+
out['TMPDIR'] = tmpdir;
|
|
235
|
+
}
|
|
236
|
+
return out;
|
|
237
|
+
};
|
|
238
|
+
|
|
197
239
|
/**
|
|
198
240
|
* Define a GetDotenv CLI plugin with compositional helpers.
|
|
199
241
|
*
|
|
@@ -548,7 +590,7 @@ const awsPlugin = () => definePlugin({
|
|
|
548
590
|
const shellSetting = resolveShell(rootOpts?.scripts, 'aws', rootOpts?.shell);
|
|
549
591
|
const ctxDotenv = (ctx?.dotenv ?? {});
|
|
550
592
|
const exit = await runCommand(argv, shellSetting, {
|
|
551
|
-
env:
|
|
593
|
+
env: buildSpawnEnv(process.env, ctxDotenv),
|
|
552
594
|
stdio: capture ? 'pipe' : 'inherit',
|
|
553
595
|
});
|
|
554
596
|
// Deterministic termination (suppressed under tests)
|
package/dist/plugins-aws.d.cts
CHANGED
|
@@ -107,6 +107,23 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
107
107
|
* Logs CLI internals when true.
|
|
108
108
|
*/
|
|
109
109
|
debug?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Strict mode: fail the run when env validation issues are detected
|
|
112
|
+
* (schema or requiredKeys). Warns by default when false or unset.
|
|
113
|
+
*/
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Redaction (presentation): mask secret-like values in logs/trace.
|
|
117
|
+
*/
|
|
118
|
+
redact?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Entropy warnings (presentation): emit once-per-key warnings for high-entropy values.
|
|
121
|
+
*/
|
|
122
|
+
warnEntropy?: boolean;
|
|
123
|
+
entropyThreshold?: number;
|
|
124
|
+
entropyMinLength?: number;
|
|
125
|
+
entropyWhitelist?: string[];
|
|
126
|
+
redactPatterns?: string[];
|
|
110
127
|
/**
|
|
111
128
|
* When true, capture child stdout/stderr and re-emit after completion.
|
|
112
129
|
* Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
|
package/dist/plugins-aws.d.mts
CHANGED
|
@@ -107,6 +107,23 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
107
107
|
* Logs CLI internals when true.
|
|
108
108
|
*/
|
|
109
109
|
debug?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Strict mode: fail the run when env validation issues are detected
|
|
112
|
+
* (schema or requiredKeys). Warns by default when false or unset.
|
|
113
|
+
*/
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Redaction (presentation): mask secret-like values in logs/trace.
|
|
117
|
+
*/
|
|
118
|
+
redact?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Entropy warnings (presentation): emit once-per-key warnings for high-entropy values.
|
|
121
|
+
*/
|
|
122
|
+
warnEntropy?: boolean;
|
|
123
|
+
entropyThreshold?: number;
|
|
124
|
+
entropyMinLength?: number;
|
|
125
|
+
entropyWhitelist?: string[];
|
|
126
|
+
redactPatterns?: string[];
|
|
110
127
|
/**
|
|
111
128
|
* When true, capture child stdout/stderr and re-emit after completion.
|
|
112
129
|
* Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
|
package/dist/plugins-aws.d.ts
CHANGED
|
@@ -107,6 +107,23 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
107
107
|
* Logs CLI internals when true.
|
|
108
108
|
*/
|
|
109
109
|
debug?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Strict mode: fail the run when env validation issues are detected
|
|
112
|
+
* (schema or requiredKeys). Warns by default when false or unset.
|
|
113
|
+
*/
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Redaction (presentation): mask secret-like values in logs/trace.
|
|
117
|
+
*/
|
|
118
|
+
redact?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Entropy warnings (presentation): emit once-per-key warnings for high-entropy values.
|
|
121
|
+
*/
|
|
122
|
+
warnEntropy?: boolean;
|
|
123
|
+
entropyThreshold?: number;
|
|
124
|
+
entropyMinLength?: number;
|
|
125
|
+
entropyWhitelist?: string[];
|
|
126
|
+
redactPatterns?: string[];
|
|
110
127
|
/**
|
|
111
128
|
* When true, capture child stdout/stderr and re-emit after completion.
|
|
112
129
|
* Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
|
package/dist/plugins-aws.mjs
CHANGED
|
@@ -192,6 +192,48 @@ const runCommand = async (command, shell, opts) => {
|
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
+
const dropUndefined = (bag) => Object.fromEntries(Object.entries(bag).filter((e) => typeof e[1] === 'string'));
|
|
196
|
+
/** Build a sanitized env for child processes from base + overlay. */
|
|
197
|
+
const buildSpawnEnv = (base, overlay) => {
|
|
198
|
+
const raw = {
|
|
199
|
+
...(base ?? {}),
|
|
200
|
+
...(overlay ?? {}),
|
|
201
|
+
};
|
|
202
|
+
// Drop undefined first
|
|
203
|
+
const entries = Object.entries(dropUndefined(raw));
|
|
204
|
+
if (process.platform === 'win32') {
|
|
205
|
+
// Windows: keys are case-insensitive; collapse duplicates
|
|
206
|
+
const byLower = new Map();
|
|
207
|
+
for (const [k, v] of entries) {
|
|
208
|
+
byLower.set(k.toLowerCase(), [k, v]); // last wins; preserve latest casing
|
|
209
|
+
}
|
|
210
|
+
const out = {};
|
|
211
|
+
for (const [, [k, v]] of byLower)
|
|
212
|
+
out[k] = v;
|
|
213
|
+
// HOME fallback from USERPROFILE (common expectation)
|
|
214
|
+
if (!Object.prototype.hasOwnProperty.call(out, 'HOME')) {
|
|
215
|
+
const up = out['USERPROFILE'];
|
|
216
|
+
if (typeof up === 'string' && up.length > 0)
|
|
217
|
+
out['HOME'] = up;
|
|
218
|
+
}
|
|
219
|
+
// Normalize TMP/TEMP coherence (pick any present; reflect to both)
|
|
220
|
+
const tmp = out['TMP'] ?? out['TEMP'];
|
|
221
|
+
if (typeof tmp === 'string' && tmp.length > 0) {
|
|
222
|
+
out['TMP'] = tmp;
|
|
223
|
+
out['TEMP'] = tmp;
|
|
224
|
+
}
|
|
225
|
+
return out;
|
|
226
|
+
}
|
|
227
|
+
// POSIX: keep keys as-is
|
|
228
|
+
const out = Object.fromEntries(entries);
|
|
229
|
+
// Ensure TMPDIR exists when any temp key is present (best-effort)
|
|
230
|
+
const tmpdir = out['TMPDIR'] ?? out['TMP'] ?? out['TEMP'];
|
|
231
|
+
if (typeof tmpdir === 'string' && tmpdir.length > 0) {
|
|
232
|
+
out['TMPDIR'] = tmpdir;
|
|
233
|
+
}
|
|
234
|
+
return out;
|
|
235
|
+
};
|
|
236
|
+
|
|
195
237
|
/**
|
|
196
238
|
* Define a GetDotenv CLI plugin with compositional helpers.
|
|
197
239
|
*
|
|
@@ -546,7 +588,7 @@ const awsPlugin = () => definePlugin({
|
|
|
546
588
|
const shellSetting = resolveShell(rootOpts?.scripts, 'aws', rootOpts?.shell);
|
|
547
589
|
const ctxDotenv = (ctx?.dotenv ?? {});
|
|
548
590
|
const exit = await runCommand(argv, shellSetting, {
|
|
549
|
-
env:
|
|
591
|
+
env: buildSpawnEnv(process.env, ctxDotenv),
|
|
550
592
|
stdio: capture ? 'pipe' : 'inherit',
|
|
551
593
|
});
|
|
552
594
|
// Deterministic termination (suppressed under tests)
|
package/dist/plugins-batch.cjs
CHANGED
|
@@ -165,6 +165,48 @@ const runCommand = async (command, shell, opts) => {
|
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
|
|
168
|
+
const dropUndefined = (bag) => Object.fromEntries(Object.entries(bag).filter((e) => typeof e[1] === 'string'));
|
|
169
|
+
/** Build a sanitized env for child processes from base + overlay. */
|
|
170
|
+
const buildSpawnEnv = (base, overlay) => {
|
|
171
|
+
const raw = {
|
|
172
|
+
...(base ?? {}),
|
|
173
|
+
...(overlay ?? {}),
|
|
174
|
+
};
|
|
175
|
+
// Drop undefined first
|
|
176
|
+
const entries = Object.entries(dropUndefined(raw));
|
|
177
|
+
if (process.platform === 'win32') {
|
|
178
|
+
// Windows: keys are case-insensitive; collapse duplicates
|
|
179
|
+
const byLower = new Map();
|
|
180
|
+
for (const [k, v] of entries) {
|
|
181
|
+
byLower.set(k.toLowerCase(), [k, v]); // last wins; preserve latest casing
|
|
182
|
+
}
|
|
183
|
+
const out = {};
|
|
184
|
+
for (const [, [k, v]] of byLower)
|
|
185
|
+
out[k] = v;
|
|
186
|
+
// HOME fallback from USERPROFILE (common expectation)
|
|
187
|
+
if (!Object.prototype.hasOwnProperty.call(out, 'HOME')) {
|
|
188
|
+
const up = out['USERPROFILE'];
|
|
189
|
+
if (typeof up === 'string' && up.length > 0)
|
|
190
|
+
out['HOME'] = up;
|
|
191
|
+
}
|
|
192
|
+
// Normalize TMP/TEMP coherence (pick any present; reflect to both)
|
|
193
|
+
const tmp = out['TMP'] ?? out['TEMP'];
|
|
194
|
+
if (typeof tmp === 'string' && tmp.length > 0) {
|
|
195
|
+
out['TMP'] = tmp;
|
|
196
|
+
out['TEMP'] = tmp;
|
|
197
|
+
}
|
|
198
|
+
return out;
|
|
199
|
+
}
|
|
200
|
+
// POSIX: keep keys as-is
|
|
201
|
+
const out = Object.fromEntries(entries);
|
|
202
|
+
// Ensure TMPDIR exists when any temp key is present (best-effort)
|
|
203
|
+
const tmpdir = out['TMPDIR'] ?? out['TMP'] ?? out['TEMP'];
|
|
204
|
+
if (typeof tmpdir === 'string' && tmpdir.length > 0) {
|
|
205
|
+
out['TMPDIR'] = tmpdir;
|
|
206
|
+
}
|
|
207
|
+
return out;
|
|
208
|
+
};
|
|
209
|
+
|
|
168
210
|
const globPaths = async ({ globs, logger, pkgCwd, rootPath, }) => {
|
|
169
211
|
let cwd = process.cwd();
|
|
170
212
|
if (pkgCwd) {
|
|
@@ -237,14 +279,12 @@ const execShellCommandBatch = async ({ command, getDotenvCliOptions, globs, igno
|
|
|
237
279
|
const hasCmd = (typeof command === 'string' && command.length > 0) ||
|
|
238
280
|
(Array.isArray(command) && command.length > 0);
|
|
239
281
|
if (hasCmd) {
|
|
282
|
+
const envBag = getDotenvCliOptions !== undefined
|
|
283
|
+
? { getDotenvCliOptions: JSON.stringify(getDotenvCliOptions) }
|
|
284
|
+
: undefined;
|
|
240
285
|
await runCommand(command, shell, {
|
|
241
286
|
cwd: path,
|
|
242
|
-
env:
|
|
243
|
-
...process.env,
|
|
244
|
-
getDotenvCliOptions: getDotenvCliOptions
|
|
245
|
-
? JSON.stringify(getDotenvCliOptions)
|
|
246
|
-
: undefined,
|
|
247
|
-
},
|
|
287
|
+
env: buildSpawnEnv(process.env, envBag),
|
|
248
288
|
stdio: capture ? 'pipe' : 'inherit',
|
|
249
289
|
});
|
|
250
290
|
}
|
package/dist/plugins-batch.d.cts
CHANGED
|
@@ -107,6 +107,23 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
107
107
|
* Logs CLI internals when true.
|
|
108
108
|
*/
|
|
109
109
|
debug?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Strict mode: fail the run when env validation issues are detected
|
|
112
|
+
* (schema or requiredKeys). Warns by default when false or unset.
|
|
113
|
+
*/
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Redaction (presentation): mask secret-like values in logs/trace.
|
|
117
|
+
*/
|
|
118
|
+
redact?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Entropy warnings (presentation): emit once-per-key warnings for high-entropy values.
|
|
121
|
+
*/
|
|
122
|
+
warnEntropy?: boolean;
|
|
123
|
+
entropyThreshold?: number;
|
|
124
|
+
entropyMinLength?: number;
|
|
125
|
+
entropyWhitelist?: string[];
|
|
126
|
+
redactPatterns?: string[];
|
|
110
127
|
/**
|
|
111
128
|
* When true, capture child stdout/stderr and re-emit after completion.
|
|
112
129
|
* Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
|
package/dist/plugins-batch.d.mts
CHANGED
|
@@ -107,6 +107,23 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
107
107
|
* Logs CLI internals when true.
|
|
108
108
|
*/
|
|
109
109
|
debug?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Strict mode: fail the run when env validation issues are detected
|
|
112
|
+
* (schema or requiredKeys). Warns by default when false or unset.
|
|
113
|
+
*/
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Redaction (presentation): mask secret-like values in logs/trace.
|
|
117
|
+
*/
|
|
118
|
+
redact?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Entropy warnings (presentation): emit once-per-key warnings for high-entropy values.
|
|
121
|
+
*/
|
|
122
|
+
warnEntropy?: boolean;
|
|
123
|
+
entropyThreshold?: number;
|
|
124
|
+
entropyMinLength?: number;
|
|
125
|
+
entropyWhitelist?: string[];
|
|
126
|
+
redactPatterns?: string[];
|
|
110
127
|
/**
|
|
111
128
|
* When true, capture child stdout/stderr and re-emit after completion.
|
|
112
129
|
* Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
|
package/dist/plugins-batch.d.ts
CHANGED
|
@@ -107,6 +107,23 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
107
107
|
* Logs CLI internals when true.
|
|
108
108
|
*/
|
|
109
109
|
debug?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Strict mode: fail the run when env validation issues are detected
|
|
112
|
+
* (schema or requiredKeys). Warns by default when false or unset.
|
|
113
|
+
*/
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Redaction (presentation): mask secret-like values in logs/trace.
|
|
117
|
+
*/
|
|
118
|
+
redact?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Entropy warnings (presentation): emit once-per-key warnings for high-entropy values.
|
|
121
|
+
*/
|
|
122
|
+
warnEntropy?: boolean;
|
|
123
|
+
entropyThreshold?: number;
|
|
124
|
+
entropyMinLength?: number;
|
|
125
|
+
entropyWhitelist?: string[];
|
|
126
|
+
redactPatterns?: string[];
|
|
110
127
|
/**
|
|
111
128
|
* When true, capture child stdout/stderr and re-emit after completion.
|
|
112
129
|
* Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
|
package/dist/plugins-batch.mjs
CHANGED
|
@@ -163,6 +163,48 @@ const runCommand = async (command, shell, opts) => {
|
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
+
const dropUndefined = (bag) => Object.fromEntries(Object.entries(bag).filter((e) => typeof e[1] === 'string'));
|
|
167
|
+
/** Build a sanitized env for child processes from base + overlay. */
|
|
168
|
+
const buildSpawnEnv = (base, overlay) => {
|
|
169
|
+
const raw = {
|
|
170
|
+
...(base ?? {}),
|
|
171
|
+
...(overlay ?? {}),
|
|
172
|
+
};
|
|
173
|
+
// Drop undefined first
|
|
174
|
+
const entries = Object.entries(dropUndefined(raw));
|
|
175
|
+
if (process.platform === 'win32') {
|
|
176
|
+
// Windows: keys are case-insensitive; collapse duplicates
|
|
177
|
+
const byLower = new Map();
|
|
178
|
+
for (const [k, v] of entries) {
|
|
179
|
+
byLower.set(k.toLowerCase(), [k, v]); // last wins; preserve latest casing
|
|
180
|
+
}
|
|
181
|
+
const out = {};
|
|
182
|
+
for (const [, [k, v]] of byLower)
|
|
183
|
+
out[k] = v;
|
|
184
|
+
// HOME fallback from USERPROFILE (common expectation)
|
|
185
|
+
if (!Object.prototype.hasOwnProperty.call(out, 'HOME')) {
|
|
186
|
+
const up = out['USERPROFILE'];
|
|
187
|
+
if (typeof up === 'string' && up.length > 0)
|
|
188
|
+
out['HOME'] = up;
|
|
189
|
+
}
|
|
190
|
+
// Normalize TMP/TEMP coherence (pick any present; reflect to both)
|
|
191
|
+
const tmp = out['TMP'] ?? out['TEMP'];
|
|
192
|
+
if (typeof tmp === 'string' && tmp.length > 0) {
|
|
193
|
+
out['TMP'] = tmp;
|
|
194
|
+
out['TEMP'] = tmp;
|
|
195
|
+
}
|
|
196
|
+
return out;
|
|
197
|
+
}
|
|
198
|
+
// POSIX: keep keys as-is
|
|
199
|
+
const out = Object.fromEntries(entries);
|
|
200
|
+
// Ensure TMPDIR exists when any temp key is present (best-effort)
|
|
201
|
+
const tmpdir = out['TMPDIR'] ?? out['TMP'] ?? out['TEMP'];
|
|
202
|
+
if (typeof tmpdir === 'string' && tmpdir.length > 0) {
|
|
203
|
+
out['TMPDIR'] = tmpdir;
|
|
204
|
+
}
|
|
205
|
+
return out;
|
|
206
|
+
};
|
|
207
|
+
|
|
166
208
|
const globPaths = async ({ globs, logger, pkgCwd, rootPath, }) => {
|
|
167
209
|
let cwd = process.cwd();
|
|
168
210
|
if (pkgCwd) {
|
|
@@ -235,14 +277,12 @@ const execShellCommandBatch = async ({ command, getDotenvCliOptions, globs, igno
|
|
|
235
277
|
const hasCmd = (typeof command === 'string' && command.length > 0) ||
|
|
236
278
|
(Array.isArray(command) && command.length > 0);
|
|
237
279
|
if (hasCmd) {
|
|
280
|
+
const envBag = getDotenvCliOptions !== undefined
|
|
281
|
+
? { getDotenvCliOptions: JSON.stringify(getDotenvCliOptions) }
|
|
282
|
+
: undefined;
|
|
238
283
|
await runCommand(command, shell, {
|
|
239
284
|
cwd: path,
|
|
240
|
-
env:
|
|
241
|
-
...process.env,
|
|
242
|
-
getDotenvCliOptions: getDotenvCliOptions
|
|
243
|
-
? JSON.stringify(getDotenvCliOptions)
|
|
244
|
-
: undefined,
|
|
245
|
-
},
|
|
285
|
+
env: buildSpawnEnv(process.env, envBag),
|
|
246
286
|
stdio: capture ? 'pipe' : 'inherit',
|
|
247
287
|
});
|
|
248
288
|
}
|
package/dist/plugins-init.d.cts
CHANGED
|
@@ -107,6 +107,23 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
107
107
|
* Logs CLI internals when true.
|
|
108
108
|
*/
|
|
109
109
|
debug?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Strict mode: fail the run when env validation issues are detected
|
|
112
|
+
* (schema or requiredKeys). Warns by default when false or unset.
|
|
113
|
+
*/
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Redaction (presentation): mask secret-like values in logs/trace.
|
|
117
|
+
*/
|
|
118
|
+
redact?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Entropy warnings (presentation): emit once-per-key warnings for high-entropy values.
|
|
121
|
+
*/
|
|
122
|
+
warnEntropy?: boolean;
|
|
123
|
+
entropyThreshold?: number;
|
|
124
|
+
entropyMinLength?: number;
|
|
125
|
+
entropyWhitelist?: string[];
|
|
126
|
+
redactPatterns?: string[];
|
|
110
127
|
/**
|
|
111
128
|
* When true, capture child stdout/stderr and re-emit after completion.
|
|
112
129
|
* Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
|
package/dist/plugins-init.d.mts
CHANGED
|
@@ -107,6 +107,23 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
107
107
|
* Logs CLI internals when true.
|
|
108
108
|
*/
|
|
109
109
|
debug?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Strict mode: fail the run when env validation issues are detected
|
|
112
|
+
* (schema or requiredKeys). Warns by default when false or unset.
|
|
113
|
+
*/
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Redaction (presentation): mask secret-like values in logs/trace.
|
|
117
|
+
*/
|
|
118
|
+
redact?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Entropy warnings (presentation): emit once-per-key warnings for high-entropy values.
|
|
121
|
+
*/
|
|
122
|
+
warnEntropy?: boolean;
|
|
123
|
+
entropyThreshold?: number;
|
|
124
|
+
entropyMinLength?: number;
|
|
125
|
+
entropyWhitelist?: string[];
|
|
126
|
+
redactPatterns?: string[];
|
|
110
127
|
/**
|
|
111
128
|
* When true, capture child stdout/stderr and re-emit after completion.
|
|
112
129
|
* Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
|
package/dist/plugins-init.d.ts
CHANGED
|
@@ -107,6 +107,23 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
107
107
|
* Logs CLI internals when true.
|
|
108
108
|
*/
|
|
109
109
|
debug?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Strict mode: fail the run when env validation issues are detected
|
|
112
|
+
* (schema or requiredKeys). Warns by default when false or unset.
|
|
113
|
+
*/
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Redaction (presentation): mask secret-like values in logs/trace.
|
|
117
|
+
*/
|
|
118
|
+
redact?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Entropy warnings (presentation): emit once-per-key warnings for high-entropy values.
|
|
121
|
+
*/
|
|
122
|
+
warnEntropy?: boolean;
|
|
123
|
+
entropyThreshold?: number;
|
|
124
|
+
entropyMinLength?: number;
|
|
125
|
+
entropyWhitelist?: string[];
|
|
126
|
+
redactPatterns?: string[];
|
|
110
127
|
/**
|
|
111
128
|
* When true, capture child stdout/stderr and re-emit after completion.
|
|
112
129
|
* Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
|
package/package.json
CHANGED
|
@@ -14,54 +14,55 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"commander": "^14.0.1",
|
|
17
|
-
"dotenv": "^17.2.
|
|
17
|
+
"dotenv": "^17.2.3",
|
|
18
18
|
"execa": "^9.6.0",
|
|
19
19
|
"fs-extra": "^11.3.2",
|
|
20
|
-
"globby": "^
|
|
21
|
-
"nanoid": "^5.1.
|
|
20
|
+
"globby": "^15",
|
|
21
|
+
"nanoid": "^5.1.6",
|
|
22
22
|
"package-directory": "^8.1.0",
|
|
23
23
|
"yaml": "^2.8.1",
|
|
24
|
-
"zod": "^4.1.
|
|
24
|
+
"zod": "^4.1.12"
|
|
25
25
|
},
|
|
26
26
|
"description": "Process dotenv files in an arbitrary location & optionally populate environment variables.",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@dotenvx/dotenvx": "^1.
|
|
29
|
-
"@eslint/js": "^9.
|
|
28
|
+
"@dotenvx/dotenvx": "^1.51.0",
|
|
29
|
+
"@eslint/js": "^9.38.0",
|
|
30
30
|
"@rollup/plugin-alias": "^5.1.1",
|
|
31
|
-
"@rollup/plugin-commonjs": "^28.0.
|
|
31
|
+
"@rollup/plugin-commonjs": "^28.0.8",
|
|
32
32
|
"@rollup/plugin-json": "^6.1.0",
|
|
33
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
33
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
34
34
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
35
35
|
"@types/fs-extra": "^11.0.4",
|
|
36
|
-
"@types/node": "^
|
|
37
|
-
"@vitest/eslint-plugin": "^1.3.6",
|
|
36
|
+
"@types/node": "^24",
|
|
38
37
|
"@vitest/coverage-v8": "^3.2.4",
|
|
38
|
+
"@vitest/eslint-plugin": "^1.3.23",
|
|
39
39
|
"auto-changelog": "^2.5.0",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"cross-env": "^10.1.0",
|
|
41
|
+
"esbuild": "^0.25.11",
|
|
42
|
+
"eslint": "^9.38.0",
|
|
42
43
|
"eslint-config-prettier": "^10.1.8",
|
|
43
|
-
"eslint-plugin-jsonc": "^2.
|
|
44
|
+
"eslint-plugin-jsonc": "^2.21.0",
|
|
44
45
|
"eslint-plugin-prettier": "^5.5.4",
|
|
45
46
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
46
47
|
"eslint-plugin-tsdoc": "^0.4.0",
|
|
47
48
|
"fs-extra": "^11.3.2",
|
|
48
49
|
"globals": "^16.4.0",
|
|
49
|
-
"jsonc-eslint-parser": "^2.4.
|
|
50
|
-
"knip": "^5.
|
|
51
|
-
"
|
|
52
|
-
"
|
|
50
|
+
"jsonc-eslint-parser": "^2.4.1",
|
|
51
|
+
"knip": "^5.66.0",
|
|
52
|
+
"lefthook": "^1.13.6",
|
|
53
|
+
"npm-packlist": "^10.0.2",
|
|
53
54
|
"prettier": "^3.6.2",
|
|
54
55
|
"release-it": "^19.0.5",
|
|
55
56
|
"rimraf": "^6.0.1",
|
|
56
|
-
"rollup": "^4.52.
|
|
57
|
+
"rollup": "^4.52.5",
|
|
57
58
|
"rollup-plugin-dts": "^6.2.3",
|
|
58
59
|
"tslib": "^2.8.1",
|
|
59
|
-
"tsx": "^4.20.
|
|
60
|
-
"typedoc": "^0.28.
|
|
61
|
-
"typedoc-plugin-mdn-links": "^5.0.
|
|
60
|
+
"tsx": "^4.20.6",
|
|
61
|
+
"typedoc": "^0.28.14",
|
|
62
|
+
"typedoc-plugin-mdn-links": "^5.0.10",
|
|
62
63
|
"typedoc-plugin-replace-text": "^4.2.0",
|
|
63
|
-
"typescript": "^5.9.
|
|
64
|
-
"typescript-eslint": "^8.
|
|
64
|
+
"typescript": "^5.9.3",
|
|
65
|
+
"typescript-eslint": "^8.46.1",
|
|
65
66
|
"vite-tsconfig-paths": "^5.1.4",
|
|
66
67
|
"vitest": "^3.2.4"
|
|
67
68
|
},
|
|
@@ -224,5 +225,5 @@
|
|
|
224
225
|
},
|
|
225
226
|
"type": "module",
|
|
226
227
|
"types": "dist/index.d.ts",
|
|
227
|
-
"version": "5.
|
|
228
|
+
"version": "5.2.0"
|
|
228
229
|
}
|