-
Notifications
You must be signed in to change notification settings - Fork 492
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
[BUG] 7.3 breaks lower bound calculation for v0 versions #323
Comments
Ah, this is because it's converting If I remember correctly, this fixed a bug that was preventing subset and intersects from working properly in some cases. I think the best answer here is to just throw out any That being said, relying on getting exactly two comparators in a simple range set is not reliable, and never was! That does not tell you the lower bound, and never could have, even for relatively simple ranges that are in use in production. It only worked by accident, and only in very restricted use cases. The specific comparators generated from a given range should be considered an internal implementation detail. That |
Comparator sets cleaned up a bit further in #324 Since it's not (and has never been) guaranteed that the first comparator in a range set will reflect the lower bound, maybe it'd be worthwhile to add a method to give you the lower bound of a range? What are you using this for? |
I'm not the developer, but I believe the library is relying on the lower bound to see if the lower bound is greater than all of the possible versions for a given semver range. This is the relevant line of code. Essentially they're taking a range, getting the lower bound, and then checking that against another range. The library was relying on the lower bound of the range @gantoine would you mind clarifying if this isn't accurate? |
Yeah, so if you have a range like So that line in flow-typed is fundamentally broken. I'll add upper/lower bound methods and send a PR once that's landed. |
That code is well before my time, so your assessment of it is as good as mine. 🤷♂️ From the looks of it that chunk of code is indeed trying to compare the lower bound of a range to another range. Since |
This should be tested on create-near-app CI anyway and currently was failing CLI because of semver bullshit npm/node-semver#323
The new
v7.3
releases modify the lower bound calculation for version identifiers beginning withv0
. Previously, thev7.2
release would report0.0.0
as the lower bound.v7.3
now returnsSymbol('SemVer ANY')
in place of the expectedSemVer
result object.This behavior seems like it was intentional, but I do admit it's a bit ironic to see such a breaking change in a minor version of the package that's literally about semantic versioning :)
If this change is intentional, and there won't be a new minor/patch version to correct the behavior, please let me know so that I can send in a PR to a library that's experiencing a crash due to this change.
The text was updated successfully, but these errors were encountered: