MugetsuM
tRPC6mo ago
2 replies
Mugetsu

Monorepo with shared trpc router type

I'm building a monorepo for a single-page application and want to structure it like this:

app/server
app/client
packages/shared
(and potentially other packages/ as needed)

Its all internal nothing to publish to npm registry or smth.

I recently came across this article by Colin McDonnell:
https://colinhacks.com/essays/live-types-typescript-monorepo

It looks promising, but I’m wondering — will the approach described there (with import/exports and project references) be enough to handle the whole monorepo without running into a nightmare of setup and ongoing maintenance?

I’ve found monorepo setup and type sharing between modules to be tricky in the past.

Does anyone have a working example repo with a similar structure they can share?
Colin McDonnell @colinhacks
Live types in a TypeScript monorepo
Was this page helpful?