| addGitTag |
Creates a Git tag for the new version. |
| addUpdatedFilesToGit |
Adds updated files to the Git staging area and commits them with the new version message. If the commit fails (for example, the pre-commit hook rejects a new word in the changelog) and the process is attached to an interactive terminal, the user is prompted to fix the issue (for example, add the missing word to cspell.json) and press Enter to retry. The retry re-stages all files, so the fix is picked up without restarting the whole release lifecycle. In a non-interactive environment (no TTY, such as CI), the error is re-thrown instead of prompting, so the script fails fast rather than hanging. Pass shouldVerifyCommit: false to skip the pre-commit hook entirely in such cases. |
| assertGitHubCliInstalled |
Checks if the GitHub CLI is installed on the system. Throws an error if the GitHub CLI is not installed. |
| assertGitInstalled |
Checks if Git is installed on the system. Throws an error if Git is not installed. |
| assertGitRepoClean |
Checks if the Git repository is clean, meaning there are no uncommitted changes. Throws an error if the Git repository is not clean. |
| autolinkBareUrls |
Wraps any bare http(s):// URL in the given text in angle brackets (<url>) so that text emitted into a Markdown document (such as a generated changelog bullet) passes markdownlint’s MD034/no-bare-urls rule while still rendering as a clickable autolink on GitHub. URLs that are already wrapped in angle brackets (<url>) or that form the target of a Markdown link ([text](url)) are left untouched, so the function is safe to run repeatedly. Trailing sentence punctuation (., ,, ;, :, !, ?) is kept outside the angle brackets so it does not become part of the link. |
| getNewVersion |
Generates a new version string based on the current version and the specified update type. Uses the semver package to compute the next version, supporting all npm increment types: major, minor, patch, premajor, preminor, prepatch, and prerelease. Pre-release versions use the beta identifier by default (e.g., 1.2.4-beta.0). |
| getReleaseNotes |
Retrieves the release notes for a specific version from the changelog. |
| getVersionUpdateType |
Determines the type of version update based on the input string. |
| gitPush |
Pushes commits and tags to the remote Git repository. |
| isPreRelease |
Whether a version is a pre-release, such as 1.2.4-beta.0. |
| parseVersionArguments |
Parses the command-line arguments for a version update into a version update type and UpdateVersionOptions. Each behavior is enabled by default; the corresponding --no-* flag turns it off. --changelog-file takes a value instead and has no default. Recognized flags: - --changelog-file=<path> — use this file’s contents as the new version’s changelog section instead of the commit-derived bullets, and skip the interactive review entirely. - --no-build — skip the build step (only safe when the build output already matches the current code). - --no-changelog-editing — generate the changelog without opening it for manual review. - --no-checks — skip the clean-repo check, format, spellcheck, lint, over-exposure analysis, and tests (the build still runs). - --no-commit-verification — pass --no-verify to the release commit, skipping the pre-commit hook. - --no-issue-closing — do not close the issues the release carries once it is published. - --no-release — run all local steps but skip the push and the GitHub release. |
| publishGitHubRelease |
Publishes a GitHub release for the new version. Creates the release and attaches the files PublishGitHubReleaseOptions.getReleaseAssetPaths names. Once the release exists, the issues it carries are closed with a link to it (see closeReleasedIssues), unless PublishGitHubReleaseOptions.shouldCloseReleasedIssues is false. A failure there is reported and does not fail the release, which is already published. |
| toUpdateVersionOptions |
Maps the values parseArgs reports for VERSION_ARGUMENT_OPTIONS onto UpdateVersionOptions. |
| updateChangelog |
Updates the changelog file with new version information and commit messages. This function reads the current changelog, appends new entries for the latest version, and prompts the user to review the changes. The review happens on a scratch copy in the OS temporary folder, and the repository’s own CHANGELOG.md is written only once the review is over — so interrupting the review leaves the repository untouched. |
| updateVersion |
Updates the version of the project based on the specified update type. This function performs a series of tasks to handle version updates: 1. Validates the version update type. 2. Checks if Git and GitHub CLI are installed. 3. Verifies that the interactive changelog review, if one is due, can actually be answered. 4. Verifies that the bump is not lower than the commits since the last tag force it to be. 5. Verifies that the Git repository is clean. 6. Runs spellcheck and linting. 7. Builds the project. 8. Settles the changelog — the only step that can block on a human, and deliberately the last one before anything is written, so an interrupt here leaves the working tree clean and the release re-runnable. The settled text is linted here too: lint:md ran in step 6, before a character of it existed. 9. Updates version in files (and in whatever UpdateVersionOptions.updateVersionInExtraFiles adds), then writes the settled changelog. 10. Adds updated files to Git, tags the commit, and pushes to the repository. 11. Prepares and publishes a GitHub release. 12. Closes the issues the release carries, with a link to it. |
| updateVersionInFiles |
Updates the version in package.json and, where they exist, package-lock.json and npm-shrinkwrap.json. |
| validate |
Validates the version update type to ensure it is either a recognized type or a valid manual version string. |