Skip to content
This repository was archived by the owner on Jul 4, 2026. It is now read-only.
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
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ import { createPages, createLayout } from './lib/templates.js';
Object.assign(answers, otherAnswers);

const { projectName, packageManager, useTypeScript, useTailwind, useAppDir, useSrcDir, pages, linter, orm, useShadcn } = answers;
const projectPath = path.join(process.cwd(), projectName);

const displayName = projectName === '.' ? path.basename(process.cwd()) : projectName;
const projectPath = projectName === '.' ? process.cwd() : path.join(process.cwd(), projectName);

console.log();
console.log(chalk.bold.hex("#23f0bcff")("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"));
Expand Down Expand Up @@ -190,7 +192,7 @@ import { createPages, createLayout } from './lib/templates.js';

console.log(chalk.magenta("Creating layout files..."));

createLayout(projectPath, projectName, useTypeScript, useAppDir, useSrcDir);
createLayout(projectPath, displayName, useTypeScript, useAppDir, useSrcDir);

const pagesPath = useAppDir
? (useSrcDir ? path.join(projectPath, "src", "app") : path.join(projectPath, "app"))
Expand Down Expand Up @@ -226,7 +228,7 @@ import { createPages, createLayout } from './lib/templates.js';
writeFile(defaultPagePath, emptyPageContent);

const readmePath = path.join(projectPath, "README.md");
writeFile(readmePath, `# ${projectName}`);
writeFile(readmePath, `# ${displayName}`);

console.log(chalk.bold.green("Layout and pages created"));

Expand Down Expand Up @@ -344,7 +346,9 @@ import { createPages, createLayout } from './lib/templates.js';
console.log(chalk.bold.hex("#23f0bcff")("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"));
console.log();
console.log(chalk.bold.white("-> Next steps:"));
console.log(chalk.cyan(` cd ${chalk.bold.white(projectName)}`));
if (projectName !== '.') {
console.log(chalk.cyan(` cd ${chalk.bold.white(projectName)}`));
}
console.log(chalk.cyan(` ${packageManager} ${chalk.bold.white(`run dev`)}`));
console.log();
console.log(chalk.white.bold(`Thank you for using create-next-quick!`));
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('create-next-quick', function () {
clearInterval(interval);
child.stdin.end();
}
}, 1000);
}, 3000);

child.on('close', (code) => {
assert.strictEqual(code, 0, 'CLI should exit with code 0');
Expand All @@ -61,7 +61,7 @@ describe('create-next-quick', function () {
testCase.options.pages + '\n',
testCase.options.linter + '\n',
testCase.options.orm + '\n',
testCase.options.useShadcn ? 'y\n' : '\n',
testCase.options.useShadcn ? '\n' : 'n\n',
];

const assertions = () => {
Expand Down