gunshi 0.27.0 → 0.27.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/lib/bone.d.ts +2 -2
- package/lib/{context-CMrZI9J4.d.ts → context-Pe5vk9kJ.d.ts} +1 -1
- package/lib/context.d.ts +2 -2
- package/lib/{definition-BWGhvqMF.d.ts → definition-BNViywAg.d.ts} +1 -1
- package/lib/definition.d.ts +3 -3
- package/lib/generator.d.ts +1 -1
- package/lib/{index-BDRk6VtJ.d.ts → index-CCtD9wBS.d.ts} +13 -1
- package/lib/index.d.ts +7 -7
- package/lib/{plugin-gv9ogu9N.d.ts → plugin-aAXfXUT6.d.ts} +1 -1
- package/lib/plugin.d.ts +3 -3
- package/lib/renderer.d.ts +6 -6
- package/lib/{types-DIfsK4mZ.d.ts → types-n4yrH5jq.d.ts} +45 -13
- package/lib/{utils-BVBpgaJv.d.ts → utils-BV37YoO0.d.ts} +1 -1
- package/lib/utils.d.ts +2 -2
- package/package.json +7 -7
package/lib/bone.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as SubCommandable, C as GunshiParams, D as Prettify, E as NormalizeToGunshiParams, O as RendererDecorator, S as ExtractExtensions, T as LazyCommand, _ as Commandable, a as Awaitable, b as ExtractArgExplicitlyProvided, c as CommandCallMode, d as CommandContextExtension, f as CommandDecorator, g as CommandRunner, h as CommandLoader, i as Args, j as ValidationErrorsDecorator, k as RenderingOptions, l as CommandContext, m as CommandExamplesFetcher, n as ArgToken, o as CliOptions, p as CommandEnvironment, r as ArgValues, s as Command, t as ArgSchema, u as CommandContextCore, v as DefaultGunshiParams, w as GunshiParamsConstraint, x as ExtractArgs, y as ExtendContext } from "./types-n4yrH5jq.js";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/bone.d.ts
|
|
4
4
|
/**
|
|
@@ -46,4 +46,4 @@ declare function cli<E extends ExtendContext = ExtendContext, G extends GunshiPa
|
|
|
46
46
|
*/
|
|
47
47
|
declare function cli<G extends GunshiParams = DefaultGunshiParams>(args: string[], entry: Command<G> | CommandRunner<G> | LazyCommand<G>, options?: CliOptions<G>): Promise<string | undefined>;
|
|
48
48
|
//#endregion
|
|
49
|
-
export { ArgSchema, ArgToken, ArgValues, 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, ValidationErrorsDecorator, cli };
|
|
49
|
+
export { ArgSchema, ArgToken, ArgValues, 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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as GunshiParams, T as LazyCommand, b as ExtractArgExplicitlyProvided, c as CommandCallMode, d as CommandContextExtension, i as Args, l as CommandContext, n as ArgToken, o as CliOptions, r as ArgValues, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint, x as ExtractArgs, y as ExtendContext } from "./types-
|
|
1
|
+
import { C as GunshiParams, T as LazyCommand, b as ExtractArgExplicitlyProvided, c as CommandCallMode, d as CommandContextExtension, i as Args, l as CommandContext, n as ArgToken, o as CliOptions, r as ArgValues, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint, x as ExtractArgs, y as ExtendContext } from "./types-n4yrH5jq.js";
|
|
2
2
|
|
|
3
3
|
//#region src/context.d.ts
|
|
4
4
|
|
package/lib/context.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import { n as ExtractExtensions, r as createCommandContext, t as CommandContextParams } from "./context-
|
|
1
|
+
import "./types-n4yrH5jq.js";
|
|
2
|
+
import { n as ExtractExtensions, r as createCommandContext, t as CommandContextParams } from "./context-Pe5vk9kJ.js";
|
|
3
3
|
export { CommandContextParams, ExtractExtensions, createCommandContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as GunshiParams, D as Prettify, S as ExtractExtensions, T as LazyCommand, h as CommandLoader, i as Args, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint, x as ExtractArgs, y as ExtendContext } from "./types-
|
|
1
|
+
import { C as GunshiParams, D as Prettify, S as ExtractExtensions, T as LazyCommand, h as CommandLoader, i as Args, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint, x as ExtractArgs, y as ExtendContext } from "./types-n4yrH5jq.js";
|
|
2
2
|
|
|
3
3
|
//#region src/definition.d.ts
|
|
4
4
|
/**
|
package/lib/definition.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as GunshiParams, T as LazyCommand, g as CommandRunner, h as CommandLoader, i as Args, r as ArgValues, s as Command, t as ArgSchema, v as DefaultGunshiParams, y as ExtendContext } from "./types-
|
|
2
|
-
import { r as createCommandContext, t as CommandContextParams } from "./context-
|
|
3
|
-
import { i as lazyWithTypes, n as defineWithTypes, r as lazy, t as define } from "./definition-
|
|
1
|
+
import { C as GunshiParams, T as LazyCommand, g as CommandRunner, h as CommandLoader, i as Args, r as ArgValues, s as Command, t as ArgSchema, v as DefaultGunshiParams, y as ExtendContext } from "./types-n4yrH5jq.js";
|
|
2
|
+
import { r as createCommandContext, t as CommandContextParams } from "./context-Pe5vk9kJ.js";
|
|
3
|
+
import { i as lazyWithTypes, n as defineWithTypes, r as lazy, t as define } from "./definition-BNViywAg.js";
|
|
4
4
|
export { ArgSchema, ArgValues, Args, Command, CommandContextParams, CommandLoader, CommandRunner, DefaultGunshiParams, ExtendContext, GunshiParams, LazyCommand, createCommandContext, define, defineWithTypes, lazy, lazyWithTypes };
|
package/lib/generator.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as LazyCommand, o as CliOptions, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint } from "./types-
|
|
1
|
+
import { T as LazyCommand, o as CliOptions, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint } from "./types-n4yrH5jq.js";
|
|
2
2
|
|
|
3
3
|
//#region src/generator.d.ts
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as GunshiParams, T as LazyCommand, g as CommandRunner, i as Args$1, o as CliOptions, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint, y as ExtendContext } from "./types-
|
|
1
|
+
import { A as SubCommandable, C as GunshiParams, T as LazyCommand, g as CommandRunner, i as Args$1, o as CliOptions, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint, y as ExtendContext } from "./types-n4yrH5jq.js";
|
|
2
2
|
import { parseArgs as parseArgs$1, resolveArgs as resolveArgs$1 } from "args-tokens";
|
|
3
3
|
|
|
4
4
|
//#region ../plugin-i18n/src/types.d.ts
|
|
@@ -104,6 +104,18 @@ declare class DefaultTranslation implements TranslationAdapter {
|
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/cli/builtin.d.ts
|
|
107
|
+
/**
|
|
108
|
+
* Run the command.
|
|
109
|
+
*
|
|
110
|
+
* This overload accepts any command-like object using a loose structural type.
|
|
111
|
+
* It bypasses TypeScript contravariance issues with callback properties.
|
|
112
|
+
*
|
|
113
|
+
* @param args - Command line arguments
|
|
114
|
+
* @param entry - A command-like object (command, command runner, or lazy command)
|
|
115
|
+
* @param options - A {@link CliOptions | CLI options}
|
|
116
|
+
* @returns A rendered usage or undefined. if you will use {@linkcode CliOptions.usageSilent} option, it will return rendered usage string.
|
|
117
|
+
*/
|
|
118
|
+
declare function cli(args: string[], entry: SubCommandable, options?: CliOptions): Promise<string | undefined>;
|
|
107
119
|
/**
|
|
108
120
|
* Run the command.
|
|
109
121
|
*
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { r as createCommandContext, t as CommandContextParams } from "./context-
|
|
3
|
-
import { i as lazyWithTypes, n as defineWithTypes, r as lazy, t as define } from "./definition-
|
|
4
|
-
import { t as ANONYMOUS_COMMAND_NAME } from "./plugin-
|
|
5
|
-
import { i as DefaultTranslation, n as resolveArgs, r as cli, t as parseArgs } from "./index-
|
|
6
|
-
import "./utils-
|
|
7
|
-
export { ANONYMOUS_COMMAND_NAME, ArgSchema, ArgToken, ArgValues, Args, Awaitable, CliOptions, Command, CommandCallMode, CommandContext, CommandContextCore, CommandContextExtension, CommandContextParams, CommandDecorator, CommandEnvironment, CommandExamplesFetcher, CommandLoader, CommandRunner, Commandable, DefaultGunshiParams, DefaultTranslation, ExtendContext, ExtractArgExplicitlyProvided, ExtractArgs, ExtractExtensions, GunshiParams, GunshiParamsConstraint, LazyCommand, NormalizeToGunshiParams, OnPluginExtension, Plugin, PluginContext, PluginDependency, PluginExtension, PluginFunction, PluginOptions, PluginWithExtension, PluginWithoutExtension, Prettify, RendererDecorator, RenderingOptions, ValidationErrorsDecorator, cli, createCommandContext, define, defineWithTypes, lazy, lazyWithTypes, parseArgs, plugin, resolveArgs };
|
|
1
|
+
import { A as SubCommandable, B as plugin, C as GunshiParams, D as Prettify, E as NormalizeToGunshiParams, F as PluginExtension, I as PluginFunction, L as PluginOptions, M as OnPluginExtension, N as Plugin, O as RendererDecorator, P as PluginDependency, R as PluginWithExtension, S as ExtractExtensions, T as LazyCommand, V as PluginContext, _ as Commandable, a as Awaitable, b as ExtractArgExplicitlyProvided, c as CommandCallMode, d as CommandContextExtension, f as CommandDecorator, g as CommandRunner, h as CommandLoader, i as Args, j as ValidationErrorsDecorator, k as RenderingOptions, l as CommandContext, m as CommandExamplesFetcher, n as ArgToken, o as CliOptions, p as CommandEnvironment, r as ArgValues, s as Command, t as ArgSchema, u as CommandContextCore, v as DefaultGunshiParams, w as GunshiParamsConstraint, x as ExtractArgs, y as ExtendContext, z as PluginWithoutExtension } from "./types-n4yrH5jq.js";
|
|
2
|
+
import { r as createCommandContext, t as CommandContextParams } from "./context-Pe5vk9kJ.js";
|
|
3
|
+
import { i as lazyWithTypes, n as defineWithTypes, r as lazy, t as define } from "./definition-BNViywAg.js";
|
|
4
|
+
import { t as ANONYMOUS_COMMAND_NAME } from "./plugin-aAXfXUT6.js";
|
|
5
|
+
import { i as DefaultTranslation, n as resolveArgs, r as cli, t as parseArgs } from "./index-CCtD9wBS.js";
|
|
6
|
+
import "./utils-BV37YoO0.js";
|
|
7
|
+
export { ANONYMOUS_COMMAND_NAME, ArgSchema, ArgToken, ArgValues, Args, Awaitable, CliOptions, Command, CommandCallMode, CommandContext, CommandContextCore, CommandContextExtension, CommandContextParams, CommandDecorator, CommandEnvironment, CommandExamplesFetcher, CommandLoader, CommandRunner, Commandable, DefaultGunshiParams, DefaultTranslation, ExtendContext, ExtractArgExplicitlyProvided, ExtractArgs, ExtractExtensions, GunshiParams, GunshiParamsConstraint, LazyCommand, NormalizeToGunshiParams, OnPluginExtension, Plugin, PluginContext, PluginDependency, PluginExtension, PluginFunction, PluginOptions, PluginWithExtension, PluginWithoutExtension, Prettify, RendererDecorator, RenderingOptions, SubCommandable, ValidationErrorsDecorator, cli, createCommandContext, define, defineWithTypes, lazy, lazyWithTypes, parseArgs, plugin, resolveArgs };
|
package/lib/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as createCommandContext, t as CommandContextParams } from "./context-
|
|
3
|
-
import { n as CLI_OPTIONS_DEFAULT, t as ANONYMOUS_COMMAND_NAME } from "./plugin-
|
|
1
|
+
import { B as plugin, C as GunshiParams, D as Prettify, E as NormalizeToGunshiParams, F as PluginExtension, I as PluginFunction, L as PluginOptions, M as OnPluginExtension, N as Plugin, O as RendererDecorator, P as PluginDependency, R as PluginWithExtension, S as ExtractExtensions, T as LazyCommand, V as PluginContext, a as Awaitable, d as CommandContextExtension, f as CommandDecorator, g as CommandRunner, i as Args, j as ValidationErrorsDecorator, l as CommandContext, m as CommandExamplesFetcher, n as ArgToken, r as ArgValues, s as Command, t as ArgSchema, u as CommandContextCore, v as DefaultGunshiParams, w as GunshiParamsConstraint, x as ExtractArgs, y as ExtendContext, z as PluginWithoutExtension } from "./types-n4yrH5jq.js";
|
|
2
|
+
import { r as createCommandContext, t as CommandContextParams } from "./context-Pe5vk9kJ.js";
|
|
3
|
+
import { n as CLI_OPTIONS_DEFAULT, t as ANONYMOUS_COMMAND_NAME } from "./plugin-aAXfXUT6.js";
|
|
4
4
|
export { ANONYMOUS_COMMAND_NAME, ArgSchema, ArgToken, ArgValues, 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/renderer.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as GunshiParams, l as CommandContext, v as DefaultGunshiParams } from "./types-
|
|
2
|
-
import "./context-
|
|
3
|
-
import "./definition-
|
|
4
|
-
import "./plugin-
|
|
5
|
-
import "./index-
|
|
6
|
-
import "./utils-
|
|
1
|
+
import { C as GunshiParams, l as CommandContext, v as DefaultGunshiParams } from "./types-n4yrH5jq.js";
|
|
2
|
+
import "./context-Pe5vk9kJ.js";
|
|
3
|
+
import "./definition-BNViywAg.js";
|
|
4
|
+
import "./plugin-aAXfXUT6.js";
|
|
5
|
+
import "./index-CCtD9wBS.js";
|
|
6
|
+
import "./utils-BV37YoO0.js";
|
|
7
7
|
|
|
8
8
|
//#region ../plugin-renderer/src/header.d.ts
|
|
9
9
|
/**
|
|
@@ -93,18 +93,18 @@ interface PluginContext<G extends GunshiParamsConstraint = DefaultGunshiParams>
|
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/plugin/core.d.ts
|
|
96
|
-
type ProcessDependency<D, A
|
|
96
|
+
type ProcessDependency<D, A extends ExtendContext> = D extends string ? D extends keyof A ? { [K in D]: A[K] } : {} : D extends {
|
|
97
97
|
id: infer ID;
|
|
98
98
|
optional?: any;
|
|
99
|
-
} ? ID extends string ? ID extends keyof A
|
|
99
|
+
} ? ID extends string ? ID extends keyof A ? D extends {
|
|
100
100
|
optional: true;
|
|
101
|
-
} ? { [K in ID]: A
|
|
101
|
+
} ? { [K in ID]: A[K] | undefined } : { [K in ID]: A[K] } : {} : never : never;
|
|
102
102
|
/**
|
|
103
103
|
* Helper type to infer dependency extensions with optional support
|
|
104
104
|
*
|
|
105
105
|
* @internal
|
|
106
106
|
*/
|
|
107
|
-
type InferDependencyExtensions<D extends ReadonlyArray<PluginDependency | string>, A
|
|
107
|
+
type InferDependencyExtensions<D extends ReadonlyArray<PluginDependency | string>, A extends ExtendContext> = D extends readonly [] ? {} : D extends readonly [infer First, ...infer Rest] ? ProcessDependency<First, A> & (Rest extends ReadonlyArray<PluginDependency | string> ? InferDependencyExtensions<Rest, A> : {}) : {};
|
|
108
108
|
/**
|
|
109
109
|
* Plugin dependency definition
|
|
110
110
|
*
|
|
@@ -210,11 +210,11 @@ ResolvedDepExt extends GunshiParams = GunshiParams<{
|
|
|
210
210
|
*
|
|
211
211
|
* @since v0.27.0
|
|
212
212
|
*/
|
|
213
|
-
type Plugin<E
|
|
213
|
+
type Plugin<E extends GunshiParams['extensions'] = DefaultGunshiParams['extensions']> = PluginFunction & {
|
|
214
214
|
id: string;
|
|
215
215
|
name?: string;
|
|
216
216
|
dependencies?: (PluginDependency | string)[];
|
|
217
|
-
extension?: CommandContextExtension<E
|
|
217
|
+
extension?: CommandContextExtension<E>;
|
|
218
218
|
};
|
|
219
219
|
/**
|
|
220
220
|
* Plugin return type with extension, which includes the plugin ID, name, dependencies, and extension.
|
|
@@ -223,7 +223,7 @@ type Plugin<E$1 extends GunshiParams['extensions'] = DefaultGunshiParams['extens
|
|
|
223
223
|
*
|
|
224
224
|
* @typeParam E - A type extending {@link GunshiParams} to specify the shape of {@linkcode CommandContext}'s extensions.
|
|
225
225
|
*/
|
|
226
|
-
interface PluginWithExtension<E
|
|
226
|
+
interface PluginWithExtension<E extends GunshiParams['extensions'] = DefaultGunshiParams['extensions']> extends Plugin<E> {
|
|
227
227
|
/**
|
|
228
228
|
* Plugin identifier
|
|
229
229
|
*/
|
|
@@ -239,7 +239,7 @@ interface PluginWithExtension<E$1 extends GunshiParams['extensions'] = DefaultGu
|
|
|
239
239
|
/**
|
|
240
240
|
* Plugin extension
|
|
241
241
|
*/
|
|
242
|
-
extension: CommandContextExtension<E
|
|
242
|
+
extension: CommandContextExtension<E>;
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
245
245
|
* Plugin return type without extension, which includes the plugin ID, name, and dependencies, but no extension.
|
|
@@ -248,7 +248,7 @@ interface PluginWithExtension<E$1 extends GunshiParams['extensions'] = DefaultGu
|
|
|
248
248
|
*
|
|
249
249
|
* @typeParam E - A type extending {@link GunshiParams} to specify the shape of {@linkcode CommandContext}'s extensions.
|
|
250
250
|
*/
|
|
251
|
-
interface PluginWithoutExtension<E
|
|
251
|
+
interface PluginWithoutExtension<E extends GunshiParams['extensions'] = DefaultGunshiParams['extensions']> extends Plugin<E> {
|
|
252
252
|
/**
|
|
253
253
|
* Plugin identifier
|
|
254
254
|
*/
|
|
@@ -572,7 +572,7 @@ interface CliOptions<G extends GunshiParamsConstraint = DefaultGunshiParams> {
|
|
|
572
572
|
/**
|
|
573
573
|
* Sub commands.
|
|
574
574
|
*/
|
|
575
|
-
subCommands?: Record<string,
|
|
575
|
+
subCommands?: Record<string, SubCommandable> | Map<string, SubCommandable>;
|
|
576
576
|
/**
|
|
577
577
|
* Left margin of the command output.
|
|
578
578
|
*/
|
|
@@ -759,7 +759,7 @@ type CommandContextCore<G extends GunshiParamsConstraint = DefaultGunshiParams>
|
|
|
759
759
|
*
|
|
760
760
|
* @since v0.27.0
|
|
761
761
|
*/
|
|
762
|
-
interface CommandContextExtension<E
|
|
762
|
+
interface CommandContextExtension<E extends GunshiParams['extensions'] = DefaultGunshiParams['extensions']> {
|
|
763
763
|
/**
|
|
764
764
|
* Plugin identifier
|
|
765
765
|
*/
|
|
@@ -767,7 +767,7 @@ interface CommandContextExtension<E$1 extends GunshiParams['extensions'] = Defau
|
|
|
767
767
|
/**
|
|
768
768
|
* Plugin extension factory
|
|
769
769
|
*/
|
|
770
|
-
readonly factory: (ctx: CommandContextCore, cmd: Command) => Awaitable<E
|
|
770
|
+
readonly factory: (ctx: CommandContextCore, cmd: Command) => Awaitable<E>;
|
|
771
771
|
/**
|
|
772
772
|
* Plugin extension factory after hook
|
|
773
773
|
*/
|
|
@@ -886,6 +886,38 @@ type LazyCommand<G extends GunshiParamsConstraint = DefaultGunshiParams, D exten
|
|
|
886
886
|
* @typeParam G - A type extending {@linkcode GunshiParams} to specify the shape of command.
|
|
887
887
|
*/
|
|
888
888
|
type Commandable<G extends GunshiParamsConstraint = DefaultGunshiParams> = Command<G> | LazyCommand<G, {}>;
|
|
889
|
+
/**
|
|
890
|
+
* Sub-command entry type for use in subCommands.
|
|
891
|
+
*
|
|
892
|
+
* This type uses a loose structural match to bypass TypeScript's contravariance issues
|
|
893
|
+
* with function parameters, allowing any Command or LazyCommand to be used as a sub-command.
|
|
894
|
+
*
|
|
895
|
+
* @since v0.27.1
|
|
896
|
+
*/
|
|
897
|
+
interface SubCommandable {
|
|
898
|
+
/** Command name */
|
|
899
|
+
name?: string;
|
|
900
|
+
/** Command description */
|
|
901
|
+
description?: string;
|
|
902
|
+
/** Command arguments - accepts any args structure */
|
|
903
|
+
args?: Args | Record<string, any>;
|
|
904
|
+
/** Command examples */
|
|
905
|
+
examples?: string | ((...args: any[]) => any);
|
|
906
|
+
/** Command runner */
|
|
907
|
+
run?: (...args: any[]) => any;
|
|
908
|
+
/** Whether to convert camelCase to kebab-case */
|
|
909
|
+
toKebab?: boolean;
|
|
910
|
+
/** Whether this is an internal command */
|
|
911
|
+
internal?: boolean;
|
|
912
|
+
/** Whether this is an entry command */
|
|
913
|
+
entry?: boolean;
|
|
914
|
+
/** Rendering options */
|
|
915
|
+
rendering?: any;
|
|
916
|
+
/** Command name for lazy commands */
|
|
917
|
+
commandName?: string;
|
|
918
|
+
/** Index signature to allow additional properties */
|
|
919
|
+
[key: string]: any;
|
|
920
|
+
}
|
|
889
921
|
/**
|
|
890
922
|
* Command examples fetcher.
|
|
891
923
|
*
|
|
@@ -958,4 +990,4 @@ type RendererDecorator<T, G extends GunshiParamsConstraint = DefaultGunshiParams
|
|
|
958
990
|
*/
|
|
959
991
|
type ValidationErrorsDecorator<G extends GunshiParamsConstraint = DefaultGunshiParams> = (baseRenderer: (ctx: Readonly<CommandContext<G>>, error: AggregateError) => Promise<string>, ctx: Readonly<CommandContext<G>>, error: AggregateError) => Promise<string>;
|
|
960
992
|
//#endregion
|
|
961
|
-
export {
|
|
993
|
+
export { SubCommandable as A, plugin as B, GunshiParams as C, Prettify as D, NormalizeToGunshiParams as E, PluginExtension as F, PluginFunction as I, PluginOptions as L, OnPluginExtension as M, Plugin as N, RendererDecorator as O, PluginDependency as P, PluginWithExtension as R, ExtractExtensions as S, LazyCommand as T, PluginContext as V, Commandable as _, Awaitable as a, ExtractArgExplicitlyProvided as b, CommandCallMode as c, CommandContextExtension as d, CommandDecorator as f, CommandRunner as g, CommandLoader as h, Args$1 as i, ValidationErrorsDecorator as j, RenderingOptions as k, CommandContext as l, CommandExamplesFetcher as m, ArgToken$1 as n, CliOptions as o, CommandEnvironment as p, ArgValues$1 as r, Command as s, ArgSchema$1 as t, CommandContextCore as u, DefaultGunshiParams as v, GunshiParamsConstraint as w, ExtractArgs as x, ExtendContext as y, PluginWithoutExtension as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as LazyCommand, _ as Commandable, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint } from "./types-
|
|
1
|
+
import { T as LazyCommand, _ as Commandable, s as Command, v as DefaultGunshiParams, w as GunshiParamsConstraint } from "./types-n4yrH5jq.js";
|
|
2
2
|
import { kebabnize } from "args-tokens/utils";
|
|
3
3
|
|
|
4
4
|
//#region src/utils.d.ts
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import { a as log, i as kebabnize, n as deepFreeze, o as resolveLazyCommand, r as isLazyCommand, t as create } from "./utils-
|
|
1
|
+
import "./types-n4yrH5jq.js";
|
|
2
|
+
import { a as log, i as kebabnize, n as deepFreeze, o as resolveLazyCommand, r as isLazyCommand, t as create } from "./utils-BV37YoO0.js";
|
|
3
3
|
export { create, deepFreeze, isLazyCommand, kebabnize, log, resolveLazyCommand };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gunshi",
|
|
3
3
|
"description": "Modern javascript command-line library",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -104,12 +104,12 @@
|
|
|
104
104
|
"jsr-exports-lint": "^0.4.1",
|
|
105
105
|
"publint": "^0.3.16",
|
|
106
106
|
"tsdown": "0.15.12",
|
|
107
|
-
"zod": "^4.1
|
|
108
|
-
"@gunshi/plugin-global": "0.27.
|
|
109
|
-
"@gunshi/plugin-renderer": "0.27.
|
|
110
|
-
"@gunshi/resources": "0.27.
|
|
111
|
-
"@gunshi/
|
|
112
|
-
"@gunshi/
|
|
107
|
+
"zod": "^4.2.1",
|
|
108
|
+
"@gunshi/plugin-global": "0.27.3",
|
|
109
|
+
"@gunshi/plugin-renderer": "0.27.3",
|
|
110
|
+
"@gunshi/resources": "0.27.3",
|
|
111
|
+
"@gunshi/shared": "0.27.3",
|
|
112
|
+
"@gunshi/plugin-i18n": "0.27.3"
|
|
113
113
|
},
|
|
114
114
|
"scripts": {
|
|
115
115
|
"build": "tsdown",
|