Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR aligned all
safe-sharp.js
in official packages and movesharp
from direct dependencies to peerDependencies.Documentation
Moving
sharp
from direct dependency intogatsby-sharp
in all packages would probably causesharp
to not be installed when Gatsby is being used without installinggatsby-sharp
.Yarn or other package managers would warn that a peerDependency is not fulfilled and/or installing them by default.
This might warrant a mention of installing
gatsby-sharp
in documentation pages pertaining to Gatsby image processing.Tests
I did not run automated e2e tests that are in this repository. Instead I use the modified packages via
yarn link
. No problem occurred for my site that usegatsby-plugin-sharp
. As the changes are identical with other packages, I think this change will do identically.Related Issues
These commints carry forward #34339 and should be a way to move forward to allow for single
sharp
instance source for all Gatsby plugins.The "friction" mentioned in safe-sharp.js files can be mitigated with documentation, and developers familiar with dependency updates should not face any issues.