Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ ignores:
- 'jest-silent-reporter'
- 'prettier-plugin-packagejson'
- 'typescript-eslint'
# Jest environments referenced in jest configs
- 'jest-environment-node'
- 'jest-environment-jsdom'
# Ignore dependencies imported implicitly by tools
- 'eslint-import-resolver-typescript'
# Ignore dependencies which plug into the NPM lifecycle
Expand Down
3 changes: 3 additions & 0 deletions jest.config.packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ module.exports = {
// Here we ensure that Jest resolves `@metamask/*` imports to the uncompiled source code for packages that live in this repo.
// NOTE: This must be synchronized with the `paths` option in `tsconfig.base.json`.
moduleNameMapper: {
// Force uuid and yaml to use CommonJS versions to avoid ESM browser bundle issues
'^uuid$': require.resolve('uuid'),
'^yaml$': require.resolve('yaml'),
'^@metamask/json-rpc-engine/v2$': [
'<rootDir>/../json-rpc-engine/src/v2/index.ts',
],
Expand Down
9 changes: 3 additions & 6 deletions jest.config.scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* NOTE:
* This config uses `babel-jest` due to ESM- / TypeScript-related incompatibilities with our
* current version (`^27`) of `jest` and `ts-jest`. We can switch to `ts-jest` once we have
* current version (`^28`) of `jest` and `ts-jest`. We can switch to `ts-jest` once we have
* migrated our Jest dependencies to version `>=29`.
*/

Expand Down Expand Up @@ -38,12 +38,9 @@ module.exports = {
},
},

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
// This ensures that Babel can resolve subpath exports correctly.
moduleNameMapper: {
'^@metamask/utils/(.+)$': [
'<rootDir>/node_modules/@metamask/utils/dist/$1.cjs',
],
// Force uuid to use CommonJS version to avoid ESM issues
'^uuid$': require.resolve('uuid'),
},

// Disabled due to use of 'transform' below.
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@
"@metamask/network-controller": "^29.0.0",
"@metamask/utils": "^11.9.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"@types/lodash": "^4.14.191",
"@types/node": "^16.18.54",
"@types/semver": "^7",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^8.48.0",
"@typescript-eslint/parser": "^8.48.0",
"@yarnpkg/types": "^4.0.0",
Expand All @@ -87,7 +88,8 @@
"eslint-plugin-promise": "^7.1.0",
"execa": "^5.0.0",
"isomorphic-fetch": "^3.0.0",
"jest": "^27.5.1",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"jest-silent-reporter": "^0.5.0",
"lodash": "^4.17.21",
"nock": "^13.3.1",
Expand All @@ -100,6 +102,8 @@
"tsx": "^4.20.5",
"typescript": "~5.3.3",
"typescript-eslint": "^8.48.0",
"uuid": "^8.3.2",
"yaml": "^2.3.4",
"yargs": "^17.7.2"
},
"packageManager": "yarn@4.10.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/account-tree-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
"@metamask/keyring-api": "^21.0.0",
"@metamask/providers": "^22.1.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
"@metamask/controller-utils": "^11.18.0",
"@metamask/providers": "^22.1.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"@types/readable-stream": "^2.3.0",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/address-book-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/ai-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/analytics-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/analytics-data-regulation-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"jest": "^28.1.3",
"nock": "^13.3.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/announcement-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/app-metadata-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"jest": "^28.1.3",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/approval-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"jest": "^28.1.3",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/assets-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"@types/lodash": "^4.14.191",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/assets-controllers/jest.environment.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const JSDOMEnvironment = require('jest-environment-jsdom');
const { TestEnvironment } = require('jest-environment-jsdom');

// Custom test environment copied from https://github.com/jsdom/jsdom/issues/2524
// in order to add TextEncoder to jsdom. TextEncoder is expected by jose.

module.exports = class CustomTestEnvironment extends JSDOMEnvironment {
module.exports = class CustomTestEnvironment extends TestEnvironment {
async setup() {
await super.setup();
if (typeof this.global.TextEncoder === 'undefined') {
Expand Down
8 changes: 4 additions & 4 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@
"@metamask/keyring-snap-client": "^8.0.0",
"@metamask/providers": "^22.1.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"@types/lodash": "^4.14.191",
"@types/node": "^16.18.54",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"jest-environment-jsdom": "^27.5.1",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"nock": "^13.3.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/base-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
"@metamask/auto-changelog": "^3.4.4",
"@metamask/json-rpc-engine": "^10.2.1",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"@types/sinon": "^9.0.10",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"jest": "^28.1.3",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
8 changes: 4 additions & 4 deletions packages/bridge-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@
"@metamask/eth-json-rpc-provider": "^6.0.0",
"@metamask/superstruct": "^3.1.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"jest-environment-jsdom": "^27.5.1",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"lodash": "^4.17.21",
"nock": "^13.3.1",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
8 changes: 4 additions & 4 deletions packages/bridge-status-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"jest-environment-jsdom": "^27.5.1",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"lodash": "^4.17.21",
"nock": "^13.3.1",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/build-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/chain-agnostic-permission/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-internal-api": "^9.0.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/claims-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
"@metamask/keyring-controller": "^25.1.0",
"@metamask/profile-sync-controller": "^27.0.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/composable-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
"@metamask/auto-changelog": "^3.4.4",
"@metamask/json-rpc-engine": "^10.2.1",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"immer": "^9.0.6",
"jest": "^27.5.1",
"jest": "^28.1.3",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/connectivity-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"@types/jest": "^28.1.8",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/controller-utils/jest.environment.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const JSDOMEnvironment = require('jest-environment-jsdom');
const { TestEnvironment } = require('jest-environment-jsdom');

// Custom test environment copied from https://github.com/jsdom/jsdom/issues/2524
// in order to add TextEncoder to jsdom. TextEncoder is expected by @noble/hashes.

module.exports = class CustomTestEnvironment extends JSDOMEnvironment {
module.exports = class CustomTestEnvironment extends TestEnvironment {
async setup() {
await super.setup();
if (typeof this.global.TextEncoder === 'undefined') {
Expand Down
Loading
Loading