Something went wrong. Try again.
Beautiful changelogs and releases for everything
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292<script lang="ts"> import type { Snippet } from 'svelte' import type { TownDistDefs } from '@dist-town/client' import { excerpt, formatDate, freshness, tidToDate } from '$lib/format' import { projectColor } from '$lib/identity' import { projectPath, projectSegments } from '$lib/paths' import LifecycleBanner from './LifecycleBanner.svelte' import ProjectTabs from './ProjectTabs.svelte' import ReportLink from './ReportLink.svelte'
// The landing shell shared by every project tab: identity, banners, // pointers, and the Latest band all persist above the bar, so // switching tabs never shifts layout — only content below changes. let { project, ident, feed = [], active, children, }: { project: TownDistDefs.ProjectView ident: string feed?: TownDistDefs.RecentReleaseView[] active: 'overview' | 'releases' | 'changelog' children: Snippet } = $props()
const handle = $derived(project.handle ?? ident) const urlPath = $derived(projectPath(project.name)) const ancestors = $derived( projectSegments(project.name) .slice(0, -1) .map((seg, i, all) => ({ seg, href: `/${handle}/${all.slice(0, i + 1).join('/')}` })), ) const leafName = $derived(projectSegments(project.name).at(-1)) const kids = $derived(project.children ?? []) // The Latest band pins the newest subtree release carrying notes, // falling back to the newest release plain (project-landing-tabs D3). const latest = $derived(feed.find((e) => e.release.changelog) ?? feed[0] ?? null) const latestDate = $derived(latest ? tidToDate(latest.release.rkey) : null) const latestFresh = $derived(freshness(latestDate))
function latestTitle(e: TownDistDefs.RecentReleaseView): string { return e.release.changelog?.title ?? `${projectPath(e.projectName)} ${e.release.version}` } function latestHref(e: TownDistDefs.RecentReleaseView): string { return `/${e.handle ?? e.did}/${projectPath(e.projectName)}@${e.release.version}` } function successorPath(renamedTo: string): string | null { const name = renamedTo.split('/').pop() return name ? `/${handle}/${projectPath(name)}` : null } // The outbound lineage claim (cli-ergonomics D7): parsed for display // from the at-uri, preferring the resolved handle. Rendered only on // this project's own page — never aggregated on the upstream's. const lineage = $derived.by(() => { if (!project.derivedFrom) return null const m = project.derivedFrom.match(/^at:\/\/([^/]+)\/[^/]+\/(.+)$/) if (!m) return null const who = project.derivedFromHandle ?? m[1] return { label: `@${who}/${projectPath(m[2])}`, href: `/${who}/${projectPath(m[2])}` } })</script>
<article> <header> <p class="publisher"> <a href="/{handle}">@{handle}</a> {#each ancestors as a (a.href)} <span class="crumb-sep dim">/</span><a class="crumb" href={a.href}>{a.seg}</a> {/each} </p> <h1 class="display">{project.displayName ?? leafName}</h1> {#if project.description} <p class="description">{project.description}</p> {/if} <p class="links dim"> {#if project.source} {#if project.source.startsWith('at://')} <!-- an atproto record, not a web page: name it, don't 404 it --> <span class="source-rec"><code title={project.source}>source</code></span> {:else} <a href={project.source}>source</a> {/if} {#if project.sourceAuthority === 'self-authenticated'} <span class="selfauth" title="This source is a record in the same repo as the project — the association is self-authenticated, though it says nothing about how artifacts were built." >same‑repo</span> {/if} {/if} {#if project.website}<a href={project.website}>website</a>{/if} {#if lineage} <span class="derived" title="The publisher's own statement of derivation — an unverified claim, shown only here." >derived from <a href={lineage.href}>{lineage.label}</a></span > {/if} </p> </header>
{#if project.renamedTo} <aside class="renamed" role="note"> <p class="head">This project has been renamed.</p> {#if successorPath(project.renamedTo)} <p><a href={successorPath(project.renamedTo)}>Continue to its successor →</a></p> {/if} </aside> {/if} <LifecycleBanner lifecycle={project.lifecycle} subject="project" />
{#if project.pointers.length > 0} <section class="pointers"> {#each project.pointers as ptr (ptr.name)} <a class="chip" href="/{handle}/{urlPath}@{ptr.name}"> <span class="chip-name">{ptr.name}</span> <span class="chip-version">{ptr.version}</span> </a> {/each} </section> {/if}
{#if latest} <section class="latest"> <h2 class="label">Latest</h2> <article class="latest-band" style:--project-color={projectColor(`${latest.did}/${latest.projectName}`)} > <div class="latest-main"> <h3 class="latest-head"><a href={latestHref(latest)}>{latestTitle(latest)}</a></h3> {#if latest.release.changelog?.textContent} <p class="excerpt dim">{excerpt(latest.release.changelog.textContent)}</p> {/if} </div> <p class="latest-meta dim nums"> {#if latestFresh} <time class="fresh" datetime={latestDate?.toISOString()} title={formatDate(latestDate)} >{latestFresh}</time > {:else} {formatDate(latestDate)} {/if} </p> </article> </section> {/if}
<ProjectTabs base="/{handle}/{urlPath}" {active} hasChildren={kids.length > 0} />
{@render children()}
<ReportLink /></article>
<style> .publisher { font-weight: 700; margin-bottom: 0.25rem; } .publisher a { text-decoration: none; } .publisher a:hover { text-decoration: underline; } .crumb-sep { margin: 0 0.15rem; } .description { margin-top: 1rem; font-size: 1.125rem; max-width: var(--measure); } .links { margin-top: 0.75rem; display: flex; gap: 1rem; font-size: 0.875rem; align-items: baseline; } .source-rec code { color: var(--ink-dim); } /* structural fact, not a publisher claim: the ok register is earned (same signing key wrote both records), kept quiet at chip scale */ .selfauth { color: var(--ok); border: 1px solid currentColor; padding: 0.05rem 0.4rem; font-size: 0.75rem; font-weight: 700; margin-left: -0.5rem; } .renamed { border-top: 4px solid var(--rule); padding: 1rem 0; margin: 1.5rem 0; } .renamed .head { font-weight: 800; font-size: 1.125rem; } .pointers { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; } .chip { display: inline-flex; gap: 0.5rem; align-items: baseline; text-decoration: none; border: 1px solid var(--rule); padding: 0.3rem 0.7rem; } .chip:hover { background: var(--ink); color: var(--ground); } .chip-name { font-weight: 800; } .chip-version { font-size: 0.875rem; } /* the Latest band: the newest notes excerpted in a band washed with the releasing project's identity hue — the highlight, not the reading surface (that's the changelog tab) */ .latest { margin-top: 2.5rem; } .latest h2 { padding-bottom: 0.5rem; } .latest-band { border-left: 4px solid var(--project-color, var(--rule)); background: color-mix(in oklab, var(--project-color, var(--ink)) 11%, transparent); padding: 1.1rem 1.25rem 1.5rem 1.4rem; display: grid; grid-template-columns: minmax(0, 1fr) 11rem; column-gap: 2.5rem; align-items: baseline; } .latest-main { min-width: 0; } .latest-head { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-size: 1.5rem; } .latest-head a { text-decoration: none; } .latest-head a:hover { text-decoration: underline; } .latest-meta { display: flex; gap: 0.6rem; align-items: baseline; justify-content: flex-end; font-size: 0.875rem; white-space: nowrap; } /* the freshness stamp: recent ink carries full weight */ .fresh { color: var(--ink); font-weight: 700; } .excerpt { max-width: var(--measure); margin-top: 0.6rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; } @media (max-width: 720px) { .latest-band { grid-template-columns: 1fr; } .latest-meta { justify-content: flex-start; margin-top: 0.5rem; } }</style>