In 2GP, we can have multiple packages that share the same namespace. There is the possibility to share Apex between these packages using the @NamespaceAccessible annotation.
This works great, except in the scenario where we have our base & extension packages in different repos / projects. When I generate the OST for my extension package, it obviously cannot see the shared apex methods & properties from it’s base package as that codebase is in a different project.
It would be great if we could ‘import’ a secondary codebase (base package) & have any @NamespaceAccessible methods & properties added to the OST of the current project (extension package).
One option is to house both packages in a single repo / project which SFDX & 2GP does support, but there are reasons why some people won’t want to do this. For example, we may want to share access to our extension package repo while keeping our base package private as it contains as core IP.