fix: authors not displaying

This commit is contained in:
LukaDev 2024-09-29 14:38:23 +02:00
parent b2ba9029e8
commit 29973e0b79
2 changed files with 15 additions and 15 deletions

Binary file not shown.

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import { BinaryIcon, Globe, Icon, LibraryIcon, Mail } from "lucide-svelte"
import { page } from "$app/stores" import { page } from "$app/stores"
import Github from "$lib/components/Github.svelte"
import type { TargetInfo } from "$lib/registry-api" import type { TargetInfo } from "$lib/registry-api"
import { BinaryIcon, Globe, Icon, LibraryIcon, Mail } from "lucide-svelte"
import type { ComponentType } from "svelte" import type { ComponentType } from "svelte"
import Command from "./Command.svelte" import Command from "./Command.svelte"
import TargetSelector from "./TargetSelector.svelte" import TargetSelector from "./TargetSelector.svelte"
import Github from "$lib/components/Github.svelte"
let { children, data } = $props() let { children, data } = $props()
@ -53,7 +53,7 @@
<aside <aside
class="w-full flex-shrink-0 border-t pt-16 lg:ml-auto lg:max-w-[22rem] lg:border-l lg:border-t-0 lg:pl-4 lg:pt-6" class="w-full flex-shrink-0 border-t pt-16 lg:ml-auto lg:max-w-[22rem] lg:border-l lg:border-t-0 lg:pl-4 lg:pt-6"
> >
<h2 class="mb-1 text-lg font-semibold text-heading">Install</h2> <h2 class="text-heading mb-1 text-lg font-semibold">Install</h2>
<Command command={installCommand} class="mb-4" /> <Command command={installCommand} class="mb-4" />
<div class="hidden lg:block"> <div class="hidden lg:block">
@ -61,12 +61,12 @@
</div> </div>
{#if data.pkg.license !== undefined} {#if data.pkg.license !== undefined}
<h2 class="mb-1 text-lg font-semibold text-heading">License</h2> <h2 class="text-heading mb-1 text-lg font-semibold">License</h2>
<div class="mb-6">{data.pkg.license}</div> <div class="mb-6">{data.pkg.license}</div>
{/if} {/if}
{#if data.pkg.repository !== undefined} {#if data.pkg.repository !== undefined}
<h2 class="mb-1 text-lg font-semibold text-heading">Repository</h2> <h2 class="text-heading mb-1 text-lg font-semibold">Repository</h2>
<div class="mb-6"> <div class="mb-6">
<a <a
href={data.pkg.repository} href={data.pkg.repository}
@ -75,7 +75,7 @@
rel="noreferrer noopener" rel="noreferrer noopener"
> >
{#if isGithub} {#if isGithub}
<Github class="size-5 text-primary" /> <Github class="text-primary size-5" />
<span> <span>
{githubRepo} {githubRepo}
</span> </span>
@ -86,29 +86,29 @@
</div> </div>
{/if} {/if}
<h2 class="mb-1 text-lg font-semibold text-heading">Exports</h2> <h2 class="text-heading mb-1 text-lg font-semibold">Exports</h2>
<ul class="mb-6 space-y-0.5"> <ul class="mb-6 space-y-0.5">
{#each exportEntries as [exportKey, exportName]} {#each exportEntries as [exportKey, exportName]}
{@const Icon = exportIcons[exportKey as keyof TargetInfo]} {@const Icon = exportIcons[exportKey as keyof TargetInfo]}
<li class="flex items-center"> <li class="flex items-center">
<Icon class="mr-2 size-5 text-primary" /> <Icon class="text-primary mr-2 size-5" />
{exportName} {exportName}
</li> </li>
{/each} {/each}
</ul> </ul>
{#if currentTarget?.bin} {#if currentTarget?.bin}
<p class="-mt-3 mb-4 text-sm text-body/80"> <p class="text-body/80 -mt-3 mb-4 text-sm">
This package provides a binary that can be executed after installation, or globally via: This package provides a binary that can be executed after installation, or globally via:
</p> </p>
<Command command={xCommand} class="mb-6" /> <Command command={xCommand} class="mb-6" />
{/if} {/if}
{#if data.pkg.authors && data.pkg.authors.length > 0} {#if data.pkg.authors && data.pkg.authors.length > 0}
<h2 class="mb-2 text-lg font-semibold text-heading">Authors</h2> <h2 class="text-heading mb-2 text-lg font-semibold">Authors</h2>
<ul> <ul>
{#each data.pkg.authors as author} {#each data.pkg.authors as author}
{@const [, name] = author.match(/^(.*?)(<|\()/) ?? []} {@const [, name] = author.match(/^(.*?)\s*(<|\(|$)/) ?? []}
{@const [, email] = author.match(/<(.*)>/) ?? []} {@const [, email] = author.match(/<(.*)>/) ?? []}
{@const [, website] = author.match(/\((.*)\)/) ?? []} {@const [, website] = author.match(/\((.*)\)/) ?? []}
@ -116,13 +116,13 @@
{name} {name}
<div class="ml-auto flex items-center space-x-2"> <div class="ml-auto flex items-center space-x-2">
{#if email} {#if email}
<a href={`mailto:${email}`} class="ml-1 text-primary" title={`Email: ${email}`}> <a href={`mailto:${email}`} class="text-primary ml-1" title={`Email: ${email}`}>
<Mail class="size-5 text-primary" aria-hidden="true" /> <Mail class="text-primary size-5" aria-hidden="true" />
</a> </a>
{/if} {/if}
{#if website} {#if website}
<a href={website} class="ml-1 text-primary" title={`Website: ${website}`}> <a href={website} class="text-primary ml-1" title={`Website: ${website}`}>
<Globe class="size-5 text-primary" aria-hidden="true" /> <Globe class="text-primary size-5" aria-hidden="true" />
</a> </a>
{/if} {/if}
</div> </div>