Compare commits

...

6 commits
v0.2.1 ... main

Author SHA1 Message Date
51508c818a
Add deprecation notice 2025-04-14 19:09:01 +02:00
322179ea13
Run fmt 2025-04-14 19:03:43 +02:00
5134624b06
Remove aide feat 2025-03-20 20:12:27 +01:00
2b24a6def1
Remove unneeded key 2025-03-20 19:22:52 +01:00
0158d7d7e0
Bump 2025-03-20 19:20:19 +01:00
560aa3d2af
Remove unneeded feature dependency 2025-03-09 23:13:14 +01:00
6 changed files with 16 additions and 9 deletions

4
Cargo.lock generated
View file

@ -101,7 +101,7 @@ dependencies = [
[[package]]
name = "axum-controller"
version = "0.2.1"
version = "0.2.2"
dependencies = [
"axum",
"axum-controller-macros",
@ -114,7 +114,7 @@ dependencies = [
[[package]]
name = "axum-controller-macros"
version = "0.2.1"
version = "0.2.2"
dependencies = [
"axum",
"prettyplease",

View file

@ -6,10 +6,10 @@ resolver = "3"
authors = ["Tristan Druyen <ek36g2vcc@mozmail.com>"]
categories = ["web-programming"]
description = "Helper macro's for better readability of axum handlers"
edition = "2024"
edition = "2021"
homepage = "https://git.vlt81.de/vault81/axum-controller"
keywords = ["axum", "controller", "macro", "routing"]
license = "AGPL-3.0-or-later"
readme = "README.md"
repository = "https://git.vlt81.de/vault81/axum-controller"
version = "0.2.1"
version = "0.3.0"

View file

@ -1,5 +1,11 @@
[![Crates.io](https://img.shields.io/crates/v/axum-controller)](https://crates.io/crates/axum-controller)
[![Documentation](https://docs.rs/axum-controller/badge.svg)](https://docs.rs/axum-controller)
![Maintenance](https://img.shields.io/badge/maintenance-deprecated-red.svg)
# DEPRECATED
This crate does not receive further development, it *might* work for your use case.
I've changed how I do routing & recommend checking out [axum-folder-router](https://crates.io/crates/axum-folder-router).
# Axum-Controller

View file

@ -2,9 +2,9 @@
use proc_macro::TokenStream;
use proc_macro2::Ident;
use syn::{
ItemImpl, MetaNameValue,
parse::{Parse, ParseStream},
punctuated::Punctuated,
ItemImpl, MetaNameValue,
};
#[macro_use]
extern crate quote;
@ -169,7 +169,7 @@ pub fn controller(attr: TokenStream, item: TokenStream) -> TokenStream {
// one where it's #state
let from_controller_into_router_impl = quote! {
impl #struct_name {
fn into_router(state: #state) -> axum::Router<#state> {
pub fn into_router(state: #state) -> axum::Router<#state> {
let __nested_router = axum::Router::new()
#(#route_calls)*
#(#middleware_calls)*

View file

@ -12,11 +12,12 @@ repository.workspace = true
version.workspace = true
[dependencies]
axum-controller-macros = { path = "../axum-controller-macros", version = "0.2.1" }
axum-typed-routing = { path = "../vendor/axum-typed-routing", version = "0.2.0", features = [ "aide"] }
axum-controller-macros = { path = "../axum-controller-macros", version = "0.3" }
axum-typed-routing = { path = "../vendor/axum-typed-routing", version = "0.2.0"}
[dev-dependencies]
axum = "0.8"
axum-typed-routing = { path = "../vendor/axum-typed-routing", version = "0.2", features = []}
axum-test = { version = "17", features = [] }
json = "0.12"
serde = { version = "1", features = ["derive"] }

View file

@ -15,5 +15,5 @@
//! ```
pub use axum_controller_macros::controller;
pub use axum_typed_routing::TypedRouter;
pub use axum_typed_routing::route;
pub use axum_typed_routing::TypedRouter;