feat: add initial project configuration and smoke tests
- Created pnpm workspace configuration to manage packages. - Added a placeholder .gitkeep file in the scripts directory. - Implemented a smoke test script to validate core API and web endpoints. - Established TypeScript base configuration for consistent compilation settings. - Introduced Turbo configuration for task management and build processes.
This commit is contained in:
43
packages/api/prisma/seed.ts
Normal file
43
packages/api/prisma/seed.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Prisma seed script — creates deterministic test data for local development.
|
||||
*
|
||||
* Run: npx prisma db seed
|
||||
* make dev-seed
|
||||
*
|
||||
* This is idempotent — safe to run multiple times.
|
||||
*
|
||||
* Replace/extend with real seed data when feature models are added.
|
||||
*/
|
||||
import { PrismaClient } from '../src/generated/prisma/client';
|
||||
import { PrismaPg } from '@prisma/adapter-pg';
|
||||
|
||||
const adapter = new PrismaPg({ connectionString: process.env['DATABASE_URL']! });
|
||||
const prisma = new PrismaClient({ adapter });
|
||||
|
||||
async function main(): Promise<void> {
|
||||
console.log('');
|
||||
console.log('🌱 Seeding davinci-platform dev database...');
|
||||
console.log('');
|
||||
|
||||
// Placeholder — replace when real models exist
|
||||
const existing = await prisma.placeholder.findFirst();
|
||||
if (existing) {
|
||||
console.log(' ⏭ Placeholder record already exists');
|
||||
} else {
|
||||
await prisma.placeholder.create({ data: {} });
|
||||
console.log(' ✅ Placeholder record created');
|
||||
}
|
||||
|
||||
console.log('');
|
||||
console.log('✅ Seed complete');
|
||||
console.log('');
|
||||
}
|
||||
|
||||
main()
|
||||
.catch((e) => {
|
||||
console.error('❌ Seed failed:', e);
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(async () => {
|
||||
await prisma.$disconnect();
|
||||
});
|
||||
Reference in New Issue
Block a user