[Feature] shadcn-audit: one component map file per component
Why
Adding a component to the shadcn audit touched the same lines in four shared files, so the parallel PRs for Badge (#600), AspectRatio (#601) and Avatar (#602) conflicted with each other. This PR takes two of those files out of every component PR.
Changes
audit/component_map.ymlis split intoaudit/component_map/<folder>.yml, one file per component. The content is identical (checked by loading both and comparing). The key reference moves toaudit/component_map/README.md. A new component adds its own file.ComponentMap.for_audit(audit_dir)reads the directory and falls back to the singlecomponent_map.yml, so preview checkouts of SHAs from before the split still load.sandbox_test.rbandrubyui_preview_test.rbread the folder list fromaudit/fixtures/and theshadcn addlist from the map; neither is hardcoded anymore. A new test checks that every fixture has a map file and every entry with selectors has fixtures.map <folder>for an unmapped folder also returnspath, the file to create. Config errors name the file:component_map/dialog.yml: unknown kind ā¦.- The skill,
grading.md,audit/README.mdandgem/AGENTS.mdpoint at the new layout.
mcp/data/registry.json still conflicts between component PRs. It is generated, so the fix is to rebuild it after merging main instead of resolving the conflict by hand. That is out of scope here.
Test steps
cd audit
bundle exec rake # 216 runs, 0 failures; standardrb clean
bundle exec exe/shadcn-audit map badge # entry from component_map/badge.yml
bundle exec exe/shadcn-audit map button # {"missing": true, "path": "audit/component_map/button.yml", ...}
š¤ Generated with Claude Code
Summary by cubic
Splits audit/component_map.yml into one file per component, audit/component_map/<folder>.yml, so adding a component no longer touches shared lines that conflict across parallel component PRs (Badge, AspectRatio, Avatar).
- New components add their own
<folder>.yml; the key reference moves toaudit/component_map/README.md. ComponentMap.for_auditreads the directory and falls back to the legacy single file, so preview checkouts of pre-split SHAs still load.map <folder>for unmapped folders now returns the file path to create; config errors name the exact file.- Sandbox and preview tests read folders and component lists from
audit/fixtures/and the map instead of hardcoding them, with a new test ensuring every fixture has a map file and every compared entry has fixtures. - Skill,
grading.md,audit/README.md, andgem/AGENTS.mdreference the new layout.
Migration
mcp/data/registry.json remains a conflict point between component PRs; rebuild it after merging main instead of resolving manually.