Skip to content

Commit 1152c00

Browse files
authored
build: add yarn cooldown support (3 days) + upgrade yarn@4.10.3 (#530)
Upgrading `yarn` to use the cooldown feature to avoid pulling packages that are "too recent". Extra layer of protection against compromised packages with supply-chain attacks. We already use the same mechanism in `snaps` and `core`, I just re-used the same value. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Build tooling changes affect dependency installation behavior and could break CI or local installs if packages aren’t old enough or not preapproved, but no runtime application logic is modified. > > **Overview** > Upgrades the repo’s Yarn version to `yarn@4.10.3` and updates configuration to enforce a **3-day `npmMinimalAgeGate`** during installs. > > Adds an allowlist via `npmPreapprovedPackages` (e.g., `@metamask/*`, `@lavamoat/*`) so selected scoped packages can bypass the age gate. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 777d2bc. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 2afa37b commit 1152c00

3 files changed

Lines changed: 958 additions & 927 deletions

File tree

.yarn/releases/yarn-4.10.3.cjs

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

.yarn/releases/yarn-4.5.0.cjs

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

.yarnrc.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ enableGlobalCache: false
44

55
enableScripts: false
66

7-
enableTelemetry: false
7+
enableTelemetry: 0
88

99
logFilters:
1010
- code: YN0004
@@ -16,4 +16,18 @@ plugins:
1616
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
1717
spec: "https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js"
1818

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

0 commit comments

Comments
 (0)