fix: only clone direct deps, skip indirect
parseCoreDeps now skips // indirect lines from go.mod. Reduces cloned repos from 17 to 10 — only what the repo directly imports. Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
ba281a2a2d
commit
e5b7b4f7d7
1 changed files with 7 additions and 2 deletions
|
|
@ -77,8 +77,8 @@ type coreDep struct {
|
|||
dir string // e.g. "core-go" (workspace subdir)
|
||||
}
|
||||
|
||||
// parseCoreDeps extracts Core ecosystem dependencies from go.mod content.
|
||||
// Finds all require lines matching dappco.re/go/* or forge.lthn.ai/core/*.
|
||||
// parseCoreDeps extracts direct Core ecosystem dependencies from go.mod content.
|
||||
// Skips indirect deps — only clones what the repo directly imports.
|
||||
func parseCoreDeps(gomod string) []coreDep {
|
||||
var deps []coreDep
|
||||
seen := make(map[string]bool)
|
||||
|
|
@ -86,6 +86,11 @@ func parseCoreDeps(gomod string) []coreDep {
|
|||
for _, line := range core.Split(gomod, "\n") {
|
||||
line = core.Trim(line)
|
||||
|
||||
// Skip indirect dependencies
|
||||
if core.Contains(line, "// indirect") {
|
||||
continue
|
||||
}
|
||||
|
||||
// Match dappco.re/go/* requires
|
||||
if core.HasPrefix(line, "dappco.re/go/") {
|
||||
parts := core.Split(line, " ")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue