Skip to content

Commit dadfc48

Browse files
committed
Release 0.4.1 — fix mix tasks crashing with 'unknown registry: Req.Finch'
Start Req before running mix tasks instead of relying on app.config.
1 parent ae9dfd2 commit dadfc48

35 files changed

Lines changed: 40 additions & 36 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.4.1
4+
5+
- Fix mix tasks crashing with `unknown registry: Req.Finch` when host app hasn't started the HTTP stack
6+
37
## 0.4.0
48

59
### New Mix Tasks (21 new, 43 total)

lib/mix/tasks/npm.audit.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Mix.Tasks.Npm.Audit do
1414

1515
@impl true
1616
def run([]) do
17-
Mix.Task.run("app.config")
17+
Application.ensure_all_started(:req)
1818

1919
case NPM.Lockfile.read() do
2020
{:ok, lockfile} when lockfile == %{} ->

lib/mix/tasks/npm.cache.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule Mix.Tasks.Npm.Cache do
1212

1313
@impl true
1414
def run(["status"]) do
15-
Mix.Task.run("app.config")
15+
Application.ensure_all_started(:req)
1616
cache_dir = NPM.Cache.dir()
1717

1818
if File.exists?(cache_dir) do
@@ -26,7 +26,7 @@ defmodule Mix.Tasks.Npm.Cache do
2626
end
2727

2828
def run(["clean"]) do
29-
Mix.Task.run("app.config")
29+
Application.ensure_all_started(:req)
3030
cache_dir = NPM.Cache.dir()
3131

3232
if File.exists?(cache_dir) do

lib/mix/tasks/npm.check.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule Mix.Tasks.Npm.Check do
1616

1717
@impl true
1818
def run([]) do
19-
Mix.Task.run("app.config")
19+
Application.ensure_all_started(:req)
2020

2121
checks = [
2222
check_package_json(),

lib/mix/tasks/npm.ci.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Mix.Tasks.Npm.Ci do
1414

1515
@impl true
1616
def run([]) do
17-
Mix.Task.run("app.config")
17+
Application.ensure_all_started(:req)
1818
NPM.install(frozen: true)
1919
end
2020

lib/mix/tasks/npm.config.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defmodule Mix.Tasks.Npm.Config do
1313

1414
@impl true
1515
def run([]) do
16-
Mix.Task.run("app.config")
16+
Application.ensure_all_started(:req)
1717

1818
Mix.shell().info("registry: #{NPM.Registry.registry_url()}")
1919
Mix.shell().info("cache: #{NPM.Cache.dir()}")

lib/mix/tasks/npm.dedupe.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Mix.Tasks.Npm.Dedupe do
1414

1515
@impl true
1616
def run([]) do
17-
Mix.Task.run("app.config")
17+
Application.ensure_all_started(:req)
1818

1919
case NPM.Lockfile.read() do
2020
{:ok, lockfile} when lockfile == %{} ->

lib/mix/tasks/npm.deprecations.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Mix.Tasks.Npm.Deprecations do
1414

1515
@impl true
1616
def run([]) do
17-
Mix.Task.run("app.config")
17+
Application.ensure_all_started(:req)
1818

1919
case NPM.Lockfile.read() do
2020
{:ok, lockfile} when lockfile == %{} ->

lib/mix/tasks/npm.diff.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Mix.Tasks.Npm.Diff do
1414

1515
@impl true
1616
def run([]) do
17-
Mix.Task.run("app.config")
17+
Application.ensure_all_started(:req)
1818

1919
case read_git_lockfile() do
2020
{:ok, old_lockfile} ->

lib/mix/tasks/npm.doctor.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defmodule Mix.Tasks.Npm.Doctor do
1919

2020
@impl true
2121
def run([]) do
22-
Mix.Task.run("app.config")
22+
Application.ensure_all_started(:req)
2323

2424
checks = [
2525
{"package.json", check_package_json()},

0 commit comments

Comments
 (0)