typegoose/mongodb-memory-server

Can you move `mongodb` to a peerDependency?

Closed this issue · 1 comments

Hey guys, so I have a bunch of packages dependent on mongodb in my project, and it seems right to have it as peerDependency in libraries like mongodb-memory-server. Is there any specific reason why it's not a peerDependency?

To my understanding peerDependencies are made for plugins, things that are not required to run the project and or are exposed to consuming code, and neither applies to mongodb-memory-server, it requires mongodb to function and does not really expose any of that code to the consumer. (If you do want to directly interact with the database (which most likely you do), it does not matter what version mongodb-memory-server uses for setup)
Additionally as a historic reason, npm 6 and below didnt automatically install peerDependencies.

my references for this understanding:

Also on modern package managers, if the versions are compatible, they will be de-duplicated anyway. (npm, yarn, pnpm)