Affected Packages
@changesets/cli
@changesets/action
Problem
npm recently added staged publishing via npm stage publish in npm CLI 11.15.0. This lets CI submit a package version to npm without making it public immediately. A maintainer can then review the staged package and explicitly approve it with 2FA before it goes live.
Today, changeset publish only supports immediate publishing through normal package-manager publishing. In a Changesets monorepo, teams who want npm staged publishing need custom scripting for package selection, publish dirs, access/tag handling, ignored/private packages, and post-approval tagging.
npm docs: https://docs.npmjs.com/staged-publishing/
Proposed Solution
Add first-class support for npm staged publishing.
Possible API:
changeset publish --stage
or:
changeset publish --publish-mode=stage
When enabled, Changesets would use npm stage publish instead of immediate publishing for packages that need publishing.
The staged mode should probably avoid creating git tags during the staging step, because a staged package is not live yet and may be rejected. A safe flow would be:
changeset version
- build packages
changeset publish --stage
- maintainer reviews staged packages with
npm stage list, npm stage view, and/or npm stage download
- maintainer approves staged packages with
npm stage approve <stage-id>
- run
changeset tag or another finalize step after approval
Notes / Constraints
npm staged publishing has a few constraints that Changesets could account for or document:
- Requires npm CLI 11.15.0 or later.
- Requires Node 22.14.0 or later.
npm stage is not workspace-aware.
- The package must already exist on the npm registry; brand-new packages cannot be staged.
npm stage publish does not require 2FA, but npm stage approve does.
- The tag used during staging is immutable; changing it requires rejecting and staging again.
Affected Packages
@changesets/cli@changesets/actionProblem
npm recently added staged publishing via
npm stage publishin npm CLI 11.15.0. This lets CI submit a package version to npm without making it public immediately. A maintainer can then review the staged package and explicitly approve it with 2FA before it goes live.Today,
changeset publishonly supports immediate publishing through normal package-manager publishing. In a Changesets monorepo, teams who want npm staged publishing need custom scripting for package selection, publish dirs, access/tag handling, ignored/private packages, and post-approval tagging.npm docs: https://docs.npmjs.com/staged-publishing/
Proposed Solution
Add first-class support for npm staged publishing.
Possible API:
or:
When enabled, Changesets would use
npm stage publishinstead of immediate publishing for packages that need publishing.The staged mode should probably avoid creating git tags during the staging step, because a staged package is not live yet and may be rejected. A safe flow would be:
changeset versionchangeset publish --stagenpm stage list,npm stage view, and/ornpm stage downloadnpm stage approve <stage-id>changeset tagor another finalize step after approvalNotes / Constraints
npm staged publishing has a few constraints that Changesets could account for or document:
npm stageis not workspace-aware.npm stage publishdoes not require 2FA, butnpm stage approvedoes.