Open hrougier opened 5 years ago
Need this feature
Yarn 2 is coming.
I did not mention that I opened this issue especially because a lot of libraries use this library, such as expo-yarn-workspaces for example. So you have to deal with this issue as soon as you want to use Yarn workspaces for expo apps 😕
Upcoming Yarn 2 will bring cleaner support for nested workspaces. As stated in the workspaces documentation:
Here is an example of a monorepo taking advantage of nested workspaces:
with
my-app/package.json
defining workspaces like this:my-app/back/package.json
defining workspaces like this:and
my-app/front/package.json
defining workspaces like this:Issue
Current algorithm stops as soon as it finds a
package.json
containing aworkspaces
section up in the tree.Note: it already is possible to nest workspaces with Yarn 1 by defining the root worktree package like this:
With the
workspaces
section of@my-app/back
and@my-app/front
having no effect. But Yarn 2's way of defining packages definitely seems cleaner.What would you think about having the algorithm to search for the most upward worktree package ? Something like:
It will still work for Yarn 1 workspaces while being ready for Yarn 2 nested workspaces.