electron-reactive-event-cli 1.0.118 → 1.0.120

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.
Files changed (95) hide show
  1. package/ReadMe.md +3 -10
  2. package/package.json +7 -26
  3. package/Distribution/All.Command.d.ts +0 -2
  4. package/Distribution/All.Command.d.ts.map +0 -1
  5. package/Distribution/All.Command.js +0 -22
  6. package/Distribution/All.Command.js.map +0 -1
  7. package/Distribution/Bin.d.ts +0 -3
  8. package/Distribution/Bin.d.ts.map +0 -1
  9. package/Distribution/Bin.js +0 -86
  10. package/Distribution/Bin.js.map +0 -1
  11. package/Distribution/Command.d.ts +0 -12
  12. package/Distribution/Command.d.ts.map +0 -1
  13. package/Distribution/Command.js +0 -100
  14. package/Distribution/Command.js.map +0 -1
  15. package/Distribution/Config.Types.d.ts +0 -36
  16. package/Distribution/Config.Types.d.ts.map +0 -1
  17. package/Distribution/Config.Types.js +0 -8
  18. package/Distribution/Config.Types.js.map +0 -1
  19. package/Distribution/Config.d.ts +0 -28
  20. package/Distribution/Config.d.ts.map +0 -1
  21. package/Distribution/Config.js +0 -161
  22. package/Distribution/Config.js.map +0 -1
  23. package/Distribution/DeclareEvents.Command.d.ts +0 -2
  24. package/Distribution/DeclareEvents.Command.d.ts.map +0 -1
  25. package/Distribution/DeclareEvents.Command.js +0 -16
  26. package/Distribution/DeclareEvents.Command.js.map +0 -1
  27. package/Distribution/DeclareEvents.Types.d.ts +0 -11
  28. package/Distribution/DeclareEvents.Types.d.ts.map +0 -1
  29. package/Distribution/DeclareEvents.Types.js +0 -8
  30. package/Distribution/DeclareEvents.Types.js.map +0 -1
  31. package/Distribution/DeclareEvents.d.ts +0 -3
  32. package/Distribution/DeclareEvents.d.ts.map +0 -1
  33. package/Distribution/DeclareEvents.js +0 -213
  34. package/Distribution/DeclareEvents.js.map +0 -1
  35. package/Distribution/Docs.Command.d.ts +0 -3
  36. package/Distribution/Docs.Command.d.ts.map +0 -1
  37. package/Distribution/Docs.Command.js +0 -19
  38. package/Distribution/Docs.Command.js.map +0 -1
  39. package/Distribution/DownloadSample.Command.d.ts +0 -3
  40. package/Distribution/DownloadSample.Command.d.ts.map +0 -1
  41. package/Distribution/DownloadSample.Command.js +0 -107
  42. package/Distribution/DownloadSample.Command.js.map +0 -1
  43. package/Distribution/Generate.Command.d.ts +0 -5
  44. package/Distribution/Generate.Command.d.ts.map +0 -1
  45. package/Distribution/Generate.Command.js +0 -20
  46. package/Distribution/Generate.Command.js.map +0 -1
  47. package/Distribution/GenerateIpc.Command.d.ts +0 -3
  48. package/Distribution/GenerateIpc.Command.d.ts.map +0 -1
  49. package/Distribution/GenerateIpc.Command.js +0 -22
  50. package/Distribution/GenerateIpc.Command.js.map +0 -1
  51. package/Distribution/GenerateIpcMainModule.d.ts +0 -3
  52. package/Distribution/GenerateIpcMainModule.d.ts.map +0 -1
  53. package/Distribution/GenerateIpcMainModule.js +0 -37
  54. package/Distribution/GenerateIpcMainModule.js.map +0 -1
  55. package/Distribution/GenerateIpcRendererModule.d.ts +0 -5
  56. package/Distribution/GenerateIpcRendererModule.d.ts.map +0 -1
  57. package/Distribution/GenerateIpcRendererModule.js +0 -73
  58. package/Distribution/GenerateIpcRendererModule.js.map +0 -1
  59. package/Distribution/GenerateScopedTypes.Command.d.ts +0 -3
  60. package/Distribution/GenerateScopedTypes.Command.d.ts.map +0 -1
  61. package/Distribution/GenerateScopedTypes.Command.js +0 -44
  62. package/Distribution/GenerateScopedTypes.Command.js.map +0 -1
  63. package/Distribution/GenerateScopedTypes.Types.d.ts +0 -25
  64. package/Distribution/GenerateScopedTypes.Types.d.ts.map +0 -1
  65. package/Distribution/GenerateScopedTypes.Types.js +0 -8
  66. package/Distribution/GenerateScopedTypes.Types.js.map +0 -1
  67. package/Distribution/GenerateScopedTypes.d.ts +0 -9
  68. package/Distribution/GenerateScopedTypes.d.ts.map +0 -1
  69. package/Distribution/GenerateScopedTypes.js +0 -228
  70. package/Distribution/GenerateScopedTypes.js.map +0 -1
  71. package/Distribution/Setup.Command.d.ts +0 -3
  72. package/Distribution/Setup.Command.d.ts.map +0 -1
  73. package/Distribution/Setup.Command.js +0 -11
  74. package/Distribution/Setup.Command.js.map +0 -1
  75. package/Distribution/Setup.d.ts +0 -2
  76. package/Distribution/Setup.d.ts.map +0 -1
  77. package/Distribution/Setup.js +0 -184
  78. package/Distribution/Setup.js.map +0 -1
  79. package/Distribution/Shared.Types.d.ts +0 -6
  80. package/Distribution/Shared.Types.d.ts.map +0 -1
  81. package/Distribution/Shared.Types.js +0 -8
  82. package/Distribution/Shared.Types.js.map +0 -1
  83. package/Distribution/Shared.d.ts +0 -24
  84. package/Distribution/Shared.d.ts.map +0 -1
  85. package/Distribution/Shared.js +0 -66
  86. package/Distribution/Shared.js.map +0 -1
  87. package/Distribution/WriteTypesToClipboard.d.ts +0 -2
  88. package/Distribution/WriteTypesToClipboard.d.ts.map +0 -1
  89. package/Distribution/WriteTypesToClipboard.js +0 -193
  90. package/Distribution/WriteTypesToClipboard.js.map +0 -1
  91. package/Distribution/index.d.ts +0 -4
  92. package/Distribution/index.d.ts.map +0 -1
  93. package/Distribution/index.js +0 -25
  94. package/Distribution/index.js.map +0 -1
  95. package/License.md +0 -21
