From bdecaa4a57eb90e17a06358c008abff89c0bd014 Mon Sep 17 00:00:00 2001 From: Ewan Croft Date: Thu, 13 Aug 2026 04:56:22 +0100 Subject: [PATCH] feat(teal): migrate to production fm.teal lexicon with legacy fallbacks - Rename TEAL_LEXICON to production fm.teal.feed.play - Add TEAL_LEGACY_LEXICON and status lexicon constants - Update tourmaline and ui to use new lexicon constants --- packages/tourmaline/src/lib/server/scrobbles.ts | 9 ++++----- packages/tourmaline/src/routes/about/+page.svelte | 2 +- .../components/layout/main/card/MusicStatusCard.svelte | 2 +- packages/utils/src/config.ts | 5 ++++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/tourmaline/src/lib/server/scrobbles.ts b/packages/tourmaline/src/lib/server/scrobbles.ts index 3894b50..35bb9bd 100644 --- a/packages/tourmaline/src/lib/server/scrobbles.ts +++ b/packages/tourmaline/src/lib/server/scrobbles.ts @@ -1,9 +1,8 @@ -import { TEAL_LEXICON } from "@ewanc26/utils"; +import { TEAL_LEXICON, TEAL_LEGACY_LEXICON } from "@ewanc26/utils"; import { fetchRepoViaCAR } from "@ewanc26/croft-click-core"; import type { TealScrobble } from "$lib/types"; -const STABLE_TEAL_LEXICON = "fm.teal.feed.play"; -const TEAL_LEXICONS = [TEAL_LEXICON, STABLE_TEAL_LEXICON] as const; +const TEAL_LEXICONS = [TEAL_LEGACY_LEXICON, TEAL_LEXICON] as const; /** * Safely parse a playedTime value from an ATProto record. @@ -55,7 +54,7 @@ function deduplicationKey(record: { rkey: string; value: unknown }): string { record.value && typeof record.value === "object" ? { ...(record.value as Record), - $type: STABLE_TEAL_LEXICON, + $type: TEAL_LEXICON, } : record.value; @@ -122,7 +121,7 @@ export async function fetchScrobbleBatch( for (const record of records) { const key = deduplicationKey(record); const previous = uniqueRecords.get(key); - if (!previous || record.uri.includes(`/${STABLE_TEAL_LEXICON}/`)) { + if (!previous || record.uri.includes(`/${TEAL_LEXICON}/`)) { uniqueRecords.set(key, record); } } diff --git a/packages/tourmaline/src/routes/about/+page.svelte b/packages/tourmaline/src/routes/about/+page.svelte index 3606848..f186fba 100644 --- a/packages/tourmaline/src/routes/about/+page.svelte +++ b/packages/tourmaline/src/routes/about/+page.svelte @@ -211,7 +211,7 @@
  • Teal - — the fm.teal.alpha lexicon this tool reads from + — the fm.teal.feed.play lexicon this tool reads from
  • MusicBrainz diff --git a/packages/ui/src/lib/components/layout/main/card/MusicStatusCard.svelte b/packages/ui/src/lib/components/layout/main/card/MusicStatusCard.svelte index 9b33cab..3c0c916 100644 --- a/packages/ui/src/lib/components/layout/main/card/MusicStatusCard.svelte +++ b/packages/ui/src/lib/components/layout/main/card/MusicStatusCard.svelte @@ -52,7 +52,7 @@
    diff --git a/packages/utils/src/config.ts b/packages/utils/src/config.ts index 7a51c01..91ee6af 100644 --- a/packages/utils/src/config.ts +++ b/packages/utils/src/config.ts @@ -2,5 +2,8 @@ * Centralized configuration for lexicons and domain constants. */ -export const TEAL_LEXICON = 'fm.teal.alpha.feed.play'; +export const TEAL_LEXICON = 'fm.teal.feed.play'; +export const TEAL_LEGACY_LEXICON = 'fm.teal.alpha.feed.play'; +export const TEAL_STATUS_LEXICON = 'fm.teal.actor.status'; +export const TEAL_LEGACY_STATUS_LEXICON = 'fm.teal.alpha.actor.status'; export const CROFT_CLICK_DOMAIN = 'croft.click'; -- 2.51.2