Skip to content

Pnpm

@simple-release/pnpm describes projects managed with pnpm: PnpmProject for a single package and PnpmWorkspacesProject for a pnpm workspaces monorepo. Publishing runs pnpm publish, so workspace: protocol dependencies are resolved on publish.

pnpm add @simple-release/pnpm

Single package:

.simple-release.json
{
"project": "@simple-release/pnpm#PnpmProject"
}

Workspaces monorepo — PnpmWorkspacesProject reads the package list from pnpm-workspace.yaml in the project root:

.simple-release.json
{
"project": ["@simple-release/pnpm#PnpmWorkspacesProject", {
"mode": "independent"
}]
}
OptionDescription
pathPath to the package.json manifest file. Defaults to 'package.json'.
changelogFilePath to the changelog file. Defaults to 'CHANGELOG.md'.
composeFunction to compose the main manifest with secondary manifests where the version should also be updated. Optional.
OptionDescription
modeVersioning mode. Required. independent — each package has its own version; fixed — all packages share the same version.
rootPath to the monorepo root. Defaults to the current working directory.
changelogFilePath to the changelog file. Defaults to 'CHANGELOG.md'.
composeSame as for PnpmProject, called for each manifest in the monorepo. Optional.
scopeFunction to format the scope name from the package name. By default the scope part of the package name is dropped: @scope/pkg-namepkg-name.
tagPrefixFunction to format the tag prefix from the scope name. Defaults to pkg-name@ in independent mode and an empty string in fixed mode.

In monorepos, commits are attributed to packages by the commit scope — fix(pkg-name): ... bumps pkg-name. The scope must match the package name without the npm scope (or whatever your scope function returns).

Options of the publish step for both classes:

OptionDescription
skipSkip publishing.
accessAccess level for the package.
tagnpm dist-tag — a string or a function of the version and prerelease components. When not set, prereleases get their prerelease identifier and maintenance releases of previous majors get release-N.x, so they never overwrite latest.
otpOne-time password for publishing.
gitChecksWhether to run pnpm git checks before publishing. Disabled by default: the release flow publishes from the released commit, and pnpm branch checks fail releases from non-default branches, like maintenance ones.
envEnvironment variables to set before publishing. Defaults to process.env.