Skip to content

Commit

Permalink
Merge branch 'main' into hm/remove-notification-controller
Browse files Browse the repository at this point in the history
  • Loading branch information
hmalik88 committed Nov 29, 2024
2 parents c6a7d83 + e2cdac9 commit 5999dbd
Show file tree
Hide file tree
Showing 288 changed files with 20,868 additions and 5,413 deletions.
17 changes: 15 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
root: true,
extends: ['@metamask/eslint-config', '@metamask/eslint-config-nodejs'],
extends: ['@metamask/eslint-config'],
ignorePatterns: [
'!.eslintrc.js',
'!jest.config.js',
'!.prettierrc.js',
'node_modules',
'**/dist',
'**/docs',
Expand All @@ -12,6 +12,19 @@ module.exports = {
'scripts/create-package/package-template',
],
overrides: [
{
files: [
'**/jest.config.js',
'**/jest.environment.js',
'**/tests/**/*.{ts,js}',
'*.js',
'*.test.{ts,js}',
'scripts/*.ts',
'scripts/create-package/*.ts',
'yarn.config.cjs',
],
extends: ['@metamask/eslint-config-nodejs'],
},
{
files: ['*.test.{ts,js}', '**/tests/**/*.{ts,js}'],
extends: ['@metamask/eslint-config-jest'],
Expand Down
13 changes: 10 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# Note: Please keep this synchronized with the `teams.json` file in the repository root.
# That file is used for some automated workflows, and maps controller to owning team(s).

* @MetaMask/engineering
/.github/ @MetaMask/wallet-framework-engineers

Expand All @@ -26,7 +29,6 @@

## Notifications Team
/packages/notification-services-controller @MetaMask/notifications
/packages/profile-sync-controller @MetaMask/notifications

## Product Safety Team
/packages/phishing-controller @MetaMask/product-safety
Expand Down Expand Up @@ -56,6 +58,7 @@
/packages/permission-controller @MetaMask/wallet-api-platform-engineers @MetaMask/wallet-framework-engineers @MetaMask/snaps-devs
/packages/permission-log-controller @MetaMask/wallet-api-platform-engineers @MetaMask/wallet-framework-engineers
/packages/selected-network-controller @MetaMask/wallet-api-platform-engineers @MetaMask/wallet-framework-engineers @MetaMask/metamask-assets
/packages/profile-sync-controller @MetaMask/notifications @MetaMask/identity

## Package Release related
/packages/accounts-controller/package.json @MetaMask/accounts-engineers @MetaMask/wallet-framework-engineers
Expand All @@ -68,6 +71,8 @@
/packages/approval-controller/CHANGELOG.md @MetaMask/confirmations @MetaMask/wallet-framework-engineers
/packages/assets-controller/package.json @MetaMask/metamask-assets @MetaMask/wallet-framework-engineers
/packages/assets-controller/CHANGELOG.md @MetaMask/metamask-assets @MetaMask/wallet-framework-engineers
/packages/chain-controller/package.json @MetaMask/accounts-engineers @MetaMask/wallet-framework-engineers
/packages/chain-controller/CHANGELOG.md @MetaMask/accounts-engineers @MetaMask/wallet-framework-engineers
/packages/ens-controller/package.json @MetaMask/confirmations @MetaMask/wallet-framework-engineers
/packages/ens-controller/CHANGELOG.md @MetaMask/confirmations @MetaMask/wallet-framework-engineers
/packages/gas-fee-controller/package.json @MetaMask/confirmations @MetaMask/wallet-framework-engineers
Expand All @@ -82,8 +87,10 @@
/packages/name-controller/CHANGELOG.md @MetaMask/confirmations @MetaMask/wallet-framework-engineers
/packages/notification-services-controller/package.json @MetaMask/notifications @MetaMask/wallet-framework-engineers
/packages/notification-services-controller/CHANGELOG.md @MetaMask/notifications @MetaMask/wallet-framework-engineers
/packages/profile-sync-controller/package.json @MetaMask/notifications @MetaMask/wallet-framework-engineers
/packages/profile-sync-controller/CHANGELOG.md @MetaMask/notifications @MetaMask/wallet-framework-engineers
/packages/phishing-controller/package.json @MetaMask/product-safety @MetaMask/wallet-framework-engineers
/packages/phishing-controller/CHANGELOG.md @MetaMask/product-safety @MetaMask/wallet-framework-engineers
/packages/profile-sync-controller/package.json @MetaMask/notifications @MetaMask/identity @MetaMask/wallet-framework-engineers
/packages/profile-sync-controller/CHANGELOG.md @MetaMask/notifications @MetaMask/identity @MetaMask/wallet-framework-engineers
/packages/queued-request-controller/package.json @MetaMask/wallet-api-platform-engineers @MetaMask/wallet-framework-engineers
/packages/queued-request-controller/CHANGELOG.md @MetaMask/wallet-api-platform-engineers @MetaMask/wallet-framework-engineers
/packages/signature-controller/package.json @MetaMask/confirmations @MetaMask/wallet-framework-engineers
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/add-prs-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Add PR to Project Board - Wallet Framework Team'

on:
pull_request:
types: [opened, labeled, review_requested]

jobs:
add-to-project:
name: Add PR to Project Board
runs-on: ubuntu-latest
env:
TEAM_NAME: 'wallet-framework-engineers'
TEAM_LABEL: 'team-wallet-framework'

steps:
- name: Add PR to project board
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e
if: |
github.event.requested_team.name == env.TEAM_NAME ||
contains(github.event.pull_request.labels.*.name, env.TEAM_LABEL) ||
contains(github.event.pull_request.requested_teams.*.name, env.TEAM_NAME)
with:
project-url: https://github.com/orgs/MetaMask/projects/113
github-token: ${{ secrets.CORE_ADD_PRS_TO_PROJECT }}
44 changes: 44 additions & 0 deletions .github/workflows/create-update-issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Create Update Issues

on:
workflow_call:
secrets:
CORE_CREATE_UPDATE_ISSUES_TOKEN:
description: GitHub token with permission to create issues in both mobile and extension repositories
required: true

jobs:
create-update-issues:
environment: default-branch
runs-on: ubuntu-latest
steps:
- name: Checkout head
uses: actions/checkout@v4
with:
fetch-tags: true

- name: Create Issues
env:
GH_TOKEN: ${{ secrets.CORE_CREATE_UPDATE_ISSUES_TOKEN }}
run: |
IFS=$'\n' read -r -d '' -a tag_array < <(git tag --points-at HEAD && printf '\0')
for tag in "${tag_array[@]}"; do
if [[ "${tag}" == @metamask/* ]] ; then
# Extract package name without the leading '@'
package_name="${tag#@}"
package_name="${package_name%@*}"
# Extract version number
version="${tag##*@}"
# Check if version number ends with .0.0
if [[ $version == *.0.0 ]]; then
# Fetch responsible team from file
teams=$(jq -r --arg key "$package_name" '.[$key]' teams.json)
gh issue create --title "Update ${package_name} to version ${version}" --body "Please update ${package_name} to version ${version}" --repo "MetaMask/metamask-extension" --label "$teams"
gh issue create --title "Update ${package_name} to version ${version}" --body "Please update ${package_name} to version ${version}" --repo "MetaMask/metamask-mobile" --label "$teams"
fi
fi
done
shell: bash
10 changes: 9 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- id: is-release
uses: MetaMask/action-is-release@dc4672b05e3b1d464cdaf783579b04a4e43f8b02
with:
commit-starts-with: 'Release [version],Release v[version],Release/[version],Release/v[version]'
commit-starts-with: 'Release [version],Release v[version],Release/[version],Release/v[version],Release `[version]`'

publish-release:
name: Publish release
Expand All @@ -48,6 +48,14 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

create-update-issues:
name: Create update issues
needs: [is-release, publish-release]
if: needs.is-release.outputs.IS_RELEASE == 'true'
uses: ./.github/workflows/create-update-issues.yaml
secrets:
CORE_CREATE_UPDATE_ISSUES_TOKEN: ${{ secrets.CORE_CREATE_UPDATE_ISSUES_TOKEN }}

all-jobs-complete:
name: All jobs complete
runs-on: ubuntu-latest
Expand Down
57 changes: 35 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@

This monorepo is a collection of packages used across multiple MetaMask clients (e.g. [`metamask-extension`](https://github.com/MetaMask/metamask-extension/), [`metamask-mobile`](https://github.com/MetaMask/metamask-mobile/)).

## Modules
## Contributing

This repository contains the following packages [^fn1]:
See the [Contributor Guide](./docs/contributing.md) for help on:

- Setting up your development environment
- Working with the monorepo
- Testing changes in clients
- Issuing new releases
- Creating a new package

## Installation/Usage

Each package in this repository has its own README where you can find installation and usage instructions. See `packages/` for more.

## Packages

<!-- start package list -->

Expand All @@ -26,6 +38,7 @@ This repository contains the following packages [^fn1]:
- [`@metamask/keyring-controller`](packages/keyring-controller)
- [`@metamask/logging-controller`](packages/logging-controller)
- [`@metamask/message-manager`](packages/message-manager)
- [`@metamask/multichain`](packages/multichain)
- [`@metamask/name-controller`](packages/name-controller)
- [`@metamask/network-controller`](packages/network-controller)
- [`@metamask/notification-services-controller`](packages/notification-services-controller)
Expand All @@ -44,8 +57,6 @@ This repository contains the following packages [^fn1]:

<!-- end package list -->

Or, in graph form [^fn1]:

<!-- start dependency graph -->

```mermaid
Expand All @@ -70,6 +81,7 @@ linkStyle default opacity:0.5
keyring_controller(["@metamask/keyring-controller"]);
logging_controller(["@metamask/logging-controller"]);
message_manager(["@metamask/message-manager"]);
multichain(["@metamask/multichain"]);
name_controller(["@metamask/name-controller"]);
network_controller(["@metamask/network-controller"]);
notification_services_controller(["@metamask/notification-services-controller"]);
Expand All @@ -91,14 +103,15 @@ linkStyle default opacity:0.5
address_book_controller --> controller_utils;
announcement_controller --> base_controller;
approval_controller --> base_controller;
assets_controllers --> accounts_controller;
assets_controllers --> approval_controller;
assets_controllers --> base_controller;
assets_controllers --> controller_utils;
assets_controllers --> polling_controller;
assets_controllers --> accounts_controller;
assets_controllers --> approval_controller;
assets_controllers --> keyring_controller;
assets_controllers --> network_controller;
assets_controllers --> polling_controller;
assets_controllers --> preferences_controller;
base_controller --> json_rpc_engine;
chain_controller --> base_controller;
composable_controller --> base_controller;
composable_controller --> json_rpc_engine;
Expand All @@ -108,15 +121,18 @@ linkStyle default opacity:0.5
eth_json_rpc_provider --> json_rpc_engine;
gas_fee_controller --> base_controller;
gas_fee_controller --> controller_utils;
gas_fee_controller --> network_controller;
gas_fee_controller --> polling_controller;
gas_fee_controller --> network_controller;
json_rpc_middleware_stream --> json_rpc_engine;
keyring_controller --> base_controller;
keyring_controller --> message_manager;
logging_controller --> base_controller;
logging_controller --> controller_utils;
message_manager --> base_controller;
message_manager --> controller_utils;
multichain --> controller_utils;
multichain --> network_controller;
multichain --> permission_controller;
name_controller --> base_controller;
name_controller --> controller_utils;
network_controller --> base_controller;
Expand All @@ -142,6 +158,9 @@ linkStyle default opacity:0.5
preferences_controller --> controller_utils;
preferences_controller --> keyring_controller;
profile_sync_controller --> base_controller;
profile_sync_controller --> keyring_controller;
profile_sync_controller --> network_controller;
profile_sync_controller --> accounts_controller;
queued_request_controller --> base_controller;
queued_request_controller --> controller_utils;
queued_request_controller --> json_rpc_engine;
Expand All @@ -152,35 +171,29 @@ linkStyle default opacity:0.5
selected_network_controller --> json_rpc_engine;
selected_network_controller --> network_controller;
selected_network_controller --> permission_controller;
signature_controller --> approval_controller;
signature_controller --> base_controller;
signature_controller --> controller_utils;
signature_controller --> approval_controller;
signature_controller --> keyring_controller;
signature_controller --> logging_controller;
signature_controller --> message_manager;
transaction_controller --> accounts_controller;
transaction_controller --> approval_controller;
signature_controller --> network_controller;
transaction_controller --> base_controller;
transaction_controller --> controller_utils;
transaction_controller --> accounts_controller;
transaction_controller --> approval_controller;
transaction_controller --> eth_json_rpc_provider;
transaction_controller --> gas_fee_controller;
transaction_controller --> network_controller;
transaction_controller --> eth_json_rpc_provider;
user_operation_controller --> approval_controller;
user_operation_controller --> base_controller;
user_operation_controller --> controller_utils;
user_operation_controller --> polling_controller;
user_operation_controller --> approval_controller;
user_operation_controller --> gas_fee_controller;
user_operation_controller --> keyring_controller;
user_operation_controller --> network_controller;
user_operation_controller --> polling_controller;
user_operation_controller --> transaction_controller;
```

<!-- end dependency graph -->

Refer to individual packages for usage instructions.

## Learn more

For instructions on performing common development-related tasks, see [contributing to the monorepo](./docs/contributing.md).

[^fn1]: The package list and dependency graph should be programmatically generated by running `yarn update-readme-content`.
(This section may be regenerated at any time by running `yarn update-readme-content`.)
Loading

0 comments on commit 5999dbd

Please sign in to comment.