Skip to content

fix(docs): sync header version badge to published CLI version - #79

Merged
pras75299 merged 2 commits into
mainfrom
fix/header-version-sync
Jun 28, 2026
Merged

pras75299 merged 2 commits into
mainfrom
fix/header-version-sync

Conversation

@pras75299

@pras75299 pras75299 commented Jun 28, 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

The home-page header badge was hard-coded to v1.0.0 while the published CLI is at 1.1.5, so the docs site advertised the wrong version. This derives the badge from a generated LIBRARY_VERSION constant that mirrors packages/cli/package.json, and wires the sync into both build:registry and version-packages so it can never drift again.

Screenshots / video (UI changes only)

Test plan

  • pnpm exec vitest run scripts/sync-version.test.ts — badge equals published CLI version
  • pnpm build:registry — regenerates apps/www/config/version.ts, no unexpected diff
  • node scripts/sync-version.mjs — standalone sync produces matching output
  • pnpm --filter uniqueui-cli build (not touched)

How it works

  • apps/www/config/version.ts is a new auto-generated constant mirroring the CLI's published version; site-header.tsx renders v{LIBRARY_VERSION} instead of the literal v1.0.0.
  • scripts/build-registry.ts gains syncVersionConstant() so every registry build refreshes the badge.
  • scripts/sync-version.mjs is a standalone sync hooked into the version-packages script, so a Changeset version bump updates the badge in the same commit.
  • scripts/sync-version.test.ts guards against drift in CI (added to test:repo).

Related issues

Summary by CodeRabbit

  • New Features

    • The website now shows the current library version automatically in the brand area.
    • Version information is now kept in sync with the released CLI version.
  • Bug Fixes

    • Replaced the previously hardcoded displayed version so the site no longer shows outdated release numbers.
  • Tests

    • Added coverage to ensure the displayed version matches the published CLI version.

@vercel

vercel Bot commented Jun 28, 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 Jun 28, 2026 5:23am

@coderabbitai

coderabbitai Bot commented Jun 28, 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 51 minutes and 25 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ 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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 45385bc0-b101-49dc-a0ee-5b6bd6a1d364

📥 Commits

Reviewing files that changed from the base of the PR and between 2b3af1d and cadc097.

📒 Files selected for processing (1)
  • scripts/sync-version.mjs
📝 Walkthrough

Walkthrough

A new sync-version.mjs script reads packages/cli/package.json and generates apps/www/config/version.ts exporting LIBRARY_VERSION. This generation is also integrated into build-registry.ts. The site header now imports and renders LIBRARY_VERSION instead of a hardcoded string. A Vitest test and package.json script updates enforce the sync.

Changes

CLI Version Sync Pipeline

Layer / File(s) Summary
sync-version script and generated version.ts
scripts/sync-version.mjs, apps/www/config/version.ts
sync-version.mjs reads and validates packages/cli/package.json, then writes version.ts exporting LIBRARY_VERSION; the committed generated file contains "1.1.5".
build-registry.ts syncVersionConstant integration
scripts/build-registry.ts
Adds CLI_PACKAGE_FILE and APP_VERSION_FILE path constants, introduces syncVersionConstant() with the same generation logic, and calls it inside buildRegistry() before the shadcn sync step.
Site header, script wiring, and test
apps/www/components/site-header.tsx, package.json, scripts/sync-version.test.ts
site-header.tsx imports and renders LIBRARY_VERSION dynamically; package.json adds node scripts/sync-version.mjs to version-packages and scripts/sync-version.test.ts to test:repo; the new test asserts the generated constant matches the CLI package version.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A version once hardcoded sat,
Now synced from CLI just like that!
A script reads the JSON with care,
Writes a constant fresh into the air.
The header now knows what version we're at! 🎉

🚥 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 title is concise, follows Conventional Commits, and accurately reflects the version badge sync change.
Description check ✅ Passed The description matches the template and includes type, summary, test plan, and implementation details.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/header-version-sync

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.

@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: 1

🤖 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 `@scripts/sync-version.mjs`:
- Around line 1-6: The path resolution in sync-version.mjs is anchored to
process.cwd(), which can point at the wrong repo files when the script is
launched from elsewhere. Update the script to derive rootDir from the script
location using import.meta.url, and keep cliPackagePath and versionFilePath
based on that resolved directory so it matches the behavior used by
build-registry.ts. Use the existing top-level path setup in sync-version.mjs to
make both entry points resolve the same repository paths consistently.
🪄 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: 91719b46-e35e-4c70-84d5-6cc1e6026b99

📥 Commits

Reviewing files that changed from the base of the PR and between 654a614 and 2b3af1d.

📒 Files selected for processing (6)
  • apps/www/components/site-header.tsx
  • apps/www/config/version.ts
  • package.json
  • scripts/build-registry.ts
  • scripts/sync-version.mjs
  • scripts/sync-version.test.ts

Comment thread scripts/sync-version.mjs Resolved
@pras75299
pras75299 merged commit f429ada into main Jun 28, 2026
12 checks passed

This branch was successfully deployed

1 active deployment
Preview — cadc0975 Deployed Jun 28, 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