diff --git a/wasm-rpc-stubgen/src/commands/app.rs b/wasm-rpc-stubgen/src/commands/app.rs index 4c95d92..1897dcc 100644 --- a/wasm-rpc-stubgen/src/commands/app.rs +++ b/wasm-rpc-stubgen/src/commands/app.rs @@ -390,7 +390,7 @@ async fn link_rpc( let _indent = LogIndent::new(); for component_name in ctx.application.component_names() { - let source = ctx.application.component_source_dir(component_name); + let source = ctx.application.component_source(component_name); let dependencies = ctx .application .component_wasm_rpc_dependencies(component_name); diff --git a/wasm-rpc-stubgen/src/model/app.rs b/wasm-rpc-stubgen/src/model/app.rs index d85cf52..844d531 100644 --- a/wasm-rpc-stubgen/src/model/app.rs +++ b/wasm-rpc-stubgen/src/model/app.rs @@ -873,6 +873,10 @@ impl Application { .unwrap_or_else(|| panic!("Component not found: {}", component_name)) } + pub fn component_source(&self, component_name: &ComponentName) -> &Path { + &self.component(component_name).source + } + pub fn component_source_dir(&self, component_name: &ComponentName) -> &Path { self.component(component_name).source_dir() } diff --git a/wasm-rpc-stubgen/src/wit_resolve.rs b/wasm-rpc-stubgen/src/wit_resolve.rs index acf5987..a528506 100644 --- a/wasm-rpc-stubgen/src/wit_resolve.rs +++ b/wasm-rpc-stubgen/src/wit_resolve.rs @@ -422,9 +422,7 @@ impl ResolvedWitApplication { { validation.push_context( "source", - app.component_source_dir(component_name) - .to_string_lossy() - .to_string(), + app.component_source(component_name).display().to_string(), ); }