forked from BeaconCMS/beacon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
204 lines (193 loc) · 6.04 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
defmodule Beacon.MixProject do
use Mix.Project
@version "0.1.0-dev"
def project do
[
app: :beacon,
version: @version,
elixir: "~> 1.13",
start_permanent: Mix.env() == :prod,
name: "Beacon",
deps: deps(),
aliases: aliases(),
docs: docs(),
elixirc_paths: elixirc_paths(Mix.env()),
dialyzer: [
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
plt_add_apps: [:mix],
list_unused_filters: true
]
]
end
def application do
[
mod: {Beacon.Application, []},
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
{:accent, "~> 1.1"},
{:bypass, "~> 2.1", only: :test},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.2", only: :dev, runtime: false},
{:ecto_sql, "~> 3.6"},
{:esbuild, "~> 0.5", only: :dev},
{:ex_brotli, "~> 0.3"},
{:ex_doc, "~> 0.29", only: :docs},
{:ex_aws, "~> 2.4"},
{:ex_aws_s3, "~> 2.4"},
{:floki, ">= 0.30.0", only: :test},
{:gettext, "~> 0.20"},
{:hackney, "~> 1.16", only: [:dev, :test]},
{:heroicons, "~> 0.5"},
{:image, "~> 0.32"},
{:jason, "~> 1.0"},
{:solid, "~> 0.14"},
phoenix_dep(),
{:phoenix_ecto, "~> 4.4"},
{:phoenix_live_reload, "~> 1.3", only: :dev},
phoenix_live_view_dep(),
{:phoenix_pubsub, "~> 2.1"},
{:phoenix_view, "~> 2.0", only: [:dev, :test]},
{:plug_cowboy, "~> 2.6", only: [:dev, :test]},
{:postgrex, "~> 0.16"},
{:safe_code, github: "TheFirstAvenger/safe_code"},
{:tailwind, "~> 0.2"},
{:rustler, ">= 0.0.0", optional: true},
live_monaco_editor_dep(),
mdex_dep()
]
end
defp phoenix_dep do
cond do
env = System.get_env("PHOENIX_VERSION") -> {:phoenix, env}
path = System.get_env("PHOENIX_PATH") -> {:phoenix, path}
:default -> {:phoenix, "~> 1.7"}
end
end
defp phoenix_live_view_dep do
cond do
env = System.get_env("PHOENIX_LIVE_VIEW_VERSION") -> {:phoenix_live_view, env}
path = System.get_env("PHOENIX_LIVE_VIEW_PATH") -> {:phoenix_live_view, path}
:default -> {:phoenix_live_view, "~> 0.19"}
end
end
defp live_monaco_editor_dep do
cond do
path = System.get_env("LIVE_MONACO_EDITOR_PATH") -> {:live_monaco_editor, path: path}
:default -> {:live_monaco_editor, "~> 0.1"}
end
end
defp mdex_dep do
cond do
path = System.get_env("MDEX_PATH") -> {:mdex, path: path}
:default -> {:mdex, "~> 0.1"}
end
end
defp aliases do
[
setup: ["deps.get", "assets.setup", "assets.build", "ecto.setup"],
"ecto.setup": ["ecto.create", "ecto.migrate"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
dev: ["ecto.reset", "run --no-halt dev.exs"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
"assets.setup": ["tailwind.install --if-missing --no-assets", "esbuild.install --if-missing"],
"assets.build": ["esbuild cdn", "esbuild cdn_min"]
]
end
defp docs do
[
main: "Beacon",
source_ref: "v#{@version}",
source_url: "https://github.com/BeaconCMS/beacon",
groups_for_modules: [
Content: [
Beacon.Content,
Beacon.Content.Component,
Beacon.Content.ErrorPage,
Beacon.Content.Layout,
Beacon.Content.LayoutEvent,
Beacon.Content.LayoutSnapshot,
Beacon.Content.Page,
Beacon.Content.Page.Event,
Beacon.Content.Page.Helper,
Beacon.Content.PageEvent,
Beacon.Content.PageEventHandler,
Beacon.Content.PageSnapshot,
Beacon.Content.PageVariant,
Beacon.Content.Stylesheet,
Beacon.Content.Snippets.Helper,
Beacon.Template,
Beacon.Template.HEEx,
Beacon.Template.Markdown,
Beacon.DataSource.Behaviour
],
"Media Library": [
Beacon.MediaLibrary,
Beacon.MediaLibrary.Asset,
Beacon.MediaLibrary.Backend,
Beacon.MediaLibrary.Backend.Repo,
Beacon.MediaLibrary.Backend.S3,
Beacon.MediaLibrary.Backend.S3.Signed,
Beacon.MediaLibrary.Backend.S3.Unsigned,
Beacon.MediaTypes,
Beacon.MediaLibrary.Processors.Default,
Beacon.MediaLibrary.Processors.Image,
Beacon.MediaLibrary.UploadMetadata
],
"Authn and Authz": [
Beacon.Authorization.Behaviour,
Beacon.Authorization.DefaultPolicy
],
Web: [
BeaconWeb.PageLive,
BeaconWeb.Components
],
"RESTful API": [
BeaconWeb.API.PageController,
BeaconWeb.API.ComponentController
],
Extensibility: [
Beacon.Config,
Beacon.Lifecycle,
Beacon.Content.PageField,
Beacon.Template.LoadMetadata,
Beacon.Template.RenderMetadata
],
Execution: [
Beacon.Router,
Beacon.Loader,
Beacon.Registry,
Beacon.RuntimeCSS,
Beacon.RuntimeJS,
Beacon.TailwindCompiler
],
Types: [
Beacon.Types.Atom,
Beacon.Types.Binary,
Beacon.Types.Site
],
Exceptions: [
Beacon.LoaderError,
Beacon.DataSourceError,
Beacon.AuthorizationError,
Beacon.ParserError,
BeaconWeb.NotFoundError
]
],
groups_for_functions: [
"Functions: Layouts": &(&1[:type] == :layouts),
"Functions: Pages": &(&1[:type] == :pages),
"Functions: Page Variants": &(&1[:type] == :page_variants),
"Functions: Stylesheets": &(&1[:type] == :stylesheets),
"Functions: Components": &(&1[:type] == :components),
"Functions: Snippets": &(&1[:type] == :snippets),
"Functions: Page Event Handlers": &(&1[:type] == :page_event_handlers),
"Functions: Error Pages": &(&1[:type] == :error_pages)
]
]
end
end