@@ -14,15 +14,13 @@ interface ChangesetWithPR extends NewChangesetWithCommit {
1414let allAuthors = new Set < string > ( ) ;
1515let patchChanges = new Set < string > ( ) ;
1616let hasAddedCredits = false ; // Track if we've added credits in this changelog
17- let isFirstEntry = true ; // Track if this is the first entry in the changelog
1817
1918// Reset function to be called at the start of each changelog generation
2019function resetChangelogState ( ) {
2120 console . log ( `[Debug] Resetting changelog state` ) ;
2221 allAuthors . clear ( ) ;
2322 patchChanges . clear ( ) ;
2423 hasAddedCredits = false ;
25- isFirstEntry = true ;
2624}
2725
2826async function getReleaseLine (
@@ -220,56 +218,34 @@ const wrappedGetReleaseLine: ChangelogFunctions["getReleaseLine"] = async (
220218 type ,
221219 opts
222220) => {
223- // Reset state if this is the first entry
224- if ( isFirstEntry ) {
225- resetChangelogState ( ) ;
226- isFirstEntry = false ;
227- }
228-
229221 console . log ( `[Debug] Processing release line for type: ${ type } ` ) ;
230222 console . log ( `[Debug] Current authors: ${ Array . from ( allAuthors ) . join ( ", " ) } ` ) ;
231- console . log ( `[Debug] isLast: ${ opts ?. isLast } ` ) ;
232223 const result = await getReleaseLine ( changeset as ChangesetWithPR , type , opts ) ;
233224
234225 // Track patch changes
235226 if ( type === "patch" ) {
236227 patchChanges . add ( changeset . summary ) ;
237228 }
238229
239- // Add credits section only if this is the last entry and we have authors
240- if ( opts ?. isLast && allAuthors . size > 0 && ! hasAddedCredits ) {
241- console . log ( `[Debug] Adding credits section for ${ type } changes` ) ;
242- const credits = getCreditsSection ( ) ;
243- // Reset state after adding credits
244- resetChangelogState ( ) ;
245- return result + credits ;
246- }
247230 return result ;
248231} ;
249232
250233const wrappedGetDependencyReleaseLine : ChangelogFunctions [ "getDependencyReleaseLine" ] =
251234 async ( changesets , dependencies , opts ) => {
252- // Reset state if this is the first entry
253- if ( isFirstEntry ) {
254- resetChangelogState ( ) ;
255- isFirstEntry = false ;
256- }
257-
258235 console . log ( `[Debug] Processing dependency release line` ) ;
259236 console . log ( `[Debug] Number of changesets: ${ changesets . length } ` ) ;
260237 console . log (
261238 `[Debug] Current authors: ${ Array . from ( allAuthors ) . join ( ", " ) } `
262239 ) ;
263- console . log ( `[Debug] isLast: ${ opts ?. isLast } ` ) ;
264240 const result = await getDependencyReleaseLine (
265241 changesets ,
266242 dependencies ,
267243 opts
268244 ) ;
269245
270- // Add credits section only if this is the last entry and we have authors
271- if ( opts ?. isLast && allAuthors . size > 0 && ! hasAddedCredits ) {
272- console . log ( `[Debug] Adding credits section for dependency changes` ) ;
246+ // Add credits section if we have authors
247+ if ( allAuthors . size > 0 && ! hasAddedCredits ) {
248+ console . log ( `[Debug] Adding credits section for all changes` ) ;
273249 const credits = getCreditsSection ( ) ;
274250 // Reset state after adding credits
275251 resetChangelogState ( ) ;
0 commit comments