Skip to content

Commit

Permalink
✨ feat: 增加git代码提交规范
Browse files Browse the repository at this point in the history
husky
lint-staged
commitlint
committtizen
cz-customizable
conventional-changelog
  • Loading branch information
AnyFork committed Jul 20, 2023
1 parent 99484f6 commit 9e49d54
Show file tree
Hide file tree
Showing 11 changed files with 3,780 additions and 138 deletions.
71 changes: 71 additions & 0 deletions .cz-config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
module.exports = {
types: [
{
value: ':sparkles: feat',
name: '✨ feat: 新功能'
},
{
value: ':bug: fix',
name: '🐛 fix: 修复bug'
},
{
value: ':package: build',
name: '📦️ build: 打包'
},
{
value: ':zap: perf',
name: '⚡️ perf: 性能优化'
},
{
value: ':tada: release',
name: '🎉 release: 发布正式版'
},
{
value: ':lipstick: style',
name: '💄 style: 代码的样式美化'
},
{
value: ':recycle: refactor',
name: '♻️ refactor: 重构'
},
{
value: ':pencil2: docs',
name: '✏️ docs: 文档变更'
},
{
value: ':white_check_mark: test',
name: '✅ test: 测试'
},
{
value: ':rewind: revert',
name: '⏪️ revert: 回退'
},
{
value: ':rocket: chore',
name: '🚀 chore: 构建/工程依赖/工具'
},
{
value: ':construction_worker: ci',
name: '👷 ci: CI related changes'
}
],
scopes: [
{ name: 'components' },
{ name: 'assets' },
{ name: 'router' },
{ name: 'utils' },
{ name: 'views' },
{ name: 'types' },
],
messages: {
type: '请选择提交类型(必填)',
customScope: '请输入文件修改范围(可选)',
subject: '请简要描述提交(必填)',
body: '请输入详细描述(可选)',
breaking: '列出任何BREAKING CHANGES(可选)',
footer: '请输入要关闭的issue(可选)',
confirmCommit: '确定提交此说明吗?'
},
allowCustomScopes: true,
subjectLimit: 100
}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"eslint.enable": true,
// code代码保存时,自动eslint修复
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": true,
"eslint.autoFixOnSave" : true
}
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## <small>0.0.1 (2023-07-20)</small>

* ✨ feat: 增加Eslint和perttier配置 ([99484f6](https://github.com/AnyFork/vite-standard-template/commit/99484f6))
* 🎉 init: 项目初始化 ([3a026c9](https://github.com/AnyFork/vite-standard-template/commit/3a026c9))
* Initial commit ([dc86fcc](https://github.com/AnyFork/vite-standard-template/commit/dc86fcc))



Loading

0 comments on commit 9e49d54

Please sign in to comment.