Getting started
- Installation
- Quick start
- Adding elm-tooling to an existing project
- 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
npm install --save-dev elm-tooling
npx elm-tooling init
npx elm-tooling install
npx elm --help
Want more details? See below.
Adding elm-tooling to an existing project
-
Go to your project:
cd my-app
-
If you don’t already have a
package.json
, create one:{ "private": true, "scripts": { "postinstall": "elm-tooling install" } }
-
Install
elm-tooling
locally:npm install --save-dev elm-tooling
-
Create an
elm-tooling.json
:npx elm-tooling init
-
Edit
elm-tooling.json
.elm-tooling init
tries to guess which tools you already depend on vianpm
by looking inside the closestnode_modules/
folder andelm.json
file (if any). Check ifelm-tooling init
got it right, and then remove tools (such aselm
andelm-format
) from yourpackage.json
. -
Install the tools in
elm-tooling.json
:npx elm-tooling install
-
Add
"postinstall": "elm-tooling install"
to yourpackage.json
scripts. This meanselm-tooling install
is automatically run afternpm install
. -
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
-
Create a folder and enter it:
mkdir my-app && cd my-app
-
Create a
package.json
:{ "private": true, "scripts": { "postinstall": "elm-tooling install" } }
-
Install
elm-tooling
locally:npm install --save-dev elm-tooling
-
Create an
elm-tooling.json
:npx elm-tooling init
-
Install the tools in
elm-tooling.json
:npx elm-tooling install
-
Create an
elm.json
:npx elm init
-
Optional: Install whatever other
npm
packages and stuff you want. -
Create the
src
folder:mkdir src
-
Create
src/Main.elm
and start coding!