create-alta-app 1.6.3 → 1.7.2

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 +24 -11
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -322,6 +322,8 @@ async function main() {
322
322
  if (fs.existsSync(packagesDir) && fs.readdirSync(packagesDir).length === 0) {
323
323
  fs.rmSync(packagesDir, { recursive: true, force: true });
324
324
  }
325
+ const scriptsDir = path.join(targetDir, 'scripts');
326
+ if (fs.existsSync(scriptsDir)) fs.rmSync(scriptsDir, { recursive: true, force: true });
325
327
 
326
328
  const rootPkgPath = path.join(targetDir, 'package.json');
327
329
  const rootPkg = JSON.parse(fs.readFileSync(rootPkgPath, 'utf-8'));
@@ -351,20 +353,15 @@ async function main() {
351
353
  },
352
354
  },
353
355
  serve: {
354
- executor: '@nx/vite:dev-server',
356
+ executor: 'nx:run-commands',
355
357
  defaultConfiguration: 'development',
356
358
  options: {
357
- buildTarget: `${projectName}:build`,
359
+ command: 'npx react-router dev',
360
+ cwd: `apps/ai-engineer/${projectName}`,
358
361
  },
359
362
  configurations: {
360
- development: {
361
- buildTarget: `${projectName}:build:development`,
362
- hmr: true,
363
- },
364
- production: {
365
- buildTarget: `${projectName}:build:production`,
366
- hmr: false,
367
- },
363
+ development: {},
364
+ production: {},
368
365
  },
369
366
  },
370
367
  preview: {
@@ -482,6 +479,10 @@ async function main() {
482
479
  lines.push(`export ${key}=${value}`);
483
480
  }
484
481
  fs.appendFileSync(shellRc, lines.join('\n') + '\n');
482
+ // Also set in current process so subsequent steps (deploy, db:push) work
483
+ for (const [key, value] of missing) {
484
+ process.env[key] = value;
485
+ }
485
486
  spinnerShell.succeed(pc.green('Shell credentials configured'));
486
487
  }
487
488
  } catch {
@@ -546,7 +547,19 @@ async function main() {
546
547
  console.log('');
547
548
  }
548
549
 
549
- // ── Step 9: Start dev server ──
550
+ // ── Step 9: Deploy to Vercel ──
551
+ if (credentials?.vercelProjectName) {
552
+ const spinnerDeploy = ora({ text: 'Deploying to Vercel...', indent: 2 }).start();
553
+ try {
554
+ run('pnpm run deploy', targetDir);
555
+ spinnerDeploy.succeed(pc.green('Deployed to Vercel'));
556
+ } catch {
557
+ spinnerDeploy.warn(pc.yellow('Could not deploy to Vercel'));
558
+ console.log(` ${pc.dim('Deploy manually: cd ' + projectName + ' && pnpm deploy')}`);
559
+ }
560
+ }
561
+
562
+ // ── Step 10: Start dev server ──
550
563
  console.log(` ${pc.bold('Starting dev server...')}`);
551
564
  console.log('');
552
565
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-alta-app",
3
- "version": "1.6.3",
3
+ "version": "1.7.2",
4
4
  "description": "Create a new Alta project",
5
5
  "bin": {
6
6
  "create-alta-app": "./index.mjs"