@sorrell/cli-utilities 1.0.49 → 1.0.51

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.
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @file Bin.ts
4
+ * @author Gage Sorrell <gage@sorrell.sh>
5
+ * @copyright (c) 2026 Gage Sorrell
6
+ * @license MIT
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=Bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bin.d.ts","sourceRoot":"","sources":["../../Source/Bin/Bin.ts"],"names":[],"mappings":";AAEA;;;;;GAKG"}
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @file Bin.ts
4
+ * @author Gage Sorrell <gage@sorrell.sh>
5
+ * @copyright (c) 2026 Gage Sorrell
6
+ * @license MIT
7
+ */
8
+ import { RunCli } from "../Command/Command.js";
9
+ import { Version } from "./Version.js";
10
+ import { WriteVersionCommand } from "./WriteVersionCommand.js";
11
+ RunCli("@sorrell/cli-utilities", Version, [WriteVersionCommand]);
12
+ //# sourceMappingURL=Bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bin.js","sourceRoot":"","sources":["../../Source/Bin/Bin.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,CAAC,wBAAwB,EAAE,OAAO,EAAE,CAAE,mBAAmB,CAAE,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @file Version.ts
3
+ * @author Gage Sorrell <gage@sorrell.sh>
4
+ * @copyright (c) 2026 Gage Sorrell
5
+ * @license MIT
6
+ */
7
+ export declare const Version: string;
8
+ //# sourceMappingURL=Version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Version.d.ts","sourceRoot":"","sources":["../../Source/Bin/Version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,EAAE,MAAe,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @file Version.ts
3
+ * @author Gage Sorrell <gage@sorrell.sh>
4
+ * @copyright (c) 2026 Gage Sorrell
5
+ * @license MIT
6
+ */
7
+ export const Version = "vFoo";
8
+ //# sourceMappingURL=Version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Version.js","sourceRoot":"","sources":["../../Source/Bin/Version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAW,MAAM,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @file WriteVersionCommand.ts
3
+ * @author Gage Sorrell <gage@sorrell.sh>
4
+ * @copyright (c) 2026 Gage Sorrell
5
+ * @license MIT
6
+ */
7
+ import { Command } from "@effect/cli";
8
+ import { Path as EffectPath, FileSystem } from "@effect/platform";
9
+ import type { PackageJsonParseError, RootDirectoryNotFoundError } from "@sorrell/utilities/npm";
10
+ import type { PlatformError } from "@effect/platform/Error";
11
+ type WriteVersionCommand = Command.Command<"write-version", EffectPath.Path | FileSystem.FileSystem, PackageJsonParseError | RootDirectoryNotFoundError | PlatformError, {
12
+ readonly Out: string;
13
+ }>;
14
+ export declare const WriteVersionCommand: WriteVersionCommand;
15
+ export {};
16
+ //# sourceMappingURL=WriteVersionCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WriteVersionCommand.d.ts","sourceRoot":"","sources":["../../Source/Bin/WriteVersionCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,OAAO,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAKhG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAkF5D,KAAK,mBAAmB,GACpB,OAAO,CAAC,OAAO,CACX,eAAe,EACb,UAAU,CAAC,IAAI,GACf,UAAU,CAAC,UAAU,EACrB,qBAAqB,GACrB,0BAA0B,GAC1B,aAAa,EACf;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CAAE,CAC5B,CAAC;AAEN,eAIA,MAAM,mBAAmB,EAAE,mBAC8C,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @file WriteVersionCommand.ts
3
+ * @author Gage Sorrell <gage@sorrell.sh>
4
+ * @copyright (c) 2026 Gage Sorrell
5
+ * @license MIT
6
+ */
7
+ import { Args, Command } from "@effect/cli";
8
+ import { Console, Effect, pipe } from "effect";
9
+ import { Path as EffectPath, FileSystem } from "@effect/platform";
10
+ import Chalk from "chalk";
11
+ import { Code } from "../Format/Format.js";
12
+ import { GetPackageJson } from "@sorrell/utilities/npm/effect";
13
+ const DefaultModuleName = "Version.ts";
14
+ const WriteVersionConfig = {
15
+ Out: pipe(Args.file({ exists: "either", name: "out" }), Args.withDefault(`./${DefaultModuleName}`), Args.withDescription(`The path to where the exported version ${Code("string")} will be written.`))
16
+ };
17
+ /* eslint-disable-next-line jsdoc/require-jsdoc */
18
+ function HandleWriteVersion({ Out }) {
19
+ return Effect.gen(function* () {
20
+ const Fs = yield* FileSystem.FileSystem;
21
+ const Path = yield* EffectPath.Path;
22
+ const HasTsExtension = [".ts", ".mts", ".cts"].some((Extension) => Out.endsWith(Extension));
23
+ const NormalizedOutPath = yield* Effect.gen(function* () {
24
+ const OutAbsolute = Path.resolve(process.cwd(), Out);
25
+ return HasTsExtension
26
+ ? OutAbsolute
27
+ : Path.resolve(OutAbsolute, DefaultModuleName);
28
+ });
29
+ const DirectoryExists = yield* Fs.exists(Path.dirname(NormalizedOutPath));
30
+ if (!DirectoryExists) {
31
+ yield* Fs.makeDirectory(Path.dirname(NormalizedOutPath), { recursive: true });
32
+ }
33
+ const PackageJson = yield* GetPackageJson();
34
+ if (!("version" in PackageJson) || PackageJson.version === undefined) {
35
+ return yield* Effect.dieMessage(`Your ${Code("package.json")} does not have a ${Code("\"version\"")} property.`);
36
+ }
37
+ const PackageVersion = PackageJson.version;
38
+ const ModuleContents = `/* eslint-disable */
39
+
40
+ export const Version: string = "v${PackageVersion}";
41
+ `;
42
+ yield* Fs.writeFileString(NormalizedOutPath, ModuleContents);
43
+ Console.log(`${Chalk.green("✔")} Successfully wrote version v${PackageVersion} ` +
44
+ `to ${Path.basename(NormalizedOutPath)}.`);
45
+ });
46
+ }
47
+ export /**
48
+ * Write a module at a given path that exports a `const Version: string` that
49
+ * is the `"version"` property of the package's `package.json`.
50
+ */ const WriteVersionCommand = Command.make("write-version", WriteVersionConfig, HandleWriteVersion);
51
+ //# sourceMappingURL=WriteVersionCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WriteVersionCommand.js","sourceRoot":"","sources":["../../Source/Bin/WriteVersionCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,MAAM,iBAAiB,GAAW,YAAY,CAAC;AAE/C,MAAM,kBAAkB,GACpB;IACI,GAAG,EAAE,IAAI,CACL,IAAI,CAAC,IAAI,CAAC,EAAE,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;QAClF,CAAC;QAED,MAAM,WAAW,GAAiB,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC;QAE1D,IAAI,CAAC,CAAC,SAAS,IAAI,WAAW,CAAC,IAAI,WAAW,CAAC,OAAO,KAAK,SAAS,EACpE,CAAC;YACG,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAC3B,QAAS,IAAI,CAAC,cAAc,CAAE,oBAAqB,IAAI,CAAC,aAAa,CAAE,YAAY,CACtF,CAAC;QACN,CAAC;QAED,MAAM,cAAc,GAAW,WAAW,CAAC,OAAO,CAAC;QAEnD,MAAM,cAAc,GAAW;;mCAEH,cAAe;CAClD,CAAC;QAEM,KAAK,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;QAE7D,OAAO,CAAC,GAAG,CACP,GAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAE,gCAAiC,cAAe,GAAG;YACxE,MAAO,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAE,GAAG,CAC9C,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC;AAaD,MAAM,CAAA;;;SAGG,CACT,MAAM,mBAAmB,GACrB,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @file Command.Barrel.ts
3
+ * @author Gage Sorrell <gage@sorrell.sh>
4
+ * @copyright (c) 2026 Gage Sorrell
5
+ * @license MIT
6
+ */
7
+ export * from "./Command.js";
8
+ export * from "./Command.Types.js";
9
+ //# sourceMappingURL=Command.Barrel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Command.Barrel.d.ts","sourceRoot":"","sources":["../../Source/Command/Command.Barrel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @file Command.Barrel.ts
3
+ * @author Gage Sorrell <gage@sorrell.sh>
4
+ * @copyright (c) 2026 Gage Sorrell
5
+ * @license MIT
6
+ */
7
+ export * from "./Command.js";
8
+ export * from "./Command.Types.js";
9
+ //# sourceMappingURL=Command.Barrel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Command.Barrel.js","sourceRoot":"","sources":["../../Source/Command/Command.Barrel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
@@ -6,10 +6,14 @@
6
6
  */
7
7
  import type { Command } from "@effect/cli";
8
8
  import type { Option } from "effect/Option";
9
+ /** The type representing any {@link Command!Command | command}. */
10
+ export type Any = Command.Command<any, any, any, any>;
9
11
  /**
10
- * The type of the {@link Command.Command | command} returned by {@link GetMainCommand}.
12
+ * The type of the command returned by {@link GetMain}.
13
+ *
14
+ * @template NameType - The type of the name of the command having this type.
11
15
  */
12
- export type MainCommand = Command.Command<string, any, any, {
13
- readonly subcommand: Option<any>;
14
- }>;
16
+ export type MainCommand<NameType extends string = string> = Command.Command<NameType, any, any, Readonly<{
17
+ subcommand: Option<any>;
18
+ }>>;
15
19
  //# 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,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAI5C,mEAAmE;AACnE,MAAM,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IACpD,OAAO,CAAC,OAAO,CACX,QAAQ,EACR,GAAG,EACH,GAAG,EACH,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,CACxC,CAAC"}
@@ -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;;AAyBH,sDAAsD"}
@@ -4,8 +4,8 @@
4
4
  * @copyright (c) 2026 Gage Sorrell
5
5
  * @license MIT
6
6
  */
7
+ import type { Any, MainCommand } from "./Command.Types.js";
7
8
  import { Command } from "@effect/cli";
8
- import type { MainCommand } from "./Command.Types.js";
9
9
  import type { NonEmptyArray } from "effect/Array";
