@boneskull/bargs 1.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.
Files changed (58) hide show
  1. package/README.md +305 -299
  2. package/dist/bargs.cjs +464 -142
  3. package/dist/bargs.cjs.map +1 -1
  4. package/dist/bargs.d.cts +35 -17
  5. package/dist/bargs.d.cts.map +1 -1
  6. package/dist/bargs.d.ts +35 -17
  7. package/dist/bargs.d.ts.map +1 -1
  8. package/dist/bargs.js +462 -142
  9. package/dist/bargs.js.map +1 -1
  10. package/dist/help.cjs +1 -2
  11. package/dist/help.cjs.map +1 -1
  12. package/dist/help.d.cts +20 -3
  13. package/dist/help.d.cts.map +1 -1
  14. package/dist/help.d.ts +20 -3
  15. package/dist/help.d.ts.map +1 -1
  16. package/dist/help.js +1 -2
  17. package/dist/help.js.map +1 -1
  18. package/dist/index.cjs +27 -31
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +15 -78
  21. package/dist/index.d.cts.map +1 -1
  22. package/dist/index.d.ts +15 -78
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +20 -30
  25. package/dist/index.js.map +1 -1
  26. package/dist/opt.cjs +147 -80
  27. package/dist/opt.cjs.map +1 -1
  28. package/dist/opt.d.cts +88 -77
  29. package/dist/opt.d.cts.map +1 -1
  30. package/dist/opt.d.ts +88 -77
  31. package/dist/opt.d.ts.map +1 -1
  32. package/dist/opt.js +146 -79
  33. package/dist/opt.js.map +1 -1
  34. package/dist/parser.cjs +3 -230
  35. package/dist/parser.cjs.map +1 -1
  36. package/dist/parser.d.cts +3 -51
  37. package/dist/parser.d.cts.map +1 -1
  38. package/dist/parser.d.ts +3 -51
  39. package/dist/parser.d.ts.map +1 -1
  40. package/dist/parser.js +2 -223
  41. package/dist/parser.js.map +1 -1
  42. package/dist/types.cjs +1 -3
  43. package/dist/types.cjs.map +1 -1
  44. package/dist/types.d.cts +110 -122
  45. package/dist/types.d.cts.map +1 -1
  46. package/dist/types.d.ts +110 -122
  47. package/dist/types.d.ts.map +1 -1
  48. package/dist/types.js +1 -3
  49. package/dist/types.js.map +1 -1
  50. package/package.json +2 -2
  51. package/dist/validate.cjs +0 -463
  52. package/dist/validate.cjs.map +0 -1
  53. package/dist/validate.d.cts +0 -28
  54. package/dist/validate.d.cts.map +0 -1
  55. package/dist/validate.d.ts +0 -28
  56. package/dist/validate.d.ts.map +0 -1
  57. package/dist/validate.js +0 -459
  58. package/dist/validate.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,96 +1,33 @@
1
1
  /**
2
2
  * Main entry point for the bargs CLI argument parser.
3
3
  *
4
- * This module exports the primary `bargs` and `bargsAsync` functions with
5
- * attached option builder methods (e.g., `bargs.string()`, `bargs.boolean()`),
6
- * allowing both function-call and builder-namespace usage patterns. It also
7
- * re-exports all public types, error classes, help generators, theme utilities,
8
- * and OSC hyperlink functions.
4
+ * Provides a combinator-style API for building type-safe CLIs.
9
5
  *
10
6
  * @example
11
7
  *
12
8
  * ```typescript
13
- * import { bargs } from 'bargs';
9
+ * import { bargs, opt, pos } from '@boneskull/bargs';
14
10
  *
15
- * // Use as function
16
- * const result = bargs({
17
- * name: 'myapp',
18
- * options: { verbose: bargs.boolean({ aliases: ['v'] }) },
19
- * });
20
- *
21
- * // Access builder namespace
22
- * const opts = bargs.options({ name: bargs.string() });
11
+ * await bargs
12
+ * .create('my-app', { version: '1.0.0' })
13
+ * .globals(opt.options({ verbose: opt.boolean({ aliases: ['v'] }) }))
14
+ * .command(
15
+ * 'greet',
16
+ * pos.positionals(pos.string({ name: 'name', required: true })),
17
+ * ({ positionals }) => console.log(`Hello, ${positionals[0]}!`),
18
+ * 'Say hello',
19
+ * )
20
+ * .parseAsync();
23
21
  * ```
24
22
  *
25
23
  * @packageDocumentation
26
24
  */
