diff --git a/lib/modules/manager/mix/extract.spec.ts b/lib/modules/manager/mix/extract.spec.ts index 37d7c990e60585..a20ea0327fd715 100644 --- a/lib/modules/manager/mix/extract.spec.ts +++ b/lib/modules/manager/mix/extract.spec.ts @@ -20,14 +20,14 @@ describe('modules/manager/mix/extract', () => { currentValue: '~> 0.8.1', datasource: 'hex', depName: 'postgrex', - depType: 'dependencies', + depType: 'prod', packageName: 'postgrex', }, { currentValue: '<1.7.0 or ~>1.7.1', datasource: 'hex', depName: 'ranch', - depType: 'dependencies', + depType: 'prod', packageName: 'ranch', }, { @@ -35,7 +35,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '0.6.0', datasource: 'github-tags', depName: 'cowboy', - depType: 'dependencies', + depType: 'prod', packageName: 'ninenines/cowboy', }, { @@ -43,7 +43,7 @@ describe('modules/manager/mix/extract', () => { currentValue: 'main', datasource: 'git-tags', depName: 'phoenix', - depType: 'dependencies', + depType: 'prod', packageName: 'https://github.com/phoenixframework/phoenix.git', }, { @@ -51,49 +51,49 @@ describe('modules/manager/mix/extract', () => { currentValue: undefined, datasource: 'github-tags', depName: 'ecto', - depType: 'dependencies', + depType: 'prod', packageName: 'elixir-ecto/ecto', }, { currentValue: '~> 1.0', datasource: 'hex', depName: 'secret', - depType: 'dependencies', + depType: 'prod', packageName: 'secret:acme', }, { currentValue: '~> 1.0', datasource: 'hex', depName: 'also_secret', - depType: 'devDependencies', + depType: 'dev', packageName: 'also_secret:acme', }, { currentValue: '>0.2.0 and <=1.0.0', datasource: 'hex', depName: 'metrics', - depType: 'dependencies', + depType: 'prod', packageName: 'metrics', }, { currentValue: '>= 1.0.0', datasource: 'hex', depName: 'jason', - depType: 'dependencies', + depType: 'prod', packageName: 'jason', }, { currentValue: '~> 1.0', datasource: 'hex', depName: 'hackney', - depType: 'dependencies', + depType: 'prod', packageName: 'hackney', }, { currentValue: '~> 6.1', datasource: 'hex', depName: 'hammer_backend_redis', - depType: 'dependencies', + depType: 'prod', packageName: 'hammer_backend_redis', }, { @@ -101,28 +101,28 @@ describe('modules/manager/mix/extract', () => { currentVersion: '1.0.10', datasource: 'hex', depName: 'castore', - depType: 'dependencies', + depType: 'prod', packageName: 'castore', }, { currentValue: '~> 2.0.0', datasource: 'hex', depName: 'gun', - depType: 'dependencies', + depType: 'prod', packageName: 'grpc_gun', }, { currentValue: '~> 0.4.0', datasource: 'hex', depName: 'another_gun', - depType: 'dependencies', + depType: 'prod', packageName: 'raygun', }, { currentValue: '~> 1.7', datasource: 'hex', depName: 'credo', - depType: 'devDependencies', + depType: 'dev', packageName: 'credo', }, { @@ -130,7 +130,7 @@ describe('modules/manager/mix/extract', () => { currentVersion: '0.37.0', datasource: 'hex', depName: 'floki', - depType: 'devDependencies', + depType: 'dev', packageName: 'floki', }, ]); @@ -145,7 +145,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '~> 0.8.1', datasource: 'hex', depName: 'postgrex', - depType: 'dependencies', + depType: 'prod', packageName: 'postgrex', lockedVersion: '0.8.4', }, @@ -153,7 +153,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '<1.7.0 or ~>1.7.1', datasource: 'hex', depName: 'ranch', - depType: 'dependencies', + depType: 'prod', packageName: 'ranch', lockedVersion: '1.7.1', }, @@ -162,7 +162,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '0.6.0', datasource: 'github-tags', depName: 'cowboy', - depType: 'dependencies', + depType: 'prod', packageName: 'ninenines/cowboy', lockedVersion: '0.6.0', }, @@ -171,7 +171,7 @@ describe('modules/manager/mix/extract', () => { currentValue: 'main', datasource: 'git-tags', depName: 'phoenix', - depType: 'dependencies', + depType: 'prod', packageName: 'https://github.com/phoenixframework/phoenix.git', lockedVersion: undefined, }, @@ -180,7 +180,7 @@ describe('modules/manager/mix/extract', () => { currentValue: undefined, datasource: 'github-tags', depName: 'ecto', - depType: 'dependencies', + depType: 'prod', packageName: 'elixir-ecto/ecto', lockedVersion: undefined, }, @@ -188,7 +188,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '~> 1.0', datasource: 'hex', depName: 'secret', - depType: 'dependencies', + depType: 'prod', packageName: 'secret:acme', lockedVersion: '1.5.0', }, @@ -196,7 +196,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '~> 1.0', datasource: 'hex', depName: 'also_secret', - depType: 'devDependencies', + depType: 'dev', packageName: 'also_secret:acme', lockedVersion: '1.3.4', }, @@ -204,7 +204,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '>0.2.0 and <=1.0.0', datasource: 'hex', depName: 'metrics', - depType: 'dependencies', + depType: 'prod', packageName: 'metrics', lockedVersion: '1.0.0', }, @@ -212,7 +212,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '>= 1.0.0', datasource: 'hex', depName: 'jason', - depType: 'dependencies', + depType: 'prod', packageName: 'jason', lockedVersion: '1.4.4', }, @@ -220,7 +220,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '~> 1.0', datasource: 'hex', depName: 'hackney', - depType: 'dependencies', + depType: 'prod', packageName: 'hackney', lockedVersion: '1.20.1', }, @@ -228,7 +228,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '~> 6.1', datasource: 'hex', depName: 'hammer_backend_redis', - depType: 'dependencies', + depType: 'prod', packageName: 'hammer_backend_redis', lockedVersion: '6.2.0', }, @@ -237,7 +237,7 @@ describe('modules/manager/mix/extract', () => { currentVersion: '1.0.10', datasource: 'hex', depName: 'castore', - depType: 'dependencies', + depType: 'prod', packageName: 'castore', lockedVersion: '1.0.10', }, @@ -245,7 +245,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '~> 2.0.0', datasource: 'hex', depName: 'gun', - depType: 'dependencies', + depType: 'prod', packageName: 'grpc_gun', lockedVersion: '2.0.1', }, @@ -253,7 +253,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '~> 0.4.0', datasource: 'hex', depName: 'another_gun', - depType: 'dependencies', + depType: 'prod', packageName: 'raygun', lockedVersion: '0.4.0', }, @@ -261,7 +261,7 @@ describe('modules/manager/mix/extract', () => { currentValue: '~> 1.7', datasource: 'hex', depName: 'credo', - depType: 'devDependencies', + depType: 'dev', packageName: 'credo', lockedVersion: '1.7.10', }, @@ -270,7 +270,7 @@ describe('modules/manager/mix/extract', () => { currentVersion: '0.37.0', datasource: 'hex', depName: 'floki', - depType: 'devDependencies', + depType: 'dev', lockedVersion: '0.37.0', packageName: 'floki', }, diff --git a/lib/modules/manager/mix/extract.ts b/lib/modules/manager/mix/extract.ts index c28ab016bcef51..663b6cce6becc0 100644 --- a/lib/modules/manager/mix/extract.ts +++ b/lib/modules/manager/mix/extract.ts @@ -61,7 +61,7 @@ export async function extractPackageFile( const dep: PackageDependency = { depName: app, - depType: 'dependencies', + depType: 'prod', }; if (git ?? github) { @@ -86,7 +86,7 @@ export async function extractPackageFile( } if (onlyValue !== undefined && !onlyEnvironments.includes('prod')) { - dep.depType = 'devDependencies'; + dep.depType = 'dev'; } deps.set(app, dep); diff --git a/lib/modules/manager/mix/readme.md b/lib/modules/manager/mix/readme.md index 803601d38711e0..7fbafcb30d9418 100644 --- a/lib/modules/manager/mix/readme.md +++ b/lib/modules/manager/mix/readme.md @@ -1,8 +1,8 @@ -The `mix` manager extracts dependencies for the `hex` datasource and uses Renovate's implementation of Hex SemVer to evaluate updates. +The `mix` manager extracts prod for the `hex` datasource and uses Renovate's implementation of Hex SemVer to evaluate updates. The `mix` package manager itself is also used to keep the lock file up-to-date. -The following `depTypes` are currently supported by the npm manager : +The following `depTypes` are currently supported by the mix manager : -- `dependencies` -- `devDependencies` +- `prod`: all dependencies by default +- `dev`: dependencies with [`:only` option](https://hexdocs.pm/mix/1.18.1/Mix.Tasks.Deps.html#module-dependency-definition-options) not containing `:prod`