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

BREAKING(semver): make invalid SemVer constants private #5168

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jun 27, 2024

These values are mainly used for implementing (now removed) rangeMax and rangeMin. They represent invalid SemVers, and it doesn't make sense to expose them as constants (MIN is the only exception, though).

Context: These values were invented in the rewrite, #3385. They don't exist in the original npm:semver.

What's changed

@std/semver/constants module has been removed.

Motivation

Most of these values are invalid SemVers, so it's not reasonable to include them in the public API.

Migration

There are no migrations for ANY, INVALID, or MAX values, as they are not SemVers.

For MIN:

- import { MIN } from "@std/semver/constants";
+ import { parse } from "@std/semver/parse";

+ const MIN = parse("0.0.0");

  // ...

Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.34%. Comparing base (162e000) to head (059736a).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5168      +/-   ##
==========================================
+ Coverage   93.31%   93.34%   +0.02%     
==========================================
  Files         470      469       -1     
  Lines       37941    37938       -3     
  Branches     5388     5391       +3     
==========================================
+ Hits        35405    35413       +8     
+ Misses       2493     2482      -11     
  Partials       43       43              

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

@iuioiua iuioiua changed the title BREAKING(semver): make invalid semver constants private BREAKING(semver): make invalid SemVer constants private Jun 27, 2024
@kt3k kt3k merged commit 04b7229 into denoland:main Jun 27, 2024
19 checks passed
@kt3k kt3k deleted the remove-constants branch June 27, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants