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

ocLazyLoad angular dependency version wildcard not being recognized? #263

Open
dnroot opened this issue Jun 22, 2015 · 7 comments
Open

ocLazyLoad angular dependency version wildcard not being recognized? #263

dnroot opened this issue Jun 22, 2015 · 7 comments

Comments

@dnroot
Copy link

dnroot commented Jun 22, 2015

ocLazyLoad currently has a dependency on angular (from here):

"dependencies": {
  "angular": ">=1.2.x <=1.4.x"
}

After upgrading to angular 1.4.1, we cannot get the latest ocLazyLoad. Looking at Gemfile.lock, it looks like the dependency is requiring angular <= 1.4. So, the wildcard version format they're using doesn't seem to be recognized by rails-assets.

@sheerun
Copy link
Contributor

sheerun commented Jul 27, 2015

>=1.2.x <=1.4.x is interpreted by rails-assets as >= 1.2, <= 1.4. This seems to be correct behavior.

@sheerun sheerun closed this as completed Jul 27, 2015
sheerun added a commit that referenced this issue Jul 27, 2015
@milk1000cc
Copy link

I think <=1.4.x means < 1.5.

I can't upgrade to backbone 1.3.3 because I use backbone.babysitter.
https://github.com/marionettejs/backbone.babysitter/blob/master/bower.json#L20

@joshjordan
Copy link
Member

@milk1000cc you are correct, it does. See here: https://github.com/npm/node-semver/blob/master/semver.js#L967

Although we're not using node-semvar, that's the defacto standard and we should be consistent.

We'd gladly accept a pull request for this. The code you'd have to touch, unfortunately, looks like this: https://github.com/tenex/rails-assets/blob/master/app/models/build/utils.rb#L41 :) and the two tests that needs changing are here: https://github.com/tenex/rails-assets/blob/master/spec/models/build/utils_spec.rb#L66

@joshjordan joshjordan reopened this Aug 20, 2016
@milk1000cc
Copy link

OK. I'll try to fix.

@milk1000cc
Copy link

I found Bower uses old semver.

Current version of node-semver is 5.3.0, but Bower uses v2.
https://github.com/bower/bower/blob/master/package.json#L58
https://github.com/npm/node-semver/blob/master/package.json

In semver v2, <=1.4.x seems to be interpreted as <1.4 (not <1.5).

semver.satisfies('1.4.1', '<=1.4.x')  // => false
semver.satisfies('1.4.0', '<=1.4.x')  // => false
semver.satisfies('1.3.9', '<=1.4.x')  // => true

Since I wrote my PR to be consistent with the latest semver, it may have to be rejected once.

@hut8
Copy link
Member

hut8 commented Aug 25, 2016

Hey @milk1000cc thanks so much for your PR. You're awesome. It's really well articulated and you fixed something pretty surprising. Sorry for the delay in getting back to you; I've been really busy with client work.

Now that you've discovered that Bower's semver is v2, would you say that it works as designed currently?

@milk1000cc
Copy link

In master branch of rails-assets, Build::Utils.fix_version_string('<=1.4.x') returns <= 1.4.
But it should return < 1.4 to consistent with Bower's semver.

I'm sorry I have no time to fix it now.

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

No branches or pull requests

5 participants