refactor(core-trpc): make the tRPC context router-agnostic

Ports the type-safety/ergonomics half of the upstream cycle-break: core-trpc
no longer imports AppRouter from @repo/core-api (an illegal
core -> core-composition boundary edge). The runtime context and both
providers are now AnyTRPCRouter-generic; consumers inject their router type
via useTRPC<TRouter>().

Our tree is already cycle-free (the demo features that closed the cycle are
deleted and no kept feature depends on core-trpc), so this is purely the
architecture/boundary improvement. The per-feature app-slice types the
upstream commit added for blog/marketing-pages/navigation are intentionally
skipped: no kept feature consumes useTRPC yet, so there is nothing to type,
and adding slice types now would be speculative.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016j8z4VHjedXDTjEDNg7qHK
This commit is contained in:
2026-07-13 00:04:23 +02:00
parent 3b577635f8
commit 73849aa6f0
6 changed files with 24 additions and 11 deletions

3
pnpm-lock.yaml generated
View File

@@ -914,9 +914,6 @@ importers:
packages/core-trpc:
dependencies:
"@repo/core-api":
specifier: workspace:*
version: link:../core-api
"@tanstack/react-query":
specifier: ^5.66.0
version: 5.96.2(react@19.2.4)