eco-pro/project-metadata-utils/1.0.0

Rerouted (archive, verified). The original repository is gone. This copy comes from an archive (Software Heritage). The Lamdera package server serves a copy recovered from swh:1:rev:ccedc9b26200893c07fe8295a6a061cb4d4b8e7f (Software Heritage, origin https://github.com/eco-pro/project-metadata-utils).

What we checked: Software Heritage archived tag 1.0.0 of github.com/eco-pro/project-metadata-utils at commit ccedc9b26200; its commit ccedc9b26200 is from 2021-02-20 17:08 UTC, before the version was published (2021-02-20 17:14 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip is our own, made from Software Heritage's copy of the files Elm uses, so its SHA-1 is not the published one.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/eco-pro/project-metadata-utils/zipball/1.0.0/

Elm.Project

Turn elm.json files into data that is nice to use in Elm.

Projects

type Project
= Application ApplicationInfo
| Package PackageInfo

There are two types of Elm projects, one for applications and another one for packages. The elm.json is different in each case, so we they are modeled as ApplicationInfo and PackageInfo types.

type alias ApplicationInfo =
{ elm : Version
, dirs : List String
, depsDirect : Deps Version
, depsIndirect : Deps Version
, testDepsDirect : Deps Version
, testDepsIndirect : Deps Version
}

The contents of an elm.json with "type": "application".

type alias Deps constraint =
List ( Name, constraint )

The dependencies for a project. The order is preserved from JSON.

type alias PackageInfo =
{ name : Name
, summary : String
, license : License
, version : Version
, exposed : Exposed
, deps : Deps Constraint
, testDeps : Deps Constraint
, elm : Constraint
}

The contents of an elm.json with "type": "package".

type Exposed
= ExposedList (List Name)
| ExposedDict (List ( String, List Name ))

There are two ways to specify "exposed-modules" field in an elm.json for packages. In one you just list the exposed modules. In the other, you provide headers for chunks of module names. In either case, the package website preserves this information to make the presentation nicer.

JSON Conversions

encode : Project -> Value

Turn a Project into the JSON that goes in elm.json

decoder : Decoder Project

Decode the contents of elm.json into a Project.