27
- import { bargsAsync as bargsAsyncBase, bargs as bargsBase } from "./bargs.js";
28
- /**
29
- * Main bargs entry point (sync). Also provides access to all opt builders via
30
- * bargs.string(), bargs.boolean(), etc.
31
- */
32
- export declare const bargs: typeof bargsBase & {
33
- array: (items: "number" | "string", props?: Omit<import("./types.js").ArrayOption, "items" | "type">) => import("./types.js").ArrayOption;
34
- boolean: <P extends Omit<import("./types.js").BooleanOption, "type"> = Omit<import("./types.js").BooleanOption, "type">>(props?: P) => import("./types.js").BooleanOption & P;
35
- command: <TOptions extends import("./types.js").OptionsSchema = import("./types.js").OptionsSchema, TPositionals extends import("./types.js").PositionalsSchema = import("./types.js").PositionalsSchema, TTransforms extends import("./types.js").TransformsConfig<any, any, any, any> | undefined = undefined>(config: import("./types.js").CommandConfig<TOptions, TPositionals, TTransforms>) => import("./types.js").CommandConfig<TOptions, TPositionals, TTransforms>;
36
- count: (props?: Omit<import("./types.js").CountOption, "type">) => import("./types.js").CountOption;
37
- enum: <const T extends readonly string[], P extends Omit<import("./types.js").EnumOption<T[number]>, "choices" | "type"> = Omit<import("./types.js").EnumOption<T[number]>, "type" | "choices">>(choices: T, props?: P) => import("./types.js").EnumOption<T[number]> & P;
38
- enumPos: <const T extends readonly string[], P extends Omit<import("./types.js").EnumPositional<T[number]>, "choices" | "type"> = Omit<import("./types.js").EnumPositional<T[number]>, "type" | "choices">>(choices: T, props?: P) => import("./types.js").EnumPositional<T[number]> & P;
39
- number: <P extends Omit<import("./types.js").NumberOption, "type"> = Omit<import("./types.js").NumberOption, "type">>(props?: P) => import("./types.js").NumberOption & P;
40
- numberPos: (props?: Omit<import("./types.js").NumberPositional, "type">) => import("./types.js").NumberPositional;
41
- options: {
42
- <A extends import("./types.js").OptionsSchema>(a: A): A;
43
- <A extends import("./types.js").OptionsSchema, B extends import("./types.js").OptionsSchema>(a: A, b: B): A & B;
44
- <A extends import("./types.js").OptionsSchema, B extends import("./types.js").OptionsSchema, C extends import("./types.js").OptionsSchema>(a: A, b: B, c: C): A & B & C;
45
- <A extends import("./types.js").OptionsSchema, B extends import("./types.js").OptionsSchema, C extends import("./types.js").OptionsSchema, D extends import("./types.js").OptionsSchema>(a: A, b: B, c: C, d: D): A & B & C & D;
46
- (...schemas: import("./types.js").OptionsSchema[]): import("./types.js").OptionsSchema;
47
- };
48
- positionals: {
49
- <A extends import("./types.js").PositionalDef>(a: A): [A];
50
- <A extends import("./types.js").PositionalDef, B extends import("./types.js").PositionalDef>(a: A, b: B): [A, B];
51
- <A extends import("./types.js").PositionalDef, B extends import("./types.js").PositionalDef, C extends import("./types.js").PositionalDef>(a: A, b: B, c: C): [A, B, C];
52
- <A extends import("./types.js").PositionalDef, B extends import("./types.js").PositionalDef, C extends import("./types.js").PositionalDef, D extends import("./types.js").PositionalDef>(a: A, b: B, c: C, d: D): [A, B, C, D];
53
- (...positionals: import("./types.js").PositionalDef[]): import("./types.js").PositionalsSchema;
54
- };
55
- string: <P extends Omit<import("./types.js").StringOption, "type"> = Omit<import("./types.js").StringOption, "type">>(props?: P) => P & import("./types.js").StringOption;
56
- stringPos: (props?: Omit<import("./types.js").StringPositional, "type">) => import("./types.js").StringPositional;
57
- variadic: (items: "number" | "string", props?: Omit<import("./types.js").VariadicPositional, "items" | "type">) => import("./types.js").VariadicPositional;
58
- };
59
- /**
60
- * Async bargs entry point. Also provides access to all opt builders via
61
- * bargsAsync.string(), etc.
62
- */
63
- export declare const bargsAsync: typeof bargsAsyncBase & {
64
- array: (items: "number" | "string", props?: Omit<import("./types.js").ArrayOption, "items" | "type">) => import("./types.js").ArrayOption;
65
- boolean: <P extends Omit<import("./types.js").BooleanOption, "type"> = Omit<import("./types.js").BooleanOption, "type">>(props?: P) => import("./types.js").BooleanOption & P;
66
- command: <TOptions extends import("./types.js").OptionsSchema = import("./types.js").OptionsSchema, TPositionals extends import("./types.js").PositionalsSchema = import("./types.js").PositionalsSchema, TTransforms extends import("./types.js").TransformsConfig<any, any, any, any> | undefined = undefined>(config: import("./types.js").CommandConfig<TOptions, TPositionals, TTransforms>) => import("./types.js").CommandConfig<TOptions, TPositionals, TTransforms>;
67
- count: (props?: Omit<import("./types.js").CountOption, "type">) => import("./types.js").CountOption;
68
- enum: <const T extends readonly string[], P extends Omit<import("./types.js").EnumOption<T[number]>, "choices" | "type"> = Omit<import("./types.js").EnumOption<T[number]>, "type" | "choices">>(choices: T, props?: P) => import("./types.js").EnumOption<T[number]> & P;
69
- enumPos: <const T extends readonly string[], P extends Omit<import("./types.js").EnumPositional<T[number]>, "choices" | "type"> = Omit<import("./types.js").EnumPositional<T[number]>, "type" | "choices">>(choices: T, props?: P) => import("./types.js").EnumPositional<T[number]> & P;
70
- number: <P extends Omit<import("./types.js").NumberOption, "type"> = Omit<import("./types.js").NumberOption, "type">>(props?: P) => import("./types.js").NumberOption & P;
71
- numberPos: (props?: Omit<import("./types.js").NumberPositional, "type">) => import("./types.js").NumberPositional;
72
- options: {
73
- <A extends import("./types.js").OptionsSchema>(a: A): A;
74
- <A extends import("./types.js").OptionsSchema, B extends import("./types.js").OptionsSchema>(a: A, b: B): A & B;
75
- <A extends import("./types.js").OptionsSchema, B extends import("./types.js").OptionsSchema, C extends import("./types.js").OptionsSchema>(a: A, b: B, c: C): A & B & C;
76
- <A extends import("./types.js").OptionsSchema, B extends import("./types.js").OptionsSchema, C extends import("./types.js").OptionsSchema, D extends import("./types.js").OptionsSchema>(a: A, b: B, c: C, d: D): A & B & C & D;
77
- (...schemas: import("./types.js").OptionsSchema[]): import("./types.js").OptionsSchema;
78
- };
79
- positionals: {
80
- <A extends import("./types.js").PositionalDef>(a: A): [A];
81
- <A extends import("./types.js").PositionalDef, B extends import("./types.js").PositionalDef>(a: A, b: B): [A, B];
82
- <A extends import("./types.js").PositionalDef, B extends import("./types.js").PositionalDef, C extends import("./types.js").PositionalDef>(a: A, b: B, c: C): [A, B, C];
83
- <A extends import("./types.js").PositionalDef, B extends import("./types.js").PositionalDef, C extends import("./types.js").PositionalDef, D extends import("./types.js").PositionalDef>(a: A, b: B, c: C, d: D): [A, B, C, D];
84
- (...positionals: import("./types.js").PositionalDef[]): import("./types.js").PositionalsSchema;
85
- };
86
- string: <P extends Omit<import("./types.js").StringOption, "type"> = Omit<import("./types.js").StringOption, "type">>(props?: P) => P & import("./types.js").StringOption;
87
- stringPos: (props?: Omit<import("./types.js").StringPositional, "type">) => import("./types.js").StringPositional;
88
- variadic: (items: "number" | "string", props?: Omit<import("./types.js").VariadicPositional, "items" | "type">) => import("./types.js").VariadicPositional;
89
- };
25
+ export { bargs, handle, map, merge } from "./bargs.js";
90
26
  export { BargsError, HelpError, ValidationError } from "./errors.js";
