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(npm): Fix replace strategy edge-case for carets #9106
fix(npm): Fix replace strategy edge-case for carets #9106
Conversation
@zharinov can you use your normal account for future pr's. 😏 |
Sorry, I'm waiting for GitHub support addressing my issue with it |
🙈😅👍 |
lib/versioning/npm/index.spec.ts
Outdated
|
||
['^0.2.3', '0.2.4', '^0.2.4'], | ||
['^2.3.0', '2.4.0', '^2.4.0'], | ||
['^2.3.4', '2.4.5', '^2.4.0'], |
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.
These shouldn't really happen with replace
though, should they?
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.
Fixed, now it remains ^2.3.4
lib/versioning/npm/index.spec.ts
Outdated
['^0.0.1', '0.0.2', '^0.0.2'], | ||
['^1.0.1', '2.0.2', '^2.0.0'], | ||
['^1.2.3', '1.2.3', '^1.2.3'], | ||
['^1.2.3', '1.2.0', '^1.2.3'], |
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.
Not sure about this one?
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.
Well, it seems sometimes downgrades are desirable
expect(
poetry.getNewValue({
currentValue: '^1.0.0',
rangeStrategy: 'replace',
currentVersion: '1.0.0',
newVersion: '1.0.7',
})
).toEqual('^1.0.7'); Do we really need upgrade to |
Agreed, it should return the existing range of |
🎉 This PR is included in version 24.91.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes:
Re-implement new value update logic. It's more verbose, but it backward-compatible with current behavior while fixing its edge-cases.
Context:
Closes #4762
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: