create-alta-app 2.9.0 → 3.1.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 +44 -20
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -450,7 +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
|
|
453
|
+
// Install from monorepo root — pnpm workspace hoists deps there
|
|
454
454
|
run('pnpm install', process.cwd());
|
|
455
455
|
spinnerInstall.succeed(pc.green('Dependencies installed'));
|
|
456
456
|
} catch {
|
|
@@ -467,12 +467,11 @@ async function main() {
|
|
|
467
467
|
if (credentials) {
|
|
468
468
|
const spinnerLink = ora({ text: 'Linking Supabase project...', indent: 2 }).start();
|
|
469
469
|
try {
|
|
470
|
-
//
|
|
470
|
+
// Use npx --yes to auto-download supabase CLI (workspace hoists deps to root)
|
|
471
471
|
spinnerLink.text = 'Logging in to Supabase...';
|
|
472
|
-
runVerbose(`npx supabase login --token ${credentials.supabaseToken}`,
|
|
473
|
-
// Link needs supabase/config.toml — run from app dir
|
|
472
|
+
runVerbose(`npx --yes supabase login --token ${credentials.supabaseToken}`, targetDir);
|
|
474
473
|
spinnerLink.text = `Linking Supabase project: ${credentials.supabaseProjectRef}...`;
|
|
475
|
-
runVerbose(`npx supabase link --project-ref ${credentials.supabaseProjectRef}`, targetDir);
|
|
474
|
+
runVerbose(`npx --yes supabase link --project-ref ${credentials.supabaseProjectRef}`, targetDir);
|
|
476
475
|
spinnerLink.succeed(pc.green('Supabase project linked'));
|
|
477
476
|
} catch (err) {
|
|
478
477
|
spinnerLink.warn(pc.yellow('Could not link Supabase project'));
|
|
@@ -577,40 +576,65 @@ async function main() {
|
|
|
577
576
|
console.log('');
|
|
578
577
|
console.log(` ${pc.magenta('◆')} ${pc.dim('Supabase')} ${credentials.supabaseUrl}`);
|
|
579
578
|
if (credentials.vercelUrl) {
|
|
580
|
-
console.log(` ${pc.magenta('◆')} ${pc.dim('Vercel')} ${credentials.vercelUrl} ${pc.dim('(
|
|
579
|
+
console.log(` ${pc.magenta('◆')} ${pc.dim('Vercel')} ${credentials.vercelUrl} ${pc.dim('(auto-deploys on every push)')}`);
|
|
581
580
|
}
|
|
582
581
|
console.log(` ${pc.magenta('◆')} ${pc.dim('Config')} alta.config.json`);
|
|
583
582
|
console.log(` ${pc.magenta('◆')} ${pc.dim('Location')} ${targetDir}`);
|
|
584
583
|
console.log('');
|
|
585
584
|
}
|
|
586
585
|
|
|
587
|
-
// ── Step 9:
|
|
588
|
-
if (credentials
|
|
589
|
-
const spinnerDeploy = ora({ text: '
|
|
586
|
+
// ── Step 9: Commit, push & trigger Vercel auto-deploy ──
|
|
587
|
+
if (credentials) {
|
|
588
|
+
const spinnerDeploy = ora({ text: 'Preparing deploy...', indent: 2 }).start();
|
|
590
589
|
try {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
spinnerDeploy.
|
|
590
|
+
const relAppPath = path.relative(process.cwd(), targetDir);
|
|
591
|
+
const monorepoRoot = process.cwd();
|
|
592
|
+
|
|
593
|
+
// Format files to pass pre-commit prettier check
|
|
594
|
+
spinnerDeploy.text = 'Formatting files with Prettier...';
|
|
595
|
+
try {
|
|
596
|
+
runVerbose(`npx prettier --write "${relAppPath}/**/*.{ts,tsx,js,jsx,json,css,md}"`, monorepoRoot);
|
|
597
|
+
} catch {
|
|
598
|
+
// Prettier might not be installed globally — continue anyway
|
|
599
|
+
}
|
|
600
|
+
spinnerDeploy.text = 'Files formatted';
|
|
601
|
+
|
|
602
|
+
// Stage the new app files
|
|
603
|
+
spinnerDeploy.text = `Staging files: ${relAppPath}...`;
|
|
604
|
+
runVerbose(`git add "${relAppPath}"`, monorepoRoot);
|
|
605
|
+
spinnerDeploy.text = `Staged ${relAppPath}`;
|
|
606
|
+
|
|
607
|
+
// Commit (--no-verify to skip hooks since we already ran prettier)
|
|
608
|
+
spinnerDeploy.text = `Committing: feat: add ${projectName}...`;
|
|
609
|
+
runVerbose(`git commit --no-verify -m "feat: add ${projectName}"`, monorepoRoot);
|
|
610
|
+
spinnerDeploy.text = `Committed: feat: add ${projectName}`;
|
|
611
|
+
|
|
612
|
+
// Push to GitHub — triggers Vercel auto-deploy
|
|
613
|
+
spinnerDeploy.text = 'Pushing to GitHub...';
|
|
614
|
+
runVerbose('git push', monorepoRoot);
|
|
615
|
+
spinnerDeploy.succeed(pc.green('Pushed to GitHub'));
|
|
616
|
+
|
|
617
|
+
const deployUrl = credentials.vercelUrl || `https://${projectName}.vercel.app`;
|
|
618
|
+
console.log(` ${pc.dim('Vercel will auto-deploy →')} ${pc.cyan(deployUrl)}`);
|
|
619
|
+
console.log(` ${pc.dim('Every future push to this branch will trigger a preview deploy')}`);
|
|
596
620
|
} catch (err) {
|
|
597
|
-
spinnerDeploy.warn(pc.yellow('Could not
|
|
621
|
+
spinnerDeploy.warn(pc.yellow('Could not push to GitHub'));
|
|
598
622
|
console.log(` ${pc.dim('Error: ' + err.message)}`);
|
|
599
|
-
console.log(` ${pc.dim('
|
|
623
|
+
console.log(` ${pc.dim('Push manually:')}`);
|
|
624
|
+
console.log(` ${pc.cyan(`git add apps/ai-engineer/${projectName} && git commit -m "feat: add ${projectName}" && git push`)}`);
|
|
600
625
|
}
|
|
601
|
-
} else {
|
|
602
|
-
console.log(` ${pc.dim('Skipping Vercel deploy — no token available')}`);
|
|
603
626
|
}
|
|
604
627
|
|
|
605
628
|
// ── Step 10: Start dev server ──
|
|
606
629
|
console.log(` ${pc.bold('Starting dev server...')}`);
|
|
607
630
|
console.log('');
|
|
608
631
|
try {
|
|
609
|
-
|
|
632
|
+
// Run from monorepo root using pnpm --filter to resolve workspace binaries
|
|
633
|
+
execSync(`pnpm --filter ${projectName} dev`, { cwd: process.cwd(), stdio: 'inherit' });
|
|
610
634
|
} catch {
|
|
611
635
|
console.log('');
|
|
612
636
|
console.log(` ${pc.dim('To start manually:')}`);
|
|
613
|
-
console.log(` ${pc.cyan(`cd
|
|
637
|
+
console.log(` ${pc.cyan(`cd apps/ai-engineer/${projectName}`)}`);
|
|
614
638
|
console.log(` ${pc.cyan('pnpm dev')}`);
|
|
615
639
|
console.log('');
|
|
616
640
|
}
|