@h3ravel/musket 0.1.1 → 0.1.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 CHANGED
@@ -509,7 +509,7 @@ var ListCommand = class ListCommand extends Command {
509
509
  const list = ListCommand.groupItems(commands);
510
510
  /** Output the modules version */
511
511
  const version$1 = this.kernel.modules.map((e) => {
512
- return __h3ravel_shared.Logger.log([[__h3ravel_support.Str.of(e.name).after("/").apa().toString(), "white"], [e.version, "green"]], " ", false);
512
+ return __h3ravel_shared.Logger.log([[`${__h3ravel_support.Str.of(e.alias ?? e.name).afterLast("/").ucfirst().replace(["-", "_"], " ").replace("cli", "CLI", false)}:`, "white"], [e.version, "green"]], " ", false);
513
513
  }).join(" | ");
514
514
  this.newLine();
515
515
  console.log(version$1);
@@ -627,8 +627,8 @@ var Musket = class Musket {
627
627
  * Get the provided packages versions
628
628
  */
629
629
  const moduleVersions = this.kernel.modules.map((e) => {
630
- return __h3ravel_shared.Logger.parse([[`${__h3ravel_support.Str.of(e.name).after("/").apa().title().replace("cli", "CLI", false)}:`, "white"], [e.version, "green"]], " ", false);
631
- }).join("\n");
630
+ return __h3ravel_shared.Logger.parse([[`${__h3ravel_support.Str.of(e.alias ?? e.name).afterLast("/").ucfirst().replace(["-", "_"], " ").replace("cli", "CLI", false)}:`, "white"], [e.version, "green"]], " ", false);
631
+ }).join(" | ");
632
632
  const additional = {
633
633
  quiet: ["-q, --quiet", "Do not output any message except errors and warnings"],
634
634
  silent: ["--silent", "Do not output any message"],
@@ -800,7 +800,7 @@ var Musket = class Musket {
800
800
  //#endregion
801
801
  //#region package.json
802
802
  var name = "@h3ravel/musket";
803
- var version = "0.1.0";
803
+ var version = "0.1.3";
804
804
  var 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.";
805
805
  var type = "module";
806
806
  var exports$1 = {
@@ -926,14 +926,18 @@ var Kernel = class Kernel {
926
926
  }
927
927
  async loadRequirements() {
928
928
  this.cwd = node_path.default.join(process.cwd(), this.basePath);
929
- try {
929
+ if (!this.config.hideMusketInfo) try {
930
930
  package_default.name = this.config.cliName ?? package_default.name;
931
931
  this.modules.push(package_default);
932
932
  } catch {}
933
933
  for (let i = 0; i < this.packages.length; i++) try {
934
- const name$1 = this.packages[i];
934
+ const item = this.packages[i];
935
+ const name$1 = typeof item === "string" ? item : item.name;
936
+ const alias = typeof item === "string" ? item : item.alias;
935
937
  const modulePath = __h3ravel_shared.FileSystem.findModulePkg(name$1, this.cwd) ?? "";
936
- this.modules.push(await import(node_path.default.join(modulePath, "package.json")));
938
+ const pkg = (await import(node_path.default.join(modulePath, "package.json"))).default;
939
+ pkg.alias = alias;
940
+ this.modules.push(pkg);
937
941
  } catch (e) {
938
942
  this.modules.push({
939
943
  version: "N/A",
package/dist/index.d.cts CHANGED
@@ -78,7 +78,10 @@ interface InitConfig {
78
78
  /**
79
79
  * Packages that should show up up when the `-V` flag is passed
80
80
  */
81
- packages?: string[];
81
+ packages?: string[] | {
82
+ name: string;
83
+ alias: string;
84
+ }[];
82
85
  /**
83
86
  * If set to true, information about musket CLI like name and
84
87
  * version info will not be unexpectedly shown in console
@@ -109,7 +112,7 @@ declare class Kernel {
109
112
  name: string;
110
113
  }>[];
111
114
  basePath: string;
112
- packages: string[];
115
+ packages: NonNullable<InitConfig['packages']>;
113
116
  private config;
114
117
  constructor(app: Application);
115
118
  ensureDirectoryExists(dir: string): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -78,7 +78,10 @@ interface InitConfig {
78
78
  /**
79
79
  * Packages that should show up up when the `-V` flag is passed
80
80
  */
81
- packages?: string[];
81
+ packages?: string[] | {
82
+ name: string;
83
+ alias: string;
84
+ }[];
82
85
  /**
83
86
  * If set to true, information about musket CLI like name and
84
87
  * version info will not be unexpectedly shown in console
@@ -109,7 +112,7 @@ declare class Kernel {
109
112
  name: string;
110
113
  }>[];
111
114
  basePath: string;
112
- packages: string[];
115
+ packages: NonNullable<InitConfig['packages']>;
113
116
  private config;
114
117
  constructor(app: Application);
115
118
  ensureDirectoryExists(dir: string): Promise<void>;
package/dist/index.js CHANGED
@@ -479,7 +479,7 @@ var ListCommand = class ListCommand extends Command {
479
479
  const list = ListCommand.groupItems(commands);
480
480
  /** Output the modules version */
481
481
  const version$1 = this.kernel.modules.map((e) => {
482
- return Logger.log([[Str.of(e.name).after("/").apa().toString(), "white"], [e.version, "green"]], " ", false);
482
+ return Logger.log([[`${Str.of(e.alias ?? e.name).afterLast("/").ucfirst().replace(["-", "_"], " ").replace("cli", "CLI", false)}:`, "white"], [e.version, "green"]], " ", false);
483
483
  }).join(" | ");
484
484
  this.newLine();
485
485
  console.log(version$1);
@@ -597,8 +597,8 @@ var Musket = class Musket {
597
597
  * Get the provided packages versions
598
598
  */
599
599
  const moduleVersions = this.kernel.modules.map((e) => {
600
- return Logger.parse([[`${Str.of(e.name).after("/").apa().title().replace("cli", "CLI", false)}:`, "white"], [e.version, "green"]], " ", false);
601
- }).join("\n");
600
+ return Logger.parse([[`${Str.of(e.alias ?? e.name).afterLast("/").ucfirst().replace(["-", "_"], " ").replace("cli", "CLI", false)}:`, "white"], [e.version, "green"]], " ", false);
601
+ }).join(" | ");
602
602
  const additional = {
603
603
  quiet: ["-q, --quiet", "Do not output any message except errors and warnings"],
604
604
  silent: ["--silent", "Do not output any message"],
@@ -770,7 +770,7 @@ var Musket = class Musket {
770
770
  //#endregion
771
771
  //#region package.json
772
772
  var name = "@h3ravel/musket";
773
- var version = "0.1.0";
773
+ var version = "0.1.3";
774
774
  var 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.";
775
775
  var type = "module";
776
776
  var exports = {
@@ -896,14 +896,18 @@ var Kernel = class Kernel {
896
896
  }
897
897
  async loadRequirements() {
898
898
  this.cwd = path.join(process.cwd(), this.basePath);
899
- try {
899
+ if (!this.config.hideMusketInfo) try {
900
900
  package_default.name = this.config.cliName ?? package_default.name;
901
901
  this.modules.push(package_default);
902
902
  } catch {}
903
903
  for (let i = 0; i < this.packages.length; i++) try {
904
- const name$1 = this.packages[i];
904
+ const item = this.packages[i];
905
+ const name$1 = typeof item === "string" ? item : item.name;
906
+ const alias = typeof item === "string" ? item : item.alias;
905
907
  const modulePath = FileSystem.findModulePkg(name$1, this.cwd) ?? "";
906
- this.modules.push(await import(path.join(modulePath, "package.json")));
908
+ const pkg = (await import(path.join(modulePath, "package.json"))).default;
909
+ pkg.alias = alias;
910
+ this.modules.push(pkg);
907
911
  } catch (e) {
908
912
  this.modules.push({
909
913
  version: "N/A",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h3ravel/musket",
3
- "version": "0.1.1",
3
+ "version": "0.1.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
  "exports": {