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-toolingnpx elm-tooling initnpx elm-tooling installnpx 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-toolinglocally:npm install --save-dev elm-tooling -
Create an
elm-tooling.json:npx elm-tooling init -
Edit
elm-tooling.json.elm-tooling inittries to guess which tools you already depend on vianpmby looking inside the closestnode_modules/folder andelm.jsonfile (if any). Check ifelm-tooling initgot it right, and then remove tools (such aselmandelm-format) from yourpackage.json. -
Install the tools in
elm-tooling.json:npx elm-tooling install -
Add
"postinstall": "elm-tooling install"to yourpackage.jsonscripts. This meanselm-tooling installis 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.16.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
-
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-toolinglocally: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
npmpackages and stuff you want. -
Create the
srcfolder:mkdir src -
Create
src/Main.elmand start coding!