Skip to content

Move terminal helpers into ui/ and break imports of command-executor - #71

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

ashirman merged 1 commit into
mainfrom
feature/rev-138

Conversation

@revopushbot

Copy link
Copy Markdown
Contributor

Step 1 of the CLI restructuring (REV-138). There's no behaviour change. command-executor.ts stays the place where commands run; this PR only moves helpers out of it.

Changes

  • New script/ui/ for terminal interaction:
    • log.ts: log.
    • prompt.ts: confirm and requestAccessKey, moved word for word.
    • progress.ts: createUploadProgress(), which replaces the progress-bar code that was duplicated in doRelease and doNativeRelease.
  • Helpers no longer import command-executor:
    • binary-utils, react-native-utils and utils/hermes-utils import log from ui/log.
    • takeHermesBaseBytecode receives the SDK as a parameter, typed as the one method it uses (Pick<AccountManager, "getBaseRelease">).
    • Only cli.ts imports command-executor now.
  • Types in one place: script/types.ts → script/types/index.ts, so existing "./types" imports still resolve. command-executor now imports types as "./types" rather than "../script/types".
  • Removed script/index.ts and "main" in package.json:
    • "main" pointed to ./script/cli.js, which isn't in the published package, so require("@revopush/code-push-cli") already failed.
    • index.ts wasn't used by anything.
    • The revopush command ("bin") is unchanged.
  • Tests stub ui/log and ui/prompt instead of command-executor.

Verification

  • Build, lint and format check: tsc, npm run lint (0 problems) and npm run format:check are clean.
  • Tests: all 158 pass on macOS and on Linux (Docker, Node 20.19.0).
  • End to end: the real CLI binary from main and from this branch, run against a local fake server with 45 commands, including y/n prompts and release uploads. Output, exit codes and server requests are identical.
  • Published command: the built package's revopush --version and whoami work.

Follow-ups

  • Remaining import loop (hermes-utils → gradle-utils → react-native-utils → hermes-utils): handled when react-native-utils is split in REV-142.
  • Ctrl+C at a y/N prompt crashes with a stack trace. This already happens on main; it's a small separate fix.
  • Package contents: the package also publishes bin/test. A "files" field and a clean step before build would fix it.

🤖 Generated with Claude Code

- log, confirm, requestAccessKey and the upload progress bar move to
  script/ui; the two upload progress copies become createUploadProgress()
- Helper modules no longer import command-executor; takeHermesBaseBytecode
  receives the SDK
- types.ts becomes types/index.ts
- Remove the unused index.ts and the package "main", which pointed to a
  file that is not published

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ashirman
ashirman merged commit 9be9e6e 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