10
10
  /**
11
11
  * For a given command, get the name of that command, such that it will
@@ -39,10 +39,21 @@ export declare function GetCommandName(PlainName: string): string;
39
39
  * @param Name - The name of the main command. This should be the name of the `"bin"` entry
40
40
  * in your `package.json`.
41
41
  *
42
- * @param SubCommands - The commands of your application.
42
+ * @param SubCommands - The subcommands of the {@link Command.Command | command} that this returns.
43
43
  *
44
- * @returns {Command.Command<typeof Name, never, never, object>} The "empty" command to have
45
- * your packages commands piped to it (as subcommands).
44
+ * @returns {MainCommand<typeof Name>} The "empty" command of the given {@link Name}, and
45
+ * given {@link SubCommands}.
46
+ */
47
+ export declare function GetMain(Name: string, SubCommands: NonEmptyArray<Command.Command<any, any, any, any>>): MainCommand<typeof Name>;
48
+ /**
49
+ * Run your CLI tool, given its name, version, and its commands.
50
+ *
51
+ * @param Name - The name of the main command. This should be the name of the `"bin"` entry
52
+ * in your `package.json`.
53
+ *
54
+ * @param Version - The semver of your CLI tool.
55
+ *
56
+ * @param SubCommands - The commands of your application.
46
57
  */
47
- export declare function GetMainCommand(Name: string, SubCommands: NonEmptyArray<Command.Command<any, any, any, any>>): MainCommand;
58
+ export declare function RunCli(Name: string, Version: string, SubCommands: NonEmptyArray<Any>): void;
48
59
  //# 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,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKxD;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CACnB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAChE,WAAW,CAAC,OAAO,IAAI,CAAC,CAO1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,GAChC,IAAI,CAmBN"}
@@ -4,6 +4,7 @@
4
4
  * @copyright (c) 2026 Gage Sorrell
5
5
  * @license MIT
6
6
  */
7
+ import { NodeContext, NodeRuntime } from "@effect/platform-node";
7
8
  import { Command } from "@effect/cli";
8
9
  import { Effect } from "effect";
9
10
  /**
@@ -43,15 +44,34 @@ 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
  *
46
- * @param SubCommands - The commands of your application.
47
+ * @param SubCommands - The subcommands of the {@link Command.Command | command} that this returns.
47
48
  *
48
- * @returns {Command.Command<typeof Name, never, never, object>} The "empty" command to have
49
- * your packages commands piped to it (as subcommands).
49
+ * @returns {MainCommand<typeof Name>} The "empty" command of the given {@link Name}, and
50
+ * given {@link SubCommands}.
50
51
  */
51
- export function GetMainCommand(Name, SubCommands) {
52
+ export function GetMain(Name, SubCommands) {
52
53
  /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */
53
54
  const MainCommand = Command.make(Name, {}, (_) => Effect.succeed(undefined));
54
55
  return MainCommand.pipe(Command.withSubcommands(SubCommands));
55
56
  }
57
+ /**
58
+ * Run your CLI tool, given its name, version, and its commands.
59
+ *
60
+ * @param Name - The name of the main command. This should be the name of the `"bin"` entry
61
+ * in your `package.json`.
62
+ *
63
+ * @param Version - The semver of your CLI tool.
64
+ *
65
+ * @param SubCommands - The commands of your application.
66
+ */
67
+ export function RunCli(Name, Version, SubCommands) {
68
+ /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */
69
+ const MainCommand = Command.make(Name, {}, (_) => Effect.succeed(undefined));
70
+ const CliRunnable = Command.run(MainCommand.pipe(Command.withSubcommands(SubCommands)), {
71
+ name: "code-auger",
72
+ version: Version
73
+ });
74
+ CliRunnable(process.argv).pipe(Effect.provide(NodeContext.layer), NodeRuntime.runMain);
75
+ }
56
76
  /* eslint-enable jsdoc/require-example */
57
77
  //# 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,WAA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ClB,OAAO,EAAE,OAAO;KACnB,CACJ,CAAC;IAEN,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAC1B,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAQ,EACxC,WAAW,CAAC,OAAO,CACtB,CAAC;AACN,CAAC;AAED,yCAAyC"}
@@ -4,5 +4,5 @@
4
4
  * @copyright (c) 2026 Gage Sorrell
5
5
  * @license MIT
6
6
  */
7
- export * from "./Command.js";
7
+ export * as Command from "./Command.Barrel.js";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Source/Command/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Source/Command/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC"}
@@ -4,5 +4,5 @@
4
4
  * @copyright (c) 2026 Gage Sorrell
5
5
  * @license MIT
6
6
  */
7
- export * from "./Command.js";
7
+ export * as Command from "./Command.Barrel.js";
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../Source/Command/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../Source/Command/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@sorrell/cli-utilities",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
+ "bin": {
5
+ "@sorrell/cli-utilities": "./Distribution/Bin/Bin.js"
6
+ },
4
7
  "description": "Utilities developing CLI tools with TypeScript.",
5
8
  "keywords": [
6
9
  "cli",