From bd33d4a86a1141a90665fae10ddf6d41ed20ebc3 Mon Sep 17 00:00:00 2001 From: Alexander Wondwossen Date: Sun, 22 Mar 2026 12:54:53 -0400 Subject: [PATCH 1/4] fix: link aliased dependencies to their real package (#2010) --- app/components/Package/Dependencies.vue | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/app/components/Package/Dependencies.vue b/app/components/Package/Dependencies.vue index 6edc71377b..ed2b147d79 100644 --- a/app/components/Package/Dependencies.vue +++ b/app/components/Package/Dependencies.vue @@ -90,6 +90,19 @@ function getDepVersionClass(dep: string) { } const numberFormatter = useNumberFormatter() + +/** + * Parses npm alias syntax: "npm:real-pkg@^1.0.0" + * Returns { name, range } for the real package, or null if not an alias. + */ +function parseNpmAlias(version: string): { name: string; range: string } | null { + if (!version.startsWith('npm:')) return null + const spec = version.slice(4) // strip 'npm:' + // Handle scoped packages like @scope/pkg@1.0.0 — find @ after position 0 + const atIdx = spec.startsWith('@') ? spec.indexOf('@', 1) : spec.indexOf('@') + if (atIdx === -1) return { name: spec, range: '' } + return { name: spec.slice(0, atIdx), range: spec.slice(atIdx + 1) } +}