Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nxt-gen-cli",
"version": "2.1.5",
"version": "2.1.6",
"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",
Expand Down
17 changes: 9 additions & 8 deletions src/lib/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function addProviderToLayout(projectPath: string) {

// 1. Add Import
const hasImport = sourceFile.getImportDeclaration(
(decl) => decl.getModuleSpecifierValue() === "@/components/providers"
(decl) => decl.getModuleSpecifierValue() === "@/components/providers",
);

if (!hasImport) {
Expand All @@ -37,7 +37,7 @@ export async function addProviderToLayout(projectPath: string) {
const exportDefault = sourceFile.getDefaultExportSymbol();
if (exportDefault) {
const funcDecl = sourceFile.getFunction(
exportDefault.getName() || "RootLayout"
exportDefault.getName() || "RootLayout",
); // Often unnamed default, need to handle that.
// Actually sourceFile.getDefaultExportSymbol() returns symbol.
// sourceFile.getExportedDeclarations() might be better or finding the function that is default exported.
Expand Down Expand Up @@ -98,7 +98,7 @@ export async function configureTailwindForHeroUI(projectPath: string) {
// 1. Add Import
// import {heroui} from '@heroui/react';
const herouiImport = sourceFile.getImportDeclaration(
(decl) => decl.getModuleSpecifierValue() === "@heroui/react"
(decl) => decl.getModuleSpecifierValue() === "@heroui/react",
);

if (!herouiImport) {
Expand All @@ -111,7 +111,7 @@ export async function configureTailwindForHeroUI(projectPath: string) {
// 2. Add Plugin
// plugins: [heroui()]
const defaultExport = sourceFile.getExportAssignment(
(d) => !d.isExportEquals()
(d) => !d.isExportEquals(),
);
if (defaultExport) {
// We expect `export default config;` and `const config: Config = { ... }`
Expand All @@ -121,7 +121,7 @@ export async function configureTailwindForHeroUI(projectPath: string) {
const configVar = sourceFile.getVariableDeclaration("config");
if (configVar) {
const initializer = configVar.getInitializerIfKind(
SyntaxKind.ObjectLiteralExpression
SyntaxKind.ObjectLiteralExpression,
);
if (initializer) {
// Handle Plugins
Expand Down Expand Up @@ -165,7 +165,7 @@ export async function configureTailwindForHeroUI(projectPath: string) {
.some((e) => e.getText().includes("@heroui/theme"));
if (!hasTheme) {
array.addElement(
`"./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}"`
`"./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}"`,
);
}
}
Expand All @@ -185,14 +185,15 @@ export async function configureGlobalCssForHeroUI(projectPath: string) {

// Check if it's already configured to avoid duplication
if (content.includes("@plugin './hero.ts';")) return;
if (content.includes('@plugin "./hero.ts";')) return;

// Replace default tailwind import with v4 setup
// We assume standard create-next-app output which usually starts with directives
// Or just prepend/replace the top part.

const v4Setup = `@import "tailwindcss";
@plugin '../../hero.ts';
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
@plugin "./hero.ts";

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @source path has been changed from a relative path going up two directories to one that goes up two directories, but the @plugin path has been changed from '../../hero.ts' to "./hero.ts". This is inconsistent. If hero.ts is at the root (app/hero.ts as created in scaffold.ts line 635), and globals.css is at src/app/globals.css, then the path should be "../../app/hero.ts", not "./hero.ts". The @source path "../../node_modules/..." suggests the CSS is in src/app/, so "./hero.ts" would look for src/app/hero.ts, which doesn't match where the file is created.

Copilot uses AI. Check for mistakes.
@source "../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}";
@custom-variant dark (&:is(.dark *));

`;
Expand Down
Loading
Loading