Skip to content
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

Yarn V1 - consider filtering yarn list via environment variable #205

Merged
merged 4 commits into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions build/utils/yarn.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ func buildYarn1Root(packageInfo *PackageInfo, packNameToFullName map[string]stri
rootDeps = append(rootDeps, maps.Keys(packageInfo.OptionalDependencies)...)

for _, directDepName := range rootDeps {
rootDependency.Details.Dependencies = append(rootDependency.Details.Dependencies, YarnDependencyPointer{Locator: packNameToFullName[directDepName]})
if fullPackageName, packageExist := packNameToFullName[directDepName]; packageExist {
rootDependency.Details.Dependencies = append(rootDependency.Details.Dependencies, YarnDependencyPointer{Locator: fullPackageName})
}
}
return rootDependency
}
Expand Down Expand Up @@ -357,9 +359,9 @@ func (yd *YarnDependency) Name() string {
if strings.Contains(yd.Value[1:], "@") {
atSignIndex := strings.Index(yd.Value[1:], "@") + 1
return yd.Value[:atSignIndex]
} else { // In some cases when using yarn V1 we encounter package names without their version (project's package name)
return yd.Value
}
// In some cases when using yarn V1 we encounter package names without their version (project's package name)
return yd.Value
}

type YarnDepDetails struct {
Expand Down
Loading