Files
agentic-dev/packages/core-trpc/package.json
Danijel Martinek c2841cf352 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>().

The clean-slate tree is already cycle-free (no kept feature consumes
core-trpc), so this is purely the architecture/boundary improvement. The
per-feature app-slice types the upstream commit added for the demo features
are intentionally skipped: no kept feature consumes useTRPC yet.

Also covers the router-agnostic useTRPC delegation: the refactor turned
useTRPC into a wrapper function whose body was unexercised, dropping
client.ts below the coverage floor — client.test.ts stubs the context
factory and asserts the delegation, restoring client.ts to 100%.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016j8z4VHjedXDTjEDNg7qHK
2026-07-13 06:09:10 +02:00

37 lines
975 B
JSON

{
"name": "@repo/core-trpc",
"private": true,
"version": "0.0.0",
"type": "module",
"exports": {
".": "./src/index.ts",
"./next": "./src/providers/next-provider.tsx",
"./tanstack": "./src/providers/tanstack-provider.tsx"
},
"scripts": {
"build": "tsc --noEmit",
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests"
},
"dependencies": {
"@tanstack/react-query": "^5.66.0",
"@trpc/client": "^11.18.0",
"@trpc/server": "^11.18.0",
"@trpc/tanstack-react-query": "^11.18.0",
"react": "^19.0.0",
"superjson": "^2.2.1"
},
"devDependencies": {
"@repo/core-eslint": "workspace:*",
"@repo/core-testing": "workspace:*",
"@repo/core-typescript": "workspace:*",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.0",
"@types/react": "^19.0.0",
"@vitest/coverage-v8": "^3.2.4",
"jsdom": "^25.0.0",
"vitest": "^3.0.0"
}
}