breadc 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Yet another Command Line Application Framework with fully strong **[TypeScript](
|
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
+ ⚡️ **Light-weight**: Only
|
|
11
|
+
+ ⚡️ **Light-weight**: Only 70 kB (Unpacked).
|
|
12
12
|
+ 📖 **East to Learn**: Breadc is basically compatible with [cac](https://github.com/cacjs/cac) and there are only 5 APIs for building a CLI application: `breadc`, `command`, `option`, `action`, `run`.
|
|
13
13
|
+ 💻 **TypeScript Infer**: IDE will automatically infer the type of your command action function.
|
|
14
14
|
|
package/dist/index.d.ts
CHANGED
|
@@ -106,8 +106,8 @@ interface Command<F extends string = string, AT extends any[] = ExtractCommand<F
|
|
|
106
106
|
description: string;
|
|
107
107
|
_arguments: Argument[];
|
|
108
108
|
_options: Option[];
|
|
109
|
-
option<OF extends string = string, OT extends string | boolean = ExtractOptionType<
|
|
110
|
-
option<OF extends string = string, OT extends string | boolean = ExtractOptionType<
|
|
109
|
+
option<OF extends string = string, OT extends string | boolean = ExtractOptionType<OF>, OR extends any = ExtractOptionType<OF>>(format: OF, description?: string, option?: OptionOption<OT, OR>): Command<F, AT, CommandOption & ExtractOption<OF, OR>, GlobalOption>;
|
|
110
|
+
option<OF extends string = string, OT extends string | boolean = ExtractOptionType<OF>, OR extends any = ExtractOptionType<OF>>(format: OF, option?: OptionOption<OT, OR>): Command<F, AT, CommandOption & ExtractOption<OF, OR>, GlobalOption>;
|
|
111
111
|
action(fn: ActionFn<AT, CommandOption & GlobalOption>): void;
|
|
112
112
|
}
|
|
113
113
|
interface CommandOption {
|
|
@@ -128,7 +128,7 @@ interface Option<F extends string = string, T extends string | boolean = Extract
|
|
|
128
128
|
cast?: (value: T extends string ? string : T extends boolean ? boolean : never) => R;
|
|
129
129
|
action?: (cursor: TreeNode, token: Token, context: Context) => TreeNode | false;
|
|
130
130
|
}
|
|
131
|
-
interface OptionOption<T extends string | boolean, R extends any> {
|
|
131
|
+
interface OptionOption<T extends string | boolean, R extends any = T> {
|
|
132
132
|
description?: string;
|
|
133
133
|
default?: T;
|
|
134
134
|
cast?: (value: T) => R;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "breadc",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Yet another Command Line Application Framework with fully strong TypeScript support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"breadc",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@breadc/color": "0.8.
|
|
38
|
+
"@breadc/color": "0.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^18.11.18",
|