[RFC] Primer CSS package reorganization #652
Labels
area: tooling
💓collab
a vibrant hub of collaboration
major release
⭐️rep
an industry leading reputation
Tag: Breaking Change
TL;DR
Primer CSS can be a pain to use and maintain. To make things easier, we're moving all of the
primer-*
package source files into a new package called@primer/css
and doing away with individually published packages.The
primer
package will be unaffected by this change. Our next major release of Primer CSS will use a new@primer/css
package name, and "legacy" Primer installations may continue to use theprimer
andprimer-*
packages until you're ready to upgrade them.Motivations
Simplify use in Sass projects. Configuring Sass with the right include paths for an npm installation of
primer
and its sub-packages is tricky. Managing multiple "sub-packages" from the same "master" release ofprimer
is also harder than it should be. Distributing a single package solves both of these problems.Ease contribution and releasing. The monorepo setup is unwieldy and fragile. One package will be easier and quicker to run, test, and release. Adding a new component? Just make a directory! No need for a new
package.json
and cross-dependency version management.Simplify documentation. Maintaining per-package READMEs and supplemental docs is painful, and we've twice now (with the Style Guide and the new docs site) built up relatively complex workflows for pulling disparate docs from each package into a site structure that we hope feels cohesive. Co-locating all of the docs under one directory should make this a lot easier.
Separate concerns. A slew of purpose-built scripts and tools have grown here to solve problems specific to our monorepo setup. Each of these tools needs to be tested and maintained, and doing so distracts us from the real work of improving Primer. Many will simply go away when we squash the monorepo; the rest should live elsewhere and be released separately.
Simplify refactoring. Making big changes (e.g. migrating from Sass to postcss) involves effectively refactoring dozens of individual codebases. Even workflow-related improvements are time-consuming because we have dozens of
package.json
files to update.Upgrading
There will only be a handful of steps to migrate/upgrade once the new package is published:
@primer/css
packageprimer/<path>
→@primer/css/<path>
primer-<package>/<path>
→@primer/css/<package>/<path>
primer
and/or anyprimer-*
packagesThis repo will be renamed from
primer/primer
toprimer/css
, so links should be updated. GitHub does a great job redirects for renamed repos, though, so it shouldn't be a problem if they're not.We think this is going to dramatically simplify how we use, work on, and publish Primer CSS, and we're excited to get started.
🚀 ❤️ 🦄 ✨
The text was updated successfully, but these errors were encountered: