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

MaintainerProfpatsch
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Yarn.Lock

Description

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.

Synopsis

Documentation

type Lockfile = Map PackageKey Package Source #

Yarn lockfile.

data PackageKey Source #

Key that indexes package for a specific version.

Constructors

PackageKey 

Fields

data Package Source #

The actual package with dependencies and download link.

Constructors

Package 

Fields

data RemoteFile Source #

A package download link.

Constructors

RemoteFile 

Fields

type PackageEntry = ([PackageKey], Package) Source #

A entry as it appears in the yarn.lock representation.

type PackageList = [PackageEntry] Source #

Convenience alias.

parse Source #

Arguments

:: Text

name of source file

-> Text

input for parser

-> Either Text Lockfile 

Convenience function that converts errors to Text.

The actual parsers are below.

Parsers

lockfile :: Parser Lockfile Source #

Convenience function that applies packageListToLockfile.

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 ".

package :: Parser Package Source #

Parses the content fields of a package.