create-alta-app 2.1.0 → 2.2.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 +16 -22
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -448,7 +448,7 @@ async function main() {
448
448
  }
449
449
 
450
450
 
451
- // ── Step 6: Login & link Supabase + Vercel ──
451
+ // ── Step 6: Login & link Supabase ──
452
452
  if (credentials) {
453
453
  const spinnerLink = ora({ text: 'Linking Supabase project...', indent: 2 }).start();
454
454
  try {
@@ -459,33 +459,27 @@ async function main() {
459
459
  spinnerLink.warn(pc.yellow('Could not link Supabase project'));
460
460
  console.log(` ${pc.dim(`Run manually: npx supabase login && npx supabase link --project-ref ${credentials.supabaseProjectRef}`)}`);
461
461
  }
462
+ }
462
463
 
463
- const spinnerVercel = ora({ text: 'Authenticating Vercel CLI...', indent: 2 }).start();
464
- try {
465
- // Persist Vercel auth globally so user doesn't need --token on every command
466
- const vercelConfigDir = path.join(process.env.HOME, 'Library', 'Application Support', 'com.vercel.cli');
467
- if (!fs.existsSync(vercelConfigDir)) fs.mkdirSync(vercelConfigDir, { recursive: true });
468
-
469
- fs.writeFileSync(
470
- path.join(vercelConfigDir, 'auth.json'),
471
- JSON.stringify({ token: credentials.vercelToken }) + '\n'
472
- );
473
-
474
- // Set current team scope
475
- const configPath = path.join(vercelConfigDir, 'config.json');
476
- let vercelConfig = {};
477
- if (fs.existsSync(configPath)) {
478
- vercelConfig = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
464
+ // ── Step 6b: Login & link Vercel ──
465
+ if (credentials) {
466
+ // Check if already logged in to Vercel
467
+ if (!canRun('npx vercel whoami')) {
468
+ console.log(`\n ${pc.cyan('Vercel login required opening browser...')}\n`);
469
+ try {
470
+ execSync('npx vercel login', { cwd: targetDir, stdio: 'inherit' });
471
+ } catch {
472
+ console.log(` ${pc.dim('Vercel login skipped run "vercel login" later to enable deploys')}`);
479
473
  }
480
- vercelConfig.currentTeam = credentials.vercelTeamId;
481
- fs.writeFileSync(configPath, JSON.stringify(vercelConfig, null, 2) + '\n');
474
+ }
482
475
 
483
- // Link the project to Vercel
476
+ const spinnerVercel = ora({ text: 'Linking Vercel project...', indent: 2 }).start();
477
+ try {
484
478
  run(`npx vercel link --project ${projectName} --yes`, targetDir);
485
- spinnerVercel.succeed(pc.green('Vercel authenticated & project linked'));
479
+ spinnerVercel.succeed(pc.green('Vercel project linked'));
486
480
  } catch {
487
481
  spinnerVercel.warn(pc.yellow('Could not link Vercel project'));
488
- console.log(` ${pc.dim('Deploy manually: cd ' + projectName + ' && pnpm run deploy')}`);
482
+ console.log(` ${pc.dim('Run manually: vercel link --project ' + projectName)}`);
489
483
  }
490
484
  }
491
485
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-alta-app",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Create a new Alta project",
5
5
  "bin": {
6
6
  "create-alta-app": "./index.mjs"