Skip to content

Commit

Permalink
https://github.com/bonfire-networks/bonfire-app
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Oct 9, 2024
1 parent e8b0a69 commit 2b66423
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
22 changes: 15 additions & 7 deletions flavours/classic/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ flavour_path = System.get_env("FLAVOUR_PATH", "flavours/" <> flavour)
project_root = File.cwd!()
as_desktop_app? = System.get_env("AS_DESKTOP_APP") in ["1", "true"]
env = config_env()

bonfire_deps =
Bonfire.Mixer.deps_for(:bonfire)
|> Bonfire.Mixer.deps_names_list(true)

#### Basic configuration

# You probably won't want to touch these. You might override some in
Expand Down Expand Up @@ -274,8 +279,7 @@ config :sentry,
# TODO? see https://hexdocs.pm/sentry/upgrade-10-x.html#actively-package-your-source-code
# NOTE: enabling `enable_source_code_context` errors with `Found two source files in different source root paths with the same relative path`
enable_source_code_context: false,
root_source_code_paths:
[project_root] ++ Bonfire.Mixer.dep_paths(Bonfire.Mixer.deps_names_for(:bonfire)),
root_source_code_paths: [project_root] ++ Bonfire.Mixer.dep_paths(bonfire_deps),
source_code_exclude_patterns: [
~r/\/flavours\//,
~r/\/extensions\//,
Expand All @@ -298,12 +302,16 @@ config :live_view_native,
config :phoenix, :template_engines, neex: LiveViewNative.Engine

config :live_view_native_stylesheet,
content: [
swiftui: [
"*_swiftui_styles.ex"
content:
[
# swiftui: ["lib/**/*swiftui*"] ++
# for dep <- bonfire_deps do
# if Mix.Project.deps_paths[dep], do: {dep, "lib/**/*swiftui*"}
# end
# |> Enum.reject(&is_nil/1)
]
],
output: "priv/static/assets"
|> IO.inspect(limit: :infinity),
output: "assets/static/assets"

if Bonfire.Mixer.compile_disabled?() do
for dep <-
Expand Down
8 changes: 6 additions & 2 deletions flavours/classic/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ if System.get_env("HOT_CODE_RELOAD") != "-1" do
# filename patterns that should trigger hots reloads of components/CSS/etc (only within the above dirs)
hot_patterns = [
~r"(_live|_view|_styles)\.ex$",
~r{(live|views|pages|components)/.*(ex|css)$},
~r".*(heex|leex|sface|neex|hooks.js)$",
~r{(live|views|pages|components|themes)/.*(ex|css)$},
~r".*(heex|leex|sface|neex|hooks.js|swiftui.*)$",
~r"priv/catalogue/.*(ex)$",
~r"priv/static/.*styles$"
]
Expand All @@ -105,7 +105,11 @@ if System.get_env("HOT_CODE_RELOAD") != "-1" do

config :bonfire, Bonfire.Web.Endpoint,
code_reloader: enable_reloader?,
<<<<<<< HEAD
# TEMP
=======
# TEMP until this is available https://github.com/surface-ui/surface/pull/755
>>>>>>> ae711bd65b (https://github.com/bonfire-networks/bonfire-app)
reloadable_compilers: [:leex, :elixir],
# reloadable_compilers: [:leex, :elixir, :surface],
reloadable_apps: [:bonfire] ++ local_dep_names,
Expand Down
4 changes: 4 additions & 0 deletions flavours/classic/config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ config :bonfire_umbrella, Bonfire.Common.Repo,
config :activity_pub, :instance, federating: true

# config :surface, :compiler, warn_on_undefined_props: false

config :live_view_native_stylesheet,
annotations: false,
pretty: false
8 changes: 4 additions & 4 deletions lib/mix/mixer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -471,20 +471,20 @@ if not Code.ensure_loaded?(Bonfire.Mixer) do

def dep_path(dep, force? \\ false)

def dep_path(dep, force?) when is_binary(dep) do
Enum.map(forks_paths(), &path_if_exists(&1 <> dep))
def dep_path(dep, force?) when is_binary(dep) or is_atom(dep) do
Enum.map(forks_paths(), &path_if_exists("#{&1}#{dep}"))
|> Enum.reject(&is_nil/1)
|> List.first() ||
(
path =
(Mix.Project.deps_path() <> "/" <> dep)
(Mix.Project.deps_path() <> "/#{dep}")
|> Path.expand(File.cwd!())

if force?, do: path, else: path_if_exists(path) || "."
)
end

def dep_path(dep, force?) do
def dep_path(dep, force?) when is_tuple(dep) do
spec = elem(dep, 1)

path =
Expand Down

0 comments on commit 2b66423

Please sign in to comment.