create-next-rkk 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +27 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -84,27 +84,44 @@ program
|
|
|
84
84
|
},
|
|
85
85
|
]);
|
|
86
86
|
const targetDir = projectName || answers.projectName;
|
|
87
|
+
const projectPath = path.join(process.cwd(), targetDir);
|
|
87
88
|
// Step 1: Create Next.js app
|
|
88
89
|
const spinner = (0, ora_1.default)('Creating Next.js application...').start();
|
|
89
90
|
try {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
// Use create-next-app with all options specified to avoid prompts
|
|
92
|
+
const createNextAppCmd = [
|
|
93
|
+
'npx',
|
|
94
|
+
'create-next-app@latest',
|
|
95
|
+
targetDir,
|
|
96
|
+
answers.typescript ? '--typescript' : '--js',
|
|
97
|
+
'--eslint',
|
|
98
|
+
'--no-tailwind',
|
|
99
|
+
'--src-dir',
|
|
100
|
+
'--app',
|
|
101
|
+
'--import-alias', '@/*',
|
|
102
|
+
'--no-git'
|
|
103
|
+
].join(' ');
|
|
104
|
+
(0, child_process_1.execSync)(createNextAppCmd, {
|
|
105
|
+
stdio: 'inherit',
|
|
106
|
+
cwd: process.cwd()
|
|
107
|
+
});
|
|
94
108
|
spinner.succeed('Next.js application created!');
|
|
109
|
+
// Verify directory exists
|
|
110
|
+
if (!fs.existsSync(projectPath)) {
|
|
111
|
+
throw new Error(`Project directory ${targetDir} was not created`);
|
|
112
|
+
}
|
|
95
113
|
// Step 2: Install rkk-next
|
|
96
114
|
if (answers.installDeps) {
|
|
97
115
|
spinner.start('Installing rkk-next...');
|
|
98
|
-
|
|
99
|
-
|
|
116
|
+
(0, child_process_1.execSync)('npm install rkk-next', {
|
|
117
|
+
stdio: 'inherit',
|
|
118
|
+
cwd: projectPath
|
|
119
|
+
});
|
|
100
120
|
spinner.succeed('rkk-next installed!');
|
|
101
121
|
}
|
|
102
|
-
else {
|
|
103
|
-
process.chdir(targetDir);
|
|
104
|
-
}
|
|
105
122
|
// Step 3: Setup template files
|
|
106
123
|
spinner.start('Setting up rkk-next configuration...');
|
|
107
|
-
setupTemplateFiles(
|
|
124
|
+
setupTemplateFiles(projectPath, answers.router, answers.typescript);
|
|
108
125
|
spinner.succeed('Configuration complete!');
|
|
109
126
|
// Success message
|
|
110
127
|
console.log(chalk_1.default.green.bold('\n✨ Success! Created ' + targetDir));
|