-
Notifications
You must be signed in to change notification settings - Fork 79
Optimize yarn workspace discovery #1430
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
base: master
Are you sure you want to change the base?
Optimize yarn workspace discovery #1430
Conversation
@@ -90,12 +90,7 @@ private ExcludedIncludedWildcardFilter deriveExcludedIncludedWildcardFilter() { | |||
|
|||
@NotNull | |||
private YarnWorkspaces collectWorkspaceData(File dir) throws IOException { | |||
Collection<YarnWorkspace> curLevelWorkspaces = packageJsonFiles.readWorkspacePackageJsonFiles(dir); | |||
Collection<YarnWorkspace> allWorkspaces = new LinkedList<>(curLevelWorkspaces); | |||
for (YarnWorkspace workspace : curLevelWorkspaces) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unnecessary to try to find nested workspaces.
Nested workspaces are not supported at this time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That link looks like it covers yarn classic (1.x?). At the top there is a link to I believe more current documentation. It does seem like nested workspaces are supported in more recent versions? Seems like we support up to 4.1 so nested workspaces might be supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll look into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found any mention of nested workspaces in later documentation, so I did an experiment with Yarn 4.1.0:
- Create a project with workspaces having 3 levels (root points to workspace
sub
, which points to workspacesub1
, which points to workspacesub2
) - In package
sub2
package.json
specify a dependency - At root level run
yarn install
- Now yarn.lock contains dependency from sub2
So, it seems like we do need to take nested workspaces into account for at least some versions. Furthermore, we probably need to do this recursively instead of at just two levels as we've been doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it back to two levels for now. We can explore doing more going forward.
…713-yarn-workspace-glob-optimization-SNAPSHOT
No description provided.