Skip to content

Publish older versions without a tag#26

Merged
zkat merged 2 commits into
npm:latestfrom
watson:watson-patch-1
Dec 20, 2018
Merged

Publish older versions without a tag#26
zkat merged 2 commits into
npm:latestfrom
watson:watson-patch-1

Conversation

@watson

@watson watson commented Dec 17, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@ljharb

ljharb commented Dec 17, 2018

Copy link
Copy Markdown
Contributor

This would be great; i currently use https://npmjs.com/safe-publish-latest to prevent accidentally publishing a backport as “latest”.

Even better (on top of this) would be if the tag could be overwritten in prepublish - then i could have a package that removed the “latest” tag when it was unsafe.

@zkat zkat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The team had a meeting and we're happy to say we've ratified this! Thanks for the RFC, and I look forward to having this. Since it's a breaking change, we won't be able to have it until npm@7, but it should be straightforward to implement and wait for the final thing 👍

@zkat zkat merged commit a6abd58 into npm:latest Dec 20, 2018
@evocateur

Copy link
Copy Markdown

In the meantime, a better way to mitigate this in long-lived maintenance branches is to immediately set publishConfig.tag in the package.json to an appropriate value. All future publishes from that branch will use that (non-"latest") value as the dist-tag, no flags necessary.

@ljharb

ljharb commented Dec 21, 2018

Copy link
Copy Markdown
Contributor

@evocateur that’s a great workaround, but it still ends up creating a tag that i have to remove after publishing.

@evocateur

Copy link
Copy Markdown

@ljharb Oh, fair enough. At least it wouldn't be "latest" by default in the scenario I described. Still doesn't avoid a tag altogether, you are correct.

@ljharb

ljharb commented Dec 21, 2018

Copy link
Copy Markdown
Contributor

@zkat couldn’t something like --no-tag be added as a semver-minor, and the breaking change later be making that the default?

@evocateur

evocateur commented Dec 22, 2018 via email

Copy link
Copy Markdown

@ljharb

ljharb commented Dec 22, 2018

Copy link
Copy Markdown
Contributor

Oh sure, maybe --without-tag then - bikeshed aside it seems totally doable as a semver-minor

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

Successfully merging this pull request may close these issues.

4 participants