@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.
- package/README.md +20 -14
- package/dist/cli.d.ts +58 -2
- package/dist/cli.mjs +800 -364
- package/dist/cliHost.d.ts +216 -17
- package/dist/cliHost.mjs +178 -14
- package/dist/config.d.ts +12 -0
- package/dist/config.mjs +79 -2
- package/dist/env-overlay.d.ts +8 -0
- package/dist/getdotenv.cli.mjs +800 -364
- package/dist/index.d.ts +220 -35
- package/dist/index.mjs +851 -365
- package/dist/plugins-aws.d.ts +94 -6
- package/dist/plugins-aws.mjs +462 -184
- package/dist/plugins-batch.d.ts +85 -3
- package/dist/plugins-batch.mjs +203 -54
- package/dist/plugins-cmd.d.ts +85 -3
- package/dist/plugins-cmd.mjs +150 -28
- package/dist/plugins-init.d.ts +85 -3
- package/dist/plugins-init.mjs +270 -131
- package/dist/plugins.d.ts +85 -4
- package/dist/plugins.mjs +800 -364
- package/dist/templates/cli/plugins/hello/defaultAction.ts +27 -0
- package/dist/templates/cli/plugins/hello/index.ts +26 -0
- package/dist/templates/cli/plugins/hello/options.ts +31 -0
- package/dist/templates/cli/plugins/hello/strangerAction.ts +20 -0
- package/dist/templates/cli/plugins/hello/types.ts +13 -0
- package/dist/templates/defaultAction.ts +27 -0
- package/dist/templates/hello/defaultAction.ts +27 -0
- package/dist/templates/hello/index.ts +26 -0
- package/dist/templates/hello/options.ts +31 -0
- package/dist/templates/hello/strangerAction.ts +20 -0
- package/dist/templates/hello/types.ts +13 -0
- package/dist/templates/index.ts +23 -22
- package/dist/templates/options.ts +31 -0
- package/dist/templates/plugins/hello/defaultAction.ts +27 -0
- package/dist/templates/plugins/hello/index.ts +26 -0
- package/dist/templates/plugins/hello/options.ts +31 -0
- package/dist/templates/plugins/hello/strangerAction.ts +20 -0
- package/dist/templates/plugins/hello/types.ts +13 -0
- package/dist/templates/strangerAction.ts +20 -0
- package/dist/templates/types.ts +13 -0
- package/package.json +3 -4
- package/templates/cli/plugins/hello/defaultAction.ts +27 -0
- package/templates/cli/plugins/hello/index.ts +26 -0
- package/templates/cli/plugins/hello/options.ts +31 -0
- package/templates/cli/plugins/hello/strangerAction.ts +20 -0
- package/templates/cli/plugins/hello/types.ts +13 -0
- package/dist/templates/cli/plugins/hello.ts +0 -42
- package/dist/templates/hello.ts +0 -42
- package/dist/templates/plugins/hello.ts +0 -42
- 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
|
-
};
|
package/dist/templates/hello.ts
DELETED
|
@@ -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
|
-
};
|