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

[bug] diff("1.7.2-1", "1.8.1") returns patch, not minor #606

Closed
1 task done
erikjalevik opened this issue Jul 28, 2023 · 1 comment · Fixed by #755
Closed
1 task done

[bug] diff("1.7.2-1", "1.8.1") returns patch, not minor #606

erikjalevik opened this issue Jul 28, 2023 · 1 comment · Fixed by #755
Labels
Bug thing that needs fixing

Comments

@erikjalevik
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

diff("1.7.2-1", "1.8.1") returns "patch".

Expected Behavior

I would have expected it to return "minor" since we're moving from 1.7 to 1.8.

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...

Environment

  • npm:
  • Node:
  • OS:
  • platform:
@erikjalevik erikjalevik added Bug thing that needs fixing Needs Triage needs an initial review labels Jul 28, 2023
@erikjalevik erikjalevik changed the title Why is diff("1.7.2-1", "1.8.1") "patch"? [QUESTION] Why is diff("1.7.2-1", "1.8.1") "patch"? Jul 28, 2023
@wraithgar wraithgar removed the Needs Triage needs an initial review label Jan 25, 2024
@wraithgar wraithgar changed the title [QUESTION] Why is diff("1.7.2-1", "1.8.1") "patch"? [bug] diff("1.7.2-1", "1.8.1") returns patch, not minor Jan 25, 2024
@wraithgar
Copy link
Member

> Semver.inc('1.7.2-1', 'patch')
'1.7.2'
> Semver.inc('1.7.2-1', 'minor')
'1.8.0'
> Semver.diff("1.7.2", "1.8.1")
'minor'

wraithgar pushed a commit that referenced this issue Jan 29, 2025
Refactored version diff logic to handle transitions from prerelease
versions to stable versions correctly for major/minor/patch version
bumps.

Closes #606

---------

Co-authored-by: berkay.daglar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants