refactor(mosaic): move @clerk/headless primitives into @clerk/mosaic - #9819
alexcarpenter wants to merge 4 commits into
Conversation
The private @clerk/headless package is merged into @clerk/mosaic as an internal primitives/ module now that Mosaic ships as its own package; splitting them was only ever needed while Mosaic lived inside clerk-js. No public API changes — primitives were never exported externally. Primitive tests keep their original happy-dom environment and setup (no clerk-js rAF mock) via a dedicated vitest project, since folding them into mosaic's jsdom project changed focus-timing behavior in floating-ui-driven components.
🦋 Changeset detectedLatest commit: 1a00a66 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedToo many files! This PR contains 312 files, which is 12 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (312)
You can disable this status message by setting the Comment |
main added DataList after the headless->mosaic primitives move landed, so it still imported from the now-removed private package. Also dedupes the lockfile to satisfy CI's dedupe --check.
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
…s too The packages/mosaic override block that disables jsx-a11y/heading-has-content and jsx-a11y/label-has-associated-control lived inside a block whose `ignores` excludes *.test.tsx (written for the unrelated StyleX rules). That left the jsx-a11y rules active on test files, where Mosaic's render-prop pattern triggers them just as much as on the components themselves. Split them into their own override with no test-file exclusion.
Description
@clerk/mosaicnow ships as its own package, so there's no longer a reason to keep the unstyled primitives (Accordion, Dialog, Select, etc.) in a separate private@clerk/headlesspackage — that split only existed while Mosaic lived inside clerk-js. This lifts and shiftspackages/headless/src/primitives/**intopackages/mosaic/src/primitives/**as internal building blocks, consumed via relative imports. Primitives were never exported externally, so there are no public API changes.One behavioral fix was needed, not just a file move: primitives originally ran on
happy-domwith a minimal test setup; folded into Mosaic's jsdom + shared clerk-js test setup, they picked up arequestAnimationFramemock (built for clerk-js's auto-animate usage) that changed focus-on-open timing in floating-ui-driven components and broke two Select tests. Fixed by giving primitives their ownvitestproject that keeps the original happy-dom environment and setup, so their test conditions are unchanged from the old package.Docs, skills, and the Swingset stories/docs referencing
@clerk/headlessare updated to reflect the new location.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change