Skip to content

chore: prune 6 dead exports in src/lib - #1296

Merged
Flotapponnier merged 1 commit into
devfrom
chore/audit-cleanup-dead-exports
Jul 18, 2026
Merged

chore: prune 6 dead exports in src/lib#1296
Flotapponnier merged 1 commit into
devfrom
chore/audit-cleanup-dead-exports

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Second pass from the audit. Only touches exports that were verified via grep across the FULL repo (src/, harnesses/, worker/, scripts/, packages/, benchmarks/) to have zero external consumers.

Fully deleted

  • MS_PER_SECOND, MS_PER_MINUTE, MS_PER_HOUR, MS_PER_DAY from time-constants.ts — never imported anywhere. SECONDS_PER_* counterparts stay (used by scales.ts).

Un-exported (still used internally, just no longer public)

  • FEATURED_SLUGS (search-featured.ts) — was aliasing ALL_SLUGS with no external consumer
  • CATEGORY_SLUG_BY_LABEL (categories.ts) — feeds only categorySlugFromLabel() one line below
  • ZENODO_CONCEPT_DOI + ZENODO_CONCEPT_URL (dataset-jsonld.ts) — only compose GLOBAL_DATASET_JSONLD and buildBenchDatasetJsonLd() in the same file
  • SeriesRingSchema (materialize/schema.ts) — only referenced by WorkerStateSchema type inference. The SeriesRing type export stays because worker/index.ts imports it.

Verified false positives from the audit (kept)

  • PM_VENUE_META, PERP_VENUE_META, PmVenueContext, PerpVenueContext, PERP_VENUES, HF_DATASET_URL, DATASET_LICENSE, CREATOR_PUBLISHER, CITABLE_JSON_URL, GLOBAL_DATASET_JSONLD, MAT_SCHEMA_VERSION, FRESH_MAX_MS, STALE_MAX_MS, WorkerStateSchema, MaterializedSnapshotSchema — all have real consumers (products pages, dataset JSON-LD builders, or the worker).

Test plan

  • bun run typecheck — clean
  • bun run validate — 75 specs valid

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).
@Flotapponnier
Flotapponnier merged commit b3beda1 into dev Jul 18, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant