Provides reusable TypeScript types and runtime schema definitions for the Shadcn registry, currently at version 0.5.0. This package defines the structure of shadcn registry entries using Zod schemas, enabling validation and type-safe handling of registry items. It is updated irregularly alongside shadcn's evolving registry specification. Key differentiators: it is the official schema library for shadcn's new v2 registry format, offering both Zod validation and first-class TypeScript support. Alternative approaches require manual type definitions or ad-hoc validation.
npm install shadcn-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Validates a shadcn registry entry using the provided Zod schema and prints the parsed result or a detailed validation error.
Ensure your registry entries conform to the v2 spec. Migrate from v1 by adapting file metadata and type fields.
Pin to a specific minor version and test after updates.
Use only the types defined in shadcn's documentation: 'registry:component', 'registry:page', 'registry:ui', etc.
Replace `registryItemSchema` with `registryItem` in your imports and usage.
Use `import { registrySchema } from 'shadcn-schema'` instead of default import.Correct the `type` field to one of the allowed values (e.g., 'registry:component').
Use `import type { RegistryItem } from 'shadcn-schema'` or enable `verbatimModuleSyntax` in tsconfig.Run `npm install shadcn-schema` and ensure moduleResolution is set to 'bundler' or 'node16'.