@karmaniverous/get-dotenv 6.5.2 → 7.0.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/dist/chunks/{AwsRestJsonProtocol-7Uww6gmd.mjs → AwsRestJsonProtocol-DeiE3wkO.mjs} +22 -5
- package/dist/chunks/{createCli-pZgHlwKX.mjs → createCli-B9-MIwWj.mjs} +4 -4
- package/dist/chunks/{externalDataInterceptor-CnjiiRdu.mjs → externalDataInterceptor-gi2RH4ez.mjs} +2 -2
- package/dist/chunks/{getSSOTokenFromFile-Bct4fw5A.mjs → getSSOTokenFromFile-BfAhZf_d.mjs} +1 -1
- package/dist/chunks/{index-BJWV46OF.mjs → index-98yxYe1W.mjs} +73 -61
- package/dist/chunks/{index-CDPFly99.mjs → index-AssUn9IY.mjs} +218 -164
- package/dist/chunks/{index-BHKFx7ea.mjs → index-B6r8O7PJ.mjs} +5 -5
- package/dist/chunks/{index-Do8RFiEa.mjs → index-C21RHLO4.mjs} +2 -2
- package/dist/chunks/{index-Cg50N4ys.mjs → index-CAtxK29A.mjs} +2 -2
- package/dist/chunks/{index-Cy9EnHMK.mjs → index-CMSCF_uw.mjs} +73 -71
- package/dist/chunks/{index-CzwvgH1X.mjs → index-Ccay5Db0.mjs} +33 -35
- package/dist/chunks/{index-37ce0nLC.mjs → index-D8S1lJ24.mjs} +44 -39
- package/dist/chunks/{index-DeXLfLd1.mjs → index-DY7wYcXW.mjs} +18 -23
- package/dist/chunks/{index-Bmw8WxM1.mjs → index-DfvhftMN.mjs} +2 -2
- package/dist/chunks/{index-udC0OkWn.mjs → index-DtdHVcXz.mjs} +2 -2
- package/dist/chunks/{index-BjE-7W3n.mjs → index-mPj0Vhpw.mjs} +5 -5
- package/dist/chunks/{index-BfVeLAui.mjs → index-xRi3oKvY.mjs} +3 -3
- package/dist/chunks/{loadSso-DJONWtFw.mjs → loadSso-C-y9gQEz.mjs} +84 -73
- package/dist/chunks/{package-boo9EyYs.mjs → package-DiDNabNr.mjs} +1 -1
- package/dist/chunks/{parseKnownFiles-DsgpkpKC.mjs → parseKnownFiles-KczcjlE0.mjs} +1 -1
- package/dist/chunks/{readMergedOptions-uWSetyes.mjs → readMergedOptions-D6niy_Ep.mjs} +24 -3
- package/dist/chunks/{resolveCliOptions-7MwNdHqz.mjs → resolveCliOptions-PWF1aEM9.mjs} +1 -1
- package/dist/chunks/{sdk-stream-mixin-uGZKBKMz.mjs → sdk-stream-mixin-blFikF4G.mjs} +1 -1
- package/dist/chunks/{types-BSMtAo8_.mjs → types-Bp3u5-IH.mjs} +1 -1
- package/dist/cli.d.ts +4 -2
- package/dist/cli.mjs +5 -5
- package/dist/cliHost.d.ts +4 -2
- package/dist/cliHost.mjs +3 -3
- package/dist/getdotenv.cli.mjs +5 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.mjs +12 -13
- package/dist/plugins-aws.d.ts +4 -2
- package/dist/plugins-aws.mjs +1 -1
- package/dist/plugins-batch.d.ts +4 -2
- package/dist/plugins-batch.mjs +1 -1
- package/dist/plugins-cmd.d.ts +4 -2
- package/dist/plugins-cmd.mjs +3 -3
- package/dist/plugins-init.d.ts +4 -2
- package/dist/plugins-init.mjs +11 -11
- package/dist/plugins.d.ts +4 -2
- package/dist/plugins.mjs +4 -4
- package/package.json +17 -17
|
@@ -173,6 +173,23 @@ const baseRootOptionDefaults = {
|
|
|
173
173
|
* - Provide Vars-aware defineDynamic and a typed config builder defineGetDotenvConfig\<Vars, Env\>().
|
|
174
174
|
* - Preserve existing behavior for defaults resolution and compat converters.
|
|
175
175
|
*/
|
|
176
|
+
/**
|
|
177
|
+
* Validate that a candidate object satisfies the {@link Logger} contract.
|
|
178
|
+
* Throws if the candidate is invalid.
|
|
179
|
+
*/
|
|
180
|
+
const assertLogger = (candidate) => {
|
|
181
|
+
if (!candidate || typeof candidate !== 'object') {
|
|
182
|
+
throw new Error('logger must be an object');
|
|
183
|
+
}
|
|
184
|
+
const l = candidate;
|
|
185
|
+
if (typeof l.debug !== 'function' ||
|
|
186
|
+
typeof l.info !== 'function' ||
|
|
187
|
+
typeof l.warn !== 'function' ||
|
|
188
|
+
typeof l.error !== 'function') {
|
|
189
|
+
throw new Error('logger must implement debug, info, warn, and error methods');
|
|
190
|
+
}
|
|
191
|
+
return l;
|
|
192
|
+
};
|
|
176
193
|
function defineDynamic(d) {
|
|
177
194
|
return d;
|
|
178
195
|
}
|
|
@@ -266,8 +283,12 @@ const resolveGetDotenvOptions = (customOptions) => {
|
|
|
266
283
|
const mergedDefaults = baseRootOptionDefaults;
|
|
267
284
|
const defaultsFromCli = getDotenvCliOptions2Options(mergedDefaults);
|
|
268
285
|
const result = defaultsDeep(defaultsFromCli, customOptions);
|
|
286
|
+
// Validate the logger (defaults to console if missing/merged).
|
|
287
|
+
// We use the merged result, so if the user didn't provide one, we get the default (console).
|
|
288
|
+
const validatedLogger = assertLogger(result.logger);
|
|
269
289
|
return Promise.resolve({
|
|
270
|
-
...result,
|
|
290
|
+
...result,
|
|
291
|
+
logger: validatedLogger,
|
|
271
292
|
vars: shake(result.vars ?? {}, (v) => v === undefined),
|
|
272
293
|
});
|
|
273
294
|
};
|
|
@@ -396,7 +417,7 @@ const computeContext = async (customOptions, plugins, hostMetaUrl) => {
|
|
|
396
417
|
}
|
|
397
418
|
const logger = validated.logger;
|
|
398
419
|
if (validated.log)
|
|
399
|
-
logger.
|
|
420
|
+
logger.info(dotenv);
|
|
400
421
|
if (validated.loadProcess)
|
|
401
422
|
Object.assign(process.env, dotenv);
|
|
402
423
|
// Merge and validate per-plugin config keyed by realized path (ns chain).
|
|
@@ -1415,4 +1436,4 @@ const readMergedOptions = (cmd) => {
|
|
|
1415
1436
|
return bag;
|
|
1416
1437
|
};
|
|
1417
1438
|
|
|
1418
|
-
export { GetDotenvCli as G, defaultsDeep as a, baseRootOptionDefaults as b, attachRootOptions as c, definePlugin as d, resolveGetDotenvOptions as e,
|
|
1439
|
+
export { GetDotenvCli as G, defaultsDeep as a, baseRootOptionDefaults as b, attachRootOptions as c, definePlugin as d, resolveGetDotenvOptions as e, assertLogger as f, getDotenvCliOptions2Options as g, defineDynamic as h, defineGetDotenvConfig as i, interpolateDeep as j, readMergedOptions as r, writeDotenvFile as w };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as fromBase64, n as toBase64, o as toHex, t as toUtf8, q as fromArrayBuffer, r as streamCollector$1 } from './index-
|
|
1
|
+
import { m as fromBase64, n as toBase64, o as toHex, t as toUtf8, q as fromArrayBuffer, r as streamCollector$1 } from './index-AssUn9IY.mjs';
|
|
2
2
|
import { Readable } from 'stream';
|
|
3
3
|
|
|
4
4
|
const isReadableStream = (stream) => typeof ReadableStream === "function" &&
|
package/dist/cli.d.ts
CHANGED
|
@@ -377,9 +377,11 @@ type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => s
|
|
|
377
377
|
*/
|
|
378
378
|
type GetDotenvDynamic = Record<string, GetDotenvDynamicFunction | ReturnType<GetDotenvDynamicFunction>>;
|
|
379
379
|
/**
|
|
380
|
-
* Logger interface compatible with `
|
|
380
|
+
* Logger interface compatible with AWS SDK v3 expectations (`debug`, `info`, `warn`, `error`).
|
|
381
|
+
* Consumers must provide an object that implements these four methods.
|
|
382
|
+
* Additional methods (like `log`) are allowed but not required or used by this library.
|
|
381
383
|
*/
|
|
382
|
-
type Logger =
|
|
384
|
+
type Logger = Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
383
385
|
/**
|
|
384
386
|
* Canonical programmatic options type (schema-derived).
|
|
385
387
|
* This type is the single source of truth for programmatic options.
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as createCli } from './chunks/createCli-
|
|
1
|
+
export { c as createCli } from './chunks/createCli-B9-MIwWj.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'path';
|
|
4
4
|
import './chunks/loader-CE4HSRN4.mjs';
|
|
@@ -13,16 +13,16 @@ import './chunks/loadModuleDefault-Dj8B3Stt.mjs';
|
|
|
13
13
|
import 'crypto';
|
|
14
14
|
import '@commander-js/extra-typings';
|
|
15
15
|
import 'nanoid';
|
|
16
|
-
import './chunks/readMergedOptions-
|
|
16
|
+
import './chunks/readMergedOptions-D6niy_Ep.mjs';
|
|
17
17
|
import './chunks/readDotenvCascade-HLU7FsEQ.mjs';
|
|
18
18
|
import 'dotenv';
|
|
19
19
|
import 'execa';
|
|
20
20
|
import './chunks/helpConfig-CGejgwWW.mjs';
|
|
21
|
-
import './chunks/resolveCliOptions-
|
|
21
|
+
import './chunks/resolveCliOptions-PWF1aEM9.mjs';
|
|
22
22
|
import './chunks/validate-CDl0rE6k.mjs';
|
|
23
23
|
import './plugins-aws.mjs';
|
|
24
24
|
import './chunks/spawnEnv-5kdIVv0x.mjs';
|
|
25
|
-
import './chunks/index-
|
|
25
|
+
import './chunks/index-AssUn9IY.mjs';
|
|
26
26
|
import 'buffer';
|
|
27
27
|
import 'os';
|
|
28
28
|
import 'node:fs/promises';
|
|
@@ -34,7 +34,7 @@ import 'node:fs';
|
|
|
34
34
|
import './plugins-batch.mjs';
|
|
35
35
|
import './chunks/invoke-DuRPU1oC.mjs';
|
|
36
36
|
import 'globby';
|
|
37
|
-
import './chunks/index-
|
|
37
|
+
import './chunks/index-CAtxK29A.mjs';
|
|
38
38
|
import './plugins-init.mjs';
|
|
39
39
|
import 'node:process';
|
|
40
40
|
import 'readline/promises';
|
package/dist/cliHost.d.ts
CHANGED
|
@@ -383,9 +383,11 @@ type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => s
|
|
|
383
383
|
*/
|
|
384
384
|
type GetDotenvDynamic = Record<string, GetDotenvDynamicFunction | ReturnType<GetDotenvDynamicFunction>>;
|
|
385
385
|
/**
|
|
386
|
-
* Logger interface compatible with `
|
|
386
|
+
* Logger interface compatible with AWS SDK v3 expectations (`debug`, `info`, `warn`, `error`).
|
|
387
|
+
* Consumers must provide an object that implements these four methods.
|
|
388
|
+
* Additional methods (like `log`) are allowed but not required or used by this library.
|
|
387
389
|
*/
|
|
388
|
-
type Logger =
|
|
390
|
+
type Logger = Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
389
391
|
/**
|
|
390
392
|
* Canonical programmatic options type (schema-derived).
|
|
391
393
|
* This type is the single source of truth for programmatic options.
|
package/dist/cliHost.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { G as GetDotenvCli, d as definePlugin, r as readMergedOptions } from './chunks/readMergedOptions-
|
|
1
|
+
export { G as GetDotenvCli, d as definePlugin, r as readMergedOptions } from './chunks/readMergedOptions-D6niy_Ep.mjs';
|
|
2
2
|
export { d as buildSpawnEnv, b as resolveCommand, c as resolveShell, r as runCommand, a as runCommandResult, s as shouldCapture } from './chunks/spawnEnv-5kdIVv0x.mjs';
|
|
3
|
-
export { b as baseGetDotenvCliOptions, r as resolveCliOptions } from './chunks/resolveCliOptions-
|
|
4
|
-
export { d as defineScripts, g as groupPlugins } from './chunks/types-
|
|
3
|
+
export { b as baseGetDotenvCliOptions, r as resolveCliOptions } from './chunks/resolveCliOptions-PWF1aEM9.mjs';
|
|
4
|
+
export { d as defineScripts, g as groupPlugins } from './chunks/types-Bp3u5-IH.mjs';
|
|
5
5
|
export { t as toHelpConfig } from './chunks/helpConfig-CGejgwWW.mjs';
|
|
6
6
|
export { c as composeNestedEnv, m as maybePreserveNodeEvalArgv, s as stripOne } from './chunks/invoke-DuRPU1oC.mjs';
|
|
7
7
|
export { z } from 'zod';
|
package/dist/getdotenv.cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as createCli } from './chunks/createCli-
|
|
2
|
+
import { c as createCli } from './chunks/createCli-B9-MIwWj.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import 'path';
|
|
5
5
|
import './chunks/loader-CE4HSRN4.mjs';
|
|
@@ -14,16 +14,16 @@ import './chunks/loadModuleDefault-Dj8B3Stt.mjs';
|
|
|
14
14
|
import 'crypto';
|
|
15
15
|
import '@commander-js/extra-typings';
|
|
16
16
|
import 'nanoid';
|
|
17
|
-
import './chunks/readMergedOptions-
|
|
17
|
+
import './chunks/readMergedOptions-D6niy_Ep.mjs';
|
|
18
18
|
import './chunks/readDotenvCascade-HLU7FsEQ.mjs';
|
|
19
19
|
import 'dotenv';
|
|
20
20
|
import 'execa';
|
|
21
21
|
import './chunks/helpConfig-CGejgwWW.mjs';
|
|
22
|
-
import './chunks/resolveCliOptions-
|
|
22
|
+
import './chunks/resolveCliOptions-PWF1aEM9.mjs';
|
|
23
23
|
import './chunks/validate-CDl0rE6k.mjs';
|
|
24
24
|
import './plugins-aws.mjs';
|
|
25
25
|
import './chunks/spawnEnv-5kdIVv0x.mjs';
|
|
26
|
-
import './chunks/index-
|
|
26
|
+
import './chunks/index-AssUn9IY.mjs';
|
|
27
27
|
import 'buffer';
|
|
28
28
|
import 'os';
|
|
29
29
|
import 'node:fs/promises';
|
|
@@ -35,7 +35,7 @@ import 'node:fs';
|
|
|
35
35
|
import './plugins-batch.mjs';
|
|
36
36
|
import './chunks/invoke-DuRPU1oC.mjs';
|
|
37
37
|
import 'globby';
|
|
38
|
-
import './chunks/index-
|
|
38
|
+
import './chunks/index-CAtxK29A.mjs';
|
|
39
39
|
import './plugins-init.mjs';
|
|
40
40
|
import 'node:process';
|
|
41
41
|
import 'readline/promises';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z, ZodObject } from 'zod';
|
|
2
|
-
export { z } from 'zod';
|
|
3
2
|
import { OptionValues, Command, InferCommandArguments, Option, CommandUnknownOpts } from '@commander-js/extra-typings';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -398,9 +397,16 @@ type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => s
|
|
|
398
397
|
*/
|
|
399
398
|
type GetDotenvDynamic = Record<string, GetDotenvDynamicFunction | ReturnType<GetDotenvDynamicFunction>>;
|
|
400
399
|
/**
|
|
401
|
-
* Logger interface compatible with `
|
|
400
|
+
* Logger interface compatible with AWS SDK v3 expectations (`debug`, `info`, `warn`, `error`).
|
|
401
|
+
* Consumers must provide an object that implements these four methods.
|
|
402
|
+
* Additional methods (like `log`) are allowed but not required or used by this library.
|
|
402
403
|
*/
|
|
403
|
-
type Logger =
|
|
404
|
+
type Logger = Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
405
|
+
/**
|
|
406
|
+
* Validate that a candidate object satisfies the {@link Logger} contract.
|
|
407
|
+
* Throws if the candidate is invalid.
|
|
408
|
+
*/
|
|
409
|
+
declare const assertLogger: (candidate: unknown) => Logger;
|
|
404
410
|
/**
|
|
405
411
|
* Canonical programmatic options type (schema-derived).
|
|
406
412
|
* This type is the single source of truth for programmatic options.
|
|
@@ -1094,7 +1100,7 @@ interface BaseRootOptionDefaults {
|
|
|
1094
1100
|
/** When true, load composed values into `process.env`. */
|
|
1095
1101
|
loadProcess: boolean;
|
|
1096
1102
|
/** Logger used by the host and plugins (console-compatible). */
|
|
1097
|
-
logger:
|
|
1103
|
+
logger: Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
1098
1104
|
/** Enable entropy warnings (presentation-only). */
|
|
1099
1105
|
warnEntropy: boolean;
|
|
1100
1106
|
/** Entropy threshold (bits/char) used for warnings. */
|
|
@@ -1923,5 +1929,5 @@ interface TokenizeOptions {
|
|
|
1923
1929
|
*/
|
|
1924
1930
|
declare const tokenize: (command: string, opts?: TokenizeOptions) => string[];
|
|
1925
1931
|
|
|
1926
|
-
export { GetDotenvCli, applyDotenvEdits, applyIncludeExclude, assertByteLimit, baseRootOptionDefaults, buildSpawnEnv, createCli, defaultsDeep, defineDynamic, defineGetDotenvConfig, definePlugin, defineScripts, dotenvExpand, dotenvExpandAll, dotenvExpandFromProcessEnv, editDotenvFile, editDotenvText, getDotenv, getDotenvCliOptions2Options, groupPlugins, interpolateDeep, loadModuleDefault, maybeWarnEntropy, parseDotenvDocument, parseFiniteNumber, parseNonNegativeInt, parsePositiveInt, readMergedOptions, redactDisplay, redactObject, renderDotenvDocument, requireString, shouldCapture, silentLogger, toNumber, tokenize, traceChildEnv, writeDotenvFile };
|
|
1932
|
+
export { GetDotenvCli, applyDotenvEdits, applyIncludeExclude, assertByteLimit, assertLogger, baseRootOptionDefaults, buildSpawnEnv, createCli, defaultsDeep, defineDynamic, defineGetDotenvConfig, definePlugin, defineScripts, dotenvExpand, dotenvExpandAll, dotenvExpandFromProcessEnv, editDotenvFile, editDotenvText, getDotenv, getDotenvCliOptions2Options, groupPlugins, interpolateDeep, loadModuleDefault, maybeWarnEntropy, parseDotenvDocument, parseFiniteNumber, parseNonNegativeInt, parsePositiveInt, readMergedOptions, redactDisplay, redactObject, renderDotenvDocument, requireString, shouldCapture, silentLogger, toNumber, tokenize, traceChildEnv, writeDotenvFile };
|
|
1927
1933
|
export type { CreateCliOptions, DotenvAssignmentSegment, DotenvBareKeySegment, DotenvConfigProvenanceEntry, DotenvDocument, DotenvDuplicateKeyStrategy, DotenvDynamicProvenanceEntry, DotenvDynamicSource, DotenvEditMode, DotenvEditOptions, DotenvEolMode, DotenvFileProvenanceEntry, DotenvFs, DotenvPathSearchOrder, DotenvProvenance, DotenvProvenanceEntry, DotenvProvenanceEntryBase, DotenvProvenanceKind, DotenvProvenanceOp, DotenvSegment, DotenvTargetPrivacy, DotenvTargetScope, DotenvUpdateMap, DotenvUpdateValue, DotenvVarsProvenanceEntry, DynamicFn, DynamicMap, EditDotenvFileOptions, EditDotenvFileResult, EntropyOptions, GetDotenvCliOptions, GetDotenvCliPlugin, GetDotenvCliPublic, GetDotenvConfig, GetDotenvDynamic, GetDotenvOptions, InferGetDotenvVarsFromConfig, InferPluginConfig, PluginWithInstanceHelpers, ProcessEnv, RedactOptions, ScriptsTable, TokenizeOptions, TraceChildEnvOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { c as createCli } from './chunks/createCli-
|
|
2
|
-
import { e as resolveGetDotenvOptions, w as writeDotenvFile } from './chunks/readMergedOptions-
|
|
3
|
-
export { G as GetDotenvCli, b as baseRootOptionDefaults, a as defaultsDeep,
|
|
1
|
+
export { c as createCli } from './chunks/createCli-B9-MIwWj.mjs';
|
|
2
|
+
import { e as resolveGetDotenvOptions, w as writeDotenvFile } from './chunks/readMergedOptions-D6niy_Ep.mjs';
|
|
3
|
+
export { G as GetDotenvCli, f as assertLogger, b as baseRootOptionDefaults, a as defaultsDeep, h as defineDynamic, i as defineGetDotenvConfig, d as definePlugin, g as getDotenvCliOptions2Options, j as interpolateDeep, r as readMergedOptions } from './chunks/readMergedOptions-D6niy_Ep.mjs';
|
|
4
4
|
export { d as buildSpawnEnv, s as shouldCapture, t as tokenize } from './chunks/spawnEnv-5kdIVv0x.mjs';
|
|
5
|
-
export { d as defineScripts, g as groupPlugins } from './chunks/types-
|
|
5
|
+
export { d as defineScripts, g as groupPlugins } from './chunks/types-Bp3u5-IH.mjs';
|
|
6
6
|
import { omit, pick } from 'radash';
|
|
7
7
|
import { Buffer } from 'node:buffer';
|
|
8
8
|
export { l as loadModuleDefault } from './chunks/loadModuleDefault-Dj8B3Stt.mjs';
|
|
9
9
|
import { InvalidArgumentError } from '@commander-js/extra-typings';
|
|
10
|
-
|
|
10
|
+
import 'zod';
|
|
11
11
|
import { nanoid } from 'nanoid';
|
|
12
12
|
import path$1 from 'path';
|
|
13
|
-
import { r as redactObject, m as maybeWarnEntropy } from './chunks/index-
|
|
14
|
-
export { a as redactDisplay, t as traceChildEnv } from './chunks/index-
|
|
13
|
+
import { r as redactObject, m as maybeWarnEntropy } from './chunks/index-CAtxK29A.mjs';
|
|
14
|
+
export { a as redactDisplay, t as traceChildEnv } from './chunks/index-CAtxK29A.mjs';
|
|
15
15
|
import { g as readDotenv, d as dotenvExpandAll, a as applyDynamicMap, c as loadAndApplyDynamic } from './chunks/readDotenvCascade-HLU7FsEQ.mjs';
|
|
16
16
|
export { h as dotenvExpand, f as dotenvExpandFromProcessEnv } from './chunks/readDotenvCascade-HLU7FsEQ.mjs';
|
|
17
17
|
import fs from 'fs-extra';
|
|
@@ -24,10 +24,10 @@ import 'package-directory';
|
|
|
24
24
|
import 'yaml';
|
|
25
25
|
import 'execa';
|
|
26
26
|
import './chunks/helpConfig-CGejgwWW.mjs';
|
|
27
|
-
import './chunks/resolveCliOptions-
|
|
27
|
+
import './chunks/resolveCliOptions-PWF1aEM9.mjs';
|
|
28
28
|
import './chunks/validate-CDl0rE6k.mjs';
|
|
29
29
|
import './plugins-aws.mjs';
|
|
30
|
-
import './chunks/index-
|
|
30
|
+
import './chunks/index-AssUn9IY.mjs';
|
|
31
31
|
import 'buffer';
|
|
32
32
|
import 'os';
|
|
33
33
|
import 'node:fs/promises';
|
|
@@ -834,7 +834,6 @@ const silentLogger = {
|
|
|
834
834
|
info: () => { },
|
|
835
835
|
warn: () => { },
|
|
836
836
|
error: () => { },
|
|
837
|
-
log: () => { },
|
|
838
837
|
};
|
|
839
838
|
|
|
840
839
|
/**
|
|
@@ -891,7 +890,7 @@ const parseNonNegativeInt = (label) => (raw) => {
|
|
|
891
890
|
|
|
892
891
|
async function getDotenv(options = {}) {
|
|
893
892
|
// Apply defaults.
|
|
894
|
-
const { defaultEnv, dotenvToken = '.env', dynamicPath, env, excludeDynamic = false, excludeEnv = false, excludeGlobal = false, excludePrivate = false, excludePublic = false, loadProcess = false, log = false, logger
|
|
893
|
+
const { defaultEnv, dotenvToken = '.env', dynamicPath, env, excludeDynamic = false, excludeEnv = false, excludeGlobal = false, excludePrivate = false, excludePublic = false, loadProcess = false, log = false, logger, outputPath, paths = [], privateToken = 'local', vars = {}, } = await resolveGetDotenvOptions(options);
|
|
895
894
|
// Read .env files.
|
|
896
895
|
const loaded = paths.length
|
|
897
896
|
? await paths.reduce(async (e, p) => {
|
|
@@ -968,7 +967,7 @@ async function getDotenv(options = {}) {
|
|
|
968
967
|
const bag = redactFlag
|
|
969
968
|
? redactObject(resultDotenv, redOpts)
|
|
970
969
|
: { ...resultDotenv };
|
|
971
|
-
logger.
|
|
970
|
+
logger.info(bag);
|
|
972
971
|
// Entropy warnings: once-per-key-per-run (presentation only)
|
|
973
972
|
const warnEntropyVal = options.warnEntropy ?? true;
|
|
974
973
|
const entropyThresholdVal = options
|
|
@@ -987,7 +986,7 @@ async function getDotenv(options = {}) {
|
|
|
987
986
|
entOpts.entropyWhitelist = entropyWhitelistVal;
|
|
988
987
|
for (const [k, v] of Object.entries(resultDotenv)) {
|
|
989
988
|
maybeWarnEntropy(k, v, v !== undefined ? 'dotenv' : 'unset', entOpts, (line) => {
|
|
990
|
-
logger.
|
|
989
|
+
logger.info(line);
|
|
991
990
|
});
|
|
992
991
|
}
|
|
993
992
|
}
|
package/dist/plugins-aws.d.ts
CHANGED
|
@@ -273,9 +273,11 @@ type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => s
|
|
|
273
273
|
*/
|
|
274
274
|
type GetDotenvDynamic = Record<string, GetDotenvDynamicFunction | ReturnType<GetDotenvDynamicFunction>>;
|
|
275
275
|
/**
|
|
276
|
-
* Logger interface compatible with `
|
|
276
|
+
* Logger interface compatible with AWS SDK v3 expectations (`debug`, `info`, `warn`, `error`).
|
|
277
|
+
* Consumers must provide an object that implements these four methods.
|
|
278
|
+
* Additional methods (like `log`) are allowed but not required or used by this library.
|
|
277
279
|
*/
|
|
278
|
-
type Logger =
|
|
280
|
+
type Logger = Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
279
281
|
/**
|
|
280
282
|
* Canonical programmatic options type (schema-derived).
|
|
281
283
|
* This type is the single source of truth for programmatic options.
|
package/dist/plugins-aws.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as readMergedOptions, d as definePlugin } from './chunks/readMergedOptions-
|
|
1
|
+
import { r as readMergedOptions, d as definePlugin } from './chunks/readMergedOptions-D6niy_Ep.mjs';
|
|
2
2
|
import 'execa';
|
|
3
3
|
import { isObject } from 'radash';
|
|
4
4
|
import 'node:buffer';
|
package/dist/plugins-batch.d.ts
CHANGED
|
@@ -273,9 +273,11 @@ type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => s
|
|
|
273
273
|
*/
|
|
274
274
|
type GetDotenvDynamic = Record<string, GetDotenvDynamicFunction | ReturnType<GetDotenvDynamicFunction>>;
|
|
275
275
|
/**
|
|
276
|
-
* Logger interface compatible with `
|
|
276
|
+
* Logger interface compatible with AWS SDK v3 expectations (`debug`, `info`, `warn`, `error`).
|
|
277
|
+
* Consumers must provide an object that implements these four methods.
|
|
278
|
+
* Additional methods (like `log`) are allowed but not required or used by this library.
|
|
277
279
|
*/
|
|
278
|
-
type Logger =
|
|
280
|
+
type Logger = Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
279
281
|
/**
|
|
280
282
|
* Canonical programmatic options type (schema-derived).
|
|
281
283
|
* This type is the single source of truth for programmatic options.
|
package/dist/plugins-batch.mjs
CHANGED
package/dist/plugins-cmd.d.ts
CHANGED
|
@@ -273,9 +273,11 @@ type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => s
|
|
|
273
273
|
*/
|
|
274
274
|
type GetDotenvDynamic = Record<string, GetDotenvDynamicFunction | ReturnType<GetDotenvDynamicFunction>>;
|
|
275
275
|
/**
|
|
276
|
-
* Logger interface compatible with `
|
|
276
|
+
* Logger interface compatible with AWS SDK v3 expectations (`debug`, `info`, `warn`, `error`).
|
|
277
|
+
* Consumers must provide an object that implements these four methods.
|
|
278
|
+
* Additional methods (like `log`) are allowed but not required or used by this library.
|
|
277
279
|
*/
|
|
278
|
-
type Logger =
|
|
280
|
+
type Logger = Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
279
281
|
/**
|
|
280
282
|
* Canonical programmatic options type (schema-derived).
|
|
281
283
|
* This type is the single source of truth for programmatic options.
|
package/dist/plugins-cmd.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'radash';
|
|
2
|
-
import './chunks/readMergedOptions-
|
|
2
|
+
import './chunks/readMergedOptions-D6niy_Ep.mjs';
|
|
3
3
|
import 'execa';
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
import 'fs-extra';
|
|
@@ -14,9 +14,9 @@ import './chunks/loader-CE4HSRN4.mjs';
|
|
|
14
14
|
import 'package-directory';
|
|
15
15
|
import 'yaml';
|
|
16
16
|
import 'zod';
|
|
17
|
-
export { c as cmdPlugin } from './chunks/index-
|
|
17
|
+
export { c as cmdPlugin } from './chunks/index-CAtxK29A.mjs';
|
|
18
18
|
import './chunks/readDotenvCascade-HLU7FsEQ.mjs';
|
|
19
19
|
import './chunks/loadModuleDefault-Dj8B3Stt.mjs';
|
|
20
20
|
import './chunks/spawnEnv-5kdIVv0x.mjs';
|
|
21
21
|
import './chunks/invoke-DuRPU1oC.mjs';
|
|
22
|
-
import './chunks/resolveCliOptions-
|
|
22
|
+
import './chunks/resolveCliOptions-PWF1aEM9.mjs';
|
package/dist/plugins-init.d.ts
CHANGED
|
@@ -273,9 +273,11 @@ type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => s
|
|
|
273
273
|
*/
|
|
274
274
|
type GetDotenvDynamic = Record<string, GetDotenvDynamicFunction | ReturnType<GetDotenvDynamicFunction>>;
|
|
275
275
|
/**
|
|
276
|
-
* Logger interface compatible with `
|
|
276
|
+
* Logger interface compatible with AWS SDK v3 expectations (`debug`, `info`, `warn`, `error`).
|
|
277
|
+
* Consumers must provide an object that implements these four methods.
|
|
278
|
+
* Additional methods (like `log`) are allowed but not required or used by this library.
|
|
277
279
|
*/
|
|
278
|
-
type Logger =
|
|
280
|
+
type Logger = Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
279
281
|
/**
|
|
280
282
|
* Canonical programmatic options type (schema-derived).
|
|
281
283
|
* This type is the single source of truth for programmatic options.
|
package/dist/plugins-init.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as readMergedOptions, d as definePlugin } from './chunks/readMergedOptions-
|
|
1
|
+
import { r as readMergedOptions, d as definePlugin } from './chunks/readMergedOptions-D6niy_Ep.mjs';
|
|
2
2
|
import 'execa';
|
|
3
3
|
import 'radash';
|
|
4
4
|
import 'node:buffer';
|
|
@@ -229,14 +229,14 @@ const isNonInteractive = () => {
|
|
|
229
229
|
* @returns A single-character decision code.
|
|
230
230
|
*/
|
|
231
231
|
const promptDecision = async (filePath, logger, rl) => {
|
|
232
|
-
logger.
|
|
232
|
+
logger.info(`File exists: ${filePath}\nChoose: [o]verwrite, [e]xample, [s]kip, [O]verwrite All, [E]xample All, [S]kip All`);
|
|
233
233
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
234
234
|
while (true) {
|
|
235
235
|
const a = (await rl.question('> ')).trim();
|
|
236
236
|
const valid = ['o', 'e', 's', 'O', 'E', 'S'];
|
|
237
237
|
if (valid.includes(a))
|
|
238
238
|
return a;
|
|
239
|
-
logger.
|
|
239
|
+
logger.info('Please enter one of: o e s O E S');
|
|
240
240
|
}
|
|
241
241
|
};
|
|
242
242
|
|
|
@@ -289,18 +289,18 @@ function attachInitDefaultAction(cli) {
|
|
|
289
289
|
if (!exists) {
|
|
290
290
|
const subs = item.subs ?? {};
|
|
291
291
|
await copyTextFile(item.src, item.dest, subs);
|
|
292
|
-
logger.
|
|
292
|
+
logger.info(`Created ${path$1.relative(cwd, item.dest)}`);
|
|
293
293
|
continue;
|
|
294
294
|
}
|
|
295
295
|
// Collision
|
|
296
296
|
if (force) {
|
|
297
297
|
const subs = item.subs ?? {};
|
|
298
298
|
await copyTextFile(item.src, item.dest, subs);
|
|
299
|
-
logger.
|
|
299
|
+
logger.info(`Overwrote ${path$1.relative(cwd, item.dest)}`);
|
|
300
300
|
continue;
|
|
301
301
|
}
|
|
302
302
|
if (yes) {
|
|
303
|
-
logger.
|
|
303
|
+
logger.info(`Skipped ${path$1.relative(cwd, item.dest)}`);
|
|
304
304
|
continue;
|
|
305
305
|
}
|
|
306
306
|
let decision = globalDecision;
|
|
@@ -325,16 +325,16 @@ function attachInitDefaultAction(cli) {
|
|
|
325
325
|
if (decision === 'overwrite') {
|
|
326
326
|
const subs = item.subs ?? {};
|
|
327
327
|
await copyTextFile(item.src, item.dest, subs);
|
|
328
|
-
logger.
|
|
328
|
+
logger.info(`Overwrote ${path$1.relative(cwd, item.dest)}`);
|
|
329
329
|
}
|
|
330
330
|
else if (decision === 'example') {
|
|
331
331
|
const destEx = `${item.dest}.example`;
|
|
332
332
|
const subs = item.subs ?? {};
|
|
333
333
|
await copyTextFile(item.src, destEx, subs);
|
|
334
|
-
logger.
|
|
334
|
+
logger.info(`Wrote example ${path$1.relative(cwd, destEx)}`);
|
|
335
335
|
}
|
|
336
336
|
else {
|
|
337
|
-
logger.
|
|
337
|
+
logger.info(`Skipped ${path$1.relative(cwd, item.dest)}`);
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
// Ensure .gitignore includes local config patterns.
|
|
@@ -344,10 +344,10 @@ function attachInitDefaultAction(cli) {
|
|
|
344
344
|
'*.local',
|
|
345
345
|
]);
|
|
346
346
|
if (created) {
|
|
347
|
-
logger.
|
|
347
|
+
logger.info(`Created ${path$1.relative(cwd, giPath)}`);
|
|
348
348
|
}
|
|
349
349
|
else if (changed) {
|
|
350
|
-
logger.
|
|
350
|
+
logger.info(`Updated ${path$1.relative(cwd, giPath)}`);
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
finally {
|
package/dist/plugins.d.ts
CHANGED
|
@@ -273,9 +273,11 @@ type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => s
|
|
|
273
273
|
*/
|
|
274
274
|
type GetDotenvDynamic = Record<string, GetDotenvDynamicFunction | ReturnType<GetDotenvDynamicFunction>>;
|
|
275
275
|
/**
|
|
276
|
-
* Logger interface compatible with `
|
|
276
|
+
* Logger interface compatible with AWS SDK v3 expectations (`debug`, `info`, `warn`, `error`).
|
|
277
|
+
* Consumers must provide an object that implements these four methods.
|
|
278
|
+
* Additional methods (like `log`) are allowed but not required or used by this library.
|
|
277
279
|
*/
|
|
278
|
-
type Logger =
|
|
280
|
+
type Logger = Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
279
281
|
/**
|
|
280
282
|
* Canonical programmatic options type (schema-derived).
|
|
281
283
|
* This type is the single source of truth for programmatic options.
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { awsPlugin, getAwsRegion } from './plugins-aws.mjs';
|
|
2
|
-
export { a as awsWhoamiPlugin } from './chunks/index-
|
|
2
|
+
export { a as awsWhoamiPlugin } from './chunks/index-AssUn9IY.mjs';
|
|
3
3
|
export { batchPlugin } from './plugins-batch.mjs';
|
|
4
|
-
export { c as cmdPlugin } from './chunks/index-
|
|
4
|
+
export { c as cmdPlugin } from './chunks/index-CAtxK29A.mjs';
|
|
5
5
|
export { initPlugin } from './plugins-init.mjs';
|
|
6
|
-
import './chunks/readMergedOptions-
|
|
6
|
+
import './chunks/readMergedOptions-D6niy_Ep.mjs';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import '@commander-js/extra-typings';
|
|
9
9
|
import './chunks/readDotenvCascade-HLU7FsEQ.mjs';
|
|
@@ -32,7 +32,7 @@ import 'process';
|
|
|
32
32
|
import 'node:fs';
|
|
33
33
|
import './chunks/invoke-DuRPU1oC.mjs';
|
|
34
34
|
import 'globby';
|
|
35
|
-
import './chunks/resolveCliOptions-
|
|
35
|
+
import './chunks/resolveCliOptions-PWF1aEM9.mjs';
|
|
36
36
|
import 'node:process';
|
|
37
37
|
import 'readline/promises';
|
|
38
38
|
import 'node:url';
|
package/package.json
CHANGED
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"commander": "^14.0.2",
|
|
18
18
|
"dotenv": "^17.2.3",
|
|
19
19
|
"execa": "^9.6.1",
|
|
20
|
-
"fs-extra": "^11.3.
|
|
20
|
+
"fs-extra": "^11.3.3",
|
|
21
21
|
"globby": "^16",
|
|
22
22
|
"nanoid": "^5.1.6",
|
|
23
23
|
"package-directory": "^8.1.0",
|
|
24
24
|
"radash": "^12.1.1",
|
|
25
25
|
"yaml": "^2.8.2",
|
|
26
|
-
"zod": "^4.
|
|
26
|
+
"zod": "^4.3.5"
|
|
27
27
|
},
|
|
28
28
|
"description": "Process dotenv files in an arbitrary location & optionally populate environment variables.",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@aws-sdk/client-sts": "^3.
|
|
31
|
-
"@dotenvx/dotenvx": "^1.51.
|
|
30
|
+
"@aws-sdk/client-sts": "^3.965.0",
|
|
31
|
+
"@dotenvx/dotenvx": "^1.51.4",
|
|
32
32
|
"@eslint/js": "^9.39.2",
|
|
33
33
|
"@rollup/plugin-alias": "^6.0.0",
|
|
34
34
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -37,27 +37,27 @@
|
|
|
37
37
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
38
38
|
"@types/fs-extra": "^11.0.4",
|
|
39
39
|
"@types/node": "^25",
|
|
40
|
-
"@vitest/coverage-v8": "^4.0.
|
|
41
|
-
"@vitest/eslint-plugin": "^1.
|
|
40
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
41
|
+
"@vitest/eslint-plugin": "^1.6.6",
|
|
42
42
|
"auto-changelog": "^2.5.0",
|
|
43
43
|
"cross-env": "^10.1.0",
|
|
44
|
-
"esbuild": "^0.27.
|
|
44
|
+
"esbuild": "^0.27.2",
|
|
45
45
|
"eslint": "^9.39.2",
|
|
46
46
|
"eslint-config-prettier": "^10.1.8",
|
|
47
47
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
48
48
|
"eslint-plugin-prettier": "^5.5.4",
|
|
49
49
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
50
50
|
"eslint-plugin-tsdoc": "^0.5.0",
|
|
51
|
-
"fs-extra": "^11.3.
|
|
52
|
-
"globals": "^
|
|
51
|
+
"fs-extra": "^11.3.3",
|
|
52
|
+
"globals": "^17.0.0",
|
|
53
53
|
"jsonc-eslint-parser": "^2.4.2",
|
|
54
|
-
"knip": "^5.
|
|
55
|
-
"lefthook": "^2.0.
|
|
54
|
+
"knip": "^5.80.0",
|
|
55
|
+
"lefthook": "^2.0.13",
|
|
56
56
|
"npm-packlist": "^10.0.3",
|
|
57
57
|
"prettier": "^3.7.4",
|
|
58
|
-
"release-it": "^19.
|
|
58
|
+
"release-it": "^19.2.3",
|
|
59
59
|
"rimraf": "^6.1.2",
|
|
60
|
-
"rollup": "^4.
|
|
60
|
+
"rollup": "^4.55.1",
|
|
61
61
|
"rollup-plugin-dts": "^6.3.0",
|
|
62
62
|
"tslib": "^2.8.1",
|
|
63
63
|
"tsx": "^4.21.0",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"typedoc-plugin-mdn-links": "^5.0.10",
|
|
66
66
|
"typedoc-plugin-replace-text": "^4.2.0",
|
|
67
67
|
"typescript": "^5.9.3",
|
|
68
|
-
"typescript-eslint": "^8.
|
|
69
|
-
"vite-tsconfig-paths": "^
|
|
70
|
-
"vitest": "^4.0.
|
|
68
|
+
"typescript-eslint": "^8.52.0",
|
|
69
|
+
"vite-tsconfig-paths": "^6.0.3",
|
|
70
|
+
"vitest": "^4.0.16"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
73
|
"node": ">=20"
|
|
@@ -221,5 +221,5 @@
|
|
|
221
221
|
},
|
|
222
222
|
"type": "module",
|
|
223
223
|
"types": "dist/index.d.ts",
|
|
224
|
-
"version": "
|
|
224
|
+
"version": "7.0.0"
|
|
225
225
|
}
|