on f4401ac help sign in
elk/docs/elm.json/application.md
69 lines 2.1 kB history raw
1# `elm.json` for applications
3This is a decent baseline for pretty much any applications made with Elm. You will need these dependencies or more.
5```json
6{
7 "type": "application",
8 "source-directories": [
9 "src"
10 ],
11 "elm-version": "0.19.0",
12 "dependencies": {
13 "direct": {
14 "elm/browser": "1.0.0",
15 "elm/core": "1.0.0",
16 "elm/html": "1.0.0",
17 "elm/json": "1.0.0"
18 },
19 "indirect": {
20 "elm/time": "1.0.0",
21 "elm/url": "1.0.0",
22 "elm/virtual-dom": "1.0.0"
23 }
24 },
25 "test-dependencies": {
26 "direct": {},
27 "indirect": {}
28 }
30```
32<br>
35## `"type"`
37Either `"application"` or `"package"`. All the other fields are based on this choice!
39<br>
42## `"source-directories"`
44A list of directories where Elm code lives. Most projects just use `"src"` for everything.
46<br>
49## `"elm-version"`
51The exact version of Elm this builds with. Should be `"0.19.0"` for most people!
53<br>
56## `"dependencies"`
58All the packages you depend upon. We use exact versions, so your `elm.json` file doubles as a "lock file" that ensures reliable builds.
60You can use modules from any `"direct"` dependency in your code. Some `"direct"` dependencies have their own dependencies that folks typically do not care about. These are the `"indirect"` dependencies. They are listed explicitly so that (1) builds are reproducible and (2) you can easily review the quantity and quality of dependencies.
62**Note:** We plan to eventually have a screen in `reactor` that helps add, remove, and upgrade packages. It can sometimes be tricky to keep all of the constraints happy, so we think having a UI will help a lot. If you get into trouble in the meantime, adding things back one-by-one often helps, and I hope you do not get into trouble!
64<br>
67## `"test-dependencies"`
69All the packages that you use in `tests/` with `elm-test` but not in the application you actually want to ship. This also uses exact versions to make tests more reliable.