Skip to main content
Sovran includes a comprehensive set of scripts for development, building, testing, and deployment. This guide covers all available npm/yarn scripts.

Development Scripts

Start Development Server

Launch the Expo development server:
yarn start
This starts the Metro bundler and opens the Expo developer tools. From there you can:
  • Press i to open iOS simulator
  • Press a to open Android emulator
  • Scan the QR code with Expo Go on a physical device

Run on Platforms

iOS

yarn ios
Builds and runs the app on the iOS simulator using production settings.

Android

yarn android
Builds and runs the app on the Android emulator using production settings.

Build Scripts

Prebuild

Generate native iOS and Android projects:
yarn prebuild
Runs expo prebuild --clean which:
  • Deletes existing ios/ and android/ directories
  • Regenerates native projects from app.json configuration
  • Applies all Expo config plugins
Run this after:
  • Adding new native dependencies
  • Modifying app.json plugins
  • Changing native permissions

EAS Build - iOS

yarn build:ios
Builds iOS for production using EAS Build:
  • Platform: ios
  • Profile: production
  • Non-interactive mode
  • Auto-submit to App Store
Full command: eas build --platform ios --profile production --non-interactive --auto-submit

EAS Build - Android

yarn build:dev:android
Builds Android for development using EAS Build:
  • Platform: android
  • Profile: development
  • Development client enabled
Full command: eas build --platform android --profile development
EAS Build Profiles are configured in eas.json:
  • development - Dev client, internal distribution
  • preview - Testing builds, internal distribution
  • production - Production builds, auto-increment version

Submission Scripts

Submit builds to app stores using EAS Submit:

iOS App Store

yarn submit:ios
Configuration (eas.json):
{
  "submit": {
    "production": {
      "ios": {
        "appleId": "business@sovranbitcoin.com",
        "ascAppId": "6499554529",
        "appleTeamId": "2ZTL7KLN2V"
      }
    }
  }
}

Android Play Store

yarn submit:android
Submits the latest Android build to Google Play Console.

Code Quality Scripts

Pre-Commit Requirement: All five code quality checks must pass before committing code.

Linting

Run ESLint to check for code issues:
yarn lint
Configuration:
  • Extends eslint-config-expo
  • Prettier integration
  • Unused imports detection
  • TypeScript support
Fix automatically:
yarn lint --fix

Type Checking

Run TypeScript compiler to check types:
yarn type-check
Runs tsc --noEmit to validate TypeScript without emitting files. Common issues:
  • Missing type imports
  • Incorrect prop types
  • Untyped function parameters

Code Formatting

yarn pretty:check
Checks if files are formatted correctly without modifying them.Pattern: ./**/*.{js,jsx,mjs,cjs,ts,tsx,json}

Find Dead Code

yarn knip
Runs Knip to find:
  • Unused exports
  • Unused dependencies
  • Unreachable code
  • Duplicate exports
Configuration: knip.json

Testing

Run Jest unit tests:
yarn test
Test framework: Jest with jest-expo preset

UI Testing

Maestro Tests

Run end-to-end UI tests with Maestro:
yarn maestro
Runs all Maestro test flows in .maestro/ directory. Prerequisites:
  • Install Maestro CLI: brew tap mobile-dev-inc/tap && brew install maestro
  • Build app for simulator/emulator
  • Ensure device is running

Build Utilities

Theme Generation

Build background theme metadata:
yarn build:themes
Runs scripts/build-background-themes.js to:
  • Extract colors from background images
  • Generate theme metadata
  • Create palette definitions
  • Output to scripts/background-themes-metadata.json

Screenshot Utilities

Resize and optimize app screenshots:
yarn screenshots
Runs scripts/resize-screenshots.js to:
  • Resize screenshots for App Store
  • Optimize image sizes
  • Generate required dimensions

Automation Scripts

FreedomStore Release

Create a pull request to FreedomStore:
yarn release:freedomstore:pr
Runs scripts/create-freedomstore-pr.sh which:
  • Clones FreedomStore repository
  • Updates Sovran metadata
  • Creates a pull request
  • Automates release process

Lifecycle Hooks

Post-Install

Automatically runs after yarn install or npm install:
{
  "scripts": {
    "postinstall": "patch-package"
  }
}
Applies patches from patches/ directory:
  • coco-cashu-core+1.1.2-rc.47.patch
  • cashu-kym+0.4.1.patch
Patches are created with npx patch-package <package-name> after modifying node_modules.

Script Execution Order

For a typical development workflow:
# 1. Install dependencies
yarn install

# 2. Start development server
yarn start

# 3. Run on device (separate terminal)
yarn ios  # or yarn android

# 4. Before committing:
yarn lint
yarn type-check
yarn pretty:check
yarn knip
yarn test

# 5. Format if needed
yarn pretty

# 6. Commit changes
git add .
git commit -m "feat: add new feature"

Production Build Workflow

iOS Production Release

# 1. Build for production (auto-submits)
yarn build:ios

# 2. Or manually submit after build
yarn submit:ios

Android Production Release

# 1. Build APK for testing
yarn build:android:apk

# 2. Test APK on device
# ...

# 3. Build production AAB
eas build --platform android --profile production

# 4. Submit to Play Store
yarn submit:android

Troubleshooting

Clear Cache

If you encounter build issues:
# Clear Metro bundler cache
yarn start --clear

# Clear Expo cache
rm -rf .expo

# Clear node modules and reinstall
rm -rf node_modules
yarn install

# Regenerate native projects
yarn prebuild

Build Errors

If EAS builds fail:
# Check EAS build logs
eas build:list

# View specific build
eas build:view <build-id>

# Check credentials
eas credentials

Type Errors

If type checking fails:
# Check specific file
npx tsc --noEmit path/to/file.ts

# Generate types for Expo Router
npx expo customize tsconfig.json

CI/CD Integration

GitHub Actions Workflow

The repository includes a CI workflow (.github/workflows/ci.yml) that runs:
steps:
  - run: yarn install
  - run: yarn lint
  - run: yarn type-check
  - run: yarn pretty:check
  - run: yarn test
Status Badge: CI

Environment Variables

EAS Build Environment

Configure per-profile environments in eas.json:
{
  "build": {
    "development": {
      "env": {
        "APP_VARIANT": "development",
        "EXPO_NO_DEV_CLIENT": "1"
      }
    }
  }
}

Local Development

No .env file is needed for basic development. Sensitive values are stored in:
  • expo-secure-store - Runtime secrets
  • eas.json - Build secrets (use EAS Secrets for sensitive data)

Next Steps

Getting Started

Set up your development environment

Project Structure

Understand the codebase organization

Tech Stack

Learn about the technologies used

Contributing

Contribution guidelines and workflow

Build docs developers (and LLMs) love