Skip to content

Commit

Permalink
Remove icon build module from build
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurClemens committed Aug 12, 2024
1 parent 45fb9f9 commit 2ea0e31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 3 additions & 8 deletions lib/helpers/octicons_helper.ex → lib_target/octicons_helper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ defmodule PrimerLive.Helpers.OcticonsHelper do
filenames
|> Enum.map(
&%{
svg: load_svg_data(icons_path, &1),
svg:
File.read!("#{icons_path}/#{&1}")
|> String.replace(~r/\<svg/, "<svg class={@class} {@rest}"),
name: &1 |> String.replace(".svg", "")
}
)
Expand Down Expand Up @@ -106,13 +108,6 @@ defmodule PrimerLive.Helpers.OcticonsHelper do
end
end

# sobelow_skip ["Traversal.FileModule"]
defp load_svg_data(icons_path, filename) do
"#{icons_path}/#{filename}"
|> File.read!()
|> String.replace(~r/\<svg/, "<svg class={@class} {@rest}")
end

defp file_count(filenames) do
case Enum.count(filenames) do
0 -> {:error, :empty}
Expand Down
6 changes: 5 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ defmodule PrimerLive.MixProject do
app: :primer_live,
version: "0.7.1",
homepage_url: "https://github.com/ArthurClemens/primer_live",
elixirc_paths: elixirc_paths(Mix.env()),
description: description(),
package: package(),
aliases: aliases(),
Expand All @@ -16,6 +17,9 @@ defmodule PrimerLive.MixProject do
]
end

defp elixirc_paths(:dev), do: ["lib", "lib_target"]
defp elixirc_paths(_), do: ["lib"]

defp description do
"An implementation of GitHub's Primer Design System for Phoenix LiveView."
end
Expand All @@ -33,7 +37,7 @@ defmodule PrimerLive.MixProject do
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:ecto_sql, "~> 3.10", only: :test, runtime: false},
{:ecto, "~> 3.10", runtime: false},
{:esbuild, "~> 0.8", only: :dev},
{:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
{:ex_doc, "0.30.5", only: :dev},
{:jason, "~> 1.4"},
{:phoenix_ecto, "~> 4.5", only: :test, runtime: false},
Expand Down

0 comments on commit 2ea0e31

Please sign in to comment.