91
27
  export { generateCommandHelp, generateHelp } from "./help.js";
28
+ export { opt, pos } from "./opt.js";
92
29
  export { link, linkifyUrls, supportsHyperlinks } from "./osc.js";
93
30
  export { ansi, createStyler, defaultTheme, stripAnsi, themes, } from "./theme.js";
94
31
  export type { StyleFn, Styler, Theme, ThemeColors, ThemeInput, } from "./theme.js";
95
- export type { AnyCommandConfig, ArrayOption, BargsConfig, BargsConfigWithCommands, BargsOptions, BargsResult, BooleanOption, CommandConfig, CommandConfigInput, CountOption, EnumOption, EnumPositional, Handler, HandlerFn, InferOption, InferOptions, InferPositional, InferPositionals, InferTransformedPositionals, InferTransformedValues, NumberOption, NumberPositional, OptionDef, OptionsSchema, PositionalDef, PositionalsSchema, PositionalsTransformFn, StringOption, StringPositional, TransformsConfig, ValuesTransformFn, VariadicPositional, } from "./types.js";
32
+ export type { ArrayOption, BooleanOption, CliBuilder, CliResult, Command, CommandDef, CountOption, CreateOptions, EnumOption, EnumPositional, HandlerFn, InferOption, InferOptions, InferPositional, InferPositionals, InferTransformedPositionals, InferTransformedValues, NumberOption, NumberPositional, OptionDef, OptionsSchema, Parser, ParseResult, PositionalDef, PositionalsSchema, PositionalsTransformFn, StringOption, StringPositional, TransformsConfig, ValuesTransformFn, VariadicPositional, } from "./types.js";
96
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA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KAAK,EAAE,mBAAmB;AAGvD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB;AAGrE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB;AAG9D,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,iBAAiB;AAGpC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,iBAAiB;AAGjE,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,MAAM,GACP,mBAAmB;AAGpB,YAAY,EACV,OAAO,EACP,MAAM,EACN,KAAK,EACL,WAAW,EACX,UAAU,GACX,mBAAmB;AAGpB,YAAY,EAEV,WAAW,EACX,aAAa,EAEb,UAAU,EACV,SAAS,EACT,OAAO,EACP,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,EAEV,cAAc,EACd,SAAS,EAET,WAAW,EACX,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EAEjB,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,mBAAmB"}
package/dist/index.js CHANGED
@@ -1,47 +1,37 @@
1
1
  /**
2
2
  * Main entry point for the bargs CLI argument parser.
3
3
  *
4
- * This module exports the primary `bargs` and `bargsAsync` functions with
5
- * attached option builder methods (e.g., `bargs.string()`, `bargs.boolean()`),
6
- * allowing both function-call and builder-namespace usage patterns. It also
7
- * re-exports all public types, error classes, help generators, theme utilities,
8
- * and OSC hyperlink functions.
4
+ * Provides a combinator-style API for building type-safe CLIs.
9
5
  *
10
6
  * @example
11
7
  *
12
8
  * ```typescript
13
- * import { bargs } from 'bargs';
9
+ * import { bargs, opt, pos } from '@boneskull/bargs';
14
10
  *
15
- * // Use as function
16
- * const result = bargs({
17
- * name: 'myapp',
18
- * options: { verbose: bargs.boolean({ aliases: ['v'] }) },
19
- * });
20
- *
21
- * // Access builder namespace
22
- * const opts = bargs.options({ name: bargs.string() });
11
+ * await bargs
12
+ * .create('my-app', { version: '1.0.0' })
13
+ * .globals(opt.options({ verbose: opt.boolean({ aliases: ['v'] }) }))
14
+ * .command(
15
+ * 'greet',
16
+ * pos.positionals(pos.string({ name: 'name', required: true })),
17
+ * ({ positionals }) => console.log(`Hello, ${positionals[0]}!`),
18
+ * 'Say hello',
19
+ * )
20
+ * .parseAsync();
23
21
  * ```
24
22
  *
25
23
  * @packageDocumentation
26
24
  */
