Skip to content
Merged
Show file tree
Hide file tree
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 Mar 16, 2022
b7e956c
docs: content script approve permission
guanbinrui Mar 16, 2022
87fe999
docs: update command
guanbinrui Mar 16, 2022
448fdd1
docs: update git conversion
guanbinrui Mar 16, 2022
b0c61a7
docs: debugging section
guanbinrui Mar 16, 2022
3eedc25
feat: add plugin development quickstart
Randolph314 Mar 15, 2022
d251bc8
feat: change file name
Randolph314 Mar 15, 2022
03ff849
docs: add more docs
guanbinrui Mar 16, 2022
ec3b18d
docs: update bounty guide
guanbinrui Mar 16, 2022
423772e
doc: update pkg
guanbinrui Mar 21, 2022
391c4dd
docs: add questions
guanbinrui Mar 24, 2022
1a50cd4
docs: add answer to "How to fix cspell errors?"
guanbinrui Mar 24, 2022
463d5b3
docs: add answer to React Strict Mode
guanbinrui Mar 24, 2022
5b6b41a
docs: update description
guanbinrui Mar 24, 2022
b78417c
docs: add answer for CI builds
guanbinrui Mar 24, 2022
b85e912
docs: add answer to lockfile
guanbinrui Mar 24, 2022
1eb836c
docs: update description
guanbinrui Mar 24, 2022
7ce6fac
refactor: update description
guanbinrui Mar 24, 2022
7930e51
docs: update format
guanbinrui Mar 24, 2022
bd7fd3c
refactor: update description
guanbinrui Mar 24, 2022
83585a2
refactor: update description
guanbinrui Mar 24, 2022
ca6a462
refactor: update description
guanbinrui Mar 24, 2022
d6abb75
refactor: update description
guanbinrui Mar 24, 2022
fcbf26b
refactor: update description
guanbinrui Mar 24, 2022
263bc29
refactor: update description
guanbinrui Mar 24, 2022
cf4505d
refactor: update description
guanbinrui Mar 24, 2022
3760c49
refactor: update description
guanbinrui Mar 24, 2022
37f9b78
refactor: update description
guanbinrui Mar 24, 2022
449c7a0
docs: add more answers
guanbinrui Mar 24, 2022
6b65df0
docs: update docs
guanbinrui Mar 24, 2022
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
107 changes: 107 additions & 0 deletions docs/FAQ.md
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?

Comment thread
guanbinrui marked this conversation as resolved.
| 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()
```
1 change: 1 addition & 0 deletions docs/blockchain-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Blockchain Integration
74 changes: 74 additions & 0 deletions docs/bounty-development-guide.md
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. |
15 changes: 0 additions & 15 deletions docs/bounty-guide.md

This file was deleted.

129 changes: 0 additions & 129 deletions docs/caveats.md

This file was deleted.

21 changes: 21 additions & 0 deletions docs/concepts.md
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
Loading