-
Notifications
You must be signed in to change notification settings - Fork 934
/
mix.exs
212 lines (197 loc) · 5.8 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
205
206
207
208
209
210
211
212
defmodule Phoenix.LiveView.MixProject do
use Mix.Project
@version "1.0.0-rc.7"
def project do
[
app: :phoenix_live_view,
version: @version,
elixir: "~> 1.13",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
test_options: [docs: true],
test_coverage: [summary: [threshold: 85], ignore_modules: coverage_ignore_modules()],
xref: [exclude: [Floki]],
package: package(),
deps: deps(),
aliases: aliases(),
docs: &docs/0,
name: "Phoenix LiveView",
homepage_url: "http://www.phoenixframework.org",
description: """
Rich, real-time user experiences with server-rendered HTML
""",
preferred_cli_env: [
docs: :docs
]
]
end
defp elixirc_paths(:e2e), do: ["lib", "test/support", "test/e2e/support"]
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def application do
[
mod: {Phoenix.LiveView.Application, []},
extra_applications: [:logger]
]
end
defp deps do
[
{:phoenix, "~> 1.6.15 or ~> 1.7.0"},
{:plug, "~> 1.15"},
{:phoenix_template, "~> 1.0"},
{:phoenix_html, "~> 3.3 or ~> 4.0 or ~> 4.1"},
{:telemetry, "~> 0.4.2 or ~> 1.0"},
{:esbuild, "~> 0.2", only: :dev},
{:phoenix_view, "~> 2.0", optional: true},
{:jason, "~> 1.0", optional: true},
{:floki, "~> 0.36", optional: true},
{:ex_doc, "~> 0.29", only: :docs},
{:makeup_eex, ">= 0.1.1", only: :docs},
{:makeup_diff, "~> 0.1.1", only: :docs},
{:html_entities, ">= 0.0.0", only: :test},
{:phoenix_live_reload, "~> 1.4", only: :test},
{:phoenix_html_helpers, "~> 1.0", only: :test},
{:bandit, "~> 1.5", only: :e2e},
{:ecto, "~> 3.11", only: :e2e},
{:phoenix_ecto, "~> 4.5", only: :e2e}
]
end
defp docs do
[
main: "welcome",
source_ref: "v#{@version}",
source_url: "https://github.com/phoenixframework/phoenix_live_view",
extra_section: "GUIDES",
extras: extras(),
groups_for_extras: groups_for_extras(),
groups_for_modules: groups_for_modules(),
groups_for_docs: [
Components: &(&1[:type] == :component),
Macros: &(&1[:type] == :macro)
],
skip_undefined_reference_warnings_on: ["CHANGELOG.md"],
before_closing_body_tag: &before_closing_body_tag/1
]
end
defp before_closing_body_tag(:html) do
"""
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.esm.min.mjs';
mermaid.initialize({
securityLevel: 'loose',
theme: 'base'
});
</script>
<style>
code.mermaid text.flowchartTitleText {
fill: var(--textBody) !important;
}
code.mermaid g.cluster > rect {
fill: var(--background) !important;
stroke: var(--neutralBackground) !important;
}
code.mermaid g.cluster[id$="__transparent"] > rect {
fill-opacity: 0 !important;
stroke: none !important;
}
code.mermaid g.nodes span.nodeLabel > em {
font-style: normal;
background-color: white;
opacity: 0.5;
padding: 1px 2px;
border-radius: 5px;
}
code.mermaid g.edgePaths > path {
stroke: var(--textBody) !important;
}
code.mermaid g.edgeLabels span.edgeLabel:not(:empty) {
background-color: var(--textBody) !important;
padding: 3px 5px !important;
border-radius:25%;
color: var(--background) !important;
}
code.mermaid .marker {
fill: var(--textBody) !important;
stroke: var(--textBody) !important;
}
</style>
"""
end
defp before_closing_body_tag(_), do: ""
defp extras do
["CHANGELOG.md"] ++
Path.wildcard("guides/*/*.md") ++
Path.wildcard("guides/cheatsheets/*.cheatmd")
end
defp groups_for_extras do
[
Introduction: ~r"guides/introduction/",
"Server-side features": ~r"guides/server/",
"Client-side integration": ~r"guides/client/",
Cheatsheets: ~r"guides/cheatsheets/"
]
end
defp groups_for_modules do
# Ungrouped Modules:
#
# Phoenix.Component
# Phoenix.LiveComponent
# Phoenix.LiveView
# Phoenix.LiveView.Controller
# Phoenix.LiveView.JS
# Phoenix.LiveView.Router
# Phoenix.LiveViewTest
[
Configuration: [
Phoenix.LiveView.HTMLFormatter,
Phoenix.LiveView.Logger,
Phoenix.LiveView.Socket
],
"Testing structures": [
Phoenix.LiveViewTest.Element,
Phoenix.LiveViewTest.Upload,
Phoenix.LiveViewTest.View
],
"Upload structures": [
Phoenix.LiveView.UploadConfig,
Phoenix.LiveView.UploadEntry,
Phoenix.LiveView.UploadWriter
],
"Plugin API": [
Phoenix.LiveComponent.CID,
Phoenix.LiveView.Engine,
Phoenix.LiveView.TagEngine,
Phoenix.LiveView.HTMLEngine,
Phoenix.LiveView.Component,
Phoenix.LiveView.Rendered,
Phoenix.LiveView.Comprehension
]
]
end
defp package do
[
maintainers: ["Chris McCord", "José Valim", "Gary Rennie", "Alex Garibay", "Scott Newcomer"],
licenses: ["MIT"],
links: %{
Changelog: "https://hexdocs.pm/phoenix_live_view/changelog.html",
GitHub: "https://github.com/phoenixframework/phoenix_live_view"
},
files:
~w(assets/js lib priv) ++
~w(CHANGELOG.md LICENSE.md mix.exs package.json README.md .formatter.exs)
]
end
defp aliases do
[
"assets.build": ["esbuild module", "esbuild cdn", "esbuild cdn_min", "esbuild main"],
"assets.watch": ["esbuild module --watch"]
]
end
defp coverage_ignore_modules do
[
~r/Phoenix\.LiveViewTest\.Support\..*/,
~r/Phoenix\.LiveViewTest\.E2E\..*/,
~r/Inspect\..*/
]
end
end