dsh-git-commit
Verifieddsh-git-commit · v0.1.0 · MIT
Git 提交助手:分析仓库变更生成规范化 Conventional Commits 提交信息、按提交历史生成 CHANGELOG、按语义化版本建议下一个版本号
Install
dsh plugin add dsh-git-commit Confirm the layer applied with dsh --profile default --dump-config — see the install guide.
Source
Published to npm without a public repository. Inspect the package contents before installing.
Tags
Readme
dsh-git-commit · Git 提交助手
分析 git 仓库,生成规范化提交信息、CHANGELOG 与版本号建议。纯 Node + git 实现,无网络、无外部服务。
提供的工具
| 工具 | 作用 |
|---|---|
suggest_commit |
分析 git status 变更,按 Conventional Commits 生成提交信息建议 |
generate_changelog |
读提交历史(按类型分组)生成 CHANGELOG.md |
suggest_version |
按 SemVer 规则建议下一个版本号(major/minor/patch) |
安装
dsh plugin add dsh-git-commit
安装后在 profile 的 package.json 的 dsh.profile.bundles 中加入 "dsh-git-commit"。
用法示例
帮我生成一条规范的提交信息
→ 调用 suggest_commit()
生成 CHANGELOG
→ 调用 generate_changelog(since="v1.0.0", outFile="CHANGELOG.md")
下个版本号该发多少
→ 调用 suggest_version()
说明
- 提交类型按文件分类自动判断:新代码→
feat、改代码→fix、测试→test、文档→docs、配置→chore、样式→style。 - 版本号建议:有
BREAKING CHANGE/!:→ major,有feat→ minor,其余 → patch。 - 建议信息是启发式默认值,可让模型在生成后进一步润色为更贴切的描述。