create-alta-app 2.6.0 → 2.9.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 +15 -8
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -450,7 +450,8 @@ async function main() {
450
450
  if (canRun('pnpm --version')) {
451
451
  const spinnerInstall = ora({ text: 'Installing dependencies...', indent: 2 }).start();
452
452
  try {
453
- run('pnpm install', targetDir);
453
+ // Install from monorepo root so pnpm workspace resolves deps correctly
454
+ run('pnpm install', process.cwd());
454
455
  spinnerInstall.succeed(pc.green('Dependencies installed'));
455
456
  } catch {
456
457
  spinnerInstall.fail(pc.yellow('Failed to install dependencies'));
@@ -466,11 +467,16 @@ async function main() {
466
467
  if (credentials) {
467
468
  const spinnerLink = ora({ text: 'Linking Supabase project...', indent: 2 }).start();
468
469
  try {
469
- run(`npx supabase login --token ${credentials.supabaseToken}`, targetDir);
470
- run(`npx supabase link --project-ref ${credentials.supabaseProjectRef}`, targetDir);
470
+ // Login is global — run from monorepo root where supabase CLI is installed
471
+ 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
474
+ spinnerLink.text = `Linking Supabase project: ${credentials.supabaseProjectRef}...`;
475
+ runVerbose(`npx supabase link --project-ref ${credentials.supabaseProjectRef}`, targetDir);
471
476
  spinnerLink.succeed(pc.green('Supabase project linked'));
472
- } catch {
477
+ } catch (err) {
473
478
  spinnerLink.warn(pc.yellow('Could not link Supabase project'));
479
+ console.log(` ${pc.dim('Error: ' + err.message)}`);
474
480
  console.log(` ${pc.dim(`Run manually: npx supabase login && npx supabase link --project-ref ${credentials.supabaseProjectRef}`)}`);
475
481
  }
476
482
  }
@@ -507,9 +513,9 @@ async function main() {
507
513
  spinnerVercel.text = 'Could not source ~/.zshrc — using process.env instead';
508
514
  }
509
515
 
510
- // Link the Vercel project
516
+ // Link from monorepo root — matches rootDirectory setting on Vercel project
511
517
  spinnerVercel.text = `Linking Vercel project: ${projectName}...`;
512
- runVerbose(`npx vercel link --project ${projectName} --yes --token ${credentials.vercelToken}`, targetDir);
518
+ runVerbose(`npx vercel link --project ${projectName} --yes --token ${credentials.vercelToken}`, process.cwd());
513
519
  spinnerVercel.succeed(pc.green('Vercel configured & linked'));
514
520
  } catch (err) {
515
521
  spinnerVercel.warn(pc.yellow('Could not configure Vercel'));
@@ -582,8 +588,9 @@ async function main() {
582
588
  if (credentials?.vercelToken) {
583
589
  const spinnerDeploy = ora({ text: 'Deploying to Vercel...', indent: 2 }).start();
584
590
  try {
585
- spinnerDeploy.text = `Running: vercel --token ${credentials.vercelToken.slice(0, 8)}... in ${targetDir}`;
586
- const deployOutput = runVerbose(`npx vercel --yes --token ${credentials.vercelToken}`, targetDir);
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());
587
594
  if (deployOutput) console.log(`\n${pc.dim(deployOutput.trim())}`);
588
595
  spinnerDeploy.succeed(pc.green(`Deployed to Vercel → ${credentials.vercelUrl || projectName + '.vercel.app'}`));
589
596
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-alta-app",
3
- "version": "2.6.0",
3
+ "version": "2.9.0",
4
4
  "description": "Create a new Alta project",
5
5
  "bin": {
6
6
  "create-alta-app": "./index.mjs"