Skip to content

Commit 4eb6826

Browse files
committed
Chore: initial commit
Signed-off-by: alt-ctrl-dev <[email protected]>
1 parent 6ddb4c3 commit 4eb6826

40 files changed

+2251
-1
lines changed

.github/ISSUE_TEMPLATE/bug.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 🐞 Bug Report
2+
description: Tell us about something that's not working the way we (probably) intend.
3+
labels: ["Kind:Bug", "State:Triage"]
4+
body:
5+
- type: input
6+
id: elixir-version
7+
attributes:
8+
label: Elixir version
9+
description: Use `elixir -v` to find the Elixir version.
10+
validations:
11+
required: true
12+
13+
- type: input
14+
id: aba-file-validator-version
15+
attributes:
16+
label: aba-file-validator version
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: current-behavior
22+
attributes:
23+
label: Current behavior
24+
description: How can we reproduce what you're seeing? Include code samples, errors and stacktraces if appropriate.
25+
placeholder: |-
26+
1. foo
27+
2. bar
28+
3. baz
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
id: expected-behavior
34+
attributes:
35+
label: Expected behavior
36+
validations:
37+
required: true

.github/workflows/ci.yml

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Unit tests
2+
3+
# Define workflow that runs when changes are pushed to the
4+
# `main` branch or pushed to a PR branch that targets the `main`
5+
# branch. Change the branch name if your project uses a
6+
# different name for the main branch like "master" or "production".
7+
on:
8+
push:
9+
paths:
10+
- '**.ex'
11+
- '**.exs'
12+
- '!**.md'
13+
branches:
14+
- main
15+
pull_request:
16+
branches:
17+
- main
18+
19+
# Sets the ENV `MIX_ENV` to `test` for running tests
20+
env:
21+
MIX_ENV: test
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
mix_test:
28+
name: mix test (OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}})
29+
30+
strategy:
31+
matrix:
32+
include:
33+
- elixir: 1.14
34+
otp: 24.2
35+
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
# Step: Setup Elixir + Erlang image as the base.
40+
- name: Set up Elixir
41+
uses: erlef/setup-beam@v1
42+
with:
43+
elixir-version: ${{ matrix.elixir }}
44+
otp-version: ${{ matrix.otp }}
45+
46+
# Step: Check out the code.
47+
- name: Checkout
48+
uses: actions/checkout@v3
49+
50+
# Step: Define how to cache deps. Restores existing cache if present.
51+
- name: Cache deps
52+
id: cache-deps
53+
uses: actions/cache@v3
54+
env:
55+
cache-name: cache-elixir-deps
56+
with:
57+
path: deps
58+
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
59+
restore-keys: |
60+
${{ runner.os }}-mix-${{ env.cache-name }}-
61+
62+
# Step: Define how to cache the `_build` directory. After the first run,
63+
# this speeds up tests runs a lot. This includes not re-compiling our
64+
# project's downloaded deps every run.
65+
- name: Cache compiled build
66+
id: cache-build
67+
uses: actions/cache@v3
68+
env:
69+
cache-name: cache-compiled-build
70+
with:
71+
path: _build
72+
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
73+
restore-keys: |
74+
${{ runner.os }}-mix-${{ env.cache-name }}-
75+
${{ runner.os }}-mix-
76+
77+
# Step: Conditionally bust the cache when job is re-run.
78+
# Sometimes, we may have issues with incremental builds that are fixed by
79+
# doing a full recompile. In order to not waste dev time on such trivial
80+
# issues (while also reaping the time savings of incremental builds for
81+
# *most* day-to-day development), force a full recompile only on builds
82+
# that are retried.
83+
- name: Clean to rule out incremental build as a source of flakiness
84+
if: github.run_attempt != '1'
85+
run: |
86+
mix deps.clean --all
87+
mix clean
88+
shell: sh
89+
90+
# Step: Download project dependencies. If unchanged, uses
91+
# the cached version.
92+
- name: Install dependencies
93+
run: mix deps.get
94+
95+
# Step: Compile the project treating any warnings as errors.
96+
# Customize this step if a different behavior is desired.
97+
- name: Compiles without warnings
98+
run: mix compile --warnings-as-errors
99+
100+
# Step: Check that the checked in code has already been formatted.
101+
# This step fails if something was found unformatted.
102+
# Customize this step as desired.
103+
- name: Check Formatting
104+
run: mix format --check-formatted
105+
106+
- if: failure()
107+
run: echo "### Failed on lint" >> $GITHUB_STEP_SUMMARY
108+
109+
# Step: Execute the tests.
110+
- name: Run tests
111+
run: mix test

README.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
# aba-viewer
1+
# AbaViewer
2+
3+
4+
## Pre-requisite
5+
- Elixir ~> v1.14
6+
7+
8+
## Setup
9+
Run mix deps.get
10+
11+
## Running
12+
To start your Phoenix server:
13+
14+
* Run `mix setup` to install and setup dependencies
15+
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
16+
17+
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
18+
19+
Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
20+
21+
## Testing
22+
Run mix test
23+
24+
## Learn more
25+
26+
* Official website: https://www.phoenixframework.org/
27+
* Guides: https://hexdocs.pm/phoenix/overview.html
28+
* Docs: https://hexdocs.pm/phoenix
29+
* Forum: https://elixirforum.com/c/phoenix-forum
30+
* Source: https://github.com/phoenixframework/phoenix

assets/css/app.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import "tailwindcss/base";
2+
@import "tailwindcss/components";
3+
@import "tailwindcss/utilities";
4+
5+
/* This file is for your main application CSS */

assets/js/app.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// If you want to use Phoenix channels, run `mix help phx.gen.channel`
2+
// to get started and then uncomment the line below.
3+
// import "./user_socket.js"
4+
5+
// You can include dependencies in two ways.
6+
//
7+
// The simplest option is to put them in assets/vendor and
8+
// import them using relative paths:
9+
//
10+
// import "../vendor/some-package.js"
11+
//
12+
// Alternatively, you can `npm install some-package --prefix assets` and import
13+
// them using a path starting with the package name:
14+
//
15+
// import "some-package"
16+
//
17+
18+
// Include phoenix_html to handle method=PUT/DELETE in forms and buttons.
19+
import "phoenix_html"
20+
// Establish Phoenix Socket and LiveView configuration.
21+
import {Socket} from "phoenix"
22+
import {LiveSocket} from "phoenix_live_view"
23+
import topbar from "../vendor/topbar"
24+
25+
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
26+
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
27+
28+
// Show progress bar on live navigation and form submits
29+
topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"})
30+
window.addEventListener("phx:page-loading-start", _info => topbar.show(300))
31+
window.addEventListener("phx:page-loading-stop", _info => topbar.hide())
32+
33+
// connect if there are any LiveViews on the page
34+
liveSocket.connect()
35+
36+
// expose liveSocket on window for web console debug logs and latency simulation:
37+
// >> liveSocket.enableDebug()
38+
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
39+
// >> liveSocket.disableLatencySim()
40+
window.liveSocket = liveSocket
41+

assets/tailwind.config.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// See the Tailwind configuration guide for advanced usage
2+
// https://tailwindcss.com/docs/configuration
3+
4+
const plugin = require("tailwindcss/plugin")
5+
6+
module.exports = {
7+
content: [
8+
"./js/**/*.js",
9+
"../lib/*_web.ex",
10+
"../lib/*_web/**/*.*ex"
11+
],
12+
theme: {
13+
extend: {
14+
colors: {
15+
brand: "#FD4F00",
16+
}
17+
},
18+
},
19+
plugins: [
20+
require("@tailwindcss/forms"),
21+
plugin(({addVariant}) => addVariant("phx-no-feedback", [".phx-no-feedback&", ".phx-no-feedback &"])),
22+
plugin(({addVariant}) => addVariant("phx-click-loading", [".phx-click-loading&", ".phx-click-loading &"])),
23+
plugin(({addVariant}) => addVariant("phx-submit-loading", [".phx-submit-loading&", ".phx-submit-loading &"])),
24+
plugin(({addVariant}) => addVariant("phx-change-loading", [".phx-change-loading&", ".phx-change-loading &"]))
25+
]
26+
}

0 commit comments

Comments
 (0)