@boneskull/bargs 0.1.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.
Files changed (91) hide show
  1. package/LICENSE +55 -0
  2. package/README.md +483 -0
  3. package/dist/bargs.cjs +167 -0
  4. package/dist/bargs.cjs.map +1 -0
  5. package/dist/bargs.d.cts +31 -0
  6. package/dist/bargs.d.cts.map +1 -0
  7. package/dist/bargs.d.ts +31 -0
  8. package/dist/bargs.d.ts.map +1 -0
  9. package/dist/bargs.js +163 -0
  10. package/dist/bargs.js.map +1 -0
  11. package/dist/errors.cjs +57 -0
  12. package/dist/errors.cjs.map +1 -0
  13. package/dist/errors.d.cts +40 -0
  14. package/dist/errors.d.cts.map +1 -0
  15. package/dist/errors.d.ts +40 -0
  16. package/dist/errors.d.ts.map +1 -0
  17. package/dist/errors.js +51 -0
  18. package/dist/errors.js.map +1 -0
  19. package/dist/help.cjs +309 -0
  20. package/dist/help.cjs.map +1 -0
  21. package/dist/help.d.cts +21 -0
  22. package/dist/help.d.cts.map +1 -0
  23. package/dist/help.d.ts +21 -0
  24. package/dist/help.d.ts.map +1 -0
  25. package/dist/help.js +304 -0
  26. package/dist/help.js.map +1 -0
  27. package/dist/index.cjs +63 -0
  28. package/dist/index.cjs.map +1 -0
  29. package/dist/index.d.cts +96 -0
  30. package/dist/index.d.cts.map +1 -0
  31. package/dist/index.d.ts +96 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +47 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/opt.cjs +205 -0
  36. package/dist/opt.cjs.map +1 -0
  37. package/dist/opt.d.cts +145 -0
  38. package/dist/opt.d.cts.map +1 -0
  39. package/dist/opt.d.ts +145 -0
  40. package/dist/opt.d.ts.map +1 -0
  41. package/dist/opt.js +202 -0
  42. package/dist/opt.js.map +1 -0
  43. package/dist/osc.cjs +190 -0
  44. package/dist/osc.cjs.map +1 -0
  45. package/dist/osc.d.cts +30 -0
  46. package/dist/osc.d.cts.map +1 -0
  47. package/dist/osc.d.ts +30 -0
  48. package/dist/osc.d.ts.map +1 -0
  49. package/dist/osc.js +181 -0
  50. package/dist/osc.js.map +1 -0
  51. package/dist/parser.cjs +293 -0
  52. package/dist/parser.cjs.map +1 -0
  53. package/dist/parser.d.cts +47 -0
  54. package/dist/parser.d.cts.map +1 -0
  55. package/dist/parser.d.ts +47 -0
  56. package/dist/parser.d.ts.map +1 -0
  57. package/dist/parser.js +285 -0
  58. package/dist/parser.js.map +1 -0
  59. package/dist/theme.cjs +203 -0
  60. package/dist/theme.cjs.map +1 -0
  61. package/dist/theme.d.cts +227 -0
  62. package/dist/theme.d.cts.map +1 -0
  63. package/dist/theme.d.ts +227 -0
  64. package/dist/theme.d.ts.map +1 -0
  65. package/dist/theme.js +198 -0
  66. package/dist/theme.js.map +1 -0
  67. package/dist/types.cjs +18 -0
  68. package/dist/types.cjs.map +1 -0
  69. package/dist/types.d.cts +244 -0
  70. package/dist/types.d.cts.map +1 -0
  71. package/dist/types.d.ts +244 -0
  72. package/dist/types.d.ts.map +1 -0
  73. package/dist/types.js +17 -0
  74. package/dist/types.js.map +1 -0
  75. package/dist/validate.cjs +452 -0
  76. package/dist/validate.cjs.map +1 -0
  77. package/dist/validate.d.cts +28 -0
  78. package/dist/validate.d.cts.map +1 -0
  79. package/dist/validate.d.ts +28 -0
  80. package/dist/validate.d.ts.map +1 -0
  81. package/dist/validate.js +448 -0
  82. package/dist/validate.js.map +1 -0
  83. package/dist/version.cjs +134 -0
  84. package/dist/version.cjs.map +1 -0
  85. package/dist/version.d.cts +27 -0
  86. package/dist/version.d.cts.map +1 -0
  87. package/dist/version.d.ts +27 -0
  88. package/dist/version.d.ts.map +1 -0
  89. package/dist/version.js +129 -0
  90. package/dist/version.js.map +1 -0
  91. package/package.json +149 -0
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Theming system for colorized help output.
3
+ *
4
+ * Provides ANSI color codes, built-in themes (default, mono, ocean, warm), and
5
+ * utilities for creating custom themes. Each theme defines colors for semantic
6
+ * elements like flags, commands, descriptions, and section headers. Themes can
7
+ * be customized by overriding individual color properties.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+ import { stripVTControlCharacters } from 'node:util';
12
+ /**
13
+ * Strip all ANSI escape codes from a string.
14
+ */
15
+ export declare const stripAnsi: typeof stripVTControlCharacters;
16
+ /**
17
+ * A bargs color theme. All color properties are optional and fall back to the
18
+ * default theme.
19
+ */
20
+ export interface Theme {
21
+ colors?: Partial<ThemeColors>;
22
+ }
23
+ /**
24
+ * Color codes for each semantic element in help output. Empty string means no
25
+ * color (passthrough).
26
+ */
27
+ export interface ThemeColors {
28
+ /** Command names (e.g., "init", "build") */
29
+ command: string;
30
+ /** The "default: " label text */
31
+ defaultText: string;
32
+ /** Default value annotations (e.g., "false", ""hello"") */
33
+ defaultValue: string;
34
+ /** Description text for options/commands */
35
+ description: string;
36
+ /** Epilog text (homepage, repository) */
37
+ epilog: string;
38
+ /** Example code/commands */
39
+ example: string;
40
+ /** Flag names (e.g., "--verbose", "-v") */
41
+ flag: string;
42
+ /** Positional argument names (e.g., "<file>") */
43
+ positional: string;
44
+ /** CLI name shown in header (e.g., "myapp") */
45
+ scriptName: string;
46
+ /** Section headers (e.g., "USAGE", "OPTIONS") */
47
+ sectionHeader: string;
48
+ /** Type annotations (e.g., "[string]", "[number]") */
49
+ type: string;
50
+ /** URL text (for linkified URLs) */
51
+ url: string;
52
+ /** Usage line text */
53
+ usage: string;
54
+ }
55
+ /**
56
+ * Theme input - either a theme name or a custom Theme object.
57
+ */
58
+ export type ThemeInput = keyof typeof themes | Theme;
59
+ /**
60
+ * Internal resolved theme with all colors defined.
61
+ */
62
+ interface ResolvedTheme {
63
+ colors: ThemeColors;
64
+ }
65
+ /**
66
+ * ANSI escape codes for building custom themes.
67
+ *
68
+ * Includes text styles (bold, italic, underline, etc.), foreground colors,
69
+ * bright foreground colors, background colors, and bright background colors.
70
+ */
71
+ export declare const ansi: {
72
+ readonly bgBlack: "\u001B[40m";
73
+ readonly bgBlue: "\u001B[44m";
74
+ readonly bgBrightBlack: "\u001B[100m";
75
+ readonly bgBrightBlue: "\u001B[104m";
76
+ readonly bgBrightCyan: "\u001B[106m";
77
+ readonly bgBrightGreen: "\u001B[102m";
78
+ readonly bgBrightMagenta: "\u001B[105m";
79
+ readonly bgBrightRed: "\u001B[101m";
80
+ readonly bgBrightWhite: "\u001B[107m";
81
+ readonly bgBrightYellow: "\u001B[103m";
82
+ readonly bgCyan: "\u001B[46m";
83
+ readonly bgGreen: "\u001B[42m";
84
+ readonly bgMagenta: "\u001B[45m";
85
+ readonly bgRed: "\u001B[41m";
86
+ readonly bgWhite: "\u001B[47m";
87
+ readonly bgYellow: "\u001B[43m";
88
+ readonly black: "\u001B[30m";
89
+ readonly blue: "\u001B[34m";
90
+ readonly bold: "\u001B[1m";
91
+ readonly brightBlack: "\u001B[90m";
92
+ readonly brightBlue: "\u001B[94m";
93
+ readonly brightCyan: "\u001B[96m";
94
+ readonly brightGreen: "\u001B[92m";
95
+ readonly brightMagenta: "\u001B[95m";
96
+ readonly brightRed: "\u001B[91m";
97
+ readonly brightWhite: "\u001B[97m";
98
+ readonly brightYellow: "\u001B[93m";
99
+ readonly cyan: "\u001B[36m";
100
+ readonly dim: "\u001B[2m";
101
+ readonly green: "\u001B[32m";
102
+ readonly hidden: "\u001B[8m";
103
+ readonly inverse: "\u001B[7m";
104
+ readonly italic: "\u001B[3m";
105
+ readonly magenta: "\u001B[35m";
106
+ readonly red: "\u001B[31m";
107
+ readonly reset: "\u001B[0m";
108
+ readonly strikethrough: "\u001B[9m";
109
+ readonly underline: "\u001B[4m";
110
+ readonly white: "\u001B[37m";
111
+ readonly yellow: "\u001B[33m";
112
+ };
113
+ /**
114
+ * Built-in themes.
115
+ */
116
+ export declare const themes: {
117
+ /** Default colorful theme */
118
+ readonly default: {
119
+ readonly colors: {
120
+ readonly command: string;
121
+ readonly defaultText: string;
122
+ readonly defaultValue: string;
123
+ readonly description: string;
124
+ readonly epilog: string;
125
+ readonly example: string;
126
+ readonly flag: string;
127
+ readonly positional: string;
128
+ readonly scriptName: string;
129
+ readonly sectionHeader: string;
130
+ readonly type: string;
131
+ readonly url: string;
132
+ readonly usage: string;
133
+ };
134
+ };
135
+ /** No colors (monochrome) */
136
+ readonly mono: {
137
+ readonly colors: {
138
+ readonly command: "";
139
+ readonly defaultText: "";
140
+ readonly defaultValue: "";
141
+ readonly description: "";
142
+ readonly epilog: "";
143
+ readonly example: "";
144
+ readonly flag: "";
145
+ readonly positional: "";
146
+ readonly scriptName: "";
147
+ readonly sectionHeader: "";
148
+ readonly type: "";
149
+ readonly url: "";
150
+ readonly usage: "";
151
+ };
152
+ };
153
+ /** Ocean theme - blues and greens (bright) */
154
+ readonly ocean: {
155
+ readonly colors: {
156
+ readonly command: string;
157
+ readonly defaultText: "\u001B[34m";
158
+ readonly defaultValue: "\u001B[32m";
159
+ readonly description: "\u001B[37m";
160
+ readonly epilog: "\u001B[34m";
161
+ readonly example: string;
162
+ readonly flag: "\u001B[96m";
163
+ readonly positional: "\u001B[92m";
164
+ readonly scriptName: string;
165
+ readonly sectionHeader: "\u001B[94m";
166
+ readonly type: "\u001B[36m";
167
+ readonly url: "\u001B[96m";
168
+ readonly usage: "\u001B[37m";
169
+ };
170
+ };
171
+ /** Warm theme - reds and yellows */
172
+ readonly warm: {
173
+ readonly colors: {
174
+ readonly command: string;
175
+ readonly defaultText: string;
176
+ readonly defaultValue: "\u001B[93m";
177
+ readonly description: "\u001B[37m";
178
+ readonly epilog: string;
179
+ readonly example: string;
180
+ readonly flag: "\u001B[93m";
181
+ readonly positional: "\u001B[91m";
182
+ readonly scriptName: string;
183
+ readonly sectionHeader: "\u001B[31m";
184
+ readonly type: "\u001B[33m";
185
+ readonly url: "\u001B[93m";
186
+ readonly usage: "\u001B[37m";
187
+ };
188
+ };
189
+ };
190
+ /**
191
+ * Default theme export for convenience.
192
+ */
193
+ export declare const defaultTheme: ResolvedTheme;
194
+ /**
195
+ * Resolve a theme input to a fully resolved Theme with all colors defined.
196
+ * Missing colors fall back to the default theme.
197
+ */
198
+ export declare const getTheme: (input: ThemeInput) => ResolvedTheme;
199
+ /**
200
+ * Style function that wraps text with ANSI codes.
201
+ */
202
+ export type StyleFn = (text: string) => string;
203
+ /**
204
+ * Styler object with methods for each semantic element.
205
+ */
206
+ export interface Styler {
207
+ command: StyleFn;
208
+ defaultText: StyleFn;
209
+ defaultValue: StyleFn;
210
+ description: StyleFn;
211
+ epilog: StyleFn;
212
+ example: StyleFn;
213
+ flag: StyleFn;
214
+ positional: StyleFn;
215
+ scriptName: StyleFn;
216
+ sectionHeader: StyleFn;
217
+ type: StyleFn;
218
+ url: StyleFn;
219
+ usage: StyleFn;
220
+ }
221
+ /**
222
+ * Create a Styler from a Theme. If the theme has missing colors, they fall back
223
+ * to the default theme.
224
+ */
225
+ export declare const createStyler: (theme: Theme) => Styler;
226
+ export {};
227
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,SAAS,iCAA2B,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC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;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAkBD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,KAAG,MAiB3C,CAAC"}
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Theming system for colorized help output.
3
+ *
4
+ * Provides ANSI color codes, built-in themes (default, mono, ocean, warm), and
5
+ * utilities for creating custom themes. Each theme defines colors for semantic
6
+ * elements like flags, commands, descriptions, and section headers. Themes can
7
+ * be customized by overriding individual color properties.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+ import { stripVTControlCharacters } from 'node:util';
12
+ /**
13
+ * Strip all ANSI escape codes from a string.
14
+ */
15
+ export declare const stripAnsi: typeof stripVTControlCharacters;
16
+ /**
17
+ * A bargs color theme. All color properties are optional and fall back to the
18
+ * default theme.
19
+ */
20
+ export interface Theme {
21
+ colors?: Partial<ThemeColors>;
22
+ }
23
+ /**
24
+ * Color codes for each semantic element in help output. Empty string means no
25
+ * color (passthrough).
26
+ */
27
+ export interface ThemeColors {
28
+ /** Command names (e.g., "init", "build") */
29
+ command: string;
30
+ /** The "default: " label text */
31
+ defaultText: string;
32
+ /** Default value annotations (e.g., "false", ""hello"") */
33
+ defaultValue: string;
34
+ /** Description text for options/commands */
35
+ description: string;
36
+ /** Epilog text (homepage, repository) */
37
+ epilog: string;
38
+ /** Example code/commands */
39
+ example: string;
40
+ /** Flag names (e.g., "--verbose", "-v") */
41
+ flag: string;
42
+ /** Positional argument names (e.g., "<file>") */
43
+ positional: string;
44
+ /** CLI name shown in header (e.g., "myapp") */
45
+ scriptName: string;
46
+ /** Section headers (e.g., "USAGE", "OPTIONS") */
47
+ sectionHeader: string;
48
+ /** Type annotations (e.g., "[string]", "[number]") */
49
+ type: string;
50
+ /** URL text (for linkified URLs) */
51
+ url: string;
52
+ /** Usage line text */
53
+ usage: string;
54
+ }
55
+ /**
56
+ * Theme input - either a theme name or a custom Theme object.
57
+ */
58
+ export type ThemeInput = keyof typeof themes | Theme;
59
+ /**
60
+ * Internal resolved theme with all colors defined.
61
+ */
62
+ interface ResolvedTheme {
63
+ colors: ThemeColors;
64
+ }
65
+ /**
66
+ * ANSI escape codes for building custom themes.
67
+ *
68
+ * Includes text styles (bold, italic, underline, etc.), foreground colors,
69
+ * bright foreground colors, background colors, and bright background colors.
70
+ */
71
+ export declare const ansi: {
72
+ readonly bgBlack: "\u001B[40m";
73
+ readonly bgBlue: "\u001B[44m";
74
+ readonly bgBrightBlack: "\u001B[100m";
75
+ readonly bgBrightBlue: "\u001B[104m";
76
+ readonly bgBrightCyan: "\u001B[106m";
77
+ readonly bgBrightGreen: "\u001B[102m";
78
+ readonly bgBrightMagenta: "\u001B[105m";
79
+ readonly bgBrightRed: "\u001B[101m";
80
+ readonly bgBrightWhite: "\u001B[107m";
81
+ readonly bgBrightYellow: "\u001B[103m";
82
+ readonly bgCyan: "\u001B[46m";
83
+ readonly bgGreen: "\u001B[42m";
84
+ readonly bgMagenta: "\u001B[45m";
85
+ readonly bgRed: "\u001B[41m";
86
+ readonly bgWhite: "\u001B[47m";
87
+ readonly bgYellow: "\u001B[43m";
88
+ readonly black: "\u001B[30m";
89
+ readonly blue: "\u001B[34m";
90
+ readonly bold: "\u001B[1m";
91
+ readonly brightBlack: "\u001B[90m";
92
+ readonly brightBlue: "\u001B[94m";
93
+ readonly brightCyan: "\u001B[96m";
94
+ readonly brightGreen: "\u001B[92m";
95
+ readonly brightMagenta: "\u001B[95m";
96
+ readonly brightRed: "\u001B[91m";
97
+ readonly brightWhite: "\u001B[97m";
98
+ readonly brightYellow: "\u001B[93m";
99
+ readonly cyan: "\u001B[36m";
100
+ readonly dim: "\u001B[2m";
101
+ readonly green: "\u001B[32m";
102
+ readonly hidden: "\u001B[8m";
103
+ readonly inverse: "\u001B[7m";
104
+ readonly italic: "\u001B[3m";
105
+ readonly magenta: "\u001B[35m";
106
+ readonly red: "\u001B[31m";
107
+ readonly reset: "\u001B[0m";
108
+ readonly strikethrough: "\u001B[9m";
109
+ readonly underline: "\u001B[4m";
110
+ readonly white: "\u001B[37m";
111
+ readonly yellow: "\u001B[33m";
112
+ };
113
+ /**
114
+ * Built-in themes.
115
+ */
116
+ export declare const themes: {
117
+ /** Default colorful theme */
118
+ readonly default: {
119
+ readonly colors: {
120
+ readonly command: string;
121
+ readonly defaultText: string;
122
+ readonly defaultValue: string;
123
+ readonly description: string;
124
+ readonly epilog: string;
125
+ readonly example: string;
126
+ readonly flag: string;
127
+ readonly positional: string;
128
+ readonly scriptName: string;
129
+ readonly sectionHeader: string;
130
+ readonly type: string;
131
+ readonly url: string;
132
+ readonly usage: string;
133
+ };
134
+ };
135
+ /** No colors (monochrome) */
136
+ readonly mono: {
137
+ readonly colors: {
138
+ readonly command: "";
139
+ readonly defaultText: "";
140
+ readonly defaultValue: "";
141
+ readonly description: "";
142
+ readonly epilog: "";
143
+ readonly example: "";
144
+ readonly flag: "";
145
+ readonly positional: "";
146
+ readonly scriptName: "";
147
+ readonly sectionHeader: "";
148
+ readonly type: "";
149
+ readonly url: "";
150
+ readonly usage: "";
151
+ };
152
+ };
153
+ /** Ocean theme - blues and greens (bright) */
154
+ readonly ocean: {
155
+ readonly colors: {
156
+ readonly command: string;
157
+ readonly defaultText: "\u001B[34m";
158
+ readonly defaultValue: "\u001B[32m";
159
+ readonly description: "\u001B[37m";
160
+ readonly epilog: "\u001B[34m";
161
+ readonly example: string;
162
+ readonly flag: "\u001B[96m";
163
+ readonly positional: "\u001B[92m";
164
+ readonly scriptName: string;
165
+ readonly sectionHeader: "\u001B[94m";
166
+ readonly type: "\u001B[36m";
167
+ readonly url: "\u001B[96m";
168
+ readonly usage: "\u001B[37m";
169
+ };
170
+ };
171
+ /** Warm theme - reds and yellows */
172
+ readonly warm: {
173
+ readonly colors: {
174
+ readonly command: string;
175
+ readonly defaultText: string;
176
+ readonly defaultValue: "\u001B[93m";
177
+ readonly description: "\u001B[37m";
178
+ readonly epilog: string;
179
+ readonly example: string;
180
+ readonly flag: "\u001B[93m";
181
+ readonly positional: "\u001B[91m";
182
+ readonly scriptName: string;
183
+ readonly sectionHeader: "\u001B[31m";
184
+ readonly type: "\u001B[33m";
185
+ readonly url: "\u001B[93m";
186
+ readonly usage: "\u001B[37m";
187
+ };
188
+ };
189
+ };
190
+ /**
191
+ * Default theme export for convenience.
192
+ */
193
+ export declare const defaultTheme: ResolvedTheme;
194
+ /**
195
+ * Resolve a theme input to a fully resolved Theme with all colors defined.
196
+ * Missing colors fall back to the default theme.
197
+ */
198
+ export declare const getTheme: (input: ThemeInput) => ResolvedTheme;
199
+ /**
200
+ * Style function that wraps text with ANSI codes.
201
+ */
202
+ export type StyleFn = (text: string) => string;
203
+ /**
204
+ * Styler object with methods for each semantic element.
205
+ */
206
+ export interface Styler {
207
+ command: StyleFn;
208
+ defaultText: StyleFn;
209
+ defaultValue: StyleFn;
210
+ description: StyleFn;
211
+ epilog: StyleFn;
212
+ example: StyleFn;
213
+ flag: StyleFn;
214
+ positional: StyleFn;
215
+ scriptName: StyleFn;
216
+ sectionHeader: StyleFn;
217
+ type: StyleFn;
218
+ url: StyleFn;
219
+ usage: StyleFn;
220
+ }
221
+ /**
222
+ * Create a Styler from a Theme. If the theme has missing colors, they fall back
223
+ * to the default theme.
224
+ */
225
+ export declare const createStyler: (theme: Theme) => Styler;
226
+ export {};
227
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;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AAM;iCAEN,MAAM;oCAEH,MAAM;2BAEf,MAAM;0BAEP,MAAM;4BAEJ,MAAM;;;IA4Fb,6BAA6B;;;;;;;;;;;;;;;;;;IAmB7B,8CAA8C;;;;;;;;;;;;;;;;;;IAmB9C,oCAAoC;;;;;;;;;;;;;;;;;;CAkBY,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,aAA8B,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,UAAU,KAAG,aAQ5C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAkBD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,KAAG,MAiB3C,CAAC"}
package/dist/theme.js ADDED
@@ -0,0 +1,198 @@
1
+ /**
2
+ * Theming system for colorized help output.
3
+ *
4
+ * Provides ANSI color codes, built-in themes (default, mono, ocean, warm), and
5
+ * utilities for creating custom themes. Each theme defines colors for semantic
6
+ * elements like flags, commands, descriptions, and section headers. Themes can
7
+ * be customized by overriding individual color properties.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+ import { stripVTControlCharacters } from 'node:util';
12
+ /**
13
+ * Strip all ANSI escape codes from a string.
14
+ */
15
+ export const stripAnsi = stripVTControlCharacters;
16
+ /**
17
+ * ANSI escape codes for building custom themes.
18
+ *
19
+ * Includes text styles (bold, italic, underline, etc.), foreground colors,
20
+ * bright foreground colors, background colors, and bright background colors.
21
+ */
22
+ export const ansi = {
23
+ bgBlack: '\x1b[40m',
24
+ bgBlue: '\x1b[44m',
25
+ bgBrightBlack: '\x1b[100m',
26
+ bgBrightBlue: '\x1b[104m',
27
+ bgBrightCyan: '\x1b[106m',
28
+ bgBrightGreen: '\x1b[102m',
29
+ bgBrightMagenta: '\x1b[105m',
30
+ bgBrightRed: '\x1b[101m',
31
+ bgBrightWhite: '\x1b[107m',
32
+ bgBrightYellow: '\x1b[103m',
33
+ bgCyan: '\x1b[46m',
34
+ bgGreen: '\x1b[42m',
35
+ bgMagenta: '\x1b[45m',
36
+ bgRed: '\x1b[41m',
37
+ bgWhite: '\x1b[47m',
38
+ bgYellow: '\x1b[43m',
39
+ black: '\x1b[30m',
40
+ blue: '\x1b[34m',
41
+ bold: '\x1b[1m',
42
+ brightBlack: '\x1b[90m',
43
+ brightBlue: '\x1b[94m',
44
+ brightCyan: '\x1b[96m',
45
+ brightGreen: '\x1b[92m',
46
+ brightMagenta: '\x1b[95m',
47
+ brightRed: '\x1b[91m',
48
+ brightWhite: '\x1b[97m',
49
+ brightYellow: '\x1b[93m',
50
+ cyan: '\x1b[36m',
51
+ dim: '\x1b[2m',
52
+ green: '\x1b[32m',
53
+ hidden: '\x1b[8m',
54
+ inverse: '\x1b[7m',
55
+ italic: '\x1b[3m',
56
+ magenta: '\x1b[35m',
57
+ red: '\x1b[31m',
58
+ reset: '\x1b[0m',
59
+ strikethrough: '\x1b[9m',
60
+ underline: '\x1b[4m',
61
+ white: '\x1b[37m',
62
+ yellow: '\x1b[33m',
63
+ };
64
+ /**
65
+ * Default color values used when theme colors are not specified.
66
+ */
67
+ const defaultColors = {
68
+ command: ansi.bold,
69
+ defaultText: ansi.dim,
70
+ defaultValue: ansi.white,
71
+ description: ansi.white,
72
+ epilog: ansi.dim,
73
+ example: ansi.white + ansi.dim,
74
+ flag: ansi.brightCyan,
75
+ positional: ansi.magenta,
76
+ scriptName: ansi.bold,
77
+ sectionHeader: ansi.brightMagenta,
78
+ type: ansi.magenta,
79
+ url: ansi.cyan,
80
+ usage: ansi.cyan,
81
+ };
82
+ /**
83
+ * Built-in themes.
84
+ */
85
+ export const themes = {
86
+ /** Default colorful theme */
87
+ default: {
88
+ colors: { ...defaultColors },
89
+ },
90
+ /** No colors (monochrome) */
91
+ mono: {
92
+ colors: {
93
+ command: '',
94
+ defaultText: '',
95
+ defaultValue: '',
96
+ description: '',
97
+ epilog: '',
98
+ example: '',
99
+ flag: '',
100
+ positional: '',
101
+ scriptName: '',
102
+ sectionHeader: '',
103
+ type: '',
104
+ url: '',
105
+ usage: '',
106
+ },
107
+ },
108
+ /** Ocean theme - blues and greens (bright) */
109
+ ocean: {
110
+ colors: {
111
+ command: ansi.bold + ansi.brightCyan,
112
+ defaultText: ansi.blue,
113
+ defaultValue: ansi.green,
114
+ description: ansi.white,
115
+ epilog: ansi.blue,
116
+ example: ansi.dim + ansi.white,
117
+ flag: ansi.brightCyan,
118
+ positional: ansi.brightGreen,
119
+ scriptName: ansi.bold + ansi.brightBlue,
120
+ sectionHeader: ansi.brightBlue,
121
+ type: ansi.cyan,
122
+ url: ansi.brightCyan,
123
+ usage: ansi.white,
124
+ },
125
+ },
126
+ /** Warm theme - reds and yellows */
127
+ warm: {
128
+ colors: {
129
+ command: ansi.bold + ansi.yellow,
130
+ defaultText: ansi.dim + ansi.yellow,
131
+ defaultValue: ansi.brightYellow,
132
+ description: ansi.white,
133
+ epilog: ansi.dim + ansi.yellow,
134
+ example: ansi.white + ansi.dim,
135
+ flag: ansi.brightYellow,
136
+ positional: ansi.brightRed,
137
+ scriptName: ansi.bold + ansi.red,
138
+ sectionHeader: ansi.red,
139
+ type: ansi.yellow,
140
+ url: ansi.brightYellow,
141
+ usage: ansi.white,
142
+ },
143
+ },
144
+ };
145
+ /**
146
+ * Default theme export for convenience.
147
+ */
148
+ export const defaultTheme = themes.default;
149
+ /**
150
+ * Resolve a theme input to a fully resolved Theme with all colors defined.
151
+ * Missing colors fall back to the default theme.
152
+ */
153
+ export const getTheme = (input) => {
154
+ if (typeof input === 'string') {
155
+ return themes[input];
156
+ }
157
+ // Merge with defaults for partial themes
158
+ return {
159
+ colors: { ...defaultColors, ...input.colors },
160
+ };
161
+ };
162
+ /**
163
+ * ANSI reset code.
164
+ */
165
+ const RESET = '\x1b[0m';
166
+ /**
167
+ * Create a style function from a color code. Returns passthrough if color is
168
+ * empty.
169
+ */
170
+ const makeStyleFn = (color) => {
171
+ if (!color) {
172
+ return (text) => text;
173
+ }
174
+ return (text) => `${color}${text}${RESET}`;
175
+ };
176
+ /**
177
+ * Create a Styler from a Theme. If the theme has missing colors, they fall back
178
+ * to the default theme.
179
+ */
180
+ export const createStyler = (theme) => {
181
+ const resolved = getTheme(theme);
182
+ return {
183
+ command: makeStyleFn(resolved.colors.command),
184
+ defaultText: makeStyleFn(resolved.colors.defaultText),
185
+ defaultValue: makeStyleFn(resolved.colors.defaultValue),
186
+ description: makeStyleFn(resolved.colors.description),
187
+ epilog: makeStyleFn(resolved.colors.epilog),
188
+ example: makeStyleFn(resolved.colors.example),
189
+ flag: makeStyleFn(resolved.colors.flag),
190
+ positional: makeStyleFn(resolved.colors.positional),
191
+ scriptName: makeStyleFn(resolved.colors.scriptName),
192
+ sectionHeader: makeStyleFn(resolved.colors.sectionHeader),
193
+ type: makeStyleFn(resolved.colors.type),
194
+ url: makeStyleFn(resolved.colors.url),
195
+ usage: makeStyleFn(resolved.colors.usage),
196
+ };
197
+ };
198
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD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,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QACvC,GAAG,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC;QACrC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC;KAC1C,CAAC;AACJ,CAAC,CAAC"}
package/dist/types.cjs ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /**
3
+ * TypeScript type definitions for the bargs CLI argument parser.
4
+ *
5
+ * Defines all public interfaces and types including:
6
+ *
7
+ * - Option definitions (`StringOption`, `BooleanOption`, `EnumOption`, etc.)
8
+ * - Positional definitions (`StringPositional`, `VariadicPositional`, etc.)
9
+ * - Schema types (`OptionsSchema`, `PositionalsSchema`)
10
+ * - Configuration types (`BargsConfig`, `BargsConfigWithCommands`)
11
+ * - Command types (`CommandConfig`, `CommandConfigInput`)
12
+ * - Type inference utilities (`InferOptions`, `InferPositionals`)
13
+ * - Result types (`BargsResult`)
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ //# sourceMappingURL=types.js.map