Specifying Dependencies
The [dependencies]
section of your pesde.toml
file is where you specify the
dependencies of your project.
pesde supports multiple types of dependencies.
pesde Dependencies
The most common type of dependency are pesde dependencies. These are dependencies on packages published to a pesde registry.
[indices]default = "https://github.com/pesde-pkg/index"
[dependencies]hello = { name = "pesde/hello", version = "^1.0.0" }
In this example, we’re specifying a dependency on the pesde/hello
package on
the official pesde registry with a version constraint of ^1.0.0
.
You can also add a dependency by running the following command:
pesde add pesde/hello
Git Dependencies
Git dependencies are dependencies on packages hosted on a Git repository.
[dependencies]acme = { repo = "acme/package", rev = "aeff6" }
In this example, we’re specifying a dependency on the package contained within
the acme/package
GitHub repository at the aeff6
commit.
You can also use a URL to specify the Git repository and a tag for the revision.
[dependencies]acme = { repo = "https://git.acme.local/package.git", rev = "v0.1.0" }
You can also specify a path if the package is not at the root of the repository.
Directoryacme/package.git
Directorypkgs/
Directoryfoo/
- pesde.toml
- …
[dependencies]foo = { repo = "acme/package", rev = "main", path = "pkgs/foo" }
The path specified by the Git dependency must either be a valid pesde package or a Wally package.
You can also add a Git dependency by running the following command:
# From Git URLpesde add https://git.acme.local/package.git#aeff6
# From GitHub repositorypesde add gh#acme/package#main
Wally Dependencies
Wally dependencies are dependencies on packages published to a Wally registry. Wally is a package manager for Roblox and thus Wally dependencies should only be used in Roblox projects.
[wally_indices]default = "https://github.com/UpliftGames/wally-index"
[dependencies]foo = { wally = "acme/package", version = "^1.0.0" }
In this example, we’re specifying a dependency on the acme/package
package
on the official Wally registry with a version constraint of ^1.0.0
.
You can also add a Wally dependency by running the following command:
pesde add wally#acme/package
Workspace Dependencies
Packages within a workspace can depend on each other. For example, if foo
and bar
are both packages in the same workspace, you can add a dependency to
bar
in the foo/pesde.toml
file:
[dependencies]bar = { workspace = "acme/bar", version = "^" }
You can also add a workspace dependency by running the following command:
pesde add workspace:acme/bar
Path Dependencies
Path dependencies are dependencies found anywhere available to the operating system. They are useful for local development, but are forbidden in published packages.
The path must be absolute and point to a directory containing a pesde.toml
file.
[dependencies]foo = { path = "/home/user/foo" }
You can also add a path dependency by running the following command:
pesde add path:/home/user/foo
Peer Dependencies
Peer dependencies are dependencies that are not installed automatically when used by another package. They need to be installed by the user of the package.
[peer_dependencies]foo = { name = "acme/foo", version = "^1.0.0" }
You can add a peer dependency by passing --peer
to the pesde add
command:
pesde add --peer acme/foo
Dev Dependencies
Dev dependencies are dependencies that are only used during development. They are not installed when the package is used as a dependency.
[dev_dependencies]foo = { name = "acme/foo", version = "^1.0.0" }
You can add a dev dependency by passing --dev
to the pesde add
command:
pesde add --dev acme/foo