-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add support for "workspaces"
config objects in yarn
#5439
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@eykrehbein is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Hm, odd behaviour from yarn to say the least but I am open to including this. @tknickman is the generator master but he is away right now so I will take over. Going to run CI first then have a look, thanks! |
@arlyon Is there anything I can do from my side right now? 🙂 |
I am merging in main to this branch to see if it helps with CI. This 'symmetric difference' error pops up every once in a while. |
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.
Thanks for adding support for this! Only two minor changes and I think this is ready to go. Sorry for the delay on the review.
if (workspaceConfig instanceof Object) { | ||
return parseWorkspacePackages({ workspaceConfig }); |
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.
pnpm
doesn't need to share this codepath as pnpm-workspace.yaml
has it's own schema.
globs: (packageJson.workspaces as Array<string> | undefined) || [], | ||
workspaces: expandWorkspaces({ | ||
workspaceGlobs: packageJson.workspaces, | ||
workspaceGlobs: packageJson.workspaces as Array<string> | undefined, |
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.
npm
also supports declaring workspaces via "workspaces": { "packages": ["package/a"] }
so we should use the parseWorkspacePackages
method you added. source
Description
To be able to use the
nohoist
config in yarn workspaces, an object with the keysnohoist
andpackages
needs to be provided for the"workspaces"
entry in package.json.The proposed changes add support for a non-array
workspaces
entry inpackage.json
when using yarn. Before that, only arrays were supported which let to the following exception inside theexpandWorkspaces
function when using an object:A function (
parseWorkspacePackages
) was introduced to dynamically parse the"workspaces"
config by reusing the logic that was already introduced to parsepnpm
configs.Testing Instructions
The given test for yarn was adapted to use a
workspaces
object instead of an array