Home / Function/ parseRegistryArg() — ui Function Reference

parseRegistryArg() — ui Function Reference

Architecture documentation for the parseRegistryArg() function in add.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  74101798_277e_166d_5b6a_840713359dd0["parseRegistryArg()"]
  670848eb_ec36_f11f_b3df_91f7406ddb11["add.ts"]
  74101798_277e_166d_5b6a_840713359dd0 -->|defined in| 670848eb_ec36_f11f_b3df_91f7406ddb11
  style 74101798_277e_166d_5b6a_840713359dd0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/commands/registry/add.ts lines 52–67

export function parseRegistryArg(arg: string): {
  namespace: string
  url?: string
} {
  const [namespace, ...rest] = arg.split("=")
  const url = rest.length > 0 ? rest.join("=") : undefined

  if (!namespace.startsWith("@")) {
    throw new Error(
      `Invalid registry namespace: ${highlighter.info(namespace)}. ` +
        `Registry names must start with @ (e.g., @acme).`
    )
  }

  return { namespace, url }
}

Subdomains

Frequently Asked Questions

What does parseRegistryArg() do?
parseRegistryArg() is a function in the ui codebase, defined in packages/shadcn/src/commands/registry/add.ts.
Where is parseRegistryArg() defined?
parseRegistryArg() is defined in packages/shadcn/src/commands/registry/add.ts at line 52.

Analyze Your Own Codebase

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

Try Supermodel Free