@@ -3,7 +3,7 @@ import { parseDocument, isMap, isScalar, isSeq } from "yaml"
33
44const toolingPath = process . env . TOOLING_PATH
55 ? new URL ( process . env . TOOLING_PATH , `file://${ process . cwd ( ) } /` )
6- : new URL ( "../src/data/tooling .yaml" , import . meta. url )
6+ : new URL ( "../src/data/projects .yaml" , import . meta. url )
77const githubToken = process . env . GITHUB_TOKEN
88const githubApiBaseUrl =
99 process . env . GITHUB_API_BASE_URL ?? "https://api.github.com"
@@ -13,14 +13,14 @@ const document = parseDocument(source)
1313const projectsNode = document . get ( "projects" , true )
1414
1515if ( ! isSeq ( projectsNode ) ) {
16- throw new Error ( "tooling .yaml must include a projects array." )
16+ throw new Error ( "projects .yaml must include a projects array." )
1717}
1818
1919const repositoryNames = [ ]
2020
2121for ( const projectNode of projectsNode . items ) {
2222 if ( ! isMap ( projectNode ) ) {
23- throw new Error ( "Each project entry in tooling .yaml must be an object." )
23+ throw new Error ( "Each project entry in projects .yaml must be an object." )
2424 }
2525
2626 const repositoryName = readOptionalString ( projectNode . get ( "repository_name" ) )
@@ -31,7 +31,9 @@ for (const projectNode of projectsNode.items) {
3131}
3232
3333const uniqueRepositoryNames = Array . from ( new Set ( repositoryNames ) )
34- const metadataByRepository = await fetchRepositoryMetadata ( uniqueRepositoryNames )
34+ const metadataByRepository = await fetchRepositoryMetadata (
35+ uniqueRepositoryNames
36+ )
3537
3638let updatedProjectCount = 0
3739
@@ -58,7 +60,7 @@ for (const projectNode of projectsNode.items) {
5860
5961 if ( shouldSyncTagsFromGitHub ( projectNode ) ) {
6062 const nextTopics = metadata . topics . toSorted ( ( left , right ) =>
61- left . localeCompare ( right ) ,
63+ left . localeCompare ( right )
6264 )
6365 const currentTags = readStringArray ( projectNode . get ( "tags" ) )
6466
@@ -83,7 +85,7 @@ if (nextSource === source) {
8385await writeFile ( toolingPath , nextSource )
8486
8587console . log (
86- `Updated ${ updatedProjectCount } project entries across ${ uniqueRepositoryNames . length } repositories.` ,
88+ `Updated ${ updatedProjectCount } project entries across ${ uniqueRepositoryNames . length } repositories.`
8789)
8890
8991function readOptionalString ( value ) {
@@ -147,7 +149,7 @@ async function fetchRepositoryMetadata(repositoryNames) {
147149 batch . map ( async ( repositoryName ) => [
148150 repositoryName ,
149151 await fetchSingleRepositoryMetadata ( repositoryName ) ,
150- ] ) ,
152+ ] )
151153 )
152154
153155 for ( const [ repositoryName , metadata ] of entries ) {
@@ -175,7 +177,7 @@ async function fetchSingleRepositoryMetadata(repositoryName) {
175177 const details = await response . text ( )
176178
177179 throw new Error (
178- `Failed to fetch ${ repositoryName } : ${ response . status } ${ response . statusText } \n${ details } ` ,
180+ `Failed to fetch ${ repositoryName } : ${ response . status } ${ response . statusText } \n${ details } `
179181 )
180182 }
181183
0 commit comments