refactor(blog)!: delete blog demo feature

Veect retrofit (ADR-027): the template's demo content is being removed
to make room for the Veect package map. This slice deletes
packages/blog whole and prunes every composition edge in one commit:
core-api router mount, core-cms collections + regenerated Payload
types, web-next bindAll entry / home page / blog route / Tailwind
sources, blog e2e spec, tsconfig paths, fallow ignore entry,
anchor-guard + generator e2e feature lists, compliance artifacts,
and feature-list doc entries (CLAUDE.md, AGENTS.md, glossary).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016j8z4VHjedXDTjEDNg7qHK
This commit is contained in:
2026-07-12 15:56:22 +02:00
parent bb12cc2432
commit ea24c85424
92 changed files with 170 additions and 3318 deletions

View File

@@ -4,7 +4,7 @@
## Purpose
This app exists solely to serve the Payload Admin UI. It contains no custom CMS code beyond Next.js routing boilerplate. All business knowledge lives in feature packages (`@repo/auth`, `@repo/blog`, etc.), which export their collections/globals via subpath exports (`.../cms`). `@repo/core-cms` composes them into a single Payload config.
This app exists solely to serve the Payload Admin UI. It contains no custom CMS code beyond Next.js routing boilerplate. All business knowledge lives in feature packages (`@repo/auth`, etc.), which export their collections/globals via subpath exports (`.../cms`). `@repo/core-cms` composes them into a single Payload config.
## Port: 3001
@@ -15,13 +15,13 @@ pnpm dev --filter @repo/cms # http://localhost:3001/admin
## Key Files
| File | Purpose |
|---|---|
| `next.config.mjs` | Minimal config wrapped with `withPayload()` from `@payloadcms/next` |
| `tsconfig.json` | TypeScript config with `@payload-config` path alias |
| `src/app/(payload)/layout.tsx` | Auto-generated Payload root layout (DO NOT MODIFY) |
| `src/app/(payload)/admin/[[...segments]]/page.tsx` | Auto-generated catch-all admin page (DO NOT MODIFY) |
| `src/app/(payload)/importMap.js` | Auto-generated Payload import map (DO NOT MODIFY) |
| File | Purpose |
| -------------------------------------------------- | ------------------------------------------------------------------- |
| `next.config.mjs` | Minimal config wrapped with `withPayload()` from `@payloadcms/next` |
| `tsconfig.json` | TypeScript config with `@payload-config` path alias |
| `src/app/(payload)/layout.tsx` | Auto-generated Payload root layout (DO NOT MODIFY) |
| `src/app/(payload)/admin/[[...segments]]/page.tsx` | Auto-generated catch-all admin page (DO NOT MODIFY) |
| `src/app/(payload)/importMap.js` | Auto-generated Payload import map (DO NOT MODIFY) |
## Hard Rules
@@ -49,15 +49,11 @@ When Payload imports `@payload-config`, it resolves to the composed config from
## Composition flow
```
Feature 1 (@repo/blog)
└─ src/integrations/cms/collections/articles.ts
└─ exported as ./cms
Feature 2 (@repo/auth)
Feature 1 (@repo/auth)
└─ src/integrations/cms/collections/users.ts
└─ exported as ./cms
Feature 3 (@repo/navigation)
Feature 2 (@repo/navigation)
└─ src/integrations/cms/globals/header.ts
└─ exported as ./cms
@@ -83,13 +79,13 @@ cd apps/cms && pnpm generate:types
## Dependencies
| Dependency | Purpose |
|---|---|
| `@repo/core-cms` | Payload config + buildConfig |
| Dependency | Purpose |
| ------------------ | ------------------------------- |
| `@repo/core-cms` | Payload config + buildConfig |
| `@payloadcms/next` | Next.js integration for Payload |
| `payload` | Payload CMS core |
| `next` | Next.js 15 framework |
| `sharp` | Image processing |
| `payload` | Payload CMS core |
| `next` | Next.js 15 framework |
| `sharp` | Image processing |
## Cross-References

View File

@@ -5,16 +5,12 @@ describe("CMS app payload.config", () => {
it("registers all feature collections", async () => {
const resolved = await config;
const slugs = resolved.collections?.map((c) => c.slug) ?? [];
expect(slugs).toEqual(
expect.arrayContaining(["users", "articles", "pages", "media"]),
);
expect(slugs).toEqual(expect.arrayContaining(["users", "pages", "media"]));
});
it("registers all feature globals", async () => {
const resolved = await config;
const slugs = resolved.globals?.map((g) => g.slug) ?? [];
expect(slugs).toEqual(
expect.arrayContaining(["site-settings", "header"]),
);
expect(slugs).toEqual(expect.arrayContaining(["site-settings", "header"]));
});
});

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@ Next.js 15 reference application using App Router. Demonstrates consuming featur
## Purpose
Thin app showcasing how features work end-to-end. Business logic lives in feature packages (`@repo/auth`, `@repo/blog`, etc.); UI primitives live in `@repo/core-ui`; this app is mostly routes, layouts, and component composition.
Thin app showcasing how features work end-to-end. Business logic lives in feature packages (`@repo/auth`, etc.); UI primitives live in `@repo/core-ui`; this app is mostly routes, layouts, and component composition.
## Port: 3000
@@ -22,13 +22,12 @@ pnpm dev --filter @repo/web-next # Next.js on port 3000
## Key Files
| File | Purpose |
|---|---|
| `src/app/layout.tsx` | Root layout — wraps app with `<Providers>` |
| File | Purpose |
| ----------------------- | ---------------------------------------------------------------------------------------- |
| `src/app/layout.tsx` | Root layout — wraps app with `<Providers>` |
| `src/app/providers.tsx` | Client component wrapper (add tRPC/React Query here after scaffolding `@repo/core-trpc`) |
| `src/app/page.tsx` | Home page — navigation + marketing content |
| `src/app/blog/[slug]/page.tsx` | Dynamic blog post route |
| `e2e/` | Playwright end-to-end tests |
| `src/app/page.tsx` | Home page — navigation + marketing content |
| `e2e/` | Playwright end-to-end tests |
## tRPC Setup (optional)
@@ -67,18 +66,18 @@ export function Providers({ children }: { children: React.ReactNode }) {
## Dependencies
| Dependency | Purpose |
|---|---|
| `@repo/core-api` | `appRouter` for tRPC endpoint |
| `@repo/core-trpc/next` | Next.js tRPC client + provider (optional — scaffold first) |
| `@repo/core-ui` | Design system components (optional — scaffold first) |
| `@repo/auth`, `@repo/blog`, etc. | Feature packages (indirectly via core-api) |
| `next` | Next.js 15 framework |
| `@trpc/server` | tRPC server (fetch adapter) |
| Dependency | Purpose |
| --------------------------------- | ---------------------------------------------------------- |
| `@repo/core-api` | `appRouter` for tRPC endpoint |
| `@repo/core-trpc/next` | Next.js tRPC client + provider (optional — scaffold first) |
| `@repo/core-ui` | Design system components (optional — scaffold first) |
| `@repo/auth`, `@repo/media`, etc. | Feature packages (indirectly via core-api) |
| `next` | Next.js 15 framework |
| `@trpc/server` | tRPC server (fetch adapter) |
## Test conventions
- Unit tests colocated: `src/app/blog/article-list.test.tsx`
- Unit tests colocated: `src/app/providers.test.tsx`
- Vitest environment: `jsdom`
- e2e tests in `e2e/` folder: `*.spec.ts`
- Run: `pnpm test --filter @repo/web-next` (units) or `pnpm test:e2e` (Playwright)
@@ -105,7 +104,7 @@ Run: `pnpm test:e2e` starts the dev server and runs all `.spec.ts` files.
## Cross-References
- **Feature packages:** `packages/{auth,blog,media,marketing-pages,navigation}/`
- **Feature packages:** `packages/{auth,media,marketing-pages,navigation}/`
- **tRPC composition:** `packages/core-api/AGENTS.md`
- **tRPC client + provider (optional):** scaffold `@repo/core-trpc` first, then see `turbo/generators/templates/core-package/trpc/AGENTS.md.hbs`
- **UI components (optional):** scaffold with `pnpm turbo gen core-package ui`, then see `turbo/generators/templates/core-package/ui/AGENTS.md.hbs`

View File

@@ -1,20 +0,0 @@
import { test, expect } from "@playwright/test";
test("/blog/[slug] returns 404 for non-existent slug", async ({ page }) => {
const response = await page.goto("/blog/this-slug-does-not-exist", {
waitUntil: "domcontentloaded",
});
expect(response?.status()).toBe(404);
});
test("/blog/[slug] for a real slug renders the article", async ({ page }) => {
// The mock blog repository is empty by default — so this test currently
// expects 404. When seeded data exists in Payload, replace 404 with 200
// and check for article.title in the page body.
test.skip(
true,
"Pending: seed a published article in Payload before enabling this test",
);
await page.goto("/blog/example-slug");
await expect(page.locator("h1").first()).toBeVisible();
});

View File

@@ -4,7 +4,6 @@ import { withSentryConfig } from "@sentry/nextjs";
const nextConfig = {
transpilePackages: [
"@repo/auth",
"@repo/blog",
"@repo/core-analytics",
"@repo/core-api",
"@repo/core-audit",

View File

@@ -15,7 +15,6 @@
},
"dependencies": {
"@repo/auth": "workspace:*",
"@repo/blog": "workspace:*",
"@repo/core-api": "workspace:*",
"@repo/core-cms": "workspace:*",
"@repo/core-shared": "workspace:*",

View File

@@ -1,17 +0,0 @@
import { ArticleDetail } from "@repo/blog/ui";
import { bindAll } from "../../../server/bind-production";
type PageProps = {
params: Promise<{ slug: string }>;
};
export default async function BlogPostPage({ params }: PageProps) {
await bindAll();
const { slug } = await params;
return (
<main className="px-6 py-8">
<ArticleDetail slug={slug} />
</main>
);
}

View File

@@ -1,4 +1,3 @@
import { ArticleList } from "@repo/blog/ui";
import { bindAll } from "../server/bind-production";
export default async function Home() {
@@ -6,10 +5,7 @@ export default async function Home() {
return (
<main className="mx-auto max-w-5xl px-6 py-8">
<h2 className="mb-4 text-2xl font-bold text-foreground">
Latest articles
</h2>
<ArticleList />
<h1 className="mb-4 text-2xl font-bold text-foreground">Veect</h1>
</main>
);
}

View File

@@ -4,9 +4,6 @@ vi.mock("@repo/core-cms", () => ({ default: Promise.resolve({}) }));
vi.mock("payload", () => ({
getPayload: vi.fn(async () => ({ jobs: { queue: vi.fn() } })),
}));
vi.mock("@repo/blog/di/bind-production", () => ({
bindProductionBlog: vi.fn(),
}));
vi.mock("@repo/auth/di/bind-production", () => ({
bindProductionAuth: vi.fn(),
}));
@@ -19,7 +16,6 @@ vi.mock("@repo/navigation/di/bind-production", () => ({
vi.mock("@repo/media/di/bind-production", () => ({
bindProductionMedia: vi.fn(),
}));
vi.mock("@repo/blog/di/bind-dev-seed", () => ({ bindDevSeedBlog: vi.fn() }));
vi.mock("@repo/auth/di/bind-dev-seed", () => ({ bindDevSeedAuth: vi.fn() }));
vi.mock("@repo/marketing-pages/di/bind-dev-seed", () => ({
bindDevSeedMarketingPages: vi.fn(),
@@ -47,10 +43,8 @@ describe("bindAllProduction", () => {
vi.clearAllMocks();
});
it("binds all five feature production repos", async () => {
it("binds all four feature production repos", async () => {
const { bindAllProduction } = await import("./bind-production");
const { bindProductionBlog } =
await import("@repo/blog/di/bind-production");
const { bindProductionAuth } =
await import("@repo/auth/di/bind-production");
const { bindProductionMarketingPages } =
@@ -62,7 +56,6 @@ describe("bindAllProduction", () => {
await bindAllProduction();
expect(bindProductionBlog).toHaveBeenCalledOnce();
expect(bindProductionAuth).toHaveBeenCalledOnce();
expect(bindProductionMarketingPages).toHaveBeenCalledOnce();
expect(bindProductionNavigation).toHaveBeenCalledOnce();
@@ -72,11 +65,11 @@ describe("bindAllProduction", () => {
it("is idempotent via bindAll — second call does not re-bind", async () => {
vi.stubEnv("NODE_ENV", "production");
const { bindAll } = await import("./bind-production");
const { bindProductionBlog } =
await import("@repo/blog/di/bind-production");
const { bindProductionAuth } =
await import("@repo/auth/di/bind-production");
await bindAll();
await bindAll();
expect(bindProductionBlog).toHaveBeenCalledOnce();
expect(bindProductionAuth).toHaveBeenCalledOnce();
});
it("passes a Payload-backed queue to each per-feature binder", async () => {
@@ -127,54 +120,54 @@ describe("bindAll dispatcher", () => {
vi.stubEnv("USE_DEV_SEED", "true");
vi.stubEnv("NODE_ENV", "production"); // even in production, dev seed wins
const { bindAll } = await import("./bind-production");
const { bindDevSeedBlog } = await import("@repo/blog/di/bind-dev-seed");
const { bindProductionBlog } =
await import("@repo/blog/di/bind-production");
const { bindDevSeedAuth } = await import("@repo/auth/di/bind-dev-seed");
const { bindProductionAuth } =
await import("@repo/auth/di/bind-production");
await bindAll();
expect(bindDevSeedBlog).toHaveBeenCalledOnce();
expect(bindProductionBlog).not.toHaveBeenCalled();
expect(bindDevSeedAuth).toHaveBeenCalledOnce();
expect(bindProductionAuth).not.toHaveBeenCalled();
});
it("NODE_ENV='production' (no override) → dispatches to bindAllProduction", async () => {
vi.stubEnv("NODE_ENV", "production");
const { bindAll } = await import("./bind-production");
const { bindProductionBlog } =
await import("@repo/blog/di/bind-production");
const { bindDevSeedBlog } = await import("@repo/blog/di/bind-dev-seed");
const { bindProductionAuth } =
await import("@repo/auth/di/bind-production");
const { bindDevSeedAuth } = await import("@repo/auth/di/bind-dev-seed");
await bindAll();
expect(bindProductionBlog).toHaveBeenCalledOnce();
expect(bindDevSeedBlog).not.toHaveBeenCalled();
expect(bindProductionAuth).toHaveBeenCalledOnce();
expect(bindDevSeedAuth).not.toHaveBeenCalled();
});
it("NODE_ENV='development' → dispatches to bindAllDevSeed (developer default)", async () => {
vi.stubEnv("NODE_ENV", "development");
const { bindAll } = await import("./bind-production");
const { bindDevSeedBlog } = await import("@repo/blog/di/bind-dev-seed");
const { bindProductionBlog } =
await import("@repo/blog/di/bind-production");
const { bindDevSeedAuth } = await import("@repo/auth/di/bind-dev-seed");
const { bindProductionAuth } =
await import("@repo/auth/di/bind-production");
await bindAll();
expect(bindDevSeedBlog).toHaveBeenCalledOnce();
expect(bindProductionBlog).not.toHaveBeenCalled();
expect(bindDevSeedAuth).toHaveBeenCalledOnce();
expect(bindProductionAuth).not.toHaveBeenCalled();
});
it("USE_DEV_SEED='false' is treated as not-set (only 'true' triggers dev seed)", async () => {
vi.stubEnv("USE_DEV_SEED", "false");
vi.stubEnv("NODE_ENV", "production");
const { bindAll } = await import("./bind-production");
const { bindProductionBlog } =
await import("@repo/blog/di/bind-production");
const { bindDevSeedBlog } = await import("@repo/blog/di/bind-dev-seed");
const { bindProductionAuth } =
await import("@repo/auth/di/bind-production");
const { bindDevSeedAuth } = await import("@repo/auth/di/bind-dev-seed");
await bindAll();
expect(bindProductionBlog).toHaveBeenCalledOnce();
expect(bindDevSeedBlog).not.toHaveBeenCalled();
expect(bindProductionAuth).toHaveBeenCalledOnce();
expect(bindDevSeedAuth).not.toHaveBeenCalled();
});
});
@@ -225,12 +218,12 @@ describe("bindAll instrumentation orthogonality", () => {
const { bindAll } = await import("./bind-production");
const { bindOtelInstrumentation } =
await import("@repo/core-shared/instrumentation");
const { bindDevSeedBlog } = await import("@repo/blog/di/bind-dev-seed");
const { bindDevSeedAuth } = await import("@repo/auth/di/bind-dev-seed");
await bindAll();
expect(bindOtelInstrumentation).toHaveBeenCalledOnce();
expect(bindDevSeedBlog).toHaveBeenCalledOnce();
expect(bindDevSeedAuth).toHaveBeenCalledOnce();
});
it("Noop instrumentation works alongside production binding (DSN unset, NODE_ENV=production)", async () => {
@@ -239,12 +232,12 @@ describe("bindAll instrumentation orthogonality", () => {
const { bindAll } = await import("./bind-production");
const { bindNoopInstrumentation } =
await import("@repo/core-shared/instrumentation");
const { bindProductionBlog } =
await import("@repo/blog/di/bind-production");
const { bindProductionAuth } =
await import("@repo/auth/di/bind-production");
await bindAll();
expect(bindNoopInstrumentation).toHaveBeenCalledOnce();
expect(bindProductionBlog).toHaveBeenCalledOnce();
expect(bindProductionAuth).toHaveBeenCalledOnce();
});
});

View File

@@ -17,12 +17,10 @@ import {
type IJobQueue,
} from "@repo/core-shared/jobs";
import { NoopRateLimit } from "@repo/core-shared/rate-limit";
import { bindProductionBlog } from "@repo/blog/di/bind-production";
import { bindProductionAuth } from "@repo/auth/di/bind-production";
import { bindProductionMarketingPages } from "@repo/marketing-pages/di/bind-production";
import { bindProductionNavigation } from "@repo/navigation/di/bind-production";
import { bindProductionMedia } from "@repo/media/di/bind-production";
import { bindDevSeedBlog } from "@repo/blog/di/bind-dev-seed";
import { bindDevSeedAuth } from "@repo/auth/di/bind-dev-seed";
import { bindDevSeedMarketingPages } from "@repo/marketing-pages/di/bind-dev-seed";
import { bindDevSeedNavigation } from "@repo/navigation/di/bind-dev-seed";
@@ -100,7 +98,6 @@ export async function bindAllProduction(): Promise<void> {
};
bindProductionAuth(ctx);
bindProductionBlog(ctx);
bindProductionMarketingPages(ctx);
bindProductionNavigation(ctx);
bindProductionMedia(ctx);
@@ -123,7 +120,6 @@ export async function bindAllDevSeed(): Promise<void> {
};
await bindDevSeedAuth(ctx);
await bindDevSeedBlog(ctx);
await bindDevSeedMarketingPages(ctx);
await bindDevSeedNavigation(ctx);
await bindDevSeedMedia(ctx);

View File

@@ -1,7 +1,6 @@
@import "tailwindcss";
@source "../../../../packages/core-ui/src";
@source "../../../../packages/navigation/src";
@source "../../../../packages/blog/src";
@source "../../../../packages/marketing-pages/src";
@source "../../../../packages/media/src";
@source "../../../../packages/auth/src";

File diff suppressed because one or more lines are too long