Skip to content

Commit

Permalink
feat: sort version in descending semantic order
Browse files Browse the repository at this point in the history
  • Loading branch information
sripwoud committed Jun 27, 2024
1 parent db5fa75 commit c62b7b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
"@zk-kit/artifacts": "1.6.0",
"jotai": "^2.8.3",
"preact": "^10.22.0",
"react-query": "^3.39.3"
"react-query": "^3.39.3",
"semver": "^7.6.2"
},
"devDependencies": {
"@preact/preset-vite": "^2.8.2",
"@types/semver": "^7.5.8",
"typescript": "^5.2.2",
"vite": "^5.3.1"
}
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/hooks/useVersions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useQuery } from 'react-query'
import rcompare from 'semver/functions/rcompare'
import { owner, repo } from '../constants'
import { gh } from '../gh'
import { useStore } from './useStore'
Expand All @@ -19,6 +20,7 @@ export function useVersions() {
data
.filter(tag => tag.includes(`@zk-kit/${selectedProject}-artifacts@`))
.map(tag => tag.split('@')[2])
.filter(version => version !== 'latest'),
.filter(version => version !== 'latest')
.sort(rcompare),
})
}
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c62b7b6

Please sign in to comment.