clerc 0.44.0 → 1.0.0-beta.2
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/index.d.ts +94 -7
- package/dist/index.js +15 -7
- package/package.json +13 -16
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
export * from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Plugin } from "@clerc/core";
|
|
2
|
+
export * from "@clerc/core";
|
|
3
|
+
|
|
4
|
+
//#region ../plugin-completions/src/index.d.ts
|
|
5
|
+
interface CompletionsPluginOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to register the `completions install` and `completions uninstall` commands.
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
managementCommands?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const completionsPlugin: (options?: CompletionsPluginOptions) => Plugin;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region ../plugin-friendly-error/src/index.d.ts
|
|
15
|
+
interface FriendlyErrorPluginOptions {
|
|
16
|
+
target?: (str: string) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const friendlyErrorPlugin: ({
|
|
19
|
+
target
|
|
20
|
+
}?: FriendlyErrorPluginOptions) => Plugin;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region ../parser/src/types.d.ts
|
|
23
|
+
/**
|
|
24
|
+
* Defines how a string input is converted to the target type T.
|
|
25
|
+
*
|
|
26
|
+
* @template T The target type.
|
|
27
|
+
*/
|
|
28
|
+
type FlagTypeFunction<T = unknown> = (value: string) => T;
|
|
29
|
+
type FlagType<T = unknown> = FlagTypeFunction<T> | readonly [FlagTypeFunction<T>];
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region ../plugin-help/src/types.d.ts
|
|
32
|
+
interface Formatters {
|
|
33
|
+
formatFlagType: (type: FlagType) => string;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region ../plugin-help/src/formatters.d.ts
|
|
37
|
+
declare const defaultFormatters: Formatters;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region ../plugin-help/src/index.d.ts
|
|
40
|
+
declare module "@clerc/core" {
|
|
41
|
+
interface CommandCustomOptions {
|
|
42
|
+
help?: {
|
|
43
|
+
showInHelp?: boolean;
|
|
44
|
+
notes?: string[];
|
|
45
|
+
examples?: [string, string][];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
interface HelpPluginOptions {
|
|
50
|
+
command?: boolean;
|
|
51
|
+
flag?: boolean;
|
|
52
|
+
showHelpWhenNoCommandSpecified?: boolean;
|
|
53
|
+
notes?: string[];
|
|
54
|
+
examples?: [string, string][];
|
|
55
|
+
banner?: string;
|
|
56
|
+
formatters?: Partial<Formatters>;
|
|
57
|
+
}
|
|
58
|
+
declare const helpPlugin: ({
|
|
59
|
+
command,
|
|
60
|
+
flag,
|
|
61
|
+
showHelpWhenNoCommandSpecified,
|
|
62
|
+
notes,
|
|
63
|
+
examples,
|
|
64
|
+
banner,
|
|
65
|
+
formatters
|
|
66
|
+
}?: HelpPluginOptions) => Plugin;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../plugin-not-found/src/index.d.ts
|
|
69
|
+
declare const notFoundPlugin: () => Plugin;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ../plugin-strict-flags/src/index.d.ts
|
|
72
|
+
declare const strictFlagsPlugin: () => Plugin;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region ../plugin-version/src/index.d.ts
|
|
75
|
+
interface VersionPluginOptions {
|
|
76
|
+
/**
|
|
77
|
+
* Whether to register the version command.
|
|
78
|
+
*
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
command?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Whether to register the global version flag.
|
|
84
|
+
*
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
flag?: boolean;
|
|
88
|
+
}
|
|
89
|
+
declare const versionPlugin: ({
|
|
90
|
+
command,
|
|
91
|
+
flag
|
|
92
|
+
}?: VersionPluginOptions) => Plugin;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { CompletionsPluginOptions, FriendlyErrorPluginOptions, HelpPluginOptions, completionsPlugin, defaultFormatters, friendlyErrorPlugin, helpPlugin, notFoundPlugin, strictFlagsPlugin, versionPlugin };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
|
|
3
|
-
export * from
|
|
4
|
-
|
|
5
|
-
export * from
|
|
6
|
-
|
|
7
|
-
export * from
|
|
1
|
+
export * from "@clerc/core"
|
|
2
|
+
|
|
3
|
+
export * from "@clerc/plugin-completions"
|
|
4
|
+
|
|
5
|
+
export * from "@clerc/plugin-friendly-error"
|
|
6
|
+
|
|
7
|
+
export * from "@clerc/plugin-help"
|
|
8
|
+
|
|
9
|
+
export * from "@clerc/plugin-not-found"
|
|
10
|
+
|
|
11
|
+
export * from "@clerc/plugin-strict-flags"
|
|
12
|
+
|
|
13
|
+
export * from "@clerc/plugin-version"
|
|
14
|
+
|
|
15
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clerc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Clerc: The full-featured cli library.",
|
|
@@ -24,13 +24,10 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"exports": {
|
|
27
|
-
".":
|
|
28
|
-
"types": "./dist/index.d.ts",
|
|
29
|
-
"import": "./dist/index.js"
|
|
30
|
-
}
|
|
27
|
+
".": "./dist/index.js"
|
|
31
28
|
},
|
|
32
|
-
"main": "dist/index.js",
|
|
33
|
-
"module": "dist/index.js",
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"module": "./dist/index.js",
|
|
34
31
|
"types": "dist/index.d.ts",
|
|
35
32
|
"typesVersions": {
|
|
36
33
|
"*": {
|
|
@@ -47,16 +44,16 @@
|
|
|
47
44
|
"access": "public"
|
|
48
45
|
},
|
|
49
46
|
"dependencies": {
|
|
50
|
-
"@clerc/core": "0.
|
|
51
|
-
"@clerc/plugin-
|
|
52
|
-
"@clerc/plugin-
|
|
53
|
-
"@clerc/plugin-
|
|
54
|
-
"@clerc/plugin-
|
|
55
|
-
"@clerc/plugin-
|
|
56
|
-
"@clerc/plugin-
|
|
47
|
+
"@clerc/core": "1.0.0-beta.2",
|
|
48
|
+
"@clerc/plugin-help": "1.0.0-beta.2",
|
|
49
|
+
"@clerc/plugin-completions": "1.0.0-beta.2",
|
|
50
|
+
"@clerc/plugin-not-found": "1.0.0-beta.2",
|
|
51
|
+
"@clerc/plugin-friendly-error": "1.0.0-beta.2",
|
|
52
|
+
"@clerc/plugin-strict-flags": "1.0.0-beta.2",
|
|
53
|
+
"@clerc/plugin-version": "1.0.0-beta.2"
|
|
57
54
|
},
|
|
58
55
|
"scripts": {
|
|
59
|
-
"build": "
|
|
60
|
-
"watch": "
|
|
56
|
+
"build": "tsdown",
|
|
57
|
+
"watch": "tsdown --watch"
|
|
61
58
|
}
|
|
62
59
|
}
|