Skip to content

Commit

Permalink
🐛 Fixed compatibility with axum 0.8 part 2 && bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
nwrenger committed Dec 20, 2024
1 parent 47cfd82 commit 17e5f2b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gluer"
version = "0.8.2"
version = "0.8.3"
edition = "2021"
authors = ["Nils Wrenger <[email protected]>"]
description = "A wrapper for Rust frameworks that eliminates redundant type and function definitions between the frontend and backend"
Expand All @@ -15,11 +15,11 @@ license = "MIT"
proc-macro = true

[dependencies]
quote = "1.0"
syn = { version = "2.0.62", features = ["full"] }
proc-macro2 = "1.0"
quote = "1.0.37"
syn = { version = "2.0.90", features = ["full"] }
proc-macro2 = "1.0.92"

[dev-dependencies]
axum = "0.7.5"
tokio = { version = "1.39.2", features = ["macros", "rt-multi-thread"] }
serde = { version = "1.0", features = ["derive"] }
axum = "0.7.9"
tokio = { version = "1.42.0", features = ["macros", "rt-multi-thread"] }
serde = { version = "1.0.216", features = ["derive"] }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
gluer = "0.8.2"
gluer = "0.8.3"
```

## Features
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ impl FnInfo {
url = url
.split("/")
.map(|part| {
if part.starts_with(":") {
if part.starts_with(':') || part.starts_with('{') {
i += 1;
format!("${{encodeURIComponent(pathTuple[{}])}}", i - 1)
} else {
Expand Down Expand Up @@ -1238,7 +1238,7 @@ impl<'a> ParsedTypeScript<'a> {
}

/// Creates the `ParsedTypeScript` struct with a few default stuff
fn filled(prefix: &'a str) -> ParsedTypeScript {
fn filled(prefix: &'a str) -> ParsedTypeScript<'a> {
let prefix = format!("const PREFIX = '{}';\n", prefix);
let basic_functions =
r#" async function fetch_api(endpoint: string, options: RequestInit): Promise<any> {
Expand Down
4 changes: 3 additions & 1 deletion tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ type S = String;
async fn main_test() {
let _app: Router<()> = generate! {
routes = { // required
// using the old syntax
"/:p" = get(fetch_root).post(add_root),
"/char/:path/metadata/:path" = get(get_alphabet),
// using the new syntax
"/char/{path}/metadata/{path}" = get(get_alphabet),
"/other" = get(fetch_other),
},
files = "tests", // Make sure to remove this when copying this example into a normal project
Expand Down

0 comments on commit 17e5f2b

Please sign in to comment.