Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between install package via composer-asset-plugin and bower #32

Closed
macklay opened this issue Sep 24, 2014 · 8 comments
Closed
Assignees
Labels
Milestone

Comments

@macklay
Copy link

macklay commented Sep 24, 2014

Im try to compare marionette js install via composer and bower.
Marionette has bower.json with such JQuery dependency:
"jquery": "^1.8.0 || ^2.0.0"

And bower install jquery 2.1.1 - its the latest vesion of jquery
But composer-asset-plugin install too old version: 2.0.3

If Im set last jquery version manualy in deps in composer json, composer insatll veeeery old marionettejs(wich has not any jquery dependence)

(in this test case, composer and bower json file contain only one package: "marionette")

bower output:

bower install
bower backbone#*                cached git://github.com/jashkenas/backbone.git#1.1.2
bower backbone#*              validate 1.1.2 against git://github.com/jashkenas/backbone.git#*
bower marionette#*              cached git://github.com/marionettejs/backbone.marionette.git#2.2.1
bower marionette#*            validate 2.2.1 against git://github.com/marionettejs/backbone.marionette.git#*
bower underscore#>=1.5.0        cached git://github.com/jashkenas/underscore.git#1.7.0
bower underscore#>=1.5.0      validate 1.7.0 against git://github.com/jashkenas/underscore.git#>=1.5.0
bower backbone#1.0.0 - 1.1.2    cached git://github.com/jashkenas/backbone.git#1.1.2
bower backbone#1.0.0 - 1.1.2  validate 1.1.2 against git://github.com/jashkenas/backbone.git#1.0.0 - 1.1.2
bower underscore#1.4.4 - 1.6.0  cached git://github.com/jashkenas/underscore.git#1.6.0
bower underscore#1.4.4 - 1.6.0         validate 1.6.0 against git://github.com/jashkenas/underscore.git#1.4.4 - 1.6.0
bower backbone.babysitter#^0.1.0         cached git://github.com/marionettejs/backbone.babysitter.git#0.1.5
bower backbone.babysitter#^0.1.0       validate 0.1.5 against git://github.com/marionettejs/backbone.babysitter.git#^0.1.0
bower backbone.wreqr#^1.0.0              cached git://github.com/marionettejs/backbone.wreqr.git#1.3.1
bower backbone.wreqr#^1.0.0            validate 1.3.1 against git://github.com/marionettejs/backbone.wreqr.git#^1.0.0
bower jquery#^1.8.0 || ^2.0.0            cached git://github.com/jquery/jquery.git#2.1.1
bower jquery#^1.8.0 || ^2.0.0          validate 2.1.1 against git://github.com/jquery/jquery.git#^1.8.0 || ^2.0.0
bower backbone#1.0.0 - 1.1.2            install backbone#1.1.2
bower underscore#1.4.4 - 1.6.0          install underscore#1.6.0
bower marionette#*                      install marionette#2.2.1
bower backbone.wreqr#^1.0.0             install backbone.wreqr#1.3.1
bower backbone.babysitter#^0.1.0        install backbone.babysitter#0.1.5
bower jquery#^1.8.0 || ^2.0.0           install jquery#2.1.1

composer output:

composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing bower-asset/jquery (2.0.3)                                  
    Downloading: 100%         

  - Installing bower-asset/backbone.wreqr (v1.0.1)
    Loading from cache

  - Installing bower-asset/underscore (1.6.0)
    Loading from cache

  - Installing bower-asset/backbone (1.1.2)
    Downloading: 100%         

  - Installing bower-asset/backbone.babysitter (v0.1.5)
    Downloading: 100%         

  - Installing bower-asset/marionette (dev-master 35374c5)
    Cloning 35374c5701a66a2d3b50a3088e5032598acde224

composer with manual set latest jquery:

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing bower-asset/backbone.wreqr (v1.0.1)                           
  - Installing bower-asset/backbone.wreqr (v0.2.0)
    Loading from cache

  - Removing bower-asset/backbone.babysitter (v0.1.5)
  - Installing bower-asset/backbone.babysitter (v0.0.6)
    Downloading: 100%         

  - Removing bower-asset/underscore (1.6.0)
  - Installing bower-asset/underscore (1.5.2)
    Loading from cache

  - Updating bower-asset/marionette (dev-master 35374c5 => v1.6.2)
    Checking out 77755a8fd6dd759a4b2c750db1cc70a9187a9652

  - Removing bower-asset/jquery (2.0.3)
  - Installing bower-asset/jquery (2.1.1)
    Loading from cache

@francoispluchino francoispluchino added this to the 1.0.0 milestone Sep 24, 2014
@francoispluchino francoispluchino self-assigned this Sep 24, 2014
@macklay macklay changed the title diference between install package via composer-asset-plugin and bower Difference between install package via composer-asset-plugin and bower Sep 24, 2014
@francoispluchino
Copy link
Member

Can you copy me the file composer.json please?

@macklay
Copy link
Author

macklay commented Sep 24, 2014

@francoispluchino,

composer.json 
{
    "name": "test",

    "minimum-stability": "dev",
    "require": {

        "bower-asset/marionette": "*"
    },

    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

@francoispluchino
Copy link
Member

The behavior of the update is very strange!

@macklay
Copy link
Author

macklay commented Sep 24, 2014

@francoispluchino,
the behavior of the install, output the same result and therefore its very strange too ;)

Maybe bower version ^2.0.0 readed by composer as ~2.0.0 ?

@francoispluchino
Copy link
Member

I found the problem. The plugin converts the range version ^2.0.0 to ~2.0.0. They have, according the doc, the same behavior: replace by >=2.0,<3.0.

However, Composer has a special, ~2.0.0 is not converted to >=2.0.0,<3.0, but to >=2.0.0,<2.1 (see the doc).

@francoispluchino
Copy link
Member

The problem is in the class Fxp\Composer\AssetPlugin\Converter\SemverConverter line 130

@francoispluchino
Copy link
Member

Fixed by 8af4aa0.

@macklay
Copy link
Author

macklay commented Sep 24, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants