From e7f95ec7ead122573e509fb668c3bd4b719f1d7d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 15 Aug 2026 19:34:00 +0000 Subject: [PATCH] docs: fix CONTRIBUTING first-run path and rustapi-rs README Point Running Examples at crates/rustapi-rs/examples and golden_path. Refresh the crate map to match the current workspace. Rewrite the crates.io Quick Start to one English 0.2.0 install path. Fixes #258 Fixes #259 Co-authored-by: Tunay --- CONTRIBUTING.md | 27 ++++++++++++-------------- crates/rustapi-rs/README.md | 38 +++++-------------------------------- 2 files changed, 17 insertions(+), 48 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 59b0b15..bf82573 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,12 +93,14 @@ cargo build --workspace --release ### Running Examples +In-repo examples live under `crates/rustapi-rs/examples/`. Start with the golden path (see [docs/GOLDEN_PATH.md](docs/GOLDEN_PATH.md)): + ```bash -# Run a specific example -cargo run -p hello-world +# First run — handler → OpenAPI → probes +cargo run -p rustapi-rs --example golden_path -# List all examples -ls examples/ +# List in-repo examples +ls crates/rustapi-rs/examples/ ``` ## Making Changes @@ -398,6 +400,7 @@ Closes #456 RustAPI/ ├── crates/ │ ├── rustapi-rs/ # 🎯 Public-facing crate (re-exports) +│ │ └── examples/ # 📖 In-crate examples (start with golden_path) │ ├── rustapi-core/ # ⚙️ Core HTTP engine and routing │ ├── rustapi-macros/ # 🔧 Procedural macros (#[get], #[post], etc.) │ ├── rustapi-validate/ # ✅ Validation integration (validator crate) @@ -406,18 +409,12 @@ RustAPI/ │ ├── rustapi-toon/ # 🎨 TOON format support │ ├── rustapi-ws/ # 🔌 WebSocket support │ ├── rustapi-view/ # 🖼️ Template rendering (Tera) +│ ├── rustapi-testing/ # 🧪 Test client and fluent assertions +│ ├── rustapi-grpc/ # 📡 gRPC helpers (Tonic) +│ ├── rustapi-mcp/ # 🤖 Native MCP (expose routes as LLM tools) │ └── cargo-rustapi/ # 📦 CLI tool -├── examples/ # 📖 Example applications -│ ├── hello-world/ # Basic example -│ ├── crud-api/ # CRUD operations -│ ├── auth-api/ # Authentication -│ ├── sqlx-crud/ # Database integration -│ ├── websocket/ # WebSocket example -│ └── ... -├── benches/ # 🏃 Performance benchmarks ├── docs/ # 📝 Documentation -├── scripts/ # 🛠️ Build and publish scripts -└── memories/ # 🧠 Project memory/context +└── scripts/ # 🛠️ Build and publish scripts ``` ### Crate Dependencies @@ -441,7 +438,7 @@ rustapi-rs (public API) - **Adding validation** → `rustapi-validate` - **Adding OpenAPI features** → `rustapi-openapi` - **Adding optional features** → `rustapi-extras` -- **Adding examples** → `examples/` +- **Adding examples** → `crates/rustapi-rs/examples/` - **Adding tests** → relevant crate's `tests/` directory - **Adding docs** → `docs/` or inline rustdoc diff --git a/crates/rustapi-rs/README.md b/crates/rustapi-rs/README.md index 3207c44..cc5a576 100644 --- a/crates/rustapi-rs/README.md +++ b/crates/rustapi-rs/README.md @@ -44,50 +44,22 @@ Feature taxonomy on the facade: ## 📦 Quick Start -**Önerilen kullanım** (en temiz ve kısa makro isimleri için): - -```toml -[dependencies] -api = { package = "rustapi-rs", version = "0.2.0" } -``` - -Sonra kodunda: - -```rust -use api::prelude::*; - -#[api::get("/hello")] -async fn hello() -> &'static str { - "Hello from RustAPI!" -} - -#[api::main] -async fn main() -> Result<(), Box> { - api::RustApi::auto().run("127.0.0.1:8080").await -} -``` - -Eğer istersen direkt uzun isimle de kullanabilirsin: +Add `rustapi-rs` to your `Cargo.toml`: ```toml [dependencies] rustapi-rs = "0.2.0" ``` -```rust -use rustapi_rs::prelude::*; - -#[rustapi_rs::get("/hello")] -... -``` - -Add `rustapi-rs` to your `Cargo.toml` (kısa isim için alias önerilir): +You can also rename the crate if you prefer shorter macro paths: ```toml [dependencies] -rustapi-rs = { version = "0.1", features = ["full"] } +api = { package = "rustapi-rs", version = "0.2.0" } ``` +Route macros work through that alias (`#[api::get("/")]`, `use api::prelude::*`). + ### The "Hello World" ```rust