fix(aidocs_classes): Refactor and enhance changelog formatting

This commit is contained in:
2024-06-23 23:05:47 +02:00
parent 4ea205e11b
commit b0fcaba2c3
4 changed files with 26 additions and 36 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tsdoc',
version: '1.3.4',
version: '1.3.5',
description: 'An advanced TypeScript documentation tool using AI to generate and enhance documentation for TypeScript projects.'
}

View File

@ -59,6 +59,8 @@ interface {
recommendedNextVersion: string; // the recommended next version of the project, x.x.x
}
For the recommendedNextVersionDetails, please only add a detail entries to the array if it has an obvious value to the reader.
You are being given the files of the project. You should use them to create the commit message.
Also you are given a diff
@ -81,16 +83,18 @@ Also you are given a diff
if (!previousChangelog) {
// lets build the changelog based on that
const commitMessages = await gitRepo.getAllCommitMessages();
console.log(JSON.stringify(commitMessages, null, 2));
let result2 = await this.aiDocsRef.openaiInstance.chat({
messageHistory: [],
systemMessage: `
You are building a changelog.md file for the project.
Omit commits and versions that lack relevant changes.
Omit commits and versions that lack relevant changes, but make sure to mention them as a range with a summarizing message instead.
A changelog entry should look like this:
## yyyy-mm-dd - x.x.x - scope here
main descriptiom here
- detailed bullet points follow
You are given:
@ -117,7 +121,7 @@ ${JSON.stringify(commitMessages, null, 2)}
{{nextVersionMessage}}
{{nextVersionDetails}}
`}\n\n${oldChangelog}\n`;
`}\n\n${oldChangelog}`;
resultObject.changelog = newChangelog;
return resultObject;

View File

@ -47,7 +47,6 @@ export class ProjectContext {
}
public async convertFilesToContext(filesArg: plugins.smartfile.SmartFile[]) {
console.log(`Using the following files for the documentation:`);
filesArg.map((fileArg) => {
// console.log(` -> ${fileArg.relative}`);
});