vitoria-training / sprout

0 stars 0 forks source link

sprout

Get starting with Elm!

Installation

Install Elm from here. Also the URL explains everything you need to know. Please read this first.

https://guide.elm-lang.org/install/elm.html

Run this command to confirm Elm is installed properly. ~elm --help~ That is it. you are ready to go!

Packages

Elm provide all packages. No need third party's packages. All dependencies are wrriten in elm.json To add more packages(to import packages in codes.)

elm install PACKAGE_NAME

such as

elm install elm/http
elm install elm/json

known issues

if .js extension has set as executable on your environment and prompt any elm command on where you see elm.js the terminal keep asking you to open elm.js file. in order to avoid this issue, either remove .js extension from the list of excutable of your environment or rename elm.js to something else. In this repository elm.js has renamed as main.js

git flow

branch

Please do not commit any tasks on these branches below.

main branch(default)

This branch is used for release versions. DO NOT DO ANYTHING ON THIS BRANCH.

develop branch

This branch is used as a base branch for ALL WORKING BRANCHES. Please pull this branch everytime it has been updated.

branch naming convention

no local rules. follow general convention. https://dev.to/varbsan/a-simplified-convention-for-naming-branches-and-commits-in-git-il4

Before you start working!

When you are assigned on or created an issue please follow these steps below.

commit rule

no local rules. follow general convention. https://www.linkedin.com/pulse/7-best-practices-writing-good-git-commitmessages-kirinyet-brian/

Pull Requests

Please link the issue on the description. you can link the issue id by typing #

Starting Docker (elm) from VSCode

reference https://zenn.dev/aoaoaoaoaoaoaoi/articles/5fdbb959616c8c#1.%E3%80%8Cdocker-compose.yml%E3%80%8D%E3%82%92%E4%BD%9C%E6%88%90

Directory structure

[ElmProject]
  │
  ├─docker-compose.yml
  │
  ├─Dockerfile
  │
  ├─(Other files)
  ・
  ・
  ・

※This time, we will use the one already placed in the Elm project.

Insert Dev Container into VSCode

Search for "Dev Container" in VSCode extensions and install it.

Open with docker

1.Start "Docker Desktop".

※Work with VSCode from here.

2.Press "><" at the bottom left of VSCode. image (Can enter the development container. If not Search for "Remote Development" in VSCode extensions and install it.)

3.Select "Reopen in Container". image

4.Select “Open with docker-compose.yml”. image

5.Don't select anything and press OK. image

6.After confirming that the container is running on "Docker Desktop", image confirm that you are in the development container with VSCode and start the terminal. image

7.Run the following command in the terminal.

Build the Elm project.

elm reactor

image

8.Check that the project is displayed at http://localhost:8000/. image

image

Display "/src/Page/Top/Top.elm" as a trial. image