.cz-config.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. module.exports = {
  2. // type 类型(定义之后,可通过上下键选择)
  3. types: [
  4. {
  5. value: 'feat',
  6. name: 'feat: 新增功能'
  7. },
  8. {
  9. value: 'fix',
  10. name: 'fix: 修复 bug'
  11. },
  12. {
  13. value: 'docs',
  14. name: 'docs: 文档变更'
  15. },
  16. {
  17. value: 'style',
  18. name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)'
  19. },
  20. {
  21. value: 'refactor',
  22. name: 'refactor: 代码重构(不包括 bug 修复、功能新增)'
  23. },
  24. {
  25. value: 'perf',
  26. name: 'perf: 性能优化'
  27. },
  28. {
  29. value: 'test',
  30. name: 'test: 添加、修改测试用例'
  31. },
  32. {
  33. value: 'build',
  34. name: 'build: 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)'
  35. },
  36. {
  37. value: 'ci',
  38. name: 'ci: 修改 CI 配置、脚本'
  39. },
  40. {
  41. value: 'chore',
  42. name: 'chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)'
  43. },
  44. {
  45. value: 'revert',
  46. name: 'revert: 回滚 commit'
  47. }
  48. ],
  49. // scope 类型(定义之后,可通过上下键选择)
  50. scopes: [
  51. ['components', '组件相关'],
  52. ['hooks', 'hook 相关'],
  53. ['utils', 'utils 相关'],
  54. ['element-plus', '对 element-plus 的调整'],
  55. ['styles', '样式相关'],
  56. ['deps', '项目依赖'],
  57. ['auth', '对 auth 修改'],
  58. ['other', '其他修改'],
  59. // 如果选择 custom,后面会让你再输入一个自定义的 scope。也可以不设置此项,把后面的 allowCustomScopes 设置为 true
  60. ['custom', '以上都不是?我要自定义']
  61. ].map(([value, description]) => {
  62. return {
  63. value,
  64. name: `${value.padEnd(30)} (${description})`
  65. }
  66. }),
  67. // 是否允许自定义填写 scope,在 scope 选择的时候,会有 empty 和 custom 可以选择。
  68. // allowCustomScopes: true,
  69. // allowTicketNumber: false,
  70. // isTicketNumberRequired: false,
  71. // ticketNumberPrefix: 'TICKET-',
  72. // ticketNumberRegExp: '\\d{1,5}',
  73. // 针对每一个 type 去定义对应的 scopes,例如 fix
  74. /*
  75. scopeOverrides: {
  76. fix: [
  77. { name: 'merge' },
  78. { name: 'style' },
  79. { name: 'e2eTest' },
  80. { name: 'unitTest' }
  81. ]
  82. },
  83. */
  84. // 交互提示信息
  85. messages: {
  86. type: '确保本次提交遵循 Angular 规范!\n选择你要提交的类型:',
  87. scope: '\n选择一个 scope(可选):',
  88. // 选择 scope: custom 时会出下面的提示
  89. customScope: '请输入自定义的 scope:',
  90. subject: '填写简短精炼的变更描述:\n',
  91. body: '填写更加详细的变更描述(可选)。使用 "|" 换行:\n',
  92. breaking: '列举非兼容性重大的变更(可选):\n',
  93. footer: '列举出所有变更的 ISSUES CLOSED(可选)。 例如: #31, #34:\n',
  94. confirmCommit: '确认提交?'
  95. },
  96. // 设置只有 type 选择了 feat 或 fix,才询问 breaking message
  97. allowBreakingChanges: ['feat', 'fix'],
  98. // 跳过要询问的步骤
  99. // skipQuestions: ['body', 'footer'],
  100. subjectLimit: 100, // subject 限制长度
  101. breaklineChar: '|' // 换行符,支持 body 和 footer
  102. // footerPrefix : 'ISSUES CLOSED:'
  103. // askForBreakingChangeFirst : true,
  104. }