Skip to content
WebJs
Menu

Registry Health

How to check that a registry works with the CLI.

Registries can change or go offline after they are added to the directory. Checking them keeps users from running an install command that fails.

Check a registry with the CLI.

A registry owner checks a registry in the directory with the CLI, which validates everything it fetches. The checks below cover the index, the items, an install and drift.

What to check

CheckCommandWhat it proves
Registry indexlist --registry <url><url>/index.json is online and every entry parses as a registry item.
Registry itemsview <name> --registry <url><url>/<name>.json downloads and parses as a registry item, and prints the source of every file.
CLI installadd <name> --registry <url>The item, its registry dependencies and its npm dependencies install into a project.
Driftdiff --registry <url>The files a project installed still match what the registry serves.

Each command fails with the HTTP status when a file is missing, and with the schema error when a file does not conform, so a non-zero exit is the signal.

pnpm dlx @webjsdev/ui list --registry https://acme.com/r
pnpm dlx @webjsdev/ui view brand-button --registry https://acme.com/r

Checking in CI

To catch a broken registry before users do, run the same commands on a schedule. list --json prints one JSON array of { name, type, categories, description }, which a script can loop over to view every item.

check-registry.sh
npx @webjsdev/ui list --registry https://acme.com/r --json > items.json

for name in $(node -e "for (const i of require('./items.json')) console.log(i.name)"); do
  npx @webjsdev/ui view "$name" --registry https://acme.com/r > /dev/null || exit 1
done

To test the install itself, run add in a throwaway app created with webjs create, then run its tests.

Directory ranking

The directory lists registries in the order of website/modules/ui/directory/registries.ts, with the WebJs UI registry first. Its search filters by name and description, and entries change only when the file does.

Directory data in the API

/ui/r/registries.json serves each entry's name, homepage, url, description and logo.

What happens next

If a listed registry stops working, open an issue or a pull request on webjsdev/webjs to fix or remove its entry. See Registry Directory for how entries are added.