Skip to content

Commit

Permalink
Bump Yarn to 4.2.2
Browse files Browse the repository at this point in the history
This allows us to use newer features of Yarn. For instance, we will be
able to write constraints in JavaScript format rather than Prolog.
  • Loading branch information
mcmire committed Jun 6, 2024
1 parent 9f3498a commit 3b66efd
Show file tree
Hide file tree
Showing 44 changed files with 4,411 additions and 5,002 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ensure-blocking-pr-labels-absent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ jobs:
permissions:
pull-requests: read
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
- name: Install dependencies
run: yarn --immutable
- name: Install Yarn
run: corepack enable
- run: yarn --immutable
- name: Run command
uses: actions/github-script@v7
with:
Expand Down
30 changes: 20 additions & 10 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ jobs:
outputs:
child-workspace-package-names: ${{ steps.workspace-package-names.outputs.child-workspace-package-names }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn
run: corepack enable
- run: yarn --immutable
- name: Fetch workspace package names
id: workspace-package-names
Expand All @@ -34,12 +36,14 @@ jobs:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn
run: corepack enable
- run: yarn --immutable
- run: yarn lint
- name: Require clean working directory
Expand All @@ -59,12 +63,14 @@ jobs:
node-version: [20.x]
package-name: ${{ fromJson(needs.prepare.outputs.child-workspace-package-names) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn
run: corepack enable
- run: yarn --immutable
- run: yarn workspace ${{ matrix.package-name }} changelog:validate
- name: Require clean working directory
Expand All @@ -83,12 +89,14 @@ jobs:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn
run: corepack enable
- run: yarn --immutable
- run: yarn build
- name: Require clean working directory
Expand All @@ -108,12 +116,14 @@ jobs:
node-version: [18.x, 20.x]
package-name: ${{ fromJson(needs.prepare.outputs.child-workspace-package-names) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn
run: corepack enable
- run: yarn --immutable
- run: yarn test:scripts
- run: yarn workspace ${{ matrix.package-name }} run test
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ jobs:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Setup Node
uses: actions/setup-node@v3
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install Yarn
run: corepack enable
- name: Restore Yarn cache
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
Expand All @@ -38,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
needs: publish-release
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- uses: actions/cache@v3
Expand All @@ -62,7 +68,7 @@ jobs:
runs-on: ubuntu-latest
needs: publish-npm-dry-run
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- uses: actions/cache@v3
Expand Down
52 changes: 0 additions & 52 deletions .yarn/plugins/@yarnpkg/plugin-constraints.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

807 changes: 0 additions & 807 deletions .yarn/releases/yarn-3.3.0.cjs

This file was deleted.

12 changes: 5 additions & 7 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
compressionLevel: mixed

enableGlobalCache: false

enableScripts: false

enableTelemetry: 0
enableTelemetry: false

logFilters:
- code: YN0004
Expand All @@ -11,9 +15,3 @@ nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
spec: "https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs
spec: "@yarnpkg/plugin-constraints"

yarnPath: .yarn/releases/yarn-3.3.0.cjs
3 changes: 3 additions & 0 deletions constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ gen_enforced_dependency(WorkspaceCwd, DependencyIdent, CorrectPeerDependencyRang
atom_concat('^', CurrentDependencyVersion, CorrectPeerDependencyRange)
).

% All packages must specify the exact version of Yarn required for development.
gen_enforced_field(WorkspaceCwd, 'packageManager', '[email protected]').

% All packages must specify a minimum Node version of 18.
gen_enforced_field(WorkspaceCwd, 'engines.node', '^18.18 || >=20').

Expand Down
3 changes: 2 additions & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

- Install the current LTS version of [Node.js](https://nodejs.org)
- 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.
- Install [Yarn v3](https://yarnpkg.com/getting-started/install).
- Install [Yarn](https://yarnpkg.com) via [Corepack](https://github.com/nodejs/corepack?tab=readme-ov-file#how-to-install)
- If you have Yarn installed globally via Homebrew or NPM, you'll need to uninstall it before enabling it via Corepack.
- Run `yarn install` to install dependencies and run any required post-install scripts.
- 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.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"typescript": "~4.9.5",
"yargs": "^17.7.2"
},
"packageManager": "yarn@3.3.0",
"packageManager": "yarn@4.2.2",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"@metamask/keyring-controller": "^17.0.0",
"@metamask/snaps-controllers": "^8.1.1"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/address-book-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/announcement-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/approval-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"@metamask/network-controller": "^19.0.0",
"@metamask/preferences-controller": "^13.0.0"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/base-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/build-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/chain-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/composable-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/controller-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/ens-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"peerDependencies": {
"@metamask/network-controller": "^19.0.0"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/eth-json-rpc-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"typedoc": "^0.24.8",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand All @@ -72,5 +71,6 @@
"allowScripts": {
"@lavamoat/preinstall-always-fail": false
}
}
},
"packageManager": "[email protected]"
}
1 change: 1 addition & 0 deletions packages/gas-fee-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"peerDependencies": {
"@metamask/network-controller": "^19.0.0"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/json-rpc-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"typedoc": "^0.24.8",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand All @@ -77,5 +76,6 @@
"allowScripts": {
"@lavamoat/preinstall-always-fail": false
}
}
},
"packageManager": "[email protected]"
}
1 change: 1 addition & 0 deletions packages/json-rpc-middleware-stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"typescript": "~4.9.5",
"webextension-polyfill-ts": "^0.26.0"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/keyring-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"typescript": "~4.9.5",
"uuid": "^8.3.2"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/logging-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/message-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/name-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/notification-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/permission-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"peerDependencies": {
"@metamask/approval-controller": "^7.0.0"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
1 change: 1 addition & 0 deletions packages/permission-log-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
Loading

0 comments on commit 3b66efd

Please sign in to comment.