From c892f38d3c68a841de6d5fb350f2b1689bcfa263 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 14 Jan 2026 01:11:28 +0000 Subject: [PATCH] refactor(scripts): extract clawtributors types --- scripts/update-clawtributors.ts | 34 +-------------------------- scripts/update-clawtributors.types.ts | 33 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 33 deletions(-) create mode 100644 scripts/update-clawtributors.types.ts diff --git a/scripts/update-clawtributors.ts b/scripts/update-clawtributors.ts index 6511e3e41..b77777556 100644 --- a/scripts/update-clawtributors.ts +++ b/scripts/update-clawtributors.ts @@ -1,43 +1,11 @@ import { execSync } from "node:child_process"; import { readFileSync, writeFileSync } from "node:fs"; import { resolve } from "node:path"; +import type { ApiContributor, Entry, MapConfig, User } from "./update-clawtributors.types.js"; const REPO = "clawdbot/clawdbot"; const PER_LINE = 10; -type MapConfig = { - ensureLogins?: string[]; - displayName?: Record; - nameToLogin?: Record; - emailToLogin?: Record; - placeholderAvatar?: string; - seedCommit?: string; -}; - -type ApiContributor = { - login?: string; - html_url?: string; - avatar_url?: string; - name?: string; - email?: string; - contributions?: number; -}; - -type User = { - login: string; - html_url: string; - avatar_url: string; -}; - -type Entry = { - key: string; - login?: string; - display: string; - html_url: string; - avatar_url: string; - lines: number; -}; - const mapPath = resolve("scripts/clawtributors-map.json"); const mapConfig = JSON.parse(readFileSync(mapPath, "utf8")) as MapConfig; diff --git a/scripts/update-clawtributors.types.ts b/scripts/update-clawtributors.types.ts new file mode 100644 index 000000000..17b576523 --- /dev/null +++ b/scripts/update-clawtributors.types.ts @@ -0,0 +1,33 @@ +export type MapConfig = { + ensureLogins?: string[]; + displayName?: Record; + nameToLogin?: Record; + emailToLogin?: Record; + placeholderAvatar?: string; + seedCommit?: string; +}; + +export type ApiContributor = { + login?: string; + html_url?: string; + avatar_url?: string; + name?: string; + email?: string; + contributions?: number; +}; + +export type User = { + login: string; + html_url: string; + avatar_url: string; +}; + +export type Entry = { + key: string; + login?: string; + display: string; + html_url: string; + avatar_url: string; + lines: number; +}; +