27
- import { bargsAsync as bargsAsyncBase, bargs as bargsBase } from "./bargs.js";
28
- import { opt } from "./opt.js";
29
- /**
30
- * Main bargs entry point (sync). Also provides access to all opt builders via
31
- * bargs.string(), bargs.boolean(), etc.
32
- */
33
- export const bargs = Object.assign(bargsBase, opt);
34
- /**
35
- * Async bargs entry point. Also provides access to all opt builders via
36
- * bargsAsync.string(), etc.
37
- */
38
- export const bargsAsync = Object.assign(bargsAsyncBase, opt);
39
- // Re-export errors
25
+ // Main API
26
+ export { bargs, handle, map, merge } from "./bargs.js";
27
+ // Errors
40
28
  export { BargsError, HelpError, ValidationError } from "./errors.js";
41
- // Re-export help generators
29
+ // Help generators
42
30
  export { generateCommandHelp, generateHelp } from "./help.js";
43
- // Re-export OSC utilities for terminal hyperlinks
31
+ // Option and positional builders
32
+ export { opt, pos } from "./opt.js";
33
+ // OSC utilities for terminal hyperlinks
44
34
  export { link, linkifyUrls, supportsHyperlinks } from "./osc.js";
45
- // Re-export theme utilities
35
+ // Theme utilities
46
36
  export { ansi, createStyler, defaultTheme, stripAnsi, themes, } from "./theme.js";
