mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
fix: migrate fields within depTypes (#718)
This commit is contained in:
parent
52b2de3bdb
commit
9d0cbb2e5d
3 changed files with 8 additions and 9 deletions
|
@ -54,8 +54,6 @@ function migrateConfig(config, parentConfig) {
|
|||
migratedConfig.major = migratedConfig.major || {};
|
||||
migratedConfig.major.automerge = false;
|
||||
} else if (val === 'minor') {
|
||||
migratedConfig.patch = migratedConfig.patch || {};
|
||||
migratedConfig.patch.automerge = true;
|
||||
migratedConfig.minor = migratedConfig.minor || {};
|
||||
migratedConfig.minor.automerge = true;
|
||||
migratedConfig.major = migratedConfig.major || {};
|
||||
|
@ -104,7 +102,7 @@ function migrateConfig(config, parentConfig) {
|
|||
if (isObject(depType)) {
|
||||
const depTypeName = depType.depType;
|
||||
if (depTypeName) {
|
||||
migratedConfig[depTypeName] = { ...depType };
|
||||
migratedConfig[depTypeName] = migrateConfig(depType).migratedConfig;
|
||||
delete migratedConfig[depTypeName].depType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,6 @@ Object {
|
|||
"minor": Object {
|
||||
"automerge": true,
|
||||
},
|
||||
"patch": Object {
|
||||
"automerge": true,
|
||||
},
|
||||
},
|
||||
"enabled": true,
|
||||
"lockFileConfig": Object {
|
||||
|
@ -22,6 +19,12 @@ Object {
|
|||
},
|
||||
"onboarding": false,
|
||||
"optionalDependencies": Object {
|
||||
"major": Object {
|
||||
"automerge": false,
|
||||
},
|
||||
"minor": Object {
|
||||
"automerge": true,
|
||||
},
|
||||
"respectLatest": false,
|
||||
},
|
||||
"packageRules": Array [
|
||||
|
@ -96,8 +99,5 @@ Object {
|
|||
},
|
||||
},
|
||||
],
|
||||
"patch": Object {
|
||||
"automerge": true,
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -41,6 +41,7 @@ describe('config/migration', () => {
|
|||
{
|
||||
depType: 'optionalDependencies',
|
||||
respectLatest: false,
|
||||
automerge: 'minor',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue