-
Notifications
You must be signed in to change notification settings - Fork 4
/
mix.exs
114 lines (104 loc) · 2.74 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
if File.exists?("blend/premix.exs") do
Code.compile_file("blend/premix.exs")
else
defmodule Blend.Premix.SurfaceForm do
def patch_project(project), do: project
def patch_deps(deps), do: deps
end
end
defmodule Surface.Form.MixProject do
use Mix.Project
@version "0.2.0"
@source_url "https://github.com/surface-ui/surface_form_helpers"
@homepage_url "https://surface-ui.org"
def project do
[
app: :surface_form_helpers,
version: @version,
elixir: "~> 1.13",
description: "Surface wrappers for Phoenix.HTML.Form functions",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers() ++ [:surface],
aliases: aliases(),
deps: deps(),
preferred_cli_env: [docs: :docs],
# Docs
name: "Surface Form",
source_url: @source_url,
homepage_url: @homepage_url,
docs: docs(),
package: package()
]
|> Blend.Premix.SurfaceForm.patch_project()
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
defp elixirc_paths(:dev), do: ["lib"] ++ catalogues()
defp elixirc_paths(:test), do: ["lib", "test/support"] ++ catalogues()
defp elixirc_paths(_), do: ["lib"]
def catalogues do
["priv/catalogue"]
end
defp aliases do
[
dev: "run --no-halt dev.exs"
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:surface, "~> 0.12.0"},
{:phoenix_html, "~> 4.0"},
{:phoenix_html_helpers, "~> 1.0"},
{:surface_catalogue, "~> 0.6.3", only: :dev},
{:esbuild, "~> 0.2", only: :dev},
{:plug_cowboy, "~> 2.0", only: :dev},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:jason, "~> 1.0", only: [:dev, :test]},
{:blend, "~> 0.4.0", only: :dev},
{:floki, "~> 0.35", only: :test},
{:phoenix_ecto, "~> 4.3", only: :test},
{:ecto, "~> 3.9.5 or ~> 3.9", only: :test},
{:ex_doc, ">= 0.31.1", only: :docs, runtime: false}
]
|> Blend.Premix.SurfaceForm.patch_deps()
end
defp docs do
[
main: "readme",
source_ref: "v#{@version}",
nest_modules_by_prefix: [
Surface.Components,
Surface.Components.Form
],
extras: [
"README.md",
"CHANGELOG.md",
"LICENSE.md"
]
]
end
defp package do
%{
licenses: ["MIT"],
links: %{
Website: @homepage_url,
Changelog: "https://hexdocs.pm/surface_form_helpers/changelog.html",
GitHub: @source_url
},
files: ~w(
README.md
CHANGELOG.md
LICENSE.md
mix.exs
lib
priv/catalogue
)
}
end
end