| Crates.io | fabricatio-constants |
| lib.rs | fabricatio-constants |
| version | 0.2.4 |
| created_at | 2025-05-24 09:35:07.883385+00 |
| updated_at | 2025-12-25 13:51:08.326355+00 |
| description | Constants for the fabricatio. |
| homepage | |
| repository | https://github.com/Whth/fabricatio |
| max_upload_size | |
| id | 1687236 |
| size | 14,257 |
A foundational constants crate for the Fabricatio ecosystem, providing application-wide constants, paths, and configuration variables.
This crate centralizes all constants used across the Fabricatio project, including application names, configuration file paths, directory locations, and environment variable names. It ensures consistency and provides a single source of truth for these values.
The crate automatically detects the user's operating system and provides appropriate paths:
| Platform | Config Directory | Example |
|---|---|---|
| Linux | $XDG_CONFIG_HOME or $HOME/.config |
/home/alice/.config/fabricatio |
| macOS | $HOME/Library/Application Support |
/Users/Alice/Library/Application Support/fabricatio |
| Windows | {FOLDERID_RoamingAppData} |
C:\Users\Alice\AppData\Roaming\fabricatio |
NAME: Application name ("fabricatio")CORE_PACKAGE_NAME: Core package name ("fabricatio_core")REPO_OWNER: GitHub repository owner ("Whth")REPO_NAME: Repository name (same as NAME)CONFIG_FILE: Default configuration filename ("fabricatio.toml")TEMPLATES_DIRNAME: Templates directory name ("templates")ROAMING: Global roaming configuration directoryTEMPLATES: Templates directory within roaming configGLOBAL_CONFIG_FILE: Full path to global configuration fileLOGGER_VARNAME: Logger configuration variable name ("logger")CONFIG_VARNAME: Configuration variable name ("CONFIG")PY_SOURCE_KEY: Python source code path key ("py_source")use fabricatio_constants::{NAME, ROAMING, GLOBAL_CONFIG_FILE};
fn main() {
println!("Application: {}", NAME);
println!("Config directory: {:?}", ROAMING);
println!("Config file: {:?}", GLOBAL_CONFIG_FILE);
}
once_cell: For global static lazy initializationdirectories-next: Cross-platform directory configurationThis crate is part of the Fabricatio project and follows the same licensing terms.