File tree Expand file tree Collapse file tree 2 files changed +8
-24
lines changed
Expand file tree Collapse file tree 2 files changed +8
-24
lines changed Original file line number Diff line number Diff line change @@ -359,8 +359,9 @@ the template we currently use:
359359> - Fix #2
360360
361361Make sure you're on latest ` trunk ` , then run
362- ` yarn release-notes <last version> <this version> ` to get a list of user-facing
363- changes. You will likely need to prune and rewrite some of these entries.
362+ ` node --run release-notes -- <last version> <this version> ` to get a list of
363+ user-facing changes. You will likely need to prune and rewrite some of these
364+ entries.
364365
365366<!-- References -->
366367
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ type Group =
1919 | "visionos"
2020 | "windows" ;
2121
22- type Changes = Record < string , Record < Group , string [ ] > > ;
22+ type Changes = Record < string , Partial < Record < Group , string [ ] > > > ;
2323
2424function assertCategory ( category : string ) : asserts category is "feat" | "fix" {
2525 if ( category !== "feat" && category !== "fix" ) {
@@ -85,33 +85,16 @@ function sanitizeGroup(group: string): Group {
8585}
8686
8787function parseCommits ( commits : Commit [ ] ) : Changes {
88- const changes : Changes = {
89- feat : {
90- general : [ ] ,
91- android : [ ] ,
92- apple : [ ] ,
93- ios : [ ] ,
94- macos : [ ] ,
95- visionos : [ ] ,
96- windows : [ ] ,
97- } ,
98- fix : {
99- general : [ ] ,
100- android : [ ] ,
101- apple : [ ] ,
102- ios : [ ] ,
103- macos : [ ] ,
104- visionos : [ ] ,
105- windows : [ ] ,
106- } ,
107- } ;
88+ const changes : Changes = { feat : { } , fix : { } } ;
10889
10990 for ( const { message } of commits ) {
11091 const m = message . match ( / ^ ( f e a t | f i x ) (?: \( ( .* ?) \) ) ? : ( .* ) $ / ) ;
11192 if ( m ) {
11293 const [ , cat , group , message ] = m ;
11394 assertCategory ( cat ) ;
114- changes [ cat ] [ sanitizeGroup ( group ) ] . push ( message ) ;
95+ const g = sanitizeGroup ( group ) ;
96+ changes [ cat ] [ g ] ||= [ ] ;
97+ changes [ cat ] [ g ] . push ( message ) ;
11598 }
11699 }
117100
You can’t perform that action at this time.
0 commit comments