Download the PHP package typisttech/composer-semver without Composer
On this page you can find all versions of the php package typisttech/composer-semver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download typisttech/composer-semver
More information about typisttech/composer-semver
Files in typisttech/composer-semver
Package composer-semver
Short Description Static linked CLI wrapper for composer/semver. Parsing and validating versions exactly like Composer does without installing PHP.
License MIT
Homepage https://github.com/typisttech/composer-semver
Informations about the package composer-semver
Static linked CLI wrapper for composer/semver.
Parsing and validating versions exactly like Composer does without installing PHP.
Built with ♥ by Typist Tech
Usage
Normalize Versions
Normalizes a version string to be able to perform comparisons on it.
This is a wrapper of the Composer\Semver\VersionParser::normalize() method.
Parse Constraints
Parses a constraint string and strip its ignorable parts.
This is a wrapper of the Composer\Semver\VersionParser::parseConstraints() method.
Print Bundled PHP and composer/semver Versions
Dump Shell Completion Scripts
For shell completions, follow the instructions from:
If you installed Composer SemVer via Homebrew, completion scripts are managed by Homebrew.
Read more at https://docs.brew.sh/Shell-Completion
[!TIP] Hire Tang Rufus!
I am looking for my next role, freelance or full-time. If you find this tool useful, I can build you more weird stuff like this. Let's talk if you are hiring PHP / Ruby / Go developers.
Contact me at https://typist.tech/contact/
Why
Which version numbering system does Composer itself use?
Composer uses Semantic Versioning (aka SemVer) 2.0.0.
-- Composer FAQ
Under the hood, Composer uses composer/semver to parse and validate versions.
Despite the lie on Composer FAQ, the fragmentary documentation, and the deceitful package name composer/semver,
Composer implements only a subset of Semantic Versioning specification while supports some uncommon versioning schemes.
Working with Composer packages versions without composer/semver is a bit tricky.
"A bit tricky" is an understatement.
| Version | Validity |
|---|---|
1.2.3 |
:white_check_mark: Valid. |
1.2.3.4 |
:white_check_mark: Valid. But not SemVer compliant. |
1.0.0-a |
:white_check_mark: Valid. |
1.0.0-b |
:white_check_mark: Valid. |
1.0.0-c |
:x: Invalid. But SemVer compliant. Composer only accepts a limited sets of pre-release versions. |
99999 |
:white_check_mark: Valid. Composer normalize it to 99999.0.0.0. |
100000.0.0 |
:white_check_mark: Valid |
100000.0.0.0 |
:x: Invalid. Starting from 100000, Composer treats it as CalVer which cannot have 4 bits. |
2010-01-02 |
:white_check_mark: Valid. |
2010-01-02-10-20-30.5 |
:white_check_mark: Valid. |
20100102-203040 |
:white_check_mark: Valid. |
20100102.0.3.4 |
:x: Invalid. CalVer cannot have 4 bits. |
2023013.0.0 |
:x: Invalid. YYYYMMD is a bad CalVer major version. |
202301311.0.0 |
:x: Invalid. YYYYMMDDh is a bad CalVer major version. |
20230131000.0.0 |
:x: Invalid.YYYYMMDDhhm is a bad CalVer major version. |
2023013100000.0.0 |
:x: Invalid. YYYYMMDDhhmmX is a bad CalVer major version. |
000.001.003.004 |
:white_check_mark: Valid. Composer normalizes it to 000.001.003.004. The leading zeros are significant and cannot be ignored. |
0700 |
:white_check_mark: Valid. Composer normalizes it to 0700.0.0.0. The leading zero is significant and cannot be ignored. |
1.00.000 |
:white_check_mark: Valid. Composer normalizes it to 1.00.000.0. All the zeroes are significant and cannot be ignored. |
Composer SemVer wraps composer/semver and the PHP runtime as a static linked CLI tool,
so you can work with the package versions exactly like Composer does without installing PHP.
[!TIP] Hire Tang Rufus!
There is no need to understand any of these quirks. Let me handle them for you. I am seeking my next job, freelance or full-time.
If you are hiring PHP / Ruby / Go developers, contact me at https://typist.tech/contact/
Installation
Homebrew (macOS / Linux) (Recommended)
apt-get (Debian based distributions, for example: Ubuntu)
Instead of the automatic setup script, you can manually configure the repository with the instructions on Cloudsmith.
Manual .deb (Debian based distributions, for example: Ubuntu)
[!WARNING] If you install the
.debfile manually, you have to take care of updating it by yourself.
Download the latest .deb file from GitHub Releases, or via gh:
Optionally, verify the .deb file:
Finally, install the package:
Manual Binary
[!WARNING] If you install the binary manually, you have to take care of updating it by yourself.
Download the latest .tar.gz file from GitHub Releases, or via gh:
Optionally, verify the .tar.gz file:
Finally, unarchive and move the binary into $PATH:
Alternatives
- ComVer
A failed attempt to re-implementcomposer/semverin Go. It only supports a subset of Composer versioning.
Credits
Composer SemVer is a Typist Tech project and maintained by Tang Rufus, freelance developer for hire.
Full list of contributors can be found on GitHub.
Copyright and License
This project is a free software distributed under the terms of the MIT license. For the full license, see LICENSE.
Contribute
Feedbacks / bug reports / pull requests are welcome.
All versions of composer-semver with dependencies
composer-runtime-api Version ^2.2
composer/semver Version ^3.4
symfony/console Version ^7.3
symfony/polyfill-iconv Version ^1.33