diff --git a/docs/development/adding-a-package-manager.md b/docs/development/adding-a-package-manager.md index 6c70ba8e00fe60..5d3fefbfc49775 100644 --- a/docs/development/adding-a-package-manager.md +++ b/docs/development/adding-a-package-manager.md @@ -1,6 +1,6 @@ # Adding a Package Manager -This document explains how to add a new language/package manager. +This document explains how to add a new package manager. ## Code structure @@ -21,7 +21,7 @@ The manager's `index.ts` file supports the following values or functions: | `extractPackageFile` | | yes | | `extractAllPackageFiles` | yes | yes | | `getRangeStrategy` | yes | | -| `language` | yes | | +| `categories` | yes | | | `supportsLockFileMaintenance` | yes | | | `updateArtifacts` | yes | yes | | `updateDependency` | yes | | @@ -80,10 +80,6 @@ The `npm` manager uses the `getRangeStrategy` function to pin `devDependencies` If left undefined, then a default `getRangeStrategy` will be used that always returns "replace". -### `language` (optional) - -This is used when more than one package manager shares settings from a common language. - ### `supportsLockFileMaintenance` (optional) Set to `true` if this package manager needs to update lock files in addition to package files. diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index f4b45f501dd252..442d3360bdd667 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -763,24 +763,6 @@ Descriptions fields embedded within presets are also collated as part of the onb Add to this object if you wish to define rules that apply only to PRs that update digests. -## docker - -Add config here if you wish it to apply to Docker package managers Dockerfile and Docker Compose. -If instead you mean to apply settings to any package manager that updates using the Docker _datasource_, use a package rule instead, e.g. - -```json -{ - "packageRules": [ - { - "matchDatasources": ["docker"], - "labels": ["docker-update"] - } - ] -} -``` - -## dotnet - ## draftPR If you want the PRs created by Renovate to be considered as drafts rather than normal PRs, you could add this property to your `renovate.json`: @@ -1132,16 +1114,6 @@ If you need to modify this path, for example in order to ignore directories, you } ``` -## golang - -Configuration added here applies for all Go-related updates. -The only supported package manager for Go is the native Go Modules (the `gomod` manager). - -For self-hosted users, `GOPROXY`, `GONOPROXY`, `GOPRIVATE` and `GOINSECURE` environment variables are supported ([reference](https://go.dev/ref/mod#module-proxy)). - -Usage of `direct` will fallback to the Renovate-native release fetching mechanism. -Also we support the `off` keyword which will stop any fetching immediately. - ## group The default configuration for groups are essentially internal to Renovate and you normally shouldn't need to modify them. @@ -1664,14 +1636,6 @@ Currently this applies to the `minimumReleaseAge` check only. The `flexible` mode can result in "flapping" of Pull Requests, for example: a pending PR with version `1.0.3` is first released but then downgraded to `1.0.2` once it passes `minimumReleaseAge`. We recommend that you use the `strict` mode, and enable the `dependencyDashboard` so that you can see suppressed PRs. -## java - -Use this configuration option for shared config across all Java projects (Gradle and Maven). - -## js - -Use this configuration option for shared config across npm/Yarn/pnpm and meteor package managers. - ## labels By default, Renovate won't add any labels to PRs. @@ -1810,12 +1774,6 @@ This works because Renovate will add a "renovate/stability-days" pending status Add to this object if you wish to define rules that apply only to minor updates. -## node - -Using this configuration option allows you to apply common configuration and policies across all Node.js version updates even if managed by different package managers (`npm`, `yarn`, etc.). - -Check out our [Node.js documentation](https://docs.renovatebot.com/node) for a comprehensive explanation of how the `node` option can be used. - ## npmToken See [Private npm module support](./getting-started/private-packages.md) for details on how this is used. @@ -2055,17 +2013,23 @@ See also `matchPackagePrefixes`. The above will match all package names starting with `eslint` but exclude ones starting with `eslint-foo`. -### matchLanguages +### matchCategories + +Use `matchCategories` to restrict rules to a particular language or group. +Matching is done using "any" logic, i.e. "match any of the following categories". +The categories can be found in the [manager documentation](./modules/manager/index.md). -Use this field to restrict rules to a particular language. e.g. + +!!! note + Rules with `matchCategories` are only applied _after_ extraction of dependencies. + If you want to configure which managers are being extracted at all, use `enabledManagers` instead. ```json { "packageRules": [ { - "matchPackageNames": ["request"], - "matchLanguages": ["python"], - "enabled": false + "matchCategories": ["python"], + "addLabels": ["py"] } ] } @@ -2528,8 +2492,6 @@ For example to replace the npm package `jade` with version `2.0.0` of the packag Add to this object if you wish to define rules that apply only to patch updates. -## php - ## pin Add to this object if you wish to define rules that apply only to PRs that pin dependencies. @@ -2864,10 +2826,6 @@ Set `pruneBranchAfterAutomerge` to `false` to keep the branch after automerging. Configure to `false` to disable deleting orphan branches and autoclosing PRs. Defaults to `true`. -## python - -Currently the only Python package manager is `pip` - specifically for `requirements.txt` and `requirements.pip` files, or any file that matches the pattern `requirements-*.(txt|pip)` - so adding any config to this `python` object is essentially the same as adding it to the `pip_requirements` object instead. - ## rangeStrategy Behavior: @@ -3314,10 +3272,6 @@ Renovate's "rollback" feature exists to propose a downgrade to the next-highest Renovate does not create these rollback PRs by default, so this functionality needs to be opted-into. We recommend you do this selectively with `packageRules` and not globally. -## ruby - -## rust - ## schedule The `schedule` option allows you to define times of week or month for Renovate updates. diff --git a/docs/usage/golang.md b/docs/usage/golang.md index 64535f9499aaf1..d9edec8e713b8f 100644 --- a/docs/usage/golang.md +++ b/docs/usage/golang.md @@ -7,6 +7,15 @@ description: Go modules support in Renovate Renovate supports upgrading dependencies in `go.mod` files and their accompanying `go.sum` checksums. +If you're self-hosting Renovate, you may use these environment variables: + +- `GOPROXY` +- `GONOPROXY` +- `GOPRIVATE` +- `GOINSECURE` + +To learn what these variables do, read the [Go Modules Reference about the`GOPROXY` protocol](https://go.dev/ref/mod#module-proxy). + ## How It Works 1. Renovate searches in each repository for any `go.mod` files diff --git a/lib/config/__snapshots__/validation.spec.ts.snap b/lib/config/__snapshots__/validation.spec.ts.snap index fd32097b86fbe2..41f8bd38992650 100644 --- a/lib/config/__snapshots__/validation.spec.ts.snap +++ b/lib/config/__snapshots__/validation.spec.ts.snap @@ -167,14 +167,10 @@ exports[`config/validation validateConfig(config) errors if invalid combinations ] `; -exports[`config/validation validateConfig(config) errors if language or manager objects are nested 1`] = ` +exports[`config/validation validateConfig(config) errors if manager objects are nested 1`] = ` [ { - "message": "The "docker" object can only be configured at the top level of a config but was found inside "major.minor"", - "topic": "Configuration Error", - }, - { - "message": "The "gradle" object can only be configured at the top level of a config but was found inside "java"", + "message": "The "gradle" object can only be configured at the top level of a config but was found inside "maven"", "topic": "Configuration Error", }, ] @@ -233,11 +229,11 @@ exports[`config/validation validateConfig(config) returns nested errors 1`] = ` exports[`config/validation validateConfig(config) selectors outside packageRules array trigger errors 1`] = ` [ { - "message": "docker.minor.matchDepNames: matchDepNames should be inside a \`packageRule\` only", + "message": "ansible.minor.matchDepNames: matchDepNames should be inside a \`packageRule\` only", "topic": "Configuration Error", }, { - "message": "docker.minor.matchPackageNames: matchPackageNames should be inside a \`packageRule\` only", + "message": "ansible.minor.matchPackageNames: matchPackageNames should be inside a \`packageRule\` only", "topic": "Configuration Error", }, { diff --git a/lib/config/index.ts b/lib/config/index.ts index 886b0a688842fa..e612edc7de6fd4 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -1,5 +1,5 @@ import { logger } from '../logger'; -import { get, getLanguageList, getManagerList } from '../modules/manager'; +import { get, getManagerList } from '../modules/manager'; import * as options from './options'; import type { AllConfig, @@ -17,18 +17,15 @@ export function getManagerConfig( ): ManagerConfig { let managerConfig: ManagerConfig = { ...config, - language: null, manager, }; - const language = get(manager, 'language'); - if (language) { - // TODO: fix types #7154 - managerConfig = mergeChildConfig(managerConfig, config[language] as any); - managerConfig.language = language; + const categories = get(manager, 'categories'); + if (categories) { + managerConfig.categories = categories; } // TODO: fix types #7154 managerConfig = mergeChildConfig(managerConfig, config[manager] as any); - for (const i of getLanguageList().concat(getManagerList())) { + for (const i of getManagerList()) { delete managerConfig[i]; } return managerConfig; diff --git a/lib/config/migration.spec.ts b/lib/config/migration.spec.ts index eae90ddd53c9fe..02efcb1ce6b321 100644 --- a/lib/config/migration.spec.ts +++ b/lib/config/migration.spec.ts @@ -564,7 +564,7 @@ describe('config/migration', () => { matchBaseBranches: ['master'], matchDatasources: ['orb'], matchDepTypes: ['peerDependencies'], - matchLanguages: ['python'], + matchCategories: ['python'], matchManagers: ['dockerfile'], matchPackageNames: ['foo'], matchPackagePatterns: ['^bar'], diff --git a/lib/config/migrations/custom/package-rules-migration.spec.ts b/lib/config/migrations/custom/package-rules-migration.spec.ts index b5f6afaf7a016a..3e6ee625006361 100644 --- a/lib/config/migrations/custom/package-rules-migration.spec.ts +++ b/lib/config/migrations/custom/package-rules-migration.spec.ts @@ -57,4 +57,54 @@ describe('config/migrations/custom/package-rules-migration', () => { } ); }); + + it('should migrate languages to categories', () => { + expect(PackageRulesMigration).toMigrate( + { + packageRules: [ + { + matchLanguages: ['docker', 'js'], + addLabels: ['docker'], + }, + { + languages: ['java'], + addLabels: ['java'], + }, + ], + }, + { + packageRules: [ + { + matchCategories: ['docker', 'js'], + addLabels: ['docker'], + }, + { + matchCategories: ['java'], + addLabels: ['java'], + }, + ], + } + ); + }); + + it('should migrate single match rule', () => { + expect(PackageRulesMigration).toMigrate( + { + packageRules: [ + { + matchLanguages: ['python'], + addLabels: ['py'], + }, + ], + }, + { + packageRules: [ + { + matchCategories: ['python'], + addLabels: ['py'], + }, + ], + } + ); + }); }); diff --git a/lib/config/migrations/custom/package-rules-migration.ts b/lib/config/migrations/custom/package-rules-migration.ts index 9da8469fe3c23c..a1e0712ea470dc 100644 --- a/lib/config/migrations/custom/package-rules-migration.ts +++ b/lib/config/migrations/custom/package-rules-migration.ts @@ -5,7 +5,8 @@ export const renameMap = { matchFiles: 'matchFileNames', matchPaths: 'matchFileNames', paths: 'matchFileNames', - languages: 'matchLanguages', + languages: 'matchCategories', + matchLanguages: 'matchCategories', baseBranchList: 'matchBaseBranches', managers: 'matchManagers', datasources: 'matchDatasources', diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index ee6cf0be989c9e..d5d02f1e9130cf 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1,7 +1,6 @@ import { getManagers } from '../../modules/manager'; import { getPlatformList } from '../../modules/platform'; import { getVersioningList } from '../../modules/versioning'; -import * as dockerVersioning from '../../modules/versioning/docker'; import type { RenovateOptions } from '../types'; const options: RenovateOptions[] = [ @@ -994,9 +993,9 @@ const options: RenovateOptions[] = [ env: false, }, { - name: 'matchLanguages', + name: 'matchCategories', description: - 'List of languages to match (e.g. `["python"]`). Valid only within a `packageRules` object.', + 'List of categories to match (for example: `["python"]`). Valid only within a `packageRules` object.', type: 'array', subType: 'string', allowString: true, @@ -2079,25 +2078,6 @@ const options: RenovateOptions[] = [ cli: false, env: false, }, - { - name: 'js', - description: 'Configuration object for JavaScript language.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - }, - { - name: 'golang', - description: 'Configuration object for Go language.', - stage: 'package', - type: 'object', - default: { - commitMessageTopic: 'module {{depName}}', - }, - mergeable: true, - cli: false, - }, { name: 'postUpdateOptions', description: @@ -2122,64 +2102,6 @@ const options: RenovateOptions[] = [ env: false, mergeable: true, }, - { - name: 'ruby', - description: 'Configuration object for Ruby language.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, - { - name: 'rust', - description: 'Configuration option for Rust package management.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, - { - name: 'node', - description: 'Configuration object for Node version renovation.', - stage: 'package', - type: 'object', - default: { - commitMessageTopic: 'Node.js', - }, - mergeable: true, - cli: false, - }, - { - name: 'docker', - description: 'Configuration object for Docker language.', - stage: 'package', - type: 'object', - default: { - versioning: dockerVersioning.id, - }, - mergeable: true, - cli: false, - }, - { - name: 'php', - description: 'Configuration object for PHP.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, - { - name: 'python', - description: 'Configuration object for Python.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, { name: 'constraints', description: @@ -2198,24 +2120,6 @@ const options: RenovateOptions[] = [ 'poetry', ], }, - { - name: 'java', - description: 'Configuration object for all Java package managers.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, - { - name: 'dotnet', - description: 'Configuration object for .NET language.', - stage: 'package', - type: 'object', - default: {}, - mergeable: true, - cli: false, - }, { name: 'hostRules', description: 'Host rules/configuration including credentials.', diff --git a/lib/config/presets/internal/default.ts b/lib/config/presets/internal/default.ts index 977e42420ddaeb..4605a2a232be9c 100644 --- a/lib/config/presets/internal/default.ts +++ b/lib/config/presets/internal/default.ts @@ -210,7 +210,10 @@ export const presets: Record = { }, docker: { description: 'Keep Dockerfile `FROM` sources updated.', - docker: { + 'docker-compose': { + enabled: true, + }, + dockerfile: { enabled: true, }, }, @@ -360,7 +363,10 @@ export const presets: Record = { }, onlyNpm: { description: 'Renovate only npm dependencies.', - docker: { + 'docker-compose': { + enabled: false, + }, + dockerfile: { enabled: false, }, meteor: { diff --git a/lib/config/presets/internal/docker.ts b/lib/config/presets/internal/docker.ts index 3709be75a3f8a2..9fcce5afe127be 100644 --- a/lib/config/presets/internal/docker.ts +++ b/lib/config/presets/internal/docker.ts @@ -8,10 +8,10 @@ export const presets: Record = { enabled: false, }, description: 'Disable Docker updates.', - docker: { + 'docker-compose': { enabled: false, }, - 'docker-compose': { + dockerfile: { enabled: false, }, }, @@ -37,8 +37,12 @@ export const presets: Record = { }, pinDigests: { description: 'Pin Docker digests.', - docker: { - pinDigests: true, - }, + packageRules: [ + { + enabled: true, + matchDatasources: ['docker'], + pinDigests: true, + }, + ], }, }; diff --git a/lib/config/presets/internal/preview.ts b/lib/config/presets/internal/preview.ts index 513412af5ee824..1644850f950a71 100644 --- a/lib/config/presets/internal/preview.ts +++ b/lib/config/presets/internal/preview.ts @@ -17,7 +17,15 @@ export const presets: Record = { }, dockerVersions: { description: 'Upgrade Docker tags to newer versions.', - docker: { + 'docker-compose': { + major: { + enabled: true, + }, + minor: { + enabled: true, + }, + }, + dockerfile: { major: { enabled: true, }, diff --git a/lib/config/types.ts b/lib/config/types.ts index cb7bb2be409062..e597c7217d1b22 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -321,7 +321,6 @@ export interface PackageRule description?: string | string[]; isVulnerabilityAlert?: boolean; matchFileNames?: string[]; - matchLanguages?: string[]; matchBaseBranches?: string[]; matchManagers?: string | string[]; matchDatasources?: string[]; @@ -341,6 +340,7 @@ export interface PackageRule matchSourceUrlPrefixes?: string[]; matchSourceUrls?: string[]; matchUpdateTypes?: UpdateType[]; + matchCategories?: string[]; matchConfidence?: MergeConfidence[]; registryUrls?: string[] | null; vulnerabilitySeverity?: string; @@ -477,7 +477,7 @@ export interface PackageRuleInputConfig extends Record { mergeConfidenceLevel?: MergeConfidence | undefined; isBump?: boolean; sourceUrl?: string | null; - language?: string; + categories?: string[]; baseBranch?: string; manager?: string; datasource?: string; @@ -505,7 +505,6 @@ export interface MigratedRenovateConfig extends RenovateConfig { export interface ManagerConfig extends RenovateConfig { manager: string; - language?: string | null; } export interface ValidationResult { diff --git a/lib/config/validation.spec.ts b/lib/config/validation.spec.ts index 1a9ad038a3d427..ca52f2919089de 100644 --- a/lib/config/validation.spec.ts +++ b/lib/config/validation.spec.ts @@ -276,7 +276,7 @@ describe('config/validation', () => { }, ], }, - docker: { + ansible: { minor: { matchDepNames: ['meteor'], matchPackageNames: ['testPackage'], @@ -631,28 +631,21 @@ describe('config/validation', () => { expect(warnings).toMatchSnapshot(); }); - it('errors if language or manager objects are nested', async () => { + it('errors if manager objects are nested', async () => { const config = { - python: { + pyenv: { enabled: false, }, - java: { + maven: { gradle: { enabled: false, }, }, - major: { - minor: { - docker: { - automerge: true, - }, - }, - }, } as never; const { warnings, errors } = await configValidation.validateConfig( config ); - expect(errors).toHaveLength(2); + expect(errors).toHaveLength(1); expect(warnings).toHaveLength(0); expect(errors).toMatchSnapshot(); }); diff --git a/lib/config/validation.ts b/lib/config/validation.ts index 13ddfd300706a7..efc55ec8eb932c 100644 --- a/lib/config/validation.ts +++ b/lib/config/validation.ts @@ -1,5 +1,5 @@ import is from '@sindresorhus/is'; -import { getLanguageList, getManagerList } from '../modules/manager'; +import { getManagerList } from '../modules/manager'; import { configRegexPredicate, isConfigRegex, regEx } from '../util/regex'; import * as template from '../util/template'; import { @@ -24,7 +24,7 @@ let optionParents: Record; const managerList = getManagerList(); -const topLevelObjects = getLanguageList().concat(getManagerList()); +const topLevelObjects = managerList; const ignoredNodes = [ '$schema', @@ -304,6 +304,7 @@ export async function validateConfig( const selectors = [ 'matchFileNames', 'matchLanguages', + 'matchCategories', 'matchBaseBranches', 'matchManagers', 'matchDatasources', diff --git a/lib/constants/category.ts b/lib/constants/category.ts new file mode 100644 index 00000000000000..d04ee2f6d72156 --- /dev/null +++ b/lib/constants/category.ts @@ -0,0 +1,24 @@ +export type Category = + | 'ansible' + | 'batect' + | 'bazel' + | 'c' + | 'cd' + | 'ci' + | 'dart' + | 'docker' + | 'dotnet' + | 'elixir' + | 'golang' + | 'helm' + | 'iac' + | 'java' + | 'js' + | 'kubernetes' + | 'node' + | 'php' + | 'python' + | 'ruby' + | 'rust' + | 'swift' + | 'terraform'; diff --git a/lib/constants/index.ts b/lib/constants/index.ts index 9575afdf2a5cc7..cb5f74bc737bb7 100644 --- a/lib/constants/index.ts +++ b/lib/constants/index.ts @@ -1,2 +1,2 @@ export * from './platforms'; -export * from './programming-language'; +export type * from './category'; diff --git a/lib/constants/programming-language.ts b/lib/constants/programming-language.ts deleted file mode 100644 index 79f2ccff6ebecd..00000000000000 --- a/lib/constants/programming-language.ts +++ /dev/null @@ -1,16 +0,0 @@ -export const programmingLanguages = [ - 'dart', - 'docker', - 'elixir', - 'golang', - 'java', - 'js', - 'dotnet', - 'node', - 'php', - 'python', - 'ruby', - 'rust', -] as const; - -export type ProgrammingLanguage = (typeof programmingLanguages)[number]; diff --git a/lib/modules/datasource/go/index.ts b/lib/modules/datasource/go/index.ts index 4da9a69ae2bf8d..f3a3994070b039 100644 --- a/lib/modules/datasource/go/index.ts +++ b/lib/modules/datasource/go/index.ts @@ -20,6 +20,10 @@ export class GoDatasource extends Datasource { super(GoDatasource.id); } + override readonly defaultConfig = { + commitMessageTopic: 'module {{depName}}', + }; + override readonly customRegistrySupport = false; readonly goproxy = new GoProxyDatasource(); diff --git a/lib/modules/manager/ansible-galaxy/index.ts b/lib/modules/manager/ansible-galaxy/index.ts index 426bef1ad220b0..5b468378b37828 100644 --- a/lib/modules/manager/ansible-galaxy/index.ts +++ b/lib/modules/manager/ansible-galaxy/index.ts @@ -1,9 +1,12 @@ +import type { Category } from '../../../constants'; import { GalaxyCollectionDatasource } from '../../datasource/galaxy-collection'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; export { extractPackageFile } from './extract'; +export const categories: Category[] = ['ansible', 'iac']; + export const defaultConfig = { fileMatch: ['(^|/)requirements\\.ya?ml$', '(^|/)galaxy\\.ya?ml$'], }; diff --git a/lib/modules/manager/ansible/index.ts b/lib/modules/manager/ansible/index.ts index c81d5468ca7b89..ca199ab883f426 100644 --- a/lib/modules/manager/ansible/index.ts +++ b/lib/modules/manager/ansible/index.ts @@ -1,8 +1,8 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; +export const categories: Category[] = ['ansible', 'iac']; export const defaultConfig = { fileMatch: ['(^|/)tasks/[^/]+\\.ya?ml$'], diff --git a/lib/modules/manager/argocd/index.ts b/lib/modules/manager/argocd/index.ts index 01a8942ad17173..a31a19c0ddb90b 100644 --- a/lib/modules/manager/argocd/index.ts +++ b/lib/modules/manager/argocd/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { HelmDatasource } from '../../datasource/helm'; @@ -11,6 +12,8 @@ export const defaultConfig = { fileMatch: [], }; +export const categories: Category[] = ['kubernetes', 'cd']; + export const supportedDatasources = [ DockerDatasource.id, GitTagsDatasource.id, diff --git a/lib/modules/manager/azure-pipelines/index.ts b/lib/modules/manager/azure-pipelines/index.ts index 8ceb6c32810ec0..6dffe661f22ec9 100644 --- a/lib/modules/manager/azure-pipelines/index.ts +++ b/lib/modules/manager/azure-pipelines/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { AzurePipelinesTasksDatasource } from '../../datasource/azure-pipelines-tasks'; import { GitTagsDatasource } from '../../datasource/git-tags'; export { extractPackageFile } from './extract'; @@ -7,6 +8,8 @@ export const defaultConfig = { enabled: false, }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [ AzurePipelinesTasksDatasource.id, GitTagsDatasource.id, diff --git a/lib/modules/manager/batect-wrapper/index.ts b/lib/modules/manager/batect-wrapper/index.ts index 80732b481d08a8..f5ec3853589f93 100644 --- a/lib/modules/manager/batect-wrapper/index.ts +++ b/lib/modules/manager/batect-wrapper/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import { id as versioning } from '../../versioning/semver'; @@ -9,4 +10,6 @@ export const defaultConfig = { versioning, }; +export const categories: Category[] = ['batect']; + export const supportedDatasources = [GithubReleasesDatasource.id]; diff --git a/lib/modules/manager/batect/index.ts b/lib/modules/manager/batect/index.ts index 466b348d0c65a5..b08728a980e64a 100644 --- a/lib/modules/manager/batect/index.ts +++ b/lib/modules/manager/batect/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { extractAllPackageFiles, extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { fileMatch: ['(^|/)batect(-bundle)?\\.ya?ml$'], }; +export const categories: Category[] = ['batect']; + export const supportedDatasources = [GitTagsDatasource.id]; diff --git a/lib/modules/manager/bazel/index.ts b/lib/modules/manager/bazel/index.ts index 3ff48cfeab9e4a..77b156c93b3469 100644 --- a/lib/modules/manager/bazel/index.ts +++ b/lib/modules/manager/bazel/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import { GithubTagsDatasource } from '../../datasource/github-tags'; @@ -11,6 +12,8 @@ export const defaultConfig = { fileMatch: ['(^|/)WORKSPACE(|\\.bazel)$', '\\.bzl$'], }; +export const categories: Category[] = ['bazel']; + export const supportedDatasources = [ DockerDatasource.id, GithubReleasesDatasource.id, diff --git a/lib/modules/manager/bazelisk/index.ts b/lib/modules/manager/bazelisk/index.ts index 350125b3b3a06c..cf40a76e5b67e0 100644 --- a/lib/modules/manager/bazelisk/index.ts +++ b/lib/modules/manager/bazelisk/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; export { extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { pinDigests: false, }; +export const categories: Category[] = ['bazel']; + export const supportedDatasources = [GithubReleasesDatasource.id]; diff --git a/lib/modules/manager/bitbucket-pipelines/index.ts b/lib/modules/manager/bitbucket-pipelines/index.ts index 86d39fd3e9f2e3..3d40503ce98119 100644 --- a/lib/modules/manager/bitbucket-pipelines/index.ts +++ b/lib/modules/manager/bitbucket-pipelines/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; @@ -7,6 +8,8 @@ export const defaultConfig = { fileMatch: ['(^|/)\\.?bitbucket-pipelines\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; export const urls = [ diff --git a/lib/modules/manager/buildkite/index.ts b/lib/modules/manager/buildkite/index.ts index d50a6e18b8d0c1..1a2d2d784de100 100644 --- a/lib/modules/manager/buildkite/index.ts +++ b/lib/modules/manager/buildkite/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { extractPackageFile } from './extract'; @@ -10,4 +11,6 @@ export const defaultConfig = { 'to {{#if isMajor}}{{{prettyNewMajor}}}{{else}}{{{newValue}}}{{/if}}', }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [GithubTagsDatasource.id]; diff --git a/lib/modules/manager/bundler/index.ts b/lib/modules/manager/bundler/index.ts index aeaba3cec117f1..722343267bd1c6 100644 --- a/lib/modules/manager/bundler/index.ts +++ b/lib/modules/manager/bundler/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { RubyVersionDatasource } from '../../datasource/ruby-version'; import { RubyGemsDatasource } from '../../datasource/rubygems'; import * as rubyVersioning from '../../versioning/ruby'; @@ -6,7 +6,6 @@ import { updateArtifacts } from './artifacts'; import { extractPackageFile } from './extract'; import { updateLockedDependency } from './update-locked'; -export const language: ProgrammingLanguage = 'ruby'; export const supportsLockFileMaintenance = true; /* @@ -25,6 +24,8 @@ export const defaultConfig = { versioning: rubyVersioning.id, }; +export const categories: Category[] = ['ruby']; + export const supportedDatasources = [ RubyGemsDatasource.id, RubyVersionDatasource.id, diff --git a/lib/modules/manager/cake/index.ts b/lib/modules/manager/cake/index.ts index 15de141e3568e6..2687374f93c20b 100644 --- a/lib/modules/manager/cake/index.ts +++ b/lib/modules/manager/cake/index.ts @@ -1,15 +1,15 @@ import moo from 'moo'; -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { regEx } from '../../../util/regex'; import { NugetDatasource } from '../../datasource/nuget'; import type { PackageDependency, PackageFileContent } from '../types'; -export const language: ProgrammingLanguage = 'dotnet'; - export const defaultConfig = { fileMatch: ['\\.cake$'], }; +export const categories: Category[] = ['dotnet']; + const lexer = moo.states({ main: { lineComment: { match: /\/\/.*?$/ }, // TODO #12870 diff --git a/lib/modules/manager/cargo/index.ts b/lib/modules/manager/cargo/index.ts index 45ee9c4fada786..e529bd2bed1864 100644 --- a/lib/modules/manager/cargo/index.ts +++ b/lib/modules/manager/cargo/index.ts @@ -1,11 +1,10 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { CrateDatasource } from '../../datasource/crate'; import * as cargoVersioning from '../../versioning/cargo'; import { updateArtifacts } from './artifacts'; import { extractPackageFile } from './extract'; export { getRangeStrategy } from './range'; -export const language: ProgrammingLanguage = 'rust'; export const supportsLockFileMaintenance = true; export { extractPackageFile, updateArtifacts }; @@ -16,4 +15,6 @@ export const defaultConfig = { versioning: cargoVersioning.id, }; +export const categories: Category[] = ['rust']; + export const supportedDatasources = [CrateDatasource.id]; diff --git a/lib/modules/manager/cdnurl/index.ts b/lib/modules/manager/cdnurl/index.ts index 5480906fbf9d53..574dc5cc1b577c 100644 --- a/lib/modules/manager/cdnurl/index.ts +++ b/lib/modules/manager/cdnurl/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { CdnJsDatasource } from '../../datasource/cdnjs'; import * as semverVersioning from '../../versioning/semver'; import { extractPackageFile } from './extract'; @@ -9,4 +10,6 @@ export const defaultConfig = { versioning: semverVersioning.id, }; +export const categories: Category[] = ['cd']; + export const supportedDatasources = [CdnJsDatasource.id]; diff --git a/lib/modules/manager/circleci/index.ts b/lib/modules/manager/circleci/index.ts index 02ef7c70aeab1b..3c2fb9b0532b23 100644 --- a/lib/modules/manager/circleci/index.ts +++ b/lib/modules/manager/circleci/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { OrbDatasource } from '../../datasource/orb'; import { extractPackageFile } from './extract'; @@ -12,4 +13,6 @@ export const defaultConfig = { fileMatch: ['(^|/)\\.circleci/config\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id, OrbDatasource.id]; diff --git a/lib/modules/manager/cloudbuild/index.ts b/lib/modules/manager/cloudbuild/index.ts index 979535276ccc5d..20b9917a5a609d 100644 --- a/lib/modules/manager/cloudbuild/index.ts +++ b/lib/modules/manager/cloudbuild/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { fileMatch: ['(^|/)cloudbuild\\.ya?ml'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/cocoapods/index.ts b/lib/modules/manager/cocoapods/index.ts index 93783b6c60bba7..a83053af0d6272 100644 --- a/lib/modules/manager/cocoapods/index.ts +++ b/lib/modules/manager/cocoapods/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { GitlabTagsDatasource } from '../../datasource/gitlab-tags'; @@ -15,6 +16,8 @@ export const defaultConfig = { versioning: rubyVersioning.id, }; +export const categories: Category[] = ['swift']; + export const supportedDatasources = [ GitTagsDatasource.id, GithubTagsDatasource.id, diff --git a/lib/modules/manager/composer/index.ts b/lib/modules/manager/composer/index.ts index 54289b89769168..9561047cc2ee77 100644 --- a/lib/modules/manager/composer/index.ts +++ b/lib/modules/manager/composer/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { PackagistDatasource } from '../../datasource/packagist'; import { updateArtifacts } from './artifacts'; @@ -7,7 +7,6 @@ import { getRangeStrategy } from './range'; import { updateLockedDependency } from './update-locked'; import { composerVersioningId } from './utils'; -export const language: ProgrammingLanguage = 'php'; export const supportsLockFileMaintenance = true; export { @@ -22,6 +21,8 @@ export const defaultConfig = { versioning: composerVersioningId, }; +export const categories: Category[] = ['php']; + export const supportedDatasources = [ GitTagsDatasource.id, PackagistDatasource.id, diff --git a/lib/modules/manager/conan/index.ts b/lib/modules/manager/conan/index.ts index 3dc5571dedc4c7..79ea56354424fb 100644 --- a/lib/modules/manager/conan/index.ts +++ b/lib/modules/manager/conan/index.ts @@ -1,4 +1,5 @@ export { extractPackageFile } from './extract'; +import type { Category } from '../../../constants'; export { getRangeStrategy } from './range'; import { ConanDatasource } from '../../datasource/conan'; import * as conan from '../../versioning/conan'; @@ -10,4 +11,6 @@ export const defaultConfig = { enabled: false, // See https://github.com/renovatebot/renovate/issues/14170 }; +export const categories: Category[] = ['c']; + export const supportedDatasources = [ConanDatasource.id]; diff --git a/lib/modules/manager/deps-edn/index.ts b/lib/modules/manager/deps-edn/index.ts index 56aec50fd53aee..d9c58b1e6ecbe8 100644 --- a/lib/modules/manager/deps-edn/index.ts +++ b/lib/modules/manager/deps-edn/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { ClojureDatasource } from '../../datasource/clojure'; import * as mavenVersioning from '../../versioning/maven'; import { extractPackageFile } from './extract'; @@ -9,4 +10,6 @@ export const defaultConfig = { versioning: mavenVersioning.id, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [ClojureDatasource.id]; diff --git a/lib/modules/manager/docker-compose/index.ts b/lib/modules/manager/docker-compose/index.ts index 69d28ba6a35a33..925c71d8b285a6 100644 --- a/lib/modules/manager/docker-compose/index.ts +++ b/lib/modules/manager/docker-compose/index.ts @@ -1,13 +1,13 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractPackageFile }; export const defaultConfig = { fileMatch: ['(^|/)(?:docker-)?compose[^/]*\\.ya?ml$'], }; +export const categories: Category[] = ['docker']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/dockerfile/index.ts b/lib/modules/manager/dockerfile/index.ts index febfd35a2a88d6..1e68c3ead0d2bd 100644 --- a/lib/modules/manager/dockerfile/index.ts +++ b/lib/modules/manager/dockerfile/index.ts @@ -1,9 +1,7 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractPackageFile }; export const defaultConfig = { @@ -13,4 +11,6 @@ export const defaultConfig = { ], }; +export const categories: Category[] = ['docker']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/droneci/index.ts b/lib/modules/manager/droneci/index.ts index d7e7fa405c5fc7..fa08c4599ee95b 100644 --- a/lib/modules/manager/droneci/index.ts +++ b/lib/modules/manager/droneci/index.ts @@ -1,13 +1,13 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractPackageFile }; export const defaultConfig = { fileMatch: ['(^|/)\\.drone\\.yml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/fleet/index.ts b/lib/modules/manager/fleet/index.ts index c864589db2f32c..e6368fc46df7c0 100644 --- a/lib/modules/manager/fleet/index.ts +++ b/lib/modules/manager/fleet/index.ts @@ -1,10 +1,15 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; +export const displayName = 'Rancher Fleet'; + export const defaultConfig = { fileMatch: ['(^|/)fleet\\.ya?ml'], }; +export const categories: Category[] = ['cd', 'kubernetes']; + export const supportedDatasources = [GitTagsDatasource.id, HelmDatasource.id]; diff --git a/lib/modules/manager/flux/index.ts b/lib/modules/manager/flux/index.ts index 58d21b8673d27f..b693db339e92a8 100644 --- a/lib/modules/manager/flux/index.ts +++ b/lib/modules/manager/flux/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { BitbucketTagsDatasource } from '../../datasource/bitbucket-tags'; import { DockerDatasource } from '../../datasource/docker'; import { GitRefsDatasource } from '../../datasource/git-refs'; @@ -15,6 +16,8 @@ export const defaultConfig = { fileMatch: [systemManifestRegex], }; +export const categories: Category[] = ['cd', 'kubernetes']; + export const supportedDatasources = [ GithubReleasesDatasource.id, GitRefsDatasource.id, diff --git a/lib/modules/manager/github-actions/index.ts b/lib/modules/manager/github-actions/index.ts index c2d7ad80bb6e42..254cc35903d9ae 100644 --- a/lib/modules/manager/github-actions/index.ts +++ b/lib/modules/manager/github-actions/index.ts @@ -1,5 +1,5 @@ +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; - export { extractPackageFile } from './extract'; export const defaultConfig = { @@ -9,4 +9,6 @@ export const defaultConfig = { ], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [GithubTagsDatasource.id]; diff --git a/lib/modules/manager/gitlabci-include/index.ts b/lib/modules/manager/gitlabci-include/index.ts index f7ecdd51105538..77d8f5fa5cb09c 100644 --- a/lib/modules/manager/gitlabci-include/index.ts +++ b/lib/modules/manager/gitlabci-include/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitlabTagsDatasource } from '../../datasource/gitlab-tags'; import { extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { fileMatch: ['\\.gitlab-ci\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [GitlabTagsDatasource.id]; diff --git a/lib/modules/manager/gitlabci/index.ts b/lib/modules/manager/gitlabci/index.ts index 3e74df89d6eb8a..71946b1b4aaa99 100644 --- a/lib/modules/manager/gitlabci/index.ts +++ b/lib/modules/manager/gitlabci/index.ts @@ -1,13 +1,13 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractAllPackageFiles, extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractAllPackageFiles, extractPackageFile }; export const defaultConfig = { fileMatch: ['\\.gitlab-ci\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/gomod/index.ts b/lib/modules/manager/gomod/index.ts index 8736edae9ba8a8..c807338a890610 100644 --- a/lib/modules/manager/gomod/index.ts +++ b/lib/modules/manager/gomod/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GoDatasource } from '../../datasource/go'; import { GolangVersionDatasource } from '../../datasource/golang-version'; import { updateArtifacts } from './artifacts'; @@ -10,13 +10,13 @@ export { extractPackageFile, updateDependency, updateArtifacts }; export const displayName = 'Go Modules'; export const url = 'https://go.dev/ref/mod'; -export const language: ProgrammingLanguage = 'golang'; - export const defaultConfig = { fileMatch: ['(^|/)go\\.mod$'], pinDigests: false, }; +export const categories: Category[] = ['golang']; + export const supportedDatasources = [ GoDatasource.id, GolangVersionDatasource.id, diff --git a/lib/modules/manager/gradle-wrapper/index.ts b/lib/modules/manager/gradle-wrapper/index.ts index 76fae92837e5c9..1aa27107aa3e43 100644 --- a/lib/modules/manager/gradle-wrapper/index.ts +++ b/lib/modules/manager/gradle-wrapper/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GradleVersionDatasource } from '../../datasource/gradle-version'; import { id as versioning } from '../../versioning/gradle'; @@ -9,4 +10,6 @@ export const defaultConfig = { versioning, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [GradleVersionDatasource.id]; diff --git a/lib/modules/manager/gradle/index.ts b/lib/modules/manager/gradle/index.ts index 82419fa6f81868..7723ce27f10fe6 100644 --- a/lib/modules/manager/gradle/index.ts +++ b/lib/modules/manager/gradle/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { MavenDatasource } from '../../datasource/maven'; import * as gradleVersioning from '../../versioning/gradle'; @@ -6,7 +6,6 @@ export { extractAllPackageFiles } from './extract'; export { updateDependency } from './update'; export { updateArtifacts } from './artifacts'; -export const language: ProgrammingLanguage = 'java'; export const supportsLockFileMaintenance = true; export const defaultConfig = { @@ -24,4 +23,6 @@ export const defaultConfig = { versioning: gradleVersioning.id, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [MavenDatasource.id]; diff --git a/lib/modules/manager/helm-requirements/index.ts b/lib/modules/manager/helm-requirements/index.ts index 7c4a02772d1021..84752392a41f1c 100644 --- a/lib/modules/manager/helm-requirements/index.ts +++ b/lib/modules/manager/helm-requirements/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; @@ -9,4 +10,6 @@ export const defaultConfig = { fileMatch: ['(^|/)requirements\\.ya?ml$'], }; +export const categories: Category[] = ['helm', 'kubernetes']; + export const supportedDatasources = [HelmDatasource.id]; diff --git a/lib/modules/manager/helm-values/index.ts b/lib/modules/manager/helm-values/index.ts index a9ef8d535341d4..6d96f591c1b390 100644 --- a/lib/modules/manager/helm-values/index.ts +++ b/lib/modules/manager/helm-values/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; export { extractPackageFile } from './extract'; @@ -7,4 +8,6 @@ export const defaultConfig = { pinDigests: false, }; +export const categories: Category[] = ['helm', 'kubernetes']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/modules/manager/helmfile/index.ts b/lib/modules/manager/helmfile/index.ts index 0c17191ac59b5f..c491b44f9c0a3e 100644 --- a/lib/modules/manager/helmfile/index.ts +++ b/lib/modules/manager/helmfile/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; @@ -13,4 +14,6 @@ export const defaultConfig = { fileMatch: ['(^|/)helmfile\\.ya?ml$'], }; +export const categories: Category[] = ['cd', 'helm', 'kubernetes']; + export const supportedDatasources = [HelmDatasource.id, DockerDatasource.id]; diff --git a/lib/modules/manager/helmsman/index.ts b/lib/modules/manager/helmsman/index.ts index 9f0cf9c1338722..6a6b47e8238904 100644 --- a/lib/modules/manager/helmsman/index.ts +++ b/lib/modules/manager/helmsman/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; @@ -5,4 +6,6 @@ export const defaultConfig = { fileMatch: [], }; +export const categories: Category[] = ['cd', 'helm', 'kubernetes']; + export const supportedDatasources = [HelmDatasource.id]; diff --git a/lib/modules/manager/helmv3/index.ts b/lib/modules/manager/helmv3/index.ts index a84cbb47b44f34..30d8b5e17f3281 100644 --- a/lib/modules/manager/helmv3/index.ts +++ b/lib/modules/manager/helmv3/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { HelmDatasource } from '../../datasource/helm'; export { updateArtifacts } from './artifacts'; @@ -14,4 +15,6 @@ export const defaultConfig = { fileMatch: ['(^|/)Chart\\.ya?ml$'], }; +export const categories: Category[] = ['helm', 'kubernetes']; + export const supportedDatasources = [DockerDatasource.id, HelmDatasource.id]; diff --git a/lib/modules/manager/html/index.ts b/lib/modules/manager/html/index.ts index c196d4af869ec4..ad6e2a725347e1 100644 --- a/lib/modules/manager/html/index.ts +++ b/lib/modules/manager/html/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { CdnJsDatasource } from '../../datasource/cdnjs'; import * as semverVersioning from '../../versioning/semver'; import { extractPackageFile } from './extract'; @@ -13,4 +14,6 @@ export const defaultConfig = { pinDigests: false, }; +export const categories: Category[] = ['cd']; + export const supportedDatasources = [CdnJsDatasource.id]; diff --git a/lib/modules/manager/index.spec.ts b/lib/modules/manager/index.spec.ts index 720a49b0e745da..b60cebaae9d4fa 100644 --- a/lib/modules/manager/index.spec.ts +++ b/lib/modules/manager/index.spec.ts @@ -31,12 +31,6 @@ describe('modules/manager/index', () => { }); }); - describe('getLanguageList()', () => { - it('gets', () => { - expect(manager.getLanguageList()).not.toBeNull(); - }); - }); - describe('getManagerList()', () => { it('gets', () => { expect(manager.getManagerList()).not.toBeNull(); diff --git a/lib/modules/manager/index.ts b/lib/modules/manager/index.ts index 26befb170ef57b..3d35007dc90841 100644 --- a/lib/modules/manager/index.ts +++ b/lib/modules/manager/index.ts @@ -1,4 +1,3 @@ -import { programmingLanguages } from '../../constants'; import type { RangeStrategy } from '../../types'; import managers from './api'; import type { @@ -13,15 +12,12 @@ import type { export { hashMap } from './fingerprint.generated'; const managerList = Array.from(managers.keys()); -const languageList = programmingLanguages.concat(); - export function get( manager: string, name: T ): ManagerApi[T] | undefined { return managers.get(manager)?.[name]; } -export const getLanguageList = (): string[] => languageList; export const getManagerList = (): string[] => managerList; export const getManagers = (): Map => managers; diff --git a/lib/modules/manager/jenkins/index.ts b/lib/modules/manager/jenkins/index.ts index afe5c649940d34..e5b0293a1c8576 100644 --- a/lib/modules/manager/jenkins/index.ts +++ b/lib/modules/manager/jenkins/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { JenkinsPluginsDatasource } from '../../datasource/jenkins-plugins'; export { extractPackageFile } from './extract'; @@ -5,4 +6,6 @@ export const defaultConfig = { fileMatch: ['(^|/)plugins\\.(txt|ya?ml)$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [JenkinsPluginsDatasource.id]; diff --git a/lib/modules/manager/jsonnet-bundler/index.ts b/lib/modules/manager/jsonnet-bundler/index.ts index fec3158e0dbe53..4afada49d83088 100644 --- a/lib/modules/manager/jsonnet-bundler/index.ts +++ b/lib/modules/manager/jsonnet-bundler/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; export { updateArtifacts } from './artifacts'; export { extractPackageFile } from './extract'; @@ -9,4 +10,6 @@ export const defaultConfig = { datasource: GitTagsDatasource.id, }; +export const categories: Category[] = ['kubernetes']; + export const supportedDatasources = [GitTagsDatasource.id]; diff --git a/lib/modules/manager/kotlin-script/index.ts b/lib/modules/manager/kotlin-script/index.ts index dbded231b6b296..ed2c56080cf01b 100644 --- a/lib/modules/manager/kotlin-script/index.ts +++ b/lib/modules/manager/kotlin-script/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { MavenDatasource } from '../../datasource/maven'; export { extractPackageFile } from './extract'; @@ -6,4 +7,6 @@ export const defaultConfig = { fileMatch: ['^.+\\.main\\.kts$'], }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [MavenDatasource.id]; diff --git a/lib/modules/manager/kubernetes/index.ts b/lib/modules/manager/kubernetes/index.ts index 1ab2c8dc6d70b3..fb62f3e611eb16 100644 --- a/lib/modules/manager/kubernetes/index.ts +++ b/lib/modules/manager/kubernetes/index.ts @@ -1,15 +1,15 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { KubernetesApiDatasource } from '../../datasource/kubernetes-api'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export const defaultConfig = { fileMatch: [], }; +export const categories: Category[] = ['kubernetes']; + export const supportedDatasources = [ DockerDatasource.id, KubernetesApiDatasource.id, diff --git a/lib/modules/manager/kustomize/index.ts b/lib/modules/manager/kustomize/index.ts index 9ec98a09bab73b..57b287b5da8fee 100644 --- a/lib/modules/manager/kustomize/index.ts +++ b/lib/modules/manager/kustomize/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; @@ -9,6 +10,8 @@ export const defaultConfig = { pinDigests: false, }; +export const categories: Category[] = ['kubernetes']; + export const supportedDatasources = [ DockerDatasource.id, GitTagsDatasource.id, diff --git a/lib/modules/manager/leiningen/index.ts b/lib/modules/manager/leiningen/index.ts index 831fa32857badf..701776c0c29917 100644 --- a/lib/modules/manager/leiningen/index.ts +++ b/lib/modules/manager/leiningen/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { ClojureDatasource } from '../../datasource/clojure'; import * as mavenVersioning from '../../versioning/maven'; @@ -8,4 +9,6 @@ export const defaultConfig = { versioning: mavenVersioning.id, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [ClojureDatasource.id]; diff --git a/lib/modules/manager/maven/index.ts b/lib/modules/manager/maven/index.ts index b6feaa85f99673..8d12ca432bb606 100644 --- a/lib/modules/manager/maven/index.ts +++ b/lib/modules/manager/maven/index.ts @@ -1,15 +1,15 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { MavenDatasource } from '../../datasource/maven'; import * as mavenVersioning from '../../versioning/maven'; export { extractAllPackageFiles } from './extract'; export { bumpPackageVersion, updateDependency } from './update'; -export const language: ProgrammingLanguage = 'java'; - export const defaultConfig = { fileMatch: ['(^|/|\\.)pom\\.xml$', '^(((\\.mvn)|(\\.m2))/)?settings\\.xml$'], versioning: mavenVersioning.id, }; +export const categories: Category[] = ['java']; + export const supportedDatasources = [MavenDatasource.id]; diff --git a/lib/modules/manager/meteor/index.ts b/lib/modules/manager/meteor/index.ts index a1826cc334e2a9..4c2ddbbbec2e1e 100644 --- a/lib/modules/manager/meteor/index.ts +++ b/lib/modules/manager/meteor/index.ts @@ -1,12 +1,12 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { NpmDatasource } from '../../datasource/npm'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'js'; - export const defaultConfig = { fileMatch: ['(^|/)package\\.js$'], }; +export const categories: Category[] = ['js']; + export const supportedDatasources = [NpmDatasource.id]; diff --git a/lib/modules/manager/mint/index.ts b/lib/modules/manager/mint/index.ts index fffd5aadb1ddf5..2301dbd9a08f44 100644 --- a/lib/modules/manager/mint/index.ts +++ b/lib/modules/manager/mint/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; export const displayName = 'Mint'; @@ -5,6 +6,8 @@ export const url = 'https://github.com/yonaskolb/Mint'; export { extractPackageFile } from './extract'; +export const categories: Category[] = ['swift']; + export const supportedDatasources = [GitTagsDatasource.id]; export const defaultConfig = { diff --git a/lib/modules/manager/mix/index.ts b/lib/modules/manager/mix/index.ts index f48c01ae2529d1..99712934c95021 100644 --- a/lib/modules/manager/mix/index.ts +++ b/lib/modules/manager/mix/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { HexDatasource } from '../../datasource/hex'; @@ -7,13 +7,13 @@ import * as hexVersioning from '../../versioning/hex'; export { extractPackageFile } from './extract'; export { updateArtifacts } from './artifacts'; -export const language: ProgrammingLanguage = 'elixir'; - export const defaultConfig = { fileMatch: ['(^|/)mix\\.exs$'], versioning: hexVersioning.id, }; +export const categories: Category[] = ['elixir']; + export const supportedDatasources = [ GithubTagsDatasource.id, GitTagsDatasource.id, diff --git a/lib/modules/manager/nodenv/index.ts b/lib/modules/manager/nodenv/index.ts index 093d18e922faee..7343b6aced2cdb 100644 --- a/lib/modules/manager/nodenv/index.ts +++ b/lib/modules/manager/nodenv/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import * as nodeVersioning from '../../versioning/node'; @@ -7,11 +7,11 @@ export { extractPackageFile } from './extract'; export const displayName = 'nodenv'; export const url = 'https://github.com/nodenv/nodenv'; -export const language: ProgrammingLanguage = 'node'; - export const defaultConfig = { fileMatch: ['(^|/)\\.node-version$'], versioning: nodeVersioning.id, }; +export const categories: Category[] = ['js', 'node']; + export const supportedDatasources = [GithubTagsDatasource.id]; diff --git a/lib/modules/manager/npm/index.ts b/lib/modules/manager/npm/index.ts index 9d309bd8a23348..26b11772e3dbf3 100644 --- a/lib/modules/manager/npm/index.ts +++ b/lib/modules/manager/npm/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { NpmDatasource } from '../../datasource/npm'; import * as npmVersioning from '../../versioning/npm'; @@ -12,7 +12,6 @@ export { } from './update'; export { getRangeStrategy } from './range'; -export const language: ProgrammingLanguage = 'js'; export const supportsLockFileMaintenance = true; export const defaultConfig = { @@ -30,4 +29,6 @@ export const defaultConfig = { }, }; +export const categories: Category[] = ['js']; + export const supportedDatasources = [GithubTagsDatasource.id, NpmDatasource.id]; diff --git a/lib/modules/manager/nuget/index.ts b/lib/modules/manager/nuget/index.ts index c34ca3a67d8e78..88e1ccdc01066b 100644 --- a/lib/modules/manager/nuget/index.ts +++ b/lib/modules/manager/nuget/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DotnetVersionDatasource } from '../../datasource/dotnet-version'; import { NugetDatasource } from '../../datasource/nuget'; @@ -6,8 +6,6 @@ export { extractPackageFile } from './extract'; export { updateArtifacts } from './artifacts'; export { bumpPackageVersion } from './update'; -export const language: ProgrammingLanguage = 'dotnet'; - export const defaultConfig = { fileMatch: [ '\\.(?:cs|fs|vb)proj$', @@ -17,6 +15,8 @@ export const defaultConfig = { ], }; +export const categories: Category[] = ['dotnet']; + export const supportedDatasources = [ DotnetVersionDatasource.id, NugetDatasource.id, diff --git a/lib/modules/manager/nvm/index.ts b/lib/modules/manager/nvm/index.ts index 0c9001f40c0a3b..0354ac17c1a358 100644 --- a/lib/modules/manager/nvm/index.ts +++ b/lib/modules/manager/nvm/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import * as nodeVersioning from '../../versioning/node'; @@ -7,12 +7,12 @@ export { extractPackageFile } from './extract'; export const displayName = 'nvm'; export const url = 'https://github.com/nvm-sh/nvm'; -export const language: ProgrammingLanguage = 'node'; - export const defaultConfig = { fileMatch: ['(^|/)\\.nvmrc$'], versioning: nodeVersioning.id, pinDigests: false, }; +export const categories: Category[] = ['js', 'node']; + export const supportedDatasources = [GithubTagsDatasource.id]; diff --git a/lib/modules/manager/osgi/index.ts b/lib/modules/manager/osgi/index.ts index 3fc0a553f3032b..01c8aaba95c8aa 100644 --- a/lib/modules/manager/osgi/index.ts +++ b/lib/modules/manager/osgi/index.ts @@ -1,10 +1,7 @@ -import type { ProgrammingLanguage } from '../../../constants'; import { MavenDatasource } from '../../datasource/maven'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'java'; - export const defaultConfig = { fileMatch: ['(^|/)src/main/features/.+\\.json$'], }; diff --git a/lib/modules/manager/pip-compile/index.ts b/lib/modules/manager/pip-compile/index.ts index fdde176cb50f34..dac650f2bcb360 100644 --- a/lib/modules/manager/pip-compile/index.ts +++ b/lib/modules/manager/pip-compile/index.ts @@ -1,10 +1,9 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from '../pip_requirements/extract'; export { updateArtifacts } from './artifacts'; -export const language: ProgrammingLanguage = 'python'; export const supportsLockFileMaintenance = true; export const supportedDatasources = [PypiDatasource.id]; @@ -17,3 +16,5 @@ export const defaultConfig = { commitMessageAction: 'Refresh pip-compile outputs', }, }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/pip_requirements/index.ts b/lib/modules/manager/pip_requirements/index.ts index 6140bdd15f788d..537d4a510fef25 100644 --- a/lib/modules/manager/pip_requirements/index.ts +++ b/lib/modules/manager/pip_requirements/index.ts @@ -1,14 +1,14 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { PypiDatasource } from '../../datasource/pypi'; export { updateArtifacts } from './artifacts'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'python'; - export const defaultConfig = { fileMatch: ['(^|/)[\\w-]*requirements(-\\w+)?\\.(txt|pip)$'], }; +export const categories: Category[] = ['python']; + export const supportedDatasources = [PypiDatasource.id, GitTagsDatasource.id]; diff --git a/lib/modules/manager/pip_setup/index.ts b/lib/modules/manager/pip_setup/index.ts index 0e3a926f9cc0f4..e71fb6f9d2199d 100644 --- a/lib/modules/manager/pip_setup/index.ts +++ b/lib/modules/manager/pip_setup/index.ts @@ -1,12 +1,12 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'python'; - export const defaultConfig = { fileMatch: ['(^|/)setup\\.py$'], }; +export const categories: Category[] = ['python']; + export const supportedDatasources = [PypiDatasource.id]; diff --git a/lib/modules/manager/pipenv/index.ts b/lib/modules/manager/pipenv/index.ts index 857579477d700f..3635d76857ce44 100644 --- a/lib/modules/manager/pipenv/index.ts +++ b/lib/modules/manager/pipenv/index.ts @@ -1,10 +1,9 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from './extract'; export { updateArtifacts } from './artifacts'; -export const language: ProgrammingLanguage = 'python'; export const supportsLockFileMaintenance = true; export const supportedDatasources = [PypiDatasource.id]; @@ -12,3 +11,5 @@ export const supportedDatasources = [PypiDatasource.id]; export const defaultConfig = { fileMatch: ['(^|/)Pipfile$'], }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/poetry/index.ts b/lib/modules/manager/poetry/index.ts index 3655fea38af505..1ad1b191287503 100644 --- a/lib/modules/manager/poetry/index.ts +++ b/lib/modules/manager/poetry/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { PypiDatasource } from '../../datasource/pypi'; @@ -11,9 +11,10 @@ export const supportedDatasources = [ GithubTagsDatasource.id, ]; -export const language: ProgrammingLanguage = 'python'; export const supportsLockFileMaintenance = true; export const defaultConfig = { fileMatch: ['(^|/)pyproject\\.toml$'], }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/pub/index.ts b/lib/modules/manager/pub/index.ts index 898e82a42a2b6a..dd4c435815d638 100644 --- a/lib/modules/manager/pub/index.ts +++ b/lib/modules/manager/pub/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DartDatasource } from '../../datasource/dart'; import * as npmVersioning from '../../versioning/npm'; @@ -11,3 +12,5 @@ export const defaultConfig = { fileMatch: ['(^|/)pubspec\\.ya?ml$'], versioning: npmVersioning.id, }; + +export const categories: Category[] = ['dart']; diff --git a/lib/modules/manager/puppet/index.ts b/lib/modules/manager/puppet/index.ts index 2b0735bb4c4c93..f88158741b01ad 100644 --- a/lib/modules/manager/puppet/index.ts +++ b/lib/modules/manager/puppet/index.ts @@ -1,16 +1,16 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { PuppetForgeDatasource } from '../../datasource/puppet-forge'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'ruby'; - export const defaultConfig = { fileMatch: ['(^|/)Puppetfile$'], }; +export const categories: Category[] = ['iac', 'ruby']; + export const supportedDatasources = [ PuppetForgeDatasource.id, GithubTagsDatasource.id, diff --git a/lib/modules/manager/pyenv/index.ts b/lib/modules/manager/pyenv/index.ts index 59d75f11cd74c8..12b668b638caca 100644 --- a/lib/modules/manager/pyenv/index.ts +++ b/lib/modules/manager/pyenv/index.ts @@ -1,14 +1,14 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import * as dockerVersioning from '../../versioning/docker'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'python'; - export const supportedDatasources = [DockerDatasource.id]; export const defaultConfig = { fileMatch: ['(^|/)\\.python-version$'], versioning: dockerVersioning.id, }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/ruby-version/index.ts b/lib/modules/manager/ruby-version/index.ts index 68eaee26ae1947..ad8aabd5dbd393 100644 --- a/lib/modules/manager/ruby-version/index.ts +++ b/lib/modules/manager/ruby-version/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { RubyVersionDatasource } from '../../datasource/ruby-version'; import * as rubyVersioning from '../../versioning/ruby'; @@ -6,9 +6,9 @@ export { extractPackageFile } from './extract'; export const supportedDatasources = [RubyVersionDatasource.id]; -export const language: ProgrammingLanguage = 'ruby'; - export const defaultConfig = { fileMatch: ['(^|/)\\.ruby-version$'], versioning: rubyVersioning.id, }; + +export const categories: Category[] = ['ruby']; diff --git a/lib/modules/manager/sbt/index.ts b/lib/modules/manager/sbt/index.ts index 111c1e52e5da6b..6465410fd615db 100644 --- a/lib/modules/manager/sbt/index.ts +++ b/lib/modules/manager/sbt/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import { MavenDatasource } from '../../datasource/maven'; import { SbtPackageDatasource } from '../../datasource/sbt-package'; @@ -22,3 +23,5 @@ export const defaultConfig = { ], versioning: ivyVersioning.id, }; + +export const categories: Category[] = ['java']; diff --git a/lib/modules/manager/setup-cfg/index.ts b/lib/modules/manager/setup-cfg/index.ts index c8b40c2a0c7238..b8c603b797d205 100644 --- a/lib/modules/manager/setup-cfg/index.ts +++ b/lib/modules/manager/setup-cfg/index.ts @@ -1,4 +1,4 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { PypiDatasource } from '../../datasource/pypi'; import { id as versioning } from '../../versioning/pep440'; @@ -6,9 +6,9 @@ export { extractPackageFile } from './extract'; export const supportedDatasources = [PypiDatasource.id]; -export const language: ProgrammingLanguage = 'python'; - export const defaultConfig = { fileMatch: ['(^|/)setup\\.cfg$'], versioning, }; + +export const categories: Category[] = ['python']; diff --git a/lib/modules/manager/swift/index.ts b/lib/modules/manager/swift/index.ts index bbb83400ecc243..dbabb946047174 100644 --- a/lib/modules/manager/swift/index.ts +++ b/lib/modules/manager/swift/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import * as swiftVersioning from '../../versioning/swift'; @@ -14,3 +15,5 @@ export const defaultConfig = { versioning: swiftVersioning.id, pinDigests: false, }; + +export const categories: Category[] = ['swift']; diff --git a/lib/modules/manager/tekton/index.ts b/lib/modules/manager/tekton/index.ts index d68cf8e0703bb8..a578c6f00619c3 100644 --- a/lib/modules/manager/tekton/index.ts +++ b/lib/modules/manager/tekton/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; @@ -5,6 +6,8 @@ export const defaultConfig = { fileMatch: [], }; +export const categories: Category[] = ['ci', 'cd']; + export const supportedDatasources = [DockerDatasource.id]; export { extractPackageFile }; diff --git a/lib/modules/manager/terraform-version/index.ts b/lib/modules/manager/terraform-version/index.ts index 0f753ba3af3818..bd91323f4bc444 100644 --- a/lib/modules/manager/terraform-version/index.ts +++ b/lib/modules/manager/terraform-version/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import * as hashicorpVersioning from '../../versioning/hashicorp'; @@ -10,3 +11,5 @@ export const defaultConfig = { versioning: hashicorpVersioning.id, extractVersion: '^v(?.*)$', }; + +export const categories: Category[] = ['terraform']; diff --git a/lib/modules/manager/terraform/index.ts b/lib/modules/manager/terraform/index.ts index d429e781909add..1e67fe9d78d8af 100644 --- a/lib/modules/manager/terraform/index.ts +++ b/lib/modules/manager/terraform/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { BitbucketTagsDatasource } from '../../datasource/bitbucket-tags'; import { DockerDatasource } from '../../datasource/docker'; import { GitTagsDatasource } from '../../datasource/git-tags'; @@ -28,3 +29,5 @@ export const defaultConfig = { fileMatch: ['\\.tf$'], pinDigests: false, }; + +export const categories: Category[] = ['iac', 'terraform']; diff --git a/lib/modules/manager/terragrunt-version/index.ts b/lib/modules/manager/terragrunt-version/index.ts index a1286d9721980d..2e5225ea0b9f99 100644 --- a/lib/modules/manager/terragrunt-version/index.ts +++ b/lib/modules/manager/terragrunt-version/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import * as hashicorpVersioning from '../../versioning/hashicorp'; @@ -10,3 +11,5 @@ export const defaultConfig = { versioning: hashicorpVersioning.id, extractVersion: '^v(?.+)$', }; + +export const categories: Category[] = ['terraform']; diff --git a/lib/modules/manager/terragrunt/index.ts b/lib/modules/manager/terragrunt/index.ts index 39d6faf56e7fc3..58864cf7f57085 100644 --- a/lib/modules/manager/terragrunt/index.ts +++ b/lib/modules/manager/terragrunt/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import { TerraformModuleDatasource } from '../../datasource/terraform-module'; @@ -16,3 +17,5 @@ export const defaultConfig = { commitMessageTopic: 'Terragrunt dependency {{depName}}', fileMatch: ['(^|/)terragrunt\\.hcl$'], }; + +export const categories: Category[] = ['iac', 'terraform']; diff --git a/lib/modules/manager/tflint-plugin/index.ts b/lib/modules/manager/tflint-plugin/index.ts index 2c17316cf35f2e..893fb9adab9151 100644 --- a/lib/modules/manager/tflint-plugin/index.ts +++ b/lib/modules/manager/tflint-plugin/index.ts @@ -1,7 +1,10 @@ +import type { Category } from '../../../constants'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; export { extractPackageFile } from './extract'; +export const categories: Category[] = ['terraform']; + // Only from GitHub Releases: https://github.com/terraform-linters/tflint/blob/master/docs/developer-guide/plugins.md#4-creating-a-github-release export const supportedDatasources = [GithubReleasesDatasource.id]; diff --git a/lib/modules/manager/travis/index.ts b/lib/modules/manager/travis/index.ts index 4bf39140df7e3f..048cc096f236d3 100644 --- a/lib/modules/manager/travis/index.ts +++ b/lib/modules/manager/travis/index.ts @@ -1,11 +1,9 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { GithubTagsDatasource } from '../../datasource/github-tags'; import * as nodeVersioning from '../../versioning/node'; export { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'node'; - export const supportedDatasources = [GithubTagsDatasource.id]; export const defaultConfig = { @@ -15,3 +13,5 @@ export const defaultConfig = { }, versioning: nodeVersioning.id, }; + +export const categories: Category[] = ['ci']; diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index 311288b6bf9369..de83d46ec6f272 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -5,7 +5,7 @@ import type { UpdateType, ValidationMessage, } from '../../config/types'; -import type { ProgrammingLanguage } from '../../constants'; +import type { Category } from '../../constants'; import type { ModuleApi, RangeStrategy, SkipReason } from '../../types'; import type { FileChange } from '../../util/git/types'; import type { MergeConfidence } from '../../util/merge-confidence/types'; @@ -229,7 +229,8 @@ export interface GlobalManagerConfig { export interface ManagerApi extends ModuleApi { defaultConfig: Record; - language?: ProgrammingLanguage; + + categories?: Category[]; supportsLockFileMaintenance?: boolean; supportedDatasources: string[]; diff --git a/lib/modules/manager/velaci/index.ts b/lib/modules/manager/velaci/index.ts index 4b81226c2eb991..cc469f0d81c992 100644 --- a/lib/modules/manager/velaci/index.ts +++ b/lib/modules/manager/velaci/index.ts @@ -1,3 +1,4 @@ +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; export { extractPackageFile } from './extract'; @@ -10,3 +11,5 @@ export const defaultConfig = { }; export const supportedDatasources = [DockerDatasource.id]; + +export const categories: Category[] = ['ci']; diff --git a/lib/modules/manager/woodpecker/index.ts b/lib/modules/manager/woodpecker/index.ts index 07a0c38a5c7702..67d4f616c409eb 100644 --- a/lib/modules/manager/woodpecker/index.ts +++ b/lib/modules/manager/woodpecker/index.ts @@ -1,13 +1,13 @@ -import type { ProgrammingLanguage } from '../../../constants'; +import type { Category } from '../../../constants'; import { DockerDatasource } from '../../datasource/docker'; import { extractPackageFile } from './extract'; -export const language: ProgrammingLanguage = 'docker'; - export { extractPackageFile }; export const defaultConfig = { fileMatch: ['^\\.woodpecker(?:/[^/]+)?\\.ya?ml$'], }; +export const categories: Category[] = ['ci']; + export const supportedDatasources = [DockerDatasource.id]; diff --git a/lib/util/package-rules/categories.ts b/lib/util/package-rules/categories.ts new file mode 100644 index 00000000000000..5e53f60665582b --- /dev/null +++ b/lib/util/package-rules/categories.ts @@ -0,0 +1,20 @@ +import is from '@sindresorhus/is'; +import type { PackageRule, PackageRuleInputConfig } from '../../config/types'; +import { Matcher } from './base'; + +export class CategoriesMatcher extends Matcher { + override matches( + { categories }: PackageRuleInputConfig, + { matchCategories }: PackageRule + ): boolean | null { + if (is.nullOrUndefined(matchCategories)) { + return null; + } + + if (is.nullOrUndefined(categories)) { + return false; + } + + return matchCategories.some((value) => categories.includes(value)); + } +} diff --git a/lib/util/package-rules/index.spec.ts b/lib/util/package-rules/index.spec.ts index e34456503d66d2..79f29d7815ebdc 100644 --- a/lib/util/package-rules/index.spec.ts +++ b/lib/util/package-rules/index.spec.ts @@ -297,7 +297,6 @@ describe('util/package-rules/index', () => { }; const dep = { depType: 'dependencies', - language: 'js', manager: 'meteor', depName: 'node', }; @@ -318,6 +317,7 @@ describe('util/package-rules/index', () => { const dep = { depType: 'dependencies', language: 'python', + categories: ['python'], manager: 'pipenv', depName: 'node', }; @@ -325,11 +325,11 @@ describe('util/package-rules/index', () => { expect(res.x).toBeUndefined(); }); - it('filters languages with matching language', () => { + it('filters categories with matching category', () => { const config: TestConfig = { packageRules: [ { - matchLanguages: ['js', 'node'], + matchCategories: ['node'], matchPackageNames: ['node'], x: 1, }, @@ -337,7 +337,7 @@ describe('util/package-rules/index', () => { }; const dep = { depType: 'dependencies', - language: 'js', + categories: ['javascript', 'node'], manager: 'meteor', depName: 'node', }; @@ -345,11 +345,11 @@ describe('util/package-rules/index', () => { expect(res.x).toBe(1); }); - it('filters languages with non-matching language', () => { + it('filters categories with non-matching category', () => { const config: TestConfig = { packageRules: [ { - matchLanguages: ['docker'], + matchCategories: ['docker'], matchPackageNames: ['node'], x: 1, }, @@ -357,7 +357,25 @@ describe('util/package-rules/index', () => { }; const dep = { depType: 'dependencies', - language: 'python', + categories: ['python'], + manager: 'pipenv', + depName: 'node', + }; + const res = applyPackageRules({ ...config, ...dep }); + expect(res.x).toBeUndefined(); + }); + + it('filters categories with undefined category', () => { + const config: TestConfig = { + packageRules: [ + { + matchCategories: ['docker'], + x: 1, + }, + ], + }; + const dep = { + depType: 'dependencies', manager: 'pipenv', depName: 'node', }; @@ -1069,7 +1087,7 @@ describe('util/package-rules/index', () => { packageRules: [ { matchPackageNames: ['abc'], - matchLanguages: ['js'], + matchCategories: ['js'], x: 1, }, ], diff --git a/lib/util/package-rules/languages.ts b/lib/util/package-rules/languages.ts deleted file mode 100644 index 674963d881d6d5..00000000000000 --- a/lib/util/package-rules/languages.ts +++ /dev/null @@ -1,18 +0,0 @@ -import is from '@sindresorhus/is'; -import type { PackageRule, PackageRuleInputConfig } from '../../config/types'; -import { Matcher } from './base'; - -export class LanguagesMatcher extends Matcher { - override matches( - { language }: PackageRuleInputConfig, - { matchLanguages }: PackageRule - ): boolean | null { - if (is.undefined(matchLanguages)) { - return null; - } - if (is.undefined(language)) { - return false; - } - return matchLanguages.includes(language); - } -} diff --git a/lib/util/package-rules/matchers.ts b/lib/util/package-rules/matchers.ts index dd2672c777b678..a6966583e25be0 100644 --- a/lib/util/package-rules/matchers.ts +++ b/lib/util/package-rules/matchers.ts @@ -1,4 +1,5 @@ import { BaseBranchesMatcher } from './base-branches'; +import { CategoriesMatcher } from './categories'; import { CurrentValueMatcher } from './current-value'; import { CurrentVersionMatcher } from './current-version'; import { DatasourcesMatcher } from './datasources'; @@ -6,7 +7,6 @@ import { DepNameMatcher } from './dep-names'; import { DepPatternsMatcher } from './dep-patterns'; import { DepTypesMatcher } from './dep-types'; import { FileNamesMatcher } from './files'; -import { LanguagesMatcher } from './languages'; import { ManagersMatcher } from './managers'; import { MergeConfidenceMatcher } from './merge-confidence'; import { PackageNameMatcher } from './package-names'; @@ -30,7 +30,6 @@ matchers.push([ ]); matchers.push([new FileNamesMatcher()]); matchers.push([new DepTypesMatcher()]); -matchers.push([new LanguagesMatcher()]); matchers.push([new BaseBranchesMatcher()]); matchers.push([new ManagersMatcher()]); matchers.push([new DatasourcesMatcher()]); @@ -39,3 +38,4 @@ matchers.push([new MergeConfidenceMatcher()]); matchers.push([new SourceUrlsMatcher(), new SourceUrlPrefixesMatcher()]); matchers.push([new CurrentValueMatcher()]); matchers.push([new CurrentVersionMatcher()]); +matchers.push([new CategoriesMatcher()]); diff --git a/lib/workers/types.ts b/lib/workers/types.ts index 1313fa33081a45..3df5bb85795dd8 100644 --- a/lib/workers/types.ts +++ b/lib/workers/types.ts @@ -44,7 +44,6 @@ export interface BranchUpgradeConfig group?: GroupConfig; groupName?: string; groupSlug?: string; - language?: string; manager: string; packageFile?: string; lockFile?: string; diff --git a/tools/docs/manager.ts b/tools/docs/manager.ts index 03f089130f7263..236bfdafd232de 100644 --- a/tools/docs/manager.ts +++ b/tools/docs/manager.ts @@ -9,6 +9,8 @@ import { replaceContent, } from './utils'; +const noCategoryDisplayName = 'no-category'; + function getTitle(manager: string, displayName: string): string { if (manager === 'regex') { return `Custom Manager Support using Regex`; @@ -26,19 +28,37 @@ export async function generateManagers( ): Promise { const managers = getManagers(); - const allLanguages: Record = {}; + const allCategories: Record = {}; + for (const [manager, definition] of managers) { - const language = definition.language ?? 'other'; - allLanguages[language] = allLanguages[language] || []; - allLanguages[language].push(manager); const { defaultConfig, supportedDatasources, urls } = definition; const { fileMatch } = defaultConfig as RenovateConfig; const displayName = getDisplayName(manager, definition); + + const categories = definition.categories ?? [noCategoryDisplayName]; + for (const category of categories) { + allCategories[category] ??= []; + allCategories[category].push(manager); + } + let md = `--- title: ${getTitle(manager, displayName)} sidebar_label: ${displayName} --- `; + md += '**Categories**: '; + if (categories.length) { + for (let i = 0; i < categories.length; i++) { + const category = categories[i]; + if (i < categories.length - 1) { + md += `\`${category}\`, `; + } else { + md += `\`${category}\``; + } + } + } + md += '\n\n'; + if (manager !== 'regex') { const nameWithUrl = getNameWithUrl(manager, definition); md += `Renovate supports updating ${nameWithUrl} dependencies.\n\n`; @@ -96,19 +116,21 @@ sidebar_label: ${displayName} await updateFile(`${dist}/modules/manager/${manager}/index.md`, md); } - const languages = Object.keys(allLanguages).filter( - (language) => language !== 'other' + + // add noCategoryDisplayName as last option + const categories = Object.keys(allCategories).filter( + (category) => category !== noCategoryDisplayName ); - languages.sort(); - languages.push('other'); - let languageText = '\n'; + categories.sort(); + categories.push(noCategoryDisplayName); + let categoryText = '\n'; - for (const language of languages) { - languageText += `**${language}**: `; - languageText += allLanguages[language].map(getManagerLink).join(', '); - languageText += '\n\n'; + for (const category of categories) { + categoryText += `**${category}**: `; + categoryText += allCategories[category].map(getManagerLink).join(', '); + categoryText += '\n\n'; } let indexContent = await readFile(`docs/usage/modules/manager/index.md`); - indexContent = replaceContent(indexContent, languageText); + indexContent = replaceContent(indexContent, categoryText); await updateFile(`${dist}/modules/manager/index.md`, indexContent); }