Commit 76e557f
build: Migrate Yarn from Berry v3.6.4 to v4.17.0 (#6417)
* build: Migrate Yarn from Berry v3.6.4 to v4.17.0
Yarn Berry v3 is end-of-life (last release 3.8.6, 2024). Bumping to the
intermediate 3.8.6 is not viable: its bundled compat/typescript patch
fails to apply to the modern TypeScript versions used across the
workspaces (Cannot apply hunk). Yarn 4 ships an up-to-date patch that
applies cleanly, so v4 is the working path.
- Bump packageManager to yarn@4.17.0 (corepack-managed)
- Pin downlevel-dts's TypeScript to a stable 5.9.3 via resolutions;
its typescript@npm:next dependency froze to a nightly build that no
yarn compat patch (v3 or v4) can patch
- Add enableScripts: true to .yarnrc.yml to preserve prior behavior;
yarn 4 flipped this default to false, which would otherwise disable
dependency build scripts (geckodriver, nx, pmd-bin, sharp)
Dev-tooling only: the published @sentry/react-native package carries no
yarn config, so there is no consumer impact.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(e2e): Disable yarn 4 release-age gate for generated test app
The e2e CLI creates a throwaway RN app with an empty yarn.lock and runs a
fresh install. Under yarn 4 (this branch's package manager), the install
auto-enables hardened mode on public-PR CI and quarantines any package
newer than npmMinimalAgeGate (default 1 day). A just-published first-party
@sentry/* version — e.g. right after a JS SDK bump — is therefore rejected
and fails the install.
Write enableHardenedMode: false and npmMinimalAgeGate: 0 into the generated
app's .yarnrc.yml. The release-age gate is inappropriate for an ephemeral
e2e app that must install freshly-published SDK packages.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(e2e): Disable yarn 4 release-age gate only on yarn-4 test apps
The previous fix wrote npmMinimalAgeGate/enableHardenedMode unconditionally
into the generated app's .yarnrc.yml. That broke RN versions whose app pins
yarn 3 (e.g. 0.71.19): yarn 3 hard-errors on the unknown settings, and it has
no release-age gate to begin with. enableHardenedMode isn't even a valid
setting on the yarn the older apps use.
Probe whether the app's yarn supports npmMinimalAgeGate (yarn 4 exits 0,
yarn 3 exits 1) and only append npmMinimalAgeGate: 0 when supported. Verified
against yarn 3.6.4 and 4.17.0: the yarn-4 app clears the quarantine, the
yarn-3 app installs with a minimal yarnrc and no unknown-setting error.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(e2e): Disable yarn 4 release-age gate for ts3.8 type-check install
Same root cause as the e2e app fix, different location. run-type-check.sh
does a fresh `yarn install` after yalc-adding @sentry/react-native, which
re-resolves transitive @sentry/* deps. Under yarn 4, a just-published SDK
version (e.g. right after a JS SDK bump) is quarantined by npmMinimalAgeGate
(default 1 day, auto-enabled by hardened mode on public-PR CI) and fails the
install.
This workspace always runs on the repo's yarn 4, so pass
YARN_NPM_MINIMAL_AGE_GATE=0 inline to the install.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 4acd4e9 commit 76e557f
6 files changed
Lines changed: 7215 additions & 7207 deletions
File tree
- dev-packages
- e2e-tests
- type-check
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
164 | 182 | | |
165 | 183 | | |
166 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
| 142 | + | |
142 | 143 | | |
0 commit comments