nextforge-cli 1.0.0 ā 1.2.0
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/bin/cli.js +98 -23
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -196,11 +196,7 @@ program
|
|
|
196
196
|
// Update tsconfig paths
|
|
197
197
|
spinner.text = 'Configuring TypeScript...';
|
|
198
198
|
|
|
199
|
-
spinner.succeed(chalk.green('Project created
|
|
200
|
-
|
|
201
|
-
// Print next steps
|
|
202
|
-
console.log(chalk.bold('\nš Next steps:\n'));
|
|
203
|
-
console.log(chalk.cyan(` cd ${projectName}`));
|
|
199
|
+
spinner.succeed(chalk.green('Project structure created!'));
|
|
204
200
|
|
|
205
201
|
const installCmd = {
|
|
206
202
|
npm: 'npm install',
|
|
@@ -208,20 +204,98 @@ program
|
|
|
208
204
|
pnpm: 'pnpm install',
|
|
209
205
|
}[answers.packageManager];
|
|
210
206
|
|
|
211
|
-
console.log(chalk.cyan(` ${installCmd}`));
|
|
212
|
-
console.log(chalk.cyan(' cp .env.example .env # Edit with your values'));
|
|
213
|
-
console.log(chalk.cyan(' npx prisma generate'));
|
|
214
|
-
console.log(chalk.cyan(' npx prisma db push'));
|
|
215
|
-
|
|
216
207
|
const devCmd = {
|
|
217
208
|
npm: 'npm run dev',
|
|
218
209
|
yarn: 'yarn dev',
|
|
219
210
|
pnpm: 'pnpm dev',
|
|
220
211
|
}[answers.packageManager];
|
|
221
212
|
|
|
222
|
-
|
|
213
|
+
// Ask if user wants to install dependencies
|
|
214
|
+
const { runInstall } = await inquirer.prompt([
|
|
215
|
+
{
|
|
216
|
+
type: 'confirm',
|
|
217
|
+
name: 'runInstall',
|
|
218
|
+
message: 'Install dependencies now?',
|
|
219
|
+
default: true,
|
|
220
|
+
},
|
|
221
|
+
]);
|
|
222
|
+
|
|
223
|
+
if (runInstall) {
|
|
224
|
+
const installSpinner = ora('Installing dependencies...').start();
|
|
225
|
+
try {
|
|
226
|
+
execSync(installCmd, { cwd: projectPath, stdio: 'pipe' });
|
|
227
|
+
installSpinner.succeed(chalk.green('Dependencies installed!'));
|
|
228
|
+
|
|
229
|
+
// Generate Prisma client
|
|
230
|
+
const prismaSpinner = ora('Generating Prisma client...').start();
|
|
231
|
+
try {
|
|
232
|
+
execSync('npx prisma generate', { cwd: projectPath, stdio: 'pipe' });
|
|
233
|
+
prismaSpinner.succeed(chalk.green('Prisma client generated!'));
|
|
234
|
+
} catch (e) {
|
|
235
|
+
prismaSpinner.warn(chalk.yellow('Prisma generate skipped (configure DATABASE_URL first)'));
|
|
236
|
+
}
|
|
223
237
|
|
|
224
|
-
|
|
238
|
+
// Ask if user wants to start dev server
|
|
239
|
+
const { runDev } = await inquirer.prompt([
|
|
240
|
+
{
|
|
241
|
+
type: 'confirm',
|
|
242
|
+
name: 'runDev',
|
|
243
|
+
message: 'Start development server now?',
|
|
244
|
+
default: false,
|
|
245
|
+
},
|
|
246
|
+
]);
|
|
247
|
+
|
|
248
|
+
// Summary
|
|
249
|
+
console.log(chalk.bold.green('\nā
Project ready!\n'));
|
|
250
|
+
console.log(chalk.dim('ā'.repeat(50)));
|
|
251
|
+
console.log(chalk.bold(' š Project: ') + chalk.cyan(projectName));
|
|
252
|
+
console.log(chalk.bold(' š¦ Database: ') + chalk.cyan(answers.database));
|
|
253
|
+
if (answers.useAuth) {
|
|
254
|
+
console.log(chalk.bold(' š Auth: ') + chalk.cyan(answers.authType));
|
|
255
|
+
}
|
|
256
|
+
if (answers.useStripe) {
|
|
257
|
+
console.log(chalk.bold(' š³ Stripe: ') + chalk.green('enabled'));
|
|
258
|
+
}
|
|
259
|
+
if (answers.useEmail) {
|
|
260
|
+
console.log(chalk.bold(' š§ Email: ') + chalk.green('enabled'));
|
|
261
|
+
}
|
|
262
|
+
if (answers.useBullMQ) {
|
|
263
|
+
console.log(chalk.bold(' ā” BullMQ: ') + chalk.green('enabled'));
|
|
264
|
+
}
|
|
265
|
+
if (answers.useDocker) {
|
|
266
|
+
console.log(chalk.bold(' š³ Docker: ') + chalk.green('enabled'));
|
|
267
|
+
}
|
|
268
|
+
console.log(chalk.dim('ā'.repeat(50)));
|
|
269
|
+
|
|
270
|
+
if (runDev) {
|
|
271
|
+
console.log(chalk.bold('\nš Starting development server...\n'));
|
|
272
|
+
console.log(chalk.dim(' API: http://localhost:3000'));
|
|
273
|
+
console.log(chalk.dim(' App: http://localhost:3001\n'));
|
|
274
|
+
execSync(devCmd, { cwd: projectPath, stdio: 'inherit' });
|
|
275
|
+
} else {
|
|
276
|
+
console.log(chalk.bold('\nš Next steps:\n'));
|
|
277
|
+
console.log(chalk.cyan(` cd ${projectName}`));
|
|
278
|
+
console.log(chalk.cyan(' # Edit .env with your database credentials'));
|
|
279
|
+
console.log(chalk.cyan(' npx prisma db push'));
|
|
280
|
+
console.log(chalk.cyan(` ${devCmd}`));
|
|
281
|
+
console.log(chalk.bold('\nš Happy coding!\n'));
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
} catch (e) {
|
|
285
|
+
installSpinner.fail(chalk.red('Installation failed'));
|
|
286
|
+
console.error(e.message);
|
|
287
|
+
}
|
|
288
|
+
} else {
|
|
289
|
+
// Manual instructions
|
|
290
|
+
console.log(chalk.bold('\nš Next steps:\n'));
|
|
291
|
+
console.log(chalk.cyan(` cd ${projectName}`));
|
|
292
|
+
console.log(chalk.cyan(` ${installCmd}`));
|
|
293
|
+
console.log(chalk.cyan(' # Edit .env with your database credentials'));
|
|
294
|
+
console.log(chalk.cyan(' npx prisma generate'));
|
|
295
|
+
console.log(chalk.cyan(' npx prisma db push'));
|
|
296
|
+
console.log(chalk.cyan(` ${devCmd}`));
|
|
297
|
+
console.log(chalk.bold('\nš Happy coding!\n'));
|
|
298
|
+
}
|
|
225
299
|
|
|
226
300
|
} catch (error) {
|
|
227
301
|
spinner.fail(chalk.red('Failed to create project'));
|
|
@@ -251,10 +325,10 @@ function generatePackageJson(projectName, answers) {
|
|
|
251
325
|
},
|
|
252
326
|
dependencies: {
|
|
253
327
|
// Core
|
|
254
|
-
next: '^
|
|
255
|
-
react: '^
|
|
256
|
-
'react-dom': '^
|
|
257
|
-
typescript: '^5.
|
|
328
|
+
next: '^15.1.0',
|
|
329
|
+
react: '^19.0.0',
|
|
330
|
+
'react-dom': '^19.0.0',
|
|
331
|
+
typescript: '^5.7.2',
|
|
258
332
|
|
|
259
333
|
// API
|
|
260
334
|
hono: '^4.0.0',
|
|
@@ -308,13 +382,14 @@ function generatePackageJson(projectName, answers) {
|
|
|
308
382
|
autoprefixer: '^10.4.17',
|
|
309
383
|
},
|
|
310
384
|
devDependencies: {
|
|
311
|
-
'@types/node': '^
|
|
312
|
-
'@types/react': '^
|
|
313
|
-
'@types/react-dom': '^
|
|
314
|
-
eslint: '^
|
|
315
|
-
'eslint-config-next': '^
|
|
316
|
-
|
|
317
|
-
|
|
385
|
+
'@types/node': '^22.10.0',
|
|
386
|
+
'@types/react': '^19.0.0',
|
|
387
|
+
'@types/react-dom': '^19.0.0',
|
|
388
|
+
eslint: '^9.17.0',
|
|
389
|
+
'eslint-config-next': '^15.1.0',
|
|
390
|
+
'@eslint/eslintrc': '^3.2.0',
|
|
391
|
+
tsx: '^4.19.0',
|
|
392
|
+
concurrently: '^9.1.0',
|
|
318
393
|
},
|
|
319
394
|
};
|
|
320
395
|
|