Module Metadata Seeder Events
Listen to module metadata seeder lifecycle events from a consuming SolidX project.
Module Metadata Seeder Events
SolidX core emits two lifecycle events from ModuleMetadataSeederService:
module-metadata-seeder.startedmodule-metadata-seeder.finished
This lets a consuming project attach project-specific behavior around metadata seeding without modifying core seeding logic.
Typical uses:
- log seed lifecycle to an external system
- trigger cache warmup after seeding completes
- notify internal tooling that a seed run started or finished
- capture timing and failure details for CI or operational dashboards
Event Payload
Both events are emitted as EventDetails<ModuleMetadataSeederEventPayload>.
The payload includes:
seedRunId- stable id shared by the started and finished eventsoptions- normalized seed options used for the runstartedAt- ISO timestamp when the seed run beganfinishedAt- ISO timestamp when the run ended (finishedevent only)durationMs- total runtime in milliseconds (finishedevent only)success-trueorfalseon thefinishedeventseededModuleNames- modules actually processed during the runcurrentStep- last active seed step when the event was emittederrorMessage- failure message when the run ends unsuccessfully
options currently contains:
modulesToSeedpruneMetadataseedGlobalMetadata
Consuming From Your App
Import EventEmitterModule.forRoot() once in your application's root module, then register any listeners you need.
Create a listener:
import { Injectable, Logger } from '@nestjs/common';
import { OnEvent } from '@nestjs/event-emitter';
import {
EventDetails,
EventType,
ModuleMetadataSeederEventPayload,
} from '@solidxai/core';
@Injectable()
export class ModuleMetadataSeederListener {
private readonly logger = new Logger(ModuleMetadataSeederListener.name);
@OnEvent(EventType.MODULE_METADATA_SEEDER_STARTED)
handleStarted(event: EventDetails<ModuleMetadataSeederEventPayload>) {
this.logger.log(
`Seed started: runId=${event.payload.seedRunId}, modules=${event.payload.options.modulesToSeed?.join(',') ?? 'ALL'}`
);
}
@OnEvent(EventType.MODULE_METADATA_SEEDER_FINISHED)
handleFinished(event: EventDetails<ModuleMetadataSeederEventPayload>) {
this.logger.log(
`Seed finished: runId=${event.payload.seedRunId}, success=${event.payload.success}, durationMs=${event.payload.durationMs}`
);
}
}Register the listener in the consuming module:
import { ModuleMetadataSeederListener } from './listeners/module-metadata-seeder.listener';
@Module({
providers: [
AppService,
ModuleMetadataSeederListener,
],
})
export class AppModule {}Notes
- Import
EventEmitterModule.forRoot()once in the consuming app's root module. - Listener registration is optional. If no listener is registered, seeding behavior is unchanged.
- The
finishedevent is emitted for both successful and failed runs. Checkpayload.success. - The payload exposes normalized seed options, which is a better contract than raw CLI argv because the seeder can also be invoked from code, not only from
solidctl. - These events are meant for integration hooks and telemetry, not for replacing core seeding behavior.

