pnpm change
Додано у: v11.13.0
Записує намір зміни: на які пакунки впливає зміна, тип підвищення версії для кожного з них, а також короткий опис, який стає записом у журналі змін. Файл намірів записується в теку .changeset/ у форматі changesets.
pnpm change [--bump <type>] [--summary <text>] [<pkg>...]
pnpm change status
Зміни намірів згодом обробляються командою pnpm version -r. Повний опис робочого процесу див. у розділі Управління релізами.
Використання
Run without arguments to record an intent interactively:
pnpm change
You are asked three questions:
- Which packages does this change affect? Packages changed since the merge base with
main(ormaster) are preselected. - Which packages should have a major bump?, then the same for
minor. Anything left over is bumped aspatch. - Summary of the change, which becomes the changelog entry.
The result is a file such as .changeset/calm-cats-resolve.md:
---
"@example/core": minor
"@example/cli": patch
---
Added a `--watch` flag to the build command.
Commit this file along with your change.
Passing package names together with --bump and --summary records an intent without prompting, which is useful in scripts:
pnpm change --bump patch --summary "Fixed a crash on empty input" @example/core
Підкоманди
status
Show the pending change intents and the release plan they produce.
pnpm change status
Pending change intents:
.changeset/calm-cats-resolve.md
Release plan:
@example/core: 1.2.0 → 1.3.0 (minor, via intent)
@example/cli: 0.4.1 → 0.4.2 (patch, via intent+dependencies)
The cause of each bump is one of intent (a change intent named the package), dependencies (a dependent was pulled in by propagation), fixed (a fixed group companion), or epic (an epic re-base).
Параметри
--bump <type>
The bump type for the named packages: none, patch, minor, or major. none records an explicit decline — the change needs no release.
--summary <text>
The summary for the changelog entry. Together with package names, this runs the command non-interactively.
Referencing packages by directory
When two workspace projects publish the same name, a package can be referenced by its workspace-relative directory instead, with a ./ prefix:
---
"./packages/cli": minor
---
This is the one additive extension pnpm makes to the changesets format. pnpm change writes it automatically when a name is ambiguous.