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.
Files changed (2) hide show
  1. package/index.mjs +31 -18
  2. 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
- // Install from monorepo root so pnpm workspace resolves deps correctly
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
- // Login is global — run from monorepo root where supabase CLI is installed
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}`, process.cwd());
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('(first deploy may take a few minutes)')}`);
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: Deploy to Vercel ──
588
- if (credentials?.vercelToken) {
589
- const spinnerDeploy = ora({ text: 'Deploying to Vercel...', indent: 2 }).start();
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
- // Deploy from monorepo root — rootDirectory on Vercel project points to the app
592
- spinnerDeploy.text = `Deploying from monorepo root...`;
593
- const deployOutput = runVerbose(`npx vercel --yes --token ${credentials.vercelToken}`, process.cwd());
594
- if (deployOutput) console.log(`\n${pc.dim(deployOutput.trim())}`);
595
- spinnerDeploy.succeed(pc.green(`Deployed to Vercel ${credentials.vercelUrl || projectName + '.vercel.app'}`));
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 deploy to Vercel'));
611
+ spinnerDeploy.warn(pc.yellow('Could not push to GitHub'));
598
612
  console.log(` ${pc.dim('Error: ' + err.message)}`);
599
- console.log(` ${pc.dim('Deploy manually: cd ' + projectName + ' && vercel --token $VERCEL_TOKEN')}`);
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 ──
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-alta-app",
3
- "version": "2.9.0",
3
+ "version": "3.0.0",
4
4
  "description": "Create a new Alta project",
5
5
  "bin": {
6
6
  "create-alta-app": "./index.mjs"