I maintain an AngularJS library called Angular Modal Service. I would like to change the dependencies so that I target AngularJS 1.3, like this:
"dependencies": {
"angular": "~1.3.0"
}
However, I know categorically that the library works for ~1.2. I don't want to force consumers who want the latest version of my code to have to upgrade, it is possible to do this:
"dependencies": {
"angular": "~1.3.0 | ~1.2.0"
}
Letting my library remain low impact? And if it is possible, is it in fact appropriate? Are there any good guidelines on this?
One of the things you can do is use your lowest minimum version and allow every version greater than that
But what might be better is to also put the highest possible version that you have tested just in case there is a future version that isn't compatible.
Or a shorthand version of that might look something like this
If you remove the second equal sign from the above what you end up with is a version syntax that node calls an x-range which can be shortened to this
which is the same as
All of this and more can be found on the node semver page.