-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Draft PR: Update package managers (bundler, composer, and npm_and_yarn) to support generalized abstraction #10825
Conversation
…deprecation_versions and supported_versions
…act package manager
…ract package manager
…ge manager we are going to use similar lowest version check for all approach
def unsupported? | ||
# Check if the version is not supported | ||
supported_versions.all? { |supported| supported > version } | ||
super( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved all common fields name, version, deprecation_versions, supported_version into abstract package manager.
Also moved unsupported?
function into abstract package manager since bundler and composer both implements unsupported in the same way.
return false if supported_versions.empty? | ||
|
||
# Check if the version is not supported | ||
supported_versions.all? { |supported| supported > version } | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composer
and bundler
are implementing this method in the same way and other ecosystems are also going to apply in same way. If there is ecosystem needs to implement unsupported in a different way then it should override that in it is package manager
This PR has been split into smaller, more focused PRs: |
What are you trying to accomplish?
This PR updates the abstract package manager to include shared attributes like
ecosystem
,name
,version
,deprecation_versions
, andsupported_versions
. Additionally, the individual package manager npm_and_yarn is also refactored to extend the abstract package manager and bundler and composer package managers are also updated according to the changes.Anything you want to highlight for special attention from reviewers?
The goal here is to centralize common functionality into the abstract
PackageManagerBase
, making each package manager more focused on its unique behavior. If there are any concerns about backward compatibility or potential edge cases in the refactoring, those are key areas to focus on.How will you know you've accomplished your goal?
Checklist
Commits