refactor(navigation)!: delete navigation demo feature

Veect retrofit (ADR-027): fifth and final slice of the demo-content
removal. Deletes packages/navigation whole and prunes every composition
edge in one commit: core-api router mount + dep + router test, core-cms
header-global composition + dep + regenerated Payload types (globals
now empty), web-next bindAll (prod + dev-seed) + tests + Tailwind
source + transpilePackages + dep, cms/core-cms payload config test
assertions, home e2e nav assertion, tsconfig paths, fallow
ignoreDependencies entry, anchor-guard FEATURES list, generator e2e
strip lists + reference-feature comments (navigation -> auth, incl.
feature templates + scaffolding guide), lockfile prune, and
feature-list doc trims (CLAUDE.md, AGENTS.md, glossary, app/feature
AGENTS.md). Compliance YAML regeneration produced no churn (navigation
declared no PII).

Cycle break: navigation's UI hooks were the last edge closing the
committed core-trpc -> core-api -> navigation -> core-trpc package
cycle. With it gone, the lint turbo task graph builds for the first
time and every package's ESLint executes; the epic's lint waiver
expires here. Latent findings: 3 errors, all mechanical, fixed
in-slice - require() import in turbo/generators/config.ts
(no-require-imports), literal type assertion in auth's
authentication.service.ts (prefer-as-const), and next-env.d.ts
triple-slash in apps/cms (rule scoped off for that generated file,
mirroring web-next's existing override). 99 warn-severity findings
remain across 5 packages (pii-declaration-must-be-complete on test
fixtures, turbo/no-undeclared-env-vars on test env keys) - all
warn-by-design, non-gating.

core-trpc keeps a consumer (apps/web-next providers) and stays per
ADR-027. Its unused @trpc/react-query dependency, surfaced by the
post-deletion fallow audit, is removed rather than ignore-listed -
core-trpc's hooks use @trpc/tanstack-react-query. Remaining fallow
warn (auth validateSession "unused member") is a false positive: the
method implements IAuthenticationService and is exercised in
container.test.ts; auth stays untouched as the regression canary.

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 19:30:32 +02:00
parent 61e1f0792d
commit 48bf4da4cd
86 changed files with 57 additions and 1819 deletions

View File

@@ -49,14 +49,10 @@ When Payload imports `@payload-config`, it resolves to the composed config from
## Composition flow
```
Feature 1 (@repo/auth)
Feature (@repo/auth)
└─ src/integrations/cms/collections/users.ts
└─ exported as ./cms
Feature 2 (@repo/navigation)
└─ src/integrations/cms/globals/header.ts
└─ exported as ./cms
Core CMS (@repo/core-cms)
└─ src/payload.config.ts
imports all feature /cms exports

View File

@@ -1,3 +1,11 @@
import baseConfig from "@repo/core-eslint/base";
export default baseConfig;
export default [
...baseConfig,
{
files: ["next-env.d.ts"],
rules: {
"@typescript-eslint/triple-slash-reference": "off",
},
},
];

View File

@@ -8,9 +8,9 @@ describe("CMS app payload.config", () => {
expect(slugs).toEqual(expect.arrayContaining(["users"]));
});
it("registers all feature globals", async () => {
it("registers no feature globals (none remain)", async () => {
const resolved = await config;
const slugs = resolved.globals?.map((g) => g.slug) ?? [];
expect(slugs).toEqual(expect.arrayContaining(["header"]));
expect(slugs).toEqual([]);
});
});

File diff suppressed because one or more lines are too long

View File

@@ -66,14 +66,14 @@ 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/navigation`, 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`, etc. | Feature packages (indirectly via core-api) |
| `next` | Next.js 15 framework |
| `@trpc/server` | tRPC server (fetch adapter) |
## Test conventions
@@ -104,7 +104,7 @@ Run: `pnpm test:e2e` starts the dev server and runs all `.spec.ts` files.
## Cross-References
- **Feature packages:** `packages/{auth,navigation}/`
- **Feature packages:** `packages/auth/`
- **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,10 +1,7 @@
import { test, expect } from "@playwright/test";
test("home page renders heading + nav", async ({ page }) => {
test("home page renders heading", async ({ page }) => {
await page.goto("/");
// Page renders and shows the heading
await expect(page.locator("h1").first()).toBeVisible();
// Nav element is present on the page
const nav = page.locator("nav");
await expect(nav).toHaveCount(1);
});

View File

@@ -12,7 +12,6 @@ const nextConfig = {
"@repo/core-dsr",
"@repo/core-shared",
"@repo/core-ui",
"@repo/navigation",
"@repo/core-trpc",
],
};

View File

@@ -19,7 +19,6 @@
"@repo/core-cms": "workspace:*",
"@repo/core-shared": "workspace:*",
"@repo/core-trpc": "workspace:^",
"@repo/navigation": "workspace:*",
"@sentry/nextjs": "^10.51.0",
"@tailwindcss/postcss": "^4.3.0",
"@tanstack/react-query": "^5.96.2",

View File

@@ -7,13 +7,7 @@ vi.mock("payload", () => ({
vi.mock("@repo/auth/di/bind-production", () => ({
bindProductionAuth: vi.fn(),
}));
vi.mock("@repo/navigation/di/bind-production", () => ({
bindProductionNavigation: vi.fn(),
}));
vi.mock("@repo/auth/di/bind-dev-seed", () => ({ bindDevSeedAuth: vi.fn() }));
vi.mock("@repo/navigation/di/bind-dev-seed", () => ({
bindDevSeedNavigation: vi.fn(),
}));
vi.mock("@repo/core-shared/instrumentation", async (importOriginal) => {
const actual =
await importOriginal<typeof import("@repo/core-shared/instrumentation")>();
@@ -33,17 +27,14 @@ describe("bindAllProduction", () => {
vi.clearAllMocks();
});
it("binds both feature production repos", async () => {
it("binds the auth feature production repos", async () => {
const { bindAllProduction } = await import("./bind-production");
const { bindProductionAuth } =
await import("@repo/auth/di/bind-production");
const { bindProductionNavigation } =
await import("@repo/navigation/di/bind-production");
await bindAllProduction();
expect(bindProductionAuth).toHaveBeenCalledOnce();
expect(bindProductionNavigation).toHaveBeenCalledOnce();
});
it("is idempotent via bindAll — second call does not re-bind", async () => {

View File

@@ -18,9 +18,7 @@ import {
} from "@repo/core-shared/jobs";
import { NoopRateLimit } from "@repo/core-shared/rate-limit";
import { bindProductionAuth } from "@repo/auth/di/bind-production";
import { bindProductionNavigation } from "@repo/navigation/di/bind-production";
import { bindDevSeedAuth } from "@repo/auth/di/bind-dev-seed";
import { bindDevSeedNavigation } from "@repo/navigation/di/bind-dev-seed";
let bindPromise: Promise<void> | null = null;
@@ -94,7 +92,6 @@ export async function bindAllProduction(): Promise<void> {
};
bindProductionAuth(ctx);
bindProductionNavigation(ctx);
}
/**
@@ -114,7 +111,6 @@ export async function bindAllDevSeed(): Promise<void> {
};
await bindDevSeedAuth(ctx);
await bindDevSeedNavigation(ctx);
}
/**

View File

@@ -1,6 +1,5 @@
@import "tailwindcss";
@source "../../../../packages/core-ui/src";
@source "../../../../packages/navigation/src";
@source "../../../../packages/auth/src";
@source "../";

File diff suppressed because one or more lines are too long