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

Add warning when attempting to remove dependency from workspace root #5737

Merged
merged 1 commit into from
Apr 26, 2018

Conversation

jxom
Copy link
Contributor

@jxom jxom commented Apr 26, 2018

Summary

This PR addresses issue #5611.

This PR basically adds a warning when trying to remove a dependency from a workspace root. When specifying the -W/--ignore-workspace-root-check it will remove the dependency from the workspace root.

Test plan

Before:

❯ yarn remove left-pad
yarn remove v1.6.0
[1/2] Removing module left-pad...
[2/2] Regenerating lockfile and installing missing dependencies...
success Uninstalled packages.

After:

❯ yarn-local remove left-pad
yarn remove v1.6.0
error Running this command will remove the dependency from the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command.
❯ yarn-local remove left-pad -W
yarn remove v1.6.0
[1/2] 🗑  Removing module left-pad...
[2/2] 📃  Regenerating lockfile and installing missing dependencies...
success Uninstalled packages.

@arcanis
Copy link
Member

arcanis commented Apr 26, 2018

Sounds good to me - 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.

2 participants