feat(npm): update resolutions (#5636)

This commit is contained in:
Michael Kriese 2020-03-10 06:52:27 +01:00 committed by GitHub
parent 81b4f7740d
commit c974929a62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 282 additions and 6 deletions

View file

@ -36,5 +36,6 @@
"repository": {
"type": "git",
"url": "http://github.com/singapore/renovate.git"
}
},
"workspaces": []
}

View file

@ -25,7 +25,10 @@
"@angular/core": "4.0.0-beta.1"
},
"resolutions": {
"config": "1.21.0"
"config": "1.21.0",
"**/@angular/cli": "8.0.0",
"**/angular": "1.33.0",
"config/glob": "1.0.0"
},
"homepage": "https://keylocation.sg",
"keywords": [

View file

@ -25,7 +25,10 @@
"@angular/core": "4.0.0-beta.1"
},
"resolutions": {
"config": "1.21.0"
"config": "1.21.0",
"**/@angular/cli": "8.0.0",
"**/angular": "1.33.0",
"config/glob": "1.0.0"
},
"homepage": "https://keylocation.sg",
"keywords": [

View file

@ -25,7 +25,10 @@
"@angular/core": "4.0.0-beta.1"
},
"resolutions": {
"config": "1.21.0"
"config": "1.21.0",
"**/@angular/cli": "8.0.0",
"**/angular": "1.33.0",
"config/glob": "1.0.0"
},
"homepage": "https://keylocation.sg",
"keywords": [

View file

@ -25,7 +25,10 @@
"@angular/core": "4.0.0-beta.1"
},
"resolutions": {
"config": "1.21.0"
"config": "1.21.0",
"**/@angular/cli": "8.0.0",
"**/angular": "1.33.0",
"config/glob": "1.0.0"
},
"homepage": "https://keylocation.sg",
"keywords": [

View file

@ -6,6 +6,7 @@ Object {
Object {
"depName": "kgabis/parson",
"depType": "dependencies",
"lookupName": "kgabis/parson",
"prettyDepType": "dependency",
"skipReason": "invalid-name",
},
@ -35,6 +36,7 @@ Object {
"datasource": "npm",
"depName": "angular",
"depType": "dependencies",
"lookupName": "angular",
"prettyDepType": "dependency",
},
Object {
@ -42,6 +44,7 @@ Object {
"datasource": "npm",
"depName": "@angular/cli",
"depType": "devDependencies",
"lookupName": "@angular/cli",
"prettyDepType": "devDependency",
},
Object {
@ -49,6 +52,7 @@ Object {
"datasource": "npm",
"depName": "foo",
"depType": "devDependencies",
"lookupName": "foo",
"prettyDepType": "devDependency",
"skipReason": "any-version",
},
@ -56,6 +60,7 @@ Object {
"currentValue": "file:../foo/bar",
"depName": "bar",
"depType": "devDependencies",
"lookupName": "bar",
"prettyDepType": "devDependency",
"skipReason": "file",
},
@ -64,6 +69,7 @@ Object {
"datasource": "npm",
"depName": "baz",
"depType": "devDependencies",
"lookupName": "baz",
"prettyDepType": "devDependency",
"skipReason": "empty",
},
@ -71,6 +77,7 @@ Object {
"currentValue": "latest",
"depName": "other",
"depType": "devDependencies",
"lookupName": "other",
"prettyDepType": "devDependency",
"skipReason": "unknown-version",
},
@ -78,6 +85,7 @@ Object {
"currentValue": ">=1.7.0 <2.0.0",
"depName": "atom",
"depType": "engines",
"lookupName": "atom",
"prettyDepType": "engine",
"skipReason": "unknown-engines",
},
@ -100,6 +108,7 @@ Object {
"datasource": "npm",
"depName": "npm",
"depType": "engines",
"lookupName": "npm",
"prettyDepType": "engine",
},
Object {
@ -108,6 +117,7 @@ Object {
"datasource": "npm",
"depName": "yarn",
"depType": "engines",
"lookupName": "yarn",
"prettyDepType": "engine",
"skipReason": "unknown-version",
},
@ -136,6 +146,7 @@ Object {
"currentValue": "github:owner/a",
"depName": "a",
"depType": "dependencies",
"lookupName": "a",
"prettyDepType": "dependency",
"skipReason": "unknown-version",
},
@ -143,6 +154,7 @@ Object {
"currentValue": "github:owner/b#master",
"depName": "b",
"depType": "dependencies",
"lookupName": "b",
"prettyDepType": "dependency",
"skipReason": "unversioned-reference",
},
@ -163,6 +175,7 @@ Object {
"currentValue": "github:owner/d#a7g3eaf",
"depName": "d",
"depType": "dependencies",
"lookupName": "d",
"prettyDepType": "dependency",
"skipReason": "unversioned-reference",
},
@ -196,6 +209,7 @@ Object {
"currentValue": "gitlab:owner/g#v1.0.0",
"depName": "g",
"depType": "dependencies",
"lookupName": "g",
"prettyDepType": "dependency",
"skipReason": "unknown-version",
},
@ -203,6 +217,7 @@ Object {
"currentValue": "github:-hello/world#v1.0.0",
"depName": "h",
"depType": "dependencies",
"lookupName": "h",
"prettyDepType": "dependency",
"skipReason": "unknown-version",
},
@ -210,6 +225,7 @@ Object {
"currentValue": "@foo/bar#v2.0.0",
"depName": "i",
"depType": "dependencies",
"lookupName": "i",
"prettyDepType": "dependency",
"skipReason": "unknown-version",
},
@ -217,6 +233,7 @@ Object {
"currentValue": "github:frank#v0.0.1",
"depName": "j",
"depType": "dependencies",
"lookupName": "j",
"prettyDepType": "dependency",
"skipReason": "unknown-version",
},
@ -315,6 +332,7 @@ Object {
"currentValue": "npm:foo",
"depName": "c",
"depType": "dependencies",
"lookupName": "c",
"npmPackageAlias": true,
"prettyDepType": "dependency",
"skipReason": "unknown-version",
@ -372,12 +390,14 @@ Object {
"datasource": "npm",
"depName": "yarn",
"depType": "volta",
"lookupName": "yarn",
"prettyDepType": "volta",
},
Object {
"currentValue": "5.9.0",
"depName": "npm",
"depType": "volta",
"lookupName": "npm",
"prettyDepType": "volta",
"skipReason": "unknown-volta",
},
@ -434,6 +454,7 @@ Object {
"datasource": "npm",
"depName": "yarn",
"depType": "volta",
"lookupName": "yarn",
"prettyDepType": "volta",
"skipReason": "unknown-version",
},
@ -463,6 +484,7 @@ Object {
"datasource": "npm",
"depName": "autoprefixer",
"depType": "dependencies",
"lookupName": "autoprefixer",
"prettyDepType": "dependency",
},
Object {
@ -470,6 +492,7 @@ Object {
"datasource": "npm",
"depName": "bower",
"depType": "dependencies",
"lookupName": "bower",
"prettyDepType": "dependency",
},
Object {
@ -477,6 +500,7 @@ Object {
"datasource": "npm",
"depName": "browserify",
"depType": "dependencies",
"lookupName": "browserify",
"prettyDepType": "dependency",
},
Object {
@ -484,6 +508,7 @@ Object {
"datasource": "npm",
"depName": "browserify-css",
"depType": "dependencies",
"lookupName": "browserify-css",
"prettyDepType": "dependency",
},
Object {
@ -491,6 +516,7 @@ Object {
"datasource": "npm",
"depName": "cheerio",
"depType": "dependencies",
"lookupName": "cheerio",
"prettyDepType": "dependency",
},
Object {
@ -498,11 +524,13 @@ Object {
"datasource": "npm",
"depName": "config",
"depType": "dependencies",
"lookupName": "config",
"prettyDepType": "dependency",
},
Object {
"depName": "enabled",
"depType": "devDependencies",
"lookupName": "enabled",
"prettyDepType": "devDependency",
"skipReason": "invalid-value",
},
@ -511,6 +539,7 @@ Object {
"datasource": "npm",
"depName": "angular",
"depType": "devDependencies",
"lookupName": "angular",
"prettyDepType": "devDependency",
},
Object {
@ -518,6 +547,7 @@ Object {
"datasource": "npm",
"depName": "angular-touch",
"depType": "devDependencies",
"lookupName": "angular-touch",
"prettyDepType": "devDependency",
},
Object {
@ -525,6 +555,7 @@ Object {
"datasource": "npm",
"depName": "angular-sanitize",
"depType": "devDependencies",
"lookupName": "angular-sanitize",
"prettyDepType": "devDependency",
},
Object {
@ -532,8 +563,41 @@ Object {
"datasource": "npm",
"depName": "@angular/core",
"depType": "devDependencies",
"lookupName": "@angular/core",
"prettyDepType": "devDependency",
},
Object {
"currentValue": "1.21.0",
"datasource": "npm",
"depName": "config",
"depType": "resolutions",
"lookupName": "config",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "8.0.0",
"datasource": "npm",
"depName": "**/@angular/cli",
"depType": "resolutions",
"lookupName": "@angular/cli",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.33.0",
"datasource": "npm",
"depName": "**/angular",
"depType": "resolutions",
"lookupName": "angular",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.0.0",
"datasource": "npm",
"depName": "config/glob",
"depType": "resolutions",
"lookupName": "glob",
"prettyDepType": "resolutions",
},
],
"ignoreNpmrcFile": undefined,
"lernaClient": "npm",
@ -560,6 +624,7 @@ Object {
"datasource": "npm",
"depName": "autoprefixer",
"depType": "dependencies",
"lookupName": "autoprefixer",
"prettyDepType": "dependency",
},
Object {
@ -567,6 +632,7 @@ Object {
"datasource": "npm",
"depName": "bower",
"depType": "dependencies",
"lookupName": "bower",
"prettyDepType": "dependency",
},
Object {
@ -574,6 +640,7 @@ Object {
"datasource": "npm",
"depName": "browserify",
"depType": "dependencies",
"lookupName": "browserify",
"prettyDepType": "dependency",
},
Object {
@ -581,6 +648,7 @@ Object {
"datasource": "npm",
"depName": "browserify-css",
"depType": "dependencies",
"lookupName": "browserify-css",
"prettyDepType": "dependency",
},
Object {
@ -588,6 +656,7 @@ Object {
"datasource": "npm",
"depName": "cheerio",
"depType": "dependencies",
"lookupName": "cheerio",
"prettyDepType": "dependency",
},
Object {
@ -595,11 +664,13 @@ Object {
"datasource": "npm",
"depName": "config",
"depType": "dependencies",
"lookupName": "config",
"prettyDepType": "dependency",
},
Object {
"depName": "enabled",
"depType": "devDependencies",
"lookupName": "enabled",
"prettyDepType": "devDependency",
"skipReason": "invalid-value",
},
@ -608,6 +679,7 @@ Object {
"datasource": "npm",
"depName": "angular",
"depType": "devDependencies",
"lookupName": "angular",
"prettyDepType": "devDependency",
},
Object {
@ -615,6 +687,7 @@ Object {
"datasource": "npm",
"depName": "angular-touch",
"depType": "devDependencies",
"lookupName": "angular-touch",
"prettyDepType": "devDependency",
},
Object {
@ -622,6 +695,7 @@ Object {
"datasource": "npm",
"depName": "angular-sanitize",
"depType": "devDependencies",
"lookupName": "angular-sanitize",
"prettyDepType": "devDependency",
},
Object {
@ -629,8 +703,41 @@ Object {
"datasource": "npm",
"depName": "@angular/core",
"depType": "devDependencies",
"lookupName": "@angular/core",
"prettyDepType": "devDependency",
},
Object {
"currentValue": "1.21.0",
"datasource": "npm",
"depName": "config",
"depType": "resolutions",
"lookupName": "config",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "8.0.0",
"datasource": "npm",
"depName": "**/@angular/cli",
"depType": "resolutions",
"lookupName": "@angular/cli",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.33.0",
"datasource": "npm",
"depName": "**/angular",
"depType": "resolutions",
"lookupName": "angular",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.0.0",
"datasource": "npm",
"depName": "config/glob",
"depType": "resolutions",
"lookupName": "glob",
"prettyDepType": "resolutions",
},
],
"ignoreNpmrcFile": undefined,
"lernaClient": "yarn",
@ -657,6 +764,7 @@ Object {
"datasource": "npm",
"depName": "autoprefixer",
"depType": "dependencies",
"lookupName": "autoprefixer",
"prettyDepType": "dependency",
},
Object {
@ -664,6 +772,7 @@ Object {
"datasource": "npm",
"depName": "bower",
"depType": "dependencies",
"lookupName": "bower",
"prettyDepType": "dependency",
},
Object {
@ -671,6 +780,7 @@ Object {
"datasource": "npm",
"depName": "browserify",
"depType": "dependencies",
"lookupName": "browserify",
"prettyDepType": "dependency",
},
Object {
@ -678,6 +788,7 @@ Object {
"datasource": "npm",
"depName": "browserify-css",
"depType": "dependencies",
"lookupName": "browserify-css",
"prettyDepType": "dependency",
},
Object {
@ -685,6 +796,7 @@ Object {
"datasource": "npm",
"depName": "cheerio",
"depType": "dependencies",
"lookupName": "cheerio",
"prettyDepType": "dependency",
},
Object {
@ -692,11 +804,13 @@ Object {
"datasource": "npm",
"depName": "config",
"depType": "dependencies",
"lookupName": "config",
"prettyDepType": "dependency",
},
Object {
"depName": "enabled",
"depType": "devDependencies",
"lookupName": "enabled",
"prettyDepType": "devDependency",
"skipReason": "invalid-value",
},
@ -705,6 +819,7 @@ Object {
"datasource": "npm",
"depName": "angular",
"depType": "devDependencies",
"lookupName": "angular",
"prettyDepType": "devDependency",
},
Object {
@ -712,6 +827,7 @@ Object {
"datasource": "npm",
"depName": "angular-touch",
"depType": "devDependencies",
"lookupName": "angular-touch",
"prettyDepType": "devDependency",
},
Object {
@ -719,6 +835,7 @@ Object {
"datasource": "npm",
"depName": "angular-sanitize",
"depType": "devDependencies",
"lookupName": "angular-sanitize",
"prettyDepType": "devDependency",
},
Object {
@ -726,8 +843,41 @@ Object {
"datasource": "npm",
"depName": "@angular/core",
"depType": "devDependencies",
"lookupName": "@angular/core",
"prettyDepType": "devDependency",
},
Object {
"currentValue": "1.21.0",
"datasource": "npm",
"depName": "config",
"depType": "resolutions",
"lookupName": "config",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "8.0.0",
"datasource": "npm",
"depName": "**/@angular/cli",
"depType": "resolutions",
"lookupName": "@angular/cli",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.33.0",
"datasource": "npm",
"depName": "**/angular",
"depType": "resolutions",
"lookupName": "angular",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.0.0",
"datasource": "npm",
"depName": "config/glob",
"depType": "resolutions",
"lookupName": "glob",
"prettyDepType": "resolutions",
},
],
"ignoreNpmrcFile": undefined,
"lernaClient": undefined,
@ -776,6 +926,7 @@ Object {
"datasource": "npm",
"depName": "autoprefixer",
"depType": "dependencies",
"lookupName": "autoprefixer",
"prettyDepType": "dependency",
},
Object {
@ -783,6 +934,7 @@ Object {
"datasource": "npm",
"depName": "bower",
"depType": "dependencies",
"lookupName": "bower",
"prettyDepType": "dependency",
},
Object {
@ -790,6 +942,7 @@ Object {
"datasource": "npm",
"depName": "browserify",
"depType": "dependencies",
"lookupName": "browserify",
"prettyDepType": "dependency",
},
Object {
@ -797,6 +950,7 @@ Object {
"datasource": "npm",
"depName": "browserify-css",
"depType": "dependencies",
"lookupName": "browserify-css",
"prettyDepType": "dependency",
},
Object {
@ -804,6 +958,7 @@ Object {
"datasource": "npm",
"depName": "cheerio",
"depType": "dependencies",
"lookupName": "cheerio",
"prettyDepType": "dependency",
},
Object {
@ -811,11 +966,13 @@ Object {
"datasource": "npm",
"depName": "config",
"depType": "dependencies",
"lookupName": "config",
"prettyDepType": "dependency",
},
Object {
"depName": "enabled",
"depType": "devDependencies",
"lookupName": "enabled",
"prettyDepType": "devDependency",
"skipReason": "invalid-value",
},
@ -824,6 +981,7 @@ Object {
"datasource": "npm",
"depName": "angular",
"depType": "devDependencies",
"lookupName": "angular",
"prettyDepType": "devDependency",
},
Object {
@ -831,6 +989,7 @@ Object {
"datasource": "npm",
"depName": "angular-touch",
"depType": "devDependencies",
"lookupName": "angular-touch",
"prettyDepType": "devDependency",
},
Object {
@ -838,6 +997,7 @@ Object {
"datasource": "npm",
"depName": "angular-sanitize",
"depType": "devDependencies",
"lookupName": "angular-sanitize",
"prettyDepType": "devDependency",
},
Object {
@ -845,8 +1005,41 @@ Object {
"datasource": "npm",
"depName": "@angular/core",
"depType": "devDependencies",
"lookupName": "@angular/core",
"prettyDepType": "devDependency",
},
Object {
"currentValue": "1.21.0",
"datasource": "npm",
"depName": "config",
"depType": "resolutions",
"lookupName": "config",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "8.0.0",
"datasource": "npm",
"depName": "**/@angular/cli",
"depType": "resolutions",
"lookupName": "@angular/cli",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.33.0",
"datasource": "npm",
"depName": "**/angular",
"depType": "resolutions",
"lookupName": "angular",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.0.0",
"datasource": "npm",
"depName": "config/glob",
"depType": "resolutions",
"lookupName": "glob",
"prettyDepType": "resolutions",
},
],
"ignoreNpmrcFile": undefined,
"lernaClient": "npm",
@ -895,6 +1088,7 @@ Object {
"datasource": "npm",
"depName": "autoprefixer",
"depType": "dependencies",
"lookupName": "autoprefixer",
"prettyDepType": "dependency",
},
Object {
@ -902,6 +1096,7 @@ Object {
"datasource": "npm",
"depName": "bower",
"depType": "dependencies",
"lookupName": "bower",
"prettyDepType": "dependency",
},
Object {
@ -909,6 +1104,7 @@ Object {
"datasource": "npm",
"depName": "browserify",
"depType": "dependencies",
"lookupName": "browserify",
"prettyDepType": "dependency",
},
Object {
@ -916,6 +1112,7 @@ Object {
"datasource": "npm",
"depName": "browserify-css",
"depType": "dependencies",
"lookupName": "browserify-css",
"prettyDepType": "dependency",
},
Object {
@ -923,6 +1120,7 @@ Object {
"datasource": "npm",
"depName": "cheerio",
"depType": "dependencies",
"lookupName": "cheerio",
"prettyDepType": "dependency",
},
Object {
@ -930,11 +1128,13 @@ Object {
"datasource": "npm",
"depName": "config",
"depType": "dependencies",
"lookupName": "config",
"prettyDepType": "dependency",
},
Object {
"depName": "enabled",
"depType": "devDependencies",
"lookupName": "enabled",
"prettyDepType": "devDependency",
"skipReason": "invalid-value",
},
@ -943,6 +1143,7 @@ Object {
"datasource": "npm",
"depName": "angular",
"depType": "devDependencies",
"lookupName": "angular",
"prettyDepType": "devDependency",
},
Object {
@ -950,6 +1151,7 @@ Object {
"datasource": "npm",
"depName": "angular-touch",
"depType": "devDependencies",
"lookupName": "angular-touch",
"prettyDepType": "devDependency",
},
Object {
@ -957,6 +1159,7 @@ Object {
"datasource": "npm",
"depName": "angular-sanitize",
"depType": "devDependencies",
"lookupName": "angular-sanitize",
"prettyDepType": "devDependency",
},
Object {
@ -964,8 +1167,41 @@ Object {
"datasource": "npm",
"depName": "@angular/core",
"depType": "devDependencies",
"lookupName": "@angular/core",
"prettyDepType": "devDependency",
},
Object {
"currentValue": "1.21.0",
"datasource": "npm",
"depName": "config",
"depType": "resolutions",
"lookupName": "config",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "8.0.0",
"datasource": "npm",
"depName": "**/@angular/cli",
"depType": "resolutions",
"lookupName": "@angular/cli",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.33.0",
"datasource": "npm",
"depName": "**/angular",
"depType": "resolutions",
"lookupName": "angular",
"prettyDepType": "resolutions",
},
Object {
"currentValue": "1.0.0",
"datasource": "npm",
"depName": "config/glob",
"depType": "resolutions",
"lookupName": "glob",
"prettyDepType": "resolutions",
},
],
"ignoreNpmrcFile": undefined,
"lernaClient": undefined,

View file

@ -22,6 +22,13 @@ import * as nodeVersioning from '../../../versioning/node';
import * as datasourceNpm from '../../../datasource/npm';
import * as datasourceGithubTags from '../../../datasource/github-tags';
function parseLookupname(depType: string, depName: string): string {
if (depType !== 'resolutions') return depName;
const [, name] = /((?:@[^/]+\/)?[^/@]+)$/.exec(depName);
return name;
}
export async function extractPackageFile(
content: string,
fileName: string,
@ -136,6 +143,7 @@ export async function extractPackageFile(
peerDependencies: 'peerDependency',
engines: 'engine',
volta: 'volta',
resolutions: 'resolutions',
};
function extractDependency(
@ -275,11 +283,16 @@ export async function extractPackageFile(
for (const [depName, val] of Object.entries(
packageJson[depType] as NpmPackageDependeny
)) {
const lookupName = parseLookupname(depType, depName);
const dep: PackageDependency = {
depType,
depName,
lookupName,
};
Object.assign(dep, extractDependency(depType, depName, val));
Object.assign(
dep,
extractDependency(depType, lookupName ?? depName, val)
);
if (depName === 'node') {
// This is a special case for Node.js to group it together with other managers
dep.commitMessageTopic = 'Node.js';

View file

@ -133,6 +133,20 @@ describe('workers/branch/package-json', () => {
'1.22.0'
);
});
it('updates glob resolutions without dep', () => {
const upgrade = {
depType: 'resolutions',
depName: '**/@angular/cli',
newValue: '8.1.0',
};
const testContent = npmUpdater.updateDependency({
fileContent: input01Content,
upgrade,
});
expect(JSON.parse(testContent).resolutions['**/@angular/cli']).toEqual(
'8.1.0'
);
});
it('replaces only the first instance of a value', () => {
const upgrade = {
depType: 'devDependencies',