Skip to content

Commit 9903ce9

Browse files
committed
anota je
1 parent 4a45568 commit 9903ce9

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

src/index.ts

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ interface ChangesetWithPR extends NewChangesetWithCommit {
1414
let allAuthors = new Set<string>();
1515
let patchChanges = new Set<string>();
1616
let 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
2019
function resetChangelogState() {
2120
console.log(`[Debug] Resetting changelog state`);
2221
allAuthors.clear();
2322
patchChanges.clear();
2423
hasAddedCredits = false;
25-
isFirstEntry = true;
2624
}
2725

2826
async 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

250233
const 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

Comments
 (0)