Skip to content

Commit 00a1ce7

Browse files
authored
ci: conventional commits changelog (#3843)
* feat(live-preview): another oen * wip: changelog script * wippppp * chore: this worked * wip: changelog working * chore(script): working changelog gen * chore(script): update changelog during release
1 parent 7eee0ec commit 00a1ce7

File tree

9 files changed

+723
-49
lines changed

9 files changed

+723
-49
lines changed

changelog.config.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
// gitRawCommitsOpts: {
3+
// from: 'v2.0.9',
4+
// path: 'packages/payload',
5+
// },
6+
// infile: 'CHANGELOG.md',
7+
options: {
8+
preset: {
9+
name: 'conventionalcommits',
10+
types: [
11+
{ section: 'Features', type: 'feat' },
12+
{ section: 'Features', type: 'feature' },
13+
{ section: 'Bug Fixes', type: 'fix' },
14+
{ section: 'Documentation', type: 'docs' },
15+
],
16+
},
17+
},
18+
// outfile: 'NEW.md',
19+
writerOpts: {
20+
commitGroupsSort: (a, b) => {
21+
const groupOrder = ['Features', 'Bug Fixes', 'Documentation']
22+
return groupOrder.indexOf(a.title) - groupOrder.indexOf(b.title)
23+
},
24+
25+
// Scoped commits at the end, alphabetical sort
26+
commitsSort: (a, b) => {
27+
if (a.scope || b.scope) {
28+
if (!a.scope) return -1
29+
if (!b.scope) return 1
30+
return a.scope === b.scope
31+
? a.subject.localeCompare(b.subject)
32+
: a.scope.localeCompare(b.scope)
33+
}
34+
35+
// Alphabetical sort
36+
return a.subject.localeCompare(b.subject)
37+
},
38+
},
39+
}

package.json

+12
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
"@swc/register": "0.1.10",
4141
"@testing-library/jest-dom": "5.17.0",
4242
"@testing-library/react": "13.4.0",
43+
"@types/concat-stream": "^2.0.1",
44+
"@types/conventional-changelog": "^3.1.4",
45+
"@types/conventional-changelog-core": "^4.2.5",
46+
"@types/conventional-changelog-preset-loader": "^2.3.4",
4347
"@types/fs-extra": "^11.0.2",
4448
"@types/jest": "29.5.4",
4549
"@types/minimist": "1.2.2",
@@ -50,15 +54,21 @@
5054
"@types/semver": "^7.5.3",
5155
"@types/shelljs": "0.8.12",
5256
"@types/testing-library__jest-dom": "5.14.8",
57+
"add-stream": "^1.0.0",
5358
"chalk": "^5.3.0",
5459
"chalk-template": "1.1.0",
60+
"concat-stream": "^2.0.0",
61+
"conventional-changelog": "^5.1.0",
62+
"conventional-changelog-core": "^7.0.0",
63+
"conventional-changelog-preset-loader": "^4.1.0",
5564
"copyfiles": "2.4.1",
5665
"cross-env": "7.0.3",
5766
"dotenv": "8.6.0",
5867
"express": "4.18.2",
5968
"form-data": "3.0.1",
6069
"fs-extra": "10.1.0",
6170
"get-port": "5.1.1",
71+
"get-stream": "6.0.1",
6272
"glob": "8.1.0",
6373
"graphql-request": "6.1.0",
6474
"husky": "^8.0.3",
@@ -74,12 +84,14 @@
7484
"prettier": "^3.0.3",
7585
"prompts": "2.4.2",
7686
"qs": "6.11.2",
87+
"read-stream": "^2.1.1",
7788
"rimraf": "3.0.2",
7889
"semver": "^7.5.4",
7990
"shelljs": "0.8.5",
8091
"simple-git": "^3.20.0",
8192
"slash": "3.0.0",
8293
"slate": "0.91.4",
94+
"tempfile": "^3.0.0",
8395
"ts-node": "10.9.1",
8496
"tsx": "^3.13.0",
8597
"turbo": "^1.10.15",

packages/live-preview/asdf.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)