Skip to content

chore: updating peerDependencies #28

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

igorescobar
Copy link

Making sure we can still install it with more recent versions of sharp.

@jwagner
Copy link
Owner

jwagner commented Jan 8, 2023

The PR didn't update the package-lock file. Fixed it on main now and released 2.0.7.

Constantly updating the peerDependency sucks, but not declaring a dependency and just injecting it sucks as well since it can lead to runtime failures. Not sure what a good way to handle this is. Do you have any suggestions @igorescobar ?

@igorescobar
Copy link
Author

igorescobar commented Jan 8, 2023

Hey @jwagner! Sorry about that and thanks for fixing it and releasing it. Yeah, sharp releases minor versions quite often and it must be hard to keep track of it.

If I were you... I would probably be more permissive with the version matching since its very unlikely that with new minor releases smartcrop would break, try something like:

"peerDependencies": {
    "sharp": ">=0.30.0 < 1"
  },

Any version after 0.30 but lower than v1. This would safeguard it for future updates without being super strict I guess 👍

@igorescobar
Copy link
Author

Meanwhile, what I did to work around it was adding this to my package.json:

"overrides": {
    "smartcrop-sharp": {
      "sharp": "$sharp"
    }
  },

@jwagner
Copy link
Owner

jwagner commented Jan 8, 2023

Might actually also be worth asking Lovell why sharp is still at a major of zero after all this time and what his interpretation of semver is. It could be that he doesn't interpret it as

initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

I guess another option would be to just set up a recurring action that updates and releases if the tests pass. Need to think about it a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants