Skip to content

setup shadcn registry#431

Merged
hari merged 6 commits intomainfrom
feat/shadcn-registry
Apr 24, 2026
Merged

setup shadcn registry#431
hari merged 6 commits intomainfrom
feat/shadcn-registry

Conversation

@hari
Copy link
Copy Markdown
Contributor

@hari hari commented Apr 23, 2026

No description provided.

hari and others added 3 commits April 23, 2026 23:09
Introduces a shadcn-CLI-installable registry for every published component doc:

- scripts/build-registry.js walks content/docs/**/*.mdx, resolves each
  doc's source via the existing file=<rootDir>/... fenced blocks (works
  across cross-category docs like feature-cards/* pointing to card/*),
  pulls hook files referenced via @/hooks/*, extracts CSS blocks into
  shadcn's nested { selector: { prop: value } } structure, and routes
  @theme vars into cssVars.theme. Emits public/r/{category}/{name}.json
  with ~/-prefixed targets, version-pinned dependencies (resolved from
  package.json), categories, and author.
- components/registry-install.tsx renders pnpm/npm/yarn/bun tabs with a
  shadcn@latest add URL, reusing the existing CopyButton. Registered in
  mdx-components so any doc can drop <RegistryInstall category="..."
  name="..." />.
- templates/doc scaffolds the CLI block into every new doc going forward.
- public/_headers: cache /r/* at the edge with stale-while-revalidate so
  CLI installs hit cached JSON without blocking on origin.
- .env.production: bake https://animata.design for local prod builds
  since Next inlines NEXT_PUBLIC_* vars at build time (CI already
  overrides via workflow env).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…nt docs

Touches all 163 published component docs to (a) surface the shadcn CLI
install path above the existing manual steps, (b) upgrade terse
descriptions into SEO-friendly copy, and (c) correct the long-standing
framer-motion -> motion drift between install instructions and source.

- scripts/inject-registry-install.js (idempotent) splits each
  ## Installation section into ### CLI (<RegistryInstall ... />) and
  ### Manual (existing <Steps>), preserving manual copy-paste flow for
  users who want it.
- scripts/rewrite-descriptions.js rewrites 113 frontmatter descriptions.
  Existing usable copy is kept and padded; empty/short ones are
  synthesized from title + category + detected feature chips (motion,
  tsparticles, Radix, Lucide, hover/transforms/gradients/shadows) +
  category-specific use cases. Long descriptions get sentence-boundary
  trimming. After this pass: p50 desc length 124c (was 46c), no empty
  descriptions, max 158c (fits Google's meta cutoff).
- 38 MDX docs updated: `npm install framer-motion` -> `npm install
  motion`. The actual component sources import from `motion/react`
  (package: motion@^12), so the original instructions would have
  left CLI users with a missing module error.
- content/docs/card/notice-card.mdx normalized from CRLF to LF line
  endings; its frontmatter parser was silently failing on the CRLF,
  which is how we caught this.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Serves an LLM-friendly view of every component doc alongside the HTML
pages, following the llmstxt.org convention.

- scripts/build-docs-markdown.js emits public/docs/{category}/{name}.md
  for every published doc. Resolves file=<rootDir>/... fenced blocks
  with the actual source inline, expands <RegistryInstall ... /> into
  the real `pnpm dlx shadcn@latest add ...` command, strips
  <ComponentPreview> / <Steps> JSX, and prepends a header with title,
  description, canonical URL, registry URL, author, and labels.
- scripts/build-llms-txt.js emits public/llms.txt (~27 KB index, H2s
  in sidebar order with per-item links + descriptions) and
  public/llms-full.txt (~506 KB, same index followed by inlined
  markdown content). Base URL resolves via NEXT_PUBLIC_APP_URL with
  animata.design fallback.
- public/_headers: set Content-Type: text/markdown; charset=utf-8 for
  /docs/*.md, /llms.txt, and /llms-full.txt, plus the same CDN-friendly
  Cache-Control + CORS as /r/*.
- Wired both generators into prebuild and registry:build.
- Generated outputs (public/docs, public/llms*.txt) are gitignored;
  they rebuild every prebuild.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Important

Review skipped

Too many files!

This PR contains 174 files, which is 24 over the limit of 150.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7fa3b72-2b7d-432f-91d6-c65d9f026154

📥 Commits

Reviewing files that changed from the base of the PR and between b35730d and 5c20a17.

📒 Files selected for processing (174)
  • .env.production
  • .gitignore
  • components/mdx-components.tsx
  • components/registry-install.tsx
  • content/docs/accordion/faq.mdx
  • content/docs/background/animated-beam.mdx
  • content/docs/background/blurry-blob.mdx
  • content/docs/background/diagonal-lines.mdx
  • content/docs/background/dot.mdx
  • content/docs/background/grid.mdx
  • content/docs/background/interactive-grid.mdx
  • content/docs/background/moving-gradient.mdx
  • content/docs/background/zigzag.mdx
  • content/docs/bento-grid/eight.mdx
  • content/docs/bento-grid/eleven.mdx
  • content/docs/bento-grid/five.mdx
  • content/docs/bento-grid/four.mdx
  • content/docs/bento-grid/gradient.mdx
  • content/docs/bento-grid/nine.mdx
  • content/docs/bento-grid/seven.mdx
  • content/docs/bento-grid/six.mdx
  • content/docs/bento-grid/ten.mdx
  • content/docs/bento-grid/three.mdx
  • content/docs/button/ai-button.mdx
  • content/docs/button/algolia-blue-button.mdx
  • content/docs/button/algolia-white-button.mdx
  • content/docs/button/animated-follow-button.mdx
  • content/docs/button/duolingo.mdx
  • content/docs/button/external-link-button.mdx
  • content/docs/button/get-started-button.mdx
  • content/docs/button/ripple-button.mdx
  • content/docs/button/shining-button.mdx
  • content/docs/button/slide-arrow-button.mdx
  • content/docs/button/status-button.mdx
  • content/docs/button/swipe-button.mdx
  • content/docs/button/toggle-switch.mdx
  • content/docs/button/work-button.mdx
  • content/docs/card/blur-stack-card.mdx
  • content/docs/card/card-comment.mdx
  • content/docs/card/card-spread.mdx
  • content/docs/card/case-study-card.mdx
  • content/docs/card/comment-reply-card.mdx
  • content/docs/card/email-feature-card.mdx
  • content/docs/card/flip-card.mdx
  • content/docs/card/github-card-shiny.mdx
  • content/docs/card/github-card-skew.mdx
  • content/docs/card/glowing-card.mdx
  • content/docs/card/integration-pills.mdx
  • content/docs/card/led-board.mdx
  • content/docs/card/notice-card.mdx
  • content/docs/card/notification-card.mdx
  • content/docs/card/staggered-card.mdx
  • content/docs/card/swap-text-card.mdx
  • content/docs/card/webhooks-card.mdx
  • content/docs/carousel/expandable.mdx
  • content/docs/carousel/image-carousel.mdx
  • content/docs/container/animated-border-trail.mdx
  • content/docs/container/animated-dock.mdx
  • content/docs/container/cursor-tracker.mdx
  • content/docs/container/fibonacci-lines.mdx
  • content/docs/container/marquee.mdx
  • content/docs/container/nav-tabs.mdx
  • content/docs/container/scrolling-testimonials.mdx
  • content/docs/fabs/flower-menu.mdx
  • content/docs/fabs/speed-dial.mdx
  • content/docs/feature-cards/confirmation-message.mdx
  • content/docs/feature-cards/content-scan.mdx
  • content/docs/feature-cards/notify-user-info.mdx
  • content/docs/feature-cards/reminder-scheduler.mdx
  • content/docs/feature-cards/score-card.mdx
  • content/docs/feature-cards/subscribe-card.mdx
  • content/docs/feature-cards/survey-card.mdx
  • content/docs/feature-cards/swap-card.mdx
  • content/docs/feature-cards/tilted-card.mdx
  • content/docs/graphs/bar-chart.mdx
  • content/docs/graphs/commit-graph.mdx
  • content/docs/graphs/donut-chart.mdx
  • content/docs/graphs/gauge-chart.mdx
  • content/docs/graphs/progress.mdx
  • content/docs/graphs/ring-chart.mdx
  • content/docs/hero/hero-section-text-hover.mdx
  • content/docs/hero/hero-section.mdx
  • content/docs/hero/product-features.mdx
  • content/docs/hero/shape-shifter.mdx
  • content/docs/hero/slack-intro.mdx
  • content/docs/icon/hover-interaction.mdx
  • content/docs/icon/icon-ripple.mdx
  • content/docs/image/disclose-image.mdx
  • content/docs/image/image-box-shadow.mdx
  • content/docs/image/images-reveal.mdx
  • content/docs/image/photo-booth.mdx
  • content/docs/image/skew-image.mdx
  • content/docs/image/tilted-cover.mdx
  • content/docs/image/trailing-image.mdx
  • content/docs/image/zoom-image.mdx
  • content/docs/list/avatar-list.mdx
  • content/docs/list/flipping-cards.mdx
  • content/docs/list/menu-animation.mdx
  • content/docs/list/orbiting-items-3-d.mdx
  • content/docs/list/orbiting-items.mdx
  • content/docs/list/reveal-image.mdx
  • content/docs/list/transaction-list.mdx
  • content/docs/list/transition-list.mdx
  • content/docs/overlay/modal.mdx
  • content/docs/preloader/vertical-tiles.mdx
  • content/docs/progress/animatedtimeline.mdx
  • content/docs/progress/spinner.mdx
  • content/docs/section/pricing.mdx
  • content/docs/tabs/fluid-tabs.mdx
  • content/docs/tabs/shift-tabs.mdx
  • content/docs/text/animated-gradient-text.mdx
  • content/docs/text/bold-copy.mdx
  • content/docs/text/circular-text.mdx
  • content/docs/text/counter.mdx
  • content/docs/text/cycle-text.mdx
  • content/docs/text/double-underline.mdx
  • content/docs/text/gibberish-text.mdx
  • content/docs/text/glitch-text.mdx
  • content/docs/text/jitter-text.mdx
  • content/docs/text/jumping-text-instagram.mdx
  • content/docs/text/mask-text.mdx
  • content/docs/text/mirror-text.mdx
  • content/docs/text/scroll-reveal.mdx
  • content/docs/text/split-text.mdx
  • content/docs/text/staggered-letter.mdx
  • content/docs/text/swap-text.mdx
  • content/docs/text/text-border-animation.mdx
  • content/docs/text/text-explode-imessage.mdx
  • content/docs/text/text-flip.mdx
  • content/docs/text/ticker.mdx
  • content/docs/text/typing-text.mdx
  • content/docs/text/underline-hover-text.mdx
  • content/docs/text/wave-reveal.mdx
  • content/docs/widget/alarm-clock.mdx
  • content/docs/widget/battery-level.mdx
  • content/docs/widget/battery.mdx
  • content/docs/widget/calendar-event.mdx
  • content/docs/widget/calendar-widget.mdx
  • content/docs/widget/calorie-counter.mdx
  • content/docs/widget/clock-with-photo.mdx
  • content/docs/widget/cycling.mdx
  • content/docs/widget/delivery-card.mdx
  • content/docs/widget/direction-card.mdx
  • content/docs/widget/expense-tracker.mdx
  • content/docs/widget/flight-widget.mdx
  • content/docs/widget/fund-widget.mdx
  • content/docs/widget/live-score.mdx
  • content/docs/widget/mobile-detail.mdx
  • content/docs/widget/music-stack-interaction.mdx
  • content/docs/widget/music-widget.mdx
  • content/docs/widget/notes.mdx
  • content/docs/widget/profile.mdx
  • content/docs/widget/reminder-widget.mdx
  • content/docs/widget/reminder.mdx
  • content/docs/widget/score-board.mdx
  • content/docs/widget/security-alert.mdx
  • content/docs/widget/shopping-list.mdx
  • content/docs/widget/sleep-tracker.mdx
  • content/docs/widget/storage-status.mdx
  • content/docs/widget/storage-widget.mdx
  • content/docs/widget/study-timer.mdx
  • content/docs/widget/team-clock.mdx
  • content/docs/widget/video-chat.mdx
  • content/docs/widget/vpn-widget.mdx
  • content/docs/widget/water-tracker.mdx
  • content/docs/widget/weather-card.mdx
  • content/docs/widget/weekly-progress.mdx
  • package.json
  • public/_headers
  • scripts/build-docs-markdown.js
  • scripts/build-llms-txt.js
  • scripts/build-registry.js
  • scripts/inject-registry-install.js
  • templates/doc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/shadcn-registry

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.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 23, 2026

Deploying animata with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5c20a17
Status: ✅  Deploy successful!
Preview URL: https://65fe8836.animata.pages.dev
Branch Preview URL: https://feat-shadcn-registry.animata.pages.dev

View logs

The synthesized descriptions from scripts/rewrite-descriptions.js felt
templated and lost the voice of the original copy. Reverting the 113
MDX frontmatter descriptions to their state on main and removing the
rewriter script. Registry JSONs and llms.txt regenerate from the
restored descriptions (p50 desc length back to 46c, matching baseline).

RegistryInstall insertions and the framer-motion -> motion fix from
the same commit remain intact — only the description field was touched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1df063dedb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/build-registry.js Outdated
@hari hari merged commit ea01da0 into main Apr 24, 2026
6 checks passed
@hari hari deleted the feat/shadcn-registry branch April 24, 2026 10:27
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