@karmaniverous/get-dotenv 5.2.0 → 5.2.2

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/index.d.cts CHANGED
@@ -49,6 +49,27 @@ type ScriptsTable<TShell extends string | boolean = string | boolean> = Record<s
49
49
  shell?: TShell;
50
50
  }>;
51
51
 
52
+ /**
53
+ * Adapter-layer augmentation: add chainable helpers to GetDotenvCli without
54
+ * coupling the core host to cliCore. Importing this module has side effects:
55
+ * it extends the prototype and merges types for consumers.
56
+ */
57
+ declare module '../cliHost/GetDotenvCli' {
58
+ interface GetDotenvCli {
59
+ /**
60
+ * Attach legacy root flags to this CLI instance. Defaults come from
61
+ * baseRootOptionDefaults when none are provided. */
62
+ attachRootOptions(defaults?: Partial<RootOptionsShape>, opts?: {
63
+ includeCommandOption?: boolean;
64
+ }): this;
65
+ /**
66
+ * Install a preSubcommand hook that merges CLI flags (including parent
67
+ * round-trip) and resolves the dotenv context before executing actions.
68
+ * Defaults come from baseRootOptionDefaults when none are provided.
69
+ */ passOptions(defaults?: Partial<RootOptionsShape>): this;
70
+ }
71
+ }
72
+
52
73
  type RootOptionsShapeCompat = Omit<RootOptionsShape, 'vars' | 'paths'> & {
53
74
  vars?: string | Record<string, string | undefined>;
54
75
  paths?: string | string[];
@@ -415,5 +436,25 @@ declare const getDotenv: (options?: Partial<GetDotenvOptions>) => Promise<Proces
415
436
  */
416
437
  declare const interpolateDeep: <T>(value: T, envRef: ProcessEnv) => T;
417
438
 
418
- export { defineDynamic, dotenvExpand, dotenvExpandAll, dotenvExpandFromProcessEnv, generateGetDotenvCli, getDotenv, getDotenvCliOptions2Options, interpolateDeep };
419
- export type { GetDotenvDynamic, GetDotenvOptions, ProcessEnv };
439
+ /**
440
+ * Create a get-dotenv CLI host with included plugins.
441
+ *
442
+ * Options:
443
+ * - alias: command name used for help/argv scaffolding (default: "getdotenv")
444
+ * - branding: optional help header; when omitted, brand() uses "<alias> v<version>"
445
+ *
446
+ * Usage:
447
+ * import \{ createCli \} from '\@karmaniverous/get-dotenv';
448
+ * await createCli(\{ alias: 'getdotenv', branding: 'getdotenv vX.Y.Z' \})
449
+ * .run(process.argv.slice(2));
450
+ */
451
+ type CreateCliOptions = {
452
+ alias?: string;
453
+ branding?: string;
454
+ };
455
+ declare function createCli(opts?: CreateCliOptions): {
456
+ run: (argv: string[]) => Promise<void>;
457
+ };
458
+
459
+ export { createCli, defineDynamic, dotenvExpand, dotenvExpandAll, dotenvExpandFromProcessEnv, generateGetDotenvCli, getDotenv, getDotenvCliOptions2Options, interpolateDeep };
460
+ export type { CreateCliOptions, GetDotenvDynamic, GetDotenvOptions, ProcessEnv };
package/dist/index.d.mts CHANGED
@@ -49,6 +49,27 @@ type ScriptsTable<TShell extends string | boolean = string | boolean> = Record<s
49
49
  shell?: TShell;
50
50
  }>;
51
51
 
52
+ /**
53
+ * Adapter-layer augmentation: add chainable helpers to GetDotenvCli without
54
+ * coupling the core host to cliCore. Importing this module has side effects:
55
+ * it extends the prototype and merges types for consumers.
56
+ */
57
+ declare module '../cliHost/GetDotenvCli' {
58
+ interface GetDotenvCli {
59
+ /**
60
+ * Attach legacy root flags to this CLI instance. Defaults come from
61
+ * baseRootOptionDefaults when none are provided. */
62
+ attachRootOptions(defaults?: Partial<RootOptionsShape>, opts?: {
63
+ includeCommandOption?: boolean;
64
+ }): this;
65
+ /**
66
+ * Install a preSubcommand hook that merges CLI flags (including parent
67
+ * round-trip) and resolves the dotenv context before executing actions.
68
+ * Defaults come from baseRootOptionDefaults when none are provided.
69
+ */ passOptions(defaults?: Partial<RootOptionsShape>): this;
70
+ }
71
+ }
72
+
52
73
  type RootOptionsShapeCompat = Omit<RootOptionsShape, 'vars' | 'paths'> & {
53
74
  vars?: string | Record<string, string | undefined>;
54
75
  paths?: string | string[];
@@ -415,5 +436,25 @@ declare const getDotenv: (options?: Partial<GetDotenvOptions>) => Promise<Proces
415
436
  */
416
437
  declare const interpolateDeep: <T>(value: T, envRef: ProcessEnv) => T;
417
438
 
418
- export { defineDynamic, dotenvExpand, dotenvExpandAll, dotenvExpandFromProcessEnv, generateGetDotenvCli, getDotenv, getDotenvCliOptions2Options, interpolateDeep };
419
- export type { GetDotenvDynamic, GetDotenvOptions, ProcessEnv };
439
+ /**
440
+ * Create a get-dotenv CLI host with included plugins.
441
+ *
442
+ * Options:
443
+ * - alias: command name used for help/argv scaffolding (default: "getdotenv")
444
+ * - branding: optional help header; when omitted, brand() uses "<alias> v<version>"
445
+ *
446
+ * Usage:
447
+ * import \{ createCli \} from '\@karmaniverous/get-dotenv';
448
+ * await createCli(\{ alias: 'getdotenv', branding: 'getdotenv vX.Y.Z' \})
449
+ * .run(process.argv.slice(2));
450
+ */
451
+ type CreateCliOptions = {
452
+ alias?: string;
453
+ branding?: string;
454
+ };
455
+ declare function createCli(opts?: CreateCliOptions): {
456
+ run: (argv: string[]) => Promise<void>;
457
+ };
458
+
459
+ export { createCli, defineDynamic, dotenvExpand, dotenvExpandAll, dotenvExpandFromProcessEnv, generateGetDotenvCli, getDotenv, getDotenvCliOptions2Options, interpolateDeep };
460
+ export type { CreateCliOptions, GetDotenvDynamic, GetDotenvOptions, ProcessEnv };
package/dist/index.d.ts CHANGED
@@ -49,6 +49,27 @@ type ScriptsTable<TShell extends string | boolean = string | boolean> = Record<s
49
49
  shell?: TShell;
50
50
  }>;
51
51
 
52
+ /**
53
+ * Adapter-layer augmentation: add chainable helpers to GetDotenvCli without
54
+ * coupling the core host to cliCore. Importing this module has side effects:
55
+ * it extends the prototype and merges types for consumers.
56
+ */
57
+ declare module '../cliHost/GetDotenvCli' {
58
+ interface GetDotenvCli {
59
+ /**
60
+ * Attach legacy root flags to this CLI instance. Defaults come from
61
+ * baseRootOptionDefaults when none are provided. */
62
+ attachRootOptions(defaults?: Partial<RootOptionsShape>, opts?: {
63
+ includeCommandOption?: boolean;
64
+ }): this;
65
+ /**
66
+ * Install a preSubcommand hook that merges CLI flags (including parent
67
+ * round-trip) and resolves the dotenv context before executing actions.
68
+ * Defaults come from baseRootOptionDefaults when none are provided.
69
+ */ passOptions(defaults?: Partial<RootOptionsShape>): this;
70
+ }
71
+ }
72
+
52
73
  type RootOptionsShapeCompat = Omit<RootOptionsShape, 'vars' | 'paths'> & {
53
74
  vars?: string | Record<string, string | undefined>;
54
75
  paths?: string | string[];
@@ -415,5 +436,25 @@ declare const getDotenv: (options?: Partial<GetDotenvOptions>) => Promise<Proces
415
436
  */
416
437
  declare const interpolateDeep: <T>(value: T, envRef: ProcessEnv) => T;
417
438
 
418
- export { defineDynamic, dotenvExpand, dotenvExpandAll, dotenvExpandFromProcessEnv, generateGetDotenvCli, getDotenv, getDotenvCliOptions2Options, interpolateDeep };
419
- export type { GetDotenvDynamic, GetDotenvOptions, ProcessEnv };
439
+ /**
440
+ * Create a get-dotenv CLI host with included plugins.
441
+ *
442
+ * Options:
443
+ * - alias: command name used for help/argv scaffolding (default: "getdotenv")
444
+ * - branding: optional help header; when omitted, brand() uses "<alias> v<version>"
445
+ *
446
+ * Usage:
447
+ * import \{ createCli \} from '\@karmaniverous/get-dotenv';
448
+ * await createCli(\{ alias: 'getdotenv', branding: 'getdotenv vX.Y.Z' \})
449
+ * .run(process.argv.slice(2));
450
+ */
451
+ type CreateCliOptions = {
452
+ alias?: string;
453
+ branding?: string;
454
+ };
455
+ declare function createCli(opts?: CreateCliOptions): {
456
+ run: (argv: string[]) => Promise<void>;
457
+ };
458
+
459
+ export { createCli, defineDynamic, dotenvExpand, dotenvExpandAll, dotenvExpandFromProcessEnv, generateGetDotenvCli, getDotenv, getDotenvCliOptions2Options, interpolateDeep };
460
+ export type { CreateCliOptions, GetDotenvDynamic, GetDotenvOptions, ProcessEnv };