diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index d3bddbf4ebf364..c3c79115b399e0 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2886,6 +2886,12 @@ See also `excludePackageNames`. The above will configure `rangeStrategy` to `pin` only for the package `angular`. + +!!! note + `matchPackageNames` will try matching `packageName` first and then fall back to matching `depName`. + If the fallback is used, Renovate will log a warning, because the fallback will be removed in a future release. + Use `matchDepNames` instead. + ### matchPackagePatterns Use this field if you want to have one or more package names patterns in your package rule. @@ -2904,6 +2910,12 @@ See also `excludePackagePatterns`. The above will configure `rangeStrategy` to `replace` for any package starting with `angular`. + +!!! note + `matchPackagePatterns` will try matching `packageName` first and then fall back to matching `depName`. + If the fallback is used, Renovate will log a warning, because the fallback will be removed in a future release. + Use `matchDepPatterns` instead. + ### matchPackagePrefixes Use this field to match a package prefix without needing to write a regex expression. @@ -2922,8 +2934,11 @@ See also `excludePackagePrefixes`. Like the earlier `matchPackagePatterns` example, the above will configure `rangeStrategy` to `replace` for any package starting with `angular`. -`matchPackagePrefixes` will match against `packageName` first, and then `depName`, however `depName` matching is deprecated and will be removed in a future major release. -If matching against `depName`, use `matchDepPatterns` instead. + +!!! note + `matchPackagePrefixes` will try matching `packageName` first and then fall back to matching `depName`. + If the fallback is used, Renovate will log a warning, because the fallback will be removed in a future release. + Use `matchDepPatterns` instead. ### matchSourceUrlPrefixes diff --git a/lib/util/package-rules/package-names.spec.ts b/lib/util/package-rules/package-names.spec.ts index 81adac82e44e94..522f0ea0c3cc2c 100644 --- a/lib/util/package-rules/package-names.spec.ts +++ b/lib/util/package-rules/package-names.spec.ts @@ -54,7 +54,7 @@ describe('util/package-rules/package-names', () => { }, ); expect(result).toBeTrue(); - expect(logger.logger.once.info).toHaveBeenCalled(); + expect(logger.logger.once.warn).toHaveBeenCalled(); }); }); @@ -108,7 +108,7 @@ describe('util/package-rules/package-names', () => { }, ); expect(result).toBeTrue(); - expect(logger.logger.once.info).toHaveBeenCalled(); + expect(logger.logger.once.warn).toHaveBeenCalled(); }); }); }); diff --git a/lib/util/package-rules/package-names.ts b/lib/util/package-rules/package-names.ts index 7af49f4beb979b..ee8cc6befb14c7 100644 --- a/lib/util/package-rules/package-names.ts +++ b/lib/util/package-rules/package-names.ts @@ -21,7 +21,7 @@ export class PackageNameMatcher extends Matcher { } if (matchPackageNames.includes(depName)) { - logger.once.info( + logger.once.warn( { packageRule, packageName, depName }, 'Use matchDepNames instead of matchPackageNames', ); @@ -48,7 +48,7 @@ export class PackageNameMatcher extends Matcher { } if (excludePackageNames.includes(depName)) { - logger.once.info( + logger.once.warn( { packageRule, packageName, depName }, 'Use excludeDepNames instead of excludePackageNames', ); diff --git a/lib/util/package-rules/package-patterns.ts b/lib/util/package-rules/package-patterns.ts index bc4f4029ed788b..9fc28c7509f821 100644 --- a/lib/util/package-rules/package-patterns.ts +++ b/lib/util/package-rules/package-patterns.ts @@ -39,7 +39,7 @@ export class PackagePatternsMatcher extends Matcher { return true; } if (matchPatternsAgainstName(matchPackagePatterns, depName)) { - logger.once.info( + logger.once.warn( { packageRule, packageName, depName }, 'Use matchDepPatterns instead of matchPackagePatterns', ); @@ -70,7 +70,7 @@ export class PackagePatternsMatcher extends Matcher { } if (matchPatternsAgainstName(excludePackagePatterns, depName)) { - logger.once.info( + logger.once.warn( { packageRule, packageName, depName }, 'Use excludeDepPatterns instead of excludePackagePatterns', ); diff --git a/lib/util/package-rules/package-prefixes.ts b/lib/util/package-rules/package-prefixes.ts index bb9b015b2ecaf4..a5502654cb3072 100644 --- a/lib/util/package-rules/package-prefixes.ts +++ b/lib/util/package-rules/package-prefixes.ts @@ -23,7 +23,7 @@ export class PackagePrefixesMatcher extends Matcher { return true; } if (matchPackagePrefixes.some((prefix) => depName.startsWith(prefix))) { - logger.once.info( + logger.once.warn( { packageName, depName }, 'Use matchDepPatterns instead of matchPackagePrefixes', ); @@ -52,7 +52,7 @@ export class PackagePrefixesMatcher extends Matcher { return true; } if (excludePackagePrefixes.some((prefix) => depName.startsWith(prefix))) { - logger.once.info( + logger.once.warn( { packageName, depName }, 'Use excludeDepPatterns instead of excludePackagePrefixes', );