diff --git a/src/config/constants.ts b/src/config/constants.ts index 2d906b7..d7b3bb3 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -1,6 +1,7 @@ import { fileURLToPath } from 'url'; import { dirname } from 'path'; import path from 'path'; +import fs from 'fs'; // Get current directory (equivalent to SQUAD_DIR in bash) export const __filename = fileURLToPath(import.meta.url); @@ -14,7 +15,7 @@ export const getSpecWrightDir = (targetDir: string = process.cwd()): string => { // Check if we're in the specwright package itself or a target project const packagePath = path.join(targetDir, 'package.json'); try { - const pkg = require(packagePath); + const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf-8')); if (pkg.name === 'specwright') { // We're in the specwright package itself (development mode) return targetDir; @@ -22,7 +23,7 @@ export const getSpecWrightDir = (targetDir: string = process.cwd()): string => { } catch { // No package.json or not specwright } - + // Target project - use specwright/ subfolder return path.join(targetDir, 'specwright'); }; diff --git a/src/web-server.ts b/src/web-server.ts index a0358b9..b49e1bb 100644 --- a/src/web-server.ts +++ b/src/web-server.ts @@ -3994,3 +3994,11 @@ ${suggestion || 'Implement this change directly in your code editor.'} return { server, wss, watcher }; } + +// Auto-start when run directly (e.g. `tsx src/web-server.ts`) +if (import.meta.url === `file://${process.argv[1]}`) { + startWebServer().catch((err) => { + console.error('Failed to start web server:', err); + process.exit(1); + }); +} diff --git a/src/web-ui/src/components/AIToolLogos.tsx b/src/web-ui/src/components/AIToolLogos.tsx index a74fc31..32554b7 100644 --- a/src/web-ui/src/components/AIToolLogos.tsx +++ b/src/web-ui/src/components/AIToolLogos.tsx @@ -71,15 +71,13 @@ export const CodexLogo = ({ size = 40, className }: LogoProps) => ( width={size} height={size} viewBox="0 0 24 24" - fill="none" + fill="currentColor" xmlns="http://www.w3.org/2000/svg" className={className} role="img" > Codex - - - + );