-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(workspaces): nested workspaces #6151
Conversation
Thanks for your contribution! Nested workspaces are currently missing by design. If you want to add them, we'll need a more formal process where we expect you to detail the benefits and possible issues, and your PR will have to be thoroughly tested 🙂 |
Hi @arcanis! |
Substantial feature requests should be proposed as an RFC, which you can do here: https://github.com/yarnpkg/rfcs Workspaces were the subject of many RFCs already. First it was proposed here, then it was split into three RFCs [1, 2, 3]. I can't find any detailed discussions about nested workspaces though. It would be great to see an RFC for that. |
I'm curious what use case you have for such an architecture? |
The "extension repo" example from this issue comes to mind. Nested workspaces would make extending a monorepo easier to accomplish. |
@Gudahtt Multiple workspaces at the same folder level is quite different than nested workspaces. |
Where are you seeing multiple workspaces at the same level? The case I linked to was two monorepos, where one depends upon (i.e. is an extension of) the other. Each of these monorepos would have multiple workspaces. e.g.
Or...
The main point here being that if you wanted this "Base Monorepo" to be usable with Yarn workspaces independently, nested workspaces would be a reasonable solution. |
@milesj We have some projects with workspaces and one project with e2e tests which depends from all other. |
Any new ? I'm waiting for this feature. It will be very useful |
@vitorcamachoo nested workspaces will be implemented in yarn v2 (#6953) |
What would be the behaviour of this feature ?
Every workspace is composed by linters, jest and so on. Note: |
The workspace implementation for the v2 is described here: |
It doesn't explain in detail what it does. I have some suggestions to make:
|
Any update? |
Are nested workspaces supported yet? I have wasted many hours on this and I can't find any clear documentation surrounding it. |
Almost. We have a project structure like above:
and it is working. :-)
It's only working if there is only one .yarn folder inside the root folder. |
Thanks, @cimchd. This helped me so much. |
motivation
yarn finds the closest manifest with
workspaces
. It's ok in almost all cases, but it fails if a package in workspace already has his own workspaces. In this case will be better to use global workspaces settings.Test plan