forked from pcharbon70/term_ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmix.exs
More file actions
185 lines (168 loc) · 5.49 KB
/
mix.exs
File metadata and controls
185 lines (168 loc) · 5.49 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
174
175
176
177
178
179
180
181
182
183
184
185
defmodule TermUI.MixProject do
use Mix.Project
@version "1.0.0-rc"
@source_url "https://github.com/pcharbon70/term_ui"
def project do
[
app: :term_ui,
version: @version,
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env()),
# Hex package
name: "TermUI",
description: "A direct-mode Terminal UI framework for Elixir/BEAM",
package: package(),
source_url: @source_url,
homepage_url: @source_url,
docs: docs(),
# Test coverage
test_coverage: [tool: ExCoveralls],
# Dialyzer
# Note: call_without_opaque warnings suppressed with :no_opaque in widget modules
# due to MapSet nested in opaque Style type
dialyzer: [
flags: [
:error_handling,
:underspecs,
:unmatched_returns
],
plt_add_apps: [:mix, :ex_unit]
]
]
end
def cli do
[
preferred_envs: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.html": :test
]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support", "mix/tasks"]
defp elixirc_paths(_), do: ["lib", "mix/tasks"]
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
# Documentation
{:ex_doc, "~> 0.31", only: :dev, runtime: false},
# Code quality
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
# Testing
{:excoveralls, "~> 0.18", only: :test},
{:stream_data, "~> 1.0", only: :test},
# Streaming
{:gen_stage, "~> 1.2"},
# Markdown processing
{:mdex, "~> 0.10"},
# Syntax highlighting for code blocks
{:makeup, "~> 1.1"},
{:makeup_elixir, "~> 1.0"},
# LLM usage rules
{:usage_rules, "~> 0.1", only: :dev, runtime: false}
]
end
defp package do
[
name: "term_ui",
licenses: ["MIT"],
links: %{
"GitHub" => @source_url
},
files: ~w(
lib
mix/tasks
guides
mix.exs
README.md
LICENSE
CHANGELOG.md
usage-rules.md
)
]
end
defp docs do
[
main: "readme",
source_ref: "v#{@version}",
source_url: @source_url,
extras: [
"README.md",
"CHANGELOG.md",
"guides/user/README.md": [filename: "user-guides", title: "User Guides"],
"guides/user/01-overview.md": [title: "Overview"],
"guides/user/02-getting-started.md": [title: "Getting Started"],
"guides/user/03-elm-architecture.md": [title: "The Elm Architecture"],
"guides/user/04-events.md": [title: "Events"],
"guides/user/05-styling.md": [title: "Styling"],
"guides/user/06-layout.md": [title: "Layout"],
"guides/user/07-widgets.md": [title: "Widgets"],
"guides/user/08-terminal.md": [title: "Terminal"],
"guides/user/09-commands.md": [title: "Commands"],
"guides/user/10-advanced-widgets.md": [title: "Advanced Widgets"],
"guides/developer/README.md": [filename: "developer-guides", title: "Developer Guides"],
"guides/developer/01-architecture-overview.md": [title: "Architecture Overview"],
"guides/developer/02-runtime-internals.md": [title: "Runtime Internals"],
"guides/developer/03-rendering-pipeline.md": [title: "Rendering Pipeline"],
"guides/developer/04-event-system.md": [title: "Event System"],
"guides/developer/05-buffer-management.md": [title: "Buffer Management"],
"guides/developer/06-terminal-layer.md": [title: "Terminal Layer"],
"guides/developer/07-elm-implementation.md": [title: "Elm Implementation"],
"guides/developer/08-creating-widgets.md": [title: "Creating Widgets"],
"guides/developer/09-testing-framework.md": [title: "Testing Framework"]
],
groups_for_extras: [
"User Guides": ~r/guides\/user\/.*/,
"Developer Guides": ~r/guides\/developer\/.*/
],
groups_for_modules: [
Core: [
TermUI,
TermUI.Elm,
TermUI.Runtime,
TermUI.Component,
TermUI.Event
],
Widgets: ~r/TermUI\.Widgets\..*/,
Rendering: [
TermUI.Renderer.Style,
TermUI.Renderer.Cell,
TermUI.Renderer.Buffer,
TermUI.Component.RenderNode
],
Layout: ~r/TermUI\.Layout\..*/,
Terminal: ~r/TermUI\.Terminal\..*/
],
before_closing_body_tag: %{
html: """
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
mermaid.initialize({ startOnLoad: false, theme: "default" });
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.parentElement;
const graphDefinition = codeEl.textContent;
const graphEl = document.createElement("div");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, graphDefinition).then(({svg, bindFunctions}) => {
graphEl.innerHTML = svg;
bindFunctions?.(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
});
</script>
"""
}
]
end
end