Both issues you described are known limitations of Tuist’s dependency analysis in mono repositories.
For the false positives with canImport, Tuist’s inspect implicit-imports command relies on static code analysis and cannot fully understand conditional imports like #if canImport(...)—so it may report dependencies as “implicit” even when they’re only conditionally imported. This is documented as a limitation: Tuist can’t reliably detect all conditional import cases and may produce false positives in these scenarios [docs].
For external dependencies being available to all targets, the current scoping mechanism in Tuist may not fully isolate module visibility per target or project in mono repo setups, especially with SwiftPM packages. This means external modules can sometimes be imported even if not explicitly declared as dependencies, which can lead to the kind of leakage you observed. This is a known gap in how exclusivity and visibility are enforced when multiple projects coexist [docs].
The recommended approach is to always explicitly declare all dependencies for each target. If you encounter linker errors or unexpected module visibility, use .package(product:) to explicitly link the required products, and avoid relying on implicit or transitive linkage [discussion].
Let me know if you want more details on workarounds or have a specific scenario you want to dig into!
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.