diff --git a/.eslintrc.js b/.eslintrc.js index 7af4a6eab..c378adac0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,6 +2,7 @@ const parserOptions = { tsconfigRootDir: __dirname, project: ['./tsconfig.packages.json'], + sourceType: 'module', }; module.exports = { @@ -79,6 +80,7 @@ module.exports = { // @metamask/keyring-eth-hd { files: ['packages/keyring-eth-hd/**/*.js'], + excludedFiles: ['packages/keyring-eth-hd/jest.config.js'], extends: ['@metamask/eslint-config-nodejs'], parserOptions, rules: { diff --git a/package.json b/package.json index e6cdbc435..fcc86b337 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,9 @@ "packages/*" ], "scripts": { - "build": "yarn run build:source && yarn run build:types", - "build:clean": "rimraf dist 'packages/*/dist' && yarn build:force", + "build": "ts-bridge --project tsconfig.build.json", + "build:clean": "yarn build --clean", "build:docs": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run build:docs", - "build:force": "yarn run build:source:force && yarn run build:types", - "build:source": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run build", - "build:source:force": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run build:force", - "build:types": "tsc --build tsconfig.build.json --verbose", - "build:watch": "yarn run build --watch", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn constraints && yarn lint:dependencies", "lint:dependencies": "depcheck && yarn dedupe --check && syncpack list-mismatches", "lint:dependencies:fix": "depcheck && yarn dedupe && syncpack fix-mismatches", @@ -51,6 +46,7 @@ "@metamask/eslint-config-nodejs": "^13.0.0", "@metamask/eslint-config-typescript": "^13.0.0", "@npmcli/package-json": "^5.0.0", + "@ts-bridge/cli": "^0.6.0", "@types/jest": "^29.5.12", "@types/node": "^20.12.12", "@typescript-eslint/eslint-plugin": "^8.5.0", @@ -70,7 +66,6 @@ "jest-silent-reporter": "^0.5.0", "prettier": "^2.8.8", "prettier-plugin-packagejson": "^2.5.2", - "rimraf": "^5.0.10", "syncpack": "^13.0.0", "ts-jest": "^29.0.5", "ts-node": "^10.9.2", diff --git a/packages/keyring-api/package.json b/packages/keyring-api/package.json index 2ea14977c..7c9406c43 100644 --- a/packages/keyring-api/package.json +++ b/packages/keyring-api/package.json @@ -15,16 +15,27 @@ "type": "git", "url": "https://github.com/MetaMask/keyring-api.git" }, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "main": "./dist/index.cjs", + "types": "./dist/index.d.cts", "files": [ "dist/" ], "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:clean": "rimraf dist && yarn build", + "build": "ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", "build:docs": "typedoc", - "build:force": "tsc --build tsconfig.build.json --force", "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-api", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-api", "publish:preview": "yarn npm publish --tag preview", @@ -48,6 +59,7 @@ "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/auto-changelog": "^3.4.4", "@metamask/providers": "^18.1.0", + "@ts-bridge/cli": "^0.6.0", "@types/jest": "^29.5.12", "@types/node": "^20.12.12", "@types/webextension-polyfill": "^0.12.1", @@ -55,7 +67,6 @@ "depcheck": "^1.4.7", "jest": "^29.5.0", "jest-it-up": "^3.1.0", - "rimraf": "^5.0.10", "ts-jest": "^29.0.5", "ts-node": "^10.9.2", "tsd": "^0.31.0", diff --git a/packages/keyring-eth-hd/jest.config.js b/packages/keyring-eth-hd/jest.config.js index f5802c498..d34eba814 100644 --- a/packages/keyring-eth-hd/jest.config.js +++ b/packages/keyring-eth-hd/jest.config.js @@ -14,6 +14,9 @@ module.exports = merge(baseConfig, { // The display name when running multiple projects displayName, + // A preset that is used as a base for Jest's configuration + preset: 'ts-jest/presets/js-with-ts', + // An array of regexp pattern strings used to skip coverage collection coveragePathIgnorePatterns: ['./test'], diff --git a/packages/keyring-eth-hd/package.json b/packages/keyring-eth-hd/package.json index d84970614..8761d1916 100644 --- a/packages/keyring-eth-hd/package.json +++ b/packages/keyring-eth-hd/package.json @@ -16,11 +16,27 @@ }, "license": "ISC", "author": "Dan Finlay", - "main": "index.js", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "main": "./dist/index.cjs", + "types": "./dist/index.d.cts", + "files": [ + "dist/" + ], "scripts": { - "build": "", - "build:clean": "", - "build:force": "", + "build": "ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", + "build:docs": "typedoc", "changelog:update": "../../scripts/update-changelog.sh @metamask/eth-hd-keyring", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/eth-hd-keyring", "publish:preview": "yarn npm publish --tag preview", @@ -41,6 +57,7 @@ "@metamask/auto-changelog": "^3.4.4", "@metamask/bip39": "^4.0.0", "@metamask/eth-hd-keyring": "4.0.1", + "@ts-bridge/cli": "^0.6.0", "@types/jest": "^29.5.12", "deepmerge": "^4.2.2", "jest": "^29.5.0" diff --git a/packages/keyring-eth-hd/index.js b/packages/keyring-eth-hd/src/index.js similarity index 92% rename from packages/keyring-eth-hd/index.js rename to packages/keyring-eth-hd/src/index.js index 1e8a45f9b..df908b565 100644 --- a/packages/keyring-eth-hd/index.js +++ b/packages/keyring-eth-hd/src/index.js @@ -1,11 +1,11 @@ -const { +import { privateToPublic, publicToAddress, ecsign, arrToBufArr, bufferToHex, -} = require('@ethereumjs/util'); -const { +} from '@ethereumjs/util'; +import { concatSig, decrypt, getEncryptionPublicKey, @@ -13,13 +13,18 @@ const { personalSign, signTypedData, SignTypedDataVersion, -} = require('@metamask/eth-sig-util'); -const bip39 = require('@metamask/scure-bip39'); -const { wordlist } = require('@metamask/scure-bip39/dist/wordlists/english'); -const { assertIsHexString, remove0x } = require('@metamask/utils'); -const { HDKey } = require('ethereum-cryptography/hdkey'); -const { keccak256 } = require('ethereum-cryptography/keccak'); -const { bytesToHex } = require('ethereum-cryptography/utils'); +} from '@metamask/eth-sig-util'; +import { + generateMnemonic, + // eslint-disable-next-line n/no-sync + mnemonicToSeedSync, + validateMnemonic, +} from '@metamask/scure-bip39'; +import { wordlist } from '@metamask/scure-bip39/dist/wordlists/english'; +import { assertIsHexString, remove0x } from '@metamask/utils'; +import { HDKey } from 'ethereum-cryptography/hdkey'; +import { keccak256 } from 'ethereum-cryptography/keccak'; +import { bytesToHex } from 'ethereum-cryptography/utils'; // Options: const hdPathString = `m/44'/60'/0'/0`; @@ -34,7 +39,7 @@ class HdKeyring { } generateRandomMnemonic() { - this._initFromMnemonic(bip39.generateMnemonic(wordlist)); + this._initFromMnemonic(generateMnemonic(wordlist)); } _uint8ArrayToString(mnemonic) { @@ -287,7 +292,7 @@ class HdKeyring { this.mnemonic = this._mnemonicToUint8Array(mnemonic); // validate before initializing - const isValid = bip39.validateMnemonic(this.mnemonic, wordlist); + const isValid = validateMnemonic(this.mnemonic, wordlist); if (!isValid) { throw new Error( 'Eth-Hd-Keyring: Invalid secret recovery phrase provided', @@ -295,7 +300,7 @@ class HdKeyring { } // eslint-disable-next-line n/no-sync - const seed = bip39.mnemonicToSeedSync(this.mnemonic, wordlist); + const seed = mnemonicToSeedSync(this.mnemonic, wordlist); this.hdWallet = HDKey.fromMasterSeed(seed); this.root = this.hdWallet.derive(this.hdPath); } @@ -309,4 +314,4 @@ class HdKeyring { } HdKeyring.type = type; -module.exports = HdKeyring; +export default HdKeyring; diff --git a/packages/keyring-eth-hd/test/index.js b/packages/keyring-eth-hd/test/index.js index 30f7edfd6..9930d8aca 100644 --- a/packages/keyring-eth-hd/test/index.js +++ b/packages/keyring-eth-hd/test/index.js @@ -1,17 +1,14 @@ -const { - TransactionFactory, - Transaction: EthereumTx, -} = require('@ethereumjs/tx'); -const { +import { TransactionFactory, Transaction as EthereumTx } from '@ethereumjs/tx'; +import { isValidAddress, bufferToHex, toBuffer, ecrecover, pubToAddress, -} = require('@ethereumjs/util'); -const oldMMForkBIP39 = require('@metamask/bip39'); -const OldHdKeyring = require('@metamask/eth-hd-keyring'); -const { +} from '@ethereumjs/util'; +import * as oldMMForkBIP39 from '@metamask/bip39'; +import OldHdKeyring from '@metamask/eth-hd-keyring'; +import { normalize, personalSign, recoverPersonalSignature, @@ -19,11 +16,11 @@ const { signTypedData, SignTypedDataVersion, encrypt, -} = require('@metamask/eth-sig-util'); -const { wordlist } = require('@metamask/scure-bip39/dist/wordlists/english'); -const { keccak256 } = require('ethereum-cryptography/keccak'); +} from '@metamask/eth-sig-util'; +import { wordlist } from '@metamask/scure-bip39/dist/wordlists/english'; +import { keccak256 } from 'ethereum-cryptography/keccak'; -const HdKeyring = require('..'); +import HdKeyring from '../src'; // Sample account: const privKeyHex = diff --git a/packages/keyring-eth-hd/tsconfig.build.json b/packages/keyring-eth-hd/tsconfig.build.json new file mode 100644 index 000000000..d0e4b01a5 --- /dev/null +++ b/packages/keyring-eth-hd/tsconfig.build.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.packages.build.json", + "compilerOptions": { + "allowJs": true, + "baseUrl": "./", + "outDir": "dist", + "rootDir": "src", + "exactOptionalPropertyTypes": false + }, + "include": ["./src/**/*.ts", "./src/**/*.js"], + "exclude": ["./src/**/*.test.ts"] +} diff --git a/packages/keyring-eth-hd/tsconfig.json b/packages/keyring-eth-hd/tsconfig.json new file mode 100644 index 000000000..389f52c34 --- /dev/null +++ b/packages/keyring-eth-hd/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.packages.json", + "compilerOptions": { + "allowJs": true, + "baseUrl": "./", + "exactOptionalPropertyTypes": false, + "target": "es2017" + }, + "include": ["./src"], + "exclude": ["./dist/**/*"] +} diff --git a/packages/keyring-eth-ledger-bridge/package.json b/packages/keyring-eth-ledger-bridge/package.json index 3726caca6..8e185afe1 100644 --- a/packages/keyring-eth-ledger-bridge/package.json +++ b/packages/keyring-eth-ledger-bridge/package.json @@ -18,16 +18,27 @@ }, "license": "ISC", "author": "Bruno Barbieri", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "main": "./dist/index.cjs", + "types": "./dist/index.d.cts", "files": [ "dist/" ], "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:clean": "rimraf dist && yarn build", + "build": "ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", "build:docs": "typedoc", - "build:force": "tsc --build tsconfig.build.json --force", "changelog:update": "../../scripts/update-changelog.sh @metamask/eth-ledger-bridge-keyring", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/eth-ledger-bridge-keyring", "publish:preview": "yarn npm publish --tag preview", @@ -52,6 +63,7 @@ "@ledgerhq/types-devices": "^6.25.3", "@metamask/auto-changelog": "^3.4.4", "@metamask/utils": "^9.2.1", + "@ts-bridge/cli": "^0.6.0", "@types/ethereumjs-tx": "^1.0.1", "@types/hdkey": "^2.0.1", "@types/jest": "^29.5.12", @@ -62,7 +74,6 @@ "ethereumjs-tx": "^1.3.7", "jest": "^29.5.0", "jest-it-up": "^3.1.0", - "rimraf": "^5.0.10", "ts-jest": "^29.0.5", "ts-node": "^10.9.2", "typedoc": "^0.25.13", diff --git a/packages/keyring-eth-simple/package.json b/packages/keyring-eth-simple/package.json index e5226cf1f..7829573ff 100644 --- a/packages/keyring-eth-simple/package.json +++ b/packages/keyring-eth-simple/package.json @@ -14,16 +14,27 @@ "type": "git", "url": "https://github.com/MetaMask/eth-simple-keyring.git" }, - "main": "dist/index.js", - "types": "dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "main": "./dist/index.cjs", + "types": "./dist/index.d.cts", "files": [ "dist/" ], "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:clean": "rimraf dist && yarn build", + "build": "ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", "build:docs": "typedoc", - "build:force": "tsc --build tsconfig.build.json --force", "changelog:update": "../../scripts/update-changelog.sh @metamask/eth-simple-keyring", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/eth-simple-keyring", "publish:preview": "yarn npm publish --tag preview", @@ -44,6 +55,7 @@ "@lavamoat/allow-scripts": "^3.2.1", "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/auto-changelog": "^3.4.4", + "@ts-bridge/cli": "^0.6.0", "@types/ethereumjs-tx": "^1.0.1", "@types/jest": "^29.5.12", "@types/node": "^20.12.12", diff --git a/packages/keyring-eth-trezor/package.json b/packages/keyring-eth-trezor/package.json index 4611bd5d5..a0536dff9 100644 --- a/packages/keyring-eth-trezor/package.json +++ b/packages/keyring-eth-trezor/package.json @@ -18,16 +18,27 @@ }, "license": "ISC", "author": "Bruno Barbieri", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "main": "./dist/index.cjs", + "types": "./dist/index.d.cts", "files": [ "dist/" ], "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:clean": "rimraf dist && yarn build", + "build": "ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", "build:docs": "typedoc", - "build:force": "tsc --build tsconfig.build.json --force", "changelog:update": "../../scripts/update-changelog.sh @metamask/eth-trezor-keyring", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/eth-trezor-keyring", "publish:preview": "yarn npm publish --tag preview", @@ -49,6 +60,7 @@ "@lavamoat/allow-scripts": "^3.2.1", "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/auto-changelog": "^3.4.4", + "@ts-bridge/cli": "^0.6.0", "@types/ethereumjs-tx": "^1.0.1", "@types/hdkey": "^2.0.1", "@types/jest": "^29.5.12", @@ -61,7 +73,6 @@ "jest": "^29.5.0", "jest-environment-jsdom": "^29.7.0", "jest-it-up": "^3.1.0", - "rimraf": "^5.0.10", "sinon": "^19.0.2", "ts-jest": "^29.0.5", "ts-node": "^10.9.2", diff --git a/packages/keyring-snap-bridge/package.json b/packages/keyring-snap-bridge/package.json index 2125bb44c..153de6694 100644 --- a/packages/keyring-snap-bridge/package.json +++ b/packages/keyring-snap-bridge/package.json @@ -6,16 +6,27 @@ "type": "git", "url": "https://github.com/MetaMask/eth-snap-keyring.git" }, - "main": "dist/index.js", - "types": "dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "main": "./dist/index.cjs", + "types": "./dist/index.d.cts", "files": [ "dist/" ], "scripts": { - "build": "yarn workspace $(jq -r '.name' ../keyring-api/package.json) build:force && tsc --build tsconfig.build.json", - "build:clean": "rimraf dist && yarn build", + "build": "yarn workspace $(jq -r '.name' ../keyring-api/package.json) build:force && ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", "build:docs": "typedoc", - "build:force": "tsc --build tsconfig.build.json --force", "changelog:update": "../../scripts/update-changelog.sh @metamask/eth-snap-keyring", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/eth-snap-keyring", "publish:preview": "yarn npm publish --tag preview", @@ -38,13 +49,13 @@ "@lavamoat/allow-scripts": "^3.2.1", "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/auto-changelog": "^3.4.4", + "@ts-bridge/cli": "^0.6.0", "@types/jest": "^29.5.12", "@types/node": "^20.12.12", "deepmerge": "^4.2.2", "depcheck": "^1.4.7", "jest": "^29.5.0", "jest-it-up": "^3.1.0", - "rimraf": "^5.0.10", "ts-jest": "^29.0.5", "ts-node": "^10.9.2", "typedoc": "^0.25.13", diff --git a/packages/keyring-snap-bridge/src/KeyringSnapControllerClient.ts b/packages/keyring-snap-bridge/src/KeyringSnapControllerClient.ts index aaabe488c..c369470fc 100644 --- a/packages/keyring-snap-bridge/src/KeyringSnapControllerClient.ts +++ b/packages/keyring-snap-bridge/src/KeyringSnapControllerClient.ts @@ -1,5 +1,5 @@ -import { KeyringClient } from '@metamask/keyring-api'; import type { JsonRpcRequest, Sender } from '@metamask/keyring-api'; +import { KeyringClient } from '@metamask/keyring-api'; import type { SnapController } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; import type { HandlerType } from '@metamask/snaps-utils'; diff --git a/tsconfig.packages.build.json b/tsconfig.packages.build.json index b50d0c283..851885f4a 100644 --- a/tsconfig.packages.build.json +++ b/tsconfig.packages.build.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.packages.json", "compilerOptions": { "declaration": true, - "declarationMap": false, + "declarationMap": true, "noEmit": false, "inlineSources": true, "sourceMap": true diff --git a/yarn.lock b/yarn.lock index 2c78ebe3c..4a5d01f7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1648,6 +1648,7 @@ __metadata: "@metamask/eslint-config-nodejs": "npm:^13.0.0" "@metamask/eslint-config-typescript": "npm:^13.0.0" "@npmcli/package-json": "npm:^5.0.0" + "@ts-bridge/cli": "npm:^0.6.0" "@types/jest": "npm:^29.5.12" "@types/node": "npm:^20.12.12" "@typescript-eslint/eslint-plugin": "npm:^8.5.0" @@ -1667,7 +1668,6 @@ __metadata: jest-silent-reporter: "npm:^0.5.0" prettier: "npm:^2.8.8" prettier-plugin-packagejson: "npm:^2.5.2" - rimraf: "npm:^5.0.10" syncpack: "npm:^13.0.0" ts-jest: "npm:^29.0.5" ts-node: "npm:^10.9.2" @@ -1877,6 +1877,7 @@ __metadata: "@metamask/eth-sig-util": "npm:^8.0.0" "@metamask/scure-bip39": "npm:^2.1.1" "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.6.0" "@types/jest": "npm:^29.5.12" deepmerge: "npm:^4.2.2" ethereum-cryptography: "npm:^2.1.2" @@ -1901,6 +1902,7 @@ __metadata: "@metamask/auto-changelog": "npm:^3.4.4" "@metamask/eth-sig-util": "npm:^8.0.0" "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.6.0" "@types/ethereumjs-tx": "npm:^1.0.1" "@types/hdkey": "npm:^2.0.1" "@types/jest": "npm:^29.5.12" @@ -1912,7 +1914,6 @@ __metadata: hdkey: "npm:^2.1.0" jest: "npm:^29.5.0" jest-it-up: "npm:^3.1.0" - rimraf: "npm:^5.0.10" ts-jest: "npm:^29.0.5" ts-node: "npm:^10.9.2" typedoc: "npm:^0.25.13" @@ -1968,6 +1969,7 @@ __metadata: "@metamask/auto-changelog": "npm:^3.4.4" "@metamask/eth-sig-util": "npm:^8.0.0" "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.6.0" "@types/ethereumjs-tx": "npm:^1.0.1" "@types/jest": "npm:^29.5.12" "@types/node": "npm:^20.12.12" @@ -1999,6 +2001,7 @@ __metadata: "@metamask/snaps-utils": "npm:^8.3.0" "@metamask/superstruct": "npm:^3.1.0" "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.6.0" "@types/jest": "npm:^29.5.12" "@types/node": "npm:^20.12.12" "@types/uuid": "npm:^9.0.8" @@ -2006,7 +2009,6 @@ __metadata: depcheck: "npm:^1.4.7" jest: "npm:^29.5.0" jest-it-up: "npm:^3.1.0" - rimraf: "npm:^5.0.10" ts-jest: "npm:^29.0.5" ts-node: "npm:^10.9.2" typedoc: "npm:^0.25.13" @@ -2030,6 +2032,7 @@ __metadata: "@metamask/eth-sig-util": "npm:^8.0.0" "@trezor/connect-plugin-ethereum": "npm:^9.0.3" "@trezor/connect-web": "npm:^9.1.11" + "@ts-bridge/cli": "npm:^0.6.0" "@types/ethereumjs-tx": "npm:^1.0.1" "@types/hdkey": "npm:^2.0.1" "@types/jest": "npm:^29.5.12" @@ -2043,7 +2046,6 @@ __metadata: jest: "npm:^29.5.0" jest-environment-jsdom: "npm:^29.7.0" jest-it-up: "npm:^3.1.0" - rimraf: "npm:^5.0.10" sinon: "npm:^19.0.2" ts-jest: "npm:^29.0.5" ts-node: "npm:^10.9.2" @@ -2123,6 +2125,7 @@ __metadata: "@metamask/snaps-sdk": "npm:^6.7.0" "@metamask/superstruct": "npm:^3.1.0" "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.6.0" "@types/jest": "npm:^29.5.12" "@types/node": "npm:^20.12.12" "@types/uuid": "npm:^9.0.8" @@ -2132,7 +2135,6 @@ __metadata: depcheck: "npm:^1.4.7" jest: "npm:^29.5.0" jest-it-up: "npm:^3.1.0" - rimraf: "npm:^5.0.10" ts-jest: "npm:^29.0.5" ts-node: "npm:^10.9.2" tsd: "npm:^0.31.0" @@ -3092,6 +3094,30 @@ __metadata: languageName: node linkType: hard +"@ts-bridge/cli@npm:^0.6.0": + version: 0.6.0 + resolution: "@ts-bridge/cli@npm:0.6.0" + dependencies: + "@ts-bridge/resolver": "npm:^0.2.0" + chalk: "npm:^5.3.0" + cjs-module-lexer: "npm:^1.3.1" + yargs: "npm:^17.7.2" + peerDependencies: + typescript: ">=4.8.0" + bin: + ts-bridge: ./dist/index.js + tsbridge: ./dist/index.js + checksum: 10/a23da563b99c56124538fbaf77a2d7a0ad01c898c86ab3be527e3dbe0b22f380daa9207bfeffd8591508ed878959ba168daf6197e06822ba8a3b62dfd7396dab + languageName: node + linkType: hard + +"@ts-bridge/resolver@npm:^0.2.0": + version: 0.2.0 + resolution: "@ts-bridge/resolver@npm:0.2.0" + checksum: 10/d4cfd1f47e9648a5f9c893b1b076adabde3a57cbe81ef823bcbbcc77a122fb6f06d99f40ff48198f8dc766bfc4b3b351d4e87cfcf2db64f7e6db924eb82a5db1 + languageName: node + linkType: hard + "@tsconfig/node10@npm:^1.0.7": version: 1.0.8 resolution: "@tsconfig/node10@npm:1.0.8" @@ -4803,10 +4829,10 @@ __metadata: languageName: node linkType: hard -"cjs-module-lexer@npm:^1.0.0": - version: 1.2.2 - resolution: "cjs-module-lexer@npm:1.2.2" - checksum: 10/f80f84bfdcc53379cc18e25ea3c0cdb4595c142b8e28df304f5c88f38202e1bccf13e845401593656781f79fb43273e1d402d6187d0eeee8dca5ddecee1dcad4 +"cjs-module-lexer@npm:^1.0.0, cjs-module-lexer@npm:^1.3.1": + version: 1.4.1 + resolution: "cjs-module-lexer@npm:1.4.1" + checksum: 10/6e830a1e00a34d416949bbc1924f3e8da65cef4a6a09e2b7fa35722e2d1c34bf378d3baca987b698d1cbc3eb83e44b044039b4e82755c96f30e0f03d1d227637 languageName: node linkType: hard @@ -6712,7 +6738,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7": +"glob@npm:^10.2.2, glob@npm:^10.3.10": version: 10.4.5 resolution: "glob@npm:10.4.5" dependencies: @@ -9984,17 +10010,6 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^5.0.10": - version: 5.0.10 - resolution: "rimraf@npm:5.0.10" - dependencies: - glob: "npm:^10.3.7" - bin: - rimraf: dist/esm/bin.mjs - checksum: 10/f3b8ce81eecbde4628b07bdf9e2fa8b684e0caea4999acb1e3b0402c695cd41f28cd075609a808e61ce2672f528ca079f675ab1d8e8d5f86d56643a03e0b8d2e - languageName: node - linkType: hard - "ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1, ripemd160@npm:^2.0.2": version: 2.0.2 resolution: "ripemd160@npm:2.0.2" @@ -11742,7 +11757,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:17.7.2, yargs@npm:^17.0.1, yargs@npm:^17.3.1, yargs@npm:^17.7.1": +"yargs@npm:17.7.2, yargs@npm:^17.0.1, yargs@npm:^17.3.1, yargs@npm:^17.7.1, yargs@npm:^17.7.2": version: 17.7.2 resolution: "yargs@npm:17.7.2" dependencies: