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

Yarn Berry: Prevent sub-package dependencies being added to root workspace #5829

Merged
merged 2 commits into from
Oct 5, 2022

Conversation

jurre
Copy link
Member

@jurre jurre commented Oct 3, 2022

Previously, when attempting to update a sub-packages' dependency, it would unintentionally get added to the top-level workspaces' dependencies in the yarn lockfile.

This happened because we ran yarn add instead of up, which adds it to the top-level package (and then updates the other existing instances), we then discard the package.json changes, so those never got committed, but the entry in the lockfile remains, putting it in an inconsistent state.

@jurre jurre requested a review from a team as a code owner October 3, 2022 18:42
@jurre jurre mentioned this pull request Oct 3, 2022
@jurre jurre force-pushed the jurre/yarn-berry-fix-workspace-deps branch from 6524dab to 32c1c4c Compare October 3, 2022 18:53
@jurre jurre force-pushed the jurre/yarn-berry-fix-workspace-deps branch from 32c1c4c to d72decf Compare October 4, 2022 08:32
jurre added 2 commits October 4, 2022 16:28
…space

Previously, when attempting to update a sub-packages' dependency, it
would unintentionally get added to the top-level workspaces'
`dependencies` in the yarn lockfile.

This happened because we ran `yarn add` instead of `up`, which adds it
to the top-level package (and then updates the other existing
instances), we then discard the package.json changes, so those never got
committed, but the entry in the lockfile remains, putting it in an
inconsistent state.
@jurre jurre force-pushed the jurre/yarn-berry-fix-workspace-deps branch from d72decf to 6b61bfc Compare October 4, 2022 14:28
@jurre jurre requested a review from mctofu October 4, 2022 14:31
@jurre jurre merged commit 8b77316 into main Oct 5, 2022
@jurre jurre deleted the jurre/yarn-berry-fix-workspace-deps branch October 5, 2022 12:12
@pavera pavera mentioned this pull request Oct 31, 2022
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