@boneskull/bargs 2.0.0 → 3.0.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 +305 -299
- package/dist/bargs.cjs +465 -135
- package/dist/bargs.cjs.map +1 -1
- package/dist/bargs.d.cts +35 -17
- package/dist/bargs.d.cts.map +1 -1
- package/dist/bargs.d.ts +35 -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 +20 -3
- package/dist/help.d.cts.map +1 -1
- package/dist/help.d.ts +20 -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 +15 -79
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +15 -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 +87 -113
- package/dist/opt.d.cts.map +1 -1
- package/dist/opt.d.ts +87 -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/types.cjs +1 -3
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +111 -233
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +111 -233
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -3
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
- 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,34 @@
|
|
|
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
|
|
17
18
|
*/
|
|
18
|
-
|
|
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
|
-
}
|
|
19
|
+
type CallableOptionsParser<V> = (<V2, P2 extends readonly unknown[]>(parser: Parser<V2, P2>) => Parser<V & V2, P2>) & Parser<V, readonly []>;
|
|
22
20
|
/**
|
|
23
21
|
* Namespaced option builders.
|
|
24
22
|
*
|
|
25
|
-
* Provides ergonomic helpers for defining CLI options, positionals, and
|
|
26
|
-
* commands with full TypeScript type inference.
|
|
27
|
-
*
|
|
28
23
|
* @example
|
|
29
24
|
*
|
|
30
25
|
* ```typescript
|
|
31
26
|
* import { opt } from 'bargs';
|
|
32
27
|
*
|
|
33
|
-
* const
|
|
28
|
+
* const parser = opt.options({
|
|
34
29
|
* verbose: opt.boolean({ aliases: ['v'] }),
|
|
35
30
|
* name: opt.string({ default: 'world' }),
|
|
36
|
-
* level: opt.enum(['low', 'medium', 'high']
|
|
31
|
+
* level: opt.enum(['low', 'medium', 'high']),
|
|
37
32
|
* });
|
|
38
33
|
* ```
|
|
39
34
|
*/
|
|
@@ -43,143 +38,122 @@ export declare const opt: {
|
|
|
43
38
|
*/
|
|
44
39
|
array: (items: "number" | "string", props?: Omit<ArrayOption, "items" | "type">) => ArrayOption;
|
|
45
40
|
/**
|
|
46
|
-
* Define a boolean option.
|
|
47
|
-
* inference.
|
|
41
|
+
* Define a boolean option.
|
|
48
42
|
*/
|
|
49
43
|
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
44
|
/**
|
|
99
45
|
* Define a count option (--verbose --verbose = 2).
|
|
100
46
|
*/
|
|
101
47
|
count: (props?: Omit<CountOption, "type">) => CountOption;
|
|
102
48
|
/**
|
|
103
|
-
* Define an enum option with string choices.
|
|
104
|
-
* a tuple of literal types automatically. Props type is preserved to enable
|
|
105
|
-
* default inference.
|
|
49
|
+
* Define an enum option with string choices.
|
|
106
50
|
*/
|
|
107
51
|
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
52
|
/**
|
|
109
|
-
* Define an enum positional argument with string choices.
|
|
110
|
-
* is inferred as a tuple of literal types automatically.
|
|
53
|
+
* Define an enum positional argument with string choices.
|
|
111
54
|
*/
|
|
112
55
|
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
56
|
/**
|
|
114
|
-
* Define a number option.
|
|
115
|
-
* inference.
|
|
57
|
+
* Define a number option.
|
|
116
58
|
*/
|
|
117
59
|
number: <P extends Omit<NumberOption, "type"> = Omit<NumberOption, "type">>(props?: P) => NumberOption & P;
|
|
118
60
|
/**
|
|
119
|
-
* Define a number positional argument.
|
|
120
|
-
* required inference.
|
|
61
|
+
* Define a number positional argument.
|
|
121
62
|
*/
|
|
122
63
|
numberPos: <P extends Omit<NumberPositional, "type"> = Omit<NumberPositional, "type">>(props?: P) => NumberPositional & P;
|
|
123
64
|
/**
|
|
124
|
-
*
|
|
125
|
-
* ones for duplicate option names. Validates that no alias conflicts exist.
|
|
65
|
+
* Create a Parser from an options schema.
|
|
126
66
|
*
|
|
127
67
|
* @example
|
|
128
68
|
*
|
|
129
69
|
* ```typescript
|
|
130
|
-
*
|
|
131
|
-
* const loggingOpts = opt.options({
|
|
70
|
+
* const parser = opt.options({
|
|
132
71
|
* 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),
|
|
72
|
+
* name: opt.string({ default: 'world' }),
|
|
139
73
|
* });
|
|
74
|
+
* // Type: Parser<{ verbose: boolean | undefined, name: string }, []>
|
|
140
75
|
* ```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
76
|
+
*/
|
|
77
|
+
options: <T extends OptionsSchema>(schema: T) => CallableOptionsParser<InferOptions<T>>;
|
|
78
|
+
/**
|
|
79
|
+
* Define a string option.
|
|
80
|
+
*/
|
|
81
|
+
string: <P extends Omit<StringOption, "type"> = Omit<StringOption, "type">>(props?: P) => P & StringOption;
|
|
82
|
+
/**
|
|
83
|
+
* Define a string positional argument.
|
|
84
|
+
*/
|
|
85
|
+
stringPos: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
86
|
+
/**
|
|
87
|
+
* Define a variadic positional (rest args).
|
|
88
|
+
*/
|
|
89
|
+
variadic: (items: "number" | "string", props?: Omit<VariadicPositional, "items" | "type">) => VariadicPositional;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* A Parser that can also be called as a function to merge with another parser.
|
|
93
|
+
* This allows `pos.positionals()` to work both as:
|
|
94
|
+
*
|
|
95
|
+
* - First arg in pipe: used directly as a Parser
|
|
96
|
+
* - Later arg in pipe: called as function to merge with incoming Parser
|
|
97
|
+
*
|
|
98
|
+
* For positionals, we DON'T intersect values - we just pass through V2.
|
|
99
|
+
*/
|
|
100
|
+
type CallablePositionalsParser<P extends readonly unknown[]> = (<V2, P2 extends readonly unknown[]>(parser: Parser<V2, P2>) => Parser<V2, readonly [...P2, ...P]>) & Parser<EmptyObject, P>;
|
|
101
|
+
/**
|
|
102
|
+
* Empty object type that works better with intersections than Record<string,
|
|
103
|
+
* never>. {} & T = T, but Record<string, never> & T can be problematic.
|
|
104
|
+
*/
|
|
105
|
+
type EmptyObject = {};
|
|
106
|
+
/**
|
|
107
|
+
* Namespaced positional builders.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
*
|
|
111
|
+
* ```typescript
|
|
112
|
+
* import { pos } from 'bargs';
|
|
113
|
+
*
|
|
114
|
+
* const parser = pos.positionals(
|
|
115
|
+
* pos.string({ name: 'input', required: true }),
|
|
116
|
+
* pos.string({ name: 'output' }),
|
|
117
|
+
* );
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare const pos: {
|
|
121
|
+
/**
|
|
122
|
+
* Define an enum positional argument with string choices.
|
|
123
|
+
*/
|
|
124
|
+
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;
|
|
125
|
+
/**
|
|
126
|
+
* Define a number positional argument.
|
|
127
|
+
*/
|
|
128
|
+
number: <P extends Omit<NumberPositional, "type"> = Omit<NumberPositional, "type">>(props?: P) => NumberPositional & P;
|
|
151
129
|
/**
|
|
152
|
-
* Create a
|
|
130
|
+
* Create a Parser from positional definitions.
|
|
153
131
|
*
|
|
154
132
|
* @example
|
|
155
133
|
*
|
|
156
134
|
* ```typescript
|
|
157
|
-
* const
|
|
158
|
-
*
|
|
159
|
-
*
|
|
135
|
+
* const parser = pos.positionals(
|
|
136
|
+
* pos.string({ name: 'input', required: true }),
|
|
137
|
+
* pos.string({ name: 'output' }),
|
|
160
138
|
* );
|
|
139
|
+
* // Type: Parser<{}, readonly [string, string | undefined]>
|
|
161
140
|
* ```
|
|
162
141
|
*/
|
|
163
142
|
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[]):
|
|
143
|
+
<A extends PositionalDef>(a: A): CallablePositionalsParser<readonly [InferPositionals<readonly [A]>[0]]>;
|
|
144
|
+
<A extends PositionalDef, B extends PositionalDef>(a: A, b: B): CallablePositionalsParser<InferPositionals<readonly [A, B]>>;
|
|
145
|
+
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef>(a: A, b: B, c: C): CallablePositionalsParser<InferPositionals<readonly [A, B, C]>>;
|
|
146
|
+
<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]>>;
|
|
147
|
+
(...positionals: PositionalDef[]): CallablePositionalsParser<readonly unknown[]>;
|
|
169
148
|
};
|
|
170
149
|
/**
|
|
171
|
-
* Define a string
|
|
172
|
-
* inference.
|
|
150
|
+
* Define a string positional argument.
|
|
173
151
|
*/
|
|
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;
|
|
152
|
+
string: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
180
153
|
/**
|
|
181
154
|
* Define a variadic positional (rest args).
|
|
182
155
|
*/
|
|
183
156
|
variadic: (items: "number" | "string", props?: Omit<VariadicPositional, "items" | "type">) => VariadicPositional;
|
|
184
157
|
};
|
|
158
|
+
export {};
|
|
185
159
|
//# sourceMappingURL=opt.d.ts.map
|
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;;;;;;GAMG;AACH,KAAK,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,SAAS,OAAO,EAAE,EACjE,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,CAA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CAAC,CAAC;QACnE,CACE,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,aAAa,EACvB,CAAC,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,34 @@
|
|
|
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
|
|
17
18
|
*/
|
|
18
|
-
|
|
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
|
-
}
|
|
19
|
+
type CallableOptionsParser<V> = (<V2, P2 extends readonly unknown[]>(parser: Parser<V2, P2>) => Parser<V & V2, P2>) & Parser<V, readonly []>;
|
|
22
20
|
/**
|
|
23
21
|
* Namespaced option builders.
|
|
24
22
|
*
|
|
25
|
-
* Provides ergonomic helpers for defining CLI options, positionals, and
|
|
26
|
-
* commands with full TypeScript type inference.
|
|
27
|
-
*
|
|
28
23
|
* @example
|
|
29
24
|
*
|
|
30
25
|
* ```typescript
|
|
31
26
|
* import { opt } from 'bargs';
|
|
32
27
|
*
|
|
33
|
-
* const
|
|
28
|
+
* const parser = opt.options({
|
|
34
29
|
* verbose: opt.boolean({ aliases: ['v'] }),
|
|
35
30
|
* name: opt.string({ default: 'world' }),
|
|
36
|
-
* level: opt.enum(['low', 'medium', 'high']
|
|
31
|
+
* level: opt.enum(['low', 'medium', 'high']),
|
|
37
32
|
* });
|
|
38
33
|
* ```
|
|
39
34
|
*/
|
|
@@ -43,143 +38,122 @@ export declare const opt: {
|
|
|
43
38
|
*/
|
|
44
39
|
array: (items: "number" | "string", props?: Omit<ArrayOption, "items" | "type">) => ArrayOption;
|
|
45
40
|
/**
|
|
46
|
-
* Define a boolean option.
|
|
47
|
-
* inference.
|
|
41
|
+
* Define a boolean option.
|
|
48
42
|
*/
|
|
49
43
|
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
44
|
/**
|
|
99
45
|
* Define a count option (--verbose --verbose = 2).
|
|
100
46
|
*/
|
|
101
47
|
count: (props?: Omit<CountOption, "type">) => CountOption;
|
|
102
48
|
/**
|
|
103
|
-
* Define an enum option with string choices.
|
|
104
|
-
* a tuple of literal types automatically. Props type is preserved to enable
|
|
105
|
-
* default inference.
|
|
49
|
+
* Define an enum option with string choices.
|
|
106
50
|
*/
|
|
107
51
|
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
52
|
/**
|
|
109
|
-
* Define an enum positional argument with string choices.
|
|
110
|
-
* is inferred as a tuple of literal types automatically.
|
|
53
|
+
* Define an enum positional argument with string choices.
|
|
111
54
|
*/
|
|
112
55
|
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
56
|
/**
|
|
114
|
-
* Define a number option.
|
|
115
|
-
* inference.
|
|
57
|
+
* Define a number option.
|
|
116
58
|
*/
|
|
117
59
|
number: <P extends Omit<NumberOption, "type"> = Omit<NumberOption, "type">>(props?: P) => NumberOption & P;
|
|
118
60
|
/**
|
|
119
|
-
* Define a number positional argument.
|
|
120
|
-
* required inference.
|
|
61
|
+
* Define a number positional argument.
|
|
121
62
|
*/
|
|
122
63
|
numberPos: <P extends Omit<NumberPositional, "type"> = Omit<NumberPositional, "type">>(props?: P) => NumberPositional & P;
|
|
123
64
|
/**
|
|
124
|
-
*
|
|
125
|
-
* ones for duplicate option names. Validates that no alias conflicts exist.
|
|
65
|
+
* Create a Parser from an options schema.
|
|
126
66
|
*
|
|
127
67
|
* @example
|
|
128
68
|
*
|
|
129
69
|
* ```typescript
|
|
130
|
-
*
|
|
131
|
-
* const loggingOpts = opt.options({
|
|
70
|
+
* const parser = opt.options({
|
|
132
71
|
* 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),
|
|
72
|
+
* name: opt.string({ default: 'world' }),
|
|
139
73
|
* });
|
|
74
|
+
* // Type: Parser<{ verbose: boolean | undefined, name: string }, []>
|
|
140
75
|
* ```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
76
|
+
*/
|
|
77
|
+
options: <T extends OptionsSchema>(schema: T) => CallableOptionsParser<InferOptions<T>>;
|
|
78
|
+
/**
|
|
79
|
+
* Define a string option.
|
|
80
|
+
*/
|
|
81
|
+
string: <P extends Omit<StringOption, "type"> = Omit<StringOption, "type">>(props?: P) => P & StringOption;
|
|
82
|
+
/**
|
|
83
|
+
* Define a string positional argument.
|
|
84
|
+
*/
|
|
85
|
+
stringPos: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
86
|
+
/**
|
|
87
|
+
* Define a variadic positional (rest args).
|
|
88
|
+
*/
|
|
89
|
+
variadic: (items: "number" | "string", props?: Omit<VariadicPositional, "items" | "type">) => VariadicPositional;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* A Parser that can also be called as a function to merge with another parser.
|
|
93
|
+
* This allows `pos.positionals()` to work both as:
|
|
94
|
+
*
|
|
95
|
+
* - First arg in pipe: used directly as a Parser
|
|
96
|
+
* - Later arg in pipe: called as function to merge with incoming Parser
|
|
97
|
+
*
|
|
98
|
+
* For positionals, we DON'T intersect values - we just pass through V2.
|
|
99
|
+
*/
|
|
100
|
+
type CallablePositionalsParser<P extends readonly unknown[]> = (<V2, P2 extends readonly unknown[]>(parser: Parser<V2, P2>) => Parser<V2, readonly [...P2, ...P]>) & Parser<EmptyObject, P>;
|
|
101
|
+
/**
|
|
102
|
+
* Empty object type that works better with intersections than Record<string,
|
|
103
|
+
* never>. {} & T = T, but Record<string, never> & T can be problematic.
|
|
104
|
+
*/
|
|
105
|
+
type EmptyObject = {};
|
|
106
|
+
/**
|
|
107
|
+
* Namespaced positional builders.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
*
|
|
111
|
+
* ```typescript
|
|
112
|
+
* import { pos } from 'bargs';
|
|
113
|
+
*
|
|
114
|
+
* const parser = pos.positionals(
|
|
115
|
+
* pos.string({ name: 'input', required: true }),
|
|
116
|
+
* pos.string({ name: 'output' }),
|
|
117
|
+
* );
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare const pos: {
|
|
121
|
+
/**
|
|
122
|
+
* Define an enum positional argument with string choices.
|
|
123
|
+
*/
|
|
124
|
+
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;
|
|
125
|
+
/**
|
|
126
|
+
* Define a number positional argument.
|
|
127
|
+
*/
|
|
128
|
+
number: <P extends Omit<NumberPositional, "type"> = Omit<NumberPositional, "type">>(props?: P) => NumberPositional & P;
|
|
151
129
|
/**
|
|
152
|
-
* Create a
|
|
130
|
+
* Create a Parser from positional definitions.
|
|
153
131
|
*
|
|
154
132
|
* @example
|
|
155
133
|
*
|
|
156
134
|
* ```typescript
|
|
157
|
-
* const
|
|
158
|
-
*
|
|
159
|
-
*
|
|
135
|
+
* const parser = pos.positionals(
|
|
136
|
+
* pos.string({ name: 'input', required: true }),
|
|
137
|
+
* pos.string({ name: 'output' }),
|
|
160
138
|
* );
|
|
139
|
+
* // Type: Parser<{}, readonly [string, string | undefined]>
|
|
161
140
|
* ```
|
|
162
141
|
*/
|
|
163
142
|
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[]):
|
|
143
|
+
<A extends PositionalDef>(a: A): CallablePositionalsParser<readonly [InferPositionals<readonly [A]>[0]]>;
|
|
144
|
+
<A extends PositionalDef, B extends PositionalDef>(a: A, b: B): CallablePositionalsParser<InferPositionals<readonly [A, B]>>;
|
|
145
|
+
<A extends PositionalDef, B extends PositionalDef, C extends PositionalDef>(a: A, b: B, c: C): CallablePositionalsParser<InferPositionals<readonly [A, B, C]>>;
|
|
146
|
+
<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]>>;
|
|
147
|
+
(...positionals: PositionalDef[]): CallablePositionalsParser<readonly unknown[]>;
|
|
169
148
|
};
|
|
170
149
|
/**
|
|
171
|
-
* Define a string
|
|
172
|
-
* inference.
|
|
150
|
+
* Define a string positional argument.
|
|
173
151
|
*/
|
|
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;
|
|
152
|
+
string: <P extends Omit<StringPositional, "type"> = Omit<StringPositional, "type">>(props?: P) => P & StringPositional;
|
|
180
153
|
/**
|
|
181
154
|
* Define a variadic positional (rest args).
|
|
182
155
|
*/
|
|
183
156
|
variadic: (items: "number" | "string", props?: Omit<VariadicPositional, "items" | "type">) => VariadicPositional;
|
|
184
157
|
};
|
|
158
|
+
export {};
|
|
185
159
|
//# sourceMappingURL=opt.d.ts.map
|
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;;;;;;GAMG;AACH,KAAK,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,SAAS,OAAO,EAAE,EACjE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,KACnB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,CAA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