Skip to content

Commit 85d73b6

Browse files
committed
Merge branch 'release/1.10.10' into released
2 parents fd84b82 + b2caf37 commit 85d73b6

Some content is hidden

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

56 files changed

+1504
-389
lines changed

.circleci/config.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version: 2.1
66
executors:
77
maskbook_node:
88
docker:
9-
- image: circleci/node:13.2.0
9+
- image: circleci/node:13.2.0-browsers
1010
working_directory: ~/repo
1111
commands:
1212
restore_workspace:
@@ -22,13 +22,13 @@ jobs:
2222
- restore_cache:
2323
name: Restore Yarn Package Cache
2424
keys:
25-
- v1-maskbook-cache
25+
- v2-maskbook-cache
2626
- run:
2727
name: Install Dependencies
2828
command: yarn install --link-duplicates --frozen-lockfile
2929
- save_cache:
3030
name: Save Yarn Package Cache
31-
key: v1-maskbook-cache
31+
key: v2-maskbook-cache
3232
paths:
3333
- ~/.cache/yarn
3434
- persist_to_workspace:
@@ -41,7 +41,7 @@ jobs:
4141
- restore_workspace
4242
- run:
4343
name: 'TypeScript type check'
44-
command: yarn tsc -p tsconfig_cjs.json --noEmit
44+
command: yarn tsc --noEmit
4545
eslint:
4646
executor: maskbook_node
4747
steps:
@@ -82,6 +82,23 @@ jobs:
8282
path: reports/junit
8383
- store_artifacts:
8484
path: coverage
85+
e2e:
86+
executor: maskbook_node
87+
steps:
88+
- restore_workspace
89+
- run:
90+
name: Setup E2E
91+
command: |
92+
mkdir -p ./screenshots
93+
yarn build:e2e
94+
- run:
95+
name: Jest E2E
96+
command: yarn test:e2e
97+
- run:
98+
name: Teardown E2E
99+
command: rm -rf ./build
100+
- store_artifacts:
101+
path: screenshots
85102
build:
86103
executor: maskbook_node
87104
steps:
@@ -91,7 +108,7 @@ jobs:
91108
command: sudo apt-get install zip
92109
- run:
93110
name: Build Maskbook
94-
command: node ./scripts/ci-build.js
111+
command: yarn build-ci
95112
- store_artifacts:
96113
path: Maskbook.base.zip
97114
destination: /Maskbook.base.zip
@@ -184,6 +201,10 @@ workflows:
184201
requires:
185202
# Fail quick with type error.
186203
- typescript
204+
- e2e:
205+
requires:
206+
# Avoid accessing build/ folder at the same time
207+
- build
187208
- publish-github-release:
188209
requires:
189210
- build

.commitlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ public/polyfill
1414

1515
# testing
1616
/coverage
17+
/junit.xml
1718

1819
# production
1920
/build
2021
/dist
2122
/storybook-static
23+
/Maskbook.*.zip
2224

2325
# misc
2426
.DS_Store
@@ -31,6 +33,9 @@ public/polyfill
3133
# contracts
3234
/contracts
3335

36+
# e2e
37+
/screenshots
38+
3439
npm-debug.log*
3540
yarn-debug.log*
3641
yarn-error.log*

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"typescript.tsdk": "node_modules/typescript/lib",
3+
"editor.formatOnSave": true,
34
"i18n-ally.sourceLanguage": "en",
45
"i18n-ally.displayLanguage": "zh",
56
"i18n-ally.localesPaths": "src/_locales",

commitlint.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

config-overrides/manifest.overrides.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ function chromium(manifest) {}
2323
/**
2424
* @param {typeof base} manifest
2525
*/
26-
function WKWebview(manifest) {}
26+
function WKWebview(manifest) {
27+
manifest['iOS-injected-scripts'] = ['js/injected-script.js']
28+
}
2729
function development(manifest, target) {
2830
manifest.key = // ID:jkoeaghipilijlahjplgbfiocjhldnap
2931
'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoz51rhO1w+wD0EKZJEFJaSMkIcIj0qRadfi0tqcl5nbpuJAsafvLe3MaTbW9LhbixTg9PHybO3tlYUFJrZgUuZlEvt2T6SKIu6Rs9e9B3/brNQG3+hCHudbZkq2WG2IzO44dglrs24bRp/pV5oIif0bLuwrzvYsPQ6hgSp+5gc4pg0LEJPLFp01fbORDknWt8suJmEMz7S0O5+u13+34NvxYzUNeLJF9gYrd4zzrAFYITDEYcqr0OMZvVrKz7IkJasER1uJyoGj4gFJeXNGE8y4Sqb150wBju70lKNKlNevWDRJKasG9CjagAD2+BAfqNyltn7KwK7jAyL1w6d6mOwIDAQAB'

e2e/dashboard.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
describe('dashboard - setup a account', () => {
2+
beforeAll(async () => {
3+
await page.goto('chrome-extension://jkoeaghipilijlahjplgbfiocjhldnap/index.html')
4+
})
5+
6+
it('render welcome page', async () => {
7+
const setupButton = await page.waitFor('a[href="#/initialize/1s"]')
8+
expect(await setupButton.evaluate(e => e.textContent.toLowerCase())).toBe('set up')
9+
})
10+
11+
it('take a screenshot', async () => {
12+
await page.screenshot({
13+
path: './screenshots/welcome.png',
14+
})
15+
})
16+
})

jest-e2e.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const path = require('path')
2+
module.exports = {
3+
preset: 'jest-puppeteer',
4+
testRegex: ['/e2e/.*\\.[jt]sx?$'],
5+
}

jest-puppeteer.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const path = require('path')
2+
const extPath = path.join(__dirname, './build')
3+
module.exports = {
4+
launch: {
5+
dumpio: true,
6+
headless: false,
7+
args: [
8+
'--no-sandbox',
9+
'--disable-infobars',
10+
`--disable-extensions-except=${extPath}`,
11+
`--load-extension=${extPath}`,
12+
],
13+
},
14+
browser: 'chromium',
15+
browserContext: 'default',
16+
}

jest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path')
22

33
module.exports = {
4+
testRegex: ['/__tests__/.*\\.[jt]sx?$'],
45
preset: 'ts-jest',
56
testEnvironment: 'jest-environment-jsdom-fourteen',
67
globals: {
@@ -9,6 +10,7 @@ module.exports = {
910
},
1011
},
1112
globalSetup: path.join(__dirname, './scripts/jest-global-setup'),
13+
globalTeardown: path.join(__dirname, './scripts/jest-global-teardown'),
1214
setupFiles: [
1315
require.resolve('jest-webextension-mock'),
1416
require.resolve('fake-indexeddb/auto'),

0 commit comments

Comments
 (0)