Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
Browse files Browse the repository at this point in the history
…twork
  • Loading branch information
developerfred committed Mar 24, 2022
2 parents 130c04e + 787fa07 commit 2117010
Show file tree
Hide file tree
Showing 36 changed files with 751 additions and 201 deletions.
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?

| 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.

```txt
/.*-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 status tag while the progress on-going.

| Status | Description |
| ------------------- | ---------------------------------------------------------------------------- |
| `Bounty: Started` | The DEV team noticed your request. You will receive comments from reviewers. |
| `Bounty: Reviewed` | The QA team noticed 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

0 comments on commit 2117010

Please sign in to comment.