Migrate composer/semver to TypeScript

D Converted · version 3.4.4

composer/semver 3.4.4 is a PHP package released under the MIT license and requires PHP ^5.3.2 || ^7.0 || ^8.0. Pext migrates it to TypeScript; on Node.js, 30 of 77 PHPUnit tests pass (38.9%), with 9 failures and 38 errors. It has no tracked dependencies, and 9 tracked packages depend on it.

Version comparison library that offers utilities, version constraint parsing and validation.

ConvertsYes
Runs on Node.jsYes
Runs on BunNot yet measured
TypeScript typesNot emitted

PHPUnit results on Node.js

38.9% of 77 tests passing (30 passed, 9 failed, 38 errors, 0 skipped). Verified 2026-10-21.

Where tests fail

The 5 test classes with the most failing tests on Node.js:

Test classFailing tests
VersionParserTest15
MultiConstraintTest9
ConstraintTest8
ComparatorTest4
SemverTest3

The remaining 8 failing tests are spread across other classes.

What “Converted” means

Converts cleanly to TypeScript. Test verification is pending or still climbing.

Requirements

PHP
^5.3.2 || ^7.0 || ^8.0
Extensions
None declared

As declared in the package's Composer metadata. Pext provides PHP extensions through its runtime modules.

Dependencies

No tracked dependencies.

Used by

More from composer

Upstream

Version
3.4.4
License
MIT
Keywords
semver, semantic, versioning, validation

Migrating a codebase that uses composer/semver?

See how Pext migrates a real PHP application, its Composer dependencies and its test suite to TypeScript.