-
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
Workspace phase 3 & 4 #3516
Workspace phase 3 & 4 #3516
Conversation
5aa907a
to
61d181b
Compare
61d181b
to
4377211
Compare
In a follow up PR I would look into testing |
!this.flags.ignoreOptional, | ||
); | ||
|
||
if (this.config.workspacesEnabled) { |
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.
Not sure this check is necessary - if there's a workspace but the experimental option is missing, yarn will abort anyway (https://github.com/yarnpkg/yarn/blob/master/src/config.js#L303)
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.
indeed, I'll remove the if
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.
Turns out this condition is still needed for commands that need fetchRequestFromCwd
but have workspaces disabled.
It would try to add workspaces resolution anyway.
src/cli/commands/install.js
Outdated
workspaces[virtualDependencyManifest.name] = {loc: '', manifest: virtualDependencyManifest}; | ||
virtualDependencyManifest.dependencies = {}; | ||
for (const workspaceName of Object.keys(workspaces)) { | ||
virtualDependencyManifest.dependencies[workspaceName] = workspaces[workspaceName].manifest.version; |
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.
This line will make the virtual dependency manifest depend on itself
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 find!
src/config.js
Outdated
|
||
// | ||
cwd: string; | ||
worktreeFolder: ?string; | ||
workspaceFolder: ?string; |
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.
There's an ambiguity with this name, since it's not clear if it's the path to the workspace common root or the path to a specific workspace.
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.
how about rootFolder?
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'd prefer workspaceRootFolder
so that the implication that the variable is null
when not using workspaces is made clear. But why not keep worktree
as the designated term for the workspace roots? It clear and concise! 😛
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 just wanted to not introduce a new term worktree because it does not imply that it is only relevant in workspaces.
workspaceRootFolder sounds quite clear.
Thanks, @arcanis. |
Implements Workspaces phase 3 & 4 RFC - ability to link between workspaces.
Description
The structure of the source code is following
Top level package.json is like
jest-matcher-utils (workspace referred by another one)
jest-diff (workspace that refers jest-matcher-utils)
When user runs yarn install, this folder structure of the Workspace gets created
jest/packages/jest-diff/node_modules/**jest-matcher-utils**
is a relative symlink tojest/packages/jest-matcher-utils
Test Plan