From 8af3cfd031c3b218dfc2ac30f532eaa0c7cc457d Mon Sep 17 00:00:00 2001 From: shadcn Date: Thu, 26 Feb 2026 17:27:02 +0400 Subject: [PATCH] fix --- packages/shadcn/src/commands/init.ts | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/shadcn/src/commands/init.ts b/packages/shadcn/src/commands/init.ts index fcd0e89170..28e6e2e002 100644 --- a/packages/shadcn/src/commands/init.ts +++ b/packages/shadcn/src/commands/init.ts @@ -305,6 +305,21 @@ export const init = new Command() } } + // Prompt for monorepo if the template supports it. + if ( + options.monorepo === undefined && + options.template && + templates[options.template as keyof typeof templates]?.monorepo + ) { + const { monorepo } = await prompts({ + type: "confirm", + name: "monorepo", + message: "Would you like to set up a monorepo?", + initial: false, + }) + options.monorepo = monorepo + } + // Prompt for base if not provided. if (!options.base) { options.base = await promptForBase() @@ -376,21 +391,6 @@ export const init = new Command() } } - // Prompt for monorepo if the template supports it. - if ( - options.monorepo === undefined && - options.template && - templates[options.template as keyof typeof templates]?.monorepo - ) { - const { monorepo } = await prompts({ - type: "confirm", - name: "monorepo", - message: "Would you like to set up a monorepo?", - initial: false, - }) - options.monorepo = monorepo - } - // Resolve base: --base flag > preset/prompt/URL > existing config > prompt. let resolvedBase: string = options.base ??