davidrjonas / composer-lock-diff

See what has changed after a composer update
MIT License
274 stars 18 forks source link

Fix the detection of dev versions for semver branches #34

Closed stof closed 2 years ago

stof commented 2 years ago

Versions like 4.4.x-dev are versions for branches, that are not prefixes with dev-.

This condition is similar to the one used in composer/semver: https://github.com/composer/semver/blob/a951f614bd64dcd26137bc9b7b2637ddcfc57649/src/VersionParser.php#L56

davidrjonas commented 2 years ago

Thanks, I'll get that released.

For posterity,

https://getcomposer.org/doc/articles/versions.md#branches

To get Composer to check out one of these branches, you must specify a version constraint that looks like this: v1.x-dev. The .x is an arbitrary string that Composer requires to tell it that we're talking about the v1 branch and not a v1 tag (alternatively, you can name the branch v1.x instead of v1). In the case of a branch with a version-like name (v1, in this case), you append -dev as a suffix, rather than using dev- as a prefix.

https://getcomposer.org/doc/articles/versions.md#stabilities

In addition to that Composer automatically adds a -dev suffix to all numeric branches and prefixes all other branches imported from a VCS repository with dev-.

stof commented 2 years ago

@davidrjonas it would be great if you could also enable auto-updates on packagist, by configuring the github webhook integration.