create-alta-app 2.9.0 → 3.0.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/index.mjs +31 -18
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -450,8 +450,7 @@ async function main() {
|
|
|
450
450
|
if (canRun('pnpm --version')) {
|
|
451
451
|
const spinnerInstall = ora({ text: 'Installing dependencies...', indent: 2 }).start();
|
|
452
452
|
try {
|
|
453
|
-
|
|
454
|
-
run('pnpm install', process.cwd());
|
|
453
|
+
run('pnpm install', targetDir);
|
|
455
454
|
spinnerInstall.succeed(pc.green('Dependencies installed'));
|
|
456
455
|
} catch {
|
|
457
456
|
spinnerInstall.fail(pc.yellow('Failed to install dependencies'));
|
|
@@ -467,10 +466,9 @@ async function main() {
|
|
|
467
466
|
if (credentials) {
|
|
468
467
|
const spinnerLink = ora({ text: 'Linking Supabase project...', indent: 2 }).start();
|
|
469
468
|
try {
|
|
470
|
-
//
|
|
469
|
+
// Both run from app dir where node_modules/.bin/supabase exists
|
|
471
470
|
spinnerLink.text = 'Logging in to Supabase...';
|
|
472
|
-
runVerbose(`npx supabase login --token ${credentials.supabaseToken}`,
|
|
473
|
-
// Link needs supabase/config.toml — run from app dir
|
|
471
|
+
runVerbose(`npx supabase login --token ${credentials.supabaseToken}`, targetDir);
|
|
474
472
|
spinnerLink.text = `Linking Supabase project: ${credentials.supabaseProjectRef}...`;
|
|
475
473
|
runVerbose(`npx supabase link --project-ref ${credentials.supabaseProjectRef}`, targetDir);
|
|
476
474
|
spinnerLink.succeed(pc.green('Supabase project linked'));
|
|
@@ -577,29 +575,44 @@ async function main() {
|
|
|
577
575
|
console.log('');
|
|
578
576
|
console.log(` ${pc.magenta('◆')} ${pc.dim('Supabase')} ${credentials.supabaseUrl}`);
|
|
579
577
|
if (credentials.vercelUrl) {
|
|
580
|
-
console.log(` ${pc.magenta('◆')} ${pc.dim('Vercel')} ${credentials.vercelUrl} ${pc.dim('(
|
|
578
|
+
console.log(` ${pc.magenta('◆')} ${pc.dim('Vercel')} ${credentials.vercelUrl} ${pc.dim('(auto-deploys on every push)')}`);
|
|
581
579
|
}
|
|
582
580
|
console.log(` ${pc.magenta('◆')} ${pc.dim('Config')} alta.config.json`);
|
|
583
581
|
console.log(` ${pc.magenta('◆')} ${pc.dim('Location')} ${targetDir}`);
|
|
584
582
|
console.log('');
|
|
585
583
|
}
|
|
586
584
|
|
|
587
|
-
// ── Step 9:
|
|
588
|
-
if (credentials
|
|
589
|
-
const spinnerDeploy = ora({ text: '
|
|
585
|
+
// ── Step 9: Commit, push & trigger Vercel auto-deploy ──
|
|
586
|
+
if (credentials) {
|
|
587
|
+
const spinnerDeploy = ora({ text: 'Preparing deploy...', indent: 2 }).start();
|
|
590
588
|
try {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
spinnerDeploy.
|
|
589
|
+
const relAppPath = path.relative(process.cwd(), targetDir);
|
|
590
|
+
const monorepoRoot = process.cwd();
|
|
591
|
+
|
|
592
|
+
// Stage the new app files
|
|
593
|
+
spinnerDeploy.text = `Staging files: ${relAppPath}...`;
|
|
594
|
+
runVerbose(`git add "${relAppPath}"`, monorepoRoot);
|
|
595
|
+
spinnerDeploy.text = `Staged ${relAppPath}`;
|
|
596
|
+
|
|
597
|
+
// Commit
|
|
598
|
+
spinnerDeploy.text = `Committing: feat: add ${projectName}...`;
|
|
599
|
+
runVerbose(`git commit -m "feat: add ${projectName}"`, monorepoRoot);
|
|
600
|
+
spinnerDeploy.text = `Committed: feat: add ${projectName}`;
|
|
601
|
+
|
|
602
|
+
// Push to GitHub — triggers Vercel auto-deploy
|
|
603
|
+
spinnerDeploy.text = 'Pushing to GitHub...';
|
|
604
|
+
runVerbose('git push', monorepoRoot);
|
|
605
|
+
spinnerDeploy.succeed(pc.green('Pushed to GitHub'));
|
|
606
|
+
|
|
607
|
+
const deployUrl = credentials.vercelUrl || `https://${projectName}.vercel.app`;
|
|
608
|
+
console.log(` ${pc.dim('Vercel will auto-deploy →')} ${pc.cyan(deployUrl)}`);
|
|
609
|
+
console.log(` ${pc.dim('Every future push to this branch will trigger a preview deploy')}`);
|
|
596
610
|
} catch (err) {
|
|
597
|
-
spinnerDeploy.warn(pc.yellow('Could not
|
|
611
|
+
spinnerDeploy.warn(pc.yellow('Could not push to GitHub'));
|
|
598
612
|
console.log(` ${pc.dim('Error: ' + err.message)}`);
|
|
599
|
-
console.log(` ${pc.dim('
|
|
613
|
+
console.log(` ${pc.dim('Push manually:')}`);
|
|
614
|
+
console.log(` ${pc.cyan(`git add apps/ai-engineer/${projectName} && git commit -m "feat: add ${projectName}" && git push`)}`);
|
|
600
615
|
}
|
|
601
|
-
} else {
|
|
602
|
-
console.log(` ${pc.dim('Skipping Vercel deploy — no token available')}`);
|
|
603
616
|
}
|
|
604
617
|
|
|
605
618
|
// ── Step 10: Start dev server ──
|