1 Star 3 Fork 0

Cheng/AnyCore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.release-it.ts 2.59 KB
一键复制 编辑 原始数据 按行查看 历史
Cheng 提交于 2025-04-02 15:34 +08:00 . :bug:fix(custom): lint fix
export default {
plugins: {
'@release-it/conventional-changelog': {
infile: 'CHANGELOG.md',
header: '# CHANGELOG | 变更日志',
preset: { name: 'conventionalcommits' },
parserOpts: {
headerPattern: /^(\p{Emoji_Presentation}|:[a-z]+:) (\w+)(?:\(([\w-]+)\))?: (.+)$/u,
headerCorrespondence: ['emoji', 'type', 'scope', 'subject'],
noteKeywords: ['BREAKING CHANGE'],
},
writerOpts: {
transform: (commit) => {
// Emoji与类型映射表
const typeEmojiMap = {
fix: '🐛',
feat: '',
chore: '🚀',
docs: '📝',
style: '🎨',
refactor: '♻️',
perf: '⚡️',
test: '',
build: '📦️',
ci: '👷',
revert: '⏪️',
init: '🎉',
}
// 提交类型与标题映射表
const typesTitleMap = {
feat: '✨ Features | 新功能',
fix: '🐛 Bug Fixes | 修复 bug',
init: '🎉 Init | 初始化',
docs: '📝 Documentation | 文档变更',
style: '🎨 Styles | 代码样式美化',
refactor: '♻️ Code Refactoring | 重构',
perf: '⚡️ Performance Improvements | 性能优化',
test: '✅ Tests | 测试',
revert: '⏪️ Reverts | 回退',
build: '📦️ Builds | 打包',
chore: '🚀 Chores | 构建/工程依赖/工具',
ci: '👷 Continuous Integrations | CI 相关变更',
}
// 标准化处理
if (typeEmojiMap[commit.type]) {
return {
...commit,
emoji: typeEmojiMap[commit.type],
header: `${typeEmojiMap[commit.type]} ${commit.type}${
commit.scope ? `(${commit.scope})` : ''
}: ${commit.subject} ([${commit.shortHash}](${commit.host}/${
commit.repository
}/commit/${commit.hash}))`,
shortHash: commit.hash?.substring(0, 7) || '',
type: typesTitleMap[commit.type],
}
}
return null
},
groupBy: 'type',
commitGroupsSort: 'title',
commitsSort: ['scope', 'subject'],
filter: (commit) => {
// 只保留有emoji映射的提交类型(早期有一些非标准的提交类型)
return !!commit.emoji
},
},
},
},
git: {
// eslint-disable-next-line no-template-curly-in-string
commitMessage: '🚀 chore(release): Release v${version}',
},
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/WuCheng-cn/any-core.git
git@gitee.com:WuCheng-cn/any-core.git
WuCheng-cn
any-core
AnyCore
master

搜索帮助