Link Search Menu Expand Document

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,
      "name": "my-app",
      "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.

    • elm-tooling init also tries to detect your entrypoints, but might fail. Have a look at "entrypoints" and make sure that they match your project.

  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. Check if there are any issues with your elm-tooling.json: npx elm-tooling validate

  9. 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:

 {
   "name": "my-app",
   "devDependencies": {
-    "elm": "0.19.1",
-    "elm-format": "0.8.3"
+    "elm-tooling": "1.3.0"
   },
   "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,
      "name": "my-app",
      "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!