diff --git a/package-lock.json b/package-lock.json index 1766a8e..819db7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@colbymchenry/codegraph", - "version": "0.5.3", + "version": "0.5.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@colbymchenry/codegraph", - "version": "0.5.3", + "version": "0.5.5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index ea4bdde..9fb2dbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@colbymchenry/codegraph", - "version": "0.5.3", + "version": "0.5.5", "description": "Supercharge Claude Code with semantic code intelligence. 30% fewer tokens, 25% fewer tool calls, 100% local.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/directory.ts b/src/directory.ts index 09db71e..588911c 100644 --- a/src/directory.ts +++ b/src/directory.ts @@ -241,10 +241,16 @@ export function validateDirectory(projectRoot: string): { return { valid: false, errors }; } - // Check for required files + // Auto-repair missing .gitignore (non-critical file) const gitignorePath = path.join(codegraphDir, '.gitignore'); if (!fs.existsSync(gitignorePath)) { - errors.push('.gitignore missing in .codegraph directory'); + try { + const gitignoreContent = `# CodeGraph data files\n# These are local to each machine and should not be committed\n\n# Database\n*.db\n*.db-wal\n*.db-shm\n\n# Cache\ncache/\n\n# Logs\n*.log\n\n# Hook markers\n.dirty\n`; + fs.writeFileSync(gitignorePath, gitignoreContent, 'utf-8'); + } catch { + // Non-fatal: warn but don't block + errors.push('.gitignore missing in .codegraph directory and could not be created'); + } } return {