fix(aidocs_classes): Fix minor bugs and update dependencies in aidocs_classes
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tsdoc',
|
||||
version: '1.3.2',
|
||||
version: '1.3.3',
|
||||
description: 'An advanced TypeScript documentation tool using AI to generate and enhance documentation for TypeScript projects.'
|
||||
}
|
||||
|
@ -72,8 +72,6 @@ Also you are given a diff
|
||||
result.message.replace('```json', '').replace('```', '')
|
||||
);
|
||||
|
||||
// lets build the changelog based on that
|
||||
const commitMessages = await gitRepo.getAllCommitMessages();
|
||||
const previousChangelogPath = plugins.path.join(this.projectDir, 'changelog.md');
|
||||
let previousChangelog: plugins.smartfile.SmartFile;
|
||||
if (await plugins.smartfile.fs.fileExists(previousChangelogPath)) {
|
||||
@ -81,6 +79,8 @@ Also you are given a diff
|
||||
}
|
||||
|
||||
if (!previousChangelog) {
|
||||
// lets build the changelog based on that
|
||||
const commitMessages = await gitRepo.getAllCommitMessages();
|
||||
let result2 = await this.aiDocsRef.openaiInstance.chat({
|
||||
messageHistory: [],
|
||||
systemMessage: `
|
||||
@ -100,17 +100,20 @@ Only return the changelog file, so it can be written directly to changelog.md`,
|
||||
userMessage: `
|
||||
Here are the commit messages:
|
||||
|
||||
${commitMessages.join('\n')}
|
||||
${JSON.stringify(commitMessages, null, 2)}
|
||||
`,
|
||||
});
|
||||
|
||||
previousChangelog = await plugins.smartfile.SmartFile.fromString(previousChangelogPath, result2.message, 'utf8');
|
||||
|
||||
previousChangelog = await plugins.smartfile.SmartFile.fromString(
|
||||
previousChangelogPath,
|
||||
result2.message,
|
||||
'utf8'
|
||||
);
|
||||
}
|
||||
|
||||
let oldChangelog = previousChangelog.contents.toString().replace('# Changelog\n\n', '');
|
||||
let newDateString = new plugins.smarttime.ExtendedDate().exportToHyphedSortableDate();
|
||||
let newChangelog = `# Changelog\n\n${
|
||||
`## ${newDateString} - {{nextVersion}} - {{nextVersionScope}}
|
||||
let newChangelog = `# Changelog\n\n${`## ${newDateString} - {{nextVersion}} - {{nextVersionScope}}
|
||||
{{nextVersionMessage}}
|
||||
{{nextVersionDetails}}
|
||||
`}\n\n${oldChangelog}\n`;
|
||||
|
@ -49,7 +49,7 @@ 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}`);
|
||||
// console.log(` -> ${fileArg.relative}`);
|
||||
});
|
||||
return filesArg
|
||||
.map((smartfile) => {
|
||||
|
Reference in New Issue
Block a user