@gunshi/bone 0.29.5 → 0.30.0
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 +39 -1
- package/package.json +9 -9
package/lib/index.d.ts
CHANGED
|
@@ -1448,5 +1448,12 @@ declare function cli<E extends ExtendContext = ExtendContext, G extends GunshiPa
|
|
|
1448
1448
|
* @returns A rendered usage or undefined. if you will use {@linkcode CliOptions.usageSilent} option, it will return rendered usage string.
|
|
1449
1449
|
*/
|
|
1450
1450
|
declare function cli<G extends GunshiParams = DefaultGunshiParams>(args: string[], entry: Command<G> | CommandRunner<G> | LazyCommand<G>, options?: CliOptions<G>): Promise<string | undefined>;
|
|
1451
|
+
//#endregion
|
|
1452
|
+
//#region src/index.d.ts
|
|
1453
|
+
/**
|
|
1454
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
1455
|
+
* @license MIT
|
|
1456
|
+
*/
|
|
1457
|
+
|
|
1451
1458
|
//#endregion
|
|
1452
1459
|
export { type ArgSchema, type ArgToken, type ArgValues, type Args, Awaitable, CliOptions, Command, CommandCallMode, CommandContext, CommandContextCore, CommandContextExtension, CommandDecorator, CommandEnvironment, CommandExamplesFetcher, CommandLoader, CommandRunner, Commandable, DefaultGunshiParams, ExtendContext, ExtractArgExplicitlyProvided, ExtractArgs, ExtractExtensions, GunshiParams, GunshiParamsConstraint, LazyCommand, NormalizeToGunshiParams, Prettify, RendererDecorator, RenderingOptions, SubCommandable, ValidationErrorsDecorator, cli };
|
package/lib/index.js
CHANGED
|
@@ -517,7 +517,17 @@ function checkConflicts(args, explicit, toKebab, actualInputNames) {
|
|
|
517
517
|
return [];
|
|
518
518
|
}
|
|
519
519
|
//#endregion
|
|
520
|
+
//#region ../../node_modules/.pnpm/args-tokens@0.24.3/node_modules/args-tokens/lib/index.js
|
|
521
|
+
/**
|
|
522
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
523
|
+
* @license MIT
|
|
524
|
+
*/
|
|
525
|
+
//#endregion
|
|
520
526
|
//#region ../gunshi/src/constants.ts
|
|
527
|
+
/**
|
|
528
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
529
|
+
* @license MIT
|
|
530
|
+
*/
|
|
521
531
|
const ANONYMOUS_COMMAND_NAME = "(anonymous)";
|
|
522
532
|
/**
|
|
523
533
|
* A no-operation function.
|
|
@@ -543,6 +553,10 @@ const CLI_OPTIONS_DEFAULT = {
|
|
|
543
553
|
//#endregion
|
|
544
554
|
//#region ../gunshi/src/utils.ts
|
|
545
555
|
/**
|
|
556
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
557
|
+
* @license MIT
|
|
558
|
+
*/
|
|
559
|
+
/**
|
|
546
560
|
* Check if the given command is a {@link LazyCommand}.
|
|
547
561
|
*
|
|
548
562
|
* @param cmd - A command to check
|
|
@@ -667,7 +681,7 @@ function deepFreeze(obj, ignores = []) {
|
|
|
667
681
|
* @param param - A {@link CommandContextParams | parameters} to create a command context.
|
|
668
682
|
* @returns A {@link CommandContext | command context}, which is readonly.
|
|
669
683
|
*/
|
|
670
|
-
async function createCommandContext({ args = {}, explicit = {}, values = {}, positionals = [], rest = [], argv = [], tokens = [], command = {}, extensions = {}, cliOptions = {}, callMode = "entry", commandPath = [], omitted = false, validationError
|
|
684
|
+
async function createCommandContext({ args = {}, explicit = {}, values = {}, positionals = [], rest = [], argv = [], tokens = [], command = {}, extensions = {}, cliOptions = {}, callMode = "entry", commandPath = [], omitted = false, validationError }) {
|
|
671
685
|
/**
|
|
672
686
|
* normailize the options schema and values, to avoid prototype pollution
|
|
673
687
|
*/
|
|
@@ -734,6 +748,10 @@ function getCommandName(cmd) {
|
|
|
734
748
|
}
|
|
735
749
|
//#endregion
|
|
736
750
|
//#region ../gunshi/src/decorators.ts
|
|
751
|
+
/**
|
|
752
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
753
|
+
* @license MIT
|
|
754
|
+
*/
|
|
737
755
|
const EMPTY_RENDERER = () => Promise.resolve("");
|
|
738
756
|
/**
|
|
739
757
|
* Factory function for creating a decorators manager.
|
|
@@ -799,6 +817,10 @@ function createDecorators() {
|
|
|
799
817
|
//#endregion
|
|
800
818
|
//#region ../gunshi/src/plugin/context.ts
|
|
801
819
|
/**
|
|
820
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
821
|
+
* @license MIT
|
|
822
|
+
*/
|
|
823
|
+
/**
|
|
802
824
|
* Factory function for creating a plugin context.
|
|
803
825
|
*
|
|
804
826
|
* @typeParam G - A type extending {@linkcode GunshiParams} to specify the shape of command parameters.
|
|
@@ -853,6 +875,10 @@ function createPluginContext(decorators, initialSubCommands) {
|
|
|
853
875
|
//#endregion
|
|
854
876
|
//#region ../gunshi/src/plugin/dependency.ts
|
|
855
877
|
/**
|
|
878
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
879
|
+
* @license MIT
|
|
880
|
+
*/
|
|
881
|
+
/**
|
|
856
882
|
* Resolve plugin dependencies using topological sort
|
|
857
883
|
*
|
|
858
884
|
* @param plugins - Array of plugins to resolve
|
|
@@ -1142,4 +1168,16 @@ async function cli(args, entry, options = {}) {
|
|
|
1142
1168
|
return cliCore(args, entry, options, []);
|
|
1143
1169
|
}
|
|
1144
1170
|
//#endregion
|
|
1171
|
+
//#region ../gunshi/src/bone.ts
|
|
1172
|
+
/**
|
|
1173
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
1174
|
+
* @license MIT
|
|
1175
|
+
*/
|
|
1176
|
+
//#endregion
|
|
1177
|
+
//#region src/index.ts
|
|
1178
|
+
/**
|
|
1179
|
+
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
1180
|
+
* @license MIT
|
|
1181
|
+
*/
|
|
1182
|
+
//#endregion
|
|
1145
1183
|
export { cli };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gunshi/bone",
|
|
3
3
|
"description": "gunshi minimum",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.30.0",
|
|
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,15 +51,15 @@
|
|
|
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/definition": "0.
|
|
60
|
-
"@gunshi/plugin-
|
|
61
|
-
"@gunshi/plugin-
|
|
62
|
-
"gunshi": "0.
|
|
57
|
+
"publint": "^0.3.20",
|
|
58
|
+
"tsdown": "0.21.0",
|
|
59
|
+
"@gunshi/definition": "0.30.0",
|
|
60
|
+
"@gunshi/plugin-renderer": "0.30.0",
|
|
61
|
+
"@gunshi/plugin-global": "0.30.0",
|
|
62
|
+
"gunshi": "0.30.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "tsdown",
|