Skip to content

feat(designSystem): panda lib + consumer propagation#3634

Open
Adebesin-Cell wants to merge 11 commits into
chakra-ui:v2from
Adebesin-Cell:feat/design-system-phase-5
Open

feat(designSystem): panda lib + consumer propagation#3634
Adebesin-Cell wants to merge 11 commits into
chakra-ui:v2from
Adebesin-Cell:feat/design-system-phase-5

Conversation

@Adebesin-Cell

@Adebesin-Cell Adebesin-Cell commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Phase 5 of designSystem: the panda lib command, plus what a consumer gets from adopting one. Design note: design-notes/design-system-manifest.md.

panda lib publishes a design system in one command. It scans your library source, builds portable build info, compiles your config into a preset.mjs, writes the three artifacts into dist, and syncs your package.json exports. It's idempotent and takes --watch.

Adopting a designSystem now does more on your side too:

  • A version drift receipt between runs, from .panda/design-system-state.json.
  • A warning when a library and your config both define a token path. Your value wins; the override is just made visible.
  • A fallback when a library's build info can't hydrate. Panda re-extracts the manifest's files instead of failing. It fails closed only when there's no files to fall back to.

How it works

  • compilePreset (@pandacss/config) bundles your config through a virtual entry that strips app and parent fields (designSystem, include, outdir, …). A nested library ships its own additions only; the parent travels in the manifest's designSystem field. Functions survive because the module is bundled, not serialized.
  • Token conflicts use a new fs-free token_conflicts primitive in pandacss_project, mirrored across the NAPI and wasm bindings and exposed as compiler.designSystem.tokenConflicts. It compares your own pre-merge token paths against each design-system layer.
  • Stale-build-info and token-conflict warnings surface through a new Driver.designSystemDiagnostics channel. The drift receipt rides Driver.designSystemDrift.

Tests

  • pandacss_project token-conflict units; binding round-trip for tokenConflicts.
  • @pandacss/config: compilePreset, lib-manifest, drift.
  • @pandacss/cli: the lib command, including idempotency and --watch.
  • @pandacss/compiler: consumer hydrate — stale fallback, fail-closed, and token conflict.

Notes

  • ship/emit-pkg don't exist on v2, so there was nothing to remove.
  • Deferred to Phase 6: the styled-system subpath exports (./css, ./recipes, …) come from codegen. Still open: cross-package source watch (open item fix (extension): update extension config types #4) and build-info tree-shaking to the consumer's actual imports.
  • Unrelated to this PR: the @pandacss/compiler suite has pre-existing JSX-extraction failures on this branch. They're identical with this PR's commits removed, so they're not introduced here. I'm tracking the root cause separately.

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 21e466a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@pandacss/compiler-shared Minor
@pandacss/compiler Minor
@pandacss/config Minor
@pandacss/cli Minor
@pandacss/compiler-wasm Minor
@pandacss/eslint-plugin Minor
@pandacss/postcss Minor
@pandacss/vite Minor
playground Patch
@pandacss/dev Minor
@pandacss/mcp Minor
website Patch
@pandacss/preset-base Minor
@pandacss/preset-panda Minor
@pandacss/types Minor

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

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
panda-docs Error Error Jun 29, 2026 8:34pm

Request Review

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Adebesin-Cell is attempting to deploy a commit to the Chakra UI Team on Vercel.

A member of the Team first needs to authorize it.

@Adebesin-Cell Adebesin-Cell changed the title feat(designSystem): panda lib + consumer propagation (Phase 5) feat(designSystem): panda lib + consumer propagation Jun 29, 2026
Comment thread crates/pandacss_stylesheet/tests/.sort.rs.pending-snap Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants