diff --git a/src/bin.rs b/src/bin.rs index 4cc0aa1c..a0c87fb8 100644 --- a/src/bin.rs +++ b/src/bin.rs @@ -34,7 +34,7 @@ use core::Config; use pathext::canonicalish; use project::{Project, ProjectLoadError}; use plugin::{PluginChain}; -use plugins::{DefaultPlugin, ScriptPlugin}; +use plugins::{DefaultPlugin, JsonModelPlugin, ScriptPlugin}; use vfs::Vfs; use vfs_watch::VfsWatcher; @@ -153,6 +153,7 @@ fn main() { lazy_static! { static ref PLUGIN_CHAIN: PluginChain = PluginChain::new(vec![ Box::new(ScriptPlugin::new()), + Box::new(JsonModelPlugin::new()), Box::new(DefaultPlugin::new()), ]); } diff --git a/src/plugins/json_model_plugin.rs b/src/plugins/json_model_plugin.rs index 137560c8..c4d6eb74 100644 --- a/src/plugins/json_model_plugin.rs +++ b/src/plugins/json_model_plugin.rs @@ -29,7 +29,11 @@ impl Plugin for JsonModelPlugin { let mut rbx_item: RbxItem = match serde_json::from_str(contents) { Ok(v) => v, - Err(_) => return TransformFileResult::Pass, // This should be an error in the future + Err(_) => { + eprintln!("Unable to parse JSON Model File named {}", name); + + return TransformFileResult::Pass; // This should be an error in the future! + }, }; rbx_item.properties.insert("Name".to_string(), RbxValue::String { diff --git a/test-project/src/hello.model.json b/test-project/src/hello.model.json new file mode 100644 index 00000000..3f3b8077 --- /dev/null +++ b/test-project/src/hello.model.json @@ -0,0 +1,24 @@ +{ + "name": "hello", + "className": "Model", + "children": [ + { + "name": "Some Part", + "className": "Part", + "children": [], + "properties": {} + }, + { + "name": "Some StringValue", + "className": "StringValue", + "children": [], + "properties": { + "Value": { + "type": "string", + "value": "Hello, world!" + } + } + } + ], + "properties": {} +} \ No newline at end of file