Commit 2b4cb4e
Fix release e2e local testing on macOS / npm >= 11 (prerelease --tag + gradle.properties) (#57469)
Summary:
Two fixes that make `test-release-local` work again for release-candidate testing on macOS with modern npm. Both are in the local release-testing scripts only (no product code).
### 1. `npm publish` needs `--tag` for prereleases (npm >= 11)
Publishing the monorepo packages to the local Verdaccio proxy fails on npm >= 11 for a prerelease version (e.g. `0.87.0-rc.0`):
```
react-native/asset-utils (packages/asset-utils) ........................ Failed ❌
npm error You must specify a tag using --tag when publishing a prerelease version.
```
npm now refuses to publish a prerelease to the default `latest` dist-tag without an explicit `--tag`. Fix: when the version is a prerelease (contains `-`), pass `--tag prerelease`. Stable versions are unaffected. (`scripts/e2e/init-project-e2e.js`)
### 2. `echo -e` corrupts `gradle.properties` on macOS
Setting up the Android test project, the script appends the maven-local repo path with `echo -e`. On macOS, `/bin/sh`'s `echo` doesn't support `-e`, so it writes a literal `-e ` onto the previous property, corrupting the file:
```
Cannot parse project property android.newDsl='false-e ' of type
'class java.lang.String' as boolean. Expected 'true' or 'false'.
```
Fix: use `printf`, which is portable. (`scripts/release-testing/test-release-local.js`)
## Changelog
[INTERNAL] - Fix `test-release-local` for prerelease testing on macOS / npm >= 11
Test Plan:
On npm 11.4.2 / Node 24, `yarn test-release-local -t RNTestProject -p Android -c <token>` against `0.87.0-rc.0`:
- **Before:** failed at "Publishing packages to local npm proxy" (prerelease `--tag` error); after working around that, failed at `app:installDebug` with the `android.newDsl='false-e '` parse error.
- **After:** packages publish to the local proxy with `--tag prerelease`, `gradle.properties` gets a well-formed `react.internal.mavenLocalRepo` line, and the app builds/installs against the RC's maven-local artifacts.
- iOS (`-t RNTestProject -p iOS`) also gets past the publish step with fix #1.
- Stable (non-prerelease) versions: `publishTag` is empty and `printf` behaves identically, so no behavior change.
Reviewed By: christophpurrer
Differential Revision: D110925222
Pulled By: zeyap1 parent c165265 commit 2b4cb4e
2 files changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
125 | | - | |
| 129 | + | |
126 | 130 | | |
127 | 131 | | |
128 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
294 | 296 | | |
295 | | - | |
| 297 | + | |
296 | 298 | | |
297 | 299 | | |
298 | 300 | | |
| |||
0 commit comments