Skip to content

Commit

Permalink
fix: disable and comment typescript v2
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed May 19, 2024
1 parent 27f04fe commit 6330ec2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
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: false,
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

0 comments on commit 6330ec2

Please sign in to comment.