@karmaniverous/get-dotenv 7.0.6 → 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.
Files changed (51) hide show
  1. package/dist/chunks/{createCli-BkHLeYXL.mjs → createCli-CUPiFVdZ.mjs} +27 -10
  2. package/dist/chunks/index-CNXekCQC.mjs +96 -0
  3. package/dist/chunks/{index-Dd6S1nZ-.mjs → index-DnG3N6yj.mjs} +6 -6
  4. package/dist/chunks/{loader-V1vbmtyw.mjs → loader-C3DtD6HB.mjs} +4 -2
  5. package/dist/chunks/{readDotenvCascade-Dgx4SC1p.mjs → readDotenvCascade-CfFPgLCp.mjs} +52 -21
  6. package/dist/chunks/{readMergedOptions-CraAnYdB.mjs → readMergedOptions-BT1C87_u.mjs} +53 -13
  7. package/dist/chunks/{resolveCliOptions-BMBkWDYJ.mjs → resolveCliOptions-BbfouWSK.mjs} +1 -1
  8. package/dist/chunks/{spawnEnv-CKgnHGpr.mjs → spawnEnv-DvisqPiU.mjs} +28 -3
  9. package/dist/chunks/{types-BthqmnDr.mjs → types-BkQxnyZK.mjs} +1 -1
  10. package/dist/cli.d.ts +29 -8
  11. package/dist/cli.mjs +11 -15
  12. package/dist/cliHost.d.ts +29 -8
  13. package/dist/cliHost.mjs +6 -6
  14. package/dist/config.d.ts +1 -1
  15. package/dist/config.mjs +1 -1
  16. package/dist/env-overlay.d.ts +13 -9
  17. package/dist/env-overlay.mjs +2 -2
  18. package/dist/getdotenv.cli.mjs +11 -15
  19. package/dist/index.d.ts +30 -9
  20. package/dist/index.mjs +31 -23
  21. package/dist/plugins-aws.d.ts +12 -1
  22. package/dist/plugins-aws.mjs +8 -7
  23. package/dist/plugins-batch.d.ts +28 -1
  24. package/dist/plugins-batch.mjs +202 -68
  25. package/dist/plugins-cmd.d.ts +12 -1
  26. package/dist/plugins-cmd.mjs +6 -6
  27. package/dist/plugins-init.d.ts +12 -1
  28. package/dist/plugins-init.mjs +3 -3
  29. package/dist/plugins.d.ts +14 -1
  30. package/dist/plugins.mjs +10 -14
  31. package/package.json +40 -40
  32. package/schema/getdotenv.config.schema.json +207 -0
  33. package/dist/chunks/AwsRestJsonProtocol-4m7HHwvS.mjs +0 -1026
  34. package/dist/chunks/externalDataInterceptor-DyDNbv-D.mjs +0 -19
  35. package/dist/chunks/getSSOTokenFromFile-CkYcEieD.mjs +0 -22
  36. package/dist/chunks/index-B35hOhgq.mjs +0 -669
  37. package/dist/chunks/index-B3fM_U6F.mjs +0 -349
  38. package/dist/chunks/index-B_yJRqty.mjs +0 -541
  39. package/dist/chunks/index-BuxEK_Z4.mjs +0 -12529
  40. package/dist/chunks/index-C58EanKv.mjs +0 -383
  41. package/dist/chunks/index-CjWZ4uNg.mjs +0 -103
  42. package/dist/chunks/index-CsI5JuIM.mjs +0 -188
  43. package/dist/chunks/index-D-a5vkZL.mjs +0 -82
  44. package/dist/chunks/index-D6iVe1wh.mjs +0 -946
  45. package/dist/chunks/index-Dl8qC51H.mjs +0 -290
  46. package/dist/chunks/index-FT37CtcF.mjs +0 -31
  47. package/dist/chunks/index-QkVZTs6l.mjs +0 -519
  48. package/dist/chunks/loadSso-DF7GLUZf.mjs +0 -488
  49. package/dist/chunks/package-DbbYaehr.mjs +0 -5
  50. package/dist/chunks/parseKnownFiles-BZNrX_JE.mjs +0 -23
  51. package/dist/chunks/sdk-stream-mixin-BL49AxZx.mjs +0 -307
package/dist/plugins.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.
@@ -358,6 +358,12 @@ interface ResolveAndLoadOptions {
358
358
  * @default true
359
359
  */
360
360
  runAfterResolve?: boolean;
361
+ /**
362
+ * Name of the invoked subcommand (plugin namespace). When provided,
363
+ * only the matching plugin subtree runs afterResolve hooks.
364
+ * When omitted, all plugins run afterResolve (backward compatibility).
365
+ */
366
+ invokedSubcommand?: string;
361
367
  }
362
368
  /**
363
369
  * Structural public interface for the host exposed to plugins.
@@ -451,6 +457,11 @@ interface GetDotenvCliPlugin<TOptions extends GetDotenvOptions = GetDotenvOption
451
457
  * After the dotenv context is resolved, initialize any clients/secrets
452
458
  * or attach per-plugin state under ctx.plugins (by convention).
453
459
  * Runs parent → children (pre-order).
460
+ *
461
+ * **Scoping**: When the host provides an invoked subcommand filter,
462
+ * afterResolve only fires for plugins whose namespace matches the
463
+ * invoked command path. A plugin's afterResolve should never produce
464
+ * side effects for commands outside its subtree.
454
465
  */
455
466
  afterResolve?: (cli: GetDotenvCliPublic<TOptions, TArgs, TOpts, TGlobal>, ctx: GetDotenvCliCtx<TOptions>) => void | Promise<void>;
456
467
  /** Zod schema for this plugin's config slice (from config.plugins[…]). */
