feat(navigation): bind binders accept (bus, queue) params
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
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 { bindDevSeedNavigation } from "@/di/bind-dev-seed";
|
||||
import { navigationContainer } from "@/di/container";
|
||||
import { NAVIGATION_SYMBOLS } from "@/di/symbols";
|
||||
@@ -31,7 +32,7 @@ describe("bindDevSeedNavigation", () => {
|
||||
});
|
||||
|
||||
it("populates the header repository with the dev header", async () => {
|
||||
await bindDevSeedNavigation(noop.tracer, noop.logger);
|
||||
await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue());
|
||||
|
||||
const repo = navigationContainer.get<IHeaderRepository>(
|
||||
NAVIGATION_SYMBOLS.IHeaderRepository,
|
||||
@@ -42,7 +43,7 @@ describe("bindDevSeedNavigation", () => {
|
||||
});
|
||||
|
||||
it("seeds a header with a non-empty items array", async () => {
|
||||
await bindDevSeedNavigation(noop.tracer, noop.logger);
|
||||
await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue());
|
||||
|
||||
const repo = navigationContainer.get<IHeaderRepository>(
|
||||
NAVIGATION_SYMBOLS.IHeaderRepository,
|
||||
@@ -56,13 +57,13 @@ describe("bindDevSeedNavigation", () => {
|
||||
});
|
||||
|
||||
it("is idempotent — calling twice rebuilds a fresh populated repo", async () => {
|
||||
await bindDevSeedNavigation(noop.tracer, noop.logger);
|
||||
await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue());
|
||||
const before = navigationContainer.get<IHeaderRepository>(
|
||||
NAVIGATION_SYMBOLS.IHeaderRepository,
|
||||
);
|
||||
const beforeHeader = await before.getHeader();
|
||||
|
||||
await bindDevSeedNavigation(noop.tracer, noop.logger);
|
||||
await bindDevSeedNavigation(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue());
|
||||
const after = navigationContainer.get<IHeaderRepository>(
|
||||
NAVIGATION_SYMBOLS.IHeaderRepository,
|
||||
);
|
||||
|
||||
@@ -5,6 +5,8 @@ import {
|
||||
type ITracer,
|
||||
type ILogger,
|
||||
} from "@repo/core-shared/instrumentation";
|
||||
import type { IEventBus } from "@repo/core-events";
|
||||
import type { IJobQueue } from "@repo/core-shared/jobs";
|
||||
import { navigationContainer } from "./container.js";
|
||||
import { NAVIGATION_SYMBOLS } from "./symbols.js";
|
||||
import { MockHeaderRepository } from "../infrastructure/repositories/header.repository.mock.js";
|
||||
@@ -24,7 +26,12 @@ import type { IHeaderRepository } from "../application/repositories/header.repos
|
||||
* Idempotent: safe to call multiple times; each call rebuilds a fresh
|
||||
* populated repo and rebinds the symbol.
|
||||
*/
|
||||
export async function bindDevSeedNavigation(tracer: ITracer, logger: ILogger): Promise<void> {
|
||||
export async function bindDevSeedNavigation(
|
||||
tracer: ITracer,
|
||||
logger: ILogger,
|
||||
bus: IEventBus,
|
||||
queue: IJobQueue,
|
||||
): Promise<void> {
|
||||
// Bind shared instrumentation into feature container
|
||||
if (navigationContainer.isBound(INSTRUMENTATION_SYMBOLS.TRACER)) {
|
||||
navigationContainer.unbind(INSTRUMENTATION_SYMBOLS.TRACER);
|
||||
@@ -77,6 +84,10 @@ export async function bindDevSeedNavigation(tracer: ITracer, logger: ILogger): P
|
||||
),
|
||||
),
|
||||
);
|
||||
// bus + queue are accept-and-forward in Phase 6; consumed by Phase 7 generator
|
||||
// output at the <gen:event-handlers> / <gen:jobs> anchors below.
|
||||
void bus;
|
||||
void queue;
|
||||
// <gen:event-handlers>
|
||||
// <gen:jobs>
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import {
|
||||
type ITracer,
|
||||
type ILogger,
|
||||
} from "@repo/core-shared/instrumentation";
|
||||
import type { IEventBus } from "@repo/core-events";
|
||||
import type { IJobQueue } from "@repo/core-shared/jobs";
|
||||
import { navigationContainer } from "./container";
|
||||
import { NAVIGATION_SYMBOLS } from "./symbols";
|
||||
import { HeaderRepository } from "../infrastructure/repositories/header.repository";
|
||||
@@ -16,6 +18,8 @@ export function bindProductionNavigation(
|
||||
config: SanitizedConfig,
|
||||
tracer: ITracer,
|
||||
logger: ILogger,
|
||||
bus: IEventBus,
|
||||
queue: IJobQueue,
|
||||
): void {
|
||||
// Bind shared instrumentation into feature container
|
||||
if (navigationContainer.isBound(INSTRUMENTATION_SYMBOLS.TRACER)) {
|
||||
@@ -71,6 +75,10 @@ export function bindProductionNavigation(
|
||||
),
|
||||
),
|
||||
);
|
||||
// bus + queue are accept-and-forward in Phase 6; consumed by Phase 7 generator
|
||||
// output at the <gen:event-handlers> / <gen:jobs> anchors below.
|
||||
void bus;
|
||||
void queue;
|
||||
// <gen:event-handlers>
|
||||
// <gen:jobs>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user