How to declare a workspace with multiple projects
Lux supports monorepos with multiple projects. You need to declare a workspace TOML at the root directory, and a project TOML for each project.
The root lux.toml
In your workspace root, add a lux.toml with the relative paths to your projects in the
workspace.members field:
lux.toml at workspace root
[worskpace]
members = [
"projects/foo",
"projects/bar",
]
Or:
lux.toml at workspace root
[worskpace]
members = ["glob:projects/*"]
Then add a lux.toml to each directory:
projects/foo/lux.tomlprojects/bar/lux.toml
Declaring local dependencies
If one of your projects depends on the other, you can make sure Lux builds the local package by declaring local dependencies:
projects/foo/lux.toml
# ...
[dependencies.foo]
path = "../foo"
version = "1.0.0"
important
- You should still declare a version so that the package can be published.
- If your project lives in a subdirectory, you should also set
source.dir. Make sure it points to the correct directory in any archives specified bysource.url. For example, if the archive extracts to a folder namedmy_project, and the project is located within the subdirectoryfoo/bar, setsource.dir = my_project/foo/bar.