diff --git a/CHANGELOG.md b/CHANGELOG.md index 825c32f..b21cd4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,7 @@ # Changelog + +## 0.1.0-alpha.3 (2023-05-05) + +### Enhancements + +* Use `ROUTEX_DEBUG=true` to help debugging compilation issues diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md new file mode 100644 index 0000000..b06a4cd --- /dev/null +++ b/TROUBLESHOOTING.md @@ -0,0 +1,11 @@ +# Troubleshooting + +## Compilation + +When your application fails to compile you might find the cause by setting the +environment variable `ROUTEX_DEBUG` to `true`. + + ROUTEX_DEBUG=true mix compile + +Do note that this might show early compilation issues, but will make the final +compilation fail at all times. diff --git a/USAGE.md b/USAGE.md index cc9cd9f..a274117 100644 --- a/USAGE.md +++ b/USAGE.md @@ -116,3 +116,6 @@ admin routes) end + end ``` + +When you run into issues, please have a look at the [Troubleshooting](TROUBLESHOOTING.md) + diff --git a/lib/routex/processing.ex b/lib/routex/processing.ex index b87a657..724ebda 100644 --- a/lib/routex/processing.ex +++ b/lib/routex/processing.ex @@ -45,11 +45,11 @@ defmodule Routex.Processing do # Enable to get more descriptive error messages during development. # Causes compilation failure when enabled. - wrap_in_task = false + wrap_in_task = System.get_env("ROUTEX_DEBUG") == "true" if wrap_in_task do IO.warn( - "Routex processing is wrapped in a task for debugging purposes. Compilation will fail" + "\n\n!! Routex processing is wrapped in a task for debugging purposes. Compilation will fail !!\n\n" ) task = Task.async(fn -> execute_callbacks(env) end) diff --git a/mix.exs b/mix.exs index 951c2c3..f82e56c 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule Routex.MixProject do use Mix.Project @source_url "https://github.com/BartOtten/routex" - @version "0.1.0-alpha.2" + @version "0.1.0-alpha.3" @name "Phoenix Routes Extension Framework" def project do @@ -83,7 +83,7 @@ defmodule Routex.MixProject do maintainers: ["Bart Otten"], licenses: ["MIT"], files: ~w(lib .formatter.exs mix.exs README.md LICENSE.md - CHANGELOG.md CONTRIBUTING.md USAGE.md EXTENSIONS.md), + CHANGELOG.md CONTRIBUTING.md USAGE.md EXTENSIONS.md TROUBLESHOOTING.md), links: %{ Changelog: "https://hexdocs.pm/routex/changelog.html", GitHub: "https://github.com/BartOtten/routex" @@ -102,7 +102,7 @@ defmodule Routex.MixProject do source_url: @source_url, assets: "assets", before_closing_head_tag: &docs_before_closing_head_tag/1, - extras: ["README.md", "USAGE.md", "CHANGELOG.md", "EXTENSIONS.md"], + extras: ["README.md", "USAGE.md", "CHANGELOG.md", "EXTENSIONS.md", "TROUBLESHOOTING.md"], filter_modules: ~r"Elixir.Routex\..*$", groups_for_modules: [ Routex: ~r"Routex\.?[^.]*$",