genbox 1.0.74 → 1.0.75

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.
@@ -337,12 +337,17 @@ async function runSoftRebuild(options) {
337
337
  log(`Warning: Database restore failed: ${error.message}`, 'error');
338
338
  }
339
339
  }
340
- // Step 8: Start PM2 services
340
+ // Step 8: Start PM2 services (only for apps with runner: pm2 or unspecified)
341
341
  onStep?.('Starting application services...');
342
342
  for (const app of resolved.apps) {
343
343
  const appConfig = config.apps[app.name];
344
344
  if (!appConfig)
345
345
  continue;
346
+ // Skip apps with runner: docker - they're already running via Docker Compose
347
+ if (appConfig.runner === 'docker') {
348
+ log(`Skipping ${app.name} (runner: docker, already started via Docker Compose)`, 'dim');
349
+ continue;
350
+ }
346
351
  // Find the repo path for this app
347
352
  const appPath = appConfig.path || app.name;
348
353
  const repoPath = resolved.repos.find(r => r.name === app.name)?.path ||
@@ -362,11 +367,12 @@ async function runSoftRebuild(options) {
362
367
  }
363
368
  }
364
369
  else {
365
- // Check for start script in package.json
366
- const hasStartScript = await sshExec(ip, keyPath, `grep -q '"start"' ${repoPath}/package.json 2>/dev/null && echo yes || echo no`, 10);
367
- if (hasStartScript.output === 'yes') {
368
- log(`Starting ${app.name} with PM2 (npm start)...`, 'info');
369
- const pm2Result = await sshExecStream(ip, keyPath, `cd ${repoPath} && source ~/.nvm/nvm.sh && pm2 start npm --name ${app.name} -- start`, {
370
+ // Use configured dev command, or fall back to dev script, then start script
371
+ const devCommand = appConfig.commands?.dev;
372
+ if (devCommand) {
373
+ // Use the configured dev command
374
+ log(`Starting ${app.name} with PM2 (${devCommand})...`, 'info');
375
+ const pm2Result = await sshExecStream(ip, keyPath, `cd ${repoPath} && source ~/.nvm/nvm.sh && pm2 start "pnpm run ${devCommand}" --name ${app.name}`, {
370
376
  onStdout: (line) => log(line, 'dim'),
371
377
  timeoutSecs: 60,
372
378
  });
@@ -374,6 +380,34 @@ async function runSoftRebuild(options) {
374
380
  log(`✓ Started ${app.name}`, 'success');
375
381
  }
376
382
  }
383
+ else {
384
+ // Check for dev script in package.json first, then start
385
+ const hasDevScript = await sshExec(ip, keyPath, `grep -q '"dev"' ${repoPath}/package.json 2>/dev/null && echo yes || echo no`, 10);
386
+ if (hasDevScript.output === 'yes') {
387
+ log(`Starting ${app.name} with PM2 (pnpm dev)...`, 'info');
388
+ const pm2Result = await sshExecStream(ip, keyPath, `cd ${repoPath} && source ~/.nvm/nvm.sh && pm2 start "pnpm run dev" --name ${app.name}`, {
389
+ onStdout: (line) => log(line, 'dim'),
390
+ timeoutSecs: 60,
391
+ });
392
+ if (pm2Result.success) {
393
+ log(`✓ Started ${app.name}`, 'success');
394
+ }
395
+ }
396
+ else {
397
+ // Fall back to start script
398
+ const hasStartScript = await sshExec(ip, keyPath, `grep -q '"start"' ${repoPath}/package.json 2>/dev/null && echo yes || echo no`, 10);
399
+ if (hasStartScript.output === 'yes') {
400
+ log(`Starting ${app.name} with PM2 (pnpm start)...`, 'info');
401
+ const pm2Result = await sshExecStream(ip, keyPath, `cd ${repoPath} && source ~/.nvm/nvm.sh && pm2 start "pnpm run start" --name ${app.name}`, {
402
+ onStdout: (line) => log(line, 'dim'),
403
+ timeoutSecs: 60,
404
+ });
405
+ if (pm2Result.success) {
406
+ log(`✓ Started ${app.name}`, 'success');
407
+ }
408
+ }
409
+ }
410
+ }
377
411
  }
378
412
  }
379
413
  // Step 9: Save PM2 process list
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genbox",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "description": "Genbox CLI - AI-Powered Development Environments",
5
5
  "main": "dist/index.js",
6
6
  "bin": {