Skip to content

Commit 30898a5

Browse files
Merge pull request #17 from PrabothCharith/development
fix: add automated shadcn init to properly configure CSS
2 parents dd52dc7 + 240535f commit 30898a5

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nxt-gen-cli",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"description": "The ultimate Next.js scaffold CLI generator. Customize your stack with Prisma, React Query, Shadcn, HeroUI, and more in seconds.",
55
"main": "dist/index.js",
66
"type": "module",

src/scaffold.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,23 @@ export const scaffoldProject = async (
246246
);
247247
playwrightSpinner.succeed("Playwright browsers installed");
248248
}
249+
250+
if (config.ui === "shadcn" || config.ui === "both") {
251+
const shadcnSpinner = ora("Initializing Shadcn UI...").start();
252+
const dlx = getDlxCommand(pm);
253+
await runCommand(
254+
dlx.command,
255+
[
256+
...dlx.args,
257+
"shadcn@latest",
258+
"init",
259+
"--yes",
260+
"--defaults",
261+
],
262+
projectPath
263+
);
264+
shadcnSpinner.succeed("Shadcn UI initialized");
265+
}
249266
} catch (error) {
250267
spinner.fail("Installation failed");
251268
console.log(chalk.red("\nError:"), error);

0 commit comments

Comments
 (0)