context

package
v0.0.0-...-0a43815 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// WorkspaceInfos contains the contents of package.json for every workspace
	// TODO(gsoltis): should the RootPackageJSON be included in WorkspaceInfos?
	WorkspaceInfos workspace.Catalog

	// WorkspaceNames is all the names of the workspaces
	WorkspaceNames []string

	// WorkspaceGraph is a graph of workspace dependencies
	// (based on package.json dependencies and devDependencies)
	WorkspaceGraph dag.AcyclicGraph

	// RootNode is a sigil identifying the root workspace
	RootNode string

	// Lockfile is a struct to read the lockfile based on the package manager
	Lockfile lockfile.Lockfile

	// PackageManager is an abstraction for all the info a package manager
	// can give us about the repo.
	PackageManager *packagemanager.PackageManager
	// contains filtered or unexported fields
}

Context of the CLI

func BuildPackageGraph

func BuildPackageGraph(repoRoot turbopath.AbsoluteSystemPath, rootPackageJSON *fs.PackageJSON, packageManagerName string) (*Context, error)

BuildPackageGraph constructs a Context instance with information about the package dependency graph

func SinglePackageGraph

func SinglePackageGraph(rootPackageJSON *fs.PackageJSON, packageManagerName string) (*Context, error)

SinglePackageGraph constructs a Context instance from a single package.

func (*Context) ChangedPackages

func (c *Context) ChangedPackages(previousLockfile lockfile.Lockfile) ([]string, error)

ChangedPackages returns a list of changed packages based on the contents of a previous lockfile This assumes that none of the package.json in the workspace change, it is the responsibility of the caller to verify this.

func (*Context) InternalDependencies

func (c *Context) InternalDependencies(start []string) ([]string, error)

InternalDependencies finds all dependencies required by the slice of starting packages, as well as the starting packages themselves.

type Warnings

type Warnings struct {
	// contains filtered or unexported fields
}

Warnings Error type for errors that don't prevent the creation of a functional Context

func (*Warnings) Error

func (w *Warnings) Error() string

Jump to

Keyboard shortcuts

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