File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ use crate::style::print_green_bold;
77
88use anyhow:: { Context , Error , Result } ;
99use mopro_ffi:: app_config:: constants:: { REACT_NATIVE_APP_DIR , REACT_NATIVE_BINDINGS_DIR } ;
10- use mopro_ffi:: app_config:: react_native:: { patch_gradle_properties_architectures, remove_unrequested_wasm_stubs} ;
10+ use mopro_ffi:: app_config:: react_native:: {
11+ patch_gradle_properties_architectures, remove_unrequested_wasm_stubs,
12+ } ;
1113use std:: { fs, path:: PathBuf } ;
1214
1315pub struct ReactNative ;
Original file line number Diff line number Diff line change @@ -319,23 +319,22 @@ pub fn patch_gradle_properties_architectures(
319319 Ok ( ( ) )
320320}
321321
322-
323322/// Remove leftover WASM scaffolding that `uniffi-bindgen-react-native generate all`
324323/// writes into the React Native bindings dir (`src/index.web.ts` and `rust_modules/wasm/`).
325- ///
324+ ///
326325/// Mopro's React Native path only targets iOS/Android. `generate all` with no
327326/// platform still emits ubrn's web templates, but never runs wasm-pack, so
328327/// `src/generated/wasm-bindgen/` is missing. Left in place, `src/index.web.ts`
329328/// is a dangling import and `bob build` / `tsc` fails.
330- pub fn remove_unrequested_wasm_stubs ( bindings_dir : & Path ) -> anyhow:: Result < ( ) > {
329+ pub fn remove_unrequested_wasm_stubs ( bindings_dir : & Path ) -> anyhow:: Result < ( ) > {
331330 let index_web_file = bindings_dir. join ( "src" ) . join ( "index.web.ts" ) ;
332331 if index_web_file. exists ( ) {
333332 fs:: remove_file ( & index_web_file) ?;
334333 }
335-
334+
336335 let wasm_crate = bindings_dir. join ( "rust_modules" ) . join ( "wasm" ) ;
337336 if wasm_crate. exists ( ) {
338337 fs:: remove_dir_all ( & wasm_crate) ?;
339338 }
340339 Ok ( ( ) )
341- }
340+ }
You can’t perform that action at this time.
0 commit comments