zahid47 / sharp-watermark

An NPM package to effortlessly add watermarks to your images
https://www.npmjs.com/package/sharp-watermark
MIT License
3 stars 2 forks source link

Unlock sharp dependency version #1

Open peacechen opened 1 month ago

peacechen commented 1 month ago

Thanks for sharing your handy watermarking library. I'm using sharp to perform other tasks and the version doesn't exactly match yours. For now it's just a minor version difference, but this could change in the future and break compatibility. I recommend moving unversioned sharp to peerDependencies, and only version the one in devDependencies for local testing.

  "devDependencies": {
    "@types/node": "^18.15.11",
    "sharp": "^0.32.0",
    "typescript": "^5.0.3"
  },
  "peerDependencies": {
    "sharp": "*"
  }

Would you accept a PR for this?

peacechen commented 2 weeks ago

This has broken the build for my project. sharp-watermark's dependency version of sharp (0.32.0) is conflicting with my project's (0.33.5). It shouldn't happen since they both specify compatible minor versions using ^, but the problem is real. See: https://github.com/lovell/sharp/issues/4200

@zahid47 please move sharp to peerDependencies instead of dependencies.