chore(setup-packages): replace semver with std-semver#2026
Merged
Conversation
Replaces the `semver` npm package (and its `@types/semver` types) with `std-semver`, an npm port of the Deno standard library `@std/semver`. Since `std-semver` has no `coerce` function, a small local helper is added that extracts the first `X.Y.Z` from an engines range string and delegates to `tryParse`.
Replace the regex-based coerce helper with tryParseRange from std-semver, which parses an engines range string and yields a Comparator (which extends SemVer) directly — no manual extraction needed.
9c26707 to
264f5da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
semvernpm package (and its@types/semverdev dependency) withstd-semver, an npm port of the Deno standard library@std/semver@types/package sincestd-semverships its own typestryParseRangeto parse the engines range string (e.g.">=23.5.0 || ^22.13.0") and extracts the firstComparator(which extendsSemVer) directly — no regex or local coerce helper neededCommands run
CI note
The
Compilejob failure is a pre-existing issue unrelated to this PR — a Turborepo cyclic dependency detection between@inquirer/testingand the prompt packages. The same failure appears on other branches (e.g. the dependabot linting PR) opened before this one.