Skip to content

Move platform helpers into platforms/android, ios and react-native - #74

Merged
ashirman merged 1 commit into
mainfrom
feature/rev-142
Oct 15, 2026
Merged

ashirman merged 1 commit into
mainfrom
feature/rev-142

Conversation

@revopushbot

Copy link
Copy Markdown
Contributor

Step 5 of the CLI restructuring (REV-142). Code is moved without behaviour changes.

New layout

script/
  platforms/
    android/  gradle.ts (version + Hermes settings), binary.ts (apk/aab)
    ios/      xcode.ts (version + .xcode.env), binary.ts (ipa)
    react-native/
      bundler.ts      react-native bundle + expo export:embed
      hermes.ts       detection, hermesc lookup, compile, base bytecode
      project.ts      react-native package path and version
      source-maps.ts  source-map paths + metadata restore
  utils/  file-utils, hash-utils, sign, validation-utils, release-size-utils

What moved

  • Split by platform: react-native-utils, binary-utils and expo-utils are gone; their code is split into the files above. utils/gradle-utils, ios-utils, hermes-utils and source-map-utils moved into platforms/.
  • Bundle commands: the react-native and Expo bundle commands moved from command-executor to bundler.ts. The executor still runs the release.
  • Import loop removed: the last loop (hermes → gradle → react-native-utils → hermes) is gone, because the small React Native project helpers now live in their own files.
  • One version type: the three identical version types are now one cli.ProjectVersionInfo.
  • Small helpers: isValidVersion moved to validation-utils, and the zip helper both binary readers share moved to file-utils.
  • Signing and hashing: hash-utils and sign moved to utils/. The ticket said sdk/, but the API client doesn't use either of them.
  • Dead code: removed the unused execSync export from command-executor.
  • Tests: test files are renamed to match, and the two source-map test files are merged. Tests that fake the bundler process now stub spawn in bundler.ts instead of the executor.

Verification against main

Check Result
24 release-react/release-expo runs (iOS and Android, all options, signing, error cases) through a fake SDK and bundler All 476 transcript lines identical
45 CLI commands against a fake server Same output, exit codes and server requests
Native release: Android metadata zip and /nativerelease upload Same zip, same request
  • Comparison caveat: the native and command comparisons differ only in temp-folder names and in timing-dependent stack frames inside libraries. I compared them with those normalised.
  • Not covered: the iOS .ipa reader isn't covered by tests or by these checks. It was moved without edits.
  • Build, lint and format: tsc, npm run lint and npm run format:check are clean.
  • Tests: all 159 pass on macOS and on Linux (Docker, Node 20.19.0).

The review found some existing bugs: the bundler treats being killed by a signal as success, has no spawn error handler, and passes a blank CODE_PUSH_NODE_ARGS through as an empty argument; hermesc also receives CODE_PUSH_NODE_ARGS. I didn't fix them here, to keep this a pure move. They're tracked in REV-144.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ashirman
ashirman merged commit 156aca4 into main Oct 15, 2026
2 checks passed
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.

2 participants