feat: expose package manager name in componentAnalysis result#518
Merged
Conversation
Attach the matched provider's command name (e.g. pip, uv, poetry) as `packageManager` on the component analysis result so IDE consumers can display provider-specific instructions without re-implementing detection. Jira: TC-4336 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideExposes the underlying provider command name as packageManager in componentAnalysis results and adds a cmdName implementation for the plain python_pip provider so IDEs can show package-manager-specific guidance. Sequence diagram for updated componentAnalysis packageManager enrichmentsequenceDiagram
participant Caller
participant componentAnalysis
participant match
participant provider
participant analysis
Caller->>componentAnalysis: componentAnalysis(manifest, opts)
componentAnalysis->>componentAnalysis: fs.accessSync(manifest)
componentAnalysis->>componentAnalysis: path.basename(manifest)
componentAnalysis->>match: match(manifest, availableProviders, opts)
match-->>componentAnalysis: provider
componentAnalysis->>analysis: requestComponent(provider, manifest, theUrl, opts)
analysis-->>componentAnalysis: result
alt provider has _cmdName
componentAnalysis->>provider: _cmdName()
provider-->>componentAnalysis: commandName
componentAnalysis->>componentAnalysis: result.packageManager = commandName
end
componentAnalysis-->>Caller: result
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
5 tasks
ruromero
requested changes
May 14, 2026
ruromero
left a comment
Collaborator
There was a problem hiding this comment.
let's try to make it more generic and maintainable.
Keep _cmdName as the internal/protected method for binary resolution and add packageManagerName() as the proper public method on every provider. This ensures result.packageManager is always set for all providers, not just when _cmdName happens to exist. Jira: TC-4336 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruromero
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_cmdName()(e.g.pip,uv,poetry,npm,pnpm,yarn) aspackageManageron the component analysis result_cmdName()to thepython_pipplain object provider for consistency with class-based providersTest plan
packageManageris set correctly for all Python providers:requirements.txt→pip,pyproject.toml + uv.lock→uv,pyproject.toml + poetry.lock→poetry,pyproject.toml(no lock) →pippackageManagerset (npm,pnpm,yarn)_cmdName, nopackageManagerset)Jira: TC-4336
🤖 Generated with Claude Code
Summary by Sourcery
Expose the matched provider’s package manager name on component analysis results and align the Python pip provider with other providers.
New Features: