electron-reactive-event-cli 1.0.11 → 1.0.13
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/Distribution/Initialize.Types.d.ts +15 -0
- package/Distribution/Initialize.Types.d.ts.map +1 -0
- package/Distribution/Initialize.Types.js +7 -0
- package/Distribution/Initialize.Types.js.map +1 -0
- package/Distribution/Initialize.d.ts +2 -0
- package/Distribution/Initialize.d.ts.map +1 -0
- package/Distribution/Initialize.js +288 -0
- package/Distribution/Initialize.js.map +1 -0
- package/Distribution/Main.d.ts +2 -0
- package/Distribution/Main.d.ts.map +1 -0
- package/Distribution/Main.js +8 -0
- package/Distribution/Main.js.map +1 -0
- package/Distribution/Provider.d.ts +2 -0
- package/Distribution/Provider.d.ts.map +1 -0
- package/Distribution/Provider.js +8 -0
- package/Distribution/Provider.js.map +1 -0
- package/Distribution/Register.Types.d.ts +2 -0
- package/Distribution/Register.Types.d.ts.map +1 -0
- package/Distribution/Register.Types.js +2 -0
- package/Distribution/Register.Types.js.map +1 -0
- package/Distribution/Register.d.ts +3 -0
- package/Distribution/Register.d.ts.map +1 -0
- package/Distribution/Register.js +13 -0
- package/Distribution/Register.js.map +1 -0
- package/Distribution/Schema.Types.d.ts +26 -0
- package/Distribution/Schema.Types.d.ts.map +1 -0
- package/Distribution/Schema.Types.js +10 -0
- package/Distribution/Schema.Types.js.map +1 -0
- package/Distribution/Select.d.ts +2 -0
- package/Distribution/Select.d.ts.map +1 -0
- package/Distribution/Select.js +114 -0
- package/Distribution/Select.js.map +1 -0
- package/Distribution/Setup.d.ts +3 -0
- package/Distribution/Setup.d.ts.map +1 -0
- package/Distribution/Setup.js +75 -0
- package/Distribution/Setup.js.map +1 -0
- package/Distribution/Shared.d.ts +2 -0
- package/Distribution/Shared.d.ts.map +1 -0
- package/Distribution/Shared.js +8 -0
- package/Distribution/Shared.js.map +1 -0
- package/Distribution/Utility.d.ts +2 -0
- package/Distribution/Utility.d.ts.map +1 -0
- package/Distribution/Utility.js +2 -0
- package/Distribution/Utility.js.map +1 -0
- package/Distribution/index.d.ts +9 -0
- package/Distribution/index.d.ts.map +1 -0
- package/Distribution/index.js.map +1 -0
- package/package.json +1 -4
- package/tsconfig.json +34 -0
- package/tsconfig.json.old +38 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type FOutputType = "console" | "clipboard" | "file";
|
|
2
|
+
export type FSetupOptions = {
|
|
3
|
+
interactive: boolean;
|
|
4
|
+
};
|
|
5
|
+
export type FCommandName = "preload" | "provider";
|
|
6
|
+
export interface IOptions {
|
|
7
|
+
Output: FOutputType;
|
|
8
|
+
}
|
|
9
|
+
export interface IGenerationRequest {
|
|
10
|
+
CommandName: FCommandName;
|
|
11
|
+
OutputType: FOutputType;
|
|
12
|
+
OutputPath: string | undefined;
|
|
13
|
+
OutputPathExists: boolean;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Initialize.Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Initialize.Types.d.ts","sourceRoot":"","sources":["../Source/Initialize.Types.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,WAAW,GACjB,SAAS,GACT,WAAW,GACX,MAAM,CAAC;AAEb,MAAM,MAAM,aAAa,GACrB;IACI,WAAW,EAAE,OAAO,CAAC;CACxB,CAAC;AAEN,MAAM,MAAM,YAAY,GAClB,SAAS,GACT,UAAU,CAAC;AAEjB,MAAM,WAAW,QAAQ;IAErB,MAAM,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IAE/B,WAAW,EAAE,YAAY,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,gBAAgB,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Initialize.Types.js","sourceRoot":"","sources":["../Source/Initialize.Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Initialize.d.ts","sourceRoot":"","sources":["../Source/Initialize.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/* File: Initialize.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
* Comment: This module registers the commands defined the other modules
|
|
6
|
+
* in this package.
|
|
7
|
+
*/
|
|
8
|
+
/* eslint-disable no-console */
|
|
9
|
+
import { GetRegisterCommand, GetSetupCommand } from "./index.js";
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
async function Main() {
|
|
12
|
+
const Program = new Command();
|
|
13
|
+
ConfigureProgram(Program);
|
|
14
|
+
const UserArguments = process.argv.slice(2);
|
|
15
|
+
const NormalizedUserArguments = NormalizeUserArguments(UserArguments);
|
|
16
|
+
console.log("NormalizedUserArguments:\n", JSON.stringify(NormalizeUserArguments, null, 4));
|
|
17
|
+
await Program.parseAsync(NormalizedUserArguments, {
|
|
18
|
+
from: "user"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async function ConfigureProgram(ProgramInstance) {
|
|
22
|
+
ProgramInstance
|
|
23
|
+
.name("create-electron-reactive-event")
|
|
24
|
+
.description("Generate boilerplate for Electron + React integrations.")
|
|
25
|
+
.showHelpAfterError()
|
|
26
|
+
.helpOption("-h, --help", "Display help information")
|
|
27
|
+
.helpCommand("help [command]", "Display help for command");
|
|
28
|
+
ProgramInstance.addCommand(await GetSetupCommand());
|
|
29
|
+
ProgramInstance.addCommand(await GetRegisterCommand());
|
|
30
|
+
}
|
|
31
|
+
// function CreateCommand(
|
|
32
|
+
// CommandName: FCommandName
|
|
33
|
+
// ): Command
|
|
34
|
+
// {
|
|
35
|
+
// const CommandInstance: Command = new Command(CommandName);
|
|
36
|
+
// CommandInstance
|
|
37
|
+
// .description(GetCommandDescription(CommandName))
|
|
38
|
+
// .requiredOption(
|
|
39
|
+
// "-o, --output <Output Type>",
|
|
40
|
+
// "Output type: console | clipboard | file",
|
|
41
|
+
// ParseOutputType
|
|
42
|
+
// )
|
|
43
|
+
// .argument(
|
|
44
|
+
// "[ OutputPath ]",
|
|
45
|
+
// "Required when output type is \"file\""
|
|
46
|
+
// )
|
|
47
|
+
// .action(
|
|
48
|
+
// async (
|
|
49
|
+
// OutputPathRaw: string | undefined,
|
|
50
|
+
// OptionsRaw: IOptions,
|
|
51
|
+
// ActionCommand: Command
|
|
52
|
+
// ): Promise<void> =>
|
|
53
|
+
// {
|
|
54
|
+
// const Request: IGenerationRequest = BuildGenerationRequest(
|
|
55
|
+
// CommandName,
|
|
56
|
+
// OptionsRaw,
|
|
57
|
+
// OutputPathRaw,
|
|
58
|
+
// ActionCommand
|
|
59
|
+
// );
|
|
60
|
+
// const GeneratedContent: string = BuildGeneratedContent(CommandName);
|
|
61
|
+
// await EmitGeneratedContent(Request, GeneratedContent);
|
|
62
|
+
// }
|
|
63
|
+
// );
|
|
64
|
+
// return CommandInstance;
|
|
65
|
+
// }
|
|
66
|
+
// function GetCommandDescription(CommandName: FCommandName): string
|
|
67
|
+
// {
|
|
68
|
+
// switch (CommandName)
|
|
69
|
+
// {
|
|
70
|
+
// case "preload":
|
|
71
|
+
// {
|
|
72
|
+
// return "Generate preload boilerplate.";
|
|
73
|
+
// }
|
|
74
|
+
// case "provider":
|
|
75
|
+
// {
|
|
76
|
+
// return "Generate provider boilerplate.";
|
|
77
|
+
// }
|
|
78
|
+
// }
|
|
79
|
+
// }
|
|
80
|
+
// function ParseOutputType(
|
|
81
|
+
// OutputTypeRaw: string
|
|
82
|
+
// ): FOutputType
|
|
83
|
+
// {
|
|
84
|
+
// switch (OutputTypeRaw)
|
|
85
|
+
// {
|
|
86
|
+
// case "console":
|
|
87
|
+
// case "clipboard":
|
|
88
|
+
// case "file":
|
|
89
|
+
// {
|
|
90
|
+
// return OutputTypeRaw;
|
|
91
|
+
// }
|
|
92
|
+
// default:
|
|
93
|
+
// {
|
|
94
|
+
// throw new InvalidArgumentError(
|
|
95
|
+
// "Output type must be exactly one of \"console\", \"clipboard\", or \"file\"."
|
|
96
|
+
// );
|
|
97
|
+
// }
|
|
98
|
+
// }
|
|
99
|
+
// }
|
|
100
|
+
// function BuildGenerationRequest(
|
|
101
|
+
// CommandName: FCommandName,
|
|
102
|
+
// Options: IOptions,
|
|
103
|
+
// OutputPathRaw: string | undefined,
|
|
104
|
+
// ActionCommand: Command
|
|
105
|
+
// ): IGenerationRequest
|
|
106
|
+
// {
|
|
107
|
+
// if (Options.Output === "file")
|
|
108
|
+
// {
|
|
109
|
+
// if (OutputPathRaw === undefined)
|
|
110
|
+
// {
|
|
111
|
+
// ActionCommand.error(
|
|
112
|
+
// "When --output file is used, you must also provide an output path immediately afterward."
|
|
113
|
+
// );
|
|
114
|
+
// }
|
|
115
|
+
// const OutputPath: string = resolve(OutputPathRaw);
|
|
116
|
+
// const OutputPathExists: boolean = existsSync(OutputPath);
|
|
117
|
+
// return {
|
|
118
|
+
// CommandName,
|
|
119
|
+
// OutputType: Options.Output,
|
|
120
|
+
// OutputPath,
|
|
121
|
+
// OutputPathExists
|
|
122
|
+
// };
|
|
123
|
+
// }
|
|
124
|
+
// if (OutputPathRaw !== undefined)
|
|
125
|
+
// {
|
|
126
|
+
// ActionCommand.error(
|
|
127
|
+
// "An output path may only be provided when --output file is used."
|
|
128
|
+
// );
|
|
129
|
+
// }
|
|
130
|
+
// return {
|
|
131
|
+
// CommandName,
|
|
132
|
+
// OutputType: Options.Output,
|
|
133
|
+
// OutputPath: undefined,
|
|
134
|
+
// OutputPathExists: false
|
|
135
|
+
// };
|
|
136
|
+
// }
|
|
137
|
+
// function BuildGeneratedContent(CommandName: FCommandName): string
|
|
138
|
+
// {
|
|
139
|
+
// return "";
|
|
140
|
+
// };
|
|
141
|
+
// async function MakeConfig(): Promise<string>
|
|
142
|
+
// {
|
|
143
|
+
// const Root: string = await GetRootDirectory();
|
|
144
|
+
//
|
|
145
|
+
// }
|
|
146
|
+
// async function EmitGeneratedContent(Request: IGenerationRequest, GeneratedContent: string): Promise<void>
|
|
147
|
+
// {
|
|
148
|
+
// switch (Request.OutputType)
|
|
149
|
+
// {
|
|
150
|
+
// case "console":
|
|
151
|
+
// {
|
|
152
|
+
// console.log(GeneratedContent);
|
|
153
|
+
// return;
|
|
154
|
+
// }
|
|
155
|
+
// case "clipboard":
|
|
156
|
+
// {
|
|
157
|
+
// clipboard.write(GeneratedContent);
|
|
158
|
+
// console.log("Output has been written to the clipboard.");
|
|
159
|
+
// return;
|
|
160
|
+
// }
|
|
161
|
+
// case "file":
|
|
162
|
+
// {
|
|
163
|
+
// await EmitFileOutput(Request, GeneratedContent);
|
|
164
|
+
// return;
|
|
165
|
+
// }
|
|
166
|
+
// }
|
|
167
|
+
// }
|
|
168
|
+
// async function EmitFileOutput(Request: IGenerationRequest, GeneratedContent: string): Promise<void>
|
|
169
|
+
// {
|
|
170
|
+
// if (Request.OutputPath === undefined)
|
|
171
|
+
// {
|
|
172
|
+
// throw new Error("OutputPath was unexpectedly undefined.");
|
|
173
|
+
// }
|
|
174
|
+
// mkdirSync(dirname(Request.OutputPath), { recursive: true });
|
|
175
|
+
// if (Request.OutputPathExists === true)
|
|
176
|
+
// {
|
|
177
|
+
// const ExistingContent: string = readFileSync(
|
|
178
|
+
// Request.OutputPath,
|
|
179
|
+
// "utf8"
|
|
180
|
+
// );
|
|
181
|
+
// const UpdatedContent: string = MergeWithExistingFile(ExistingContent, GeneratedContent);
|
|
182
|
+
// writeFileSync(Request.OutputPath, UpdatedContent, "utf8");
|
|
183
|
+
// console.log(`Updated existing file: "${ Request.OutputPath }"`);
|
|
184
|
+
// }
|
|
185
|
+
// else
|
|
186
|
+
// {
|
|
187
|
+
// writeFileSync(Request.OutputPath, GeneratedContent, "utf8");
|
|
188
|
+
// console.log(`Created new file: "${ Request.OutputPath }"`);
|
|
189
|
+
// }
|
|
190
|
+
// }
|
|
191
|
+
// function MergeWithExistingFile(ExistingContent: string, GeneratedContent: string): string
|
|
192
|
+
// {
|
|
193
|
+
// return [
|
|
194
|
+
// ExistingContent,
|
|
195
|
+
// "",
|
|
196
|
+
// GeneratedContent,
|
|
197
|
+
// ""
|
|
198
|
+
// ].join("\n");
|
|
199
|
+
// }
|
|
200
|
+
function NormalizeUserArguments(UserArguments) {
|
|
201
|
+
const NormalizedUserArguments = [];
|
|
202
|
+
let IsExpectingOutputValue = false;
|
|
203
|
+
let IsExpectingOutputPath = false;
|
|
204
|
+
for (let Index = 0; Index < UserArguments.length; Index += 1) {
|
|
205
|
+
const UserArgument = UserArguments[Index];
|
|
206
|
+
if (IsExpectingOutputValue === true && UserArgument !== undefined) {
|
|
207
|
+
NormalizedUserArguments.push(UserArgument);
|
|
208
|
+
IsExpectingOutputValue = false;
|
|
209
|
+
IsExpectingOutputPath = UserArgument === "file";
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
if (IsExpectingOutputPath === true && UserArgument !== undefined) {
|
|
213
|
+
NormalizedUserArguments.push(UserArgument);
|
|
214
|
+
IsExpectingOutputPath = false;
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
const IsHelpArgument = (UserArgument === "?" ||
|
|
218
|
+
UserArgument === "/?" ||
|
|
219
|
+
UserArgument === "/h" ||
|
|
220
|
+
UserArgument === "/help");
|
|
221
|
+
if (IsHelpArgument) {
|
|
222
|
+
NormalizedUserArguments.push("--help");
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
if (UserArgument === "help" && ShouldTreatAsHelpCommand(UserArguments, Index) === true) {
|
|
226
|
+
NormalizedUserArguments.push("--help");
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (UserArgument === "-o" || UserArgument === "--output") {
|
|
230
|
+
NormalizedUserArguments.push(UserArgument);
|
|
231
|
+
IsExpectingOutputValue = true;
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (UserArgument === "/o" || UserArgument === "/output") {
|
|
235
|
+
NormalizedUserArguments.push("--output");
|
|
236
|
+
IsExpectingOutputValue = true;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
if (UserArgument?.startsWith("-o=") === true) {
|
|
240
|
+
const OutputValue = UserArgument.slice("-o=".length);
|
|
241
|
+
NormalizedUserArguments.push(`--output=${OutputValue}`);
|
|
242
|
+
IsExpectingOutputPath = OutputValue === "file";
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
if (UserArgument?.startsWith("--output=") === true) {
|
|
246
|
+
const OutputValue = UserArgument.slice("--output=".length);
|
|
247
|
+
NormalizedUserArguments.push(`--output=${OutputValue}`);
|
|
248
|
+
IsExpectingOutputPath = OutputValue === "file";
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
if (UserArgument?.startsWith("/o=") === true) {
|
|
252
|
+
const OutputValue = UserArgument.slice("/o=".length);
|
|
253
|
+
NormalizedUserArguments.push(`--output=${OutputValue}`);
|
|
254
|
+
IsExpectingOutputPath = OutputValue === "file";
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
if (UserArgument?.startsWith("/output=") === true) {
|
|
258
|
+
const OutputValue = UserArgument.slice("/output=".length);
|
|
259
|
+
NormalizedUserArguments.push(`--output=${OutputValue}`);
|
|
260
|
+
IsExpectingOutputPath = OutputValue === "file";
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
if (UserArgument !== undefined) {
|
|
264
|
+
NormalizedUserArguments.push(UserArgument);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return NormalizedUserArguments;
|
|
268
|
+
}
|
|
269
|
+
function ShouldTreatAsHelpCommand(UserArguments, Index) {
|
|
270
|
+
if (UserArguments[Index] !== "help") {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
if (UserArguments.length === 1 && Index === 0) {
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
const IsAskingForCommandDescription = (UserArguments.length === 2 &&
|
|
277
|
+
Index === 1 &&
|
|
278
|
+
IsCommandName(UserArguments[0] || ""));
|
|
279
|
+
if (IsAskingForCommandDescription) {
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
function IsCommandName(Value) {
|
|
285
|
+
return ["setup", "register"].includes(Value);
|
|
286
|
+
}
|
|
287
|
+
Main();
|
|
288
|
+
//# sourceMappingURL=Initialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Initialize.js","sourceRoot":"","sources":["../Source/Initialize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,+BAA+B;AAE/B,OAAO,EAAqB,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,KAAK,UAAU,IAAI;IAEf,MAAM,OAAO,GAAY,IAAI,OAAO,EAAE,CAAC;IACvC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAE1B,MAAM,aAAa,GAA0B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnE,MAAM,uBAAuB,GAAkB,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAErF,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,IAAI,CAAC,SAAS,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAE3F,MAAM,OAAO,CAAC,UAAU,CACpB,uBAAuB,EACvB;QACI,IAAI,EAAE,MAAM;KACf,CACJ,CAAC;AACN,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,eAAwB;IAEpD,eAAe;SACV,IAAI,CAAC,gCAAgC,CAAC;SACtC,WAAW,CAAC,yDAAyD,CAAC;SACtE,kBAAkB,EAAE;SACpB,UAAU,CAAC,YAAY,E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AAC;YACG,MAAM,WAAW,GAAW,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAElE,uBAAuB,CAAC,IAAI,CAAC,YAAa,WAAY,EAAE,CAAC,CAAC;YAC1D,qBAAqB,GAAG,WAAW,KAAK,MAAM,CAAC;YAE/C,SAAS;QACb,CAAC;QAED,IAAI,YAAY,KAAK,SAAS,EAC9B,CAAC;YACG,uBAAuB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;IAED,OAAO,uBAAuB,CAAC;AACnC,CAAC;AAED,SAAS,wBAAwB,CAAC,aAAoC,EAAE,KAAa;IAEjF,IAAI,aAAa,CAAC,KAAK,CAAC,KAAK,MAAM,EACnC,CAAC;QACG,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,EAC7C,CAAC;QACG,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,6BAA6B,GAAY,CAC3C,aAAa,CAAC,MAAM,KAAK,CAAC;QAC1B,KAAK,KAAK,CAAC;QACX,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CACxC,CAAC;IAEF,IAAI,6BAA6B,EACjC,CAAC;QACG,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAEhC,OAAO,CAAE,OAAO,EAAE,UAAU,CAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Main.d.ts","sourceRoot":"","sources":["../Source/Main.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../Source/Main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../Source/Provider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../Source/Provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Register.Types.d.ts","sourceRoot":"","sources":["../Source/Register.Types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Register.Types.js","sourceRoot":"","sources":["../Source/Register.Types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Register.d.ts","sourceRoot":"","sources":["../Source/Register.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,wBAAgB,kBAAkB,IAAI,OAAO,CAO5C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* File: Register.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
* Comment: This module defines the `register` command.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
export function GetRegisterCommand() {
|
|
9
|
+
const RegisterCommand = new Command("register");
|
|
10
|
+
// RegisterCommand.
|
|
11
|
+
return RegisterCommand;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=Register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Register.js","sourceRoot":"","sources":["../Source/Register.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,UAAU,kBAAkB;IAE9B,MAAM,eAAe,GAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAEzD,mBAAmB;IAEnB,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type FCliConfig = {
|
|
2
|
+
/** The `name` of the interface that holds your `main` event declarations. */
|
|
3
|
+
main: {
|
|
4
|
+
/** The name of the interface type. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** The path of the module that contains the interface type. */
|
|
7
|
+
path: string;
|
|
8
|
+
};
|
|
9
|
+
/** The `name` of the interface that holds your `renderer` event declarations. */
|
|
10
|
+
renderer: {
|
|
11
|
+
/** The name of the interface type. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** The path of the module that contains the interface type. */
|
|
14
|
+
path: string;
|
|
15
|
+
};
|
|
16
|
+
/** Where the module containing the `declare module` blocks will be written. */
|
|
17
|
+
outPath: string;
|
|
18
|
+
/**
|
|
19
|
+
* The glob(s) of path(s) to modules containing your event declarations.
|
|
20
|
+
*
|
|
21
|
+
* If this property is not specified, then the paths given in the
|
|
22
|
+
* `include` property of your package's `tsconfig.json` will be used.
|
|
23
|
+
*/
|
|
24
|
+
files?: Array<string>;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=Schema.Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Schema.Types.d.ts","sourceRoot":"","sources":["../Source/Schema.Types.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,UAAU,GAClB;IACI,6EAA6E;IAC7E,IAAI,EACJ;QACI,sCAAsC;QACtC,IAAI,EAAE,MAAM,CAAC;QAEb,+DAA+D;QAC/D,IAAI,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,iFAAiF;IACjF,QAAQ,EACR;QACI,sCAAsC;QACtC,IAAI,EAAE,MAAM,CAAC;QAEb,+DAA+D;QAC/D,IAAI,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* File: Schema.Types.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
* Comment: This module defines the `Schema` type, from which the JSON schema
|
|
6
|
+
* is created for the JSON file that may be provided to the
|
|
7
|
+
* `register` command.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=Schema.Types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Schema.Types.js","sourceRoot":"","sources":["../Source/Schema.Types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../Source/Select.ts"],"names":[],"mappings":"AAwIA,wBAAsB,YAAY,CAC9B,gCAAgC,EAAE,MAAM,GACzC,OAAO,CAAC,MAAM,CAAC,CAgEjB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* File: Select.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { confirm, select } from "@inquirer/prompts";
|
|
7
|
+
import { extname, relative, resolve } from "path";
|
|
8
|
+
import { readdir, stat } from "fs/promises";
|
|
9
|
+
function IsTypeScriptModuleFile(FileName) {
|
|
10
|
+
const Extension = extname(FileName).toLowerCase();
|
|
11
|
+
return Extension === ".ts" || Extension === ".tsx";
|
|
12
|
+
}
|
|
13
|
+
function GetDisplayDirectory(ProjectRootDirectoryPath, CurrentDirectoryPath) {
|
|
14
|
+
const RelativeDirectoryPath = relative(ProjectRootDirectoryPath, CurrentDirectoryPath);
|
|
15
|
+
return RelativeDirectoryPath === "" ? "." : RelativeDirectoryPath;
|
|
16
|
+
}
|
|
17
|
+
async function ReadMenuChoices(ProjectRootDirectoryPath, CurrentDirectoryPath) {
|
|
18
|
+
const DirectoryEntries = await readdir(CurrentDirectoryPath, { withFileTypes: true });
|
|
19
|
+
const SortDirectories = (A, B) => {
|
|
20
|
+
return A.name.localeCompare(B.name, undefined, {
|
|
21
|
+
numeric: true,
|
|
22
|
+
sensitivity: "base"
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
const GetDirectoryChoice = (DirectoryEntry) => {
|
|
26
|
+
const AbsolutePath = resolve(CurrentDirectoryPath, DirectoryEntry.name);
|
|
27
|
+
return {
|
|
28
|
+
description: "Open directory",
|
|
29
|
+
name: `${DirectoryEntry.name}/`,
|
|
30
|
+
value: {
|
|
31
|
+
AbsolutePath,
|
|
32
|
+
Kind: "Directory"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const IsDirectory = (DirectoryEntry) => {
|
|
37
|
+
return DirectoryEntry.isDirectory();
|
|
38
|
+
};
|
|
39
|
+
const DirectoryChoices = DirectoryEntries
|
|
40
|
+
.filter(IsDirectory)
|
|
41
|
+
.sort(SortDirectories)
|
|
42
|
+
.map(GetDirectoryChoice);
|
|
43
|
+
const IsModule = (DirectoryEntry) => {
|
|
44
|
+
return (DirectoryEntry.isFile() &&
|
|
45
|
+
IsTypeScriptModuleFile(DirectoryEntry.name));
|
|
46
|
+
};
|
|
47
|
+
const GetModuleChoice = (DirectoryEntry) => {
|
|
48
|
+
const AbsolutePath = resolve(CurrentDirectoryPath, DirectoryEntry.name);
|
|
49
|
+
return {
|
|
50
|
+
description: "Select module",
|
|
51
|
+
name: DirectoryEntry.name,
|
|
52
|
+
value: {
|
|
53
|
+
AbsolutePath,
|
|
54
|
+
Kind: "File"
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const FileChoices = DirectoryEntries
|
|
59
|
+
.filter(IsModule)
|
|
60
|
+
.sort(SortDirectories)
|
|
61
|
+
.map(GetModuleChoice);
|
|
62
|
+
const Choices = [];
|
|
63
|
+
if (CurrentDirectoryPath !== ProjectRootDirectoryPath) {
|
|
64
|
+
Choices.push({
|
|
65
|
+
description: "Go to parent directory",
|
|
66
|
+
name: "../",
|
|
67
|
+
value: {
|
|
68
|
+
Kind: "Parent"
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
Choices.push(...DirectoryChoices);
|
|
73
|
+
Choices.push(...FileChoices);
|
|
74
|
+
return Choices;
|
|
75
|
+
}
|
|
76
|
+
export async function PromptModule(ProjectRootDirectoryPathArgument) {
|
|
77
|
+
const ProjectRootDirectoryPath = resolve(ProjectRootDirectoryPathArgument);
|
|
78
|
+
const ProjectRootDirectoryStats = await stat(ProjectRootDirectoryPath);
|
|
79
|
+
if (!ProjectRootDirectoryStats.isDirectory()) {
|
|
80
|
+
throw new Error(`The path "${ProjectRootDirectoryPath}" is not a directory.`);
|
|
81
|
+
}
|
|
82
|
+
let CurrentDirectoryPath = ProjectRootDirectoryPath;
|
|
83
|
+
while (true) {
|
|
84
|
+
const Choices = await ReadMenuChoices(ProjectRootDirectoryPath, CurrentDirectoryPath);
|
|
85
|
+
if (Choices.length === 0) {
|
|
86
|
+
throw new Error(`No subdirectories or TypeScript modules were found under "${ProjectRootDirectoryPath}".`);
|
|
87
|
+
}
|
|
88
|
+
const DisplayDirectory = GetDisplayDirectory(ProjectRootDirectoryPath, CurrentDirectoryPath);
|
|
89
|
+
const Selection = await select({
|
|
90
|
+
choices: Choices,
|
|
91
|
+
message: `Select a TypeScript module (${DisplayDirectory})`
|
|
92
|
+
});
|
|
93
|
+
switch (Selection.Kind) {
|
|
94
|
+
case "Parent":
|
|
95
|
+
CurrentDirectoryPath = resolve(CurrentDirectoryPath, "..");
|
|
96
|
+
break;
|
|
97
|
+
case "Directory":
|
|
98
|
+
CurrentDirectoryPath = Selection.AbsolutePath;
|
|
99
|
+
break;
|
|
100
|
+
case "File":
|
|
101
|
+
{
|
|
102
|
+
const RelativeModulePath = relative(ProjectRootDirectoryPath, Selection.AbsolutePath);
|
|
103
|
+
const Confirmed = await confirm({
|
|
104
|
+
message: `Use "${RelativeModulePath}"?`
|
|
105
|
+
});
|
|
106
|
+
if (Confirmed) {
|
|
107
|
+
return Selection.AbsolutePath;
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../Source/Select.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAuB5C,SAAS,sBAAsB,CAAC,QAAgB;IAE5C,MAAM,SAAS,GAAW,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1D,OAAO,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,MAAM,CAAC;AACvD,CAAC;AAED,SAAS,mBAAmB,CAAC,wBAAgC,EAAE,oBAA4B;IAEvF,MAAM,qBAAqB,GAAW,QAAQ,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;IAC/F,OAAO,qBAAqB,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC;AACtE,CAAC;AAED,KAAK,UAAU,eAAe,CAC1B,wBAAgC,EAChC,oBAA4B;IAI5B,MAAM,gBAAgB,GAClB,MAAM,OAAO,CAAC,oBAAoB,EAAE,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EF,MAAM,SAAS,GAAmB,MAAM,MAAM,CAAiB;YAC3D,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,+BAAgC,gBAAiB,GAAG;SAChE,CAAC,CAAC;QAEH,QAAQ,SAAS,CAAC,IAAI,EACtB,CAAC;YACG,KAAK,QAAQ;gBACT,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;gBAC3D,MAAM;YACV,KAAK,WAAW;gBACZ,oBAAoB,GAAG,SAAS,CAAC,YAAY,CAAC;gBAC9C,MAAM;YACV,KAAK,MAAM;gBACX,CAAC;oBACG,MAAM,kBAAkB,GAAW,QAAQ,CACvC,wBAAwB,EACxB,SAAS,CAAC,YAAY,CACzB,CAAC;oBAEF,MAAM,SAAS,GAAY,MAAM,OAAO,CAAC;wBACrC,OAAO,EAAE,QAAQ,kBAAkB,IAAI;qBAC1C,CAAC,CAAC;oBAEH,IAAI,SAAS,EACb,CAAC;wBACG,OAAO,SAAS,CAAC,YAAY,CAAC;oBAClC,CAAC;oBAED,MAAM;gBACV,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Setup.d.ts","sourceRoot":"","sources":["../Source/Setup.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoFpC,wBAAsB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CASxD"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* File: Setup.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
6
|
+
/* eslint-disable no-console */
|
|
7
|
+
import { GetPackageRootDirectory, GetSafeNewPath, TryAsync } from "@sorrell/utilities";
|
|
8
|
+
import { basename, resolve } from "path";
|
|
9
|
+
import { Code } from "@sorrell/cli-utilities";
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
import { PromptModule } from "./Select.js";
|
|
12
|
+
import ora from "ora";
|
|
13
|
+
import { writeFile } from "fs/promises";
|
|
14
|
+
function GetEmptyCliConfig() {
|
|
15
|
+
return {
|
|
16
|
+
main: {
|
|
17
|
+
name: "",
|
|
18
|
+
path: ""
|
|
19
|
+
},
|
|
20
|
+
outPath: "",
|
|
21
|
+
renderer: {
|
|
22
|
+
name: "",
|
|
23
|
+
path: ""
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
async function SetupInteractive() {
|
|
28
|
+
const SelectedModule = await PromptModule(await GetPackageRootDirectory());
|
|
29
|
+
console.log(`SelectedModule === ${SelectedModule}`);
|
|
30
|
+
}
|
|
31
|
+
async function SetupNoInteractive() {
|
|
32
|
+
// Create default `FSchema` object, write to root path.
|
|
33
|
+
// Write to the project root with the default file name
|
|
34
|
+
// (if a file with that path already exists, append `(${ number })`)
|
|
35
|
+
const ConfigFileNameBase = "electron-reactive-event.json";
|
|
36
|
+
const ThisOra = ora({
|
|
37
|
+
text: `Writing ${Code(ConfigFileNameBase)} to your package's root directory...`
|
|
38
|
+
}).start();
|
|
39
|
+
const RootDirectory = await GetPackageRootDirectory();
|
|
40
|
+
const ConfigPathBase = resolve(RootDirectory, ConfigFileNameBase);
|
|
41
|
+
const ConfigPath = await GetSafeNewPath(ConfigPathBase);
|
|
42
|
+
const ConfigContents = JSON.stringify(GetEmptyCliConfig(), null, 4);
|
|
43
|
+
const { Error } = await TryAsync(writeFile(ConfigPath, ConfigContents));
|
|
44
|
+
const ConfigPathFileName = basename(ConfigPath);
|
|
45
|
+
if (Error !== undefined) {
|
|
46
|
+
/* eslint-disable-next-line @stylistic/max-len */
|
|
47
|
+
ThisOra.succeed(`The file ${Code(ConfigPath)} was written successfully!`);
|
|
48
|
+
console.log(`Please open the file and fill out its fields to use the ${Code("register")} command.`);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
/* eslint-disable-next-line @stylistic/max-len */
|
|
52
|
+
ThisOra.fail(`The file ${Code(ConfigPathFileName)} could not be written in ${Code(RootDirectory)}. Here is the error:`);
|
|
53
|
+
console.error(JSON.stringify(Error, null, 4) + "\n");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function Setup() {
|
|
57
|
+
const { interactive: IsInteractive } = this.opts();
|
|
58
|
+
if (IsInteractive) {
|
|
59
|
+
await SetupInteractive.call(this);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
await SetupNoInteractive.call(this);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export async function GetSetupCommand() {
|
|
68
|
+
const SetupCommand = new Command("setup")
|
|
69
|
+
/* eslint-disable-next-line @stylistic/max-len */
|
|
70
|
+
.description("Create the config file needed to register your event declarations automatically in your project's build step.")
|
|
71
|
+
.option("--no-interactive")
|
|
72
|
+
.action(Setup);
|
|
73
|
+
return SetupCommand;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=Setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Setup.js","sourceRoot":"","sources":["../Source/Setup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+BAA+B;AAE/B,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,SAAS,iBAAiB;IAEtB,OAAO;QACH,IA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AAE,WAAW,CAAC,CAAC;IAC1G,CAAC;SAED,CAAC;QACG,iDAAiD;QACjD,OAAO,CAAC,IAAI,CAAC,YAAa,IAAI,CAAC,kBAAkB,CAAE,4BAA6B,IAAI,CAAC,aAAa,CAAE,uBAAuB,CAAC,CAAC;QAC7H,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACzD,CAAC;AACL,CAAC;AAED,KAAK,UAAU,KAAK;IAEhB,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAkB,IAAI,CAAC,IAAI,EAAE,CAAC;IAElE,IAAI,aAAa,EACjB,CAAC;QACG,MAAM,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,OAAO;IACX,CAAC;SAED,CAAC;QACG,MAAM,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,OAAO;IACX,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe;IAEjC,MAAM,YAAY,GAAY,IAAI,OAAO,CAAC,OAAO,CAAC;QAC9C,iDAAiD;SAChD,WAAW,CAAC,+GAA+G,CAAC;SAC5H,MAAM,CAAC,kBAAkB,CAAC;SAC1B,MAAM,CAAC,KAAK,CAAC,CAAC;IAEnB,OAAO,YAAY,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shared.d.ts","sourceRoot":"","sources":["../Source/Shared.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shared.js","sourceRoot":"","sources":["../Source/Shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utility.d.ts","sourceRoot":"","sources":["../Source/Utility.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utility.js","sourceRoot":"","sources":["../Source/Utility.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./Initialize.js";
|
|
2
|
+
export * from "./Initialize.Types.js";
|
|
3
|
+
export * from "./Register.js";
|
|
4
|
+
export * from "./Register.Types.js";
|
|
5
|
+
export * from "./Schema.Types.js";
|
|
6
|
+
export * from "./Select.js";
|
|
7
|
+
export * from "./Setup.js";
|
|
8
|
+
export * from "./Shared.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAMA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"setup": "./Distribution/index.js"
|
|
5
5
|
},
|
|
6
6
|
"name": "electron-reactive-event-cli",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.13",
|
|
8
8
|
"description": "Helper package to integrate electron-reactive-event in your Electron- and React-based app.",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"electron",
|
|
@@ -15,9 +15,6 @@
|
|
|
15
15
|
"event",
|
|
16
16
|
"react-hooks"
|
|
17
17
|
],
|
|
18
|
-
"files": [
|
|
19
|
-
"./Schema.json"
|
|
20
|
-
],
|
|
21
18
|
"homepage": "https://github.com/GageSorrell/SorrellWm/tree/Package/ElectronReactiveEventCli",
|
|
22
19
|
"bugs": {
|
|
23
20
|
"url": "https://github.com/GageSorrell/SorrellWm/issues"
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions":
|
|
3
|
+
{
|
|
4
|
+
"rootDir": "./Source",
|
|
5
|
+
"outDir": "./Distribution",
|
|
6
|
+
"module": "nodenext",
|
|
7
|
+
"target": "esnext",
|
|
8
|
+
"lib": [
|
|
9
|
+
"esnext"
|
|
10
|
+
],
|
|
11
|
+
"types": [
|
|
12
|
+
"node"
|
|
13
|
+
],
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"declarationMap": true,
|
|
17
|
+
"noUncheckedIndexedAccess": true,
|
|
18
|
+
"exactOptionalPropertyTypes": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noImplicitOverride": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
|
24
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
25
|
+
"strict": true,
|
|
26
|
+
"jsx": "react-jsx",
|
|
27
|
+
"isolatedModules": true,
|
|
28
|
+
"noUncheckedSideEffectImports": true,
|
|
29
|
+
"moduleDetection": "force",
|
|
30
|
+
"skipLibCheck": true
|
|
31
|
+
},
|
|
32
|
+
"include": [ "Source/**/*.ts", "Source/**/*.tsx" ],
|
|
33
|
+
"exclude": [ "node_modules", "Distribution" ]
|
|
34
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions":
|
|
3
|
+
{
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"module": "nodenext",
|
|
6
|
+
"moduleResolution": "NodeNext",
|
|
7
|
+
|
|
8
|
+
"rootDir": "./Source",
|
|
9
|
+
"outDir": "./Distribution",
|
|
10
|
+
|
|
11
|
+
"lib":
|
|
12
|
+
[
|
|
13
|
+
"ES2023",
|
|
14
|
+
"DOM",
|
|
15
|
+
"DOM.Iterable"
|
|
16
|
+
],
|
|
17
|
+
|
|
18
|
+
"jsx": "react-jsx",
|
|
19
|
+
|
|
20
|
+
"types": [ "node" ],
|
|
21
|
+
"declaration": true,
|
|
22
|
+
"declarationMap": true,
|
|
23
|
+
"sourceMap": true,
|
|
24
|
+
|
|
25
|
+
"strict": true,
|
|
26
|
+
"isolatedModules": true,
|
|
27
|
+
|
|
28
|
+
"noUncheckedIndexedAccess": true,
|
|
29
|
+
"exactOptionalPropertyTypes": true,
|
|
30
|
+
"noImplicitOverride": true,
|
|
31
|
+
"useUnknownInCatchVariables": true,
|
|
32
|
+
|
|
33
|
+
"skipLibCheck": true,
|
|
34
|
+
"noEmitOnError": true
|
|
35
|
+
},
|
|
36
|
+
"include": [ "Source/**/*.ts", "Source/**/*.tsx" ],
|
|
37
|
+
"exclude": [ "node_modules" ]
|
|
38
|
+
}
|