Skip to content

Instantly share code, notes, and snippets.

@devpanda0
devpanda0 / generate-prisma-classes.ts
Last active July 19, 2025 06:41
Script to auto-generate entity classes, DTOs, and associated files from Prisma models
import { InterfaceDeclaration, Project, SyntaxKind } from 'ts-morph';
import * as path from 'path';
import * as fs from 'fs';
interface Property {
propName: string;
propType: string;
isOptional: boolean;
validator: string;
example: string;
isRelation: boolean;