In the earlier version of my project which I fully scraped (because it was AI slop because I wanted to present something quickly) I had global tsconfig.json, package.json, etc. I had apps/api/src/ for Fastify and apps/api/web/ for Next.js.
Next.js installs its own tsconfig.json, and it just seems weird to have 2 tsconfig.json in a hierarchy.
In my project, Next.js and Fastify run in the same Node process, not different web servers.
What is the best way to structure my project? Should I keep tsconfig.json and package.json separate for both apps, and one generic version at the project root?
Fastify will require Next.js as a dependency and I think Next.js won't require Fastify, so I need Next.js at both places. Not really a problem because I use pnpm.
The confusing part that I found is that tsserver and tsc work differently. tsserver searches upward from the file's directory to find its owning tsconfig.json while tsc only uses the tsconfig.json from its current working directory.…