fix(aidocs): Fix changelog generation by handling leading newlines
This commit is contained in:
parent
a22c400355
commit
d962e17c18
@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2024-06-24 - 1.3.12 - fix(aidocs)
|
||||||
|
Fix changelog generation by handling leading newlines
|
||||||
|
|
||||||
|
- Fixed handling of leading newlines in the changelog to ensure proper formatting.
|
||||||
|
|
||||||
## 2024-06-23 - 1.3.11 - fix(core)
|
## 2024-06-23 - 1.3.11 - fix(core)
|
||||||
Fixed new changelog formatting issue to retain consistent spacing.
|
Fixed new changelog formatting issue to retain consistent spacing.
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tsdoc',
|
name: '@git.zone/tsdoc',
|
||||||
version: '1.3.11',
|
version: '1.3.12',
|
||||||
description: 'An advanced TypeScript documentation tool using AI to generate and enhance documentation for TypeScript projects.'
|
description: 'An advanced TypeScript documentation tool using AI to generate and enhance documentation for TypeScript projects.'
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,10 @@ export class Commit {
|
|||||||
smartgitInstance,
|
smartgitInstance,
|
||||||
this.projectDir
|
this.projectDir
|
||||||
);
|
);
|
||||||
const diffStringArray = await gitRepo.getUncommittedDiff(['pnpm-lock.yaml', 'package-lock.json']);
|
const diffStringArray = await gitRepo.getUncommittedDiff([
|
||||||
|
'pnpm-lock.yaml',
|
||||||
|
'package-lock.json',
|
||||||
|
]);
|
||||||
const projectContext = new ProjectContext(this.projectDir);
|
const projectContext = new ProjectContext(this.projectDir);
|
||||||
let contextString = await projectContext.update();
|
let contextString = await projectContext.update();
|
||||||
contextString = `
|
contextString = `
|
||||||
@ -116,6 +119,9 @@ ${JSON.stringify(commitMessages, null, 2)}
|
|||||||
}
|
}
|
||||||
|
|
||||||
let oldChangelog = previousChangelog.contents.toString().replace('# Changelog\n\n', '');
|
let oldChangelog = previousChangelog.contents.toString().replace('# Changelog\n\n', '');
|
||||||
|
if (oldChangelog.startsWith('\n')) {
|
||||||
|
oldChangelog = oldChangelog.replace('\n', '');
|
||||||
|
}
|
||||||
let newDateString = new plugins.smarttime.ExtendedDate().exportToHyphedSortableDate();
|
let newDateString = new plugins.smarttime.ExtendedDate().exportToHyphedSortableDate();
|
||||||
let newChangelog = `# Changelog\n\n${`## ${newDateString} - {{nextVersion}} - {{nextVersionScope}}
|
let newChangelog = `# Changelog\n\n${`## ${newDateString} - {{nextVersion}} - {{nextVersionScope}}
|
||||||
{{nextVersionMessage}}
|
{{nextVersionMessage}}
|
||||||
|
Loading…
Reference in New Issue
Block a user