Skip to content

Commit 4d71edc

Browse files
committed
Merge remote-tracking branch 'upstream/master' into codingsh/Integrate-Optimism
2 parents 4f9a737 + a2f5d83 commit 4d71edc

File tree

2,808 files changed

+86497
-56440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,808 files changed

+86497
-56440
lines changed

.circleci/config.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ jobs:
2525
name: Restore PNPM Package Cache
2626
keys:
2727
- v3-mask-cache-pnpm
28+
- run:
29+
name: Install PNPM
30+
command: sudo npm install -g [email protected]
2831
- run:
2932
name: Install Dependencies
30-
command: npx pnpm@6.4.0 install --frozen-lockfile --store-dir ~/.pnpm/
33+
command: pnpm install --frozen-lockfile --store-dir ~/.pnpm/
3134
- save_cache:
3235
name: Save NPM Package Cache
3336
key: v3-mask-cache-npm
@@ -41,6 +44,9 @@ jobs:
4144
executor: mask_node
4245
steps:
4346
- restore_workspace
47+
- run:
48+
name: Install PNPM
49+
command: sudo npm install -g [email protected]
4450
- run:
4551
name: Build Mask Network
4652
command: npx gulp build-ci

.eslintrc.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@
2323
"no-restricted-globals": ["error", "event", "name", "length", "closed"],
2424
"no-restricted-imports": [
2525
"error",
26-
{ "paths": [{ "name": "lodash", "message": "Please use lodash-es instead." }] }
26+
{
27+
"paths": [
28+
{ "name": "lodash", "message": "Please use lodash-unified instead." },
29+
{ "name": "lodash-es", "message": "Please use lodash-unified instead." },
30+
{ "name": "date-fns", "message": "Please use date-fns/{submodule} instead." },
31+
{ "name": "date-fns/esm", "message": "Please use date-fns/{submodule} instead." }
32+
]
33+
}
2734
],
2835
"no-return-await": "error",
2936
"no-sparse-arrays": "error",

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
99
liberapay: # Replace with a single Liberapay username
1010
issuehunt: # Replace with a single IssueHunt username
1111
otechie: # Replace with a single Otechie username
12-
custom: https://donate.unlock-protocol.com/?r=DimensionDev/Maskbook
12+
custom: #

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Mask
4-
url: https://github.com/DimensionDev/Maskbook/discussions
4+
url: https://we.mask.io/
55
about: Where talks about Mask happen.

.github/pull_request_template.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
<!-- Please refer to the related issue number -->
2-
closes #
1+
## Description
2+
3+
<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
4+
5+
Closes # (NO_ISSUE)
6+
7+
## Type of change
8+
9+
<!-- Please remove options that are not relevant. -->
10+
11+
- [ ] Documentation
12+
- [ ] Code refactoring (Restructuring existing code w/o changing its observable behavior)
13+
- [ ] Bug fix (non-breaking change which fixes an issue)
14+
- [ ] New feature (non-breaking change which adds functionality)
15+
- [ ] Breaking change (a fix or feature that would make something no longer possible to do/require old user must upgrade their Mask Network to this new version)
16+
17+
## Previews
18+
19+
<!-- Please attach screenshots if there are any visual changes. -->
20+
21+
## Checklist
22+
23+
- [ ] My code follows the style guidelines of this project.
24+
- [ ] I have performed a self-review of my own code.
25+
- [ ] I have removed all in development `console.log`s
26+
- [ ] I have removed all commented code.
27+
- [ ] I have commented on my code, particularly in hard-to-understand areas.
28+
- [ ] I have read [Internationalization Guide](https://github.com/DimensionDev/Maskbook/blob/develop/docs/i18n-guide.md) and moved text fields to the i18n JSON file.
29+
30+
If this PR depends on external APIs:
31+
32+
- [ ] I have configured those APIs with CORS headers to let extension requests get passed. <!-- If you don't have permission to modify the server, please let us know it. -->
33+
- chrome extension: `chrome-extension://[id]`
34+
- firefox extension: `moz-extension://[id]`
35+
- [ ] I have delegated all web requests to the background service via the internal RPC bridge.

.github/semantic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enabled: true
2+
titleOnly: true

.github/workflows/bot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
pull_request:
77
branches: [master, develop*, released]
88

9+
# Cancels all previous workflow runs for pull requests that have not completed.
10+
concurrency:
11+
# The concurrency group contains the workflow name and the branch name for
12+
# pull requests or the commit hash for any other events.
13+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
14+
cancel-in-progress: true
15+
916
jobs:
1017
merge_conflict_check:
1118
runs-on: ubuntu-20.04

.github/workflows/compile.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
name: Build
1+
name: Compile
22

33
on:
44
push:
55
branches: [master, develop*, released]
66
pull_request:
77
branches: [master, develop*, released]
88

9+
# Cancels all previous workflow runs for pull requests that have not completed.
10+
concurrency:
11+
# The concurrency group contains the workflow name and the branch name for
12+
# pull requests or the commit hash for any other events.
13+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
14+
cancel-in-progress: true
15+
916
jobs:
1017
build:
1118
runs-on: ubuntu-20.04
@@ -21,34 +28,22 @@ jobs:
2128
with:
2229
ref: ${{ github.event.pull_request.head.sha }}
2330
fetch-depth: 0
24-
- uses: actions/setup-node@v2
25-
- name: Restore pnpm cache
26-
uses: actions/cache@v2
31+
- uses: pnpm/action-setup@v2
2732
with:
28-
path: ~/.pnpm-store
29-
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
30-
restore-keys: ${{ runner.os }}-node-
31-
- name: Restore TypeScript incremental build cache
32-
uses: actions/cache@v2
33+
version: '6.23.1'
34+
- uses: actions/setup-node@v2
3335
with:
34-
path: packages/**/dist
35-
# actions/cache will not upload changes in cache if primary key hits
36-
# by adding date to the primary key, we can ensure the cache updates on the first build of the day
37-
key: ${{ runner.os }}-tsc-v2-${{ hashFiles('packages/**/tsconfig.json') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ steps.get-date.outputs.date }}
38-
# Allow fallback to cache of different dependencies but not allowing fallback to different tsconfig
39-
# because that might indicates a structural/flags changes in tsc emit.
40-
restore-keys: |
41-
${{ runner.os }}-tsc-v2-${{ hashFiles('packages/**/tsconfig.json') }}-${{ hashFiles('pnpm-lock.yaml') }}
42-
${{ runner.os }}-tsc-v2-${{ hashFiles('packages/**/tsconfig.json') }}
36+
node-version: '16'
37+
cache: 'pnpm'
4338
- name: Restore Webpack cache
4439
uses: actions/cache@v2
4540
with:
46-
path: packages/maskbook/node_modules/.cache/
41+
path: packages/mask/node_modules/.cache/
4742
key: ${{ runner.os }}-extension-${{ hashFiles('pnpm-lock.yaml') }}-${{ steps.get-date.outputs.date }}
4843
# Not fallback to different dependencies. Webpack seems like have bug.
4944
# An example caused by the webpack cache bug: https://github.com/facebook/react/issues/21587
5045
restore-keys: ${{ runner.os }}-extension-${{ hashFiles('pnpm-lock.yaml') }}
51-
- run: npx pnpm install
46+
- run: pnpm install
5247
- run: npx gulp build-ci
5348
- name: Upload `MaskNetwork.base.zip`
5449
uses: actions/upload-artifact@v2

.github/workflows/linters.yml

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
pull_request:
77
branches: [master, develop*, released]
88

9+
# Cancels all previous workflow runs for pull requests that have not completed.
10+
concurrency:
11+
# The concurrency group contains the workflow name and the branch name for
12+
# pull requests or the commit hash for any other events.
13+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
14+
cancel-in-progress: true
15+
916
jobs:
1017
prettier:
1118
runs-on: ubuntu-20.04
@@ -14,21 +21,21 @@ jobs:
1421
with:
1522
ref: ${{ github.event.pull_request.head.sha }}
1623
- uses: actions/setup-node@v2
17-
- run: npx prettier@2.4.0 --list-different .
24+
- run: npx prettier@2.5.0 --list-different .
1825
locale-kit:
1926
runs-on: ubuntu-20.04
2027
steps:
2128
- uses: actions/checkout@v2
2229
with:
2330
ref: ${{ github.event.pull_request.head.sha }}
31+
- uses: pnpm/action-setup@v2
32+
with:
33+
version: '6.23.1'
2434
- uses: actions/setup-node@v2
25-
- name: pnpm cache
26-
uses: actions/cache@v2
2735
with:
28-
path: ~/.pnpm-store
29-
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
30-
restore-keys: ${{ runner.os }}-node-
31-
- run: npx pnpm install
36+
node-version: '16'
37+
cache: 'pnpm'
38+
- run: pnpm install
3239
- run: npx gulp locale-kit
3340
type-check-and-jest:
3441
runs-on: ubuntu-20.04
@@ -40,46 +47,33 @@ jobs:
4047
- uses: actions/checkout@v2
4148
with:
4249
ref: ${{ github.event.pull_request.head.sha }}
50+
- uses: pnpm/action-setup@v2
51+
with:
52+
version: '6.23.1'
4353
- uses: actions/setup-node@v2
4454
with:
4555
node-version: '16'
46-
- name: pnpm cache
47-
uses: actions/cache@v2
48-
with:
49-
path: ~/.pnpm-store
50-
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
51-
restore-keys: ${{ runner.os }}-node-
52-
- name: Restore TypeScript incremental build cache
53-
uses: actions/cache@v2
54-
with:
55-
path: packages/**/dist
56-
# actions/cache will not upload changes in cache if primary key hits
57-
# by adding date to the primary key, we can ensure the cache updates on the first build of the day
58-
key: ${{ runner.os }}-tsc-v2-${{ hashFiles('packages/**/tsconfig.json') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ steps.get-date.outputs.date }}
59-
# Allow fallback to cache of different dependencies but not allowing fallback to different tsconfig
60-
# because that might indicates a structural/flags changes in tsc emit.
61-
restore-keys: |
62-
${{ runner.os }}-tsc-v2-${{ hashFiles('packages/**/tsconfig.json') }}-${{ hashFiles('pnpm-lock.yaml') }}
63-
${{ runner.os }}-tsc-v2-${{ hashFiles('packages/**/tsconfig.json') }}
64-
- run: npx pnpm install
56+
cache: 'pnpm'
57+
- run: pnpm install
6558
- run: npx gulp codegen
59+
- run: npx gulp polyfill
6660
- run: node --experimental-vm-modules ./node_modules/jest/bin/jest.js
6761
eslint:
6862
runs-on: ubuntu-20.04
6963
steps:
7064
- uses: actions/checkout@v2
7165
with:
7266
ref: ${{ github.event.pull_request.head.sha }}
67+
- uses: pnpm/action-setup@v2
68+
with:
69+
version: '6.23.1'
7370
- uses: actions/setup-node@v2
74-
- name: pnpm cache
75-
uses: actions/cache@v2
7671
with:
77-
path: ~/.pnpm-store
78-
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
79-
restore-keys: ${{ runner.os }}-node-
80-
- run: npx pnpm install
81-
- run: npm run lint:ci -- --max-warnings=0
82-
- run: npm run lint:ci -- --format=junit --output-file=reports/junit/eslint-results.xml
72+
node-version: '16'
73+
cache: 'pnpm'
74+
- run: pnpm install
75+
- run: pnpm run lint:ci -- --max-warnings=0
76+
- run: pnpm run lint:ci -- --format=junit --output-file=reports/junit/eslint-results.xml
8377
- name: Upload eslint report
8478
uses: actions/upload-artifact@v2
8579
with:

.github/workflows/netlify.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
pull_request:
77
branches: [master, develop*, released]
88

9+
# Cancels all previous workflow runs for pull requests that have not completed.
10+
concurrency:
11+
# The concurrency group contains the workflow name and the branch name for
12+
# pull requests or the commit hash for any other events.
13+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
14+
cancel-in-progress: true
15+
916
jobs:
1017
netlify:
1118
runs-on: ubuntu-20.04
@@ -20,25 +27,13 @@ jobs:
2027
with:
2128
ref: ${{ github.event.pull_request.head.sha }}
2229
fetch-depth: 0
23-
- uses: actions/setup-node@v2
24-
- name: Restore pnpm cache
25-
uses: actions/cache@v2
30+
- uses: pnpm/action-setup@v2
2631
with:
27-
path: ~/.pnpm-store
28-
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
29-
restore-keys: ${{ runner.os }}-node-
30-
- name: Restore TypeScript incremental build cache
31-
uses: actions/cache@v2
32+
version: '6.23.1'
33+
- uses: actions/setup-node@v2
3234
with:
33-
path: packages/**/dist
34-
# actions/cache will not upload changes in cache if primary key hits
35-
# by adding date to the primary key, we can ensure the cache updates on the first build of the day
36-
key: ${{ runner.os }}-tsc-v2-${{ hashFiles('packages/**/tsconfig.json') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ steps.get-date.outputs.date }}
37-
# Allow fallback to cache of different dependencies but not allowing fallback to different tsconfig
38-
# because that might indicates a structural/flags changes in tsc emit.
39-
restore-keys: |
40-
${{ runner.os }}-tsc-v2-${{ hashFiles('packages/**/tsconfig.json') }}-${{ hashFiles('pnpm-lock.yaml') }}
41-
${{ runner.os }}-tsc-v2-${{ hashFiles('packages/**/tsconfig.json') }}
35+
node-version: '16'
36+
cache: 'pnpm'
4237
- name: Restore Webpack cache
4338
uses: actions/cache@v2
4439
with:
@@ -49,7 +44,7 @@ jobs:
4944
# Not fallback to different dependencies. Webpack seems like have bug.
5045
# An example caused by the webpack cache bug: https://github.com/facebook/react/issues/21587
5146
restore-keys: ${{ runner.os }}-netlify-${{ hashFiles('pnpm-lock.yaml') }}
52-
- run: npx pnpm install
47+
- run: pnpm install
5348
- run: npx gulp build-ci-netlify
5449
- name: Deploy to Netlify
5550
uses: nwtgck/[email protected]

0 commit comments

Comments
 (0)