feat(rn): Capgo React Native updater + CLI with file-level delta

Closed
RI
12d ago
+4945-42

Summary (AI generated)

  • Add @capgo/react-native-updater: React Native native module (iOS/Android) that speaks Capgo /updates + /stats and applies Capgo file-level delta manifests (SHA-256 + optional Brotli), same backend contract as @capgo/capacitor-updater.
  • Add @capgo/rn-cli (capgo-rn): Metro export of index.android.bundle + main.jsbundle + assets, then upload via @capgo/cli bundle upload --delta.
  • Extend @capgo/cli so upload/delta/brotli detection accepts @capgo/react-native-updater, and skip Capacitor index.html / notifyAppReady checks for RN export folders.

Motivation (AI generated)

React Native teams need Capgo-style OTA with the same Capgo Cloud delta system (not binary bspatch). This mirrors the RN integration pattern from zepto-labs/react-native-delta (JS bundle path override + check/download/apply), while reusing Capgo’s existing file-manifest delta pipeline end to end.

Business Impact (AI generated)

Opens Capgo live updates to React Native without forking storage/backend. One cloud, one delta format, new client + CLI surface.

Test Plan (AI generated)

  • bun run --cwd packages/rn-cli test
  • bun run --cwd packages/react-native-updater test
  • bun test ./cli/test/test-rn-updater-version.test.mjs
  • Wire a sample RN app: getJSBundleFile / getJSBundleURL, call notifyAppReady(), upload with capgo-rn upload <appId> --channel production, verify /updates returns manifest and only changed files download
  • Confirm Capacitor uploads still detect @capgo/capacitor-updater and require index.html / notifyAppReady unless --no-code-check

Generated with AI

Made with Cursor

Summary by CodeRabbit

  • New Features
    • Added a React Native updater for Android and iOS with bundle downloads, file-level delta updates, Brotli compression, checksum validation, rollback, channels, progress events, and bundle management.
    • Added a React Native CLI with init, bundle, upload, and compatibility-check commands.
    • Added native dependency scanning, compatibility reporting, and precomputed package metadata support for uploads.
    • Added automatic detection of installed Capacitor and React Native updater packages.
  • Bug Fixes
    • Improved React Native export handling and updater compatibility validation during uploads.
  • Documentation
    • Added setup, native integration, CLI usage, and update workflow documentation.
  • Tests
    • Added coverage for updater detection, API contracts, metadata scanning, compatibility options, and export validation.