Hello all, how do you deal with your stacks/infras...
# general
j
Hello all, how do you deal with your stacks/infrastructure in a monorepo? I want to reorganize our monorepo and right now we aren’t granular enough, I have a big “server” package containing the whole cdk project + all the backend services code. I’d like to split all my services in their own packages but I’m not sure about the cdk stack. I think I’ll put it in a single package as well, and maybe write a few constructs related to each microservices inside each of them. 🤔
f
Hey @Julien Goux, @thdxr created this Typescript Monorepo repo. It can have 1 or more stacks, and the function code is group into packages. The same setup could probably work for a pure CDK app as well.
j
Do you have a link? 🙂
j
Awesome thanks! I know @thdxr and I have mutual interests, I often see you pop on twitter 😄
I’ll try to migrate from yarn v1 to pnpm + turborepo, I wonder if turborepo could help the cdk synth
because right now it rebuilds everything everytime we deploy
huge, your structuration of the monorepo is more or less what we have today
a domain folder / infra folder 😄
t
Yeah I wrote in the notes why I'm not using discrete packages. I'm also planning on playing with Turborepo, we might consider embedding its functionality into SST because deploying 1 function requires building all functions/frontend/etc
j
Yes this is an issue I have with cdk. I guess one workaround right now would be to opt-out for the NodejsFunction construct and use the tryBundle option to run esbuild manually through turbo. So if nothing changed it would get the build from the cache.