Comments (8)
@isaacs that figures:
> require('semver/package.json').version
'2.1.0'
TBH I don't know why this behavior is changed but old one seems more correct to me. Ranges are useless if a crate have a pre-release string. And *
means any except it's not any.
Anyway I am closing this issue since semver
crate is using node-semver behavior.
from semver.
Yes, this is intended behavior. You only get prerelease versions when explicitly asking for them. This is consistent with other semver implementations, take https://semver.npmjs.com/ and try matching *
vs 1.0.0-rc.1
.
which then confuses me why you say
I tried node's semver and * is matching (satisfying) fine with 0.1.0-pre.0.
@isaacs, do you know what's up here?
from semver.
Another example from semantic_version python module:
>>> from semantic_version import Spec, Version
>>> Spec('*').match(Version('0.1.0-pre.0'))
True
I think *
range is only different in npm. In theory *
means any and it should match any valid semver.
from semver.
I haven't had the time to check, but IIRC Bundler also doesn't give you prerelase explicitly.
In theory * means any and it should match any valid semver.
That depends, it should match any released version, imho, and pre-releases aren't real releases.
Anyway, this library will try to be as compatible with the rest of the ecosystem as possible, but if it's not standard across the ecosystem, then we'll do what I think is right 😉
from semver.
Nope, it doesn't, by design.
$ semver -r '*' 1.0.0-pre
$ echo $?
1
https://github.com/npm/node-semver/#prerelease-tags
from semver.
Obviously I can't speak for Python's semantic_version module, though. I'm assuming it works for its purposes. Version range specifiers are much less standardized than versions themselves, but cargo and npm are mostly in sync with one another.
from semver.
@isaacs I am wondering why all these examples are returning true:
> var semver = require('semver')
> semver.satisfies('0.1.0-pre.0', '*')
true
> semver.satisfies('0.1.0-pre.0', '0.1')
true
> semver.satisfies('0.1.0-pre.0', '^0')
true
> semver.satisfies('0.1.0-pre.0', '0')
true
I only need this kind of behavior from semver crate. semver crate is returning false for all of these.
from semver.
@onur Probably you're using a very outdated version of semver.
> var semver = require('./')
undefined
> semver.satisfies('0.1.0-pre.0', '*')
false
> semver.satisfies('0.1.0-pre.0', '0.1')
false
> semver.satisfies('0.1.0-pre.0', '^0')
false
> semver.satisfies('0.1.0-pre.0', '0')
false
> require('semver/package.json').version
'5.3.0'
> require('./package.json').version
'5.3.0'
from semver.
Related Issues (20)
- Wildcard VersionReq alongside other requirements HOT 3
- `is_exact`? HOT 2
- Display impl for Version no longer supports padding
- 1.0.4 broke older nightlies HOT 1
- Why is Op non-exhaustive? HOT 1
- Doc/test requests from an audit from a vendor crate bump HOT 1
- Unable to parse v0.0.1-001 HOT 1
- Negation operator HOT 1
- v1.0.8 breaks Send/Sync impls on some public structs HOT 1
- Please yank version 1.0.8 when you get the chance HOT 1
- Implementation for range with multiple look buged when pre-release are not present HOT 1
- `cargo doc` emits errors, but then works anyway
- Error when cargo fuzz HOT 1
- Pre-release requirement not satisfied HOT 2
- `Identifier::new_unchecked()` writes to null pointer on allocation failure HOT 2
- Implement Ord for VersionReq? HOT 1
- Version Mutability HOT 2
- Pre-release versions fail validation HOT 5
- Support VerReq with date HOT 2
- Comparison of `Version`s also compares build metadata HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semver.