inpsyde / modularity

A PSR-11 implementation for WordPress Plugins, Themes or Libraries.
https://inpsyde.github.io/modularity/
GNU General Public License v2.0
44 stars 4 forks source link

Add branch alias #3

Closed gmazzap closed 3 years ago

gmazzap commented 3 years ago

Non-code improvement.

It is not possible to obtain an installable set of packages if one or more packages references modularity with dev-master while other packages with ^1 or equivalent.

It is possible to resolve modularity even if some packages requirs it with dev-master while other packages with ^1 or equivalent.

No.

Branch aliases in Composer are a very powerful tool.

Right now inpsyde/modularity:dev-master and inpsyde/modularity:1.0.0 refer to the exact same code. Still, if a package requires it with dev-master and another with ^1 Composer will say it is not possible to resolve an installable set of packages. The reason is simple: Composer can't compare dev-master with ^1 , because dev-master is not numeric and Composer has no idea what code it contains.

Thanks to branch aliases we can instruct Composer that what's in master branch is a "development version" comparable with 1.x and thanks to that Composer will be able to solve the puzzle.

Please note that because the alias is always for a "dev" version, when the "minimum stability" root config will be "stable" Composer will not pull the dev-master, no matter the branch alias, and that save us from the risk of having unreleased things in production (because we have "minimum stability" to stable in production, right?)