0.3.3 • Published 5 months ago
@varlet/release v0.3.3
介绍
Varlet Release
是一个用于发布所有包、生成变更日志和检测 commit message
的工具,依赖于 pnpm
。
安装
pnpm add @varlet/release -D
使用
使用命令
# 发布所有包并生成变更日志
npx vr release
# 指定远程仓库名称
npx vr release -r https://github.com/varletjs/varlet-release
# or
npx vr release --remote https://github.com/varletjs/varlet-release
# 仅生成变更日志
npx vr changelog
# 指定变更日志文件名
npx vr changelog -f changelog.md
# or
npx vr changelog --file changelog.md
# 检测 commit message
npx vr lint-commit -p .git/COMMIT_EDITMSG
# 发布到 npm,可以在 ci 中执行
npx vr publish
配置
release
参数 | 说明 |
---|---|
-r --remote \<remote> | 指定远程仓库名称 |
-s --skip-npm-publish | 跳过 npm 发布 |
-c --check-remote-version | 检测 npm 包的远程版本是否与要在本地发布的包版本相同,如果是,则停止执行 |
-sc --skip-changelog | 跳过生成变更日志 |
-sgt --skip-git-tag | 跳过 git tag |
-nt --npm-tag \<npmTag> | npm tag |
changelog
参数 | 说明 |
---|---|
-f --file \<filename> | 指定变更日志文件名 |
-rc --releaseCount \<releaseCount> | 发布数量 |
-p --preset \<preset> | 指定变更预设 |
lint-commit
参数 | 说明 |
---|---|
-p --commitMessagePath \<path> | 提交 git message 的临时文件路径。git 钩子 commit-msg 会传递这个参数。 |
-r --commitMessageRe \<reg> | 验证 commit message 是否通过的正则 |
-e --errorMessage \<message> | 验证失败展示的错误信息 |
-w --warningMessage \<message> | 验证失败展示的提示信息 |
publish
参数 | 说明 |
---|---|
-c --check-remote-version | 检测npm包的远程版本是否与要在本地发布的包版本相同,如果是,则跳过发布 |
-nt --npm-tag \<npmTag> | npm tag |
自定义处理
示例
import { changelog, release } from '@varlet/release'
// Do what you want to do...
release()
你可以传入一个 task
,在包版本更改后,在发布之前会调用 task
。
import { changelog, release } from '@varlet/release'
async function task() {
await doSomething1()
await doSomething2()
}
release({ task })
类型
interface PublishCommandOptions {
preRelease?: boolean
checkRemoteVersion?: boolean
npmTag?: string
}
function publish({ preRelease, checkRemoteVersion, npmTag }: PublishCommandOptions): Promise<void>
function updateVersion(version: string): void
interface ReleaseCommandOptions {
remote?: string
skipNpmPublish?: boolean
skipChangelog?: boolean
skipGitTag?: boolean
npmTag?: string
task?(newVersion: string, oldVersion: string): Promise<void>
}
function release(options: ReleaseCommandOptions): Promise<void>
interface ChangelogCommandOptions {
file?: string
releaseCount?: number
preset?:
| 'angular'
| 'atom'
| 'codemirror'
| 'conventionalcommits'
| 'ember'
| 'eslint'
| 'express'
| 'jquery'
| 'jshint'
}
function changelog({ releaseCount, file, preset }?: 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
许可证
0.3.3
5 months ago
0.3.2
6 months ago
0.3.1-alpha.1730553381783
8 months ago
0.3.1
8 months ago
0.3.0
8 months ago
0.2.11
11 months ago
0.2.10
1 year ago
0.2.9
1 year ago
0.2.8
1 year ago
0.2.7
1 year ago
0.2.6
1 year ago
0.2.5
1 year ago
0.2.4
1 year ago
0.2.3
1 year ago
0.2.1
1 year ago
0.2.2
1 year ago
0.2.0
1 year ago
0.1.1-alpha.1702435034678
2 years ago
0.1.1-alpha.1702447412579
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.3-alpha.1700239118439
2 years ago
0.0.3-alpha.1700239030385
2 years ago
0.0.3-alpha.1700238748072
2 years ago
0.0.3-alpha.1700238681993
2 years ago
0.0.3-alpha.1700238601515
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago