@@ -252,30 +252,32 @@ pub fn componentize_bindgen(
252252 let iface_prefix = interface_name ( resolve, * iface_id)
253253 . map ( |s| format ! ( "{s}$" ) )
254254 . unwrap_or_else ( String :: new) ;
255- let resource_name = ty. name . as_ref ( ) . unwrap ( ) . to_lower_camel_case ( ) ;
255+ let resource_name_camel = ty. name . as_ref ( ) . unwrap ( ) . to_lower_camel_case ( ) ;
256+ let resource_name_kebab = ty. name . as_ref ( ) . unwrap ( ) . to_kebab_case ( ) ;
256257 let module_name = format ! ( "[export]{key_name}" ) ;
257- resource_bindings. push ( format ! ( "{iface_prefix}new${resource_name }" ) ) ;
258+ resource_bindings. push ( format ! ( "{iface_prefix}new${resource_name_camel }" ) ) ;
258259 resource_imports. push ( (
259260 module_name. clone ( ) ,
260- format ! ( "[resource-new]{resource_name }" ) ,
261+ format ! ( "[resource-new]{resource_name_kebab }" ) ,
261262 1 ,
262263 ) ) ;
263- resource_bindings. push ( format ! ( "{iface_prefix}rep${resource_name }" ) ) ;
264+ resource_bindings. push ( format ! ( "{iface_prefix}rep${resource_name_camel }" ) ) ;
264265 resource_imports. push ( (
265266 module_name. clone ( ) ,
266- format ! ( "[resource-rep]{resource_name }" ) ,
267+ format ! ( "[resource-rep]{resource_name_kebab }" ) ,
267268 1 ,
268269 ) ) ;
269- resource_bindings. push ( format ! ( "export${iface_prefix}drop${resource_name}" ) ) ;
270+ resource_bindings
271+ . push ( format ! ( "export${iface_prefix}drop${resource_name_camel}" ) ) ;
270272 resource_imports. push ( (
271273 module_name. clone ( ) ,
272- format ! ( "[resource-drop]{resource_name }" ) ,
274+ format ! ( "[resource-drop]{resource_name_kebab }" ) ,
273275 0 ,
274276 ) ) ;
275277 finalization_registries. push ( format ! (
276- "const finalizationRegistry_export${iface_prefix}{resource_name } = \
278+ "const finalizationRegistry_export${iface_prefix}{resource_name_camel } = \
277279 new FinalizationRegistry((handle) => {{
278- $resource_export${iface_prefix}drop${resource_name }(handle);
280+ $resource_export${iface_prefix}drop${resource_name_camel }(handle);
279281 }});
280282 "
281283 ) ) ;
@@ -312,6 +314,7 @@ pub fn componentize_bindgen(
312314 let resource_name = ty. name . as_deref ( ) . unwrap ( ) ;
313315 let prefix = prefix. as_deref ( ) . unwrap_or ( "" ) ;
314316 let resource_name_camel = resource_name. to_lower_camel_case ( ) ;
317+ let resource_name_kebab = resource_name. to_kebab_case ( ) ;
315318
316319 finalization_registries. push ( format ! (
317320 "const finalizationRegistry_import${prefix}{resource_name_camel} = \
@@ -323,7 +326,7 @@ pub fn componentize_bindgen(
323326 resource_bindings. push ( format ! ( "import${prefix}drop${resource_name_camel}" ) ) ;
324327 resource_imports. push ( (
325328 imported_resource_modules. get ( & id) . unwrap ( ) . clone ( ) ,
326- format ! ( "[resource-drop]{resource_name }" ) ,
329+ format ! ( "[resource-drop]{resource_name_kebab }" ) ,
327330 0 ,
328331 ) ) ;
329332 }
0 commit comments