launchbase 1.0.8 ā 1.0.9
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 +13 -10
- 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.9';
|
|
11
11
|
const program = new Command();
|
|
12
12
|
|
|
13
13
|
function findAvailablePort(startPort = 5432, maxAttempts = 100) {
|
|
@@ -538,18 +538,20 @@ program
|
|
|
538
538
|
env: { ...process.env, PORT: apiPort.toString() }
|
|
539
539
|
});
|
|
540
540
|
|
|
541
|
-
// Start frontend
|
|
541
|
+
// Start frontend if included
|
|
542
|
+
let frontend = null;
|
|
542
543
|
if (options.template) {
|
|
543
544
|
const frontendPath = path.join(targetDir, 'frontend');
|
|
544
545
|
if (await fs.pathExists(frontendPath)) {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
546
|
+
console.log('šØ Starting frontend development server...\n');
|
|
547
|
+
frontend = spawn('npm', ['run', 'dev'], {
|
|
548
|
+
cwd: frontendPath,
|
|
549
|
+
stdio: 'inherit',
|
|
550
|
+
shell: true,
|
|
551
|
+
env: { ...process.env, VITE_API_URL: `http://localhost:${apiPort}`, PORT: frontendPort.toString() }
|
|
552
|
+
});
|
|
553
|
+
} else {
|
|
554
|
+
console.log('ā ļø Frontend folder not found at ' + frontendPath + '\n');
|
|
553
555
|
}
|
|
554
556
|
}
|
|
555
557
|
|
|
@@ -557,6 +559,7 @@ program
|
|
|
557
559
|
process.on('SIGINT', () => {
|
|
558
560
|
console.log('\n\nš Shutting down...');
|
|
559
561
|
backend.kill();
|
|
562
|
+
if (frontend) frontend.kill();
|
|
560
563
|
process.exit(0);
|
|
561
564
|
});
|
|
562
565
|
});
|
package/package.json
CHANGED