I\'ve recently come across the change in composer meaning that the default minimum-stability
is stable
, and rather than set this to dev
The answer is: Tags. Your may also use Alias, if you don't want to use tags. But it's worth to mention, that you should only mark your packages as stable, when they are stable and not to make others believe they are.
Update: One more link: Stability
dev-master
*@stable
It's sometimes useful, especially during an audit, to grab latest versions of your requirements, that's why I made a composer package that make stable all your dependencies : Composer Stable Versions (https://github.com/MaximeCulea/Composer-Stable-Versions).
Using this command, your dependencies into composer.json will be automatically be changed from:
"wpackagist-plugin/wordpress-seo":"6.2"
into:
"wpackagist-plugin/wordpress-seo":"*@stable"
If afterwards you plan doing the reverse thing to grab latest versions of your composer.lock which you tested your site against, especially useful while making a site live, have a look to an other of my composer command : Composer Freeze Versions (https://github.com/MaximeCulea/Composer-Freeze-Versions).
Using this command, your dependencies into composer.json will be automatically be locked:
"wpackagist-plugin/wordpress-seo":"@stable"
into:
"wpackagist-plugin/wordpress-seo":"6.2"
Hope it helps.
Elaborating on KingCrunch's answer, since this was not immediately obvious to me.
From https://getcomposer.org/doc/02-libraries.md#specifying-the-version
When you publish your package on Packagist, it is able to infer the version from the VCS (git, svn, hg) information. This means you don't have to explicitly declare it.
This is very easy with Github: https://help.github.com/articles/working-with-tags/
Furthermore:
If you are creating packages by hand and really have to specify it explicitly, you can just add a version field:
{ "version": "1.0.0" }
If you don't get your package from a github or a similar repository, but rather for example from the local path, "path" type, you have to have the version explicitly defined in the 'composer.json' file, it won't figure it out from the local git tags. Also, such a package will be installed only if it does not exist on the packagist, github and therefore it might be needed to be temporarily renamed if it exists in the local path composer.json "name" field, to something else.