@@ -65,7 +65,7 @@ function classifyTitle(title) {
6565 }
6666
6767 // Single-word prefix like chore:, feat:
68- match = t . match ( / ^ ( b u g | f e a t | e n h a n c e m e n t | r e f a c t o r | d o c s | t e s t | c h o r e | t a s k | c o m p o s i t e | u x \/ u i | p r o p o s a l | i d e a | d i s c u s s i o n ) [: \s - ] + / i) ;
68+ match = t . match ( / ^ ( b u g | f e a t | e n h a n c e m e n t | r e f a c t o r | d o c s | t e s t | c h o r e | t a s k | c o m p o s i t e | u x \/ u i ) [: \s - ] + / i) ;
6969 if ( match ) {
7070 const prefix = match [ 1 ] . toLowerCase ( ) ;
7171 return PREFIX_MAP [ prefix ] || "Other" ;
@@ -74,19 +74,19 @@ function classifyTitle(title) {
7474 return "Other" ;
7575}
7676
77- // --- Normalize title for display (keep all prefixes in brackets as-is) ---
77+ // --- Normalize title for release notes ---
78+ // Convert emoji + chore: → [Chore], feat: → [Feat], etc.
7879function normalizeTitleForNotes ( title ) {
7980 let t = title . trim ( ) ;
8081
81- // Match leading emoji + optional :emoji: + optional text prefix like chore:, feat:, etc.
82- const match = t . match ( / ^ ( [ \s \p{ Emoji_Presentation} \p{ Extended_Pictographic} ] + | ( : [ a - z A - Z 0 - 9 _ + - ] + : ) + ) \s * ( b u g | f e a t | e n h a n c e m e n t | r e f a c t o r | d o c s | t e s t | c h o r e | t a s k | c o m p o s i t e | u x \/ u i ) [: \s - ] + / i) ;
82+ // Remove leading emoji or :emoji: (one or more)
83+ t = t . replace ( / ^ ( [ \s \p{ Emoji_Presentation} \p{ Extended_Pictographic} ] + | ( : [ a - z A - Z 0 - 9 _ + - ] + : ) + ) \s * / u, '' ) ;
84+
85+ // Match leading word prefix like chore:, feat:, etc.
86+ const match = t . match ( / ^ ( b u g | f e a t | e n h a n c e m e n t | r e f a c t o r | d o c s | t e s t | c h o r e | t a s k | c o m p o s i t e | u x \/ u i ) [: \s - ] + / i) ;
8387 if ( match ) {
84- const prefix = match [ 3 ] . toLowerCase ( ) ;
85- const sectionName = PREFIX_MAP [ prefix ] ;
86- if ( sectionName ) {
87- // Replace everything matched with [Prefix] (first letter capitalized)
88- t = t . replace ( match [ 0 ] , `[${ prefix . charAt ( 0 ) . toUpperCase ( ) + prefix . slice ( 1 ) } ] ` ) ;
89- }
88+ const prefix = match [ 1 ] . toLowerCase ( ) ;
89+ t = t . replace ( match [ 0 ] , `[${ prefix . charAt ( 0 ) . toUpperCase ( ) + prefix . slice ( 1 ) } ] ` ) ;
9090 }
9191
9292 return t ;
@@ -274,7 +274,7 @@ async function main() {
274274 console . log ( `✅ Release processing completed` ) ;
275275}
276276
277- // --- Run ---
277+ // Run
278278main ( ) . catch ( err => {
279279 console . error ( "Error:" , err ) ;
280280 process . exit ( 1 ) ;
0 commit comments