prisma/prisma
client-generator-js
Active contributors: jacek-prisma, Oleksii Orlenko
Purpose
packages/client-generator-js is the legacy generator that backs the provider = "prisma-client-js" directive. It is the original Prisma Client generator — the one most older user projects still use.
It coexists with client-generator-ts (the modern prisma-client generator) in Prisma 7. Both are built and tested simultaneously; users migrate to the new generator on their own schedule.
What it produces
The same shape as client-generator-ts — a typed PrismaClient class, a Prisma namespace, and supporting types — but with subtle output differences chosen for compatibility with older bundlers and pre-ESM environments. Default output path historically was node_modules/.prisma/client.
Directory layout
packages/client-generator-js/src/
├── TSClient/
│ ├── PrismaClient.ts # buildClientOptions method emits constructor option types
│ └── ... # Other TSClient parts
└── ...Key abstractions
| Symbol | File | What it does |
|---|---|---|
buildClientOptions method |
packages/client-generator-js/src/TSClient/PrismaClient.ts |
Emits the TS declaration for PrismaClientOptions (legacy flavor) |
| TSClient generator | packages/client-generator-js/src/TSClient/ |
The class hierarchy that turns DMMF into generated code |
Differences from client-generator-ts
The two generators produce semantically equivalent clients but differ in:
- Module format — JS-flavored generator produces output suited to CJS-first projects; TS-flavored generator targets modern ESM/TS toolchains.
- Runtime selection — both delegate to the same
@prisma/client/runtime, but the generated re-exports and types are slightly different. - Future — the JS generator is in maintenance mode. New features land in
client-generator-tsfirst.
Synchronization with client-generator-ts
When a PrismaClient constructor option changes, both generators must emit the new declaration. The two seams are:
packages/client-generator-js/src/TSClient/PrismaClient.tsbuildClientOptionsmethodpackages/client-generator-ts/src/TSClient/file-generators/PrismaNamespaceFile.tsbuildClientOptionsfunction
Reviewers watch for diffs that touch one and not the other.
Integration points
- Same as
client-generator-ts— DMMF input,ts-buildersfor output, registered inclient-generator-registry, runtime imports from@prisma/client/runtime.
Entry points for modification
- Change emitted types:
src/TSClient/ - Synchronize a new constructor option:
PrismaClient.tsbuildClientOptionsmethod (don't forget the TS-flavored sibling)
See also
client-generator-ts— the modern counterpart- Client generation feature
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.