@@ -2,7 +2,6 @@ import { log } from "@clack/prompts";
22import pc from "picocolors" ;
33
44export function displayPostInstallInstructions (
5- hasAuth : boolean ,
65 database : string ,
76 projectName : string ,
87 packageManager : string ,
@@ -12,52 +11,56 @@ export function displayPostInstallInstructions(
1211 const runCmd = packageManager === "npm" ? "npm run" : packageManager ;
1312 const cdCmd = `cd ${ projectName } ` ;
1413
15- const steps = [ ] ;
14+ log . info ( ` ${ pc . cyan ( "Project created successfully!" ) }
1615
17- if ( ! depsInstalled ) {
18- steps . push ( ` ${ pc . cyan ( packageManager ) } install` ) ;
19- }
16+ ${ pc . bold ( "Next steps:" ) }
17+ ${ pc . cyan ( "1." ) } ${ cdCmd }
18+ ${ ! depsInstalled ? ` ${ pc . cyan ( "2." ) } ${ packageManager } install\n` : "" } ${ pc . cyan ( depsInstalled ? "2." : "3." ) } ${ runCmd } dev
2019
21- if ( hasAuth && database !== "none" ) {
22- steps . push ( `${ pc . yellow ( "Database Setup:" ) } ` ) ;
20+ ${ pc . bold ( "Your project will be available at:" ) }
21+ ${ pc . cyan ( "•" ) } Frontend: http://localhost:3001
22+ ${ pc . cyan ( "•" ) } API: http://localhost:3000
2323
24- if ( orm === "prisma" ) {
25- steps . push (
26- `${ pc . cyan ( "1." ) } Generate Prisma client: ${ pc . green ( `${ runCmd } prisma:generate` ) } ` ,
27- ) ;
28- steps . push (
29- `${ pc . cyan ( "2." ) } Push schema to database: ${ pc . green ( `${ runCmd } prisma:push` ) } ` ,
30- ) ;
31- } else if ( orm === "drizzle" ) {
32- steps . push (
33- `${ pc . cyan ( "1." ) } Apply migrations: ${ pc . green ( `${ runCmd } db:push` ) } ` ,
34- ) ;
35- }
36- }
24+ ${ database !== "none" ? getDatabaseInstructions ( database , orm , runCmd ) : "" } `) ;
25+ }
26+
27+ function getDatabaseInstructions (
28+ database : string ,
29+ orm ?: string ,
30+ runCmd ?: string ,
31+ ) : string {
32+ const instructions = [ ] ;
3733
38- if ( database === "postgres" ) {
39- steps . push ( `${ pc . yellow ( "PostgreSQL Configuration:" ) } ` ) ;
40- steps . push (
41- `Make sure to update ${ pc . cyan ( "packages/server/.env" ) } with your PostgreSQL connection string.` ,
34+ if ( orm === "prisma" ) {
35+ instructions . push (
36+ `${ pc . cyan ( "•" ) } Apply schema: ${ pc . dim ( `${ runCmd } db:push` ) } ` ,
37+ ) ;
38+ instructions . push (
39+ `${ pc . cyan ( "•" ) } Database UI: ${ pc . dim ( `${ runCmd } db:studio` ) } ` ,
4240 ) ;
43- } else if ( database === "sqlite" ) {
44- steps . push ( `${ pc . yellow ( "Database Configuration:" ) } ` ) ;
45- steps . push (
46- `${ pc . cyan ( "packages/server/.env" ) } contains your SQLite connection details. Update if needed.` ,
41+
42+ if ( database === "turso" ) {
43+ instructions . push (
44+ `${ pc . yellow ( "NOTE:" ) } Turso support with Prisma is in Early Access and requires additional setup.` ,
45+ `${ pc . dim ( "Learn more at: https://www.prisma.io/docs/orm/overview/databases/turso" ) } ` ,
46+ ) ;
47+ }
48+ } else if ( orm === "drizzle" ) {
49+ instructions . push (
50+ `${ pc . cyan ( "•" ) } Apply schema: ${ pc . dim ( `${ runCmd } db:push` ) } ` ,
4751 ) ;
48- steps . push (
49- `Start the local SQLite database with : ${ pc . green ( `${ runCmd } db:local ` ) } ` ,
52+ instructions . push (
53+ `${ pc . cyan ( "•" ) } Database UI : ${ pc . dim ( `${ runCmd } db:studio ` ) } ` ,
5054 ) ;
5155 }
5256
53- steps . push ( `${ pc . yellow ( "Start Development:" ) } ` ) ;
54- steps . push ( `${ pc . green ( `${ runCmd } dev` ) } ` ) ;
55-
56- log . info ( `${ pc . cyan ( "Installation completed!" ) } Here are some next steps:
57-
58- ${ cdCmd }
59- ${ steps . join ( "\n" ) }
57+ if ( database === "sqlite" ) {
58+ instructions . push (
59+ `${ pc . cyan ( "•" ) } Start local DB: ${ pc . dim ( `cd packages/server && ${ runCmd } db:local` ) } ` ,
60+ ) ;
61+ }
6062
61- The client application will be available at ${ pc . cyan ( "http://localhost:3001" ) }
62- The API server will be running at ${ pc . cyan ( "http://localhost:3000" ) } ` ) ;
63+ return instructions . length
64+ ? `${ pc . bold ( "Database commands:" ) } \n${ instructions . join ( "\n" ) } \n\n`
65+ : "" ;
6366}
0 commit comments