fix(aidocs_classes): Refactor and enhance changelog formatting

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

View File

@ -1,54 +1,41 @@
# Changelog
## 2024-06-23 - 1.3.4 - fix(aidocs_classes)
Fix changelog formatting issue in commit class
- Adjusted formatting in the template for the changelog in `commit.ts`.
- Ensured proper line spacing for readability and consistency.
## 2024-06-23 - 1.3.5 - fix(aidocs_classes)
Refactor and enhance changelog formatting
- Updated the `commit.ts` file to improve the changelog formatting and ensure consistency.
- Enhanced the changelog instructions to include summarizing messages for omitted commits.
- Removed unnecessary console logging in `projectcontext.ts`.
```markdown
## 2024-06-23 - 1.3.3 - fix(aidocs_classes)
Fix changelog formatting issue in commit class
## 2024-06-23 - 1.3.2 - fix(aidocs_classes)
Fix minor bugs and update dependencies in aidocs_classes
- Fixed typo in INextCommitObject interface within the aidocs_classes.
- Updated date format in changelog generation from European format to hyphened sortable format.
- Updated @push.rocks/smartgit dependency from version 3.0.4 to 3.1.0.
- Updated typedoc dependency from version 0.26.0 to 0.26.1.
- Improved commit message generation by adding handling for empty diffs and updating changelog instructions.
## 23.06.2024 - 1.3.2 - fix(aidocs_classes)
## 2024-06-23 - 1.3.1 - fix(aidocs_classes)
Fix typo in INextCommitObject interface and update date format in changelog generation.
- Corrected typo in INextCommitObject interface within the aidocs_classes directory.
- Updated date format in changelog generation from European format to hyphened sortable format.
## 2023-xx-xx - 1.3.1 - aidocs_classes
## 2024-06-23 - 1.3.0 - fix(aidocs_classes)
Fix typo in INextCommitObject interface
- Corrected a minor typo in the INextCommitObject interface for consistency.
## 2023-xx-xx - 1.3.0 - core
## 2024-06-23 - 1.2.4 - feat(core)
Added smarttime dependency and improved changelog generation
- Introduced smarttime dependency to the core module.
- Enhanced changelog generation to be more efficient.
## 2023-xx-xx - 1.2.4 - logging
## 2024-06-23 - 1.2.3 - fix(logging)
Refactor logger initialization to use commitinfo data
- Logger initialization now utilizes commitinfo data for better context and accuracy.
## 2023-xx-xx - 1.2.3 - aidocs
## 2024-06-23 - 1.2.2 - fix(aidocs)
Fix bug in AiDoc class causing undefined token handling
- Resolved an issue in the AiDoc class where undefined tokens were not being handled correctly.
## 2023-xx-xx - 1.2.1 - core
## 2024-06-23 - 1.2.0 - fix(core)
Fixed usage of plugins in project context and readme generation
- Improved the usage of plugins within the project context.
- Fixed issues related to README.md generation.
## 2023-xx-xx - 1.2.0 - aidocs_classes
## 2024-06-23 - 1.1.42 - feat(aidocs_classes)
Enhance changelog generation by supporting complete generation in the absence of previous changelog files
- Updated changelog generation to support complete generation even when previous changelog files are absent.
## 2023-xx-xx - 1.1.42 - aidoc_classes
## 2024-06-23 - 1.1.41 - fix(aidocs_classes)
Improve commit message generation by handling empty diffs and updating changelog instructions
- Enhanced commit message generation to handle empty diffs.
- Updated instructions for changelog generation for better clarity.
```

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}`);
});