Cannot access inner dependencies via pinned-dep

I have project a structure that loosely follows:

components
  - src
  - bsconfig
main
  - src
  - bsconfig
     - components (pinned-dep)

Components has a dependency on rescript-material-ui where I am exposing some modules to main:

// components/src/Library.res
module Snackbar = {
  ...
  module AnchorOrigin = Mui.Snackbar.AnchorOrigin
}

However Snackbar.AnchorOrigin is not available in main, erroring with:

The module Components.Library.Snackbar.AnchorOrigin is an alias for module Snackbar-Mui.AnchorOrigin, which is missing

This is resolved by including rescript-material-ui as a bs-dependency in main, however this then exposes the entirety of MUI which defeats the point of having a separate guarded component library.

Is there any way to expose MUI from components in main, without having to add it as a bs-dependency?

I think you’d need to use include for this:

// components/src/Library.res
module Snackbar = {
  ...
  module AnchorOrigin = {
    include Mui.Snackbar.AnchorOrigin
  }
}

While the docs say that you should not use that keyword, for binding libraries it is mostly fine.

I’ve also tried using include which also doesn’t seem to work for the module and it’s submodules

module Snackbar = {
  include Mui.Snackbar
}

It looks like I can included modules at their lowest level of nesting, however this ends up with me manually having to re-export everything, and the types are incompatible as SnackBar.horizontal != Mui.Snackbar.horizontal

module Snackbar = {
  module AnchorOrigin = {
    include Mui.Snackbar.AnchorOrigin
  }

  type horizontal = Mui.Snackbar.horizontal
  type vertical = Mui.Snackbar.vertical

  let makeProps = Mui.Snackbar.makeProps
  let make = Mui.Snackbar.make
}