Repository navigation
fix(docs): sync header version badge to published CLI version - #79
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
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 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. 📝 WalkthroughWalkthroughA new ChangesCLI Version Sync Pipeline
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (6)
apps/www/components/site-header.tsxapps/www/config/version.tspackage.jsonscripts/build-registry.tsscripts/sync-version.mjsscripts/sync-version.test.ts
Type
Summary
The home-page header badge was hard-coded to
v1.0.0while the published CLI is at1.1.5, so the docs site advertised the wrong version. This derives the badge from a generatedLIBRARY_VERSIONconstant that mirrorspackages/cli/package.json, and wires the sync into bothbuild:registryandversion-packagesso 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 versionpnpm build:registry— regeneratesapps/www/config/version.ts, no unexpected diffnode scripts/sync-version.mjs— standalone sync produces matching outputpnpm --filter uniqueui-cli build(not touched)How it works
apps/www/config/version.tsis a new auto-generated constant mirroring the CLI's published version;site-header.tsxrendersv{LIBRARY_VERSION}instead of the literalv1.0.0.scripts/build-registry.tsgainssyncVersionConstant()so every registry build refreshes the badge.scripts/sync-version.mjsis a standalone sync hooked into theversion-packagesscript, so a Changeset version bump updates the badge in the same commit.scripts/sync-version.test.tsguards against drift in CI (added totest:repo).Related issues
Summary by CodeRabbit
New Features
Bug Fixes
Tests