Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Oct 22, 2024
1 parent 87a6d3c commit 48a0d91
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 25 deletions.
16 changes: 11 additions & 5 deletions flavours/classic/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ 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)
if Code.ensure_loaded?(Bonfire.Mixer),
do:
Bonfire.Mixer.deps_for(:bonfire)
|> Bonfire.Mixer.deps_names_list(true),
else: []

dep_paths =
if Code.ensure_loaded?(Bonfire.Mixer), do: Bonfire.Mixer.dep_paths(bonfire_deps), else: []

#### Basic configuration

Expand Down Expand Up @@ -184,7 +190,7 @@ Code.eval_file(
cond do
File.exists?("extensions/bonfire_files/lib/mime_types.ex") -> "extensions/bonfire_files/lib/"
File.exists?("deps/bonfire_files/lib/mime_types.ex") -> "deps/bonfire_files/lib/"
true -> "config/"
true -> Path.dirname(__ENV__.file)
end
)

Expand Down Expand Up @@ -279,7 +285,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_deps),
root_source_code_paths: [project_root] ++ dep_paths,
source_code_exclude_patterns: [
~r/\/flavours\//,
~r/\/extensions\//,
Expand Down Expand Up @@ -314,7 +320,7 @@ config :live_view_native_stylesheet,
|> IO.inspect(limit: :infinity),
output: "assets/static/assets"

if Bonfire.Mixer.compile_disabled?() do
if Code.ensure_loaded?(Bonfire.Mixer) and Bonfire.Mixer.compile_disabled?() do
for dep <-
Bonfire.Mixer.mess_other_flavour_dep_names(flavour)
|> Bonfire.Mixer.log(
Expand Down
16 changes: 10 additions & 6 deletions flavours/classic/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ config :bonfire_umbrella, Bonfire.Common.Repo,
stacktrace: true

local_deps =
Mess.read_umbrella(
# Path.expand("config/"),
config_dir: "config/",
use_local_forks?: System.get_env("WITH_FORKS", "1") == "1"
)
if Code.ensure_loaded?(Mess),
do:
Mess.read_umbrella(
# Path.expand("config/"),
config_dir: "config/",
use_local_forks?: System.get_env("WITH_FORKS", "1") == "1"
),
else: []

# if System.get_env("WITH_FORKS", "1") == "1" , do:
# Mess.deps(
Expand Down Expand Up @@ -101,7 +104,8 @@ if System.get_env("HOT_CODE_RELOAD") != "-1" do
~r"(live_handler|live_handlers|routes)\.ex$"
]

Bonfire.Mixer.log(patterns, "Watching these filenames for live reloading in the browser")
if Code.ensure_loaded?(Bonfire.Mixer),
do: Bonfire.Mixer.log(patterns, "Watching these filenames for live reloading in the browser")

config :bonfire, Bonfire.Web.Endpoint,
code_reloader: enable_reloader?,
Expand Down
65 changes: 64 additions & 1 deletion flavours/classic/config/mime_types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,70 @@ defmodule Bonfire.Files.MimeTypes do
"application/json" => ["json"],
"application/activity+json" => ["activity+json"],
"application/ld+json" => ["ld+json"],
"application/jrd+json" => ["jrd+json"]
"application/jrd+json" => ["jrd+json"],
"application/json" => ["json"],
"application/activity+json" => ["activity+json"],
"application/ld+json" => ["ld+json"],
"application/jrd+json" => ["jrd+json"],
"application/x-tar" => ["tar"],
"application/x-bzip" => ["bzip"],
"application/x-bzip2" => ["bzip2"],
"application/gzip" => ["gz", "gzip"],
"application/zip" => ["zip"],
"application/vnd.rar" => ["rar"],
"application/x-7z-compressed" => ["7z"],
"text/plain" => ["txt", "text", "log", "asc"],
"application/gzip" => ["gz", "gzip"],
"text/swiftui" => ["swiftui"],
"text/jetpack" => ["jetpack"],
"video/mpeg" => ["mpeg", "m1v", "m2v", "mpa", "mpe", "mpg"],
"audio/wav" => ["wav"],
"video/3gpp" => ["3gp"],
"application/x-mobipocket-ebook" => ["prc", "mobi"],
"application/x-bzip2" => ["bzip2"],
"text/csv" => ["csv"],
"image/svg+xml" => ["svg"],
"audio/mpeg" => ["mpa", "mp2"],
"application/epub+zip" => ["epub"],
"application/x-matroska" => ["mkv"],
"application/jrd+json" => ["jrd+json"],
"image/webp" => ["webp"],
"application/json" => ["json"],
"image/gif" => ["gif"],
"text/tab-separated-values" => ["tsv"],
"image/png" => ["png"],
"audio/webm" => ["webm"],
"audio/opus" => ["opus"],
"application/rtf" => ["rtf"],
"application/ld+json" => ["ld+json"],
"video/webm" => ["webm"],
"application/ics" => ["vcs", "ics"],
"video/mp4" => ["mp4", "mp4v", "mpg4"],
"audio/mp4" => ["m4a", "mp4"],
"application/x-7z-compressed" => ["7z"],
"audio/mp3" => ["mp3"],
"text/markdown" => ["md", "mkd", "markdown", "livemd"],
"audio/flac" => ["flac"],
"application/activity+json" => ["activity+json"],
"audio/m4a" => ["m4a"],
"image/jpeg" => ["jpg", "jpeg"],
"audio/x-m4a" => ["m4a"],
"video/3gpp2" => ["3g2"],
"application/vnd.rar" => ["rar"],
"video/x-msvideo" => ["avi"],
"application/pdf" => ["pdf"],
"audio/ogg" => ["ogg", "oga"],
"text/plain" => ["txt", "text", "log", "asc"],
"text/styles" => ["styles"],
"application/zip" => ["zip"],
"video/quicktime" => ["mov", "qt"],
"audio/aac" => ["aac"],
"application/x-bzip" => ["bzip"],
"video/x-matroska" => ["mkv"],
"text/x-vcard" => ["vcf"],
"video/ogg" => ["ogg", "ogv"],
"image/apng" => ["apng"],
"application/x-tar" => ["tar"]
}

# define which is preferred when more than one
Expand Down
Loading

0 comments on commit 48a0d91

Please sign in to comment.