@karmaniverous/get-dotenv 7.0.7 → 7.0.8
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/{createCli-DRgcaM2D.mjs → createCli-CUPiFVdZ.mjs} +24 -9
- package/dist/chunks/index-CNXekCQC.mjs +96 -0
- package/dist/chunks/{index-BzoCat8h.mjs → index-DnG3N6yj.mjs} +6 -6
- package/dist/chunks/{loader-V1vbmtyw.mjs → loader-C3DtD6HB.mjs} +4 -2
- package/dist/chunks/{readDotenvCascade-Dgx4SC1p.mjs → readDotenvCascade-CfFPgLCp.mjs} +52 -21
- package/dist/chunks/{readMergedOptions-x80ltQO_.mjs → readMergedOptions-BT1C87_u.mjs} +41 -14
- package/dist/chunks/{resolveCliOptions-CR-BEUmS.mjs → resolveCliOptions-BbfouWSK.mjs} +1 -1
- package/dist/chunks/{spawnEnv-CKgnHGpr.mjs → spawnEnv-DvisqPiU.mjs} +28 -3
- package/dist/chunks/{types-poB1VAs_.mjs → types-BkQxnyZK.mjs} +1 -1
- package/dist/cli.d.ts +9 -5
- package/dist/cli.mjs +11 -15
- package/dist/cliHost.d.ts +9 -5
- package/dist/cliHost.mjs +6 -6
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/env-overlay.d.ts +13 -9
- package/dist/env-overlay.mjs +2 -2
- package/dist/getdotenv.cli.mjs +11 -15
- package/dist/index.d.ts +10 -6
- package/dist/index.mjs +31 -23
- package/dist/plugins-aws.d.ts +1 -1
- package/dist/plugins-aws.mjs +4 -4
- package/dist/plugins-batch.d.ts +17 -1
- package/dist/plugins-batch.mjs +202 -68
- package/dist/plugins-cmd.d.ts +1 -1
- package/dist/plugins-cmd.mjs +6 -6
- package/dist/plugins-init.d.ts +1 -1
- package/dist/plugins-init.mjs +3 -3
- package/dist/plugins.d.ts +3 -1
- package/dist/plugins.mjs +10 -14
- package/package.json +40 -40
- package/schema/getdotenv.config.schema.json +207 -0
- package/dist/chunks/AwsRestJsonProtocol-BWWvLZiw.mjs +0 -1026
- package/dist/chunks/externalDataInterceptor-Bbvq4sdd.mjs +0 -19
- package/dist/chunks/getSSOTokenFromFile-ClTzvS3i.mjs +0 -22
- package/dist/chunks/index-4kbkrHS9.mjs +0 -12529
- package/dist/chunks/index-B5GwHCSX.mjs +0 -669
- package/dist/chunks/index-Cl6wXPYD.mjs +0 -82
- package/dist/chunks/index-D7Lv-lxm.mjs +0 -349
- package/dist/chunks/index-DFNP_Nrx.mjs +0 -188
- package/dist/chunks/index-DO68RbZ8.mjs +0 -103
- package/dist/chunks/index-Db08BBL5.mjs +0 -519
- package/dist/chunks/index-De2jIOhi.mjs +0 -541
- package/dist/chunks/index-IOQ1o3w3.mjs +0 -290
- package/dist/chunks/index-Tm4WDj9R.mjs +0 -383
- package/dist/chunks/index-fNrNPp4e.mjs +0 -946
- package/dist/chunks/index-w8gK2SKP.mjs +0 -31
- package/dist/chunks/loadSso-Ce3ChPPj.mjs +0 -488
- package/dist/chunks/package-DbbYaehr.mjs +0 -5
- package/dist/chunks/parseKnownFiles-BCL0L7aP.mjs +0 -23
- package/dist/chunks/sdk-stream-mixin-B_ajKWho.mjs +0 -307
package/dist/cliHost.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { G as GetDotenvCli,
|
|
2
|
-
export { b as buildSpawnEnv, r as resolveCommand, a as resolveShell, c as runCommand, d as runCommandResult, s as shouldCapture } from './chunks/spawnEnv-
|
|
3
|
-
export { b as baseGetDotenvCliOptions, r as resolveCliOptions } from './chunks/resolveCliOptions-
|
|
4
|
-
export { d as defineScripts, g as groupPlugins } from './chunks/types-
|
|
1
|
+
export { G as GetDotenvCli, d as definePlugin, r as readMergedOptions } from './chunks/readMergedOptions-BT1C87_u.mjs';
|
|
2
|
+
export { b as buildSpawnEnv, r as resolveCommand, a as resolveShell, c as runCommand, d as runCommandResult, s as shouldCapture } from './chunks/spawnEnv-DvisqPiU.mjs';
|
|
3
|
+
export { b as baseGetDotenvCliOptions, r as resolveCliOptions } from './chunks/resolveCliOptions-BbfouWSK.mjs';
|
|
4
|
+
export { d as defineScripts, g as groupPlugins } from './chunks/types-BkQxnyZK.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';
|
|
8
8
|
import '@commander-js/extra-typings';
|
|
9
|
-
import './chunks/readDotenvCascade-
|
|
9
|
+
import './chunks/readDotenvCascade-CfFPgLCp.mjs';
|
|
10
10
|
import 'fs-extra';
|
|
11
11
|
import 'radash';
|
|
12
12
|
import 'node:buffer';
|
|
@@ -17,7 +17,7 @@ import 'path';
|
|
|
17
17
|
import 'url';
|
|
18
18
|
import 'dotenv';
|
|
19
19
|
import 'nanoid';
|
|
20
|
-
import './chunks/loader-
|
|
20
|
+
import './chunks/loader-C3DtD6HB.mjs';
|
|
21
21
|
import 'package-directory';
|
|
22
22
|
import 'yaml';
|
|
23
23
|
import 'execa';
|
package/dist/config.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ interface RootOptionsShape {
|
|
|
69
69
|
*/
|
|
70
70
|
trace?: boolean | string[];
|
|
71
71
|
/** Paths to search for dotenv files (space-delimited string or array). */
|
|
72
|
-
paths?: string;
|
|
72
|
+
paths?: string | string[];
|
|
73
73
|
/** Delimiter for paths string (default: space). */
|
|
74
74
|
pathsDelimiter?: string;
|
|
75
75
|
/** Regex pattern for paths delimiter. */
|
package/dist/config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as discoverConfigFiles, l as loadConfigFile, r as resolveGetDotenvConfigSources, t as toFileUrl } from './chunks/loader-
|
|
1
|
+
export { d as discoverConfigFiles, l as loadConfigFile, r as resolveGetDotenvConfigSources, t as toFileUrl } from './chunks/loader-C3DtD6HB.mjs';
|
|
2
2
|
export { v as validateEnvAgainstSources } from './chunks/validate-CDl0rE6k.mjs';
|
|
3
3
|
import 'fs-extra';
|
|
4
4
|
import 'package-directory';
|
package/dist/env-overlay.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ interface RootOptionsShape {
|
|
|
69
69
|
*/
|
|
70
70
|
trace?: boolean | string[];
|
|
71
71
|
/** Paths to search for dotenv files (space-delimited string or array). */
|
|
72
|
-
paths?: string;
|
|
72
|
+
paths?: string | string[];
|
|
73
73
|
/** Delimiter for paths string (default: space). */
|
|
74
74
|
pathsDelimiter?: string;
|
|
75
75
|
/** Regex pattern for paths delimiter. */
|
|
@@ -165,7 +165,7 @@ type ProcessEnv = Record<string, string | undefined>;
|
|
|
165
165
|
* and the selected environment (if any), and returns either a string to set
|
|
166
166
|
* or `undefined` to unset/skip the variable.
|
|
167
167
|
*/
|
|
168
|
-
type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => string | undefined;
|
|
168
|
+
type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => string | null | undefined;
|
|
169
169
|
/**
|
|
170
170
|
* A map of dynamic variable definitions.
|
|
171
171
|
* Keys are variable names; values are either literal strings or functions.
|
|
@@ -318,15 +318,17 @@ declare function pushDotenvProvenance(prov: DotenvProvenance, key: string, entry
|
|
|
318
318
|
|
|
319
319
|
/**
|
|
320
320
|
* Apply a dynamic map to the target progressively.
|
|
321
|
-
* - Functions receive (target, env) and may return string | undefined.
|
|
322
|
-
* -
|
|
321
|
+
* - Functions receive (target, env) and may return string | null | undefined.
|
|
322
|
+
* - string → set the key to that value.
|
|
323
|
+
* - undefined → no-op, leave existing value unchanged.
|
|
324
|
+
* - null → delete the key from the target.
|
|
323
325
|
*
|
|
324
326
|
* @param target - Mutable target environment to assign into.
|
|
325
327
|
* @param map - Dynamic map to apply (functions and/or literal values).
|
|
326
328
|
* @param env - Selected environment name (if any) passed through to dynamic functions.
|
|
327
|
-
* @returns
|
|
329
|
+
* @returns Set of keys that were deleted (value was null).
|
|
328
330
|
*/
|
|
329
|
-
declare function applyDynamicMap(target: ProcessEnv, map?: GetDotenvDynamic, env?: string):
|
|
331
|
+
declare function applyDynamicMap(target: ProcessEnv, map?: GetDotenvDynamic, env?: string): Set<string>;
|
|
330
332
|
/**
|
|
331
333
|
* Load a default-export dynamic map from a JS/TS file (without applying it).
|
|
332
334
|
*
|
|
@@ -357,12 +359,14 @@ declare function loadDynamicModuleDefault(absPath: string, cacheDirName: string)
|
|
|
357
359
|
* @param prov - Provenance map to append into.
|
|
358
360
|
* @param meta - Dynamic provenance metadata (source tier and optional dynamicPath).
|
|
359
361
|
*
|
|
362
|
+
* @returns Set of keys that were deleted (value was null).
|
|
363
|
+
*
|
|
360
364
|
* @public
|
|
361
365
|
*/
|
|
362
366
|
declare function applyDynamicMapWithProvenance(target: ProcessEnv, map: GetDotenvDynamic | undefined, env: string | undefined, prov: DotenvProvenance, meta: {
|
|
363
367
|
dynamicSource: DotenvDynamicSource;
|
|
364
368
|
dynamicPath?: string;
|
|
365
|
-
}):
|
|
369
|
+
}): Set<string>;
|
|
366
370
|
/**
|
|
367
371
|
* Load a default-export dynamic map from a JS/TS file and apply it.
|
|
368
372
|
* Uses util/loadModuleDefault for robust TS handling (direct import, esbuild,
|
|
@@ -376,9 +380,9 @@ declare function applyDynamicMapWithProvenance(target: ProcessEnv, map: GetDoten
|
|
|
376
380
|
* @param absPath - Absolute path to the dynamic module file.
|
|
377
381
|
* @param env - Selected environment name (if any).
|
|
378
382
|
* @param cacheDirName - Cache subdirectory under `.tsbuild/` for compiled artifacts.
|
|
379
|
-
* @returns A `Promise\<
|
|
383
|
+
* @returns A `Promise\<Set\<string\>\>` resolving to the set of deleted keys.
|
|
380
384
|
*/
|
|
381
|
-
declare function loadAndApplyDynamic(target: ProcessEnv, absPath: string, env: string | undefined, cacheDirName: string): Promise<
|
|
385
|
+
declare function loadAndApplyDynamic(target: ProcessEnv, absPath: string, env: string | undefined, cacheDirName: string): Promise<Set<string>>;
|
|
382
386
|
|
|
383
387
|
/**
|
|
384
388
|
* Configuration sources for environment overlay.
|
package/dist/env-overlay.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { a as applyDynamicMap, b as applyDynamicMapWithProvenance, c as createDotenvProvenance, l as loadAndApplyDynamic,
|
|
1
|
+
import { d as dotenvExpandAll } from './chunks/readDotenvCascade-CfFPgLCp.mjs';
|
|
2
|
+
export { a as applyDynamicMap, b as applyDynamicMapWithProvenance, c as createDotenvProvenance, l as loadAndApplyDynamic, e as loadDynamicModuleDefault, o as overlayEnvWithProvenance, p as pushDotenvProvenance, r as readDotenvCascadeWithProvenance } from './chunks/readDotenvCascade-CfFPgLCp.mjs';
|
|
3
3
|
import 'fs-extra';
|
|
4
4
|
import 'node:path';
|
|
5
5
|
import 'radash';
|
package/dist/getdotenv.cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as createCli } from './chunks/createCli-
|
|
2
|
+
import { c as createCli } from './chunks/createCli-CUPiFVdZ.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import 'path';
|
|
5
|
-
import './chunks/loader-
|
|
5
|
+
import './chunks/loader-C3DtD6HB.mjs';
|
|
6
6
|
import 'fs-extra';
|
|
7
7
|
import 'package-directory';
|
|
8
8
|
import 'url';
|
|
@@ -14,28 +14,24 @@ import './chunks/loadModuleDefault-Dj8B3Stt.mjs';
|
|
|
14
14
|
import 'crypto';
|
|
15
15
|
import '@commander-js/extra-typings';
|
|
16
16
|
import 'nanoid';
|
|
17
|
-
import './chunks/readMergedOptions-
|
|
18
|
-
import './chunks/readDotenvCascade-
|
|
17
|
+
import './chunks/readMergedOptions-BT1C87_u.mjs';
|
|
18
|
+
import './chunks/readDotenvCascade-CfFPgLCp.mjs';
|
|
19
19
|
import 'dotenv';
|
|
20
20
|
import 'execa';
|
|
21
21
|
import './chunks/helpConfig-CGejgwWW.mjs';
|
|
22
|
-
import './chunks/resolveCliOptions-
|
|
22
|
+
import './chunks/resolveCliOptions-BbfouWSK.mjs';
|
|
23
23
|
import './chunks/validate-CDl0rE6k.mjs';
|
|
24
24
|
import './plugins-aws.mjs';
|
|
25
|
-
import './chunks/spawnEnv-
|
|
26
|
-
import './chunks/index-
|
|
27
|
-
import '
|
|
28
|
-
import 'node:fs/promises';
|
|
29
|
-
import 'node:stream';
|
|
30
|
-
import 'node:crypto';
|
|
31
|
-
import 'node:fs';
|
|
32
|
-
import 'node:https';
|
|
33
|
-
import 'node:process';
|
|
25
|
+
import './chunks/spawnEnv-DvisqPiU.mjs';
|
|
26
|
+
import './chunks/index-CNXekCQC.mjs';
|
|
27
|
+
import '@aws-sdk/client-sts';
|
|
34
28
|
import './plugins-batch.mjs';
|
|
35
29
|
import './chunks/invoke-DuRPU1oC.mjs';
|
|
36
30
|
import 'globby';
|
|
37
|
-
import '
|
|
31
|
+
import 'os';
|
|
32
|
+
import './chunks/index-DnG3N6yj.mjs';
|
|
38
33
|
import './plugins-init.mjs';
|
|
34
|
+
import 'node:process';
|
|
39
35
|
import 'readline/promises';
|
|
40
36
|
import 'node:url';
|
|
41
37
|
|
package/dist/index.d.ts
CHANGED
|
@@ -286,7 +286,7 @@ interface RootOptionsShape {
|
|
|
286
286
|
*/
|
|
287
287
|
trace?: boolean | string[];
|
|
288
288
|
/** Paths to search for dotenv files (space-delimited string or array). */
|
|
289
|
-
paths?: string;
|
|
289
|
+
paths?: string | string[];
|
|
290
290
|
/** Delimiter for paths string (default: space). */
|
|
291
291
|
pathsDelimiter?: string;
|
|
292
292
|
/** Regex pattern for paths delimiter. */
|
|
@@ -398,7 +398,7 @@ type RootOptionsShapeCompat = Omit<RootOptionsShape, 'vars' | 'paths'> & {
|
|
|
398
398
|
* and the selected environment (if any), and returns either a string to set
|
|
399
399
|
* or `undefined` to unset/skip the variable.
|
|
400
400
|
*/
|
|
401
|
-
type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => string | undefined;
|
|
401
|
+
type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => string | null | undefined;
|
|
402
402
|
/**
|
|
403
403
|
* A map of dynamic variable definitions.
|
|
404
404
|
* Keys are variable names; values are either literal strings or functions.
|
|
@@ -433,7 +433,7 @@ type GetDotenvOptions = Omit<z.output<typeof getDotenvOptionsSchemaResolved>, 'l
|
|
|
433
433
|
* Vars-aware dynamic helpers (compile-time DX).
|
|
434
434
|
* DynamicFn: receive the current expanded variables and optional env.
|
|
435
435
|
*/
|
|
436
|
-
type DynamicFn<Vars extends ProcessEnv> = (vars: Vars, env?: string) => string | undefined;
|
|
436
|
+
type DynamicFn<Vars extends ProcessEnv> = (vars: Vars, env?: string) => string | null | undefined;
|
|
437
437
|
/**
|
|
438
438
|
* Vars-aware dynamic map type used by {@link defineDynamic} and JS/TS configs.
|
|
439
439
|
*
|
|
@@ -952,10 +952,14 @@ declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions,
|
|
|
952
952
|
install(): Promise<void>;
|
|
953
953
|
/**
|
|
954
954
|
* Run afterResolve hooks for registered plugins (parent → children).
|
|
955
|
-
* When {@link
|
|
956
|
-
*
|
|
955
|
+
* When {@link commandPath} is provided, only the matching branch of the
|
|
956
|
+
* plugin tree runs; otherwise all plugins run (backward compatibility).
|
|
957
|
+
*
|
|
958
|
+
* The path is walked segment-by-segment against the plugin tree.
|
|
959
|
+
* Intermediate matches run their own afterResolve hook.
|
|
960
|
+
* The deepest match runs afterResolve for itself and all its descendants.
|
|
957
961
|
*/
|
|
958
|
-
|
|
962
|
+
_runAfterResolve(ctx: GetDotenvCliCtx<TOptions>, commandPath?: string[]): Promise<void>;
|
|
959
963
|
}
|
|
960
964
|
|
|
961
965
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { c as createCli } from './chunks/createCli-
|
|
2
|
-
import {
|
|
3
|
-
export { G as GetDotenvCli,
|
|
4
|
-
export { b as buildSpawnEnv, s as shouldCapture, t as tokenize } from './chunks/spawnEnv-
|
|
5
|
-
export { d as defineScripts, g as groupPlugins } from './chunks/types-
|
|
1
|
+
export { c as createCli } from './chunks/createCli-CUPiFVdZ.mjs';
|
|
2
|
+
import { e as resolveGetDotenvOptions, w as writeDotenvFile } from './chunks/readMergedOptions-BT1C87_u.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-BT1C87_u.mjs';
|
|
4
|
+
export { b as buildSpawnEnv, s as shouldCapture, t as tokenize } from './chunks/spawnEnv-DvisqPiU.mjs';
|
|
5
|
+
export { d as defineScripts, g as groupPlugins } from './chunks/types-BkQxnyZK.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';
|
|
@@ -10,35 +10,31 @@ 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 {
|
|
14
|
-
export {
|
|
15
|
-
import {
|
|
16
|
-
export {
|
|
13
|
+
import { r as redactObject, m as maybeWarnEntropy } from './chunks/index-DnG3N6yj.mjs';
|
|
14
|
+
export { a as redactDisplay, t as traceChildEnv } from './chunks/index-DnG3N6yj.mjs';
|
|
15
|
+
import { g as readDotenv, d as dotenvExpandAll, a as applyDynamicMap, l as loadAndApplyDynamic } from './chunks/readDotenvCascade-CfFPgLCp.mjs';
|
|
16
|
+
export { h as dotenvExpand, f as dotenvExpandFromProcessEnv } from './chunks/readDotenvCascade-CfFPgLCp.mjs';
|
|
17
17
|
import fs from 'fs-extra';
|
|
18
18
|
import path from 'node:path';
|
|
19
19
|
import 'crypto';
|
|
20
20
|
import 'url';
|
|
21
21
|
import 'dotenv';
|
|
22
|
-
import './chunks/loader-
|
|
22
|
+
import './chunks/loader-C3DtD6HB.mjs';
|
|
23
23
|
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-BbfouWSK.mjs';
|
|
28
28
|
import './chunks/validate-CDl0rE6k.mjs';
|
|
29
29
|
import './plugins-aws.mjs';
|
|
30
|
-
import './chunks/index-
|
|
31
|
-
import '
|
|
32
|
-
import 'node:fs/promises';
|
|
33
|
-
import 'node:stream';
|
|
34
|
-
import 'node:crypto';
|
|
35
|
-
import 'node:fs';
|
|
36
|
-
import 'node:https';
|
|
37
|
-
import 'node:process';
|
|
30
|
+
import './chunks/index-CNXekCQC.mjs';
|
|
31
|
+
import '@aws-sdk/client-sts';
|
|
38
32
|
import './plugins-batch.mjs';
|
|
39
33
|
import './chunks/invoke-DuRPU1oC.mjs';
|
|
40
34
|
import 'globby';
|
|
35
|
+
import 'os';
|
|
41
36
|
import './plugins-init.mjs';
|
|
37
|
+
import 'node:process';
|
|
42
38
|
import 'readline/promises';
|
|
43
39
|
import 'node:url';
|
|
44
40
|
|
|
@@ -927,11 +923,13 @@ async function getDotenv(options = {}) {
|
|
|
927
923
|
...(outputPath ? { [outputKey]: outputPath } : {}),
|
|
928
924
|
}, { progressive: true });
|
|
929
925
|
// Process dynamic variables. Programmatic option takes precedence over path.
|
|
926
|
+
const deletedKeys = new Set();
|
|
930
927
|
if (!excludeDynamic) {
|
|
931
928
|
// A2 precedence: programmatic dynamic < dynamicPath (dynamicPath wins when present)
|
|
932
929
|
if (options.dynamic && Object.keys(options.dynamic).length > 0) {
|
|
933
930
|
try {
|
|
934
|
-
applyDynamicMap(dotenv, options.dynamic, env ?? defaultEnv)
|
|
931
|
+
for (const k of applyDynamicMap(dotenv, options.dynamic, env ?? defaultEnv))
|
|
932
|
+
deletedKeys.add(k);
|
|
935
933
|
}
|
|
936
934
|
catch {
|
|
937
935
|
throw new Error(`Unable to evaluate dynamic variables.`);
|
|
@@ -940,7 +938,8 @@ async function getDotenv(options = {}) {
|
|
|
940
938
|
// dynamicPath is evaluated even when programmatic `dynamic` is present.
|
|
941
939
|
if (dynamicPath) {
|
|
942
940
|
const absDynamicPath = path$1.resolve(dynamicPath);
|
|
943
|
-
await loadAndApplyDynamic(dotenv, absDynamicPath, env ?? defaultEnv, 'getdotenv-dynamic')
|
|
941
|
+
for (const k of await loadAndApplyDynamic(dotenv, absDynamicPath, env ?? defaultEnv, 'getdotenv-dynamic'))
|
|
942
|
+
deletedKeys.add(k);
|
|
944
943
|
}
|
|
945
944
|
}
|
|
946
945
|
// Write output file.
|
|
@@ -989,8 +988,17 @@ async function getDotenv(options = {}) {
|
|
|
989
988
|
}
|
|
990
989
|
}
|
|
991
990
|
// Load process.env.
|
|
992
|
-
if (loadProcess)
|
|
993
|
-
|
|
991
|
+
if (loadProcess) {
|
|
992
|
+
for (const key of deletedKeys) {
|
|
993
|
+
Reflect.deleteProperty(process.env, key);
|
|
994
|
+
}
|
|
995
|
+
for (const [key, value] of Object.entries(resultDotenv)) {
|
|
996
|
+
if (value === undefined)
|
|
997
|
+
Reflect.deleteProperty(process.env, key);
|
|
998
|
+
else
|
|
999
|
+
process.env[key] = value;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
994
1002
|
return resultDotenv;
|
|
995
1003
|
}
|
|
996
1004
|
|
package/dist/plugins-aws.d.ts
CHANGED
|
@@ -272,7 +272,7 @@ type ProcessEnv = Record<string, string | undefined>;
|
|
|
272
272
|
* and the selected environment (if any), and returns either a string to set
|
|
273
273
|
* or `undefined` to unset/skip the variable.
|
|
274
274
|
*/
|
|
275
|
-
type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => string | undefined;
|
|
275
|
+
type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => string | null | undefined;
|
|
276
276
|
/**
|
|
277
277
|
* A map of dynamic variable definitions.
|
|
278
278
|
* Keys are variable names; values are either literal strings or functions.
|
package/dist/plugins-aws.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as readMergedOptions,
|
|
1
|
+
import { r as readMergedOptions, d as definePlugin } from './chunks/readMergedOptions-BT1C87_u.mjs';
|
|
2
2
|
import 'execa';
|
|
3
3
|
import { isObject } from 'radash';
|
|
4
4
|
import 'node:buffer';
|
|
@@ -10,12 +10,12 @@ import 'url';
|
|
|
10
10
|
import '@commander-js/extra-typings';
|
|
11
11
|
import 'nanoid';
|
|
12
12
|
import 'dotenv';
|
|
13
|
-
import './chunks/loader-
|
|
13
|
+
import './chunks/loader-C3DtD6HB.mjs';
|
|
14
14
|
import 'package-directory';
|
|
15
15
|
import 'yaml';
|
|
16
16
|
import { z } from 'zod';
|
|
17
|
-
import { c as runCommand, d as runCommandResult, s as shouldCapture, a as resolveShell, b as buildSpawnEnv } from './chunks/spawnEnv-
|
|
18
|
-
import './chunks/readDotenvCascade-
|
|
17
|
+
import { c as runCommand, d as runCommandResult, s as shouldCapture, a as resolveShell, b as buildSpawnEnv } from './chunks/spawnEnv-DvisqPiU.mjs';
|
|
18
|
+
import './chunks/readDotenvCascade-CfFPgLCp.mjs';
|
|
19
19
|
import './chunks/loadModuleDefault-Dj8B3Stt.mjs';
|
|
20
20
|
|
|
21
21
|
/**
|
package/dist/plugins-batch.d.ts
CHANGED
|
@@ -272,7 +272,7 @@ type ProcessEnv = Record<string, string | undefined>;
|
|
|
272
272
|
* and the selected environment (if any), and returns either a string to set
|
|
273
273
|
* or `undefined` to unset/skip the variable.
|
|
274
274
|
*/
|
|
275
|
-
type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => string | undefined;
|
|
275
|
+
type GetDotenvDynamicFunction = (vars: ProcessEnv, env: string | undefined) => string | null | undefined;
|
|
276
276
|
/**
|
|
277
277
|
* A map of dynamic variable definitions.
|
|
278
278
|
* Keys are variable names; values are either literal strings or functions.
|
|
@@ -561,6 +561,11 @@ interface ExecShellCommandBatchOptions {
|
|
|
561
561
|
* an array is treated as argv for shell‑off execution.
|
|
562
562
|
*/
|
|
563
563
|
command?: string | string[];
|
|
564
|
+
/**
|
|
565
|
+
* Maximum number of concurrent executions when {@link ExecShellCommandBatchOptions.parallel} is true.
|
|
566
|
+
* Defaults to {@link defaultConcurrency}.
|
|
567
|
+
*/
|
|
568
|
+
concurrency?: number;
|
|
564
569
|
/**
|
|
565
570
|
* Merged root CLI options bag (JSON‑serializable) forwarded for nested composition
|
|
566
571
|
* by downstream executors. Used to compute child overlays deterministically.
|
|
@@ -586,6 +591,11 @@ interface ExecShellCommandBatchOptions {
|
|
|
586
591
|
* Logger used for headings, listings, and diagnostics.
|
|
587
592
|
*/
|
|
588
593
|
logger: Logger;
|
|
594
|
+
/**
|
|
595
|
+
* When true, execute commands across discovered directories in parallel.
|
|
596
|
+
* Output is buffered per-directory and printed in discovery order.
|
|
597
|
+
*/
|
|
598
|
+
parallel?: boolean;
|
|
589
599
|
/**
|
|
590
600
|
* Resolve the batch root from the nearest package directory instead of CWD.
|
|
591
601
|
*/
|
|
@@ -608,12 +618,16 @@ interface ExecShellCommandBatchOptions {
|
|
|
608
618
|
interface BatchParentInvokerFlags {
|
|
609
619
|
/** Command to execute. */
|
|
610
620
|
command?: string;
|
|
621
|
+
/** Maximum concurrent executions in parallel mode. */
|
|
622
|
+
concurrency?: number;
|
|
611
623
|
/** Space-delimited glob patterns. */
|
|
612
624
|
globs?: string;
|
|
613
625
|
/** List directories without executing. */
|
|
614
626
|
list?: boolean;
|
|
615
627
|
/** Ignore errors and continue. */
|
|
616
628
|
ignoreErrors?: boolean;
|
|
629
|
+
/** Execute commands in parallel across directories. */
|
|
630
|
+
parallel?: boolean;
|
|
617
631
|
/** Use package directory as root. */
|
|
618
632
|
pkgCwd?: boolean;
|
|
619
633
|
/** Root path for discovery. */
|
|
@@ -636,6 +650,7 @@ interface BatchCmdSubcommandOptions {
|
|
|
636
650
|
* - scripts/shell: used to resolve command and shell behavior per script or global default.
|
|
637
651
|
*/
|
|
638
652
|
declare const batchPlugin: (opts?: BatchPluginOptions) => PluginWithInstanceHelpers<GetDotenvOptions, {
|
|
653
|
+
concurrency?: number | undefined;
|
|
639
654
|
scripts?: Record<string, string | {
|
|
640
655
|
cmd: string;
|
|
641
656
|
shell?: string | boolean | undefined;
|
|
@@ -643,6 +658,7 @@ declare const batchPlugin: (opts?: BatchPluginOptions) => PluginWithInstanceHelp
|
|
|
643
658
|
shell?: string | boolean | undefined;
|
|
644
659
|
rootPath?: string | undefined;
|
|
645
660
|
globs?: string | undefined;
|
|
661
|
+
parallel?: boolean | undefined;
|
|
646
662
|
pkgCwd?: boolean | undefined;
|
|
647
663
|
}, [], {}, {}>;
|
|
648
664
|
/**
|