symplify
symplify copied to clipboard
Repositories path merged to global composer.json wrongly
HI, I have the following setup
- src\libs\library_one\src\composer.json
{
"name": "xxx/library_one",
"type": "library",
"require": {
"php": "^7.4"
},
"autoload": {
"psr-4": {
"XXX\\LibraryOne\\": "src"
}
},
"minimum-stability": "stable"
}
- src\apps\app_one\src\composer.json
{
"name": "xxx/app_one",
"require": {
"php": "^7.4",
"xxx/library_one": "self.version"
},
"autoload": {
"psr-4": {
"XXX\\AppOne\\": "src"
}
},
"repositories": [
{
"type": "path",
"url": "../../../src/libs/*/"
}
],
"minimum-stability": "stable"
}
After running cmd php vendor/bin/monorepo-builder merge
the global composer.json was updated as follows, notice that the repository paths have been copied exactly which is not valid when in root folder. Fyi, app_one is working fine when I did composer install within the app folder and execute its code but when I do composer install in root folder which contains the global composer.json it failed due to the path not being valid.
Please let me know if I am doing something wrong or if it is a bug. Thank you.
- composer.json
{
"require": {
"php": "^7.4"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"symplify/monorepo-builder": "^11.1"
},
"autoload": {
"psr-4": {
"XXX\\AppOne\\": "src/apps/app_one/src",
"XXX\\LibraryOne\\": "src/libs/library_one/src"
}
},
"repositories": [
{
"type": "path",
"url": "../../../src/libs/*/" <<<< The correct path should be `src/libs/*/`
}
],
"replace": {
"xxx/app_one": "self.version",
"xxx/library_one": "self.version"
},
"minimum-stability": "stable"
}
Hi, thanks for reporting.
There is a similar service to handle this for paths in PSR-4 → autoload the same way. Could you send a fix with for repositories → url?
Not sure, can you point me the exact file location that the fix needs to be applied.
I'm not sure, but should be some service responsible for merging. Similar place where the PSR-4 paths are decorated.
I have created the decorator but could not find how it can be called along with the other decorators. Could you tell me in which file it should be?
Kind reminder