wpmlock

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LockfileName   = "wpm.lock"
	CurrentVersion = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LockPackage

type LockPackage struct {
	Version      string              `json:"version"`
	Resolved     string              `json:"resolved"`
	Digest       string              `json:"digest"`
	Type         types.PackageType   `json:"type"`
	Bin          *types.Bin          `json:"bin,omitempty"`
	Dependencies *types.Dependencies `json:"dependencies,omitempty"`
}

LockPackage represents a specific version of a package locked in the lockfile.

type Lockfile

type Lockfile struct {
	LockfileVersion int                    `json:"lockfileVersion"`
	Packages        map[string]LockPackage `json:"packages"`
	Indentation     string                 `json:"-"`
}

Lockfile represents the state of the dependency tree. Since wpm does not support nesting, this is a flat map of package names to their locked details.

func New

func New() *Lockfile

New creates a new empty Lockfile instance with the current version.

func Read

func Read(cwd string) (*Lockfile, error)

Read loads the wpm.lock file from the specified directory.

func (*Lockfile) SetIndentation

func (l *Lockfile) SetIndentation(indentation string)

SetIndentation sets the indentation style for the lockfile when written to disk.

func (*Lockfile) Write

func (l *Lockfile) Write(cwd string) error

Write saves the Lockfile to disk in the specified directory.

Jump to

Keyboard shortcuts

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