Skip to content

Add the official Logo.dev shadcn/ui component registry - #4

Merged
alexbaldwin merged 4 commits into
mainfrom
feat/shadcn-registry
Jul 7, 2026
Merged

Add the official Logo.dev shadcn/ui component registry#4
alexbaldwin merged 4 commits into
mainfrom
feat/shadcn-registry

Conversation

@alexbaldwin

Copy link
Copy Markdown
Contributor

What this is

This turns the public logo-api repo into the home of Logo.dev's open source components, starting with a shadcn/ui registry — the same model as firecrawl/firecrawl hosting everything open source in one repo.

Six installable items, all zero-npm-dependency (shadcn primitives resolve from ui.shadcn.com):

Item What it does
logo Bulletproof logo image: domain/name/ticker/crypto/ISIN lookup, 1x/2x retina srcSet, provider-free dark mode (dark: variant pair), monogram/initials/custom fallback chain
logo-avatar Logo in a shadcn Avatar shell with initials fallback
brand-search Debounced + abortable company autocomplete (cmdk/Popover) plus a Next.js route handler that keeps the sk_ key server-side
logo-wall Customer logo grid, CSS grayscale-to-color hover, attribution on by default
attribution Free-plan attribution link (rel="noopener" only — referrer stays intact)
logo-lib Typed URL builder + srcset/initials helpers shared by everything

How it's distributed

  • npx shadcn@latest add logo-dev/logo-api/logo (GitHub form, works on merge, pinnable to tag/SHA)
  • npx shadcn@latest add https://www.logo.dev/r/logo.json (branded URL; marketing-site PR adds a /r/* rewrite to this repo's committed r/ output — follow-up)
  • @logodev/logo once we're listed in shadcn's registry directory (follow-up PR to shadcn-ui/ui)

Built JSON is committed in r/ and CI fails if it drifts from the sources (git diff --exit-code r/). components/ui/ holds vendored primitives for typechecking only.

Verification

  • 16 unit tests on the URL builder (paths per lookup kind, encoding, size clamp, fallback=404 mapping, srcset shape, token precedence); typecheck + Biome (ultracite) clean
  • Full consumer e2e in a fresh create-next-app (shadcn v4, radix-nova preset): installed via direct URL and @logodev namespace; dep chain pulled button/command/popover/avatar + cross-item deps; imports rewritten to consumer aliases; env keys written to .env.local; tsc --noEmit + next build clean
  • Runtime with real keys: all five lookup types render, dead domain falls back to an initials tile (via fallback=404 → onError), dark-mode class toggle swaps to dark logo variants, brand search fires exactly 1 request for 4 keystrokes (200ms debounce + abort) with logos per result, logo wall renders attribution with referrer intact

⚠️ Call for review

  • LICENSE: this adds MIT to a previously license-less public repo (copyright Logodev, Inc.) — confirm that's the intended grant before merging.
  • Cross-item registryDependencies point at https://www.logo.dev/r/*.json, so installs of dependent items resolve fully once the marketing rewrite deploys; the GitHub install form works for everything immediately after that.

🤖 Generated with Claude Code

@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

alexbaldwin and others added 2 commits July 6, 2026 11:17
Six installable items (logo, logo-avatar, brand-search, logo-wall,
attribution, logo-lib) with sources in registry/new-york/, built JSON
committed in r/, and CI enforcing typecheck/lint/test plus build-output
sync. components/ui/ holds vendored shadcn primitives for typechecking
only. MIT license added (repo previously had none).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Some shadcn Avatar variants (e.g. radix-nova) define their own string
size variant, which intersected with our numeric size prop to never.
Caught installing into a radix-nova consumer app.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alexbaldwin
alexbaldwin force-pushed the feat/shadcn-registry branch from 32c8f67 to 5d22570 Compare July 6, 2026 15:18
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Codex review (P2): brand-search.tsx imported ChevronsUpDownIcon from
lucide-react, but the registry item never installed that package. A
consumer whose project lacks lucide-react (e.g. initialized with a
different icon library, or none) would get code that fails to compile.

shadcn's own primitives import lucide directly because `shadcn init`
always installs it, and its registry transform only rewrites an explicit
<IconPlaceholder> element per the consumer's configured iconLibrary. Since
this block uses exactly one decorative icon, inline it as a self-contained
SVG instead: zero dependencies, works on any icon setup, nothing to
declare in registry.json.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

- P1 (logo-dev.ts): reading process.env for the token broke TypeScript in
  browser-only consumers without @types/node ("Cannot find name 'process'").
  Add a minimal ambient `declare const process` so the file typechecks with
  or without @types/node. Verified the literal process.env.NEXT_PUBLIC_*
  access still gets inlined into Next.js client bundles.
- use-brand-search.ts: fix a stale-results race — the in-flight request is now
  aborted in effect cleanup (not only when the next debounce fires) and state
  updates are guarded on the controller, so an older query's response can't
  overwrite the current results. Also fix endpoint query-string joining so a
  custom endpoint with existing params (?tenant=acme) stays valid.
- logo.tsx: respect a decorative alt="" on the initials fallback tile
  (aria-hidden instead of an announced role=img), and reset the errored flag
  on the full request identity (fallback/format/theme/greyscale/size), so
  changing any URL option retries the image instead of sticking on a fallback.
- logo-dev.ts: use index access instead of Array.at() in logoInitials for
  broader TS lib-target portability.

Verified: typecheck, lint, 16 unit tests, registry build, a fresh Next.js
consumer install (logos render, dead-domain initials fallback, debounced
search), non-Node typecheck, and Next client-bundle token inlining.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@alexbaldwin
alexbaldwin merged commit c05660f into main Jul 7, 2026
1 check passed
@alexbaldwin
alexbaldwin deleted the feat/shadcn-registry branch September 1, 2026 20:33
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