Skip to content

chore(setup-packages): replace semver with std-semver#2026

Merged
SBoudrias merged 2 commits intomainfrom
emdash/semver-315
Mar 10, 2026
Merged

chore(setup-packages): replace semver with std-semver#2026
SBoudrias merged 2 commits intomainfrom
emdash/semver-315

Conversation

@SBoudrias
Copy link
Owner

@SBoudrias SBoudrias commented Mar 9, 2026

Summary

  • Replaces the semver npm package (and its @types/semver dev dependency) with std-semver, an npm port of the Deno standard library @std/semver
  • Removes the need for a separate @types/ package since std-semver ships its own types
  • Uses tryParseRange to parse the engines range string (e.g. ">=23.5.0 || ^22.13.0") and extracts the first Comparator (which extends SemVer) directly — no regex or local coerce helper needed

Commands run

yarn install
yarn tsc

CI note

The Compile job failure is a pre-existing issue unrelated to this PR — a Turborepo cyclic dependency detection between @inquirer/testing and the prompt packages. The same failure appears on other branches (e.g. the dependabot linting PR) opened before this one.

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.
@SBoudrias SBoudrias marked this pull request as ready for review March 10, 2026 01:58
@SBoudrias SBoudrias merged commit f9a3adb into main Mar 10, 2026
8 of 9 checks passed
@SBoudrias SBoudrias deleted the emdash/semver-315 branch March 10, 2026 01:58
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.

1 participant