-
Notifications
You must be signed in to change notification settings - Fork 15
/
defaultConfig.js
51 lines (41 loc) · 1.52 KB
/
defaultConfig.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
const DEFAULT_CONFIG = {
types: [
{ types: ["feat", "feature"], label: "New Features" },
{ types: ["fix", "bugfix"], label: "Bugfixes" },
{ types: ["improvements", "enhancement"], label: "Improvements" },
{ types: ["perf"], label: "Performance Improvements" },
{ types: ["build", "ci"], label: "Build System" },
{ types: ["refactor"], label: "Refactors" },
{ types: ["doc", "docs"], label: "Documentation Changes" },
{ types: ["test", "tests"], label: "Tests" },
{ types: ["style"], label: "Code Style Changes" },
{ types: ["chore"], label: "Chores" },
{ types: ["other"], label: "Other Changes" },
],
excludeTypes: [],
includeCommitBody: false,
renderTypeSection: function (label, commits, includeCommitBody) {
let text = `\n## ${label}\n`;
commits.forEach(commit => {
const scope = commit.scope ? `**${commit.scope}:** ` : "";
text += `- ${scope}${commit.subject}\n`;
if (commit.body && includeCommitBody) {
text += `${commit.body}\n`;
}
});
return text;
},
renderNotes: function (notes) {
let text = `\n## BREAKING CHANGES\n`;
notes.forEach(note => {
text += `- due to [${note.commit.sha.substr(0, 6)}](${note.commit.url}): ${note.commit.subject}\n\n`;
text += `${note.text}\n\n`;
});
return text;
},
renderChangelog: function (release, changes) {
const now = new Date();
return `# ${release} - ${now.toISOString().substr(0, 10)}\n\n` + changes + "\n\n";
},
};
module.exports = DEFAULT_CONFIG;