@h3ravel/musket 2.2.1 → 2.2.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/dist/index.cjs +20 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +20 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -346,6 +346,7 @@ var Command = class {
|
|
|
346
346
|
* @returns
|
|
347
347
|
*/
|
|
348
348
|
setOption(key, value) {
|
|
349
|
+
this.input.options[key] = value;
|
|
349
350
|
this.program.setOptionValue(key, value);
|
|
350
351
|
return this;
|
|
351
352
|
}
|
|
@@ -683,6 +684,15 @@ var Command = class {
|
|
|
683
684
|
return _h3ravel_shared.Prompts.checkbox(message, choices, required, prefix, pageSize);
|
|
684
685
|
}
|
|
685
686
|
/**
|
|
687
|
+
* Creates a table with the given options and logs it to the console.
|
|
688
|
+
*
|
|
689
|
+
* @param options
|
|
690
|
+
* @returns
|
|
691
|
+
*/
|
|
692
|
+
table(options) {
|
|
693
|
+
return _h3ravel_shared.Logger.table(options);
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
686
696
|
* Open the user's default text editor to accept multi-line input.
|
|
687
697
|
*
|
|
688
698
|
* @param message Message to display
|
|
@@ -694,6 +704,16 @@ var Command = class {
|
|
|
694
704
|
editor(message, postfix, defaultValue, validate) {
|
|
695
705
|
return _h3ravel_shared.Prompts.editor(message, postfix, defaultValue, validate);
|
|
696
706
|
}
|
|
707
|
+
/**
|
|
708
|
+
* Prompt the user for multi-line input directly in the console.
|
|
709
|
+
*
|
|
710
|
+
* @param prompt Message to display
|
|
711
|
+
* @param placeholder The placeholder text for the input
|
|
712
|
+
* @returns
|
|
713
|
+
*/
|
|
714
|
+
multiline(prompt = "Please provide your input below:", placeholder, options) {
|
|
715
|
+
return _h3ravel_shared.Prompts.multiline(prompt, placeholder, options);
|
|
716
|
+
}
|
|
697
717
|
};
|
|
698
718
|
//#endregion
|
|
699
719
|
//#region src/Commands/HelpCommand.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChoiceOrSeparatorArray, Choices, LoggerChalk, Spinner } from "@h3ravel/shared";
|
|
1
|
+
import { ChoiceOrSeparatorArray, Choices, Logger, LoggerChalk, Prompts, Spinner } from "@h3ravel/shared";
|
|
2
2
|
import { Argument, Command as Command$1 } from "commander";
|
|
3
3
|
import { UserConfig } from "tsdown";
|
|
4
4
|
|
|
@@ -801,6 +801,13 @@ declare class Command<A extends Application = Application> {
|
|
|
801
801
|
* @returns
|
|
802
802
|
*/
|
|
803
803
|
checkbox(message: string, choices: Choices, required?: boolean, prefix?: string, pageSize?: number): Promise<string[]>;
|
|
804
|
+
/**
|
|
805
|
+
* Creates a table with the given options and logs it to the console.
|
|
806
|
+
*
|
|
807
|
+
* @param options
|
|
808
|
+
* @returns
|
|
809
|
+
*/
|
|
810
|
+
table(options?: Parameters<typeof Logger['table']>[0]): typeof Logger['table'];
|
|
804
811
|
/**
|
|
805
812
|
* Open the user's default text editor to accept multi-line input.
|
|
806
813
|
*
|
|
@@ -811,6 +818,14 @@ declare class Command<A extends Application = Application> {
|
|
|
811
818
|
* @returns
|
|
812
819
|
*/
|
|
813
820
|
editor(message?: string, postfix?: string, defaultValue?: string, validate?: (text: string) => boolean | string): Promise<string>;
|
|
821
|
+
/**
|
|
822
|
+
* Prompt the user for multi-line input directly in the console.
|
|
823
|
+
*
|
|
824
|
+
* @param prompt Message to display
|
|
825
|
+
* @param placeholder The placeholder text for the input
|
|
826
|
+
* @returns
|
|
827
|
+
*/
|
|
828
|
+
multiline(prompt?: string, placeholder?: string, options?: Omit<Exclude<Parameters<typeof Prompts['multiline']>[0], string>, 'prompt' | 'placeholder'>): Promise<string>;
|
|
814
829
|
}
|
|
815
830
|
//#endregion
|
|
816
831
|
//#region src/Musket.d.ts
|
package/dist/index.js
CHANGED
|
@@ -322,6 +322,7 @@ var Command = class {
|
|
|
322
322
|
* @returns
|
|
323
323
|
*/
|
|
324
324
|
setOption(key, value) {
|
|
325
|
+
this.input.options[key] = value;
|
|
325
326
|
this.program.setOptionValue(key, value);
|
|
326
327
|
return this;
|
|
327
328
|
}
|
|
@@ -659,6 +660,15 @@ var Command = class {
|
|
|
659
660
|
return Prompts.checkbox(message, choices, required, prefix, pageSize);
|
|
660
661
|
}
|
|
661
662
|
/**
|
|
663
|
+
* Creates a table with the given options and logs it to the console.
|
|
664
|
+
*
|
|
665
|
+
* @param options
|
|
666
|
+
* @returns
|
|
667
|
+
*/
|
|
668
|
+
table(options) {
|
|
669
|
+
return Logger.table(options);
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
662
672
|
* Open the user's default text editor to accept multi-line input.
|
|
663
673
|
*
|
|
664
674
|
* @param message Message to display
|
|
@@ -670,6 +680,16 @@ var Command = class {
|
|
|
670
680
|
editor(message, postfix, defaultValue, validate) {
|
|
671
681
|
return Prompts.editor(message, postfix, defaultValue, validate);
|
|
672
682
|
}
|
|
683
|
+
/**
|
|
684
|
+
* Prompt the user for multi-line input directly in the console.
|
|
685
|
+
*
|
|
686
|
+
* @param prompt Message to display
|
|
687
|
+
* @param placeholder The placeholder text for the input
|
|
688
|
+
* @returns
|
|
689
|
+
*/
|
|
690
|
+
multiline(prompt = "Please provide your input below:", placeholder, options) {
|
|
691
|
+
return Prompts.multiline(prompt, placeholder, options);
|
|
692
|
+
}
|
|
673
693
|
};
|
|
674
694
|
//#endregion
|
|
675
695
|
//#region src/Commands/HelpCommand.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/musket",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
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",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"vitest": "^4.1.8"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@h3ravel/shared": "^2.
|
|
69
|
+
"@h3ravel/shared": "^2.2.4",
|
|
70
70
|
"chalk": "^5.6.2",
|
|
71
71
|
"commander": "^14.0.1",
|
|
72
72
|
"dayjs": "^1.11.18",
|