This commit is contained in:
shadcn
2026-02-17 14:10:35 +04:00
parent b8f355ac4f
commit 3877ae5328
4 changed files with 9 additions and 4 deletions

View File

@@ -20,6 +20,8 @@ export function createTemplate(config: {
name: string
title: string
defaultProjectName: string
// Force a specific package manager for this template.
packageManager?: string
// Framework names that map to this template.
frameworks?: string[]
scaffold: (options: TemplateOptions) => Promise<void>

View File

@@ -23,6 +23,7 @@ export const nextMonorepo = createTemplate({
name: "next-monorepo",
title: "Next.js (Monorepo)",
defaultProjectName: "next-monorepo",
packageManager: "pnpm",
scaffold: async ({ projectPath, packageManager }) => {
const createSpinner = spinner(
`Creating a new Next.js monorepo. This may take a few minutes.`

View File

@@ -61,9 +61,11 @@ export async function createProject(
projectName = name ?? projectName
}
const packageManager = await getPackageManager(options.cwd, {
withFallback: true,
})
const packageManager =
templates[template].packageManager ??
(await getPackageManager(options.cwd, {
withFallback: true,
}))
const projectPath = `${options.cwd}/${projectName}`

View File

@@ -7,5 +7,5 @@
"printWidth": 80,
"plugins": ["prettier-plugin-tailwindcss"],
"tailwindStylesheet": "app/globals.css",
"tailwindFunctions": ["cn"]
"tailwindFunctions": ["cn", "cva"]
}