jsr
jsr copied to clipboard
feat: package version in scope and search result lists
Closes #421
I think this needs some different styling. Right now it is not clear that this is the latest version.
@josh-collinsworth any ideas?
I think this needs some different styling. Right now it is not clear that this is the latest version.
@josh-collinsworth any ideas?
Is there any situation where this might not display the most recent version? Wouldn't search always automatically default to the latest and show that version?
If not, I'd suggest maybe adding a "latest" pill, similar to what's shown on the package page next to the version number.
If so, though, I'm wondering whether it's needed at all.
For what it's worth, I had a little hack at this myself before I realised this PR was open. I think it's pretty obvious that it refers to the latest version, what else would it be? adding a latest pill would just be noise. I think that the version could be a little bit more subtle though, here was my hack at it, based on the styling of on the main package page...
<div class="grow-1">
<div class="flex items-baseline gap-x-3">
<span class="text-cyan-700 font-semibold">
{`@${pkg.scope}/${pkg.name}`}
</span>
{'latestVersion' in pkg && pkg.latestVersion && (
<span class="text-[0.75em] font-bold text-gray-500 truncate">
<span class="relative text-[0.80em] -top-[0.175em] font-[800]">
@
</span>
{pkg.latestVersion}
</span>
)}
</div>
It seems clear to me that this is the latest version. npm also does this. Perhaps we can merge this and then re-evaluate if we get complaints.
How would you like to proceed, @lucacasonato?
Gentle ping on this one once more. Having this would be nice, specifically for std, as we would then be able to remove the packages table in the README.
Any progress on this? I'd really like to see this feature in jsr, really useful for std and other libraries that consist of multiple packages.