@karmaniverous/get-dotenv 5.2.5 → 6.0.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.
Files changed (41) hide show
  1. package/README.md +63 -67
  2. package/dist/cliHost.cjs +765 -549
  3. package/dist/cliHost.d.cts +128 -84
  4. package/dist/cliHost.d.mts +128 -84
  5. package/dist/cliHost.d.ts +128 -84
  6. package/dist/cliHost.mjs +765 -549
  7. package/dist/getdotenv.cli.mjs +915 -685
  8. package/dist/index.cjs +959 -1006
  9. package/dist/index.d.cts +18 -178
  10. package/dist/index.d.mts +18 -178
  11. package/dist/index.d.ts +18 -178
  12. package/dist/index.mjs +960 -1006
  13. package/dist/plugins-aws.cjs +0 -1
  14. package/dist/plugins-aws.d.cts +8 -78
  15. package/dist/plugins-aws.d.mts +8 -78
  16. package/dist/plugins-aws.d.ts +8 -78
  17. package/dist/plugins-aws.mjs +0 -1
  18. package/dist/plugins-batch.cjs +53 -11
  19. package/dist/plugins-batch.d.cts +10 -79
  20. package/dist/plugins-batch.d.mts +10 -79
  21. package/dist/plugins-batch.d.ts +10 -79
  22. package/dist/plugins-batch.mjs +53 -11
  23. package/dist/plugins-cmd.cjs +162 -1555
  24. package/dist/plugins-cmd.d.cts +8 -78
  25. package/dist/plugins-cmd.d.mts +8 -78
  26. package/dist/plugins-cmd.d.ts +8 -78
  27. package/dist/plugins-cmd.mjs +162 -1554
  28. package/dist/plugins-demo.cjs +52 -7
  29. package/dist/plugins-demo.d.cts +8 -78
  30. package/dist/plugins-demo.d.mts +8 -78
  31. package/dist/plugins-demo.d.ts +8 -78
  32. package/dist/plugins-demo.mjs +52 -7
  33. package/dist/plugins-init.d.cts +8 -78
  34. package/dist/plugins-init.d.mts +8 -78
  35. package/dist/plugins-init.d.ts +8 -78
  36. package/dist/plugins.cjs +283 -1630
  37. package/dist/plugins.d.cts +10 -79
  38. package/dist/plugins.d.mts +10 -79
  39. package/dist/plugins.d.ts +10 -79
  40. package/dist/plugins.mjs +285 -1631
  41. package/package.json +4 -2
@@ -1,76 +1,6 @@
1
1
  import { Command } from 'commander';
2
2
  import { ZodType } from 'zod';
3
3
 
4
- /**
5
- * Minimal root options shape shared by CLI and generator layers.
6
- * Keep keys optional to respect exactOptionalPropertyTypes semantics.
7
- */
8
- type RootOptionsShape = {
9
- env?: string;
10
- vars?: string;
11
- command?: string;
12
- outputPath?: string;
13
- shell?: string | boolean;
14
- loadProcess?: boolean;
15
- excludeAll?: boolean;
16
- excludeDynamic?: boolean;
17
- excludeEnv?: boolean;
18
- excludeGlobal?: boolean;
19
- excludePrivate?: boolean;
20
- excludePublic?: boolean;
21
- log?: boolean;
22
- debug?: boolean;
23
- capture?: boolean;
24
- strict?: boolean;
25
- redact?: boolean;
26
- warnEntropy?: boolean;
27
- entropyThreshold?: number;
28
- entropyMinLength?: number;
29
- entropyWhitelist?: string[];
30
- redactPatterns?: string[];
31
- defaultEnv?: string;
32
- dotenvToken?: string;
33
- dynamicPath?: string;
34
- trace?: boolean | string[];
35
- paths?: string;
36
- pathsDelimiter?: string;
37
- pathsDelimiterPattern?: string;
38
- privateToken?: string;
39
- varsDelimiter?: string;
40
- varsDelimiterPattern?: string;
41
- varsAssignor?: string;
42
- varsAssignorPattern?: string;
43
- scripts?: ScriptsTable;
44
- };
45
- /**
46
- * Scripts table shape (configurable shell type).
47
- */
48
- type ScriptsTable<TShell extends string | boolean = string | boolean> = Record<string, string | {
49
- cmd: string;
50
- shell?: TShell;
51
- }>;
52
-
53
- /**
54
- * Adapter-layer augmentation: add chainable helpers to GetDotenvCli without
55
- * coupling the core host to cliCore. Importing this module has side effects:
56
- * it extends the prototype and merges types for consumers.
57
- */
58
- declare module '../cliHost/GetDotenvCli' {
59
- interface GetDotenvCli {
60
- /**
61
- * Attach legacy root flags to this CLI instance. Defaults come from
62
- * baseRootOptionDefaults when none are provided. */
63
- attachRootOptions(defaults?: Partial<RootOptionsShape>, opts?: {
64
- includeCommandOption?: boolean;
65
- }): this;
66
- /**
67
- * Install a preSubcommand hook that merges CLI flags (including parent
68
- * round-trip) and resolves the dotenv context before executing actions.
69
- * Defaults come from baseRootOptionDefaults when none are provided.
70
- */ passOptions(defaults?: Partial<RootOptionsShape>): this;
71
- }
72
- }
73
-
74
4
  /**
75
5
  * A minimal representation of an environment key/value mapping.
76
6
  * Values may be `undefined` to represent "unset". */ type ProcessEnv = Record<string, string | undefined>;
@@ -165,14 +95,6 @@ interface GetDotenvOptions {
165
95
  useConfigLoader?: boolean;
166
96
  }
167
97
 
168
- /** * Per-invocation context shared with plugins and actions. */
169
- type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
170
- optionsResolved: TOptions;
171
- dotenv: ProcessEnv;
172
- plugins?: Record<string, unknown>;
173
- pluginConfigs?: Record<string, unknown>;
174
- };
175
-
176
98
  /** src/cliHost/definePlugin.ts
177
99
  * Plugin contracts for the GetDotenv CLI host.
178
100
  *
@@ -223,6 +145,14 @@ interface GetDotenvCliPlugin {
223
145
  use: (child: GetDotenvCliPlugin) => GetDotenvCliPlugin;
224
146
  }
225
147
 
148
+ /** * Per-invocation context shared with plugins and actions. */
149
+ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
150
+ optionsResolved: TOptions;
151
+ dotenv: ProcessEnv;
152
+ plugins?: Record<string, unknown>;
153
+ pluginConfigs?: Record<string, unknown>;
154
+ };
155
+
226
156
  declare const awsPlugin: () => GetDotenvCliPlugin;
227
157
 
228
158
  /**
@@ -243,7 +173,8 @@ type BatchPluginOptions = {
243
173
  /**
244
174
  * Batch plugin for the GetDotenv CLI host.
245
175
  *
246
- * Mirrors the legacy batch subcommand behavior without altering the shipped CLI. * Options:
176
+ * Mirrors the legacy batch subcommand behavior without altering the shipped CLI.
177
+ * Options:
247
178
  * - scripts/shell: used to resolve command and shell behavior per script or global default.
248
179
  * - logger: defaults to console.
249
180
  */
@@ -1,76 +1,6 @@
1
1
  import { Command } from 'commander';
2
2
  import { ZodType } from 'zod';
3
3
 
