Skip to content

Conversation

@jonathanyeong
Copy link
Contributor

@jonathanyeong jonathanyeong commented Jan 26, 2026

Fixes: #117

Why

When fetching from registry npmjs, the incorrect readme filename is returned:

❯ curl -s "https://registry.npmjs.org/@biomejs%2Fbiome" | jq -r '.readmeFilename'
README.zh-TW.md

Doing some digging it might be because biomejs stores all its readmes in a single folder. Someone had a similar issue here.

Changes made

  • Check if readmeFilename matches set of standard Readme filenames. If not, fetch the standard filename from jsDelivr.

Testing

Visiting preview link of biomejs shows english README by default (https://npmxdev-git-fork-jonathanyeong-jy-fix-incorrect-readme-poetry.vercel.app/@biomejs/biome)

CleanShot 2026-01-26 at 11 00 13@2x

And is not the standard filenames
@vercel
Copy link

vercel bot commented Jan 26, 2026

@jonathanyeong is attempting to deploy a commit to the danielroe Team on Vercel.

A member of the Team first needs to authorize it.

return false
}

const filenames = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielroe if this approach makes sense, I can extract this out into a shared const since it's duplicated in fetchReadmeFromJsdelivr

@jonathanyeong jonathanyeong marked this pull request as ready for review January 26, 2026 16:10
@jonathanyeong jonathanyeong changed the title fix: fetch readme if filename doesn't match locale fix: fetch correct base readme by default Jan 26, 2026
@jonathanyeong jonathanyeong changed the title fix: fetch correct base readme by default fix: fetch correct readme by default Jan 26, 2026
@vercel
Copy link

vercel bot commented Jan 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
npmx.dev Ready Ready Preview, Comment Jan 26, 2026 11:55pm

Request Review

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(made a few small tweaks - hope that was ok!)

thank you for this ❤️

@danielroe danielroe changed the title fix: fetch correct readme by default fix: prefer classic readme if npm picks up a different filename Jan 26, 2026
@danielroe danielroe merged commit ff5da1a into npmx-dev:main Jan 26, 2026
8 checks passed
@jonathanyeong
Copy link
Contributor Author

Of course! Thank you for making the PR better!

@jonathanyeong jonathanyeong deleted the jy/fix-incorrect-readme branch January 26, 2026 23:57
vinnymac pushed a commit to vinnymac/npmx.dev that referenced this pull request Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect readme pulled by default

2 participants