Home / File/ blocks.ts — ui Source File

blocks.ts — ui Source File

Architecture documentation for blocks.ts, a typescript file in the ui codebase. 3 imports, 0 dependents.

File typescript ComponentRegistry Styles 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  22ff694c_64ff_0a8f_de75_d5f0da9991cd["blocks.ts"]
  ceec689a_1334_a657_3c35_094070222b09["schema"]
  22ff694c_64ff_0a8f_de75_d5f0da9991cd --> ceec689a_1334_a657_3c35_094070222b09
  6802ce19_522d_e5fb_e458_8826d9f6952e["zod"]
  22ff694c_64ff_0a8f_de75_d5f0da9991cd --> 6802ce19_522d_e5fb_e458_8826d9f6952e
  9798186b_08af_1d79_2ad7_d662300dc0ba["registry-styles"]
  22ff694c_64ff_0a8f_de75_d5f0da9991cd --> 9798186b_08af_1d79_2ad7_d662300dc0ba
  style 22ff694c_64ff_0a8f_de75_d5f0da9991cd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use server"

import { registryItemSchema } from "shadcn/schema"
import { z } from "zod"

import { Style } from "@/registry/registry-styles"

export async function getAllBlockIds(
  types: z.infer<typeof registryItemSchema>["type"][] = [
    "registry:block",
    "registry:internal",
  ],
  categories: string[] = [],
  style: Style["name"] = "new-york"
): Promise<string[]> {
  const { Index } = await import("@/__registry__")
  const index = z.record(registryItemSchema).parse(Index[style])

  return Object.values(index)
    .filter(
      (block) =>
        types.includes(block.type) &&
        (categories.length === 0 ||
          block.categories?.some((category) =>
            categories.includes(category)
          )) &&
        !block.name.startsWith("chart-")
    )
    .map((block) => block.name)
}

Subdomains

Functions

Dependencies

  • registry-styles
  • schema
  • zod

Frequently Asked Questions

What does blocks.ts do?
blocks.ts is a source file in the ui codebase, written in typescript. It belongs to the ComponentRegistry domain, Styles subdomain.
What functions are defined in blocks.ts?
blocks.ts defines 1 function(s): getAllBlockIds.
What does blocks.ts depend on?
blocks.ts imports 3 module(s): registry-styles, schema, zod.
Where is blocks.ts in the architecture?
blocks.ts is located at deprecated/www/lib/blocks.ts (domain: ComponentRegistry, subdomain: Styles, directory: deprecated/www/lib).

Analyze Your Own Codebase

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

Try Supermodel Free