Add a basic Elm front-end

This commit is contained in:
Correl Roush 2017-07-18 22:13:27 -04:00
parent 0b86dfc9c4
commit 9a12f4129d
7 changed files with 78 additions and 8 deletions

7
Makefile Normal file
View file

@ -0,0 +1,7 @@
all: elm
elm:
$(MAKE) $(MAKE_FLAGS) --directory priv
clean:
$(MAKE) clean $(MAKE_FLAGS) --directory priv

2
priv/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
index.html
elm-stuff

7
priv/Makefile Normal file
View file

@ -0,0 +1,7 @@
all: index.html
index.html:
elm-make --yes src/Riichi.elm --output=index.html --warn
clean:
rm -rf elm-stuff index.html

15
priv/elm-package.json Normal file
View file

@ -0,0 +1,15 @@
{
"version": "1.0.0",
"summary": "helpful summary of your project, less than 80 characters",
"repository": "https://github.com/user/project.git",
"license": "BSD3",
"source-directories": [
"src"
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 3.0.0"
},
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -1,8 +0,0 @@
<html>
<head>
<title>Riichi Mahjong</title>
</head>
<body>
<h1>Riichi Mahjong</h1>
</body>
</html>

37
priv/src/Riichi.elm Normal file
View file

@ -0,0 +1,37 @@
module Riichi exposing (..)
import Html exposing (..)
type alias Model =
{}
type Msg
= Noop
init : ( Model, Cmd Msg )
init =
( {}, Cmd.none )
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
( model, Cmd.none )
main : Program Never Model Msg
main =
program
{ init = init
, update = update
, view = view
, subscriptions = \_ -> Sub.none
}
view : Model -> Html Msg
view model =
div []
[ h1 [] [ text "Riichi Mahjong" ] ]

View file

@ -1,5 +1,15 @@
%% -*- mode: erlang -*-
{pre_hooks,
[{"(linux|darwin|solaris)", compile,"make elm"},
{"(freebsd|netbsd|openbsd)",compile,"gmake elm"},
{"win32", compile,"make elm"},
{"(linux|darwin|solaris)", eunit, "make elm-test"},
{"(freebsd|netbsd|openbsd)",eunit, "gmake elm-test"},
{"win32", eunit, "make elm-test"},
{"(linux|darwin|solaris)", clean, "make clean"}
]}.
{relx, [{release, {riichi, "0.0.1"},
[riichi]},
{dev_mode, true},