47
37
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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P,mBAAmB"}
package/dist/opt.cjs CHANGED
@@ -1,22 +1,19 @@
1
1
  "use strict";
2
2
  /**
3
- * Builder functions for defining CLI options, positionals, and commands.
3
+ * Builder functions for defining CLI options and positionals.
4
4
  *
5
5
  * Provides ergonomic helpers with full TypeScript type inference for
6
6
  * constructing option schemas (`opt.string()`, `opt.boolean()`, `opt.enum()`,
7
- * etc.), positional schemas (`opt.stringPos()`, `opt.numberPos()`,
8
- * `opt.variadic()`), and command definitions (`opt.command()`). Includes
9
- * composition utilities for merging schemas (`opt.options()`,
10
- * `opt.positionals()`).
7
+ * etc.) and positional schemas (`opt.stringPos()`, `opt.numberPos()`,
8
+ * `opt.variadic()`).
11
9
  *
12
10
  * @packageDocumentation
13
11
  */
14
12
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.opt = void 0;
13
+ exports.pos = exports.opt = void 0;
16
14
  const errors_js_1 = require("./errors.cjs");
17
15
  /**
18
- * Validate that no alias conflicts exist in a merged options schema. Throws
19
- * BargsError if the same alias is used by multiple options.
16
+ * Validate that no alias conflicts exist in a merged options schema.
20
17
  */
21
18
  const validateAliasConflicts = (schema) => {
22
19
  const aliasToOption = new Map();
@@ -34,32 +31,56 @@ const validateAliasConflicts = (schema) => {
34
31
  }
35
32
  };
36
33
  /**
37
- * Compose multiple option schemas into one.
34
+ * Create a Parser from an options schema that can also merge with existing
35
+ * parsers.
36
+ *
37
+ * Supports two usage patterns:
38
+ *
39
+ * 1. Standalone: `opt.options({ ... })` - returns a Parser
40
+ * 2. Merging: `pos.positionals(...)(opt.options(...))` - merges positionals into
41
+ * options
38
42
  */
39
- const optionsImpl = (...schemas) => {
40
- const merged = Object.assign({}, ...schemas);
41
- validateAliasConflicts(merged);
42
- return merged;
43
+ const optionsImpl = (schema) => {
44
+ validateAliasConflicts(schema);
45
+ // Create the merge function
46
+ const merger = (parser) => {
47
+ const mergedSchema = { ...parser.__optionsSchema, ...schema };
48
+ validateAliasConflicts(mergedSchema);
49
+ // Preserve transforms from the incoming parser
50
+ const transformed = parser;
51
+ const result = {
52
+ ...parser,
53
+ __brand: 'Parser',
54
+ __optionsSchema: mergedSchema,
55
+ __values: {},
56
+ };
57
+ if (transformed.__transform) {
58
+ result.__transform = transformed.__transform;
59
+ }
60
+ return result;
61
+ };
62
+ // Add Parser properties to the function
63
+ const parserProps = {
64
+ __brand: 'Parser',
65
+ __optionsSchema: schema,
66
+ __positionals: [],
67
+ __positionalsSchema: [],
68
+ __values: {},
69
+ };
70
+ return Object.assign(merger, parserProps);
43
71
  };
44
- /**
45
- * Create a positionals schema from positional definitions.
46
- */
47
- const positionalsImpl = (...positionals) => positionals;
48
72
  /**
49
73
  * Namespaced option builders.
50
74
  *
51
- * Provides ergonomic helpers for defining CLI options, positionals, and
52
- * commands with full TypeScript type inference.
53
- *
54
75
  * @example
55
76
  *
56
77
  * ```typescript
57
78
  * import { opt } from 'bargs';
58
79
  *
59
- * const options = opt.options({
80
+ * const parser = opt.options({
60
81
  * verbose: opt.boolean({ aliases: ['v'] }),
61
82
  * name: opt.string({ default: 'world' }),
62
- * level: opt.enum(['low', 'medium', 'high'] as const),
83
+ * level: opt.enum(['low', 'medium', 'high']),
63
84
  * });
64
85
  * ```
65
86
  */
@@ -74,34 +95,12 @@ exports.opt = {
74
95
  ...props,
75
96
  }),
