From f03407ce7b498463ad1e6145bbb36d8227bcbedf Mon Sep 17 00:00:00 2001 From: Florent Tapponnier Date: Sat, 18 Jul 2026 19:15:22 +0200 Subject: [PATCH] chore: prune 6 dead exports in src/lib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deep-audit confirmed via grep across the full repo (src/, harnesses/, worker/, scripts/, packages/): Fully deleted (0 refs anywhere): - src/lib/time-constants.ts: MS_PER_SECOND, MS_PER_MINUTE, MS_PER_HOUR, MS_PER_DAY — never imported. SECONDS_PER_* stay (used by scales.ts). Un-exported (only used internally in their own file): - src/lib/search-featured.ts: FEATURED_SLUGS re-exported ALL_SLUGS but the alias itself had no external consumer. - src/lib/categories.ts: CATEGORY_SLUG_BY_LABEL feeds only categorySlugFromLabel() one line below. - src/lib/dataset-jsonld.ts: ZENODO_CONCEPT_DOI and ZENODO_CONCEPT_URL are only used to compose GLOBAL_DATASET_JSONLD and buildBenchDatasetJsonLd() in the same file. - src/lib/materialize/schema.ts: SeriesRingSchema is only referenced by WorkerStateSchema's type inference (the SeriesRing type export stays — worker/index.ts imports it). --- src/lib/categories.ts | 2 +- src/lib/dataset-jsonld.ts | 4 ++-- src/lib/materialize/schema.ts | 2 +- src/lib/search-featured.ts | 5 +++-- src/lib/time-constants.ts | 16 ++++------------ 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/lib/categories.ts b/src/lib/categories.ts index 091bde4e..2f810b43 100644 --- a/src/lib/categories.ts +++ b/src/lib/categories.ts @@ -114,7 +114,7 @@ export const CATEGORY_BY_SLUG: ReadonlyMap = new Map( CATEGORIES.map((c) => [c.slug, c]), ); -export const CATEGORY_SLUG_BY_LABEL: ReadonlyMap = new Map( +const CATEGORY_SLUG_BY_LABEL: ReadonlyMap = new Map( CATEGORIES.map((c) => [c.label, c.slug]), ); diff --git a/src/lib/dataset-jsonld.ts b/src/lib/dataset-jsonld.ts index 6db08662..4fc9f445 100644 --- a/src/lib/dataset-jsonld.ts +++ b/src/lib/dataset-jsonld.ts @@ -27,8 +27,8 @@ export const HF_DATASET_URL = /** Concept DOI for the dataset on Zenodo. Always resolves to the latest * version. New version DOIs are minted automatically when we push a * new git tag of the form `vX.Y.Z-dataset`. */ -export const ZENODO_CONCEPT_DOI = "10.5281/zenodo.20800311"; -export const ZENODO_CONCEPT_URL = `https://doi.org/${ZENODO_CONCEPT_DOI}`; +const ZENODO_CONCEPT_DOI = "10.5281/zenodo.20800311"; +const ZENODO_CONCEPT_URL = `https://doi.org/${ZENODO_CONCEPT_DOI}`; /** Latest parquet headlines snapshot via Hugging Face's auto-converted * parquet API. The repo itself only holds dated partitions diff --git a/src/lib/materialize/schema.ts b/src/lib/materialize/schema.ts index 9655f706..b722b841 100644 --- a/src/lib/materialize/schema.ts +++ b/src/lib/materialize/schema.ts @@ -69,7 +69,7 @@ export function freshnessOf(meta: StalenessMeta | undefined, now = Date.now()): * display values carry forward separately via StalenessMeta. Cadences * mirror the live loader: 24h = 72 pts @ 20 min, 7d = 84 pts @ 2 h, * 30d = 60 pts @ 12 h. */ -export const SeriesRingSchema = z.object({ +const SeriesRingSchema = z.object({ /** Epoch ms of points[0]. */ startEpoch: z.number(), stepSec: z.number(), diff --git a/src/lib/search-featured.ts b/src/lib/search-featured.ts index 8345d860..98b8cade 100644 --- a/src/lib/search-featured.ts +++ b/src/lib/search-featured.ts @@ -86,8 +86,9 @@ export async function buildFeaturedLeaders(): Promise { }; } -/** Exported for the public endpoint + the dialog's TS type. */ -export const FEATURED_SLUGS = ALL_SLUGS; +// FEATURED_SLUGS previously re-exported ALL_SLUGS but had zero +// external consumers. ALL_SLUGS stays used internally by +// buildFeaturedLeaders below. /** * Worker-safe variant of `buildFeaturedLeaders`. Reads each of the 12 diff --git a/src/lib/time-constants.ts b/src/lib/time-constants.ts index 1a3f41bb..e80518de 100644 --- a/src/lib/time-constants.ts +++ b/src/lib/time-constants.ts @@ -1,20 +1,12 @@ /** * Shared time-unit constants. * - * Single source of truth for the milliseconds / seconds conversions that - * leak across files as magic numbers (86400, 60_000, 3_600_000, ...). - * Importing from here makes the intent obvious at the call site and - * keeps grep-ability if a duration unit ever has to change. - * - * Naming convention mirrors the unit-of-measure that the constant - * EXPANDS into (MS_PER_MINUTE === 60_000 milliseconds in one minute). + * Single source of truth for the seconds conversions that leak across + * files as magic numbers (86400, 60, 3600). Importing from here makes + * the intent obvious at the call site and keeps grep-ability if a + * duration unit ever has to change. */ -export const MS_PER_SECOND = 1_000; -export const MS_PER_MINUTE = 60_000; -export const MS_PER_HOUR = 3_600_000; -export const MS_PER_DAY = 86_400_000; - export const SECONDS_PER_MINUTE = 60; export const SECONDS_PER_HOUR = 3_600; export const SECONDS_PER_DAY = 86_400;