We’ve been using Turbo Repo for over a year and would like feedback on our app/package structure and setup:
Current Structure:
/apps/web-1
/apps/web-1/shared/* (each folder has a package.json) ±70 packages
/apps/web-1/features/* (each folder has a package.json) ±40 packages
/apps/web-2
We’re a big company (more than 150 FE devs) with domain-based teams, so packages are nested under web-1
with a dedicated package.json. This works due to heavy caching, but the setup could be improved. However, restructuring is complex and time-consuming.
We are in the process of updating to turbo 2.1 onwards so that we can start using the --affected
. But as most of the internal packages are inside of the web-1, I feel like the dependency chart is not as good as it could be.
These are the areas in which I would like to get feedback, I did try to get some metrics in regards to building and timings, but migrating the whole environment is just hard, and couldn’t dedicate much time to it.
-
Is it fine to keep packages nested under
web-1
if they’re only used there? Is having nestedpackage.json
files and rebuilding the entire app when a package changes a bad practice? -
We decided to put all the shared web-1 specific packages inside the web-w folder as they are going to be used outside of web-1. Would we benefit from moving the shared packages to the root folder instead of nested in the web-1? (we use just-in-time type of packages)
-
We have
turbo.json
in every folder web-1, web-2, and root. Should we keep only oneturbo.json
in the root for easier management? Is it considered a bad practice to keep multiple turbo.json? -
For Storybook, should we create separate entries per app, would this be easier to manage?
apps/web-1
apps/web-2
apps/storybook-web-1
apps/storybook-web-2
- We use pnpm. For shared dependencies like React libs, can versions be managed in one place, or do they need to be repeated in each package? Would
peerDependencies
with*
work?
Any feedback or suggestions would be greatly appreciated!