feat: add architecture sync script and cheerio dependency

- Added sync:arch npm script to synchronize architecture documentation
- Installed cheerio for HTML parsing capabilities
- Alphabetized package.json dependencies for better maintainability
This commit is contained in:
Yusuf İpek
2025-11-10 19:47:07 +03:00
parent 08f35aedbc
commit fdd5d9ef63
5 changed files with 529 additions and 15 deletions
+36
View File
@@ -0,0 +1,36 @@
import { NextResponse } from 'next/server'
import { query } from '@/lib/database/config'
export async function GET() {
try {
// Check if arch platform exists
const platformResult = await query(
'SELECT * FROM platforms WHERE id = $1',
['arch']
)
// Count arch packages
const countResult = await query(
'SELECT COUNT(*) FROM packages WHERE platform_id = $1',
['arch']
)
// Get sample packages
const sampleResult = await query(
'SELECT name, version, description FROM packages WHERE platform_id = $1 LIMIT 5',
['arch']
)
return NextResponse.json({
platform: platformResult.rows[0] || null,
totalPackages: parseInt(countResult.rows[0].count),
samplePackages: sampleResult.rows
})
} catch (error) {
console.error('Debug error:', error)
return NextResponse.json(
{ error: error instanceof Error ? error.message : 'Unknown error' },
{ status: 500 }
)
}
}