mirror of
https://github.com/xazukx/ts-rs.git
synced 2026-11-14 21:50:25 +00:00
use stupidly large types in E2E test - maybe it fails on CI?
This commit is contained in:
@@ -2,5 +2,5 @@ use ts_rs::TS;
|
||||
|
||||
#[derive(TS)]
|
||||
pub struct Crate1 {
|
||||
pub x: i32
|
||||
pub x: [[[i32; 128]; 128]; 128],
|
||||
}
|
||||
@@ -2,5 +2,5 @@ use ts_rs::TS;
|
||||
|
||||
#[derive(TS)]
|
||||
pub struct Crate2 {
|
||||
pub x: i32
|
||||
pub x: [[[i32; 128]; 128]; 128],
|
||||
}
|
||||
|
||||
@@ -12,3 +12,87 @@ pub struct Parent {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent2 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent3 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent4 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent5 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent6 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent7 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent8 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent9 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent10 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent11 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent12 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent13 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent14 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
#[derive(TS)]
|
||||
#[ts(export)]
|
||||
pub struct Parent15 {
|
||||
pub crate1: Crate1,
|
||||
pub crate2: Crate2,
|
||||
}
|
||||
|
||||
+2
-1
@@ -31,6 +31,7 @@ pub enum ExportError {
|
||||
|
||||
/// Exports `T` to the file specified by the `#[ts(export_to = ..)]` attribute.
|
||||
/// Additionally, all dependencies of `T` will be exported as well.
|
||||
///
|
||||
/// TODO: This might cause a race condition:
|
||||
/// If two types `A` and `B` are `#[ts(export)]` and depend on type `C`,
|
||||
/// then both tests for exporting `A` and `B` will try to write `C` to `C.ts`.
|
||||
@@ -133,7 +134,7 @@ fn generate_decl<T: TS + ?Sized>(out: &mut String) {
|
||||
/// Push an import statement for all dependencies of `T`
|
||||
fn generate_imports<T: TS + ?Sized + 'static>(out: &mut String) -> Result<(), ExportError> {
|
||||
let path =
|
||||
Path::new(T::EXPORT_TO.ok_or(ExportError::CannotBeExported(std::any::type_name::<T>()))?);
|
||||
Path::new(T::EXPORT_TO.ok_or(CannotBeExported(std::any::type_name::<T>()))?);
|
||||
|
||||
let deps = T::dependencies();
|
||||
let deduplicated_deps = deps
|
||||
|
||||
Reference in New Issue
Block a user