@crafter/skillkit 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/stats.ts +2 -1
package/package.json
CHANGED
package/src/commands/stats.ts
CHANGED
|
@@ -70,6 +70,7 @@ export async function runStats(): Promise<void> {
|
|
|
70
70
|
console.log(` ${bold(showAll ? "ALL SKILLS" : "TOP SKILLS")}\n`);
|
|
71
71
|
|
|
72
72
|
const maxCount = topSkills.length > 0 ? (topSkills[0]?.total ?? 1) : 1;
|
|
73
|
+
const maxNameLen = Math.max(16, ...topSkills.map((s) => s.skill_name.length));
|
|
73
74
|
const barWidth = 20;
|
|
74
75
|
|
|
75
76
|
for (const skill of topSkills) {
|
|
@@ -77,7 +78,7 @@ export async function runStats(): Promise<void> {
|
|
|
77
78
|
const filled = Math.round((skill.total / maxCount) * barWidth);
|
|
78
79
|
const bar = "█".repeat(filled);
|
|
79
80
|
const spark = sparkline(daily.map((d) => d.count));
|
|
80
|
-
const name = cyan(skill.skill_name.padEnd(
|
|
81
|
+
const name = cyan(skill.skill_name.padEnd(maxNameLen));
|
|
81
82
|
console.log(
|
|
82
83
|
` ${name} ${bar.padEnd(barWidth)} ${String(skill.total).padStart(4)} ${spark}`,
|
|
83
84
|
);
|