UNPKG

aoian

Version:
399 lines (395 loc) 14.4 kB
#!/usr/bin/env node import { z } from 'zod'; import { registryIndexSchema, registryItemSchema } from './registry/index.js'; declare const configSchema: z.ZodObject<z.objectUtil.extendShape<{ $schema: z.ZodOptional<z.ZodString>; style: z.ZodString; rsc: z.ZodDefault<z.ZodBoolean>; tsx: z.ZodDefault<z.ZodBoolean>; tailwind: z.ZodObject<{ config: z.ZodString; css: z.ZodString; baseColor: z.ZodString; cssVariables: z.ZodDefault<z.ZodBoolean>; prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>; }, "strip", z.ZodTypeAny, { config: string; css: string; baseColor: string; cssVariables: boolean; prefix?: string | undefined; }, { config: string; css: string; baseColor: string; cssVariables?: boolean | undefined; prefix?: string | undefined; }>; aliases: z.ZodObject<{ components: z.ZodString; utils: z.ZodString; ui: z.ZodOptional<z.ZodString>; lib: z.ZodOptional<z.ZodString>; hooks: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { components: string; utils: string; ui?: string | undefined; lib?: string | undefined; hooks?: string | undefined; }, { components: string; utils: string; ui?: string | undefined; lib?: string | undefined; hooks?: string | undefined; }>; iconLibrary: z.ZodOptional<z.ZodString>; }, { resolvedPaths: z.ZodObject<{ cwd: z.ZodString; tailwindConfig: z.ZodString; tailwindCss: z.ZodString; utils: z.ZodString; components: z.ZodString; lib: z.ZodString; hooks: z.ZodString; ui: z.ZodString; }, "strip", z.ZodTypeAny, { components: string; ui: string; utils: string; lib: string; hooks: string; cwd: string; tailwindConfig: string; tailwindCss: string; }, { components: string; ui: string; utils: string; lib: string; hooks: string; cwd: string; tailwindConfig: string; tailwindCss: string; }>; }>, "strict", z.ZodTypeAny, { tailwind: { config: string; css: string; baseColor: string; cssVariables: boolean; prefix?: string | undefined; }; style: string; rsc: boolean; tsx: boolean; aliases: { components: string; utils: string; ui?: string | undefined; lib?: string | undefined; hooks?: string | undefined; }; resolvedPaths: { components: string; ui: string; utils: string; lib: string; hooks: string; cwd: string; tailwindConfig: string; tailwindCss: string; }; $schema?: string | undefined; iconLibrary?: string | undefined; }, { tailwind: { config: string; css: string; baseColor: string; cssVariables?: boolean | undefined; prefix?: string | undefined; }; style: string; aliases: { components: string; utils: string; ui?: string | undefined; lib?: string | undefined; hooks?: string | undefined; }; resolvedPaths: { components: string; ui: string; utils: string; lib: string; hooks: string; cwd: string; tailwindConfig: string; tailwindCss: string; }; $schema?: string | undefined; rsc?: boolean | undefined; tsx?: boolean | undefined; iconLibrary?: string | undefined; }>; type Config = z.infer<typeof configSchema>; declare function getRegistryIndex(): Promise<{ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; name: string; tailwind?: { config?: { content?: string[] | undefined; theme?: Record<string, any> | undefined; plugins?: string[] | undefined; } | undefined; } | undefined; $schema?: string | undefined; title?: string | undefined; author?: string | undefined; description?: string | undefined; dependencies?: string[] | undefined; devDependencies?: string[] | undefined; registryDependencies?: string[] | undefined; files?: ({ path: string; type: "registry:page" | "registry:file"; target: string; content?: string | undefined; } | { path: string; type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; content?: string | undefined; target?: string | undefined; })[] | undefined; cssVars?: { light?: Record<string, string> | undefined; dark?: Record<string, string> | undefined; } | undefined; meta?: Record<string, any> | undefined; docs?: string | undefined; categories?: string[] | undefined; }[] | undefined>; declare function getRegistryStyles(): Promise<{ name: string; label: string; }[]>; declare function getRegistryIcons(): Promise<Record<string, Record<string, string>>>; declare function getRegistryItem(name: string, style: string): Promise<{ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; name: string; tailwind?: { config?: { content?: string[] | undefined; theme?: Record<string, any> | undefined; plugins?: string[] | undefined; } | undefined; } | undefined; $schema?: string | undefined; title?: string | undefined; author?: string | undefined; description?: string | undefined; dependencies?: string[] | undefined; devDependencies?: string[] | undefined; registryDependencies?: string[] | undefined; files?: ({ path: string; type: "registry:page" | "registry:file"; target: string; content?: string | undefined; } | { path: string; type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; content?: string | undefined; target?: string | undefined; })[] | undefined; cssVars?: { light?: Record<string, string> | undefined; dark?: Record<string, string> | undefined; } | undefined; meta?: Record<string, any> | undefined; docs?: string | undefined; categories?: string[] | undefined; } | null>; declare function getRegistryBaseColors(): Promise<{ name: string; label: string; }[]>; declare function getRegistryBaseColor(baseColor: string): Promise<{ cssVars: { light: Record<string, string>; dark: Record<string, string>; }; inlineColors: { light: Record<string, string>; dark: Record<string, string>; }; inlineColorsTemplate: string; cssVarsTemplate: string; } | undefined>; declare function resolveTree(index: z.infer<typeof registryIndexSchema>, names: string[]): Promise<{ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; name: string; tailwind?: { config?: { content?: string[] | undefined; theme?: Record<string, any> | undefined; plugins?: string[] | undefined; } | undefined; } | undefined; $schema?: string | undefined; title?: string | undefined; author?: string | undefined; description?: string | undefined; dependencies?: string[] | undefined; devDependencies?: string[] | undefined; registryDependencies?: string[] | undefined; files?: ({ path: string; type: "registry:page" | "registry:file"; target: string; content?: string | undefined; } | { path: string; type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; content?: string | undefined; target?: string | undefined; })[] | undefined; cssVars?: { light?: Record<string, string> | undefined; dark?: Record<string, string> | undefined; } | undefined; meta?: Record<string, any> | undefined; docs?: string | undefined; categories?: string[] | undefined; }[]>; declare function fetchTree(style: string, tree: z.infer<typeof registryIndexSchema>): Promise<{ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; name: string; tailwind?: { config?: { content?: string[] | undefined; theme?: Record<string, any> | undefined; plugins?: string[] | undefined; } | undefined; } | undefined; $schema?: string | undefined; title?: string | undefined; author?: string | undefined; description?: string | undefined; dependencies?: string[] | undefined; devDependencies?: string[] | undefined; registryDependencies?: string[] | undefined; files?: ({ path: string; type: "registry:page" | "registry:file"; target: string; content?: string | undefined; } | { path: string; type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; content?: string | undefined; target?: string | undefined; })[] | undefined; cssVars?: { light?: Record<string, string> | undefined; dark?: Record<string, string> | undefined; } | undefined; meta?: Record<string, any> | undefined; docs?: string | undefined; categories?: string[] | undefined; }[] | undefined>; declare function getItemTargetPath(config: Config, item: Pick<z.infer<typeof registryItemSchema>, "type">, override?: string): Promise<string | null>; declare function fetchRegistry(paths: string[]): Promise<unknown[]>; declare function registryResolveItemsTree(names: z.infer<typeof registryItemSchema>["name"][], config: Config): Promise<{ tailwind?: { config?: { content?: string[] | undefined; theme?: Record<string, any> | undefined; plugins?: string[] | undefined; } | undefined; } | undefined; dependencies?: string[] | undefined; devDependencies?: string[] | undefined; files?: ({ path: string; type: "registry:page" | "registry:file"; target: string; content?: string | undefined; } | { path: string; type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; content?: string | undefined; target?: string | undefined; })[] | undefined; cssVars?: { light?: Record<string, string> | undefined; dark?: Record<string, string> | undefined; } | undefined; docs?: string | undefined; } | null>; declare function registryGetTheme(name: string, config: Config): Promise<{ name: string; type: "registry:theme"; tailwind: { config: { theme: { extend: { borderRadius: { lg: string; md: string; sm: string; }; colors: {}; }; }; }; }; cssVars: { light: { radius: string; }; dark: {}; }; } | null>; declare function resolveRegistryItems(names: string[], config: Config): Promise<string[]>; declare function getRegistryTypeAliasMap(): Map<string, string>; declare function getRegistryParentMap(registryItems: z.infer<typeof registryItemSchema>[]): Map<string, { type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; name: string; tailwind?: { config?: { content?: string[] | undefined; theme?: Record<string, any> | undefined; plugins?: string[] | undefined; } | undefined; } | undefined; $schema?: string | undefined; title?: string | undefined; author?: string | undefined; description?: string | undefined; dependencies?: string[] | undefined; devDependencies?: string[] | undefined; registryDependencies?: string[] | undefined; files?: ({ path: string; type: "registry:page" | "registry:file"; target: string; content?: string | undefined; } | { path: string; type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:example" | "registry:style" | "registry:internal"; content?: string | undefined; target?: string | undefined; })[] | undefined; cssVars?: { light?: Record<string, string> | undefined; dark?: Record<string, string> | undefined; } | undefined; meta?: Record<string, any> | undefined; docs?: string | undefined; categories?: string[] | undefined; }>; export { fetchRegistry, fetchTree, getItemTargetPath, getRegistryBaseColor, getRegistryBaseColors, getRegistryIcons, getRegistryIndex, getRegistryItem, getRegistryParentMap, getRegistryStyles, getRegistryTypeAliasMap, registryGetTheme, registryResolveItemsTree, resolveRegistryItems, resolveTree };