跳到主内容
版本:Next

pnpm stage

添加于:v11.3.0

使用 npm 的 暂存发布 工作流程发布包。 Staged versions are not resolved by pnpm install until they are explicitly approved, letting you defer proof-of-presence (2FA) to a later point in time — useful for verifying release artifacts, smoke-testing CI, or coordinating multi-package releases.

pnpm stage <subcommand> [options]

子命令

publish

暂存发布软件包。

pnpm stage publish [<tarball>|<dir>] [--tag <tag>] [--access <public|restricted>] [options]

接受与 pnpm publish 相同的参数,但将 tarball 上传到暂存区而不是将其提升到活动注册源。 生成的 暂存 ID 将被打印出来,并可与其他子命令一起使用。

Use --recursive (or -r) to stage every publishable package in the workspace.

list

List all staged package versions, or list the staged versions of a specific package.

pnpm stage list [<package-spec>]

view

Show details of a specific staged version.

pnpm stage view <stage-id>

approve

Approve a staged version, promoting it to the live registry. This is the step that consumes the one-time password.

pnpm stage approve <stage-id> [--otp <otp>]

reject

Reject a staged version and remove it from staging.

pnpm stage reject <stage-id> [--otp <otp>]

download

Download the tarball of a staged version for inspection.

pnpm stage download <stage-id>

配置项

--registry <url>

The base URL of the npm registry. 默认使用已配置的默认注册源。

--tag <tag>

Registers the staged package with the given dist-tag. Defaults to latest.

--access <public|restricted>

Tells the registry whether the staged package should be public or restricted.

--json

以 JSON 格式显示信息。 Applies to list, view, publish, and download.

--dry-run

Does everything stage publish would do except uploading to the registry.

--otp <otp>

One-time password for approve and reject.

--recursive, -r

Stage all publishable packages from the workspace.

--filter <package_selector>

阅读更多有关过滤的内容。