forked from jiayisheji/miracle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cz-config.js
140 lines (133 loc) · 3.22 KB
/
.cz-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
const projects = [
{
name: 'admin',
readme: '/apps/admin',
},
{
name: 'webapp',
readme: '/apps/webapp',
},
{
name: 'api',
readme: '/apps/api',
},
];
// 默认自定义 scopes
const defaultScopes = [
{
name: 'wip',
readme: 'Work In Process',
},
{
name: 'workspace',
readme: '/',
},
{
name: 'tools',
readme: '/tools',
},
{
name: 'docs',
readme: '/docs',
},
{
name: 'deps',
readme: 'bump package-name from 7.0.1 to 8.0.1',
},
{
name: 'dev-deps',
readme: 'bump package-name from 7.0.1 to 8.0.1',
},
];
const scopes = [...projects, ...defaultScopes].filter(Boolean);
module.exports = {
// 自定义types
types: [
{
value: 'feat',
name: '新增功能',
},
{
value: 'fix',
name: 'bug修复',
},
{
value: 'docs',
name: '文档更新',
},
{
value: 'style',
name: '不影响程序逻辑的代码修改(修改空白字符,格式缩进,补全缺失的分号等,没有改变代码逻辑)',
},
{
value: 'refactor',
name: '重构代码(既没有新增功能,也没有修复bug)',
},
{
value: 'perf',
name: '改进性能、体验优化的代码更改',
},
{
value: 'test',
name: '新增测试或更新现有测试用例',
},
{
value: 'build',
name: '主要目的是修改项目构建系统(例如 glup, webpack, rollup,npm的配置等.xxx) 的提交',
},
{
value: 'ci',
name: '主要目的是修改项目继续集成流程(例如 Travis, Jenkins, GitLab CI, Circle等) 的提交',
},
{
value: 'revert',
name: '回滚某个更早之前的提交',
},
{
value: 'release',
name: '版本发布',
},
{
value: 'chore',
name: '不属于以上类型的其他类型',
},
],
// 自定义scopes
scopes,
allowTicketNumber: false,
isTicketNumberRequired: false,
ticketNumberPrefix: 'TICKET-',
ticketNumberRegExp: '\\d{1,5}',
// it needs to match the value for field type. Eg.: 'fix'
/*
scopeOverrides: {
fix: [
{name: 'merge'},
{name: 'style'},
{name: 'e2eTest'},
{name: 'unitTest'}
]
},
*/
// override the messages, defaults are as follows
messages: {
type: '选择要提交的更改类型:',
scope: '表示此更改的范围(可选):',
// used if allowCustomScopes is true
customScope: '选择此项可以更改自定义范围:',
subject: '用简短的文字描述变更内容:',
body: '提供更长的变更描述(可选)。使用“|”中断新行:',
breaking: '列出任何中断更改(可选):',
footer: '列出此更改所关闭的任何问题(可选)。例如:#31 #34。对应“package.json”文件里“bugs.url”',
confirmCommit: '你确定要继续执行上面的提交吗?',
},
allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix'],
// 跳过任何你想问的问题
skipQuestions: ['body', 'footer'],
// limit subject length
subjectLimit: 100,
// breaklineChar: '|', // It is supported for fields body and footer.
// footerPrefix : 'ISSUES CLOSED:'
// askForBreakingChangeFirst : true, // default is false
};