@@ -559,6 +570,7 @@ interface BatchPluginOptions {
559
570
  * - scripts/shell: used to resolve command and shell behavior per script or global default.
560
571
  */
561
572
  declare const batchPlugin: (opts?: BatchPluginOptions) => PluginWithInstanceHelpers<GetDotenvOptions, {
573
+ concurrency?: number | undefined;
562
574
  scripts?: Record<string, string | {
563
575
  cmd: string;
564
576
  shell?: string | boolean | undefined;
@@ -566,6 +578,7 @@ declare const batchPlugin: (opts?: BatchPluginOptions) => PluginWithInstanceHelp
566
578
  shell?: string | boolean | undefined;
567
579
  rootPath?: string | undefined;
568
580
  globs?: string | undefined;
581
+ parallel?: boolean | undefined;
569
582
  pkgCwd?: boolean | undefined;
570
583
  }, [], {}, {}>;
571
584
 
package/dist/plugins.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  export { awsPlugin, getAwsRegion } from './plugins-aws.mjs';
2
- export { R as awsWhoamiPlugin } from './chunks/index-BuxEK_Z4.mjs';
2
+ export { a as awsWhoamiPlugin } from './chunks/index-CNXekCQC.mjs';
3
3
  export { batchPlugin } from './plugins-batch.mjs';
4
- export { c as cmdPlugin } from './chunks/index-Dd6S1nZ-.mjs';
4
+ export { c as cmdPlugin } from './chunks/index-DnG3N6yj.mjs';
5
5
  export { initPlugin } from './plugins-init.mjs';
6
- import './chunks/readMergedOptions-CraAnYdB.mjs';
6
+ import './chunks/readMergedOptions-BT1C87_u.mjs';
7
7
  import 'zod';
8
8
  import '@commander-js/extra-typings';
9
- import './chunks/readDotenvCascade-Dgx4SC1p.mjs';
9
+ import './chunks/readDotenvCascade-CfFPgLCp.mjs';
10
10
  import 'fs-extra';
11
11
  import 'radash';
12
12
  import 'node:buffer';
@@ -17,20 +17,16 @@ import 'path';
17
17
  import 'url';
18
18
  import 'dotenv';
19
19
  import 'nanoid';
20
- import './chunks/loader-V1vbmtyw.mjs';
20
+ import './chunks/loader-C3DtD6HB.mjs';
21
21
  import 'package-directory';
22
22
  import 'yaml';
23
23
  import 'execa';
24
- import './chunks/spawnEnv-CKgnHGpr.mjs';
25
- import 'node:os';
26
- import 'node:fs/promises';
27
- import 'node:stream';
28
- import 'node:crypto';
29
- import 'node:fs';
30
- import 'node:https';
31
- import 'node:process';
24
+ import './chunks/spawnEnv-DvisqPiU.mjs';
25
+ import '@aws-sdk/client-sts';
32
26
  import './chunks/invoke-DuRPU1oC.mjs';
33
27
  import 'globby';
34
- import './chunks/resolveCliOptions-BMBkWDYJ.mjs';
28
+ import 'os';
29
+ import './chunks/resolveCliOptions-BbfouWSK.mjs';
30
+ import 'node:process';
35
31
  import 'readline/promises';
36
32
  import 'node:url';
package/package.json CHANGED
@@ -1,11 +1,5 @@
1
1
  {
2
2
  "author": "Jason Williscroft",
3
- "auto-changelog": {
4
- "output": "CHANGELOG.md",
5
- "unreleased": true,
6
- "commitLimit": false,
7
- "hideCredit": true
8
- },
9
3
  "bin": {
10
4
  "getdotenv": "./dist/getdotenv.cli.mjs"
11
5
  },
@@ -15,59 +9,59 @@
15
9
  "dependencies": {
16
10
  "@commander-js/extra-typings": "^14.0.0",
17
11
  "commander": "^14.0.2",
18
- "dotenv": "^17.2.3",
12
+ "dotenv": "^17.4.2",
19
13
  "execa": "^9.6.1",
20
- "fs-extra": "^11.3.3",
14
+ "fs-extra": "^11.3.5",
21
15
  "globby": "^16",
22
- "nanoid": "^5.1.6",
23
- "package-directory": "^8.1.0",
16
+ "nanoid": "^5.1.11",
17
+ "package-directory": "^8.2.0",
24
18
  "radash": "^12.1.1",
25
- "yaml": "^2.8.2",
26
- "zod": "^4.3.5"
19
+ "yaml": "^2.9.0",
20
+ "zod": "^4.4.3"
27
21
  },
28
22
  "description": "Process dotenv files in an arbitrary location & optionally populate environment variables.",
29
23
  "devDependencies": {
30
- "@aws-sdk/client-sts": "^3.965.0",
31
- "@dotenvx/dotenvx": "^1.51.4",
32
- "@eslint/js": "^9.39.2",
24
+ "@aws-sdk/client-sts": "^3.1061.0",
25
+ "@dotenvx/dotenvx": "^1.71.0",
26
+ "@eslint/js": "^10.0.1",
33
27
  "@rollup/plugin-alias": "^6.0.0",
34
- "@rollup/plugin-commonjs": "^29.0.0",
28
+ "@rollup/plugin-commonjs": "^29.0.3",
35
29
  "@rollup/plugin-json": "^6.1.0",
36
30
  "@rollup/plugin-node-resolve": "^16.0.3",
37
31
  "@rollup/plugin-typescript": "^12.3.0",
38
32
  "@types/fs-extra": "^11.0.4",
39
33
  "@types/node": "^25",
40
- "@vitest/coverage-v8": "^4.0.16",
41
- "@vitest/eslint-plugin": "^1.6.6",
42
- "auto-changelog": "^2.5.0",
34
+ "@vitest/coverage-v8": "^4.1.8",
35
+ "@vitest/eslint-plugin": "^1.6.19",
43
36
  "cross-env": "^10.1.0",
44
37
  "esbuild": "^0.27.2",
45
- "eslint": "^9.39.2",
38
+ "eslint": "^10.4.1",
46
39
  "eslint-config-prettier": "^10.1.8",
47
40
  "eslint-plugin-jsonc": "^2.21.0",
48
- "eslint-plugin-prettier": "^5.5.4",
41
+ "eslint-plugin-prettier": "^5.5.6",
49
42
  "eslint-plugin-simple-import-sort": "^12.1.1",
50
- "eslint-plugin-tsdoc": "^0.5.0",
51
- "fs-extra": "^11.3.3",
52
- "globals": "^17.0.0",
43
+ "eslint-plugin-tsdoc": "^0.5.2",
44
+ "fs-extra": "^11.3.5",
45
+ "git-cliff": "^2.13.1",
46
+ "globals": "^17.6.0",
53
47
  "jsonc-eslint-parser": "^2.4.2",
54
48
  "knip": "^5.80.0",
55
- "lefthook": "^2.0.13",
49
+ "lefthook": "^2.1.9",
56
50
  "npm-packlist": "^10.0.3",
57
- "prettier": "^3.7.4",
51
+ "prettier": "^3.8.3",
58
52
  "release-it": "^19.2.3",
59
- "rimraf": "^6.1.2",
60
- "rollup": "^4.55.1",
61
- "rollup-plugin-dts": "^6.3.0",
53
+ "rimraf": "^6.1.3",
54
+ "rollup": "^4.61.1",
55
+ "rollup-plugin-dts": "^6.4.1",
62
56
  "tslib": "^2.8.1",
63
- "tsx": "^4.21.0",
64
- "typedoc": "^0.28.15",
65
- "typedoc-plugin-mdn-links": "^5.0.10",
57
+ "tsx": "^4.22.4",
58
+ "typedoc": "^0.28.19",
59
+ "typedoc-plugin-mdn-links": "^5.1.1",
66
60
  "typedoc-plugin-replace-text": "^4.2.0",
67
- "typescript": "^5.9.3",
68
- "typescript-eslint": "^8.52.0",
69
- "vite-tsconfig-paths": "^6.0.3",
70
- "vitest": "^4.0.16"
61
+ "typescript": "^6.0.3",
62
+ "typescript-eslint": "^8.60.1",
63
+ "vite-tsconfig-paths": "^6.1.1",
64
+ "vitest": "^4.1.8"
71
65
  },
72
66
  "engines": {
73
67
  "node": ">=20"
@@ -137,6 +131,7 @@
137
131
  "files": [
138
132
  "dist",
139
133
  "getdotenv.config.json",
134
+ "schema",
140
135
  "templates"
141
136
  ],
142
137
  "homepage": "https://github.com/karmaniverous/get-dotenv#readme",
@@ -156,9 +151,13 @@
156
151
  "main": "dist/index.mjs",
157
152
  "name": "@karmaniverous/get-dotenv",
158
153
  "peerDependencies": {
154
+ "@aws-sdk/client-sts": "^3.965.0",
159
155
  "esbuild": "*"
160
156
  },
161
157
  "peerDependenciesMeta": {
158
+ "@aws-sdk/client-sts": {
159
+ "optional": true
160
+ },
162
161
  "esbuild": {
163
162
  "optional": true
164
163
  }
@@ -168,7 +167,7 @@
168
167
  },
169
168
  "release-it": {
170
169
  "git": {
171
- "changelog": "npx auto-changelog --stdout --template https://raw.githubusercontent.com/release-it/release-it/main/templates/changelog-compact.hbs",
170
+ "changelog": "npx git-cliff --latest --strip header",
172
171
  "commitMessage": "chore: release v${version}",
173
172
  "requireBranch": "main"
174
173
  },
@@ -200,10 +199,11 @@
200
199
  "url": "https://github.com/karmaniverous/get-dotenv"
201
200
  },
202
201
  "scripts": {
203
- "build": "rimraf dist && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
202
+ "generate:schema": "tsx tools/generate-schema.js",
203
+ "build": "npm run generate:schema && rimraf dist && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
204
204
  "cli": "tsx src/cli/getdotenv",
205
205
  "cli:dist": "node dist/getdotenv.cli.mjs",
206
- "changelog": "auto-changelog",
206
+ "changelog": "git-cliff -o CHANGELOG.md",
207
207
  "docs": "typedoc",
208
208
  "pack:dry": "npm pack --dry-run",
209
209
  "knip": "knip",
@@ -221,5 +221,5 @@
221
221
  },
222
222
  "type": "module",
223
223
  "types": "dist/index.d.ts",
224
- "version": "7.0.6"
224
+ "version": "7.0.8"
225
225
  }
@@ -0,0 +1,207 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "rootOptionDefaults": {
6
+ "type": "object",
7
+ "properties": {
8
+ "defaultEnv": {
9
+ "type": "string"
10
+ },
11
+ "defaultEnvKey": {
12
+ "type": "string"
13
+ },
14
+ "dotenvToken": {
15
+ "type": "string"
16
+ },
17
+ "dynamicPath": {
18
+ "type": "string"
19
+ },
20
+ "dynamic": {
21
+ "type": "object",
22
+ "propertyNames": {
23
+ "type": "string"
24
+ },
25
+ "additionalProperties": {}
26
+ },
27
+ "env": {
28
+ "type": "string"
29
+ },
30
+ "excludeDynamic": {
31
+ "type": "boolean"
32
+ },
33
+ "excludeEnv": {
34
+ "type": "boolean"
35
+ },
36
+ "excludeGlobal": {
37
+ "type": "boolean"
38
+ },
39
+ "excludePrivate": {
40
+ "type": "boolean"
41
+ },
42
+ "excludePublic": {
43
+ "type": "boolean"
44
+ },
45
+ "loadProcess": {
46
+ "type": "boolean"
47
+ },
48
+ "log": {
49
+ "type": "boolean"
50
+ },
51
+ "outputPath": {
52
+ "type": "string"
53
+ },
54
+ "paths": {
55
+ "type": "string"
56
+ },
57
+ "privateToken": {
58
+ "type": "string"
59
+ },
60
+ "vars": {
61
+ "type": "string"
62
+ },
63
+ "debug": {
64
+ "type": "boolean"
65
+ },
66
+ "strict": {
67
+ "type": "boolean"
68
+ },
69
+ "capture": {
70
+ "type": "boolean"
71
+ },
72
+ "trace": {
73
+ "anyOf": [
74
+ {
75
+ "type": "boolean"
76
+ },
77
+ {
78
+ "type": "array",
79
+ "items": {
80
+ "type": "string"
81
+ }
82
+ }
83
+ ]
84
+ },
85
+ "redact": {
86
+ "type": "boolean"
87
+ },
88
+ "warnEntropy": {
89
+ "type": "boolean"
90
+ },
91
+ "entropyThreshold": {
92
+ "type": "number"
93
+ },
94
+ "entropyMinLength": {
95
+ "type": "number"
96
+ },
97
+ "entropyWhitelist": {
98
+ "type": "array",
99
+ "items": {
100
+ "type": "string"
101
+ }
102
+ },
103
+ "redactPatterns": {
104
+ "type": "array",
105
+ "items": {
106
+ "type": "string"
107
+ }
108
+ },
109
+ "pathsDelimiter": {
110
+ "type": "string"
111
+ },
112
+ "pathsDelimiterPattern": {
113
+ "type": "string"
114
+ },
115
+ "scripts": {
116
+ "type": "object",
117
+ "propertyNames": {
118
+ "type": "string"
119
+ },
120
+ "additionalProperties": {}
121
+ },
122
+ "shell": {
123
+ "anyOf": [
124
+ {
125
+ "type": "boolean"
126
+ },
127
+ {
128
+ "type": "string"
129
+ }
130
+ ]
131
+ },
132
+ "varsAssignor": {
133
+ "type": "string"
134
+ },
135
+ "varsAssignorPattern": {
136
+ "type": "string"
137
+ },
138
+ "varsDelimiter": {
139
+ "type": "string"
140
+ },
141
+ "varsDelimiterPattern": {
142
+ "type": "string"
143
+ }
144
+ },
145
+ "additionalProperties": false
146
+ },
147
+ "rootOptionVisibility": {
148
+ "type": "object",
149
+ "propertyNames": {
150
+ "type": "string"
151
+ },
152
+ "additionalProperties": {
153
+ "type": "boolean"
154
+ }
155
+ },
156
+ "scripts": {
157
+ "type": "object",
158
+ "propertyNames": {
159
+ "type": "string"
160
+ },
161
+ "additionalProperties": {}
162
+ },
163
+ "requiredKeys": {
164
+ "type": "array",
165
+ "items": {
166
+ "type": "string"
167
+ }
168
+ },
169
+ "schema": {},
170
+ "vars": {
171
+ "type": "object",
172
+ "propertyNames": {
173
+ "type": "string"
174
+ },
175
+ "additionalProperties": {
176
+ "type": "string"
177
+ }
178
+ },
179
+ "envVars": {
180
+ "type": "object",
181
+ "propertyNames": {
182
+ "type": "string"
183
+ },
184
+ "additionalProperties": {
185
+ "type": "object",
186
+ "propertyNames": {
187
+ "type": "string"
188
+ },
189
+ "additionalProperties": {
190
+ "type": "string"
191
+ }
192
+ }
193
+ },
194
+ "dynamic": {},
195
+ "plugins": {
196
+ "type": "object",
197
+ "propertyNames": {
198
+ "type": "string"
199
+ },
200
+ "additionalProperties": {}
201
+ }
202
+ },
203
+ "additionalProperties": false,
204
+ "$id": "https://raw.githubusercontent.com/karmaniverous/get-dotenv/main/schema/getdotenv.config.schema.json",
205
+ "title": "get-dotenv Configuration",
206
+ "description": "Schema for getdotenv.config.json configuration files. See https://github.com/karmaniverous/get-dotenv"
207
+ }