forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangelog.ejs
More file actions
66 lines (60 loc) · 1.77 KB
/
changelog.ejs
File metadata and controls
66 lines (60 loc) · 1.77 KB
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
<%#
The data structure for this file looks like this:
{
from: 'v1.2.3',
to: 'v1.2.4',
// For a commit with description:
// ------------------------------------------------------
// feat(@angular/pwa): add something to this
//
// Fixes #123
// ------------------------------------------------------
// See https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser
commits: [ {
type: 'feat', // | 'fix' | 'refactor' | 'build' | 'test' | 'ci'
scope: '@angular/pwa', // package name (or null)
subject: 'add something to this',
header: 'feat(@angular/pwa): add something to this',
body: null,
footer: 'Fixes #123',
references: [
{
action: 'Closes',
owner: null,
repository: null,
issue: '123',
raw: '#123',
prefix: '#'
}
],
} ]
}
%># Commits
<%
// Get unique scopes.
const scopes = commits.map(x => x.scope)
.sort()
.filter((v, i, a) => v !== a[i - 1]);
for (const scope of scopes) {
const scopeCommits = commits
.filter(x => x.scope === scope)
.filter(x => ['fix', 'feat'].includes(x.type));
if (scopeCommits.length == 0) {
continue;
}
%>
## `<%= scope || 'Misc' %>`
| Commit | Description | Notes |
|:------:| ----------- | -----:|
<%
for (const commit of scopeCommits) {
switch (commit.type) {
case 'fix': %><%= include('./changelog-fix', commit) %><% break;
case 'feat': %><%= include('./changelog-feat', commit) %><% break;
}
}
%>
<% } %>
----
# Special Thanks
<%= include('./changelog-special-thanks', { commits }) %>