Skip to content

ref(registry): fold changelogs.json into per-slug manifests - #72

Merged
pras75299 merged 2 commits into
mainfrom
chore/a5b-fold-changelogs
May 31, 2026
Merged

pras75299 merged 2 commits into
mainfrom
chore/a5b-fold-changelogs

Conversation

@pras75299

@pras75299 pras75299 commented May 31, 2026 •

Copy link
Copy Markdown
Owner

Type

  • New component / block (registry)
  • CLI change (init / add / list / info / doctor / search / shadcn JSON)
  • Docs site (apps/www)
  • Build / scripts / CI
  • Bug fix
  • Refactor / chore

Summary

Implements backlog A5b / ADR 0006: folds the global registry/changelogs.json monolith (~654 lines) into a required changelog array on each registry/components/<slug>.json manifest — the last global slug-keyed merge-conflict file after ADR 0003–0005.

Deleted

  • registry/changelogs.json

Manifest change

Each slug manifest now includes:

"changelog": [
  { "version": "1.1.0", "date": "2026-05-30", "changes": ["…"] },
  { "version": "1.0.0", "date": "2026-05-20", "changes": ["Initial release."] }
]

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Documentation**
  * Updated component contribution guidance to reflect simplified changelog workflow for new and updated components.
  * Documented the migration of changelog data architecture to per-component organization.

* **Chores**
  * Reorganized changelog storage from centralized to per-component structure, improving maintainability and consistency.
  * Component scaffolding now auto-generates initial changelog entries, streamlining the creation process.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@vercel

vercel Bot commented May 31, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
uniqueui-platform Ready Ready Preview, Comment May 31, 2026 3:50pm

@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@pras75299, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 31 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 58f566a1-96c9-48e3-97de-46a769ff7ca0

📥 Commits

Reviewing files that changed from the base of the PR and between ff12a81 and 25c1cf5.

📒 Files selected for processing (8)
  • apps/www/public/registry.json
  • apps/www/public/registry/gradient-text-reveal.json
  • apps/www/public/registry/horizontal-scroll-gallery.json
  • apps/www/public/registry/hover-reveal-card.json
  • registry.json
  • registry/components/gradient-text-reveal.json
  • registry/components/horizontal-scroll-gallery.json
  • registry/components/hover-reveal-card.json
📝 Walkthrough

Walkthrough

This PR implements ADR 0006 by migrating changelogs from a single global registry file into per-component manifest arrays. The schema is extended to require changelog on each component manifest, new aggregation logic builds a unified changelog map during the build process, all 60+ component manifests receive changelog entries, and contributor guidance is updated to reflect the new workflow.

Changes

Changelog Folding into Component Manifests

Layer / File(s) Summary
Schema contract for manifest changelogs
packages/registry-schema/src/index.ts, packages/registry-schema/src/index.test.ts
ComponentManifest now requires a changelog array validated by the exported ManifestChangelog schema. Tests validate that changelogs enforce newest-first semver ordering.
Changelog aggregation from manifests
scripts/changelogs-from-manifests.ts, scripts/changelogs-from-manifests.test.ts
New utility module exports changelogsFromManifestOrder and changelogsFromManifests to aggregate changelog arrays from per-component manifests into a deterministic slug-ordered map. Tests verify order preservation and drift detection against published aggregated JSON.
Build and validation pipeline updates
scripts/build-registry.ts, scripts/validate-registry.mjs, registry/types.ts
Build and validation scripts now derive changelogs from per-component registry/components/{slug}.json manifests using the aggregation utility, instead of reading a standalone registry/changelogs.json. Build continues to emit the aggregated changelog JSON as a build artifact.
Component scaffolding and migration tools
scripts/scaffold-component.mjs, scripts/scaffold-component.test.ts, scripts/migrate-changelogs-to-slug.mjs
scaffold-component.mjs now generates initial 1.0.0 changelog stubs directly in manifests via initialChangelog(). New one-shot migration script migrate-changelogs-to-slug.mjs moves all changelogs from the global file into per-slug manifests and validates no stray entries remain.
Migrate changelogs into all component manifests
registry/components/*.json (60+ files), registry/changelogs.json
All component manifests receive changelog entries: most get an initial 1.0.0 release dated 2026-05-20, while hero components get multi-version historical changelogs. Global registry/changelogs.json is deleted (−654 lines).
Documentation, ADRs, and contributor guidance
docs/adr/0006-fold-changelogs-into-slug-manifests.md, docs/adr/0003-fold-metadata-into-slug-manifests.md, .claude/skills/add-component/SKILL.md, CLAUDE.md, .cursor/rules/coderabbit-review-patterns.mdc, apps/www/app/changelog/page.tsx, scripts/check-agent-docs-drift.{mjs,test.ts}
ADR 0006 documents the migration rationale and consequences. Contributor guidance, review patterns, and changelog page comments are updated to reference per-manifest changelog arrays. Drift detection flags stale references to registry/changelogs.json.
Package and configuration updates
package.json
Test script entry is updated.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • pras75299/uniqueui#58: Introduced registry/changelogs.json as the registry changelog source; this PR replaces that source with per-component manifests.
  • pras75299/uniqueui#66: Reworked scripts/build-registry.ts to load registry metadata; this PR further changes how that script sources changelog data.
  • pras75299/uniqueui#68: Updated scaffolding and manifest structure; this PR extends scaffolding to generate per-manifest changelogs instead of global entries.

Poem

Changelogs scattered, now home in their slot,
Each component guards its release plot.
One global file bid fond farewell,
Per-slug manifests a cleaner tale tell. 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main refactoring: folding changelogs.json into per-slug component manifests as planned in ADR 0006.
Description check ✅ Passed The PR description identifies the type (Refactor/chore, Build/scripts, Docs site), provides a clear summary of the ADR 0006 implementation, and specifies key changes (deletion of global file and per-component changelog field).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/a5b-fold-changelogs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
packages/registry-schema/src/index.test.ts (1)

105-114: ⚡ Quick win

Assert the failure reason, not just .ok.

This test only checks ok === false, so it would still pass if the manifest were rejected for an unrelated reason — masking a regression in the ordering refinement itself. The sibling Changelogs test (lines 394-405) pins the error to /newest-first/; mirror that here so the test fails only when the descending-semver rule does.

💚 Proposed fix to pin the rejection reason
     it("rejects out-of-order changelog entries on the manifest", () => {
         const bad = {
             ...goodManifest,
             changelog: [
                 { version: "1.0.0", date: "2026-05-20", changes: ["Initial release."] },
                 { version: "1.1.0", date: "2026-05-21", changes: ["Update."] },
             ],
         };
-        expect(validate(ComponentManifest, bad).ok).toBe(false);
+        const r = validate(ComponentManifest, bad);
+        expect(r.ok).toBe(false);
+        if (!r.ok) expect(r.errors.join("\n")).toMatch(/newest-first/);
     });

As per coding guidelines: "Tests must encode WHY behavior matters, not just WHAT it does. A test that can't fail when business logic changes is wrong."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/registry-schema/src/index.test.ts` around lines 105 - 114, The test
currently only checks validate(ComponentManifest, bad).ok is false which can
mask unrelated failures; update the assertion to pin the rejection reason to the
changelog ordering refinement by inspecting the validation error from
validate(ComponentManifest, bad) and asserting the error path/message indicates
the newest-first rule (e.g., reference to "/newest-first/" or equivalent) so the
test fails only when the descending-semver changelog rule is violated; locate
the test using the names validate, ComponentManifest and bad/goodManifest and
replace the broad ok check with an assertion that the validation error contains
the "/newest-first/" indication.
scripts/migrate-changelogs-to-slug.mjs (1)

36-71: ⚡ Quick win

Validate everything before writing any manifest (avoid partial migration on failure).

The loop writes each manifest in place (Line 58) while validation of slug/filename match (Lines 41-44), missing changelog keys (Lines 46-49), and stray changelogs.json entries (Lines 62-71) is interleaved or deferred until after all writes. Any failure exits with a non-zero code only after some or all manifests have already been mutated, and with registry/changelogs.json still on disk — leaving the tree half-migrated and requiring a manual git checkout to recover.

Split into a validate phase (including the stray-entry check) that collects the computed next-states, then a write phase plus unlinkSync only once all checks pass.

♻️ Two-pass migration
     let updated = 0;
+    const pending = [];
 
     for (const file of manifestFiles) {
         const slug = file.replace(/\.json$/, "");
         const manifestPath = path.join(COMPONENTS_DIR, file);
         const manifest = readJson(manifestPath);
 
         if (manifest.slug !== slug) {
             console.error(`${file}: slug field "${manifest.slug}" does not match filename`);
             process.exit(1);
         }
 
         if (!(slug in changelogs)) {
             console.error(`changelogs.json: missing entry for "${slug}"`);
             process.exit(1);
         }
 
         const { motion, ...rest } = manifest;
         const next = {
             ...rest,
             changelog: changelogs[slug],
             ...(motion ? { motion } : {}),
         };
-
-        fs.writeFileSync(manifestPath, `${JSON.stringify(next, null, 2)}\n`);
-        updated++;
+        pending.push({ manifestPath, next });
     }
 
     const changelogSlugs = new Set(Object.keys(changelogs));
     for (const file of manifestFiles) {
         changelogSlugs.delete(file.replace(/\.json$/, ""));
     }
     if (changelogSlugs.size > 0) {
         console.error(
             `changelogs.json has stray entries: ${[...changelogSlugs].sort().join(", ")}`,
         );
         process.exit(1);
     }
+
+    for (const { manifestPath, next } of pending) {
+        fs.writeFileSync(manifestPath, `${JSON.stringify(next, null, 2)}\n`);
+        updated++;
+    }

Based on learnings: "Scaffold/CLI scripts must validate collisions (manifest.json order, existing paths) before creating files, never write then throw."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/migrate-changelogs-to-slug.mjs` around lines 36 - 71, The script
currently writes manifests in the first loop (fs.writeFileSync inside the for-of
over manifestFiles) before all validations complete, causing partial migrations
on failure; change to a two-pass process: first iterate manifestFiles, use
readJson and the existing slug checks (manifest.slug vs slug) and changelogs
membership checks to validate everything and build a Map (or object) of
manifestPath -> computed next JSON string (the "next" value you already
compute), also perform the stray-entry check using changelogSlugs; only if all
validations pass, do a second pass that writes the precomputed values to disk
with fs.writeFileSync (and perform any fs.unlinkSync removals once after
validation if needed). Reference symbols: manifestFiles, readJson,
manifest.slug, changelogs, changelogSlugs, next, manifestPath, fs.writeFileSync,
fs.unlinkSync.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@registry/components/gradient-text-reveal.json`:
- Around line 108-110: The JSON entry sets motion.reducedMotion to "none" but
lacks the required justification; add a motion.performanceNotes property
alongside motion.reducedMotion in the gradient-text-reveal.json component
explaining why the OS reduced-motion preference is intentionally not honored
(e.g., necessary for core UX, accessibility tradeoff, or performance
constraints), referencing the motion.reducedMotion field in your message so
reviewers can see the rationale.

In `@registry/components/horizontal-scroll-gallery.json`:
- Around line 84-86: The manifest sets motion.reducedMotion to "none" but lacks
motion.performanceNotes; add a motion.performanceNotes string explaining why the
component intentionally does not honor the user's OS reduced-motion preference
(e.g., brief rationale and any mitigation) so the rule for registry components
is satisfied; update the JSON for the horizontal-scroll-gallery component by
adding the motion.performanceNotes property alongside motion.reducedMotion with
a concise explanation.

In `@registry/components/hover-reveal-card.json`:
- Around line 123-125: Add a new motion.performanceNotes field next to
motion.reducedMotion in the hover-reveal-card component JSON to document why the
OS reduced-motion preference is intentionally not honored; update the object
that contains motion.reducedMotion ("none") to include a concise explanation
(e.g., required for key interaction/animation fidelity, technical constraints,
or accessibility tradeoffs) so the entry reads motion.reducedMotion and
motion.performanceNotes, referencing the hover-reveal-card component and the
motion block to locate where to add the note.

---

Nitpick comments:
In `@packages/registry-schema/src/index.test.ts`:
- Around line 105-114: The test currently only checks
validate(ComponentManifest, bad).ok is false which can mask unrelated failures;
update the assertion to pin the rejection reason to the changelog ordering
refinement by inspecting the validation error from validate(ComponentManifest,
bad) and asserting the error path/message indicates the newest-first rule (e.g.,
reference to "/newest-first/" or equivalent) so the test fails only when the
descending-semver changelog rule is violated; locate the test using the names
validate, ComponentManifest and bad/goodManifest and replace the broad ok check
with an assertion that the validation error contains the "/newest-first/"
indication.

In `@scripts/migrate-changelogs-to-slug.mjs`:
- Around line 36-71: The script currently writes manifests in the first loop
(fs.writeFileSync inside the for-of over manifestFiles) before all validations
complete, causing partial migrations on failure; change to a two-pass process:
first iterate manifestFiles, use readJson and the existing slug checks
(manifest.slug vs slug) and changelogs membership checks to validate everything
and build a Map (or object) of manifestPath -> computed next JSON string (the
"next" value you already compute), also perform the stray-entry check using
changelogSlugs; only if all validations pass, do a second pass that writes the
precomputed values to disk with fs.writeFileSync (and perform any fs.unlinkSync
removals once after validation if needed). Reference symbols: manifestFiles,
readJson, manifest.slug, changelogs, changelogSlugs, next, manifestPath,
fs.writeFileSync, fs.unlinkSync.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f1d3bb15-464b-4b5f-b1d9-51a14cd4b5c9

📥 Commits

Reviewing files that changed from the base of the PR and between 882cf02 and ff12a81.

📒 Files selected for processing (83)
  • .claude/skills/add-component/SKILL.md
  • .cursor/rules/coderabbit-review-patterns.mdc
  • CLAUDE.md
  • apps/www/app/changelog/page.tsx
  • docs/adr/0003-fold-metadata-into-slug-manifests.md
  • docs/adr/0006-fold-changelogs-into-slug-manifests.md
  • package.json
  • packages/registry-schema/src/index.test.ts
  • packages/registry-schema/src/index.ts
  • registry/changelogs.json
  • registry/components/3d-tilt-card.json
  • registry/components/ambient-glow-card.json
  • registry/components/animated-glowing-text-outline.json
  • registry/components/animated-tabs.json
  • registry/components/animated-timeline.json
  • registry/components/aurora-background.json
  • registry/components/bento-grid.json
  • registry/components/blur-reveal.json
  • registry/components/border-beam.json
  • registry/components/caustic-light-card.json
  • registry/components/chromatic-aberration-reveal.json
  • registry/components/confetti-burst.json
  • registry/components/count-up.json
  • registry/components/cursor-trail.json
  • registry/components/data-table.json
  • registry/components/dot-grid-background.json
  • registry/components/drawer-slide.json
  • registry/components/dynamic-info.json
  • registry/components/flip-card.json
  • registry/components/floating-dock.json
  • registry/components/glow-hero-section.json
  • registry/components/gradient-text-reveal.json
  • registry/components/hero-iridescent-sweep.json
  • registry/components/hero-liquid-aurora-mesh.json
  • registry/components/hero-logo-marquee.json
  • registry/components/hero-magnetic-letters.json
  • registry/components/hero-noise-dot-field.json
  • registry/components/hero-reference-pulse.json
  • registry/components/hero-terminal.json
  • registry/components/horizontal-scroll-gallery.json
  • registry/components/hover-reveal-card.json
  • registry/components/infinite-marquee.json
  • registry/components/interactive-cursor.json
  • registry/components/iridescent-foil-button.json
  • registry/components/kinetic-variable-headline.json
  • registry/components/limelight-nav.json
  • registry/components/liquid-glass-panel.json
  • registry/components/macbook-mock.json
  • registry/components/magnetic-button.json
  • registry/components/magnetic-text.json
  • registry/components/meteors-card.json
  • registry/components/mini-mac-keyboard.json
  • registry/components/morphing-card-stack.json
  • registry/components/morphing-modal.json
  • registry/components/moving-border.json
  • registry/components/multi-step-auth-card.json
  • registry/components/nested-comments.json
  • registry/components/notification-stack.json
  • registry/components/outlined-mega-mark.json
  • registry/components/particle-field.json
  • registry/components/pen-cursor.json
  • registry/components/radial-menu.json
  • registry/components/refractive-cursor-lens.json
  • registry/components/ripple.json
  • registry/components/scramble-text.json
  • registry/components/scroll-reveal.json
  • registry/components/shader-mesh-gradient.json
  • registry/components/shiny-text.json
  • registry/components/shooting-stars-grid.json
  • registry/components/skeleton-shimmer.json
  • registry/components/spotlight-card.json
  • registry/components/typewriter-text.json
  • registry/components/word-rotate.json
  • registry/types.ts
  • scripts/build-registry.ts
  • scripts/changelogs-from-manifests.test.ts
  • scripts/changelogs-from-manifests.ts
  • scripts/check-agent-docs-drift.mjs
  • scripts/check-agent-docs-drift.test.ts
  • scripts/migrate-changelogs-to-slug.mjs
  • scripts/scaffold-component.mjs
  • scripts/scaffold-component.test.ts
  • scripts/validate-registry.mjs
💤 Files with no reviewable changes (1)
  • registry/changelogs.json

@pras75299
pras75299 merged commit 0aa27d5 into main May 31, 2026
12 checks passed

This branch was successfully deployed

1 active deployment
Preview — 25c1cf56 Deployed May 31, 2026 by vercel[bot]
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.

1 participant