@chromahq/core 0.1.3 → 0.1.4

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/dist/index.cjs.js CHANGED
@@ -1204,6 +1204,7 @@ class ApplicationBootstrap {
1204
1204
  await this.registerMessages();
1205
1205
  await this.registerJobs();
1206
1206
  await this.bootMessages();
1207
+ await this.bootServices();
1207
1208
  this.logger.success("\u{1F389} Chroma application initialization complete!");
1208
1209
  bootstrap$1({ container, keepAlive: keepPortAlive, portName });
1209
1210
  } catch (error) {
@@ -1211,6 +1212,23 @@ class ApplicationBootstrap {
1211
1212
  throw error;
1212
1213
  }
1213
1214
  }
1215
+ /**
1216
+ * Boot all registered services by calling their onBoot method if present
1217
+ */
1218
+ async bootServices() {
1219
+ this.logger.info("\u{1F680} Booting services...");
1220
+ for (const [serviceName, ServiceClass] of this.serviceRegistry.entries()) {
1221
+ try {
1222
+ const instance = container.get(ServiceClass);
1223
+ if (typeof instance.onBoot === "function") {
1224
+ await instance.onBoot();
1225
+ this.logger.success(`Booted service: ${serviceName}`);
1226
+ }
1227
+ } catch (error) {
1228
+ this.logger.error(`Failed to boot service ${serviceName}:`, error);
1229
+ }
1230
+ }
1231
+ }
1214
1232
  /**
1215
1233
  * Discover all services in the application directory
1216
1234
  */
package/dist/index.es.js CHANGED
@@ -1202,6 +1202,7 @@ class ApplicationBootstrap {
1202
1202
  await this.registerMessages();
1203
1203
  await this.registerJobs();
1204
1204
  await this.bootMessages();
1205
+ await this.bootServices();
1205
1206
  this.logger.success("\u{1F389} Chroma application initialization complete!");
1206
1207
  bootstrap$1({ container, keepAlive: keepPortAlive, portName });
1207
1208
  } catch (error) {
@@ -1209,6 +1210,23 @@ class ApplicationBootstrap {
1209
1210
  throw error;
1210
1211
  }
1211
1212
  }
1213
+ /**
1214
+ * Boot all registered services by calling their onBoot method if present
1215
+ */
1216
+ async bootServices() {
1217
+ this.logger.info("\u{1F680} Booting services...");
1218
+ for (const [serviceName, ServiceClass] of this.serviceRegistry.entries()) {
1219
+ try {
1220
+ const instance = container.get(ServiceClass);
1221
+ if (typeof instance.onBoot === "function") {
1222
+ await instance.onBoot();
1223
+ this.logger.success(`Booted service: ${serviceName}`);
1224
+ }
1225
+ } catch (error) {
1226
+ this.logger.error(`Failed to boot service ${serviceName}:`, error);
1227
+ }
1228
+ }
1229
+ }
1212
1230
  /**
1213
1231
  * Discover all services in the application directory
1214
1232
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chromahq/core",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Core library for building Chrome extensions with Chroma framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",