github arthurfiorette/prisma-json-types-generator v6.0.0

one hour ago

The generator no longer uses the TypeScript compiler. It parses Prisma's generated client with oxc-parser, a parser written in Rust, and replaces the type text in place.

typescript is no longer a dependency or peer dependency. Your project can use TypeScript 5.9, 6 or 7, and the generator does not care which one.

Faster generation

Generator time as reported by prisma generate, median of 5 runs. Apple M4 Pro, Node 24.22.1, Prisma 7.10.1. Each model has Json, Json?, Json[], a typed String and a literal-typed Int.

Schema Client v5.2.0 v6.0.0 Speedup
10 models prisma-client-js 62 ms 30 ms 2.1x
10 models prisma-client 57 ms 30 ms 1.9x
50 models prisma-client-js 182 ms 94 ms 1.9x
50 models prisma-client 200 ms 97 ms 2.1x
300 models prisma-client-js (17 MB index.d.ts) 945 ms 455 ms 2.1x
300 models prisma-client (300 model files) 1130 ms 467 ms 2.4x

Smaller install

v5.2.0 v6.0.0
typescript@6.0.3: 24.3 MB unpacked oxc-parser 2.9 MB + one platform binding (~2.2 MB) + @oxc-project/types 45 KB

The binding is installed for your platform through optional dependencies, so don't install with optional dependencies disabled.

Breaking changes

  • Requires Prisma 7.10 or later.
  • Requires Node.js ^20.19.0 || >=22.12.0, the same range Prisma 7 supports.

Fixes

  • With generatedFileExtension = "mts" (or "cts"), the shared helper types are now written to pjtg.mts / pjtg.cts, which is what the generated imports point to. Before, they were written to pjtg.ts, the imports did not resolve, and every PJTG.* type was silently any because Prisma marks its files with @ts-nocheck.

Upgrading

Update the package. If you only kept typescript around for this generator, you can remove it. See Legacy versions for which release supports which Prisma and TypeScript versions.

Don't miss a new prisma-json-types-generator release

NewReleases is sending notifications on new releases.