diff --git a/packages/navigation/package.json b/packages/navigation/package.json index 3a24e74..e6ab3ca 100644 --- a/packages/navigation/package.json +++ b/packages/navigation/package.json @@ -19,6 +19,7 @@ }, "dependencies": { "@repo/core-events": "workspace:*", + "@repo/core-realtime": "workspace:*", "@repo/core-shared": "workspace:*", "@trpc/server": "^11.0.0", "inversify": "^6.2.0", diff --git a/packages/navigation/src/di/bind-dev-seed.test.ts b/packages/navigation/src/di/bind-dev-seed.test.ts index 90f1b87..cf395c9 100644 --- a/packages/navigation/src/di/bind-dev-seed.test.ts +++ b/packages/navigation/src/di/bind-dev-seed.test.ts @@ -1,7 +1,8 @@ import "reflect-metadata"; import { afterEach, beforeEach, describe, expect, it } from "vitest"; import { NoopTracer, NoopLogger } from "@repo/core-shared/instrumentation"; -import { RecordingEventBus, RecordingJobQueue } from "@repo/core-testing/instrumentation"; +import { RecordingEventBus, RecordingJobQueue, RecordingRealtimeBroadcaster } from "@repo/core-testing/instrumentation"; +import { RealtimeHandlerRegistry } from "@repo/core-realtime"; import { bindDevSeedNavigation } from "@/di/bind-dev-seed"; import { navigationContainer } from "@/di/container"; import { NAVIGATION_SYMBOLS } from "@/di/symbols"; @@ -32,7 +33,7 @@ describe("bindDevSeedNavigation", () => { }); it("populates the header repository with the dev header", async () => { - await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue()); + await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue(), new RecordingRealtimeBroadcaster(), new RealtimeHandlerRegistry()); const repo = navigationContainer.get( NAVIGATION_SYMBOLS.IHeaderRepository, @@ -43,7 +44,7 @@ describe("bindDevSeedNavigation", () => { }); it("seeds a header with a non-empty items array", async () => { - await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue()); + await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue(), new RecordingRealtimeBroadcaster(), new RealtimeHandlerRegistry()); const repo = navigationContainer.get( NAVIGATION_SYMBOLS.IHeaderRepository, @@ -57,13 +58,13 @@ describe("bindDevSeedNavigation", () => { }); it("is idempotent — calling twice rebuilds a fresh populated repo", async () => { - await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue()); + await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue(), new RecordingRealtimeBroadcaster(), new RealtimeHandlerRegistry()); const before = navigationContainer.get( NAVIGATION_SYMBOLS.IHeaderRepository, ); const beforeHeader = await before.getHeader(); - await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue()); + await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue(), new RecordingRealtimeBroadcaster(), new RealtimeHandlerRegistry()); const after = navigationContainer.get( NAVIGATION_SYMBOLS.IHeaderRepository, ); diff --git a/packages/navigation/src/di/bind-dev-seed.ts b/packages/navigation/src/di/bind-dev-seed.ts index 1ddb311..711054d 100644 --- a/packages/navigation/src/di/bind-dev-seed.ts +++ b/packages/navigation/src/di/bind-dev-seed.ts @@ -6,6 +6,7 @@ import { type ILogger, } from "@repo/core-shared/instrumentation"; import type { IEventBus } from "@repo/core-events"; +import type { IRealtimeBroadcaster, IRealtimeHandlerRegistry } from "@repo/core-realtime"; import type { IJobQueue } from "@repo/core-shared/jobs"; import { navigationContainer } from "./container.js"; import { NAVIGATION_SYMBOLS } from "./symbols.js"; @@ -31,6 +32,8 @@ export async function bindDevSeedNavigation( logger: ILogger, bus: IEventBus, queue: IJobQueue, + realtime: IRealtimeBroadcaster, + realtimeRegistry: IRealtimeHandlerRegistry, ): Promise { // Bind shared instrumentation into feature container if (navigationContainer.isBound(INSTRUMENTATION_SYMBOLS.TRACER)) { @@ -88,6 +91,8 @@ export async function bindDevSeedNavigation( // output at the / anchors below. void bus; void queue; + void realtime; + void realtimeRegistry; // // // diff --git a/packages/navigation/src/di/bind-production.ts b/packages/navigation/src/di/bind-production.ts index 9b30206..b3d2bf4 100644 --- a/packages/navigation/src/di/bind-production.ts +++ b/packages/navigation/src/di/bind-production.ts @@ -7,6 +7,7 @@ import { type ILogger, } from "@repo/core-shared/instrumentation"; import type { IEventBus } from "@repo/core-events"; +import type { IRealtimeBroadcaster, IRealtimeHandlerRegistry } from "@repo/core-realtime"; import type { IJobQueue } from "@repo/core-shared/jobs"; import { navigationContainer } from "./container"; import { NAVIGATION_SYMBOLS } from "./symbols"; @@ -20,6 +21,8 @@ export function bindProductionNavigation( logger: ILogger, bus: IEventBus, queue: IJobQueue, + realtime: IRealtimeBroadcaster, + realtimeRegistry: IRealtimeHandlerRegistry, ): void { // Bind shared instrumentation into feature container if (navigationContainer.isBound(INSTRUMENTATION_SYMBOLS.TRACER)) { @@ -79,6 +82,8 @@ export function bindProductionNavigation( // output at the / anchors below. void bus; void queue; + void realtime; + void realtimeRegistry; // // //