8000 Added support for the `from_native` function in both Composer and Golang version ranges by aayushkdev · Pull Request #152 · aboutcode-org/univers · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

8000 Added support for the from_native function in both Composer and Golang version ranges #152

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aayushkdev
Copy link

Fix #47

  • Added support for the from_native function in both Composer and Golang version ranges.
  • For Golang, this includes support for version ranges like >=1.2.3, <=2.0.0, v1.2.3-beta.1, and ranges using || for multiple constraints.
  • For Composer, this adds support for version ranges with ^, ~, .* patterns, and the || operator for combining multiple version ranges.

…lang version ranges. issue aboutcode-org#47

Signed-off-by: Aayush Kumar <aayush214.kumar@gmail.com>
Copy link
Contributor
@TG1999 TG1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@barv-jfrog
Copy link
barv-jfrog commented May 7, 2025

@TG1999, @aayushkdev
There are few things missing here:

  1. Support for legacy "|" (which is the same for "||")
  2. Support for hyphen - https://getcomposer.org/doc/articles/versions.md#hyphenated-version-range-
  3. I noticed in some packages it required wildcard as "x" instead of "*", i.e 1.5.x and not always 1.5.*

1 and 2 are pretty big in my opinion, 3 is nice to have

@pombredanne
Copy link
Member

@barv-jfrog Thanks ++ for the inputs!

@aayushkdev Do you mind to have a look and add these enhancements?

@pombredanne
Copy link
Member

@barv-jfrog would you have some real, live examples to share for a test suite? Or would have a link to composer PHP's test code that we could port to use as tests here?

@barv-jfrog
Copy link
barv-jfrog commented May 8, 2025

@pombredanne sure
for example:

  1. https://packagist.org/packages/fazlinovic/laravel-vue-i18n-generator - Here you can see legacy usage of parallel "|" and not "||"
  2. here you can see hyphens - https://packagist.org/packages/dubroquin/bouncer
  3. here you can see usage of "x" instead of "*" - https://packa 8000 gist.org/packages/hungnm144/laravel-elfinder

Regarding the logic of each one of this - 1 and 3 are simple, they are the same as "||" and "x".
Regarding 2 - logic of hyphens - I added the link in my previous comment on how to deal with this from the composer website

@aayushkdev
Copy link
Author

@barv-jfrog Thanks ++ for the inputs!

@aayushkdev Do you mind to have a look and add these enhancements?

yeah sure I will have a look.

…onRange

Signed-off-by: Aayush Kumar <aayush214.kumar@gmail.com>
@aayushkdev
Copy link
Author

Hey @barv-jfrog @pombredanne I have made the requested changes please have a look.

@barv-jfrog
Copy link

Hi @aayushkdev thanks for paying attention to my comments.
It looks good to me.

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

Successfully merging this pull request may close these issues.

Add support for from_native function
4 participants
0