@gunshi/plugin 0.29.5 → 0.30.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/lib/index.d.ts +7 -0
- package/lib/index.js +19 -1
- package/package.json +6 -6
package/lib/index.d.ts
CHANGED
|
@@ -1696,5 +1696,12 @@ declare function createCommandContext<G extends GunshiParamsConstraint = Default
|
|
|
1696
1696
|
args: ExtractArgs<G>;
|
|
1697
1697
|
extensions: ExtractExtensions$1<E>;
|
|
1698
1698
|
}>>>>;
|
|
1699
|
+
//#endregion
|
|
1700
|
+
//#region src/index.d.ts
|
|
1701
|
+
/**
|
|
1702
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
1703
|
+
* @license MIT
|
|
1704
|
+
*/
|
|
1705
|
+
|
|
1699
1706
|
//#endregion
|
|
1700
1707
|
export { ANONYMOUS_COMMAND_NAME, type ArgSchema, type ArgToken, type ArgValues, type Args, Awaitable, CLI_OPTIONS_DEFAULT, Command, CommandContext, CommandContextCore, CommandContextExtension, CommandContextParams, CommandDecorator, CommandExamplesFetcher, CommandRunner, DefaultGunshiParams, ExtendContext, ExtractArgs, ExtractExtensions, GunshiParams, GunshiParamsConstraint, LazyCommand, NormalizeToGunshiParams, OnPluginExtension, Plugin, PluginContext, PluginDependency, PluginExtension, PluginFunction, PluginOptions, PluginWithExtension, PluginWithoutExtension, Prettify, RendererDecorator, ValidationErrorsDecorator, createCommandContext, plugin };
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
//#region ../gunshi/src/constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
2
6
|
const ANONYMOUS_COMMAND_NAME = "(anonymous)";
|
|
3
7
|
/**
|
|
4
8
|
* A no-operation function.
|
|
@@ -24,6 +28,10 @@ const CLI_OPTIONS_DEFAULT = {
|
|
|
24
28
|
//#endregion
|
|
25
29
|
//#region ../gunshi/src/utils.ts
|
|
26
30
|
/**
|
|
31
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
32
|
+
* @license MIT
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
27
35
|
* Check if the given command is a {@link LazyCommand}.
|
|
28
36
|
*
|
|
29
37
|
* @param cmd - A command to check
|
|
@@ -88,7 +96,7 @@ function deepFreeze(obj, ignores = []) {
|
|
|
88
96
|
* @param param - A {@link CommandContextParams | parameters} to create a command context.
|
|
89
97
|
* @returns A {@link CommandContext | command context}, which is readonly.
|
|
90
98
|
*/
|
|
91
|
-
async function createCommandContext({ args = {}, explicit = {}, values = {}, positionals = [], rest = [], argv = [], tokens = [], command = {}, extensions = {}, cliOptions = {}, callMode = "entry", commandPath = [], omitted = false, validationError
|
|
99
|
+
async function createCommandContext({ args = {}, explicit = {}, values = {}, positionals = [], rest = [], argv = [], tokens = [], command = {}, extensions = {}, cliOptions = {}, callMode = "entry", commandPath = [], omitted = false, validationError }) {
|
|
92
100
|
/**
|
|
93
101
|
* normailize the options schema and values, to avoid prototype pollution
|
|
94
102
|
*/
|
|
@@ -155,6 +163,10 @@ function getCommandName(cmd) {
|
|
|
155
163
|
}
|
|
156
164
|
//#endregion
|
|
157
165
|
//#region ../gunshi/src/plugin/core.ts
|
|
166
|
+
/**
|
|
167
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
168
|
+
* @license MIT
|
|
169
|
+
*/
|
|
158
170
|
const NOOP_EXTENSION = () => {
|
|
159
171
|
return Object.create(null);
|
|
160
172
|
};
|
|
@@ -201,4 +213,10 @@ function plugin(options = {}) {
|
|
|
201
213
|
});
|
|
202
214
|
}
|
|
203
215
|
//#endregion
|
|
216
|
+
//#region src/index.ts
|
|
217
|
+
/**
|
|
218
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
219
|
+
* @license MIT
|
|
220
|
+
*/
|
|
221
|
+
//#endregion
|
|
204
222
|
export { ANONYMOUS_COMMAND_NAME, CLI_OPTIONS_DEFAULT, createCommandContext, plugin };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gunshi/plugin",
|
|
3
3
|
"description": "plugin development kit for gunshi",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.30.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">= 22"
|
|
29
29
|
},
|
|
30
30
|
"type": "module",
|
|
31
31
|
"files": [
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"deno": "^2.7.
|
|
54
|
+
"deno": "^2.7.14",
|
|
55
55
|
"jsr": "^0.14.3",
|
|
56
56
|
"jsr-exports-lint": "^0.4.2",
|
|
57
|
-
"publint": "^0.3.
|
|
58
|
-
"tsdown": "0.
|
|
59
|
-
"gunshi": "0.
|
|
57
|
+
"publint": "^0.3.20",
|
|
58
|
+
"tsdown": "0.21.0",
|
|
59
|
+
"gunshi": "0.30.1"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "tsdown",
|