π§© Background
getFullDashboardData in lib/github.ts is ~120 lines handling profile mapping, language aggregation, developer score, insights, achievements, and commit clock β all in one function. This makes it hard to test or reuse individual parts.
π― Objective
Extract at least three pure helpers:
buildProfileData(profileData, totalStars, developerScore)
aggregateLanguages(repos)
buildInsights(streakStats, languages)
π Files to touch
π οΈ Implementation steps
- Extract each helper, keeping existing tests green.
- Export helpers for unit-testability.
- Add at least one focused test per helper in
lib/github.test.ts.
β
Definition of done
π§© Background
getFullDashboardDatainlib/github.tsis ~120 lines handling profile mapping, language aggregation, developer score, insights, achievements, and commit clock β all in one function. This makes it hard to test or reuse individual parts.π― Objective
Extract at least three pure helpers:
buildProfileData(profileData, totalStars, developerScore)aggregateLanguages(repos)buildInsights(streakStats, languages)π Files to touch
lib/github.tsπ οΈ Implementation steps
lib/github.test.ts.β Definition of done
getFullDashboardDatais β€60 lines.