Skip to content

Commit 44b7096

Browse files
authored
Update ts-rs dependency from ^11.0.1 to ^12.0.1 (#115)
2 parents 057c486 + 18a44bd commit 44b7096

5 files changed

Lines changed: 26 additions & 13 deletions

File tree

Cargo.lock

Lines changed: 15 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ serde = { version = "1.0.219", features = ["derive"] }
2828
serde_json = "1.0.140"
2929
tokio = { version = "1.44", features = ["rt", "rt-multi-thread"] }
3030
tower = { version = "0.5", features = ["util"] }
31-
ts-rs = { version = "11.0.1", features = [
31+
ts-rs = { version = "12.0.1", features = [
3232
"serde-compat",
3333
], default-features = false }
3434
qubit-macros = { version = "1.0.0-beta.0", path = "./crates/qubit-macros" }
@@ -42,8 +42,6 @@ thiserror = "2.0.12"
4242

4343
[features]
4444
ts-format = ["ts-rs/format"]
45-
ts-esm = ["ts-rs/import-esm"]
46-
4745
ts-serde-json = ["ts-rs/serde-json-impl"]
4846
ts-chrono = ["ts-rs/chrono-impl"]
4947
ts-bigdecimal = ["ts-rs/bigdecimal-impl"]

src/handler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ mod test {
557557
expected_params.into_iter().collect::<Vec<_>>()
558558
);
559559
assert_eq!(
560-
<<H::Response as ResponseValue<_>>::Value as TS>::name(),
560+
<<H::Response as ResponseValue<_>>::Value as TS>::name(&ts_rs::Config::default()),
561561
expected_return
562562
);
563563
}

src/handler/ts.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Utilities for representing TypeScript types at runtime.
22
3+
#[cfg(test)]
4+
use ts_rs::Config;
35
use ts_rs::{TS, TypeVisitor};
46

57
/// Tuple of [`TS`] types.
@@ -58,8 +60,10 @@ mod test {
5860

5961
impl TypeVisitor for TypeCollector {
6062
fn visit<T: TS + 'static + ?Sized>(&mut self) {
61-
self.0
62-
.push((T::name(), T::output_path().map(|_| T::decl())));
63+
self.0.push((
64+
T::name(&Config::default()),
65+
T::output_path().map(|_| T::decl(&Config::default())),
66+
));
6367
}
6468
}
6569

src/reflection/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use std::fmt::Display;
44

5-
use ts_rs::TS;
5+
use ts_rs::{Config, TS};
66

77
#[derive(Clone, Debug, PartialEq, Eq)]
88
pub struct CodegenType {
@@ -14,7 +14,7 @@ impl CodegenType {
1414
pub fn from_type_with_definition<T: TS + 'static + ?Sized>() -> (Self, String) {
1515
// Generate the declaration, which includes `type ... =`, and any generic
1616
// parameters.
17-
let declaration = T::decl();
17+
let declaration = T::decl(&Config::default());
1818

1919
// Split the declaration into the name and definition.
2020
let (name, definition) = declaration.split_once("=").expect("valid TS declaration");
@@ -28,7 +28,7 @@ impl CodegenType {
2828
}
2929

3030
pub fn from_type<T: TS + 'static + ?Sized>() -> Self {
31-
Self::from_name_and_generics(T::name())
31+
Self::from_name_and_generics(T::name(&Config::default()))
3232
}
3333

3434
fn from_name_and_generics(s: impl AsRef<str>) -> Self {

0 commit comments

Comments
 (0)