pnpm lane

Manages per-package release lanes. A lane is a parallel release track: while a package is on one, the bare pnpm version -r releases it as X.Y.Z-<lane>.N prereleases while the rest of the workspace keeps releasing stable versions. Moving a package back to the main lane releases its accumulated stable version on the next run.

pnpm lane
pnpm lane <name> --filter <pattern>
pnpm lane main --filter <pattern>

Membership lives under the versioning.lanes key of pnpm-workspace.yaml; this command is a convenience editor for that key.

Usage#

Show lane membership#

pnpm lane
Lanes:
  alpha:
    @example/cli
    @example/napi

If no package has been assigned a lane, this prints All packages are on the main lane.

Move packages onto a lane#

pnpm lane alpha --filter @example/cli

--filter is required. It selects the packages to move. If it selects nothing, the command fails with ERR_PNPM_VERSIONING_NO_PACKAGES. Lane names may contain only alphanumerics and hyphens, and cannot be purely numeric. main in any other case, such as MAIN, is rejected.

A package that is already on a different lane cannot move directly. The command fails with ERR_PNPM_VERSIONING_ALREADY_ON_LANE. Run pnpm lane main --filter <pkg> first.

Outside a workspace, pnpm lane fails with ERR_PNPM_WORKSPACE_ONLY.

Move packages back to the main lane#

pnpm lane main --filter @example/cli

main is the reserved name of the default lane. Every package is on it unless assigned elsewhere, and packages on it release stable versions. Graduating a package releases the stable version its prereleases were building toward on the next pnpm version -r run.

Versions on a lane#

A package on a lane releases X.Y.Z-<lane>.N, where X.Y.Z is the stable version the lane is building toward and N counts up from 0:

Current versionPending intentLaneNew version
2.0.0minoralpha2.1.0-alpha.0
2.1.0-alpha.0patchalpha2.1.0-alpha.1
2.1.0-alpha.1majoralpha3.0.0-alpha.0
3.0.0-alpha.0nonemain3.0.0

N restarts at 0 whenever the stable target changes. When a bump escalates the target (a major intent while the lane was building a minor), the target is recomputed and the counter resets.

Packages in the same fixed group must move between lanes together.

Options#

--filter <package_selector>#

Select the packages to move between lanes. Required when assigning a lane.

Read more about filtering.