File tree Expand file tree Collapse file tree 3 files changed +27
-58
lines changed Expand file tree Collapse file tree 3 files changed +27
-58
lines changed Original file line number Diff line number Diff line change 1
1
<%
2
- if (! hash) {
2
+ if (! commit . hash ) {
3
3
return ;
4
4
}
5
5
6
- const shortSha = hash && hash .slice (0 , 7 );
6
+ const shortSha = commit . hash .slice (0 , 7 );
7
7
%>
8
8
<tr >
9
9
<% # Commit: %>
10
10
<td ><%
11
11
if (shortSha) {
12
12
% >
13
- < a href= " https://github.com/angular/angular-cli/commit/<%= hash %>" >< img
13
+ < a href= " https://github.com/angular/angular-cli/commit/<%= commit. hash %>" >< img
14
14
align= " top"
15
- title= " Feature " src= " https://img.shields.io/badge/<%= shortSha %>-feat-blue .svg" / >
15
+ title= " <%= typeInfo.title %> " src= " https://img.shields.io/badge/<%= shortSha %>-<%= commit.type %>-<%= typeInfo.badgeColor %> .svg" / >
16
16
< / a>< %
17
17
} %>
18
18
</td >
19
19
20
20
<% # Desc: %>
21
- <td ><%= subject %> </td >
21
+ <td ><%= commit . subject %> </td >
22
22
23
23
<% # Notes: %>
24
24
<td ><%
25
- for (const reference of references) {
25
+ for (const reference of commit . references ) {
26
26
if (! reference .action || ! reference .issue ) {
27
27
continue ;
28
28
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55
55
return aOrder == - 1 ? bOrder == - 1 ? (a || ' ' ).localeCompare (b || ' ' ) : 1 : aOrder - bOrder;
56
56
});
57
57
58
- for (const scope of scopes) {
59
- // Do feature first, then fixes.
60
- const allScopeCommits = commits .filter (x => x .scope === scope);
58
+ const ALLOWED_TYPES = {
59
+ ' feat' : {
60
+ badgeColor: ' blue' ,
61
+ title: ' Feature' ,
62
+ },
63
+ ' fix' : {
64
+ badgeColor: ' green' ,
65
+ title: ' Bug Fix' ,
66
+ },
67
+ ' perf' : {
68
+ badgeColor: ' orange' ,
69
+ title: ' Performance Improvement' ,
70
+ },
71
+ };
61
72
62
- const scopeCommits = [
63
- ... allScopeCommits .filter (x => x .type === ' feat' ),
64
- ... allScopeCommits .filter (x => x .type === ' fix' ),
65
- ];
73
+ for (const scope of scopes) {
74
+ const scopeCommits = commits .filter (x => x .scope === scope && !! ALLOWED_TYPES [x .type ]);
66
75
67
76
if (scopeCommits .length == 0 ) {
68
77
continue ;
69
78
}
79
+
80
+ scopeCommits .sort ((a , b ) => a .type - b .type );
70
81
% >
71
82
< tr>< td colspan= 3 >< h3>< %
72
83
if (scope) {
83
94
< %
84
95
let nbRows = 0 ;
85
96
for (const commit of scopeCommits) {
86
- nbRows++ ;
87
- switch (commit .type ) {
88
- case ' fix' : % >< %= include (' ./changelog-fix' , commit) % >< % break ;
89
- case ' feat' : % >< %= include (' ./changelog-feat' , commit) % >< % break ;
90
- }
97
+ nbRows++ ; % >
98
+ < %= include (' ./changelog-commit' , { commit, typeInfo: ALLOWED_TYPES [commit .type ] }) % >
99
+ < %
91
100
}
92
101
93
102
// Add an empty row to get the alternating colors in sync.
You can’t perform that action at this time.
0 commit comments