lockfile

package
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PnpmEcosystem = NpmEcosystem

Variables

This section is empty.

Functions

func CachedMustCompile added in v0.10.0

func CachedMustCompile(exp string) *regexp.Regexp

Types

type Dependency

type Dependency struct {
	Name    string
	Version string
}

type DependencyState added in v0.10.0

type DependencyState struct {
	Package   Dependency
	Processed bool
}

type Ecosystem

type Ecosystem string
const NpmEcosystem Ecosystem = "npm"

type NpmLockDependency added in v0.10.0

type NpmLockDependency struct {
	Version      string                       `json:"version"`
	Dependencies map[string]NpmLockDependency `json:"dependencies,omitempty"`
}

type NpmLockPackage added in v0.10.0

type NpmLockPackage struct {
	Version      string            `json:"version"`
	Resolved     string            `json:"resolved"`
	Dependencies map[string]string `json:"dependencies"`
}

type NpmLockfile added in v0.10.0

type NpmLockfile struct {
	Version int `json:"lockfileVersion"`
	// npm v1- lockfiles use "dependencies"
	Dependencies map[string]NpmLockDependency `json:"dependencies"`
	// npm v2+ lockfiles use "packages"
	Packages map[string]NpmLockPackage `json:"packages,omitempty"`
}

type PackageDetails

type PackageDetails struct {
	Name         string       `json:"name"`
	Version      string       `json:"version"`
	Commit       string       `json:"commit,omitempty"`
	Ecosystem    Ecosystem    `json:"ecosystem,omitempty"`
	CompareAs    Ecosystem    `json:"compareAs,omitempty"`
	Dependencies []Dependency `json:"dependencies,omitempty"`
}

func ParseNpmLock added in v0.10.0

func ParseNpmLock(pathToLockfile string) ([]PackageDetails, error)

func ParsePnpmLock added in v0.10.0

func ParsePnpmLock(pathToLockfile string) ([]PackageDetails, error)

func ParseYarnLock

func ParseYarnLock(pathToLockfile string) ([]PackageDetails, error)

type PackageDetailsParser

type PackageDetailsParser = func(pathToLockfile string) ([]PackageDetails, error)

type PackageFlattened added in v0.10.0

type PackageFlattened struct {
	Name         string
	Version      string
	Dependencies []DependencyState
}

func ExpandPackage added in v0.10.0

func ExpandPackage(packageName string, packages []PackageDetails) (*PackageFlattened, error)

type PnpmLockPackage added in v0.10.0

type PnpmLockPackage struct {
	Resolution   PnpmLockPackageResolution `yaml:"resolution"`
	Name         string                    `yaml:"name"`
	Version      string                    `yaml:"version"`
	Dependencies map[string]string         `yaml:"dependencies"`
}

type PnpmLockPackageResolution added in v0.10.0

type PnpmLockPackageResolution struct {
	Tarball string `yaml:"tarball"`
	Commit  string `yaml:"commit"`
	Repo    string `yaml:"repo"`
	Type    string `yaml:"type"`
}

type PnpmLockfile added in v0.10.0

type PnpmLockfile struct {
	Version  float64                    `yaml:"lockfileVersion"`
	Packages map[string]PnpmLockPackage `yaml:"packages,omitempty"`
}

func (*PnpmLockfile) UnmarshalYAML added in v0.10.0

func (l *PnpmLockfile) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL