diff --git a/CHANGELOG.md b/CHANGELOG.md index e08180e..5708868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- ## [Unreleased] +## v1.20.1 — Improved CLI Error UX & Build Feedback + +### ✨ CLI — Error reporting & diagnostics +- Introduce **Python-like compiler error rendering** with code frames + `(file:line:column + surrounding context)` +- Highlight **only the faulty line** with a red caret (`^`) for instant readability +- Safely truncate very long lines with **UTF-8–aware ellipsis** +- Add **precise, Vix-style hints** for common mistakes + (e.g. `Response::json()` misuse) +- Hide verbose alternative diagnostics unless log level is `debug` or `trace` +- Improve `run` / script error reporting for clearer, actionable diagnostics + +### 🔨 CLI — Build output & Ninja integration +- Restore **live Ninja progress output** (`[x/y %]`) during builds +- Filter noisy compiler command output in live mode +- Keep **full raw build logs** in `build.log` for post-mortem diagnostics +- Let `ErrorHandler` display **structured, human-readable errors** on failure +- Introduce **progress-only build output mode** +- Fix unused variables and header warnings in build pipeline + +### 🧩 Internal +- Minor internal cleanups to support improved error UX +- No breaking changes + + ## v1.20.0 — Modules, Registry & Dependency Workflow (Latest) ### ✨ Nouveautés majeures diff --git a/examples/hello_routes.cpp b/examples/hello_routes.cpp index 35a20f2..c2740ec 100644 --- a/examples/hello_routes.cpp +++ b/examples/hello_routes.cpp @@ -37,7 +37,7 @@ int main() // Example with path param app.get("/users/{id}", [](Request &, Response &res) - { res.status(4040).json({"error", "User not found"}); }); + { res.status(404).json({"error", "User not found"}); }); app.get("/hello", [](const Request &, Response &res) { diff --git a/examples/http/router_params.cpp b/examples/http/router_params.cpp index 0633c32..2e55104 100644 --- a/examples/http/router_params.cpp +++ b/examples/http/router_params.cpp @@ -38,20 +38,20 @@ int main() // Example: // GET /posts/2025/hello-world // - app.get("/posts", [](Request &req, Response &res) + app.get("/posts/{year}/{slug}", [](Request &req, Response &res) { - const auto year = req.query_value("year"); - const auto slug = req.query_value("slug"); - - res.json(json::kv({ - {"year", year}, - {"slug", slug}, - {"title", "Post: " + slug}, - {"message", "This is an example route with multiple params."}, - {"powered_by", "Vix.cpp"}, - {"params", req.params()}, - {"query", req.query()} - })); }); + const auto year = req.param("year"); + const auto slug = req.param("slug"); + + res.json(json::kv({ + {"year", year}, + {"slug", slug}, + {"title", "Post: " + slug}, + {"message", "This is an example route with multiple params."}, + {"powered_by", "Vix.cpp"}, + {"params", req.params()}, + {"query", req.query()} + })); }); // Optional: a root route for discoverability app.get("/", [](Request &, Response &res) @@ -59,5 +59,4 @@ int main() "hint", "Try GET /hello/Alice or /posts/2025/hello-world"}); }); app.run(8080); - return 0; } diff --git a/modules/cli b/modules/cli index 8356c52..88b72fe 160000 --- a/modules/cli +++ b/modules/cli @@ -1 +1 @@ -Subproject commit 8356c52c79a14ebd490b9f75be227c18213c6dc2 +Subproject commit 88b72fe6d1c50ea9e6ab36856c8d02c8b403cc88 diff --git a/modules/core b/modules/core index cb37164..1740475 160000 --- a/modules/core +++ b/modules/core @@ -1 +1 @@ -Subproject commit cb37164d311259f61e25c5edd16fadbfe826c8cb +Subproject commit 17404752674c8006acd0a2d509051b9115108331 diff --git a/modules/utils b/modules/utils index d123f0e..69a2cb4 160000 --- a/modules/utils +++ b/modules/utils @@ -1 +1 @@ -Subproject commit d123f0ed9f73c3434d67438967979db440c28283 +Subproject commit 69a2cb4efab39781f6f4ed4de5ee9cdc498dd49b