From f05922dfd06d01c6a748932827d929741acfbc78 Mon Sep 17 00:00:00 2001 From: Antoine Lethimonnier <43064022+WarningImHack3r@users.noreply.github.com> Date: Wed, 10 Jan 2024 07:45:02 +0100 Subject: [PATCH] feat(cli): Add JSON schema (#256) * Add schema * Update schema.json --- apps/www/src/public/schema.json | 14 ++++++++++++-- packages/cli/src/commands/init.ts | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/www/src/public/schema.json b/apps/www/src/public/schema.json index e8a0ca09..cb463b16 100644 --- a/apps/www/src/public/schema.json +++ b/apps/www/src/public/schema.json @@ -6,6 +6,10 @@ "type": "string", "enum": ["default", "new-york"] }, + "typescript": { + "type": "boolean", + "default": true + }, "tailwind": { "type": "object", "properties": { @@ -19,11 +23,17 @@ "type": "string" }, "cssVariables": { - "type": "boolean" + "type": "boolean", + "default": true } }, "required": ["config", "css", "baseColor", "cssVariables"] - }, + }, + "framework": { + "type": "string", + "enum": ["nuxt", "vite", "laravel", "astro"], + "default": "vite" + }, "aliases": { "type": "object", "properties": { diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index a69082dd..c20ddffb 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -178,7 +178,7 @@ export async function promptForConfig( ]) const config = rawConfigSchema.parse({ - // $schema: 'https://ui.shadcn.com/schema.json', + $schema: 'https://shadcn-vue.com/schema.json', style: options.style, typescript: options.typescript, framework: options.framework,