Skip to content
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

Fix for devDependencies not upgrading within a workspace #6943

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

the-realtom
Copy link

@the-realtom the-realtom commented Jan 20, 2019

Fixes: #4971

Summary
Performing a yarn add <dependency> within a workspace adds a new version to dependencies in the package.json instead of upgrading the version in devDependencies.

Test plan

  1. Setup a package in a workspace with a single devDependency.
  2. yarn workspace package1 [add/upgrade] [dependencyName]
  3. Ensure devDependency is updated.
  4. Repeat the same test but instead cd package1 then yarn [add/upgrade] [dependencyName]

Notes
Alternatively, removing this if statement would fix the issue as well:

// include dependencies from all workspaces
if (this.flags.includeWorkspaceDeps) {
pushDeps('dependencies', workspaceManifest, {hint: null, optional: false}, true);
pushDeps('devDependencies', workspaceManifest, {hint: 'dev', optional: false}, !this.config.production);
pushDeps('optionalDependencies', workspaceManifest, {hint: 'optional', optional: true}, true);
}

Copy link
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a good sign when the tests start to fail :)

Can you make sure they pass, and add a new test to prevent further regressions? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yarn add in workspace adds to dependencies when it should update devDependencies
2 participants