Maintainer | Profpatsch |
---|---|
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
The Yarn package manager improves on npm
in that it writes yarn.lock
files that contain a complete
version resolution of all dependencies. This way a deterministic
deployment can be guaranteed.
This module provides a parser for yarn.lock
files.
- type Lockfile = Map PackageKey Package
- data PackageKey = PackageKey {}
- data Package = Package {}
- data RemoteFile = RemoteFile {}
- type PackageEntry = ([PackageKey], Package)
- type PackageList = [PackageEntry]
- parse :: Text -> Text -> Either Text Lockfile
- lockfile :: Parser Lockfile
- packageListToLockfile :: PackageList -> Lockfile
- packageList :: Parser PackageList
- packageEntry :: Parser PackageEntry
- packageKeys :: Parser [PackageKey]
- packageKey :: Parser PackageKey
- package :: Parser Package
Documentation
The actual package with dependencies and download link.
Package | |
|
type PackageEntry = ([PackageKey], Package) Source #
A entry as it appears in the yarn.lock representation.
type PackageList = [PackageEntry] Source #
Convenience alias.
Convenience function that converts errors to Text.
The actual parsers are below.
Parsers
packageListToLockfile :: PackageList -> Lockfile Source #
The yarn.lock file is basically a hashmap with multi-keyed entries.
This should press it into our Lockfile Map.
packageList :: Parser PackageList Source #
Parse a complete yarn.lock into exaclty the same representation.
You can apply packageListToLockfile
to make it usable.
packageEntry :: Parser PackageEntry Source #
A single PackageEntry.
handlebars@^4.0.4: version "4.0.6" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.6.tgz#2ce4484850537f9c97a8026d5399b935c4ed4ed7" dependencies: async "^1.4.0" optimist "^0.6.1" source-map "^0.4.4" optionalDependencies: uglify-js "^2.6"
packageKeys :: Parser [PackageKey] Source #
The list of PackageKeys that index the same Package
align-text^0.1.1, align-text
^0.1.3:\n
packageKey :: Parser PackageKey Source #
A packageKey is <package-name>@<semver>
;
If the semver contains spaces, it is also quoted with "
.