Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove typescript v2 causing flaky tests #1985

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions bin/sozo/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ pub struct BuildArgs {
#[arg(help = "Generate Typescript bindings.")]
pub typescript: bool,

#[arg(long)]
#[arg(help = "Generate Typescript bindings.")]
pub typescript_v2: bool,

// #[arg(long)]
// #[arg(help = "Generate Typescript bindings.")]
// pub typescript_v2: bool,
#[arg(long)]
#[arg(help = "Generate Unity bindings.")]
pub unity: bool,
Expand All @@ -44,9 +43,9 @@ impl BuildArgs {
builtin_plugins.push(BuiltinPlugins::Typescript);
}

if self.typescript_v2 {
builtin_plugins.push(BuiltinPlugins::TypeScriptV2);
}
// if self.typescript_v2 {
// builtin_plugins.push(BuiltinPlugins::TypeScriptV2);
// }

if self.unity {
builtin_plugins.push(BuiltinPlugins::Unity);
Expand Down Expand Up @@ -131,7 +130,6 @@ mod tests {
bindings_output: "generated".to_string(),
typescript: true,
unity: true,
typescript_v2: true,
stats: true,
};
let result = build_args.run(&config);
Expand Down
4 changes: 2 additions & 2 deletions crates/dojo-bindgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use error::{BindgenResult, Error};

mod plugins;
use plugins::typescript::TypescriptPlugin;
use plugins::typescript_v2::TypeScriptV2Plugin;
// use plugins::typescript_v2::TypeScriptV2Plugin;
use plugins::unity::UnityPlugin;
use plugins::BuiltinPlugin;
pub use plugins::BuiltinPlugins;
Expand Down Expand Up @@ -86,7 +86,7 @@ impl PluginManager {
let builder: Box<dyn BuiltinPlugin> = match plugin {
BuiltinPlugins::Typescript => Box::new(TypescriptPlugin::new()),
BuiltinPlugins::Unity => Box::new(UnityPlugin::new()),
BuiltinPlugins::TypeScriptV2 => Box::new(TypeScriptV2Plugin::new()),
// BuiltinPlugins::TypeScriptV2 => Box::new(TypeScriptV2Plugin::new()),
};

let files = builder.generate_code(&data).await?;
Expand Down
4 changes: 2 additions & 2 deletions crates/dojo-bindgen/src/plugins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ pub mod unity;
pub enum BuiltinPlugins {
Typescript,
Unity,
TypeScriptV2,
// TypeScriptV2,
}

impl fmt::Display for BuiltinPlugins {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
BuiltinPlugins::Typescript => write!(f, "typescript"),
BuiltinPlugins::Unity => write!(f, "unity"),
BuiltinPlugins::TypeScriptV2 => write!(f, "typescript_v2"),
// BuiltinPlugins::TypeScriptV2 => write!(f, "typescript_v2"),
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use crate::{DojoContract, DojoData, DojoModel};
pub struct TypeScriptV2Plugin {}

impl TypeScriptV2Plugin {
pub fn new() -> Self {
Self {}
}
// pub fn new() -> Self {
// Self {}
// }

// Maps cairo types to TypeScript defined types
fn map_type(type_name: &str) -> String {
Expand Down
Loading