4
- /**
5
- * Minimal root options shape shared by CLI and generator layers.
6
- * Keep keys optional to respect exactOptionalPropertyTypes semantics.
7
- */
8
- type RootOptionsShape = {
9
- env?: string;
10
- vars?: string;
11
- command?: string;
12
- outputPath?: string;
13
- shell?: string | boolean;
14
- loadProcess?: boolean;
15
- excludeAll?: boolean;
16
- excludeDynamic?: boolean;
17
- excludeEnv?: boolean;
18
- excludeGlobal?: boolean;
19
- excludePrivate?: boolean;
20
- excludePublic?: boolean;
21
- log?: boolean;
22
- debug?: boolean;
23
- capture?: boolean;
24
- strict?: boolean;
25
- redact?: boolean;
26
- warnEntropy?: boolean;
27
- entropyThreshold?: number;
28
- entropyMinLength?: number;
29
- entropyWhitelist?: string[];
30
- redactPatterns?: string[];
31
- defaultEnv?: string;
32
- dotenvToken?: string;
33
- dynamicPath?: string;
34
- trace?: boolean | string[];
35
- paths?: string;
36
- pathsDelimiter?: string;
37
- pathsDelimiterPattern?: string;
38
- privateToken?: string;
39
- varsDelimiter?: string;
40
- varsDelimiterPattern?: string;
41
- varsAssignor?: string;
42
- varsAssignorPattern?: string;
43
- scripts?: ScriptsTable;
44
- };
45
- /**
46
- * Scripts table shape (configurable shell type).
47
- */
48
- type ScriptsTable<TShell extends string | boolean = string | boolean> = Record<string, string | {
49
- cmd: string;
50
- shell?: TShell;
51
- }>;
52
-
53
- /**
54
- * Adapter-layer augmentation: add chainable helpers to GetDotenvCli without
55
- * coupling the core host to cliCore. Importing this module has side effects:
56
- * it extends the prototype and merges types for consumers.
57
- */
58
- declare module '../cliHost/GetDotenvCli' {
59
- interface GetDotenvCli {
60
- /**
61
- * Attach legacy root flags to this CLI instance. Defaults come from
62
- * baseRootOptionDefaults when none are provided. */
63
- attachRootOptions(defaults?: Partial<RootOptionsShape>, opts?: {
64
- includeCommandOption?: boolean;
65
- }): this;
66
- /**
67
- * Install a preSubcommand hook that merges CLI flags (including parent
68
- * round-trip) and resolves the dotenv context before executing actions.
69
- * Defaults come from baseRootOptionDefaults when none are provided.
70
- */ passOptions(defaults?: Partial<RootOptionsShape>): this;
71
- }
72
- }
73
-
74
4
  /**
75
5
  * A minimal representation of an environment key/value mapping.
76
6
  * Values may be `undefined` to represent "unset". */ type ProcessEnv = Record<string, string | undefined>;
@@ -165,14 +95,6 @@ interface GetDotenvOptions {
165
95
  useConfigLoader?: boolean;
166
96
  }
167
97
 
168
- /** * Per-invocation context shared with plugins and actions. */
169
- type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
170
- optionsResolved: TOptions;
171
- dotenv: ProcessEnv;
172
- plugins?: Record<string, unknown>;
173
- pluginConfigs?: Record<string, unknown>;
174
- };
175
-
176
98
  /** src/cliHost/definePlugin.ts
177
99
  * Plugin contracts for the GetDotenv CLI host.
178
100
  *
@@ -223,6 +145,14 @@ interface GetDotenvCliPlugin {
223
145
  use: (child: GetDotenvCliPlugin) => GetDotenvCliPlugin;
224
146
  }
225
147
 
148
+ /** * Per-invocation context shared with plugins and actions. */
149
+ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
150
+ optionsResolved: TOptions;
151
+ dotenv: ProcessEnv;
152
+ plugins?: Record<string, unknown>;
153
+ pluginConfigs?: Record<string, unknown>;
154
+ };
155
+
226
156
  declare const awsPlugin: () => GetDotenvCliPlugin;
227
157
 
228
158
  /**
@@ -243,7 +173,8 @@ type BatchPluginOptions = {
243
173
  /**
244
174
  * Batch plugin for the GetDotenv CLI host.
245
175
  *
246
- * Mirrors the legacy batch subcommand behavior without altering the shipped CLI. * Options:
176
+ * Mirrors the legacy batch subcommand behavior without altering the shipped CLI.
177
+ * Options:
247
178
  * - scripts/shell: used to resolve command and shell behavior per script or global default.
248
179
  * - logger: defaults to console.
249
180
  */
package/dist/plugins.d.ts CHANGED
@@ -1,76 +1,6 @@
1
1
  import { Command } from 'commander';
2
2
  import { ZodType } from 'zod';
3
3
 
