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
2323820d
Commit
2323820d
authored
6 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
refactor: replace config dot notation in npm lookup
parent
409cd4ad
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/manager/npm/package.js
+14
-15
14 additions, 15 deletions
lib/manager/npm/package.js
with
14 additions
and
15 deletions
lib/manager/npm/package.js
+
14
−
15
View file @
2323820d
...
@@ -9,28 +9,27 @@ module.exports = {
...
@@ -9,28 +9,27 @@ module.exports = {
async
function
getPackageUpdates
(
config
)
{
async
function
getPackageUpdates
(
config
)
{
logger
.
trace
({
config
},
`npm.getPackageUpdates()`
);
logger
.
trace
({
config
},
`npm.getPackageUpdates()`
);
if
(
config
.
depType
===
'
engines
'
)
{
const
{
depType
,
depName
,
currentVersion
}
=
config
;
if
(
config
.
depName
!==
'
node
'
)
{
if
(
depType
===
'
engines
'
)
{
if
(
depName
!==
'
node
'
)
{
logger
.
debug
(
'
Skipping non-node engine
'
);
logger
.
debug
(
'
Skipping non-node engine
'
);
return
[];
return
[];
}
}
return
nodeManager
.
getPackageUpdates
(
config
);
return
nodeManager
.
getPackageUpdates
(
config
);
}
}
let
results
=
[];
let
results
=
[];
if
(
config
.
currentVersion
.
startsWith
(
'
file:
'
))
{
if
(
currentVersion
.
startsWith
(
'
file:
'
))
{
logger
.
debug
(
logger
.
debug
(
{
dependency
:
config
.
depName
,
currentVersion
:
config
.
currentVersion
},
{
dependency
:
depName
,
currentVersion
},
'
Skipping file: dependency
'
'
Skipping file: dependency
'
);
);
return
[];
return
[];
}
}
if
(
!
isValidSemver
(
config
.
currentVersion
))
{
if
(
!
isValidSemver
(
currentVersion
))
{
results
.
push
({
results
.
push
({
depName
:
config
.
depName
,
depName
,
type
:
'
warning
'
,
type
:
'
warning
'
,
message
:
`Dependency uses tag "
\`
${
message
:
`Dependency uses tag "
\`
${
currentVersion
}
\`
" as its version so that will never be changed by Renovate`
,
config
.
currentVersion
}
\`
" as its version so that will never be changed by Renovate`
,
});
});
logger
.
debug
(
results
[
0
].
message
);
logger
.
debug
(
results
[
0
].
message
);
return
results
;
return
results
;
...
@@ -39,12 +38,12 @@ async function getPackageUpdates(config) {
...
@@ -39,12 +38,12 @@ async function getPackageUpdates(config) {
config
.
npmrc
,
config
.
npmrc
,
config
.
global
?
config
.
global
.
exposeEnv
:
false
config
.
global
?
config
.
global
.
exposeEnv
:
false
);
);
const
npmDep
=
await
npmApi
.
getDependency
(
config
.
depName
);
const
npmDep
=
await
npmApi
.
getDependency
(
depName
);
if
(
npmDep
)
{
if
(
npmDep
)
{
results
=
await
versions
.
determineUpgrades
(
npmDep
,
config
);
results
=
await
versions
.
determineUpgrades
(
npmDep
,
config
);
if
(
results
.
length
>
0
)
{
if
(
results
.
length
>
0
)
{
logger
.
info
(
logger
.
info
(
{
dependency
:
config
.
depName
},
{
dependency
:
depName
},
`
${
results
.
length
}
result(s):
${
results
.
map
(
`
${
results
.
length
}
result(s):
${
results
.
map
(
upgrade
=>
upgrade
.
newVersion
upgrade
=>
upgrade
.
newVersion
)}
`
)}
`
...
@@ -54,11 +53,11 @@ async function getPackageUpdates(config) {
...
@@ -54,11 +53,11 @@ async function getPackageUpdates(config) {
// If dependency lookup fails then warn and return
// If dependency lookup fails then warn and return
const
result
=
{
const
result
=
{
type
:
'
warning
'
,
type
:
'
warning
'
,
message
:
`Failed to look up dependency
${
config
.
depName
}
`
,
message
:
`Failed to look up dependency
${
depName
}
`
,
};
};
results
=
[
result
];
results
=
[
result
];
logger
.
info
(
logger
.
info
(
{
dependency
:
config
.
depName
,
packageFile
:
config
.
packageFile
},
{
dependency
:
depName
,
packageFile
:
config
.
packageFile
},
result
.
message
result
.
message
);
);
}
}
...
@@ -67,9 +66,9 @@ async function getPackageUpdates(config) {
...
@@ -67,9 +66,9 @@ async function getPackageUpdates(config) {
npmDep
&&
npmDep
.
repositoryUrl
&&
npmDep
.
repositoryUrl
.
length
npmDep
&&
npmDep
.
repositoryUrl
&&
npmDep
.
repositoryUrl
.
length
?
npmDep
.
repositoryUrl
?
npmDep
.
repositoryUrl
:
null
;
:
null
;
if
(
!
result
.
repositoryUrl
&&
config
.
depName
.
startsWith
(
'
@types/
'
))
{
if
(
!
result
.
repositoryUrl
&&
depName
.
startsWith
(
'
@types/
'
))
{
logger
.
debug
(
'
Setting @types url manually
'
);
logger
.
debug
(
'
Setting @types url manually
'
);
result
.
repositoryUrl
=
`https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/
${
config
.
depName
.
replace
(
result
.
repositoryUrl
=
`https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/
${
depName
.
replace
(
'
@
'
,
'
@
'
,
''
''
)}
`
;
)}
`
;
...
...
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