-
Notifications
You must be signed in to change notification settings - Fork 624
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
deprecation(semver): rename isSemVerComparator()
#3957
deprecation(semver): rename isSemVerComparator()
#3957
Conversation
isSemVerRange()
and isSemVerComparator()
Co-authored-by: Asher Gomez <[email protected]>
Co-authored-by: Asher Gomez <[email protected]>
Co-authored-by: Asher Gomez <[email protected]>
@iuioiua Before merging: There is also an opportunity to simplify before export interface Range {
// The outer array is OR while each inner array is AND
ranges: SemVerRangeOr;
} after // The outer array is OR while each inner array is AND
export type Range = Comparator[][]; WDYT? |
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.
Sorry, I missed a couple of nits.
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.
Sorry, I missed a couple of nits.
No problem.
What is your opinion on this? |
Actually, looking into Range a bit more, it seems that the current implementation is kinda strange. |
Yeah, it is strange. I see repeated use of |
How about we redefine Range to |
The first solution sounds better. But maybe worth doing in another PR. |
The more I investigate about the Range implementation, the more am I convinced that the two renames
are misleading. Their actual definition of SemVerRange is not a single Range but an array of Ranges. Some of the function names for Range are now used for Ranges. As a solution, we could rename these to
WDYT? Please do not merge until this fundamental problem is solved. |
Are you able to open a new issue focusing on this weird nested range design? There may be a reason (or there may not be) for this design decision. Either way, let's proceed with this PR as it focuses on removing the |
@iuioiua I have opened an issue on this. This misnomer is also present in the npm semver. Even the bnf file in node-semver calls it Would you be ok if I reduced this PR to
so it can be merged? |
Yep, let's reduce the PR 👍🏾 |
isSemVerRange()
and isSemVerComparator()
isSemVerComparator()
done |
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.
LGTM! Thanks! Let's see what Yoshiya thinks.
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.
LGTM
renames
SemVerComparator
=>Comparator
isSemVerComparator()
=>isComparator()
isSemVerRange()
=>isRange()
SemVerRange
=>Range
All old functions and interfaces are deprecated.