Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<%
if (!hash) {
if (!commit.hash) {
return;
}

const shortSha = hash && hash.slice(0, 7);
const shortSha = commit.hash.slice(0, 7);
%>
<tr>
<%# Commit: %>
<td><%
if (shortSha) {
%>
<a href="https://github.com/angular/angular-cli/commit/<%= hash %>"><img
<a href="https://github.com/angular/angular-cli/commit/<%= commit.hash %>"><img
align="top"
title="Feature" src="https://img.shields.io/badge/<%= shortSha %>-feat-blue.svg" />
title="<%= typeInfo.title %>" src="https://img.shields.io/badge/<%= shortSha %>-<%= commit.type %>-<%= typeInfo.badgeColor %>.svg" />
</a><%
} %>
</td>

<%# Desc: %>
<td><%= subject %></td>
<td><%= commit.subject %></td>

<%# Notes: %>
<td><%
for (const reference of references) {
for (const reference of commit.references) {
if (!reference.action || !reference.issue) {
continue;
}
Expand Down
40 changes: 0 additions & 40 deletions scripts/templates/changelog-fix.ejs

This file was deleted.

33 changes: 21 additions & 12 deletions scripts/templates/changelog.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,29 @@
return aOrder == -1 ? bOrder == -1 ? (a || '').localeCompare(b || '') : 1 : aOrder - bOrder;
});

for (const scope of scopes) {
// Do feature first, then fixes.
const allScopeCommits = commits.filter(x => x.scope === scope);
const ALLOWED_TYPES = {
'feat': {
badgeColor: 'blue',
title: 'Feature',
},
'fix': {
badgeColor: 'green',
title: 'Bug Fix',
},
'perf': {
badgeColor: 'orange',
title: 'Performance Improvement',
},
};

const scopeCommits = [
...allScopeCommits.filter(x => x.type === 'feat'),
...allScopeCommits.filter(x => x.type === 'fix'),
];
for (const scope of scopes) {
const scopeCommits = commits.filter(x => x.scope === scope && !!ALLOWED_TYPES[x.type]);

if (scopeCommits.length == 0) {
continue;
}

scopeCommits.sort((a, b) => a.type - b.type);
%>
<tr><td colspan=3><h3><%
if (scope) {
Expand All @@ -83,11 +94,9 @@
<%
let nbRows = 0;
for (const commit of scopeCommits) {
nbRows++;
switch (commit.type) {
case 'fix': %><%= include('./changelog-fix', commit) %><% break;
case 'feat': %><%= include('./changelog-feat', commit) %><% break;
}
nbRows++; %>
<%= include('./changelog-commit', { commit, typeInfo: ALLOWED_TYPES[commit.type] }) %>
<%
}

// Add an empty row to get the alternating colors in sync.
Expand Down