Skip to content

fix(release): resolve npm dist-tag from prerelease label#3

Merged
akhilesharora merged 1 commit into
mainfrom
chore/release-tag-prerelease
May 9, 2026
Merged

fix(release): resolve npm dist-tag from prerelease label#3
akhilesharora merged 1 commit into
mainfrom
chore/release-tag-prerelease

Conversation

@akhilesharora

Copy link
Copy Markdown
Collaborator

Summary

release.yml published 0.2.0-alpha.2 without --tag, so it landed on latest instead of alpha. That overrode the alpha channel — npm install @datacline/langos-sdk-node (with no version) would now pull a pre-release.

Fix

Resolve the dist-tag from the prerelease label in package.json version:

Version dist-tag
0.2.0-alpha.2 alpha
0.2.0-beta.1 beta
0.2.0-rc.0 rc
1.0.0 latest

Prereleases stay on their own channel; default install only pulls a prerelease if the user explicitly asks (npm install @datacline/langos-sdk-node@alpha).

Already-fixed state

The current dist-tags were corrected manually post-publish via npm dist-tag add @datacline/langos-sdk-node@0.2.0-alpha.2 alpha. Registry now reads { alpha: '0.2.0-alpha.2', latest: '0.2.0-alpha.2' } (latest stays at alpha.2 until first stable).

Test plan

  • Bash logic tested locally: 0.2.0-alpha.2alpha, 1.0.0latest, 0.2.0latest
  • CI green on this PR
  • On next prerelease tag (alpha.3 or beta.1), verify the publish lands on the correct channel

Previously release.yml ran 'npm publish --access public --provenance' with
no --tag flag, so every publish (including prereleases like 0.2.0-alpha.2)
defaulted to 'latest'. That overrode the alpha dist-tag and meant
'npm install @datacline/langos-sdk-node' would pull a pre-release.

Now we resolve the dist-tag from the version:
  0.2.0-alpha.2 -> alpha
  0.2.0-beta.1  -> beta
  0.2.0-rc.0    -> rc
  1.0.0         -> latest

Prereleases stay on their own channel; default install only pulls a
prerelease if the user explicitly asks (npm install @scope/pkg@alpha).
@akhilesharora akhilesharora merged commit 792c221 into main May 9, 2026
4 checks passed
@akhilesharora akhilesharora deleted the chore/release-tag-prerelease branch May 9, 2026 11:23
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.

1 participant