Does "version" in composer.json follow semantic versioning ?
MadCat34 opened this issue · comments
Hi,
Does "version" in composer.json follow semantic versioning ?
If yes, there is an error in https://getcomposer.org/doc/04-schema.md#version
Semantic versioning allows "pre-versions" like 1.0.0-beta.2.
But, examples in getcomposer.org are wrong
1.0.0
1.0.2
1.1.0
0.2.5
1.0.0-dev
1.0.0-alpha3 <== Here : with semantic versioning, it should be 1.0.0-alpha.3
1.0.0-beta2 <== Here : with semantic versioning, it should be 1.0.0-beta.2
1.0.0-RC5 <== Here : with semantic versioning, it should be 1.0.0-RC.5
v2.0.4-p1 <== Here : with semantic versioning, it should be 2.0.4-p.1
Or am I wrong ?
We do not follow semver strictly. We support a set of versions, most of which are semver, but also do support some more stuff, and some minor things of semver are not supported. Changing/fixing this is near impossible without breaking the ecosystem so that's life.
Note that composer does support putting a .
(or a -
) between the prerelease identifier and the number. So 1.0.0-alpha.3
also works.
However, semver allows any string as pre-release identifier while composer supports only a few ones.