From 5c3cd4f3026ee992fe993d320032902e583d6ad6 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Sat, 19 Oct 2024 05:30:31 +0000 Subject: [PATCH 1/4] fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-ELLIPTIC-8187303 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fad9fae96418..d52b6679b586 100644 --- a/package.json +++ b/package.json @@ -360,7 +360,7 @@ "@metamask/snaps-sdk": "^6.5.1", "@metamask/snaps-utils": "^8.1.1", "@metamask/transaction-controller": "^37.2.0", - "@metamask/user-operation-controller": "^13.0.0", + "@metamask/user-operation-controller": "^14.0.1", "@metamask/utils": "^9.3.0", "@ngraveio/bc-ur": "^1.1.12", "@noble/hashes": "^1.3.3", From 3d0d75dc4be4752dba6acad912c5324477316eec Mon Sep 17 00:00:00 2001 From: Romel <122599979+Ramyromel@users.noreply.github.com> Date: Sat, 26 Oct 2024 03:50:24 +0300 Subject: [PATCH 2/4] Update documentation with repository structure --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Ramyromel/metamask-extension?shareId=XXXX-XXXX-XXXX-XXXX). --- README.md | 30 +++++++++++++- docs/CONTRIBUTING.md | 26 ++++++++++++ docs/README.md | 13 ++++++ docs/REPOSITORY_STRUCTURE.md | 77 ++++++++++++++++++++++++++++++++++++ 4 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 docs/CONTRIBUTING.md create mode 100644 docs/REPOSITORY_STRUCTURE.md diff --git a/README.md b/README.md index 4f15e138be56..db7e1a2f7f33 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,17 @@ To learn how to contribute to the MetaMask codebase, visit our [Contributor Docs To learn how to contribute to the MetaMask Extension project itself, visit our [Extension Docs](https://github.com/MetaMask/metamask-extension/tree/develop/docs). +## Table of Contents + +- [GitHub Codespaces quickstart](#github-codespaces-quickstart) +- [Building on your local machine](#building-on-your-local-machine) +- [Git Hooks](#git-hooks) +- [Contributing](#contributing) +- [Architecture](#architecture) +- [Other Docs](#other-docs) +- [Dapp Developer Resources](#dapp-developer-resources) +- [Repository Overview](#repository-overview) + ## GitHub Codespaces quickstart As an alternative to building on your local machine, there is a new option to get a development environment up and running in less than 5 minutes by using GitHub Codespaces. Please note that there is a [Limited Free Monthly Quota](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces), and after that GitHub will start charging you. @@ -254,4 +265,21 @@ Whenever you change dependencies (adding, removing, or updating, either in `pack - [Prompt your users to add and switch to a new network.](https://docs.metamask.io/wallet/how-to/add-network/) - [Change the logo that appears when your dapp connects to MetaMask.](https://docs.metamask.io/wallet/how-to/display/icon/) -[1]: http://www.nomnoml.com/#view/%5B%3Cactor%3Euser%5D%0A%0A%5Bmetamask-ui%7C%0A%20%20%20%5Btools%7C%0A%20%20%20%20%20react%0A%20%20%20%20%20redux%0A%20%20%20%20%20thunk%0A%20%20%20%20%20ethUtils%0A%20%20%20%20%20jazzicon%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20account-detail%0A%20%20%20%20%20accounts%0A%20%20%20%20%20locked-screen%0A%20%20%20%20%20restore-vault%0A%20%20%20%20%20identicon%0A%20%20%20%20%20config%0A%20%20%20%20%20info%0A%20%20%20%5D%0A%20%20%20%5Breducers%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20metamask%0A%20%20%20%20%20identities%0A%20%20%20%5D%0A%20%20%20%5Bactions%7C%0A%20%20%20%20%20%5BbackgroundConnection%5D%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%5D%3A-%3E%5Bactions%5D%0A%20%20%20%5Bactions%5D%3A-%3E%5Breducers%5D%0A%20%20%20%5Breducers%5D%3A-%3E%5Bcomponents%5D%0A%5D%0A%0A%5Bweb%20dapp%7C%0A%20%20%5Bui%20code%5D%0A%20%20%5Bweb3%5D%0A%20%20%5Bmetamask-inpage%5D%0A%20%20%0A%20%20%5B%3Cactor%3Eui%20developer%5D%0A%20%20%5Bui%20developer%5D-%3E%5Bui%20code%5D%0A%20%20%5Bui%20code%5D%3C-%3E%5Bweb3%5D%0A%20%20%5Bweb3%5D%3C-%3E%5Bmetamask-inpage%5D%0A%5D%0A%0A%5Bmetamask-background%7C%0A%20%20%5Bprovider-engine%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bid%20store%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%3E%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%3C-%3E%5Bid%20store%5D%0A%20%20%5Bconfig%20manager%7C%0A%20%20%20%20%5Brpc%20configuration%5D%0A%20%20%20%20%5Bencrypted%20keys%5D%0A%20%20%20%20%5Bwallet%20nicknames%5D%0A%20%20%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%5Bconfig%20manager%5D%0A%20%20%5Bid%20store%5D%3C-%3E%5Bconfig%20manager%5D%0A%5D%0A%0A%5Buser%5D%3C-%3E%5Bmetamask-ui%5D%0A%0A%5Buser%5D%3C%3A--%3A%3E%5Bweb%20dapp%5D%0A%0A%5Bmetamask-contentscript%7C%0A%20%20%5Bplugin%20restart%20detector%5D%0A%20%20%5Brpc%20passthrough%5D%0A%5D%0A%0A%5Brpc%20%7C%0A%20%20%5Bethereum%20blockchain%20%7C%0A%20%20%20%20%5Bcontracts%5D%0A%20%20%20%20%5Baccounts%5D%0A%20%20%5D%0A%5D%0A%0A%5Bweb%20dapp%5D%3C%3A--%3A%3E%5Bmetamask-contentscript%5D%0A%5Bmetamask-contentscript%5D%3C-%3E%5Bmetamask-background%5D%0A%5Bmetamask-background%5D%3C-%3E%5Bmetamask-ui%5D%0A%5Bmetamask-background%5D%3C-%3E%5Brpc%5D%0A +## Repository Overview + +The MetaMask Browser Extension repository is organized with the following directories and configuration files: + +- Configuration files: + - `.browserslistrc` + - `.circleci/config.yml` + - `.eslintrc.js` + - `.prettierrc.yml` +- Directories: + - `.circleci`: Includes scripts and configuration files for continuous integration and deployment. + - `.devcontainer`: Contains configuration files for development containers, including `devcontainer.json` and various setup scripts. + - `.github`: Contains GitHub-specific files like issue templates, pull request templates, and GitHub Actions workflows. + - `app`: Holds the main source code for the MetaMask extension, including localization files, images, scripts, and HTML files. + - `docs`: Contains documentation related to the project. + - `shared`: Includes shared constants, modules, and utilities. + - `test`: Has test data, helpers, and end-to-end tests. + - `ui`: Contains React components, hooks, contexts, and styles used in the MetaMask extension's user interface. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 000000000000..0ce4f77aef77 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to MetaMask + +Thank you for your interest in contributing to the MetaMask Browser Extension! This document provides guidelines and instructions to help you navigate the repository and contribute effectively. + +## How to Navigate the Repository + +The MetaMask Browser Extension repository is organized into several directories, each serving a specific purpose. Here is a brief description of each directory: + +- `.circleci`: Contains scripts and configuration files for continuous integration and deployment using CircleCI. +- `.devcontainer`: Contains configuration files for development containers, including `devcontainer.json` and various setup scripts. +- `.github`: Contains GitHub-specific files, such as issue templates, pull request templates, and GitHub Actions workflows. +- `app`: Contains the main source code for the MetaMask extension, including localization files, images, scripts, and HTML files. +- `docs`: Contains documentation related to the project, such as publishing guides, QA guides, and design system information. +- `shared`: Contains shared constants, modules, and utilities used across the project. +- `test`: Contains test data, helpers, and end-to-end tests for the project. +- `ui`: Contains the React components, hooks, contexts, and styles used in the MetaMask extension's user interface. + +## Relevant Documentation + +Here are some links to relevant documentation files that will help you get started: + +- [How to add custom build to Chrome](./add-to-chrome.md) +- [How to add custom build to Firefox](./add-to-firefox.md) +- [Publishing Guide](./publishing.md) +- [How to add a feature behind a secret feature flag](./secret-preferences.md) +- [Developing on MetaMask](../development/README.md) diff --git a/docs/README.md b/docs/README.md index 80f5901b57ba..f955ef337e9b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,6 +10,19 @@ For up to the minute news, follow our [Twitter](https://twitter.com/metamask_io) To learn how to develop MetaMask-compatible applications, visit our [Developer Docs](https://metamask.github.io/metamask-docs/). +## Repository Structure + +The MetaMask Browser Extension repository is organized into several directories, each serving a specific purpose. Here is a brief description of each directory: + +- `.circleci`: Contains scripts and configuration files for continuous integration and deployment using CircleCI. +- `.devcontainer`: Contains configuration files for development containers, including `devcontainer.json` and various setup scripts. +- `.github`: Contains GitHub-specific files, such as issue templates, pull request templates, and GitHub Actions workflows. +- `app`: Contains the main source code for the MetaMask extension, including localization files, images, scripts, and HTML files. +- `docs`: Contains documentation related to the project, such as publishing guides, QA guides, and design system information. +- `shared`: Contains shared constants, modules, and utilities used across the project. +- `test`: Contains test data, helpers, and end-to-end tests for the project. +- `ui`: Contains the React components, hooks, contexts, and styles used in the MetaMask extension's user interface. + - [How to add custom build to Chrome](./add-to-chrome.md) - [How to add custom build to Firefox](./add-to-firefox.md) - [Publishing Guide](./publishing.md) diff --git a/docs/REPOSITORY_STRUCTURE.md b/docs/REPOSITORY_STRUCTURE.md new file mode 100644 index 000000000000..d05a153b0690 --- /dev/null +++ b/docs/REPOSITORY_STRUCTURE.md @@ -0,0 +1,77 @@ +# MetaMask Browser Extension Repository Structure + +The MetaMask Browser Extension repository is organized into several directories, each serving a specific purpose. Below is a detailed description of each directory and its purpose, along with examples of important files and their roles. + +## Directories + +### `.circleci` +Contains scripts and configuration files for continuous integration and deployment using CircleCI. + +**Examples of important files:** +- `config.yml`: Main configuration file for CircleCI. + +### `.devcontainer` +Contains configuration files for development containers, including `devcontainer.json` and various setup scripts. + +**Examples of important files:** +- `devcontainer.json`: Configuration file for the development container. + +### `.github` +Contains GitHub-specific files, such as issue templates, pull request templates, and GitHub Actions workflows. + +**Examples of important files:** +- `CODEOWNERS`: Defines the code owners for the repository. +- `CONTRIBUTING.md`: Guidelines for contributing to the project. +- `pull-request-template.md`: Template for pull requests. + +### `app` +Holds the main source code for the MetaMask extension, including localization files, images, scripts, and HTML files. + +**Examples of important files:** +- `background.html`: Background page for the extension. +- `home.html`: Home page for the extension. +- `scripts/background.js`: Background script for the extension. + +### `docs` +Contains documentation related to the project, such as publishing guides, QA guides, and design system information. + +**Examples of important files:** +- `README.md`: Overview of the documentation. +- `publishing.md`: Guide for publishing the extension. +- `QA_Guide.md`: Quality assurance guide. + +### `shared` +Includes shared constants, modules, and utilities used across the project. + +**Examples of important files:** +- `constants/accounts.ts`: Shared constants related to accounts. +- `constants/gas.ts`: Shared constants related to gas. + +### `test` +Has test data, helpers, and end-to-end tests for the project. + +**Examples of important files:** +- `e2e/tests`: End-to-end tests for the extension. +- `unit`: Unit tests for the extension. + +### `ui` +Contains React components, hooks, contexts, and styles used in the MetaMask extension's user interface. + +**Examples of important files:** +- `components`: React components used in the extension. +- `hooks`: Custom hooks used in the extension. +- `styles`: Styles used in the extension. + +## Configuration Files + +### `.browserslistrc` +Specifies the list of browsers that the project supports. + +### `.circleci/config.yml` +Main configuration file for CircleCI. + +### `.eslintrc.js` +Configuration file for ESLint, specifying linting rules for the project. + +### `.prettierrc.yml` +Configuration file for Prettier, specifying code formatting rules for the project. From 2559025383cdd078f1382d6553d98df315425f3a Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Sat, 26 Oct 2024 05:43:23 +0000 Subject: [PATCH 3/4] fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-SECP256K1-8237220 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fad9fae96418..d52b6679b586 100644 --- a/package.json +++ b/package.json @@ -360,7 +360,7 @@ "@metamask/snaps-sdk": "^6.5.1", "@metamask/snaps-utils": "^8.1.1", "@metamask/transaction-controller": "^37.2.0", - "@metamask/user-operation-controller": "^13.0.0", + "@metamask/user-operation-controller": "^14.0.1", "@metamask/utils": "^9.3.0", "@ngraveio/bc-ur": "^1.1.12", "@noble/hashes": "^1.3.3", From 8328031d30720b78de65cf3c8c1eda88fee2f154 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Sat, 2 Nov 2024 23:08:45 +0000 Subject: [PATCH 4/4] fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-SECP256K1-8237220 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d52b6679b586..c31a7bc2e4f5 100644 --- a/package.json +++ b/package.json @@ -353,7 +353,7 @@ "@metamask/scure-bip39": "^2.0.3", "@metamask/selected-network-controller": "^18.0.1", "@metamask/signature-controller": "^19.1.0", - "@metamask/smart-transactions-controller": "^13.0.0", + "@metamask/smart-transactions-controller": "^14.0.0", "@metamask/snaps-controllers": "^9.7.0", "@metamask/snaps-execution-environments": "^6.7.2", "@metamask/snaps-rpc-methods": "^11.1.1",