Initial commit
This commit is contained in:
commit
f87bfd478f
5 changed files with 141 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
bin
|
||||
elm-stuff
|
||||
public/elm.js
|
31
Makefile
Normal file
31
Makefile
Normal file
|
@ -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
|
25
elm.json
Normal file
25
elm.json
Normal file
|
@ -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": {}
|
||||
}
|
||||
}
|
27
public/index.html
Normal file
27
public/index.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
<!doctype html>
|
||||
<html class="no-js" lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>Dashboard</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
<!-- Place favicon.ico in the root directory -->
|
||||
<script src="elm.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!--[if lt IE 8]>
|
||||
<p class="browserupgrade">
|
||||
You are using an <strong>outdated</strong> browser. Please
|
||||
<a href="http://browsehappy.com/">upgrade your browser</a> to improve
|
||||
your experience.
|
||||
</p>
|
||||
<![endif]-->
|
||||
|
||||
<script type="text/javascript">
|
||||
var app = Elm.App.init();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
55
src/App.elm
Normal file
55
src/App.elm
Normal file
|
@ -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
|
Loading…
Reference in a new issue