feat(features): add bind-dev-seed binders for auth/marketing-pages/navigation/media
Mirrors the canonical blog pattern landed earlier on this branch. Per feature: - src/__seeds__/dev.ts — lazy buildDev<Entities>() function using the feature's existing factory for sensible defaults - src/di/bind-dev-seed.ts — bindDevSeed<Feature>() async function that rebinds the repo symbol(s) to a populated MockXRepository via .toConstantValue - src/di/bind-dev-seed.test.ts — 3+ tests per feature (populates, reachable by id/slug, idempotent) - package.json — adds ./di/bind-dev-seed subpath export Tests + use cases continue to construct mocks directly; the seed never runs from a *.test.ts path. App boot wiring (USE_DEV_SEED env branch) follows in a separate commit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
26
packages/navigation/src/__seeds__/dev.ts
Normal file
26
packages/navigation/src/__seeds__/dev.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { headerFactory } from "../__factories__/header.factory.js";
|
||||
import { navItemFactory } from "../__factories__/nav-item.factory.js";
|
||||
import type { Header } from "../entities/models/header.js";
|
||||
|
||||
/**
|
||||
* Realistic navigation seed for dev mode + storybook stories.
|
||||
*
|
||||
* Built from `headerFactory` and `navItemFactory` so factory defaults take
|
||||
* care of boring fields and we only override what makes the nav look like a
|
||||
* real site header.
|
||||
*
|
||||
* Lazily produced so importing this module is side-effect-free — the
|
||||
* factory's sequence counter only advances when a binder calls
|
||||
* `buildDevHeader()`.
|
||||
*/
|
||||
export function buildDevHeader(): Header {
|
||||
return headerFactory.build({
|
||||
logoId: "logo-main",
|
||||
items: [
|
||||
navItemFactory.build({ label: "Home", href: "/", external: false }),
|
||||
navItemFactory.build({ label: "Blog", href: "/blog", external: false }),
|
||||
navItemFactory.build({ label: "About", href: "/about", external: false }),
|
||||
navItemFactory.build({ label: "Pricing", href: "/pricing", external: false }),
|
||||
],
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user