Crate forc_pkg

source ·
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::BuildProfile;
pub use manifest::PackageManifest;
pub use manifest::PackageManifestFile;
pub use manifest::WorkspaceManifest;
pub use manifest::WorkspaceManifestFile;

Modules

Structs

The set of options provided to the build functions.
Represents the full build plan for a project.
The result of successfully compiling a package.
The package descriptors that a BuiltPackage holds so that the source used for building the package can be retrieved later on.
Everything needed to recognize a checkout in offline mode
The set of options to filter type of projects to build in a workspace.
A package uniquely identified by name along with its pinned source.
A unique ID for a pinned package.
Error returned upon failed parsing of PinnedId::from_str.
A package uniquely identified by name along with its source.
Represents a package entry point.
Data specific to the test entry point.
Contains the lexed, parsed, and typed compilation stages of a program.
A git repo with a Forc.toml manifest at its root.
A pinned instance of a git source.
A pinned instance of a path source.
Error returned upon failed parsing of SourcePathPinned::from_str.
Error returned upon failed parsing of SourcePinned::from_str.
A package from the official registry.
A pinned instance of the registry source.

Enums

Used to distinguish between types of git references.
Data specific to each kind of package entry point.
Specifies a base source for a package.
Error returned upon failed parsing of SourceGitPinned::from_str.
A pinned instance of the package source.
The possible conditions for a test result to be considered “passing”.

Constants

The name of the constant holding the contract’s id.
The suffix that helps identify the file which contains the hash of the binary file created when scripts are built_package.
The suffix that helps identify the file which contains the root hash of the binary file created when predicates are built_package.

Functions

Build an entire forc package and return the built_package output.
Builds a project with given BuildOptions.
Compile the entire forc package and return the lexed, parsed and typed programs of the dependancies and project. The final item in the returned vector is the project.
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.
Compiles the package to an AST.
Returns the ContractId of a built_package contract with specified salt.
Builds the dependency namespace for the package at the given node index within the graph.
Fetch the repo at the given git package’s URL and checkout the pinned commit.
Produce a unique ID for a particular fetch pass.
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.
Format an error message if a given URL fails to produce a working node.
The path to which a git package commit should be checked out.
Format an error message for an absent Forc.toml.
Returns a parsed AST from the supplied PackageManifestFile
Format an error message for failed parsing of a manifest.
Pin the given git-sourced package.
Given a forc_pkg::BuildProfile, produce the necessary sway_core::BuildConfig required for compilation.
Format an error message if an incorrect program type is present.

Type Definitions

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