Skip to content

All modules must be dependencies of primer-css... But should they? #236

@shawnbot

Description

@shawnbot

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:

  1. primer-css imports primer-core, which can be resolved by Sass in primer-css/node_modules because it's a dependency.
  2. primer-core imports primer-support, which doesn't exist in primer-css/node_modules unless primer-css also depends on primer-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. 🚧

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions