From 6a6d612acb5b003dd5401c50813299e35f9dab6f Mon Sep 17 00:00:00 2001 From: setop Date: Fri, 14 Jul 2023 09:47:05 +0200 Subject: [PATCH] working template --- .tool-versions | 1 + README.md | 18 ++++++++ cmd.txt | 17 ++++++++ cookiecutter.json | 3 ++ requirements.txt | 1 + {{cookiecutter.app_name}}/.gitignore | 1 + {{cookiecutter.app_name}}/.tool-versions | 1 + {{cookiecutter.app_name}}/README.md | 23 ++++++++++ {{cookiecutter.app_name}}/elm.json | 24 +++++++++++ {{cookiecutter.app_name}}/src/Main.elm | 53 ++++++++++++++++++++++++ 10 files changed, 142 insertions(+) create mode 100644 .tool-versions create mode 100644 README.md create mode 100644 cmd.txt create mode 100644 cookiecutter.json create mode 100644 requirements.txt create mode 100644 {{cookiecutter.app_name}}/.gitignore create mode 100644 {{cookiecutter.app_name}}/.tool-versions create mode 100644 {{cookiecutter.app_name}}/README.md create mode 100644 {{cookiecutter.app_name}}/elm.json create mode 100644 {{cookiecutter.app_name}}/src/Main.elm diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..c10ee4e --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +python 3.11.4 diff --git a/README.md b/README.md new file mode 100644 index 0000000..c1db52c --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# cookiecutter-elm + +[cookiecutter](https://github.com/audreyr/cookiecutter) + + +## Requires + +* Python +* Cookiecutter +* Elm + +## Use cookiecutter-elm + +`cookiecutter https://git.zoocoop.com/setop/cookiecutter-elm` + +## instructions + +see cmd.txt file diff --git a/cmd.txt b/cmd.txt new file mode 100644 index 0000000..4e87840 --- /dev/null +++ b/cmd.txt @@ -0,0 +1,17 @@ +# install venv +python -m venv .venv +. .venv/bin/activate +pip install -U pip +pip install -r requirements.txt + +# run template +cookiecutter . + +# clean +deactivate +rm -rf .venv +rm -rf \{\{cookiecutter.app_name\}\}/ +rm -rf .git + +cd simpleapp + diff --git a/cookiecutter.json b/cookiecutter.json new file mode 100644 index 0000000..1a3f78e --- /dev/null +++ b/cookiecutter.json @@ -0,0 +1,3 @@ +{ + "app_name": "simpleapp" +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c8e988b --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +cookiecutter diff --git a/{{cookiecutter.app_name}}/.gitignore b/{{cookiecutter.app_name}}/.gitignore new file mode 100644 index 0000000..e185314 --- /dev/null +++ b/{{cookiecutter.app_name}}/.gitignore @@ -0,0 +1 @@ +elm-stuff \ No newline at end of file diff --git a/{{cookiecutter.app_name}}/.tool-versions b/{{cookiecutter.app_name}}/.tool-versions new file mode 100644 index 0000000..b825aa9 --- /dev/null +++ b/{{cookiecutter.app_name}}/.tool-versions @@ -0,0 +1 @@ +elm 0.19.1 diff --git a/{{cookiecutter.app_name}}/README.md b/{{cookiecutter.app_name}}/README.md new file mode 100644 index 0000000..43706da --- /dev/null +++ b/{{cookiecutter.app_name}}/README.md @@ -0,0 +1,23 @@ +# A simple Elm app + +Basic Elm code lives in `src/Main.elm` and relies on the [elm/html][html] library. + +## Build Instructions + +Run the following command from the root of this project: + +```bash +elm make src/Main.elm --output index.html +``` + +Open `index.html` in your browser. + +## Start a development server + +Run the following command from the root of this project: + +```bash +elm reactor +``` + +Visit `http://localhost:8000` to see your project dashboard. diff --git a/{{cookiecutter.app_name}}/elm.json b/{{cookiecutter.app_name}}/elm.json new file mode 100644 index 0000000..a8e90d9 --- /dev/null +++ b/{{cookiecutter.app_name}}/elm.json @@ -0,0 +1,24 @@ +{ + "type": "application", + "source-directories": [ + "src" + ], + "elm-version": "0.19.1", + "dependencies": { + "direct": { + "elm/browser": "1.0.2", + "elm/core": "1.0.4", + "elm/html": "1.0.0" + }, + "indirect": { + "elm/json": "1.1.3", + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "elm/virtual-dom": "1.0.2" + } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} + } +} diff --git a/{{cookiecutter.app_name}}/src/Main.elm b/{{cookiecutter.app_name}}/src/Main.elm new file mode 100644 index 0000000..8016b83 --- /dev/null +++ b/{{cookiecutter.app_name}}/src/Main.elm @@ -0,0 +1,53 @@ +module Main exposing (..) + +import Browser +import Html exposing (Html, h1, text) + + + +---- MODEL ---- + + +type alias Model = + {} + + +init : ( Model, Cmd Msg ) +init = + ( {}, Cmd.none ) + + + +---- UPDATE ---- + + +type Msg + = NoOp + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + ( model, Cmd.none ) + + + +---- VIEW ---- + + +view : Model -> Html Msg +view model = + h1 [] [ text "Your Elm app '{{cookiecutter.app_name}}' is working!" ] + + + +---- PROGRAM ---- + + +main : Program () Model Msg +main = + Browser.element + { view = view + , init = \_ -> init + , update = update + , subscriptions = always Sub.none + }