From cda6a88af9d26f15ae75659af1dd27fe7621aa67 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Wed, 18 Nov 2026 17:47:30 +0900 Subject: [PATCH] fix(landing): type the benchmark data by the fields the page reads The benchmark refresh after #1002 recorded client bytes in benchmark-results.json, so the frozen e2e fixture (clientBytes: null) no longer fits typeof live and landing-next-e2e fails its type check on every pull request. Co-Authored-By: Claude Opus 5.5 --- apps/landing/src/app/benchmark-data.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/apps/landing/src/app/benchmark-data.ts b/apps/landing/src/app/benchmark-data.ts index 2c8538018..50255d38e 100644 --- a/apps/landing/src/app/benchmark-data.ts +++ b/apps/landing/src/app/benchmark-data.ts @@ -12,5 +12,29 @@ import fixture from '../../../../e2e/fixtures/benchmark-results.json' export const BENCHMARK_SOURCE = process.env.LANDING_BENCHMARK_DATA === 'fixture' ? 'fixture' : 'live' -export const benchmarkResults: typeof live = +/** + * What the landing page reads of a benchmark-results.json. Both files fit it: + * the frozen fixture records no client bytes (`null`), while a live run does, + * so neither file's inferred type can stand for the other. + */ +export interface BenchmarkResults { + run: { + id: string + url: string + commit: string + next: string + devupUi: string + sha: string + } + samples: number + rows: readonly { + table: string + target: string + version: string + median: number + bytes: number + }[] +} + +export const benchmarkResults: BenchmarkResults = BENCHMARK_SOURCE === 'fixture' ? fixture : live