trpc types sharing non-monorepo project
What is your solution for types sharing using trpc but withouth a monorepo? I have 2 completly separate folders: client & server and I would like to have one source of types truth from the server. But it seems that trpc cannot manage and they just recommend to use a monorepo for that. Anyone has an idea please? ty
2 Replies
You can just create shared types in parent dir of both client and server dir and package it.
consume it via file: or npm link.
Making it an npm package is likely the way to go if you don't want a monorepo. I wouldn't recommend a git submodule but I guess you could. Is there a reason why a monorepo is not a great fit?