Pnpm suppport (#6)

* fix: resolves issues #3 and #4

* feat: add pnpm support & introduce pkg manager wrap for npm
This commit is contained in:
Sahil Bansal
2025-04-30 14:26:38 +05:30
committed by GitHub
parent ec010c7d6b
commit 1aa4b06f41
9 changed files with 320 additions and 165 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ type RegistryType string
const (
RegistryNPM RegistryType = "npm"
RegistryPNPM RegistryType = "pnpm"
RegistryPyPI RegistryType = "pypi"
RegistryGo RegistryType = "go"
)
@@ -29,7 +30,7 @@ func NewFetcherFactory(timeout time.Duration) *FetcherFactory {
// CreateFetcher returns a fetcher for the specified registry type
func (ff *FetcherFactory) CreateFetcher(registryType RegistryType) (Fetcher, error) {
switch registryType {
case RegistryNPM:
case RegistryNPM, RegistryPNPM:
return NewNpmFetcher(ff.timeout), nil
default:
return nil, fmt.Errorf("unsupported registry type: %s", registryType)