@karmaniverous/get-dotenv 6.1.0 → 6.2.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 (51) hide show
  1. package/README.md +20 -14
  2. package/dist/cli.d.ts +58 -2
  3. package/dist/cli.mjs +800 -364
  4. package/dist/cliHost.d.ts +216 -17
  5. package/dist/cliHost.mjs +178 -14
  6. package/dist/config.d.ts +12 -0
  7. package/dist/config.mjs +79 -2
  8. package/dist/env-overlay.d.ts +8 -0
  9. package/dist/getdotenv.cli.mjs +800 -364
  10. package/dist/index.d.ts +220 -35
  11. package/dist/index.mjs +851 -365
  12. package/dist/plugins-aws.d.ts +94 -6
  13. package/dist/plugins-aws.mjs +462 -184
  14. package/dist/plugins-batch.d.ts +85 -3
  15. package/dist/plugins-batch.mjs +203 -54
  16. package/dist/plugins-cmd.d.ts +85 -3
  17. package/dist/plugins-cmd.mjs +150 -28
  18. package/dist/plugins-init.d.ts +85 -3
  19. package/dist/plugins-init.mjs +270 -131
  20. package/dist/plugins.d.ts +85 -4
  21. package/dist/plugins.mjs +800 -364
  22. package/dist/templates/cli/plugins/hello/defaultAction.ts +27 -0
  23. package/dist/templates/cli/plugins/hello/index.ts +26 -0
  24. package/dist/templates/cli/plugins/hello/options.ts +31 -0
  25. package/dist/templates/cli/plugins/hello/strangerAction.ts +20 -0
  26. package/dist/templates/cli/plugins/hello/types.ts +13 -0
  27. package/dist/templates/defaultAction.ts +27 -0
  28. package/dist/templates/hello/defaultAction.ts +27 -0
  29. package/dist/templates/hello/index.ts +26 -0
  30. package/dist/templates/hello/options.ts +31 -0
  31. package/dist/templates/hello/strangerAction.ts +20 -0
  32. package/dist/templates/hello/types.ts +13 -0
  33. package/dist/templates/index.ts +23 -22
  34. package/dist/templates/options.ts +31 -0
  35. package/dist/templates/plugins/hello/defaultAction.ts +27 -0
  36. package/dist/templates/plugins/hello/index.ts +26 -0
  37. package/dist/templates/plugins/hello/options.ts +31 -0
  38. package/dist/templates/plugins/hello/strangerAction.ts +20 -0
  39. package/dist/templates/plugins/hello/types.ts +13 -0
  40. package/dist/templates/strangerAction.ts +20 -0
  41. package/dist/templates/types.ts +13 -0
  42. package/package.json +3 -4
  43. package/templates/cli/plugins/hello/defaultAction.ts +27 -0
  44. package/templates/cli/plugins/hello/index.ts +26 -0
  45. package/templates/cli/plugins/hello/options.ts +31 -0
  46. package/templates/cli/plugins/hello/strangerAction.ts +20 -0
  47. package/templates/cli/plugins/hello/types.ts +13 -0
  48. package/dist/templates/cli/plugins/hello.ts +0 -42
  49. package/dist/templates/hello.ts +0 -42
  50. package/dist/templates/plugins/hello.ts +0 -42
  51. package/templates/cli/plugins/hello.ts +0 -42
