Can someone help me figure out how to arrange a package with the structure as in ITensors.jl?

The reason for the ITensorVisualizationCore submodule within the ITensors module is to define the interface function visualize and macro @visualize, which I want to be able to use inside ITensors to help debug code by visualizing tensor contractions. However, I didn’t want all of ITensorsVisualizationBase (the common infrastructure of the various visualization backends like UnicodePlots and Makie) defined inside ITensors, so I defined ITensorVisualizationCore just to define the minimal interface that then gets extended by ITensorsVisualizationBase and the backend packages.

Perhaps there is a better way to achieve this. Ultimately it might make sense to have a separate VisualizationCore interface package that just defines visualize and @visualize which can then be loaded inside ITensors (analogous to packages like GitHub - JuliaArrays/StaticArraysCore.jl: Interface package for StaticArrays.jl) which then get overloaded by ITensorsVisualizationBase and extended by the various visualization backend packages.

Also I should probably re-implement some of this using the new Pkg extensions system coming to Julia 1.9 (5. Creating Packages · Pkg.jl).