Skip to content

refactor: introduce Ecosystem interface for multi-PM support#65

Merged
DecampsRenan merged 1 commit into
mainfrom
multi-pm-feasibility
Apr 8, 2026
Merged

refactor: introduce Ecosystem interface for multi-PM support#65
DecampsRenan merged 1 commit into
mainfrom
multi-pm-feasibility

Conversation

@DecampsRenan
Copy link
Copy Markdown
Owner

Summary

  • Introduces a new internal/ecosystem package with an Ecosystem interface that abstracts PM-specific behavior: command resolution, audit build/parse, lock files, manifest files, and artifact directories
  • Implements the interface for all 4 existing JS package managers (npm, yarn, pnpm, bun) in dedicated files
  • Refactors detector, resolver, and audit packages to delegate to the ecosystem registry instead of hardcoded switch statements
  • Pure refactoring — no new features, no behavioral changes, all existing tests pass

This lays the groundwork for adding non-JS ecosystems (Cargo, Go, Maven, etc.) in a follow-up PR.

Test plan

  • All existing tests pass (go test ./...)
  • New ecosystem package has full test coverage for audit parsing and command building
  • Manual smoke test: spm install, spm add, spm run, spm clean, spm audit in an npm/yarn/pnpm project

🤖 Generated with Claude Code

Extract PM-specific behavior (resolve, audit build/parse, artifact dirs,
lock files) into an Ecosystem interface with per-PM implementations
(npm, yarn, pnpm, bun). Detector and resolver now delegate to the
ecosystem registry instead of hardcoded switch statements.

This is a pure refactoring — no new features, all existing tests pass.
Prepares the codebase for adding non-JS ecosystems (Cargo, Go, etc.).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@DecampsRenan DecampsRenan merged commit e285da9 into main Apr 8, 2026
7 checks passed
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.

1 participant