From 634d0b1f94e6127a17f82bccd50e3de66268e78a Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 15 Apr 2024 16:57:47 -0400 Subject: [PATCH] Add some comments to the major collator --- packages/api/src/major/major-collator.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/api/src/major/major-collator.ts b/packages/api/src/major/major-collator.ts index f586224e2..1ab56eaf4 100644 --- a/packages/api/src/major/major-collator.ts +++ b/packages/api/src/major/major-collator.ts @@ -31,7 +31,14 @@ async function fileExists( } // TODO: this code is quick and dirty but works. this should be replaced with some dry-er code later. +/** + * Iterates over the ./majors directory, collecting majors and adding them to + * the exported MAJORS and MAJOR_YEARS object/set respectively. It prioritizes + * parsed.commit.json files over parsed.initial.json files because _.commit._ + * files have been human-reviewed and _.initial._ files are raw scraper output. + */ async function collateMajors() { + // TODO: determine why these needed to be runtime imports (normal import statements didn't work here). const fs = await import("fs/promises"); const path = await import("path"); const years = (