File tree Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,13 @@ interface ChangelogConfig {
31
31
*/
32
32
displayTypes? : CommitTypes [];
33
33
/**
34
- * there are two languages types
34
+ * whether to include emoji in title
35
35
*/
36
- language? : ' en-US' | ' zh-CN' ;
36
+ withEmoji? : boolean ;
37
+ /**
38
+ * title language
39
+ */
40
+ titleLanguage? : ' en-US' | ' zh-CN' ;
37
41
/**
38
42
* whether to show author
39
43
*/
Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ export interface CustomConfig {
18
18
* 是否显示作者
19
19
*/
20
20
showAuthor ?: boolean ;
21
+ /**
22
+ * whether to include emoji in title
23
+ */
24
+ withEmoji ?: boolean ;
25
+ /**
26
+ * title language
27
+ */
28
+ titleLanguage ?: 'en-US' | 'zh-CN' ;
21
29
}
22
30
23
31
const explorer = cosmiconfigSync ( 'changelog' ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,10 @@ export default (customConfig: CustomConfig) => (
15
15
const issues = [ ] ;
16
16
17
17
commit . notes . forEach ( ( note ) => {
18
- note . title = 'BREAKING CHANGES' ;
18
+ note . title = `${
19
+ customConfig ?. withEmoji === false ? '' : '💥 '
20
+ } BREAKING CHANGES`;
21
+
19
22
discard = false ;
20
23
} ) ;
21
24
@@ -28,14 +31,16 @@ export default (customConfig: CustomConfig) => (
28
31
if ( ! displayTypes . includes ( < CommitTypes > commit . type ) && discard ) return ;
29
32
30
33
// 修改 type 标题
31
- commit . type = getDisplayName ( commit . type ) ;
34
+ commit . type = getDisplayName ( commit . type , {
35
+ language : customConfig . titleLanguage ,
36
+ withEmoji : customConfig . withEmoji ,
37
+ } ) ;
32
38
39
+ /** * 处理 scope ** */
33
40
if ( commit . scope === '*' ) {
34
41
commit . scope = '' ;
35
42
}
36
43
37
- /** * 处理 scope ** */
38
-
39
44
if ( customConfig . displayScopes ) {
40
45
if ( ! customConfig . displayScopes ?. includes ( commit . scope ) ) return ;
41
46
}
You can’t perform that action at this time.
0 commit comments