-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CHANGELOG: - This should appear. - So should this.
- Loading branch information
1 parent
641ca41
commit b839f32
Showing
2 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
const changelog = require("standard-changelog"); | ||
const changelog = require("conventional-changelog-core"); | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const commitPartial = fs.readFileSync(path.resolve(require.resolve("conventional-changelog-writer"), "../templates/commit.hbs")) | ||
.toString() | ||
.replace("* {{header}}\n\n{{~!-- commit link --}}", "### {{committerDate}}\n{{header}}\n\n"); | ||
|
||
changelog().pipe(process.stdout); | ||
changelog(undefined, undefined, undefined, { | ||
noteKeywords: ["CHANGELOG"] | ||
}, { | ||
transform: function(commit, context) { | ||
if (commit.notes.length === 1) { | ||
commit.header = commit.notes[0].text; | ||
commit.footer = null; | ||
commit.notes = []; | ||
return commit; | ||
} | ||
}, | ||
commitPartial | ||
}) | ||
.pipe(process.stdout); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters