@karmaniverous/get-dotenv 6.2.2 → 6.2.4

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 (89) hide show
  1. package/dist/chunks/AwsRestJsonProtocol-Bq1HE-Ln.mjs +932 -0
  2. package/dist/chunks/createCli-BY6_cfZr.mjs +439 -0
  3. package/dist/chunks/externalDataInterceptor-CbsdEYa-.mjs +19 -0
  4. package/dist/chunks/getSSOTokenFromFile-hUSpR7Wf.mjs +22 -0
  5. package/dist/chunks/helpConfig-CGejgwWW.mjs +12 -0
  6. package/dist/chunks/index-B5JKTBOL.mjs +443 -0
  7. package/dist/chunks/index-BEJFiHMX.mjs +522 -0
  8. package/dist/chunks/index-BPYF6K_G.mjs +82 -0
  9. package/dist/chunks/index-Bc3h0a95.mjs +374 -0
  10. package/dist/chunks/index-BpCF5UKx.mjs +272 -0
  11. package/dist/chunks/index-C_wqbTwI.mjs +187 -0
  12. package/dist/chunks/index-CeCufHlm.mjs +9374 -0
  13. package/dist/chunks/index-Cu7rdyqN.mjs +102 -0
  14. package/dist/chunks/index-DWAtHEA-.mjs +379 -0
  15. package/dist/chunks/index-Dp1Ip6Ra.mjs +354 -0
  16. package/dist/chunks/index-DyU5pKKi.mjs +24 -0
  17. package/dist/chunks/index-c7zKtEuy.mjs +578 -0
  18. package/dist/chunks/index-cIunyiUQ.mjs +702 -0
  19. package/dist/chunks/invoke-DuRPU1oC.mjs +60 -0
  20. package/dist/chunks/loadModuleDefault-Dj8B3Stt.mjs +123 -0
  21. package/dist/chunks/loadSso-w1eTVg0O.mjs +412 -0
  22. package/dist/chunks/loader-DnhPeGfq.mjs +346 -0
  23. package/dist/chunks/overlayEnv-Bs2kVayG.mjs +234 -0
  24. package/dist/chunks/package-boo9EyYs.mjs +5 -0
  25. package/dist/chunks/parseKnownFiles-B9cDK21V.mjs +23 -0
  26. package/dist/chunks/readMergedOptions-Nt0TR7dX.mjs +1626 -0
  27. package/dist/chunks/resolveCliOptions-TFRzhB2c.mjs +138 -0
  28. package/dist/chunks/sdk-stream-mixin-BZoJ5jy9.mjs +167 -0
  29. package/dist/chunks/spawnEnv-CN8a7cNR.mjs +306 -0
  30. package/dist/chunks/types-DJ-BGABd.mjs +59 -0
  31. package/dist/chunks/validate-CDl0rE6k.mjs +61 -0
  32. package/dist/cli.mjs +39 -19307
  33. package/dist/cliHost.mjs +20 -2800
  34. package/dist/config.mjs +10 -509
  35. package/dist/env-overlay.mjs +6 -337
  36. package/dist/getdotenv.cli.mjs +39 -19305
  37. package/dist/index.mjs +39 -19396
  38. package/dist/plugins-aws.d.ts +1 -4
  39. package/dist/plugins-aws.mjs +65 -2568
  40. package/dist/plugins-batch.mjs +16 -2573
  41. package/dist/plugins-cmd.mjs +19 -3094
  42. package/dist/plugins-init.d.ts +8 -0
  43. package/dist/plugins-init.mjs +85 -2297
  44. package/dist/plugins.mjs +36 -18817
  45. package/package.json +1 -2
  46. package/dist/templates/cli/index.ts +0 -25
  47. package/dist/templates/cli/plugins/hello/defaultAction.ts +0 -27
  48. package/dist/templates/cli/plugins/hello/index.ts +0 -26
  49. package/dist/templates/cli/plugins/hello/options.ts +0 -31
  50. package/dist/templates/cli/plugins/hello/strangerAction.ts +0 -20
  51. package/dist/templates/cli/plugins/hello/types.ts +0 -13
  52. package/dist/templates/config/js/getdotenv.config.js +0 -20
  53. package/dist/templates/config/json/local/getdotenv.config.local.json +0 -7
  54. package/dist/templates/config/json/public/getdotenv.config.json +0 -9
  55. package/dist/templates/config/public/getdotenv.config.json +0 -8
  56. package/dist/templates/config/ts/getdotenv.config.ts +0 -28
  57. package/dist/templates/config/yaml/local/getdotenv.config.local.yaml +0 -7
  58. package/dist/templates/config/yaml/public/getdotenv.config.yaml +0 -7
  59. package/dist/templates/defaultAction.ts +0 -27
  60. package/dist/templates/getdotenv.config.js +0 -20
  61. package/dist/templates/getdotenv.config.json +0 -9
  62. package/dist/templates/getdotenv.config.local.json +0 -7
  63. package/dist/templates/getdotenv.config.local.yaml +0 -7
  64. package/dist/templates/getdotenv.config.ts +0 -28
  65. package/dist/templates/getdotenv.config.yaml +0 -7
  66. package/dist/templates/hello/defaultAction.ts +0 -27
  67. package/dist/templates/hello/index.ts +0 -26
  68. package/dist/templates/hello/options.ts +0 -31
  69. package/dist/templates/hello/strangerAction.ts +0 -20
  70. package/dist/templates/hello/types.ts +0 -13
  71. package/dist/templates/index.ts +0 -26
  72. package/dist/templates/js/getdotenv.config.js +0 -20
  73. package/dist/templates/json/local/getdotenv.config.local.json +0 -7
  74. package/dist/templates/json/public/getdotenv.config.json +0 -9
  75. package/dist/templates/local/getdotenv.config.local.json +0 -7
  76. package/dist/templates/local/getdotenv.config.local.yaml +0 -7
  77. package/dist/templates/options.ts +0 -31
  78. package/dist/templates/plugins/hello/defaultAction.ts +0 -27
  79. package/dist/templates/plugins/hello/index.ts +0 -26
  80. package/dist/templates/plugins/hello/options.ts +0 -31
  81. package/dist/templates/plugins/hello/strangerAction.ts +0 -20
  82. package/dist/templates/plugins/hello/types.ts +0 -13
  83. package/dist/templates/public/getdotenv.config.json +0 -9
  84. package/dist/templates/public/getdotenv.config.yaml +0 -7
  85. package/dist/templates/strangerAction.ts +0 -20
  86. package/dist/templates/ts/getdotenv.config.ts +0 -28
  87. package/dist/templates/types.ts +0 -13
  88. package/dist/templates/yaml/local/getdotenv.config.local.yaml +0 -7
  89. package/dist/templates/yaml/public/getdotenv.config.yaml +0 -7
