Bee-Lab / bowerphp

A PHP implementation of bower :bird:
MIT License
467 stars 38 forks source link

Wrong version of jQuery is installed #118

Closed sabl0r closed 6 days ago

sabl0r commented 9 years ago

Hi, thanks for this great tool! I like the idea! Today I ran into the following issue:

bower.json

"dependencies": {
    "jquery": "1",
    "x-editable": "*"
}

Bower pulls in jQuery 1.11.2 as expected:

# bower install
bower jquery#1                  cached git://github.com/jquery/jquery.git#1.11.2
bower jquery#1                validate 1.11.2 against git://github.com/jquery/jquery.git#1
bower x-editable#*              cached git://github.com/vitalets/x-editable.git#1.5.1
bower x-editable#*            validate 1.5.1 against git://github.com/vitalets/x-editable.git#*
bower jquery#>=1.6              cached git://github.com/jquery/jquery.git#2.1.3
bower jquery#>=1.6            validate 2.1.3 against git://github.com/jquery/jquery.git#>=1.6
bower x-editable#*             install x-editable#1.5.1
bower jquery#1                 install jquery#1.11.2

x-editable#1.5.1 vendor\bower\x-editable
└── jquery#1.11.2

jquery#1.11.2 vendor\bower\jquery

BowerPHP pulls in jQuery 2.1.3:

# vendor/bin/bowerphp install
bower jquery#1
bower jquery#1.11.2            install
bower x-editable#*
bower x-editable#1.5.1         install
bower jquery#>=1.6             install

# head -n 2 vendor/bower/jquery/dist/jquery.js
/*!
 * jQuery JavaScript Library v2.1.3

Is this a bug or are my dependency specifications wrong? Any ideas, what's going on here?

garak commented 9 years ago

We still need to implement advanced dependencies resolving. Meanwhile, you can work around your situation by swapping positions in your bower.json:

"dependencies": {
    "x-editable": "*",
    "jquery": "1"
}
sabl0r commented 9 years ago

Thanks for your explanation. Your workaround works great. Fine by me for now ;)