Skip to content

Commit 8a2c76c

Browse files
committed
wip
1 parent def1375 commit 8a2c76c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

scripts/sync-landing-schema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "./src/index.ts",
66
"scripts": {
77
"codegen": "gql-gen --config graphql-codegen.ts",
8-
"start": "node ./src/index.ts"
8+
"start": "node src/index.ts"
99
},
1010
"dependencies": {
1111
"@graphql-codegen/cli": "^6.0.0",

scripts/sync-landing-schema/src/index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ import { dirname, resolve } from "node:path"
55
import { fetchRepoContributors } from "./fetch-repo-contributors.ts"
66

77
type RepoRef = `${string}/${string}`
8+
interface Contributor {
9+
id: string
10+
website?: string
11+
contributions: number
12+
}
13+
type ContributorsForProjects = {
14+
[projectName: string]: Contributor[]
15+
}
816

917
const __dirname = dirname(fileURLToPath(import.meta.url))
1018
const outPath = resolve(__dirname, "data.json")
@@ -21,14 +29,10 @@ export const REPO_TO_PROJECT: Record<RepoRef, string> = {
2129
* - Uses GitHub GraphQL API (v4) with a personal access token in env GITHUB_ACCESS_TOKEN
2230
* - Aggregates contributors across multiple repos that map to the same project
2331
* - Sorts contributors per project by contributions (desc)
24-
*
25-
* Returns a map: { [projectName]: Array<{ id, website?, contributions }> }
2632
*/
2733
export async function getContributors(
2834
repoToProject: Record<RepoRef, string> = REPO_TO_PROJECT,
29-
): Promise<
30-
Record<string, Array<{ id: string; website?: string; contributions: number }>>
31-
> {
35+
): Promise<ContributorsForProjects> {
3236
const accessToken = process.env.GITHUB_ACCESS_TOKEN
3337
if (!accessToken) {
3438
console.warn(

0 commit comments

Comments
 (0)