Skip to content

Commit b2f3b57

Browse files
committed
fix spelling and unreachable code
1 parent dbbb1e3 commit b2f3b57

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

lib/mix/helpers.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ defmodule Backpex.Mix.Helpers do
7878
end
7979

8080
@doc """
81-
Checks if a npm package is already installed in the project.
81+
Checks if an npm package is already installed in the project.
8282
"""
8383
def npm_package_installed?(package_name) do
8484
env = [{"PATH", System.get_env("PATH")}]

lib/mix/tasks/backpex.install.ex

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ if Code.ensure_loaded?(Igniter) do
157157
Igniter.add_notice(igniter, "Installed daisyUI via npm.")
158158
else
159159
true ->
160-
Mix.shell().info("daisyui is already installed. Skipping.")
160+
Mix.shell().info("daisyUI is already installed. Skipping.")
161161
igniter
162162

163163
{:error, error} ->
@@ -231,8 +231,26 @@ if Code.ensure_loaded?(Igniter) do
231231
igniter
232232

233233
{:error, igniter} ->
234-
Mix.raise("Failed to add backpex routes")
235-
igniter
234+
Warning.warn_with_code_sample(
235+
igniter,
236+
"""
237+
Failed to add backpex routes automatically. Please manually add the following to your router.ex:
238+
239+
1. Add the import at the top of your router file:
240+
""",
241+
"import Backpex.Router"
242+
)
243+
|> Warning.warn_with_code_sample(
244+
"""
245+
2. Add the backpex routes in a scope with the browser pipeline:
246+
""",
247+
"""
248+
scope "/admin", #{Phoenix.web_module(igniter)} do
249+
pipe_through :browser
250+
backpex_routes()
251+
end
252+
"""
253+
)
236254
end
237255
end
238256
end
@@ -298,7 +316,7 @@ if Code.ensure_loaded?(Igniter) do
298316

299317
defp remove_bg_white? do
300318
Mix.shell().yes?(
301-
"A background color at the body could cause issues with the backpex app_shell. Do you want to remove it? See: https://hexdocs.pm/backpex/installation.html#remove-default-background-color"
319+
"A background color at the body could cause issues with the backpex app_shell component. Do you want to remove it? See: https://hexdocs.pm/backpex/installation.html#remove-default-background-color"
302320
)
303321
end
304322

priv/templates/layouts/admin.html.heex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
</:topbar>
1919
<:sidebar>
2020
<!-- Example Sidebar Item -->
21-
<%!-- <Backpex.HTML.Layout.sidebar_item current_url={@current_url} navigate={"/admin/users"}>
21+
<!-- <Backpex.HTML.Layout.sidebar_item current_url={@current_url} navigate={"/admin/users"}>
2222
<.icon name="hero-users" class="size-5" /> Users
23-
</Backpex.HTML.Layout.sidebar_item> --%>
23+
</Backpex.HTML.Layout.sidebar_item> -->
2424
</:sidebar>
2525
<Backpex.HTML.Layout.flash_messages flash={@flash} />
26-
{@inner_content}
26+
{@inner_content}
2727
</Backpex.HTML.Layout.app_shell>

0 commit comments

Comments
 (0)