Skip to content

Commit 8c5eaf0

Browse files
committed
chore: implement 2-tier release notes structure
Restructured release notes into Highlights/Maintenance sections - Highlights: feat, fix, perf types (user-facing changes) - Maintenance: other types (internal improvements) Migrated .releaserc.json to .releaserc.js to enable writerOpts functions Used transform function for commit categorization and groupBy for section grouping
1 parent 216c118 commit 8c5eaf0

2 files changed

Lines changed: 92 additions & 70 deletions

File tree

.releaserc.js

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
export default {
2+
branches: ["release"],
3+
repositoryUrl: "https://github.com/KubrickCode/baedal.git",
4+
plugins: [
5+
[
6+
"@semantic-release/commit-analyzer",
7+
{
8+
preset: "conventionalcommits",
9+
releaseRules: [
10+
{ type: "feat", release: "minor" },
11+
{ type: "fix", release: "patch" },
12+
{ type: "perf", release: "patch" },
13+
{ type: "ifix", release: "patch" },
14+
{ type: "docs", release: "patch" },
15+
{ type: "style", release: "patch" },
16+
{ type: "refactor", release: "patch" },
17+
{ type: "test", release: "patch" },
18+
{ type: "ci", release: "patch" },
19+
{ type: "chore", release: "patch" },
20+
],
21+
},
22+
],
23+
[
24+
"@semantic-release/release-notes-generator",
25+
{
26+
preset: "conventionalcommits",
27+
presetConfig: {
28+
types: [
29+
{ type: "feat", section: "✨ Features", hidden: false },
30+
{ type: "fix", section: "🐛 Bug Fixes", hidden: false },
31+
{ type: "perf", section: "⚡ Performance", hidden: false },
32+
{ type: "ifix", section: "🔧 Internal Fixes", hidden: false },
33+
{ type: "docs", section: "📚 Documentation", hidden: false },
34+
{ type: "style", section: "💄 Styles", hidden: false },
35+
{ type: "refactor", section: "♻️ Refactoring", hidden: false },
36+
{ type: "test", section: "✅ Tests", hidden: false },
37+
{ type: "ci", section: "🔧 CI/CD", hidden: false },
38+
{ type: "chore", section: "🔨 Chore", hidden: false },
39+
],
40+
},
41+
writerOpts: {
42+
transform(commit) {
43+
const highlightTypes = ["feat", "fix", "perf"];
44+
45+
if (highlightTypes.includes(commit.type)) {
46+
commit.category = "🎯 Highlights";
47+
} else {
48+
commit.category = "🔧 Maintenance";
49+
}
50+
51+
return commit;
52+
},
53+
groupBy: "category",
54+
commitGroupsSort(a, b) {
55+
const priority = {
56+
"🎯 Highlights": 1,
57+
"🔧 Maintenance": 2,
58+
};
59+
return (priority[a.title] || 999) - (priority[b.title] || 999);
60+
},
61+
commitsSort: ["scope", "subject"],
62+
},
63+
},
64+
],
65+
[
66+
"@semantic-release/changelog",
67+
{
68+
changelogFile: "CHANGELOG.md",
69+
},
70+
],
71+
"@semantic-release/npm",
72+
[
73+
"@semantic-release/exec",
74+
{
75+
prepareCmd: "just lint config",
76+
},
77+
],
78+
[
79+
"@semantic-release/git",
80+
{
81+
assets: ["package.json", "CHANGELOG.md"],
82+
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
83+
},
84+
],
85+
[
86+
"@semantic-release/github",
87+
{
88+
assets: [],
89+
},
90+
],
91+
],
92+
};

.releaserc.json

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)