-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmix.exs
More file actions
173 lines (153 loc) · 4.13 KB
/
Copy pathmix.exs
File metadata and controls
173 lines (153 loc) · 4.13 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
defmodule X402.MixProject do
use Mix.Project
@version "0.3.3"
@source_url "https://github.com/cardotrejos/x402"
@description "Elixir SDK for the x402 HTTP payment protocol"
def project do
[
app: :x402,
version: @version,
elixir: "~> 1.19",
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
elixirc_paths: elixirc_paths(Mix.env()),
# Hex
description: @description,
package: package(),
# Docs
name: "X402",
source_url: @source_url,
homepage_url: @source_url,
docs: docs(),
# Testing
test_coverage: [tool: ExCoveralls, minimum_coverage: 90],
# Dialyzer
dialyzer: [
plt_file: {:no_warn, "priv/plts/project.plt"},
plt_add_apps: [:mix, :credo]
]
]
end
def cli do
[
preferred_envs: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.html": :test,
"coveralls.github": :test,
ci: :test
]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
# HTTP client (optional — users can bring their own)
{:finch, "~> 0.19", optional: true},
# Plug integration (optional — users can bring their own web stack)
{:plug, "~> 1.14", optional: true},
# JSON encoding/decoding
{:jason, "~> 1.2"},
# Option validation (Dashbit style)
{:nimble_options, "~> 1.0"},
# EVM signature verification (optional — only needed for SIWX)
{:ex_secp256k1, "~> 0.8.0", optional: true},
{:ex_keccak, "~> 0.7.8", optional: true},
# Documentation
{:ex_doc, "~> 0.35", only: :dev, runtime: false},
# Testing
{:excoveralls, "~> 0.18", only: :test},
{:bypass, "~> 2.1", only: :test},
{:mox, "~> 1.2", only: :test},
# Code quality
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}
]
end
defp package do
[
name: "x402",
licenses: ["MIT"],
links: %{
"GitHub" => @source_url,
"x402 Protocol" => "https://x402.org",
"Docs" => "https://docs.x402.org"
},
maintainers: ["Ricardo Trejos"],
files: ~w(lib guides .formatter.exs mix.exs README.md LICENSE CHANGELOG.md)
]
end
defp docs do
[
main: "readme",
source_ref: "main",
source_url: @source_url,
extras: [
"README.md": [title: "Overview"],
"CHANGELOG.md": [title: "Changelog"],
LICENSE: [title: "License"],
"guides/getting-started.md": [title: "Getting Started"],
"guides/plug-integration.md": [title: "Plug/Phoenix Integration"]
],
groups_for_extras: [
Guides: ~r/guides\/.*/
],
groups_for_modules: [
"Core Protocol": [
X402,
X402.PaymentRequired,
X402.PaymentSignature,
X402.PaymentResponse
],
"Facilitator Client": [
X402.Facilitator,
X402.Facilitator.HTTP,
X402.Hooks,
X402.Hooks.Context,
X402.Hooks.Default
],
"Plug Integration": [
X402.Plug.PaymentGate
],
Utilities: [
X402.Wallet
],
Extensions: [
X402.Extensions.SIWX,
X402.Extensions.SIWX.Verifier,
X402.Extensions.SIWX.Verifier.Default,
X402.Extensions.SIWX.Storage,
X402.Extensions.SIWX.ETSStorage
]
],
groups_for_docs: [
"Header Encoding": &(&1[:group] == :headers),
"Payment Verification": &(&1[:group] == :verification)
]
]
end
defp aliases do
[
quality: [
"compile --warnings-as-errors",
"format --check-formatted",
"credo --strict",
"dialyzer"
],
ci: [
"compile --warnings-as-errors",
"format --check-formatted",
"credo --strict",
"test --cover",
"cmd env MIX_ENV=dev mix dialyzer"
]
]
end
end