A workspace is a collection of one or more packages, namely workspace members, that are managed together.
The key points for workspaces are:
forccommands available for a single package can also be used for a workspace, like
- All packages share a common
Forc.lockfile which resides in the root directory of the workspace.
Workspace manifests are declared within
Forc.toml files and support the following fields:
members- Packages to include in the workspace.
An empty workspace can be created with
forc new --workspace or
forc init --workspace.
members field defines which packages are members of the workspace:
[workspace] members = ["member1", "path/to/member2"]
members field accepts entries to be given in relative path with respect to the workspace root.
Packages that are located within a workspace directory but are not contained within the
members set are ignored.
forc build- Builds an entire workspace.
forc deploy- Builds and deploys all deployable members (i.e, contracts) of the workspace in the correct order.
forc check- Checks all members of the workspace.
forc update- Checks and updates workspace level
Forc.lockfile that is shared between workspace members.