Skip to content

Commit

Permalink
Merge branch 'release/1.10.10' into released
Browse files Browse the repository at this point in the history
  • Loading branch information
guanbinrui committed Mar 10, 2020
2 parents fd84b82 + b2caf37 commit 85d73b6
Show file tree
Hide file tree
Showing 56 changed files with 1,504 additions and 389 deletions.
31 changes: 26 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2.1
executors:
maskbook_node:
docker:
- image: circleci/node:13.2.0
- image: circleci/node:13.2.0-browsers
working_directory: ~/repo
commands:
restore_workspace:
Expand All @@ -22,13 +22,13 @@ jobs:
- restore_cache:
name: Restore Yarn Package Cache
keys:
- v1-maskbook-cache
- v2-maskbook-cache
- run:
name: Install Dependencies
command: yarn install --link-duplicates --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: v1-maskbook-cache
key: v2-maskbook-cache
paths:
- ~/.cache/yarn
- persist_to_workspace:
Expand All @@ -41,7 +41,7 @@ jobs:
- restore_workspace
- run:
name: 'TypeScript type check'
command: yarn tsc -p tsconfig_cjs.json --noEmit
command: yarn tsc --noEmit
eslint:
executor: maskbook_node
steps:
Expand Down Expand Up @@ -82,6 +82,23 @@ jobs:
path: reports/junit
- store_artifacts:
path: coverage
e2e:
executor: maskbook_node
steps:
- restore_workspace
- run:
name: Setup E2E
command: |
mkdir -p ./screenshots
yarn build:e2e
- run:
name: Jest E2E
command: yarn test:e2e
- run:
name: Teardown E2E
command: rm -rf ./build
- store_artifacts:
path: screenshots
build:
executor: maskbook_node
steps:
Expand All @@ -91,7 +108,7 @@ jobs:
command: sudo apt-get install zip
- run:
name: Build Maskbook
command: node ./scripts/ci-build.js
command: yarn build-ci
- store_artifacts:
path: Maskbook.base.zip
destination: /Maskbook.base.zip
Expand Down Expand Up @@ -184,6 +201,10 @@ workflows:
requires:
# Fail quick with type error.
- typescript
- e2e:
requires:
# Avoid accessing build/ folder at the same time
- build
- publish-github-release:
requires:
- build
Expand Down
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ public/polyfill

# testing
/coverage
/junit.xml

# production
/build
/dist
/storybook-static
/Maskbook.*.zip

# misc
.DS_Store
Expand All @@ -31,6 +33,9 @@ public/polyfill
# contracts
/contracts

# e2e
/screenshots

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true,
"i18n-ally.sourceLanguage": "en",
"i18n-ally.displayLanguage": "zh",
"i18n-ally.localesPaths": "src/_locales",
Expand Down
3 changes: 0 additions & 3 deletions commitlint.config.js

This file was deleted.

4 changes: 3 additions & 1 deletion config-overrides/manifest.overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ function chromium(manifest) {}
/**
* @param {typeof base} manifest
*/
function WKWebview(manifest) {}
function WKWebview(manifest) {
manifest['iOS-injected-scripts'] = ['js/injected-script.js']
}
function development(manifest, target) {
manifest.key = // ID:jkoeaghipilijlahjplgbfiocjhldnap
'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoz51rhO1w+wD0EKZJEFJaSMkIcIj0qRadfi0tqcl5nbpuJAsafvLe3MaTbW9LhbixTg9PHybO3tlYUFJrZgUuZlEvt2T6SKIu6Rs9e9B3/brNQG3+hCHudbZkq2WG2IzO44dglrs24bRp/pV5oIif0bLuwrzvYsPQ6hgSp+5gc4pg0LEJPLFp01fbORDknWt8suJmEMz7S0O5+u13+34NvxYzUNeLJF9gYrd4zzrAFYITDEYcqr0OMZvVrKz7IkJasER1uJyoGj4gFJeXNGE8y4Sqb150wBju70lKNKlNevWDRJKasG9CjagAD2+BAfqNyltn7KwK7jAyL1w6d6mOwIDAQAB'
Expand Down
16 changes: 16 additions & 0 deletions e2e/dashboard.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
describe('dashboard - setup a account', () => {
beforeAll(async () => {
await page.goto('chrome-extension://jkoeaghipilijlahjplgbfiocjhldnap/index.html')
})

it('render welcome page', async () => {
const setupButton = await page.waitFor('a[href="#/initialize/1s"]')
expect(await setupButton.evaluate(e => e.textContent.toLowerCase())).toBe('set up')
})

it('take a screenshot', async () => {
await page.screenshot({
path: './screenshots/welcome.png',
})
})
})
5 changes: 5 additions & 0 deletions jest-e2e.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const path = require('path')
module.exports = {
preset: 'jest-puppeteer',
testRegex: ['/e2e/.*\\.[jt]sx?$'],
}
16 changes: 16 additions & 0 deletions jest-puppeteer.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const path = require('path')
const extPath = path.join(__dirname, './build')
module.exports = {
launch: {
dumpio: true,
headless: false,
args: [
'--no-sandbox',
'--disable-infobars',
`--disable-extensions-except=${extPath}`,
`--load-extension=${extPath}`,
],
},
browser: 'chromium',
browserContext: 'default',
}
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path')

module.exports = {
testRegex: ['/__tests__/.*\\.[jt]sx?$'],
preset: 'ts-jest',
testEnvironment: 'jest-environment-jsdom-fourteen',
globals: {
Expand All @@ -9,6 +10,7 @@ module.exports = {
},
},
globalSetup: path.join(__dirname, './scripts/jest-global-setup'),
globalTeardown: path.join(__dirname, './scripts/jest-global-teardown'),
setupFiles: [
require.resolve('jest-webextension-mock'),
require.resolve('fake-indexeddb/auto'),
Expand Down
34 changes: 21 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"name": "maskbook",
"version": "1.10.9",
"version": "1.10.10",
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
"build": "webpack --mode production",
"build-ci": "ts-node scripts/ci-build.ts",
"build-storybook": "build-storybook -s public --quiet",
"build:base": "webpack --mode production",
"build:chromium": "webpack --mode production --chromium",
"build:firefox": "webpack --mode production --firefox",
"build:gecko": "webpack --mode production --firefox-gecko",
"build:ios": "webpack --mode production --wk-webview",
"build:e2e": "webpack --mode production --e2e",
"compile:contracts": "./scripts/contracts.sh",
"install": "node scripts/postinstall.js",
"install": "ts-node scripts/postinstall.ts",
"lint": "eslint src/ --ext .ts,.tsx --fix",
"lint:report": "eslint src/ --ext .ts,.tsx --format junit -o reports/junit/eslint-results.xml",
"lint:typecoverage": "type-coverage -p tsconfig_cjs.json --strict --ignore-catch --detail --at-least 98.5",
"lint:typecoverage": "type-coverage --strict --ignore-catch --detail --at-least 98.5",
"start": "webpack-dev-server --mode development",
"start:android": "webpack-dev-server --firefox-android --mode development",
"start:chromium": "webpack-dev-server --chromium --mode development",
Expand All @@ -24,8 +26,9 @@
"start:ios": "webpack-dev-server --wk-webview --mode development",
"storybook": "start-storybook -p 9009 -s public --quiet",
"test": "jest --watch",
"test:ci": "jest --ci --collectCoverage=true --reporters=default --reporters=jest-junit",
"uninstall": "node scripts/postinstall.js"
"test:ci": "jest --ci --collectCoverage=true --reporters=default --reporters=jest-junit -w 1",
"test:e2e": "jest --runInBand --config=jest-e2e.config.js",
"uninstall": "ts-node scripts/postinstall.ts"
},
"husky": {
"hooks": {
Expand All @@ -35,7 +38,7 @@
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
"npm run lint"
"eslint --ext .ts,.tsx --fix"
]
},
"dependencies": {
Expand Down Expand Up @@ -73,13 +76,13 @@
"jsonwebtoken": "^8.5.1",
"jsqr": "^1.2.0",
"lodash-es": "^4.17.11",
"node-stego": "^0.10.0",
"node-stego": "^0.10.1",
"notistack": "^0.9.7",
"openzeppelin-solidity": "^2.4.0",
"pvtsutils": "^1.0.9",
"qrcode": "^1.4.4",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-i18next": "^11.3.2",
"react-router-dom": "^5.0.0",
"react-use": "^13.26.3",
Expand Down Expand Up @@ -115,7 +118,10 @@
"@types/enzyme": "^3.10.5",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/jest": "^25.1.2",
"@typescript-eslint/eslint-plugin": "^2.20.0",
"@typescript-eslint/eslint-plugin": "^2.22.0",
"@types/expect-puppeteer": "^4.4.0",
"@types/jest-environment-puppeteer": "^4.3.1",
"@types/puppeteer": "^2.0.0",
"@typescript-eslint/parser": "^2.19.2",
"asmcrypto.js": "^2.3.2",
"awesome-typescript-loader": "^5.2.1",
Expand All @@ -130,6 +136,7 @@
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react-hooks": "^2.3.0",
"esm": "^3.2.25",
"expect-puppeteer": "^4.4.0",
"fake-indexeddb": "^3.0.0",
"fork-ts-checker-notifier-webpack-plugin": "^2.0.0",
"fork-ts-checker-webpack-plugin": "^4.0.4",
Expand All @@ -139,13 +146,14 @@
"jest-esm-transformer": "^1.0.0",
"jest-junit": "^10.0.0",
"jest-webextension-mock": "^3.5.0",
"jest-puppeteer": "^4.4.0",
"lint-staged": "^10.0.7",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"puppeteer-core": "^2.1.1",
"puppeteer": "^2.1.1",
"react-devtools": "^4.4.0",
"react-docgen-typescript-loader": "^3.6.0",
"react-test-renderer": "^16.12.0",
"react-test-renderer": "^16.13.0",
"storybook-addon-figma": "^0.1.0",
"storybook-addon-i18n": "^5.1.13",
"storybook-addon-material-ui": "^0.9.0-alpha.21",
Expand All @@ -159,7 +167,7 @@
"typechain-target-web3-v1": "^1.0.4",
"typescript": "^3.7.5",
"web-ext": "^4.1.0",
"webpack": "^4.41.6",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.10.3",
"webpack-extension-manifest-plugin": "^0.5.0",
Expand Down
72 changes: 0 additions & 72 deletions scripts/ci-build.js

This file was deleted.

Loading

0 comments on commit 85d73b6

Please sign in to comment.