Skip to content

fix: use semver dot separator for beta pre-release versions (beta-X → beta.X)#5764

Merged
mark-wiemer merged 6 commits intomainfrom
copilot/fix-beta-version-separator
Feb 21, 2026
Merged

fix: use semver dot separator for beta pre-release versions (beta-X → beta.X)#5764
mark-wiemer merged 6 commits intomainfrom
copilot/fix-beta-version-separator

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 21, 2026

  • Update package.json version from 12.0.0-beta-10 to 12.0.0-beta.10
  • Update package-lock.json version (via npm install --package-lock-only with npm 10)
  • Update .github/release-please/manifest.json so release-please proposes 12.0.0-beta.11 next
  • Update CHANGELOG.md current entry header to use dot notation
  • Update MAINTAINERS.md — fix beta example, add blockquote warning about dot-vs-dash for future maintainers, fix RC example from rc-1 to rc.1
Original prompt

This section details on the original issue you should resolve

<issue_title>🐛 Bug: beta versions should use semver-style dot numeric separator (instead of dash)</issue_title>
<issue_description>### Bug Report Checklist

  • I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
  • I have searched for related issues and issues with the faq label, but none matched my issue.
  • I have 'smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, my usage of Mocha, or Mocha itself.
  • I want to provide a PR to resolve this

Expected

Using caret with a beta version should pick up newer beta.

Actual

12.0.0-beta-10 is NOT matched by "^12.0.0-beta-9 (or even "^12.0.0-beta-10" 🤯 )

Minimal, Complete and Verifiable Example

mkdir semver-behavior
cd semver-behavior
npm init -y
npm pkg set type=module
npm i semver
echo "import { gt } from 'semver'; console.log('12.0.0-beta-10 > 12.0.0-beta-9', gt('12.0.0-beta-10', '12.0.0-beta-9')); console.log('12.0.0-beta.10 > 12.0.0-beta.9', gt('12.0.0-beta.10', '12.0.0-beta.9'));" > main.js
node main.js

prints:

12.0.0-beta-10 > 12.0.0-beta-9 false
12.0.0-beta.10 > 12.0.0-beta.9 true

Versions

12.0.0-beta-*

Additional Info

semver, which is used by npm and many other packages, treats - differently from .

I believe it treats dot as a separator, parsing the numeric digits after it as a number, while it treats the dash as regular alphabet, sorting 10 before 9.

Neat one, isn't it?</issue_description>

<agent_instructions>use npm 10. make sure the next release proposed by release-please is 12.0.0-beta.11</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Feb 21, 2026

CLA Not Signed

@mark-wiemer
Copy link
Copy Markdown
Member

@copilot also update MAINTAINERS.md to track this for the future

Co-authored-by: mark-wiemer <7833360+mark-wiemer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix beta versions to use semver-style dot separator fix: use semver dot separator for beta pre-release versions (beta-X → beta.X) Feb 21, 2026
Copilot AI requested a review from mark-wiemer February 21, 2026 12:57
Co-authored-by: mark-wiemer <7833360+mark-wiemer@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 21, 2026

@copilot also update MAINTAINERS.md to track this for the future

Done in b383700. Added a blockquote warning explaining that dot . must be used as the separator (not dash -) due to semver numeric ordering, and also fixed the RC transition example from rc-1 to rc.1 for consistency.

Comment thread CHANGELOG.md Outdated
@mark-wiemer mark-wiemer marked this pull request as ready for review February 21, 2026 13:01
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.84%. Comparing base (3481b1e) to head (4978819).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5764   +/-   ##
=======================================
  Coverage   88.84%   88.84%           
=======================================
  Files          66       66           
  Lines        4771     4771           
  Branches      976      976           
=======================================
  Hits         4239     4239           
  Misses        532      532           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mark-wiemer mark-wiemer merged commit 5574738 into main Feb 21, 2026
14 of 16 checks passed
@mark-wiemer mark-wiemer deleted the copilot/fix-beta-version-separator branch February 21, 2026 13:22
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.

🐛 Bug: beta versions should use semver-style dot numeric separator (instead of dash)

2 participants