Maintainer | Profpatsch |
---|---|
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
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
- type Lockfile = MKMap PackageKey Package
- parseFile :: FilePath -> IO (Either LockfileError Lockfile)
- parse :: FilePath -> Text -> Either LockfileError Lockfile
- prettyLockfileError :: LockfileError -> Text
- data LockfileError
- data PackageErrorInfo = PackageErrorInfo {}
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.
:: 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
.
:: FilePath | name of the input file, used for the parser |
-> Text | content of a |
-> 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
.
ParseError Text | The initial parsing step failed |
PackageErrors (NonEmpty PackageErrorInfo) | a package could not be parsed from the AST |
Instances
Eq LockfileError Source # | |
Defined in Yarn.Lock (==) :: LockfileError -> LockfileError -> Bool # (/=) :: LockfileError -> LockfileError -> Bool # | |
Show LockfileError Source # | |
Defined in Yarn.Lock showsPrec :: Int -> LockfileError -> ShowS # show :: LockfileError -> String # showList :: [LockfileError] -> ShowS # |
data PackageErrorInfo Source #
Information about package parsing errors.
PackageErrorInfo | |
|
Instances
Eq PackageErrorInfo Source # | |
Defined in Yarn.Lock (==) :: PackageErrorInfo -> PackageErrorInfo -> Bool # (/=) :: PackageErrorInfo -> PackageErrorInfo -> Bool # | |
Show PackageErrorInfo Source # | |
Defined in Yarn.Lock showsPrec :: Int -> PackageErrorInfo -> ShowS # show :: PackageErrorInfo -> String # showList :: [PackageErrorInfo] -> ShowS # |