Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to publish minor/patch release of old major version? #154

Closed
voxpelli opened this issue May 2, 2017 · 8 comments
Closed

Comments

@voxpelli
Copy link
Contributor

voxpelli commented May 2, 2017

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?)

@SamVerschueren
Copy link
Collaborator

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.

@sindresorhus
Copy link
Owner

I think you can already do this: $ np --tag=disttag 0.0.2. You have to specify a dist-tag and a specific version.

@jesstelford
Copy link
Contributor

jesstelford commented May 3, 2017

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

@SamVerschueren
Copy link
Collaborator

Okay, cool. Nice to know that it works :).

@sindresorhus
Copy link
Owner

@jesstelford Don't forget the --tag flag, otherwise npm will set 2.0.1 as the latest version.

@voxpelli
Copy link
Contributor Author

voxpelli commented May 3, 2017

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.

@itaisteinherz
Copy link
Collaborator

itaisteinherz commented Mar 16, 2019

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.

@sindresorhus
Copy link
Owner

@itaisteinherz 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants