Skip to content

Commit

Permalink
Improve changelog format (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbarth committed May 12, 2021
1 parent d34b22f commit 2d2cc0a
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 9 deletions.
44 changes: 43 additions & 1 deletion .grenrc.js
Expand Up @@ -3,12 +3,37 @@ module.exports = {
prefix: "",
onlyMilestones: false,
ignoreTagsWith: ["v0.32.0", "0.0.3"],
ignoreLabels: [
"semver-major",
"semver-minor",
"semver-patch",
"closed",
"breaking-change",
"bug",
"enhancement",
"dependencies",
],
tags: "all",
groupBy: false,
groupBy: {
"Major Changes": ["semver-major", "breaking-change"],
"Minor Changes": ["semver-minor", "enhancement"],
Dependencies: ["dependencies"],
"Bug Fixes": ["semver-patch", "bug"],
Other: ["..."],
},
changelogFilename: "CHANGELOG.md",
username: "node-saml",
repo: "passport-saml",
template: {
issue: function (placeholders) {
const parts = [
"-",
placeholders.labels,
placeholders.name,
`[${placeholders.text}](${placeholders.url})`,
];
return parts.filter((_) => _).join(" ");
},
release: function (placeholders) {
let dateParts = placeholders.date.split("/");
let placeholdersDate = new Date(
Expand All @@ -17,7 +42,24 @@ module.exports = {
Number(dateParts[0])
);
let isoDateString = placeholdersDate.toISOString().split("T")[0];
placeholders.body = placeholders.body.replace(
"*No changelog for this release.*",
"\n_No changelog for this release._"
);
return `## ${placeholders.release} (${isoDateString})\n${placeholders.body}`;
},
group: function (placeholders) {
const iconMap = {
Enhancements: "🚀",
"Minor Changes": "🚀",
"Bug Fixes": "🐛",
Documentation: "📚",
"Technical Tasks": "⚙️",
"Major Changes": "💣",
Dependencies: "🔗",
};
const icon = iconMap[placeholders.heading] || "🙈";
return "\n#### " + icon + " " + placeholders.heading + ":\n";
},
},
};
9 changes: 9 additions & 0 deletions .release-it.json
@@ -0,0 +1,9 @@
{
"github": {
"release": true,
"releaseName": "v${version}"
},
"hooks": {
"after:bump": "npm run changelog"
}
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "passport-saml",
"version": "2.0.6",
"version": "2.2.0",
"description": "SAML 2.0 authentication strategy for Passport",
"keywords": [
"saml",
Expand Down Expand Up @@ -42,6 +42,7 @@
"prettier-check": "prettier --config .prettierrc.json --check .",
"prettier-format": "prettier --config .prettierrc.json --write .",
"prettier-watch": "onchange -k -p 100 \".\" -- prettier --config .prettierrc.json --write {{file}}",
"release": "release-it",
"test": "npm run prettier-check && npm run lint && npm run tsc && mocha",
"test-watch": "mocha --watch",
"tsc": "tsc",
Expand Down Expand Up @@ -92,11 +93,5 @@
},
"engines": {
"node": ">= 12"
},
"release-it": {
"github": {
"release": true,
"releaseName": "v${version}"
}
}
}

0 comments on commit 2d2cc0a

Please sign in to comment.