denoland / deno_std

The Deno Standard Library
https://jsr.io/@std
MIT License
2.83k stars 581 forks source link

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

Closed kt3k closed 5 days ago

kt3k commented 5 days ago

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");

  // ...
codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.