create-alta-app 1.7.0 → 1.7.2
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/index.mjs +19 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -322,6 +322,8 @@ async function main() {
|
|
|
322
322
|
if (fs.existsSync(packagesDir) && fs.readdirSync(packagesDir).length === 0) {
|
|
323
323
|
fs.rmSync(packagesDir, { recursive: true, force: true });
|
|
324
324
|
}
|
|
325
|
+
const scriptsDir = path.join(targetDir, 'scripts');
|
|
326
|
+
if (fs.existsSync(scriptsDir)) fs.rmSync(scriptsDir, { recursive: true, force: true });
|
|
325
327
|
|
|
326
328
|
const rootPkgPath = path.join(targetDir, 'package.json');
|
|
327
329
|
const rootPkg = JSON.parse(fs.readFileSync(rootPkgPath, 'utf-8'));
|
|
@@ -477,6 +479,10 @@ async function main() {
|
|
|
477
479
|
lines.push(`export ${key}=${value}`);
|
|
478
480
|
}
|
|
479
481
|
fs.appendFileSync(shellRc, lines.join('\n') + '\n');
|
|
482
|
+
// Also set in current process so subsequent steps (deploy, db:push) work
|
|
483
|
+
for (const [key, value] of missing) {
|
|
484
|
+
process.env[key] = value;
|
|
485
|
+
}
|
|
480
486
|
spinnerShell.succeed(pc.green('Shell credentials configured'));
|
|
481
487
|
}
|
|
482
488
|
} catch {
|
|
@@ -541,7 +547,19 @@ async function main() {
|
|
|
541
547
|
console.log('');
|
|
542
548
|
}
|
|
543
549
|
|
|
544
|
-
// ── Step 9:
|
|
550
|
+
// ── Step 9: Deploy to Vercel ──
|
|
551
|
+
if (credentials?.vercelProjectName) {
|
|
552
|
+
const spinnerDeploy = ora({ text: 'Deploying to Vercel...', indent: 2 }).start();
|
|
553
|
+
try {
|
|
554
|
+
run('pnpm run deploy', targetDir);
|
|
555
|
+
spinnerDeploy.succeed(pc.green('Deployed to Vercel'));
|
|
556
|
+
} catch {
|
|
557
|
+
spinnerDeploy.warn(pc.yellow('Could not deploy to Vercel'));
|
|
558
|
+
console.log(` ${pc.dim('Deploy manually: cd ' + projectName + ' && pnpm deploy')}`);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// ── Step 10: Start dev server ──
|
|
545
563
|
console.log(` ${pc.bold('Starting dev server...')}`);
|
|
546
564
|
console.log('');
|
|
547
565
|
try {
|