refactor: add extends config massage (#1256)

This commit is contained in:
Rhys Arkins 2017-12-01 07:16:17 +01:00 committed by GitHub
parent d948553a2e
commit 5e68613150
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View file

@ -47,6 +47,16 @@ function migrateConfig(config) {
} else {
migratedConfig.semanticCommitScope = null;
}
} else if (key === 'extends' && Array.isArray(val)) {
for (let i = 0; i < val.length; i += 1) {
if (val[i] === 'config:application' || val[i] === ':js-app') {
isMigrated = true;
migratedConfig.extends[i] = 'config:js-app';
} else if (val[i] === 'config:library') {
isMigrated = true;
migratedConfig.extends[i] = 'config:js-lib';
}
}
} else if (key === 'automergeMinor') {
isMigrated = true;
migratedConfig.minor = migratedConfig.minor || {};

View file

@ -21,6 +21,10 @@ Object {
"schedule": Array [],
},
"enabled": true,
"extends": Array [
"config:js-app",
"config:js-lib",
],
"ignorePaths": Array [
"node_modules/",
],

View file

@ -6,6 +6,7 @@ describe('config/migration', () => {
it('it migrates config', () => {
const config = {
enabled: true,
extends: [':js-app', 'config:library'],
maintainYarnLock: true,
onboarding: 'false',
automerge: 'none',