morintd / prismock

A mock for PrismaClient, dedicated to unit testing.
https://www.npmjs.com/package/prismock
MIT License
203 stars 23 forks source link

Prisma dependency version + release cadence #1099

Closed tony-cocco closed 2 months ago

tony-cocco commented 2 months ago

More of a question here, Prisma releases new versions very often. We have prisma, @prisma/client, and prismock as deps in our project. Personally, I like to keep the core prisma version in sync, which means we can't really update prismock until you've updated the prisma dep here.

This feels like an increased burden to you. My question is, does it make sense to change prisma to a peerDependency of prismock and open the version up to something like 5.x? Or does it not even matter if we end up having multiple prisma dependencies installed in the lockfile (this has caused issues with other libraries we use)? We could also use a resolution and force the prisma version to reduce duplicate prisma installations but does also mean prismock may break if the prisma version isn't backwards-compatible.

Would also be interested to know what other people are doing if they are staying up-to-date with prisma and prismock.

Thanks for your library and contributions. ❤️

As a quick note: at the time of writing prismock is relying on prisma@5.17.0. Prisma's latest version is 5.19.1.

morintd commented 2 months ago

Hello @tony-cocco , I definitely agree prisma should be a peerDependency. I guess it's a mistake on my part, I only put @prisma/client as a peerDependency.

I'll change it right now, let me know if it works after using the corresponding version.

morintd commented 2 months ago

:tada: This issue has been resolved in version 1.33.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

tony-cocco commented 1 month ago

Hey @morintd thanks for the super fast turnaround. Looking at upgrading to prisma 5.20 today but do still notice that I have some duplicate libraries since prismock also relies on @prisma/debug@5.17.0 and @prisma/internals@5.17.0.

Partial diff after updating everything:

 "@prisma/debug@5.17.0":
   version "5.17.0"
   resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-5.17.0.t
gz#a765105848993984535b6066f8ebc6e6ead26533"
   integrity sha512-l7+AteR3P8FXiYyo496zkuoiJ5r9jLQEdUuxIxNCN1ud8rdbH3GT
xm+f+dCyaSv9l9WY+29L9czaVRXz9mULfg==

+"@prisma/debug@5.20.0":
+  version "5.20.0"
+  resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-5.20.0.t
gz#c6d1cf6e3c6e9dba150347f13ca200b1d66cc9fc"
+  integrity sha512-oCx79MJ4HSujokA8S1g0xgZUGybD4SyIOydoHMngFYiwEwYDQ5tB
QkK5XoEHuwOYDKUOKRn/J0MEymckc4IgsQ==
+
 "@prisma/engines-version@5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cd
e053":
   version "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053"
   resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engi
nes-version-5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053.tgz#3c7cc
1ef3ebc34cbd069e5873b9982f2aabf5acd"
   integrity sha512-tUuxZZysZDcrk5oaNOdrBnnkoTtmNQPkzINFDjz7eG6vcs9AVDmA
/F6K5Plsb2aQc/l5M2EnFqn3htng9FA4hg==

+"@prisma/engines-version@5.20.0-12.06fc58a368dc7be9fbbbe894adf8d445d208
c284":
+  version "5.20.0-12.06fc58a368dc7be9fbbbe894adf8d445d208c284"
+  resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engi
nes-version-5.20.0-12.06fc58a368dc7be9fbbbe894adf8d445d208c284.tgz#9a53b
13cdcfd706ae54198111000f33c63655c39"
+  integrity sha512-Lg8AS5lpi0auZe2Mn4gjuCg081UZf88k3cn0RCwHgR+6cyHHpttP
ZBElJTHf83ZGsRNAmVCZCfUGA57WB4u4JA==
+

There's a few other since internals needs a bunch. Do we think this is an issue?