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

Angular version upper bound is specified as 1.3.16, not 1.3.17 #4064

Closed
jgilchrist opened this issue Jul 28, 2015 · 7 comments
Closed

Angular version upper bound is specified as 1.3.16, not 1.3.17 #4064

jgilchrist opened this issue Jul 28, 2015 · 7 comments

Comments

@jgilchrist
Copy link

Here the upper bound for Angular is specified as 1.3.16 - however, the README claims to support any 1.3.x version, so the upper bound should instead be 1.3.17.

@jgilchrist
Copy link
Author

Seems like the bound should be ~1.3.16 to denote 'any patch level change above 1.3.16'?

@c0bra
Copy link
Contributor

c0bra commented Jul 28, 2015

Bower refuses to work with a range from one version to another that isn't fixed to an explicit number; not sure why.

See this comment: #3925 (comment)

@jgilchrist
Copy link
Author

That's odd - if I run that using bower-semver:

> semver.maxSatisfying(['1.3.16', '1.2.18'], '>=1.2.16 <=1.3.16')
'1.3.16'

Seems to work fine for me, as does:

> semver.maxSatisfying(['1.3.17', '1.2.18'], '>=1.2.16 ~1.3.16')
'1.3.17'

Edit:

And if you add both patch versions, it correctly picks the highest one:

> semver.maxSatisfying(['1.3.16', '1.3.17', '1.2.18'], '>=1.2.16 ~1.3.16')
'1.3.17'

@c0bra
Copy link
Contributor

c0bra commented Jul 28, 2015

Oh wait, this is what breaks:

var semver = require('semver');
var bowersemver = require('bower-semver');

console.log('bower', bowersemver.maxSatisfying(['1.3.16', '1.2.18'], '>=1.2.16 <=1.3.x'));
console.log('semver', semver.maxSatisfying(['1.3.16', '1.2.18'], '>=1.2.16 <=1.3.x'));
bower 1.2.18
semver 1.3.16

@jgilchrist
Copy link
Author

Looks like you might be using conflicting syntaxes?

The .x syntax expresses a different constraint to <=. If you remove the <= then you get the correct result.

// Undefined behaviour?
// Either that or it's saying 'less than any patch 1.3.x' so it picks a version in 1.2.x
> semver.maxSatisfying(['1.3.16', '1.2.18'], '>=1.2.16 <=1.3.x')
'1.2.18'
// Correct result
> semver.maxSatisfying(['1.3.16', '1.2.18'], '>=1.2.16 1.3.x')
'1.3.16'

@c0bra
Copy link
Contributor

c0bra commented Jul 28, 2015

doh, I see. silly me. I wonder why bower's is different then?

@c0bra c0bra closed this as completed in 13d93f4 Jul 28, 2015
@jgilchrist
Copy link
Author

Yeah, not a clue. bower-semver doesn't look like much more than a thin wrapper around semver. Their maxSatisfying function does some filtering based around pre-releases so maybe it's something to do with that?

Thanks for the fix!

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

2 participants