-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Clean up peer dependencies in first-party plugins #34685
Comments
Hi @aaronadamsCA, we definitely would welcome improvement to (peer)dependencies situation. One thing that we are missing (other than fixing dep problems) is some automated tests to ensure we don't regress in this area in future. I remember trying out https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md at some point in past, but there was some problems with it back then (don't remember if problem was with eslint rule in general or just something about that rule that didn't work for us). But this would only solve part of the issue you described. For example 1-2 seems like plugins actually want to use things that gatsby core provide, but you can't really do it like that (instead gatsby should re-export pieces like that, and then plugin can have peerDep on gatsby and import webpack/babel from it or alternatively plugins should use https://nodejs.org/api/module.html#modulecreaterequirefilename ) |
Makes sense. Some thoughts:
Locally, I've used the following packageExtensions:
gatsby-plugin-image@*:
peerDependenciesMeta:
gatsby-plugin-sharp:
optional: true
gatsby-source-filesystem:
optional: true
gatsby-source-shopify@^6:
peerDependencies:
gatsby: ^4 I'm pretty sure these would be harmless PRs, so I'll try to file them soon. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Not stale, PR filed! |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Co-authored-by: Lennart <[email protected]> Fixes #34685
Preliminary Checks
Description
Yarn 3 gives some warnings on first-party plugins due to inaccurate peer dependencies. Some examples:
For the first two, those shouldn't be peer deps of those packages; the third one should be marked optional with
peerDependenciesMeta
, since you only need it in certain use case; for the last two, the plugin should have Gatsby as a peer dependency.I'd like to improve some of these, but I figured it'd be best to check first if (a) anyone else is looking at this issue and (b) it's okay to do it all in a single PR.
The text was updated successfully, but these errors were encountered: