feat(cli): Add JSON schema (#256)

* Add schema

* Update schema.json
This commit is contained in:
Antoine Lethimonnier 2024-01-10 07:45:02 +01:00 committed by GitHub
parent 1ff244c475
commit f05922dfd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -6,6 +6,10 @@
"type": "string", "type": "string",
"enum": ["default", "new-york"] "enum": ["default", "new-york"]
}, },
"typescript": {
"type": "boolean",
"default": true
},
"tailwind": { "tailwind": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -19,11 +23,17 @@
"type": "string" "type": "string"
}, },
"cssVariables": { "cssVariables": {
"type": "boolean" "type": "boolean",
"default": true
} }
}, },
"required": ["config", "css", "baseColor", "cssVariables"] "required": ["config", "css", "baseColor", "cssVariables"]
}, },
"framework": {
"type": "string",
"enum": ["nuxt", "vite", "laravel", "astro"],
"default": "vite"
},
"aliases": { "aliases": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -178,7 +178,7 @@ export async function promptForConfig(
]) ])
const config = rawConfigSchema.parse({ const config = rawConfigSchema.parse({
// $schema: 'https://ui.shadcn.com/schema.json', $schema: 'https://shadcn-vue.com/schema.json',
style: options.style, style: options.style,
typescript: options.typescript, typescript: options.typescript,
framework: options.framework, framework: options.framework,