-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathmix.exs
More file actions
186 lines (166 loc) · 5.08 KB
/
mix.exs
File metadata and controls
186 lines (166 loc) · 5.08 KB
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
defmodule Beacon.LiveAdmin.MixProject do
use Mix.Project
@version "0.4.4-dev"
@source_url "https://github.com/BeaconCMS/beacon_live_admin"
@homepage_url "https://beaconcms.org"
def project do
[
app: :beacon_live_admin,
version: @version,
elixir: "~> 1.14.1 or ~> 1.15",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
name: "Beacon LiveAdmin",
homepage_url: @homepage_url,
source_url: @source_url,
description: """
Phoenix LiveView Admin Panel to manage Beacon CMS sites.
""",
package: package(),
deps: deps(),
aliases: aliases(),
docs: docs()
]
end
def application do
[
mod: {Beacon.LiveAdmin.Application, []},
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp package do
[
maintainers: ["Leandro Pereira", "Andrew Berrien"],
licenses: ["MIT"],
links: %{
Changelog: "https://hexdocs.pm/beacon_live_admin/#{@version}/changelog.html",
GitHub: @source_url,
Website: @homepage_url,
DockYard: "https://dockyard.com"
},
files: ~w(lib priv .formatter.exs mix.exs CHANGELOG.md LICENSE.md)
]
end
defp deps do
[
# Overridable
override_dep(:phoenix, "~> 1.7", "PHOENIX_VERSION", "PHOENIX_PATH"),
override_dep(:phoenix_live_view, ">= 1.0.1", "PHOENIX_LIVE_VIEW_VERSION", "PHOENIX_LIVE_VIEW_PATH"),
override_dep(:live_monaco_editor, "~> 0.2", "LIVE_MONACO_EDITOR_VERSION", "LIVE_MONACO_EDITOR_PATH"),
beacon_dep(),
# Runtime
{:ecto, "~> 3.6"},
{:phoenix_html, "~> 4.0"},
{:live_svelte, "~> 0.12"},
{:floki, ">= 0.30.0"},
{:tailwind_compiler, path: "/Users/bcardarella/projects/tailwind_compiler", override: true},
esbuild_dep(),
{:gettext, "~> 0.26"},
{:jason, "~> 1.0"},
{:igniter, "~> 0.5", optional: true},
{:turboprop, "~> 0.1"},
# Dev, Test, Docs
{:bandit, "~> 1.0", only: :dev, optional: true},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:ex_doc, "~> 0.29", only: :dev},
{:makeup_elixir, "~> 1.0.1 or ~> 1.1", only: :dev},
{:makeup_eex, "~> 2.0", only: :dev},
{:makeup_syntect, "~> 0.1", only: :dev}
]
end
defp override_dep(dep, requirement, env_version, env_path) do
cond do
version = System.get_env(env_version) ->
{dep, version, override: true}
path = System.get_env(env_path) ->
{dep, path: path, override: true}
:default ->
{dep, requirement}
end
end
defp beacon_dep do
cond do
path = System.get_env("BEACON_PATH") ->
{:beacon, path: path, runtime: false}
String.ends_with?(@version, "-dev") ->
{:beacon, github: "BeaconCMS/beacon", runtime: false}
:else ->
{:beacon, ">= 0.0.0 and < 1.0.0", runtime: false}
end
end
# TODO: remove this check after we start requiring min OTP 25
# https://github.com/phoenixframework/esbuild/commit/83b786bb91438c496f7d917d98ac9c72e3b210c6
if System.otp_release() >= "25" do
defp esbuild_dep, do: {:esbuild, "~> 0.5"}
else
defp esbuild_dep, do: {:esbuild, "~> 0.5 and < 0.9.0"}
end
defp aliases do
[
setup: ["deps.get", "assets.setup"],
dev: "run --no-halt dev.exs",
"format.all": ["format", "cmd npm run format --prefix ./assets"],
"format.all.check": [
"format --check-formatted",
"cmd npm run format-check --prefix ./assets"
],
"assets.setup": [
"tailwind.install --if-missing --no-assets",
"esbuild.install --if-missing",
"cmd npm install --prefix assets"
],
"assets.watch": [
"tailwind beacon_live_admin",
"cmd --cd assets node build.js --watch"
],
"assets.build": [
"tailwind beacon_live_admin",
"tailwind beacon_live_admin_min",
"cmd --cd assets node build.js --deploy"
]
]
end
defp docs do
[
main: "Beacon.LiveAdmin",
logo: "assets/images/beacon_logo.png",
source_ref: "v#{@version}",
source_url: "https://github.com/BeaconCMS/beacon_live_admin",
extra_section: "GUIDES",
extras: extras(),
groups_for_extras: groups_for_extras(),
groups_for_modules: groups_for_modules(),
skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
]
end
defp extras do
["CHANGELOG.md"] ++ Path.wildcard("guides/*/*.md")
end
defp groups_for_extras do
[
Introduction: ~r"guides/introduction/",
Recipes: ~r"guides/recipes/"
]
end
defp groups_for_modules do
[
Execution: [
Beacon.LiveAdmin.Router,
Beacon.LiveAdmin.Plug,
Beacon.LiveAdmin.Cluster
],
Extensibility: [
Beacon.LiveAdmin.PageBuilder,
Beacon.LiveAdmin.PageBuilder.Page,
Beacon.LiveAdmin.PageBuilder.Table,
Beacon.LiveAdmin.AdminComponents,
Beacon.LiveAdmin.CoreComponents
],
Exceptions: [
Beacon.LiveAdmin.ClusterError
]
]
end
end