Home / File/ schema.ts — ui Source File

schema.ts — ui Source File

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

File typescript FrameworkTooling SchemaValidation 1 imports 3 dependents 3 functions

Entity Profile

Dependency Diagram

graph LR
  d622c874_d9cc_69e4_4150_aadbf45b3cda["schema.ts"]
  6802ce19_522d_e5fb_e458_8826d9f6952e["zod"]
  d622c874_d9cc_69e4_4150_aadbf45b3cda --> 6802ce19_522d_e5fb_e458_8826d9f6952e
  c60ed853_bfca_7f86_2576_e5b58bb7b8aa["schema.test.ts"]
  c60ed853_bfca_7f86_2576_e5b58bb7b8aa --> d622c874_d9cc_69e4_4150_aadbf45b3cda
  d51ab9e0_8488_8598_7079_e383487a0885["utils.test.ts"]
  d51ab9e0_8488_8598_7079_e383487a0885 --> d622c874_d9cc_69e4_4150_aadbf45b3cda
  e1e4fe12_f94e_9708_96a3_f46784286b86["registry.test.ts"]
  e1e4fe12_f94e_9708_96a3_f46784286b86 --> d622c874_d9cc_69e4_4150_aadbf45b3cda
  style d622c874_d9cc_69e4_4150_aadbf45b3cda fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { z } from "zod"

// Note: if you edit the schema here, you must also edit the schema in the
// apps/v4/public/schema/registry-item.json file.

export const registryConfigItemSchema = z.union([
  // Simple string format: "https://example.com/{name}.json"
  z.string().refine((s) => s.includes("{name}"), {
    message: "Registry URL must include {name} placeholder",
  }),
  // Advanced object format with auth options
  z.object({
    url: z.string().refine((s) => s.includes("{name}"), {
      message: "Registry URL must include {name} placeholder",
    }),
    params: z.record(z.string(), z.string()).optional(),
    headers: z.record(z.string(), z.string()).optional(),
  }),
])

export const registryConfigSchema = z.record(
  z.string().refine((key) => key.startsWith("@"), {
    message: "Registry names must start with @ (e.g., @v0, @acme)",
  }),
  registryConfigItemSchema
)

export const rawConfigSchema = z
  .object({
    $schema: z.string().optional(),
    style: z.string(),
    rsc: z.coerce.boolean().default(false),
    tsx: z.coerce.boolean().default(true),
    tailwind: z.object({
      config: z.string().optional(),
      css: z.string(),
      baseColor: z.string(),
      cssVariables: z.boolean().default(true),
      prefix: z.string().default("").optional(),
    }),
    iconLibrary: z.string().optional(),
    rtl: z.coerce.boolean().default(false).optional(),
    menuColor: z.enum(["default", "inverted"]).default("default").optional(),
    menuAccent: z.enum(["subtle", "bold"]).default("subtle").optional(),
    aliases: z.object({
      components: z.string(),
      utils: z.string(),
      ui: z.string().optional(),
      lib: z.string().optional(),
      hooks: z.string().optional(),
    }),
    registries: registryConfigSchema.optional(),
  })
  .strict()

export const configSchema = rawConfigSchema.extend({
  resolvedPaths: z.object({
    cwd: z.string(),
    tailwindConfig: z.string(),
    tailwindCss: z.string(),
// ... (243 more lines)

Subdomains

Dependencies

  • zod

Frequently Asked Questions

What does schema.ts do?
schema.ts is a source file in the ui codebase, written in typescript. It belongs to the FrameworkTooling domain, SchemaValidation subdomain.
What functions are defined in schema.ts?
schema.ts defines 3 function(s): cssValueSchema, registryConfigItemSchema, registryConfigSchema.
What does schema.ts depend on?
schema.ts imports 1 module(s): zod.
What files import schema.ts?
schema.ts is imported by 3 file(s): registry.test.ts, schema.test.ts, utils.test.ts.
Where is schema.ts in the architecture?
schema.ts is located at packages/shadcn/src/registry/schema.ts (domain: FrameworkTooling, subdomain: SchemaValidation, directory: packages/shadcn/src/registry).

Analyze Your Own Codebase

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

Try Supermodel Free