Instruction file imported from tikoci/rosetta (
.github/instructions/npm-channel-source-of-truth.instructions.md). Copyright stays with the author.
npm channel source of truth
release.yml's "Determine npm release channel" step derives latest vs. prerelease (and the stage: alpha/beta/rc) entirely by parsing package.json's committed version field.
- Do not add a
workflow_dispatchinput, environment variable, or other CI-side flag that also selects or overrides the channel — that would let the two signals disagree. - A bare
MAJOR.MINOR.PATCHversion meanslatest. AMAJOR.MINOR.PATCH-<stage>or-<stage>.Nversion means prerelease, with<stage>validated against thealpha/beta/rcallowlist. Anything else fails the workflow loudly — never treat an unrecognized shape aslatestby default. - If a channel-adjacent input is genuinely needed later (e.g. limiting which registries get the floating tag), keep
package.json's version as the single source of truth for the channel decision itself, and layer the new input on top rather than replacing it.