Looking for feedback on structuring a big project with turbo repo

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.

  1. Is it fine to keep packages nested under web-1 if they’re only used there? Is having nested package.json files and rebuilding the entire app when a package changes a bad practice?

  2. 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)

  3. We have turbo.json in every folder web-1, web-2, and root. Should we keep only one turbo.json in the root for easier management? Is it considered a bad practice to keep multiple turbo.json?

  4. 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
  1. 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!

Everything you’re already doing sounds good to me! --affected should work with your existing structure (if it doesn’t, please file a bug report in our repo).

As far as your proposals go about restructuring, as long as you are following this guidance, Turborepo will work as one would hope. The directory structures from then on are only meaningful for your developer experience. As long as the package manager Workspace is spec-compliant, Turborepo will work as expected.