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

Support complex expressions #196

Closed
j8r opened this issue Mar 23, 2018 · 4 comments
Closed

Support complex expressions #196

j8r opened this issue Mar 23, 2018 · 4 comments

Comments

@j8r
Copy link
Contributor

j8r commented Mar 23, 2018

Support complex expressions, like npm's semver implementation like "or" || and hyphen ranges.

I've implemented most of them with the npm's syntax in semantic_compare (caret ranges ^ instead of ~> and no space between the operator and version number)

@j8r
Copy link
Contributor Author

j8r commented Mar 23, 2018

To add some context: the Ruby inspired gem syntax can be kept, but the use case is when we support LTS versions of a library - we need an expression like ~> 1.2.0 || ~> 2.4.0

@ysbaddaden
Copy link
Contributor

To be honest I never needed any of these.

  1. forcing no space between operator and version makes no sense to me (arbitrary parsing rule).

  2. I don't understand the || rule: multiple versions should restrict versions, not expand them arbitrarily. Furthermore Crystal ain't even aiming for a stable release, libraries even less, so long-term-support for libraries seems soooo far away.

  3. The ^ constraint always confuses me, especially since one should never expect a minor version to never break (it will). I believe the ~> requirement is far more safe, along with an outdated command to easily search for outdated dependencies.

  4. Shards doesn't require semver. It happens to support it, but doesn't enforce it in any way.

All in all, I believe an outdated command and supporting pre-release versions (see #184) would be more useful than supporting ^ or || for the time being.

@j8r
Copy link
Contributor Author

j8r commented Mar 23, 2018

I never said to port caret or tilde ranges, but having a way to have the "or" operator || and hyphen ranges. This way we can restrict versions between one to another, that are tested to work properly. A program works for versions after 1.2.9 until 1.4.7 for example, that is untested.

@ysbaddaden
Copy link
Contributor

Superseded by #261

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

No branches or pull requests

2 participants