@@ -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;
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 ;
@@ -39,7 +41,7 @@ impl Create for ReactNative {
3941 react_native_bindings_dir. as_ref ( ) . unwrap ( ) ,
4042 & mopro_module_dir,
4143 ) ?;
42- remove_stale_web_entrypoint ( & mopro_module_dir) ?;
44+ remove_unrequested_wasm_stubs ( & mopro_module_dir) ?;
4345
4446 let assets_dir = target_dir. join ( "assets/keys" ) ;
4547 fs:: remove_dir_all ( & assets_dir) ?;
@@ -87,19 +89,3 @@ impl Create for ReactNative {
8789 print_footer_message ( ) ;
8890 }
8991}
90-
91- /// The downloaded `zkmopro/react-native-app` scaffold ships a static
92- /// `src/index.web.ts` (for optional web/wasm support) that imports from
93- /// `./generated/wasm-bindgen/index.js` and `index_bg.wasm`. `mopro build` never
94- /// generates that `generated/wasm-bindgen` directory — React Native builds only
95- /// target iOS/Android — so the file is always a dangling reference. Since
96- /// `copy_dir` only overwrites files present in the built bindings dir, it can't
97- /// remove this pre-existing one; left in place, it breaks `npm install`'s
98- /// `prepare: bob build` step (`tsc` fails to resolve the missing module).
99- fn remove_stale_web_entrypoint ( mopro_module_dir : & std:: path:: Path ) -> Result < ( ) > {
100- let index_web_ts = mopro_module_dir. join ( "src" ) . join ( "index.web.ts" ) ;
101- if index_web_ts. exists ( ) {
102- fs:: remove_file ( & index_web_ts) ?;
103- }
104- Ok ( ( ) )
105- }
0 commit comments