electron-reactive-event-cli 1.0.111 → 1.0.112

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.
@@ -13,7 +13,7 @@ const Command_1 = require("./Command");
13
13
  const open_1 = __importDefault(require("open"));
14
14
  /** Opens the documentation page for the CLI. */
15
15
  async function DocsCommand() {
16
- (0, Command_1.SetCommand)("Docs");
16
+ (0, Command_1.SetCommand)("docs");
17
17
  (0, open_1.default)("https://electron-reactive-event.sorrell.sh/1.0.0/cli/introduction");
18
18
  }
19
19
  //# sourceMappingURL=Docs.Command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadSample.Command.d.ts","sourceRoot":"","sources":["../Source/DownloadSample.Command.ts"],"names":[],"mappings":"AAUA,qDAAqD;AACrD,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CA8B3D"}
1
+ {"version":3,"file":"DownloadSample.Command.d.ts","sourceRoot":"","sources":["../Source/DownloadSample.Command.ts"],"names":[],"mappings":"AAgBA,qDAAqD;AACrD,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAqI3D"}
@@ -9,22 +9,99 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  };
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.DownloadSampleCommand = DownloadSampleCommand;
12
+ const cli_utilities_1 = require("@sorrell/cli-utilities");
13
+ const listr2_1 = require("listr2");
14
+ const simple_git_1 = require("simple-git");
15
+ const chalk_1 = __importDefault(require("chalk"));
12
16
  const fs_1 = require("fs");
13
- const degit_1 = __importDefault(require("degit"));
17
+ const Shared_1 = require("./Shared");
18
+ const promises_1 = require("fs/promises");
14
19
  const path_1 = require("path");
20
+ const os_1 = require("os");
15
21
  /** Downloads the sample project for this package. */
16
22
  async function DownloadSampleCommand() {
17
- await fs_1.promises.mkdir("electron-reactive-event-sample");
18
- process.chdir("electron-reactive-event-sample");
19
- await (0, degit_1.default)("GageSorrell/SorrellWm");
20
- const Files = await fs_1.promises.readdir((0, path_1.resolve)("SorrellWm"), { recursive: true, withFileTypes: true });
21
- const ExtraneousFiles = Files.filter((File) => !File.name.startsWith("Package"));
22
- const DeleteExtraneousPath = (Path) => fs_1.promises.rm(Path.name, { force: true, recursive: true });
23
- await Promise.allSettled(ExtraneousFiles.map(DeleteExtraneousPath));
24
- await fs_1.promises.cp((0, path_1.resolve)("SorrellWm", "Package", "ElectronReactiveEvent", "Sample"), (0, path_1.resolve)("."), { recursive: true });
25
- await fs_1.promises.rm((0, path_1.resolve)("SorrellWm"), { force: true, recursive: true });
26
- process.chdir("..");
27
- /* eslint-disable-next-line no-console */
28
- console.log("Downloaded sample project!");
23
+ const Context = {
24
+ DownloadPath: "",
25
+ Git: undefined,
26
+ TempPath: ""
27
+ };
28
+ let DownloadPath = "";
29
+ try {
30
+ await new listr2_1.Listr([
31
+ {
32
+ task: async (Context, Task) => {
33
+ const SampleDirectoryName = "electron-reactive-event-sample";
34
+ Context.DownloadPath = "./" + SampleDirectoryName;
35
+ DownloadPath = Context.DownloadPath;
36
+ Task.title = `Creating directory ${(0, cli_utilities_1.Path)(Context.DownloadPath)}.`;
37
+ await fs_1.promises.mkdir(Context.DownloadPath);
38
+ Task.title = `Created directory ${(0, cli_utilities_1.Path)(Context.DownloadPath)}.`;
39
+ },
40
+ title: "Creating directory "
41
+ },
42
+ {
43
+ task: async (Context, Task) => {
44
+ Context.TempPath = (0, path_1.resolve)((0, os_1.tmpdir)(), "electron-reactive-event-cli");
45
+ await (0, promises_1.mkdir)(Context.TempPath);
46
+ Task.title = "Created temp directory to download and process the sample project.";
47
+ },
48
+ title: "Creating temp directory to download and process the sample project."
49
+ },
50
+ {
51
+ task: async (Context, Task) => {
52
+ Context.Git = (0, simple_git_1.simpleGit)();
53
+ Task.title = `Initialized ${(0, cli_utilities_1.Code)("git")} client.`;
54
+ },
55
+ title: `Initializing ${(0, cli_utilities_1.Code)("git")} client.`
56
+ },
57
+ {
58
+ task: async (Context, Task) => {
59
+ if (Context.Git === undefined) {
60
+ throw new Shared_1.SimpleError("Git client was not initialized.");
61
+ }
62
+ await Context.Git.raw("clone", "--filter=blob:none", "--sparse", "https://github.com/GageSorrell/SorrellWm.git", Context.TempPath);
63
+ /* eslint-disable-next-line @stylistic/max-len */
64
+ Task.title = `Performed sparse ${(0, cli_utilities_1.Code)("clone")} of the monorepo containing the sample project.`;
65
+ },
66
+ title: `Performing sparse ${(0, cli_utilities_1.Code)("clone")} of the monorepo containing the sample project.`
67
+ },
68
+ {
69
+ task: async (Context, Task) => {
70
+ if (Context.Git === undefined) {
71
+ throw new Shared_1.SimpleError("Git client was not initialized.");
72
+ }
73
+ await Context.Git.cwd({
74
+ path: (0, path_1.resolve)(Context.TempPath),
75
+ root: true
76
+ });
77
+ await Context.Git.raw("sparse-checkout", "set", (0, path_1.resolve)(Context.DownloadPath));
78
+ Task.title = `Performed ${(0, cli_utilities_1.Code)("sparse checkout")} of the sample project.`;
79
+ },
80
+ title: `Performing ${(0, cli_utilities_1.Code)("sparse checkout")} of the sample project.`
81
+ },
82
+ {
83
+ task: async (Context, Task) => {
84
+ await fs_1.promises.rm(Context.TempPath, { force: true, recursive: true });
85
+ Task.title = "Deleted temp directory.";
86
+ },
87
+ title: "Deleting temp directory."
88
+ }
89
+ ], {
90
+ renderer: listr2_1.DefaultRenderer
91
+ }).run();
92
+ }
93
+ catch (ListrError) {
94
+ if (ListrError instanceof Shared_1.SimpleError) {
95
+ console.error(`🚨 ${ListrError.TheMessage}`);
96
+ process.exit(1);
97
+ }
98
+ else {
99
+ console.dir(ListrError);
100
+ console.error("\n🚨 Failed to download the sample project. The error is printed above.");
101
+ process.exit(1);
102
+ }
103
+ }
104
+ console.log(`${chalk_1.default.green("āœ“")} Downloaded sample project to ${(0, cli_utilities_1.Path)(DownloadPath)}.`);
105
+ process.exit(0);
29
106
  }
30
107
  //# sourceMappingURL=DownloadSample.Command.js.map
@@ -1 +1 @@
1
- {"version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AC,GAAG,CAAC,GAAI,eAAK,CAAC,KAAK,CAAC,GAAG,CAAE,iCAAkC,IAAA,oBAAI,EAAC,YAAY,CAAE,GAAG,CAAC,CAAC;IAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=Setup.Command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Setup.Command.d.ts","sourceRoot":"","sources":["../Source/Setup.Command.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /* File: Setup.Command.ts
4
+ * Author: Gage Sorrell <gage@sorrell.sh>
5
+ * Copyright: (c) 2026 Gage Sorrell
6
+ * License: MIT
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const Setup_1 = require("./Setup");
10
+ (0, Setup_1.SetupCommand)();
11
+ //# sourceMappingURL=Setup.Command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Setup.Command.js","sourceRoot":"","sources":["../Source/Setup.Command.ts"],"names":[],"mappings":";;AAEA;;;;GAIG;;AAEH,mCAAuC;AAEvC,IAAA,oBAAY,GAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Setup.d.ts","sourceRoot":"","sources":["../Source/Setup.ts"],"names":[],"mappings":"AAsEA,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CASlD"}
1
+ {"version":3,"file":"Setup.d.ts","sourceRoot":"","sources":["../Source/Setup.ts"],"names":[],"mappings":"AA0EA,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAuKlD"}
@@ -4,57 +4,178 @@
4
4
  * Copyright: (c) 2026 Gage Sorrell
5
5
  * License: MIT
6
6
  */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
7
10
  Object.defineProperty(exports, "__esModule", { value: true });
8
11
  exports.SetupCommand = SetupCommand;
9
12
  /* eslint-disable jsdoc/require-jsdoc, no-console */
10
13
  const Config_1 = require("./Config");
11
- const Command_1 = require("./Command");
14
+ const Shared_1 = require("./Shared");
15
+ const promises_1 = require("fs/promises");
16
+ const chalk_1 = __importDefault(require("chalk"));
17
+ const cli_utilities_1 = require("@sorrell/cli-utilities");
12
18
  const utilities_1 = require("@sorrell/utilities");
19
+ const prompt_adapter_enquirer_1 = require("@listr2/prompt-adapter-enquirer");
20
+ const Command_1 = require("./Command");
13
21
  const fs_1 = require("fs");
14
22
  const path_1 = require("path");
15
- const promises_1 = require("fs/promises");
16
23
  async function GetDefaultWrittenConfig() {
17
24
  const Lines = JSON.stringify(await (0, Config_1.GetDefaultConfig)(), null, 4).split("\n");
18
25
  const InsertionIndex = Lines.findIndex((Line) => {
19
26
  return Line.includes("AugmentationModulePath: string;");
20
27
  });
21
- const CommentedContent = `// /**
22
- // * \`electron-reactive-event-cli\` can create modules for you that export the reactive
23
- // * IPC functions, scoped to your \`PackageKey\`.
24
- // */
25
- // IpcModulePath?:
26
- // {
27
- // /** The path of the module that calls \`getReactiveIpcMain\`, and exports its output. */
28
- // Main?: string;
28
+ /* eslint-disable-next-line @stylistic/max-len */
29
+ const CommentedContent = `// // \`electron-reactive-event-cli\` can create modules for you that export the reactive
30
+ // // IPC functions, scoped to your \`PackageKey\`.
31
+ // "IpcModulePath": {
32
+ // // The path of the module that calls \`getReactiveIpcMain\`, and exports its output.
33
+ // "Main": "",
29
34
 
30
- // /** The path of the module that calls \`getReactiveIpcHooks\`, and exports its output. */
31
- // Renderer?: string;
35
+ // // The path of the module that calls \`getReactiveIpcHooks\`, and exports its output.
36
+ // "Renderer": ""
32
37
  // };
33
38
  `.split("\n");
34
39
  return Lines.toSpliced(InsertionIndex, 0, ...CommentedContent, "\n").join("\n");
35
40
  }
36
- async function Inner() {
37
- const Root = await (0, utilities_1.GetPackageRootDirectory)();
38
- const ConfigPath = (0, path_1.resolve)(Root, Config_1.ConfigFileName);
39
- if (!(0, fs_1.existsSync)(ConfigPath)) {
40
- try {
41
- console.log("Going to write file...");
42
- await (0, promises_1.writeFile)(ConfigPath, await GetDefaultWrittenConfig(), { encoding: "utf-8" });
43
- console.log("Wrote file!", ConfigPath);
44
- return ConfigPath;
45
- }
46
- catch (Error) {
47
- throw new Command_1.TryError(undefined, Error);
48
- }
49
- }
50
- else {
51
- throw new Command_1.TryError(`A file was already found at ${ConfigPath}. Exiting!`);
52
- }
53
- }
41
+ // async function Inner(): Promise<string>
42
+ // {
43
+ // const Root: string = await GetPackageRootDirectory();
44
+ // const ConfigPath: string = resolve(Root, ConfigFileName);
45
+ // if (!existsSync(ConfigPath))
46
+ // {
47
+ // try
48
+ // {
49
+ // console.log("Going to write file...");
50
+ // await writeFile(
51
+ // ConfigPath,
52
+ // await GetDefaultWrittenConfig(),
53
+ // { encoding: "utf-8" }
54
+ // );
55
+ // console.log("Wrote file!", ConfigPath);
56
+ // return ConfigPath;
57
+ // }
58
+ // catch (Error: unknown)
59
+ // {
60
+ // throw new TryError(undefined, Error);
61
+ // }
62
+ // }
63
+ // else
64
+ // {
65
+ // throw new TryError(`A file was already found at ${ ConfigPath }. Exiting!`);
66
+ // }
67
+ // }
54
68
  async function SetupCommand() {
55
69
  (0, Command_1.SetCommand)("setup");
56
- await (0, Command_1.Try)(
57
- /* eslint-disable-next-line @stylistic/max-len */
58
- "Writing the default config file to electron-reactive-event.config.jsonc in the root of your package...", (Result) => `Successfully wrote the config file at\n\n ${Result}!`, Inner);
70
+ await (0, Shared_1.RunListr)([
71
+ {
72
+ task: async (Context, Task) => {
73
+ try {
74
+ Context.RootDirectory = await (0, utilities_1.GetPackageRootDirectory)();
75
+ }
76
+ catch {
77
+ Task.title = "Failed to find root directory of a NodeJS project.";
78
+ /* eslint-disable-next-line @stylistic/max-len */
79
+ throw new Shared_1.SimpleError("It appears that the command was not run from within a NodeJS project. Exiting.");
80
+ }
81
+ Task.title = "Found root directory of current NodeJS project.";
82
+ },
83
+ title: "Finding root directory of current NodeJS project."
84
+ },
85
+ {
86
+ task: async (Context, Task) => {
87
+ if ((0, fs_1.existsSync)((0, path_1.resolve)(Context.RootDirectory, Config_1.ConfigFileName))) {
88
+ Task.title = "Found existing config file.";
89
+ Context.ConfigAlreadyExists = true;
90
+ }
91
+ Task.title = "Did not find an existing config file.";
92
+ },
93
+ title: "Checking for existing config file."
94
+ },
95
+ {
96
+ skip: (Context) => Context.ConfigAlreadyExists,
97
+ task: async (Context, Task) => {
98
+ const ConfigPath = (0, path_1.resolve)(Context.RootDirectory, Config_1.ConfigFileName);
99
+ try {
100
+ await (0, promises_1.writeFile)(ConfigPath, await GetDefaultWrittenConfig(), { encoding: "utf-8" });
101
+ Task.title = "Wrote default config file.";
102
+ }
103
+ catch {
104
+ Task.title = "Failed to write default config file.";
105
+ throw new Shared_1.SimpleError("Unable to write default config file. Exiting.");
106
+ }
107
+ },
108
+ title: "Writing default config file."
109
+ },
110
+ {
111
+ task: async (Context, Task) => {
112
+ Context.WriteNpmScript = await Task.prompt(prompt_adapter_enquirer_1.ListrEnquirerPromptAdapter).run({
113
+ initial: true,
114
+ /* eslint-disable-next-line @stylistic/max-len */
115
+ message: `Add ${(0, cli_utilities_1.Code)("npm")} script "${(0, cli_utilities_1.Code)("update-reactive")}" to run the ${(0, cli_utilities_1.Code)("declare-events")} and ${(0, cli_utilities_1.Code)("generate")} commands for you?`,
116
+ type: "Toggle"
117
+ });
118
+ /* eslint-disable-next-line @stylistic/max-len */
119
+ Task.title = `Determined that the ${(0, cli_utilities_1.Code)("npm")} script "${(0, cli_utilities_1.Code)("update-reactive")}" ${Context.WriteNpmScript ? chalk_1.default.italic("should") : "should " + chalk_1.default.italic("not")} be added.`;
120
+ },
121
+ /* eslint-disable-next-line @stylistic/max-len */
122
+ title: `Determining whether the ${(0, cli_utilities_1.Code)("npm")} script "${(0, cli_utilities_1.Code)("update-reactive")}" should be added.`
123
+ },
124
+ {
125
+ skip: (Context) => !Context.WriteNpmScript,
126
+ task: async (_Context, Task) => {
127
+ return Task.newListr((ParentTask) => [
128
+ {
129
+ task: async (Context, Task) => {
130
+ const PackageJsonPath = (0, path_1.resolve)(Context.RootDirectory, "package.json");
131
+ const PackageJsonContents = await (0, promises_1.readFile)(PackageJsonPath, { encoding: "utf-8" });
132
+ Context.PackageJson = JSON.parse(PackageJsonContents);
133
+ Task.title = `Read the project's ${(0, cli_utilities_1.Code)("package.json")}.`;
134
+ },
135
+ title: `Reading the project's ${(0, cli_utilities_1.Code)("package.json")}.`
136
+ },
137
+ {
138
+ task: async (Context, Task) => {
139
+ if ("scripts" in Context.PackageJson &&
140
+ typeof Context.PackageJson.scripts === "object" &&
141
+ Context.PackageJson.scripts !== null) {
142
+ if ("update-reactive" in Context.PackageJson.scripts) {
143
+ Context.AlreadyHasUpdateReactiveScript = true;
144
+ Task.title = `Found existing "${(0, cli_utilities_1.Code)("update-reactive")}" script.`;
145
+ return;
146
+ }
147
+ }
148
+ Context.AlreadyHasUpdateReactiveScript = false;
149
+ Task.title = `No existing "${(0, cli_utilities_1.Code)("update-reactive")}" script found.`;
150
+ },
151
+ title: `Checking for existing "${(0, cli_utilities_1.Code)("update-reactive")}" script.`
152
+ },
153
+ {
154
+ skip: (Context) => Context.AlreadyHasUpdateReactiveScript,
155
+ task: async (Context, Task) => {
156
+ const ScriptsUndefined = (!("scripts" in Context.PackageJson) ||
157
+ Context.PackageJson.scripts === undefined);
158
+ if (ScriptsUndefined) {
159
+ Context.PackageJson.scripts = {};
160
+ }
161
+ Context.PackageJson.scripts["update-reactive"] =
162
+ /* eslint-disable-next-line @stylistic/max-len */
163
+ "electron-reactive-event-cli declare-events && electron-reactive-event-cli generate";
164
+ const OutPackageJson = JSON.stringify(Context.PackageJson, null, 2);
165
+ await (0, promises_1.writeFile)((0, path_1.resolve)(Context.RootDirectory, "package.json"), OutPackageJson, { encoding: "utf-8" });
166
+ Task.title = `Saved changes to ${(0, cli_utilities_1.Code)("package.json")}.`;
167
+ /* eslint-disable-next-line @stylistic/max-len */
168
+ ParentTask.title = `Added "${(0, cli_utilities_1.Code)("update-reactive")}" script to ${(0, cli_utilities_1.Code)("package.json")}.`;
169
+ },
170
+ title: `Saving changes to ${(0, cli_utilities_1.Code)("package.json")}.`
171
+ }
172
+ ], { concurrent: false });
173
+ },
174
+ title: `Adding "${(0, cli_utilities_1.Code)("update-reactive")}" script to ${(0, cli_utilities_1.Code)("package.json")}.`
175
+ }
176
+ ], "Failed to finish setup.", {
177
+ concurrent: false
178
+ });
179
+ console.log(`${chalk_1.default.green("āœ“")} Completed ${(0, cli_utilities_1.Code)("setup")} successfully!`);
59
180
  }
60
181
  //# sourceMappingURL=Setup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Setup.js","sourceRoot":"","sources":["../Source/Setup.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAkEH,oCASC;AAzED,oDAAoD;AAEpD,qCAA4D;AAC5D,uCAAsD;AACtD,kDAA6D;AAC7D,2BAAgC;AAChC,+BAA+B;AAC/B,0CAAwC;AAExC,KAAK,UAAU,uBAAuB;IAElC,MAAM,KAAK,GAAkB,IAAI,CAAC,SAAS,CAAC,MAAM,IAAA,yBAAgB,GAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3F,MAAM,cAAc,GAAW,KAAK,CAAC,SAAS,CAAC,CAAC,IAAY,EAAW,EAAE;QAErE,OAAO,IAAI,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAkB;;;;;;;;;;;;CAY3C,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEV,OAAO,KAAK,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,EAAE,GAAG,gBAAgB,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpF,CAAC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AAO,CAAC,WAAW,CAAC,OAAO,GAAG,EAAG,CAAC;4BACtC,CAAC;4BAEA,OAAO,CAAC,WAAW,CAAC,OAAkC,CAAC,iBAAiB,CAAC;gCACtE,iDAAiD;gCACjD,oFAAoF,CAAC;4BAEzF,MAAM,cAAc,GAAW,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;4BAC5E,MAAM,IAAA,oBAAS,EACX,IAAA,cAAO,EAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,EAC9C,cAAc,EACd,EAAE,QAAQ,EAAE,OAAO,EAAE,CACxB,CAAC;4BAEF,IAAI,CAAC,KAAK,GAAG,oBAAqB,IAAA,oBAAI,EAAC,cAAc,CAAE,GAAG,CAAC;4BAE3D,iDAAiD;4BACjD,UAAU,CAAC,KAAK,GAAG,UAAW,IAAA,oBAAI,EAAC,iBAAiB,CAAE,eAAgB,IAAA,oBAAI,EAAC,cAAc,CAAE,GAAG,CAAC;wBACnG,CAAC;wBACD,KAAK,EAAE,qBAAsB,IAAA,oBAAI,EAAC,cAAc,CAAE,GAAG;qBACxD;iBACJ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;YAC9B,CAAC;YACD,KAAK,EAAE,WAAY,IAAA,oBAAI,EAAC,iBAAiB,CAAE,eAAgB,IAAA,oBAAI,EAAC,cAAc,CAAE,GAAG;SACtF;KACJ,EACD,yBAAyB,EACzB;QACI,UAAU,EAAE,KAAK;KACpB,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,GAAI,eAAK,CAAC,KAAK,CAAC,GAAG,CAAE,cAAe,IAAA,oBAAI,EAAC,OAAO,CAAE,gBAAgB,CAAC,CAAC;AACpF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DefaultRenderer, ListrDefaultRenderer, ListrGetRendererClassFromValue, ListrTask, ListrTaskWrapper } from "listr2";
2
+ export type Wrapper<ContextType> = ListrTaskWrapper<ContextType, ListrDefaultRenderer, ListrDefaultRenderer>;
3
+ export type ListrConstructorTask<ContextType> = ListrTask<ContextType, ListrGetRendererClassFromValue<typeof DefaultRenderer>, ListrGetRendererClassFromValue<typeof DefaultRenderer>> | Array<ListrTask<ContextType, ListrGetRendererClassFromValue<typeof DefaultRenderer>, ListrGetRendererClassFromValue<typeof DefaultRenderer>>>;
4
+ //# sourceMappingURL=Shared.Types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shared.Types.d.ts","sourceRoot":"","sources":["../Source/Shared.Types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,eAAe,EACf,oBAAoB,EACpB,8BAA8B,EAC9B,SAAS,EACT,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,MAAM,OAAO,CAAC,WAAW,IAAI,gBAAgB,CAC/C,WAAW,EACX,oBAAoB,EACpB,oBAAoB,CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,WAAW,IACtC,SAAS,CACP,WAAW,EACX,8BAA8B,CAAC,OAAO,eAAe,CAAC,EACtD,8BAA8B,CAAC,OAAO,eAAe,CAAC,CAAC,GACzD,KAAK,CAAC,SAAS,CACb,WAAW,EACX,8BAA8B,CAAC,OAAO,eAAe,CAAC,EACtD,8BAA8B,CAAC,OAAO,eAAe,CAAC,CAAC,CAC1D,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /* File: Shared.Types.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=Shared.Types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shared.Types.js","sourceRoot":"","sources":["../Source/Shared.Types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,8 @@
1
+ import { type DefaultRenderer, type ListrBaseClassOptions, type ListrTaskObject } from "listr2";
2
+ import type { ListrConstructorTask } from "./Shared.Types";
3
+ export declare class SimpleError extends Error {
4
+ constructor(Message: string);
5
+ TheMessage: string;
6
+ }
7
+ export declare function RunListr<ContextType = unknown>(Task: ListrConstructorTask<ContextType>, GenericErrorMessage: string, Options?: ListrBaseClassOptions<ContextType, typeof DefaultRenderer, typeof DefaultRenderer>, ParentTask?: ListrTaskObject<unknown, typeof DefaultRenderer, typeof DefaultRenderer>): Promise<void>;
8
+ //# sourceMappingURL=Shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shared.d.ts","sourceRoot":"","sources":["../Source/Shared.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACI,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,qBAAa,WAAY,SAAQ,KAAK;gBAEf,OAAO,EAAE,MAAM;IAM3B,UAAU,EAAE,MAAM,CAAC;CAC7B;AA8BD,wBAAsB,QAAQ,CAAC,WAAW,GAAG,OAAO,EAChD,IAAI,EAAE,oBAAoB,CAAC,WAAW,CAAC,EACvC,mBAAmB,EAAE,MAAM,EAC3B,OAAO,CAAC,EAAE,qBAAqB,CAAC,WAAW,EAAE,OAAO,eAAe,EAAE,OAAO,eAAe,CAAC,EAC5F,UAAU,CAAC,EAAE,eAAe,CACxB,OAAO,EACP,OAAO,eAAe,EACtB,OAAO,eAAe,CACzB,GACF,OAAO,CAAC,IAAI,CAAC,CAkBf"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /* File: Shared.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.SimpleError = void 0;
9
+ exports.RunListr = RunListr;
10
+ const listr2_1 = require("listr2");
11
+ class SimpleError extends Error {
12
+ constructor(Message) {
13
+ super();
14
+ this.TheMessage = Message;
15
+ }
16
+ TheMessage;
17
+ }
18
+ exports.SimpleError = SimpleError;
19
+ ;
20
+ class Listr extends listr2_1.Listr {
21
+ constructor(Task, Options, ParentTask) {
22
+ if (Options === undefined && ParentTask === undefined) {
23
+ super(Task);
24
+ }
25
+ else if (Options !== undefined && ParentTask === undefined) {
26
+ super(Task, Options);
27
+ }
28
+ else if (Options !== undefined && ParentTask !== undefined) {
29
+ super(Task, Options, ParentTask);
30
+ }
31
+ }
32
+ }
33
+ ;
34
+ async function RunListr(Task, GenericErrorMessage, Options, ParentTask) {
35
+ try {
36
+ await new Listr(Task, Options, ParentTask);
37
+ }
38
+ catch (ListrError) {
39
+ if (ListrError instanceof SimpleError) {
40
+ console.error(`🚨 ${ListrError.TheMessage}`);
41
+ }
42
+ else {
43
+ console.dir(ListrError);
44
+ console.error("\n🚨 ${ GenericErrorMessage }. The error is printed above.");
45
+ }
46
+ }
47
+ }
48
+ //# sourceMappingURL=Shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shared.js","sourceRoot":"","sources":["../Source/Shared.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAgDH,4BA2BC;AAzED,mCAI2C;AAG3C,MAAa,WAAY,SAAQ,KAAK;IAElC,YAAmB,OAAe;QAE9B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;IAC9B,CAAC;IAEM,UAAU,CAAS;CAC7B;AATD,kCASC;AAAA,CAAC;AAEF,MAAM,KACF,SAAQ,cAA0E;IAElF,YACI,IAAuC,EACvC,OAA4F,EAC5F,UAIC;QAGD,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EACrD,CAAC;YACG,KAAK,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;aACI,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EAC1D,CAAC;YACG,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzB,CAAC;aACI,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EAC1D,CAAC;YACG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;CACJ;AAAA,CAAC;AAEK,KAAK,UAAU,QAAQ,CAC1B,IAAuC,EACvC,mBAA2B,EAC3B,OAA4F,EAC5F,UAIC;IAGD,IACA,CAAC;QACG,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,UAAmB,EAC1B,CAAC;QACG,IAAI,UAAU,YAAY,WAAW,EACrC,CAAC;YACG,OAAO,CAAC,KAAK,CAAC,MAAO,UAAU,CAAC,UAAW,EAAE,CAAC,CAAC;QACnD,CAAC;aAED,CAAC;YACG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACxB,OAAO,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./Config";
2
+ export * from "./Config.Types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAMA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /* File: index.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ __exportStar(require("./Config"), exports);
23
+ __exportStar(require("./Config.Types"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,iDAA+B"}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "electron-reactive-event-cli",
3
- "version": "1.0.111",
3
+ "version": "1.0.112",
4
4
  "description": "CLI utility for electron-reactive-event.",
5
5
  "bin": {
6
6
  "electron-reactive-event-cli": "./Distribution/Bin.js",
7
+ "electron-reactive-event-cli-setup": "./Distribution/Setup.Command.js",
7
8
  "reactive-cli": "./Distribution/Bin.js"
8
9
  },
9
10
  "files": [
@@ -29,6 +30,10 @@
29
30
  "license": "MIT",
30
31
  "author": "Gage Sorrell <gage@sorrell.sh>",
31
32
  "type": "commonjs",
33
+ "exports": {
34
+ ".": "./Distribution/index.js"
35
+ },
36
+ "types": "./Distribution/index.d.ts",
32
37
  "main": "index.js",
33
38
  "scripts": {
34
39
  "build": "tsc -p ./tsconfig.json",
@@ -36,10 +41,15 @@
36
41
  "generate-schema": "npx typescript-json-schema ./tsconfig.JsonSchema.json CliConfig --out ../ElectronReactiveEvent/Documentation/public/CliConfig.Schema.json"
37
42
  },
38
43
  "dependencies": {
44
+ "@listr2/prompt-adapter-enquirer": "^4.2.1",
45
+ "@sorrell/cli-utilities": "^1.0.27",
39
46
  "@sorrell/utilities": "^1.1.6",
47
+ "chalk": "^5.6.2",
40
48
  "degit": "^2.8.4",
49
+ "listr2": "^10.2.1",
41
50
  "open": "^11.0.0",
42
51
  "ora": "^9.3.0",
52
+ "simple-git": "^3.36.0",
43
53
  "typescript": "^6.0.2"
44
54
  },
45
55
  "devDependencies": {