Turn elm.json
files into data that is nice to use in Elm.
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.
{ elm : Elm.Version.Version
, dirs : List String
, depsDirect : Deps Elm.Version.Version
, depsIndirect : Deps Elm.Version.Version
, testDepsDirect : Deps Elm.Version.Version
, testDepsIndirect : Deps Elm.Version.Version
}
The contents of an elm.json
with "type": "application"
.
List ( Elm.Package.Name
, constraint
}
The dependencies for a project. The order is preserved from JSON.
{ name : Elm.Package.Name
, summary : String
, license : Elm.License.License
, version : Elm.Version.Version
, exposed : Exposed
, deps : Deps Elm.Constraint.Constraint
, testDeps : Deps Elm.Constraint.Constraint
, elm : Elm.Constraint.Constraint
}
The contents of an elm.json
with "type": "package"
.
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.
encode : Project -> Json.Encode.Value
Turn a Project
into the JSON that goes in elm.json
decoder : Json.Decode.Decoder Project
Decode the contents of elm.json
into a Project
.