Skip to content

fix: use displayVersion instead of pkg#2186

Open
Flo0806 wants to merge 2 commits intonpmx-dev:mainfrom
Flo0806:fix/license-per-version
Open

fix: use displayVersion instead of pkg#2186
Flo0806 wants to merge 2 commits intonpmx-dev:mainfrom
Flo0806:fix/license-per-version

Conversation

@Flo0806
Copy link
Contributor

@Flo0806 Flo0806 commented Mar 21, 2026

🔗 Linked issue

Fixes: #2163

🧭 Context

If you switch to older/other versions in a package which have a different version the version doesn't change

📚 Description

Problem is the loaded packages (latest/current version) was used to show license informations. Now we use the displayVersion for that and we now always see the current license.

@vercel
Copy link

vercel bot commented Mar 21, 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 21, 2026 8:51pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 21, 2026 8:51pm
npmx-lunaria Ignored Ignored Mar 21, 2026 8:51pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a97b99fa-7a24-4ad3-bce2-e619880df38c

📥 Commits

Reviewing files that changed from the base of the PR and between d86c9c4 and dcf52f7.

📒 Files selected for processing (2)
  • app/components/OgImage/Package.vue
  • app/pages/package/[[org]]/[name].vue

📝 Walkthrough

Walkthrough

The license display logic across two components has been updated to prefer the displayed version's license information over the package's default license. In both app/components/OgImage/Package.vue and app/pages/package/[[org]]/[name].vue, the rendering now uses displayVersion?.license || pkg?.license instead of only pkg?.license. This ensures that when viewing a specific package version, the correct license for that version is shown rather than always displaying the latest version's license information.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description clearly explains the issue and solution: switching versions was not updating the license display because it was using the loaded package instead of the selected displayVersion.
Linked Issues check ✅ Passed The changes correctly address the linked issue #2163 by replacing pkg.license with displayVersion?.license || pkg.license in both components to show the selected version's license.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the license display issue; only two Vue components were modified to use displayVersion instead of pkg for license information.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/pages/package/[[org]]/[name].vue 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

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

Ideally we fix this where we're loading the packument from the registry, since presumably we're either getting license from the top level of the packument which is just referring to latest. We should be getting license, and most other data, from the packument version instead if that makes sense?

@Flo0806
Copy link
Contributor Author

Flo0806 commented Mar 21, 2026

Ideally we fix this where we're loading the packument from the registry, since presumably we're either getting license from the top level of the packument which is just referring to latest. We should be getting license, and most other data, from the packument version instead if that makes sense?

displayVersion resolves always the current license, doesn't it? From this it works as well for me with this fix. Did I overlook anything?

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.

License is always shown from latest version

2 participants