English | 中文
Varlet Release
is a tool to release all packages, generate changelogs and lint commit message.
npm i @varlet/release -D
yarn add @varlet/release -D
pnpm add @varlet/release -D
# Release all packages and generate changelogs
npx vr release
# Specify remote name
npx vr release -r <remote>
# or
npx vr release --remote <remote>
# Just generate changelogs
npx vr changelog
# Specify changelog filename
npx vr changelog -f <filename>
# or
npx vr changelog --file <filename>
# Lint commit message
npx vr lint-commit <gitMessagePath>
Params | Instructions |
---|---|
-r --remote <remote> | Specify remote name |
Params | Instructions |
---|---|
-f --file <filename> | Specify changelog filename |
-rc --releaseCount <releaseCount> | Release count |
Params | Instructions |
---|---|
<gitMessagePath> | The path of the temporary file to which the git message is submitted. The git hook commit-msg will pass this parameter |
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 })
interface ReleaseCommandOptions {
remote?: string
task?(): Promise<void>
}
function release(options: ReleaseCommandOptions): Promise<void>
interface ChangelogCommandOptions {
file?: string
releaseCount?: number
}
function changelog({ releaseCount, file }?: ChangelogCommandOptions): Promise<void>
function commitLint(gitMessagePath: string): void