Skip to main content

Module toml_cfg

Module toml_cfg 

Source
Expand description

wesl.toml configuration parsing and file scanning.

This module handles reading wesl.toml configuration files and building module hierarchies from glob patterns.

# Version of WESL used in this project.
edition = "2026_pre"

# Optional, can be auto-inferred from the existence of a package manager file.
# Inclusion of this field is encouraged.
package-manager = "npm"

# Where are the shaders located. This is the path of `package::`.
root = "./shaders"

# Optional
include = [ "shaders/**/*.wesl", "shaders/**/*.wgsl" ]

# Optional.
# Some projects have large folders that we shouldn't react to.
exclude = [ "**/test" ]

# Lists all used dependencies
[dependencies]
# Shorthand for `foolib = { package = "foolib" }`
foolib = {}
# Can be used for renaming packages. Now bevy in my code is called "cute_bevy".
cute_bevy = { package = "bevy" }
# File path to a folder with a wesl.toml. Simplest kind of dependency.
mylib = { path = "../mylib" }

Structs§

PackageConfig
Package configuration fields.
ScanResult
Result of scanning files, including any non-fatal warnings.
WeslToml
Parsed wesl.toml configuration.

Enums§

DependenciesConfig
The [dependencies] section of wesl.toml.
DependencySpec
A single dependency specification.
DependencySpecProxy
Intermediate data type for serialization / deserialization
PackageManager
ScanWarning
Warning emitted during file scanning (non-fatal).
WeslEdition

Functions§

scan_from_config
Scan files based on a WeslToml and build a Module hierarchy.