I had a problem. I was working with Prisma across multiple projects and needed to share database types between them. The regular Prisma client comes with all its dependencies and runtime overhead. What I really wanted was just the clean TypeScript interfaces I could copy anywhere.
The Problem
When you use Prisma, you get fantastic type safety. But those types are tied to the Prisma client. If you want to use the same types in:
Your frontend React app
A separate microservice
A shared utility library
Another project entirely
You're stuck. You either duplicate type definitions manually or import the entire Prisma client just for types. Neither solution felt right.
The Solution
I built prisma-standalone-types. It generates clean TypeScript interfaces from your Prisma schema with zero dependencies. You can copy these types anywhere and they just work.
Here's what it does:
Reads your existing Prisma schema
Generates JSON Schema using prisma-json-schema-generator
Converts that to clean TypeScript interfaces
Outputs a file you can copy to any project
Example
Your Prisma schema:
prisma
enum UserRole {
ADMIN
USER
}
model User {
id String @id @default(uuid())
name String
email String?
role UserRole @default(USER)
createdAt DateTime @default(now())
}
Documentation: Full README with examples and options
I built this because I needed it. Hopefully it solves the same problem for you. The package handles all the complex JSON Schema to TypeScript conversion automatically. You just run one command and get clean, copyable types.
Try it out and let me know what you think. Issues and contributions welcome on GitHub.