From 0e9c5f1a0099eab04f604cd110a9b3a236da0c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 23 Aug 2026 18:58:14 +0200 Subject: [PATCH] Drop unimported re-exports outside the barrels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eighteen modules carried a convenience re-export of a symbol defined elsewhere. In each case the callers the comment describes now import the concrete module directly, so the line had no importer left. Where the whole re-export block went, the comment explaining it went with it — doctor-report-pdf-core, trend-card and medication-extract-prompt each claimed to be a single import surface that nothing was using. Definitions are untouched; imports that existed only to feed a removed re-export go too. --- src/components/charts/trend-card.tsx | 6 ------ src/components/insights/coach-panel/use-coach.ts | 2 -- src/components/medications/wizard/wizard-payload.ts | 7 ++----- src/lib/ai/coach/about-me.ts | 2 -- src/lib/ai/coach/medication-extract-prompt.ts | 7 ------- src/lib/ai/coach/snapshot-freshness.ts | 7 +------ src/lib/auth/invite-token.ts | 2 -- src/lib/auth/oidc-native-handoff.ts | 6 ------ src/lib/crypto/encryption-corpus.ts | 3 --- src/lib/cycle/custom-symptoms.ts | 2 -- src/lib/doctor-report-pdf-core.ts | 8 +------- src/lib/fhir/lab-loinc.ts | 3 --- src/lib/insights/derived/coach-read.ts | 7 +------ src/lib/insights/mood-aggregates.ts | 6 +----- src/lib/insights/status-provider.ts | 3 --- src/lib/report-selection/saved-profile.ts | 7 ------- src/lib/tz/resolver.ts | 1 - src/lib/validations/labs.ts | 3 --- 18 files changed, 6 insertions(+), 76 deletions(-) diff --git a/src/components/charts/trend-card.tsx b/src/components/charts/trend-card.tsx index fe0e873be..63d4bbfcf 100644 --- a/src/components/charts/trend-card.tsx +++ b/src/components/charts/trend-card.tsx @@ -15,14 +15,8 @@ import { getTrendSentiment, sentimentColorClass, type TrendDirectionSentiment, - type TrendSentimentDirection, } from "@/lib/insights/trend-sentiment"; -// v1.9.0 — the metric-aware sentiment mapping moved to a shared module so the -// range-delta caption paints the same colour for the same signal. Re-exported -// here so existing `@/components/charts/trend-card` importers keep the type. -export type { TrendDirectionSentiment, TrendSentimentDirection }; - interface SecondaryMetric { /** Sub-value latest reading (e.g. diastolic when latest is systolic). */ latest: number | null; diff --git a/src/components/insights/coach-panel/use-coach.ts b/src/components/insights/coach-panel/use-coach.ts index 532d58f60..a08d4a325 100644 --- a/src/components/insights/coach-panel/use-coach.ts +++ b/src/components/insights/coach-panel/use-coach.ts @@ -13,7 +13,6 @@ import { toast } from "sonner"; import type { CoachConversationAttachmentDTO, CoachConversationDetailDTO, - CoachConversationDTO, CoachConversationsPage, CoachProvenance, CoachScope, @@ -1118,7 +1117,6 @@ export function useSendCoachMessage(opts: UseSendCoachMessageOptions = {}) { // `@/lib/ai/coach/types` directly. export type { CoachConversationAttachmentDTO, - CoachConversationDTO, CoachConversationDetailDTO, CoachProvenance, CoachSuggestion, diff --git a/src/components/medications/wizard/wizard-payload.ts b/src/components/medications/wizard/wizard-payload.ts index 7413270a9..55ca08a23 100644 --- a/src/components/medications/wizard/wizard-payload.ts +++ b/src/components/medications/wizard/wizard-payload.ts @@ -44,10 +44,7 @@ */ import { encodeCadence } from "@/components/medications/scheduling/cadence-picker"; -import { - dateToIsoString, - isoStringToDate, -} from "@/components/medications/scheduling/course-window-row"; +import { dateToIsoString } from "@/components/medications/scheduling/course-window-row"; import { type CadenceKind, type CadenceSubControls, @@ -1277,4 +1274,4 @@ function subControlsFromRrule(rrule: string): CadenceSubControls { // Re-exports — convenience for the dialog and tests // ──────────────────────────────────────────────────────────────────── -export { dateToIsoString, isoStringToDate }; +export { dateToIsoString }; diff --git a/src/lib/ai/coach/about-me.ts b/src/lib/ai/coach/about-me.ts index 24c514cc8..31cf2ffa7 100644 --- a/src/lib/ai/coach/about-me.ts +++ b/src/lib/ai/coach/about-me.ts @@ -42,8 +42,6 @@ import { } from "@/lib/validations/health-profile-facts"; import { decryptHealthProfileFactValue } from "@/lib/profile/health-facts"; -export { ABOUT_ME_MAX_CHARS } from "@/lib/validations/about-me"; - export interface SelfContext { aboutMe: string | null; conditions: string | null; diff --git a/src/lib/ai/coach/medication-extract-prompt.ts b/src/lib/ai/coach/medication-extract-prompt.ts index c5858d08c..2132c0573 100644 --- a/src/lib/ai/coach/medication-extract-prompt.ts +++ b/src/lib/ai/coach/medication-extract-prompt.ts @@ -90,13 +90,6 @@ export type MedicationExtractionResult = z.infer< typeof medicationExtractionSchema >; -/** - * Re-export the wizard `CadenceKind` + `WeekdayToken` types so callers - * (the route, the tests) import a single module rather than chasing - * the wizard types directory. - */ -export type { CadenceKind, WeekdayToken }; - /** * Build the system prompt. Same shape across calls — the model only * sees the user's free text via `buildUserPrompt()`. The system prompt diff --git a/src/lib/ai/coach/snapshot-freshness.ts b/src/lib/ai/coach/snapshot-freshness.ts index 7f27fe8e7..09cf91dc8 100644 --- a/src/lib/ai/coach/snapshot-freshness.ts +++ b/src/lib/ai/coach/snapshot-freshness.ts @@ -26,10 +26,7 @@ * * Pure and in-place — the snapshot is a plain record by the time it gets here. */ -import { - TODAY_CLAIM_MAX_AGE_DAYS, - isCurrentForTodayClaim, -} from "@/lib/insights/measurement-freshness"; +import { isCurrentForTodayClaim } from "@/lib/insights/measurement-freshness"; /** When a metric block's series actually ends, and what may be said about it. */ export interface SnapshotAsOf { @@ -187,5 +184,3 @@ export function annotateSnapshotFreshness(snapshot: Record): { } return { stale, coarseWithheld }; } - -export { TODAY_CLAIM_MAX_AGE_DAYS }; diff --git a/src/lib/auth/invite-token.ts b/src/lib/auth/invite-token.ts index ecc15be0b..2916cb20d 100644 --- a/src/lib/auth/invite-token.ts +++ b/src/lib/auth/invite-token.ts @@ -20,8 +20,6 @@ import { randomBytes } from "node:crypto"; import { prisma } from "@/lib/db"; import { hashToken } from "@/lib/auth/hmac"; -export { INVITE_MAX_TTL_DAYS } from "@/lib/validations/invite"; - /** Raw-token prefix — distinct from `hlk_` (API) and `hlr_` (refresh). */ export const INVITE_TOKEN_PREFIX = "hlv_"; diff --git a/src/lib/auth/oidc-native-handoff.ts b/src/lib/auth/oidc-native-handoff.ts index 35fec970c..c2d9076cc 100644 --- a/src/lib/auth/oidc-native-handoff.ts +++ b/src/lib/auth/oidc-native-handoff.ts @@ -44,13 +44,7 @@ export function buildNativeCallbackUrl(params: Record): string { // Re-export the shared mint/consume core so the OIDC callback + token route // keep importing from here unchanged. export { - HANDOFF_CODE_PREFIX, mintNativeHandoff, consumeNativeHandoff, stampIssuedRefreshToken, } from "@/lib/auth/native-handoff"; -export type { - HandoffFlow, - MintedHandoff, - ConsumeHandoffResult, -} from "@/lib/auth/native-handoff"; diff --git a/src/lib/crypto/encryption-corpus.ts b/src/lib/crypto/encryption-corpus.ts index 4230770eb..cadeee22d 100644 --- a/src/lib/crypto/encryption-corpus.ts +++ b/src/lib/crypto/encryption-corpus.ts @@ -40,7 +40,6 @@ import { } from "@/lib/crypto"; import { ENCRYPTED_COLUMNS, - encryptedColumnKey, type EncryptedColumn, } from "@/lib/crypto/encrypted-columns"; @@ -381,5 +380,3 @@ export async function rotateCorpus( totalErrors, }; } - -export { encryptedColumnKey }; diff --git a/src/lib/cycle/custom-symptoms.ts b/src/lib/cycle/custom-symptoms.ts index 7435d731a..fcfd4bd66 100644 --- a/src/lib/cycle/custom-symptoms.ts +++ b/src/lib/cycle/custom-symptoms.ts @@ -26,10 +26,8 @@ import { CUSTOM_SYMPTOM_KEY_PREFIX } from "@/lib/cycle/custom-symptoms-shared"; export { CUSTOM_SYMPTOM_KEY_PREFIX, - CUSTOM_SYMPTOM_CATEGORY_KEY, CUSTOM_SYMPTOM_CATEGORY_ID, MAX_CUSTOM_SYMPTOMS_PER_USER, - CUSTOM_SYMPTOM_ICON_ALLOWLIST, isCustomSymptomKey, createCustomSymptomSchema, updateCustomSymptomSchema, diff --git a/src/lib/doctor-report-pdf-core.ts b/src/lib/doctor-report-pdf-core.ts index f5e79a422..d193958ad 100644 --- a/src/lib/doctor-report-pdf-core.ts +++ b/src/lib/doctor-report-pdf-core.ts @@ -18,7 +18,7 @@ import { isStructuredLeafId, REPORT_GROUPS, } from "./report-selection/catalogue"; -import { MEASUREMENT_TYPE_LABEL_KEYS } from "./measurements/type-label-keys"; + import { getUnitForType } from "./validations/measurement"; import { makeFormatters, @@ -166,12 +166,6 @@ export interface DoctorReportRenderOptions { includeCharts?: boolean; } -// Per-type label keys live in a lucide-free module so leaf consumers — the -// public clinician share view, this renderer — can import the map without -// dragging icon components into their graph. Re-exported here so the PDF core -// stays the single import surface its existing callers already use. -export { MEASUREMENT_TYPE_LABEL_KEYS }; - export const DOCTOR_REPORT_TYPE_UNIT_KEYS: Record = { WEIGHT: "kg", BLOOD_PRESSURE_SYS: "mmHg", diff --git a/src/lib/fhir/lab-loinc.ts b/src/lib/fhir/lab-loinc.ts index 0e748d0f9..d9e883349 100644 --- a/src/lib/fhir/lab-loinc.ts +++ b/src/lib/fhir/lab-loinc.ts @@ -37,12 +37,9 @@ * to show a biomarker's name resolves it through the labs catalog instead. */ -import { LOINC_SYSTEM, UCUM_SYSTEM } from "@/lib/fhir/loinc-map"; import { localisedValues } from "@/lib/i18n/shared-resolve"; import { stripDiacritics } from "@/lib/i18n/fold-for-match"; -export { LOINC_SYSTEM, UCUM_SYSTEM }; - /** A curated biomarker → LOINC + canonical-UCUM entry. */ export interface LabLoincMapping { loinc: string; diff --git a/src/lib/insights/derived/coach-read.ts b/src/lib/insights/derived/coach-read.ts index 346df7bae..7467e1f98 100644 --- a/src/lib/insights/derived/coach-read.ts +++ b/src/lib/insights/derived/coach-read.ts @@ -39,12 +39,7 @@ import { type CoachReadStripData, } from "@/lib/insights/derived/coach-read-shape"; -export type { - CoachReadBaseline, - CoachReadDriver, - CoachReadStripData, - CoachReadBaselinePlacement, -} from "@/lib/insights/derived/coach-read-shape"; +export type { CoachReadStripData } from "@/lib/insights/derived/coach-read-shape"; /** * Read the latest reading for `(userId, type)` — the value the strip places diff --git a/src/lib/insights/mood-aggregates.ts b/src/lib/insights/mood-aggregates.ts index 985b998ea..f829df5f6 100644 --- a/src/lib/insights/mood-aggregates.ts +++ b/src/lib/insights/mood-aggregates.ts @@ -39,11 +39,7 @@ import { computeMoodDimensionSeries, type MoodDimensionSummary, } from "@/lib/insights/mood-dimension-series"; -export { - computeMoodDimensionSeries, - type MoodDimensionPoint, - type MoodDimensionSummary, -} from "@/lib/insights/mood-dimension-series"; +export { type MoodDimensionSummary } from "@/lib/insights/mood-dimension-series"; import { resolveUserTimezone } from "@/lib/tz/resolver"; import { annotate } from "@/lib/logging/context"; import { createCustomLabelResolver } from "@/lib/mood/custom-tags"; diff --git a/src/lib/insights/status-provider.ts b/src/lib/insights/status-provider.ts index 8f36e8a1d..f30a7b36a 100644 --- a/src/lib/insights/status-provider.ts +++ b/src/lib/insights/status-provider.ts @@ -1,6 +1,5 @@ import { resolveProvider, resolveProviderChain } from "@/lib/ai/provider"; import { - AllProvidersFailedError, runRawCompletionWithFallback, type ProviderChainResolved, } from "@/lib/ai/provider-runner"; @@ -299,5 +298,3 @@ export async function runStatusCompletion( tokensUsed: result.tokensUsed ?? null, }; } - -export { AllProvidersFailedError }; diff --git a/src/lib/report-selection/saved-profile.ts b/src/lib/report-selection/saved-profile.ts index 987c2c02c..c23988809 100644 --- a/src/lib/report-selection/saved-profile.ts +++ b/src/lib/report-selection/saved-profile.ts @@ -26,13 +26,6 @@ import { type ReportSelection, } from "./selection"; -export { - savedReportProfileSchema, - parseSavedProfile, - SAVED_PROFILE_FALLBACK, - type SavedReportProfile, -} from "./profile-shape"; - /** * Resolve the owner's saved selection. * diff --git a/src/lib/tz/resolver.ts b/src/lib/tz/resolver.ts index a51feb7a8..1835432d5 100644 --- a/src/lib/tz/resolver.ts +++ b/src/lib/tz/resolver.ts @@ -49,7 +49,6 @@ export { formatInUserTz, userDayKey, hourInTz, - type FormatInUserTzShape, } from "./format"; const BERLIN_DAY_FORMATTER = new Intl.DateTimeFormat("en-US", { diff --git a/src/lib/validations/labs.ts b/src/lib/validations/labs.ts index 8a1b7c6bc..d7c2ea3c3 100644 --- a/src/lib/validations/labs.ts +++ b/src/lib/validations/labs.ts @@ -307,10 +307,7 @@ export type ListLabResultsInput = z.infer; * implementation. Re-exported here for the existing import sites. */ export { - classifyAgainstEffectiveRange, classifyReferenceRange, - formatReferenceRange, - resolveEffectiveReferenceRange, type EffectiveReferenceRange, type ReferenceRangeOrigin, type ReferenceRangeStatus,