Skip to content

Commit a380fcc

Browse files
committed
refactor: include 'latest' in TAG_PRIORITY
1 parent 4354aa2 commit a380fcc

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

app/pages/package/[[org]]/[name]/versions.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ async function ensureFullDataLoaded() {
6565
// ─── Derived data ─────────────────────────────────────────────────────────────
6666
6767
const versionToTagsMap = computed(() => buildVersionToTagsMap(distTags.value))
68+
6869
const tagRows = computed(() => buildTaggedVersionRows(distTags.value))
6970
const latestTagRow = computed(() => tagRows.value.find(r => r.tags.includes('latest')) ?? null)
7071
const otherTagRows = computed(() =>

app/utils/versions.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,16 @@ export function getPrereleaseChannel(version: string): string {
5757
* Unknown tags fall back to Infinity and are sorted by publish date descending.
5858
*/
5959
export const TAG_PRIORITY: Record<string, number> = {
60-
stable: 0,
61-
rc: 1,
62-
beta: 2,
63-
next: 3,
64-
alpha: 4,
65-
canary: 5,
66-
nightly: 6,
67-
experimental: 7,
68-
legacy: 8,
60+
latest: 0,
61+
stable: 1,
62+
rc: 2,
63+
beta: 3,
64+
next: 4,
65+
alpha: 5,
66+
canary: 6,
67+
nightly: 7,
68+
experimental: 8,
69+
legacy: 9,
6970
}
7071

7172
/**

0 commit comments

Comments
 (0)