diff --git a/js/packages/quary-extension/package.json b/js/packages/quary-extension/package.json index 00a1c0da..4003fac0 100644 --- a/js/packages/quary-extension/package.json +++ b/js/packages/quary-extension/package.json @@ -197,7 +197,7 @@ "package-web": "webpack --config webpack.web.config.js --mode production --devtool hidden-source-map --env STAGE=production", "package-node": "webpack --config webpack.node.config.js --mode production --devtool hidden-source-map --env STAGE=production", "lint": "eslint src --ext ts", - "run-in-browser": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=. ../../../../analytics" + "run-in-browser": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=. ../../../rust/core/src/init" }, "devDependencies": { "@quary/eslint-config-shared": "workspace:*", diff --git a/rust/wasm-binding/src/rpc_proto_defined_functions.rs b/rust/wasm-binding/src/rpc_proto_defined_functions.rs index 198ca8d0..c8c63d2e 100644 --- a/rust/wasm-binding/src/rpc_proto_defined_functions.rs +++ b/rust/wasm-binding/src/rpc_proto_defined_functions.rs @@ -222,9 +222,19 @@ async fn create_model_schema_entry_internal( path.push(model.file_path.as_str()); path.pop(); + let mut path = PathBuf::from(&project_root); + path.push(model.file_path.as_str()); + let file = path.file_stem().ok_or("Failed to get file stem")?; + // Make the schema.yaml file be in there - let mut schema_path = path.clone(); - schema_path.push("schema.yaml"); + let mut schema_path = PathBuf::from(&project_root); + schema_path.push(model.file_path.as_str()); + schema_path.pop(); + schema_path.push(format!( + "{}.yaml", + file.to_str() + .ok_or("Failed to convert file stem to string")? + )); let string_schema_path = schema_path .to_str() .ok_or("Failed to convert path to string")? @@ -1943,7 +1953,7 @@ models: .unwrap(); let binding = written_files.borrow(); - let updated_content = binding.get(&"models/schema.yaml".to_string()).unwrap(); + let updated_content = binding.get(&"models/shifts.yaml".to_string()).unwrap(); assert_eq!( updated_content, @@ -1976,11 +1986,7 @@ models: "models/schema.yaml".to_string(), quary_proto::File { name: "models/schema.yaml".to_string(), - contents: prost::bytes::Bytes::from( - " - models: - ", - ), + contents: prost::bytes::Bytes::from(""), }, ), ] @@ -1999,7 +2005,7 @@ models: .unwrap(); let binding = written_files.borrow(); - let updated_content = binding.get(&"models/schema.yaml".to_string()).unwrap(); + let updated_content = binding.get(&"models/shifts.yaml".to_string()).unwrap(); assert_eq!( updated_content,