@h3ravel/musket 0.6.4 → 0.6.5
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 +13 -13
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32,8 +32,8 @@ type CommandOption = {
|
|
|
32
32
|
*/
|
|
33
33
|
nestedOptions?: CommandOption[];
|
|
34
34
|
};
|
|
35
|
-
type ParsedCommand = {
|
|
36
|
-
commandClass: Command
|
|
35
|
+
type ParsedCommand<A extends Application = Application> = {
|
|
36
|
+
commandClass: Command<A>;
|
|
37
37
|
baseCommand: string;
|
|
38
38
|
description?: string;
|
|
39
39
|
/**
|
|
@@ -59,7 +59,7 @@ type PackageMeta = string | {
|
|
|
59
59
|
base?: boolean;
|
|
60
60
|
};
|
|
61
61
|
type CommandMethodResolver = <X extends Command>(cmd: X, met: any) => Promise<X>;
|
|
62
|
-
interface KernelConfig {
|
|
62
|
+
interface KernelConfig<A extends Application = Application> {
|
|
63
63
|
/**
|
|
64
64
|
* ASCII Art style logo
|
|
65
65
|
*/
|
|
@@ -108,11 +108,11 @@ interface KernelConfig {
|
|
|
108
108
|
/**
|
|
109
109
|
* Commands that should be autoloaded by default
|
|
110
110
|
*/
|
|
111
|
-
baseCommands?: typeof Command[];
|
|
111
|
+
baseCommands?: typeof Command<A>[];
|
|
112
112
|
/**
|
|
113
113
|
* A command that will be run when the script is run without arguments
|
|
114
114
|
*/
|
|
115
|
-
rootCommand?: typeof Command
|
|
115
|
+
rootCommand?: typeof Command<A>;
|
|
116
116
|
/**
|
|
117
117
|
* Paths where musket can search and auto discover commands
|
|
118
118
|
*
|
|
@@ -394,7 +394,7 @@ declare class Command<A extends Application = Application> {
|
|
|
394
394
|
}
|
|
395
395
|
//#endregion
|
|
396
396
|
//#region src/Musket.d.ts
|
|
397
|
-
declare class Musket {
|
|
397
|
+
declare class Musket<A extends Application = Application> {
|
|
398
398
|
private app;
|
|
399
399
|
private kernel;
|
|
400
400
|
private baseCommands;
|
|
@@ -409,7 +409,7 @@ declare class Musket {
|
|
|
409
409
|
private config;
|
|
410
410
|
private commands;
|
|
411
411
|
private program;
|
|
412
|
-
constructor(app:
|
|
412
|
+
constructor(app: A, kernel: Kernel<A>, baseCommands?: Command<A>[], resolver?: CommandMethodResolver | undefined, tsDownConfig?: UserConfig);
|
|
413
413
|
build(): Promise<Command$1>;
|
|
414
414
|
private loadBaseCommands;
|
|
415
415
|
/**
|
|
@@ -418,7 +418,7 @@ declare class Musket {
|
|
|
418
418
|
* @param config
|
|
419
419
|
* @returns
|
|
420
420
|
*/
|
|
421
|
-
configure(config: KernelConfig): this;
|
|
421
|
+
configure(config: KernelConfig<A>): this;
|
|
422
422
|
/**
|
|
423
423
|
* Set the paths where the cli can search and auto discover commands
|
|
424
424
|
*
|
|
@@ -436,13 +436,13 @@ declare class Musket {
|
|
|
436
436
|
*
|
|
437
437
|
* @param command
|
|
438
438
|
*/
|
|
439
|
-
addCommand(command: Command): this;
|
|
439
|
+
addCommand(command: Command<A>): this;
|
|
440
440
|
/**
|
|
441
441
|
* Push a list of new commands to commands stack
|
|
442
442
|
*
|
|
443
443
|
* @param command
|
|
444
444
|
*/
|
|
445
|
-
registerCommands(commands: Command[]): this;
|
|
445
|
+
registerCommands(commands: Command<A>[]): this;
|
|
446
446
|
/**
|
|
447
447
|
* Get all the registered commands
|
|
448
448
|
*/
|
|
@@ -451,8 +451,8 @@ declare class Musket {
|
|
|
451
451
|
rebuild(name: string): Promise<void>;
|
|
452
452
|
private makeOption;
|
|
453
453
|
private handle;
|
|
454
|
-
static parse<E extends boolean = false>(kernel: Kernel
|
|
455
|
-
static parse<E extends boolean = false>(kernel: Kernel
|
|
454
|
+
static parse<E extends boolean = false, A extends Application = Application>(kernel: Kernel<A>, config: KernelConfig<A>, returnExit?: E): Promise<E extends true ? number : Command$1>;
|
|
455
|
+
static parse<E extends boolean = false, A extends Application = Application>(kernel: Kernel<A>, config: KernelConfig<A>, commands: typeof Command<A>[], returnExit?: E): Promise<E extends true ? number : Command$1>;
|
|
456
456
|
}
|
|
457
457
|
//#endregion
|
|
458
458
|
//#region src/Contracts/Application.d.ts
|
|
@@ -484,7 +484,7 @@ declare class Signature {
|
|
|
484
484
|
* @param commandClass
|
|
485
485
|
* @returns
|
|
486
486
|
*/
|
|
487
|
-
static parseSignature(signature: string, commandClass: Command): ParsedCommand;
|
|
487
|
+
static parseSignature<A extends Application = Application>(signature: string, commandClass: Command<A>): ParsedCommand;
|
|
488
488
|
}
|
|
489
489
|
//#endregion
|
|
490
490
|
export { Application, Command, CommandMethodResolver, CommandOption, Kernel, KernelConfig, Musket, PackageMeta, ParsedCommand, Signature };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/musket",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Musket CLI is a framework-agnostic CLI framework designed to allow you build artisan-like CLI apps and for use in the H3ravel framework.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|