New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yarn plug and play and optional peerDependencies #3059
Comments
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? |
Released in 0.20.1 |
Hi,
yarn --pnp
is a really interesting thing to speedup module loading:https://yarnpkg.com/en/docs/pnp
however it needs all modules to declare what they depend on to be able to work properly.
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).
pg, mysql2, sqlite3 (...) should be in peerDependencies, but optional.
This is precisely what yarn's peerDependenciesMeta field do:
yarnpkg/yarn@011a634
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
The text was updated successfully, but these errors were encountered: