Home / Function/ resolveRegistryUrl() — ui Function Reference

resolveRegistryUrl() — ui Function Reference

Architecture documentation for the resolveRegistryUrl() function in builder.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  6046d561_51c8_77b1_6ef2_3be75ddbac07["resolveRegistryUrl()"]
  8c5b2947_9033_b37b_2596_f9777d2a7f77["builder.ts"]
  6046d561_51c8_77b1_6ef2_3be75ddbac07 -->|defined in| 8c5b2947_9033_b37b_2596_f9777d2a7f77
  style 6046d561_51c8_77b1_6ef2_3be75ddbac07 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/registry/builder.ts lines 149–162

export function resolveRegistryUrl(pathOrUrl: string) {
  if (isUrl(pathOrUrl)) {
    // If the url contains /chat/b/, we assume it's the v0 registry.
    // We need to add the /json suffix if it's missing.
    const url = new URL(pathOrUrl)
    if (url.pathname.match(/\/chat\/b\//) && !url.pathname.endsWith("/json")) {
      url.pathname = `${url.pathname}/json`
    }

    return url.toString()
  }

  return `${REGISTRY_URL}/${pathOrUrl}`
}

Subdomains

Frequently Asked Questions

What does resolveRegistryUrl() do?
resolveRegistryUrl() is a function in the ui codebase, defined in packages/shadcn/src/registry/builder.ts.
Where is resolveRegistryUrl() defined?
resolveRegistryUrl() is defined in packages/shadcn/src/registry/builder.ts at line 149.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free