Skip to content

[BUG] Registry only serves one item; build-registry.ts cannot run outside the author's machine #8

Closed

Description

@oliver-mee

Describe the bug

The published registry only serves one item. registry/registry.json in this repo declares 162 items, and scripts/build-registry.ts can generate 155 item files, but https://amicro.vercel.app/r/ only contains card-carousel.json and index.json. So shadcn add @amicro/<anything-else> fails for every other component.

Amicro is listed in the official shadcn registry directory (https://ui.shadcn.com/r/registries.json), so the CLI resolves @amicro out of the box and users hit this immediately.

There are three separate causes, all in the publishing path:

  1. scripts/build-registry.ts line 5 hardcodes an absolute path:

    const WORKSPACE_ROOT = 'c:/Users/we/Desktop/Amicro---Micro-transitions';

    The script cannot run on any other machine, including CI.

  2. It writes to registry/, which is not served. Vite serves public/, and the registry URL registered in the directory is https://amicro.vercel.app/r/{name}.json, which maps to public/r/.

  3. It writes into type subfolders (registry/ui/<name>.json), so even under public/, the paths would be /r/ui/<name>.json rather than the flat /r/<name>.json the registry URL specifies.

The script is also not called by npm run build, so nothing regenerates the output at deploy time.

To Reproduce

# any item other than card-carousel
npx shadcn@latest view @amicro/fade-up
# The item at https://amicro.vercel.app/r/fade-up.json was not found.

curl -s -o /dev/null -w '%{http_code}\n' https://amicro.vercel.app/r/fade-up.json
# 200, but the body is the SPA's index.html, not JSON

The 200 is worth noting: the catch-all rewrite in vercel.json returns index.html for missing paths, so a missing registry item looks like a successful response. The shadcn CLI reports this as Unexpected token '<', which is confusing to debug.

@amicro/card-carousel does resolve correctly, because that one file was committed to public/r/ by hand.

Expected behavior

Every item in registry/registry.json is served at https://amicro.vercel.app/r/<name>.json, so shadcn add @amicro/<name> works for any component.

Screenshots

N/A, this is a build and hosting issue rather than a visual one.

Desktop (please complete the following information):

  • OS: Linux
  • Browser: N/A, reproduced with curl and the shadcn CLI
  • Version: shadcn CLI 4.18.0, Node 24

Smartphone (please complete the following information):

N/A, not device specific.

Additional context

I verified a fix locally. Pointing WORKSPACE_ROOT at process.cwd(), writing to public/r, and flattening the output generates 155 item files. Serving that directory and pointing the CLI at it gives working search and install:

$ shadcn search @amicro -q "loader"
- @amicro/morph-loader (ui) - Gooey/morphing shape loader.
- @amicro/waveform-loader (ui) - Waveform Loader loading animation.
- @amicro/skeleton-loader (ui) - Skeleton Loader loading animation.

$ shadcn view @amicro/fade-up
{ "name": "fade-up", "title": "Fade Up", "description": "Fade with upward translation.", ... }

Happy to open a PR with that change if the approach looks right to you. I left vercel.json alone, since Vercel only applies rewrites when a request does not match a static file, so the misleading 200 should resolve by itself once the files exist.

Activity

  1. Subhan-code commented on Sep 28, 2026

    @Subhan-code
    Owner

    resolved it thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions