fix: show and link aliased deps correctly#2192
fix: show and link aliased deps correctly#2192Flo0806 wants to merge 5 commits intonpmx-dev:mainfrom
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: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds parsing and resolution for npm alias dependency syntax across dependency-related code. A new exported parseDepValue(value) function classifies dependency strings into aliased npm forms, non-semver references, or semver ranges and returns a resolved name and range. The Dependencies component, outdated-dependencies and replacement composables now use the resolved package name and range for routing, vulnerability/deprecation/replacement lookups and UI displays while preserving original dependency keys for result storage. Non-semver constraints are filtered out from semver-based lookups. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app/components/Package/Dependencies.vue (1)
163-217: Consider computing resolved values once per dependency item.Within each
<li>iteration,depName(dep, version)is called up to 14 times andgetVulnerableDepInfo(...)up to 6 times. Each invocation re-parses the value and re-searches the array respectively.For most package lists this won't be noticeable, but if you'd like to tidy it up:
♻️ Optional: extract a computed list with pre-resolved values
const resolvedDependencies = computed(() => sortedDependencies.value.map(([key, value]) => { const realName = depName(key, value) return { key, value, realName, range: depRange(value), vulnInfo: getVulnerableDepInfo(realName), deprecatedInfo: getDeprecatedDepInfo(realName), } }) )Then iterate over
resolvedDependenciesin the template, accessing pre-computed properties.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f671524c-1347-4a26-b64d-495f5696082e
📒 Files selected for processing (3)
app/components/Package/Dependencies.vueapp/composables/npm/useOutdatedDependencies.tsapp/utils/npm/outdated-dependencies.ts
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
🔗 Linked issue
Fixes: #2010
🧭 Context
Aliased dependencies got wrong name, link and version.
📚 Description
isNonSemverConstraintwas ignoringnpm:in given constraint. Now we check explicitly tonpm:as a alias and show it correclty in the sidebar, including outdated and vulns tooltips e.g.Before:

Now:
