optionkit 0.0.1 → 0.0.3

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 CHANGED
@@ -1,35 +1,142 @@
1
1
  # optionkit
2
2
 
3
- `optionkit` resolves typed Node.js configuration from defaults, environment
4
- variables, and long CLI flags.
3
+ `optionkit` turns a Zod configuration schema into CLI options. It adds
4
+ environment-variable bindings, adds unambiguous short flags, and lazily loads
5
+ the CLI stack without making Fireargs, Commander, or Zod runtime dependencies
6
+ of this package.
5
7
 
6
- ```js
7
- import { loadConfig } from "optionkit";
8
+ ```ts
9
+ import { createOptionKit } from 'optionkit';
8
10
 
9
- const config = loadConfig({
10
- defaults: {
11
- port: 3000,
12
- debug: false,
13
- logLevel: "info",
11
+ const { f, z } = await createOptionKit({ moduleUrl: import.meta.url });
12
+
13
+ const appOptionsSchema = z.object({
14
+ port: z.number().default(3000).describe('Port to listen on.'),
15
+ debug: z.boolean().default(false).describe('Write diagnostics to stderr.'),
16
+ logLevel: z.enum(['info', 'warn', 'error']).default('info')
17
+ .describe('Minimum log level.'),
18
+ }).readonly();
19
+
20
+ const serve = f.command({ name: 'serve', description: 'Start the server.' })
21
+ .input(appOptionsSchema)
22
+ .output(z.void())
23
+ .handler(async config => {
24
+ await startServer(config);
25
+ });
26
+
27
+ await serve.parseAsync(process.argv);
28
+ ```
29
+
30
+ If the consuming package is named `my-app`, the fields above receive
31
+ `MY_APP_PORT`, `MY_APP_DEBUG`, and `MY_APP_LOG_LEVEL`. `port`, `debug`, and
32
+ `logLevel` also receive `-p`, `-d`, and `-l` because their initials do not
33
+ conflict. When two options share an initial, neither gets that automatic short
34
+ flag.
35
+
36
+ Adaptation happens at each command's `.input(...)` boundary. Subcommands need no
37
+ special handling: build each leaf from its own schema, then mount the leaves with
38
+ `f.program(...).router({ serve, status })`. Environment and short-flag conflicts
39
+ are calculated independently for each leaf.
40
+
41
+ ## Lazy CLI dependencies
42
+
43
+ optionkit first resolves Fireargs and Zod from the consuming CLI package. If
44
+ they are unavailable, it detects the package manager from the invocation
45
+ directory and installs the pinned Fireargs and Zod ranges from the consuming
46
+ package root. `cacheDirectory` opts into an isolated install explicitly; there
47
+ is no default versioned cache. Fireargs' package metadata supplies its remaining
48
+ peer dependencies. Optionkit restores the consuming manifest and lockfile
49
+ byte-for-byte after installation, and installer output stays silent so JSON
50
+ output is not polluted.
51
+
52
+ Only `@antfu/install-pkg` is a runtime dependency of optionkit. Fireargs,
53
+ Zod, and `clean-stack` are development dependencies whose ranges are generated
54
+ into the build from the catalog in `pnpm-workspace.yaml`. A matching root
55
+ catalog keeps Bun compatible, and verification fails if the two catalogs
56
+ diverge. `src/_generated/catalog.ts` is a one-to-one runtime mirror of the root
57
+ catalog. The stack cleaner is installed separately and best-effort: a failure
58
+ never prevents the CLI from starting, and `formatError` falls back to the
59
+ original stack. Fireargs and Zod are also declared as optional peers, so a
60
+ consumer's compatible installation is reused without making either package a
61
+ required install.
62
+
63
+ Use the returned `z` when the consuming package does not otherwise depend on
64
+ Zod. It always comes from the same dependency location as the CLI adapter:
65
+
66
+ ```ts
67
+ const { f, z } = await createOptionKit({ moduleUrl: import.meta.url });
68
+ const input = z.object({ verbose: z.boolean().default(false) });
69
+ ```
70
+
71
+ Use `environmentPrefix` or `projectName` to override automatic package-name
72
+ translation. Per-field `env` and `short` values can be overridden or disabled:
73
+
74
+ ```ts
75
+ await createOptionKit({
76
+ environmentPrefix: 'SERVICE',
77
+ fields: {
78
+ debug: { env: false, short: 'x' },
14
79
  },
15
- prefix: "MY_APP_",
80
+ moduleUrl: import.meta.url,
16
81
  });
17
82
  ```
18
83
 
19
- With `MY_APP_PORT=4000` and `node app.js --port=5000 --debug`, the result is:
84
+ Array, tuple, object, and record options with generated environment bindings try
85
+ JSON first because an environment variable supplies only one string. For example,
86
+ `APP_TAGS='["one","two"]'` and `APP_ENV='{"PORT":"3000"}'` become their
87
+ corresponding Zod input values. Arrays also accept comma- or whitespace-delimited
88
+ shell words, including quotes and backslash escapes. If decoding does not apply,
89
+ the original string reaches Zod as the final authority. Decoded array values are
90
+ fed through Fireargs' native variadic option handling, so repeated flags and
91
+ scalar coercion keep their normal behavior. Object and record flags accept their
92
+ structured value as one token. A consumer-supplied Fireargs `parse` function is
93
+ forwarded unchanged and takes precedence over this augmentation. Every other
94
+ per-option Fireargs configuration field is forwarded as well; command and program
95
+ configuration remains available through the returned `f` namespace.
96
+
97
+ For wrapper commands, `passThroughArguments: true` supplies Fireargs' pass-through
98
+ settings and adds a typed trailing `args: string[]` input in one place:
99
+
100
+ ```ts
101
+ const run = f.command({ name: 'run', passThroughArguments: true })
102
+ .input(z.object(options))
103
+ .output(z.void())
104
+ .handler(async ({ args, ...config }) => runExecutable(config, args));
105
+ ```
106
+
107
+ Pass `{ description: '...' }` instead of `true` to override the generated
108
+ positional help text. Explicit Fireargs command settings still override the
109
+ shortcut defaults.
110
+
111
+ Fireargs programs currently show help when invoked without a subcommand. Optionkit
112
+ does not override that dispatch: Commander only exposes a clean default-command
113
+ switch while adding a command, whereas Fireargs owns that mounting step. A shim
114
+ would either depend on Commander internals or duplicate Fireargs routing.
20
115
 
21
- ```js
22
- {
23
- port: 5000,
24
- debug: true,
25
- logLevel: "info",
26
- }
116
+ `resolvePackage` and `importPackageIfAvailable` expose the same resolve-first
117
+ behavior for other optional integrations. They only suppress a genuinely
118
+ missing package; initialization errors from an installed package still surface.
119
+
120
+ ## Pyfig migration
121
+
122
+ Pyfig can keep `pyfigOptionsSchema` as its API source of truth. Its CLI only
123
+ needs to replace the manual loader; Optionkit adapts every command input:
124
+
125
+ ```ts
126
+ const { f, z } = await createOptionKit({
127
+ log,
128
+ moduleUrl: import.meta.url,
129
+ });
130
+
131
+ const createInput = (passthrough = false) => pyfigOptionsSchema.unwrap().extend({
132
+ ...(passthrough ? { args: f.argument().schema(passthroughArguments) } : {}),
133
+ });
27
134
  ```
28
135
 
29
- Precedence is `defaults < environment < CLI`. Camel-case keys map to
30
- upper-snake-case environment names (`logLevel` becomes `MY_APP_LOG_LEVEL`) and
31
- kebab-case CLI flags (`--log-level`). Boolean flags accept `--debug` and
32
- `--no-debug`.
136
+ The command, router, output schemas, handlers, and passthrough behavior do not
137
+ change. `PYFIG_*` names and conflict-free short flags are derived automatically.
138
+ Pyfig needs only `optionkit` for its CLI integration; it does not need its own
139
+ Fireargs peer metadata, Fireargs development dependency, or install helper.
33
140
 
34
141
  ## Install
35
142
 
@@ -0,0 +1,6 @@
1
+ export declare const catalog: {
2
+ readonly "clean-stack": "^7.0.0";
3
+ readonly fireargs: "^0.6.2";
4
+ readonly zod: "^4.6.7";
5
+ };
6
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/_generated/catalog.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO;aAClB,aAAa,EAAE,QAAQ;aACvB,QAAU,EAAE,QAAQ;aACpB,GAAK,EAAE,QAAQ;CACP,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Generated from package.json by scripts/generate-catalog.ts.
2
+ export const catalog = {
3
+ "clean-stack": "^7.0.0",
4
+ "fireargs": "^0.6.2",
5
+ "zod": "^4.6.7"
6
+ };
7
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/_generated/catalog.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,QAAQ;CACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { createOptionKit, type ArgumentConfiguration, type CliCommand, type CliParseOptions, type CliProgram, type CliRoute, type CommandConfiguration, type CreateOptionKitSettings, type FieldBuilder, type OptionConfiguration, type OptionKit, type OptionKitAdapter, type OptionKitLogger, type ProgramConfiguration, } from './optionkit.js';
2
+ export { importPackageIfAvailable, resolvePackage } from './resolve.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { createOptionKit, } from './optionkit.js';
2
+ export { importPackageIfAvailable, resolvePackage } from './resolve.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAchB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,135 @@
1
+ import type { ZodArray, ZodBoolean, ZodNumber, ZodObject, ZodReadonly, ZodString, ZodType } from 'zod';
2
+ type ZodNamespace = typeof import('zod').z;
3
+ type ZodShape = Record<string, ZodType>;
4
+ type ObjectSchema = ZodObject<ZodShape> | ZodReadonly<ZodObject<ZodShape>>;
5
+ type SchemaInput<Schema extends ZodType> = import('zod').input<Schema>;
6
+ type SchemaOutput<Schema extends ZodType> = import('zod').output<Schema>;
7
+ export interface OptionConfiguration<Value = unknown> {
8
+ /** Long flag without dashes. Defaults to the kebab-case field key. */
9
+ name?: string;
10
+ /** Override the generated environment variable, or disable it for this field. */
11
+ env?: string | false;
12
+ /** Override the generated short flag, or disable it for this field. */
13
+ short?: string | false;
14
+ conflicts?: string | string[];
15
+ implies?: Record<string, unknown>;
16
+ hidden?: boolean;
17
+ preset?: unknown;
18
+ helpGroup?: string;
19
+ defaultDescription?: string;
20
+ /** Fireargs parser for one CLI or environment string; disables automatic decoding. */
21
+ parse?: (value: string) => Value;
22
+ }
23
+ export interface ArgumentConfiguration<Value = unknown> {
24
+ name?: string;
25
+ defaultDescription?: string;
26
+ parse?: (value: string) => Value;
27
+ }
28
+ export interface PassThroughArgumentsConfiguration {
29
+ /** Help text for the generated trailing `args` positional. */
30
+ description?: string;
31
+ }
32
+ export interface CommandConfiguration extends Record<string, unknown> {
33
+ /** Add a typed trailing `args` array and the Fireargs pass-through switches. */
34
+ passThroughArguments?: boolean | PassThroughArgumentsConfiguration;
35
+ }
36
+ export type ProgramConfiguration = Record<string, unknown>;
37
+ export interface CliParseOptions {
38
+ from?: 'electron' | 'node' | 'user';
39
+ }
40
+ export interface CliRoute {
41
+ readonly type: 'command' | 'program';
42
+ helpInformation(): string;
43
+ parseAsync(argv?: readonly string[], options?: CliParseOptions): Promise<unknown>;
44
+ }
45
+ export interface CliCommand extends CliRoute {
46
+ readonly type: 'command';
47
+ }
48
+ export interface CliProgram extends CliRoute {
49
+ readonly type: 'program';
50
+ }
51
+ export interface CommandContext {
52
+ readonly command: CliCommand;
53
+ readonly json: boolean;
54
+ }
55
+ export interface RenderContext<Input> {
56
+ readonly command: CliCommand;
57
+ readonly input: Input;
58
+ readonly json: false;
59
+ }
60
+ export interface FieldBuilder<Value = never> {
61
+ string(): ZodString;
62
+ number(): ZodNumber;
63
+ boolean(): ZodBoolean;
64
+ enum<const Values extends readonly [string, ...string[]]>(values: Values): ZodType<Values[number]>;
65
+ array<Inner extends ZodType>(inner: Inner): ZodArray<Inner>;
66
+ schema<Schema extends ZodType>(schema: Schema): Schema;
67
+ }
68
+ interface HandlerBuilder<Input, Output extends ZodType> {
69
+ handler(handler: (input: Input, context: CommandContext) => SchemaInput<Output> | Promise<SchemaInput<Output>>): CliCommand;
70
+ }
71
+ interface OutputBuilder<Input, Output extends ZodType> extends HandlerBuilder<Input, Output> {
72
+ render(render: (output: SchemaOutput<Output>, context: RenderContext<Input>) => string | void | Promise<string | void>): HandlerBuilder<Input, Output>;
73
+ }
74
+ interface CommandBuilder<PassThrough extends boolean> {
75
+ input<Input extends ObjectSchema>(schema: Input): {
76
+ output<Output extends ZodType>(schema: Output): OutputBuilder<PassThrough extends true ? SchemaOutput<Input> & {
77
+ args: string[];
78
+ } : SchemaOutput<Input>, Output>;
79
+ };
80
+ }
81
+ export interface OptionKitAdapter {
82
+ argument<Value = never>(configuration?: ArgumentConfiguration<Value>): FieldBuilder<Value>;
83
+ command(configuration: CommandConfiguration & {
84
+ passThroughArguments: true | PassThroughArgumentsConfiguration;
85
+ }): CommandBuilder<true>;
86
+ command(configuration?: CommandConfiguration): CommandBuilder<false>;
87
+ option<Value = never>(configuration?: OptionConfiguration<Value>): FieldBuilder<Value>;
88
+ program(configuration?: ProgramConfiguration): {
89
+ router(routes: Readonly<Record<string, CliRoute>>): CliProgram;
90
+ };
91
+ }
92
+ export type OptionKitLogger = (message: string, details?: Readonly<Record<string, unknown>>) => void;
93
+ export interface CreateOptionKitSettings {
94
+ /** Module URL for the consuming CLI; used to find its nearest package.json. */
95
+ moduleUrl?: string | URL;
96
+ /** Explicit consuming package root when moduleUrl discovery is not appropriate. */
97
+ packageRoot?: string;
98
+ /** Override the consuming package name used to derive the environment prefix. */
99
+ projectName?: string;
100
+ /** Override the generated prefix, or disable environment bindings. */
101
+ environmentPrefix?: string | false;
102
+ /** Generate non-conflicting single-letter flags. Defaults to true. */
103
+ shortFlags?: boolean;
104
+ /** Letters that automatic short-flag generation must not use. */
105
+ reservedShortFlags?: readonly string[];
106
+ /** Per-field CLI metadata applied after generated values. */
107
+ fields?: Readonly<Record<string, OptionConfiguration>>;
108
+ /** Working directory used to detect the caller's package manager. */
109
+ invocationDirectory?: string;
110
+ /** Explicit isolated install directory. By default, missing packages install at packageRoot. */
111
+ cacheDirectory?: string;
112
+ /** Optional diagnostics sink. optionkit never writes install progress itself. */
113
+ log?: OptionKitLogger;
114
+ }
115
+ export interface OptionKit {
116
+ /** CLI builder namespace, loaded from the project or the lazy cache. */
117
+ f: OptionKitAdapter;
118
+ /** Zod from the same dependency location as the CLI adapter. */
119
+ z: ZodNamespace;
120
+ /** Prefix used for generated environment variables, including its trailing underscore. */
121
+ environmentPrefix: string | false;
122
+ /** The consuming package root discovered for this CLI. */
123
+ packageRoot: string;
124
+ /** Where the CLI dependencies were resolved or installed. */
125
+ dependencySource: 'cache' | 'package-root' | 'project';
126
+ /** Render an error with clean-stack when the optional dependency is available. */
127
+ formatError: (error: unknown) => string;
128
+ }
129
+ /**
130
+ * Load the CLI adapter on demand. Every command input is transparently augmented
131
+ * with environment bindings and conflict-free short flags.
132
+ */
133
+ export declare function createOptionKit(settings?: CreateOptionKitSettings): Promise<OptionKit>;
134
+ export {};
135
+ //# sourceMappingURL=optionkit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionkit.d.ts","sourceRoot":"","sources":["../src/optionkit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACR,MAAM,KAAK,CAAC;AAMb,KAAK,YAAY,GAAG,cAAc,KAAK,EAAE,CAAC,CAAC;AAC3C,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAGxC,KAAK,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC3E,KAAK,WAAW,CAAC,MAAM,SAAS,OAAO,IAAI,OAAO,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;AACvE,KAAK,YAAY,CAAC,MAA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