Expand description

Building, locking, fetching and updating sway projects as Forc packages.

A forc package represents a Sway project with a Forc.toml manifest file declared at its root. The project should consist of one or more Sway modules under a src directory. It may also declare a set of forc package dependencies within its manifest.

Re-exports

pub use lock::Lock;
pub use manifest::Manifest;

Modules

Structs

Parameters to pass through to the sway_core::BuildConfig during compilation.

Represents the full build plan for a project.

The result of successfully compiling a package.

A package uniquely identified by name along with its pinned source.

A unique ID for a pinned package.

A package uniquely identified by name along with its source.

A git repo with a Forc.toml manifest at its root.

A pinned instance of a git source.

A package from the official registry.

A pinned instance of the registry source.

Enums

Used to distinguish between types of git references.

Specifies a base source for a package.

Error returned upon failed parsing of SourceGitPinned::from_str.

A pinned instance of the package source.

Functions

Build an entire forc package and return the compiled output.

The pkg::Graph is of a -> b where a depends on b. We can determine compilation order by performing a toposort of the graph with reversed weights. The resulting order ensures all dependencies are always compiled before their dependents.

Compiles the given package.

Builds the dependency namespace for the package at the given node index within the graph.

The same as find_within, but returns the package’s project directory.

Attempt to find a Forc.toml with the given project name within the given directory.

Given graph of pinned dependencies and the directory for the root node, produce a path map containing the path to the local source for every node in the graph.

Given a forc_pkg::BuildConfig, produce the necessary sway_core::BuildConfig required for compilation.

Type Definitions

The name specified on the left hand side of the = in a depenedency declaration under [dependencies] within a forc manifest.