create-alta-app 2.5.0 → 2.7.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 +19 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -14,7 +14,17 @@ const ALTA_SERVICE_URL = 'https://ikbbbmmzxeemjwzrzsmt.supabase.co/functions/v1/
|
|
|
14
14
|
const ALTA_FINALIZE_URL = 'https://ikbbbmmzxeemjwzrzsmt.supabase.co/functions/v1/finalize-project';
|
|
15
15
|
|
|
16
16
|
function run(cmd, cwd) {
|
|
17
|
-
execSync(cmd, { cwd, stdio: '
|
|
17
|
+
execSync(cmd, { cwd, stdio: 'pipe' });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function runVerbose(cmd, cwd) {
|
|
21
|
+
try {
|
|
22
|
+
return execSync(cmd, { cwd, stdio: 'pipe', encoding: 'utf-8' });
|
|
23
|
+
} catch (err) {
|
|
24
|
+
const stderr = err.stderr?.toString() || '';
|
|
25
|
+
const stdout = err.stdout?.toString() || '';
|
|
26
|
+
throw new Error(stderr || stdout || err.message);
|
|
27
|
+
}
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
function canRun(cmd) {
|
|
@@ -440,7 +450,8 @@ async function main() {
|
|
|
440
450
|
if (canRun('pnpm --version')) {
|
|
441
451
|
const spinnerInstall = ora({ text: 'Installing dependencies...', indent: 2 }).start();
|
|
442
452
|
try {
|
|
443
|
-
|
|
453
|
+
// Install from monorepo root so pnpm workspace resolves deps correctly
|
|
454
|
+
run('pnpm install', process.cwd());
|
|
444
455
|
spinnerInstall.succeed(pc.green('Dependencies installed'));
|
|
445
456
|
} catch {
|
|
446
457
|
spinnerInstall.fail(pc.yellow('Failed to install dependencies'));
|
|
@@ -498,8 +509,9 @@ async function main() {
|
|
|
498
509
|
}
|
|
499
510
|
|
|
500
511
|
// Link the Vercel project
|
|
512
|
+
// Link from monorepo root so rootDirectory (apps/ai-engineer/<name>) resolves correctly
|
|
501
513
|
spinnerVercel.text = `Linking Vercel project: ${projectName}...`;
|
|
502
|
-
|
|
514
|
+
runVerbose(`npx vercel link --project ${projectName} --yes --token ${credentials.vercelToken}`, process.cwd());
|
|
503
515
|
spinnerVercel.succeed(pc.green('Vercel configured & linked'));
|
|
504
516
|
} catch (err) {
|
|
505
517
|
spinnerVercel.warn(pc.yellow('Could not configure Vercel'));
|
|
@@ -572,8 +584,10 @@ async function main() {
|
|
|
572
584
|
if (credentials?.vercelToken) {
|
|
573
585
|
const spinnerDeploy = ora({ text: 'Deploying to Vercel...', indent: 2 }).start();
|
|
574
586
|
try {
|
|
575
|
-
|
|
576
|
-
|
|
587
|
+
// Deploy from monorepo root so rootDirectory (apps/ai-engineer/<name>) resolves correctly
|
|
588
|
+
spinnerDeploy.text = `Running: vercel --token ${credentials.vercelToken.slice(0, 8)}... from monorepo root`;
|
|
589
|
+
const deployOutput = runVerbose(`npx vercel --yes --token ${credentials.vercelToken}`, process.cwd());
|
|
590
|
+
if (deployOutput) console.log(`\n${pc.dim(deployOutput.trim())}`);
|
|
577
591
|
spinnerDeploy.succeed(pc.green(`Deployed to Vercel → ${credentials.vercelUrl || projectName + '.vercel.app'}`));
|
|
578
592
|
} catch (err) {
|
|
579
593
|
spinnerDeploy.warn(pc.yellow('Could not deploy to Vercel'));
|