@boneskull/bargs 2.0.0 → 3.0.1
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 +306 -298
- package/dist/bargs.cjs +465 -135
- package/dist/bargs.cjs.map +1 -1
- package/dist/bargs.d.cts +36 -17
- package/dist/bargs.d.cts.map +1 -1
- package/dist/bargs.d.ts +36 -17
- package/dist/bargs.d.ts.map +1 -1
- package/dist/bargs.js +463 -135
- package/dist/bargs.js.map +1 -1
- package/dist/help.cjs +1 -2
- package/dist/help.cjs.map +1 -1
- package/dist/help.d.cts +21 -3
- package/dist/help.d.cts.map +1 -1
- package/dist/help.d.ts +21 -3
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +1 -2
- package/dist/help.js.map +1 -1
- package/dist/index.cjs +27 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -79
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +18 -79
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -30
- package/dist/index.js.map +1 -1
- package/dist/opt.cjs +148 -122
- package/dist/opt.cjs.map +1 -1
- package/dist/opt.d.cts +85 -113
- package/dist/opt.d.cts.map +1 -1
- package/dist/opt.d.ts +85 -113
- package/dist/opt.d.ts.map +1 -1
- package/dist/opt.js +147 -121
- package/dist/opt.js.map +1 -1
- package/dist/parser.cjs +3 -230
- package/dist/parser.cjs.map +1 -1
- package/dist/parser.d.cts +3 -51
- package/dist/parser.d.cts.map +1 -1
- package/dist/parser.d.ts +3 -51
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +2 -223
- package/dist/parser.js.map +1 -1
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +17 -1
- package/dist/theme.d.cts.map +1 -1
- package/dist/theme.d.ts +17 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js.map +1 -1
- package/dist/types.cjs +1 -3
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +128 -234
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +128 -234
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -3
- package/dist/types.js.map +1 -1
- package/package.json +6 -3
- package/dist/validate.cjs +0 -463
- package/dist/validate.cjs.map +0 -1
- package/dist/validate.d.cts +0 -28
- package/dist/validate.d.cts.map +0 -1
- package/dist/validate.d.ts +0 -28
- package/dist/validate.d.ts.map +0 -1
- package/dist/validate.js +0 -459
- package/dist/validate.js.map +0 -1
package/dist/opt.d.cts
CHANGED
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Builder functions for defining CLI options
|
|
2
|
+
* Builder functions for defining CLI options and positionals.
|
|
3
3
|
*
|
|
4
4
|
* Provides ergonomic helpers with full TypeScript type inference for
|
|
5
5
|
* constructing option schemas (`opt.string()`, `opt.boolean()`, `opt.enum()`,
|
|
6
|
-
* etc.)
|
|
7
|
-
* `opt.variadic()`)
|
|
8
|
-
* composition utilities for merging schemas (`opt.options()`,
|
|
9
|
-
* `opt.positionals()`).
|
|
6
|
+
* etc.) and positional schemas (`opt.stringPos()`, `opt.numberPos()`,
|
|
7
|
+
* `opt.variadic()`).
|
|
10
8
|
*
|
|
11
9
|
* @packageDocumentation
|
|
12
10
|
*/
|
|
13
|
-
import type { ArrayOption, BooleanOption,
|
|
11
|
+
import type { ArrayOption, BooleanOption, CountOption, EnumOption, EnumPositional, InferOptions, InferPositionals, NumberOption, NumberPositional, OptionsSchema, Parser, PositionalDef, StringOption, StringPositional, VariadicPositional } from "./types.cjs";
|
|
14
12
|
/**
|
|
15
|
-
*
|
|
16
|
-
* options
|
|
13
|
+
* A Parser that can also be called as a function to merge with another parser.
|
|
14
|
+
* This allows `opt.options()` to work both as:
|
|
15
|
+
*
|
|
16
|
+
* - First arg in pipe: used directly as a Parser
|
|
17
|
+
* - Later arg in pipe: called as function to merge with incoming Parser
|
|
18
|
+
*
|
|
19
|
+
* @knipignore
|
|
17
20
|
*/
|
|
18
|
-
export
|
|
19
|
-
<const TOptions extends OptionsSchema = OptionsSchema, const TPositionals extends PositionalsSchema = PositionalsSchema, const TTransforms extends TransformsConfig<any, any, any, any> | undefined = undefined>(config: CommandConfig<Record<string, never>, undefined, TOptions, TPositionals, TTransforms>): CommandConfig<Record<string, never>, undefined, TOptions, TPositionals, TTransforms>;
|
|
20
|
-
<TGlobalOptions extends OptionsSchema, TGlobalTransforms extends TransformsConfig<any, any, any, any> | undefined = undefined>(): <const TOptions extends OptionsSchema = OptionsSchema, const TPositionals extends PositionalsSchema = PositionalsSchema, const TTransforms extends TransformsConfig<any, any, any, any> | undefined = undefined>(config: CommandConfig<TGlobalOptions, TGlobalTransforms, TOptions, TPositionals, TTransforms>) => CommandConfig<TGlobalOptions, TGlobalTransforms, TOptions, TPositionals, TTransforms>;
|
|
21
|
-
}
|
|
21
|
+
export type CallableOptionsParser<V> = (<V2, P2 extends readonly unknown[]>(parser: Parser<V2, P2>) => Parser<V & V2, P2>) & Parser<V, readonly []>;
|
|
22
22
|
/**
|
|
23
23
|
* Namespaced option builders.
|
|
24
24
|
*
|
|
25
|
-
* Provides ergonomic helpers for defining CLI options, positionals, and
|
|
26
|
-
* commands with full TypeScript type inference.
|
|
27
|
-
*
|
|
28
25
|
* @example
|
|
29
26
|
*
|
|
30
27
|
* ```typescript
|
|
31
28
|
* import { opt } from 'bargs';
|
|
32
29
|
*
|
|
33
|
-
* const
|
|
30
|
+
* const parser = opt.options({
|
|
34
31
|
* verbose: opt.boolean({ aliases: ['v'] }),
|
|
35
32
|
* name: opt.string({ default: 'world' }),
|
|
36
|
-
* level: opt.enum(['low', 'medium', 'high']
|
|
33
|
+
* level: opt.enum(['low', 'medium', 'high']),
|
|
37
34
|
* });
|
|
38
35
|
* ```
|
|
39
36
|
*/
|
|
@@ -43,140 +40,115 @@ export declare const opt: {
|
|
|
43
40
|
*/
|
|
44
41
|
array: (items: "number" | "string", props?: Omit<ArrayOption, "items" | "type">) => ArrayOption;
|
|
45
42
|
/**
|
|
46
|
-
* Define a boolean option.
|
|
47
|
-
* inference.
|
|
43
|
+
* Define a boolean option.
|
|
48
44
|
*/
|
|
49
45
|
boolean: <P extends Omit<BooleanOption, "type"> = Omit<BooleanOption, "type">>(props?: P) => BooleanOption & P;
|
|
50
|
-
/**
|
|
51
|
-
* Define a command with proper type inference.
|
|
52
|
-
*
|
|
53
|
-
* Three usage patterns:
|
|
54
|
-
*
|
|
55
|
-
* 1. Simple usage (no global options): `bargs.command({ ... })`
|
|
56
|
-
* 2. With global options: `bargs.command<typeof globalOptions>()({ ... })`
|
|
57
|
-
* 3. With global options AND transforms: `bargs.command<typeof globalOptions,
|
|
58
|
-
* typeof globalTransforms>()({ ... })`
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
*
|
|
62
|
-
* ```typescript
|
|
63
|
-
* // Simple usage - no global options typed
|
|
64
|
-
* const simpleCmd = bargs.command({
|
|
65
|
-
* description: 'Simple command',
|
|
66
|
-
* handler: ({ values }) => { ... },
|
|
67
|
-
* });
|
|
68
|
-
*
|
|
69
|
-
* // With global options typed
|
|
70
|
-
* const globalOptions = {
|
|
71
|
-
* verbose: bargs.boolean({ aliases: ['v'] }),
|
|
72
|
-
* } as const;
|
|
73
|
-
*
|
|
74
|
-
* const greetCmd = bargs.command<typeof globalOptions>()({
|
|
75
|
-
* description: 'Greet someone',
|
|
76
|
-
* options: { name: bargs.string({ default: 'world' }) },
|
|
77
|
-
* handler: ({ values }) => {
|
|
78
|
-
* // values.verbose is properly typed as boolean | undefined
|
|
79
|
-
* console.log(`Hello, ${values.name}!`);
|
|
80
|
-
* },
|
|
81
|
-
* });
|
|
82
|
-
*
|
|
83
|
-
* // With global options AND global transforms typed
|
|
84
|
-
* const globalTransforms = {
|
|
85
|
-
* values: (v) => ({ ...v, timestamp: Date.now() }),
|
|
86
|
-
* } as const;
|
|
87
|
-
*
|
|
88
|
-
* const timedCmd = bargs.command<typeof globalOptions, typeof globalTransforms>()({
|
|
89
|
-
* description: 'Time-aware command',
|
|
90
|
-
* handler: ({ values }) => {
|
|
91
|
-
* // values.timestamp is properly typed from global transforms
|
|
92
|
-
* console.log(`Ran at ${values.timestamp}`);
|
|
93
|
-
* },
|
|
94
|
-
* });
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
command: CommandBuilder;
|
|
98
46
|
/**
|
|
99
47
|
* Define a count option (--verbose --verbose = 2).
|
|
100
48
|
*/
|
|
101
49
|
count: (props?: Omit<CountOption, "type">) => CountOption;
|
|
102
50
|
/**
|
|
103
|
-
* Define an enum option with string choices.
|
|
104
|
-
* a tuple of literal types automatically. Props type is preserved to enable
|
|
105
|
-
* default inference.
|
|
51
|
+
* Define an enum option with string choices.
|
|
106
52
|
*/
|
|
107
53
|
enum: <const T extends readonly string[], P extends Omit<EnumOption<T[number]>, "choices" | "type"> = Omit<EnumOption<T[number]>, "type" | "choices">>(choices: T, props?: P) => EnumOption<T[number]> & P;
|
|
108
54
|
/**
|
|
109
|
-
* Define an enum positional argument with string choices.
|
|
110
|
-
* is inferred as a tuple of literal types automatically.
|
|
55
|
+
* Define an enum positional argument with string choices.
|
|
111
56
|
*/
|
|
112
57
|
enumPos: <const T extends readonly string[], P extends Omit<EnumPositional<T[number]>, "choices" | "type"> = Omit<EnumPositional<T[number]>, "type" | "choices">>(choices: T, props?: P) => EnumPositional<T[number]> & P;
|
|
113
58
|
/**
|
|
114
|
-
* Define a number option.
|
|
115
|
-
* inference.
|
|
59
|
+
* Define a number option.
|
|
116
60
|
*/
|
|
117
61
|
number: <P extends Omit<NumberOption, "type"> = Omit<NumberOption, "type">>(props?: P) => NumberOption & P;
|
|
118
62
|
/**
|
|
119
|
-
* Define a number positional argument.
|
|
120
|
-
* required inference.
|
|
63
|
+
* Define a number positional argument.
|
|
121
64
|
*/
|
|
122
65
|
numberPos: <P extends Omit<NumberPositional, "type"> = Omit<NumberPositional, "type">>(props?: P) => NumberPositional & P;
|
|
123
66
|
/**
|
|
124
|
-
*
|
|
125
|
-
* ones for duplicate option names. Validates that no alias conflicts exist.
|
|
67
|
+
* Create a Parser from an options schema.
|
|
126
68
|
*
|
|
127
69
|
* @example
|
|
128
70
|
*
|
|
129
71
|
* ```typescript
|
|
130
|
-
*
|
|
131
|
-
* const loggingOpts = opt.options({
|
|
72
|
+
* const parser = opt.options({
|
|
132
73
|
* verbose: opt.boolean({ aliases: ['v'] }),
|
|
133
|
-
*
|
|
134
|
-
* });
|
|
135
|
-
*
|
|
136
|
-
* // Merge multiple schemas
|
|
137
|
-
* const allOpts = opt.options(loggingOpts, ioOpts, {
|
|
138
|
-
* format: opt.enum(['json', 'yaml'] as const),
|
|
74
|
+
* name: opt.string({ default: 'world' }),
|
|
139
75
|
* });
|
|
76
|
+
* // Type: Parser<{ verbose: boolean | undefined, name: string }, []>
|
|
140
77
|
* ```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
78
|
+
*/
|
|
79
|
+
options: <T extends OptionsSchema>(schema: T) => CallableOptionsParser<InferOptions<T>>;
|
|
80
|
+
/**
|
|
81
|
+
* Define a string option.
|
|
82
|
+
*/
|
|
83
|
+
string: <P extends Omit<StringOption, "type"> = Omit<StringOption, "type">>(props?: P) => P & StringOption;
|
|
84
|
+
/**
|
|
85
|
+
* Define a string positional argument.
|
|
86
|
+
*/
|
|
87
|
+
stringPos: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
88
|
+
/**
|
|
89
|
+
* Define a variadic positional (rest args).
|
|
90
|
+
*/
|
|
91
|
+
variadic: (items: "number" | "string", props?: Omit<VariadicPositional, "items" | "type">) => VariadicPositional;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* A Parser that can also be called as a function to merge with another parser.
|
|
95
|
+
* This allows `pos.positionals()` to work both as:
|
|
96
|
+
*
|
|
97
|
+
* - First arg in pipe: used directly as a Parser
|
|
98
|
+
* - Later arg in pipe: called as function to merge with incoming Parser
|
|
99
|
+
*
|
|
100
|
+
* For positionals, we DON'T intersect values - we just pass through V2.
|
|
101
|
+
*
|
|
102
|
+
* @knipignore
|
|
103
|
+
*/
|
|
104
|
+
export type CallablePositionalsParser<P extends readonly unknown[]> = (<V2, P2 extends readonly unknown[]>(parser: Parser<V2, P2>) => Parser<V2, readonly [...P2, ...P]>) & Parser<object, P>;
|
|
105
|
+
/**
|
|
106
|
+
* Namespaced positional builders.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
*
|
|
110
|
+
* ```typescript
|
|
111
|
+
* import { pos } from 'bargs';
|
|
112
|
+
*
|
|
113
|
+
* const parser = pos.positionals(
|
|
114
|
+
* pos.string({ name: 'input', required: true }),
|
|
115
|
+
* pos.string({ name: 'output' }),
|
|
116
|
+
* );
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare const pos: {
|
|
120
|
+
/**
|
|
121
|
+
* Define an enum positional argument with string choices.
|
|
122
|
+
*/
|
|
123
|
+
enum: <const T extends readonly string[], P extends Omit<EnumPositional<T[number]>, "choices" | "type"> = Omit<EnumPositional<T[number]>, "type" | "choices">>(choices: T, props?: P) => EnumPositional<T[number]> & P;
|
|
124
|
+
/**
|
|
125
|
+
* Define a number positional argument.
|
|
126
|
+
*/
|
|
127
|
+
number: <P extends Omit<NumberPositional, "type"> = Omit<NumberPositional, "type">>(props?: P) => NumberPositional & P;
|
|
151
128
|
/**
|
|
152
|
-
* Create a
|
|
129
|
+
* Create a Parser from positional definitions.
|
|
153
130
|
*
|
|
154
131
|
* @example
|
|
155
132
|
*
|
|
156
133
|
* ```typescript
|
|
157
|
-
* const
|
|
158
|
-
*
|
|
159
|
-
*
|
|
134
|
+
* const parser = pos.positionals(
|
|
135
|
+
* pos.string({ name: 'input', required: true }),
|
|
136
|
+
* pos.string({ name: 'output' }),
|
|
160
137
|
* );
|
|
138
|
+
* // Type: Parser<{}, readonly [string, string | undefined]>
|
|
161
139
|
* ```
|
|
162
140
|
*/
|
|
163
141
|
positionals: {
|
|
164
|
-
<A extends PositionalDef>(a: A): [A]
|
|
165
|
-
<A extends PositionalDef, B extends PositionalDef>(a: A, b: B): [A, B]
|
|
166
|
-
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef>(a: A, b: B, c: C): [A, B, C]
|
|
167
|
-
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef, D extends PositionalDef>(a: A, b: B, c: C, d: D): [A, B, C, D]
|
|
168
|
-
(...positionals: PositionalDef[]):
|
|
142
|
+
<A extends PositionalDef>(a: A): CallablePositionalsParser<readonly [InferPositionals<readonly [A]>[0]]>;
|
|
143
|
+
<A extends PositionalDef, B extends PositionalDef>(a: A, b: B): CallablePositionalsParser<InferPositionals<readonly [A, B]>>;
|
|
144
|
+
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef>(a: A, b: B, c: C): CallablePositionalsParser<InferPositionals<readonly [A, B, C]>>;
|
|
145
|
+
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef, D extends PositionalDef>(a: A, b: B, c: C, d: D): CallablePositionalsParser<InferPositionals<readonly [A, B, C, D]>>;
|
|
146
|
+
(...positionals: PositionalDef[]): CallablePositionalsParser<readonly unknown[]>;
|
|
169
147
|
};
|
|
170
148
|
/**
|
|
171
|
-
* Define a string
|
|
172
|
-
* inference.
|
|
149
|
+
* Define a string positional argument.
|
|
173
150
|
*/
|
|
174
|
-
string: <P extends Omit<
|
|
175
|
-
/**
|
|
176
|
-
* Define a string positional argument. Props type is preserved to enable
|
|
177
|
-
* required inference.
|
|
178
|
-
*/
|
|
179
|
-
stringPos: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
151
|
+
string: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
180
152
|
/**
|
|
181
153
|
* Define a variadic positional (rest args).
|
|
182
154
|
*/
|
package/dist/opt.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opt.d.ts","sourceRoot":"","sources":["../src/opt.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"opt.d.ts","sourceRoot":"","sources":["../src/opt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,MAAM,EACN,aAAa,EAEb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EACnB,oBAAmB;AA2BpB;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,SAAS,OAAO,EAAE,EACxE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,KACnB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GACtB,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAsDzB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,GAAG;IAGd;;OAEG;mBAEM,QAAQ,GAAG,QAAQ,UACnB,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC,KACzC,WAAW;IAMd;;OAEG;cAED,CAAC,SAAS,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,wCAE9B,CAAC,KACP,aAAa,GAAG,CAAC;IAMpB;;OAEG;oBACY,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,KAAQ,WAAW;IAK3D;;OAEG;iBAEK,CAAC,SAAS,SAAS,MAAM,EAAE,EACjC,CAAC,SAAS,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,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SAAS,aAAa,EAEvB,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,GACH,yBAAyB,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,CACE,GAAG,WAAW,EAAE,aAAa,EAAE,GAC9B,yBAAyB,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;KAClD;IAED;;OAEG;aAED,CAAC,SAAS,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,2CAEjC,CAAC,KACP,CAAC,GAAG,gBAAgB;IAMvB;;OAEG;sBAEM,QAAQ,GAAG,QAAQ,UACnB,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,MAAM,CAAC,KAChD,kBAAkB;CAKtB,CAAC"}
|
package/dist/opt.d.ts
CHANGED
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Builder functions for defining CLI options
|
|
2
|
+
* Builder functions for defining CLI options and positionals.
|
|
3
3
|
*
|
|
4
4
|
* Provides ergonomic helpers with full TypeScript type inference for
|
|
5
5
|
* constructing option schemas (`opt.string()`, `opt.boolean()`, `opt.enum()`,
|
|
6
|
-
* etc.)
|
|
7
|
-
* `opt.variadic()`)
|
|
8
|
-
* composition utilities for merging schemas (`opt.options()`,
|
|
9
|
-
* `opt.positionals()`).
|
|
6
|
+
* etc.) and positional schemas (`opt.stringPos()`, `opt.numberPos()`,
|
|
7
|
+
* `opt.variadic()`).
|
|
10
8
|
*
|
|
11
9
|
* @packageDocumentation
|
|
12
10
|
*/
|
|
13
|
-
import type { ArrayOption, BooleanOption,
|
|
11
|
+
import type { ArrayOption, BooleanOption, CountOption, EnumOption, EnumPositional, InferOptions, InferPositionals, NumberOption, NumberPositional, OptionsSchema, Parser, PositionalDef, StringOption, StringPositional, VariadicPositional } from "./types.js";
|
|
14
12
|
/**
|
|
15
|
-
*
|
|
16
|
-
* options
|
|
13
|
+
* A Parser that can also be called as a function to merge with another parser.
|
|
14
|
+
* This allows `opt.options()` to work both as:
|
|
15
|
+
*
|
|
16
|
+
* - First arg in pipe: used directly as a Parser
|
|
17
|
+
* - Later arg in pipe: called as function to merge with incoming Parser
|
|
18
|
+
*
|
|
19
|
+
* @knipignore
|
|
17
20
|
*/
|
|
18
|
-
export
|
|
19
|
-
<const TOptions extends OptionsSchema = OptionsSchema, const TPositionals extends PositionalsSchema = PositionalsSchema, const TTransforms extends TransformsConfig<any, any, any, any> | undefined = undefined>(config: CommandConfig<Record<string, never>, undefined, TOptions, TPositionals, TTransforms>): CommandConfig<Record<string, never>, undefined, TOptions, TPositionals, TTransforms>;
|
|
20
|
-
<TGlobalOptions extends OptionsSchema, TGlobalTransforms extends TransformsConfig<any, any, any, any> | undefined = undefined>(): <const TOptions extends OptionsSchema = OptionsSchema, const TPositionals extends PositionalsSchema = PositionalsSchema, const TTransforms extends TransformsConfig<any, any, any, any> | undefined = undefined>(config: CommandConfig<TGlobalOptions, TGlobalTransforms, TOptions, TPositionals, TTransforms>) => CommandConfig<TGlobalOptions, TGlobalTransforms, TOptions, TPositionals, TTransforms>;
|
|
21
|
-
}
|
|
21
|
+
export type CallableOptionsParser<V> = (<V2, P2 extends readonly unknown[]>(parser: Parser<V2, P2>) => Parser<V & V2, P2>) & Parser<V, readonly []>;
|
|
22
22
|
/**
|
|
23
23
|
* Namespaced option builders.
|
|
24
24
|
*
|
|
25
|
-
* Provides ergonomic helpers for defining CLI options, positionals, and
|
|
26
|
-
* commands with full TypeScript type inference.
|
|
27
|
-
*
|
|
28
25
|
* @example
|
|
29
26
|
*
|
|
30
27
|
* ```typescript
|
|
31
28
|
* import { opt } from 'bargs';
|
|
32
29
|
*
|
|
33
|
-
* const
|
|
30
|
+
* const parser = opt.options({
|
|
34
31
|
* verbose: opt.boolean({ aliases: ['v'] }),
|
|
35
32
|
* name: opt.string({ default: 'world' }),
|
|
36
|
-
* level: opt.enum(['low', 'medium', 'high']
|
|
33
|
+
* level: opt.enum(['low', 'medium', 'high']),
|
|
37
34
|
* });
|
|
38
35
|
* ```
|
|
39
36
|
*/
|
|
@@ -43,140 +40,115 @@ export declare const opt: {
|
|
|
43
40
|
*/
|
|
44
41
|
array: (items: "number" | "string", props?: Omit<ArrayOption, "items" | "type">) => ArrayOption;
|
|
45
42
|
/**
|
|
46
|
-
* Define a boolean option.
|
|
47
|
-
* inference.
|
|
43
|
+
* Define a boolean option.
|
|
48
44
|
*/
|
|
49
45
|
boolean: <P extends Omit<BooleanOption, "type"> = Omit<BooleanOption, "type">>(props?: P) => BooleanOption & P;
|
|
50
|
-
/**
|
|
51
|
-
* Define a command with proper type inference.
|
|
52
|
-
*
|
|
53
|
-
* Three usage patterns:
|
|
54
|
-
*
|
|
55
|
-
* 1. Simple usage (no global options): `bargs.command({ ... })`
|
|
56
|
-
* 2. With global options: `bargs.command<typeof globalOptions>()({ ... })`
|
|
57
|
-
* 3. With global options AND transforms: `bargs.command<typeof globalOptions,
|
|
58
|
-
* typeof globalTransforms>()({ ... })`
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
*
|
|
62
|
-
* ```typescript
|
|
63
|
-
* // Simple usage - no global options typed
|
|
64
|
-
* const simpleCmd = bargs.command({
|
|
65
|
-
* description: 'Simple command',
|
|
66
|
-
* handler: ({ values }) => { ... },
|
|
67
|
-
* });
|
|
68
|
-
*
|
|
69
|
-
* // With global options typed
|
|
70
|
-
* const globalOptions = {
|
|
71
|
-
* verbose: bargs.boolean({ aliases: ['v'] }),
|
|
72
|
-
* } as const;
|
|
73
|
-
*
|
|
74
|
-
* const greetCmd = bargs.command<typeof globalOptions>()({
|
|
75
|
-
* description: 'Greet someone',
|
|
76
|
-
* options: { name: bargs.string({ default: 'world' }) },
|
|
77
|
-
* handler: ({ values }) => {
|
|
78
|
-
* // values.verbose is properly typed as boolean | undefined
|
|
79
|
-
* console.log(`Hello, ${values.name}!`);
|
|
80
|
-
* },
|
|
81
|
-
* });
|
|
82
|
-
*
|
|
83
|
-
* // With global options AND global transforms typed
|
|
84
|
-
* const globalTransforms = {
|
|
85
|
-
* values: (v) => ({ ...v, timestamp: Date.now() }),
|
|
86
|
-
* } as const;
|
|
87
|
-
*
|
|
88
|
-
* const timedCmd = bargs.command<typeof globalOptions, typeof globalTransforms>()({
|
|
89
|
-
* description: 'Time-aware command',
|
|
90
|
-
* handler: ({ values }) => {
|
|
91
|
-
* // values.timestamp is properly typed from global transforms
|
|
92
|
-
* console.log(`Ran at ${values.timestamp}`);
|
|
93
|
-
* },
|
|
94
|
-
* });
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
command: CommandBuilder;
|
|
98
46
|
/**
|
|
99
47
|
* Define a count option (--verbose --verbose = 2).
|
|
100
48
|
*/
|
|
101
49
|
count: (props?: Omit<CountOption, "type">) => CountOption;
|
|
102
50
|
/**
|
|
103
|
-
* Define an enum option with string choices.
|
|
104
|
-
* a tuple of literal types automatically. Props type is preserved to enable
|
|
105
|
-
* default inference.
|
|
51
|
+
* Define an enum option with string choices.
|
|
106
52
|
*/
|
|
107
53
|
enum: <const T extends readonly string[], P extends Omit<EnumOption<T[number]>, "choices" | "type"> = Omit<EnumOption<T[number]>, "type" | "choices">>(choices: T, props?: P) => EnumOption<T[number]> & P;
|
|
108
54
|
/**
|
|
109
|
-
* Define an enum positional argument with string choices.
|
|
110
|
-
* is inferred as a tuple of literal types automatically.
|
|
55
|
+
* Define an enum positional argument with string choices.
|
|
111
56
|
*/
|
|
112
57
|
enumPos: <const T extends readonly string[], P extends Omit<EnumPositional<T[number]>, "choices" | "type"> = Omit<EnumPositional<T[number]>, "type" | "choices">>(choices: T, props?: P) => EnumPositional<T[number]> & P;
|
|
113
58
|
/**
|
|
114
|
-
* Define a number option.
|
|
115
|
-
* inference.
|
|
59
|
+
* Define a number option.
|
|
116
60
|
*/
|
|
117
61
|
number: <P extends Omit<NumberOption, "type"> = Omit<NumberOption, "type">>(props?: P) => NumberOption & P;
|
|
118
62
|
/**
|
|
119
|
-
* Define a number positional argument.
|
|
120
|
-
* required inference.
|
|
63
|
+
* Define a number positional argument.
|
|
121
64
|
*/
|
|
122
65
|
numberPos: <P extends Omit<NumberPositional, "type"> = Omit<NumberPositional, "type">>(props?: P) => NumberPositional & P;
|
|
123
66
|
/**
|
|
124
|
-
*
|
|
125
|
-
* ones for duplicate option names. Validates that no alias conflicts exist.
|
|
67
|
+
* Create a Parser from an options schema.
|
|
126
68
|
*
|
|
127
69
|
* @example
|
|
128
70
|
*
|
|
129
71
|
* ```typescript
|
|
130
|
-
*
|
|
131
|
-
* const loggingOpts = opt.options({
|
|
72
|
+
* const parser = opt.options({
|
|
132
73
|
* verbose: opt.boolean({ aliases: ['v'] }),
|
|
133
|
-
*
|
|
134
|
-
* });
|
|
135
|
-
*
|
|
136
|
-
* // Merge multiple schemas
|
|
137
|
-
* const allOpts = opt.options(loggingOpts, ioOpts, {
|
|
138
|
-
* format: opt.enum(['json', 'yaml'] as const),
|
|
74
|
+
* name: opt.string({ default: 'world' }),
|
|
139
75
|
* });
|
|
76
|
+
* // Type: Parser<{ verbose: boolean | undefined, name: string }, []>
|
|
140
77
|
* ```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
78
|
+
*/
|
|
79
|
+
options: <T extends OptionsSchema>(schema: T) => CallableOptionsParser<InferOptions<T>>;
|
|
80
|
+
/**
|
|
81
|
+
* Define a string option.
|
|
82
|
+
*/
|
|
83
|
+
string: <P extends Omit<StringOption, "type"> = Omit<StringOption, "type">>(props?: P) => P & StringOption;
|
|
84
|
+
/**
|
|
85
|
+
* Define a string positional argument.
|
|
86
|
+
*/
|
|
87
|
+
stringPos: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
88
|
+
/**
|
|
89
|
+
* Define a variadic positional (rest args).
|
|
90
|
+
*/
|
|
91
|
+
variadic: (items: "number" | "string", props?: Omit<VariadicPositional, "items" | "type">) => VariadicPositional;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* A Parser that can also be called as a function to merge with another parser.
|
|
95
|
+
* This allows `pos.positionals()` to work both as:
|
|
96
|
+
*
|
|
97
|
+
* - First arg in pipe: used directly as a Parser
|
|
98
|
+
* - Later arg in pipe: called as function to merge with incoming Parser
|
|
99
|
+
*
|
|
100
|
+
* For positionals, we DON'T intersect values - we just pass through V2.
|
|
101
|
+
*
|
|
102
|
+
* @knipignore
|
|
103
|
+
*/
|
|
104
|
+
export type CallablePositionalsParser<P extends readonly unknown[]> = (<V2, P2 extends readonly unknown[]>(parser: Parser<V2, P2>) => Parser<V2, readonly [...P2, ...P]>) & Parser<object, P>;
|
|
105
|
+
/**
|
|
106
|
+
* Namespaced positional builders.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
*
|
|
110
|
+
* ```typescript
|
|
111
|
+
* import { pos } from 'bargs';
|
|
112
|
+
*
|
|
113
|
+
* const parser = pos.positionals(
|
|
114
|
+
* pos.string({ name: 'input', required: true }),
|
|
115
|
+
* pos.string({ name: 'output' }),
|
|
116
|
+
* );
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare const pos: {
|
|
120
|
+
/**
|
|
121
|
+
* Define an enum positional argument with string choices.
|
|
122
|
+
*/
|
|
123
|
+
enum: <const T extends readonly string[], P extends Omit<EnumPositional<T[number]>, "choices" | "type"> = Omit<EnumPositional<T[number]>, "type" | "choices">>(choices: T, props?: P) => EnumPositional<T[number]> & P;
|
|
124
|
+
/**
|
|
125
|
+
* Define a number positional argument.
|
|
126
|
+
*/
|
|
127
|
+
number: <P extends Omit<NumberPositional, "type"> = Omit<NumberPositional, "type">>(props?: P) => NumberPositional & P;
|
|
151
128
|
/**
|
|
152
|
-
* Create a
|
|
129
|
+
* Create a Parser from positional definitions.
|
|
153
130
|
*
|
|
154
131
|
* @example
|
|
155
132
|
*
|
|
156
133
|
* ```typescript
|
|
157
|
-
* const
|
|
158
|
-
*
|
|
159
|
-
*
|
|
134
|
+
* const parser = pos.positionals(
|
|
135
|
+
* pos.string({ name: 'input', required: true }),
|
|
136
|
+
* pos.string({ name: 'output' }),
|
|
160
137
|
* );
|
|
138
|
+
* // Type: Parser<{}, readonly [string, string | undefined]>
|
|
161
139
|
* ```
|
|
162
140
|
*/
|
|
163
141
|
positionals: {
|
|
164
|
-
<A extends PositionalDef>(a: A): [A]
|
|
165
|
-
<A extends PositionalDef, B extends PositionalDef>(a: A, b: B): [A, B]
|
|
166
|
-
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef>(a: A, b: B, c: C): [A, B, C]
|
|
167
|
-
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef, D extends PositionalDef>(a: A, b: B, c: C, d: D): [A, B, C, D]
|
|
168
|
-
(...positionals: PositionalDef[]):
|
|
142
|
+
<A extends PositionalDef>(a: A): CallablePositionalsParser<readonly [InferPositionals<readonly [A]>[0]]>;
|
|
143
|
+
<A extends PositionalDef, B extends PositionalDef>(a: A, b: B): CallablePositionalsParser<InferPositionals<readonly [A, B]>>;
|
|
144
|
+
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef>(a: A, b: B, c: C): CallablePositionalsParser<InferPositionals<readonly [A, B, C]>>;
|
|
145
|
+
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef, D extends PositionalDef>(a: A, b: B, c: C, d: D): CallablePositionalsParser<InferPositionals<readonly [A, B, C, D]>>;
|
|
146
|
+
(...positionals: PositionalDef[]): CallablePositionalsParser<readonly unknown[]>;
|
|
169
147
|
};
|
|
170
148
|
/**
|
|
171
|
-
* Define a string
|
|
172
|
-
* inference.
|
|
149
|
+
* Define a string positional argument.
|
|
173
150
|
*/
|
|
174
|
-
string: <P extends Omit<
|
|
175
|
-
/**
|
|
176
|
-
* Define a string positional argument. Props type is preserved to enable
|
|
177
|
-
* required inference.
|
|
178
|
-
*/
|
|
179
|
-
stringPos: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
151
|
+
string: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
180
152
|
/**
|
|
181
153
|
* Define a variadic positional (rest args).
|
|
182
154
|
*/
|
package/dist/opt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opt.d.ts","sourceRoot":"","sources":["../src/opt.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"opt.d.ts","sourceRoot":"","sources":["../src/opt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,MAAM,EACN,aAAa,EAEb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EACnB,mBAAmB;AA2BpB;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,SAAS,OAAO,EAAE,EACxE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,KACnB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GACtB,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAsDzB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,GAAG;IAGd;;OAEG;mBAEM,QAAQ,GAAG,QAAQ,UACnB,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC,KACzC,WAAW;IAMd;;OAEG;cAED,CAAC,SAAS,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,wCAE9B,CA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