This commit is contained in:
shadcn
2026-02-26 17:27:02 +04:00
parent fae5e78292
commit 8af3cfd031

View File

@@ -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 ??