Skip to content

fix(registry): bake democrito.design URLs into registryDependencies#74

Merged
mmorerasanchez merged 2 commits into
mainfrom
fix/registry-url-resolution
Jun 17, 2026
Merged

fix(registry): bake democrito.design URLs into registryDependencies#74
mmorerasanchez merged 2 commits into
mainfrom
fix/registry-url-resolution

Conversation

@mmorerasanchez

@mmorerasanchez mmorerasanchez commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Prefixes REGISTRY_URL=https://democrito.design/r before build-registry.mjs in both build and registry npm scripts
  • On every build, custom component registryDependencies now write as full .json URLs (e.g. "https://democrito.design/r/sidebar-nav.json")
  • shadcn/ui primitives remain as bare names — they're resolved by shadcn itself
  • The addUrl() function in scripts/build-registry.mjs (line 315) already handled this; it just needed the env var

Why this matters

npx shadcn@latest add https://democrito.design/r/app-shell.json fetches the item but then cannot resolve its deps (sidebar-nav, top-bar, theme-toggle) because bare names have no registry context. With full URLs, shadcn chains the installs correctly.

Verification

node -e "const a=JSON.parse(require('fs').readFileSync('./public/r/app-shell.json','utf8')); console.log(a.registryDependencies)"
# ["https://democrito.design/r/sidebar-nav.json", "https://democrito.design/r/theme-toggle.json", "https://democrito.design/r/top-bar.json"]

node -e "const a=JSON.parse(require('fs').readFileSync('./public/r/sidebar-nav.json','utf8')); console.log(a.registryDependencies)"
# ["avatar","badge","button","https://democrito.design/r/logo.json","https://democrito.design/r/nav-item.json"]

125/125 tests pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated build configuration and component registry references to use explicit resource URLs, improving system stability and dependency resolution across the design system.

Prefix build-registry.mjs with REGISTRY_URL so every npm run build
and npm run registry writes full .json URLs for custom component deps.
shadcn/ui primitives remain as bare names (resolved by shadcn itself).

Verified: app-shell.json deps are full URLs; sidebar-nav.json has
correct mix of bare (shadcn) + full URLs (custom).
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

All registryDependencies entries across 17 public/r/*.json registry manifests are migrated from bare slug strings (e.g., "code") to fully-qualified URLs (e.g., "https://democrito.design/r/code.json"). The build and registry npm scripts are updated to pass REGISTRY_URL=https://democrito.design/r inline to scripts/build-registry.mjs.

Changes

Registry Dependency URL Migration

Layer / File(s) Summary
Build script REGISTRY_URL parameterization
package.json
The build and registry scripts now set REGISTRY_URL=https://democrito.design/r inline before running scripts/build-registry.mjs, replacing the prior unparameterized invocation.
Index manifest URL migration
public/r/democrito-atoms.json, public/r/democrito-molecules.json, public/r/democrito-organisms.json, public/r/democrito-templates.json
All registryDependencies entries in the four top-level index manifests are replaced from bare slug strings to fully-qualified https://democrito.design/r/*.json URLs.
Individual component manifest URL migration
public/r/activity-feed.json, public/r/app-shell.json, public/r/auth-form.json, public/r/code-block.json, public/r/dashboard-stats.json, public/r/field-header.json, public/r/filter-bar.json, public/r/run-history.json, public/r/search-bar.json, public/r/settings-nav.json, public/r/sidebar-nav.json, public/r/token-reference-card.json, public/r/top-bar.json
Each individual component manifest replaces its registryDependencies slug identifiers with absolute https://democrito.design/r/*.json URLs.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • mmorerasanchez/democrito#48: Also modifies the build script in package.json that runs scripts/build-registry.mjs, making it directly related to the build script changes in this PR.

Poem

🐇 Hoppity-hop through the registry lane,
No more short slugs, just full URLs plain!
Each .json path now points far and wide,
To democrito.design with nothing to hide.
The build script too gets its REGISTRY_URL set —
The tidiest manifests this bunny's seen yet! 🌐

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating registry dependency references to use full Democrito design URLs instead of bare component names across multiple registry JSON files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/registry-url-resolution

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 8-11: The build and registry scripts in package.json use
POSIX-style environment variable assignment (REGISTRY_URL=...) which fails on
Windows cmd.exe. Install the cross-env package as a dev dependency and replace
the inline environment variable assignments in both the build script (line 8)
and registry script (line 11) with cross-env to ensure cross-platform
compatibility. For example, replace REGISTRY_URL=https://democrito.design/r node
with cross-env REGISTRY_URL=https://democrito.design/r node for both affected
scripts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 39602817-809c-46d0-92e2-b6c3f9b3478c

📥 Commits

Reviewing files that changed from the base of the PR and between 640ac2e and f1084f5.

📒 Files selected for processing (18)
  • package.json
  • public/r/activity-feed.json
  • public/r/app-shell.json
  • public/r/auth-form.json
  • public/r/code-block.json
  • public/r/dashboard-stats.json
  • public/r/democrito-atoms.json
  • public/r/democrito-molecules.json
  • public/r/democrito-organisms.json
  • public/r/democrito-templates.json
  • public/r/field-header.json
  • public/r/filter-bar.json
  • public/r/run-history.json
  • public/r/search-bar.json
  • public/r/settings-nav.json
  • public/r/sidebar-nav.json
  • public/r/token-reference-card.json
  • public/r/top-bar.json

Comment thread package.json
Comment on lines +8 to +11
"build": "node scripts/generate-counts.mjs && node scripts/generate-tokens.mjs && node scripts/stamp-design-date.mjs && REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs",
"test": "vitest run",
"test:watch": "vitest",
"registry": "node scripts/build-registry.mjs"
"registry": "REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether scripts currently rely on POSIX-only inline env syntax
rg -n '"(build|registry)"\s*:\s*".*REGISTRY_URL=' package.json

# Verify whether cross-env is already available in dependencies
rg -n '"cross-env"\s*:' package.json

Repository: mmorerasanchez/democrito

Length of output: 361


Use cross-platform env injection for npm scripts (Windows breakage).

Lines 8 and 11 use POSIX-style inline env assignment (REGISTRY_URL=... node ...), which does not work in default Windows cmd.exe, so npm run build and npm run registry will fail for Windows contributors and CI.

Suggested fix
{
  "scripts": {
-    "build": "node scripts/generate-counts.mjs && node scripts/generate-tokens.mjs && node scripts/stamp-design-date.mjs && REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs",
+    "build": "node scripts/generate-counts.mjs && node scripts/generate-tokens.mjs && node scripts/stamp-design-date.mjs && cross-env REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs",
-    "registry": "REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs"
+    "registry": "cross-env REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs"
  },
  "devDependencies": {
+   "cross-env": "^7.0.3",
    ...
  }
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"build": "node scripts/generate-counts.mjs && node scripts/generate-tokens.mjs && node scripts/stamp-design-date.mjs && REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs",
"test": "vitest run",
"test:watch": "vitest",
"registry": "node scripts/build-registry.mjs"
"registry": "REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs"
"build": "node scripts/generate-counts.mjs && node scripts/generate-tokens.mjs && node scripts/stamp-design-date.mjs && cross-env REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs",
"test": "vitest run",
"test:watch": "vitest",
"registry": "cross-env REGISTRY_URL=https://democrito.design/r node scripts/build-registry.mjs"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 8 - 11, The build and registry scripts in
package.json use POSIX-style environment variable assignment (REGISTRY_URL=...)
which fails on Windows cmd.exe. Install the cross-env package as a dev
dependency and replace the inline environment variable assignments in both the
build script (line 8) and registry script (line 11) with cross-env to ensure
cross-platform compatibility. For example, replace
REGISTRY_URL=https://democrito.design/r node with cross-env
REGISTRY_URL=https://democrito.design/r node for both affected scripts.

Split the registryDependencies URL-application into two passes: individual
components continue using addUrl (only custom non-ui names get URLs, so
ui cross-refs like command→dialog stay bare), while all 5 tier bundles
use addBundleUrl (unconditional prefix, since every bundle dep is served
from the democrito registry). democrito-ui bundle now 48/48 URLs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mmorerasanchez mmorerasanchez merged commit 19e0135 into main Jun 17, 2026
1 check passed
@mmorerasanchez mmorerasanchez deleted the fix/registry-url-resolution branch June 17, 2026 12:59
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