Skip to content

0.0.14#32

Open
revopushbot wants to merge 3 commits into
mainfrom
0.0.14
Open

0.0.14#32
revopushbot wants to merge 3 commits into
mainfrom
0.0.14

Conversation

@revopushbot

Copy link
Copy Markdown
Contributor

Enforce --outputDir layout, drop Windows, and consolidate React-release validation

Why

Diff updates require a release's uploaded package to live under a folder named CodePush — the base-bundle lookup (react-native-utils.ts takeHermesBaseBytecode) resolves the previous bundle via path.basename(outputFolder), and binary extraction (binary-utils.ts) hardcodes a CodePush/ prefix. When --outputDir is omitted we default to os.tmpdir()/CodePush (correct), but a custom --outputDir could be any name, silently breaking diff updates (the base bundle is never found, so no -base-bytecode diff is produced).

This PR fails the release early with a clear message when a custom --outputDir doesn't satisfy that requirement, removes Windows (no longer supported), and consolidates the scattered React-release validation into one place.

What changed

--outputDir validation

  • A custom --outputDir must end in a folder named CodePush (e.g. ./build/CodePush); otherwise the release fails up front with:
    The "--outputDir" path must end with a folder named "CodePush" (e.g. "./build/CodePush"). Received: "...".
  • Applies to release-react and release-expo. release-native is untouched (it nests CodePush/ internally, so its basename is irrelevant).

Drop Windows support

  • release-react now accepts only android / ios.
  • Removed the Windows example and Windows mentions from release-react / release-expo help text in command-parser.ts.
  • Updated the 'Platform must be either …' messages in react-native-utils.ts to drop Windows. (OS-level Windows handling — Git Bash backslashes — is unchanged.)

Consolidated validation (command-executor.ts)

  • Introduced a single validateReactReleaseCommand(command, { resolveEntryFile }) that performs all up-front validation and returns the derived inputs (platform, bundleName, entryFile, projectName): platform check, --outputDir check, React Native project check, and entry-file resolution (skipped for Expo, whose expo export:embed resolves its own entry point). The semver-range check stays in the chain since it needs the async-resolved app version.
  • releaseReact / releaseExpo are now validate → set up folders → run the chain, removing the duplicated platform switch, package.json block, and entry-file logic from both.

Bug fix / hardening (in the consolidation)

  • The old try/catch wrapped the field checks, so the specific "name field not set" / "not a React Native project" errors were swallowed and replaced by the generic "unable to read package.json". The try now wraps only the require, so each error surfaces correctly.
  • Guarded dependencies?.["react-native"] so a package.json with no dependencies reports "not a React Native project" instead of a misleading read error.

Testing

  • npm run build (tsc) passes; lint shows only pre-existing no-unused-vars warnings, none in touched code.
  • release-react MyApp ios --outputDir ./build/wrong → fails immediately with the CodePush message.
  • --outputDir ./build/CodePush (and trailing slash) → proceeds.
  • Omitting --outputDir → still uses the temp CodePush folder.
  • release-react MyApp windows … → rejected with Platform must be either "android" or "ios".

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