diff --git a/package.json b/package.json index 2445e9b..42d6324 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nxt-gen-cli", - "version": "2.1.4", + "version": "2.1.5", "description": "The ultimate Next.js scaffold CLI generator. Customize your stack with Prisma, React Query, Shadcn, HeroUI, and more in seconds.", "main": "dist/index.js", "type": "module", diff --git a/src/scaffold.ts b/src/scaffold.ts index 4484210..ef87c52 100644 --- a/src/scaffold.ts +++ b/src/scaffold.ts @@ -246,6 +246,23 @@ export const scaffoldProject = async ( ); playwrightSpinner.succeed("Playwright browsers installed"); } + + if (config.ui === "shadcn" || config.ui === "both") { + const shadcnSpinner = ora("Initializing Shadcn UI...").start(); + const dlx = getDlxCommand(pm); + await runCommand( + dlx.command, + [ + ...dlx.args, + "shadcn@latest", + "init", + "--yes", + "--defaults", + ], + projectPath + ); + shadcnSpinner.succeed("Shadcn UI initialized"); + } } catch (error) { spinner.fail("Installation failed"); console.log(chalk.red("\nError:"), error);