feat: scoped npm support (@angular/core style paths) in extract_npm_info

This commit is contained in:
Marker689
2026-05-11 20:46:42 +03:00
parent b50c64aadb
commit 2dd26272cb
3 changed files with 64 additions and 7 deletions

View File

@@ -56,8 +56,16 @@ class TestNpmExtractor:
)
def test_scoped_package(self):
# Note: scoped packages have a different path in Nexus
assert extract_npm_info("packages/@scope/name/-/name-1.0.0.tgz") is None
assert extract_npm_info("packages/@scope/name/-/name-1.0.0.tgz") == (
"@scope/name",
"1.0.0",
)
def test_scoped_angular_core(self):
assert extract_npm_info("packages/@angular/core/-/core-18.0.0.tgz") == (
"@angular/core",
"18.0.0",
)
def test_not_packages(self):
assert extract_npm_info("/other/lodash/-/lodash-4.17.21.tgz") is None