Skip to content

feat: adding gh changelog/releases to npmx#1233

Open
WilcoSp wants to merge 132 commits intonpmx-dev:mainfrom
WilcoSp:feat/changelog-1
Open

feat: adding gh changelog/releases to npmx#1233
WilcoSp wants to merge 132 commits intonpmx-dev:mainfrom
WilcoSp:feat/changelog-1

Conversation

@WilcoSp
Copy link
Contributor

@WilcoSp WilcoSp commented Feb 8, 2026

This pr will add the possibility to view the changelog.md & releases from a package's github repo within npmx.
This will make it easier to see the changelogs while not needing to leave npmx and allowing quicker access.

This pr is the first pr of #501

Preview here, this will automatically update

Acknowledgements

While I was making this PR antfu also made this pr #1368 and here my comment from his pr

Also @ShroXd is currently working on adding changelogs to the version history page that was merged with #2025, we've both agreed to first independently work on our PRs and later after both are merged and we've received feedback & irl use we'll collaborate on the interaction between the two

@vercel
Copy link

vercel bot commented Feb 8, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 22, 2026 9:54am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 22, 2026 9:54am
npmx-lunaria Ignored Ignored Mar 22, 2026 9:54am

Request Review

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
i18n/locales/en.json Source changed, localizations will be marked as outdated.
i18n/locales/kn-IN.json Localization changed, will be marked as complete. 🔄️
i18n/locales/tr-TR.json Localization changed, will be marked as complete. 🔄️
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 68.75000% with 15 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/Package/Header.vue 46.15% 5 Missing and 2 partials ⚠️
app/utils/router.ts 0.00% 3 Missing and 2 partials ⚠️
app/components/Changelog/Card.vue 76.92% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment on lines +16 to +18
const cardId = computed(() => (release.publishedAt ? `date-${formattedDate.value}` : undefined))

const navId = computed(() => `release-${slugify(release.title)}`)
Copy link
Member

Choose a reason for hiding this comment

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

Is there a chance that two cards will have the same id?

maybe sth like

cardId = ... `${navId}-card`

Copy link
Contributor Author

@WilcoSp WilcoSp Mar 18, 2026

Choose a reason for hiding this comment

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

yes it can and even already does happen (nuxt), but it's on purpose with cardId because it's only to be a fallback when matching with navId didn't succeed

For releases npmx will first match with publish date + version and if not successful it'll then try to navigate to the first cardId that matches the publish date of the package version.
I'm going to change it that it'll only try to navigate to a date if a release for it is present.

return resolved
}
return baseUrl
}
Copy link
Member

@alexdln alexdln Mar 18, 2026

Choose a reason for hiding this comment

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

Do we really want to support custom changelogs? It feels so complicated and I'm not sure it worse it. @serhalp wdyt?

@alexdln
Copy link
Member

alexdln commented Mar 18, 2026

@WilcoSp amazing work, sorry I haven't looked at it in a while

Most of the comments are trivial, and some of them could probably be moved to a separate issue.
I'd prefer to move custom changelog support out as well, I'm a bit unsure about that part...

Could you also please add these pages to the robots.txt exceptions?

@WilcoSp
Copy link
Contributor Author

WilcoSp commented Mar 18, 2026

@alexdln thanks for the review, I'll check later your comments and either implement your suggestions in this pr or in the next pr (will comment on thise moved to the next pr)


with 'custom changelogs', I think you mean the custom markdown renderer for changelog. it's needed because readme & changelogs have different needs & contexts

for example header links in changelog are only the icon in the header because vite has the version headers link to gh diff page

for the both markdown renderers it's probably better in the next pr to look what can be shared with and without create functions to make maintaining both better.

@WilcoSp
Copy link
Contributor Author

WilcoSp commented Mar 18, 2026

I've just applied most suggestions and marked them as resolved. the other I've left open due to a comment or I'll work on when back from the office tomorrow (19 march)

at work I'm noticing that ungh.cc gh api keys are being exhausted rn, for this I'll add better error handling.
for example for me rn it says valibot isn't supported while actually ungh isn't able to get the data.

the only issue I'm facing is that some packages have both releases and changelog.md in use (oxfmt), but some like msw only have a changelog.md to refer to releases, how can I best detect whether I can fallback to changelog.md and when not?

@WilcoSp
Copy link
Contributor Author

WilcoSp commented Mar 19, 2026

hey @alexdln I've just applied the last changes, when you want you can review again this pr.

here are some of the larger changes

  • the watch in markdown.vue & releases.vue have been changed to watchEffect
  • the routing has been changed from 'changes' to 'changelog'
  • added the changelog routes to robots.txt
  • when ungh.cc api keys are exhausted the error for it will be handled
    • when ungh.cc is exhausted an error will be created.
    • changelog.md is checked if it exists it'll then be returned by the api
    • if changelog.md doesn't exists then the earlier created error will be throw to which the changelog page will than display a rate limit error.

only the matching misses on branched versions for changelog i'll save for the next pr.

for ungh.cc error handling has been added because today the api keys were rate limited a lot earlier today.

@ghostdevv
Copy link
Contributor

(the storybook/chromatic ci breaking is my fault #2167)

@WilcoSp
Copy link
Contributor Author

WilcoSp commented Mar 20, 2026

@ghostdevv can happen and at least in github it was clear why the ci wasn't fully successful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review This PR is waiting for a review from a maintainer ux Related to wider UX decisions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants