#183 package shapes

This commit is contained in:
neil 2023-01-30 20:15:27 +08:00
parent 4273295168
commit 4daea75753
4 changed files with 12 additions and 3 deletions

View file

@ -7,6 +7,7 @@ import urlJoin from 'url-join';
export const baseUrl = 'https://api.tea.xyz/v1';
export async function get<T>(path: string, query?: { [key: string]: string }) {
console.log(`GET /api/${path}`)
const [session, client] = await Promise.all([getSession(), getClient()]);
const uri = urlJoin(baseUrl, path);

View file

@ -34,7 +34,7 @@
<div>
<p>
<span class="text-xs text-gray"
>V&NonBreakingSpace;{pkg.version} {pkg?.bottles ? `| ${pkg.bottles} bottles` : ''}</span
>V&NonBreakingSpace;{pkg.version} {pkg?.bottles?.length ? `| ${pkg.bottles.length} bottles` : ''}</span
>
</p>
</div>

View file

@ -19,7 +19,15 @@ export interface Package {
dl_count: number;
installs: number;
reviews?: Review[];
bottles?: number; // TODO: where to get this?
// metas
full_description?: string; // probably markdown
bottles?: Bottle[];
license?: string;
size_bytes?: number;
documentation_url?: string;
github_repository_url?: string;
owners?: Partial<Developer>[];
categories?: string[];
}
export type AirtablePost = {