diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml index 5321e073f5..17d308909f 100644 --- a/.github/workflows/build-lint-test.yml +++ b/.github/workflows/build-lint-test.yml @@ -60,8 +60,6 @@ jobs: - run: yarn --immutable --immutable-cache - name: Build run: yarn build:ci - - name: Build types - run: yarn build:types - name: Cache build files uses: actions/cache@v4 with: diff --git a/.yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch b/.yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch deleted file mode 100644 index 2ac7512ab5..0000000000 --- a/.yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/dist/index.js b/dist/index.js -index 4500c4e43c3bbd24aa60b7d4cf95aa3fee8eb185..9c442bc216f99b7cfadb5ac62cb98d3ae9ce2f56 100644 ---- a/dist/index.js -+++ b/dist/index.js -@@ -1813,6 +1813,8 @@ var cjsSplitting = () => { - } - const { transform: transform3 } = await Promise.resolve().then(() => require("sucrase")); - const result = transform3(code, { -+ // https://github.com/egoist/tsup/issues/1087 -+ disableESTransforms: true, - filePath: info.path, - transforms: ["imports"], - sourceMapOptions: this.options.sourcemap ? { diff --git a/constraints.pro b/constraints.pro index 55feea7852..5897e1e77d 100644 --- a/constraints.pro +++ b/constraints.pro @@ -152,32 +152,40 @@ gen_enforced_field(WorkspaceCwd, 'sideEffects', 'false') :- \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.'. -% The type definitions entrypoint for the dependency must be `./dist/types/index.d.ts`. -gen_enforced_field(WorkspaceCwd, 'types', './dist/types/index.d.ts') :- +% The type definitions entrypoint for the dependency must be `./dist/index.d.cts`. +gen_enforced_field(WorkspaceCwd, 'types', './dist/index.d.cts') :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.'. -gen_enforced_field(WorkspaceCwd, 'exports["."].types', './dist/types/index.d.ts') :- +gen_enforced_field(WorkspaceCwd, 'exports["."].types', null) :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.'. -% The entrypoint for the dependency must be `./dist/cjs/index.js`. -gen_enforced_field(WorkspaceCwd, 'main', './dist/index.js') :- +% The entrypoint for the dependency must be `./dist/index.cjs`. +gen_enforced_field(WorkspaceCwd, 'main', './dist/index.cjs') :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.'. -gen_enforced_field(WorkspaceCwd, 'exports["."].require', './dist/index.js') :- +gen_enforced_field(WorkspaceCwd, 'exports["."].require.types', './dist/index.d.cts') :- + \+ is_example(WorkspaceCwd), + \+ workspace_field(WorkspaceCwd, 'private', true), + WorkspaceCwd \= '.'. +gen_enforced_field(WorkspaceCwd, 'exports["."].require.default', './dist/index.cjs') :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.'. -% The module entrypoint for the dependency must be `./dist/esm/index.js`. +% The module entrypoint for the dependency must be `./dist/index.mjs`. gen_enforced_field(WorkspaceCwd, 'module', './dist/index.mjs') :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.'. -gen_enforced_field(WorkspaceCwd, 'exports["."].import', './dist/index.mjs') :- +gen_enforced_field(WorkspaceCwd, 'exports["."].import.types', './dist/index.d.mts') :- + \+ is_example(WorkspaceCwd), + \+ workspace_field(WorkspaceCwd, 'private', true), + WorkspaceCwd \= '.'. +gen_enforced_field(WorkspaceCwd, 'exports["."].import.default', './dist/index.mjs') :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.'. @@ -202,22 +210,17 @@ gen_enforced_field(WorkspaceCwd, 'files', ['dist', 'jest-preset.js']) :- WorkspaceCwd = 'packages/snaps-jest'. % Dependencies must have a build script. -gen_enforced_field(WorkspaceCwd, 'scripts.build', 'tsup --clean && yarn build:types') :- +gen_enforced_field(WorkspaceCwd, 'scripts.build', 'ts-bridge --project tsconfig.build.json --verbose --no-references') :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.', WorkspaceCwd \= 'packages/snaps-simulator', WorkspaceCwd \= 'packages/snaps-cli', WorkspaceCwd \= 'packages/snaps-execution-environments'. -gen_enforced_field(WorkspaceCwd, 'scripts.build:types', 'tsc --project tsconfig.build.json') :- +gen_enforced_field(WorkspaceCwd, 'scripts.build:types', null) :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.'. -gen_enforced_field(WorkspaceCwd, 'scripts.build:ci', 'tsup --clean') :- - \+ is_example(WorkspaceCwd), - \+ workspace_field(WorkspaceCwd, 'private', true), - WorkspaceCwd \= '.', - WorkspaceCwd \= 'packages/snaps-simulator'. % Dependencies must have preview scripts. gen_enforced_field(WorkspaceCwd, 'scripts.publish:preview', 'yarn npm publish --tag preview') :- diff --git a/package.json b/package.json index a2ec20c178..44c288cafa 100644 --- a/package.json +++ b/package.json @@ -19,11 +19,8 @@ "lint": "yarn workspaces foreach --all --parallel run lint:eslint && yarn lint:misc --check && yarn lint:tsconfig && yarn constraints && yarn lint:dependencies", "lint:fix": "yarn workspaces foreach --all --parallel run lint:eslint --fix && yarn lint:misc --write && yarn lint:tsconfig && yarn constraints --fix && yarn dedupe", "lint:ci": "yarn lint:eslint && yarn lint:misc --check && yarn lint:tsconfig && yarn constraints && yarn lint:dependencies", - "build": "yarn build:source && yarn build:types", - "build:ci": "yarn workspaces filter --include \"packages/*\" --parallel --topological --no-private run build:ci", - "build:clean": "yarn clean && yarn build", - "build:source": "yarn workspaces filter --parallel --topological --exclude \"{packages/examples,packages/examples/packages/invoke-snap}\" run build", - "build:types": "tsc --build tsconfig.build.json", + "build": "ts-bridge --project tsconfig.build.json --verbose && yarn build:examples", + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --clean", "build:examples": "yarn workspace @metamask/example-snaps build", "clean": "yarn workspaces foreach --all --parallel --verbose run clean", "test": "yarn workspaces foreach --all --parallel --verbose run test", @@ -65,8 +62,7 @@ "luxon@^3.2.1": "patch:luxon@npm%3A3.3.0#./.yarn/patches/luxon-npm-3.3.0-bdbae9bfd5.patch", "tsconfig-paths@^3.11.0": "patch:tsconfig-paths@npm%3A3.14.2#./.yarn/patches/tsconfig-paths-npm-3.14.2-90ce75420d.patch", "tsconfig-paths@^3.14.1": "patch:tsconfig-paths@npm%3A3.14.2#./.yarn/patches/tsconfig-paths-npm-3.14.2-90ce75420d.patch", - "tsconfig-paths@^4.1.2": "patch:tsconfig-paths@npm%3A3.14.2#./.yarn/patches/tsconfig-paths-npm-3.14.2-90ce75420d.patch", - "tsup@^8.0.1": "patch:tsup@npm%3A8.0.2#./.yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch" + "tsconfig-paths@^4.1.2": "patch:tsconfig-paths@npm%3A3.14.2#./.yarn/patches/tsconfig-paths-npm-3.14.2-90ce75420d.patch" }, "devDependencies": { "@lavamoat/allow-scripts": "^3.0.4", @@ -78,6 +74,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@metamask/utils": "^9.2.1", "@swc/core": "1.3.78", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/node": "18.14.2", "@typescript-eslint/eslint-plugin": "^5.42.1", @@ -104,7 +101,6 @@ "semver": "^7.5.4", "simple-git-hooks": "^2.7.0", "ts-node": "^10.9.1", - "tsup": "^8.0.1", "typescript": "~5.3.3", "vite": "^4.3.9" }, @@ -122,7 +118,6 @@ "ts-node>@swc/core": true, "@swc/core": true, "favicons>sharp": true, - "tsup>esbuild": true, "vite>esbuild": true } }, diff --git a/packages/create-snap/package.json b/packages/create-snap/package.json index 9c2be69867..6308b5f26e 100644 --- a/packages/create-snap/package.json +++ b/packages/create-snap/package.json @@ -10,26 +10,29 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", - "bin": "./dist/main.js", + "types": "./dist/index.d.cts", + "bin": "./dist/main.cjs", "files": [ "dist" ], "scripts": { - "build": "tsup --clean && yarn build:types", - "build:types": "tsc --project tsconfig.build.json", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "build:chmod": "chmod +x ./dist/main.mjs && chmod +x ./dist/main.js", "build:clean": "yarn clean && yarn build", "build:watch": "tsc-watch --onSuccess 'yarn build:chmod'", - "clean": "rimraf '*.tsbuildinfo' 'dist'", "test": "jest && yarn posttest", "posttest": "jest-it-up", "test:watch": "yarn test --watch", @@ -42,8 +45,7 @@ "publish:package": "../../scripts/publish-package.sh", "lint:ci": "yarn lint", "publish:preview": "yarn npm publish --tag preview", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/snaps-utils": "workspace:^", @@ -59,9 +61,9 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/node": "18.14.2", - "@types/rimraf": "^3.0.0", "@types/yargs": "^17.0.24", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", @@ -80,10 +82,8 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "ts-node": "^10.9.1", "tsc-watch": "^4.5.0", - "tsup": "^8.0.1", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/create-snap/tsconfig.build.json b/packages/create-snap/tsconfig.build.json index 16b2a53623..9699c80467 100644 --- a/packages/create-snap/tsconfig.build.json +++ b/packages/create-snap/tsconfig.build.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./src" }, "include": ["./src"], diff --git a/packages/create-snap/tsconfig.json b/packages/create-snap/tsconfig.json index 85adfc60aa..7c3b900e55 100644 --- a/packages/create-snap/tsconfig.json +++ b/packages/create-snap/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "baseUrl": "./" }, - "include": ["./src", "./src/**/*.json", "package.json", "tsup.config.ts"], + "include": ["./src", "./src/**/*.json", "package.json"], "references": [{ "path": "../snaps-cli" }, { "path": "../snaps-utils" }] } diff --git a/packages/create-snap/tsup.config.ts b/packages/create-snap/tsup.config.ts deleted file mode 100644 index d62dc9943a..0000000000 --- a/packages/create-snap/tsup.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, - external: ['@metamask/create-snap'], - platform: 'node', -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/examples/packages/bip32/snap.manifest.json b/packages/examples/packages/bip32/snap.manifest.json index efc5e5bc16..a614a56a11 100644 --- a/packages/examples/packages/bip32/snap.manifest.json +++ b/packages/examples/packages/bip32/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "R8Of/lcLuLbr2AAcUsDD6e0cdbOdHHvHlwxs+BoAHtE=", + "shasum": "oIth1iwHikuY19tkSxTGtl4YzdX1XAiGn2RJl+DAeCs=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/bip44/snap.manifest.json b/packages/examples/packages/bip44/snap.manifest.json index 46fae73146..fff1ffa89f 100644 --- a/packages/examples/packages/bip44/snap.manifest.json +++ b/packages/examples/packages/bip44/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "8Iyfr16llKRg4UoML6rvo+76L+R6KhKxg8p0GdAczts=", + "shasum": "Ta9rEMnKSdYz7ecxZh++RZyMSW9JVsQVqa+zFLLO87k=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/browserify-plugin/snap.manifest.json b/packages/examples/packages/browserify-plugin/snap.manifest.json index 459e4a0880..9298798dfa 100644 --- a/packages/examples/packages/browserify-plugin/snap.manifest.json +++ b/packages/examples/packages/browserify-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "27ak99bFxoi5UmR0mvMhQWYJfsyZjeYva4kPd2sklgc=", + "shasum": "86NLlsPJvWJxQuiDRc6479u6RvMaCFIK8GNVpTdcPjI=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/browserify/snap.manifest.json b/packages/examples/packages/browserify/snap.manifest.json index 4ee0f0c1f1..d2b27042e7 100644 --- a/packages/examples/packages/browserify/snap.manifest.json +++ b/packages/examples/packages/browserify/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "f/RSumnRBLYDElSvfXJ98Q+k3qOxINGvpiwGhxe+TFA=", + "shasum": "BXW4yp9Qs+yCSXZXMJfvEIjY0epnS2yhzcHZ8kAb0B0=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/client-status/snap.manifest.json b/packages/examples/packages/client-status/snap.manifest.json index d1ceab438a..60f9d96131 100644 --- a/packages/examples/packages/client-status/snap.manifest.json +++ b/packages/examples/packages/client-status/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "LPHBZ8HaW5f2snnJ+7932mfqASK7jcXejfFjVyJ/VXA=", + "shasum": "igAdAUtow5JI5MOgNqhdcqlpBo67XhupsT3Ns8tTbto=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/cronjobs/snap.manifest.json b/packages/examples/packages/cronjobs/snap.manifest.json index b6707b2e8d..e4e9dd2b74 100644 --- a/packages/examples/packages/cronjobs/snap.manifest.json +++ b/packages/examples/packages/cronjobs/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "UDkFbOMBRfWLD2oh0hlFurcqT3W33ysAIjUOBaEx/+k=", + "shasum": "o5qiOur9Zl+yAjHScLzh0FfK7/jcKx7rGqotitpJ6Uo=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/dialogs/snap.manifest.json b/packages/examples/packages/dialogs/snap.manifest.json index ba5c77fd69..67035ee16f 100644 --- a/packages/examples/packages/dialogs/snap.manifest.json +++ b/packages/examples/packages/dialogs/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "klyP48icUHenhFEjXT4cvgSPT30ZFMqUTFBb2YqS4lI=", + "shasum": "77wtrsk6BY8OSjG5pWALMSJzOmznWaaR7EiM3LGigjI=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/ethereum-provider/snap.manifest.json b/packages/examples/packages/ethereum-provider/snap.manifest.json index 0904219b8d..700254a385 100644 --- a/packages/examples/packages/ethereum-provider/snap.manifest.json +++ b/packages/examples/packages/ethereum-provider/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "pqp9lYbT/4A1Z2vgozgLu/kxvjdmlfFjmowIMOEsD0k=", + "shasum": "UjXjIPRsp5mK1VwBQL8eRaGjIX1pW7E+KPMls3BGXRA=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/ethers-js/snap.manifest.json b/packages/examples/packages/ethers-js/snap.manifest.json index 652c58746f..598841f513 100644 --- a/packages/examples/packages/ethers-js/snap.manifest.json +++ b/packages/examples/packages/ethers-js/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "E+ijMmCKNfgzuyCynS6PHT0c2F+22NlJpAE0cbNSlcM=", + "shasum": "fwMTtk4KJjak+yf6666Vv/+syXmFVAnVPAsBkalK2Qc=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/file-upload/snap.manifest.json b/packages/examples/packages/file-upload/snap.manifest.json index e09751f081..2187c9fbe2 100644 --- a/packages/examples/packages/file-upload/snap.manifest.json +++ b/packages/examples/packages/file-upload/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "UvAKkgLp43SSDI/mUdvjehfLGrQq1rB5lPfETxDTqT4=", + "shasum": "314nMSBFTIeG+Z7RGc9D/FZPRk/vQjaZfzo8rMFMSmY=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/get-entropy/snap.manifest.json b/packages/examples/packages/get-entropy/snap.manifest.json index 70584a50a9..537974b0a1 100644 --- a/packages/examples/packages/get-entropy/snap.manifest.json +++ b/packages/examples/packages/get-entropy/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "GXJcuL0Bz7RCGE39iUk1v6QSmlMaA0gXJSekaE2l0cw=", + "shasum": "ur2Jxp1kniP1jYLeexXHTB/+dgfJom1volcPQgSNX6c=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/get-file/snap.manifest.json b/packages/examples/packages/get-file/snap.manifest.json index 47138775ce..b92551b975 100644 --- a/packages/examples/packages/get-file/snap.manifest.json +++ b/packages/examples/packages/get-file/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "BzCYiUBdWeViyl4Ux80SGv2kVJapohrpC/dTW5yM+iA=", + "shasum": "z8vSlRUXBdgkLnThLXk0CxPylXp3zeK0MG70lTqyrHc=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/home-page/snap.manifest.json b/packages/examples/packages/home-page/snap.manifest.json index e393dbb100..1f7a24583c 100644 --- a/packages/examples/packages/home-page/snap.manifest.json +++ b/packages/examples/packages/home-page/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "dZ9WgkIrRPAi7nKbYBSeaD3xV9rKf0VT9/5FgrrK4QE=", + "shasum": "tOQyZkJPX1hUaoCfBlAV+4vl7Tbt9DcPCquAh84IGP4=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/images/snap.manifest.json b/packages/examples/packages/images/snap.manifest.json index d7be65bc4c..1e8c4f2536 100644 --- a/packages/examples/packages/images/snap.manifest.json +++ b/packages/examples/packages/images/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "r+Vr5LYfHiuQZuvypm1jQNfQzdp7unl6AgskaGCFJnM=", + "shasum": "ewEvZGj7D/wUtBH8bDutuDuJ1leq8n9Penuu8yDAykA=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/images/tsconfig.json b/packages/examples/packages/images/tsconfig.json index 1cb4c3315f..783b285e19 100644 --- a/packages/examples/packages/images/tsconfig.json +++ b/packages/examples/packages/images/tsconfig.json @@ -4,7 +4,9 @@ "baseUrl": "./", "paths": { "@metamask/*": ["../../../*/src"] - } + }, + "module": "ES2020", + "moduleResolution": "Node10" }, "include": ["src", "snap.config.ts"], "references": [ diff --git a/packages/examples/packages/interactive-ui/snap.manifest.json b/packages/examples/packages/interactive-ui/snap.manifest.json index 708a6a9b70..8153f8286a 100644 --- a/packages/examples/packages/interactive-ui/snap.manifest.json +++ b/packages/examples/packages/interactive-ui/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "/Xgz50XZhm49exI9MtCOtWRox1N894/sLTYZIGYrFX4=", + "shasum": "QIFPu6VwYTRWVGIS5fHeoOWuV7RxLhn7wYFtrcc5pKM=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json b/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json index e3ed4b2b71..50199ea58e 100644 --- a/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json +++ b/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "sDb0ugSBJGrdF7ObFjJ3GKVkE/8cManTyFxzE+27wzg=", + "shasum": "NEGArtJf6+X6DHqr3WyxoQCVhGEEAhqcoRUGKNqgKn0=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json b/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json index 7c80c466ab..2516ea1744 100644 --- a/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json +++ b/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "xPa7zpGbgq01EtWw8qxQFqzteqMYxDXn2nevqoVzJJs=", + "shasum": "Y0k3QSqHBYytNfYgmtrjwhbZ3e8WzXhOQFYPJCIuJfg=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/json-rpc/snap.manifest.json b/packages/examples/packages/json-rpc/snap.manifest.json index d19267db87..147f6513e5 100644 --- a/packages/examples/packages/json-rpc/snap.manifest.json +++ b/packages/examples/packages/json-rpc/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "XgbjBxwNlGsjmdztBI22Z+gYQ1/NKI7yEBmlVxgOpMg=", + "shasum": "yDlo/WglB5Cvdeqx9JDwRm/iIiE6TiOpoIkITW2kCzk=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/jsx/snap.manifest.json b/packages/examples/packages/jsx/snap.manifest.json index 827bd1411d..66efdcaacd 100644 --- a/packages/examples/packages/jsx/snap.manifest.json +++ b/packages/examples/packages/jsx/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "T+A3hsNIIBcFZnfBu0PBzJm2oapEixpCGjNV4nMgnzg=", + "shasum": "HP/m3FdQ1hzjaQMMPLCLGwY1pxwth35ZyLolPC7PyOE=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/lifecycle-hooks/snap.manifest.json b/packages/examples/packages/lifecycle-hooks/snap.manifest.json index b0dd1ac846..e044675125 100644 --- a/packages/examples/packages/lifecycle-hooks/snap.manifest.json +++ b/packages/examples/packages/lifecycle-hooks/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "MNSdE7seQVY/J2CgiR1ui5S3+EqhaWWUI2sWCQ8UMNs=", + "shasum": "Huxm0NrX6zvh0k9iGnStycNNcmHSGRK1EK/+jmv7nyI=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/localization/snap.manifest.json b/packages/examples/packages/localization/snap.manifest.json index 226b4b123d..aa9a746ad4 100644 --- a/packages/examples/packages/localization/snap.manifest.json +++ b/packages/examples/packages/localization/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "mONCNm5xmhuk1QcfKLaOAs7Uql/eh5G2Yo0jSPyIzXg=", + "shasum": "k/mLclt6BlGiW6jEiOMBRrlrIaZ5L4fwuz8/48PdQ7s=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/manage-state/snap.manifest.json b/packages/examples/packages/manage-state/snap.manifest.json index f76c383d22..3df05a3842 100644 --- a/packages/examples/packages/manage-state/snap.manifest.json +++ b/packages/examples/packages/manage-state/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "98vhPnaWHkUPD18HSxKy5vFYKNRYOdRqwkihnGcT00A=", + "shasum": "saGtVCiivJDm47hobzzC6Z7jFLXYu94N3hUPn+WEu9A=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/network-access/snap.manifest.json b/packages/examples/packages/network-access/snap.manifest.json index 017c1712f2..db1c22d15b 100644 --- a/packages/examples/packages/network-access/snap.manifest.json +++ b/packages/examples/packages/network-access/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "43/FOUjIa7N9trMI54h2h02nZCO2HTZG9tlMwdeRilQ=", + "shasum": "Vrn0u7Fn353VA0BJgRb7y/hvwYxbZLHO63Y1wytPC8g=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/notifications/snap.manifest.json b/packages/examples/packages/notifications/snap.manifest.json index ad539cb1bc..fca897ef12 100644 --- a/packages/examples/packages/notifications/snap.manifest.json +++ b/packages/examples/packages/notifications/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "LGJJjBHbbUE4+MdIk0c7EqItgJKaKNZgroPaURABxyI=", + "shasum": "I7oitI3EFjnd0V8Gv9Cmcp53Vbx5d2KJxMpRC7iOmyY=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/rollup-plugin/snap.manifest.json b/packages/examples/packages/rollup-plugin/snap.manifest.json index 440f4e06cf..0cb516baa4 100644 --- a/packages/examples/packages/rollup-plugin/snap.manifest.json +++ b/packages/examples/packages/rollup-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "g3e2k0lQsDN/0bZJW5y4sQGWNYHAs8KUK91edExDGhY=", + "shasum": "Oe6qk8RKXcAG9EU/rPVLq8p14YgP9yOv+dWFEleGHaI=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/signature-insights/snap.manifest.json b/packages/examples/packages/signature-insights/snap.manifest.json index 7fb9b976f9..a7fdafd08a 100644 --- a/packages/examples/packages/signature-insights/snap.manifest.json +++ b/packages/examples/packages/signature-insights/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "lVBEoTo90Uqgvi19KaemXi7Di4BSngCBukRN9opy2ng=", + "shasum": "mxW5zlXyghmveLeZIwJMZkwjqb7Y8peJut9uvbxgLCU=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/transaction-insights/snap.manifest.json b/packages/examples/packages/transaction-insights/snap.manifest.json index 859bc7d576..9cfcc1640e 100644 --- a/packages/examples/packages/transaction-insights/snap.manifest.json +++ b/packages/examples/packages/transaction-insights/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "fDFhZfuLUwjFDFdCpgLW02M/c6BKa8rr6gVaOb7EE9g=", + "shasum": "2HeDCuxgl9zngyHAGEyikHFuM3Rcek5Jc0lCeuPNFqA=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/wasm/snap.manifest.json b/packages/examples/packages/wasm/snap.manifest.json index 14993bdac8..1b2f18289e 100644 --- a/packages/examples/packages/wasm/snap.manifest.json +++ b/packages/examples/packages/wasm/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "GveQv7vX09cdHS/joDV6HsGhuKPx4z9HqeSd4/HBR00=", + "shasum": "1G7IG92NOe39Qcwed55/zGCaez0SKpR0ScihXdWZz5s=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/webpack-plugin/snap.manifest.json b/packages/examples/packages/webpack-plugin/snap.manifest.json index 57de036f4a..ba67ead9da 100644 --- a/packages/examples/packages/webpack-plugin/snap.manifest.json +++ b/packages/examples/packages/webpack-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "ZEPqntjeYnKUDvoKSfQ5NiRaRoG5PJWoD+kK3G4ebUs=", + "shasum": "uVDLdocB0sDfvyV0zieKT53u9irH18ZynErd8QYWL+U=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snaps-browserify-plugin/package.json b/packages/snaps-browserify-plugin/package.json index 8618a2c186..62a14337a4 100644 --- a/packages/snaps-browserify-plugin/package.json +++ b/packages/snaps-browserify-plugin/package.json @@ -11,15 +11,20 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist" ], @@ -32,10 +37,7 @@ "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-browserify-plugin", - "build": "tsup --clean && yarn build:types", - "build:types": "tsc --project tsconfig.build.json", - "build:ci": "tsup --clean", - "clean": "rimraf '*.tsbuildinfo' 'dist'", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", "lint:dependencies": "depcheck" @@ -54,6 +56,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/browserify": "^12.0.37", "@types/convert-source-map": "^1.5.2", "@types/jest": "^27.5.1", @@ -76,8 +79,6 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", - "tsup": "^8.0.1", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/snaps-browserify-plugin/tsconfig.build.json b/packages/snaps-browserify-plugin/tsconfig.build.json index 31c878583c..4dc952c93e 100644 --- a/packages/snaps-browserify-plugin/tsconfig.build.json +++ b/packages/snaps-browserify-plugin/tsconfig.build.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./src" }, "include": ["./src"], diff --git a/packages/snaps-browserify-plugin/tsconfig.json b/packages/snaps-browserify-plugin/tsconfig.json index 29291d0908..81e1cbb9be 100644 --- a/packages/snaps-browserify-plugin/tsconfig.json +++ b/packages/snaps-browserify-plugin/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "baseUrl": "./" }, - "include": ["./src", "package.json", "tsup.config.ts"], + "include": ["./src", "package.json"], "references": [ { "path": "../snaps-utils" diff --git a/packages/snaps-browserify-plugin/tsup.config.ts b/packages/snaps-browserify-plugin/tsup.config.ts deleted file mode 100644 index 3eaf645296..0000000000 --- a/packages/snaps-browserify-plugin/tsup.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-cli/package.json b/packages/snaps-cli/package.json index 06c8b17c72..4125583612 100644 --- a/packages/snaps-cli/package.json +++ b/packages/snaps-cli/package.json @@ -10,30 +10,33 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json", "./browserslistrc": "./.browserslistrc" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "bin": { - "mm-snap": "./dist/main.js" + "mm-snap": "./dist/main.cjs" }, "files": [ "dist", ".browserslistrc" ], "scripts": { - "build": "tsup --clean && yarn build:types && yarn build:chmod && yarn build:readme", - "build:types": "tsc --project tsconfig.build.json", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references && yarn build:chmod && yarn build:readme", "build:chmod": "chmod +x ./dist/main.mjs && chmod +x ./dist/main.js", "build:readme": "node ./scripts/updateReadme.js", "build:watch": "tsc-watch --onSuccess 'yarn build:chmod'", - "clean": "rimraf '*.tsbuildinfo' 'dist'", "test": "jest --runInBand && yarn posttest", "posttest": "jest-it-up", "test:watch": "yarn test --watch", @@ -45,8 +48,7 @@ "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@babel/core": "^7.23.2", @@ -107,10 +109,10 @@ "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/browserify": "^12.0.37", "@types/jest": "^27.5.1", "@types/node": "18.14.2", - "@types/rimraf": "^3.0.0", "@types/serve-handler": "^6.1.0", "@types/yargs": "^17.0.24", "@typescript-eslint/eslint-plugin": "^5.42.1", @@ -132,10 +134,8 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "ts-node": "^10.9.1", "tsc-watch": "^4.5.0", - "tsup": "^8.0.1", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/snaps-cli/tsconfig.build.json b/packages/snaps-cli/tsconfig.build.json index 16109802b2..8b4bb8a851 100644 --- a/packages/snaps-cli/tsconfig.build.json +++ b/packages/snaps-cli/tsconfig.build.json @@ -2,8 +2,9 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", - "rootDir": "./src" + "outDir": "./dist", + "rootDir": "./src", + "skipLibCheck": true }, "include": ["./src"], "exclude": [ diff --git a/packages/snaps-cli/tsconfig.json b/packages/snaps-cli/tsconfig.json index cf0ed65956..be873d2de1 100644 --- a/packages/snaps-cli/tsconfig.json +++ b/packages/snaps-cli/tsconfig.json @@ -1,15 +1,10 @@ { "extends": "../../tsconfig.packages.json", "compilerOptions": { - "baseUrl": "./" + "baseUrl": "./", + "skipLibCheck": true }, - "include": [ - "./src", - "./src/**/*.json", - "jest.setup.ts", - "package.json", - "tsup.config.ts" - ], + "include": ["./src", "./src/**/*.json", "jest.setup.ts", "package.json"], "references": [ { "path": "../snaps-utils" }, { "path": "../snaps-browserify-plugin" }, diff --git a/packages/snaps-cli/tsup.config.ts b/packages/snaps-cli/tsup.config.ts deleted file mode 100644 index 3cfca96324..0000000000 --- a/packages/snaps-cli/tsup.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, - external: ['@metamask/snaps-cli'], - platform: 'node', -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-controllers/package.json b/packages/snaps-controllers/package.json index 4b0c8294b4..5aca31a81a 100644 --- a/packages/snaps-controllers/package.json +++ b/packages/snaps-controllers/package.json @@ -9,25 +9,40 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./node": { - "import": "./dist/node.mjs", - "require": "./dist/node.js", - "types": "./dist/types/node.d.ts" + "import": { + "types": "./dist/types/node.d.mts", + "default": "./dist/node.mjs" + }, + "require": { + "types": "./dist/types/node.d.cts", + "default": "./dist/node.cjs" + } }, "./react-native": { - "import": "./dist/react-native.mjs", - "require": "./dist/react-native.js", - "types": "./dist/types/react-native.d.ts" + "import": { + "types": "./dist/types/react-native.d.mts", + "default": "./dist/react-native.mjs" + }, + "require": { + "types": "./dist/types/react-native.d.cts", + "default": "./dist/react-native.cjs" + } }, "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist", "react-native.d.ts", @@ -39,9 +54,7 @@ "posttest": "ts-node scripts/coverage.ts && rimraf coverage/jest coverage/wdio", "test:browser": "wdio run wdio.config.js", "test:ci": "yarn test", - "build": "tsup --clean && yarn build:types", - "build:types": "tsc --project tsconfig.build.json", - "clean": "rimraf '*.tsbuildinfo' 'dist'", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "lint:eslint": "eslint . --cache --ext js,ts,jsx,tsx", "lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" --ignore-path ../../.gitignore", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", @@ -49,8 +62,7 @@ "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-controllers", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/approval-controller": "^7.0.2", @@ -91,6 +103,7 @@ "@metamask/template-snap": "^0.7.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/chrome": "^0.0.237", "@types/concat-stream": "^2.0.0", "@types/gunzip-maybe": "^1.4.0", @@ -129,7 +142,6 @@ "prettier-plugin-packagejson": "^2.2.11", "rimraf": "^4.1.2", "ts-node": "^10.9.1", - "tsup": "^8.0.1", "typescript": "~5.3.3", "vite": "^4.3.9", "vite-tsconfig-paths": "^4.0.5", diff --git a/packages/snaps-controllers/react-native.d.ts b/packages/snaps-controllers/react-native.d.ts index 5f68fd1974..7ba732f560 100644 --- a/packages/snaps-controllers/react-native.d.ts +++ b/packages/snaps-controllers/react-native.d.ts @@ -1 +1,3 @@ -export * from './dist/types/react-native'; +/* eslint-disable import/extensions */ + +export * from './dist/react-native.cjs'; diff --git a/packages/snaps-controllers/react-native.js b/packages/snaps-controllers/react-native.js index 8d13fc31c1..7671f8beb0 100644 --- a/packages/snaps-controllers/react-native.js +++ b/packages/snaps-controllers/react-native.js @@ -2,4 +2,4 @@ // Re-exported for compatibility with build tools that don't support the // `exports` field in package.json -module.exports = require('./dist/react-native'); +module.exports = require('./dist/react-native.cjs'); diff --git a/packages/snaps-controllers/tsconfig.build.json b/packages/snaps-controllers/tsconfig.build.json index 15d1222fa8..4ca59dd1a0 100644 --- a/packages/snaps-controllers/tsconfig.build.json +++ b/packages/snaps-controllers/tsconfig.build.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./src" }, "include": ["./src"], diff --git a/packages/snaps-controllers/tsconfig.json b/packages/snaps-controllers/tsconfig.json index 580fcc3eb1..f756ea467c 100644 --- a/packages/snaps-controllers/tsconfig.json +++ b/packages/snaps-controllers/tsconfig.json @@ -3,13 +3,7 @@ "compilerOptions": { "baseUrl": "./" }, - "include": [ - "./src", - "scripts", - "package.json", - "tsup.config.ts", - "react-native.d.ts" - ], + "include": ["./src", "scripts", "package.json", "react-native.d.ts"], "references": [ { "path": "../snaps-execution-environments" }, { "path": "../snaps-rpc-methods" }, diff --git a/packages/snaps-controllers/tsup.config.ts b/packages/snaps-controllers/tsup.config.ts deleted file mode 100644 index 3eaf645296..0000000000 --- a/packages/snaps-controllers/tsup.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json index 819bf4ac35..f2cef1b0f1 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json @@ -49,7 +49,7 @@ "@metamask/utils>pony-cause": true, "browserify>buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/providers": { @@ -130,7 +130,7 @@ "@metamask/utils>pony-cause": true, "browserify>buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/utils>@noble/hashes": { @@ -183,6 +183,19 @@ "browserify>process": true } }, + "eslint>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "browserify>process": true, + "eslint>debug>ms": true + } + }, "readable-stream": { "packages": { "browserify>browser-resolve": true, @@ -200,19 +213,6 @@ "console.warn": true, "localStorage": true } - }, - "tsup>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "tsup>debug>ms": true - } } } } \ No newline at end of file diff --git a/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json index bc1e5804e8..5500982724 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json @@ -59,7 +59,7 @@ "@metamask/utils>pony-cause": true, "buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/providers": { @@ -146,7 +146,7 @@ "@metamask/utils>pony-cause": true, "buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/utils>@noble/hashes": { @@ -203,6 +203,27 @@ "process": true } }, + "eslint>debug": { + "builtin": { + "tty.isatty": true, + "util.deprecate": true, + "util.formatWithOptions": true, + "util.inspect": true + }, + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "@wdio/mocha-framework>mocha>supports-color": true, + "eslint>debug>ms": true, + "tty": true, + "util": true + } + }, "istanbul-lib-report>supports-color>has-flag": { "globals": { "process.argv": true @@ -238,27 +259,6 @@ "packages": { "util": true } - }, - "tsup>debug": { - "builtin": { - "tty.isatty": true, - "util.deprecate": true, - "util.formatWithOptions": true, - "util.inspect": true - }, - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "@wdio/mocha-framework>mocha>supports-color": true, - "tsup>debug>ms": true, - "tty": true, - "util": true - } } } } \ No newline at end of file diff --git a/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json index bc1e5804e8..5500982724 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json @@ -59,7 +59,7 @@ "@metamask/utils>pony-cause": true, "buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/providers": { @@ -146,7 +146,7 @@ "@metamask/utils>pony-cause": true, "buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/utils>@noble/hashes": { @@ -203,6 +203,27 @@ "process": true } }, + "eslint>debug": { + "builtin": { + "tty.isatty": true, + "util.deprecate": true, + "util.formatWithOptions": true, + "util.inspect": true + }, + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "@wdio/mocha-framework>mocha>supports-color": true, + "eslint>debug>ms": true, + "tty": true, + "util": true + } + }, "istanbul-lib-report>supports-color>has-flag": { "globals": { "process.argv": true @@ -238,27 +259,6 @@ "packages": { "util": true } - }, - "tsup>debug": { - "builtin": { - "tty.isatty": true, - "util.deprecate": true, - "util.formatWithOptions": true, - "util.inspect": true - }, - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "@wdio/mocha-framework>mocha>supports-color": true, - "tsup>debug>ms": true, - "tty": true, - "util": true - } } } } \ No newline at end of file diff --git a/packages/snaps-execution-environments/lavamoat/browserify/webview/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/webview/policy.json index 08552e1b12..b485967fc0 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/webview/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/webview/policy.json @@ -28,7 +28,7 @@ "@metamask/utils>pony-cause": true, "browserify>buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/rpc-errors": { @@ -75,7 +75,7 @@ "@metamask/utils>pony-cause": true, "browserify>buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/utils>@noble/hashes": { @@ -128,6 +128,19 @@ "browserify>process": true } }, + "eslint>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "browserify>process": true, + "eslint>debug>ms": true + } + }, "readable-stream": { "packages": { "browserify>browser-resolve": true, @@ -145,19 +158,6 @@ "console.warn": true, "localStorage": true } - }, - "tsup>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "tsup>debug>ms": true - } } } } \ No newline at end of file diff --git a/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json index 819bf4ac35..f2cef1b0f1 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json @@ -49,7 +49,7 @@ "@metamask/utils>pony-cause": true, "browserify>buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/providers": { @@ -130,7 +130,7 @@ "@metamask/utils>pony-cause": true, "browserify>buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/utils>@noble/hashes": { @@ -183,6 +183,19 @@ "browserify>process": true } }, + "eslint>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "browserify>process": true, + "eslint>debug>ms": true + } + }, "readable-stream": { "packages": { "browserify>browser-resolve": true, @@ -200,19 +213,6 @@ "console.warn": true, "localStorage": true } - }, - "tsup>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "tsup>debug>ms": true - } } } } \ No newline at end of file diff --git a/packages/snaps-execution-environments/lavamoat/browserify/worker-pool/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/worker-pool/policy.json index 08552e1b12..b485967fc0 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/worker-pool/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/worker-pool/policy.json @@ -28,7 +28,7 @@ "@metamask/utils>pony-cause": true, "browserify>buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/rpc-errors": { @@ -75,7 +75,7 @@ "@metamask/utils>pony-cause": true, "browserify>buffer": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/utils>@noble/hashes": { @@ -128,6 +128,19 @@ "browserify>process": true } }, + "eslint>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "browserify>process": true, + "eslint>debug>ms": true + } + }, "readable-stream": { "packages": { "browserify>browser-resolve": true, @@ -145,19 +158,6 @@ "console.warn": true, "localStorage": true } - }, - "tsup>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "tsup>debug>ms": true - } } } } \ No newline at end of file diff --git a/packages/snaps-execution-environments/lavamoat/build-system/policy.json b/packages/snaps-execution-environments/lavamoat/build-system/policy.json index 268123bfbc..af6d609f6b 100644 --- a/packages/snaps-execution-environments/lavamoat/build-system/policy.json +++ b/packages/snaps-execution-environments/lavamoat/build-system/policy.json @@ -35,8 +35,8 @@ "depcheck>@babel/parser": true, "depcheck>@babel/traverse": true, "depcheck>json5": true, - "lavamoat>@babel/code-frame": true, - "tsup>debug": true + "eslint>debug": true, + "lavamoat>@babel/code-frame": true } }, "@babel/core>@ampproject/remapping": { @@ -53,8 +53,8 @@ "define": true }, "packages": { - "tsup>sucrase>@jridgewell/gen-mapping>@jridgewell/set-array": true, - "tsup>sucrase>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true + "terser>@jridgewell/source-map>@jridgewell/gen-mapping>@jridgewell/set-array": true, + "terser>@jridgewell/source-map>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true } }, "@babel/core>@babel/generator": { @@ -65,8 +65,8 @@ "packages": { "@babel/core>@babel/generator>jsesc": true, "@babel/core>@babel/types": true, - "terser>@jridgewell/source-map>@jridgewell/trace-mapping": true, - "tsup>sucrase>@jridgewell/gen-mapping": true + "terser>@jridgewell/source-map>@jridgewell/gen-mapping": true, + "terser>@jridgewell/source-map>@jridgewell/trace-mapping": true } }, "@babel/core>@babel/generator>jsesc": { @@ -1019,7 +1019,7 @@ "@metamask/utils>@scure/base": true, "@metamask/utils>pony-cause": true, "depcheck>semver": true, - "tsup>debug": true + "eslint>debug": true } }, "@metamask/utils>@noble/hashes": { @@ -1823,8 +1823,8 @@ "depcheck>@babel/traverse>@babel/helper-hoist-variables": true, "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true, "depcheck>@babel/traverse>globals": true, - "lavamoat>@babel/code-frame": true, - "tsup>debug": true + "eslint>debug": true, + "lavamoat>@babel/code-frame": true } }, "depcheck>@babel/traverse>@babel/helper-function-name": { @@ -1967,6 +1967,25 @@ "eslint>chalk>ansi-styles>color-convert>color-name": true } }, + "eslint>debug": { + "builtin": { + "tty.isatty": true, + "util.deprecate": true, + "util.formatWithOptions": true, + "util.inspect": true + }, + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "@wdio/mocha-framework>mocha>supports-color": true, + "eslint>debug>ms": true + } + }, "eslint>espree": { "packages": { "eslint>eslint-visitor-keys": true, @@ -2355,79 +2374,60 @@ "define": true } }, - "terser>@jridgewell/source-map>@jridgewell/trace-mapping": { + "terser>@jridgewell/source-map>@jridgewell/gen-mapping": { "globals": { "define": true }, "packages": { - "terser>@jridgewell/source-map>@jridgewell/trace-mapping>@jridgewell/resolve-uri": true, - "terser>@jridgewell/source-map>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": true + "terser>@jridgewell/source-map>@jridgewell/gen-mapping>@jridgewell/set-array": true, + "terser>@jridgewell/source-map>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true, + "terser>@jridgewell/source-map>@jridgewell/trace-mapping": true } }, - "terser>@jridgewell/source-map>@jridgewell/trace-mapping>@jridgewell/resolve-uri": { + "terser>@jridgewell/source-map>@jridgewell/gen-mapping>@jridgewell/set-array": { "globals": { "define": true } }, - "terser>@jridgewell/source-map>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": { + "terser>@jridgewell/source-map>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": { "globals": { "Buffer": true, "TextDecoder": true, "define": true } }, - "terser>acorn": { + "terser>@jridgewell/source-map>@jridgewell/trace-mapping": { "globals": { - "console": true, "define": true - } - }, - "terser>source-map-support>buffer-from": { - "globals": { - "Buffer": true - } - }, - "tsup>debug": { - "builtin": { - "tty.isatty": true, - "util.deprecate": true, - "util.formatWithOptions": true, - "util.inspect": true - }, - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true }, "packages": { - "@wdio/mocha-framework>mocha>supports-color": true, - "tsup>debug>ms": true + "terser>@jridgewell/source-map>@jridgewell/trace-mapping>@jridgewell/resolve-uri": true, + "terser>@jridgewell/source-map>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": true } }, - "tsup>sucrase>@jridgewell/gen-mapping": { + "terser>@jridgewell/source-map>@jridgewell/trace-mapping>@jridgewell/resolve-uri": { "globals": { "define": true - }, - "packages": { - "terser>@jridgewell/source-map>@jridgewell/trace-mapping": true, - "tsup>sucrase>@jridgewell/gen-mapping>@jridgewell/set-array": true, - "tsup>sucrase>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true } }, - "tsup>sucrase>@jridgewell/gen-mapping>@jridgewell/set-array": { + "terser>@jridgewell/source-map>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": { "globals": { + "Buffer": true, + "TextDecoder": true, "define": true } }, - "tsup>sucrase>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": { + "terser>acorn": { "globals": { - "Buffer": true, - "TextDecoder": true, + "console": true, "define": true } }, + "terser>source-map-support>buffer-from": { + "globals": { + "Buffer": true + } + }, "yargs": { "builtin": { "assert.notStrictEqual": true, diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index 02c7587031..8ed87f7433 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -9,9 +9,14 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./dist/browserify/node-process/bundle.js": { "default": "./dist/browserify/node-process/bundle.js" @@ -21,9 +26,9 @@ }, "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist" ], @@ -39,16 +44,14 @@ "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-execution-environments", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "clean": "rimraf '*.tsbuildinfo' 'dist' 'src/__GENERATED__/' 'coverage/*' '__test__/*'", - "build": "tsup --clean && yarn build:types && yarn build:lavamoat", - "build:types": "tsc --project tsconfig.build.json", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references && yarn build:lavamoat", "build:lavamoat": "lavamoat scripts/build.js --policy lavamoat/build-system/policy.json --policyOverride lavamoat/build-system/policy-override.json", "build:lavamoat:policy": "yarn build:lavamoat --writeAutoPolicy && node scripts/build.js --writeAutoPolicy", "auto-changelog-init": "auto-changelog init", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", "start": "node scripts/start.js", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/json-rpc-engine": "^9.0.2", @@ -79,6 +82,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/express": "^4.17.17", "@types/jest": "^27.5.1", "@types/node": "18.14.2", @@ -120,7 +124,6 @@ "ses": "^1.1.0", "terser": "^5.17.7", "ts-node": "^10.9.1", - "tsup": "^8.0.1", "typescript": "~5.3.3", "vite": "^4.3.9", "vite-tsconfig-paths": "^4.0.5", diff --git a/packages/snaps-execution-environments/tsconfig.build.json b/packages/snaps-execution-environments/tsconfig.build.json index bb79af3e25..7be8ef380e 100644 --- a/packages/snaps-execution-environments/tsconfig.build.json +++ b/packages/snaps-execution-environments/tsconfig.build.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./src", "typeRoots": ["../../node_modules/@types", "./node_modules/@types"] }, diff --git a/packages/snaps-execution-environments/tsconfig.json b/packages/snaps-execution-environments/tsconfig.json index 9bb5b593d8..539d5dce75 100644 --- a/packages/snaps-execution-environments/tsconfig.json +++ b/packages/snaps-execution-environments/tsconfig.json @@ -5,13 +5,7 @@ "typeRoots": ["../../node_modules/@types", "./node_modules/@types"], "allowJs": true }, - "include": [ - "./src", - "webpack.config.js", - "scripts", - "package.json", - "tsup.config.ts" - ], + "include": ["./src", "webpack.config.js", "scripts", "package.json"], "references": [ { "path": "../snaps-sdk" diff --git a/packages/snaps-execution-environments/tsup.config.ts b/packages/snaps-execution-environments/tsup.config.ts deleted file mode 100644 index b341957eee..0000000000 --- a/packages/snaps-execution-environments/tsup.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, - external: ['@metamask/snaps-execution-environments'], -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-jest/jest-preset.js b/packages/snaps-jest/jest-preset.js index 62b1e54322..d20d8bb708 100644 --- a/packages/snaps-jest/jest-preset.js +++ b/packages/snaps-jest/jest-preset.js @@ -12,7 +12,7 @@ const config = { // timeout to 30 seconds by default. testTimeout: 30000, - setupFilesAfterEnv: [resolve(__dirname, 'dist', 'setup.js')], + setupFilesAfterEnv: [resolve(__dirname, 'dist', 'setup.cjs')], }; module.exports = config; diff --git a/packages/snaps-jest/package.json b/packages/snaps-jest/package.json index 52ca848a88..dc3cdb87b6 100644 --- a/packages/snaps-jest/package.json +++ b/packages/snaps-jest/package.json @@ -5,16 +5,21 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./jest-preset": "./jest-preset.js", "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist", "jest-preset.js" @@ -29,12 +34,9 @@ "lint:ci": "yarn lint", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-jest", - "build": "tsup --clean && yarn build:types", - "build:types": "tsc --project tsconfig.build.json", - "clean": "rimraf '*.tsbuildinfo' 'dist'", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "publish:preview": "yarn npm publish --tag preview", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@jest/environment": "^29.5.0", @@ -72,6 +74,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/mime": "^3.0.0", "@types/semver": "^7.5.0", @@ -91,8 +94,6 @@ "jest-it-up": "^2.0.0", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", - "tsup": "^8.0.1", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/snaps-jest/src/types/index.ts b/packages/snaps-jest/src/types/index.ts new file mode 100644 index 0000000000..fcb073fefc --- /dev/null +++ b/packages/snaps-jest/src/types/index.ts @@ -0,0 +1 @@ +export * from './types'; diff --git a/packages/snaps-jest/src/types.ts b/packages/snaps-jest/src/types/types.ts similarity index 99% rename from packages/snaps-jest/src/types.ts rename to packages/snaps-jest/src/types/types.ts index eb29ce63c0..a5476de548 100644 --- a/packages/snaps-jest/src/types.ts +++ b/packages/snaps-jest/src/types/types.ts @@ -9,7 +9,7 @@ import type { SnapOptionsStruct, SnapResponseStruct, TransactionOptionsStruct, -} from './internals'; +} from '../internals'; export type RequestOptions = { /** diff --git a/packages/snaps-jest/tsconfig.build.json b/packages/snaps-jest/tsconfig.build.json index 122ed335e1..e19a4c36e4 100644 --- a/packages/snaps-jest/tsconfig.build.json +++ b/packages/snaps-jest/tsconfig.build.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./src" }, "include": ["./src"], @@ -15,13 +15,19 @@ ], "references": [ { - "path": "../snaps-utils/tsconfig.build.json" + "path": "../snaps-controllers/tsconfig.build.json" + }, + { + "path": "../snaps-execution-environments/tsconfig.build.json" + }, + { + "path": "../snaps-rpc-methods/tsconfig.build.json" }, { "path": "../snaps-sdk/tsconfig.build.json" }, { - "path": "../snaps-simulator/tsconfig.build.json" + "path": "../snaps-utils/tsconfig.build.json" } ] } diff --git a/packages/snaps-jest/tsconfig.json b/packages/snaps-jest/tsconfig.json index 441aef3546..5816f86b5b 100644 --- a/packages/snaps-jest/tsconfig.json +++ b/packages/snaps-jest/tsconfig.json @@ -3,16 +3,22 @@ "compilerOptions": { "baseUrl": "./" }, - "include": ["./src", "package.json", "tsup.config.ts"], + "include": ["./src", "package.json"], "references": [ { - "path": "../snaps-utils" + "path": "../snaps-controllers" + }, + { + "path": "../snaps-execution-environments" }, { - "path": "../snaps-simulator" + "path": "../snaps-rpc-methods" }, { "path": "../snaps-sdk" + }, + { + "path": "../snaps-utils" } ] } diff --git a/packages/snaps-jest/tsup.config.ts b/packages/snaps-jest/tsup.config.ts deleted file mode 100644 index 3eaf645296..0000000000 --- a/packages/snaps-jest/tsup.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-rollup-plugin/package.json b/packages/snaps-rollup-plugin/package.json index 3ff68282f6..1cb3390387 100644 --- a/packages/snaps-rollup-plugin/package.json +++ b/packages/snaps-rollup-plugin/package.json @@ -12,15 +12,20 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist" ], @@ -33,13 +38,10 @@ "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-rollup-plugin", - "build": "tsup --clean && yarn build:types", - "build:types": "tsc --project tsconfig.build.json", - "clean": "rimraf '*.tsbuildinfo' 'dist'", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/snaps-utils": "workspace:^" @@ -54,6 +56,7 @@ "@rollup/plugin-virtual": "^2.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", @@ -72,9 +75,7 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "rollup": "^2.73.0", - "tsup": "^8.0.1", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/snaps-rollup-plugin/tsconfig.build.json b/packages/snaps-rollup-plugin/tsconfig.build.json index 31c878583c..4dc952c93e 100644 --- a/packages/snaps-rollup-plugin/tsconfig.build.json +++ b/packages/snaps-rollup-plugin/tsconfig.build.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./src" }, "include": ["./src"], diff --git a/packages/snaps-rollup-plugin/tsconfig.json b/packages/snaps-rollup-plugin/tsconfig.json index dc42b0cdc0..108eebf353 100644 --- a/packages/snaps-rollup-plugin/tsconfig.json +++ b/packages/snaps-rollup-plugin/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "baseUrl": "./" }, - "include": ["./src", "package.json", "tsup.config.ts"], + "include": ["./src", "package.json"], "references": [{ "path": "../snaps-utils" }] } diff --git a/packages/snaps-rollup-plugin/tsup.config.ts b/packages/snaps-rollup-plugin/tsup.config.ts deleted file mode 100644 index 3eaf645296..0000000000 --- a/packages/snaps-rollup-plugin/tsup.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-rpc-methods/package.json b/packages/snaps-rpc-methods/package.json index 2171de61a6..b7ddbb4e4f 100644 --- a/packages/snaps-rpc-methods/package.json +++ b/packages/snaps-rpc-methods/package.json @@ -9,15 +9,20 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist" ], @@ -30,13 +35,10 @@ "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-rpc-methods", - "build": "tsup --clean && yarn build:types", - "build:types": "tsc --project tsconfig.build.json", - "clean": "rimraf '*.tsbuildinfo' 'dist'", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/key-tree": "^9.1.2", @@ -58,6 +60,7 @@ "@metamask/json-rpc-engine": "^9.0.2", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/node": "18.14.2", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", @@ -75,8 +78,6 @@ "jest-it-up": "^2.0.0", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", - "tsup": "^8.0.1", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/snaps-rpc-methods/tsconfig.build.json b/packages/snaps-rpc-methods/tsconfig.build.json index b71fd38392..9560ed3410 100644 --- a/packages/snaps-rpc-methods/tsconfig.build.json +++ b/packages/snaps-rpc-methods/tsconfig.build.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./src" }, "include": ["./src"], diff --git a/packages/snaps-rpc-methods/tsconfig.json b/packages/snaps-rpc-methods/tsconfig.json index 87b8b62915..c4fbe0133f 100644 --- a/packages/snaps-rpc-methods/tsconfig.json +++ b/packages/snaps-rpc-methods/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "baseUrl": "./" }, - "include": ["./src", "package.json", "tsup.config.ts"], + "include": ["./src", "package.json"], "references": [{ "path": "../snaps-sdk" }, { "path": "../snaps-utils" }] } diff --git a/packages/snaps-rpc-methods/tsup.config.ts b/packages/snaps-rpc-methods/tsup.config.ts deleted file mode 100644 index 3eaf645296..0000000000 --- a/packages/snaps-rpc-methods/tsup.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-sdk/jsx-dev-runtime.d.ts b/packages/snaps-sdk/jsx-dev-runtime.d.ts index 9f6da66d30..ae34cba2ae 100644 --- a/packages/snaps-sdk/jsx-dev-runtime.d.ts +++ b/packages/snaps-sdk/jsx-dev-runtime.d.ts @@ -1 +1,3 @@ -export * from './dist/types/jsx/jsx-dev-runtime'; +/* eslint-disable import/extensions */ + +export * from './dist/jsx/jsx-dev-runtime.cjs'; diff --git a/packages/snaps-sdk/jsx-dev-runtime.js b/packages/snaps-sdk/jsx-dev-runtime.js index c4cdeabaeb..d9bb40763c 100644 --- a/packages/snaps-sdk/jsx-dev-runtime.js +++ b/packages/snaps-sdk/jsx-dev-runtime.js @@ -2,4 +2,4 @@ // Re-exported for compatibility with build tools that don't support the // `exports` field in package.json -module.exports = require('./dist/jsx/jsx-dev-runtime'); +module.exports = require('./dist/jsx/jsx-dev-runtime.cjs'); diff --git a/packages/snaps-sdk/jsx-runtime.d.ts b/packages/snaps-sdk/jsx-runtime.d.ts index d7a2093a35..e16a60d095 100644 --- a/packages/snaps-sdk/jsx-runtime.d.ts +++ b/packages/snaps-sdk/jsx-runtime.d.ts @@ -1 +1,3 @@ -export * from './dist/types/jsx/jsx-runtime'; +/* eslint-disable import/extensions */ + +export * from './dist/jsx/jsx-runtime.cjs'; diff --git a/packages/snaps-sdk/jsx-runtime.js b/packages/snaps-sdk/jsx-runtime.js index fbad611e2e..1a87fed683 100644 --- a/packages/snaps-sdk/jsx-runtime.js +++ b/packages/snaps-sdk/jsx-runtime.js @@ -2,4 +2,4 @@ // Re-exported for compatibility with build tools that don't support the // `exports` field in package.json -module.exports = require('./dist/jsx/jsx-runtime'); +module.exports = require('./dist/jsx/jsx-runtime.cjs'); diff --git a/packages/snaps-sdk/jsx.d.ts b/packages/snaps-sdk/jsx.d.ts index 4d05055341..064e9a0b4f 100644 --- a/packages/snaps-sdk/jsx.d.ts +++ b/packages/snaps-sdk/jsx.d.ts @@ -1 +1,3 @@ -export * from './dist/types/jsx'; +/* eslint-disable import/extensions */ + +export * from './dist/jsx/index.cjs'; diff --git a/packages/snaps-sdk/jsx.js b/packages/snaps-sdk/jsx.js index 9005da32d7..6646b6a6d1 100644 --- a/packages/snaps-sdk/jsx.js +++ b/packages/snaps-sdk/jsx.js @@ -2,4 +2,4 @@ // Re-exported for compatibility with build tools that don't support the // `exports` field in package.json -module.exports = require('./dist/jsx/index'); +module.exports = require('./dist/jsx/index.cjs'); diff --git a/packages/snaps-sdk/package.json b/packages/snaps-sdk/package.json index f4b9ab4b2f..4fa039b8f6 100644 --- a/packages/snaps-sdk/package.json +++ b/packages/snaps-sdk/package.json @@ -8,30 +8,50 @@ "sideEffects": false, "exports": { ".": { - "types": "./dist/types/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.js" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs", + "types": "./dist/index.d.cts" + } }, "./jsx": { - "types": "./dist/types/jsx/index.d.ts", - "import": "./dist/jsx/index.mjs", - "require": "./dist/jsx/index.js" + "import": { + "types": "./dist/types/jsx/index.d.mts", + "default": "./dist/jsx/index.mjs" + }, + "require": { + "default": "./dist/jsx/index.cjs", + "types": "./dist/types/jsx/index.d.cts" + } }, "./jsx-runtime": { - "types": "./dist/types/jsx/jsx-runtime.d.ts", - "import": "./dist/jsx/jsx-runtime.mjs", - "require": "./dist/jsx/jsx-runtime.js" + "import": { + "types": "./dist/types/jsx/jsx-runtime.d.mts", + "default": "./dist/jsx/jsx-runtime.mjs" + }, + "require": { + "default": "./dist/jsx/jsx-runtime.cjs", + "types": "./dist/types/jsx/jsx-runtime.d.cts" + } }, "./jsx-dev-runtime": { - "types": "./dist/types/jsx/jsx-dev-runtime.d.ts", - "import": "./dist/jsx/jsx-dev-runtime.mjs", - "require": "./dist/jsx/jsx-dev-runtime.js" + "import": { + "types": "./dist/types/jsx/jsx-dev-runtime.d.mts", + "default": "./dist/jsx/jsx-dev-runtime.mjs" + }, + "require": { + "default": "./dist/jsx/jsx-dev-runtime.cjs", + "types": "./dist/types/jsx/jsx-dev-runtime.d.cts" + } }, "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist", "jsx.js", @@ -50,13 +70,10 @@ "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-sdk", - "build": "tsup --clean && yarn build:types", - "build:types": "tsc --project tsconfig.build.json", - "clean": "rimraf '*.tsbuildinfo' 'dist'", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/key-tree": "^9.1.2", @@ -72,7 +89,7 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", - "@swc/core": "1.3.78", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", @@ -92,9 +109,7 @@ "jest-it-up": "^2.0.0", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "ts-jest": "^29.1.1", - "tsup": "^8.0.1", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/snaps-sdk/tsconfig.build.json b/packages/snaps-sdk/tsconfig.build.json index c51cd58db5..3739f54e54 100644 --- a/packages/snaps-sdk/tsconfig.build.json +++ b/packages/snaps-sdk/tsconfig.build.json @@ -2,8 +2,10 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", - "rootDir": "./src" + "outDir": "./dist", + "rootDir": "./src", + "module": "ES2020", + "moduleResolution": "Node10" }, "include": ["./src"], "exclude": [ diff --git a/packages/snaps-sdk/tsconfig.json b/packages/snaps-sdk/tsconfig.json index 13936c8364..4151f21fe0 100644 --- a/packages/snaps-sdk/tsconfig.json +++ b/packages/snaps-sdk/tsconfig.json @@ -3,12 +3,13 @@ "compilerOptions": { "baseUrl": "./", "jsx": "react-jsx", - "jsxImportSource": "@metamask/snaps-sdk" + "jsxImportSource": "@metamask/snaps-sdk", + "module": "ES2020", + "moduleResolution": "Node10" }, "include": [ "./src", "package.json", - "tsup.config.ts", "jsx.d.ts", "jsx-runtime.d.ts", "jsx-dev-runtime.d.ts" diff --git a/packages/snaps-sdk/tsup.config.ts b/packages/snaps-sdk/tsup.config.ts deleted file mode 100644 index f8e0b2b96f..0000000000 --- a/packages/snaps-sdk/tsup.config.ts +++ /dev/null @@ -1,27 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -delete baseConfig.entry; - -const config: Options = { - name: packageJson.name, - entry: [ - 'src/index.ts', - 'src/jsx/index.ts', - 'src/jsx/jsx-runtime.ts', - 'src/jsx/jsx-dev-runtime.ts', - ], - - // Esbuild is not deterministic when code splitting is enabled. This is - // problematic for building the example Snaps in this repository, so we - // disable code splitting here. - splitting: false, -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-simulator/.depcheckrc.json b/packages/snaps-simulator/.depcheckrc.json index fb5a498268..c1fe2fd17d 100644 --- a/packages/snaps-simulator/.depcheckrc.json +++ b/packages/snaps-simulator/.depcheckrc.json @@ -5,6 +5,7 @@ "@lavamoat/preinstall-always-fail", "@metamask/auto-changelog", "@metamask/eslint-*", + "@swc/core", "@types/*", "@typescript-eslint/*", "assert", diff --git a/packages/snaps-simulator/package.json b/packages/snaps-simulator/package.json index e24523679c..21f93b515a 100644 --- a/packages/snaps-simulator/package.json +++ b/packages/snaps-simulator/package.json @@ -19,7 +19,6 @@ "test": "jest && jest-it-up --margin 0.5", "test:ci": "yarn test", "test:watch": "jest --watch", - "clean": "rimraf '*.tsbuildinfo' 'dist'", "lint:ci": "yarn lint", "publish:preview": "yarn npm publish --tag preview", "lint:dependencies": "depcheck" @@ -118,14 +117,12 @@ "react-refresh": "^0.14.0", "readable-stream": "^3.6.2", "redux-saga-test-plan": "^4.0.6", - "rimraf": "^4.1.2", "stream-browserify": "^3.0.0", "style-loader": "^3.3.2", "swc-loader": "^0.2.3", "terser-webpack-plugin": "^5.3.9", "ts-node": "^10.9.1", "tsconfig-paths-webpack-plugin": "^4.0.1", - "tsup": "^8.0.1", "typescript": "~5.3.3", "webpack": "^5.88.0", "webpack-cli": "^5.1.4", diff --git a/packages/snaps-simulator/tsconfig.build.json b/packages/snaps-simulator/tsconfig.build.json index 743bb079fb..55bad5951c 100644 --- a/packages/snaps-simulator/tsconfig.build.json +++ b/packages/snaps-simulator/tsconfig.build.json @@ -3,7 +3,7 @@ "compilerOptions": { "jsx": "react-jsx", "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./", "skipLibCheck": true, "resolveJsonModule": true diff --git a/packages/snaps-simulator/tsconfig.json b/packages/snaps-simulator/tsconfig.json index ab6982a118..ff5642e437 100644 --- a/packages/snaps-simulator/tsconfig.json +++ b/packages/snaps-simulator/tsconfig.json @@ -5,7 +5,7 @@ "jsx": "react-jsx", "resolveJsonModule": true }, - "include": ["./src", "webpack.config.ts", "package.json", "tsup.config.ts"], + "include": ["./src", "webpack.config.ts", "package.json"], "references": [ { "path": "../snaps-rpc-methods" }, { "path": "../snaps-controllers" }, diff --git a/packages/snaps-simulator/tsup.config.ts b/packages/snaps-simulator/tsup.config.ts deleted file mode 100644 index 3eaf645296..0000000000 --- a/packages/snaps-simulator/tsup.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-utils/package.json b/packages/snaps-utils/package.json index cc85cc3138..25fbf82b58 100644 --- a/packages/snaps-utils/package.json +++ b/packages/snaps-utils/package.json @@ -8,25 +8,40 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./node": { - "import": "./dist/node.mjs", - "require": "./dist/node.js", - "types": "./dist/types/node.d.ts" + "import": { + "types": "./dist/node.d.mts", + "default": "./dist/node.mjs" + }, + "require": { + "types": "./dist/node.d.cts", + "default": "./dist/node.cjs" + } }, "./test-utils": { - "import": "./dist/test-utils/index.mjs", - "require": "./dist/test-utils/index.js", - "types": "./dist/types/test-utils/index.d.ts" + "import": { + "types": "./dist/test-utils/index.d.mts", + "default": "./dist/test-utils/index.mjs" + }, + "require": { + "types": "./dist/test-utils/index.d.cts", + "default": "./dist/test-utils/index.cjs" + } }, "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist" ], @@ -40,14 +55,11 @@ "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-utils", - "build": "tsup --clean && yarn build:types", - "build:types": "tsc --project tsconfig.build.json", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "build:clean": "yarn clean && yarn build", - "clean": "rimraf '*.tsbuildinfo' 'dist'", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@babel/core": "^7.23.2", @@ -86,6 +98,7 @@ "@metamask/post-message-stream": "^8.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/mocha": "^10.0.1", "@types/node": "18.14.2", @@ -121,7 +134,6 @@ "prettier-plugin-packagejson": "^2.2.11", "rimraf": "^4.1.2", "ts-node": "^10.9.1", - "tsup": "^8.0.1", "typescript": "~5.3.3", "vite": "^4.3.9", "vite-tsconfig-paths": "^4.0.5", diff --git a/packages/snaps-utils/src/eval-worker.js b/packages/snaps-utils/src/eval-worker.cjs similarity index 87% rename from packages/snaps-utils/src/eval-worker.js rename to packages/snaps-utils/src/eval-worker.cjs index c9beab78ed..e1eb76f5ac 100644 --- a/packages/snaps-utils/src/eval-worker.js +++ b/packages/snaps-utils/src/eval-worker.cjs @@ -3,7 +3,7 @@ require('ts-node').register({ transpileOnly: true, compilerOptions: { - module: 'commonjs', + module: 'Node16', } }); diff --git a/packages/snaps-utils/src/eval-worker.ts b/packages/snaps-utils/src/eval-worker.ts index 5c7fa4dc2f..a462050700 100644 --- a/packages/snaps-utils/src/eval-worker.ts +++ b/packages/snaps-utils/src/eval-worker.ts @@ -1,3 +1,6 @@ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore - TypeScript complains about this being ESM in a CJS file, but +// `ses/lockdown` has a CommonJS entry point. // eslint-disable-next-line import/no-unassigned-import import 'ses/lockdown'; diff --git a/packages/snaps-utils/src/eval.ts b/packages/snaps-utils/src/eval.ts index 5bd19605fe..a583091dca 100644 --- a/packages/snaps-utils/src/eval.ts +++ b/packages/snaps-utils/src/eval.ts @@ -31,7 +31,7 @@ export async function evalBundle(bundlePath: string): Promise { await validateFilePath(bundlePath); return new Promise((resolve, reject) => { - const worker = fork(join(__dirname, 'eval-worker.js'), [bundlePath], { + const worker = fork(join(__dirname, 'eval-worker.cjs'), [bundlePath], { // To avoid printing the output of the worker to the console, we set // `stdio` to `pipe` and handle the output ourselves. stdio: 'pipe', diff --git a/packages/snaps-utils/tsconfig.build.json b/packages/snaps-utils/tsconfig.build.json index 89e9bd47d8..faae0157b7 100644 --- a/packages/snaps-utils/tsconfig.build.json +++ b/packages/snaps-utils/tsconfig.build.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./src" }, "include": ["./src"], @@ -12,7 +12,7 @@ "./src/**/test-utils", "./src/**/__mocks__", "./src/**/__snapshots__", - "./src/eval-worker.js", + "./src/eval-worker.cjs", "scripts" ], "references": [ diff --git a/packages/snaps-utils/tsconfig.json b/packages/snaps-utils/tsconfig.json index 0d410cef02..f80bb06ff9 100644 --- a/packages/snaps-utils/tsconfig.json +++ b/packages/snaps-utils/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "baseUrl": "./" }, - "include": ["./src", "scripts", "package.json", "tsup.config.ts"], + "include": ["./src", "scripts", "package.json"], "references": [{ "path": "../snaps-sdk" }] } diff --git a/packages/snaps-utils/tsup.config.ts b/packages/snaps-utils/tsup.config.ts deleted file mode 100644 index c21ce6b3b1..0000000000 --- a/packages/snaps-utils/tsup.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, - entry: ['!./src/eval-worker.js'], -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/snaps-webpack-plugin/package.json b/packages/snaps-webpack-plugin/package.json index a2fc4ebbf8..17db6f65ae 100644 --- a/packages/snaps-webpack-plugin/package.json +++ b/packages/snaps-webpack-plugin/package.json @@ -12,15 +12,20 @@ "sideEffects": false, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/types/index.d.ts" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist" ], @@ -33,13 +38,10 @@ "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-webpack-plugin", - "build": "tsup --clean && yarn build:types", - "build:types": "tsc --project tsconfig.build.json", - "clean": "rimraf '*.tsbuildinfo' 'dist'", + "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", - "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/snaps-sdk": "workspace:^", @@ -56,6 +58,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/webpack-sources": "^3.2.0", "@typescript-eslint/eslint-plugin": "^5.42.1", @@ -75,8 +78,6 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", - "tsup": "^8.0.1", "typescript": "~5.3.3", "webpack": "^5.88.0" }, diff --git a/packages/snaps-webpack-plugin/tsconfig.build.json b/packages/snaps-webpack-plugin/tsconfig.build.json index 6929150752..ee60819a70 100644 --- a/packages/snaps-webpack-plugin/tsconfig.build.json +++ b/packages/snaps-webpack-plugin/tsconfig.build.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.packages.build.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist/types", + "outDir": "./dist", "rootDir": "./src" }, "include": ["./src"], diff --git a/packages/snaps-webpack-plugin/tsconfig.json b/packages/snaps-webpack-plugin/tsconfig.json index 7fdd0d0331..9a1233c97e 100644 --- a/packages/snaps-webpack-plugin/tsconfig.json +++ b/packages/snaps-webpack-plugin/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "baseUrl": "./" }, - "include": ["./src", "package.json", "tsup.config.ts"], + "include": ["./src", "package.json"], "references": [ { "path": "../snaps-sdk" diff --git a/packages/snaps-webpack-plugin/tsup.config.ts b/packages/snaps-webpack-plugin/tsup.config.ts deleted file mode 100644 index ba676e6165..0000000000 --- a/packages/snaps-webpack-plugin/tsup.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import deepmerge from 'deepmerge'; -import type { Options } from 'tsup'; - -import packageJson from './package.json'; - -// `tsup.config.ts` is not under `rootDir`, so we need to use `require` instead. -// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const { default: baseConfig } = require('../../tsup.config'); - -const config: Options = { - name: packageJson.name, - external: ['@swc/core', 'pnpapi', 'uglify-js'], -}; - -export default deepmerge(baseConfig, config); diff --git a/packages/test-snaps/package.json b/packages/test-snaps/package.json index 731fbd7b04..d85e52f83f 100644 --- a/packages/test-snaps/package.json +++ b/packages/test-snaps/package.json @@ -99,7 +99,6 @@ "jest": "^29.0.2", "jest-it-up": "^2.0.0", "prettier": "^2.7.1", - "rimraf": "^4.1.2", "style-loader": "^3.3.2", "swc-loader": "^0.2.3", "terser-webpack-plugin": "^5.3.9", diff --git a/scripts/verify-tsconfig.mjs b/scripts/verify-tsconfig.mjs index e18faf6dde..25bb1fa427 100644 --- a/scripts/verify-tsconfig.mjs +++ b/scripts/verify-tsconfig.mjs @@ -5,7 +5,7 @@ import { fileURLToPath } from 'url'; const cwd = pathUtils.dirname(fileURLToPath(import.meta.url)) // These are the packages we expect to _not_ be referenced in the root tsconfig. -const IGNORE_LIST = new Set(['examples', 'test-snaps']); +const IGNORE_LIST = new Set(['examples', 'snaps-simulator', 'test-snaps']); // Get reference paths from root tsconfig.json const rootTsconfig = JSON.parse(await fs.readFile('./tsconfig.json', { encoding: 'utf8' })); diff --git a/tsconfig.build.json b/tsconfig.build.json index 99ddb4f587..3236d1d92c 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -10,7 +10,6 @@ { "path": "./packages/snaps-rollup-plugin/tsconfig.build.json" }, { "path": "./packages/snaps-rpc-methods/tsconfig.build.json" }, { "path": "./packages/snaps-sdk/tsconfig.build.json" }, - { "path": "./packages/snaps-simulator/tsconfig.build.json" }, { "path": "./packages/snaps-utils/tsconfig.build.json" }, { "path": "./packages/snaps-webpack-plugin/tsconfig.build.json" } ] diff --git a/tsconfig.json b/tsconfig.json index 39d06b3601..b65dc62c29 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,6 @@ { "path": "./packages/snaps-rollup-plugin" }, { "path": "./packages/snaps-rpc-methods" }, { "path": "./packages/snaps-sdk" }, - { "path": "./packages/snaps-simulator" }, { "path": "./packages/snaps-utils" }, { "path": "./packages/snaps-webpack-plugin" } ], @@ -19,5 +18,5 @@ "resolveJsonModule": true }, "files": [], - "include": ["scripts", "tsup.config.ts"] + "include": ["scripts"] } diff --git a/tsconfig.packages.build.json b/tsconfig.packages.build.json index 087c534e7c..ef6e2ec3ca 100644 --- a/tsconfig.packages.build.json +++ b/tsconfig.packages.build.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "inlineSources": true, - "sourceMap": true, - "module": "ES2020" + "sourceMap": true } } diff --git a/tsconfig.packages.json b/tsconfig.packages.json index b4b99ab09b..0c4caea6d9 100644 --- a/tsconfig.packages.json +++ b/tsconfig.packages.json @@ -6,8 +6,8 @@ "jsx": "react-jsx", "jsxImportSource": "@metamask/snaps-sdk", "lib": ["DOM", "ES2020"], - "module": "CommonJS", - "moduleResolution": "node", + "module": "Node16", + "moduleResolution": "Node16", "paths": { "@metamask/*/test-utils": ["../*/src/test-utils"], "@metamask/*/node": ["../*/src/node"], diff --git a/tsup.config.ts b/tsup.config.ts deleted file mode 100644 index d5b27a188b..0000000000 --- a/tsup.config.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { builtinModules } from 'module'; -import type { Options } from 'tsup'; - -// `Plugin` is not exported from `tsup`, so we have to define it ourselves. -type Plugin = Options['plugins'][number]; - -const DIRNAME_SHIM = `import { fileURLToPath } from 'url' -import path from 'path' - -const getFilename = () => fileURLToPath(import.meta.url) -const getDirname = () => path.dirname(getFilename()) - -export const __dirname = /* @__PURE__ */ getDirname()`; - -/** - * A `tsup` plugin that adds a `__dirname` shim to the beginning of each chunk - * that uses `__dirname`. This is necessary because `__dirname` is not available - * in ESM, so we have to use `import.meta.url` and `fileURLToPath` to get the - * dirname of the current file. - * - * Note: This breaks source maps in the files that use `__dirname`. - */ -const dirnameShimPlugin: Plugin = { - name: 'dirname-shim-plugin', - - renderChunk(code, info) { - if ( - info.type !== 'chunk' || - this.format === 'cjs' || - !code.includes('__dirname') - ) { - return undefined; - } - - return { code: `${DIRNAME_SHIM}\n${code}`, map: info.map }; - }, -}; - -const config: Options = { - // Clean the dist folder before bundling. - clean: true, - - // The entry to bundle. - entry: [ - 'src/**/*.ts', - 'src/**/*.tsx', - '!src/**/__fixtures__/**/*', - '!src/**/__mocks__/**/*', - '!src/**/__test__/**/*', - '!src/**/__tests__/**/*', - '!src/**/__snapshots__/**/*', - '!src/**/test-utils/**/*', - '!src/**/*.test.ts', - '!src/**/*.test.tsx', - '!src/**/*.test-d.ts', - '!src/**/*.test.*.ts', - '!src/**/*.test.*.tsx', - ], - - // External modules that should not be processed by `tsup`. We want to - // exclude built-in Node.js modules from the bundle. - // https://tsup.egoist.dev/#excluding-packages - external: builtinModules, - - // The output formats. We want to generate both CommonJS and ESM bundles. - // https://tsup.egoist.dev/#bundle-formats - format: ['cjs', 'esm'], - - // The platform to target when generating the bundles. `neutral` means that - // the bundles will work in both Node.js and browsers. - platform: 'neutral', - - // The plugins to use when bundling. We add a plugin that adds a `__dirname` - // shim to the beginning of each chunk that uses `__dirname`. - plugins: [dirnameShimPlugin], - - // Hide unnecessary logs from the console. Warnings and errors will still be - // shown. - silent: true, - - // Generate sourcemaps as separate files. - // https://tsup.egoist.dev/#generate-sourcemap-file - sourcemap: true, - - // Split the output into chunks. This is useful for tree-shaking. - // https://tsup.egoist.dev/#code-splitting - splitting: true, -}; - -export default config; diff --git a/yarn.lock b/yarn.lock index c125a36bdb..e8007a1cd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2843,13 +2843,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/aix-ppc64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/aix-ppc64@npm:0.19.12" - conditions: os=aix & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/android-arm64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/android-arm64@npm:0.18.20" @@ -2857,13 +2850,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/android-arm64@npm:0.19.12" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/android-arm@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/android-arm@npm:0.18.20" @@ -2871,13 +2857,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/android-arm@npm:0.19.12" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@esbuild/android-x64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/android-x64@npm:0.18.20" @@ -2885,13 +2864,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-x64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/android-x64@npm:0.19.12" - conditions: os=android & cpu=x64 - languageName: node - linkType: hard - "@esbuild/darwin-arm64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/darwin-arm64@npm:0.18.20" @@ -2899,13 +2871,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/darwin-arm64@npm:0.19.12" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/darwin-x64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/darwin-x64@npm:0.18.20" @@ -2913,13 +2878,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/darwin-x64@npm:0.19.12" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@esbuild/freebsd-arm64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/freebsd-arm64@npm:0.18.20" @@ -2927,13 +2885,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/freebsd-arm64@npm:0.19.12" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/freebsd-x64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/freebsd-x64@npm:0.18.20" @@ -2941,13 +2892,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/freebsd-x64@npm:0.19.12" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/linux-arm64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/linux-arm64@npm:0.18.20" @@ -2955,13 +2899,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/linux-arm64@npm:0.19.12" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/linux-arm@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/linux-arm@npm:0.18.20" @@ -2969,13 +2906,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/linux-arm@npm:0.19.12" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - "@esbuild/linux-ia32@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/linux-ia32@npm:0.18.20" @@ -2983,13 +2913,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/linux-ia32@npm:0.19.12" - conditions: os=linux & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/linux-loong64@npm:0.14.54": version: 0.14.54 resolution: "@esbuild/linux-loong64@npm:0.14.54" @@ -3004,13 +2927,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/linux-loong64@npm:0.19.12" - conditions: os=linux & cpu=loong64 - languageName: node - linkType: hard - "@esbuild/linux-mips64el@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/linux-mips64el@npm:0.18.20" @@ -3018,13 +2934,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/linux-mips64el@npm:0.19.12" - conditions: os=linux & cpu=mips64el - languageName: node - linkType: hard - "@esbuild/linux-ppc64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/linux-ppc64@npm:0.18.20" @@ -3032,13 +2941,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/linux-ppc64@npm:0.19.12" - conditions: os=linux & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/linux-riscv64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/linux-riscv64@npm:0.18.20" @@ -3046,13 +2948,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/linux-riscv64@npm:0.19.12" - conditions: os=linux & cpu=riscv64 - languageName: node - linkType: hard - "@esbuild/linux-s390x@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/linux-s390x@npm:0.18.20" @@ -3060,13 +2955,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/linux-s390x@npm:0.19.12" - conditions: os=linux & cpu=s390x - languageName: node - linkType: hard - "@esbuild/linux-x64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/linux-x64@npm:0.18.20" @@ -3074,13 +2962,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/linux-x64@npm:0.19.12" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - "@esbuild/netbsd-x64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/netbsd-x64@npm:0.18.20" @@ -3088,13 +2969,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/netbsd-x64@npm:0.19.12" - conditions: os=netbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/openbsd-x64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/openbsd-x64@npm:0.18.20" @@ -3102,13 +2976,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/openbsd-x64@npm:0.19.12" - conditions: os=openbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/sunos-x64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/sunos-x64@npm:0.18.20" @@ -3116,13 +2983,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/sunos-x64@npm:0.19.12" - conditions: os=sunos & cpu=x64 - languageName: node - linkType: hard - "@esbuild/win32-arm64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/win32-arm64@npm:0.18.20" @@ -3130,13 +2990,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/win32-arm64@npm:0.19.12" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/win32-ia32@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/win32-ia32@npm:0.18.20" @@ -3144,13 +2997,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/win32-ia32@npm:0.19.12" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/win32-x64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/win32-x64@npm:0.18.20" @@ -3158,13 +3004,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.19.12": - version: 0.19.12 - resolution: "@esbuild/win32-x64@npm:0.19.12" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@eslint/eslintrc@npm:^1.3.3": version: 1.3.3 resolution: "@eslint/eslintrc@npm:1.3.3" @@ -4207,9 +4046,9 @@ __metadata: "@metamask/snaps-utils": "workspace:^" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/jest": "npm:^27.5.1" "@types/node": "npm:18.14.2" - "@types/rimraf": "npm:^3.0.0" "@types/yargs": "npm:^17.0.24" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" @@ -4228,15 +4067,13 @@ __metadata: memfs: "npm:^3.4.13" prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" - rimraf: "npm:^4.1.2" semver: "npm:^7.5.4" ts-node: "npm:^10.9.1" tsc-watch: "npm:^4.5.0" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" yargs: "npm:^17.7.1" bin: - create-snap: ./dist/main.js + create-snap: ./dist/main.cjs languageName: unknown linkType: soft @@ -5420,6 +5257,7 @@ __metadata: "@metamask/snaps-utils": "workspace:^" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/browserify": "npm:^12.0.37" "@types/convert-source-map": "npm:^1.5.2" "@types/jest": "npm:^27.5.1" @@ -5444,8 +5282,6 @@ __metadata: prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" readable-stream: "npm:^3.6.2" - rimraf: "npm:^4.1.2" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" languageName: unknown linkType: soft @@ -5475,10 +5311,10 @@ __metadata: "@metamask/utils": "npm:^9.2.1" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/browserify": "npm:^12.0.37" "@types/jest": "npm:^27.5.1" "@types/node": "npm:18.14.2" - "@types/rimraf": "npm:^3.0.0" "@types/serve-handler": "npm:^6.1.0" "@types/yargs": "npm:^17.0.24" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" @@ -5519,7 +5355,6 @@ __metadata: punycode: "npm:^2.3.0" querystring-es3: "npm:^0.2.1" readable-stream: "npm:^3.6.2" - rimraf: "npm:^4.1.2" semver: "npm:^7.5.4" serve-handler: "npm:^6.1.5" stream-browserify: "npm:^3.0.0" @@ -5531,7 +5366,6 @@ __metadata: timers-browserify: "npm:^2.0.12" ts-node: "npm:^10.9.1" tsc-watch: "npm:^4.5.0" - tsup: "npm:^8.0.1" tty-browserify: "npm:^0.0.1" typescript: "npm:~5.3.3" url: "npm:^0.11.1" @@ -5541,7 +5375,7 @@ __metadata: webpack-merge: "npm:^5.9.0" yargs: "npm:^17.7.1" bin: - mm-snap: ./dist/main.js + mm-snap: ./dist/main.cjs languageName: unknown linkType: soft @@ -5575,6 +5409,7 @@ __metadata: "@metamask/utils": "npm:^9.2.1" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/chrome": "npm:^0.0.237" "@types/concat-stream": "npm:^2.0.0" "@types/gunzip-maybe": "npm:^1.4.0" @@ -5623,7 +5458,6 @@ __metadata: rimraf: "npm:^4.1.2" tar-stream: "npm:^3.1.7" ts-node: "npm:^10.9.1" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" vite: "npm:^4.3.9" vite-tsconfig-paths: "npm:^4.0.5" @@ -5666,6 +5500,7 @@ __metadata: "@metamask/utils": "npm:^9.2.1" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/express": "npm:^4.17.17" "@types/jest": "npm:^27.5.1" "@types/node": "npm:18.14.2" @@ -5709,7 +5544,6 @@ __metadata: ses: "npm:^1.1.0" terser: "npm:^5.17.7" ts-node: "npm:^10.9.1" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" vite: "npm:^4.3.9" vite-tsconfig-paths: "npm:^4.0.5" @@ -5750,6 +5584,7 @@ __metadata: "@reduxjs/toolkit": "npm:^1.9.5" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/jest": "npm:^27.5.1" "@types/mime": "npm:^3.0.0" "@types/semver": "npm:^7.5.0" @@ -5776,8 +5611,6 @@ __metadata: readable-stream: "npm:^3.6.2" redux: "npm:^4.2.1" redux-saga: "npm:^1.2.3" - rimraf: "npm:^4.1.2" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" languageName: unknown linkType: soft @@ -5808,6 +5641,7 @@ __metadata: "@rollup/plugin-virtual": "npm:^2.1.0" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/jest": "npm:^27.5.1" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" @@ -5826,9 +5660,7 @@ __metadata: memfs: "npm:^3.4.13" prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" - rimraf: "npm:^4.1.2" rollup: "npm:^2.73.0" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" languageName: unknown linkType: soft @@ -5854,6 +5686,7 @@ __metadata: "@noble/hashes": "npm:^1.3.1" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/node": "npm:18.14.2" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" @@ -5871,8 +5704,6 @@ __metadata: jest-it-up: "npm:^2.0.0" prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" - rimraf: "npm:^4.1.2" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" languageName: unknown linkType: soft @@ -5892,7 +5723,7 @@ __metadata: "@metamask/rpc-errors": "npm:^6.3.1" "@metamask/superstruct": "npm:^3.1.0" "@metamask/utils": "npm:^9.2.1" - "@swc/core": "npm:1.3.78" + "@ts-bridge/cli": "npm:^0.4.4" "@types/jest": "npm:^27.5.1" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" @@ -5912,9 +5743,7 @@ __metadata: jest-it-up: "npm:^2.0.0" prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" - rimraf: "npm:^4.1.2" ts-jest: "npm:^29.1.1" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" languageName: unknown linkType: soft @@ -6014,14 +5843,12 @@ __metadata: redux: "npm:^4.2.1" redux-saga: "npm:^1.2.3" redux-saga-test-plan: "npm:^4.0.6" - rimraf: "npm:^4.1.2" stream-browserify: "npm:^3.0.0" style-loader: "npm:^3.3.2" swc-loader: "npm:^0.2.3" terser-webpack-plugin: "npm:^5.3.9" ts-node: "npm:^10.9.1" tsconfig-paths-webpack-plugin: "npm:^4.0.1" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" webpack: "npm:^5.88.0" webpack-cli: "npm:^5.1.4" @@ -6058,6 +5885,7 @@ __metadata: "@scure/base": "npm:^1.1.1" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/jest": "npm:^27.5.1" "@types/mocha": "npm:^10.0.1" "@types/node": "npm:18.14.2" @@ -6102,7 +5930,6 @@ __metadata: semver: "npm:^7.5.4" ses: "npm:^1.1.0" ts-node: "npm:^10.9.1" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" validate-npm-package-name: "npm:^5.0.0" vite: "npm:^4.3.9" @@ -6128,6 +5955,7 @@ __metadata: "@metamask/utils": "npm:^9.2.1" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.4" "@types/jest": "npm:^27.5.1" "@types/webpack-sources": "npm:^3.2.0" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" @@ -6147,8 +5975,6 @@ __metadata: memfs: "npm:^3.4.13" prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" - rimraf: "npm:^4.1.2" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" webpack: "npm:^5.88.0" webpack-sources: "npm:^3.2.3" @@ -6241,7 +6067,6 @@ __metadata: react-bootstrap: "npm:^2.5.0" react-dom: "npm:^18.2.0" react-redux: "npm:^8.0.5" - rimraf: "npm:^4.1.2" simplex-noise: "npm:^4.0.0" style-loader: "npm:^3.3.2" swc-loader: "npm:^0.2.3" @@ -6998,97 +6823,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.9.6" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - -"@rollup/rollup-android-arm64@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-android-arm64@npm:4.9.6" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-darwin-arm64@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-darwin-arm64@npm:4.9.6" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-darwin-x64@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-darwin-x64@npm:4.9.6" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm-gnueabihf@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.9.6" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm64-gnu@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.9.6" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm64-musl@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.9.6" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - -"@rollup/rollup-linux-riscv64-gnu@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.9.6" - conditions: os=linux & cpu=riscv64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-x64-gnu@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.9.6" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-x64-musl@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.9.6" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - -"@rollup/rollup-win32-arm64-msvc@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.9.6" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-win32-ia32-msvc@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.9.6" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - -"@rollup/rollup-win32-x64-msvc@npm:4.9.6": - version: 4.9.6 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.9.6" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@scure/base@npm:^1.0.0, @scure/base@npm:^1.1.1, @scure/base@npm:^1.1.3, @scure/base@npm:~1.1.0, @scure/base@npm:~1.1.3": version: 1.1.3 resolution: "@scure/base@npm:1.1.3" @@ -7356,6 +7090,30 @@ __metadata: languageName: node linkType: hard +"@ts-bridge/cli@npm:^0.4.4": + version: 0.4.4 + resolution: "@ts-bridge/cli@npm:0.4.4" + dependencies: + "@ts-bridge/resolver": "npm:^0.1.2" + 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/a904945e6d65cc75fadacdabbb7e92ecbb8f8c916f88e7887f0e9f340f36dadd1033d89867b0b4500983de43a15b09f118225a6542bbde2c4c77da43f07e9ba4 + languageName: node + linkType: hard + +"@ts-bridge/resolver@npm:^0.1.2": + version: 0.1.2 + resolution: "@ts-bridge/resolver@npm:0.1.2" + checksum: 10/4126154e0344f4fdf35612f65d4459e993dcf914fe765ce95d8237a6ccb85e092bd31a6d31765cc24c0280a0e243ed2385f8b355d7fb13ba7c36e95e3caf1613 + languageName: node + linkType: hard + "@tsconfig/node10@npm:^1.0.7": version: 1.0.8 resolution: "@tsconfig/node10@npm:1.0.8" @@ -7551,7 +7309,7 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:*, @types/estree@npm:1.0.5, @types/estree@npm:^1.0.0": +"@types/estree@npm:*, @types/estree@npm:^1.0.0": version: 1.0.5 resolution: "@types/estree@npm:1.0.5" checksum: 10/7de6d928dd4010b0e20c6919e1a6c27b61f8d4567befa89252055fad503d587ecb9a1e3eab1b1901f923964d7019796db810b7fd6430acb26c32866d126fd408 @@ -7963,16 +7721,6 @@ __metadata: languageName: node linkType: hard -"@types/rimraf@npm:^3.0.0": - version: 3.0.2 - resolution: "@types/rimraf@npm:3.0.2" - dependencies: - "@types/glob": "npm:*" - "@types/node": "npm:*" - checksum: 10/b47fa302f46434cba704d20465861ad250df79467d3d289f9d6490d3aeeb41e8cb32dd80bd1a8fd833d1e185ac719fbf9be12e05ad9ce9be094d8ee8f1405347 - languageName: node - linkType: hard - "@types/scheduler@npm:*": version: 0.16.3 resolution: "@types/scheduler@npm:0.16.3" @@ -9189,13 +8937,6 @@ __metadata: languageName: node linkType: hard -"any-promise@npm:^1.0.0": - version: 1.3.0 - resolution: "any-promise@npm:1.3.0" - checksum: 10/6737469ba353b5becf29e4dc3680736b9caa06d300bda6548812a8fee63ae7d336d756f88572fa6b5219aed36698d808fa55f62af3e7e6845c7a1dc77d240edb - languageName: node - linkType: hard - "anymatch@npm:^3.0.3, anymatch@npm:~3.1.2": version: 3.1.2 resolution: "anymatch@npm:3.1.2" @@ -10194,17 +9935,6 @@ __metadata: languageName: node linkType: hard -"bundle-require@npm:^4.0.0": - version: 4.0.2 - resolution: "bundle-require@npm:4.0.2" - dependencies: - load-tsconfig: "npm:^0.2.3" - peerDependencies: - esbuild: ">=0.17" - checksum: 10/22178607249adb52cc76e409add67930b81cdc6507ed8cbd7b162dc2824ce53c51b669d01bf073e9b7cd9d98f10f3dbf9a3285345813085b856d437cdc97e162 - languageName: node - linkType: hard - "bytes@npm:3.0.0": version: 3.0.0 resolution: "bytes@npm:3.0.0" @@ -10234,13 +9964,6 @@ __metadata: languageName: node linkType: hard -"cac@npm:^6.7.12": - version: 6.7.14 - resolution: "cac@npm:6.7.14" - checksum: 10/002769a0fbfc51c062acd2a59df465a2a947916b02ac50b56c69ec6c018ee99ac3e7f4dd7366334ea847f1ecacf4defaa61bcd2ac283db50156ce1f1d8c8ad42 - languageName: node - linkType: hard - "cacache@npm:^16.0.2": version: 16.0.7 resolution: "cacache@npm:16.0.7" @@ -10454,7 +10177,7 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:3.5.3, chokidar@npm:^3.5.1, chokidar@npm:^3.5.3": +"chokidar@npm:3.5.3, chokidar@npm:^3.5.3": version: 3.5.3 resolution: "chokidar@npm:3.5.3" dependencies: @@ -10539,7 +10262,7 @@ __metadata: languageName: node linkType: hard -"cjs-module-lexer@npm:^1.0.0": +"cjs-module-lexer@npm:^1.0.0, cjs-module-lexer@npm:^1.3.1": version: 1.4.0 resolution: "cjs-module-lexer@npm:1.4.0" checksum: 10/b041096749792526120d8b8756929f8ef5dd4596502a0e1013f857e3027acd6091915fea77037921d70ee1a99988a100d994d3d3c2e323b04dd4c5ffd516cf13 @@ -10803,13 +10526,6 @@ __metadata: languageName: node linkType: hard -"commander@npm:^4.0.0": - version: 4.1.1 - resolution: "commander@npm:4.1.1" - checksum: 10/3b2dc4125f387dab73b3294dbcb0ab2a862f9c0ad748ee2b27e3544d25325b7a8cdfbcc228d103a98a716960b14478114a5206b5415bd48cdafa38797891562c - languageName: node - linkType: hard - "commander@npm:^8.3.0": version: 8.3.0 resolution: "commander@npm:8.3.0" @@ -12585,86 +12301,6 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.19.2": - version: 0.19.12 - resolution: "esbuild@npm:0.19.12" - dependencies: - "@esbuild/aix-ppc64": "npm:0.19.12" - "@esbuild/android-arm": "npm:0.19.12" - "@esbuild/android-arm64": "npm:0.19.12" - "@esbuild/android-x64": "npm:0.19.12" - "@esbuild/darwin-arm64": "npm:0.19.12" - "@esbuild/darwin-x64": "npm:0.19.12" - "@esbuild/freebsd-arm64": "npm:0.19.12" - "@esbuild/freebsd-x64": "npm:0.19.12" - "@esbuild/linux-arm": "npm:0.19.12" - "@esbuild/linux-arm64": "npm:0.19.12" - "@esbuild/linux-ia32": "npm:0.19.12" - "@esbuild/linux-loong64": "npm:0.19.12" - "@esbuild/linux-mips64el": "npm:0.19.12" - "@esbuild/linux-ppc64": "npm:0.19.12" - "@esbuild/linux-riscv64": "npm:0.19.12" - "@esbuild/linux-s390x": "npm:0.19.12" - "@esbuild/linux-x64": "npm:0.19.12" - "@esbuild/netbsd-x64": "npm:0.19.12" - "@esbuild/openbsd-x64": "npm:0.19.12" - "@esbuild/sunos-x64": "npm:0.19.12" - "@esbuild/win32-arm64": "npm:0.19.12" - "@esbuild/win32-ia32": "npm:0.19.12" - "@esbuild/win32-x64": "npm:0.19.12" - dependenciesMeta: - "@esbuild/aix-ppc64": - optional: true - "@esbuild/android-arm": - optional: true - "@esbuild/android-arm64": - optional: true - "@esbuild/android-x64": - optional: true - "@esbuild/darwin-arm64": - optional: true - "@esbuild/darwin-x64": - optional: true - "@esbuild/freebsd-arm64": - optional: true - "@esbuild/freebsd-x64": - optional: true - "@esbuild/linux-arm": - optional: true - "@esbuild/linux-arm64": - optional: true - "@esbuild/linux-ia32": - optional: true - "@esbuild/linux-loong64": - optional: true - "@esbuild/linux-mips64el": - optional: true - "@esbuild/linux-ppc64": - optional: true - "@esbuild/linux-riscv64": - optional: true - "@esbuild/linux-s390x": - optional: true - "@esbuild/linux-x64": - optional: true - "@esbuild/netbsd-x64": - optional: true - "@esbuild/openbsd-x64": - optional: true - "@esbuild/sunos-x64": - optional: true - "@esbuild/win32-arm64": - optional: true - "@esbuild/win32-ia32": - optional: true - "@esbuild/win32-x64": - optional: true - bin: - esbuild: bin/esbuild - checksum: 10/861fa8eb2428e8d6521a4b7c7930139e3f45e8d51a86985cc29408172a41f6b18df7b3401e7e5e2d528cdf83742da601ddfdc77043ddc4f1c715a8ddb2d8a255 - languageName: node - linkType: hard - "escalade@npm:^3.1.1": version: 3.1.1 resolution: "escalade@npm:3.1.1" @@ -14310,7 +13946,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^11.0.3, globby@npm:^11.1.0": +"globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -16200,13 +15836,6 @@ __metadata: languageName: node linkType: hard -"joycon@npm:^3.0.1": - version: 3.1.1 - resolution: "joycon@npm:3.1.1" - checksum: 10/4b36e3479144ec196425f46b3618f8a96ce7e1b658f091a309cd4906215f5b7a402d7df331a3e0a09681381a658d0c5f039cb3cf6907e0a1e17ed847f5d37775 - languageName: node - linkType: hard - "js-sdsl@npm:^4.1.4": version: 4.1.5 resolution: "js-sdsl@npm:4.1.5" @@ -16671,13 +16300,6 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:^3.0.0": - version: 3.0.0 - resolution: "lilconfig@npm:3.0.0" - checksum: 10/55f60f4f9f7b41358cc33875e3696919412683a35aec30c6c60c4f6ecb16fb6d11f7ac856b8458b9b82b21d5f4629649fbfca1de034e8d5b0cc7a70836266db6 - languageName: node - linkType: hard - "lines-and-columns@npm:^1.1.6": version: 1.1.6 resolution: "lines-and-columns@npm:1.1.6" @@ -16757,13 +16379,6 @@ __metadata: languageName: node linkType: hard -"load-tsconfig@npm:^0.2.3": - version: 0.2.5 - resolution: "load-tsconfig@npm:0.2.5" - checksum: 10/b3176f6f0c86dbdbbc7e337440a803b0b4407c55e2e1cfc53bd3db68e0211448f36428a6075ecf5e286db5d1bf791da756fc0ac4d2447717140fb6a5218ecfb4 - languageName: node - linkType: hard - "loader-runner@npm:^4.2.0": version: 4.2.0 resolution: "loader-runner@npm:4.2.0" @@ -16907,13 +16522,6 @@ __metadata: languageName: node linkType: hard -"lodash.sortby@npm:^4.7.0": - version: 4.7.0 - resolution: "lodash.sortby@npm:4.7.0" - checksum: 10/38df19ae28608af2c50ac342fc1f414508309d53e1d58ed9adfb2c3cd17c3af290058c0a0478028d932c5404df3d53349d19fa364ef6bed6145a6bc21320399e - languageName: node - linkType: hard - "lodash.throttle@npm:^4.1.1": version: 4.1.1 resolution: "lodash.throttle@npm:4.1.1" @@ -17760,17 +17368,6 @@ __metadata: languageName: node linkType: hard -"mz@npm:^2.7.0": - version: 2.7.0 - resolution: "mz@npm:2.7.0" - dependencies: - any-promise: "npm:^1.0.0" - object-assign: "npm:^4.0.1" - thenify-all: "npm:^1.0.0" - checksum: 10/8427de0ece99a07e9faed3c0c6778820d7543e3776f9a84d22cf0ec0a8eb65f6e9aee9c9d353ff9a105ff62d33a9463c6ca638974cc652ee8140cd1e35951c87 - languageName: node - linkType: hard - "n12@npm:0.4.0": version: 0.4.0 resolution: "n12@npm:0.4.0" @@ -18123,7 +17720,7 @@ __metadata: languageName: node linkType: hard -"object-assign@npm:^4.0.1, object-assign@npm:^4.1.1": +"object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" checksum: 10/fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f @@ -18787,7 +18384,7 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.1, pirates@npm:^4.0.4": +"pirates@npm:^4.0.4": version: 4.0.6 resolution: "pirates@npm:4.0.6" checksum: 10/d02dda76f4fec1cbdf395c36c11cf26f76a644f9f9a1bfa84d3167d0d3154d5289aacc72677aa20d599bb4a6937a471de1b65c995e2aea2d8687cbcd7e43ea5f @@ -18851,24 +18448,6 @@ __metadata: languageName: node linkType: hard -"postcss-load-config@npm:^4.0.1": - version: 4.0.2 - resolution: "postcss-load-config@npm:4.0.2" - dependencies: - lilconfig: "npm:^3.0.0" - yaml: "npm:^2.3.4" - peerDependencies: - postcss: ">=8.0.9" - ts-node: ">=9.0.0" - peerDependenciesMeta: - postcss: - optional: true - ts-node: - optional: true - checksum: 10/e2c2ed9b7998a5b123e1ce0c124daf6504b1454c67dcc1c8fdbcc5ffb2597b7de245e3ac34f63afc928d3fd3260b1e36492ebbdb01a9ff63f16b3c8b7b925d1b - languageName: node - linkType: hard - "postcss-modules-extract-imports@npm:^3.0.0": version: 3.0.0 resolution: "postcss-modules-extract-imports@npm:3.0.0" @@ -20293,60 +19872,6 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.0.2": - version: 4.9.6 - resolution: "rollup@npm:4.9.6" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.9.6" - "@rollup/rollup-android-arm64": "npm:4.9.6" - "@rollup/rollup-darwin-arm64": "npm:4.9.6" - "@rollup/rollup-darwin-x64": "npm:4.9.6" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.9.6" - "@rollup/rollup-linux-arm64-gnu": "npm:4.9.6" - "@rollup/rollup-linux-arm64-musl": "npm:4.9.6" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.9.6" - "@rollup/rollup-linux-x64-gnu": "npm:4.9.6" - "@rollup/rollup-linux-x64-musl": "npm:4.9.6" - "@rollup/rollup-win32-arm64-msvc": "npm:4.9.6" - "@rollup/rollup-win32-ia32-msvc": "npm:4.9.6" - "@rollup/rollup-win32-x64-msvc": "npm:4.9.6" - "@types/estree": "npm:1.0.5" - fsevents: "npm:~2.3.2" - dependenciesMeta: - "@rollup/rollup-android-arm-eabi": - optional: true - "@rollup/rollup-android-arm64": - optional: true - "@rollup/rollup-darwin-arm64": - optional: true - "@rollup/rollup-darwin-x64": - optional: true - "@rollup/rollup-linux-arm-gnueabihf": - optional: true - "@rollup/rollup-linux-arm64-gnu": - optional: true - "@rollup/rollup-linux-arm64-musl": - optional: true - "@rollup/rollup-linux-riscv64-gnu": - optional: true - "@rollup/rollup-linux-x64-gnu": - optional: true - "@rollup/rollup-linux-x64-musl": - optional: true - "@rollup/rollup-win32-arm64-msvc": - optional: true - "@rollup/rollup-win32-ia32-msvc": - optional: true - "@rollup/rollup-win32-x64-msvc": - optional: true - fsevents: - optional: true - bin: - rollup: dist/bin/rollup - checksum: 10/7c343d9d8ece2ebfbde20b62545f7ee16cbba719da94584fef72ad2f0bdea5f2c49cc429839350e7a4181be04e01bfcd1bd45e1654b8b288a612c409eaebdae4 - languageName: node - linkType: hard - "root@workspace:.": version: 0.0.0-use.local resolution: "root@workspace:." @@ -20360,6 +19885,7 @@ __metadata: "@metamask/eslint-config-typescript": "npm:^12.1.0" "@metamask/utils": "npm:^9.2.1" "@swc/core": "npm:1.3.78" + "@ts-bridge/cli": "npm:^0.4.4" "@types/jest": "npm:^27.5.1" "@types/node": "npm:18.14.2" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" @@ -20386,7 +19912,6 @@ __metadata: semver: "npm:^7.5.4" simple-git-hooks: "npm:^2.7.0" ts-node: "npm:^10.9.1" - tsup: "npm:^8.0.1" typescript: "npm:~5.3.3" vite: "npm:^4.3.9" languageName: unknown @@ -21025,15 +20550,6 @@ __metadata: languageName: node linkType: hard -"source-map@npm:0.8.0-beta.0": - version: 0.8.0-beta.0 - resolution: "source-map@npm:0.8.0-beta.0" - dependencies: - whatwg-url: "npm:^7.0.0" - checksum: 10/c02e22ab9f8b8e38655ba1e9abae9fe1f8ba216cbbea922718d5e2ea45821606a74f10edec1db9055e7f7cfd1e6a62e5eade67ec30c017a02f4c8e990accbc1c - languageName: node - linkType: hard - "source-map@npm:^0.5.7, source-map@npm:~0.5.3": version: 0.5.7 resolution: "source-map@npm:0.5.7" @@ -21509,24 +21025,6 @@ __metadata: languageName: node linkType: hard -"sucrase@npm:^3.20.3": - version: 3.35.0 - resolution: "sucrase@npm:3.35.0" - dependencies: - "@jridgewell/gen-mapping": "npm:^0.3.2" - commander: "npm:^4.0.0" - glob: "npm:^10.3.10" - lines-and-columns: "npm:^1.1.6" - mz: "npm:^2.7.0" - pirates: "npm:^4.0.1" - ts-interface-checker: "npm:^0.1.9" - bin: - sucrase: bin/sucrase - sucrase-node: bin/sucrase-node - checksum: 10/bc601558a62826f1c32287d4fdfa4f2c09fe0fec4c4d39d0e257fd9116d7d6227a18309721d4185ec84c9dc1af0d5ec0e05a42a337fbb74fc293e068549aacbe - languageName: node - linkType: hard - "suffix@npm:^0.1.0": version: 0.1.1 resolution: "suffix@npm:0.1.1" @@ -21740,24 +21238,6 @@ __metadata: languageName: node linkType: hard -"thenify-all@npm:^1.0.0": - version: 1.6.0 - resolution: "thenify-all@npm:1.6.0" - dependencies: - thenify: "npm:>= 3.1.0 < 4" - checksum: 10/dba7cc8a23a154cdcb6acb7f51d61511c37a6b077ec5ab5da6e8b874272015937788402fd271fdfc5f187f8cb0948e38d0a42dcc89d554d731652ab458f5343e - languageName: node - linkType: hard - -"thenify@npm:>= 3.1.0 < 4": - version: 3.3.1 - resolution: "thenify@npm:3.3.1" - dependencies: - any-promise: "npm:^1.0.0" - checksum: 10/486e1283a867440a904e36741ff1a177faa827cf94d69506f7e3ae4187b9afdf9ec368b3d8da225c192bfe2eb943f3f0080594156bf39f21b57cd1411e2e7f6d - languageName: node - linkType: hard - "through2@npm:4.0.2": version: 4.0.2 resolution: "through2@npm:4.0.2" @@ -21881,15 +21361,6 @@ __metadata: languageName: node linkType: hard -"tr46@npm:^1.0.1": - version: 1.0.1 - resolution: "tr46@npm:1.0.1" - dependencies: - punycode: "npm:^2.1.0" - checksum: 10/6e80d75480cb6658f7f283c15f5f41c2d4dfa243ca99a0e1baf3de6cc823fc4c829f89782a7a11e029905781fccfea42d08d8a6674ba7948c7dbc595b6f27dd3 - languageName: node - linkType: hard - "tr46@npm:^3.0.0": version: 3.0.0 resolution: "tr46@npm:3.0.0" @@ -21913,15 +21384,6 @@ __metadata: languageName: node linkType: hard -"tree-kill@npm:^1.2.2": - version: 1.2.2 - resolution: "tree-kill@npm:1.2.2" - bin: - tree-kill: cli.js - checksum: 10/49117f5f410d19c84b0464d29afb9642c863bc5ba40fcb9a245d474c6d5cc64d1b177a6e6713129eb346b40aebb9d4631d967517f9fbe8251c35b21b13cd96c7 - languageName: node - linkType: hard - "ts-api-utils@npm:^1.0.1": version: 1.3.0 resolution: "ts-api-utils@npm:1.3.0" @@ -21931,13 +21393,6 @@ __metadata: languageName: node linkType: hard -"ts-interface-checker@npm:^0.1.9": - version: 0.1.13 - resolution: "ts-interface-checker@npm:0.1.13" - checksum: 10/9f7346b9e25bade7a1050c001ec5a4f7023909c0e1644c5a96ae20703a131627f081479e6622a4ecee2177283d0069e651e507bedadd3904fc4010ab28ffce00 - languageName: node - linkType: hard - "ts-jest@npm:^29.1.1": version: 29.1.1 resolution: "ts-jest@npm:29.1.1" @@ -22096,84 +21551,6 @@ __metadata: languageName: node linkType: hard -"tsup@npm:8.0.2": - version: 8.0.2 - resolution: "tsup@npm:8.0.2" - dependencies: - bundle-require: "npm:^4.0.0" - cac: "npm:^6.7.12" - chokidar: "npm:^3.5.1" - debug: "npm:^4.3.1" - esbuild: "npm:^0.19.2" - execa: "npm:^5.0.0" - globby: "npm:^11.0.3" - joycon: "npm:^3.0.1" - postcss-load-config: "npm:^4.0.1" - resolve-from: "npm:^5.0.0" - rollup: "npm:^4.0.2" - source-map: "npm:0.8.0-beta.0" - sucrase: "npm:^3.20.3" - tree-kill: "npm:^1.2.2" - peerDependencies: - "@microsoft/api-extractor": ^7.36.0 - "@swc/core": ^1 - postcss: ^8.4.12 - typescript: ">=4.5.0" - peerDependenciesMeta: - "@microsoft/api-extractor": - optional: true - "@swc/core": - optional: true - postcss: - optional: true - typescript: - optional: true - bin: - tsup: dist/cli-default.js - tsup-node: dist/cli-node.js - checksum: 10/dd8c375181a748cdeb86aa3d779d6d755596881f47fe38b7c4b810ff1ef6424d485b23065fda0f6e32d9988bae19cd64e49f6e2f11295d5184485ab7528a37d1 - languageName: node - linkType: hard - -"tsup@patch:tsup@npm%3A8.0.2#./.yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch::locator=root%40workspace%3A.": - version: 8.0.2 - resolution: "tsup@patch:tsup@npm%3A8.0.2#./.yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch::version=8.0.2&hash=ce4dd6&locator=root%40workspace%3A." - dependencies: - bundle-require: "npm:^4.0.0" - cac: "npm:^6.7.12" - chokidar: "npm:^3.5.1" - debug: "npm:^4.3.1" - esbuild: "npm:^0.19.2" - execa: "npm:^5.0.0" - globby: "npm:^11.0.3" - joycon: "npm:^3.0.1" - postcss-load-config: "npm:^4.0.1" - resolve-from: "npm:^5.0.0" - rollup: "npm:^4.0.2" - source-map: "npm:0.8.0-beta.0" - sucrase: "npm:^3.20.3" - tree-kill: "npm:^1.2.2" - peerDependencies: - "@microsoft/api-extractor": ^7.36.0 - "@swc/core": ^1 - postcss: ^8.4.12 - typescript: ">=4.5.0" - peerDependenciesMeta: - "@microsoft/api-extractor": - optional: true - "@swc/core": - optional: true - postcss: - optional: true - typescript: - optional: true - bin: - tsup: dist/cli-default.js - tsup-node: dist/cli-node.js - checksum: 10/4f011dee02adb00970189b34642e0d3c6824d6db874c1e72fbfb800d2367d2f78852f559059a059ee9088215363d061aa5ef37ab286a64027ea7214c8a580fb8 - languageName: node - linkType: hard - "tsutils@npm:^3.21.0": version: 3.21.0 resolution: "tsutils@npm:3.21.0" @@ -22994,13 +22371,6 @@ __metadata: languageName: node linkType: hard -"webidl-conversions@npm:^4.0.2": - version: 4.0.2 - resolution: "webidl-conversions@npm:4.0.2" - checksum: 10/594187c36f2d7898f89c0ed3b9248a095fa549ecc1befb10a97bc884b5680dc96677f58df5579334d8e0d1018e5ef075689cfa2a6c459f45a61a9deb512cb59e - languageName: node - linkType: hard - "webidl-conversions@npm:^7.0.0": version: 7.0.0 resolution: "webidl-conversions@npm:7.0.0" @@ -23210,17 +22580,6 @@ __metadata: languageName: node linkType: hard -"whatwg-url@npm:^7.0.0": - version: 7.1.0 - resolution: "whatwg-url@npm:7.1.0" - dependencies: - lodash.sortby: "npm:^4.7.0" - tr46: "npm:^1.0.1" - webidl-conversions: "npm:^4.0.2" - checksum: 10/769fd35838b4e50536ae08d836472e86adbedda1d5493ea34353c55468147e7868b91d2535b59e01a9e7331ab7e4cdfdf5490c279c045da23c327cf33e32f755 - languageName: node - linkType: hard - "which-boxed-primitive@npm:^1.0.2": version: 1.0.2 resolution: "which-boxed-primitive@npm:1.0.2" @@ -23497,7 +22856,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.2.2, yaml@npm:^2.3.4": +"yaml@npm:^2.2.2": version: 2.3.4 resolution: "yaml@npm:2.3.4" checksum: 10/f8207ce43065a22268a2806ea6a0fa3974c6fde92b4b2fa0082357e487bc333e85dc518910007e7ac001b532c7c84bd3eccb6c7757e94182b564028b0008f44b