Package Exports
- @varlet/release
Readme
Varlet Release
English | 中文
Intro
Varlet Release is a tool to release all packages, generate changelogs and lint commit message.
Installation
npm
npm i @varlet/release -Dyarn
yarn add @varlet/release -Dpnpm
pnpm add @varlet/release -DUsage
Using Command
# Release all packages and generate changelogs
npx vr release
# Specify remote name
npx vr release -r https://github.com/varletjs/varlet-release
# or
npx vr release --remote https://github.com/varletjs/varlet-release
# Just generate changelogs
npx vr changelog
# Specify changelog filename
npx vr changelog -f changelog.md
# or
npx vr changelog --file changelog.md
# Lint commit message
npx vr lint-commit -p .git/COMMIT_EDITMSG
# Publish to npm, which can be called in the ci environment
npx vr publishConfiguration
release
| Params | Instructions |
|---|---|
| -r --remote <remote> | Specify remote name |
| -s --skip-npm-publish | Skip npm publish |
| -sgt --skip-git-tag | Skip git tag |
changelog
| Params | Instructions |
|---|---|
| -f --file <filename> | Specify changelog filename |
| -rc --releaseCount <releaseCount> | Release count |
lint-commit
| Params | Instructions |
|---|---|
| -p --commitMessagePath <path> | The path of the temporary file to which the git message is submitted. The git hook commit-msg will pass this parameter |
| -r --commitMessageRe <reg> | Validate the regular of whether the commit message passes |
| -e --errorMessage <message> | Validation failed to display error messages |
| -w --warningMessage <message> | Validation failed to display warning messages |
publish
vr publishCustom Handle
Example
import { release, changelog } from '@varlet/release'
// Do what you want to do...
release()You can pass in a task that will be called before the publish after the package version is changed.
import { release, changelog } from '@varlet/release'
async function task() {
await doSomething1()
await doSomething2()
}
release({ task })Types
function publish(preRelease: boolean | undefined): Promise<void>
function updateVersion(version: string): void
interface ReleaseCommandOptions {
remote?: string
skipNpmPublish?: boolean
skipGitTag?: boolean
task?(): Promise<void>
}
function release(options: ReleaseCommandOptions): Promise<void>
interface ChangelogCommandOptions {
file?: string
releaseCount?: number
}
function changelog({ releaseCount, file }?: ChangelogCommandOptions): Promise<void>
const COMMIT_MESSAGE_RE: RegExp
function isVersionCommitMessage(message: string): string | false | null
function getCommitMessage(commitMessagePath: string): string
interface CommitLintCommandOptions {
commitMessagePath: string
commitMessageRe?: string | RegExp
errorMessage?: string
warningMessage?: string
}
function commitLint(options: CommitLintCommandOptions): void