Skip to content

Commit 2d4503e

Browse files
committed
refactor: replace matchPackageNames to matchDepNames
Here's a breakdown of their preferences: * **`matchDepNames` is generally preferred for clarity and accuracy.** * `matchDepNames` was introduced specifically to match against the `depName` field, which typically represents the "short" or primary name of a dependency (e.g., `react`, `lodash`). * Using `matchDepNames` makes your Renovate configuration more explicit and easier to understand, as its name directly reflects its intended behavior. * **`matchPackageNames` has historical baggage and can be misleading.** * Historically, `matchPackageNames` in Renovate also matched against the `depName` by default, despite its name suggesting it would match the `packageName` field. This was due to an earlier implementation decision. * While `matchPackageNames` might still match `depName` in many current setups (for backward compatibility), it can be confusing and lead to unexpected behavior if you're expecting it to match the `packageName` (which is often a more complete or specific identifier, like `org.apache.maven:maven-core`).
1 parent 9d244bf commit 2d4503e

File tree

1 file changed

+66
-68
lines changed

1 file changed

+66
-68
lines changed

renovate-presets/default.json5

Lines changed: 66 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
{
2-
'$schema': 'https://docs.renovatebot.com/renovate-schema.json',
3-
'extends': ['group:monorepos'],
4-
'dependencyDashboard': true,
5-
'rangeStrategy': 'replace',
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["group:monorepos"],
4+
"dependencyDashboard": true,
5+
"rangeStrategy": "replace",
66

77
// Schedule Renovate to run during off-peak hours
8-
'schedule': ['after 10:00pm every weekday', 'before 5:00am every weekday', 'every weekend'],
9-
'prConcurrentLimit': 8,
10-
'prHourlyLimit': 4,
11-
'timezone': 'America/Tijuana',
8+
"schedule": ["after 10:00pm every weekday", "before 5:00am every weekday", "every weekend"],
9+
"prConcurrentLimit": 8,
10+
"prHourlyLimit": 4,
11+
"timezone": "America/Tijuana",
1212

1313
// Commit and PR customization
14-
'commitBody': 'See associated pull request for more information.',
15-
'semanticCommits': 'enabled',
16-
'semanticCommitScope': '',
17-
'semanticCommitType': 'build',
18-
'labels': ['area: build & ci', 'action: review'],
19-
20-
'lockFileMaintenance': {
21-
'enabled': true,
14+
"commitBody": "See associated pull request for more information.",
15+
"semanticCommits": "enabled",
16+
"semanticCommitScope": "",
17+
"semanticCommitType": "build",
18+
"labels": ["area: build & ci", "action: review"],
19+
20+
"lockFileMaintenance": {
21+
"enabled": true,
2222
},
2323

2424
// Ignored dependencies in all repositories
25-
'ignoreDeps': [
26-
'build_bazel_rules_nodejs',
27-
'rules_pkg',
28-
'yarn', // Yarn is copied locally in all repositories where needed.
25+
"ignoreDeps": [
26+
"build_bazel_rules_nodejs",
27+
"rules_pkg",
28+
"yarn", // Yarn is copied locally in all repositories where needed.
2929
],
3030

31-
'packageRules': [
31+
"packageRules": [
3232
// ============================================================================
3333
// GENERAL GROUPING & UPDATE BEHAVIOR
3434
// ============================================================================
3535

3636
// Group all non-major updates (minor and patch) together
3737
{
38-
'groupName': 'all non-major dependencies',
39-
'matchPackageNames': ['*', '!node', '!pnpm', '!npm', '!yarn'],
40-
'matchUpdateTypes': ['digest', 'patch', 'minor'],
38+
"groupName": "all non-major dependencies",
39+
"matchDepNames": ["*", "!node", "!pnpm", "!npm", "!yarn"],
40+
"matchUpdateTypes": ["digest", "patch", "minor"],
4141
},
4242

4343
// ============================================================================
@@ -46,8 +46,8 @@
4646

4747
// Group Bazel updates
4848
{
49-
'groupName': 'bazel dependencies',
50-
'matchManagers': ['bazel'],
49+
"groupName": "bazel dependencies",
50+
"matchManagers": ["bazel"],
5151
},
5252

5353
// ============================================================================
@@ -56,41 +56,41 @@
5656

5757
// Group updates related to Angular ecosystem across repositories
5858
{
59-
'groupName': 'cross-repo angular dependencies',
60-
'followTag': 'next',
61-
'separateMajorMinor': false,
62-
'schedule': ['at any time'],
63-
'matchPackageNames': [
64-
'@angular-devkit/**',
65-
'@angular/**',
66-
'@schematics/**',
67-
'angular/**',
68-
'ng-packagr',
59+
"groupName": "cross-repo angular dependencies",
60+
"followTag": "next",
61+
"separateMajorMinor": false,
62+
"schedule": ["at any time"],
63+
"matchDepNames": [
64+
"@angular-devkit/**",
65+
"@angular/**",
66+
"@schematics/**",
67+
"angular/**",
68+
"ng-packagr",
6969
],
7070
},
7171

72-
// Disable 'next' tag tracking on non-main branches
72+
// Disable "next" tag tracking on non-main branches
7373
{
74-
'matchBaseBranches': ['!main'],
75-
'followTag': null,
74+
"matchBaseBranches": ["!main"],
75+
"followTag": null,
7676
},
7777

7878
// Keep minor and patch updates separate for TypeScript
7979
{
80-
'matchPackageNames': ['typescript'],
81-
'separateMinorPatch': true,
80+
"matchDepNames": ["typescript"],
81+
"separateMinorPatch": true,
8282
},
8383

8484
// Group TypeScript-related packages
8585
{
86-
'groupName': 'typescript dependencies',
87-
'matchPackageNames': ['typescript', 'tslib'],
86+
"groupName": "typescript dependencies",
87+
"matchDepNames": ["typescript", "tslib"],
8888
},
8989

9090
// Limit how many times these packages get updated (They deploy each merged PR)
9191
{
92-
'matchPackageNames': ['renovate', 'quicktype-core'],
93-
'schedule': ['on sunday and wednesday'],
92+
"matchDepNames": ["renovate", "quicktype-core"],
93+
"schedule": ["on sunday and wednesday"],
9494
},
9595

9696
// ============================================================================
@@ -99,9 +99,9 @@
9999

100100
// Group dependencies in the scorecard GitHub Actions workflow
101101
{
102-
'groupName': 'scorecard action dependencies',
103-
'matchFileNames': ['.github/workflows/scorecard.yml'],
104-
'matchPackageNames': ['*'],
102+
"groupName": "scorecard action dependencies",
103+
"matchFileNames": [".github/workflows/scorecard.yml"],
104+
"matchDepNames": ["*"],
105105
},
106106

107107
// ============================================================================
@@ -110,33 +110,31 @@
110110

111111
// Disable updates for placeholder or 0.0.0-style versions
112112
{
113-
'enabled': false,
114-
'matchCurrentVersion': '/^[~^]?0\\.0\\.0-/',
113+
"enabled": false,
114+
"matchCurrentVersion": "/^[~^]?0\\.0\\.0-/",
115115
},
116116

117117
// Disable major updates for specified dependencies
118118
{
119-
'enabled': false,
120-
'matchDepNames': [
121-
'bazel', // bazelisk bazel verison
119+
"enabled": false,
120+
"matchDepNames": [
121+
"@types/node",
122+
"node",
123+
"bazel", // bazelisk bazel verison
124+
"npm",
125+
"pnpm",
126+
"rxjs",
127+
"tslib",
128+
"yarn",
122129
],
123-
'matchPackageNames': [
124-
'@types/node',
125-
'node',
126-
'npm',
127-
'pnpm',
128-
'rxjs',
129-
'tslib',
130-
'yarn',
131-
],
132-
'matchUpdateTypes': ['major'],
130+
"matchUpdateTypes": ["major"],
133131
},
134132

135133
// Disable TypeScript major and minor updates
136134
{
137-
'enabled': false,
138-
'matchPackageNames': ['typescript'],
139-
'matchUpdateTypes': ['major', 'minor'],
140-
},
141-
],
135+
"enabled": false,
136+
"matchDepNames": ["typescript"],
137+
"matchUpdateTypes": ["major", "minor"],
138+
}
139+
]
142140
}

0 commit comments

Comments
 (0)