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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ignores:
- 'ts-jest'
- 'ts-node'
- 'typedoc'
- 'typescript'
# Ignore plugins for tools
- '@typescript-eslint/*'
- 'eslint-config-*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
rename-after-install-and-build: true
environment: default-branch
docs-url: 'https://github.com/MetaMask/core/blob/main/docs/processes/preview-builds.md'
docs-url: 'https://github.com/MetaMask/internal-snaps/blob/main/docs/processes/preview-builds.md'
secrets:
PUBLISH_PREVIEW_NPM_TOKEN: ${{ secrets.PUBLISH_PREVIEW_NPM_TOKEN }}
BUILD_ENV: |
Expand Down
19 changes: 2 additions & 17 deletions docs/processes/preview-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,10 @@ Generally, when working with preview builds, you will follow this process:
To publish preview builds:

1. Create a pull request with the changes to your package(s).
2. Post a comment on the pull request with the text `@metamaskbot publish-previews`. The `publish-preview` GitHub action will kick off to generate and publish preview builds for all packages in the monorepo.
2. Post a comment on the pull request with the text `@metamaskbot publish-preview`. The `publish-preview` GitHub action will kick off to generate and publish preview builds for all packages in the monorepo.
3. After a few minutes, you will see a new comment that lists the newly published packages along with their versions.

<details><summary><b>Publishing preview builds as an independent contributor</b></summary>
<br/>
Note that the steps above will only work if you are a member of the MetaMask engineering team on GitHub. If you are not, you'll need to follow some different steps:

1. First, you'll need access to an NPM organization under which the preview builds will be published. If you have not already done so, you can either [create a new organization](https://www.npmjs.com/org/create) or [convert your existing username into an organization](https://www.npmjs.com/org/upgrade).
2. Open the `package.json` for each package that you want to publish, and change the NPM scope in the package's name from `@metamask` to reflect your NPM organization.
3. Run the following command to create and publish preview builds for all packages in the monorepo (replacing `NPM_ORG` as appropriate):

```bash
yarn prepare-preview-builds "@<NPM_ORG>" "$(git rev-parse --short HEAD)"
yarn build
yarn publish-previews
```

You will see a list of the newly published packages along with their versions.
</details>
This workflow is available to members of the MetaMask engineering team on GitHub. Independent contributors should use [local builds](./local-builds.md) instead.

## Using preview builds

Expand Down
32 changes: 0 additions & 32 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@
},
"@typescript-eslint/no-unused-vars": {
"count": 6
},
"n/no-unsupported-features/node-builtins": {
"count": 6
}
},
"packages/solana-wallet-snap/src/core/handlers/onKeyringRequest/Keyring.ts": {
Expand Down Expand Up @@ -486,9 +483,6 @@
"packages/solana-wallet-snap/src/core/services/send/SendService.test.ts": {
"@typescript-eslint/no-explicit-any": {
"count": 6
},
"n/no-unsupported-features/node-builtins": {
"count": 1
}
},
"packages/solana-wallet-snap/src/core/services/send/SendSolBuilder.test.ts": {
Expand Down Expand Up @@ -572,9 +566,6 @@
},
"n/no-sync": {
"count": 22
},
"n/no-unsupported-features/node-builtins": {
"count": 4
}
},
"packages/solana-wallet-snap/src/core/services/subscriptions/SubscriptionService.ts": {
Expand Down Expand Up @@ -1377,33 +1368,21 @@
"packages/stellar-wallet-snap/src/handlers/keyring/keyring.test.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 2
},
"n/no-unsupported-features/node-builtins": {
"count": 2
}
},
"packages/stellar-wallet-snap/src/handlers/keyring/signAuthEntry.test.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 1
},
"n/no-unsupported-features/node-builtins": {
"count": 1
}
},
"packages/stellar-wallet-snap/src/handlers/keyring/signMessage.test.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 1
},
"n/no-unsupported-features/node-builtins": {
"count": 1
}
},
"packages/stellar-wallet-snap/src/handlers/keyring/signTransaction.test.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 1
},
"n/no-unsupported-features/node-builtins": {
"count": 1
}
},
"packages/stellar-wallet-snap/src/services/account/AccountService.test.ts": {
Expand Down Expand Up @@ -1494,9 +1473,6 @@
"packages/stellar-wallet-snap/src/services/on-chain-account/OnChainAccountService.test.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 1
},
"n/no-unsupported-features/node-builtins": {
"count": 3
}
},
"packages/stellar-wallet-snap/src/services/on-chain-account/OnChainAccountSynchronizeService.test.ts": {
Expand All @@ -1508,9 +1484,6 @@
},
"jsdoc/require-returns": {
"count": 2
},
"n/no-unsupported-features/node-builtins": {
"count": 1
}
},
"packages/stellar-wallet-snap/src/services/on-chain-account/__mocks__/onChainAccount.fixtures.ts": {
Expand Down Expand Up @@ -1601,11 +1574,6 @@
"count": 5
}
},
"packages/stellar-wallet-snap/src/services/wallet/WalletService.test.ts": {
"n/no-unsupported-features/node-builtins": {
"count": 3
}
},
"packages/stellar-wallet-snap/src/services/wallet/__mocks__/wallet.fixtures.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 2
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import jest from '@metamask/eslint-config-jest';
import nodejs from '@metamask/eslint-config-nodejs';
import typescript from '@metamask/eslint-config-typescript';

const NODE_LTS_VERSION = 22;
const NODE_LTS_VERSION = 24;

/**
* Arguments to the `no-restricted` syntax rule that advises use of
Expand Down
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,33 @@
"name": "@metamask/internal-snaps-monorepo",
"version": "7.0.0",
"private": true,
"description": "Monorepo for firt-party snaps",
"description": "Monorepo for first-party snaps",
"repository": {
"type": "git",
"url": "https://github.com/MetaMask/internal-snaps.git"
},
"workspaces": [
"packages/*"
],
"files": [],
"scripts": {
"build": "yarn workspaces foreach --all --no-private --topological-dev --parallel --interlaced --verbose run build",
"build:clean": "yarn build:only-clean && yarn build",
"build:docs": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run build:docs",
"build:only-clean": "rimraf -g 'packages/*/dist'",
"build:types": "tsc --build tsconfig.build.json --verbose",
"changelog:update": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run changelog:update",
"changelog:validate": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run changelog:validate",
"create-release-branch": "create-release-branch --formatter oxfmt",
"create-package": "tsx scripts/create-package",
"lint": "yarn lint:eslint && echo && yarn lint:misc --check && yarn constraints && yarn lint:dependencies && yarn readme-content:check",
"lint:dependencies": "depcheck && yarn dedupe --check",
"lint:dependencies:fix": "depcheck && yarn dedupe",
"lint:eslint": "yarn build:only-clean && NODE_OPTIONS='--max-old-space-size=6144' yarn eslint",
"lint:eslint": "yarn eslint",
"lint:fix": "yarn lint:eslint --fix --prune-suppressions && echo && yarn lint:misc --write && yarn constraints --fix && yarn lint:dependencies:fix && yarn readme-content:update",
"lint:misc": "oxfmt --ignore-path .gitignore",
"lint:misc:check": "yarn lint:misc --check",
"prepack": "./scripts/prepack.sh",
"prepare-preview-builds": "./scripts/prepare-preview-builds.sh",
"readme-content:check": "tsx scripts/update-readme-content.ts --check",
"readme-content:update": "tsx scripts/update-readme-content.ts",
"setup": "yarn install",
"test": "yarn test:scripts --silent --collectCoverage=false --reporters=jest-silent-reporter && yarn test:packages",
"test:clean": "yarn workspaces foreach --all --parallel --verbose run test:clean && yarn test",
"test:packages": "yarn test:verbose --silent --collectCoverage=false --reporters=jest-silent-reporter",
Expand All @@ -51,7 +47,7 @@
"@metamask/utils": "^11.11.0",
"@types/jest": "^30.0.0",
"@types/lodash": "^4.17.15",
"@types/node": "^16.18.54",
"@types/node": "^24",
"@types/semver": "^7",
"@typescript-eslint/eslint-plugin": "^8.48.0",
"@typescript-eslint/parser": "^8.48.0",
Expand Down Expand Up @@ -101,9 +97,6 @@
"ripemd160@npm:^2.0.1": "2.0.2",
"ws@7.4.6": "^7.5.10"
},
"simple-git-hooks": {
"pre-push": "yarn lint"
},
"engines": {
"node": ">=20"
},
Expand Down
8 changes: 3 additions & 5 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
/**
* This configuration is used by the `build` script in `package.json`.
*
* This is just used as a way to request builds for all packages. `tsconfig.base.json` is not
* extended here because the `tsconfig.build.json` file referenced for each package already
* (indirectly) extends it.
* Solution-style config for library packages that emit types via `ts-bridge`.
* `create-package` adds new library packages to `references`. Snap packages
* do not use this file; they are built with `mm-snap`.
*/
"references": [
{
Expand Down
8 changes: 3 additions & 5 deletions yarn.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,9 @@ module.exports = defineConfig({
expectWorkspaceArrayField(workspace, 'files', 'dist/');
}
} else {
// The root package must specify an empty set of published files. (This
// is required in order to be able to import anything in
// development-only scripts, as otherwise the
// `node/no-unpublished-require` ESLint rule will disallow it.)
expectWorkspaceField(workspace, 'files', []);
// The root package is private and is never published, so `files` is
// unused. Unset it so it cannot be reintroduced.
workspace.unset('files');
}

// If one workspace package lists another workspace package within
Expand Down
27 changes: 18 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,7 @@ __metadata:
"@metamask/utils": "npm:^11.11.0"
"@types/jest": "npm:^30.0.0"
"@types/lodash": "npm:^4.17.15"
"@types/node": "npm:^16.18.54"
"@types/node": "npm:^24"
"@types/semver": "npm:^7"
"@typescript-eslint/eslint-plugin": "npm:^8.48.0"
"@typescript-eslint/parser": "npm:^8.48.0"
Expand Down Expand Up @@ -5559,7 +5559,16 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:*, @types/node@npm:22.7.5":
"@types/node@npm:*, @types/node@npm:^24":
version: 24.13.3
resolution: "@types/node@npm:24.13.3"
dependencies:
undici-types: "npm:~7.18.0"
checksum: 10/cfa6ed1e16c4624d1e83b09aeb72a2f50a7e17d837bf5a1259a52e346f33a693afd289402d3b6118ce3abea7aff35f2a4f13a0284b96bc5807a50f0e22e1ec77
languageName: node
linkType: hard

"@types/node@npm:22.7.5":
version: 22.7.5
resolution: "@types/node@npm:22.7.5"
dependencies:
Expand All @@ -5568,13 +5577,6 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:^16.18.54":
version: 16.18.106
resolution: "@types/node@npm:16.18.106"
checksum: 10/1970719a048bfc56554f8e132e8e5292c197d6e023d334190b0d3817a05a12bfb6537eaa24778ddb695d2073195f0545e5a4b6bcaf81b656994bbca39f349c3b
languageName: node
linkType: hard

"@types/parse-json@npm:^4.0.0":
version: 4.0.2
resolution: "@types/parse-json@npm:4.0.2"
Expand Down Expand Up @@ -15050,6 +15052,13 @@ __metadata:
languageName: node
linkType: hard

"undici-types@npm:~7.18.0":
version: 7.18.2
resolution: "undici-types@npm:7.18.2"
checksum: 10/e61a5918f624d68420c3ca9d301e9f15b61cba6e97be39fe2ce266dd6151e4afe424d679372638826cb506be33952774e0424141200111a9857e464216c009af
languageName: node
linkType: hard

"unicorn-magic@npm:^0.3.0":
version: 0.3.0
resolution: "unicorn-magic@npm:0.3.0"
Expand Down