From f42ac4726857b2e6f7818c9bae841d2f4cc4c019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 27 Jun 2026 00:37:14 +0200 Subject: [PATCH] fix(insights): drop the undeclared server-only import from the coach-read builder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The builder is server-only by construction — only the metric-page route imports it and it reads Prisma — and no other module in the tree depends on the `server-only` package, so the import was both redundant and an undeclared dependency. Removing it keeps the dead-code gate clean without weakening the boundary. --- src/lib/insights/derived/coach-read.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/insights/derived/coach-read.ts b/src/lib/insights/derived/coach-read.ts index 4c62950bb..e7f72b5be 100644 --- a/src/lib/insights/derived/coach-read.ts +++ b/src/lib/insights/derived/coach-read.ts @@ -16,12 +16,11 @@ * nothing clears the existing floor the line is omitted entirely. * * Both inputs reuse the deterministic engines unchanged — no new statistics, - * no lowered floor. Server-only (Prisma reads). The DTO shapes + the pure - * selection helpers live in the client-safe `coach-read-shape.ts` sibling so - * the strip component and the unit test can share them without pulling Prisma. + * no lowered floor. Server-only by construction — only the metric-page + * route imports it, and it reads Prisma. The DTO shapes + the pure selection + * helpers live in the client-safe `coach-read-shape.ts` sibling so the strip + * component and the unit test can share them without pulling Prisma. */ -import "server-only"; - import type { MeasurementType } from "@/generated/prisma/client"; import { prisma } from "@/lib/db"; import {