mirror of
https://github.com/semver/semver.git
synced 2026-07-11 06:53:03 -05:00
[GH-ISSUE #613] How to increment a version with a prefix / range in the dependency string #1300
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @soundstep on GitHub (Sep 17, 2020).
Original GitHub issue: https://github.com/semver/semver/issues/613
Hi,
This is more a question than a bug.
I'm writing a CLI for a monorepo that bumps version, and possibly change versions specified as dependencies.
If I'm parsing a
package.jsonand find that kind of string for a dependency:It might make sense only in our case, but what would be the best way to change this string:
to:
I tried a few things like:
But that doesn't work. I also tried to find a way to extract the version from the range but didn't find anything. I suppose I would need something like:
I'm kinda guessing that this would be hard with some ranges like "1.0.x".
lerna version --exact is somewhat close because they use npm version --save-prefix but that's for the versions themselves, not the dependency ranges.
Any advice?
@ljharb commented on GitHub (Sep 17, 2020):
This seems like a better issue for https://github.com/npm/node-semver rather than this repo.
@soundstep commented on GitHub (Sep 18, 2020):
Right I see, I will re-create there!