feat(compiler): design-system manifest value + engine gen/load#3604
Open
Adebesin-Cell wants to merge 15 commits into
Open
feat(compiler): design-system manifest value + engine gen/load#3604Adebesin-Cell wants to merge 15 commits into
Adebesin-Cell wants to merge 15 commits into
Conversation
phase 1 of designSystem support. adds the panda.lib.json manifest type and Project::design_system_manifest, exposed as compiler.designSystem (create + validate) across native and wasm. pure (no fs); no config field or CLI yet.
🦋 Changeset detectedLatest commit: d6b24be The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 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.
|
|
@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. |
…ystem-manifest
…Cell/panda into design-system-manifest
…ystem-manifest
The wasm binding had no manifest coverage; native had no error-path coverage. Add a wasm design-system suite mirroring native (create/stamp, importMap object parity, optional omission, validate) plus missing-required, unknown-field, and empty-files edges on native.
ac3eba5 made normalize_leaf a no-op so utility class names keep authored segments; atoms() now carries authored values (CSS still resolves at emit). The native callbacks test was updated then; the wasm one was missed.
Add load() to the compiler.designSystem namespace: the consumer side of the design-system manifest. It validates the manifest, then resolves and hydrates the library's pre-extracted styles, tree-shaken to the consumer's imports. Composed over the existing buildInfo primitives so the resolve + hydrate logic stays in one place; the preset/importMap merge is the host's, since the value layer can't execute the preset module. Covered on native + wasm bindings and the fallback.
Add resolveChain to the compiler.designSystem namespace: the composition case. Given the manifests the host already read, order a chain of parent design systems root-first, dedup shared ancestors, and report cycles — pure value logic (resolve_chain in pandacss_project) with no fs, so the recursion + cycle guard are exercised in-memory. Exposed across native + wasm bindings and the fallback.
# Conflicts: # packages/compiler/src/index.ts
…ystem-manifest # Conflicts: # packages/compiler/src/fallback.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
introduce first-class design systems, starting with the manifest.
designSystem: '@acme/ds'backed by apanda.lib.jsonmanifest that ties a library's preset, build info, import paths, and its own parent design system into one resolvable unit.compiler.designSystemacross the native and wasm bindings:create— produce a manifest from a built project (panda lib, later).validate— schema check.load— the consumer side: validate the manifest, then hydrate the library's pre-extracted styles, tree-shaken to the consumer's imports.resolveChain— the composition case: order a chain of parent design systems root-first, deduping shared ancestors and reporting cycles.why
adopting a design system today means hand-wiring
presets+importMap+include+ abuildinfopath, and re-extracting every imported component in every app. the manifest collapses that to one field.the hard logic — generation, consumption, and the parent-chain walk — is pure compiler methods over in-memory values. the engine owns it, the host owns fs + module resolution. so the bug-prone parts (version guard, resolve + hydrate, and the cycle guard in the chain walk) are testable without touching disk.
notes
designSystemconfig field, nopanda libCLI yet. the config field, host module resolution, smartinclude, andpanda libare later phases — laid out in the design note.loadcovers the build-info half of consumption. the preset +importMapmerge into the consumer config is the host's job: the value layer can't execute the preset module. on any incompatibilityloadreturns{ ok: false, reason }so the host falls back to re-extracting the manifest'sfiles.resolveChaintakes the manifests the host already read and returns the root-first merge/hydrate order (or a cycle path). a parent absent from the set is a chain boundary — the host owns parent-not-found via module resolution.createstamps the schema version and carries host-supplied fields today;importMapand the parentdesignSystemcome from resolved config in phase 2. the input shape already allows them, so that lands without a signature change.staticCss, layer ordering). three genuinely-open items remain.test plan
cargo test -p pandacss_project --test integration design_system— manifest value (stamp + carry, optional omission, json round-trip) + chain resolution (depth-n order, shared-parent dedup, absent-parent boundary, cycle path, empty set)design-system(15: create/validate, load hydrate + tree-shake + mismatch, resolveChain order/dedup/cycle) +build-info(17, no regression)design-system(9: create/validate + load + resolveChain over the boundary) +build-info(3)pnpm typecheckcargo fmt --all --check; clippy onpandacss_project,compiler_napi,compiler_wasmcompiler.node+ wasm bundle so the binding tests ran against the new methods