-
Notifications
You must be signed in to change notification settings - Fork 53
Convert Primer Brand to a monorepo #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: fdf935f The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🟢 No visual differences foundOur visual comparison tests did not find any differences in the UI. |
🟢 No design token changes found |
Thanks for trying it out @joshblack! Love the feedback.
Prettier and ESLint configs are already in the monorepo root, or are you referring to something else? Jest config however lives in React for now, because the config was mostly React-oriented. I can look at hosting out anything generic to the top-level though. Leave that with me. Does that cover it?
Great point. The
Thanks for the Loom demo, it's certainly a confusing issue. I've already looked at bumping the React libraries to v18. Storybook was the only blocker during that attempt, but they've very recently shipped support for it so I may just give the upgrade another go. One the other hand, I do wonder whether create-react-app and other e2e integrations should even resolve modules at a workspace level. My thinking is to keep them isolated and free of side-effects, like docs is currently. Reason being, they are meant to represent clean installations and it's harder to make them deterministic or representative of an end-user experience otherwise. Appreciate it goes against a workspaces inherent dependency resolution, but I see it as an intentional feature, rather than a bug. For context, the current integration tests for those frameworks are ephemerally generated, which gives higher confidence that the library will work e2e.
Absolutely. We haven't needed to solve this yet, because Primer Brand is typically used in SSR sites first, so CommonJS provided the maximum compatibility, particularly with Next.js which only recently gained support for ESM under an experimental flag. Initially I went the ESM-first route.. but the e2e compatibility just wasn't there at the time. The current Webpack build config is flexible and we can add support for a separate ESM bundle whenever we're ready. Same applies to code splitting. I just kicked this problem down the road for now. |
There seems to be a peer dependency issue when following the install steps that you provided. This could then be mitigated using the legacy dependencies flag. After that issue there was another: |
@JoshBowdenConcepts I've updated the description. The
Is this when running |
This is when running the build command. And yes it seems that webpack has failed. I am not sure why I seem to be running into these issues more often than others haha |
Summary
Conversion of Primer Brand to a monorepo per the ADR.
Part of https://github.com/github/primer/issues/1366
List of notable changes:
react
,e2e
,design-tokens
andstorybook
into their own packages@primer/brand-primitives
Benchmarks
Before and after benchmarks for CI runs.
What should reviewers focus on?
Steps to test:
git checkout -b rezrah/npm-workspace origin/rezrah/npm-workspace
npm install && cd apps/docs && npm install --legacy-peer-deps
(because docs is outside workspace for now)npm run build
npm run lint
npm run format
npm run check
npm run test
npm run start
(should open Storybook, Docs in the browser)Supporting resources (related issues, external links, etc):
Contributor checklist:
Reviewer checklist:
Screenshots: