Skip to content

Commit b35e280

Browse files
committed
Bump Yarn to 4.2.2
This allows us to use newer features of Yarn. For instance, we will be able to write constraints in JavaScript format rather than Prolog.
1 parent 9f3498a commit b35e280

File tree

45 files changed

+4222
-5006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4222
-5006
lines changed

.github/workflows/ensure-blocking-pr-labels-absent.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ jobs:
1313
permissions:
1414
pull-requests: read
1515
steps:
16-
- uses: actions/checkout@v3
17-
- name: Set up Node.js
18-
uses: actions/setup-node@v3
16+
- uses: actions/checkout@v4
17+
- name: Use Node.js
18+
uses: actions/setup-node@v4
1919
with:
20-
cache: yarn
21-
- name: Install dependencies
22-
run: yarn --immutable
20+
node-version-file: '.nvmrc'
21+
- name: Install Yarn
22+
run: corepack enable
23+
- name: Restore Yarn cache
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version-file: '.nvmrc'
27+
cache: 'yarn'
28+
- run: yarn --immutable
2329
- name: Run command
2430
uses: actions/github-script@v7
2531
with:

.github/workflows/lint-build-test.yml

+45-15
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ jobs:
1313
outputs:
1414
child-workspace-package-names: ${{ steps.workspace-package-names.outputs.child-workspace-package-names }}
1515
steps:
16-
- uses: actions/checkout@v3
17-
- name: Use Node.js ${{ matrix.node-version }}
18-
uses: actions/setup-node@v3
16+
- uses: actions/checkout@v4
17+
- name: Install Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: Install Yarn
22+
run: corepack enable
23+
- name: Restore Yarn cache
24+
uses: actions/setup-node@v4
1925
with:
2026
node-version: ${{ matrix.node-version }}
2127
cache: yarn
@@ -34,9 +40,15 @@ jobs:
3440
matrix:
3541
node-version: [20.x]
3642
steps:
37-
- uses: actions/checkout@v3
38-
- name: Use Node.js ${{ matrix.node-version }}
39-
uses: actions/setup-node@v3
43+
- uses: actions/checkout@v4
44+
- name: Install Node.js ${{ matrix.node-version }}
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: ${{ matrix.node-version }}
48+
- name: Install Yarn
49+
run: corepack enable
50+
- name: Restore Yarn cache
51+
uses: actions/setup-node@v4
4052
with:
4153
node-version: ${{ matrix.node-version }}
4254
cache: yarn
@@ -59,9 +71,15 @@ jobs:
5971
node-version: [20.x]
6072
package-name: ${{ fromJson(needs.prepare.outputs.child-workspace-package-names) }}
6173
steps:
62-
- uses: actions/checkout@v3
63-
- name: Use Node.js ${{ matrix.node-version }}
64-
uses: actions/setup-node@v3
74+
- uses: actions/checkout@v4
75+
- name: Install Node.js ${{ matrix.node-version }}
76+
uses: actions/setup-node@v4
77+
with:
78+
node-version: ${{ matrix.node-version }}
79+
- name: Install Yarn
80+
run: corepack enable
81+
- name: Restore Yarn cache
82+
uses: actions/setup-node@v4
6583
with:
6684
node-version: ${{ matrix.node-version }}
6785
cache: yarn
@@ -83,9 +101,15 @@ jobs:
83101
matrix:
84102
node-version: [20.x]
85103
steps:
86-
- uses: actions/checkout@v3
87-
- name: Use Node.js ${{ matrix.node-version }}
88-
uses: actions/setup-node@v3
104+
- uses: actions/checkout@v4
105+
- name: Install Node.js ${{ matrix.node-version }}
106+
uses: actions/setup-node@v4
107+
with:
108+
node-version: ${{ matrix.node-version }}
109+
- name: Install Yarn
110+
run: corepack enable
111+
- name: Restore Yarn cache
112+
uses: actions/setup-node@v4
89113
with:
90114
node-version: ${{ matrix.node-version }}
91115
cache: yarn
@@ -108,9 +132,15 @@ jobs:
108132
node-version: [18.x, 20.x]
109133
package-name: ${{ fromJson(needs.prepare.outputs.child-workspace-package-names) }}
110134
steps:
111-
- uses: actions/checkout@v3
112-
- name: Use Node.js ${{ matrix.node-version }}
113-
uses: actions/setup-node@v3
135+
- uses: actions/checkout@v4
136+
- name: Install Node.js ${{ matrix.node-version }}
137+
uses: actions/setup-node@v4
138+
with:
139+
node-version: ${{ matrix.node-version }}
140+
- name: Install Yarn
141+
run: corepack enable
142+
- name: Restore Yarn cache
143+
uses: actions/setup-node@v4
114144
with:
115145
node-version: ${{ matrix.node-version }}
116146
cache: yarn

.github/workflows/publish-preview.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
outputs:
1313
IS_FORK: ${{ steps.is-fork.outputs.IS_FORK }}
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: Determine whether this PR is from a fork
1717
id: is-fork
1818
run: echo "IS_FORK=$(gh pr view --json isCrossRepository --jq '.isCrossRepository' "${PR_NUMBER}" )" >> "$GITHUB_OUTPUT"
@@ -29,14 +29,20 @@ jobs:
2929
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: actions/checkout@v3
33-
- name: Checkout pull request
32+
- uses: actions/checkout@v4
33+
- name: Check out pull request
3434
run: gh pr checkout "${PR_NUMBER}"
3535
env:
3636
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3737
PR_NUMBER: ${{ github.event.issue.number }}
38-
- name: Setup Node
39-
uses: actions/setup-node@v3
38+
- name: Install Node
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version-file: '.nvmrc'
42+
- name: Install Yarn
43+
run: corepack enable
44+
- name: Restore Yarn cache
45+
uses: actions/setup-node@v4
4046
with:
4147
node-version-file: '.nvmrc'
4248
cache: yarn

.github/workflows/publish-release.yml

+36-8
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@ jobs:
1414
contents: write
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
with:
1919
ref: ${{ github.sha }}
20-
- name: Setup Node
21-
uses: actions/setup-node@v3
20+
- name: Install Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version-file: '.nvmrc'
24+
- name: Install Yarn
25+
run: corepack enable
26+
- name: Restore Yarn cache
27+
uses: actions/setup-node@v4
2228
with:
2329
node-version-file: '.nvmrc'
2430
cache: yarn
25-
- uses: actions/cache@v3
31+
- uses: actions/cache@v4
2632
with:
2733
path: |
2834
./packages/**/dist
@@ -38,10 +44,21 @@ jobs:
3844
runs-on: ubuntu-latest
3945
needs: publish-release
4046
steps:
41-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v4
4248
with:
4349
ref: ${{ github.sha }}
44-
- uses: actions/cache@v3
50+
- name: Install Node
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version-file: '.nvmrc'
54+
- name: Install Yarn
55+
run: corepack enable
56+
- name: Restore Yarn cache
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version-file: '.nvmrc'
60+
cache: yarn
61+
- uses: actions/cache@v4
4562
with:
4663
path: |
4764
./packages/**/dist
@@ -62,10 +79,21 @@ jobs:
6279
runs-on: ubuntu-latest
6380
needs: publish-npm-dry-run
6481
steps:
65-
- uses: actions/checkout@v3
82+
- uses: actions/checkout@v4
6683
with:
6784
ref: ${{ github.sha }}
68-
- uses: actions/cache@v3
85+
- name: Install Node
86+
uses: actions/setup-node@v4
87+
with:
88+
node-version-file: '.nvmrc'
89+
- name: Install Yarn
90+
run: corepack enable
91+
- name: Restore Yarn cache
92+
uses: actions/setup-node@v4
93+
with:
94+
node-version-file: '.nvmrc'
95+
cache: yarn
96+
- uses: actions/cache@v4
6997
with:
7098
path: |
7199
./packages/**/dist

.yarn/plugins/@yarnpkg/plugin-constraints.cjs

-52
This file was deleted.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

-28
This file was deleted.

.yarn/releases/yarn-3.3.0.cjs

-807
This file was deleted.

.yarnrc.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
compressionLevel: mixed
2+
3+
enableGlobalCache: false
4+
15
enableScripts: false
26

3-
enableTelemetry: 0
7+
enableTelemetry: false
48

59
logFilters:
610
- code: YN0004
@@ -11,9 +15,3 @@ nodeLinker: node-modules
1115
plugins:
1216
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
1317
spec: "https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js"
14-
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
15-
spec: "@yarnpkg/plugin-workspace-tools"
16-
- path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs
17-
spec: "@yarnpkg/plugin-constraints"
18-
19-
yarnPath: .yarn/releases/yarn-3.3.0.cjs

constraints.pro

+3
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ gen_enforced_dependency(WorkspaceCwd, DependencyIdent, CorrectPeerDependencyRang
408408
atom_concat('^', CurrentDependencyVersion, CorrectPeerDependencyRange)
409409
).
410410

411+
% All packages must specify the exact version of Yarn required for development.
412+
gen_enforced_field(WorkspaceCwd, 'packageManager', '[email protected]').
413+
411414
% All packages must specify a minimum Node version of 18.
412415
gen_enforced_field(WorkspaceCwd, 'engines.node', '^18.18 || >=20').
413416

docs/contributing.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
- Install the current LTS version of [Node.js](https://nodejs.org)
66
- If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm install` will install the latest version and running `nvm use` will automatically choose the right node version for you.
7-
- Install [Yarn v3](https://yarnpkg.com/getting-started/install).
7+
- Install [Yarn](https://yarnpkg.com) via [Corepack](https://github.com/nodejs/corepack?tab=readme-ov-file#how-to-install)
8+
- If you have Yarn installed globally via Homebrew or NPM, you'll need to uninstall it before enabling it via Corepack.
89
- Run `yarn install` to install dependencies and run any required post-install scripts.
910
- Run `yarn simple-git-hooks` to add a [Git hook](https://github.com/toplenboren/simple-git-hooks#what-is-a-git-hook) to your local development environment which will ensure that all files pass linting before you push a branch.
1011

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"typescript": "~4.9.5",
8989
"yargs": "^17.7.2"
9090
},
91-
"packageManager": "yarn@3.3.0",
91+
"packageManager": "yarn@4.2.2",
9292
"engines": {
9393
"node": "^18.18 || >=20"
9494
},

packages/accounts-controller/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"@metamask/keyring-controller": "^17.0.0",
7070
"@metamask/snaps-controllers": "^8.1.1"
7171
},
72+
"packageManager": "[email protected]",
7273
"engines": {
7374
"node": "^18.18 || >=20"
7475
},

packages/address-book-controller/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"typedoc-plugin-missing-exports": "^2.0.0",
5656
"typescript": "~4.9.5"
5757
},
58+
"packageManager": "[email protected]",
5859
"engines": {
5960
"node": "^18.18 || >=20"
6061
},

packages/announcement-controller/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"typedoc-plugin-missing-exports": "^2.0.0",
5454
"typescript": "~4.9.5"
5555
},
56+
"packageManager": "[email protected]",
5657
"engines": {
5758
"node": "^18.18 || >=20"
5859
},

packages/approval-controller/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"typedoc-plugin-missing-exports": "^2.0.0",
5858
"typescript": "~4.9.5"
5959
},
60+
"packageManager": "[email protected]",
6061
"engines": {
6162
"node": "^18.18 || >=20"
6263
},

packages/assets-controllers/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"@metamask/network-controller": "^19.0.0",
9595
"@metamask/preferences-controller": "^13.0.0"
9696
},
97+
"packageManager": "[email protected]",
9798
"engines": {
9899
"node": "^18.18 || >=20"
99100
},

packages/base-controller/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"typedoc-plugin-missing-exports": "^2.0.0",
5656
"typescript": "~4.9.5"
5757
},
58+
"packageManager": "[email protected]",
5859
"engines": {
5960
"node": "^18.18 || >=20"
6061
},

packages/build-utils/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"typedoc-plugin-missing-exports": "^2.0.0",
5656
"typescript": "~4.9.5"
5757
},
58+
"packageManager": "[email protected]",
5859
"engines": {
5960
"node": "^18.18 || >=20"
6061
},

packages/chain-controller/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"typedoc-plugin-missing-exports": "^2.0.0",
6262
"typescript": "~4.9.5"
6363
},
64+
"packageManager": "[email protected]",
6465
"engines": {
6566
"node": "^18.18 || >=20"
6667
},

packages/composable-controller/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"typedoc-plugin-missing-exports": "^2.0.0",
5757
"typescript": "~4.9.5"
5858
},
59+
"packageManager": "[email protected]",
5960
"engines": {
6061
"node": "^18.18 || >=20"
6162
},

packages/controller-utils/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"typedoc-plugin-missing-exports": "^2.0.0",
6363
"typescript": "~4.9.5"
6464
},
65+
"packageManager": "[email protected]",
6566
"engines": {
6667
"node": "^18.18 || >=20"
6768
},

packages/ens-controller/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"peerDependencies": {
6262
"@metamask/network-controller": "^19.0.0"
6363
},
64+
"packageManager": "[email protected]",
6465
"engines": {
6566
"node": "^18.18 || >=20"
6667
},

packages/eth-json-rpc-provider/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"typedoc": "^0.24.8",
6161
"typescript": "~4.9.5"
6262
},
63-
"packageManager": "yarn@3.3.0",
63+
"packageManager": "yarn@4.2.2",
6464
"engines": {
6565
"node": "^18.18 || >=20"
6666
},

packages/gas-fee-controller/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"peerDependencies": {
7070
"@metamask/network-controller": "^19.0.0"
7171
},
72+
"packageManager": "[email protected]",
7273
"engines": {
7374
"node": "^18.18 || >=20"
7475
},

packages/json-rpc-engine/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"typedoc": "^0.24.8",
6666
"typescript": "~4.9.5"
6767
},
68-
"packageManager": "yarn@3.3.0",
68+
"packageManager": "yarn@4.2.2",
6969
"engines": {
7070
"node": "^18.18 || >=20"
7171
},

0 commit comments

Comments
 (0)