Skip to content

Commit 68a2b0c

Browse files
Mrtenzmetamaskbot
andauthored
chore: Bump Yarn to 4.10.3 and configure NPM age gate (#3691)
## Explanation This bumps Yarn to the latest version (`4.10.3`), which includes support for setting an age gate for NPM packages. It's set to 3 days following the security recommendations, meaning that packages must be at least 3 days old to be installed. ## References MetaMask/metamask-module-template#270 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Upgrades Yarn to 4.10.3, adds a 3-day npm age gate with preapproved packages, and updates related configs and LavaMoat policy references. > > - **Build/Config**: > - **Yarn upgrade**: Set `yarnPath` and root `packageManager` to `[email protected]` in `.yarnrc.yml`, `package.json`, and `yarn.config.cjs`. > - **NPM age gate**: Add `npmMinimalAgeGate: 4320` and `npmPreapprovedPackages` (`@metamask/*`, `@lavamoat/*`) in `.yarnrc.yml`. > - **LavaMoat policy**: > - Update `policy.json` to reference `depcheck>readdirp>picomatch` instead of `ts-loader>micromatch>picomatch` in relevant entries. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 635d8c1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: MetaMask Bot <[email protected]>
1 parent 3fda705 commit 68a2b0c

File tree

6 files changed

+957
-930
lines changed

6 files changed

+957
-930
lines changed

.yarn/releases/yarn-4.10.3.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-4.4.1.cjs

Lines changed: 0 additions & 925 deletions
This file was deleted.

.yarnrc.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,14 @@ plugins:
1818
- path: .yarn/plugins/local/plugin-workspaces-filter.js
1919
- path: .yarn/plugins/local/plugin-lifecycle-scripts.js
2020

21-
yarnPath: .yarn/releases/yarn-4.4.1.cjs
21+
yarnPath: .yarn/releases/yarn-4.10.3.cjs
22+
23+
# Configure the NPM minimal age gate to 3 days, meaning packages must be at
24+
# least 3 days old to be installed.
25+
npmMinimalAgeGate: 4320 # 3 days (in minutes)
26+
27+
# Override the minimal age gate, allowing certain packages to be installed
28+
# regardless of their publish age.
29+
npmPreapprovedPackages:
30+
- '@metamask/*'
31+
- '@lavamoat/*'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"typescript-eslint": "^8.6.0",
123123
"vite": "^6.2.7"
124124
},
125-
"packageManager": "yarn@4.4.1",
125+
"packageManager": "yarn@4.10.3",
126126
"engines": {
127127
"node": "^20 || >=22"
128128
},

packages/snaps-execution-environments/lavamoat/build-system/policy.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@
818818
},
819819
"packages": {
820820
"ts-loader>micromatch>braces": true,
821-
"ts-loader>micromatch>picomatch": true
821+
"depcheck>readdirp>picomatch": true
822822
}
823823
},
824824
"webpack>mime-types": {
@@ -860,7 +860,7 @@
860860
"process": true
861861
}
862862
},
863-
"ts-loader>micromatch>picomatch": {
863+
"depcheck>readdirp>picomatch": {
864864
"builtin": {
865865
"path.basename": true,
866866
"path.sep": true

yarn.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ module.exports = defineConfig({
241241
if (isChildWorkspace) {
242242
workspace.unset('packageManager');
243243
} else {
244-
expectWorkspaceField(workspace, 'packageManager', 'yarn@4.4.1');
244+
expectWorkspaceField(workspace, 'packageManager', 'yarn@4.10.3');
245245
}
246246

247247
// All packages must specify a minimum Node.js version of 18.18.

0 commit comments

Comments
 (0)