-
Notifications
You must be signed in to change notification settings - Fork 80
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
Enhancements for ExpressionParser #18
Conversation
Any word on this? |
Sorry, totally forgot about this. Will take a closer look at it tonight. |
Having taken a quick look at the code and having read through the node-semver's ranges spec, I can't help but wonder why would anyone need anything except the x-ranges. Correct me if I'm wrong but it looks like the x-ranges cover all possible use cases for ranges. Besides x-ranges are more intuitive than corresponding tilde ranges and caret ranges, compare P.S. This is not to say I'm not willing to incorporate the changes, just want to understand the wisdom behind these complications. |
The tilde and caret provides more fine-grained possibilities to control mostly patches IMO. BTW, your example for If you examine few npm and bower packages, you will find that the caret and tilde are used quite often. |
Thank you for taking the time to explain this to me. Now I get the part I was missing. |
Guys, thanks for your work on this! I look forward to the next release that includes this PR... |
@kickroot thanks for the feedback, I appreciate it. Hopefully you can expect the next release this week. |
ping @zafarkhaja |
@shayke thank you for your patience and commitment to this PR, I appreciate it. There were few things that concerned me about this PR
Although p.1 complicates the grammar and its parsing, I believe we can at least make it transparent for users just by giving some good examples in the Consider the following expression which doesn't pass the check
and then rewrite the method accordingly (this snippet here can serve as a starting point). We also need to amend Another thing not to forget is to update I know this all might be puzzling and confusing and I'm willing to help because it requires substantial refactoring, it's just that I'm not sure how do we go about collaborating in your repo before merging into the main one. |
Well then, I guess you can just fork the initial project and take my commits as patches (I could give you that, a patch for each commit?) The easiest way will probably be to merge this pull and then create another one with all those refactorings you plan to make. |
Ideally I'd go with this only if we had "atomic" commits (one per piece of functionality), and that would make more sense then it does now.
This one is good enough for me, we can do it. But before few more things I'd like to ask you, could you please Thank you. P.S. I'll release the new version after I do this refactoring following your commit. |
@shayke let me know if you need any help. Or, if you don't mind, I can do the |
This commit enhances expressions to support https://github.com/npm/node-semver - Support the caret (^) operator - X-Ranges: Implemented for *, x and X - Improved Tilde ranges to work with the examples at https://github.com/npm/node-semver#tilde-ranges-123-12-1
OK I've squashed the commits and changed the commit message. Thanks |
Thanks @shayke. I merged it into the |
Thanks a lot, I'm looking forward to the release! |
Unfortunately, the refactoring is taking more time than I've expected. I've reworked the BNF grammar and I'm almost done with the refactoring but there's one thing I'm not sure about. The following line I overlooked while reviewing the code looks very suspicious to me assertTrue(v.satisfies("2.0.0")); // >=2.0.0 And I didn't find anything similar to it in the |
Hey @shayke good news! :) Finally I managed to release it. Thank you for the contribution. |
Thank you! I'm happy we got it all together eventually. |
This library is great!
I was missing some range comparisons as described in https://github.com/npm/node-semver
Here is what I've added:
I'd really appreciate if this can be merged so I could use this library the same way it behaves in JS (mostly for implementing stuff for Bower and NPM).
The key for this pull request is to be able to use Version.satisfies() and simply provide it with the supported ranges from bower and npm.