-
Notifications
You must be signed in to change notification settings - Fork 316
docs: improve documentation #5883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
9a82ce7
docs: add setup doc
guanbinrui b7e956c
docs: content script approve permission
guanbinrui 87fe999
docs: update command
guanbinrui 448fdd1
docs: update git conversion
guanbinrui b0c61a7
docs: debugging section
guanbinrui 3eedc25
feat: add plugin development quickstart
Randolph314 d251bc8
feat: change file name
Randolph314 03ff849
docs: add more docs
guanbinrui ec3b18d
docs: update bounty guide
guanbinrui 423772e
doc: update pkg
guanbinrui 391c4dd
docs: add questions
guanbinrui 1a50cd4
docs: add answer to "How to fix cspell errors?"
guanbinrui 463d5b3
docs: add answer to React Strict Mode
guanbinrui 5b6b41a
docs: update description
guanbinrui b78417c
docs: add answer for CI builds
guanbinrui b85e912
docs: add answer to lockfile
guanbinrui 1eb836c
docs: update description
guanbinrui 7ce6fac
refactor: update description
guanbinrui 7930e51
docs: update format
guanbinrui bd7fd3c
refactor: update description
guanbinrui 83585a2
refactor: update description
guanbinrui ca6a462
refactor: update description
guanbinrui d6abb75
refactor: update description
guanbinrui fcbf26b
refactor: update description
guanbinrui 263bc29
refactor: update description
guanbinrui cf4505d
refactor: update description
guanbinrui 3760c49
refactor: update description
guanbinrui 37f9b78
refactor: update description
guanbinrui 449c7a0
docs: add more answers
guanbinrui 6b65df0
docs: update docs
guanbinrui File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # FAQ | ||
|
|
||
| ## How to resolve merge conflicts in `pnpm-lock.yaml`? | ||
|
|
||
| Merge the target branch into yours and never mind those conflicts in `pnpm-lock.yaml`. And checkout the file to be the one on the target branch to revert changes your branch took in. Then run `pnpm install` to up the lockfile to date. | ||
|
|
||
| E.g., your `feat/fantasy` branch conflicts with `develop` branch. | ||
|
|
||
| ```bash | ||
| > git branch --show-current | ||
| feat/fantasy | ||
|
|
||
| # merge the develop branch and never manually handle the conflicts in lock file | ||
| > git merge develop | ||
|
|
||
| # check out the lock file from the base branch | ||
| > git checkout develop -- pnpm-lock.yaml | ||
|
|
||
| # up the lockfile to date | ||
| > pnpm install | ||
| ``` | ||
|
|
||
| ## Why my Git hooks don't work? | ||
|
|
||
| ```bash | ||
| npx husky install # on project root directory | ||
| ``` | ||
|
|
||
| ## How to fix cspell errors in CI? | ||
|
|
||
| This project uses [cspell](https://github.com/streetsidesoftware/cspell) for checking typos. You can add unlisted words into `cspell.json` to bypass cspell checking. After you update the configuration file, you could run checking locally before pushing it to make sure your patch is working. | ||
|
|
||
| ```bash | ||
| npx cspell lint pattern_that_match_your_files | ||
|
|
||
| # e.g. check spell of the RSS3 plugin | ||
| npx cspell lint ./packages/plugins/RSS3/**/* | ||
| ``` | ||
|
|
||
| Learn more: [`cspell.json`](https://cspell.org/configuration/#cspelljson) | ||
|
|
||
| ## Why were my components rendered many times? | ||
|
|
||
| All components should working in [Strict Mode](https://reactjs.org/docs/strict-mode.html) and React 18 new [Strict Effects](https://github.com/reactwg/react-18/discussions/19). | ||
|
|
||
| If you found your code not working correctly, please read the documentation above. In addition, you can comment out `<StrictMode />` temporarily to verify if it is a problem with your component not supporting Strict Mode. | ||
|
|
||
| DO NOT remove `<StrictMode />`. | ||
|
|
||
| ## How to download CI builds? | ||
|
|
||
| | Name | Description | | ||
| | ----------------------------- | ----------------------------------------------------------------------- | | ||
| | MaskNetwork.base.zip | The default build, currently is the same as the Chromium build. | | ||
| | MaskNetwork.chromium-beta.zip | Build for Chromium based browsers with some insider features turned on. | | ||
| | MaskNetwork.chromium.zip | Build for Chromium based browsers | | ||
| | MaskNetwork.firefox.zip | Build for Firefox | | ||
| | MaskNetwork.gecko.zip | Build for Android native Mask app | | ||
| | MaskNetwork.iOS.zip | Build for iOS native Mask app | | ||
|
|
||
| You can download these builds in two places. | ||
|
|
||
| - Github: Open the pull request page, and click the **Actions** tab. Then on the opened page, click the **build** sub-item on the **Compile** item. On the action detailed page, click the **Summary** tab. Now you can download builds on the **Artifacts** section. | ||
|
|
||
| E.g., <https://github.com/DimensionDev/Maskbook/actions/runs/2026749204> | ||
|
|
||
| - CircleCI: Open the pull request page, and scroll down to the review status card. Click **Show all checks** to find the ** | ||
| ci/circleci: build** item, and click the **details** link. On the opened CircleCI page, click the **ARTIFACTS** tab. | ||
|
|
||
| E.g., <https://app.circleci.com/pipelines/github/DimensionDev/Maskbook/24886/workflows/eeabcc93-6152-437f-a65d-24f0acee34a9/jobs/52795/artifacts> | ||
|
|
||
| ## Help! The data service doesn’t return a CORS header. | ||
|
|
||
| Please contact the service maintainer to add CORS headers, the extension will send requests in following origins: | ||
|
|
||
| | Browser | Origin | | ||
| | -------- | --------------------------------------------------- | | ||
| | Chromium | chrome-extension://jkoeaghipilijlahjplgbfiocjhldnap | | ||
| | Firefox | moz-extension://id | | ||
|
|
||
| The Chromium extension has a fixed id, but only on production mode. And the Firefox browser will set a new id each time it boots an extension. So, in summary, it's better to allow all origins which match the regexp below. | ||
|
|
||
| ```ts | ||
| ;/.*-extension:\/\/[^\S]+/ | ||
| ``` | ||
|
|
||
| If you cannot reach the service maintainer another workaround is to use a proxy server to add CORS headers. To enable it try to change the request URL into `https://cors.r2d2.to/?=[url]`. | ||
|
|
||
| ```ts | ||
| // before | ||
| fetch('https://api.com') | ||
|
|
||
| // after | ||
| fetch('https://cors.r2d2.to/?=https://api.com') | ||
| ``` | ||
|
|
||
| ## How to read the local settings? | ||
|
|
||
| Open the background.html of the extension and execute the following scripts in the console. | ||
|
|
||
| ```ts | ||
| // get all storage | ||
| browser.storage.local.get(null).then(console.log) | ||
|
|
||
| // clear all storage | ||
| browser.storage.local.clear() | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Blockchain Integration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Bounty Development Guide | ||
|
|
||
| Hi, Awesome people! Welcome to start a bounty task on Mask Network. | ||
|
|
||
| ## Tech Reqirements | ||
|
|
||
| Mask Network extension is written in TypeScript. The UI is written by React and [@mui](https://mui.com/) framework. We write CSS in [CSS-in-JS](css-in-js.md) style. | ||
|
|
||
| We prefer widely adopting tech solutions that include: | ||
|
|
||
| - [Web3.js](https://web3js.readthedocs.io/) Ethereum JavaScript API | ||
| - [react-use](https://streamich.github.io/react-use/) React Hooks — 👍 | ||
| - [bignumber.js](https://mikemcl.github.io/bignumber.js/) A JavaScript library for arbitrary-precision arithmetic. | ||
| - [lodash](https://lodash.com/docs/) A modern JavaScript utility library delivering modularity, performance & extras. | ||
| - [urlcat](https://urlcat.dev/) A URL builder library for JavaScript. | ||
|
|
||
| > If your bounty task is related to another project, it could have extra requirements that need to consider. | ||
|
|
||
| If you are familiar with these libraries mentioned above, it will take less effort for you to get started. | ||
| The codebase is open-sourced under the AGPLv3 license. | ||
|
|
||
| ## Packages | ||
|
|
||
| After cloning the repository and [set up the development environment](setup.md). The codebase is constructed as a monorepo with many internal packages. Each package serves a specific purpose. Let's take a quick tour. | ||
|
|
||
| ### Core Packages | ||
|
|
||
| - `packages/mask` The main extension which has multiple websites supports, keeps the user's data safe and hosts a plugin system. | ||
| - `packages/encryption` The encryption & decryption of mask network. | ||
| - `packages/plugin-infra` The definition of the plugin system, with a bunch of APIs to expose the core abilities to plugins. | ||
|
|
||
| ### Plugin Packages | ||
|
|
||
| - `packages/plugins/*` All of integrated plugins. | ||
|
|
||
| ### Shared Packages | ||
|
|
||
| - `packages/shared` Shared UI components and utilities. | ||
| - `packages/shared-base` Shared types, constants, and atomic units. Must be as pure as possible and testable. | ||
|
|
||
| ### Web3 Packages | ||
|
|
||
| - `packages/web3-constants` Each Web3 constant must set up for all kowned chain IDs. | ||
| - `packages/web3-contracts` EVM contract ABIs and compiled TypeScript definitions. | ||
| - `packages/web3-provider` A hub of APIs for external data source. | ||
| - `packages/web3-shared-*` Shared hooks, utilities, types for each network. | ||
|
|
||
| ## Learn Through Examples | ||
|
|
||
| Almost all bounty tasks for the Mask Network plugin relate to a plugin. After learning the basics, checkout those pull requests or plugins to learn quick from examples. | ||
|
|
||
| ### Dapp Plugins | ||
|
|
||
| | Plugin | Pull Request Links | | ||
| | ----------- | ----------------------------------------------------------------------------------------------- | | ||
| | Collectible | <https://github.com/DimensionDev/Maskbook/pulls?q=is%3Apr+label%3A%22Plugin%3A+Collectibles%22> | | ||
| | Trader | <https://github.com/DimensionDev/Maskbook/pulls?q=is%3Apr+label%3A%22Plugin%3A+Trader%22> | | ||
| | Savings | <https://github.com/DimensionDev/Maskbook/pulls?q=is%3Apr+label%3A%22Plugin%3A+Savings%22> | | ||
|
|
||
| ### Network Plugins | ||
|
|
||
| | Plugin | Pull Request Links | | ||
| | ---------- | -------------------------------------------------------------------------------------- | | ||
| | EVM Chains | <https://github.com/DimensionDev/Maskbook/pulls?q=is%3Apr+label%3A%22Plugin%3A+EVM%22> | | ||
|
|
||
| ## Pull Request Conversions | ||
|
|
||
| After bounty hacker opening a pull request. Reviewer will label it with `Type: Bounty`, and update a statu tags while the request on-going. | ||
|
|
||
| | Status | Description | | ||
| | ------------------- | ---------------------------------------------------------------------------- | | ||
| | `Bounty: Started` | The DEV team noticed your request. You will receive comments from reviewers. | | ||
| | `Bounty: Reviewed` | The QA team notcied your request. You will receive bugs from reviewers. | | ||
| | `Bounty: Qualified` | Your request is qualifed. It will ship soon. | |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Concepts | ||
|
|
||
| ## Persona | ||
|
|
||
| ## Post Payload | ||
|
|
||
| ## Wallet | ||
|
|
||
| ## Dashboard | ||
|
|
||
| ## Popup | ||
|
|
||
| ## SNS Provider | ||
|
|
||
| ## Wallet Provider | ||
|
|
||
| ## Plugin | ||
|
|
||
| ## Network | ||
|
|
||
| ## ChainId |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.