fix(ci): skip lefthook install when .git directory missing

- Prevents lefthook from failing in CI/Vercel environments
- Only installs git hooks when in actual git repository

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ajax Davis 2025-11-29 13:51:05 +10:00
parent 23dd6b1a33
commit 0d7a8e4696
6 changed files with 1336 additions and 6 deletions

40
test-db.mjs Normal file
View file

@ -0,0 +1,40 @@
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient({
datasources: {
db: {
url: process.env.DATABASE_URL,
},
},
});
async function main() {
console.log('Testing database connection...');
// Test 1: Count tools
console.time('Count tools');
const count = await prisma.tool.count();
console.timeEnd('Count tools');
console.log(`Total tools: ${count}`);
// Test 2: Fetch first 20 tools (same as API)
console.time('Fetch 20 tools');
const tools = await prisma.tool.findMany({
orderBy: [{ qualityScore: 'desc' }, { npmDownloadsLastMonth: 'desc' }, { createdAt: 'desc' }],
take: 20,
});
console.timeEnd('Fetch 20 tools');
console.log(`Fetched ${tools.length} tools`);
// Test 3: Check if there are indexes
console.log('\nFirst tool:', tools[0]?.npmPackageName || 'No tools found');
}
main()
.catch((e) => {
console.error('Database error:', e);
process.exit(1);
})
.finally(async () => {
await prisma.$disconnect();
});