File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
scripts/sync-landing-schema Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ import { dirname, resolve } from "node:path"
55import { fetchRepoContributors } from "./fetch-repo-contributors.ts"
66
77type 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
917const __dirname = dirname ( fileURLToPath ( import . meta. url ) )
1018const 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 */
2733export 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 (
You can’t perform that action at this time.
0 commit comments