@@ -1,44 +0,0 @@
1
- "use strict";
2
- /* File: GenerateScopedTypes.Command.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.GenerateScopedTypesCommand = GenerateScopedTypesCommand;
9
- exports.GenerateScopedTypes = GenerateScopedTypes;
10
- /* eslint-disable jsdoc/require-jsdoc, no-console */
11
- const Config_1 = require("./Config");
12
- const GenerateScopedTypes_1 = require("./GenerateScopedTypes");
13
- const Command_1 = require("./Command");
14
- async function GenerateScopedTypesCommand() {
15
- (0, Command_1.SetCommand)("generate-scoped-types");
16
- await GenerateScopedTypes();
17
- }
18
- async function GenerateScopedTypes() {
19
- const Config = await (0, Config_1.GetConfigSafe)();
20
- const DefaultConfig = await (0, Config_1.GetDefaultConfig)();
21
- if (!(await (0, Config_1.HasConfig)())) {
22
- /* eslint-disable-next-line @stylistic/max-len */
23
- console.log("\n💡 Tip: You can create a default config file by running\n\n npm exec electron-reactive-event setup\n");
24
- }
25
- const DefaultLabelScopedModulePath = Config.ScopedModulePath === DefaultConfig.ScopedModulePath
26
- ? "default"
27
- : "";
28
- if (!(await (0, Config_1.HasConfig)())) {
29
- /* eslint-disable-next-line @stylistic/max-len */
30
- console.log("\n💡 Tip: You can create a default config file by running\n\n npm exec electron-reactive-event setup\n");
31
- }
32
- /* eslint-disable @stylistic/max-len */
33
- console.log(`Writing scoped types module at ${DefaultLabelScopedModulePath} path ${Config.ScopedModulePath}...`);
34
- try {
35
- await (0, GenerateScopedTypes_1.GenerateScopedTypesInner)();
36
- console.log(`Successfully created scoped types for PackageKey ${Config.PackageKey}!`);
37
- process.exit(0);
38
- }
39
- catch {
40
- console.error(Error, "\n\n🚨 The scoped types could not be written. The error is printed above.");
41
- process.exit(1);
42
- }
43
- }
44
- //# sourceMappingURL=GenerateScopedTypes.Command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenerateScopedTypes.Command.js","sourceRoot":"","sources":["../Source/GenerateScopedTypes.Command.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AASH,gEAIC;AAED,kDAoCC;AAjDD,oDAAoD;AAEpD,qCAAsE;AAEtE,+DAAiE;AACjE,uCAAuC;AAEhC,KAAK,UAAU,0BAA0B;IAE5C,IAAA,oBAAU,EAAC,uBAAuB,CAAC,CAAC;IACpC,MAAM,mBAAmB,EAAE,CAAC;AAChC,CAAC;AAEM,KAAK,UAAU,mBAAmB;IAErC,MAAM,MAAM,GAAc,MAAM,IAAA,sBAAa,GAAE,CAAC;IAChD,MAAM,aAAa,GAAc,MAAM,IAAA,yBAAgB,GAAE,CAAC;IAE1D,IAAI,CAAC,CAAC,MAAM,IAAA,kBAAS,GAAE,CAAC,EACxB,CAAC;QACG,iDAAiD;QACjD,OAAO,CAAC,GAAG,CAAC,2GAA2G,CAAC,CAAC;IAC7H,CAAC;IAED,MAAM,4BAA4B,GAC9B,MAAM,CAAC,gBAAgB,KAAK,aAAa,CAAC,gBAAgB;QACtD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAE,CAAC;IAEb,IAAI,CAAC,CAAC,MAAM,IAAA,kBAAS,GAAE,CAAC,EACxB,CAAC;QACG,iDAAiD;QACjD,OAAO,CAAC,GAAG,CAAC,2GAA2G,CAAC,CAAC;IAC7H,CAAC;IAED,uCAAuC;IACvC,OAAO,CAAC,GAAG,CAAC,kCAAmC,4BAA6B,SAAU,MAAM,CAAC,gBAAiB,KAAK,CAAC,CAAC;IAErH,IACA,CAAC;QACG,MAAM,IAAA,8CAAwB,GAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,oDAAqD,MAAM,CAAC,UAAW,GAAG,CAAC,CAAC;QACxF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,MACA,CAAC;QACG,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,4EAA4E,CAAC,CAAC;QACnG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC"}
@@ -1,25 +0,0 @@
1
- export type ScopedTypeDefinition<PackageKey extends string, KeyType extends string> = `export type ${KeyType}<${PackageKey}${string}> = ${KeyType}Imported<${PackageKey}${string}>;`;
2
- export type Channels = {
3
- Any: string;
4
- Response: string;
5
- NoResponse: string;
6
- Request: string;
7
- NoRequest: string;
8
- Error: string;
9
- NoError: string;
10
- ErrorPayload: string;
11
- ErrorMessageOnly: string;
12
- Handler: Record<string, string>;
13
- Listener: Record<string, string>;
14
- };
15
- export type ScopedExport = "Channel" | "FilterByOwner" | "Handle" | "HandleOnce" | "InvokeEventDeferred" | "IpcMainReactive" | "Listener" | "MainListener" | "MainRegistrar" | "Off" | "OffEventDeferred" | "On" | "OnEventDeferred" | "Once" | "OnceEventDeferred" | "ReactiveEventHooks" | "ReactiveIpcMainFunctions" | "RemoveAllListeners" | "RemoveHandler" | "RendererListener" | "RendererRegistrar" | "Send" | "SendEventDeferred" | "UseInvokeEvent" | "UseInvokeEventDeferred" | "UseOffEventDeferred" | "UseOnEvent" | "UseOnEventDeferred" | "UseOnceEvent" | "UseOnceEventDeferred" | "UseSendEvent" | "UseSendEventDeferred";
16
- export type UnscopedExport = "EventDecl" | "EventDeclHandler" | "EventDeclListener" | "EventOwner" | "IpcEvent" | "MainOwner" | "PackageKeys" | "ReactiveEventContext" | "ReactiveEventProviderProps" | "Registrar" | "RendererOwner";
17
- export type Types = {
18
- Scoped: {
19
- [Key in ScopedExport]: string | symbol;
20
- };
21
- Unscoped: {
22
- [Key in UnscopedExport]: string | symbol;
23
- };
24
- };
25
- //# sourceMappingURL=GenerateScopedTypes.Types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenerateScopedTypes.Types.d.ts","sourceRoot":"","sources":["../Source/GenerateScopedTypes.Types.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,oBAAoB,CAC5B,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,MAAM,IAGtB,eAAgB,OAAQ,IAAK,UAAW,GAAI,MAAO,OAAQ,OAAQ,YAAa,UAAW,GAAI,MAAO,IAAI,CAAC;AAE/G,MAAM,MAAM,QAAQ,GAChB;IACI,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AAEN,MAAM,MAAM,YAAY,GAClB,SAAS,GACT,eAAe,GACf,QAAQ,GACR,YAAY,GACZ,qBAAqB,GACrB,iBAAiB,GACjB,UAAU,GACV,cAAc,GACd,eAAe,GACf,KAAK,GACL,kBAAkB,GAClB,IAAI,GACJ,iBAAiB,GACjB,MAAM,GACN,mBAAmB,GACnB,oBAAoB,GACpB,0BAA0B,GAC1B,oBAAoB,GACpB,eAAe,GACf,kBAAkB,GAClB,mBAAmB,GACnB,MAAM,GACN,mBAAmB,GACnB,gBAAgB,GAChB,wBAAwB,GACxB,qBAAqB,GACrB,YAAY,GACZ,oBAAoB,GACpB,cAAc,GACd,sBAAsB,GACtB,cAAc,GACd,sBAAsB,CAAC;AAE7B,MAAM,MAAM,cAAc,GACpB,WAAW,GACX,kBAAkB,GAClB,mBAAmB,GACnB,YAAY,GACZ,UAAU,GACV,WAAW,GACX,aAAa,GACb,sBAAsB,GACtB,4BAA4B,GAC5B,WAAW,GACX,eAAe,CAAC;AAEtB,MAAM,MAAM,KAAK,GACb;IACI,MAAM,EACN;SACM,GAAG,IAAI,YAAY,GAAI,MAAM,GAAG,MAAM;KAC3C,CAAC;IACF,QAAQ,EACR;SACM,GAAG,IAAI,cAAc,GAAI,MAAM,GAAG,MAAM;KAC7C,CAAC;CACL,CAAC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- /* File: GenerateScopedTypes.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=GenerateScopedTypes.Types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenerateScopedTypes.Types.js","sourceRoot":"","sources":["../Source/GenerateScopedTypes.Types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Generate a module in the developer's project (in the `process.cwd()`) containing
3
- * a type for every type exported by `electron-reactive-event`, such that the `PackageKey`
4
- * type parameter is set for the developer's project's `PackageKey`.
5
- *
6
- * @example `npm exec electron-reactive-event generate-types MyPackageKey`
7
- */
8
- export declare function GenerateScopedTypesInner(): Promise<void>;
9
- //# sourceMappingURL=GenerateScopedTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenerateScopedTypes.d.ts","sourceRoot":"","sources":["../Source/GenerateScopedTypes.ts"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAmS9D"}
@@ -1,228 +0,0 @@
1
- "use strict";
2
- /* File: GenerateScopedTypes.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.GenerateScopedTypesInner = GenerateScopedTypesInner;
9
- /* eslint-disable no-console */
10
- const Command_1 = require("./Command");
11
- const Config_1 = require("./Config");
12
- const promises_1 = require("node:fs/promises");
13
- /**
14
- * Generate a module in the developer's project (in the `process.cwd()`) containing
15
- * a type for every type exported by `electron-reactive-event`, such that the `PackageKey`
16
- * type parameter is set for the developer's project's `PackageKey`.
17
- *
18
- * @example `npm exec electron-reactive-event generate-types MyPackageKey`
19
- */
20
- async function GenerateScopedTypesInner() {
21
- const PackageKey = await (0, Command_1.Try)("Reading the PackageKey from the config file...", (Result) => `Found PackageKey ${Result} in the config file!`, async () => {
22
- const Config = await (0, Config_1.GetConfigSafe)();
23
- return Config.PackageKey;
24
- });
25
- if (PackageKey === undefined || process.argv.length < 3) {
26
- console.error("A PackageKey argument was not provided. The name of your project's PackageKey " +
27
- "should be provided as the last argument. For example,\n\n" +
28
- " npm exec electron-reactive-event generate-types MyPackageKey");
29
- process.exit(1);
30
- }
31
- // eslint-disable-next-line jsdoc/require-jsdoc
32
- function GetChannelTypeDefinition(Path, OwnerType = true) {
33
- const FullPath = Path.split(".");
34
- const Name = Path.includes(".")
35
- ? FullPath[FullPath.length - 1]
36
- : Path;
37
- return OwnerType
38
- // eslint-disable-next-line @stylistic/max-len
39
- ? `export type ${Name}<OwnerType extends EventOwnerImported> = ChannelImported.${Path}<PackageKey, OwnerType>;`
40
- : `export type ${Name} = ChannelImported.${Path}<PackageKey>;`;
41
- }
42
- const Channels = {
43
- Any: GetChannelTypeDefinition("Any"),
44
- Error: GetChannelTypeDefinition("Error", false),
45
- ErrorMessageOnly: GetChannelTypeDefinition("ErrorMessageOnly", false),
46
- ErrorPayload: GetChannelTypeDefinition("ErrorPayload", false),
47
- NoError: GetChannelTypeDefinition("NoError"),
48
- NoResponse: GetChannelTypeDefinition("NoResponse"),
49
- Response: GetChannelTypeDefinition("Response", false),
50
- NoRequest: GetChannelTypeDefinition("NoRequest"),
51
- Request: GetChannelTypeDefinition("Request"),
52
- Handler: {
53
- Any: GetChannelTypeDefinition("Handler.Any", false),
54
- Request: GetChannelTypeDefinition("Handler.Request", false),
55
- Response: GetChannelTypeDefinition("Handler.Response", false),
56
- NoRequest: GetChannelTypeDefinition("Handler.NoRequest", false),
57
- NoResponse: GetChannelTypeDefinition("Handler.NoResponse", false),
58
- Error: GetChannelTypeDefinition("Handler.Error", false),
59
- ErrorMessageOnly: GetChannelTypeDefinition("Handler.ErrorMessageOnly", false),
60
- ErrorPayload: GetChannelTypeDefinition("Handler.ErrorPayload", false),
61
- NoError: GetChannelTypeDefinition("Handler.NoError", false)
62
- },
63
- Listener: {
64
- Any: GetChannelTypeDefinition("Listener.Any"),
65
- NoRequest: GetChannelTypeDefinition("Listener.NoRequest"),
66
- Request: GetChannelTypeDefinition("Listener.Request")
67
- }
68
- };
69
- const ReexportedType = Symbol("ReexportedType");
70
- /* eslint-disable @stylistic/max-len */
71
- const Types = {
72
- Scoped: [
73
- "Channel<OwnerType extends EventOwner>",
74
- "FilterByOwner<OwnerType extends EventOwner>",
75
- "Handle",
76
- "HandleOnce",
77
- "InvokeEventDeferred",
78
- "IpcMainReactive",
79
- "Listener<OwnerType extends EventOwner, ChannelType extends Channel.Listener<PackageKey, OwnerType>, EventType extends IpcEvent | undefined>",
80
- "MainListener<ChannelType extends Channel.Listener<PackageKey, RendererOwner>>",
81
- "MainRegistrar",
82
- "Off",
83
- "OffEventDeferred",
84
- "On",
85
- "OnEventDeferred",
86
- "Once",
87
- "OnceEventDeferred",
88
- "ReactiveEventHooks",
89
- "ReactiveIpcMainFunctions",
90
- "RemoveAllListeners",
91
- "RemoveHandler",
92
- "RendererListener<ChannelType extends Channel.Listener<PackageKey, MainOwner>>",
93
- "RendererRegistrar",
94
- "Send",
95
- "SendEventDeferred",
96
- "UseInvokeEvent",
97
- "UseInvokeEventDeferred",
98
- "UseOffEventDeferred",
99
- "UseOnEvent",
100
- "UseOnEventDeferred",
101
- "UseOnceEvent",
102
- "UseOnceEventDeferred",
103
- "UseSendEvent",
104
- "UseSendEventDeferred"
105
- ],
106
- Unscoped: [
107
- "EventDecl<OwnerType extends EventOwner, RequestType, ResponseType, ErrorType>",
108
- "EventDeclHandler<RequestType, ResponseType, ErrorType>",
109
- "EventDeclListener<OwnerType extends EventOwner, RequestType>",
110
- "EventOwner",
111
- "IpcEvent",
112
- "MainOwner",
113
- "PackageKeys",
114
- "ReactiveEventContext",
115
- "ReactiveEventProviderProps",
116
- "RendererOwner"
117
- ]
118
- };
119
- /* eslint-enable @stylistic/max-len */
120
- const ScopedExportStatementsSimple = Types.Scoped
121
- .filter((Type) => !Type.includes("<"))
122
- .map((Type) => {
123
- return `export ${Type} = ${Type}Imported<PackageKey>;`;
124
- });
125
- const ScopedExportStatementsAdvanced = Types.Scoped
126
- .filter((Type) => Type.includes("<"))
127
- .map((Type) => {
128
- const TypeArgumentVector = (() => {
129
- if (!Type.includes("<")) {
130
- return undefined;
131
- }
132
- const Input = Type.slice(Type.indexOf("<") + 1, Type.indexOf(">"));
133
- const Matches = [];
134
- const Pattern = /(?:^|,)\s*([^,\s]+)/g;
135
- let Match;
136
- while ((Match = Pattern.exec(Input)) !== null) {
137
- Matches.push(Match[1]);
138
- }
139
- return Matches.join(", ");
140
- })();
141
- return `export ${Type} = ${Type}Imported<PackageKey, ${TypeArgumentVector}>;`;
142
- });
143
- // eslint-disable-next-line jsdoc/require-jsdoc
144
- function MakeImported(Name) {
145
- return `,\n ${Name} as ${Name}Imported`;
146
- }
147
- const ImportStatement = ("import type { \n" +
148
- Types.Scoped
149
- .map((Type) => {
150
- const Name = Type.includes("<")
151
- ? Type.slice(0, Type.indexOf("<"))
152
- : Type;
153
- return ` ${Name} as ${Name}Imported`;
154
- })
155
- .join(",\n") +
156
- "\n} from \"electron-reactive-event\";\n");
157
- const ImportedNamespaces = [
158
- "Channel",
159
- "Handler",
160
- "Invoke",
161
- "Listener"
162
- ];
163
- const NamespacesImportStatement = ("import { \n" +
164
- ImportedNamespaces
165
- .map((Namespace) => {
166
- return ` ${Namespace} as ${Namespace}Imported`;
167
- })
168
- .join(",\n") +
169
- "\n} from \"electron-reactive-event\";\n");
170
- const ImportErrorFunction = "import { ReactiveEventError as ReactiveEventErrorImported } from " +
171
- "\"electron-reactive-event/scoped\";";
172
- const PackageKeyDefinition = `export type PackageKey = "${PackageKey}";\n`;
173
- // eslint-disable-next-line @stylistic/max-len
174
- // const PackageKeyDeclareModule: string = `declare module "electron-reactive-event/registrar"\n{\n interface Registrar\n {\n ${ PackageKey }: { };\n }\n};\n`;
175
- // type EntryType = [ string, string | symbol ];
176
- // const ExportStatements: string =
177
- // Object
178
- // .entries(Types)
179
- // .filter(([ _Key, Value ]: EntryType) => typeof Value === "string")
180
- // .map(([ _Key, Value ]: EntryType) => Value)
181
- // .join("\n") + "\n";
182
- // const ReexportStatements: string = "export type {\n" +
183
- // Object
184
- // .entries(Types)
185
- // .filter(([ _Key, Value ]: [ string, string ]) => typeof Value !== "string")
186
- // .map(([ Key ]: [ string, string | symbol ]) => ` ${ Key }`)
187
- // .join(",\n") +
188
- // "\n} from \"electron-reactive-event/scoped\";\n";
189
- const ExportStatements = "";
190
- const ReexportStatements = "export type {\n";
191
- const BeginChannelLine = "export namespace Channel\n{\n";
192
- const EndChannelLine = "};\n";
193
- const ChannelLines = Object.entries(Channels).map(([Key, Property]) => {
194
- if (typeof Property === "string") {
195
- return ` ${Property}\n`;
196
- }
197
- else {
198
- return ` export namespace ${Key}\n {\n` +
199
- Object.values(Property).map((SubProperty) => {
200
- return ` ${SubProperty}`;
201
- }).join("\n") +
202
- "\n };\n";
203
- }
204
- });
205
- const Channel = BeginChannelLine + ChannelLines.join("\n") + EndChannelLine;
206
- const Header = (0, Command_1.GetHeader)("Reactive.Types.Generated.ts", "generate-scoped-types");
207
- try {
208
- const ScopedModulePath = await (async () => {
209
- const Config = await (0, Config_1.GetConfigSafe)();
210
- return Config.ScopedModulePath;
211
- })();
212
- await (0, promises_1.writeFile)(ScopedModulePath, [
213
- Header,
214
- ImportStatement,
215
- NamespacesImportStatement,
216
- ReexportStatements,
217
- PackageKeyDefinition,
218
- Channel,
219
- ExportStatements
220
- ].join("\n"));
221
- process.exit(0);
222
- }
223
- catch {
224
- console.error("Could not write file.");
225
- process.exit(1);
226
- }
227
- }
228
- //# sourceMappingURL=GenerateScopedTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenerateScopedTypes.js","sourceRoot":"","sources":["../Source/GenerateScopedTypes.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAiBH,4DAmSC;AAlTD,+BAA+B;AAE/B,uCAA2C;AAG3C,qCAAyC;AACzC,+CAA6C;AAE7C;;;;;;GAMG;AACI,KAAK,UAAU,wBAAwB;IAE1C,MAAM,UAAU,GAAW,MAAM,IAAA,aAAG,EAChC,gDAAgD,EAChD,CAAC,MAAc,EAAE,EAAE,CAAC,oBAAqB,MAAO,sBAAsB,EACtE,KAAK,IAAqB,EAAE;QAExB,MAAM,MAAM,GAAc,MA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YACI,MAAM;YACN,eAAe;YACf,yBAAyB;YACzB,kBAAkB;YAClB,oBAAoB;YACpB,OAAO;YACP,gBAAgB;SACnB,CAAC,IAAI,CAAC,IAAI,CAAC,CACf,CAAC;QAEF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,MACA,CAAC;QACG,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC"}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=Setup.Command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Setup.Command.d.ts","sourceRoot":"","sources":["../Source/Setup.Command.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
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
@@ -1 +0,0 @@
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,2 +0,0 @@
1
- export declare function SetupCommand(): Promise<void>;
2
- //# sourceMappingURL=Setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Setup.d.ts","sourceRoot":"","sources":["../Source/Setup.ts"],"names":[],"mappings":"AAgFA,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAuKlD"}
@@ -1,184 +0,0 @@
1
- "use strict";
2
- /* File: Setup.ts
3
- * Author: Gage Sorrell <gage@sorrell.sh>
4
- * Copyright: (c) 2026 Gage Sorrell
5
- * License: MIT
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.SetupCommand = SetupCommand;
12
- /* eslint-disable jsdoc/require-jsdoc, no-console */
13
- const Config_1 = require("./Config");
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");
18
- const utilities_1 = require("@sorrell/utilities");
19
- const prompt_adapter_enquirer_1 = require("@listr2/prompt-adapter-enquirer");
20
- const Command_1 = require("./Command");
21
- const fs_1 = require("fs");
22
- const path_1 = require("path");
23
- async function GetDefaultWrittenConfig() {
24
- const SchemaLine = "$schema: \"https://electron-reactive-event.sorrell.sh/CliConfig.Schema.json\"";
25
- const Lines = JSON.stringify(await (0, Config_1.GetDefaultConfig)(), null, 4)
26
- .split("\n")
27
- .splice(1, 0, SchemaLine, "\n");
28
- const InsertionIndex = Lines.findIndex((Line) => {
29
- return Line.includes("AugmentationModulePath: string;");
30
- });
31
- /* eslint-disable-next-line @stylistic/max-len */
32
- const CommentedContent = `// // \`electron-reactive-event-cli\` can create modules for you that export the reactive
33
- // // IPC functions, scoped to your \`PackageKey\`.
34
- // "IpcModulePath": {
35
- // // The path of the module that calls \`getReactiveIpcMain\`, and exports its output.
36
- // "Main": "",
37
-
38
- // // The path of the module that calls \`getReactiveIpcHooks\`, and exports its output.
39
- // "Renderer": ""
40
- // };
41
- `.split("\n");
42
- return Lines.toSpliced(InsertionIndex, 0, ...CommentedContent, "\n").join("\n");
43
- }
44
- // async function Inner(): Promise<string>
45
- // {
46
- // const Root: string = await GetPackageRootDirectory();
47
- // const ConfigPath: string = resolve(Root, ConfigFileName);
48
- // if (!existsSync(ConfigPath))
49
- // {
50
- // try
51
- // {
52
- // console.log("Going to write file...");
53
- // await writeFile(
54
- // ConfigPath,
55
- // await GetDefaultWrittenConfig(),
56
- // { encoding: "utf-8" }
57
- // );
58
- // console.log("Wrote file!", ConfigPath);
59
- // return ConfigPath;
60
- // }
61
- // catch (Error: unknown)
62
- // {
63
- // throw new TryError(undefined, Error);
64
- // }
65
- // }
66
- // else
67
- // {
68
- // throw new TryError(`A file was already found at ${ ConfigPath }. Exiting!`);
69
- // }
70
- // }
71
- async function SetupCommand() {
72
- (0, Command_1.SetCommand)("setup");
73
- await (0, Shared_1.RunListr)([
74
- {
75
- task: async (Context, Task) => {
76
- try {
77
- Context.RootDirectory = await (0, utilities_1.GetPackageRootDirectory)();
78
- }
79
- catch {
80
- Task.title = "Failed to find root directory of a NodeJS project.";
81
- /* eslint-disable-next-line @stylistic/max-len */
82
- throw new Shared_1.SimpleError("It appears that the command was not run from within a NodeJS project. Exiting.");
83
- }
84
- Task.title = "Found root directory of current NodeJS project.";
85
- },
86
- title: "Finding root directory of current NodeJS project."
87
- },
88
- {
89
- task: async (Context, Task) => {
90
- if ((0, fs_1.existsSync)((0, path_1.resolve)(Context.RootDirectory, Config_1.DefaultConfigFileName))) {
91
- Task.title = "Found existing config file.";
92
- Context.ConfigAlreadyExists = true;
93
- }
94
- Task.title = "Did not find an existing config file.";
95
- },
96
- title: "Checking for existing config file."
97
- },
98
- {
99
- skip: (Context) => Context.ConfigAlreadyExists,
100
- task: async (Context, Task) => {
101
- const ConfigPath = (0, path_1.resolve)(Context.RootDirectory, Config_1.DefaultConfigFileName);
102
- try {
103
- await (0, promises_1.writeFile)(ConfigPath, await GetDefaultWrittenConfig(), { encoding: "utf-8" });
104
- Task.title = "Wrote default config file.";
105
- }
106
- catch {
107
- Task.title = "Failed to write default config file.";
108
- throw new Shared_1.SimpleError("Unable to write default config file. Exiting.");
109
- }
110
- },
111
- title: "Writing default config file."
112
- },
113
- {
114
- task: async (Context, Task) => {
115
- Context.WriteNpmScript = await Task.prompt(prompt_adapter_enquirer_1.ListrEnquirerPromptAdapter).run({
116
- initial: true,
117
- /* eslint-disable-next-line @stylistic/max-len */
118
- 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?`,
119
- type: "Toggle"
120
- });
121
- /* eslint-disable-next-line @stylistic/max-len */
122
- 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.`;
123
- },
124
- /* eslint-disable-next-line @stylistic/max-len */
125
- title: `Determining whether the ${(0, cli_utilities_1.Code)("npm")} script "${(0, cli_utilities_1.Code)("update-reactive")}" should be added.`
126
- },
127
- {
128
- skip: (Context) => !Context.WriteNpmScript,
129
- task: async (_Context, Task) => {
130
- return Task.newListr((ParentTask) => [
131
- {
132
- task: async (Context, Task) => {
133
- const PackageJsonPath = (0, path_1.resolve)(Context.RootDirectory, "package.json");
134
- const PackageJsonContents = await (0, promises_1.readFile)(PackageJsonPath, { encoding: "utf-8" });
135
- Context.PackageJson = JSON.parse(PackageJsonContents);
136
- Task.title = `Read the project's ${(0, cli_utilities_1.Code)("package.json")}.`;
137
- },
138
- title: `Reading the project's ${(0, cli_utilities_1.Code)("package.json")}.`
139
- },
140
- {
141
- task: async (Context, Task) => {
142
- if ("scripts" in Context.PackageJson &&
143
- typeof Context.PackageJson.scripts === "object" &&
144
- Context.PackageJson.scripts !== null) {
145
- if ("update-reactive" in Context.PackageJson.scripts) {
146
- Context.AlreadyHasUpdateReactiveScript = true;
147
- Task.title = `Found existing "${(0, cli_utilities_1.Code)("update-reactive")}" script.`;
148
- return;
149
- }
150
- }
151
- Context.AlreadyHasUpdateReactiveScript = false;
152
- Task.title = `No existing "${(0, cli_utilities_1.Code)("update-reactive")}" script found.`;
153
- },
154
- title: `Checking for existing "${(0, cli_utilities_1.Code)("update-reactive")}" script.`
155
- },
156
- {
157
- skip: (Context) => Context.AlreadyHasUpdateReactiveScript,
158
- task: async (Context, Task) => {
159
- const ScriptsUndefined = (!("scripts" in Context.PackageJson) ||
160
- Context.PackageJson.scripts === undefined);
161
- if (ScriptsUndefined) {
162
- Context.PackageJson.scripts = {};
163
- }
164
- Context.PackageJson.scripts["update-reactive"] =
165
- /* eslint-disable-next-line @stylistic/max-len */
166
- "electron-reactive-event-cli declare-events && electron-reactive-event-cli generate";
167
- const OutPackageJson = JSON.stringify(Context.PackageJson, null, 2);
168
- await (0, promises_1.writeFile)((0, path_1.resolve)(Context.RootDirectory, "package.json"), OutPackageJson, { encoding: "utf-8" });
169
- Task.title = `Saved changes to ${(0, cli_utilities_1.Code)("package.json")}.`;
170
- /* eslint-disable-next-line @stylistic/max-len */
171
- ParentTask.title = `Added "${(0, cli_utilities_1.Code)("update-reactive")}" script to ${(0, cli_utilities_1.Code)("package.json")}.`;
172
- },
173
- title: `Saving changes to ${(0, cli_utilities_1.Code)("package.json")}.`
174
- }
175
- ], { concurrent: false });
176
- },
177
- title: `Adding "${(0, cli_utilities_1.Code)("update-reactive")}" script to ${(0, cli_utilities_1.Code)("package.json")}.`
178
- }
179
- ], "Failed to finish setup.", {
180
- concurrent: false
181
- });
182
- console.log(`${chalk_1.default.green("✓")} Completed ${(0, cli_utilities_1.Code)("setup")} successfully!`);
183
- }
184
- //# sourceMappingURL=Setup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Setup.js","sourceRoot":"","sources":["../Source/Setup.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AA4EH,oCAuKC;AAjPD,oDAAoD;AAEpD,qCAAmE;AACnE,qCAAiD;AACjD,0CAAkD;AAClD,kDAA0B;AAC1B,0DAA8C;AAC9C,kDAA6D;AAE7D,6EAA6E;AAC7E,uCAAuC;AAEvC,2BAAgC;AAChC,+BAA+B;AAE/B,KAAK,UAAU,uBAAuB;IAElC,MAAM,UAAU,GACZ,+E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, 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
- /** The name of the CLI package. */
5
- export type PackageNameType = "electron-reactive-event-cli";
6
- //# sourceMappingURL=Shared.Types.d.ts.map
@@ -1 +0,0 @@
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;AAEN,mCAAmC;AACnC,MAAM,MAAM,eAAe,GAAG,6BAA6B,CAAC"}
@@ -1,8 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"Shared.Types.js","sourceRoot":"","sources":["../Source/Shared.Types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -1,24 +0,0 @@
1
- import { type DefaultRenderer, type ListrBaseClassOptions, type ListrTaskObject } from "listr2";
2
- import type { ListrConstructorTask, PackageNameType } from "./Shared.Types";
3
- /** {@inheritdoc PackageNameType} */
4
- export declare const PackageName: PackageNameType;
5
- /** A string-only {@link Error} used by {@link Listr} to show nicely-formatted errors. */
6
- export declare class SimpleError extends Error {
7
- constructor(Message: string);
8
- TheMessage: string;
9
- }
10
- /**
11
- * A wrapper for `new Listr` that handles errors nicely.
12
- *
13
- * @typeParam ContextType - The type of the `listr2` context used by the {@link Task}.
14
- *
15
- * @param Task - The task(s) to run.
16
- * @param GenericErrorMessage - The error message that is shown if the {@link Task | task(s)} throw(s)
17
- * something other than a {@link SimpleError}.
18
- * @param Options - *(Optional)* The {@link ListrBaseClassOptions} used to customize the
19
- * {@link Task | task(s)}.
20
- * @param ParentTask - *(Optional)* The {@link ListrTaskObject | parent task} of which the
21
- * {@link Task | task(s)} are (a) descendant(s).
22
- */
23
- 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>;
24
- //# sourceMappingURL=Shared.d.ts.map
@@ -1 +0,0 @@
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,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAI5E,oCAAoC;AACpC,eAAO,MAAM,WAAW,EAAE,eAAwD,CAAC;AAInF,yFAAyF;AACzF,qBAAa,WAAY,SAAQ,KAAK;gBAEf,OAAO,EAAE,MAAM;IAM3B,UAAU,EAAE,MAAM,CAAC;CAC7B;AA8BD;;;;;;;;;;;;GAYG;AACH,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"}