Refactor database integration to use bun:sqlite instead of better-sqlite3
- Updated import statements across multiple files to use bun:sqlite. - Changed database query methods from `prepare` to `query` for consistency. - Removed dependency on better-sqlite3 from package.json and adjusted package.json to specify bun as the engine. - Modified hook installation process to eliminate unnecessary dependency installation. - Updated migration scripts to align with bun:sqlite's API.
This commit is contained in:
+2
-15
@@ -262,25 +262,12 @@ function writeHookFiles(timeout: number = 180000): void {
|
||||
};
|
||||
writeFileSync(join(runtimeHooksDir, 'config.json'), JSON.stringify(hookConfig, null, 2));
|
||||
|
||||
// Create package.json and install dependencies in hooks directory
|
||||
// Create package.json in hooks directory (no dependencies needed with bun:sqlite)
|
||||
const hookPackageJson = {
|
||||
name: "claude-mem-hooks",
|
||||
type: "module",
|
||||
dependencies: {
|
||||
"better-sqlite3": "^11.8.0"
|
||||
}
|
||||
type: "module"
|
||||
};
|
||||
writeFileSync(join(runtimeHooksDir, 'package.json'), JSON.stringify(hookPackageJson, null, 2));
|
||||
|
||||
// Install dependencies
|
||||
try {
|
||||
execSync('npm install --silent', {
|
||||
cwd: runtimeHooksDir,
|
||||
stdio: 'pipe'
|
||||
});
|
||||
} catch (error) {
|
||||
// Silent fail - hooks might still work if better-sqlite3 is globally available
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user