Skip to content

Commit

Permalink
Filter out the dependency with the same namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpLink committed Nov 3, 2024
1 parent 701424f commit 8124d3f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions packages/lib/src/gir-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ export class GirModule {
}
}

// Filter out the dependency with the same namespace among each other
transitiveDependencies = transitiveDependencies.filter((dep, index, self) => {
const samePackage = self.findIndex((t) => t.namespace === dep.namespace)
this.log.debug(`Filtering out dependency with same namespace: ${dep.namespace} ${index} ${samePackage}`)
return index === samePackage
})

return transitiveDependencies
}

Expand Down
2 changes: 1 addition & 1 deletion types
3 changes: 1 addition & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3688,7 +3688,6 @@ __metadata:
"@girs/gmodule-2.0": "workspace:^"
"@girs/gobject-2.0": "workspace:^"
"@girs/gtk-3.0": "workspace:^"
"@girs/gtksource-300": "workspace:^"
"@girs/gtksource-4": "workspace:^"
"@girs/harfbuzz-0.0": "workspace:^"
"@girs/pango-1.0": "workspace:^"
Expand Down Expand Up @@ -5984,7 +5983,7 @@ __metadata:
languageName: unknown
linkType: soft

"@girs/gtksource-300@workspace:^, @girs/gtksource-300@workspace:types/gtksource-300":
"@girs/gtksource-300@workspace:types/gtksource-300":
version: 0.0.0-use.local
resolution: "@girs/gtksource-300@workspace:types/gtksource-300"
dependencies:
Expand Down

0 comments on commit 8124d3f

Please sign in to comment.