Add analyzers, generators, and templates
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-02-01 01:02:31 +00:00
parent 323b3574e8
commit f4bf61181c

View File

@@ -0,0 +1,40 @@
import { TemplateData } from '../types';
export class JsonGenerator {
static generate(data: TemplateData): string {
return JSON.stringify(data, null, 2);
}
static generateSummary(data: TemplateData): object {
const { projectInfo, files, config, generatedAt } = data;
return {
generatedAt,
project: {
type: projectInfo.projectType.primaryLanguage,
languages: projectInfo.projectType.languages,
frameworks: projectInfo.projectType.frameworks,
buildTools: projectInfo.projectType.buildTools,
fileCount: projectInfo.fileCount,
},
dependencies: {
total: projectInfo.dependencies.total,
production: projectInfo.dependencies.direct.length,
development: projectInfo.dependencies.dev.length,
topDependencies: projectInfo.dependencies.direct
.slice(0, 10)
.map(d => d.name),
},
conventions: projectInfo.conventions
? {
naming: projectInfo.conventions.namingConvention,
importStyle: projectInfo.conventions.importStyle.style,
testingFramework: projectInfo.conventions.testingFramework,
codeStyle: projectInfo.conventions.codeStyle,
}
: null,
config,
sampleFiles: files.slice(0, 20),
};
}
}