create-electro 1.0.7 → 1.0.9

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,6 +13,11 @@ type _InvokeMethod<T, K extends PropertyKey> = K extends keyof _Instance<T>
13
13
  ? (...args: A) => Promise<Awaited<V>>
14
14
  : never
15
15
  : never;
16
+ type _SignalId = Extract<keyof import("@electrojs/runtime").ModuleSignalPayloadMap, string>;
17
+ type _VoidSignalId = {
18
+ [TKey in _SignalId]: import("@electrojs/runtime").ModuleSignalPayloadMap[TKey] extends void ? TKey : never;
19
+ }[_SignalId];
20
+ type _NonVoidSignalId = Exclude<_SignalId, _VoidSignalId>;
16
21
 
17
22
  declare module "@electrojs/runtime" {
18
23
  interface ModuleMethodMap {
@@ -32,6 +37,13 @@ declare module "@electrojs/runtime" {
32
37
 
33
38
  interface ModuleSignalPayloadMap {}
34
39
 
40
+ interface SignalBus {
41
+ publish<TSignalId extends _VoidSignalId>(signalId: TSignalId): void;
42
+ publish<TSignalId extends _NonVoidSignalId>(signalId: TSignalId, payload: ModuleSignalPayloadMap[TSignalId]): void;
43
+ subscribe<TSignalId extends _SignalId>(signalId: TSignalId, handler: SignalListener<ModuleSignalPayloadMap[TSignalId]>): () => void;
44
+ subscribe<TSignalId extends _SignalId>(signalId: TSignalId, handler: ContextualSignalHandler<ModuleSignalPayloadMap[TSignalId]>): () => void;
45
+ }
46
+
35
47
  interface ModuleJobRegistry {
36
48
  app: never;
37
49
  notes: never;
@@ -20,6 +20,8 @@ app.on("before-quit", () => {
20
20
  void kernel.shutdown();
21
21
  });
22
22
 
23
- void app.whenReady().then(async () => {
23
+ void (async () => {
24
+ await kernel.initialize();
25
+ await app.whenReady();
24
26
  await kernel.start();
25
- });
27
+ })();
@@ -29,7 +29,7 @@ export class AppModule {
29
29
  });
30
30
  }
31
31
 
32
- async onReady() {
32
+ async onStart() {
33
33
  await this.window.open();
34
34
  }
35
35
  }
@@ -35,7 +35,7 @@ const features = [
35
35
  {
36
36
  icon: "clock-01",
37
37
  title: "Lifecycle-Aware",
38
- detail: "onInit, onReady, onShutdown, onDispose — predictable resource management across your entire app.",
38
+ detail: "onInit, onStart, onReady, onShutdown, onDispose — predictable resource management across your entire app.",
39
39
  },
40
40
  {
41
41
  icon: "computer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-electro",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Scaffold a new ElectroJS Electron app with the recommended monorepo layout",
5
5
  "keywords": [
6
6
  "create",