yarn-lock-0.5.0: Represent and parse yarn.lock files

MaintainerProfpatsch
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Yarn.Lock

Contents

Description

The Yarn package manager improves on npm, because it writes yarn.lock files that contain a complete version resolution of all dependencies. This way a deterministic deployment can be guaranteed.

Synopsis

Documentation

type Lockfile = MKMap PackageKey Package Source #

Yarn lockfile.

It is a multi-keyed map (each value can be referenced by multiple keys). This is achieved by using an intermediate key ik.

Attention: Might be changed to a newtype in a future release.

parseFile Source #

Arguments

:: FilePath

file to read

-> IO (Either LockfileError Lockfile) 

Convenience function, combining all parsing steps.

The resulting Lockfile structure might not yet be optimal, see fromPackages.

parse Source #

Arguments

:: FilePath

name of the input file, used for the parser

-> Text

content of a yarn.lock

-> Either LockfileError Lockfile 

For when you want to provide only the file contents.

Errors

prettyLockfileError :: LockfileError -> Text Source #

Pretty print a parsing error with sane default formatting.

data LockfileError Source #

Everything that can go wrong when parsing a Lockfile.

Constructors

ParseError Text

The initial parsing step failed

PackageErrors (NonEmpty PackageErrorInfo)

a package could not be parsed from the AST

data PackageErrorInfo Source #

Information about package parsing errors.

Constructors

PackageErrorInfo 

Fields