Just came across a case where I needed to back port a patch to a previous major version as I'm not yet able to update all of my projects to the new major version of my module, but I'm getting the impression that np doesn't support releasing any minor or patch versions of previous major releases?
Would be great to have such support within np, especially as it's so easy to accidentally publish that minor/patch version as latest tag (pretty common by even very large modules when they do an occasional maintenance release)
Am I understanding the current state of np correctly? And if so: Is it something that you would be interested in supporting? (Maybe as --maintenance or such?)
Is it something that you would be interested in supporting?
In my opinion, no. I have addressed this a couple of times already but currently np is already far too feature rich for what @sindresorhus and I use it for. So unless Sindre has another opinion, I'd suggest either forking it or manually releasing maintenance versions. Personally I never had to do it so it seems more like an edge case.
I think you can already do this: $ np --tag=disttag 0.0.2. You have to specify a dist-tag and a specific version.
I've had no problem with:
git checkout -b backport-the-things v2.0.0 # (2.0.0 being previous major)
# make some changes
git commit -m "backporting changes"
git push -u origin backport-the-things
np --any-branch
Then selecting 'patch' like normal would release 2.0.1
Okay, cool. Nice to know that it works :).
@jesstelford Don't forget the --tag flag, otherwise npm will set 2.0.1 as the latest version.
Forgetting the --tag was the reason why I was thinking a combo of something like --any-branch and --tag for maintenance releases as --maintenance or something would be somewhat neat.
it could ensure the use of --tag + maybe also validate that one is actually pushing a maintenance release and not a version using the latest major version.
Great that it's already doable to do older releases, but as shown it's easy to do a mistake, and I don't like to tell my team mates to do something that is easy to mess up, then I rather tell them to try to avoid it.
So could be neat if it was supported, but of course also neat with a lean tool.
I think that we should mention @jesstelford's suggestion above in the Tips section of the readme, as it may come in handy for some users.
Also, since a working solution to this issue has already been proposed, it seems like this can be closed.
@itaisteinherz 馃憤
Most helpful comment
@jesstelford Don't forget the
--tagflag, otherwise npm will set 2.0.1 as the latest version.