Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
5e2171dbfd | |||
70d4af653a | |||
06f6fdef98 | |||
b6fb7bf029 | |||
4c83725120 | |||
a060cd1a03 | |||
e8372effc7 | |||
571249705e | |||
927cd961fd | |||
63b4fcc232 | |||
4188ed7f24 | |||
1feddc6e85 | |||
499baebc18 | |||
01fc0d0c6e |
40
changelog.md
40
changelog.md
@ -1,4 +1,40 @@
|
||||
# Changelog
|
||||
|
||||
## 1.2.0
|
||||
feat(aidocs_classes): Enhance changelog generation by supporting complete generation in the absence of previous changelog files
|
||||
## 23.06.2024 - 1.3.2 - 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.
|
||||
|
||||
|
||||
```markdown
|
||||
## 2023-xx-xx - 1.3.1 - aidocs_classes
|
||||
Fix typo in INextCommitObject interface
|
||||
- Corrected a minor typo in the INextCommitObject interface for consistency.
|
||||
|
||||
## 2023-xx-xx - 1.3.0 - 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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.
|
||||
```
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@git.zone/tsdoc",
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.2",
|
||||
"private": false,
|
||||
"description": "An advanced TypeScript documentation tool using AI to generate and enhance documentation for TypeScript projects.",
|
||||
"type": "module",
|
||||
@ -39,6 +39,7 @@
|
||||
"@push.rocks/smartlog-destination-local": "^9.0.2",
|
||||
"@push.rocks/smartpath": "^5.0.18",
|
||||
"@push.rocks/smartshell": "^3.0.5",
|
||||
"@push.rocks/smarttime": "^4.0.6",
|
||||
"typedoc": "^0.26.0",
|
||||
"typescript": "^5.5.2"
|
||||
},
|
||||
|
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@ -47,6 +47,9 @@ importers:
|
||||
'@push.rocks/smartshell':
|
||||
specifier: ^3.0.5
|
||||
version: 3.0.5
|
||||
'@push.rocks/smarttime':
|
||||
specifier: ^4.0.6
|
||||
version: 4.0.6
|
||||
typedoc:
|
||||
specifier: ^0.26.0
|
||||
version: 0.26.0(typescript@5.5.2)
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tsdoc',
|
||||
version: '1.2.0',
|
||||
version: '1.3.2',
|
||||
description: 'An advanced TypeScript documentation tool using AI to generate and enhance documentation for TypeScript projects.'
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ export interface INextCommitObject {
|
||||
recommendedNextVersionLevel: 'fix' | 'feat' | 'BREAKING CHANGE'; // the recommended next version level of the project
|
||||
recommendedNextVersionScope: string; // the recommended scope name of the next version, like "core" or "cli", or specific class names.
|
||||
recommendedNextVersionMessage: string; // the commit message. Don't put fix() feat() or BREAKING CHANGE in the message. Please just the message itself.
|
||||
recommendedNextVersionDetails: string[]; // detailed bullet points for the changelog
|
||||
recommendedNextVersion: string; // the recommended next version of the project, x.x.x
|
||||
changelog?: string; // the changelog for the next version
|
||||
}
|
||||
@ -49,10 +50,12 @@ Important: Answer only in valid JSON.
|
||||
Your answer should be parseable with JSON.parse() without modifying anything.
|
||||
|
||||
Here is the structure of the JSON you should return:
|
||||
{
|
||||
|
||||
interface {
|
||||
recommendedNextVersionLevel: 'fix' | 'feat' | 'BREAKING CHANGE'; // the recommended next version level of the project
|
||||
recommendedNextVersionScope: string; // the recommended scope name of the next version, like "core" or "cli", or specific class names.
|
||||
recommendedNextVersionMessage: string; // the commit message. Don't put fix() feat() or BREAKING CHANGE in the message. Please just the message itself.
|
||||
recommendedNextVersionDetails: string[]; // detailed bullet points for the changelog
|
||||
recommendedNextVersion: string; // the recommended next version of the project, x.x.x
|
||||
}
|
||||
|
||||
@ -76,40 +79,43 @@ Also you are given a diff
|
||||
if (await plugins.smartfile.fs.fileExists(previousChangelogPath)) {
|
||||
previousChangelog = await plugins.smartfile.SmartFile.fromFilePath(previousChangelogPath);
|
||||
}
|
||||
|
||||
if (!previousChangelog) {
|
||||
let result2 = await this.aiDocsRef.openaiInstance.chat({
|
||||
messageHistory: [],
|
||||
systemMessage: `
|
||||
You are building a changelog file for the projext.
|
||||
You are building a changelog.md file for the project.
|
||||
Omit commits and versions that lack relevant changes.
|
||||
|
||||
You are given
|
||||
* the previous changelog file (if available)
|
||||
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:
|
||||
* the commit messages of the project
|
||||
|
||||
Only return the changelog file, so it can be written directly to changelog.md
|
||||
|
||||
For the latest version, that is not yet part of the commit messages, add a placeholder entry that uses {{nextVersion}} and {{nextVersionMessage}} as variables to filled later.
|
||||
Only output newer versions and their changes compared to ones already mentioned. We take of appending your output later.
|
||||
If there is no previous changelog file, generate a complete changelog from commit messages with heading and everything + the placeholder section mentioned above.
|
||||
`,
|
||||
Only return the changelog file, so it can be written directly to changelog.md`,
|
||||
userMessage: `
|
||||
The previous changelog file is:
|
||||
${!previousChangelog ? 'No previous changelog file found' : previousChangelog.contents.toString()}
|
||||
Here are the commit messages:
|
||||
|
||||
Here are the commit messages so far:
|
||||
|
||||
${commitMessages.join('\n\n')}
|
||||
${commitMessages.join('\n')}
|
||||
`,
|
||||
});
|
||||
if (previousChangelog) {
|
||||
let newChangelog = result2.message;
|
||||
newChangelog = newChangelog.replace('# Changelog\n\n', '');
|
||||
let oldChangelog = previousChangelog.contents.toString().replace('# Changelog\n\n', '');
|
||||
newChangelog = `# Changelog\n\n${newChangelog}\n\n${oldChangelog}`;
|
||||
resultObject.changelog = newChangelog;
|
||||
} else {
|
||||
resultObject.changelog = result2.message;
|
||||
|
||||
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}}
|
||||
{{nextVersionMessage}}
|
||||
{{nextVersionDetails}}
|
||||
`}\n\n${oldChangelog}\n`;
|
||||
resultObject.changelog = newChangelog;
|
||||
|
||||
return resultObject;
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,6 @@
|
||||
import { commitinfo } from './00_commitinfo_data.js';
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
export const logger = new plugins.smartlog.Smartlog({
|
||||
logContext: {
|
||||
company: 'Some Company',
|
||||
companyunit: 'Some CompanyUnit',
|
||||
containerName: 'Some Containername',
|
||||
environment: 'local',
|
||||
runtime: 'node',
|
||||
zone: 'gitzone',
|
||||
},
|
||||
minimumLogLevel: 'silly',
|
||||
});
|
||||
export const logger = plugins.smartlog.Smartlog.createForCommitinfo(commitinfo);
|
||||
|
||||
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
|
||||
|
@ -16,6 +16,7 @@ import * as smartlog from '@push.rocks/smartlog';
|
||||
import * as smartlogDestinationLocal from '@push.rocks/smartlog-destination-local';
|
||||
import * as smartpath from '@push.rocks/smartpath';
|
||||
import * as smartshell from '@push.rocks/smartshell';
|
||||
import * as smarttime from '@push.rocks/smarttime';
|
||||
|
||||
export {
|
||||
npmextra,
|
||||
@ -30,6 +31,7 @@ export {
|
||||
smartlogDestinationLocal,
|
||||
smartpath,
|
||||
smartshell,
|
||||
smarttime,
|
||||
};
|
||||
|
||||
// third party scope
|
||||
|
Reference in New Issue
Block a user