npm-check-updates icon indicating copy to clipboard operation
npm-check-updates copied to clipboard

--pre 0 updates to beta package

Open AgileInteractive opened this issue 1 year ago • 2 comments
trafficstars

ncu --upgrade -t minor --pre 0

Updates the package supabase to version 1.163.6 which is tagged "beta"

Shouldnt it update to 1.163.2 which is tagged "latest"?

AgileInteractive avatar Apr 25 '24 19:04 AgileInteractive

Hi, thanks for reporting. You're right, this is somewhat confusing behavior.

--pre includes/exludes semver versions that end in a prerelease version part, e.g. -alpha.0, -beta.5, -rc.2. 1.163.6 is not a prerelease version, but a patch. I'm not sure why supabase is publishing patches to the beta tag. This seems a bit unconventional to me. To be valid semver, 1.163.6 must be a non-breaking change from 1.163.2.

There is furthermore a functional reason why npm-check-updates cannot exclude normal versions published to the beta tag when using -t minor. If supabase published 2.0.0 to the beta tag, then there would be no way to tell that 1.163.6 was a beta, because the npm registry does not keep a tag history. This would result in ncu -t minor --pre 0 recommending different versions depending on when the command was executed and what was published to beta, even if none of the 1.x versions have changed.

In light of this, I would recommend using -t minor or --pre 0, but not both for supabase.

raineorshine avatar Apr 25 '24 20:04 raineorshine

Thank you for the swift and thorough reply, I will follow the advice

AgileInteractive avatar Apr 25 '24 20:04 AgileInteractive