~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/knotless

git that lives in your Atmosphere account

Forked from chadtmiller.com/knotless

0
0
65 lines · 1.9 KB Raw History
<script lang="ts">
	import type { PackageView, ReleaseView } from '#lib/lexicons/dev/knotless/defs.ts';
	import type { Paged } from '#lib/pages.svelte.ts';
	import Icon from '#lib/atoms/Icon.svelte';
	import More from '#lib/atoms/More.svelte';
	import { releasesHref } from '#lib/releases.ts';
	import ReleaseCard from './ReleaseCard.svelte';
	import Empty from '#lib/molecules/Empty.svelte';
	/**
	 * The releases of `owner`'s repository `name`, newest first, the `pages`
	 * shown so far and the way to the next: of every package, or of the one
	 * picked, `only`, from the `packages` it publishes, each with its latest version, to pick one by. With none,
	 * how to publish one.
	 */
	let {
		owner,
		name,
		pages,
		packages = [],
		only
	}: {
		owner: string;
		name: string;
		pages: Paged<ReleaseView>;
		packages?: PackageView[];
		only?: string;
	} = $props();
</script>

<div class="toolbar">
	<h2>{only ? `Releases of ${only}` : 'Releases'}</h2>
</div>
{#if packages.length > 1}
	<ul class="package-strip" aria-label="Packages">
		{#each packages as p (p.name)}
			<li>
				<a
					href={releasesHref(owner, name, p.name === only ? undefined : p.name)}
					aria-current={p.name === only ? 'true' : undefined}
					><Icon name={p.image ? 'container' : 'package'} /><b>{p.name}</b>{#if p.latest}<span
							class="mute">{p.latest}</span
						>{/if}</a
				>
			</li>
		{/each}
	</ul>
{/if}
{#each pages.items as r (r.uri)}
	<ReleaseCard {owner} {name} release={r} />
{:else}
	<div class="box">
		{#if only}
			<Empty title="No releases of {only}"
				><a href={releasesHref(owner, name)}>See every package's releases</a></Empty
			>
		{:else}
			<Empty
				title="No releases yet"
				cmd="knotless release publish knotless://{owner}/{name} {name} 0.1.0 dist/*"
				>Publish a version of a package from a build, and it shows here.</Empty
			>
		{/if}
	</div>
{/each}
<More {pages} label="More releases" />