Files
petvity/lib/development/records.ts
T
CatoandClaude cf6912e957 feat(records): public roadmap and changelog, from the repo through the fleet map (#103)
The fleet's building-in-public contract puts each product's record in its
own repository as two markdown files and renders it through Loki's fleet map
via bip-kit. Petvity had neither the files nor the pages.

- ROADMAP.md: Now / Next / Later / Shipped, derived from the phases in
  AGENTS.md and the merged history. Planned work is written as plans.
- CHANGELOG.md: Keep-a-Changelog dialect, user-facing, newest first, from
  merged PRs; today's homepage rewrite is the top entry.
- /[locale]/roadmap and /[locale]/changelog render bip-kit's DevelopmentPage
  inside the marketing nav/footer; the records are English by contract, the
  chrome and metadata stay localized (keys in all 9 locales, footer links).
- lib/config/development.ts is the SSOT for the map URL, slug and profile;
  lib/development/records.ts fetches with revalidate 300 and an 8s ceiling.
- The --bp-* theme scope already mapped for the blog (.pv-longform) covers
  the records; the page title and record name take the editorial faces.
- Vitest covers the data path with a fleet-map fixture, no network.
- Sitemap lists both pages.

Verified at 390px in de/en/ar: no horizontal overflow.


Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 04:09:11 -07:00

25 lines
1.0 KiB
TypeScript

import { loadDevelopmentProfile } from "bip-kit";
import type { DevelopmentProfile } from "bip-kit";
import { DEVELOPMENT } from "@/lib/config/development";
/**
* Next's fetch cache is keyed on the request, so the revalidate window is set
* here rather than in bip-kit's default (which asks for `no-store`): the map is
* public, identical for every visitor, and cached upstream for five minutes.
*
* The 8s ceiling is bip-kit's own; it is restated so a slower upstream cannot
* hold a marketing page hostage even if the library's default ever changes.
*/
export const fetchFleetMap: typeof fetch = (input, init) =>
fetch(input, {
...init,
cache: undefined,
next: { revalidate: DEVELOPMENT.revalidateSeconds },
signal: AbortSignal.timeout(DEVELOPMENT.timeoutMs),
});
/** `null` when the map is unreachable or has no valid entry for this product. */
export function loadPetvityProfile(): Promise<DevelopmentProfile | null> {
return loadDevelopmentProfile(DEVELOPMENT.mapUrl, DEVELOPMENT.slug, fetchFleetMap);
}