GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: preserve pre-release and build parts of a version on coerce (#592) by madtisa · Pull Request #671 · npm/node-semver

Conversation

@madtisa

@madtisa madtisa commented Dec 21, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What / Why

Introduces the new coerce option includePrerelease, if set, allowing to preserve pre-release and build parts of a version.

References

Fixes #592
Fixes #357

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@madtisa
madtisa requested a review from a team as a code owner December 21, 2023 23:53
@madtisa madtisa mentioned this pull request Dec 21, 2023
Support updating mods with pre-release versions Nexus-Mods/Vortex#15044
Closed
madtisa
feat: preserve pre-release and build parts of a version on coerce (np…
86535f0
…m#592)

Introduces the new coerce option `full`, if set, allowing to preserve
pre-release and build parts of a version.
@madtisa
madtisa force-pushed the f/support-coercing-prerelease branch from 7c9a156 to 86535f0 Compare December 22, 2023 00:07
@wraithgar

wraithgar commented Jan 3, 2024

Copy link
Copy Markdown
Contributor

Should this be using includePrerelease instead?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@madtisa

madtisa commented Jan 4, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Should this be using includePrerelease instead?

Isn't that option have different meaning: to compare without taking prerelease versions into account? I can change it, if it won't cause confusion

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@madtisa

madtisa commented Jan 4, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

It also includes build part

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wraithgar

wraithgar commented Jan 4, 2024

Copy link
Copy Markdown
Contributor

No it's the opposite. If true, includePrerelease means to include the prereelase portion when doing comparisons. The default is false.

It seems to make sense to extend this boolean to also include the coercion function. What we want to avoid is adding a new single-use boolean with an extremely generic name like "full".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@madtisa
Change option name to includePrerelease
5f425d7
@madtisa

madtisa commented Jan 4, 2024

Copy link
Copy Markdown
Contributor Author

No it's the opposite. If true, includePrerelease means to include the prereelase portion when doing comparisons. The default is false.

It seems to make sense to extend this boolean to also include the coercion function. What we want to avoid is adding a new single-use boolean with an extremely generic name like "full".

Yeah, I meant the opposite (despite what I wrote). I understand the point about name is too generic 👌

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

wraithgar
wraithgar reviewed Jan 4, 2024
View reviewed changes
Comment thread functions/coerce.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

madtisa added 2 commits January 4, 2024 19:41
@madtisa
Fix line too long
3b5c580
@madtisa
Fix line too long
4a2d45f
wraithgar
wraithgar reviewed Jan 4, 2024
View reviewed changes
Comment thread internal/re.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@madtisa
Remove redundant comma
e735962
@wraithgar

wraithgar commented Jan 4, 2024

Copy link
Copy Markdown
Contributor

This is looking really good, heading in the right direction. Just some regex cleanup and an erroneous comment change. The actual implementation in functions/coerce.js is really good, much easier to read with the parts broken up like that.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@madtisa
Extract duplicate coerce regex part to separate token
b3bba18
@madtisa

madtisa commented Jan 4, 2024

Copy link
Copy Markdown
Contributor Author

It's done, should I squash (rebase) everything into one commit at the end?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wraithgar

wraithgar commented Jan 4, 2024

Copy link
Copy Markdown
Contributor

It's done, should I squash (rebase) everything into one commit at the end?

You don't have to, I will squash this when I merge it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@madtisa
Correct comment about includePrerelease usage
0bcf798
wraithgar
wraithgar reviewed Jan 4, 2024
View reviewed changes
Comment thread test/functions/coerce.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@wraithgar wraithgar self-assigned this Jan 4, 2024
@madtisa
Fix comparing versions with builds
0fceca5
wraithgar
wraithgar reviewed Jan 4, 2024
View reviewed changes
Comment thread test/functions/coerce.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@wraithgar

wraithgar commented Jan 4, 2024

Copy link
Copy Markdown
Contributor

Thanks for your patience and responses getting this PR ready. This module is one of the most highly downloaded packages on the entire registry and we try to be careful and purposeful when making changes. We're definitely on the right track here and I think this is something that will be able to land soon.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

madtisa
Fix coerce token creation
5e34030
@madtisa

madtisa commented Jan 4, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Okay, linted and tested locally, so everything should be alright.

I'm still nervous about option name includePrerelease, since it passed all the way to SemVer instance, and it has different meaning there: https://github.com/madtisa/node-semver/blob/5c8efbcb3c6c125af10746d054faff13e8c33fbd/classes/semver.js#L31C1-L32C59.
I would also elevate this change as breaking due to probability this option had been already used with intent that doesn't include parsing prerelease and build parts of a version

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wraithgar

wraithgar commented Jan 4, 2024

Copy link
Copy Markdown
Contributor

We have been the lack of including includePrerelease in a function as a bug, fixing it is not a breaking change. We can leave this PR open for a bit to see if others agree or disagree.

There is still the one odd assertion in test/functions/coerce.js that asserts two different things joined by an || that seems off to me.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@madtisa

madtisa commented Jan 4, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

We have been the lack of including includePrerelease in a function as a bug, fixing it is not a breaking change. We can leave this PR open for a bit to see if others agree or disagree.

There is still the one odd assertion in test/functions/coerce.js that asserts two different things joined by an || that seems off to me.

Addressed this in conversation above: #671 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

madtisa
Increase version comparison readability
e3cecc0
@NOUIY NOUIY mentioned this pull request Aug 17, 2024
[Snyk] Upgrade semver from 7.3.7 to 7.6.3 NOUIY/npm-groovy-lint#83
Closed
@gregory567 gregory567 mentioned this pull request Aug 21, 2024
[Snyk] Upgrade semver from 7.5.2 to 7.6.3 gregory567/ContInt-backend#5
Open
@Bbjj88h Bbjj88h mentioned this pull request Aug 21, 2024
[Snyk] Upgrade semver from 7.5.4 to 7.6.3 Bbjj88h/setup-node#1
Open
@NOUIY NOUIY mentioned this pull request Aug 23, 2024
[Snyk] Upgrade semver from 7.3.8 to 7.6.3 NOUIY/security-wg#56
Closed
@rickybright rickybright mentioned this pull request Aug 29, 2024
[Snyk] Upgrade semver from 7.3.5 to 7.6.3 rickybright/juice-shop#6
Open
@NickyMartinez NickyMartinez mentioned this pull request Aug 30, 2024
[Snyk] Upgrade semver from 7.3.5 to 7.6.3 NickyMartinez/juice-shop#5
Open
@Mhmonicox Mhmonicox mentioned this pull request Sep 7, 2024
[Snyk] Upgrade: , , semver, typed-rest-client Mhmonicox/actions-setup-cmake#37
Open
@NOUIY NOUIY mentioned this pull request Sep 7, 2024
[Snyk] Upgrade: , , react, react-dom, semver, , , clsx, , , cross-fetch, file-loader, lunr, next, raw-loader, react-syntax-highlighter, url-loader NOUIY/layer0-docs#478
Open
@YoYBaBy YoYBaBy mentioned this pull request Sep 9, 2024
[Snyk] Upgrade semver from 7.3.2 to 7.6.3 YoYBaBy/nodejs.org#282
Open
@Exkaleburx Exkaleburx mentioned this pull request Sep 9, 2024
[Snyk] Upgrade: minimatch, semver Exkaleburx/vscode-languageserver-node#14
Open
@NOUIY NOUIY mentioned this pull request Sep 13, 2024
[Snyk] Upgrade: , , semver NOUIY/setup-java#213
Open
@Thompson1985 Thompson1985 mentioned this pull request Sep 13, 2024
[Snyk] Upgrade semver from 7.6.0 to 7.6.3 Thompson1985/vscode-eslint#3
Open
@snyk-io snyk-io Bot mentioned this pull request Sep 23, 2024
[Snyk] Upgrade: , , semver SherfeyInv/setup-python#1
Open
@m-heyda m-heyda mentioned this pull request Sep 24, 2024
[Snyk] Upgrade semver from 7.5.2 to 7.6.3 m-heyda/hain#35
Open
@marklacasse marklacasse mentioned this pull request Sep 26, 2024
[Snyk] Upgrade semver from 7.6.0 to 7.6.3 marklacasse/setup-dotnet#1
Open
@phoebeyusnyk phoebeyusnyk mentioned this pull request Sep 29, 2024
[Snyk] Upgrade semver from 7.3.5 to 7.6.3 phoebeyusnyk/juice-shop#4
Open
@tahmid198 tahmid198 mentioned this pull request Sep 30, 2024
[Snyk] Upgrade semver from 7.3.5 to 7.6.3 tahmid198/juice-shop#4
Open
@AeonArriving AeonArriving mentioned this pull request Sep 30, 2024
[Snyk] Upgrade semver from 7.3.8 to 7.6.3 AeonArriving/audit-ci#2
Open
@chambridge chambridge mentioned this pull request Oct 2, 2024
[Snyk] Upgrade semver from 7.6.0 to 7.6.3 RedHatInsights/ocp-advisor-frontend#803
Merged
@InfiniteLove2020 InfiniteLove2020 mentioned this pull request Oct 3, 2024
[Snyk] Upgrade semver from 7.3.2 to 7.6.3 InfiniteLove2020/nodejs.org#6
Open
@CASABECI CASABECI mentioned this pull request Oct 6, 2024
[Snyk] Upgrade semver from 7.6.0 to 7.6.3 CASABECI/setup-node#1
Open
@nerdy-tech-com-gitub nerdy-tech-com-gitub mentioned this pull request Oct 24, 2024
[Snyk] Upgrade semver from 6.3.1 to 7.6.3 nerdy-tech-com-gitub/toolkit#6
Open
@lkeff lkeff mentioned this pull request Oct 26, 2024
[Snyk] Upgrade semver from 7.5.4 to 7.6.3 lkeff/vscode-go#5
Open
@suculent suculent mentioned this pull request Oct 30, 2024
[Snyk] Upgrade semver from 7.5.3 to 7.6.3 suculent/thinx-device-api#484
Merged
@HaLaGu1L HaLaGu1L mentioned this pull request Nov 1, 2024
[Snyk] Upgrade semver from 7.5.2 to 7.6.3 HaLaGu1L/vscode#13
Open
@doperiddle doperiddle mentioned this pull request Nov 10, 2024
[Snyk] Upgrade semver from 7.3.2 to 7.6.3 doperiddle/paystring#6
Merged
@nickvadala-snyk nickvadala-snyk mentioned this pull request Nov 11, 2024
[Snyk] Upgrade semver from 7.3.5 to 7.6.3 nickvadala-snyk/juice-shop#4
Open
@coderabbitai coderabbitai Bot mentioned this pull request Apr 18, 2026
Refac bootstrap Jason2866/pioarduino-node-helpers#13
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Jul 21, 2026
fix(version): support from-git pnpm/pnpm#13203
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Aug 2, 2026
Resolve one dependency version across the full graph frostney/lwpt#134
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@wraithgar wraithgar Awaiting requested review from wraithgar
1 more reviewer
@lukekarrys lukekarrys lukekarrys approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@wraithgar wraithgar

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

coerce drops build and prerelease information [BUG] Filter version with prerelease tags

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@madtisa @wraithgar @ljharb @Tobbe @lukekarrys
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.