Self-hosting a registry
The default registry is https://cdn.jsdelivr.net/gh/jarooda/jlds@main/registry — jsDelivr serving the registry/ subfolder of the jlds monorepo directly from GitHub. No server is involved, so hosting your own fork (with custom or modified components) only requires GitHub + jsDelivr.
Prerequisites
- A public GitHub repository containing your
registry/folder (jsDelivr's free tier only serves public repos) - At least one component under
registry/components/
1. Push your registry to GitHub
git init
git add .
git commit -m "chore: initial commit"
git remote add origin https://github.com/<your-org>/<your-repo>.git
git branch -M main
git push -u origin main2. Verify the CDN URL
jsDelivr serves files at:
https://cdn.jsdelivr.net/gh/<org>/<repo>@<ref>/<path>Since the registry lives in a subfolder, your base URL is:
https://cdn.jsdelivr.net/gh/<org>/<repo>@main/registryOpen these in a browser — you should see raw JSON:
https://cdn.jsdelivr.net/gh/<org>/<repo>@main/registry/registry.json
https://cdn.jsdelivr.net/gh/<org>/<repo>@main/registry/components/button/meta.jsonIf you get a 404, wait ~1 minute for jsDelivr to pick up the push.
3. Point jlds.json at it
{
"registry": "https://cdn.jsdelivr.net/gh/<org>/<repo>@main/registry"
}For local development, you can instead point at the folder on disk — see CLI: local vs. remote registry.
Releasing a new component version
Edit files under
registry/components/<name>/.Bump
"version"in that component'smeta.json.Commit and push:
bashgit add registry/ git commit -m "feat(button): add loading state" git push origin mainUsers run
jlds update <name>to pull the new version.
Pinning to a tag
@main always reflects the latest push. For production, jsDelivr recommends pinning to a release tag, which is immutable (once cached, it never changes):
git tag v0.2.0
git push origin v0.2.0{
"registry": "https://cdn.jsdelivr.net/gh/<org>/<repo>@v0.2.0/registry"
}jsDelivr cache
@mainrefreshes within a few minutes of a push.Tagged versions (
@v0.2.0) are immutable — to ship a fix, cut a new tag.To force-refresh
@mainimmediately, hit jsDelivr's purge endpoint:https://purge.jsdelivr.net/gh/<org>/<repo>@main/registry/registry.json