Skip to content

update a dependency correctly when it's declared multiple times with different range - #412

Merged
Andarist merged 18 commits into
changesets:masterfrom
Feiyang1:fei-multi-dep-fix
Aug 27, 2020
Merged

Andarist merged 18 commits into
changesets:masterfrom
Feiyang1:fei-multi-dep-fix

Conversation

@Feiyang1

Copy link
Copy Markdown
Contributor

Fixes #411

@changeset-bot

changeset-bot Bot commented Jul 10, 2020 •

Copy link
Copy Markdown

🦋 Changeset is good to go

Latest commit: 0e8a6bb

We got this.

This PR includes changesets to release 2 packages
Name Type
@changesets/assemble-release-plan Patch
@changesets/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread package.json Resolved
Comment thread .changeset/nice-eels-study.md Resolved

@Feiyang1 Feiyang1 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed comments. PTAL.

"pkg-b": "1.0.1"
},
peerDependencies: {
"pkg-b": "^1.0.1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm always a little bit when it comes to how changesets handle peer dependencies, but I have thought that updating a peer dependency with a patch release shouldn't bump this? Or it just bumps the range but doesn't bump the major of the dependent package (pkg-a here)?

@Feiyang1 Feiyang1 Jul 30, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct. Patch bump to a peerDependency doesn't bump the major of the dependent package. See here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

An offtopic observation - the linked line looks suspicious. What if nextRelease.type === 'none'? This might be worth investigating.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm, that seems like a possibility. I might look into it when I get time and create an issue if I can reproduce. I will leave it in this PR though.

@Feiyang1

Feiyang1 commented Aug 6, 2020

Copy link
Copy Markdown
Contributor Author

@Andarist gentle ping

@Feiyang1

Copy link
Copy Markdown
Contributor Author

@Andarist Sorry for the extremely slow response. Can you please take another look?

@Andarist
Andarist merged commit d531dbd into changesets:master Aug 27, 2020
@github-actions github-actions Bot mentioned this pull request Aug 27, 2020
@Feiyang1
Feiyang1 deleted the fei-multi-dep-fix branch August 28, 2020 17:41
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.

Dependency declared in multiple dependency arrays (e.g. in both peerDeps and devDeps) with different version range is not updated correctly

2 participants