Align the architecture docs with the current repo: - Boundary matrix: feature may depend on core, feature, tooling — a feature may import another feature's public exports. overview.md, dependency-flow.md, and vertical-feature-spec.md all said the stale `feature -> core, tooling`. - Optional-core lists completed with core-analytics, core-consent, core-dsr; tooling list completed with core-testing. - Package count corrected to the accurate 19-package breakdown. - BindContext table gained analytics, consentFactory, rateLimit. Deeper drift (the HTML explainers, vertical-feature-spec §5/§9.5/§11) is tracked in the local .tmp/ working note, not yet addressed.
32 lines
2.1 KiB
Markdown
32 lines
2.1 KiB
Markdown
# Template tiers
|
|
|
|
This template ships in three tiers:
|
|
|
|
## Must-have (always present)
|
|
|
|
- `@repo/core-shared` — protocol types, `BindContext`, instrumentation interfaces, jobs interface, tRPC primitives, payload helpers
|
|
- `@repo/core-eslint` — flat-config preset + repo-rules ESLint plugin + boundaries
|
|
- `@repo/core-typescript` — tsconfig presets (base, react-library, nextjs)
|
|
- `@repo/core-testing` — vitest helpers, factories, mocks, contracts
|
|
- `@repo/core-cms` — Payload config base
|
|
- `@repo/core-api` — top-level tRPC router root (mounts feature routers)
|
|
|
|
Plus all 5 feature packages: auth, blog, marketing-pages, navigation, media.
|
|
|
|
## Optional (scaffolded on demand)
|
|
|
|
| Package | Generator | ADR | Guide |
|
|
| -------------- | --------------------------------------- | ------- | ----------------------------------- |
|
|
| core-realtime | `pnpm turbo gen core-package realtime` | ADR-016 | docs/guides/realtime.md |
|
|
| core-events | `pnpm turbo gen core-package events` | ADR-015 | docs/guides/events-and-jobs.md |
|
|
| core-trpc | `pnpm turbo gen core-package trpc` | (none) | (none) |
|
|
| core-ui | `pnpm turbo gen core-package ui` | (none) | (none) |
|
|
| core-audit | `pnpm turbo gen core-package audit` | ADR-018 | docs/guides/audit-and-compliance.md |
|
|
| core-analytics | `pnpm turbo gen core-package analytics` | ADR-024 | docs/guides/analytics.md |
|
|
| core-consent | `pnpm turbo gen core-package consent` | ADR-025 | docs/guides/consent.md |
|
|
| core-dsr | `pnpm turbo gen core-package dsr` | ADR-025 | docs/guides/dsr.md |
|
|
|
|
## Why optional
|
|
|
|
Each optional package addresses a specific need (realtime delivery, cross-feature events, tRPC, design system). Projects that don't need them get a slimmer template. The generator emits byte-identical copies of the packages as they shipped — see `turbo/generators/__snapshots__/core-package/<name>.snapshot.json` for the canonical content hashes.
|