Skip to content

Commit

Permalink
Merge branch 'main' into disable-code-splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmire committed Jun 27, 2024
2 parents 0bf7589 + 879280b commit 296ee53
Show file tree
Hide file tree
Showing 374 changed files with 29,700 additions and 11,833 deletions.
8 changes: 1 addition & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,13 @@ module.exports = {
// TODO: auto-fix breaks stuff
'@typescript-eslint/promise-function-async': 'off',

// TODO: re-enble most of these rules
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
// TODO: re-enable most of these rules
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/prefer-enum-initializers': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/restrict-template-expressions': 'warn',
'no-restricted-syntax': 'off',
'no-restricted-globals': 'off',
},
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x]
outputs:
child-workspace-package-names: ${{ steps.workspace-package-names.outputs.child-workspace-package-names }}
steps:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
needs: prepare
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x]
package-name: ${{ fromJson(needs.prepare.outputs.child-workspace-package-names) }}
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
lts/*
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This repository contains the following packages [^fn1]:
- [`@metamask/name-controller`](packages/name-controller)
- [`@metamask/network-controller`](packages/network-controller)
- [`@metamask/notification-controller`](packages/notification-controller)
- [`@metamask/notification-services-controller`](packages/notification-services-controller)
- [`@metamask/permission-controller`](packages/permission-controller)
- [`@metamask/permission-log-controller`](packages/permission-log-controller)
- [`@metamask/phishing-controller`](packages/phishing-controller)
Expand Down Expand Up @@ -73,6 +74,7 @@ linkStyle default opacity:0.5
name_controller(["@metamask/name-controller"]);
network_controller(["@metamask/network-controller"]);
notification_controller(["@metamask/notification-controller"]);
notification_services_controller(["@metamask/notification-services-controller"]);
permission_controller(["@metamask/permission-controller"]);
permission_log_controller(["@metamask/permission-log-controller"]);
phishing_controller(["@metamask/phishing-controller"]);
Expand Down Expand Up @@ -124,6 +126,10 @@ linkStyle default opacity:0.5
network_controller --> eth_json_rpc_provider;
network_controller --> json_rpc_engine;
notification_controller --> base_controller;
notification_services_controller --> base_controller;
notification_services_controller --> controller_utils;
notification_services_controller --> keyring_controller;
notification_services_controller --> profile_sync_controller;
permission_controller --> base_controller;
permission_controller --> controller_utils;
permission_controller --> json_rpc_engine;
Expand All @@ -138,6 +144,7 @@ linkStyle default opacity:0.5
preferences_controller --> base_controller;
preferences_controller --> controller_utils;
preferences_controller --> keyring_controller;
profile_sync_controller --> base_controller;
queued_request_controller --> base_controller;
queued_request_controller --> controller_utils;
queued_request_controller --> json_rpc_engine;
Expand All @@ -154,11 +161,13 @@ linkStyle default opacity:0.5
signature_controller --> keyring_controller;
signature_controller --> logging_controller;
signature_controller --> message_manager;
transaction_controller --> accounts_controller;
transaction_controller --> approval_controller;
transaction_controller --> base_controller;
transaction_controller --> controller_utils;
transaction_controller --> gas_fee_controller;
transaction_controller --> network_controller;
transaction_controller --> eth_json_rpc_provider;
user_operation_controller --> approval_controller;
user_operation_controller --> base_controller;
user_operation_controller --> controller_utils;
Expand Down
4 changes: 2 additions & 2 deletions constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ gen_enforced_dependency(WorkspaceCwd, DependencyIdent, CorrectPeerDependencyRang
atom_concat('^', CurrentDependencyVersion, CorrectPeerDependencyRange)
).

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

% All published packages are public.
gen_enforced_field(WorkspaceCwd, 'publishConfig.access', 'public') :-
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Getting started

- Install [Node.js](https://nodejs.org) version 16.
- If you're using [NVM](https://github.com/creationix/nvm#installation) (recommended), `nvm use` will ensure that the right version is installed.
- 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).
- 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
3 changes: 1 addition & 2 deletions jest.config.packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ module.exports = {

// "resetMocks" resets all mocks, including mocked modules, to jest.fn(),
// between each test case.
// TODO: Enable
// resetMocks: true,
resetMocks: true,

// Reset the module registry before running each individual test
// resetModules: false,
Expand Down
6 changes: 6 additions & 0 deletions jest.config.scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ module.exports = {
// // A preset that is used as a base for Jest's configuration
// preset: 'ts-jest',

// "resetMocks" resets all mocks, including mocked modules, to jest.fn(),
// between each test case.
resetMocks: true,

// "restoreMocks" restores all mocks created using jest.spyOn to their
// original implementations, between each test. It does not affect mocked
// modules.
restoreMocks: true,

setupFilesAfterEnv: ['./tests/scripts-setup.ts'],

// The test environment that will be used for testing
testEnvironment: 'node',

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/core-monorepo",
"version": "154.0.0",
"version": "167.0.0",
"private": true,
"description": "Monorepo for packages shared between MetaMask clients",
"repository": {
Expand Down Expand Up @@ -49,14 +49,15 @@
"@babel/core": "^7.23.5",
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@lavamoat/allow-scripts": "^3.0.2",
"@lavamoat/allow-scripts": "^3.0.4",
"@metamask/create-release-branch": "^3.0.0",
"@metamask/eslint-config": "^12.2.0",
"@metamask/eslint-config-jest": "^12.1.0",
"@metamask/eslint-config-nodejs": "^12.1.0",
"@metamask/eslint-config-typescript": "^12.1.0",
"@metamask/eth-json-rpc-provider": "^3.0.2",
"@metamask/json-rpc-engine": "^8.0.2",
"@metamask/eth-block-tracker": "^9.0.3",
"@metamask/eth-json-rpc-provider": "^4.0.0",
"@metamask/json-rpc-engine": "^9.0.0",
"@metamask/utils": "^8.3.0",
"@types/jest": "^27.4.1",
"@types/node": "^16.18.54",
Expand All @@ -74,7 +75,6 @@
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eth-block-tracker": "^8.0.0",
"execa": "^5.0.0",
"isomorphic-fetch": "^3.0.0",
"jest": "^27.5.1",
Expand All @@ -90,7 +90,7 @@
},
"packageManager": "[email protected]",
"engines": {
"node": ">=16.0.0"
"node": "^18.18 || >=20"
},
"lavamoat": {
"allowScripts": {
Expand Down
69 changes: 68 additions & 1 deletion packages/accounts-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,68 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [17.1.1]

### Fixed

- Handle edge case of undefined `selectedAccount` during onboarding for `getSelectedMultichainAccount` ([#4466](https://github.com/MetaMask/core/pull/4466))

## [17.1.0]

### Added

- Add `AccountsController:listMultichainAccounts` action ([#4426](https://github.com/MetaMask/core/pull/4426))

### Fixed

- Refactored `getSelectedAccount` to handle case when there are no accounts to return. The logic was previously contained in `getAccountExpect` has been transferred to `getSelectedAccount`. ([#4322](https://github.com/MetaMask/core/pull/4322))
- Updated `handleAccountRemoved` to automatically select the most recent account if the removed account was the currently selected account. ([#4322](https://github.com/MetaMask/core/pull/4322))
- Move `@metamask/keyring-controller` to dependency ([#4425](https://github.com/MetaMask/core/pull/4425))

## [17.0.0]

### Changed

- **BREAKING:** Newly added account is no longer set as the last selected account ([#4363](https://github.com/MetaMask/core/pull/4363))
- Bump `@metamask/eth-snap-keyring` to `^4.3.1` ([#4405](https://github.com/MetaMask/core/pull/4405))
- Bump `@metamask/keyring-api` to `^8.0.0` ([#4405](https://github.com/MetaMask/core/pull/4405))
- Bump `@metamask/keyring-controller` to `^17.1.0` (`devDependencies`) ([#4413](https://github.com/MetaMask/core/pull/4413))

### Fixed

- Use `listMultichainAccount` in `getAccountByAddress` ([#4375](https://github.com/MetaMask/core/pull/4375))

## [16.0.0]

### Changed

- **BREAKING:** Bump minimum Node version to 18.18 ([#3611](https://github.com/MetaMask/core/pull/3611))
- **BREAKING:** Bump peer dependency `@metamask/keyring-controller` to `^17.0.0` ([#4352](https://github.com/MetaMask/core/pull/4352))
- Bump `@metamask/base-controller` to `^6.0.0` ([#4352](https://github.com/MetaMask/core/pull/4352))

## [15.0.0]

### Added

- Add `getNextAvailableAccountName` method and `AccountsController:getNextAvailableAccountName` controller action ([#4326](https://github.com/MetaMask/core/pull/4326))
- Add `listMultichainAccounts` method for getting accounts on a specific chain or the default chain ([#4330](https://github.com/MetaMask/core/pull/4330))
- Add `getSelectedMultichainAccount` method and `AccountsController:getSelectedMultichainAccount` controller action for getting the selected account on a specific chain or the default chain ([#4330](https://github.com/MetaMask/core/pull/4330))

### Changed

- **BREAKING:** Bump peer dependency `@metamask/snaps-controllers` to `^8.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262))
- **BREAKING:** Bump peer dependency `@metamask/keyring-controller` to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342))
- **BREAKING:** `listAccounts` now filters the list of accounts in state to EVM accounts ([#4330](https://github.com/MetaMask/core/pull/4330))
- **BREAKING:** `getSelectedAccount` now throws if the selected account is not an EVM account ([#4330](https://github.com/MetaMask/core/pull/4330))
- Bump `@metamask/eth-snap-keyring` to `^4.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262))
- Bump `@metamask/keyring-api` to `^6.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262))
- Bump `@metamask/snaps-sdk` to `^4.2.0` ([#4262](https://github.com/MetaMask/core/pull/4262))
- Bump `@metamask/snaps-utils` to `^7.4.0` ([#4262](https://github.com/MetaMask/core/pull/4262))

### Fixed

- Fix "Type instantiation is excessively deep and possibly infinite" TypeScript error ([#4331](https://github.com/MetaMask/core/pull/4331))

## [14.0.0]

### Changed
Expand Down Expand Up @@ -171,7 +233,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release ([#1637](https://github.com/MetaMask/core/pull/1637))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[17.1.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[17.1.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[17.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[16.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[15.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[14.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[13.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[12.0.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
2 changes: 2 additions & 0 deletions packages/accounts-controller/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,

coveragePathIgnorePatterns: ['./src/tests'],

// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
Expand Down
14 changes: 7 additions & 7 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/accounts-controller",
"version": "14.0.0",
"version": "17.1.1",
"description": "Manages internal accounts",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -42,9 +42,10 @@
},
"dependencies": {
"@ethereumjs/util": "^8.1.0",
"@metamask/base-controller": "^5.0.2",
"@metamask/eth-snap-keyring": "^4.1.1",
"@metamask/keyring-api": "^6.1.1",
"@metamask/base-controller": "^6.0.0",
"@metamask/eth-snap-keyring": "^4.3.1",
"@metamask/keyring-api": "^8.0.0",
"@metamask/keyring-controller": "^17.1.0",
"@metamask/snaps-sdk": "^4.2.0",
"@metamask/snaps-utils": "^7.4.0",
"@metamask/utils": "^8.3.0",
Expand All @@ -55,7 +56,6 @@
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-controller": "^16.0.0",
"@metamask/snaps-controllers": "^8.1.1",
"@types/jest": "^27.4.1",
"@types/readable-stream": "^2.3.0",
Expand All @@ -67,11 +67,11 @@
"typescript": "~4.9.5"
},
"peerDependencies": {
"@metamask/keyring-controller": "^16.0.0",
"@metamask/keyring-controller": "^17.0.0",
"@metamask/snaps-controllers": "^8.1.1"
},
"engines": {
"node": ">=16.0.0"
"node": "^18.18 || >=20"
},
"publishConfig": {
"access": "public",
Expand Down
Loading

0 comments on commit 296ee53

Please sign in to comment.