Some checks failed
CI / typecheck + lint + boundaries + test + build (push) Has been cancelled
CI / Playwright e2e (push) Has been cancelled
CI / Storybook smoke tests + visual regression (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Coverage snapshot / snapshot (push) Has been cancelled
Release Please / release-please (push) Has been cancelled
Sentry PII guard (R31) / pii-guard (push) Has been cancelled
Extends 8111639 to cover __factories__, __seeds__, __contracts__, and
core-testing barrels.
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { articleFactory } from "../__factories__/article.factory";
|
|
import type { Article } from "../entities/models/article";
|
|
|
|
/**
|
|
* Realistic blog seed for dev mode + storybook stories.
|
|
*
|
|
* Built from `articleFactory` so factory defaults take care of the boring
|
|
* fields (createdAt, updatedAt, content, authorId) and we only override what
|
|
* makes the data look like a populated database.
|
|
*
|
|
* Lazily produced so importing this module is side-effect-free — the factory's
|
|
* sequence counter only advances when a binder calls `buildDevArticles()`.
|
|
*/
|
|
export function buildDevArticles(): Article[] {
|
|
return [
|
|
articleFactory.build({
|
|
id: "welcome",
|
|
slug: "welcome",
|
|
title: "Welcome to the blog",
|
|
status: "published",
|
|
}),
|
|
articleFactory.build({
|
|
id: "vertical-feature-architecture",
|
|
slug: "vertical-feature-architecture",
|
|
title: "Why vertical-feature packages",
|
|
status: "published",
|
|
}),
|
|
articleFactory.build({
|
|
id: "wip-post",
|
|
slug: "work-in-progress",
|
|
title: "A draft we haven't shipped yet",
|
|
status: "draft",
|
|
}),
|
|
];
|
|
}
|