Skip to content

Refactor: Migrate to Expo Bare Workflow and Introduce src/ Architecture - #104

Open
kapildadhich075 wants to merge 43 commits into
CypherCommons:masterfrom
kapildadhich075:project-migration
Open

Refactor: Migrate to Expo Bare Workflow and Introduce src/ Architecture#104
kapildadhich075 wants to merge 43 commits into
CypherCommons:masterfrom
kapildadhich075:project-migration

Conversation

@kapildadhich075

@kapildadhich075 kapildadhich075 commented May 14, 2026

Copy link
Copy Markdown

Overview

This PR modernizes the Shroud Wallet codebase by migrating the project to Expo Bare Workflow (SDK 55) and restructuring the repository around a centralized src/ directory.

The branch is fully synced with the latest upstream/master changes and includes all required merge conflict resolutions.


Expo SDK 55 Migration

  • Migrated the project to Expo Bare Workflow using expo-dev-client
  • Added EAS build support via eas.json
  • Replaced several legacy native dependencies with Expo-supported modules

Examples include:

  • expo-file-system
  • expo-notifications
  • expo-image-picker
  • expo-haptics
  • expo-clipboard

This improves native stability, simplifies future upgrades, and enables cloud builds through EAS.


Repository Restructure

All application source code has been consolidated into a dedicated src/ directory.

Moved modules include:

  • components
  • navigation
  • screens
  • modules
  • helpers
  • utils
  • tests
  • img
  • localization and typings

Additional cleanup:

  • Renamed screen/screens/
  • Moved misplaced root-level files into proper directories
  • Updated relative imports across the project

This significantly reduces root-level clutter and improves project navigation.


Native & Build System Updates

  • Updated iOS native configuration for Expo module initialization
  • Resolved linker/build issues related to Expo integration
  • Preserved compatibility with the custom rust_jsi_bridge
  • Validated native module compilation across iOS and Android

Tooling & Configuration

Updated configuration and tooling to support the new structure:

  • metro.config.js
  • tsconfig.json
  • jest.config.js
  • .detoxrc.json

Testing and utility scripts were also updated accordingly.


Local Setup Requirements

Because the project uses a custom Rust-based JSI bridge (rust_jsi_bridge), fresh clones require rebuilding the native Rust binaries before running iOS setup or native builds.

Recommended setup flow:

npm install
npm run rust:rebuild
cd ios && pod install && cd ..
npx expo start -c

This generates the required Rust native artifacts locally and ensures CocoaPods can correctly link the generated frameworks.

The compiled Rust binaries are intentionally excluded from Git:

  • ios/RustJsiBridge.xcframework/
  • android/app/src/main/jniLibs/

Important for Reviewers

Because of the repository restructure, Metro may cache outdated file paths.

After pulling the branch:

npx expo start -c

This clears Metro cache and rebuilds module resolution paths based on the new structure.


Validation Checklist

  • iOS Simulator build verified
  • Android build verified
  • Rust JSI modules compile successfully
  • Synced with latest upstream/master
  • Testing paths updated for new structure
  • Expo integration validated
  • EAS configuration and cloud build setup added

…th expo equivalents

- modules/fs.ts: use expo-file-system/legacy for cacheDirectory, EncodingType etc; use rn-qr-generator for QR detection
- components/CameraScreen.tsx: migrate from react-native-camera-kit-no-google Camera to expo-camera CameraView
- components/AddressInputScanButton.tsx: replace detectQRCodeInImage with RNQRGenerator.detect
- hooks/useCompanionListeners.ts: replace RNFS with expo-file-system/legacy, replace detectQRCodeInImage with RNQRGenerator
- tests/setup.js: update mocks to match new packages
@kapildadhich075 kapildadhich075 changed the title Migrate to Expo SDK 55 and update dependencies and configurations Refactor: Migrate to Expo Bare Workflow and Introduce src/ Architecture May 18, 2026
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "Shroud.app"
BlueprintName = "Shroud"
BuildableName = "ShroudWallet.app"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app name is "Shroud" and not "ShroudWallet"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch! During my hit-and-trial testing to get the EAS builds working, the PRODUCT_NAME in project.pbxproj was temporarily set to ShroudWallet, which caused the compiled binary to output as ShroudWallet.app. I will update the configuration so it correctly compiles as Shroud.app!

BuildableName = "Shroud.app"
BlueprintName = "Shroud"
BuildableName = "ShroudWallet.app"
BlueprintName = "BlueWallet"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have BlueWallet here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When migrating to Expo, the EAS cloud build pipeline kept failing because it was defaulting to look for the legacy BlueWallet Xcode scheme (it was throwing errors saying BlueWallet.xcscheme was corrupted). To quickly unblock the builds, I temporarily reverted the internal native target (PBXNativeTarget) back to BlueWallet. Because the native target was renamed, the BlueprintName had to match it to link properly. Now that I understand the proper configuration required for Expo, I'll completely eliminate the BlueWallet target name and rename everything back to Shroud.

@NAME-ASHWANIYADAV

Copy link
Copy Markdown
Contributor

@theanmolsharma @kapildadhich075 Ran the numbers on this branch against today's master.

It's 153 commits behind, and a test merge (git merge-tree) conflicts in 157 files. The "fully synced with upstream" note in the description was true in May. Since then the Settings/Currency/TransactionDetails redesigns, SP change addresses, network settings, and the dark-mode series have all landed, at root paths this PR moves into src/.

The repeated hand-merges are also losing repo history. Four dependencies Shroud deliberately deleted are back, with zero imports: react-native-rate, react-native-watch-connectivity, react-native-draglist, and payjoin-client. I checked payjoin-client's one grep hit and it's a comment in hd-segwit-bech32-transaction.ts, not an import. 23 new deps in total on this branch, so CONTRIBUTING's rule about discussing new dependencies first applies here regardless of the Expo question.

e898ef9 deserves its own look. It's labeled refactor: but changes app-start behavior: a missing INDEXER_BASE_URL used to throw, now it warns and boots without an indexer. Whether the app should fail fast there is a product call, not a refactor, and #146 has since handled indexer-unavailability on master its own way, so this hunk now fights newer code. The same commit removes the live require('crypto') from shim.js. That line existed to populate global.crypto before other modules load, so I'd want a device test proving nothing reads it at import time before deleting it. The NODE_ENV/babel-preset-expo note in that hunk is a good catch though, that one's real.

On the bigger question. A restructure this size on a long-lived branch only lands if it's rebased right at the end under a merge freeze, otherwise it conflicts with everything merged before and after it. The last four months are the proof. If the maintainers want Expo + src/ (an issue settling that first would match how this repo works), I think the landable version looks like:

Per-module dependency swaps (expo-clipboard, expo-haptics, ...), one small PR each, no restructure.
The src/ move as a pure git mv commit, zero content edits, so git tracks renames and the review is trivial.
Expo toolchain and EAS config last.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants