Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
yarn plug and play and optional peerDependencies #3059
In the case of modules like knex, where one of the dependencies is declared by a parent module, the plug and play system fails (e.g. knex won't find pg).
This is precisely what yarn's peerDependenciesMeta field do:
However i suppose it needs to be available in npm too before it can be added to knex's package.json.
Meanwhile, a simple solution would be to be able to pass knex the driver module itself, like
That is interesting... If it can be setup to package.json without breaking npm functionality, I don't see why it couldn't be added. I don't think that just having
However I still didn't understand how that should work in a way that only needed DB driver package would be included... could you elaborate it more how knex's package.json and parent projects package.json should look in that case?