-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
One thing that @broccolini and I had to do to get the primer-css module building successfully in the new monorepo structure (see #230) was to manually add all of the submodules to the dependencies in primer-css/package.json. Here's an example of why:
primer-cssimportsprimer-core, which can be resolved by Sass inprimer-css/node_modulesbecause it's a dependency.primer-coreimportsprimer-support, which doesn't exist inprimer-css/node_modulesunlessprimer-cssalso depends onprimer-support.
In other words, generally speaking: Every primer module currently must list all of its dependencies' dependencies (and so on) in order to build successfully with primer-module-build. This is... not ideal. It's not super brittle because we've already listed all of the modules — but the next time that we do add a module, we need to be sure to add it as a dependent of primer-css in addition to any other modules that use it.
We could potentially get around this by changing the way that primer-module-build resolves imports, or look at a tool like Eyeglass that does this already. Whether we decide to fix it or not, it's something to be aware of. 🚧