Home / Function/ resolveRegistryItems() — ui Function Reference

resolveRegistryItems() — ui Function Reference

Architecture documentation for the resolveRegistryItems() function in build.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  fad061f2_6610_9959_e2da_f7274dc36de4["resolveRegistryItems()"]
  63e091f6_3c2a_b275_9d68_1537ab7744bf["build.ts"]
  fad061f2_6610_9959_e2da_f7274dc36de4 -->|defined in| 63e091f6_3c2a_b275_9d68_1537ab7744bf
  81f7cdd0_5b9c_3c3f_b34d_f82fdfc939e9["buildRegistry()"]
  81f7cdd0_5b9c_3c3f_b34d_f82fdfc939e9 -->|calls| fad061f2_6610_9959_e2da_f7274dc36de4
  style fad061f2_6610_9959_e2da_f7274dc36de4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/commands/registry/build.ts lines 185–219

async function resolveRegistryItems(
  registry: z.infer<typeof registrySchema>,
  config: z.infer<typeof configSchema>,
  projectInfo: ProjectInfo
): Promise<z.infer<typeof registrySchema>> {
  for (const item of registry.items) {
    if (!item.files?.length) {
      continue
    }

    // Process all files in the array instead of just the first one
    for (const file of item.files) {
      const results = await recursivelyResolveFileImports(
        file.path,
        config,
        projectInfo
      )

      // Remove file from results.files
      results.files = results.files?.filter((f) => f.path !== file.path)

      if (results.files) {
        item.files.push(...results.files)
      }

      if (results.dependencies) {
        item.dependencies = item.dependencies
          ? item.dependencies.concat(results.dependencies)
          : results.dependencies
      }
    }
  }

  return registry
}

Subdomains

Called By

Frequently Asked Questions

What does resolveRegistryItems() do?
resolveRegistryItems() is a function in the ui codebase, defined in packages/shadcn/src/commands/registry/build.ts.
Where is resolveRegistryItems() defined?
resolveRegistryItems() is defined in packages/shadcn/src/commands/registry/build.ts at line 185.
What calls resolveRegistryItems()?
resolveRegistryItems() is called by 1 function(s): buildRegistry.

Analyze Your Own Codebase

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

Try Supermodel Free