Repository navigation
Expand file tree
/
Copy pathmix.exs
More file actions
151 lines (140 loc) · 4.15 KB
/
Copy pathmix.exs
File metadata and controls
151 lines (140 loc) · 4.15 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
defmodule Sheetshow.MixProject do
use Mix.Project
@version "0.1.6"
@source_url "https://github.com/zero-one-group/sheetshow"
@description "Google Sheets from Elixir, as values, with a small database on a tab " <>
"and the same code over .xlsx files."
def project do
[
app: :sheetshow,
version: @version,
elixir: "~> 1.18",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
aliases: aliases(),
name: "Sheetshow",
description: @description,
source_url: @source_url,
package: package(),
docs: docs()
]
end
# `dev/` is scripts for a person to run, and `test/` and `assets/` are not the
# library, so none of them ship.
defp package do
[
licenses: ["Apache-2.0"],
files: ~w(lib guides assets mix.exs README.md CHANGELOG.md LICENSE usage-rules.md),
links: %{
"GitHub" => @source_url,
"Changelog" => "#{@source_url}/blob/main/CHANGELOG.md"
}
]
end
# Read by ex_doc, which is a dev-only dependency; see the README.
defp docs do
[
main: "readme",
# The logo and the badge the README shows; ex_doc copies the directory
# into doc/ as is, and without this they are broken images on HexDocs.
assets: %{"assets" => "assets"},
extras: [
"README.md",
"guides/quick-start-google.md",
"guides/quick-start-xlsx.md",
"guides/google-setup.md",
"guides/cookbook.md",
"guides/instead-of-postgres.md",
"guides/guarantees.md",
"guides/cheatsheet.cheatmd",
"usage-rules.md",
"CHANGELOG.md",
"LICENSE"
],
groups_for_extras: [
Guides: [
"guides/quick-start-google.md",
"guides/quick-start-xlsx.md",
"guides/google-setup.md",
"guides/cookbook.md",
"guides/instead-of-postgres.md"
],
Reference: ["guides/guarantees.md", "guides/cheatsheet.cheatmd", "usage-rules.md"]
],
source_ref: "v#{@version}",
groups_for_modules: [
"Start here": [Sheetshow],
"Cells and layout": [
Sheetshow.A1,
Sheetshow.Cell,
Sheetshow.Coord,
Sheetshow.Range,
Sheetshow.Style,
Sheetshow.Value
],
Plans: [
Sheetshow.Op,
Sheetshow.Op.AddSheet,
Sheetshow.Op.AppendRows,
Sheetshow.Op.DeleteRows,
Sheetshow.Op.DeleteSheet,
Sheetshow.Op.PutCells,
Sheetshow.Op.SetDimensions
],
"A database on a tab": [
Sheetshow.Log,
Sheetshow.Log.Event,
Sheetshow.Schema,
Sheetshow.Table,
Sheetshow.Table.Change,
Sheetshow.Table.Row,
Sheetshow.Table.Snapshot,
Sheetshow.ULID
],
Backends: [
Sheetshow.Backend,
Sheetshow.Client,
Sheetshow.Google,
Sheetshow.Memory,
Sheetshow.Store,
Sheetshow.Store.Local,
Sheetshow.Store.WebDAV,
Sheetshow.Workbook,
Sheetshow.Xlsx
],
Credentials: [
Sheetshow.OAuth,
Sheetshow.ServiceAccount,
Sheetshow.Token,
Sheetshow.UserAccount
],
Errors: [Sheetshow.CellError, Sheetshow.Error]
]
]
end
# :public_key signs the service-account assertion and vouches for Google's
# certificate; :inets and :ssl are the HTTP client; :xmerl is the SAX parser
# the xlsx backend reads worksheets with. No :logger, since the library does
# not log.
def application do
[extra_applications: [:public_key, :inets, :ssl, :xmerl]]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_env), do: ["lib"]
def cli do
[preferred_envs: [check: :test, "check.all": :test]]
end
defp deps do
[
{:ex_doc, "~> 0.36", only: :dev, runtime: false}
]
end
defp aliases do
gate = ["format --check-formatted", "compile --force --warnings-as-errors"]
[
check: gate ++ ["test"],
"check.all": gate ++ ["test --include integration"]
]
end
end