patch-package icon indicating copy to clipboard operation
patch-package copied to clipboard

Semver support for ranged patches?

Open dotansimha opened this issue 5 years ago • 2 comments

I noticed that a warning is being printed when package version has a mismatch. In my example, I would like to create a patch that will be applied over ^3 version, without having the need to specify it manually. I guess the actual change should be done here: https://github.com/ds300/patch-package/blob/master/src/applyPatches.ts#L152 , and use semver library to compare the versions and check for match. This way I'll be able to create my-patch+^3.0.0 and it will be applied over ^3.0.1 as well.

dotansimha avatar Jul 29 '20 07:07 dotansimha

This would be great.

Having to rename the patch files on every revsion/minor update is tedious. Especially with automated updates coming with dependabot or alike.

uncaught avatar Mar 15 '23 11:03 uncaught

Not sure about adding version range constraints inside the file name.

I'd be happy to accept a PR to add a cli option that prevents the mismatch warnings from being printed. --disable-version-mismatch-warning or something.

ds300 avatar Mar 15 '23 13:03 ds300