From 9dfbfa762cb73339965ef60d6b5c68406d3f626f Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Fri, 30 Aug 2024 16:42:30 +0200 Subject: [PATCH 01/19] Replace `tsup` with `ts-bridge` --- .github/workflows/build-lint-test.yml | 2 - .yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch | 13 - constraints.pro | 30 +- package.json | 13 +- packages/create-snap/package.json | 24 +- packages/create-snap/tsconfig.build.json | 2 +- packages/create-snap/tsconfig.json | 2 +- packages/create-snap/tsup.config.ts | 16 - packages/examples/packages/bip32/package.json | 2 - packages/examples/packages/bip44/package.json | 2 - .../packages/browserify-plugin/package.json | 2 - .../examples/packages/browserify/package.json | 2 - .../packages/client-status/package.json | 2 - .../examples/packages/cronjobs/package.json | 2 - .../examples/packages/dialogs/package.json | 2 - .../examples/packages/errors/package.json | 2 - .../packages/ethereum-provider/package.json | 2 - .../examples/packages/ethers-js/package.json | 2 - .../packages/file-upload/package.json | 2 - .../packages/get-entropy/package.json | 2 - .../examples/packages/get-file/package.json | 2 - .../examples/packages/home-page/package.json | 2 - .../examples/packages/images/package.json | 2 - .../packages/interactive-ui/package.json | 2 - .../packages/consumer-signer/package.json | 2 - .../packages/core-signer/package.json | 2 - .../examples/packages/json-rpc/package.json | 2 - packages/examples/packages/jsx/package.json | 2 - .../packages/lifecycle-hooks/package.json | 2 - .../packages/localization/package.json | 2 - .../packages/manage-state/package.json | 2 - .../packages/name-lookup/package.json | 2 - .../packages/network-access/package.json | 2 - .../packages/notifications/package.json | 2 - .../packages/rollup-plugin/package.json | 2 - .../packages/signature-insights/package.json | 2 - .../transaction-insights/package.json | 2 - packages/examples/packages/wasm/package.json | 2 - .../packages/webpack-plugin/package.json | 2 - packages/snaps-browserify-plugin/package.json | 22 +- .../tsconfig.build.json | 2 +- .../snaps-browserify-plugin/tsconfig.json | 2 +- .../snaps-browserify-plugin/tsup.config.ts | 14 - packages/snaps-cli/package.json | 24 +- packages/snaps-cli/tsconfig.build.json | 2 +- packages/snaps-cli/tsconfig.json | 8 +- packages/snaps-cli/tsup.config.ts | 16 - packages/snaps-controllers/package.json | 44 +- packages/snaps-controllers/react-native.js | 2 +- .../snaps-controllers/tsconfig.build.json | 2 +- packages/snaps-controllers/tsconfig.json | 8 +- packages/snaps-controllers/tsup.config.ts | 14 - .../snaps-execution-environments/package.json | 21 +- .../tsconfig.build.json | 2 +- .../tsconfig.json | 8 +- .../tsup.config.ts | 15 - packages/snaps-jest/jest-preset.js | 2 +- packages/snaps-jest/package.json | 22 +- packages/snaps-jest/tsconfig.build.json | 2 +- packages/snaps-jest/tsconfig.json | 2 +- packages/snaps-jest/tsup.config.ts | 14 - packages/snaps-rollup-plugin/package.json | 22 +- .../snaps-rollup-plugin/tsconfig.build.json | 2 +- packages/snaps-rollup-plugin/tsconfig.json | 2 +- packages/snaps-rollup-plugin/tsup.config.ts | 14 - packages/snaps-rpc-methods/package.json | 22 +- .../snaps-rpc-methods/tsconfig.build.json | 2 +- packages/snaps-rpc-methods/tsconfig.json | 2 +- packages/snaps-rpc-methods/tsup.config.ts | 14 - packages/snaps-sdk/jsx-dev-runtime.d.ts | 2 +- packages/snaps-sdk/jsx-dev-runtime.js | 2 +- packages/snaps-sdk/jsx-runtime.d.ts | 2 +- packages/snaps-sdk/jsx-runtime.js | 2 +- packages/snaps-sdk/jsx.d.ts | 2 +- packages/snaps-sdk/jsx.js | 2 +- packages/snaps-sdk/package.json | 55 +- packages/snaps-sdk/tsconfig.build.json | 2 +- packages/snaps-sdk/tsconfig.json | 1 - packages/snaps-sdk/tsup.config.ts | 27 - packages/snaps-simulator/package.json | 2 - packages/snaps-simulator/tsconfig.build.json | 2 +- packages/snaps-simulator/tsconfig.json | 2 +- packages/snaps-simulator/tsup.config.ts | 14 - packages/snaps-utils/package.json | 44 +- packages/snaps-utils/tsconfig.build.json | 2 +- packages/snaps-utils/tsconfig.json | 2 +- packages/snaps-utils/tsup.config.ts | 15 - packages/snaps-webpack-plugin/package.json | 22 +- .../snaps-webpack-plugin/tsconfig.build.json | 2 +- packages/snaps-webpack-plugin/tsconfig.json | 2 +- packages/snaps-webpack-plugin/tsup.config.ts | 15 - tsconfig.json | 2 +- tsup.config.ts | 90 --- yarn.lock | 697 +----------------- 94 files changed, 279 insertions(+), 1223 deletions(-) delete mode 100644 .yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch delete mode 100644 packages/create-snap/tsup.config.ts delete mode 100644 packages/snaps-browserify-plugin/tsup.config.ts delete mode 100644 packages/snaps-cli/tsup.config.ts delete mode 100644 packages/snaps-controllers/tsup.config.ts delete mode 100644 packages/snaps-execution-environments/tsup.config.ts delete mode 100644 packages/snaps-jest/tsup.config.ts delete mode 100644 packages/snaps-rollup-plugin/tsup.config.ts delete mode 100644 packages/snaps-rpc-methods/tsup.config.ts delete mode 100644 packages/snaps-sdk/tsup.config.ts delete mode 100644 packages/snaps-simulator/tsup.config.ts delete mode 100644 packages/snaps-utils/tsup.config.ts delete mode 100644 packages/snaps-webpack-plugin/tsup.config.ts delete mode 100644 tsup.config.ts 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..b09f2abf5c 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,18 +210,18 @@ 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') :- +gen_enforced_field(WorkspaceCwd, 'scripts.build:ci', 'ts-bridge --project tsconfig.build.json --verbose --no-references --clean') :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.', diff --git a/package.json b/package.json index a2ec20c178..e48c70953c 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", + "build:ci": "yarn build --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.3", "@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..b1ca5cb5d4 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", @@ -43,7 +46,7 @@ "lint:ci": "yarn lint", "publish:preview": "yarn npm publish --tag preview", "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@metamask/snaps-utils": "workspace:^", @@ -83,7 +86,6 @@ "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/package.json b/packages/examples/packages/bip32/package.json index 1ec1a070d3..cc019c5322 100644 --- a/packages/examples/packages/bip32/package.json +++ b/packages/examples/packages/bip32/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/bip32-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/bip44/package.json b/packages/examples/packages/bip44/package.json index 4bd6552029..298d3c135d 100644 --- a/packages/examples/packages/bip44/package.json +++ b/packages/examples/packages/bip44/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/bip44-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/browserify-plugin/package.json b/packages/examples/packages/browserify-plugin/package.json index a8e17ecf11..2a9fabb24d 100644 --- a/packages/examples/packages/browserify-plugin/package.json +++ b/packages/examples/packages/browserify-plugin/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "ts-node --swc scripts/build.ts", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/browserify-plugin-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/browserify/package.json b/packages/examples/packages/browserify/package.json index a040a89b04..dce0284ec0 100644 --- a/packages/examples/packages/browserify/package.json +++ b/packages/examples/packages/browserify/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/browserify-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/client-status/package.json b/packages/examples/packages/client-status/package.json index da6e8cbbfe..8c6aa64fc8 100644 --- a/packages/examples/packages/client-status/package.json +++ b/packages/examples/packages/client-status/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/client-status-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/cronjobs/package.json b/packages/examples/packages/cronjobs/package.json index 054d253a55..a6e981b11e 100644 --- a/packages/examples/packages/cronjobs/package.json +++ b/packages/examples/packages/cronjobs/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/cronjob-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/dialogs/package.json b/packages/examples/packages/dialogs/package.json index ea9435c795..96d14fd70c 100644 --- a/packages/examples/packages/dialogs/package.json +++ b/packages/examples/packages/dialogs/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/dialog-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/errors/package.json b/packages/examples/packages/errors/package.json index 06c7913a90..7f28c1a2e1 100644 --- a/packages/examples/packages/errors/package.json +++ b/packages/examples/packages/errors/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/error-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/ethereum-provider/package.json b/packages/examples/packages/ethereum-provider/package.json index 5d9bbc21f9..536d0f9ef2 100644 --- a/packages/examples/packages/ethereum-provider/package.json +++ b/packages/examples/packages/ethereum-provider/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/ethereum-provider-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/ethers-js/package.json b/packages/examples/packages/ethers-js/package.json index 5827f04ccb..b0afcc07b6 100644 --- a/packages/examples/packages/ethers-js/package.json +++ b/packages/examples/packages/ethers-js/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/ethers-js-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/file-upload/package.json b/packages/examples/packages/file-upload/package.json index ff4b66b0ed..d0314d79e5 100644 --- a/packages/examples/packages/file-upload/package.json +++ b/packages/examples/packages/file-upload/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/file-upload-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/get-entropy/package.json b/packages/examples/packages/get-entropy/package.json index 27e6202073..d36a9f2193 100644 --- a/packages/examples/packages/get-entropy/package.json +++ b/packages/examples/packages/get-entropy/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/get-entropy-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/get-file/package.json b/packages/examples/packages/get-file/package.json index 5ac938654a..386ba82b81 100644 --- a/packages/examples/packages/get-file/package.json +++ b/packages/examples/packages/get-file/package.json @@ -16,8 +16,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/get-file-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/home-page/package.json b/packages/examples/packages/home-page/package.json index 904d7386ee..a10e74e4a5 100644 --- a/packages/examples/packages/home-page/package.json +++ b/packages/examples/packages/home-page/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/home-page-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/images/package.json b/packages/examples/packages/images/package.json index 2540f42bcb..07b43cf5f2 100644 --- a/packages/examples/packages/images/package.json +++ b/packages/examples/packages/images/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/images-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/interactive-ui/package.json b/packages/examples/packages/interactive-ui/package.json index 8da650747a..ffc20865f8 100644 --- a/packages/examples/packages/interactive-ui/package.json +++ b/packages/examples/packages/interactive-ui/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/interactive-ui-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/invoke-snap/packages/consumer-signer/package.json b/packages/examples/packages/invoke-snap/packages/consumer-signer/package.json index 705de4a9d1..382c687587 100644 --- a/packages/examples/packages/invoke-snap/packages/consumer-signer/package.json +++ b/packages/examples/packages/invoke-snap/packages/consumer-signer/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../../../scripts/validate-changelog.sh @metamask/consumer-signer-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/invoke-snap/packages/core-signer/package.json b/packages/examples/packages/invoke-snap/packages/core-signer/package.json index f69b838ef5..e63cb839a8 100644 --- a/packages/examples/packages/invoke-snap/packages/core-signer/package.json +++ b/packages/examples/packages/invoke-snap/packages/core-signer/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../../../scripts/validate-changelog.sh @metamask/core-signer-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/json-rpc/package.json b/packages/examples/packages/json-rpc/package.json index 72b8bce88a..e8dc843392 100644 --- a/packages/examples/packages/json-rpc/package.json +++ b/packages/examples/packages/json-rpc/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/json-rpc-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/jsx/package.json b/packages/examples/packages/jsx/package.json index 58f8e77200..282735e04a 100644 --- a/packages/examples/packages/jsx/package.json +++ b/packages/examples/packages/jsx/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/jsx-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/lifecycle-hooks/package.json b/packages/examples/packages/lifecycle-hooks/package.json index 44c18a1dd3..3f96e88c64 100644 --- a/packages/examples/packages/lifecycle-hooks/package.json +++ b/packages/examples/packages/lifecycle-hooks/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/lifecycle-hooks-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/localization/package.json b/packages/examples/packages/localization/package.json index e18f835c34..eeb46a4b4a 100644 --- a/packages/examples/packages/localization/package.json +++ b/packages/examples/packages/localization/package.json @@ -16,8 +16,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/localization-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/manage-state/package.json b/packages/examples/packages/manage-state/package.json index f7fb35ccb9..eced079aec 100644 --- a/packages/examples/packages/manage-state/package.json +++ b/packages/examples/packages/manage-state/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/manage-state-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/name-lookup/package.json b/packages/examples/packages/name-lookup/package.json index 1c576e4536..58fdf0b156 100644 --- a/packages/examples/packages/name-lookup/package.json +++ b/packages/examples/packages/name-lookup/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/name-lookup-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/network-access/package.json b/packages/examples/packages/network-access/package.json index 031f75ac0f..de7a90fc73 100644 --- a/packages/examples/packages/network-access/package.json +++ b/packages/examples/packages/network-access/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/network-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/notifications/package.json b/packages/examples/packages/notifications/package.json index 19fa7356ad..f6129fd5ae 100644 --- a/packages/examples/packages/notifications/package.json +++ b/packages/examples/packages/notifications/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/notification-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/rollup-plugin/package.json b/packages/examples/packages/rollup-plugin/package.json index 0ded136e94..e0a9f32bed 100644 --- a/packages/examples/packages/rollup-plugin/package.json +++ b/packages/examples/packages/rollup-plugin/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "rollup --config", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/rollup-plugin-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/signature-insights/package.json b/packages/examples/packages/signature-insights/package.json index 91f5c7a293..6163b94bde 100644 --- a/packages/examples/packages/signature-insights/package.json +++ b/packages/examples/packages/signature-insights/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/signature-insights-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/transaction-insights/package.json b/packages/examples/packages/transaction-insights/package.json index 50d96df3e0..334122111f 100644 --- a/packages/examples/packages/transaction-insights/package.json +++ b/packages/examples/packages/transaction-insights/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "mm-snap build", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/insights-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/wasm/package.json b/packages/examples/packages/wasm/package.json index 3ea40ecd4e..de0a3619bb 100644 --- a/packages/examples/packages/wasm/package.json +++ b/packages/examples/packages/wasm/package.json @@ -16,8 +16,6 @@ "scripts": { "build": "yarn build:wasm && mm-snap build", "build:wasm": "asc", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/wasm-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/webpack-plugin/package.json b/packages/examples/packages/webpack-plugin/package.json index 9f7bc873d2..0af406c303 100644 --- a/packages/examples/packages/webpack-plugin/package.json +++ b/packages/examples/packages/webpack-plugin/package.json @@ -15,8 +15,6 @@ ], "scripts": { "build": "webpack", - "build:clean": "yarn clean && yarn build", - "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/webpack-plugin-example-snap", "lint:ci": "yarn lint", diff --git a/packages/snaps-browserify-plugin/package.json b/packages/snaps-browserify-plugin/package.json index 8618a2c186..51381a45b9 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,8 @@ "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", + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", "lint:dependencies": "depcheck" @@ -77,7 +80,6 @@ "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..64bf3178b4 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:types && 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", @@ -46,7 +49,7 @@ "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@babel/core": "^7.23.2", @@ -135,7 +138,6 @@ "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..5af10b54bc 100644 --- a/packages/snaps-cli/tsconfig.build.json +++ b/packages/snaps-cli/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-cli/tsconfig.json b/packages/snaps-cli/tsconfig.json index cf0ed65956..a2daf1a960 100644 --- a/packages/snaps-cli/tsconfig.json +++ b/packages/snaps-cli/tsconfig.json @@ -3,13 +3,7 @@ "compilerOptions": { "baseUrl": "./" }, - "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..18e6c33ad6 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", @@ -50,7 +63,7 @@ "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@metamask/approval-controller": "^7.0.2", @@ -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.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/package.json b/packages/snaps-execution-environments/package.json index 02c7587031..6c21041468 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,8 +44,7 @@ "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", @@ -48,7 +52,7 @@ "lint:ci": "yarn lint", "start": "node scripts/start.js", "lint:dependencies": "depcheck", - "build:ci": "tsup --clean" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@metamask/json-rpc-engine": "^9.0.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..1453a91e58 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,10 @@ "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" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@jest/environment": "^29.5.0", @@ -92,7 +95,6 @@ "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/tsconfig.build.json b/packages/snaps-jest/tsconfig.build.json index 122ed335e1..a697341e23 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"], diff --git a/packages/snaps-jest/tsconfig.json b/packages/snaps-jest/tsconfig.json index 441aef3546..403ec7ab09 100644 --- a/packages/snaps-jest/tsconfig.json +++ b/packages/snaps-jest/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-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..f83be7c441 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,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-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" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@metamask/snaps-utils": "workspace:^" @@ -74,7 +77,6 @@ "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..a657c27a3d 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,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-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" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@metamask/key-tree": "^9.1.2", @@ -76,7 +79,6 @@ "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..fe65566c0e 100644 --- a/packages/snaps-sdk/jsx-dev-runtime.d.ts +++ b/packages/snaps-sdk/jsx-dev-runtime.d.ts @@ -1 +1 @@ -export * from './dist/types/jsx/jsx-dev-runtime'; +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..3e1e2c1563 100644 --- a/packages/snaps-sdk/jsx-runtime.d.ts +++ b/packages/snaps-sdk/jsx-runtime.d.ts @@ -1 +1 @@ -export * from './dist/types/jsx/jsx-runtime'; +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..c0695d9787 100644 --- a/packages/snaps-sdk/jsx.d.ts +++ b/packages/snaps-sdk/jsx.d.ts @@ -1 +1 @@ -export * from './dist/types/jsx'; +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..5fe942c0d0 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,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-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" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@metamask/key-tree": "^9.1.2", @@ -94,7 +112,6 @@ "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..b5750c2595 100644 --- a/packages/snaps-sdk/tsconfig.build.json +++ b/packages/snaps-sdk/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-sdk/tsconfig.json b/packages/snaps-sdk/tsconfig.json index 13936c8364..9d7a31d51e 100644 --- a/packages/snaps-sdk/tsconfig.json +++ b/packages/snaps-sdk/tsconfig.json @@ -8,7 +8,6 @@ "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/package.json b/packages/snaps-simulator/package.json index e24523679c..0bd6fa7b53 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" @@ -125,7 +124,6 @@ "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..e5e3864fd1 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,12 @@ "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" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@babel/core": "^7.23.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/tsconfig.build.json b/packages/snaps-utils/tsconfig.build.json index 89e9bd47d8..5e9ad6a8e6 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"], 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..4fd0069944 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,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-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" + "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" }, "dependencies": { "@metamask/snaps-sdk": "workspace:^", @@ -76,7 +79,6 @@ "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/tsconfig.json b/tsconfig.json index 39d06b3601..7842684d4f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,5 +19,5 @@ "resolveJsonModule": true }, "files": [], - "include": ["scripts", "tsup.config.ts"] + "include": ["scripts"] } 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..7b5aa58fbd 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" @@ -4232,11 +4071,10 @@ __metadata: 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 @@ -5445,7 +5283,6 @@ __metadata: 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 @@ -5531,7 +5368,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 +5377,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 @@ -5623,7 +5459,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" @@ -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" @@ -5777,7 +5611,6 @@ __metadata: 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 @@ -5828,7 +5661,6 @@ __metadata: 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 @@ -5872,7 +5704,6 @@ __metadata: 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 @@ -5914,7 +5745,6 @@ __metadata: 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 @@ -6021,7 +5851,6 @@ __metadata: 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" @@ -6102,7 +5931,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" @@ -6148,7 +5976,6 @@ __metadata: 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" @@ -6998,97 +6825,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 +7092,30 @@ __metadata: languageName: node linkType: hard +"@ts-bridge/cli@npm:^0.4.3": + version: 0.4.3 + resolution: "@ts-bridge/cli@npm:0.4.3" + dependencies: + "@ts-bridge/resolver": "npm:^0.1.1" + 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/068bbb4b96f8b46276a07d79ac22542b98174648987cafd91c09d3e1ab7ededaba07d1169bb344a34a1a6f516ba1e6849552fe549fdf915df263dd0dfe24ed3e + languageName: node + linkType: hard + +"@ts-bridge/resolver@npm:^0.1.1": + version: 0.1.1 + resolution: "@ts-bridge/resolver@npm:0.1.1" + checksum: 10/2f16a392c18c85ee0945e06a6e8d8a5ee8e576863b3c44ea0b95c7fc789cc0dbff035b6522a9e67fa44bf54708fae94b3d465aee70ddf49a06d33a6931b92b7d + languageName: node + linkType: hard + "@tsconfig/node10@npm:^1.0.7": version: 1.0.8 resolution: "@tsconfig/node10@npm:1.0.8" @@ -7551,7 +7311,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 @@ -9189,13 +8949,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 +9947,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 +9976,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 +10189,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 +10274,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 +10538,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 +12313,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 +13958,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 +15848,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 +16312,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 +16391,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 +16534,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 +17380,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 +17732,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 +18396,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 +18460,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 +19884,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 +19897,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.3" "@types/jest": "npm:^27.5.1" "@types/node": "npm:18.14.2" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" @@ -20386,7 +19924,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 +20562,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 +21037,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 +21250,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 +21373,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 +21396,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 +21405,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 +21563,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 +22383,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 +22592,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 +22868,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 From b61d89c04abeaef58620be16dc4be17c317ce854 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 2 Sep 2024 10:41:46 +0200 Subject: [PATCH 02/19] Revert example package.json files --- packages/examples/packages/bip32/package.json | 2 ++ packages/examples/packages/bip44/package.json | 2 ++ packages/examples/packages/browserify-plugin/package.json | 2 ++ packages/examples/packages/browserify/package.json | 2 ++ packages/examples/packages/client-status/package.json | 2 ++ packages/examples/packages/cronjobs/package.json | 2 ++ packages/examples/packages/dialogs/package.json | 2 ++ packages/examples/packages/errors/package.json | 2 ++ packages/examples/packages/ethereum-provider/package.json | 2 ++ packages/examples/packages/ethers-js/package.json | 2 ++ packages/examples/packages/file-upload/package.json | 2 ++ packages/examples/packages/get-entropy/package.json | 2 ++ packages/examples/packages/get-file/package.json | 2 ++ packages/examples/packages/home-page/package.json | 2 ++ packages/examples/packages/images/package.json | 2 ++ packages/examples/packages/interactive-ui/package.json | 2 ++ .../packages/invoke-snap/packages/consumer-signer/package.json | 2 ++ .../packages/invoke-snap/packages/core-signer/package.json | 2 ++ packages/examples/packages/json-rpc/package.json | 2 ++ packages/examples/packages/jsx/package.json | 2 ++ packages/examples/packages/lifecycle-hooks/package.json | 2 ++ packages/examples/packages/localization/package.json | 2 ++ packages/examples/packages/manage-state/package.json | 2 ++ packages/examples/packages/name-lookup/package.json | 2 ++ packages/examples/packages/network-access/package.json | 2 ++ packages/examples/packages/notifications/package.json | 2 ++ packages/examples/packages/rollup-plugin/package.json | 2 ++ packages/examples/packages/signature-insights/package.json | 2 ++ packages/examples/packages/transaction-insights/package.json | 2 ++ packages/examples/packages/wasm/package.json | 2 ++ packages/examples/packages/webpack-plugin/package.json | 2 ++ 31 files changed, 62 insertions(+) diff --git a/packages/examples/packages/bip32/package.json b/packages/examples/packages/bip32/package.json index cc019c5322..1ec1a070d3 100644 --- a/packages/examples/packages/bip32/package.json +++ b/packages/examples/packages/bip32/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/bip32-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/bip44/package.json b/packages/examples/packages/bip44/package.json index 298d3c135d..4bd6552029 100644 --- a/packages/examples/packages/bip44/package.json +++ b/packages/examples/packages/bip44/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/bip44-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/browserify-plugin/package.json b/packages/examples/packages/browserify-plugin/package.json index 2a9fabb24d..a8e17ecf11 100644 --- a/packages/examples/packages/browserify-plugin/package.json +++ b/packages/examples/packages/browserify-plugin/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "ts-node --swc scripts/build.ts", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/browserify-plugin-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/browserify/package.json b/packages/examples/packages/browserify/package.json index dce0284ec0..a040a89b04 100644 --- a/packages/examples/packages/browserify/package.json +++ b/packages/examples/packages/browserify/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/browserify-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/client-status/package.json b/packages/examples/packages/client-status/package.json index 8c6aa64fc8..da6e8cbbfe 100644 --- a/packages/examples/packages/client-status/package.json +++ b/packages/examples/packages/client-status/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/client-status-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/cronjobs/package.json b/packages/examples/packages/cronjobs/package.json index a6e981b11e..054d253a55 100644 --- a/packages/examples/packages/cronjobs/package.json +++ b/packages/examples/packages/cronjobs/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/cronjob-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/dialogs/package.json b/packages/examples/packages/dialogs/package.json index 96d14fd70c..ea9435c795 100644 --- a/packages/examples/packages/dialogs/package.json +++ b/packages/examples/packages/dialogs/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/dialog-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/errors/package.json b/packages/examples/packages/errors/package.json index 7f28c1a2e1..06c7913a90 100644 --- a/packages/examples/packages/errors/package.json +++ b/packages/examples/packages/errors/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/error-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/ethereum-provider/package.json b/packages/examples/packages/ethereum-provider/package.json index 536d0f9ef2..5d9bbc21f9 100644 --- a/packages/examples/packages/ethereum-provider/package.json +++ b/packages/examples/packages/ethereum-provider/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/ethereum-provider-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/ethers-js/package.json b/packages/examples/packages/ethers-js/package.json index b0afcc07b6..5827f04ccb 100644 --- a/packages/examples/packages/ethers-js/package.json +++ b/packages/examples/packages/ethers-js/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/ethers-js-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/file-upload/package.json b/packages/examples/packages/file-upload/package.json index d0314d79e5..ff4b66b0ed 100644 --- a/packages/examples/packages/file-upload/package.json +++ b/packages/examples/packages/file-upload/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/file-upload-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/get-entropy/package.json b/packages/examples/packages/get-entropy/package.json index d36a9f2193..27e6202073 100644 --- a/packages/examples/packages/get-entropy/package.json +++ b/packages/examples/packages/get-entropy/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/get-entropy-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/get-file/package.json b/packages/examples/packages/get-file/package.json index 386ba82b81..5ac938654a 100644 --- a/packages/examples/packages/get-file/package.json +++ b/packages/examples/packages/get-file/package.json @@ -16,6 +16,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/get-file-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/home-page/package.json b/packages/examples/packages/home-page/package.json index a10e74e4a5..904d7386ee 100644 --- a/packages/examples/packages/home-page/package.json +++ b/packages/examples/packages/home-page/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/home-page-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/images/package.json b/packages/examples/packages/images/package.json index 07b43cf5f2..2540f42bcb 100644 --- a/packages/examples/packages/images/package.json +++ b/packages/examples/packages/images/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/images-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/interactive-ui/package.json b/packages/examples/packages/interactive-ui/package.json index ffc20865f8..8da650747a 100644 --- a/packages/examples/packages/interactive-ui/package.json +++ b/packages/examples/packages/interactive-ui/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/interactive-ui-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/invoke-snap/packages/consumer-signer/package.json b/packages/examples/packages/invoke-snap/packages/consumer-signer/package.json index 382c687587..705de4a9d1 100644 --- a/packages/examples/packages/invoke-snap/packages/consumer-signer/package.json +++ b/packages/examples/packages/invoke-snap/packages/consumer-signer/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../../../scripts/validate-changelog.sh @metamask/consumer-signer-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/invoke-snap/packages/core-signer/package.json b/packages/examples/packages/invoke-snap/packages/core-signer/package.json index e63cb839a8..f69b838ef5 100644 --- a/packages/examples/packages/invoke-snap/packages/core-signer/package.json +++ b/packages/examples/packages/invoke-snap/packages/core-signer/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../../../scripts/validate-changelog.sh @metamask/core-signer-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/json-rpc/package.json b/packages/examples/packages/json-rpc/package.json index e8dc843392..72b8bce88a 100644 --- a/packages/examples/packages/json-rpc/package.json +++ b/packages/examples/packages/json-rpc/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/json-rpc-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/jsx/package.json b/packages/examples/packages/jsx/package.json index 282735e04a..58f8e77200 100644 --- a/packages/examples/packages/jsx/package.json +++ b/packages/examples/packages/jsx/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/jsx-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/lifecycle-hooks/package.json b/packages/examples/packages/lifecycle-hooks/package.json index 3f96e88c64..44c18a1dd3 100644 --- a/packages/examples/packages/lifecycle-hooks/package.json +++ b/packages/examples/packages/lifecycle-hooks/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/lifecycle-hooks-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/localization/package.json b/packages/examples/packages/localization/package.json index eeb46a4b4a..e18f835c34 100644 --- a/packages/examples/packages/localization/package.json +++ b/packages/examples/packages/localization/package.json @@ -16,6 +16,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/localization-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/manage-state/package.json b/packages/examples/packages/manage-state/package.json index eced079aec..f7fb35ccb9 100644 --- a/packages/examples/packages/manage-state/package.json +++ b/packages/examples/packages/manage-state/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/manage-state-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/name-lookup/package.json b/packages/examples/packages/name-lookup/package.json index 58fdf0b156..1c576e4536 100644 --- a/packages/examples/packages/name-lookup/package.json +++ b/packages/examples/packages/name-lookup/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/name-lookup-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/network-access/package.json b/packages/examples/packages/network-access/package.json index de7a90fc73..031f75ac0f 100644 --- a/packages/examples/packages/network-access/package.json +++ b/packages/examples/packages/network-access/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/network-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/notifications/package.json b/packages/examples/packages/notifications/package.json index f6129fd5ae..19fa7356ad 100644 --- a/packages/examples/packages/notifications/package.json +++ b/packages/examples/packages/notifications/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/notification-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/rollup-plugin/package.json b/packages/examples/packages/rollup-plugin/package.json index e0a9f32bed..0ded136e94 100644 --- a/packages/examples/packages/rollup-plugin/package.json +++ b/packages/examples/packages/rollup-plugin/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "rollup --config", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/rollup-plugin-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/signature-insights/package.json b/packages/examples/packages/signature-insights/package.json index 6163b94bde..91f5c7a293 100644 --- a/packages/examples/packages/signature-insights/package.json +++ b/packages/examples/packages/signature-insights/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/signature-insights-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/transaction-insights/package.json b/packages/examples/packages/transaction-insights/package.json index 334122111f..50d96df3e0 100644 --- a/packages/examples/packages/transaction-insights/package.json +++ b/packages/examples/packages/transaction-insights/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/insights-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/wasm/package.json b/packages/examples/packages/wasm/package.json index de0a3619bb..3ea40ecd4e 100644 --- a/packages/examples/packages/wasm/package.json +++ b/packages/examples/packages/wasm/package.json @@ -16,6 +16,8 @@ "scripts": { "build": "yarn build:wasm && mm-snap build", "build:wasm": "asc", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/wasm-example-snap", "lint:ci": "yarn lint", diff --git a/packages/examples/packages/webpack-plugin/package.json b/packages/examples/packages/webpack-plugin/package.json index 0af406c303..9f7bc873d2 100644 --- a/packages/examples/packages/webpack-plugin/package.json +++ b/packages/examples/packages/webpack-plugin/package.json @@ -15,6 +15,8 @@ ], "scripts": { "build": "webpack", + "build:clean": "yarn clean && yarn build", + "clean": "rimraf \"dist\"", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies", "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/webpack-plugin-example-snap", "lint:ci": "yarn lint", From 5b8ea36cc7ca302e2277a55a37bd75458411acf8 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 2 Sep 2024 10:53:00 +0200 Subject: [PATCH 03/19] Fix some lint issues --- packages/create-snap/package.json | 2 -- packages/snaps-browserify-plugin/package.json | 1 - packages/snaps-cli/package.json | 2 -- packages/snaps-controllers/package.json | 1 - .../snaps-execution-environments/package.json | 1 - packages/snaps-jest/package.json | 1 - packages/snaps-rollup-plugin/package.json | 1 - packages/snaps-rpc-methods/package.json | 1 - packages/snaps-sdk/package.json | 2 -- packages/snaps-simulator/.depcheckrc.json | 1 + packages/snaps-simulator/package.json | 1 - packages/snaps-utils/package.json | 1 - packages/snaps-webpack-plugin/package.json | 1 - packages/test-snaps/package.json | 1 - yarn.lock | 26 ------------------- 15 files changed, 1 insertion(+), 42 deletions(-) diff --git a/packages/create-snap/package.json b/packages/create-snap/package.json index b1ca5cb5d4..141276ed21 100644 --- a/packages/create-snap/package.json +++ b/packages/create-snap/package.json @@ -64,7 +64,6 @@ "@swc/jest": "^0.2.26", "@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", @@ -83,7 +82,6 @@ "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", "typescript": "~5.3.3" diff --git a/packages/snaps-browserify-plugin/package.json b/packages/snaps-browserify-plugin/package.json index 51381a45b9..90e648c3cc 100644 --- a/packages/snaps-browserify-plugin/package.json +++ b/packages/snaps-browserify-plugin/package.json @@ -79,7 +79,6 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/snaps-cli/package.json b/packages/snaps-cli/package.json index 64bf3178b4..e50d46acea 100644 --- a/packages/snaps-cli/package.json +++ b/packages/snaps-cli/package.json @@ -113,7 +113,6 @@ "@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", @@ -135,7 +134,6 @@ "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", "typescript": "~5.3.3" diff --git a/packages/snaps-controllers/package.json b/packages/snaps-controllers/package.json index 18e6c33ad6..9128c45d0c 100644 --- a/packages/snaps-controllers/package.json +++ b/packages/snaps-controllers/package.json @@ -140,7 +140,6 @@ "mkdirp": "^1.0.4", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "ts-node": "^10.9.1", "typescript": "~5.3.3", "vite": "^4.3.9", diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index 6c21041468..de1a3a494d 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -119,7 +119,6 @@ "lavamoat-browserify": "^17.0.5", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "serve-handler": "^6.1.5", "ses": "^1.1.0", "terser": "^5.17.7", diff --git a/packages/snaps-jest/package.json b/packages/snaps-jest/package.json index 1453a91e58..08d95cb21a 100644 --- a/packages/snaps-jest/package.json +++ b/packages/snaps-jest/package.json @@ -94,7 +94,6 @@ "jest-it-up": "^2.0.0", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/snaps-rollup-plugin/package.json b/packages/snaps-rollup-plugin/package.json index f83be7c441..2de0ce7f35 100644 --- a/packages/snaps-rollup-plugin/package.json +++ b/packages/snaps-rollup-plugin/package.json @@ -75,7 +75,6 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "rollup": "^2.73.0", "typescript": "~5.3.3" }, diff --git a/packages/snaps-rpc-methods/package.json b/packages/snaps-rpc-methods/package.json index a657c27a3d..6da3e8a079 100644 --- a/packages/snaps-rpc-methods/package.json +++ b/packages/snaps-rpc-methods/package.json @@ -78,7 +78,6 @@ "jest-it-up": "^2.0.0", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "typescript": "~5.3.3" }, "engines": { diff --git a/packages/snaps-sdk/package.json b/packages/snaps-sdk/package.json index 5fe942c0d0..f5dc2e5075 100644 --- a/packages/snaps-sdk/package.json +++ b/packages/snaps-sdk/package.json @@ -90,7 +90,6 @@ "@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", "@types/jest": "^27.5.1", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", @@ -110,7 +109,6 @@ "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", "typescript": "~5.3.3" }, 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 0bd6fa7b53..21f93b515a 100644 --- a/packages/snaps-simulator/package.json +++ b/packages/snaps-simulator/package.json @@ -117,7 +117,6 @@ "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", diff --git a/packages/snaps-utils/package.json b/packages/snaps-utils/package.json index e5e3864fd1..0991c73e61 100644 --- a/packages/snaps-utils/package.json +++ b/packages/snaps-utils/package.json @@ -132,7 +132,6 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "ts-node": "^10.9.1", "typescript": "~5.3.3", "vite": "^4.3.9", diff --git a/packages/snaps-webpack-plugin/package.json b/packages/snaps-webpack-plugin/package.json index 4fd0069944..a2b9de064f 100644 --- a/packages/snaps-webpack-plugin/package.json +++ b/packages/snaps-webpack-plugin/package.json @@ -78,7 +78,6 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", - "rimraf": "^4.1.2", "typescript": "~5.3.3", "webpack": "^5.88.0" }, 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/yarn.lock b/yarn.lock index 7b5aa58fbd..1449f5c092 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4048,7 +4048,6 @@ __metadata: "@swc/jest": "npm:^0.2.26" "@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" @@ -4067,7 +4066,6 @@ __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" @@ -5282,7 +5280,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" typescript: "npm:~5.3.3" languageName: unknown linkType: soft @@ -5315,7 +5312,6 @@ __metadata: "@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" @@ -5356,7 +5352,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" @@ -5456,7 +5451,6 @@ __metadata: prettier-plugin-packagejson: "npm:^2.2.11" readable-stream: "npm:^3.6.2" readable-web-to-node-stream: "npm:^3.0.2" - rimraf: "npm:^4.1.2" tar-stream: "npm:^3.1.7" ts-node: "npm:^10.9.1" typescript: "npm:~5.3.3" @@ -5539,7 +5533,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" serve-handler: "npm:^6.1.5" ses: "npm:^1.1.0" terser: "npm:^5.17.7" @@ -5610,7 +5603,6 @@ __metadata: readable-stream: "npm:^3.6.2" redux: "npm:^4.2.1" redux-saga: "npm:^1.2.3" - rimraf: "npm:^4.1.2" typescript: "npm:~5.3.3" languageName: unknown linkType: soft @@ -5659,7 +5651,6 @@ __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" typescript: "npm:~5.3.3" languageName: unknown @@ -5703,7 +5694,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" typescript: "npm:~5.3.3" languageName: unknown linkType: soft @@ -5723,7 +5713,6 @@ __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" "@types/jest": "npm:^27.5.1" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" @@ -5743,7 +5732,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" ts-jest: "npm:^29.1.1" typescript: "npm:~5.3.3" languageName: unknown @@ -5844,7 +5832,6 @@ __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" @@ -5927,7 +5914,6 @@ __metadata: prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" rfdc: "npm:^1.3.0" - rimraf: "npm:^4.1.2" semver: "npm:^7.5.4" ses: "npm:^1.1.0" ts-node: "npm:^10.9.1" @@ -5975,7 +5961,6 @@ __metadata: memfs: "npm:^3.4.13" prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" - rimraf: "npm:^4.1.2" typescript: "npm:~5.3.3" webpack: "npm:^5.88.0" webpack-sources: "npm:^3.2.3" @@ -6068,7 +6053,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" @@ -7723,16 +7707,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" From 60a5b885023b17546ab0e32c64c9c8b98980abbc Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 2 Sep 2024 11:21:28 +0200 Subject: [PATCH 04/19] Add rimraf to stuff that uses it --- packages/snaps-controllers/package.json | 1 + packages/snaps-execution-environments/package.json | 1 + packages/snaps-utils/package.json | 1 + yarn.lock | 3 +++ 4 files changed, 6 insertions(+) diff --git a/packages/snaps-controllers/package.json b/packages/snaps-controllers/package.json index 9128c45d0c..18e6c33ad6 100644 --- a/packages/snaps-controllers/package.json +++ b/packages/snaps-controllers/package.json @@ -140,6 +140,7 @@ "mkdirp": "^1.0.4", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", + "rimraf": "^4.1.2", "ts-node": "^10.9.1", "typescript": "~5.3.3", "vite": "^4.3.9", diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index de1a3a494d..6c21041468 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -119,6 +119,7 @@ "lavamoat-browserify": "^17.0.5", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", + "rimraf": "^4.1.2", "serve-handler": "^6.1.5", "ses": "^1.1.0", "terser": "^5.17.7", diff --git a/packages/snaps-utils/package.json b/packages/snaps-utils/package.json index 0991c73e61..e5e3864fd1 100644 --- a/packages/snaps-utils/package.json +++ b/packages/snaps-utils/package.json @@ -132,6 +132,7 @@ "memfs": "^3.4.13", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.2.11", + "rimraf": "^4.1.2", "ts-node": "^10.9.1", "typescript": "~5.3.3", "vite": "^4.3.9", diff --git a/yarn.lock b/yarn.lock index 1449f5c092..aa904c9f37 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5451,6 +5451,7 @@ __metadata: prettier-plugin-packagejson: "npm:^2.2.11" readable-stream: "npm:^3.6.2" readable-web-to-node-stream: "npm:^3.0.2" + rimraf: "npm:^4.1.2" tar-stream: "npm:^3.1.7" ts-node: "npm:^10.9.1" typescript: "npm:~5.3.3" @@ -5533,6 +5534,7 @@ __metadata: prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" readable-stream: "npm:^3.6.2" + rimraf: "npm:^4.1.2" serve-handler: "npm:^6.1.5" ses: "npm:^1.1.0" terser: "npm:^5.17.7" @@ -5914,6 +5916,7 @@ __metadata: prettier: "npm:^2.7.1" prettier-plugin-packagejson: "npm:^2.2.11" rfdc: "npm:^1.3.0" + rimraf: "npm:^4.1.2" semver: "npm:^7.5.4" ses: "npm:^1.1.0" ts-node: "npm:^10.9.1" From 84d4d104eb37d94f3110aed5a32211d9a498f041 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 2 Sep 2024 11:48:17 +0200 Subject: [PATCH 05/19] Fix more issues --- packages/create-snap/package.json | 1 + packages/examples/package.json | 1 + packages/snaps-browserify-plugin/package.json | 1 + packages/snaps-cli/package.json | 1 + packages/snaps-controllers/package.json | 1 + packages/snaps-execution-environments/package.json | 1 + packages/snaps-jest/package.json | 1 + packages/snaps-rollup-plugin/package.json | 1 + packages/snaps-rpc-methods/package.json | 1 + packages/snaps-sdk/package.json | 1 + packages/snaps-simulator/package.json | 1 + packages/snaps-utils/package.json | 1 + packages/snaps-utils/src/eval.ts | 2 +- packages/snaps-webpack-plugin/package.json | 1 + yarn.lock | 13 +++++++++++++ 15 files changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/create-snap/package.json b/packages/create-snap/package.json index 141276ed21..acc2425fd6 100644 --- a/packages/create-snap/package.json +++ b/packages/create-snap/package.json @@ -62,6 +62,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/jest": "^27.5.1", "@types/node": "18.14.2", "@types/yargs": "^17.0.24", diff --git a/packages/examples/package.json b/packages/examples/package.json index cfd3b6f9f5..a609aae170 100644 --- a/packages/examples/package.json +++ b/packages/examples/package.json @@ -33,6 +33,7 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", + "@ts-bridge/cli": "^0.4.3", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", "depcheck": "^1.4.7", diff --git a/packages/snaps-browserify-plugin/package.json b/packages/snaps-browserify-plugin/package.json index 90e648c3cc..bf2face25a 100644 --- a/packages/snaps-browserify-plugin/package.json +++ b/packages/snaps-browserify-plugin/package.json @@ -57,6 +57,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/browserify": "^12.0.37", "@types/convert-source-map": "^1.5.2", "@types/jest": "^27.5.1", diff --git a/packages/snaps-cli/package.json b/packages/snaps-cli/package.json index e50d46acea..c50c244e01 100644 --- a/packages/snaps-cli/package.json +++ b/packages/snaps-cli/package.json @@ -110,6 +110,7 @@ "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/browserify": "^12.0.37", "@types/jest": "^27.5.1", "@types/node": "18.14.2", diff --git a/packages/snaps-controllers/package.json b/packages/snaps-controllers/package.json index 18e6c33ad6..91e35b8bc7 100644 --- a/packages/snaps-controllers/package.json +++ b/packages/snaps-controllers/package.json @@ -104,6 +104,7 @@ "@metamask/template-snap": "^0.7.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/chrome": "^0.0.237", "@types/concat-stream": "^2.0.0", "@types/gunzip-maybe": "^1.4.0", diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index 6c21041468..1cbe70e596 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -83,6 +83,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/express": "^4.17.17", "@types/jest": "^27.5.1", "@types/node": "18.14.2", diff --git a/packages/snaps-jest/package.json b/packages/snaps-jest/package.json index 08d95cb21a..b614c02842 100644 --- a/packages/snaps-jest/package.json +++ b/packages/snaps-jest/package.json @@ -75,6 +75,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/jest": "^27.5.1", "@types/mime": "^3.0.0", "@types/semver": "^7.5.0", diff --git a/packages/snaps-rollup-plugin/package.json b/packages/snaps-rollup-plugin/package.json index 2de0ce7f35..703c3015b8 100644 --- a/packages/snaps-rollup-plugin/package.json +++ b/packages/snaps-rollup-plugin/package.json @@ -57,6 +57,7 @@ "@rollup/plugin-virtual": "^2.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/jest": "^27.5.1", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", diff --git a/packages/snaps-rpc-methods/package.json b/packages/snaps-rpc-methods/package.json index 6da3e8a079..cdcb68702a 100644 --- a/packages/snaps-rpc-methods/package.json +++ b/packages/snaps-rpc-methods/package.json @@ -61,6 +61,7 @@ "@metamask/json-rpc-engine": "^9.0.2", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/node": "18.14.2", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", diff --git a/packages/snaps-sdk/package.json b/packages/snaps-sdk/package.json index f5dc2e5075..84ef1709ef 100644 --- a/packages/snaps-sdk/package.json +++ b/packages/snaps-sdk/package.json @@ -90,6 +90,7 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", + "@ts-bridge/cli": "^0.4.3", "@types/jest": "^27.5.1", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", diff --git a/packages/snaps-simulator/package.json b/packages/snaps-simulator/package.json index 21f93b515a..3550467b19 100644 --- a/packages/snaps-simulator/package.json +++ b/packages/snaps-simulator/package.json @@ -75,6 +75,7 @@ "@redux-saga/symbols": "^1.1.3", "@swc/core": "1.3.78", "@testing-library/react": "^14.0.0", + "@ts-bridge/cli": "^0.4.3", "@types/express": "^4.17.17", "@types/he": "^1.2.3", "@types/jest": "^27.5.1", diff --git a/packages/snaps-utils/package.json b/packages/snaps-utils/package.json index e5e3864fd1..1b7df6beed 100644 --- a/packages/snaps-utils/package.json +++ b/packages/snaps-utils/package.json @@ -99,6 +99,7 @@ "@metamask/post-message-stream": "^8.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/jest": "^27.5.1", "@types/mocha": "^10.0.1", "@types/node": "18.14.2", 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-webpack-plugin/package.json b/packages/snaps-webpack-plugin/package.json index a2b9de064f..41014ea99c 100644 --- a/packages/snaps-webpack-plugin/package.json +++ b/packages/snaps-webpack-plugin/package.json @@ -59,6 +59,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", + "@ts-bridge/cli": "^0.4.3", "@types/jest": "^27.5.1", "@types/webpack-sources": "^3.2.0", "@typescript-eslint/eslint-plugin": "^5.42.1", diff --git a/yarn.lock b/yarn.lock index aa904c9f37..23fc7f8036 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4046,6 +4046,7 @@ __metadata: "@metamask/snaps-utils": "workspace:^" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.3" "@types/jest": "npm:^27.5.1" "@types/node": "npm:18.14.2" "@types/yargs": "npm:^17.0.24" @@ -4411,6 +4412,7 @@ __metadata: "@metamask/eslint-config-jest": "npm:^12.1.0" "@metamask/eslint-config-nodejs": "npm:^12.1.0" "@metamask/eslint-config-typescript": "npm:^12.1.0" + "@ts-bridge/cli": "npm:^0.4.3" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" depcheck: "npm:^1.4.7" @@ -5256,6 +5258,7 @@ __metadata: "@metamask/snaps-utils": "workspace:^" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" + "@ts-bridge/cli": "npm:^0.4.3" "@types/browserify": "npm:^12.0.37" "@types/convert-source-map": "npm:^1.5.2" "@types/jest": "npm:^27.5.1" @@ -5309,6 +5312,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.3" "@types/browserify": "npm:^12.0.37" "@types/jest": "npm:^27.5.1" "@types/node": "npm:18.14.2" @@ -5406,6 +5410,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.3" "@types/chrome": "npm:^0.0.237" "@types/concat-stream": "npm:^2.0.0" "@types/gunzip-maybe": "npm:^1.4.0" @@ -5496,6 +5501,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.3" "@types/express": "npm:^4.17.17" "@types/jest": "npm:^27.5.1" "@types/node": "npm:18.14.2" @@ -5579,6 +5585,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.3" "@types/jest": "npm:^27.5.1" "@types/mime": "npm:^3.0.0" "@types/semver": "npm:^7.5.0" @@ -5635,6 +5642,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.3" "@types/jest": "npm:^27.5.1" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" @@ -5679,6 +5687,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.3" "@types/node": "npm:18.14.2" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" @@ -5715,6 +5724,7 @@ __metadata: "@metamask/rpc-errors": "npm:^6.3.1" "@metamask/superstruct": "npm:^3.1.0" "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.4.3" "@types/jest": "npm:^27.5.1" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" @@ -5775,6 +5785,7 @@ __metadata: "@reduxjs/toolkit": "npm:^1.9.5" "@swc/core": "npm:1.3.78" "@testing-library/react": "npm:^14.0.0" + "@ts-bridge/cli": "npm:^0.4.3" "@types/express": "npm:^4.17.17" "@types/he": "npm:^1.2.3" "@types/jest": "npm:^27.5.1" @@ -5876,6 +5887,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.3" "@types/jest": "npm:^27.5.1" "@types/mocha": "npm:^10.0.1" "@types/node": "npm:18.14.2" @@ -5945,6 +5957,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.3" "@types/jest": "npm:^27.5.1" "@types/webpack-sources": "npm:^3.2.0" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" From 8de3ba7d348f847a3f90f0652f0c9ab40bbaf64a Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 2 Sep 2024 11:59:42 +0200 Subject: [PATCH 06/19] Update scripts --- package.json | 4 ++-- packages/snaps-simulator/package.json | 1 - tsconfig.build.json | 1 - tsconfig.json | 1 - yarn.lock | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e48c70953c..41298d4723 100644 --- a/package.json +++ b/package.json @@ -19,8 +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": "ts-bridge --project tsconfig.build.json --verbose", - "build:ci": "yarn build --clean", + "build": "ts-bridge --project tsconfig.build.json --verbose && yarn build:examples", + "build:ci": "ts-bridge --project tsconfig.build.json --verbose", "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", diff --git a/packages/snaps-simulator/package.json b/packages/snaps-simulator/package.json index 3550467b19..21f93b515a 100644 --- a/packages/snaps-simulator/package.json +++ b/packages/snaps-simulator/package.json @@ -75,7 +75,6 @@ "@redux-saga/symbols": "^1.1.3", "@swc/core": "1.3.78", "@testing-library/react": "^14.0.0", - "@ts-bridge/cli": "^0.4.3", "@types/express": "^4.17.17", "@types/he": "^1.2.3", "@types/jest": "^27.5.1", 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 7842684d4f..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" } ], diff --git a/yarn.lock b/yarn.lock index 23fc7f8036..787bd2dacd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5785,7 +5785,6 @@ __metadata: "@reduxjs/toolkit": "npm:^1.9.5" "@swc/core": "npm:1.3.78" "@testing-library/react": "npm:^14.0.0" - "@ts-bridge/cli": "npm:^0.4.3" "@types/express": "npm:^4.17.17" "@types/he": "npm:^1.2.3" "@types/jest": "npm:^27.5.1" From 18f3c72f737b36c67dbeafc2d9819b41a6e584b0 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 2 Sep 2024 12:14:11 +0200 Subject: [PATCH 07/19] Rename eval-worker test file --- packages/snaps-utils/src/{eval-worker.js => eval-worker.cjs} | 0 packages/snaps-utils/tsconfig.build.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/snaps-utils/src/{eval-worker.js => eval-worker.cjs} (100%) diff --git a/packages/snaps-utils/src/eval-worker.js b/packages/snaps-utils/src/eval-worker.cjs similarity index 100% rename from packages/snaps-utils/src/eval-worker.js rename to packages/snaps-utils/src/eval-worker.cjs diff --git a/packages/snaps-utils/tsconfig.build.json b/packages/snaps-utils/tsconfig.build.json index 5e9ad6a8e6..faae0157b7 100644 --- a/packages/snaps-utils/tsconfig.build.json +++ b/packages/snaps-utils/tsconfig.build.json @@ -12,7 +12,7 @@ "./src/**/test-utils", "./src/**/__mocks__", "./src/**/__snapshots__", - "./src/eval-worker.js", + "./src/eval-worker.cjs", "scripts" ], "references": [ From 9ccd7ce05ae09cdce37729414dfbd39db6e9c202 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 2 Sep 2024 12:14:46 +0200 Subject: [PATCH 08/19] Add snaps-simulator to tsconfig ignore list --- scripts/verify-tsconfig.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' })); From 38ddfc135d71f5c45a12de5d58e2fdf34cac3ef2 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 2 Sep 2024 14:07:14 +0200 Subject: [PATCH 09/19] Example Snaps doesn't need @ts-bridge/cli --- packages/examples/package.json | 1 - yarn.lock | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/examples/package.json b/packages/examples/package.json index a609aae170..cfd3b6f9f5 100644 --- a/packages/examples/package.json +++ b/packages/examples/package.json @@ -33,7 +33,6 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", - "@ts-bridge/cli": "^0.4.3", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", "depcheck": "^1.4.7", diff --git a/yarn.lock b/yarn.lock index 787bd2dacd..320021882b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4412,7 +4412,6 @@ __metadata: "@metamask/eslint-config-jest": "npm:^12.1.0" "@metamask/eslint-config-nodejs": "npm:^12.1.0" "@metamask/eslint-config-typescript": "npm:^12.1.0" - "@ts-bridge/cli": "npm:^0.4.3" "@typescript-eslint/eslint-plugin": "npm:^5.42.1" "@typescript-eslint/parser": "npm:^6.21.0" depcheck: "npm:^1.4.7" From 3ae6550a41bfdeb5205db07af1388a376f97ca26 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 2 Sep 2024 14:08:47 +0200 Subject: [PATCH 10/19] Fix lint errors in export files --- packages/snaps-controllers/react-native.d.ts | 4 +++- packages/snaps-sdk/jsx-dev-runtime.d.ts | 2 ++ packages/snaps-sdk/jsx-runtime.d.ts | 2 ++ packages/snaps-sdk/jsx.d.ts | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) 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-sdk/jsx-dev-runtime.d.ts b/packages/snaps-sdk/jsx-dev-runtime.d.ts index fe65566c0e..ae34cba2ae 100644 --- a/packages/snaps-sdk/jsx-dev-runtime.d.ts +++ b/packages/snaps-sdk/jsx-dev-runtime.d.ts @@ -1 +1,3 @@ +/* eslint-disable import/extensions */ + export * from './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 3e1e2c1563..e16a60d095 100644 --- a/packages/snaps-sdk/jsx-runtime.d.ts +++ b/packages/snaps-sdk/jsx-runtime.d.ts @@ -1 +1,3 @@ +/* eslint-disable import/extensions */ + export * from './dist/jsx/jsx-runtime.cjs'; diff --git a/packages/snaps-sdk/jsx.d.ts b/packages/snaps-sdk/jsx.d.ts index c0695d9787..064e9a0b4f 100644 --- a/packages/snaps-sdk/jsx.d.ts +++ b/packages/snaps-sdk/jsx.d.ts @@ -1 +1,3 @@ +/* eslint-disable import/extensions */ + export * from './dist/jsx/index.cjs'; From 84619bc3090df1e80140b1838afe32be6f4801a0 Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Tue, 3 Sep 2024 10:27:33 +0000 Subject: [PATCH 11/19] Update LavaMoat policies --- .../lavamoat/browserify/iframe/policy.json | 30 +++--- .../browserify/node-process/policy.json | 46 ++++----- .../browserify/node-thread/policy.json | 46 ++++----- .../lavamoat/browserify/webview/policy.json | 30 +++--- .../browserify/worker-executor/policy.json | 30 +++--- .../browserify/worker-pool/policy.json | 30 +++--- .../lavamoat/build-system/policy.json | 96 +++++++++---------- 7 files changed, 154 insertions(+), 154 deletions(-) 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, From 891def6df17eff3211d67ffd2df5ddf59e4f3e7a Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 9 Sep 2024 10:08:58 +0200 Subject: [PATCH 12/19] Bump to `@ts-bridge/cli@^0.4.4` --- package.json | 2 +- packages/create-snap/package.json | 2 +- packages/snaps-browserify-plugin/package.json | 2 +- packages/snaps-cli/package.json | 4 +- packages/snaps-controllers/package.json | 2 +- .../snaps-execution-environments/package.json | 2 +- packages/snaps-jest/package.json | 2 +- packages/snaps-jest/src/types/index.ts | 1 + packages/snaps-jest/src/{ => types}/types.ts | 2 +- packages/snaps-rollup-plugin/package.json | 2 +- packages/snaps-rpc-methods/package.json | 2 +- packages/snaps-sdk/package.json | 2 +- packages/snaps-utils/package.json | 2 +- packages/snaps-webpack-plugin/package.json | 2 +- yarn.lock | 42 +++++++++---------- 15 files changed, 36 insertions(+), 35 deletions(-) create mode 100644 packages/snaps-jest/src/types/index.ts rename packages/snaps-jest/src/{ => types}/types.ts (99%) diff --git a/package.json b/package.json index 41298d4723..0b2643702d 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@metamask/utils": "^9.2.1", "@swc/core": "1.3.78", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/node": "18.14.2", "@typescript-eslint/eslint-plugin": "^5.42.1", diff --git a/packages/create-snap/package.json b/packages/create-snap/package.json index acc2425fd6..1098c7bfd2 100644 --- a/packages/create-snap/package.json +++ b/packages/create-snap/package.json @@ -62,7 +62,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/node": "18.14.2", "@types/yargs": "^17.0.24", diff --git a/packages/snaps-browserify-plugin/package.json b/packages/snaps-browserify-plugin/package.json index bf2face25a..085e40784c 100644 --- a/packages/snaps-browserify-plugin/package.json +++ b/packages/snaps-browserify-plugin/package.json @@ -57,7 +57,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/browserify": "^12.0.37", "@types/convert-source-map": "^1.5.2", "@types/jest": "^27.5.1", diff --git a/packages/snaps-cli/package.json b/packages/snaps-cli/package.json index c50c244e01..6965609829 100644 --- a/packages/snaps-cli/package.json +++ b/packages/snaps-cli/package.json @@ -33,7 +33,7 @@ ".browserslistrc" ], "scripts": { - "build": "ts-bridge --project tsconfig.build.json --verbose --no-references && yarn build:types && yarn build:chmod && yarn build:readme", + "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'", @@ -110,7 +110,7 @@ "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/browserify": "^12.0.37", "@types/jest": "^27.5.1", "@types/node": "18.14.2", diff --git a/packages/snaps-controllers/package.json b/packages/snaps-controllers/package.json index 91e35b8bc7..2c16893bd2 100644 --- a/packages/snaps-controllers/package.json +++ b/packages/snaps-controllers/package.json @@ -104,7 +104,7 @@ "@metamask/template-snap": "^0.7.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/chrome": "^0.0.237", "@types/concat-stream": "^2.0.0", "@types/gunzip-maybe": "^1.4.0", diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index 1cbe70e596..989f33538f 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -83,7 +83,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/express": "^4.17.17", "@types/jest": "^27.5.1", "@types/node": "18.14.2", diff --git a/packages/snaps-jest/package.json b/packages/snaps-jest/package.json index b614c02842..aa23f44598 100644 --- a/packages/snaps-jest/package.json +++ b/packages/snaps-jest/package.json @@ -75,7 +75,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/mime": "^3.0.0", "@types/semver": "^7.5.0", 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-rollup-plugin/package.json b/packages/snaps-rollup-plugin/package.json index 703c3015b8..759dcc868c 100644 --- a/packages/snaps-rollup-plugin/package.json +++ b/packages/snaps-rollup-plugin/package.json @@ -57,7 +57,7 @@ "@rollup/plugin-virtual": "^2.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", diff --git a/packages/snaps-rpc-methods/package.json b/packages/snaps-rpc-methods/package.json index cdcb68702a..996e000def 100644 --- a/packages/snaps-rpc-methods/package.json +++ b/packages/snaps-rpc-methods/package.json @@ -61,7 +61,7 @@ "@metamask/json-rpc-engine": "^9.0.2", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/node": "18.14.2", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", diff --git a/packages/snaps-sdk/package.json b/packages/snaps-sdk/package.json index 84ef1709ef..6a72bbe2c1 100644 --- a/packages/snaps-sdk/package.json +++ b/packages/snaps-sdk/package.json @@ -90,7 +90,7 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^6.21.0", diff --git a/packages/snaps-utils/package.json b/packages/snaps-utils/package.json index 1b7df6beed..0b0c8d201c 100644 --- a/packages/snaps-utils/package.json +++ b/packages/snaps-utils/package.json @@ -99,7 +99,7 @@ "@metamask/post-message-stream": "^8.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/mocha": "^10.0.1", "@types/node": "18.14.2", diff --git a/packages/snaps-webpack-plugin/package.json b/packages/snaps-webpack-plugin/package.json index 41014ea99c..ed31398377 100644 --- a/packages/snaps-webpack-plugin/package.json +++ b/packages/snaps-webpack-plugin/package.json @@ -59,7 +59,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", - "@ts-bridge/cli": "^0.4.3", + "@ts-bridge/cli": "^0.4.4", "@types/jest": "^27.5.1", "@types/webpack-sources": "^3.2.0", "@typescript-eslint/eslint-plugin": "^5.42.1", diff --git a/yarn.lock b/yarn.lock index 320021882b..e8007a1cd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4046,7 +4046,7 @@ __metadata: "@metamask/snaps-utils": "workspace:^" "@swc/core": "npm:1.3.78" "@swc/jest": "npm:^0.2.26" - "@ts-bridge/cli": "npm:^0.4.3" + "@ts-bridge/cli": "npm:^0.4.4" "@types/jest": "npm:^27.5.1" "@types/node": "npm:18.14.2" "@types/yargs": "npm:^17.0.24" @@ -5257,7 +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.3" + "@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" @@ -5311,7 +5311,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.3" + "@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" @@ -5409,7 +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.3" + "@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" @@ -5500,7 +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.3" + "@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" @@ -5584,7 +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.3" + "@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" @@ -5641,7 +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.3" + "@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" @@ -5686,7 +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.3" + "@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" @@ -5723,7 +5723,7 @@ __metadata: "@metamask/rpc-errors": "npm:^6.3.1" "@metamask/superstruct": "npm:^3.1.0" "@metamask/utils": "npm:^9.2.1" - "@ts-bridge/cli": "npm:^0.4.3" + "@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" @@ -5885,7 +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.3" + "@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" @@ -5955,7 +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.3" + "@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" @@ -7090,11 +7090,11 @@ __metadata: languageName: node linkType: hard -"@ts-bridge/cli@npm:^0.4.3": - version: 0.4.3 - resolution: "@ts-bridge/cli@npm:0.4.3" +"@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.1" + "@ts-bridge/resolver": "npm:^0.1.2" chalk: "npm:^5.3.0" cjs-module-lexer: "npm:^1.3.1" yargs: "npm:^17.7.2" @@ -7103,14 +7103,14 @@ __metadata: bin: ts-bridge: ./dist/index.js tsbridge: ./dist/index.js - checksum: 10/068bbb4b96f8b46276a07d79ac22542b98174648987cafd91c09d3e1ab7ededaba07d1169bb344a34a1a6f516ba1e6849552fe549fdf915df263dd0dfe24ed3e + checksum: 10/a904945e6d65cc75fadacdabbb7e92ecbb8f8c916f88e7887f0e9f340f36dadd1033d89867b0b4500983de43a15b09f118225a6542bbde2c4c77da43f07e9ba4 languageName: node linkType: hard -"@ts-bridge/resolver@npm:^0.1.1": - version: 0.1.1 - resolution: "@ts-bridge/resolver@npm:0.1.1" - checksum: 10/2f16a392c18c85ee0945e06a6e8d8a5ee8e576863b3c44ea0b95c7fc789cc0dbff035b6522a9e67fa44bf54708fae94b3d465aee70ddf49a06d33a6931b92b7d +"@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 @@ -19885,7 +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.3" + "@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" From b2e8db10b814d087af2af189857cbc21c3c59acd Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Mon, 9 Sep 2024 10:02:59 +0000 Subject: [PATCH 13/19] Update example snaps --- packages/examples/packages/bip32/snap.manifest.json | 2 +- packages/examples/packages/bip44/snap.manifest.json | 2 +- packages/examples/packages/browserify-plugin/snap.manifest.json | 2 +- packages/examples/packages/browserify/snap.manifest.json | 2 +- packages/examples/packages/client-status/snap.manifest.json | 2 +- packages/examples/packages/cronjobs/snap.manifest.json | 2 +- packages/examples/packages/dialogs/snap.manifest.json | 2 +- packages/examples/packages/ethereum-provider/snap.manifest.json | 2 +- packages/examples/packages/ethers-js/snap.manifest.json | 2 +- packages/examples/packages/file-upload/snap.manifest.json | 2 +- packages/examples/packages/get-entropy/snap.manifest.json | 2 +- packages/examples/packages/get-file/snap.manifest.json | 2 +- packages/examples/packages/home-page/snap.manifest.json | 2 +- packages/examples/packages/images/snap.manifest.json | 2 +- packages/examples/packages/interactive-ui/snap.manifest.json | 2 +- .../invoke-snap/packages/consumer-signer/snap.manifest.json | 2 +- .../invoke-snap/packages/core-signer/snap.manifest.json | 2 +- packages/examples/packages/json-rpc/snap.manifest.json | 2 +- packages/examples/packages/jsx/snap.manifest.json | 2 +- packages/examples/packages/lifecycle-hooks/snap.manifest.json | 2 +- packages/examples/packages/localization/snap.manifest.json | 2 +- packages/examples/packages/manage-state/snap.manifest.json | 2 +- packages/examples/packages/network-access/snap.manifest.json | 2 +- packages/examples/packages/notifications/snap.manifest.json | 2 +- packages/examples/packages/rollup-plugin/snap.manifest.json | 2 +- .../examples/packages/signature-insights/snap.manifest.json | 2 +- .../examples/packages/transaction-insights/snap.manifest.json | 2 +- packages/examples/packages/wasm/snap.manifest.json | 2 +- packages/examples/packages/webpack-plugin/snap.manifest.json | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) 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/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", From 80fc48fee4d28f86fb721d6f38a4a393e56ec396 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 9 Sep 2024 12:26:43 +0200 Subject: [PATCH 14/19] Update project references of snaps-jest --- packages/snaps-jest/tsconfig.build.json | 10 ++++++++-- packages/snaps-jest/tsconfig.json | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/snaps-jest/tsconfig.build.json b/packages/snaps-jest/tsconfig.build.json index a697341e23..e19a4c36e4 100644 --- a/packages/snaps-jest/tsconfig.build.json +++ b/packages/snaps-jest/tsconfig.build.json @@ -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 403ec7ab09..5816f86b5b 100644 --- a/packages/snaps-jest/tsconfig.json +++ b/packages/snaps-jest/tsconfig.json @@ -6,13 +6,19 @@ "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" } ] } From 5e3acf18c0976bc58c008b0465b8fde99bc1f918 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 9 Sep 2024 13:19:25 +0200 Subject: [PATCH 15/19] Enable Node16 module resolution --- .../examples/packages/browserify-plugin/snap.manifest.json | 2 +- packages/examples/packages/browserify/snap.manifest.json | 2 +- .../images.ts => examples/packages/images/src/images.d.ts} | 7 +------ packages/snaps-cli/tsconfig.build.json | 3 ++- packages/snaps-cli/tsconfig.json | 3 ++- packages/snaps-sdk/src/types/index.ts | 1 - tsconfig.packages.build.json | 3 +-- tsconfig.packages.json | 4 ++-- 8 files changed, 10 insertions(+), 15 deletions(-) rename packages/{snaps-sdk/src/types/images.ts => examples/packages/images/src/images.d.ts} (72%) diff --git a/packages/examples/packages/browserify-plugin/snap.manifest.json b/packages/examples/packages/browserify-plugin/snap.manifest.json index 9298798dfa..25d3866601 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": "86NLlsPJvWJxQuiDRc6479u6RvMaCFIK8GNVpTdcPjI=", + "shasum": "sMwND6AEkeKsDGmco0iXwfoit1cF+5ma0IiPttevwlE=", "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 d2b27042e7..d6d03c249a 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": "BXW4yp9Qs+yCSXZXMJfvEIjY0epnS2yhzcHZ8kAb0B0=", + "shasum": "i4dr8xQTfJM87uTLP9CkRz+ezhPSU1xLl9EeSXuQYuI=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snaps-sdk/src/types/images.ts b/packages/examples/packages/images/src/images.d.ts similarity index 72% rename from packages/snaps-sdk/src/types/images.ts rename to packages/examples/packages/images/src/images.d.ts index c36e8789cd..794066d209 100644 --- a/packages/snaps-sdk/src/types/images.ts +++ b/packages/examples/packages/images/src/images.d.ts @@ -1,15 +1,10 @@ // eslint-disable-next-line import/unambiguous -declare module '*.svg' { - const content: string; - export default content; -} - declare module '*.png' { const content: string; export default content; } -declare module '*.jpg' { +declare module '*.svg' { const content: string; export default content; } diff --git a/packages/snaps-cli/tsconfig.build.json b/packages/snaps-cli/tsconfig.build.json index 5af10b54bc..8b4bb8a851 100644 --- a/packages/snaps-cli/tsconfig.build.json +++ b/packages/snaps-cli/tsconfig.build.json @@ -3,7 +3,8 @@ "compilerOptions": { "baseUrl": "./", "outDir": "./dist", - "rootDir": "./src" + "rootDir": "./src", + "skipLibCheck": true }, "include": ["./src"], "exclude": [ diff --git a/packages/snaps-cli/tsconfig.json b/packages/snaps-cli/tsconfig.json index a2daf1a960..be873d2de1 100644 --- a/packages/snaps-cli/tsconfig.json +++ b/packages/snaps-cli/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig.packages.json", "compilerOptions": { - "baseUrl": "./" + "baseUrl": "./", + "skipLibCheck": true }, "include": ["./src", "./src/**/*.json", "jest.setup.ts", "package.json"], "references": [ diff --git a/packages/snaps-sdk/src/types/index.ts b/packages/snaps-sdk/src/types/index.ts index fafc24fe65..cf517de345 100644 --- a/packages/snaps-sdk/src/types/index.ts +++ b/packages/snaps-sdk/src/types/index.ts @@ -1,7 +1,6 @@ // This is intentionally imported, rather than re-exported. /* eslint-disable import/no-unassigned-import */ import './global'; -import './images'; /* eslint-enable import/no-unassigned-import */ export * from './caip'; 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"], From f51eccd693e9597f86ef402b40b55c906cd3792f Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 9 Sep 2024 14:15:26 +0200 Subject: [PATCH 16/19] Fix issues with declarations and eval worker --- packages/examples/packages/images/tsconfig.json | 4 +++- .../src/images.d.ts => snaps-sdk/src/types/images.ts} | 7 ++++++- packages/snaps-sdk/src/types/index.ts | 1 + packages/snaps-sdk/tsconfig.build.json | 4 +++- packages/snaps-sdk/tsconfig.json | 4 +++- packages/snaps-utils/src/eval-worker.cjs | 2 +- 6 files changed, 17 insertions(+), 5 deletions(-) rename packages/{examples/packages/images/src/images.d.ts => snaps-sdk/src/types/images.ts} (72%) 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/images/src/images.d.ts b/packages/snaps-sdk/src/types/images.ts similarity index 72% rename from packages/examples/packages/images/src/images.d.ts rename to packages/snaps-sdk/src/types/images.ts index 794066d209..c36e8789cd 100644 --- a/packages/examples/packages/images/src/images.d.ts +++ b/packages/snaps-sdk/src/types/images.ts @@ -1,10 +1,15 @@ // eslint-disable-next-line import/unambiguous +declare module '*.svg' { + const content: string; + export default content; +} + declare module '*.png' { const content: string; export default content; } -declare module '*.svg' { +declare module '*.jpg' { const content: string; export default content; } diff --git a/packages/snaps-sdk/src/types/index.ts b/packages/snaps-sdk/src/types/index.ts index cf517de345..fafc24fe65 100644 --- a/packages/snaps-sdk/src/types/index.ts +++ b/packages/snaps-sdk/src/types/index.ts @@ -1,6 +1,7 @@ // This is intentionally imported, rather than re-exported. /* eslint-disable import/no-unassigned-import */ import './global'; +import './images'; /* eslint-enable import/no-unassigned-import */ export * from './caip'; diff --git a/packages/snaps-sdk/tsconfig.build.json b/packages/snaps-sdk/tsconfig.build.json index b5750c2595..3739f54e54 100644 --- a/packages/snaps-sdk/tsconfig.build.json +++ b/packages/snaps-sdk/tsconfig.build.json @@ -3,7 +3,9 @@ "compilerOptions": { "baseUrl": "./", "outDir": "./dist", - "rootDir": "./src" + "rootDir": "./src", + "module": "ES2020", + "moduleResolution": "Node10" }, "include": ["./src"], "exclude": [ diff --git a/packages/snaps-sdk/tsconfig.json b/packages/snaps-sdk/tsconfig.json index 9d7a31d51e..4151f21fe0 100644 --- a/packages/snaps-sdk/tsconfig.json +++ b/packages/snaps-sdk/tsconfig.json @@ -3,7 +3,9 @@ "compilerOptions": { "baseUrl": "./", "jsx": "react-jsx", - "jsxImportSource": "@metamask/snaps-sdk" + "jsxImportSource": "@metamask/snaps-sdk", + "module": "ES2020", + "moduleResolution": "Node10" }, "include": [ "./src", diff --git a/packages/snaps-utils/src/eval-worker.cjs b/packages/snaps-utils/src/eval-worker.cjs index c9beab78ed..e1eb76f5ac 100644 --- a/packages/snaps-utils/src/eval-worker.cjs +++ b/packages/snaps-utils/src/eval-worker.cjs @@ -3,7 +3,7 @@ require('ts-node').register({ transpileOnly: true, compilerOptions: { - module: 'commonjs', + module: 'Node16', } }); From f8953ed75292d6385749a99f8a1a48c2f9c72580 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 9 Sep 2024 15:02:58 +0200 Subject: [PATCH 17/19] Fix another eval issue --- packages/snaps-utils/src/eval-worker.ts | 3 +++ 1 file changed, 3 insertions(+) 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'; From db3b4bd28f1c29260ab503e8d4bd7bc9b745d859 Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Mon, 9 Sep 2024 13:08:30 +0000 Subject: [PATCH 18/19] Update example snaps --- packages/examples/packages/browserify-plugin/snap.manifest.json | 2 +- packages/examples/packages/browserify/snap.manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/examples/packages/browserify-plugin/snap.manifest.json b/packages/examples/packages/browserify-plugin/snap.manifest.json index 25d3866601..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": "sMwND6AEkeKsDGmco0iXwfoit1cF+5ma0IiPttevwlE=", + "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 d6d03c249a..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": "i4dr8xQTfJM87uTLP9CkRz+ezhPSU1xLl9EeSXuQYuI=", + "shasum": "BXW4yp9Qs+yCSXZXMJfvEIjY0epnS2yhzcHZ8kAb0B0=", "location": { "npm": { "filePath": "dist/bundle.js", From a55c72400ccd3c4c47148f54e0b49b45c3b089ed Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Mon, 9 Sep 2024 15:23:10 +0200 Subject: [PATCH 19/19] Remove unnecessary build:ci script --- constraints.pro | 5 ----- package.json | 2 +- packages/create-snap/package.json | 3 +-- packages/snaps-browserify-plugin/package.json | 1 - packages/snaps-cli/package.json | 3 +-- packages/snaps-controllers/package.json | 3 +-- packages/snaps-execution-environments/package.json | 3 +-- packages/snaps-jest/package.json | 3 +-- packages/snaps-rollup-plugin/package.json | 3 +-- packages/snaps-rpc-methods/package.json | 3 +-- packages/snaps-sdk/package.json | 3 +-- packages/snaps-utils/package.json | 3 +-- packages/snaps-webpack-plugin/package.json | 3 +-- 13 files changed, 11 insertions(+), 27 deletions(-) diff --git a/constraints.pro b/constraints.pro index b09f2abf5c..5897e1e77d 100644 --- a/constraints.pro +++ b/constraints.pro @@ -221,11 +221,6 @@ gen_enforced_field(WorkspaceCwd, 'scripts.build:types', null) :- \+ is_example(WorkspaceCwd), \+ workspace_field(WorkspaceCwd, 'private', true), WorkspaceCwd \= '.'. -gen_enforced_field(WorkspaceCwd, 'scripts.build:ci', 'ts-bridge --project tsconfig.build.json --verbose --no-references --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 0b2643702d..44c288cafa 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "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": "ts-bridge --project tsconfig.build.json --verbose && yarn build:examples", - "build:ci": "ts-bridge --project tsconfig.build.json --verbose", + "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", diff --git a/packages/create-snap/package.json b/packages/create-snap/package.json index 1098c7bfd2..6308b5f26e 100644 --- a/packages/create-snap/package.json +++ b/packages/create-snap/package.json @@ -45,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": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/snaps-utils": "workspace:^", diff --git a/packages/snaps-browserify-plugin/package.json b/packages/snaps-browserify-plugin/package.json index 085e40784c..62a14337a4 100644 --- a/packages/snaps-browserify-plugin/package.json +++ b/packages/snaps-browserify-plugin/package.json @@ -38,7 +38,6 @@ "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-browserify-plugin", "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", - "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", "lint:dependencies": "depcheck" diff --git a/packages/snaps-cli/package.json b/packages/snaps-cli/package.json index 6965609829..4125583612 100644 --- a/packages/snaps-cli/package.json +++ b/packages/snaps-cli/package.json @@ -48,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": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@babel/core": "^7.23.2", diff --git a/packages/snaps-controllers/package.json b/packages/snaps-controllers/package.json index 2c16893bd2..5aca31a81a 100644 --- a/packages/snaps-controllers/package.json +++ b/packages/snaps-controllers/package.json @@ -62,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": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/approval-controller": "^7.0.2", diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index 989f33538f..8ed87f7433 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -51,8 +51,7 @@ "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", "start": "node scripts/start.js", - "lint:dependencies": "depcheck", - "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/json-rpc-engine": "^9.0.2", diff --git a/packages/snaps-jest/package.json b/packages/snaps-jest/package.json index aa23f44598..dc3cdb87b6 100644 --- a/packages/snaps-jest/package.json +++ b/packages/snaps-jest/package.json @@ -36,8 +36,7 @@ "lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-jest", "build": "ts-bridge --project tsconfig.build.json --verbose --no-references", "publish:preview": "yarn npm publish --tag preview", - "lint:dependencies": "depcheck", - "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@jest/environment": "^29.5.0", diff --git a/packages/snaps-rollup-plugin/package.json b/packages/snaps-rollup-plugin/package.json index 759dcc868c..1cb3390387 100644 --- a/packages/snaps-rollup-plugin/package.json +++ b/packages/snaps-rollup-plugin/package.json @@ -41,8 +41,7 @@ "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": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/snaps-utils": "workspace:^" diff --git a/packages/snaps-rpc-methods/package.json b/packages/snaps-rpc-methods/package.json index 996e000def..b7ddbb4e4f 100644 --- a/packages/snaps-rpc-methods/package.json +++ b/packages/snaps-rpc-methods/package.json @@ -38,8 +38,7 @@ "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": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/key-tree": "^9.1.2", diff --git a/packages/snaps-sdk/package.json b/packages/snaps-sdk/package.json index 6a72bbe2c1..4fa039b8f6 100644 --- a/packages/snaps-sdk/package.json +++ b/packages/snaps-sdk/package.json @@ -73,8 +73,7 @@ "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": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/key-tree": "^9.1.2", diff --git a/packages/snaps-utils/package.json b/packages/snaps-utils/package.json index 0b0c8d201c..25fbf82b58 100644 --- a/packages/snaps-utils/package.json +++ b/packages/snaps-utils/package.json @@ -59,8 +59,7 @@ "build:clean": "yarn clean && yarn build", "publish:preview": "yarn npm publish --tag preview", "lint:ci": "yarn lint", - "lint:dependencies": "depcheck", - "build:ci": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@babel/core": "^7.23.2", diff --git a/packages/snaps-webpack-plugin/package.json b/packages/snaps-webpack-plugin/package.json index ed31398377..17db6f65ae 100644 --- a/packages/snaps-webpack-plugin/package.json +++ b/packages/snaps-webpack-plugin/package.json @@ -41,8 +41,7 @@ "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": "ts-bridge --project tsconfig.build.json --verbose --no-references --clean" + "lint:dependencies": "depcheck" }, "dependencies": { "@metamask/snaps-sdk": "workspace:^",