User story
As an @tsed/prisma user adopting Prisma's modern prisma-client generator,
I want to generate Ts.ED models, repositories, and services from a Prisma Client generated to an explicit directory,
so that I can migrate to recent Prisma versions without retaining prisma-client-js as a compatibility dependency.
Context
Source discussion: https://github.com/orgs/tsedio/discussions/3449
Prisma recommends the prisma-client provider and states that prisma-client-js will be removed in a future Prisma ORM release. The new provider requires an explicit output and generates the client outside node_modules.
The workspace already uses Prisma 7.3.0 to develop @tsed/prisma, but the integration cannot yet consume this new provider.
Product decision
Supporting both Prisma client providers is not a requirement if the resulting implementation or maintenance burden is significant.
The implementation should first assess the cost of keeping prisma-client-js compatibility:
- If it is small and does not introduce fragile conditional behaviour, support both providers during a transition.
- If it is substantial, release a new major version of
@tsed/prisma that supports only prisma-client.
In the Prisma-client-only option:
- The migration must be clearly documented, including the required
output and import-path changes.
- Configuring
prisma-client-js must fail early with an explicit error explaining that it is unsupported and how to migrate.
- Do not silently rewrite or strip
-js from the configured provider; an automatic transformation could conceal an invalid schema and yield surprising output.
Impact analysis
Current blockers
packages/orm/prisma/src/generator.ts declares requiresGenerators: ["prisma-client-js"], so Prisma still requires the legacy generator.
packages/orm/prisma/src/cli/prismaGenerator.ts exclusively looks up a generator whose provider is prisma-client-js; with provider = "prisma-client", that lookup finds nothing and generation fails.
- The client path is derived from
otherGenerators and the implementation assumes output is present. This must be validated against the new provider's required explicit output.
- Generated imports—especially
Prisma.Decimal—must keep working with a locally generated ESM client and must not silently fall back to @prisma/client.
Areas to validate
- Prisma generator contract:
@prisma/generator-helper, @prisma/internals, GeneratorOptions, and DMMF.
- Import resolution for generated models, the
Prisma namespace, enums, and scalar types.
- ESM output and relative paths, including any required extensions for the selected generation mode.
- The measured cost and reliability of retaining
prisma-client-js compatibility.
- Existing fixtures: PostgreSQL ESM, Mongo ESM, enums, and circular references. Prisma's v7 documentation notes that MongoDB is not supported in v7; therefore, the test strategy must distinguish legacy compatibility from the modern Prisma compatibility matrix.
Proposed scope
- Accept
prisma-client as a supported provider in both the manifest and the onGenerate phase.
- Safely resolve the configured client generator and its
output, with an actionable error when no compatible provider or output is configured.
- Propagate the actual client path to every transformation that generates imports.
- Assess legacy
prisma-client-js support and select one of the documented migration paths below.
- Update integration documentation with a
schema.prisma example using prisma-client and a local output.
- Prepare the compatibility matrix for the current Prisma major version. Prisma 8 support must be validated separately against its connector-specific migration guides.
Migration paths
A. Low-impact transition
Maintain both prisma-client and prisma-client-js, with regression tests for both providers.
B. Preferred when dual support is costly
Ship a new major version of @tsed/prisma supporting only prisma-client; document the migration and reject prisma-client-js with an explicit diagnostic.
Acceptance criteria
Out of scope
- Changing Prisma connection configuration (
prisma.config.ts, datasource URLs, or driver adapters) unless required to run the tests.
- Claiming complete Prisma 8 compatibility without executing a dedicated validation matrix.
Planned validation
- Run the focused
packages/orm/prisma test suite.
- Run
prisma generate against the new prisma-client fixture.
- Type-check generated artifacts.
- Run applicable existing ESM fixtures.
- If legacy support is retained, run the equivalent
prisma-client-js fixture.
User story
As an
@tsed/prismauser adopting Prisma's modernprisma-clientgenerator,I want to generate Ts.ED models, repositories, and services from a Prisma Client generated to an explicit directory,
so that I can migrate to recent Prisma versions without retaining
prisma-client-jsas a compatibility dependency.Context
Source discussion: https://github.com/orgs/tsedio/discussions/3449
Prisma recommends the
prisma-clientprovider and states thatprisma-client-jswill be removed in a future Prisma ORM release. The new provider requires an explicitoutputand generates the client outsidenode_modules.The workspace already uses Prisma
7.3.0to develop@tsed/prisma, but the integration cannot yet consume this new provider.Product decision
Supporting both Prisma client providers is not a requirement if the resulting implementation or maintenance burden is significant.
The implementation should first assess the cost of keeping
prisma-client-jscompatibility:@tsed/prismathat supports onlyprisma-client.In the Prisma-client-only option:
outputand import-path changes.prisma-client-jsmust fail early with an explicit error explaining that it is unsupported and how to migrate.-jsfrom the configured provider; an automatic transformation could conceal an invalid schema and yield surprising output.Impact analysis
Current blockers
packages/orm/prisma/src/generator.tsdeclaresrequiresGenerators: ["prisma-client-js"], so Prisma still requires the legacy generator.packages/orm/prisma/src/cli/prismaGenerator.tsexclusively looks up a generator whose provider isprisma-client-js; withprovider = "prisma-client", that lookup finds nothing and generation fails.otherGeneratorsand the implementation assumesoutputis present. This must be validated against the new provider's required explicit output.Prisma.Decimal—must keep working with a locally generated ESM client and must not silently fall back to@prisma/client.Areas to validate
@prisma/generator-helper,@prisma/internals,GeneratorOptions, and DMMF.Prismanamespace, enums, and scalar types.prisma-client-jscompatibility.Proposed scope
prisma-clientas a supported provider in both the manifest and theonGeneratephase.output, with an actionable error when no compatible provider or output is configured.prisma-client-jssupport and select one of the documented migration paths below.schema.prismaexample usingprisma-clientand a local output.Migration paths
A. Low-impact transition
Maintain both
prisma-clientandprisma-client-js, with regression tests for both providers.B. Preferred when dual support is costly
Ship a new major version of
@tsed/prismasupporting onlyprisma-client; document the migration and rejectprisma-client-jswith an explicit diagnostic.Acceptance criteria
generator client { provider = "prisma-client"; output = "../generated/prisma" }andgenerator tsed { provider = "tsed-prisma" }runsprisma generatesuccessfully.Prisma.Decimal—from a custom output.prisma-client-jsconfiguration remains functional and is covered by non-regression tests.@tsed/prismamajor version; documentation provides the migration steps; andprisma-client-jsfails with an explicit, actionable error.prisma-client-jstoprisma-client.output.@tsed/prismadocumentation describes the recommended configuration and Prisma compatibility status.Out of scope
prisma.config.ts, datasource URLs, or driver adapters) unless required to run the tests.Planned validation
packages/orm/prismatest suite.prisma generateagainst the newprisma-clientfixture.prisma-client-jsfixture.