From f87bfd478f249bec99e906dbcb5ced583760f6bc Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 20 Dec 2024 18:06:58 -0500 Subject: [PATCH] Initial commit --- .gitignore | 3 +++ Makefile | 31 ++++++++++++++++++++++++++ elm.json | 25 +++++++++++++++++++++ public/index.html | 27 +++++++++++++++++++++++ src/App.elm | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 elm.json create mode 100644 public/index.html create mode 100644 src/App.elm diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e27712 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin +elm-stuff +public/elm.js diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bb48e34 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +.PHONY: all clean clean-deps + +TARGET=public/elm.js +SOURCE=src/App.elm + +ELM_FILES = $(shell find src -type f -name '*.elm') +ELM = ./bin/elm + +ELMMAKE_FLAGS = +ifeq ($(DEBUG),1) + ELMMAKE_FLAGS += --debug +endif + +all: $(TARGET) + +$(ELM): + mkdir -p ./bin + curl -sL https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz \ + | gunzip > $@ + chmod +x $@ + +$(TARGET): $(ELM_FILES) $(ELM) + $(ELM) make $(ELMMAKE_FLAGS) $(SOURCE) --output $@ + +clean-deps: + rm -rf bin + rm -rf elm-stuff + +clean: + rm -f $(TARGET) + rm -rf elm-stuff/build-artifacts diff --git a/elm.json b/elm.json new file mode 100644 index 0000000..472cef8 --- /dev/null +++ b/elm.json @@ -0,0 +1,25 @@ +{ + "type": "application", + "source-directories": [ + "src" + ], + "elm-version": "0.19.1", + "dependencies": { + "direct": { + "elm/browser": "1.0.2", + "elm/core": "1.0.5", + "elm/html": "1.0.0", + "elm/json": "1.1.3", + "mdgriffith/elm-ui": "1.1.8" + }, + "indirect": { + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "elm/virtual-dom": "1.0.3" + } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} + } +} diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..aa877ea --- /dev/null +++ b/public/index.html @@ -0,0 +1,27 @@ + + + + + + Dashboard + + + + + + + + + + + + + diff --git a/src/App.elm b/src/App.elm new file mode 100644 index 0000000..345944f --- /dev/null +++ b/src/App.elm @@ -0,0 +1,55 @@ +module App exposing (main) + +import Browser +import Element as E +import Json.Decode + + +type alias Extension = + { name : String + } + + +type alias Model = + { extension : Maybe Extension + } + + +type Msg + = NoOp + + +main = + Browser.document + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + +init : Json.Decode.Value -> ( Model, Cmd Msg ) +init _ = + ( { extension = Nothing }, Cmd.none ) + + +view : Model -> Browser.Document Msg +view model = + { title = "Dashboard" + , body = + [ E.layout [] <| + E.text "Welcome!" + ] + } + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + NoOp -> + ( model, Cmd.none ) + + +subscriptions : Model -> Sub Msg +subscriptions model = + Sub.none