Skip to content

Commit

Permalink
docs(adding-package-manager): add missing functions of ManagerAPI int…
Browse files Browse the repository at this point in the history
…erface (#21535)

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
  • Loading branch information
secustor and HonkingGoose committed Apr 29, 2023
1 parent 708f5e8 commit ab04c11
Showing 1 changed file with 40 additions and 5 deletions.
45 changes: 40 additions & 5 deletions docs/development/adding-a-package-manager.md
Expand Up @@ -14,11 +14,23 @@ Common application logic for Renovate, not specific to particular managers, usua

The manager's `index.ts` file supports the following values/functions:

- extractPackageFile
- extractAllPackageFiles
- getRangeStrategy (optional)
- language (optional)
- supportsLockFileMaintenance (optional)
| Value/function | Optional | Async |
| ----------------------------- | -------- | ----- |
| `bumpPackageVersion` | yes | |
| `extractPackageFile` | | yes |
| `extractAllPackageFiles` | yes | yes |
| `getRangeStrategy` | yes | |
| `language` | yes | |
| `supportsLockFileMaintenance` | yes | |
| `updateArtifacts` | yes | yes |
| `updateDependency` | yes | |
| `updateLockedDependency` | yes | |

### `bumpPackageVersion` (optional)

Use this function to allow version bumps of updated packages.
For example, to increase the version of a Maven module if a package has been updated.
Another example would be to bump the Helm chart version, if a subchart version has been updated.

### `extractPackageFile(content, packageFile, config)` (async, semi-mandatory)

Expand Down Expand Up @@ -67,3 +79,26 @@ This is used when more than one package manager shares settings from a common la
### `supportsLockFileMaintenance` (optional)

Set to true if this package manager needs to update lock files in addition to package files.

### `updateArtifacts` (async, optional)

Use `updateArtifacts` to run binaries that in turn will update files.
`updateArtifacts` is often used to indirectly update lock files.

To _directly_ update dependencies in lock files: use `updateLockedDependency` instead.

`updateArtifacts` gets triggered:

- after a dependency update (for a package file), or
- during `lockfileMaintenance`

### `updateDependency` (optional)

Use `updateDependency` if _both_ conditions apply:

- the manager can't be updated to use the standard replacing mechanism
- a custom replacement has to be provided

### `updateLockedDependency` (optional)

Use `updateLockedDependency` to directly update dependencies in lock files.

0 comments on commit ab04c11

Please sign in to comment.