76
97
  /**
77
- * Define a boolean option. Props type is preserved to enable default
78
- * inference.
98
+ * Define a boolean option.
79
99
  */
80
100
  boolean: (props = {}) => ({
81
101
  type: 'boolean',
82
102
  ...props,
83
103
  }),
84
- /**
85
- * Define a command with proper type inference.
86
- *
87
- * @example
88
- *
89
- * ```typescript
90
- * const greetCmd = opt.command({
91
- * description: 'Greet someone',
92
- * options: opt.options({
93
- * name: opt.string({ default: 'world' }),
94
- * }),
95
- * transforms: {
96
- * values: (v) => ({ ...v, timestamp: Date.now() }),
97
- * },
98
- * handler: ({ values }) => {
99
- * console.log(`Hello, ${values.name}! (${values.timestamp})`);
100
- * },
101
- * });
102
- * ```
103
- */
104
- command: (config) => config,
105
104
  /**
106
105
  * Define a count option (--verbose --verbose = 2).
107
106
  */
@@ -110,9 +109,7 @@ exports.opt = {
110
109
  ...props,
111
110
  }),
112
111
  /**
113
- * Define an enum option with string choices. The choices array is inferred as
114
- * a tuple of literal types automatically. Props type is preserved to enable
115
- * default inference.
112
+ * Define an enum option with string choices.
116
113
  */