@@ -1,26 +0,0 @@
1
- import { definePlugin } from '@karmaniverous/get-dotenv/cliHost';
2
-
3
- import { attachHelloDefaultAction } from './defaultAction';
4
- import { attachHelloOptions } from './options';
5
- import { attachHelloStrangerAction } from './strangerAction';
6
- import { helloPluginConfigSchema } from './types';
7
-
8
- export const helloPlugin = () => {
9
- const plugin = definePlugin({
10
- ns: 'hello',
11
- configSchema: helloPluginConfigSchema,
12
- setup(cli) {
13
- // Keep description in the plugin “index” (this file), not in an options helper.
14
- cli.description('Say hello with current dotenv context');
15
-
16
- const helloCmd = attachHelloOptions(cli, plugin);
17
- attachHelloDefaultAction(cli, helloCmd, plugin);
18
- attachHelloStrangerAction(cli);
19
-
20
- return undefined;
21
- },
22
- });
23
- return plugin;
24
- };
25
-
26
- export type HelloPlugin = ReturnType<typeof helloPlugin>;
@@ -1,31 +0,0 @@
1
- import type { GetDotenvCliPublic } from '@karmaniverous/get-dotenv/cliHost';
2
-
3
- import type { HelloPlugin } from '.';
4
- import type { HelloPluginConfig } from './types';
5
-
6
- export function attachHelloOptions(
7
- cli: GetDotenvCliPublic,
8
- plugin: HelloPlugin,
9
- ) {
10
- const loudOn = plugin
11
- .createPluginDynamicOption(
12
- cli,
13
- '-l, --loud',
14
- (_bag, pluginCfg: Readonly<HelloPluginConfig>) =>
15
- `print greeting in ALL CAPS${pluginCfg.loud ? ' (default)' : ''}`,
16
- )
17
- .conflicts('loudOff');
18
-
19
- const loudOff = plugin
20
- .createPluginDynamicOption(
21
- cli,
22
- '-L, --loud-off',
23
- (_bag, pluginCfg: Readonly<HelloPluginConfig>) =>
24
- `print greeting in normal case${pluginCfg.loud ? '' : ' (default)'}`,
25
- )
26
- .conflicts('loud');
27
-
28
- return cli.addOption(loudOn).addOption(loudOff);
29
- }
30
-
31
- export type HelloCommand = ReturnType<typeof attachHelloOptions>;
@@ -1,20 +0,0 @@
1
- import type { GetDotenvCliPublic } from '@karmaniverous/get-dotenv/cliHost';
2
-
3
- /**
4
- * Attach the `stranger` subcommand under `hello`.
5
- *
6
- * Reads `SECRET_IDENTITY` from the resolved get-dotenv context (`cli.getCtx().dotenv`).
7
- *
8
- * @param cli - The `hello` command mount.
9
- * @returns Nothing.
10
- */
11
- export function attachHelloStrangerAction(cli: GetDotenvCliPublic): void {
12
- const really = cli
13
- .ns('stranger')
14
- .description('Print SECRET_IDENTITY from the resolved dotenv context');
15
-
16
- really.action(() => {
17
- const secretIdentity = really.getCtx().dotenv.SECRET_IDENTITY;
18
- console.log(`My secret identity is ${secretIdentity ?? 'still a secret'}.`);
19
- });
20
- }
@@ -1,13 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- * Zod schema for hello plugin configuration.
5
- */
6
- export const helloPluginConfigSchema = z.object({
7
- loud: z.boolean().optional().default(false),
8
- });
9
-
10
- /**
11
- * Hello plugin configuration object.
12
- */
13
- export type HelloPluginConfig = z.infer<typeof helloPluginConfigSchema>;
@@ -1,9 +0,0 @@
1
- {
2
- "vars": {
3
- "APP_SETTING": "app_value"
4
- },
5
- "envVars": {
6
- "dev": { "ENV_SETTING": "dev_value" },
7
- "test": { "ENV_SETTING": "test_value" }
8
- }
9
- }
@@ -1,7 +0,0 @@
1
- vars:
2
- APP_SETTING: "app_value"
3
- envVars:
4
- dev:
5
- ENV_SETTING: "dev_value"
6
- test:
7
- ENV_SETTING: "test_value"
@@ -1,20 +0,0 @@
1
- import type { GetDotenvCliPublic } from '@karmaniverous/get-dotenv/cliHost';
2
-
3
- /**
4
- * Attach the `stranger` subcommand under `hello`.
5
- *
6
- * Reads `SECRET_IDENTITY` from the resolved get-dotenv context (`cli.getCtx().dotenv`).
7
- *
8
- * @param cli - The `hello` command mount.
9
- * @returns Nothing.
10
- */
11
- export function attachHelloStrangerAction(cli: GetDotenvCliPublic): void {
12
- const really = cli
13
- .ns('stranger')
14
- .description('Print SECRET_IDENTITY from the resolved dotenv context');
15
-
16
- really.action(() => {
17
- const secretIdentity = really.getCtx().dotenv.SECRET_IDENTITY;
18
- console.log(`My secret identity is ${secretIdentity ?? 'still a secret'}.`);
19
- });
20
- }
@@ -1,28 +0,0 @@
1
- import { defineGetDotenvConfig } from '@karmaniverous/get-dotenv';
2
-
3
- type Vars = {
4
- APP_SETTING?: string;
5
- ENV_SETTING?: string;
6
- };
7
-
8
- export default defineGetDotenvConfig<Vars>({
9
- // Help-time root defaults (example):
10
- // rootOptionDefaults: {
11
- // redact: true,
12
- // // redactPatterns: ['API_KEY', 'SECRET'],
13
- // },
14
- // Help-time visibility (example): hide selected root flags in -h
15
- // rootOptionVisibility: { capture: false },
16
-
17
- vars: { APP_SETTING: 'app_value' },
18
- envVars: { dev: { ENV_SETTING: 'dev_value' } },
19
- dynamic: {
20
- GREETING: ({ APP_SETTING = '' }) => `${APP_SETTING}-ts`,
21
- // Example: env-aware dynamic value. The second argument receives the
22
- // selected environment (if any); tailor behavior per environment.
23
- // For example, with env='dev' this yields "for-dev"; when env is not
24
- // provided, this returns an empty string.
25
- ENV_TAG: (_vars: Record<string, string | undefined>, env?: string) =>
26
- env ? `for-${env}` : '',
27
- },
28
- });
@@ -1,13 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- * Zod schema for hello plugin configuration.
5
- */
6
- export const helloPluginConfigSchema = z.object({
7
- loud: z.boolean().optional().default(false),
8
- });
9
-
10
- /**
11
- * Hello plugin configuration object.
12
- */
13
- export type HelloPluginConfig = z.infer<typeof helloPluginConfigSchema>;
@@ -1,7 +0,0 @@
1
- vars:
2
- APP_SECRET: "secret_value"
3
- envVars:
4
- dev:
5
- ENV_SECRET: "dev_secret"
6
- test:
7
- ENV_SECRET: "test_secret"
@@ -1,7 +0,0 @@
1
- vars:
2
- APP_SETTING: "app_value"
3
- envVars:
4
- dev:
5
- ENV_SETTING: "dev_value"
6
- test:
7
- ENV_SETTING: "test_value"