From a7c19f15cdecfc9b44ef3de7164d6d74f2c2e057 Mon Sep 17 00:00:00 2001 From: Illia Filippov Date: Sat, 20 Dec 2025 23:05:27 +0100 Subject: [PATCH 1/2] fix(init): show Playwright browser download progress The Playwright chromium installation was running silently, causing the script to appear frozen at "Checking Playwright browsers..." for several minutes during first-time setup. Change stdio from 'ignore' to 'inherit' so users can see download progress and understand what's happening. --- init.mjs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/init.mjs b/init.mjs index 500a9115..b4a54e13 100644 --- a/init.mjs +++ b/init.mjs @@ -2,7 +2,7 @@ /** * Automaker - Cross-Platform Development Environment Setup and Launch Script - * + * * This script works on Windows, macOS, and Linux. */ @@ -59,7 +59,11 @@ function printHeader() { */ function execCommand(command, options = {}) { try { - return execSync(command, { encoding: 'utf8', stdio: 'pipe', ...options }).trim(); + return execSync(command, { + encoding: 'utf8', + stdio: 'pipe', + ...options, + }).trim(); } catch { return null; } @@ -94,7 +98,7 @@ function getProcessesOnPort(port) { try { const output = execCommand(`lsof -ti:${port}`); if (output) { - output.split('\n').forEach(pid => { + output.split('\n').forEach((pid) => { const parsed = parseInt(pid.trim(), 10); if (parsed > 0) pids.add(parsed); }); @@ -158,7 +162,7 @@ async function killPort(port) { * Sleep for a given number of milliseconds */ function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); + return new Promise((resolve) => setTimeout(resolve, ms)); } /** @@ -291,7 +295,7 @@ async function main() { const playwright = crossSpawn( 'npx', ['playwright', 'install', 'chromium'], - { stdio: 'ignore', cwd: path.join(__dirname, 'apps', 'ui') } + { stdio: 'inherit', cwd: path.join(__dirname, 'apps', 'ui') } ); playwright.on('close', () => resolve()); playwright.on('error', () => resolve()); @@ -323,7 +327,7 @@ async function main() { await cleanup(); process.exit(0); }; - + process.on('SIGINT', () => handleExit('SIGINT')); process.on('SIGTERM', () => handleExit('SIGTERM')); @@ -344,7 +348,9 @@ async function main() { } // Start server in background - const logStream = fs.createWriteStream(path.join(__dirname, 'logs', 'server.log')); + const logStream = fs.createWriteStream( + path.join(__dirname, 'logs', 'server.log') + ); serverProcess = runNpm(['run', 'dev:server'], { stdio: ['ignore', 'pipe', 'pipe'], }); @@ -377,7 +383,10 @@ async function main() { } log('✓ Server is ready!', 'green'); - log(`The application will be available at: http://localhost:3007`, 'green'); + log( + `The application will be available at: http://localhost:3007`, + 'green' + ); console.log(''); // Start web app @@ -411,4 +420,3 @@ main().catch((err) => { cleanup(); process.exit(1); }); - From f30240267f279c689fe0b2806ce3be993a54ec20 Mon Sep 17 00:00:00 2001 From: Illia Filippov Date: Sat, 20 Dec 2025 23:31:56 +0100 Subject: [PATCH 2/2] fix(init): improve Playwright installation error handling Updated the Playwright browser installation process to capture and log the exit code, providing feedback on success or failure. If the installation fails, a warning message is displayed, enhancing user awareness during setup. --- init.mjs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/init.mjs b/init.mjs index b4a54e13..56bb8a56 100644 --- a/init.mjs +++ b/init.mjs @@ -291,17 +291,26 @@ async function main() { // Install Playwright browsers from apps/ui where @playwright/test is installed log('Checking Playwright browsers...', 'yellow'); try { - await new Promise((resolve) => { + const exitCode = await new Promise((resolve) => { const playwright = crossSpawn( 'npx', ['playwright', 'install', 'chromium'], { stdio: 'inherit', cwd: path.join(__dirname, 'apps', 'ui') } ); - playwright.on('close', () => resolve()); - playwright.on('error', () => resolve()); + playwright.on('close', (code) => resolve(code)); + playwright.on('error', () => resolve(1)); }); + + if (exitCode === 0) { + log('Playwright browsers ready', 'green'); + } else { + log( + 'Playwright installation failed (browser automation may not work)', + 'yellow' + ); + } } catch { - // Ignore errors - Playwright install is optional + log('Playwright installation skipped', 'yellow'); } // Kill any existing processes on required ports