[Chore] Split divergences and the MCP registry into one file per component
Merged
CI
2d ago+3577+3577+0123456789012345678901234567890123456789-3387-3387-0123456789012345678901234567890123456789
The last audit PRs (#605 to #610) conflicted with each other in two shared files:
audit/divergences.yml: each PR appended its entries at the end of the file.mcp/data/registry.json: one JSON with components in alphabetical order. Breadcrumb, Bubble and Button sit next to each other, so their blocks touched.
This applies the fix #604 used for the component map: one file per component.
Changes
audit/divergences/<folder>.yml, plus a README describing the keys.Divergences.for_auditreads the folder and falls back to the singledivergences.ymlwhen auditing a checkout from before the split. An entry in the wrong file (e.g.component: dialoginsidesheet.yml) raises aConfigError. Grader lines now citeaudit/divergences/<folder>.ymlas the source.mcp/data/registry/index.json(version) andmcp/data/registry/components/<slug>.json. The builder deletes JSON files for components the gem no longer has.Registry.loadstill accepts a single JSON (test fixture,RUBY_UI_MCP_REGISTRY).- CI's "MCP registry up to date" check now diffs the folder, and
git add -Ncatches a component file that was never committed. - CLAUDE.md, gem/AGENTS.md, the mcp and audit READMEs and the shadcn-audit skill point at the new paths.
The split registry loads to the same data as the old registry.json (compared after parsing). After this, two PRs conflict only when they touch the same component or bump the version.
#585 still edits audit/divergences.yml and will need a rebase that moves its entry to audit/divergences/dialog.yml.
Test steps
cd audit && bundle exec rakecd mcp && bundle exec rake testcd mcp && bundle exec exe/ruby-ui-mcp-build && git status mcp/data: nothing changes.
š¤ Generated with Claude Code
Summary by cubic
Splits the audit divergences and MCP registry into one file per component so parallel PRs stop conflicting in shared data files.
audit/divergences.ymlbecomesaudit/divergences/<folder>.yml;Divergences.for_auditfalls back to the single file for checkouts from before the split, and raises aConfigErrorwhen both exist, an entry is in the wrong file, or a stray non-.ymlfile (other thanREADME.md) is in the folder. Grader lines cite the new path.mcp/data/registry.jsonbecomesmcp/data/registry/index.jsonpluscomponents/<slug>.json; the builder deletes files for components the gem no longer has, andRegistry.loadstill accepts a single JSON for test fixtures andRUBY_UI_MCP_REGISTRY. CI now diffs the folder and usesgit add -Nto catch files never committed.- The split registry parses to the same data as the old
registry.json, so two PRs conflict only when they touch the same component or bump the version.
Migration
- #585 still edits
audit/divergences.ymland needs a rebase to move its entry toaudit/divergences/dialog.yml.