This commit is contained in:
Mayel de Borniol 2023-02-04 17:50:23 +13:00
parent ecbed27bef
commit 8e47d66fe8
5 changed files with 346 additions and 10 deletions

View file

@ -18,6 +18,7 @@ import { EmojiHooks } from "./../../../deps/bonfire_ui_common/assets/js/emoji"
// import { EditorCkHooks } from "./../../../deps/bonfire_editor_ck/assets/js/extension"
// import { EditorQuillHooks } from "./../../../deps/bonfire_editor_quill/assets/js/extension"
import { ComposerHooks } from "./../../../deps/bonfire_ui_common/assets/js/composer"
import { CodeHooks } from "./../../../deps/bonfire_ui_common/assets/js/code"
// import { GeolocateHooks } from "./../../../deps/bonfire_geolocate/assets/js/extension"
// import { KanbanHooks } from "./../../../deps/bonfire_ui_kanban/assets/js/extension"
@ -27,6 +28,6 @@ import { ComposerHooks } from "./../../../deps/bonfire_ui_common/assets/js/compo
// import LiveSelect from "./../../../deps/live_select/assets/js/live_select"
import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js"
Object.assign(ExtensionHooks, ComposerHooks, PopupHooks, EmojiHooks, ResponsiveTabsHooks, CarouselHooks, FeedHooks, ChangeLocaleHooks, InputSelectHooks, NotificationsHooks, ThemeHooks, LiveSelect) // ImageHooks, EditorCkHooks, EditorQuillHooks
Object.assign(ExtensionHooks, ComposerHooks, PopupHooks, EmojiHooks, ResponsiveTabsHooks, CarouselHooks, FeedHooks, ChangeLocaleHooks, InputSelectHooks, NotificationsHooks, ThemeHooks, LiveSelect, CodeHooks) // ImageHooks, EditorCkHooks, EditorQuillHooks
export { ExtensionHooks }

View file

@ -119,8 +119,11 @@ prepare:
# Run the app in development
dev: init dev-run
@dev-extra:
iex --sname extra --remsh dev
@dev-run:
{{ if WITH_DOCKER == "total" { "just docker-stop-web && docker-compose run --name $WEB_CONTAINER --service-ports web" } else { "iex -S mix phx.server" } }}
{{ if WITH_DOCKER == "total" { "just docker-stop-web && docker-compose run --name $WEB_CONTAINER --service-ports web" } else { "iex --sname dev -S mix phx.server" } }}
@dev-remote: init
{{ if WITH_DOCKER == "total" { "WITH_FORKS=0 just docker-stop-web && docker-compose run --name $WEB_CONTAINER --service-ports web" } else { "WITH_FORKS=0 iex -S mix phx.server" } }}

View file

@ -204,7 +204,7 @@ defmodule Bonfire.Umbrella.MixProject do
releases: [
bonfire: [
runtime_config_path: Mixer.config_path(config(), "runtime.exs"),
# to enable debugging
# should BEAM files should have their debug information, documentation chunks, and other non-essential metadata?
strip_beams: false,
applications: [
bonfire: :permanent,

View file

@ -14,12 +14,12 @@
"benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"},
"benchee_html": {:hex, :benchee_html, "1.0.0", "5b4d24effebd060f466fb460ec06576e7b34a00fc26b234fe4f12c4f05c95947", [:mix], [{:benchee, ">= 0.99.0 and < 2.0.0", [hex: :benchee, repo: "hexpm", optional: false]}, {:benchee_json, "~> 1.0", [hex: :benchee_json, repo: "hexpm", optional: false]}], "hexpm", "5280af9aac432ff5ca4216d03e8a93f32209510e925b60e7f27c33796f69e699"},
"benchee_json": {:hex, :benchee_json, "1.0.0", "cc661f4454d5995c08fe10dd1f2f72f229c8f0fb1c96f6b327a8c8fc96a91fe5", [:mix], [{:benchee, ">= 0.99.0 and < 2.0.0", [hex: :benchee, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "da05d813f9123505f870344d68fb7c86a4f0f9074df7d7b7e2bb011a63ec231c"},
"bonfire": {:git, "https://github.com/bonfire-networks/bonfire_spark", "870db8b7232ed794d4619806c437683e3a3ac02e", [branch: "main"]},
"bonfire": {:git, "https://github.com/bonfire-networks/bonfire_spark", "21949af0e14ab78b556f09859a81d25b9df87276", [branch: "main"]},
"bonfire_api_graphql": {:git, "https://github.com/bonfire-networks/bonfire_api_graphql", "4bd0bc7297ceda80704b72eaeb1d682bd6ef865a", [branch: "main"]},
"bonfire_boundaries": {:git, "https://github.com/bonfire-networks/bonfire_boundaries", "863197241f54808d95e8562730d323e63c11b93c", [branch: "main"]},
"bonfire_boundaries": {:git, "https://github.com/bonfire-networks/bonfire_boundaries", "a46af1445951d72e1b2b77d302ba04a7ecca0460", [branch: "main"]},
"bonfire_breadpub": {:git, "https://github.com/bonfire-networks/bonfire_breadpub", "521cec8dbe51aac67085415dfc0557f1e93a6028", [branch: "main"]},
"bonfire_classify": {:git, "https://github.com/bonfire-networks/bonfire_classify", "38c4d776fb19cbfca3254300963c707f500f64f9", [branch: "main"]},
"bonfire_common": {:git, "https://github.com/bonfire-networks/bonfire_common", "3dc35446ba097c09136db809b4fea5692576180d", [branch: "main"]},
"bonfire_common": {:git, "https://github.com/bonfire-networks/bonfire_common", "2957b9409ffb79ea05ad1991728c2766bd7736d0", [branch: "main"]},
"bonfire_data_access_control": {:git, "https://github.com/bonfire-networks/bonfire_data_access_control", "63f9881a6446dcd8ff5d079a95b52c8a8d76d8bc", [branch: "main"]},
"bonfire_data_activity_pub": {:git, "https://github.com/bonfire-networks/bonfire_data_activity_pub", "59ca6db48cf2b5168bd82b1910214fd220f5fb1d", [branch: "main"]},
"bonfire_data_assort": {:git, "https://github.com/bonfire-networks/bonfire_data_assort", "9f90819b48e523776008a0c1e3197807b2d2ff6c", [branch: "master"]},
@ -43,12 +43,12 @@
"bonfire_quantify": {:git, "https://github.com/bonfire-networks/bonfire_quantify", "2598795d4f7339bb759184c251a4d49e173fcba5", [branch: "main"]},
"bonfire_search": {:git, "https://github.com/bonfire-networks/bonfire_search", "27b55370e0e61f7a154b3c9d9efea2860d96bf23", [branch: "main"]},
"bonfire_social": {:git, "https://github.com/bonfire-networks/bonfire_social", "81c7e0958a29d73a124e92ccf1fd8716edde01e5", [branch: "main"]},
"bonfire_tag": {:git, "https://github.com/bonfire-networks/bonfire_tag", "36c336be5cbaaeca3e68618e04f8928104d85980", [branch: "main"]},
"bonfire_ui_common": {:git, "https://github.com/bonfire-networks/bonfire_ui_common", "62fd0064b75dd3b02debb625a43b105ac5ce94aa", [branch: "main"]},
"bonfire_tag": {:git, "https://github.com/bonfire-networks/bonfire_tag", "d46b01e17fda71a7cd982cdd2ab5f4c6a1fb548b", [branch: "main"]},
"bonfire_ui_common": {:git, "https://github.com/bonfire-networks/bonfire_ui_common", "4026bafb49425de77cf3a6fd484117b2fc03e215", [branch: "main"]},
"bonfire_ui_coordination": {:git, "https://github.com/bonfire-networks/bonfire_ui_coordination", "2fd412764bfa82aebede8e0b97e8715a834a8db1", [branch: "main"]},
"bonfire_ui_kanban": {:git, "https://github.com/bonfire-networks/bonfire_ui_kanban", "22b3378bb7d57105743e7541b777078663636a75", [branch: "main"]},
"bonfire_ui_me": {:git, "https://github.com/bonfire-networks/bonfire_ui_me", "61624f43a104490d6d1bed03d16f3d98a3c00e88", [branch: "main"]},
"bonfire_ui_social": {:git, "https://github.com/bonfire-networks/bonfire_ui_social", "b18f2133dfaab14c3ad537d116f78efcb0e1fa2e", [branch: "main"]},
"bonfire_ui_me": {:git, "https://github.com/bonfire-networks/bonfire_ui_me", "f78cec243e0067b5ffa4de52a12d5b4f770f18f2", [branch: "main"]},
"bonfire_ui_social": {:git, "https://github.com/bonfire-networks/bonfire_ui_social", "b46df68c2888d196a34cf6424f578e6a909faa01", [branch: "main"]},
"bonfire_ui_valueflows": {:git, "https://github.com/bonfire-networks/bonfire_ui_valueflows", "c709e2baf0009e315f8e224c8320595808c4f9bc", [branch: "main"]},
"bonfire_upcycle": {:git, "https://gitlab.com/bonfire-networks/bonfire_upcycle", "d769fc800728e105e637d2644ef2e28a1fb8ff58", [branch: "main"]},
"bonfire_valueflows": {:git, "https://github.com/bonfire-networks/bonfire_valueflows", "a5a031abb7ddd84b74874eed5c8ffeb0d48ad9e2", [branch: "main"]},

332
priv/mix.exs Normal file
View file

@ -0,0 +1,332 @@
Code.eval_file("lib/mix/mess.exs")
Code.eval_file("lib/mix/mixer.ex")
defmodule Bonfire.Umbrella.MixProject do
use Mix.Project
alias Bonfire.Mixer
# we only behave as an umbrella im dev/test env
@use_local_forks System.get_env("WITH_FORKS", "1") == "1"
@ext_forks_path Mixer.forks_path()
@use_umbrella? Mix.env() == :dev and @use_local_forks and System.get_env("AS_UMBRELLA") == "1" and
File.exists?("#{@ext_forks_path}/bonfire")
@umbrella_path if @use_umbrella?, do: @ext_forks_path, else: nil
if @use_umbrella?, do: IO.puts("NOTE: Running as umbrella...")
@extra_deps [
# compilation
# {:tria, github: "hissssst/tria"},
## password hashing - builtin vs nif
{:pbkdf2_elixir, "~> 2.0", only: [:dev, :test]},
{:argon2_elixir, "~> 3.0", only: [:prod]},
## dev conveniences
#
# {:exsync, git: "https://github.com/falood/exsync", only: :dev},
# {:mix_unused, "~> 0.4", only: :dev},
{:ex_doc, "~> 0.28.3", only: [:dev, :test], runtime: false},
{:ecto_erd, "~> 0.4", only: :dev},
# {:ecto_dev_logger, "~> 0.7", only: :dev},
# flame graphs in live_dashboard
# {:flame_on, "~> 0.5", only: :dev},
{:pseudo_gettext, git: "https://github.com/tmbb/pseudo_gettext", only: :dev},
{:periscope, "~> 0.4", only: :dev},
# {:changelog, "~> 0.1", only: [:dev, :test], runtime: false}, # retrieve changelogs of latest dependency versions
# changelog generation
{:versioce, "~> 1.1.2", only: :dev},
# needed for changelog generation
{:git_cli, "~> 0.3.0", only: :dev},
# {:archeometer, git: "https://gitlab.com/mayel/archeometer", only: [:dev, :test]}, # "~> 0.1.0" # disabled because exqlite not working in CI
{:recode, "~> 0.4", only: :dev},
# API client needed for changelog generation
{:neuron, "~> 5.0", only: :dev, override: true},
# note: cannot use only: dev
# {:phoenix_profiler, "~> 0.2.0"},
# "~> 0.1.0", path: "forks/one_plus_n_detector",
# {:one_plus_n_detector, git: "https://github.com/bonfire-networks/one_plus_n_detector", only: :dev},
{:observer_cli, "~> 1.7", only: :dev},
# tests
# {:floki, ">= 0.0.0", only: [:dev, :test]},
{:mock, "~> 0.3", only: :test},
# {:mox, "~> 1.0", only: :test},
{:ex_machina, "~> 2.7", only: [:dev, :test]},
{:zest, "~> 0.1.0"},
{:grumble, "~> 0.1.3", only: [:test], override: true},
{:mix_test_watch, "~> 1.1", only: :test, runtime: false, override: true},
{:mix_test_interactive, "~> 1.2", only: :test, runtime: false},
{:ex_unit_notifier, "~> 1.0", only: :test},
{:wallaby, "~> 0.30", runtime: false, only: :test},
# {:bypass, "~> 2.1", only: :test}, # used in furlex
# Benchmarking utilities
{:benchee, "~> 1.1", only: [:dev, :test]},
{:benchee_html, "~> 1.0", only: [:dev, :test]},
# for Telemetry store
{:circular_buffer, "~> 0.4", only: :dev},
# list dependencies & licenses
# {
# :licensir,
# only: :dev,
# runtime: false,
# git: "https://github.com/bonfire-networks/licensir",
# branch: "main"
# # path: "./forks/licensir"
# },
# security auditing
# {:mix_audit, "~> 0.1", only: [:dev], runtime: false}
{:sobelow, "~> 0.8", only: :dev}
]
# TODO: put these in ENV or an external writeable config file similar to deps.*
@default_flavour "classic"
@config [
# note that the flavour will automatically be added where the dash appears
version: "0.4.0-beta.7",
elixir: "~> 1.13",
default_flavour: @default_flavour,
logo: "assets/static/images/bonfire-icon.png",
guides: [
"README.md",
"docs/HACKING.md",
"docs/DEPLOY.md",
"docs/ARCHITECTURE.md",
"docs/BONFIRE-FLAVOURED-ELIXIR.md",
"docs/DATABASE.md",
"docs/BOUNDARIES.md",
"docs/GRAPHQL.md",
"docs/MRF.md",
"docs/CHANGELOG.md",
"docs/CHANGELOG-autogenerated.md"
],
deps_prefixes: [
docs: [
"bonfire",
"pointers",
"paginator",
"ecto_shorts",
"ecto_sparkles",
"absinthe_client",
"activity_pub",
"arrows",
"ecto_materialized_path",
"flexto",
"grumble",
"linkify",
"verbs",
"voodoo",
"waffle",
"zest"
],
test: [
"bonfire",
"pointers",
# "paginator",
"ecto_shorts",
"ecto_sparkles",
"activity_pub",
"arrows",
"linkify",
"fetch_favicon"
],
data: [
"bonfire_data_",
"bonfire_data_edges",
"pointers",
"bonfire_boundaries",
"bonfire_tag",
"bonfire_classify",
"bonfire_geolocate",
"bonfire_quantify",
"bonfire_valueflows"
],
api: [
"bonfire_api_graphql",
"bonfire_me",
"bonfire_social",
"bonfire_tag",
"bonfire_classify",
"bonfire_geolocate",
"bonfire_valueflows"
],
required: [
"bonfire_boundaries",
"bonfire_social",
"bonfire_me",
"bonfire_ecto",
"bonfire_epics",
"bonfire_common",
"bonfire_fail"
],
localise: ["bonfire"],
localise_self: []
],
deps:
Mess.deps(Mixer.mess_sources(@default_flavour), @extra_deps,
use_local_forks?: @use_local_forks,
use_umbrella?: @use_umbrella?,
umbrella_root?: @use_local_forks,
umbrella_path: @umbrella_path
)
# |> IO.inspect(limit: :infinity)
]
def config, do: @config
def deps, do: config()[:deps]
def project do
[
app: :bonfire_umbrella,
apps_path: @umbrella_path,
version: Mixer.version(config()),
elixir: config()[:elixir],
elixirc_options: [debug_info: true, docs: true],
elixirc_paths: Mixer.elixirc_paths(config(), Mix.env()),
test_paths: Mixer.test_paths(config()),
# test_deps: Mixer.deps(config(), :test) |> IO.inspect(),
required_deps: config()[:deps_prefixes][:required],
# consolidate_protocols: false, # for Tria
compilers: Mixer.compilers(Mix.env()),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
multirepo_deps: Mixer.deps(config(), :bonfire),
in_multirepo_fn: &Mixer.in_multirepo?/1,
multirepo_recompile_fn: &Mixer.deps_recompile/0,
config_path: "config/config.exs",
releases: [
bonfire: [
runtime_config_path: Mixer.config_path(config(), "runtime.exs"),
# to enable debugging
strip_beams: false,
applications: [
bonfire: :permanent,
# if observability fails it shouldnt take your app down with it
opentelemetry_exporter: :permanent,
opentelemetry: :temporary
]
]
],
sources_url: "https://github.com/bonfire-networks",
source_url: "https://github.com/bonfire-networks/bonfire-app",
homepage_url: "https://bonfirenetworks.org",
docs: [
# The first page to display from the docs
name: "Bonfire",
main: "readme",
logo: config()[:logo],
output: "docs/exdoc",
source_url_pattern: &Mixer.source_url_pattern/2,
# extra pages to include
extras: Mixer.readme_paths(config()),
# extra apps to include in module docs
source_beam: Mixer.docs_beam_paths(config()),
# deps: Mixer.doc_dep_urls(config()),
# Note: first match wins
groups_for_extras: [
Guides: Path.wildcard("docs/*"),
"Flavours of Bonfire": Path.wildcard("flavours/*/*"),
"Data schemas": Path.wildcard("{extensions,deps,forks}/bonfire_data_*/*"),
"UI extensions": Path.wildcard("{extensions,deps,forks}/bonfire_ui_*/*"),
"Bonfire utilities":
[
"bonfire_api_graphql",
"bonfire_boundaries",
"bonfire_common",
"bonfire_ecto",
"bonfire_epics",
"bonfire_fail",
"bonfire_files",
"bonfire_mailer"
]
|> Enum.flat_map(&Path.wildcard("{extensions,deps,forks}/#{&1}/*")),
"Feature extensions": Path.wildcard("{extensions,deps,forks}/bonfire_*/*"),
"Other utilities": Path.wildcard("{extensions,deps,forks}/*/*"),
Dependencies: Path.wildcard("docs/DEPENDENCIES/*")
],
groups_for_modules: [
"Data schemas": ~r/^Bonfire.Data.?/,
"UI extensions": ~r/^Bonfire.UI.?/,
"Bonfire utilities": [
~r/^Bonfire.API?/,
~r/^Bonfire.GraphQL?/,
~r/^Bonfire.Web?/,
~r/^Bonfire.Boundaries?/,
~r/^Bonfire.Common?/,
~r/^Bonfire.Ecto?/,
~r/^Bonfire.Epics?/,
~r/^Bonfire.Fail?/,
~r/^Bonfire.Files?/,
~r/^Bonfire.Mailer?/,
~r/^Pointers?/
],
"Feature extensions": [~r/^Bonfire.?/, ~r/^ValueFlows.?/],
Federation: [
~r/^ActivityPub.?/,
~r/^ActivityPub.?/,
~r/^Nodeinfo.?/,
~r/^NodeinfoWeb.?/
],
Icons: ~r/^Iconify.?/,
Utilities: ~r/.?/
],
nest_modules_by_prefix: [
Bonfire.Data,
# Bonfire.UI,
Bonfire,
ActivityPub,
ActivityPubWeb,
# ValueFlows,
Iconify
]
]
]
end
# def application, do: Bonfire.Spark.MixProject.application()
defp aliases do
[
"hex.setup": ["local.hex --force"],
"rebar.setup": ["local.rebar --force"],
"bonfire.seeds": [
# "phil_columns.seed",
],
# FIXME: this does not update transitive deps
"bonfire.deps.update": ["deps.update " <> Mixer.deps_to_update(config())],
"bonfire.deps.clean": [
"deps.clean " <> Mixer.deps_to_clean(config(), :localise) <> " --build"
],
"bonfire.deps.clean.data": [
"deps.clean " <> Mixer.deps_to_clean(config(), :data) <> " --build"
],
"bonfire.deps.clean.api": [
"deps.clean " <> Mixer.deps_to_clean(config(), :api) <> " --build"
],
"bonfire.deps.recompile": [
"deps.compile " <> Mixer.deps_to_update(config()) <> " --force"
],
"ecto.seeds": [
"run #{Mixer.flavour_path(config())}/repo/seeds.exs"
],
setup: [
"hex.setup",
"rebar.setup",
"deps.get",
"bonfire.deps.clean.data",
"ecto.setup"
],
updates: ["deps.get", "bonfire.deps.update"],
upgrade: ["updates", "ecto.migrate"],
"ecto.setup": ["ecto.create", "ecto.migrate"],
"ecto.migrate": ["bonfire.seeds"],
"ecto.reset": ["ecto.drop --force", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
sobelow: ["cmd mix sobelow"]
]
end
end