feat: add manifest-based package installation detection

This commit is contained in:
Sahilb315
2025-06-10 02:43:56 +05:30
parent 9ed94f5312
commit 7ab669e623
8 changed files with 346 additions and 72 deletions
+16
View File
@@ -30,12 +30,28 @@ type ParsedCommand struct {
// Parsed install target if this is an install command
InstallTargets []*PackageInstallTarget
// IsManifestInstall indicates if this is a manifest-based installation
// (e.g., npm install, pip install -r requirements.txt)
IsManifestInstall bool
// ManifestFiles contains the list of manifest files to install from
// (e.g., ["requirements.txt"] for pip install -r requirements.txt)
ManifestFiles []string
}
func (pc *ParsedCommand) HasInstallTarget() bool {
return len(pc.InstallTargets) > 0
}
func (pc *ParsedCommand) HasManifestInstall() bool {
return pc.IsManifestInstall
}
func (pc *ParsedCommand) ShouldExtractFromManifest() bool {
return pc.IsManifestInstall && !pc.HasInstallTarget()
}
// PackageManager is the contract for implementing a package manager
type PackageManager interface {
// Name of the package manager implementation