vercel/turborepo

๐Ÿ“š Docs: separate organization structure

Closed this issue ยท 1 comments

yamz8 commented

What is the improvement or update you wish to see?

is there any example of how to create separate organizations in the same turbo?
my goal is to have something like this:

apps/
    org1/
       web/
       mobile/
       api/
org2/
       web/
       mobile/
       api/
packages/
    shared/
    org1/
    org2/

Is there any context that might help us understand?

https://turbo.build/repo/docs/crafting-your-repository/structuring-a-repository

Does the docs page already exist? Please link to it.

https://turbo.build/repo/docs/crafting-your-repository/structuring-a-repository

Hey, @yamz8! I'm thinking this section describes the underlying concepts of how you would go about this.

Since Turborepo doesn't allow for nested workspaces (apps/**, with a double star), you'd want to enumerate the groups in your package.json#workspaces or pnpm-workspace.json, according to your package manager. As an example, with pnpm and the file tree you provided:

packages:
  - apps/org1/*
  - apps/org2/*
  - packages/*

You'd then be able to install and use them as you'd like.


As far as putting this specific use case into the docs, I'm hesitant. I've come back to this issue around 3 times now and put thought to it twice as many times. After much thinking, I'm considering first principles, particularly that great documentation is just as much about what they don't say as what they do say.

For this case, I'm settling on the docs to continue to teach the concepts to accomplish the use case you're describing, and I think we're adequately doing that as they stand right now. By not adding this content, we'll be able to keep the page streamlined to the concepts of building a monorepo, rather than prescribing for every use case that someone might come up with. While this does put a bit more of the shared responsibility onto you (and folks looking for this use case), I feel it's the right move to put you on the path towards long term success.

I hope the example I provided above helps get you closer to achieving your goals and will close this in the interest of keeping the docs focused on lower level concepts. Thank you for using Turborepo and being a part of the community!