Shared patches for Rector packages, for easier re-use.
This meta package makes use of cweagans/composer-patches.
The composer patches packages does not work as intuitively as you max expect. Yet, there is a combination, that clicks :)
The external patch file works only for main rector/rector-src
repository. It cannot be used e.g. for dev packages that depend on `rector/rector-src
🔴
The patches must be defined in rector/rector-src
in composer.json
:
{
"extra": {
"patches": {
"package-name": [
"https://raw.github.com/.../patches/some.patch"
]
}
}
}
- The path to patch file must be absolute. Relative path fails when using
rector/rector-src
as dependency, as thecomposer.json
is nested there
The patch must be added to this repository in /patches
directory.
The dependency package (e.g. rector/rector-symfony) must allow to install patches from rector/rector-src
in the package composer.json
:
{
"require-dev": {
"symplify/vendor-patches": "^10.0"
},
"extra": {
"enable-patching": true
}
}
It also must require symplify/vendor-patches package
, to invoke the plugin on composer install
.
This is the setup that works ✔️