@@ -131,90 +131,41 @@ your-project/
131131
132132---
133133
134- ## 🎭 Advanced Features
134+ ## 🔧 Optional Features
135135
136- ` workspace_tools ` is packed with powerful, optional features. Enable them in your ` Cargo.toml ` as needed.
136+ Enable additional functionality as needed in your ` Cargo.toml ` :
137137
138- <details >
139- <summary ><strong >🔧 Seamless Serde Integration (`serde_integration`)</strong ></summary >
140-
141- Eliminate boilerplate for loading ` .toml ` , ` .json ` , and ` .yaml ` files.
142-
143- ** Enable:** ` cargo add serde ` and add ` workspace_tools = { workspace = true, features = ["serde_integration"] } ` to ` Cargo.toml ` .
138+ ** Serde Integration** (` serde ` ) - * enabled by default*
139+ Load ` .toml ` , ` .json ` , and ` .yaml ` files directly into structs.
144140
145141``` rust
146- use serde :: Deserialize ;
147- use workspace_tools :: workspace;
148-
149142#[ derive( Deserialize ) ]
150- struct AppConfig
151- {
152- name : String ,
153- port : u16 ,
154- }
155-
156- let ws = workspace ()? ;
157-
158- // Automatically finds and parses `config/app.{toml,yaml,json}`.
159- let config : AppConfig = ws . load_config ( " app" )? ;
160- println! ( " Running '{}' on port {}" , config . name, config . port );
143+ struct AppConfig { name : String , port : u16 }
161144
162- // Load and merge multiple layers (e.g., base + production).
163- let final_config : AppConfig = ws . load_config_layered ( & [ " base" , " production" ] )? ;
164-
165- // Partially update a configuration file on disk.
166- let updates = serde_json :: json! ( { " port" : 9090 } );
167- let updated_config : AppConfig = ws . update_config ( " app" , updates )? ;
145+ let config : AppConfig = workspace ()? . load_config ( " app" )? ;
168146```
169147
170- </details >
171-
172- <details >
173- <summary ><strong >🔍 Powerful Resource Discovery (`glob`)</strong ></summary >
174-
175- Find files anywhere in your workspace using glob patterns.
176-
177- ** Enable:** Add ` workspace_tools = { workspace = true, features = ["glob"] } ` to ` Cargo.toml ` .
148+ ** Resource Discovery** (` glob ` )
149+ Find files with glob patterns like ` src/**/*.rs ` .
178150
179151``` rust
180- use workspace_tools :: workspace;
181-
182- let ws = workspace ()? ;
183-
184- // Find all Rust source files recursively.
185- let rust_files = ws . find_resources ( " src/**/*.rs" )? ;
186-
187- // Intelligently find a config file, trying multiple extensions.
188- let db_config = ws . find_config ( " database" )? ; // Finds config/database.toml, .yaml, etc.
152+ let rust_files = workspace ()? . find_resources ( " src/**/*.rs" )? ;
189153```
190154
191- </details >
192-
193- <details >
194- <summary ><strong >🔒 Secure Secret Management (`secret_management`)</strong ></summary >
195-
196- Load secrets from files in a dedicated, git-ignored ` .secret/ ` directory, with fallbacks to environment variables.
197-
198- ** Enable:** Add ` workspace_tools = { workspace = true, features = ["secret_management"] } ` to ` Cargo.toml ` .
199-
200- ```
201- // .gitignore
202- .*
203- // .secret/-secrets.sh
204- API_KEY="your-super-secret-key"
205- ```
155+ ** Secret Management** (` secrets ` )
156+ Load secrets from ` .secret/ ` directory with environment fallbacks.
206157
207158``` rust
208- use workspace_tools :: workspace;
159+ let api_key = workspace ()? . load_secret_key ( " API_KEY" , " -secrets.sh" )? ;
160+ ```
209161
210- let ws = workspace ()? ;
162+ ** Config Validation** (` validation ` )
163+ Schema-based validation for configuration files.
211164
212- // Loads API_KEY from .secret/-secrets.sh, or falls back to the environment.
213- let api_key = ws . load_secret_key ( " API_KEY " , " -secrets.sh " )? ;
165+ ``` rust
166+ let config : AppConfig = workspace () ? . load_config_with_validation ( " app " )? ;
214167```
215168
216- </details >
217-
218169---
219170
220171## 🛠️ Built for the Real World
@@ -286,15 +237,6 @@ graph TD
286237
287238---
288239
289- ## 🚧 Vision & Roadmap
290-
291- ` workspace_tools ` is actively developed. Our vision is to make workspace management a solved problem in Rust. Upcoming features include:
292-
293- * ** Project Scaffolding** : A powerful ` cargo workspace-tools init ` command to create new projects from templates.
294- * ** Configuration Validation** : Schema-based validation to catch config errors before they cause panics.
295- * ** Async & Hot-Reloading** : Full ` tokio ` integration for non-blocking file operations and live configuration reloads.
296- * ** Official CLI Tool** : A ` cargo workspace-tools ` command for managing your workspace from the terminal.
297- * ** IDE Integration** : Rich support for VS Code and RustRover to bring workspace-awareness directly into your editor.
298240
299241## 🤝 Contributing
300242
0 commit comments