Skip to content

Commit 39b038d

Browse files
committed
Merge branch 'develop' into feat/integration-boba-network
2 parents d86d720 + d376263 commit 39b038d

File tree

93 files changed

+1319
-1558
lines changed

Some content is hidden

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

93 files changed

+1319
-1558
lines changed

.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"ecmaVersion": 2020,
44
"sourceType": "module"
55
},
6-
"extends": ["plugin:prettier/recommended"],
76
"env": {
87
"node": true
98
},

.github/workflows/linters.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ jobs:
9090
node-version: "16"
9191
cache: "pnpm"
9292
- run: pnpm install
93-
- run: pnpm run lint:ci
93+
- name: Run Eslint
94+
run: |
95+
# report to stdio and to file, it's cached, the second run should be fast
96+
pnpm run lint:ci
97+
pnpm run lint:ci-report
9498
- name: Upload eslint report
9599
uses: actions/upload-artifact@v2
96100
with:

package.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"build": "build",
1919
"build-ios": "build --preset iOS",
2020
"lint": "eslint -c packages/.eslintrc.json packages --ext .ts,.tsx,.js --cache --fix",
21-
"lint:ci": "eslint -c packages/.eslintrc.json packages --ext .ts,.tsx,.js --cache --format=junit --output-file=reports/junit/eslint-results.xml",
21+
"lint:ci": "eslint -c packages/.eslintrc.json packages --ext .ts,.tsx,.js --cache",
22+
"lint:ci-report": "pnpm lint:ci -- --format=junit --output-file=reports/junit/eslint-results.xml",
2223
"postinstall": "patch-package",
2324
"prepare": "husky install",
2425
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
@@ -31,21 +32,21 @@
3132
"@emotion/serialize": "^1.0.2",
3233
"@emotion/styled": "^11.8.1",
3334
"@emotion/utils": "^1.1.0",
34-
"@mui/icons-material": "5.4.4",
35-
"@mui/lab": "5.0.0-alpha.71",
36-
"@mui/material": "5.4.4",
37-
"@mui/system": "5.4.4",
35+
"@mui/icons-material": "5.5.0",
36+
"@mui/lab": "5.0.0-alpha.72",
37+
"@mui/material": "5.5.0",
38+
"@mui/system": "5.5.0",
3839
"@types/masknet__global-types": "workspace:*",
3940
"@types/react": "^17.0.39",
40-
"@types/react-dom": "17.0.11",
41-
"@types/web": "^0.0.54",
42-
"i18next": "^21.6.13",
41+
"@types/react-dom": "17.0.13",
42+
"@types/web": "^0.0.55",
43+
"i18next": "^21.6.14",
4344
"lodash": "^4.17.21",
4445
"lodash-es": "^4.17.21",
4546
"lodash-unified": "1.0.2",
46-
"react": "18.0.0-rc.0",
47-
"react-dom": "18.0.0-rc.0",
48-
"react-i18next": "^11.15.5",
47+
"react": "18.0.0-rc.2",
48+
"react-dom": "18.0.0-rc.2",
49+
"react-i18next": "^11.15.6",
4950
"ts-results": "3.3.0",
5051
"web3-core": "1.5.2",
5152
"web3-core-method": "1.5.2"
@@ -62,28 +63,26 @@
6263
"@nice-labs/git-rev": "^3.5.0",
6364
"@swc/core": "^1.2.148",
6465
"@types/lodash-es": "^4.17.6",
65-
"@typescript-eslint/experimental-utils": "^5.13.0",
66+
"@typescript-eslint/experimental-utils": "^5.14.0",
6667
"cspell": "^5.18.5",
6768
"eslint": "8.10.0",
68-
"eslint-config-prettier": "^8.5.0",
6969
"eslint-plugin-import": "2.25.4",
70-
"eslint-plugin-prettier": "^4.0.0",
7170
"eslint-plugin-react": "^7.29.3",
7271
"eslint-plugin-react-hooks": "^4.3.0",
7372
"eslint-plugin-unicorn": "^41.0.0",
7473
"eslint-plugin-unused-imports": "^2.0.0",
7574
"gulp": "^4.0.2",
7675
"husky": "^7.0.4",
7776
"jest": "^28.0.0-alpha.3",
78-
"lint-staged": "^12.3.4",
77+
"lint-staged": "^12.3.5",
7978
"prettier": "^2.5.1",
8079
"ts-jest": "^27.1.3",
81-
"ts-node": "^10.6.0",
80+
"ts-node": "^10.7.0",
8281
"typescript": "4.6.2"
8382
},
8483
"pnpm": {
8584
"overrides": {
86-
"@types/node": "^17.0.17"
85+
"@types/node": "^17.0.21"
8786
},
8887
"onlyBuiltDependencies": []
8988
}

packages/dashboard/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
"@masknet/shared-base": "workspace:*",
2323
"@masknet/storybook-shared": "workspace:*",
2424
"@masknet/theme": "workspace:*",
25+
"@masknet/web3-providers": "workspace:*",
2526
"@masknet/web3-shared-base": "workspace:*",
2627
"@masknet/web3-shared-evm": "workspace:*",
27-
"@masknet/web3-providers": "workspace:*",
2828
"@msgpack/msgpack": "^2.7.2",
2929
"@servie/events": "^3.0.0",
3030
"@types/color": "^3.0.3",
3131
"@types/react-avatar-editor": "^10.3.6",
32-
"async-call-rpc": "^6.0.1",
32+
"async-call-rpc": "^6.0.2",
3333
"bignumber.js": "^9.0.2",
3434
"classnames": "^2.3.1",
3535
"color": "^4.2.1",

packages/dashboard/src/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import type {} from 'react-dom/next'
55

66
import './initialization/isolated_bridge'
77
import './initialization/i18n'
8-
import ReactDOM from 'react-dom'
8+
import { StrictMode } from 'react'
9+
import { createRoot } from 'react-dom/client'
910
import Dashboard from './initialization/Dashboard'
1011

1112
if (import.meta.webpackHot) {
@@ -14,4 +15,8 @@ if (import.meta.webpackHot) {
1415
document.getElementById('warning')?.remove()
1516
}
1617

17-
ReactDOM.createRoot(document.getElementById('root')!).render(<Dashboard />)
18+
createRoot(document.getElementById('root')!).render(
19+
<StrictMode>
20+
<Dashboard />
21+
</StrictMode>,
22+
)

packages/dashboard/src/locales/zh-CN.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@
3131
"about_dialog_source_code": "源代码: ",
3232
"about_dialog_feedback": "反馈: ",
3333
"about_dialog_touch": "联系我们",
34-
"about_dialog_description": "Mask Network引领您探索更新更开放的互联网。Mask Network允许您在社交网络上发送加密的贴文。 同时我们提供了更多功能,譬如发送加密红包,购买加密货币,加密文件服务等。",
34+
"about_dialog_description": "Mask Network 引领您探索更新更开放的互联网。Mask Network 允许您在社交网络上发送加密的贴文。 同时我们提供了更多功能,譬如发送加密红包,购买加密货币,加密文件服务等。",
3535
"setup_page_title": "欢迎来到 Mask Network!",
3636
"setup_page_description": "在社交网络上加密您的贴文和聊天内容,只允许您的朋友进行解密。",
3737
"setup_page_create_account_title": "创建身份",
38-
"setup_page_create_account_subtitle": "构建您的数字身份系统,探索Web 3.0",
38+
"setup_page_create_account_subtitle": "构建您的数字身份系统,探索 Web 3.0",
3939
"setup_page_create_account_button": "创建",
4040
"setup_page_create_restore_title": "恢复身份",
41-
"setup_page_create_restore_subtitle": "使用身份助记词或历史备份恢复您的数据.",
41+
"setup_page_create_restore_subtitle": "通过身份助记词或历史备份恢复。",
4242
"setup_page_create_restore_button": "恢复或登录",
4343
"create_account_private_key": "私钥",
4444
"create_account_identity_id": "身份助记词",
4545
"create_account_identity_title": "创建Mask Network身份",
4646
"create_account_sign_in_button": "恢复或登录",
4747
"create_account_persona_exists": "该身份已存在。",
4848
"create_account_mnemonic_download_or_print": "我已妥善保存我的身份信息。",
49-
"create_account_preview_tip": "这个二维码保存您的身份信息,请妥善保存。您可以使用Mask APP 扫描二维码登录您的身份。",
49+
"create_account_preview_tip": "这个二维码保存您的身份信息,请妥善保存。您可以使用 Mask APP 扫描二维码登录您的身份。",
5050
"create_account_mnemonic_confirm_failed": "助记词不正确",
5151
"create_account_connect_social_media_button": "创建",
5252
"create_account_connect_social_media": "连接到 {{type}}",

packages/dashboard/src/pages/CreateMaskWallet/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import { Routes, Route } from 'react-router-dom'
22
import { lazy } from 'react'
33
import { CreateMaskWalletFrame } from '../../components/CreateWalletFrame'
4+
import { DashboardRoutes, relativeRouteOf } from '@masknet/shared-base'
45

56
const Welcome = lazy(() => import('./components/Welcome'))
67
const CreateWalletForm = lazy(() => import('./components/CreateWalletForm'))
78
const CreateMnemonic = lazy(() => import('./components/CreateMnemonic'))
89

10+
const r = relativeRouteOf(DashboardRoutes.CreateMaskWallet)
911
export default function CreateWallet() {
1012
return (
1113
<CreateMaskWalletFrame>
1214
<Routes>
13-
<Route path="/" element={<Welcome />} />
14-
<Route path="/form" element={<CreateWalletForm />} />
15-
<Route path="/mnemonic" element={<CreateMnemonic />} />
15+
<Route path="*" element={<Welcome />} />
16+
<Route path={r(DashboardRoutes.CreateMaskWalletForm)} element={<CreateWalletForm />} />
17+
<Route path={r(DashboardRoutes.CreateMaskWalletMnemonic)} element={<CreateMnemonic />} />
1618
</Routes>
1719
</CreateMaskWalletFrame>
1820
)

packages/dashboard/src/pages/Wallets/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
Web3Plugin,
1212
} from '@masknet/plugin-infra'
1313
import { useRemoteControlledDialog } from '@masknet/shared'
14-
import { DashboardRoutes } from '@masknet/shared-base'
14+
import { DashboardRoutes, relativeRouteOf } from '@masknet/shared-base'
1515
import { useWeb3State } from '@masknet/web3-shared-evm'
1616
import BigNumber from 'bignumber.js'
1717
import { useEffect, useMemo, useState } from 'react'
@@ -30,6 +30,7 @@ import { useIsMatched } from './hooks'
3030
import { StartUp } from './StartUp'
3131
import { getTokenUSDValue } from './utils/getTokenUSDValue'
3232

33+
const r = relativeRouteOf(DashboardRoutes.Wallets)
3334
function Wallets() {
3435
const wallet = useWallet()
3536
const wallets = useWallets()
@@ -122,10 +123,10 @@ function Wallets() {
122123
showOperations={pluginId === NetworkPluginID.PLUGIN_EVM}
123124
/>
124125
<Routes>
125-
<Route path="/" element={<Assets network={selectedNetwork} />} />
126-
<Route path="transfer" element={<Transfer />} />
126+
<Route path="*" element={<Assets network={selectedNetwork} />} />
127+
<Route path={r(DashboardRoutes.WalletsTransfer)} element={<Transfer />} />
127128
<Route
128-
path="history"
129+
path={r(DashboardRoutes.WalletsHistory)}
129130
element={<History selectedChainId={selectedNetwork?.chainId ?? currentChainId} />}
130131
/>
131132
</Routes>

packages/external-plugin-previewer/src/playground.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { t } from 'ef.js'
33
import { setupPortalShadowRoot } from '@masknet/theme'
4-
setupPortalShadowRoot({ mode: 'open' })
4+
setupPortalShadowRoot({ mode: 'open' }, [])
55

66
Object.assign(globalThis, { React })
77

packages/injected-script/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "./dist/sdk/index.d.ts",
77
"devDependencies": {
88
"@rollup/plugin-sucrase": "^4.0.2",
9-
"rollup": "^2.69.0",
9+
"rollup": "^2.70.0",
1010
"rollup-plugin-terser": "^7.0.2"
1111
},
1212
"scripts": {

0 commit comments

Comments
 (0)