From 72c189dcecd095e31a62d4f2256997abec51760b Mon Sep 17 00:00:00 2001 From: Seungpyo1007 Date: Tue, 15 Sep 2026 11:22:22 +0900 Subject: [PATCH] feat(site): include CPU engineering samples in dataset growth The growth section's total, per-collection counts and newest point now add the satellite repo's catalog.json count. Earlier points are dump snapshots only, so the newest point shows the satellite as a step. Refs #19 --- site/src/scripts/techapi.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/site/src/scripts/techapi.js b/site/src/scripts/techapi.js index 71f41edf1735..934c6b82a115 100644 --- a/site/src/scripts/techapi.js +++ b/site/src/scripts/techapi.js @@ -231,6 +231,7 @@ function countUp(node, target, opts = {}) { gpus: "GPUs", cpus: "CPUs", brands: "Brands", + cpu_es: "CPU eng. samples", }; const shortLabel = { games: "games", @@ -245,6 +246,7 @@ function countUp(node, target, opts = {}) { gpus: "gpus", cpus: "cpus", brands: "brands", + cpu_es: "cpu eng. samples", }; const dumpPath = "site/public/v1/index.json"; const countRows = (manifest) => { @@ -465,7 +467,19 @@ function countUp(node, target, opts = {}) { renderHistory(points); } - getJSON("v1/index.json").then((manifest) => { + // Satellite repos are not in the dump; fold their current count into the + // latest snapshot so the total and the newest point include them. + // ponytail: current count only, no back-history until satellites publish one. + const withSatellites = (manifest) => + fetch("https://gettechapi.github.io/cpu-engineering-samples/catalog.json") + .then((r) => (r.ok ? r.json() : Promise.reject())) + .then((list) => { + manifest.collections = { ...manifest.collections, cpu_es: { count: list.length } }; + return manifest; + }) + .catch(() => manifest); + + getJSON("v1/index.json").then(withSatellites).then((manifest) => { renderSnapshot(manifest); return loadCommitHistory(manifest).catch(() => { chartEl.innerHTML = '
Growth chart unavailable
';