- {#each data.versions as pkg, index}
+ {#each data.versions as pkgVersion, index}
{@const isLatest = index === 0}
yanked)}
>
-
{/each}
diff --git a/website/src/routes/(app)/packages/[scope]/[name]/versions/+page.ts b/website/src/routes/(app)/packages/[scope]/[name]/versions/+page.ts
index 26b58e0..da7dc3d 100644
--- a/website/src/routes/(app)/packages/[scope]/[name]/versions/+page.ts
+++ b/website/src/routes/(app)/packages/[scope]/[name]/versions/+page.ts
@@ -10,18 +10,30 @@ export const load: PageLoad = async ({ params, fetch }) => {
const { scope, name } = params
try {
- const versions = await fetchRegistryJson
(
+ const versionsResponse = await fetchRegistryJson(
`packages/${encodeURIComponent(`${scope}/${name}`)}`,
fetch,
)
- versions.reverse()
+ const versions = Object.entries(versionsResponse.versions)
+ .map(([version, data]) => ({
+ version,
+ description: data.description,
+ targets: data.targets,
+ published_at: Object.values(data.targets)
+ .map(({ published_at }) => new Date(published_at))
+ .sort()
+ .reverse()[0]
+ .toISOString(),
+ }))
+ .reverse()
return {
+ name: versionsResponse.name,
versions,
meta: {
- title: `${versions[0].name} - versions`,
+ title: `${versionsResponse.name} - versions`,
description: versions[0].description,
},
}