fix(aidocs): correct smartconfig file handling and tighten TypeScript typings

This commit is contained in:
2026-05-09 12:34:16 +00:00
parent 5eed13258a
commit abe7717eed
11 changed files with 1027 additions and 881 deletions
+1 -1
View File
@@ -226,7 +226,7 @@ Analyze these changes and output the JSON commit message object.
const resultObject: INextCommitObject = JSON.parse(jsonString);
const previousChangelogPath = plugins.path.join(this.projectDir, 'changelog.md');
let previousChangelog: plugins.smartfile.SmartFile;
let previousChangelog: plugins.smartfile.SmartFile | undefined;
if (await plugins.fsInstance.file(previousChangelogPath).exists()) {
previousChangelog = await plugins.smartfileFactory.fromFilePath(previousChangelogPath);
}
+1 -1
View File
@@ -80,7 +80,7 @@ Don't wrap the JSON in \`\`\`json\`\`\` - just return the raw JSON object.
const files = await projectContext.gatherFiles();
// Update smartconfig.json
const smartconfigJson = files.smartfilesNpmextraJSON;
const smartconfigJson = files.smartfilesSmartconfigJSON;
const smartconfigJsonContent = JSON.parse(smartconfigJson.contents.toString());
smartconfigJsonContent['gitzone'].module.description = resultObject.description;
+3 -3
View File
@@ -26,7 +26,7 @@ export class ProjectContext {
plugins.path.join(this.projectDir, 'readme.hints.md'),
this.projectDir,
);
const smartfilesNpmextraJSON = await plugins.smartfileFactory.fromFilePath(
const smartfilesSmartconfigJSON = await plugins.smartfileFactory.fromFilePath(
plugins.path.join(this.projectDir, '.smartconfig.json'),
this.projectDir,
);
@@ -40,7 +40,7 @@ export class ProjectContext {
smartfilePackageJSON,
smartfilesReadme,
smartfilesReadmeHints,
smartfilesNpmextraJSON,
smartfilesSmartconfigJSON,
smartfilesMod,
smartfilesTest,
};
@@ -80,7 +80,7 @@ ${smartfile.contents.toString()}
files.smartfilePackageJSON,
files.smartfilesReadme,
files.smartfilesReadmeHints,
files.smartfilesNpmextraJSON,
files.smartfilesSmartconfigJSON,
...files.smartfilesMod,
...files.smartfilesTest,
]);
+1 -1
View File
@@ -20,7 +20,7 @@ export class Readme {
// First check legal info before introducing any cost
const projectContext = new ProjectContext(this.projectDir);
const smartconfigJson = JSON.parse(
(await projectContext.gatherFiles()).smartfilesNpmextraJSON.contents.toString()
(await projectContext.gatherFiles()).smartfilesSmartconfigJSON.contents.toString()
);
const legalInfo = smartconfigJson?.['tsdoc']?.legal;
if (!legalInfo) {