Skip to content

fix: prerelease identifier starting with digits #781

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

Merged
merged 2 commits into from
May 8, 2025

Conversation

mbtools
Copy link
Contributor

@mbtools mbtools commented Apr 24, 2025

Closes #775

@wraithgar your suspicion was correct. The regex for the prerelease identifier was not precise enough. Changing the order of numeric and non-numeric parts fixes the issue. I reverted the change to inc function in semver.js. The tests still pass 😃

I added tests that check the exact result of parsing valid versions in particular the pre-release and build parts which was somehow missing. We might want to add edge cases here.

@mbtools
Copy link
Contributor Author

mbtools commented Apr 24, 2025

Looks like the lint errors are related to template, not this change

@mbtools mbtools marked this pull request as ready for review April 24, 2025 20:14
@mbtools mbtools requested a review from a team as a code owner April 24, 2025 20:14
@wraithgar
Copy link
Member

Thanks, good move using the re that's already being exported instead of trying to make a new one.

@wraithgar wraithgar changed the title fix: prerelease identifier fix: prerelease identifier starting with digits May 8, 2025
@wraithgar wraithgar merged commit c99f336 into npm:main May 8, 2025
29 of 30 checks passed
@github-actions github-actions bot mentioned this pull request May 8, 2025
@mbtools mbtools deleted the prerelease-identifier branch May 8, 2025 18:52
owlstronaut pushed a commit that referenced this pull request May 12, 2025
🤖 I have created a release *beep* *boop*
---


## [7.7.2](v7.7.1...v7.7.2)
(2025-05-12)
### Bug Fixes
*
[`fcafb61`](fcafb61)
[#780](#780) add missing `'use
strict'` directives (#780) (@Fdawgs)
*
[`c99f336`](c99f336)
[#781](#781) prerelease
identifier starting with digits (#781) (@mbtools)
### Chores
*
[`c760403`](c760403)
[#784](#784) template-oss-apply
for workflow permissions (#784) (@wraithgar)
*
[`2677f2a`](2677f2a)
[#778](#778) bump
@npmcli/template-oss from 4.23.6 to 4.24.3 (#778) (@dependabot[bot],
@npm-cli-bot)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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] Coercing version with prerelease identifier that starts with digits returns truncated identifier
2 participants