fix(release): auto-sync the npm 'next' dist-tag to the highest published version#357
Open
latekvo wants to merge 2 commits into
Open
fix(release): auto-sync the npm 'next' dist-tag to the highest published version#357latekvo wants to merge 2 commits into
latekvo wants to merge 2 commits into
Conversation
…hed version A stable `npm publish` only moves `latest`, and `npm publish --tag next` moves `next` only when a prerelease ships. So once a prerelease was tagged `next`, every later stable release left `next` frozen on an old prerelease (currently next=0.7.0-next.4 while latest=0.11.0). Add scripts/sync-next-dist-tag.mjs, which re-points `next` at the highest published version (prerelease or stable). It runs after both publish workflows and is exposed as a manual sync-next-tag workflow to repair the tag without republishing. Idempotent and self-healing. The script is dependency-free at runtime; a node:test proves its SemVer comparator matches the `semver` library and runs in the unit-tests CI.
hubgan
approved these changes
Jun 19, 2026
# Conflicts: # package-lock.json # package.json
filip131311
requested changes
Jun 19, 2026
filip131311
left a comment
Collaborator
There was a problem hiding this comment.
npm view argent versions is broken here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
nextdist-tag drifts. Right now:A stable
npm publishonly moveslatest, andnpm publish --tag nextmovesnextonly when a prerelease ships. So once0.7.0-next.4was taggednext, every later stable release (0.7.0 → 0.11.0) leftnextfrozen — hence the recurring "we setnextonce then forget" problem.Fix
scripts/sync-next-dist-tag.mjsre-pointsnextat the highest published version overall (prerelease or stable, per SemVer precedence). It is:publish.ymlandpublish-next.yml, sonextself-heals on every publish.Sync 'next' dist-tagworkflow (workflow_dispatch, with adry_runtoggle) to repair the tag without republishing. Running it now would movenext0.7.0-next.4 → 0.11.0.nextalready points at the max.npm cineeded in the lightweight manual job.Verification
next→0.11.0(the current max) as expected.scripts/sync-next-dist-tag.test.mjsproves the hand-rolled SemVer comparator matches thesemverlibrary across every pair of the real version history plus prerelease edge cases. Wired into the unit-tests CI (npm run test:scripts);semveradded as a devDep (test oracle only).npm run lint,npm run typecheck:scripts, andprettier --checkall pass.Note (out of scope)
A stable
npm publishof a backport (e.g.0.8.2while0.11.0is out) would still wrongly movelatest— that's a separate, pre-existing npm behavior and not addressed here. Thenextsync handles backports correctly (it never regresses below the max).