-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmix.exs
More file actions
147 lines (136 loc) · 3.8 KB
/
Copy pathmix.exs
File metadata and controls
147 lines (136 loc) · 3.8 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
defmodule LocalizeWeb.MixProject do
use Mix.Project
@version "1.1.0"
def project do
[
app: :localize_web,
version: @version,
elixir: "~> 1.17",
name: "Localize Web",
description: description(),
source_url: "https://github.com/elixir-localize/localize_web",
package: package(),
docs: docs(),
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
aliases: aliases(),
deps: deps(),
dialyzer: [
plt_add_apps: ~w(gettext phoenix phoenix_live_view phoenix_html)a,
flags: [
:error_handling,
:unknown,
:underspecs,
:extra_return,
:missing_return
]
]
]
end
defp description do
"""
Plugs, localized routes, and HTML helpers for the Localize library.
"""
end
defp package do
[
licenses: ["Apache-2.0"],
links: links(),
files: ~w(lib priv guides mix.exs README.md LICENSE.md CHANGELOG.md)
]
end
def links do
%{
"GitHub" => "https://github.com/elixir-localize/localize_web",
"Readme" => "https://github.com/elixir-localize/localize_web/blob/v#{@version}/README.md",
"Changelog" =>
"https://github.com/elixir-localize/localize_web/blob/v#{@version}/CHANGELOG.md"
}
end
defp docs do
[
main: "readme",
formatters: ["html", "markdown"],
extras: [
"README.md",
"CHANGELOG.md",
"guides/http-locale-discovery.md",
"guides/phoenix-localized-routing.md",
"guides/localized-html-helpers.md",
"guides/mf2-messages-in-heex.md"
],
groups_for_extras: [
Guides: [
"guides/http-locale-discovery.md",
"guides/phoenix-localized-routing.md",
"guides/localized-html-helpers.md",
"guides/mf2-messages-in-heex.md"
]
],
groups_for_modules: [
Plugs: [
Localize.Plug,
Localize.Plug.PutLocale,
Localize.Plug.PutSession,
Localize.Plug.AcceptLanguage,
Localize.AcceptLanguage
],
Routes: [
Localize.Routes,
Localize.VerifiedRoutes,
Localize.Routes.LocalizedHelpers
],
"HTML Helpers": [
Localize.HTML,
Localize.HTML.Currency,
Localize.HTML.Territory,
Localize.HTML.Subdivision,
Localize.HTML.Locale,
Localize.HTML.Unit,
Localize.HTML.Month,
Localize.HTML.Message
]
],
skip_undefined_reference_warnings_on: ["CHANGELOG.md", "Localize.AcceptLanguage"]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
{:localize, "~> 1.0"},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:plug, "~> 1.9"},
{:gettext, "~> 1.0"},
{:phoenix, "~> 1.7", optional: true},
{:phoenix_html, "~> 4.0"},
{:phoenix_html_helpers, "~> 1.0"},
{:phoenix_live_view, "~> 1.0", optional: true},
{:jason, "~> 1.0", optional: true},
{:ex_doc, "~> 0.34", only: [:dev, :release], runtime: false},
{:dialyxir, "~> 1.0", only: :dev, runtime: false}
] ++ maybe_json_polyfill()
end
defp maybe_json_polyfill do
if Code.ensure_loaded?(:json) do
[]
else
[{:json_polyfill, "~> 0.2 or ~> 1.0"}]
end
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(:dev), do: ["lib"]
defp elixirc_paths(_), do: ["lib"]
# Ensure CLDR locale data for the locales referenced in tests is
# present before the suite runs. The download is a no-op when the
# cache is already populated, so the alias is cheap on warm
# developer machines.
defp aliases do
[
test: ["localize.download_locales", "test"]
]
end
end