From 83b95413a40bb521e8faefb7e11252e7c3d6ac3c Mon Sep 17 00:00:00 2001 From: Moritz Bischof Date: Fri, 16 Feb 2024 11:10:06 +0100 Subject: [PATCH] fix TS_RS_EXPORT_DIR --- ts-rs/src/export.rs | 3 ++- ts-rs/src/lib.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ts-rs/src/export.rs b/ts-rs/src/export.rs index 724129b..8bf1e89 100644 --- a/ts-rs/src/export.rs +++ b/ts-rs/src/export.rs @@ -146,7 +146,8 @@ pub mod __private { pub fn get_export_to_path() -> Option { provided_default_dir().map_or_else( || T::EXPORT_TO.map(ToString::to_string), - |path| Some(format!("{path}/{}.ts", T::name())), + // TODO: maybe introduce T::NAME or T::ident() or something in that vein + |path| Some(format!("{path}/{}.ts", T::name().split('<').next().unwrap())), ) } } diff --git a/ts-rs/src/lib.rs b/ts-rs/src/lib.rs index 2fb0301..3553e0c 100644 --- a/ts-rs/src/lib.rs +++ b/ts-rs/src/lib.rs @@ -410,6 +410,7 @@ impl Dependency { let exported_to = T::get_export_to()?; Some(Dependency { type_id: TypeId::of::(), + // TODO: maybe introduce T::NAME or T::ident() or something in that vein ts_name: T::name().split('<').next().unwrap().to_owned(), exported_to, })