Open MrPetovan opened 6 years ago
This is not possible because it's the Solver SAT of the Composer that is responsible to resolve the dependencies, and that the bower-asset/
and npm-asset/
are 2 different vendors.
I believe this is a different question, here the vendors are the same for both sides of the satisfy
config clause.
Did you try the resolution section?
I saw it but I don't think it is relevant to my problem.
Expanded explanation:
npm-asset/jquery:^1
and it is sitting in vendor/asset/jquery
.bower-asset
package with a dependency on jQuery 2, a simple require will import bower-asset:jquery:^2
and overwrite vendor/asset/jquery
.bower-asset/jquery-2.x
as it is possible. The library is correctly copied in vendor/asset/jquery-2.x
.bower-asset
package depending on bower-asset/jquery:^2
won't recognize bower-asset/jquery-2.x
as a met dependency and carry on with importing bower-asset/jquery:^2
with the above side-effect.Ok, I understand better now. I think this may be possible to turn each dependency into another dependency with a map for the conversion. But this map will only be available for the Composer root package.
But this map will only be available for the Composer root package.
What does this mean? Let's take an example:
composer.json:
{
"require": {
"fxp/composer-asset-plugin": "~1.3",
"npm-asset/jquery": "^1",
"bower-asset/jquery-2.x": "^2",
"bower-asset/example": "*",
},
"config": {
"fxp-asset": {
"installer-paths": {
"npm-asset-library": "vendor/asset",
"bower-asset-library": "vendor/asset"
},
"satisfies": {
"bower-asset/jquery-2.x": "bower-asset/jquery"
}
}
},
}
bower-asset/example
requires bower-asset/jquery
, is it considered as "available for the Composer root package"?bower-asset/example
requires bower-asset/example2
that requires bower-asset/jquery
, is it considered as "available for the Composer root package"?Because the config section is only available for the Composer root package. The config
section of Composer package is doesn't used if the package is installed in the dependencies. So, you cannot define the map in the library, for this map to be used in the project (root package).
So, would I be able to require bower-asset/example
without importing bower-asset/jquery
in the above example?
Yes, of course.
Ok, I was just making sure. Thank you so much for the answers!
Related to #311
Since https://github.com/friendica/friendica already has the
npm-asset/jquery:^1.11.4
dependency and we are using the same asset directory for both repositories, I tried importingbower-asset/jquery-2.x
to satisfy a new Bower dependency.However, Bower went on and still installed
bower-asset/jquery:^3.3
which overwrote/vendor/asset-folder/jquery
.How can I direct bower to use the versioned dependency for subsequent imports?
It could look something like: