Appendix B. Installing Elm packages

This appendix elaborates on these concepts first introduced in chapter 3

  • Direct and indirect dependencies
  • Default imports
  • Elm’s semantic versioning
  • Installation of Elm packages

Whenever we run elm install to add a new dependency, it modifies our elm.json file. Here is the elm.json file we’ll have at the beginning of the book’s final chapter, chapter 8.

Listing B.1. Photo Groove’s elm.json
{
    "type": "application",                                1
    "source-directories": [
        "src"                                             2
    ],
    "elm-version": "0.19.1",
    "dependencies": {
        "direct": {                                          3
            "NoRedInk/elm-json-decode-pipeline": "1.0.0",    4
            "elm/browser": "1.0.1",
            "elm/core": "1.0.2",
            "elm/html": "1.0.0",
            "elm/http": "2.0.0",
            "elm/json": "1.1.2",
            "elm/random": "1.0.0"
        },
        "indirect": {                                        5 "elm/bytes": ...

Get Elm in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.