Spea / SpBowerBundle

Symfony2 Bundle to handle asset dependencies with bower
231 stars 44 forks source link

Does SpBowerBundle let users handle dependency conflicts? #115

Closed nanoo-k closed 9 years ago

nanoo-k commented 10 years ago

I have several packages whose dependencies conflict with each other. Specifically, several are okay with jQuery#2.1 and one requires jQuery#1.11.1. When conflicts like these arise using bower install I can choose which version of jQuery to use (and then I include the other jQuery version giving it a different dependency name, something like jquery-1.11.1), but running app/console sp:bower:install just fails.

Is SpBowerBundle able to resolve this?

Here's my output:

$ app/console sp:bower:install
Installing bower dependencies for "DriverSideSiteBundle" into "/Users/miguelvalencia/Projects/Advanced Auto Parts/juniper/src/DriverSide/Bundle/SiteBundle/Resources/config/bower/../../public/components"
bower jquery-1.11.1#1.11.1      cached git://github.com/jquery/jquery.git#1.11.1
bower jquery-1.11.1#1.11.1    validate 1.11.1 against git://github.com/jquery/jquery.git#1.11.1
bower carouFredSel#~6.2.1       cached git://github.com/gilbitron/carouFredSel.git#6.2.1
bower carouFredSel#~6.2.1     validate 6.2.1 against git://github.com/gilbitron/carouFredSel.git#~6.2.1
bower jquery-2.1.1#2.1.1        cached git://github.com/jquery/jquery.git#2.1.1
bower jquery-2.1.1#2.1.1      validate 2.1.1 against git://github.com/jquery/jquery.git#2.1.1
bower jquery#>= 2.1.0           cached git://github.com/jquery/jquery.git#2.1.1
bower jquery#>= 2.1.0         validate 2.1.1 against git://github.com/jquery/jquery.git#>= 2.1.0
bower jquery#>=1.2              cached git://github.com/jquery/jquery.git#2.1.1
bower jquery#>=1.2            validate 2.1.1 against git://github.com/jquery/jquery.git#>=1.2
bower jquery#>=1.6              cached git://github.com/jquery/jquery.git#2.1.1
bower jquery#>=1.6            validate 2.1.1 against git://github.com/jquery/jquery.git#>=1.6
bower jquery#>=1.7 <2.0         cached git://github.com/jquery/jquery.git#1.11.1
bower jquery#>=1.7 <2.0       validate 1.11.1 against git://github.com/jquery/jquery.git#>=1.7 <2.0
bower                        ECONFLICT Unable to find suitable version for jquery

  [Sp\BowerBundle\Bower\Exception\RuntimeException]  
  An error occured while installing dependencies     

sp:bower:install
Spea commented 9 years ago

That is a good question. I'm not sure if this can be done, but I will check it

mktcode commented 9 years ago

Same issue here. Any progress on this?

Tokeiito commented 9 years ago

Same problem on my end. Normally on plain bower install, it will give us to choose which version of package to use. But with sp:bower:install it just throws exception.

nanoo-k commented 9 years ago

I decided against SpBowerBundle, but one solution may be to include a resolutions parameter in bower.json.

{ "dependencies": { "jquery": "2.1.3", "angular": "1.3.15" }, "resolutions": { "angular": "1.3.9", "jquery": "2.1.3" } }

I haven't tried, but I'm guessing SpBowerBundle respects the definitions under resolutions. You'll need to figure out which version to resolve to yourself, but SpBowerBundle might play nice once you do.

On Tue, May 5, 2015 at 6:51 AM, Tokeiito notifications@github.com wrote:

Same problem on my end. Normally on plain bower install, it will give us to choose which version of package to use. But with sp:bower:install it just throws exception.

— Reply to this email directly or view it on GitHub https://github.com/Spea/SpBowerBundle/issues/115#issuecomment-99083427.

Spea commented 9 years ago

You can handle dependency conflicts in the latest master version. I will try to release a new version asap, but I have to clean up some other things first.