Git
npm i -D @unirelman/plugin-gitpnpm add -D @unirelman/plugin-gityarn add -D @unirelman/plugin-gitbun add -d @unirelman/plugin-gitimport { createGitPlugin } from "@unirelman/plugin-git";
createGitPlugin();Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
commitMessage |
string | ({ nextVersions }) => string |
"chore(release): bump versions" |
Message of the release commit. nextVersions is a ReadonlyMap of each scope name to its next version. |
tagFormat |
GitTagFormat |
See Tag names | Function that names the tag of a version. |
annotatedTags |
boolean |
false |
Whether tags are annotated, with the tag name as message. Lightweight tags are never signed, even with tag.gpgSign. |
Phases
Section titled “Phases”| Phase | Behavior |
|---|---|
prepare |
Stages the files written or deleted by the version pipeline and commits them as the release commit, when there are any. |
createReleases |
Creates a tag on the current commit for each scope’s current version whose tag is missing. The tags are local: push them, or let the GitHub Action push them. |
The release commit contains the release files only, as the version pipeline leaves them. Other files, staged or not, stay out of it.
Tag names
Section titled “Tag names”By default:
| Scope | Tag | Example |
|---|---|---|
| At the project root | <version> |
1.0.1 |
| Elsewhere | <scope>@<version> |
@example/core@1.0.1 |
tagFormat names tags another way. It receives the scope name, the version, and whether the scope is at the project root:
import { createGitPlugin, type GitTagFormat } from "@unirelman/plugin-git";
const tagFormat: GitTagFormat = ({ scopeName, version, isRootScope }) => isRootScope ? `v${version}` : `${scopeName}/v${version}`;
createGitPlugin({ tagFormat });The GitHub plugin names its releases after the tags: pass it the same tagFormat.
Releases
Section titled “Releases”| Field | Value |
|---|---|
type |
git-tag |
name |
The tag name. |
status |
existing when the tag already exists locally. |