117
114
  enum: (choices, props = {}) => ({
118
115
  choices,
@@ -120,8 +117,7 @@ exports.opt = {
120
117
  ...props,
121
118
  }),
122
119
  /**
123
- * Define an enum positional argument with string choices. The choices array
124
- * is inferred as a tuple of literal types automatically.
120
+ * Define an enum positional argument with string choices.
125
121
  */
126
122
  enumPos: (choices, props = {}) => ({
127
123
  choices,
@@ -129,14 +125,12 @@ exports.opt = {
129
125
  ...props,
130
126
  }),
131
127
  /**
132
- * Define a number option. Props type is preserved to enable default
133
- * inference.
128
+ * Define a number option.
134
129
  */
135
130
  number: (props = {}) => ({
136
131
  type: 'number',
137
132
  ...props,
138
133
  }),
139
- // ─── Positional Builders ───────────────────────────────────────────
140
134
  /**
141
135
  * Define a number positional argument.
142
136
  */
@@ -145,57 +139,130 @@ exports.opt = {
145
139
  ...props,
146
140
  }),
147
141
  /**
148
- * Compose multiple option schemas into one. Later schemas override earlier
149
- * ones for duplicate option names. Validates that no alias conflicts exist.
142
+ * Create a Parser from an options schema.
150
143
  *
151
144
  * @example
152
145
  *
153
146
  * ```typescript
154
- * // Single schema (identity, enables reuse)
155
- * const loggingOpts = opt.options({
147
+ * const parser = opt.options({
156
148
  * verbose: opt.boolean({ aliases: ['v'] }),
157
- * quiet: opt.boolean({ aliases: ['q'] }),
158
- * });
159
- *
160
- * // Merge multiple schemas
161
- * const allOpts = opt.options(loggingOpts, ioOpts, {
162
- * format: opt.enum(['json', 'yaml'] as const),
149
+ * name: opt.string({ default: 'world' }),
163
150
  * });
151
+ * // Type: Parser<{ verbose: boolean | undefined, name: string }, []>
164
152
  * ```
165
- *
166
- * @throws BargsError if multiple options use the same alias
167
153
  */
168
154
  options: optionsImpl,
169
155
  /**
170
- * Create a positionals schema with proper tuple type inference.
156
+ * Define a string option.
157
+ */
158
+ string: (props = {}) => ({
159
+ type: 'string',
160
+ ...props,
161
+ }),
162
+ /**
163
+ * Define a string positional argument.
164
+ */
165
+ stringPos: (props = {}) => ({
166
+ type: 'string',
167
+ ...props,
168
+ }),
169
+ /**
170
+ * Define a variadic positional (rest args).
171
+ */
172
+ variadic: (items, props = {}) => ({
173
+ items,
174
+ type: 'variadic',
175
+ ...props,
176
+ }),
177
+ };
178
+ /**
179
+ * Create a Parser from positional definitions that can also merge with existing
180
+ * parsers.
181
+ *
182
+ * Supports two usage patterns:
183
+ *
184
+ * 1. Standalone: `pos.positionals(...)` - returns a Parser
185
+ * 2. Merging: `pos.positionals(...)(opt.options(...))` - merges positionals into
186
+ * options
187
+ */
188
+ const positionalsImpl = (...positionals) => {
189
+ // Create the merge function - just passes through V2, no intersection needed
190
+ const merger = (parser) => {
191
+ // Preserve transforms from the incoming parser
192
+ const transformed = parser;
193
+ const result = {
194
+ ...parser,
195
+ __brand: 'Parser',
196
+ __positionals: [],
197
+ __positionalsSchema: [...parser.__positionalsSchema, ...positionals],
198
+ };
199
+ if (transformed.__transform) {
200
+ result.__transform = transformed.__transform;
201
+ }
202
+ return result;
203
+ };
204
+ // Add Parser properties to the function
205
+ // Use empty object {} instead of Record<string, never> for better intersection behavior
206
+ const parserProps = {
207
+ __brand: 'Parser',
208
+ __optionsSchema: {},
209
+ __positionals: [],
210
+ __positionalsSchema: positionals,
211
+ __values: {},
212
+ };
213
+ return Object.assign(merger, parserProps);
214
+ };
215
+ /**
216
+ * Namespaced positional builders.
217
+ *
218
+ * @example
219
+ *
220
+ * ```typescript
221
+ * import { pos } from 'bargs';
222
+ *
223
+ * const parser = pos.positionals(
224
+ * pos.string({ name: 'input', required: true }),
225
+ * pos.string({ name: 'output' }),
226
+ * );
227
+ * ```
228
+ */
229
+ exports.pos = {
230
+ /**
231
+ * Define an enum positional argument with string choices.
232
+ */
233
+ enum: (choices, props = {}) => ({
234
+ choices,
235
+ type: 'enum',
236
+ ...props,
237
+ }),
238
+ /**
239
+ * Define a number positional argument.
240
+ */
241
+ number: (props = {}) => ({
242
+ type: 'number',
243
+ ...props,
244
+ }),
245
+ /**
246
+ * Create a Parser from positional definitions.
171
247
  *
172
248
  * @example
173
249
  *
174
250
  * ```typescript
175
- * const positionals = opt.positionals(
176
- * opt.stringPos({ description: 'Input file', required: true }),
177
- * opt.stringPos({ description: 'Output file' }),
251
+ * const parser = pos.positionals(
252
+ * pos.string({ name: 'input', required: true }),
253
+ * pos.string({ name: 'output' }),
178
254
  * );
255
+ * // Type: Parser<{}, readonly [string, string | undefined]>
179
256
  * ```
180
257
  */
181
258
  positionals: positionalsImpl,
182
- /**
183
- * Define a string option. Props type is preserved to enable default
184
- * inference.
185
- */
186
- string: (props = {}) => ({
187
- type: 'string',
188
- ...props,
189
- }),
190
- // ─── Composition ───────────────────────────────────────────────────
191
259
  /**
192
260
  * Define a string positional argument.
193
261
  */
194
- stringPos: (props = {}) => ({
262
+ string: (props = {}) => ({
195
263
  type: 'string',
196
264
  ...props,
197
265
  }),
198
- // ─── Command Builder ───────────────────────────────────────────────
199
266
  /**
200
267
  * Define a variadic positional (rest args).
201
268
  */
package/dist/opt.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"opt.js","sourceRoot":"","sources":["../src/opt.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAoBH,4CAAyC;AAEzC;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAAC,MAAqB,EAAQ,EAAE;IAC7D,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEhD,KAAK,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACjB,SAAS;QACX,CA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