From 2ada6246426d5320ae4c041cb50e1901c23d68a3 Mon Sep 17 00:00:00 2001 From: atharv96k Date: Wed, 27 May 2026 10:40:41 +0530 Subject: [PATCH] refactor(github): move achievement milestones to config file --- lib/github.ts | 3 +-- lib/svg/constants.ts | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/github.ts b/lib/github.ts index cbd49c01..0ec7ece4 100644 --- a/lib/github.ts +++ b/lib/github.ts @@ -4,6 +4,7 @@ import type { ContributionCalendar, ContributionDay } from '../types'; import { calculateStreak } from './calculate'; import { TTLCache } from './cache'; import { LANGUAGE_COLORS } from './svg/languageColors'; +import { CONTRIBUTION_MILESTONES, STREAK_MILESTONES } from './svg/constants'; interface GitHubRepo { stargazers_count: number; @@ -14,8 +15,6 @@ interface GitHubRepo { const MAX_RETRIES = 3; // Initial delay in ms; doubles on each retry. const BASE_DELAY_MS = 500; -const CONTRIBUTION_MILESTONES = [1, 10, 100, 250, 500, 1000]; -const STREAK_MILESTONES = [3, 7, 30, 100]; const GRAPHQL_TIMEOUT_MS = 8000; // 8s for GraphQL endpoint const REST_TIMEOUT_MS = 5000; // 5s for REST endpoints diff --git a/lib/svg/constants.ts b/lib/svg/constants.ts index 761af474..c0fa547f 100644 --- a/lib/svg/constants.ts +++ b/lib/svg/constants.ts @@ -12,3 +12,6 @@ export const FONT_MAP: Record = { fira: '"Fira Code", monospace', roboto: '"Roboto", sans-serif', }; + +export const CONTRIBUTION_MILESTONES = [1, 10, 100, 250, 500, 1000]; +export const STREAK_MILESTONES = [3, 7, 30, 100];