chore: upgrade Yarn to 4.16.0#128
Conversation
Migrate to Yarn 4 using Corepack via the packageManager field. Replace .yarnrc with .yarnrc.yml (using the template's defaults: enableScripts false, 3-day npm minimal age gate, telemetry off, node-modules linker). Add the LavaMoat allow-scripts Yarn plugin so install-script approval keeps working without a separate `yarn allow-scripts` step. Bump @lavamoat/allow-scripts ^1 -> ^3 and @lavamoat/preinstall-always-fail ^1 -> ^2 to match the plugin. Drop the now-redundant `setup` script. Update build-lint-test.yml: enable Corepack in both jobs, switch the install to `yarn install --immutable`, drop the explicit allow-scripts step. Pin three transitive browserslist deps via `resolutions` (semver, caniuse-lite, electron-to-chromium, baseline-browser-mapping) to versions outside the 3-day age gate. These come in via @babel/core, which jest pulls for its internal transforms. dist/index.js is regenerated and now contains slightly different bundled internals after the lockfile migration; the source has not changed and behaviour is equivalent.
After the initial Yarn 4 install with pinned resolutions, the age-gated packages have aged out (or settled at a version Yarn picks naturally). Removing the resolutions block leaves the lockfile stable -- yarn install --immutable still passes -- and avoids carrying maintenance pins that would need updating on every future dep bump.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
Ignoring alerts on:
|
|
@SocketSecurity ignore npm/glob@13.0.6 False positive. @SocketSecurity ignore npm/undici@6.26.0 Network access expected. @SocketSecurity ignore npm/npm-normalize-package-bin@3.0.1 New author is ok. |
Summary
Migrates from Yarn classic to Yarn 4.16.0 to align with the module template:
packageManagerfield;.yarnrcis replaced by.yarnrc.yml(template defaults verbatim).yarn-plugin-allow-scripts, checked in under.yarn/plugins/.@lavamoat/allow-scriptsbumps to^3.0.4and@lavamoat/preinstall-always-failto^2.0.0to match the plugin. Thesetupscript is removed.build-lint-test.yml: both jobs gaincorepack enable, the install becomesyarn install --immutable, and the explicityarn allow-scriptsstep is dropped.dist/index.jsis regenerated; the bundled output differs slightly becausenccinlines a few helpers differently after the lockfile migration, but the source is unchanged.Four browserslist-ecosystem transitives (pulled in via
@babel/corefor Jest's transforms) were briefly pinned withresolutionsto dodge the 3-daynpmMinimalAgeGateduring the initial install, then dropped once the lockfile settled.The bigger template gaps (workflow restructure,
yarn.config.cjs,engines.nodebump) remain out of scope.