Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Getting started

  1. Installation
  2. Quick start
  3. Adding elm-tooling to an existing project
  4. Creating a new project with elm-tooling

Installation

npm install --save-dev elm-tooling
npx elm-tooling help

Quick start

Assuming you already have a package.json

  1. npm install --save-dev elm-tooling
  2. npx elm-tooling init
  3. npx elm-tooling install
  4. npx elm --help

Want more details? See below.

Adding elm-tooling to an existing project

  1. Go to your project: cd my-app

  2. If you don’t already have a package.json, create one:

    {
      "private": true,
      "scripts": {
        "postinstall": "elm-tooling install"
      }
    }
    
  3. Install elm-tooling locally: npm install --save-dev elm-tooling

  4. Create an elm-tooling.json: npx elm-tooling init

  5. Edit elm-tooling.json. elm-tooling init tries to guess which tools you already depend on via npm by looking inside the closest node_modules/ folder and elm.json file (if any). Check if elm-tooling init got it right, and then remove tools (such as elm and elm-format) from your package.json.

  6. Install the tools in elm-tooling.json: npx elm-tooling install

  7. Add "postinstall": "elm-tooling install" to your package.json scripts. This means elm-tooling install is automatically run after npm install.

  8. Run through your CI and build system and see if everything works or something needs to be tweaked. See CI setup for more information.

With the above steps, you might end up with changes like this:

package.json:

 {
   "devDependencies": {
-    "elm": "0.19.1",
-    "elm-format": "0.8.3"
+    "elm-tooling": "1.15.1"
   },
   "scripts": {
+    "postinstall": "elm-tooling install"
   }
 }

elm-tooling.json:

+{
+    "tools": {
+        "elm": "0.19.1",
+        "elm-format": "0.8.3"
+    }
+}

Creating a new project with elm-tooling

  1. Create a folder and enter it: mkdir my-app && cd my-app

  2. Create a package.json:

    {
      "private": true,
      "scripts": {
        "postinstall": "elm-tooling install"
      }
    }
    
  3. Install elm-tooling locally: npm install --save-dev elm-tooling

  4. Create an elm-tooling.json: npx elm-tooling init

  5. Install the tools in elm-tooling.json: npx elm-tooling install

  6. Create an elm.json: npx elm init

  7. Optional: Install whatever other npm packages and stuff you want.

  8. Create the src folder: mkdir src

  9. Create src/Main.elm and start coding!