swift package show-dependencies shows recursive dependencies. For example, here's the output for the dealer example package.
$ swift package show-dependencies --format json
{
"name": "dealer",
"url": "https://github.com/apple/example-package-dealer",
"version": "unspecified",
"path": "example-package-dealer",
"dependencies": [
{
"name": "DeckOfPlayingCards",
"url": "https://github.com/apple/example-package-deckofplayingcards.git",
"version": "3.0.4",
"path": ".build/checkouts/example-package-deckofplayingcards",
"dependencies": [
{
"name": "FisherYates",
"url": "https://github.com/apple/example-package-fisheryates.git",
"version": "2.0.6",
"path": ".build/checkouts/example-package-fisheryates",
"dependencies": [
]
},
{
"name": "PlayingCard",
"url": "https://github.com/apple/example-package-playingcard.git",
"version": "3.0.5",
"path": ".build/checkouts/example-package-playingcard",
"dependencies": [
]
}
]
}
]
}
But like you said, this is incomplete, as it only includes Swift dependencies.
I recently used that to generate a software bill of materials for Swift projects in spdx-sbom-generator. With the latest Executive Order on Cybersecurity, there's a lot of work being done on SBOMs, which have to do with the traceability part of what you're looking for.
Beyond that, my role at GitHub is focused on improving the experience for Swift developers across the platform, including integration with Dependabot, the Security Advisories, and the dependency graph. Feel free to reach out and let me know more about your use case, and how we might work together to improve tooling across the Swift ecosystem. 