launchbase 1.0.7 ā 1.0.8
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/launchbase.js +19 -4
- package/package.json +1 -1
package/bin/launchbase.js
CHANGED
|
@@ -7,7 +7,7 @@ const crypto = require('crypto');
|
|
|
7
7
|
const fs = require('fs-extra');
|
|
8
8
|
const { execSync, spawn } = require('child_process');
|
|
9
9
|
|
|
10
|
-
const VERSION = '1.0.
|
|
10
|
+
const VERSION = '1.0.8';
|
|
11
11
|
const program = new Command();
|
|
12
12
|
|
|
13
13
|
function findAvailablePort(startPort = 5432, maxAttempts = 100) {
|
|
@@ -472,11 +472,17 @@ program
|
|
|
472
472
|
console.log('š¦ Installing dependencies...\n');
|
|
473
473
|
runCommand('npm install', { cwd: targetDir });
|
|
474
474
|
|
|
475
|
+
// Install frontend dependencies if template was requested
|
|
475
476
|
if (options.template) {
|
|
476
477
|
const frontendPath = path.join(targetDir, 'frontend');
|
|
478
|
+
console.log(` Checking frontend path: ${frontendPath}`);
|
|
479
|
+
console.log(` Frontend exists: ${await fs.pathExists(frontendPath)}`);
|
|
480
|
+
|
|
477
481
|
if (await fs.pathExists(frontendPath)) {
|
|
478
482
|
console.log('\nš¦ Installing frontend dependencies...\n');
|
|
479
483
|
runCommand('npm install', { cwd: frontendPath });
|
|
484
|
+
} else {
|
|
485
|
+
console.log(' ā ļø Frontend folder not found. Template may not have been copied.\n');
|
|
480
486
|
}
|
|
481
487
|
}
|
|
482
488
|
|
|
@@ -490,9 +496,18 @@ program
|
|
|
490
496
|
// Wait a moment for DB to be fully ready
|
|
491
497
|
await new Promise(r => setTimeout(r, 2000));
|
|
492
498
|
|
|
493
|
-
// Run migrations
|
|
494
|
-
console.log('š
|
|
495
|
-
|
|
499
|
+
// Run migrations - use reset for fresh projects to avoid drift
|
|
500
|
+
console.log('š Setting up database schema...\n');
|
|
501
|
+
try {
|
|
502
|
+
// Try reset first (for fresh DB or when there's drift)
|
|
503
|
+
execSync('npx prisma migrate reset --force', {
|
|
504
|
+
cwd: targetDir,
|
|
505
|
+
stdio: 'inherit'
|
|
506
|
+
});
|
|
507
|
+
} catch {
|
|
508
|
+
// If reset fails, try regular migrate
|
|
509
|
+
runCommand('npx prisma migrate dev --name init', { cwd: targetDir });
|
|
510
|
+
}
|
|
496
511
|
dbReady = true;
|
|
497
512
|
}
|
|
498
513
|
}
|
package/package.json
CHANGED