Skip to content

Commit

Permalink
feat(config): migrate yarn -> npm in enabledManagers (renovatebot#11965)
Browse files Browse the repository at this point in the history
  • Loading branch information
olegkrivtsov authored Oct 20, 2021
1 parent 2d2a599 commit c7f74e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/config/__snapshots__/migration.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ Object {
"dependencyDashboard": true,
"dependencyDashboardTitle": "foo",
"enabled": true,
"enabledManagers": Array [
"npm",
],
"exposeAllEnv": true,
"extends": Array [
":automergeBranch",
Expand Down
1 change: 1 addition & 0 deletions lib/config/migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ describe('config/migration', () => {
},
],
raiseDeprecationWarnings: false,
enabledManagers: ['yarn'],
} as any;
const parentConfig = { ...defaultConfig, semanticCommits: 'disabled' };
const { isMigrated, migratedConfig } = configMigration.migrateConfig(
Expand Down
6 changes: 6 additions & 0 deletions lib/config/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ export function migrateConfig(
} else if (val !== 'enabled' && val !== 'disabled') {
migratedConfig.semanticCommits = 'auto';
}
} else if (key === 'enabledManagers' && is.array(val)) {
// Replace yarn with npm, since yarn actually uses npm as package manager
migratedConfig.enabledManagers = migratedConfig.enabledManagers.map(
(element) => (element === 'yarn' ? 'npm' : element)
);
} else if (parentKey === 'hostRules' && key === 'platform') {
migratedConfig.hostType = val;
delete migratedConfig.platform;
Expand Down Expand Up @@ -550,6 +555,7 @@ export function migrateConfig(
}
delete migratedConfig[key];
}

const migratedTemplates = {
fromVersion: 'currentVersion',
newValueMajor: 'newMajor',
Expand Down

0 comments on commit c7f74e3

Please sign in to comment.