Skip to content

fix(publish): report publishConfig.tag in publish and stage notices - #10136

Open
ljharb wants to merge 1 commit into
npm:latestfrom
ljharb:publish-config-tag-notice
Open

ljharb wants to merge 1 commit into
npm:latestfrom
ljharb:publish-config-tag-notice

Conversation

@ljharb

@ljharb ljharb commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

A package's publishConfig can set tag, eg "publishConfig": { "tag": "next" }. npm publishes with it, since publishConfig is flattened into opts and the publish uses opts.defaultTag, but the "Publishing to … with tag …" notice, and the npm stage "has been staged with tag …" notice, printed defaultTag, which is read from the CLI config before publishConfig is applied. So npm publish said "with tag latest" while publishing to next.

Both notices now print opts.defaultTag, the tag actually used, with tests for npm publish and npm stage.

A package's `publishConfig` can set `tag`, eg `"publishConfig": { "tag": "next" }`. npm publishes with it, since `publishConfig` is flattened into `opts` and the publish uses `opts.defaultTag`, but the "Publishing to … with tag …" notice, and the `npm stage` "has been staged with tag …" notice, printed `defaultTag`, which is read from the CLI config before `publishConfig` is applied. So `npm publish` said "with tag latest" while publishing to `next`.

Both notices now print `opts.defaultTag`, the tag actually used, with tests for `npm publish` and `npm stage`.
@ljharb
ljharb requested a review from a team as a code owner October 15, 2026 23:30
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