fix: component loading 10 -> 45 via registry scanning#40
Merged
Conversation
Two blockers prevented veneer from rendering most rafters component previews. Multi-element JSX code blocks (common in docs) caused oxc_parser panics because adjacent JSX elements are not valid JS. Fixed by wrapping in a fragment before parsing. The registry only scanned for variantClasses in .tsx files, missing the 44 .classes.ts files where rafters stores its class definitions. Scanner now reads .classes.ts with prefix-derived conventions. Components without variant records get passthrough Web Components for static previews. Coverage goes from 8 to 59 of 60 component docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three fixes to the component registry scanner:
1. Relax MissingVariants gate: Components with base_classes or
size_lookup (but no variant records) now register. This picks up
structural components like avatar, card, empty, item, kbd.
2. Handle nested object variants: extract_object_entries now
concatenates string values from nested objects like
{ border: 'border-primary', checked: 'bg-primary' }. This picks
up checkbox, slider, switch.
3. Fallback class extraction: .classes.ts files that export individual
class constants (accordionItemClasses, dialogOverlayClasses, etc.)
without matching {prefix}VariantClasses conventions now register
via extract_all_exported_classes fallback.
Verified: `veneer build` from rafters loads 45 components (was 10).
All 167 tests pass, clippy clean, fmt clean.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 tasks
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.
Summary
*Classesconstants without the{prefix}VariantClassesconventionTest plan
🤖 Generated with Claude Code