Composer not updating package (grabbing it from repo.magento.com instead of packagist) [closed]
-
02-10-2020 - |
Question
My package (https://packagist.org/packages/limesharp/stockists) is not getting updated when running composer update (it's currently stuck at 1.0.5 instead of grabbing 1.0.11).
On a closer look at the composer.lock file I see that the repo url is repo.magento.com
instead of packagist. (https://repo.magento.com/archives/limesharp/stockists/limesharp-stockists-1.0.5.0.zip).
I don't understand why is that, maybe because I submitted a version to the marketplace and the first url composer checks is https://repo.magento.com/ and then the packagist repo.
If that is the case, can something be done about it? Can you update the https://repo.magento.com/ without submitting the extension to the marketplace every time a bug is fixed (takes days to be approved).
Solution
Composer will always check Packagist as last and thus repo.magento.com will be checked before Packagist.
You could add the GitHub URL of your package above the Magento repository in your "repositories"
section of your project's composer.json
:
{
"require": {
"magento/product-community-edition": "~2.1.0",
"limesharp/stockists": "~1.0.11"
}
"repositories": [
{
"type": "git",
"url": "https://github.com/ClaudiuCreanga/magento2-store-locator-stockists-extension.git"
},
{
"type": "composer",
"url": "https://repo.magento.com/"
}
]
}
This way, the direct GitHub URL will be checked first, then repo.magento.com and then Packagist.
P.S. Defining "repositories"
is not possible in any package (not only on Magento Marketplace), see the Composer documentation on the repositories property, it states it is root only, so only allowed in your project's composer.json
. If you do define repositories in your package' composer.json
it will be ignored.