Skip to content

Commit 91edd7d

Browse files
committed
Don’t recompute packages without types
1 parent e33adb4 commit 91edd7d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/history/scripts/generateFull.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ const datesFileName = new URL("../data/dates.json", import.meta.url);
4545
await downloadData();
4646
const existingDates: DatesJson = JSON.parse(await readFile(datesFileName, "utf8"));
4747
let bytesRead = 0;
48-
const seenResults = new Map<string, string>();
48+
const seenResults = new Map<string, [coreVersion: string, hasTypes: boolean]>();
4949
for (const date of dates) {
5050
const fh = await open(fullJsonFileName, "r");
5151
const start = bytesRead;
5252
bytesRead = (await fh.stat()).size;
5353
for await (const line of fh.readLines({ start })) {
5454
const result: FullJsonLine = JSON.parse(line);
55-
seenResults.set(result.packageSpec, result.coreVersion);
55+
seenResults.set(result.packageSpec, [result.coreVersion, !!result.analysis.types]);
5656
}
5757
await fh.close();
5858

@@ -92,7 +92,10 @@ for (const date of dates) {
9292
continue;
9393
}
9494
const existing = seenResults.get(`${pkg.packageName}@${pkg.packageVersion}`);
95-
if (!existing || major(existing) !== major(versions.core) || minor(existing) !== minor(versions.core)) {
95+
if (
96+
!existing ||
97+
(existing[1] && (major(existing[0]) !== major(versions.core) || minor(existing[0]) !== minor(versions.core)))
98+
) {
9699
work.push(pkg);
97100
}
98101
}

0 commit comments

Comments
 (0)