@@ -1,42 +0,0 @@
1
- import {
2
- definePlugin,
3
- getRootCommand,
4
- } from '@karmaniverous/get-dotenv/cliHost';
5
- import { z } from 'zod';
6
-
7
- const HelloConfigSchema = z.object({
8
- loud: z.boolean().optional().default(false),
9
- color: z.string().optional(),
10
- });
11
-
12
- export const helloPlugin = () => {
13
- const plugin = definePlugin({
14
- ns: 'hello',
15
- configSchema: HelloConfigSchema,
16
- setup(cli) {
17
- cli
18
- .description('Say hello with current dotenv context')
19
- .addOption(
20
- plugin.createPluginDynamicOption(
21
- cli,
22
- '--loud',
23
- (_bag, pluginCfg) =>
24
- `print greeting in ALL CAPS${pluginCfg.loud ? ' (default)' : ''}`,
25
- ),
26
- )
27
- .action(() => {
28
- const ctx = cli.getCtx();
29
- // Derive CLI name from the true root command using a typed helper.
30
- const rootName = getRootCommand(cli).name();
31
-
32
- const cfg = plugin.readConfig(cli);
33
- const keys = Object.keys(ctx.dotenv);
34
- const label = cfg.loud
35
- ? `[${rootName}] DOTENV KEYS (${String(keys.length)}):`
36
- : `[${rootName}] dotenv keys (${String(keys.length)}):`;
37
- console.log(label, keys.join(', '));
38
- });
39
- },
40
- });
41
- return plugin;
42
- };
@@ -1,42 +0,0 @@
1
- import {
2
- definePlugin,
3
- getRootCommand,
4
- } from '@karmaniverous/get-dotenv/cliHost';
5
- import { z } from 'zod';
6
-
7
- const HelloConfigSchema = z.object({
8
- loud: z.boolean().optional().default(false),
9
- color: z.string().optional(),
10
- });
11
-
12
- export const helloPlugin = () => {
13
- const plugin = definePlugin({
14
- ns: 'hello',
15
- configSchema: HelloConfigSchema,
16
- setup(cli) {
17
- cli
18
- .description('Say hello with current dotenv context')
19
- .addOption(
20
- plugin.createPluginDynamicOption(
21
- cli,
22
- '--loud',
23
- (_bag, pluginCfg) =>
24
- `print greeting in ALL CAPS${pluginCfg.loud ? ' (default)' : ''}`,
25
- ),
26
- )
27
- .action(() => {
28
- const ctx = cli.getCtx();
29
- // Derive CLI name from the true root command using a typed helper.
30
- const rootName = getRootCommand(cli).name();
31
-
32
- const cfg = plugin.readConfig(cli);
33
- const keys = Object.keys(ctx.dotenv);
34
- const label = cfg.loud
35
- ? `[${rootName}] DOTENV KEYS (${String(keys.length)}):`
36
- : `[${rootName}] dotenv keys (${String(keys.length)}):`;
37
- console.log(label, keys.join(', '));
38
- });
39
- },
40
- });
41
- return plugin;
42
- };
@@ -1,42 +0,0 @@
1
- import {
2
- definePlugin,
3
- getRootCommand,
4
- } from '@karmaniverous/get-dotenv/cliHost';
5
- import { z } from 'zod';
6
-
7
- const HelloConfigSchema = z.object({
8
- loud: z.boolean().optional().default(false),
9
- color: z.string().optional(),
10
- });
11
-
12
- export const helloPlugin = () => {
13
- const plugin = definePlugin({
14
- ns: 'hello',
15
- configSchema: HelloConfigSchema,
16
- setup(cli) {
17
- cli
18
- .description('Say hello with current dotenv context')
19
- .addOption(
20
- plugin.createPluginDynamicOption(
21
- cli,
22
- '--loud',
23
- (_bag, pluginCfg) =>
24
- `print greeting in ALL CAPS${pluginCfg.loud ? ' (default)' : ''}`,
25
- ),
26
- )
27
- .action(() => {
28
- const ctx = cli.getCtx();
29
- // Derive CLI name from the true root command using a typed helper.
30
- const rootName = getRootCommand(cli).name();
31
-
32
- const cfg = plugin.readConfig(cli);
33
- const keys = Object.keys(ctx.dotenv);
34
- const label = cfg.loud
35
- ? `[${rootName}] DOTENV KEYS (${String(keys.length)}):`
36
- : `[${rootName}] dotenv keys (${String(keys.length)}):`;
37
- console.log(label, keys.join(', '));
38
- });
39
- },
40
- });
41
- return plugin;
42
- };
@@ -1,42 +0,0 @@
1
- import {
2
- definePlugin,
3
- getRootCommand,
4
- } from '@karmaniverous/get-dotenv/cliHost';
5
- import { z } from 'zod';
6
-
7
- const HelloConfigSchema = z.object({
8
- loud: z.boolean().optional().default(false),
9
- color: z.string().optional(),
10
- });
11
-
12
- export const helloPlugin = () => {
13
- const plugin = definePlugin({
14
- ns: 'hello',
15
- configSchema: HelloConfigSchema,
16
- setup(cli) {
17
- cli
18
- .description('Say hello with current dotenv context')
19
- .addOption(
20
- plugin.createPluginDynamicOption(
21
- cli,
22
- '--loud',
23
- (_bag, pluginCfg) =>
24
- `print greeting in ALL CAPS${pluginCfg.loud ? ' (default)' : ''}`,
25
- ),
26
- )
27
- .action(() => {
28
- const ctx = cli.getCtx();
29
- // Derive CLI name from the true root command using a typed helper.
30
- const rootName = getRootCommand(cli).name();
31
-
32
- const cfg = plugin.readConfig(cli);
33
- const keys = Object.keys(ctx.dotenv);
34
- const label = cfg.loud
35
- ? `[${rootName}] DOTENV KEYS (${String(keys.length)}):`
36
- : `[${rootName}] dotenv keys (${String(keys.length)}):`;
37
- console.log(label, keys.join(', '));
38
- });
39
- },
40
- });
41
- return plugin;
42
- };