refakts
Version:
TypeScript refactoring tool built for AI coding agents to perform precise refactoring operations via command line instead of requiring complete code regeneration.
69 lines β’ 2.51 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoadmapDisplay = void 0;
class RoadmapDisplay {
showStatus(data) {
this.printHeader();
this.printAllFeatures(data);
this.printTopFeatures(data);
this.printLastUpdated(data);
}
printHeader() {
process.stdout.write('πΊοΈ RefakTS Roadmap Status\n');
process.stdout.write('='.repeat(50) + '\n');
}
printAllFeatures(data) {
const sortedFeatures = this.getSortedFeatures(data);
if (sortedFeatures.length === 0) {
process.stdout.write('\nπ No pending features - roadmap is clear!\n');
return;
}
this.printSortedFeatureList(sortedFeatures);
}
printSortedFeatureList(sortedFeatures) {
process.stdout.write('\nπ All Features (by votes):\n');
this.printFeatureList(sortedFeatures);
}
getSortedFeatures(data) {
return data.features.sort((a, b) => b.score - a.score);
}
printFeatureList(features) {
for (const feature of features) {
this.printFeature(feature);
}
}
printFeature(feature) {
const statusIcon = this.getStatusIcon(feature.status);
const deps = this.formatDependencies(feature.dependencies);
process.stdout.write(` ${statusIcon} ${feature.name} (${feature.score} votes)${deps}\n`);
process.stdout.write(` ${feature.description}\n`);
this.printWhyIfPresent(feature.why);
process.stdout.write('\n');
}
formatDependencies(dependencies) {
return dependencies ? ` (depends: ${dependencies.join(', ')})` : '';
}
printWhyIfPresent(why) {
if (why) {
process.stdout.write(` Why: ${why}\n`);
}
}
getStatusIcon(status) {
return status === 'completed' ? 'β
' :
status === 'in-progress' ? 'π' : 'π';
}
printTopFeatures(data) {
const topFeatures = data.features
.sort((a, b) => b.score - a.score)
.slice(0, 3);
process.stdout.write('π Top Voted Features:\n');
topFeatures.forEach((f, i) => {
process.stdout.write(` ${i + 1}. ${f.name} (${f.score} votes)\n`);
});
}
printLastUpdated(data) {
process.stdout.write(`\nπ
Last updated: ${new Date(data.lastUpdated).toLocaleDateString()}\n`);
}
}
exports.RoadmapDisplay = RoadmapDisplay;
//# sourceMappingURL=roadmap-display.js.map