Skip to content
Snippets Groups Projects
Commit 250c4d81 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

feat(npm): ignore vendorised package.json files

Closes #2291
parent efa5edbd
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,10 @@ async function extractDependencies(content, packageFile, config) {
logger.info({ packageFile }, 'Invalid JSON');
return null;
}
if (packageJson._id && packageJson._args && packageJson._from) {
logger.info('Ignoring vendorised package.json');
return null;
}
if (packageFile !== 'package.json' && packageJson.renovate) {
const error = new Error('config-validation');
error.configFile = packageFile;
......
{
"_args": [
[
"is-object@1.0.1",
"/Users/rhys/github/renovateapp"
]
],
"_from": "is-object@1.0.1",
"_id": "is-object@1.0.1",
"_inBundle": false,
"_integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=",
"_location": "/is-object",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "is-object@1.0.1",
"name": "is-object",
"escapedName": "is-object",
"rawSpec": "1.0.1",
"saveSpec": null,
"fetchSpec": "1.0.1"
},
"_requiredBy": [
"/isurl"
],
"_resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz",
"_spec": "1.0.1",
"_where": "/Users/rhys/github/renovateapp",
"author": {
"name": "Raynos",
"email": "raynos2@gmail.com"
},
"bugs": {
"url": "https://github.com/ljharb/is-object/issues",
"email": "ljharb@gmail.com"
},
"contributors": [
{
"name": "Raynos"
},
{
"name": "Jordan Harband",
"url": "https://github.com/ljharb"
}
],
"dependencies": {},
"description": "Checks whether a value is an object",
"devDependencies": {
"covert": "~1.0.0",
"jscs": "~1.6.0",
"tape": "~2.14.0"
},
"homepage": "https://github.com/ljharb/is-object",
"keywords": [],
"license": "MIT",
"licenses": [
{
"type": "MIT",
"url": "http://github.com/ljharb/is-object/raw/master/LICENSE"
}
],
"main": "index",
"name": "is-object",
"repository": {
"type": "git",
"url": "git://github.com/ljharb/is-object.git"
},
"scripts": {
"coverage": "covert test/index.js",
"coverage-quiet": "covert test/index.js --quiet",
"lint": "jscs *.js */*.js",
"test": "npm run lint && node test/index.js && npm run coverage-quiet"
},
"testling": {
"files": "test/index.js",
"browsers": [
"ie/6..latest",
"firefox/3..6",
"firefox/16..latest",
"firefox/nightly",
"chrome/22..latest",
"chrome/canary",
"opera/10.0",
"opera/11..latest",
"opera/next",
"safari/4..latest",
"ipad/6.0..latest",
"iphone/6.0..latest"
]
},
"version": "1.0.1"
}
......@@ -11,6 +11,7 @@ function readFixture(fixture) {
const input01Content = readFixture('inputs/01.json');
const workspacesContent = readFixture('inputs/workspaces.json');
const vendorisedContent = readFixture('is-object.json');
describe('manager/npm/extract', () => {
describe('.extractDependencies()', () => {
......@@ -25,6 +26,14 @@ describe('manager/npm/extract', () => {
);
expect(res).toBe(null);
});
it('ignores vendorised package.json', async () => {
const res = await npmExtract.extractDependencies(
vendorisedContent,
'package.json',
{}
);
expect(res).toBe(null);
});
it('throws error if non-root renovate config', async () => {
let e;
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment