Skip to content

feat(core): convert wakatime + top-languages fetchers to TypeScript - #410

Merged
martin-mfg merged 1 commit into
stats-organization:masterfrom
marcalexiei:core-ts
Jul 28, 2026
Merged

feat(core): convert wakatime + top-languages fetchers to TypeScript#410
martin-mfg merged 1 commit into
stats-organization:masterfrom
marcalexiei:core-ts

Conversation

@marcalexiei

Copy link
Copy Markdown

Another step of #140, continues #370.

  • wakatime fetcher + test ➡️ .ts. Typed the props object and the axios body (axios.get<{ data: WakaTimeData }>);
    replaced the raw err.response.status access with an axios.isAxiosError guard.
  • top-languages fetcher + test ➡️ .ts, calling retryer<TopLanguagesQueryResponse>(…).
    Split the single let repoNodes (reused across three shapes) into typed values and simplified two of the three reduce calls (map-builder → for…of, final sort ➡️ Object.fromEntries).
    The flatten reduce is kept as-is — its order feeds the repoCount logic.
  • types.ts: added count: number to Lang (the fetcher always produces it; the card only reads name/color/size).

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

@marcalexiei is attempting to deploy a commit to the martin-mfg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@martin-mfg
martin-mfg merged commit 259fc7c into stats-organization:master Jul 28, 2026
5 of 7 checks passed
martin-mfg pushed a commit that referenced this pull request Jul 29, 2026
Another step of #140, continues #410.

- `stats` fetcher + test ➡️ `.ts`, threading typed GraphQL and
REST-search shapes through `retryer<…>`.
- Added a `src/_github-username-regex.d.ts` shim (package ships no
types).
- Fixed a bug caught by the types: statsFetcher expected pat in its
options object,
  but the caller passed it as a second argument, so it was ignored. 
Private-access users' token is now correctly passed to the main stats
query.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants