craft
craft copied to clipboard
target(npm): Cleanup "next" tag when releasing newer version
Currently, when we release a preview version (beta, alpha, or RC), it publishes it with next tag on the NPM registry:
https://github.com/getsentry/craft/blob/master/src/targets/npm.ts#L181-L189
However, when after a few iterations we perform a complete release, with a non-preview version, this tag is never cleaned up, and it points to the older version than latest, which is not valid by definition, as next should always point to at least latest (or newer).
It would be nice if we could detect that the next was pointing at the preview version of the "about to be released" version, and if that is the case, call npm dist-tag rm @sentry/node next to clean it up.
An example from @sentry/node repository: