build(frontend)!: knip drops --production; plain knip stays

The production pass (7ed2ac4e, E32) asked "is this export used by what
ships?". No real hit: its only findings were 37 exports a test imports,
answered with 36 `@internal` JSDoc tags (E34 S2) — test-only exports, not
defects. Since then it has only ever asked for another tag. The tags go
with it (36, no longer read by anything), and so do the production-only
`!…!` exclusions in knip.jsonc and their register rows. Plain knip (unused
files, exports and dependencies) keeps running in the gate.
This commit is contained in:
2026-10-05 00:19:38 +02:00
parent 7e681e112e
commit 36653886d5
30 changed files with 12 additions and 68 deletions
-8
View File
@@ -58,7 +58,6 @@ export interface StatRow {
const DASH = "—";
// bits-per-second → "4.2 Mbps" / "820 kbps". Undefined/0 → dash (hls.js reports 0 before a level loads).
/** @internal exported for plexStats.test.ts */
export function fmtBitrate(bps: number | undefined, lang: string): string {
if (!bps || bps <= 0) return DASH;
if (bps >= 1_000_000) return `${formatDecimal(bps / 1_000_000, lang)} Mbps`;
@@ -66,14 +65,12 @@ export function fmtBitrate(bps: number | undefined, lang: string): string {
}
// Seconds of buffer ahead of the playhead → "12.3 sec" / "12,3 mp".
/** @internal exported for plexStats.test.ts */
export function fmtBufferSecs(s: number, lang: string): string {
if (!Number.isFinite(s) || s < 0) return DASH;
return formatUnit(s, "second", lang, 1);
}
// Dropped / total decoded frames, with a drop percentage once any frames have been decoded.
/** @internal exported for plexStats.test.ts */
export function fmtFrames(dropped: number, total: number, lang: string): string {
if (total <= 0) return DASH;
const pct = (dropped / total) * 100;
@@ -83,14 +80,12 @@ export function fmtFrames(dropped: number, total: number, lang: string): string
// Intrinsic decoded resolution. 0×0 means the browser hasn't decoded (or can't) — an honest dash,
// which is itself the tell for a not-yet-playable codec pre-transcode.
/** @internal exported for plexStats.test.ts */
export function fmtRes(w: number, h: number): string {
if (w <= 0 || h <= 0) return DASH;
return `${w}×${h}`;
}
// Seconds → m:ss (offsets/positions are small; hours are folded into minutes deliberately).
/** @internal exported for plexStats.test.ts */
export function fmtClock(s: number): string {
if (!Number.isFinite(s) || s < 0) return DASH;
const total = Math.floor(s);
@@ -100,7 +95,6 @@ export function fmtClock(s: number): string {
}
// hls.js active level → "2 / 4 · 1280×720" (1-based index for humans). Auto/unknown level → dash + count.
/** @internal exported for plexStats.test.ts */
export function fmtLevel(l: HlsLevelInfo | null): string {
if (!l || l.total <= 0) return DASH;
const idx = l.index >= 0 ? `${l.index + 1} / ${l.total}` : `auto / ${l.total}`;
@@ -109,7 +103,6 @@ export function fmtLevel(l: HlsLevelInfo | null): string {
}
// Video/audio codec from the active hls.js level (only HLS exposes them; direct play → dash).
/** @internal exported for plexStats.test.ts */
export function fmtCodec(video: string | undefined, audio: string | undefined): string {
const v = video?.split(".")[0] || null; // "avc1.640028" → "avc1"
const a = audio?.split(".")[0] || null;
@@ -122,7 +115,6 @@ export function fmtCodec(video: string | undefined, audio: string | undefined):
// "· HDR→SDR" tag when the GPU OpenCL tonemap path handled a 10-bit/HDR source ("transcode · GPU ·
// HDR→SDR"). Non-transcode modes (direct/remux) and an unknown encoder read as the bare mode. Raw tokens
// (not i18n'd), consistent with the other technical values in this overlay (e.g. transport "hls").
/** @internal exported for plexStats.test.ts */
export function fmtMode(
playable: string,
hwEncoder?: boolean | null,