[QUESTION] Is it possible to integrate SST into an existing Turborepo project?
Hi all! 👋
First of all, thank you for this great tool. I really love it!
I have a small question. I have a large project built with Turborepo and Next.js. But now I want to use SST, but I can't find a way how to combine my existing Turborepo project with a new SST project.
Do you guys maybe have an example for me? Or is this even possible?
Thanks in advance!
yes I used to use turborepo alongside SST, hard to give a general answer it just depends on your setup
I wish say however because of how SST/CDK works you probably won't see much benefit in using turborepo alongside of it
Okay, thank you. So you dont use SST with Turbo, but next to it in the same project repository?
@thdxr Do you perhaps have an example of what your package.json from the root directory looks like? 😄
I asked myself the same question last week. I tried using SST along with T3-stack and turborepo (from https://github.com/t3-oss/create-t3-turbo) and was not able to get it workin. (I disabled the expo workspace because I wanted to test deploying the nextjs-app only)
On the other hand I was able to integrate SST and t3stack without turbo (using https://github.com/t3-oss/create-t3-app) even with usage of prisma.
I really like how SST deploys everything to aws-lamba but I did not like using SST without a monorepo. Removing turbo from https://github.com/t3-oss/create-t3-turbo and using pnpm workspaces instead, seems like a bad idea to me. Unfortunately I have not the required understanding on how to integrate SST with a monorepo like turbo which puts me a bit on hold using SST. If I come up with a solution I will post it here.
Yeah Turbo isn't terribly helpful. But we default to supporting pnpm and if you run npx create-sst@latest it'll create a mono repo for you.
@jayair how would you setup an SST monorepo with a shared ui library and configs without Turbo?
Would multiple apps in one SST monorepo be declared in the same sst.config.ts -> stacks(app) ?
Yeah we do a mono repo is our standard setup https://docs.sst.dev/start/standalone
If I have an existing turborepo with an app in apps/my-app, where should the SST files be?
I'm okay to move files around after runing yarn create sst or equivalent.
- Should
sst.config.tsbe insideapps/my-appor in the root of the turborepo? - Should the
/stacksfolder be insideapps/my-appor in the root of the tuborepo? - Should the
packages/coreandpackages/functionsfrom SST be insideapps/my-appor under my turborepo/packagesfolder?
I can understand it if doesn't work well but it still works right? @thdxr would it be possible to create a super minimal example of SST with turborepo or clarify where some of the files should be moved to as per questions 1/2/3 above?
sst.config.ts needs to be in the root. stacks/ isn't a real "workspace" so it can be wherever. The rest of your workspaces depend on your package manager config.
Any news on this... I've got a mono repo with 5 nextjs apps.
sst dev turbo dev breaks links
Having sst dev inside each packages dev script throws an error about to many sst instances.