Skip to content

Commit

Permalink
fix(mix): rename depTypes to prod & dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed Dec 28, 2024
1 parent 601b6ac commit 9a12b77
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
64 changes: 32 additions & 32 deletions lib/modules/manager/mix/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,117 +20,117 @@ 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',
},
{
currentDigest: undefined,
currentValue: '0.6.0',
datasource: 'github-tags',
depName: 'cowboy',
depType: 'dependencies',
depType: 'prod',
packageName: 'ninenines/cowboy',
},
{
currentDigest: undefined,
currentValue: 'main',
datasource: 'git-tags',
depName: 'phoenix',
depType: 'dependencies',
depType: 'prod',
packageName: 'https://github.com/phoenixframework/phoenix.git',
},
{
currentDigest: '795036d997c7503b21fb64d6bf1a89b83c44f2b5',
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',
},
{
currentValue: '== 1.0.10',
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',
},
{
currentValue: '== 0.37.0',
currentVersion: '0.37.0',
datasource: 'hex',
depName: 'floki',
depType: 'devDependencies',
depType: 'dev',
packageName: 'floki',
},
]);
Expand All @@ -145,15 +145,15 @@ describe('modules/manager/mix/extract', () => {
currentValue: '~> 0.8.1',
datasource: 'hex',
depName: 'postgrex',
depType: 'dependencies',
depType: 'prod',
packageName: 'postgrex',
lockedVersion: '0.8.4',
},
{
currentValue: '<1.7.0 or ~>1.7.1',
datasource: 'hex',
depName: 'ranch',
depType: 'dependencies',
depType: 'prod',
packageName: 'ranch',
lockedVersion: '1.7.1',
},
Expand All @@ -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',
},
Expand All @@ -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,
},
Expand All @@ -180,55 +180,55 @@ describe('modules/manager/mix/extract', () => {
currentValue: undefined,
datasource: 'github-tags',
depName: 'ecto',
depType: 'dependencies',
depType: 'prod',
packageName: 'elixir-ecto/ecto',
lockedVersion: undefined,
},
{
currentValue: '~> 1.0',
datasource: 'hex',
depName: 'secret',
depType: 'dependencies',
depType: 'prod',
packageName: 'secret:acme',
lockedVersion: '1.5.0',
},
{
currentValue: '~> 1.0',
datasource: 'hex',
depName: 'also_secret',
depType: 'devDependencies',
depType: 'dev',
packageName: 'also_secret:acme',
lockedVersion: '1.3.4',
},
{
currentValue: '>0.2.0 and <=1.0.0',
datasource: 'hex',
depName: 'metrics',
depType: 'dependencies',
depType: 'prod',
packageName: 'metrics',
lockedVersion: '1.0.0',
},
{
currentValue: '>= 1.0.0',
datasource: 'hex',
depName: 'jason',
depType: 'dependencies',
depType: 'prod',
packageName: 'jason',
lockedVersion: '1.4.4',
},
{
currentValue: '~> 1.0',
datasource: 'hex',
depName: 'hackney',
depType: 'dependencies',
depType: 'prod',
packageName: 'hackney',
lockedVersion: '1.20.1',
},
{
currentValue: '~> 6.1',
datasource: 'hex',
depName: 'hammer_backend_redis',
depType: 'dependencies',
depType: 'prod',
packageName: 'hammer_backend_redis',
lockedVersion: '6.2.0',
},
Expand All @@ -237,31 +237,31 @@ describe('modules/manager/mix/extract', () => {
currentVersion: '1.0.10',
datasource: 'hex',
depName: 'castore',
depType: 'dependencies',
depType: 'prod',
packageName: 'castore',
lockedVersion: '1.0.10',
},
{
currentValue: '~> 2.0.0',
datasource: 'hex',
depName: 'gun',
depType: 'dependencies',
depType: 'prod',
packageName: 'grpc_gun',
lockedVersion: '2.0.1',
},
{
currentValue: '~> 0.4.0',
datasource: 'hex',
depName: 'another_gun',
depType: 'dependencies',
depType: 'prod',
packageName: 'raygun',
lockedVersion: '0.4.0',
},
{
currentValue: '~> 1.7',
datasource: 'hex',
depName: 'credo',
depType: 'devDependencies',
depType: 'dev',
packageName: 'credo',
lockedVersion: '1.7.10',
},
Expand All @@ -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',
},
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/manager/mix/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function extractPackageFile(

const dep: PackageDependency = {
depName: app,
depType: 'dependencies',
depType: 'prod',
};

if (git ?? github) {
Expand All @@ -86,7 +86,7 @@ export async function extractPackageFile(
}

if (onlyValue !== undefined && !onlyEnvironments.includes('prod')) {
dep.depType = 'devDependencies';
dep.depType = 'dev';
}

deps.set(app, dep);
Expand Down
8 changes: 4 additions & 4 deletions lib/modules/manager/mix/readme.md
Original file line number Diff line number Diff line change
@@ -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`

0 comments on commit 9a12b77

Please sign in to comment.