@sorrell/cli-utilities 1.0.49 → 1.0.50

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.
@@ -4,12 +4,5 @@
4
4
  * @copyright (c) 2026 Gage Sorrell
5
5
  * @license MIT
6
6
  */
7
- import type { Command } from "@effect/cli";
8
- import type { Option } from "effect/Option";
9
- /**
10
- * The type of the {@link Command.Command | command} returned by {@link GetMainCommand}.
11
- */
12
- export type MainCommand = Command.Command<string, any, any, {
13
- readonly subcommand: Option<any>;
14
- }>;
7
+ export type __Command__Types__Dummy__Export = string;
15
8
  //# sourceMappingURL=Command.Types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Command.Types.d.ts","sourceRoot":"","sources":["../../Source/Command/Command.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,OAAO,CAAC,OAAO,CACX,MAAM,EACN,GAAG,EACH,GAAG,EACH;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;CAAE,CACxC,CAAC"}
1
+ {"version":3,"file":"Command.Types.d.ts","sourceRoot":"","sources":["../../Source/Command/Command.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAAC"}
@@ -5,5 +5,4 @@
5
5
  * @license MIT
6
6
  */
7
7
  export {};
8
- /* eslint-enable @typescript-eslint/no-explicit-any */
9
8
  //# sourceMappingURL=Command.Types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Command.Types.js","sourceRoot":"","sources":["../../Source/Command/Command.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAoBH,sDAAsD"}
1
+ {"version":3,"file":"Command.Types.js","sourceRoot":"","sources":["../../Source/Command/Command.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -5,7 +5,6 @@
5
5
  * @license MIT
6
6
  */
7
7
  import { Command } from "@effect/cli";
8
- import type { MainCommand } from "./Command.Types.js";
9
8
  import type { NonEmptyArray } from "effect/Array";
10
9
  /**
11
10
  * For a given command, get the name of that command, such that it will
@@ -39,10 +38,12 @@ export declare function GetCommandName(PlainName: string): string;
39
38
  * @param Name - The name of the main command. This should be the name of the `"bin"` entry
40
39
  * in your `package.json`.
41
40
  *
41
+ * @param Version - The semver of your CLI tool.
42
+ *
42
43
  * @param SubCommands - The commands of your application.
43
44
  *
44
45
  * @returns {Command.Command<typeof Name, never, never, object>} The "empty" command to have
45
46
  * your packages commands piped to it (as subcommands).
46
47
  */
47
- export declare function GetMainCommand(Name: string, SubCommands: NonEmptyArray<Command.Command<any, any, any, any>>): MainCommand;
48
+ export declare function GetCliRunner(Name: string, Version: string, SubCommands: NonEmptyArray<Command.Command<any, any, any, any>>): (() => void);
48
49
  //# sourceMappingURL=Command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../Source/Command/Command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKxD;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAChE,WAAW,CAQb"}
1
+ {"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../Source/Command/Command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKxD;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAChE,CAAC,MAAM,IAAI,CAAC,CAsBd"}
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { Command } from "@effect/cli";
8
8
  import { Effect } from "effect";
9
+ import { NodeContext, NodeRuntime } from "@effect/platform-node";
9
10
  /**
10
11
  * For a given command, get the name of that command, such that it will
11
12
  * work, even if the command will be run inside of a Windows shell terminal.
@@ -43,15 +44,23 @@ export function GetCommandName(PlainName) {
43
44
  * @param Name - The name of the main command. This should be the name of the `"bin"` entry
44
45
  * in your `package.json`.
45
46
  *
47
+ * @param Version - The semver of your CLI tool.
48
+ *
46
49
  * @param SubCommands - The commands of your application.
47
50
  *
48
51
  * @returns {Command.Command<typeof Name, never, never, object>} The "empty" command to have
49
52
  * your packages commands piped to it (as subcommands).
50
53
  */
51
- export function GetMainCommand(Name, SubCommands) {
54
+ export function GetCliRunner(Name, Version, SubCommands) {
52
55
  /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */
53
56
  const MainCommand = Command.make(Name, {}, (_) => Effect.succeed(undefined));
54
- return MainCommand.pipe(Command.withSubcommands(SubCommands));
57
+ const CliRunnable = Command.run(MainCommand.pipe(Command.withSubcommands(SubCommands)), {
58
+ name: "code-auger",
59
+ version: Version
60
+ });
61
+ return function () {
62
+ CliRunnable(process.argv).pipe(Effect.provide(NodeContext.layer), NodeRuntime.runMain);
63
+ };
55
64
  }
56
65
  /* eslint-enable jsdoc/require-example */
57
66
  //# sourceMappingURL=Command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Command.js","sourceRoot":"","sources":["../../Source/Command/Command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB;IAE5C,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO;QAC/B,CAAC,CAAC,GAAI,SAAU,MAAM;QACtB,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC;AAED,8EAA8E;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAC1B,IAAY,EACZ,WAA+D;IAG/D,sEAAsE;IACtE,MAAM,WAAW,GACb,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,EAAG,EAAE,CAAC,CAAS,EAAqC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAEzG,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;AAElE,CAAC;AAED,yCAAyC"}
1
+ {"version":3,"file":"Command.js","sourceRoot":"","sources":["../../Source/Command/Command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGjE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB;IAE5C,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO;QAC/B,CAAC,CAAC,GAAI,SAAU,MAAM;QACtB,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC;AAED,8EAA8E;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CACxB,IAAY,EACZ,OAAe,EACf,WAA+D;IAG/D,sEAAsE;IACtE,MAAM,WAAW,GACb,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,EAAG,EAAE,CAAC,CAAS,EAAiC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAErG,MAAM,WAAW,GACb,OAAO,CAAC,GAAG,CACP,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,EACtD;QACI,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,OAAO;KACnB,CACJ,CAAC;IAEN,OAAO;QAEH,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAC1B,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAQ,EACxC,WAAW,CAAC,OAAO,CACtB,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAED,yCAAyC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sorrell/cli-utilities",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "Utilities developing CLI tools with TypeScript.",
5
5
  "keywords": [
6
6
  "cli",