4
- /**
5
- * Minimal root options shape shared by CLI and generator layers.
6
- * Keep keys optional to respect exactOptionalPropertyTypes semantics.
7
- */
8
- type RootOptionsShape = {
9
- env?: string;
10
- vars?: string;
11
- command?: string;
12
- outputPath?: string;
13
- shell?: string | boolean;
14
- loadProcess?: boolean;
15
- excludeAll?: boolean;
16
- excludeDynamic?: boolean;
17
- excludeEnv?: boolean;
18
- excludeGlobal?: boolean;
19
- excludePrivate?: boolean;
20
- excludePublic?: boolean;
21
- log?: boolean;
22
- debug?: boolean;
23
- capture?: boolean;
24
- strict?: boolean;
25
- redact?: boolean;
26
- warnEntropy?: boolean;
27
- entropyThreshold?: number;
28
- entropyMinLength?: number;
29
- entropyWhitelist?: string[];
30
- redactPatterns?: string[];
31
- defaultEnv?: string;
32
- dotenvToken?: string;
33
- dynamicPath?: string;
34
- trace?: boolean | string[];
35
- paths?: string;
36
- pathsDelimiter?: string;
37
- pathsDelimiterPattern?: string;
38
- privateToken?: string;
39
- varsDelimiter?: string;
40
- varsDelimiterPattern?: string;
41
- varsAssignor?: string;
42
- varsAssignorPattern?: string;
43
- scripts?: ScriptsTable;
44
- };
45
- /**
46
- * Scripts table shape (configurable shell type).
47
- */
48
- type ScriptsTable<TShell extends string | boolean = string | boolean> = Record<string, string | {
49
- cmd: string;
50
- shell?: TShell;
51
- }>;
52
-
53
- /**
54
- * Adapter-layer augmentation: add chainable helpers to GetDotenvCli without
55
- * coupling the core host to cliCore. Importing this module has side effects:
56
- * it extends the prototype and merges types for consumers.
57
- */
58
- declare module '../cliHost/GetDotenvCli' {
59
- interface GetDotenvCli {
60
- /**
61
- * Attach legacy root flags to this CLI instance. Defaults come from
62
- * baseRootOptionDefaults when none are provided. */
63
- attachRootOptions(defaults?: Partial<RootOptionsShape>, opts?: {
64
- includeCommandOption?: boolean;
65
- }): this;
66
- /**
67
- * Install a preSubcommand hook that merges CLI flags (including parent
68
- * round-trip) and resolves the dotenv context before executing actions.
69
- * Defaults come from baseRootOptionDefaults when none are provided.
70
- */ passOptions(defaults?: Partial<RootOptionsShape>): this;
71
- }
72
- }
73
-
74
4
  /**
75
5
  * A minimal representation of an environment key/value mapping.
76
6
  * Values may be `undefined` to represent "unset". */ type ProcessEnv = Record<string, string | undefined>;
@@ -165,14 +95,6 @@ interface GetDotenvOptions {
165
95
  useConfigLoader?: boolean;
166
96
  }
167
97
 
168
- /** * Per-invocation context shared with plugins and actions. */
169
- type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
170
- optionsResolved: TOptions;
171
- dotenv: ProcessEnv;
172
- plugins?: Record<string, unknown>;
173
- pluginConfigs?: Record<string, unknown>;
174
- };
175
-
176
98
  /** src/cliHost/definePlugin.ts
177
99
  * Plugin contracts for the GetDotenv CLI host.
178
100
  *
@@ -223,6 +145,14 @@ interface GetDotenvCliPlugin {
223
145
  use: (child: GetDotenvCliPlugin) => GetDotenvCliPlugin;
224
146
  }
225
147
 
148
+ /** * Per-invocation context shared with plugins and actions. */
149
+ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
150
+ optionsResolved: TOptions;
151
+ dotenv: ProcessEnv;
152
+ plugins?: Record<string, unknown>;
153
+ pluginConfigs?: Record<string, unknown>;
154
+ };
155
+
226
156
  declare const awsPlugin: () => GetDotenvCliPlugin;
227
157
 
228
158
  /**
@@ -243,7 +173,8 @@ type BatchPluginOptions = {
243
173
  /**
244
174
  * Batch plugin for the GetDotenv CLI host.
245
175
  *
246
- * Mirrors the legacy batch subcommand behavior without altering the shipped CLI. * Options:
176
+ * Mirrors the legacy batch subcommand behavior without altering the shipped CLI.
177
+ * Options:
247
178
  * - scripts/shell: used to resolve command and shell behavior per script or global default.
248
179
  * - logger: defaults to console.
249
180
  */