Colby McHenry преди 4 месеца
родител
ревизия
a9148e674e
променени са 3 файла, в които са добавени 11 реда и са изтрити 5 реда
  1. 2 2
      package-lock.json
  2. 1 1
      package.json
  3. 8 2
      src/directory.ts

+ 2 - 2
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": {

+ 1 - 1
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",

+ 8 - 2
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 {