fix: show license from correct version#2662
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis change fixes a bug where the displayed licence could come from the latest package version instead of the selected version. It adds a shared Changes
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/composables/npm/usePackage.ts`:
- Line 119: The current assignment uses normalizeLicense(versionData?.license ||
pkg.license) which incorrectly falls back to pkg.license even when a specific
version is selected; change the logic so that when a specific version is
selected you only use versionData?.license (no top-level fallback), and only
fall back to pkg.license when no version is selected (e.g., check the presence
of the version/selectedVersion variable and call normalizeLicense with
versionData?.license when a version is provided, otherwise use
versionData?.license || pkg.license). Ensure this change touches the line using
normalizeLicense, versionData, and pkg.license so the top-level license is not
shown for selected versions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e83f1575-b719-4f4c-832b-b4161e066cc4
📒 Files selected for processing (2)
app/composables/npm/usePackage.tsshared/types/npm-registry.ts
🔗 Linked issue
Fixes #2163
Closes #2186
🧭 Context
📚 Description
Before:
After: