sst / sst

Build full-stack apps on your own infrastructure.
https://sst.dev
MIT License
24.04k stars 1.85k forks source link

How to set up type-checking for SST infra code in a monorepo? #5890

Open mikecfisher opened 4 weeks ago

mikecfisher commented 4 weeks ago

I'm working with a bun monorepo using SST v3 and trying to figure out the best way to add TypeScript type-checking for my infra code. My infrastructure code is at the root of the repo, alongside sst.config.ts, and isn't part of a standard workspace package, so it's not covered by my existing typecheck setup.

I've tried creating a root tsconfig.json that includes sst.config.ts and infra/**/*.ts, but when I run tsc, I get a lot of type errors from the .sst/platform directory. It seems that even with skipLibCheck and various exclude patterns, TypeScript still follows the imports into the platform files and errors out on SST's internal code.

What is the recommended way to handle this? I'd like to have a clean tsc run in CI for my own code without checking all the SST internals. Is there a best practice for this type of setup?

thdxr commented 3 weeks ago

we have a fix for this in a branch will release soon