@@ -3,7 +3,7 @@ const rules = [
33 { type : 'fix' , release : 'patch' , title : 'Bug fixes' } ,
44 { type : 'refactor' , release : 'patch' , title : 'Code refactors' } ,
55 { type : 'docs' , release : 'patch' , title : 'Documentation changes' } ,
6- { type : 'chore' , release : 'patch' , title : 'Other changes' } ,
6+ { type : 'chore' , release : 'patch' , title : 'Other changes' }
77] ;
88
99const sortMap = Object . fromEntries ( rules . map ( ( rule , index ) => [ rule . title , index ] ) ) ;
@@ -15,32 +15,42 @@ module.exports = {
1515 branches : [ 'main' ] ,
1616 tagFormat : '${version}' ,
1717 plugins : [
18- [ '@semantic-release/commit-analyzer' , {
19- preset : 'conventionalcommits' ,
20- releaseRules : [
21- { breaking : true , release : 'major' } ,
22- { revert : true , release : 'patch' } ,
23- ] . concat (
24- rules . map ( ( { type, release } ) => ( { type, release } ) )
25- ) ,
26- } ] ,
27- [ '@semantic-release/release-notes-generator' , {
28- preset : 'conventionalcommits' ,
29- presetConfig : {
30- types : rules . map ( ( { type, title } ) => ( { type, section : title } ) ) ,
31- } ,
32- writerOpts : {
33- commitGroupsSort : ( a , z ) => sortMap [ a . title ] - sortMap [ z . title ] ,
34- } ,
35- } ] ,
18+ [
19+ '@semantic-release/commit-analyzer' ,
20+ {
21+ preset : 'conventionalcommits' ,
22+ releaseRules : [
23+ { breaking : true , release : 'major' } ,
24+ { revert : true , release : 'patch' }
25+ ] . concat ( rules . map ( ( { type, release } ) => ( { type, release } ) ) )
26+ }
27+ ] ,
28+ [
29+ '@semantic-release/release-notes-generator' ,
30+ {
31+ preset : 'conventionalcommits' ,
32+ presetConfig : {
33+ types : rules . map ( ( { type, title } ) => ( { type, section : title } ) )
34+ } ,
35+ writerOpts : {
36+ commitGroupsSort : ( a , z ) => sortMap [ a . title ] - sortMap [ z . title ]
37+ }
38+ }
39+ ] ,
3640 '@semantic-release/changelog' ,
3741 [ '@semantic-release/npm' , { npmPublish : false } ] ,
38- [ '@semantic-release/git' , {
39- message : 'chore: create new release ${nextRelease.version}\n\n${nextRelease.notes}' ,
40- assets : [ 'package.json' , 'CHANGELOG.md' ] ,
41- } ] ,
42- [ '@semantic-release/github' , {
43- draftRelease : false ,
44- } ] ,
45- ] ,
46- } ;
42+ [
43+ '@semantic-release/git' ,
44+ {
45+ message : 'chore: create new release ${nextRelease.version}\n\n${nextRelease.notes}' ,
46+ assets : [ 'package.json' , 'CHANGELOG.md' ]
47+ }
48+ ] ,
49+ [
50+ '@semantic-release/github' ,
51+ {
52+ draftRelease : false
53+ }
54+ ]
55+ ]
56+ } ;
0 commit comments