bob-core 3.0.0-beta.2 → 3.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{package-BI6Z9-0r.cjs → package-Chbq4tyH.cjs} +1 -1
- package/dist/cjs/src/args/index.d.ts +56 -31
- package/dist/cjs/src/errors/renderError.d.ts +9 -0
- package/dist/cjs/src/flags/boolean.d.ts +7 -2
- package/dist/cjs/src/flags/custom.d.ts +7 -5
- package/dist/cjs/src/flags/directory.d.ts +13 -8
- package/dist/cjs/src/flags/file.d.ts +13 -8
- package/dist/cjs/src/flags/helpers.d.ts +1 -0
- package/dist/cjs/src/flags/index.d.ts +63 -33
- package/dist/cjs/src/flags/number.d.ts +16 -11
- package/dist/cjs/src/flags/string.d.ts +7 -2
- package/dist/cjs/src/flags/url.d.ts +7 -2
- package/dist/cjs/src/index.js +5 -5
- package/dist/cjs/src/options/HelpOption.d.ts +4 -2
- package/dist/esm/{package-BLXL_OAz.js → package-DtqoIUbm.js} +2 -2
- package/dist/esm/src/args/index.d.ts +56 -31
- package/dist/esm/src/errors/renderError.d.ts +9 -0
- package/dist/esm/src/flags/boolean.d.ts +7 -2
- package/dist/esm/src/flags/custom.d.ts +7 -5
- package/dist/esm/src/flags/directory.d.ts +13 -8
- package/dist/esm/src/flags/file.d.ts +13 -8
- package/dist/esm/src/flags/helpers.d.ts +1 -0
- package/dist/esm/src/flags/index.d.ts +63 -33
- package/dist/esm/src/flags/number.d.ts +16 -11
- package/dist/esm/src/flags/string.d.ts +7 -2
- package/dist/esm/src/flags/url.d.ts +7 -2
- package/dist/esm/src/index.js +263 -244
- package/dist/esm/src/options/HelpOption.d.ts +4 -2
- package/package.json +2 -2
|
@@ -1,42 +1,67 @@
|
|
|
1
1
|
import { custom } from '../flags/custom.js';
|
|
2
2
|
import { optionFlag } from '../flags/option.js';
|
|
3
3
|
export declare const Args: {
|
|
4
|
-
string:
|
|
5
|
-
|
|
4
|
+
string: {
|
|
5
|
+
(): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & {
|
|
6
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
7
|
+
};
|
|
8
|
+
<const U extends import('../index.js').FlagProps<string> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & U & {
|
|
9
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
10
|
+
};
|
|
6
11
|
};
|
|
7
|
-
number:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
number: {
|
|
13
|
+
(): import('../index.js').FlagProps<number> & {
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
} & {
|
|
17
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): number;
|
|
18
|
+
};
|
|
19
|
+
<const U extends import('../index.js').FlagProps<number> & Partial<{
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
}>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "min" | "max">, never>): import('../index.js').FlagProps<number> & {
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
25
|
+
} & U & {
|
|
26
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): number;
|
|
27
|
+
};
|
|
18
28
|
};
|
|
19
29
|
option: typeof optionFlag;
|
|
20
|
-
file:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
file: {
|
|
31
|
+
(): import('../index.js').FlagProps<string> & {
|
|
32
|
+
exists?: boolean;
|
|
33
|
+
} & {
|
|
34
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
35
|
+
};
|
|
36
|
+
<const U extends import('../index.js').FlagProps<string> & Partial<{
|
|
37
|
+
exists?: boolean;
|
|
38
|
+
}>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
|
|
39
|
+
exists?: boolean;
|
|
40
|
+
} & U & {
|
|
41
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
42
|
+
};
|
|
28
43
|
};
|
|
29
|
-
directory:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
directory: {
|
|
45
|
+
(): import('../index.js').FlagProps<string> & {
|
|
46
|
+
exists?: boolean;
|
|
47
|
+
} & {
|
|
48
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
49
|
+
};
|
|
50
|
+
<const U extends import('../index.js').FlagProps<string> & Partial<{
|
|
51
|
+
exists?: boolean;
|
|
52
|
+
}>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
|
|
53
|
+
exists?: boolean;
|
|
54
|
+
} & U & {
|
|
55
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
56
|
+
};
|
|
37
57
|
};
|
|
38
|
-
url:
|
|
39
|
-
|
|
58
|
+
url: {
|
|
59
|
+
(): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & {
|
|
60
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): URL;
|
|
61
|
+
};
|
|
62
|
+
<const U extends import('../index.js').FlagProps<URL> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & U & {
|
|
63
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): URL;
|
|
64
|
+
};
|
|
40
65
|
};
|
|
41
66
|
custom: typeof custom;
|
|
42
67
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Logger } from '../Logger.js';
|
|
2
|
+
export type ErrorDetail = [label: string, value: string];
|
|
3
|
+
export type RenderErrorOptions = {
|
|
4
|
+
title: string;
|
|
5
|
+
details?: ErrorDetail[];
|
|
6
|
+
hint?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function quote(name: string): string;
|
|
9
|
+
export declare function renderError(logger: Logger, opts: RenderErrorOptions): void;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { ParameterOpts } from '../lib/types.js';
|
|
2
|
-
export declare const booleanFlag:
|
|
3
|
-
|
|
2
|
+
export declare const booleanFlag: {
|
|
3
|
+
(): import('../lib/types.js').FlagProps<boolean> & import('../lib/types.js').CustomOptions & {
|
|
4
|
+
parse(input: any, opts: ParameterOpts): boolean;
|
|
5
|
+
};
|
|
6
|
+
<const U extends import('../lib/types.js').FlagProps<boolean> & Partial<import('../lib/types.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../lib/types.js').FlagProps<boolean> & import('../lib/types.js').CustomOptions & U & {
|
|
7
|
+
parse(input: any, opts: ParameterOpts): boolean;
|
|
8
|
+
};
|
|
4
9
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CustomOptions, FlagProps, ParameterOpts } from '../lib/types.js';
|
|
2
|
-
export declare function custom<T,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export declare function custom<T, P extends CustomOptions = CustomOptions>(defaults?: FlagProps<T> & Partial<P>): {
|
|
3
|
+
(): FlagProps<T> & P & {
|
|
4
|
+
parse(input: any, opts: ParameterOpts): T;
|
|
5
|
+
};
|
|
6
|
+
<const U extends FlagProps<T> & Partial<P>>(overrides: U & Record<Exclude<keyof U, keyof FlagProps<T> | keyof P>, never>): FlagProps<T> & P & U & {
|
|
7
|
+
parse(input: any, opts: ParameterOpts): T;
|
|
8
|
+
};
|
|
7
9
|
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
export declare const directoryFlag:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export declare const directoryFlag: {
|
|
2
|
+
(): import('../index.js').FlagProps<string> & {
|
|
3
|
+
exists?: boolean;
|
|
4
|
+
} & {
|
|
5
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
6
|
+
};
|
|
7
|
+
<const U extends import('../index.js').FlagProps<string> & Partial<{
|
|
8
|
+
exists?: boolean;
|
|
9
|
+
}>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
|
|
10
|
+
exists?: boolean;
|
|
11
|
+
} & U & {
|
|
12
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
13
|
+
};
|
|
9
14
|
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
export declare const fileFlag:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export declare const fileFlag: {
|
|
2
|
+
(): import('../index.js').FlagProps<string> & {
|
|
3
|
+
exists?: boolean;
|
|
4
|
+
} & {
|
|
5
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
6
|
+
};
|
|
7
|
+
<const U extends import('../index.js').FlagProps<string> & Partial<{
|
|
8
|
+
exists?: boolean;
|
|
9
|
+
}>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
|
|
10
|
+
exists?: boolean;
|
|
11
|
+
} & U & {
|
|
12
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
13
|
+
};
|
|
9
14
|
};
|
|
@@ -1,45 +1,75 @@
|
|
|
1
1
|
import { custom } from './custom.js';
|
|
2
2
|
import { optionFlag } from './option.js';
|
|
3
3
|
export declare const Flags: {
|
|
4
|
-
string:
|
|
5
|
-
|
|
4
|
+
string: {
|
|
5
|
+
(): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & {
|
|
6
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
7
|
+
};
|
|
8
|
+
<const U extends import('../index.js').FlagProps<string> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & U & {
|
|
9
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
10
|
+
};
|
|
6
11
|
};
|
|
7
|
-
number:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
number: {
|
|
13
|
+
(): import('../index.js').FlagProps<number> & {
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
} & {
|
|
17
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): number;
|
|
18
|
+
};
|
|
19
|
+
<const U extends import('../index.js').FlagProps<number> & Partial<{
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
}>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "min" | "max">, never>): import('../index.js').FlagProps<number> & {
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
25
|
+
} & U & {
|
|
26
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): number;
|
|
27
|
+
};
|
|
18
28
|
};
|
|
19
|
-
boolean:
|
|
20
|
-
|
|
29
|
+
boolean: {
|
|
30
|
+
(): import('../index.js').FlagProps<boolean> & import('../index.js').CustomOptions & {
|
|
31
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): boolean;
|
|
32
|
+
};
|
|
33
|
+
<const U extends import('../index.js').FlagProps<boolean> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<boolean> & import('../index.js').CustomOptions & U & {
|
|
34
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): boolean;
|
|
35
|
+
};
|
|
21
36
|
};
|
|
22
37
|
option: typeof optionFlag;
|
|
23
|
-
file:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
file: {
|
|
39
|
+
(): import('../index.js').FlagProps<string> & {
|
|
40
|
+
exists?: boolean;
|
|
41
|
+
} & {
|
|
42
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
43
|
+
};
|
|
44
|
+
<const U extends import('../index.js').FlagProps<string> & Partial<{
|
|
45
|
+
exists?: boolean;
|
|
46
|
+
}>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
|
|
47
|
+
exists?: boolean;
|
|
48
|
+
} & U & {
|
|
49
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
50
|
+
};
|
|
31
51
|
};
|
|
32
|
-
directory:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
directory: {
|
|
53
|
+
(): import('../index.js').FlagProps<string> & {
|
|
54
|
+
exists?: boolean;
|
|
55
|
+
} & {
|
|
56
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
57
|
+
};
|
|
58
|
+
<const U extends import('../index.js').FlagProps<string> & Partial<{
|
|
59
|
+
exists?: boolean;
|
|
60
|
+
}>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
|
|
61
|
+
exists?: boolean;
|
|
62
|
+
} & U & {
|
|
63
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
64
|
+
};
|
|
40
65
|
};
|
|
41
|
-
url:
|
|
42
|
-
|
|
66
|
+
url: {
|
|
67
|
+
(): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & {
|
|
68
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): URL;
|
|
69
|
+
};
|
|
70
|
+
<const U extends import('../index.js').FlagProps<URL> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & U & {
|
|
71
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): URL;
|
|
72
|
+
};
|
|
43
73
|
};
|
|
44
74
|
custom: typeof custom;
|
|
45
75
|
};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
export declare const numberFlag:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
export declare const numberFlag: {
|
|
2
|
+
(): import('../index.js').FlagProps<number> & {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
} & {
|
|
6
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): number;
|
|
7
|
+
};
|
|
8
|
+
<const U extends import('../index.js').FlagProps<number> & Partial<{
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
}>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "min" | "max">, never>): import('../index.js').FlagProps<number> & {
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
} & U & {
|
|
15
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): number;
|
|
16
|
+
};
|
|
12
17
|
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
export declare const stringFlag:
|
|
2
|
-
|
|
1
|
+
export declare const stringFlag: {
|
|
2
|
+
(): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & {
|
|
3
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
4
|
+
};
|
|
5
|
+
<const U extends import('../index.js').FlagProps<string> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & U & {
|
|
6
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): string;
|
|
7
|
+
};
|
|
3
8
|
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
export declare const urlFlag:
|
|
2
|
-
|
|
1
|
+
export declare const urlFlag: {
|
|
2
|
+
(): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & {
|
|
3
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): URL;
|
|
4
|
+
};
|
|
5
|
+
<const U extends import('../index.js').FlagProps<URL> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & U & {
|
|
6
|
+
parse(input: any, opts: import('../index.js').ParameterOpts): URL;
|
|
7
|
+
};
|
|
3
8
|
};
|