Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
7e7ec8cc
Commit
7e7ec8cc
authored
6 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
refactor: remove purl namespace and name
parent
f145e886
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/datasource/maven.js
+6
-4
6 additions, 4 deletions
lib/datasource/maven.js
lib/util/purl.js
+2
-0
2 additions, 0 deletions
lib/util/purl.js
test/util/__snapshots__/purl.spec.js.snap
+0
-8
0 additions, 8 deletions
test/util/__snapshots__/purl.spec.js.snap
with
8 additions
and
12 deletions
lib/datasource/maven.js
+
6
−
4
View file @
7e7ec8cc
...
...
@@ -47,10 +47,11 @@ async function getPkgReleases(purl, config) {
}
function
getDependencyParts
(
purl
)
{
const
[
group
,
name
]
=
purl
.
lookupName
.
split
(
'
/
'
);
return
{
display
:
`
${
purl
.
namespace
}
:
${
purl
.
name
}
`
,
group
:
purl
.
namespace
,
name
:
purl
.
name
,
display
:
purl
.
lookupName
.
replace
(
'
/
'
,
'
:
'
)
,
group
,
name
,
dependencyUrl
:
generateMavenUrl
(
purl
),
};
}
...
...
@@ -132,7 +133,8 @@ async function downloadHttpProtocol(pkgUrl) {
}
function
generateMavenUrl
(
purl
)
{
return
purl
.
namespace
.
replace
(
/
\.
/g
,
'
/
'
)
+
`/
${
purl
.
name
}
`
;
const
[
group
,
name
]
=
purl
.
lookupName
.
split
(
'
/
'
);
return
group
.
replace
(
/
\.
/g
,
'
/
'
)
+
`/
${
name
}
`
;
}
function
isMavenCentral
(
pkgUrl
)
{
...
...
This diff is collapsed.
Click to expand it.
lib/util/purl.js
+
2
−
0
View file @
7e7ec8cc
...
...
@@ -44,6 +44,8 @@ function parse(input) {
}
else
{
res
.
qualifiers
=
{};
}
delete
res
.
namespace
;
delete
res
.
name
;
delete
res
.
version
;
// we don't use it
return
res
;
}
This diff is collapsed.
Click to expand it.
test/util/__snapshots__/purl.spec.js.snap
+
0
−
8
View file @
7e7ec8cc
...
...
@@ -4,8 +4,6 @@ exports[`util/purl parse() parses namespaced npm 1`] = `
Object {
"datasource": "npm",
"lookupName": "@foo/bar",
"name": "bar",
"namespace": "@foo",
"qualifiers": Object {},
}
`;
...
...
@@ -14,8 +12,6 @@ exports[`util/purl parse() parses namespaced npm with version 1`] = `
Object {
"datasource": "npm",
"lookupName": "@foo/bar",
"name": "bar",
"namespace": "@foo",
"qualifiers": Object {},
}
`;
...
...
@@ -24,7 +20,6 @@ exports[`util/purl parse() parses npm with version and 1 qualifier 1`] = `
Object {
"datasource": "npm",
"lookupName": "foo",
"name": "foo",
"qualifiers": Object {
"a": "b",
},
...
...
@@ -35,7 +30,6 @@ exports[`util/purl parse() parses npm with version and 2 qualifiers 1`] = `
Object {
"datasource": "npm",
"lookupName": "foo",
"name": "foo",
"qualifiers": Object {
"a": "b",
"c": "d",
...
...
@@ -47,7 +41,6 @@ exports[`util/purl parse() parses npm with version and 2 qualifiers and subpath
Object {
"datasource": "npm",
"lookupName": "foo",
"name": "foo",
"qualifiers": Object {
"a": "b",
"c": "d",
...
...
@@ -60,7 +53,6 @@ exports[`util/purl parse() parses simple npm 1`] = `
Object {
"datasource": "npm",
"lookupName": "foo",
"name": "foo",
"qualifiers": Object {},
}
`;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment