Skip to content

Commit

Permalink
Merge branch 'hardware-wallets-referral-and-tutorial-links' of https:…
Browse files Browse the repository at this point in the history
…//github.com/MetaMask/metamask-extension into hardware-wallets-referral-and-tutorial-links
  • Loading branch information
AlexJupiter committed Jul 27, 2022
2 parents d511ae1 + aeac17f commit 416abd7
Show file tree
Hide file tree
Showing 679 changed files with 34,043 additions and 10,096 deletions.
78 changes: 71 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ version: 2.1
executors:
node-browsers:
docker:
- image: circleci/node:14-browsers
- image: circleci/node:16-browsers
node-browsers-medium-plus:
docker:
- image: circleci/node:14-browsers
- image: circleci/node:16-browsers
resource_class: medium+
environment:
NODE_OPTIONS: --max_old_space_size=2048
Expand Down Expand Up @@ -53,6 +53,9 @@ workflows:
- prep-build-test:
requires:
- prep-deps
- prep-build-test-mv3:
requires:
- prep-deps
- prep-build-test-flask:
requires:
- prep-deps
Expand Down Expand Up @@ -133,14 +136,19 @@ workflows:
- benchmark:
requires:
- prep-build-test
- stats-module-load-init:
requires:
- prep-build-test-mv3
- job-publish-prerelease:
requires:
- prep-deps
- prep-build
- prep-build-beta
- prep-build-flask
- prep-build-storybook
- prep-build-test-mv3
- benchmark
- stats-module-load-init
- all-tests-pass
- job-publish-release:
filters:
Expand Down Expand Up @@ -200,8 +208,8 @@ jobs:
- persist_to_workspace:
root: .
paths:
- node_modules
- build-artifacts
- node_modules
- build-artifacts

validate-lavamoat-config:
executor: node-browsers-medium-plus
Expand Down Expand Up @@ -305,6 +313,26 @@ jobs:
- dist-test-flask
- builds-test-flask

prep-build-test-mv3:
executor: node-browsers-medium-plus
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Build extension in mv3 for testing
command: yarn build:test:mv3
- run:
name: Move test build to 'dist-test' to avoid conflict with production build
command: mv ./dist ./dist-test-mv3
- run:
name: Move test zips to 'builds-test' to avoid conflict with production build
command: mv ./builds ./builds-test-mv3
- persist_to_workspace:
root: .
paths:
- dist-test-mv3
- builds-test-mv3

prep-build-test:
executor: node-browsers-medium-plus
Expand Down Expand Up @@ -419,7 +447,6 @@ jobs:
name: Validate release candidate changelog
command: yarn lint:changelog:rc


test-deps-audit:
executor: node-browsers
steps:
Expand Down Expand Up @@ -574,6 +601,43 @@ jobs:
paths:
- test-artifacts

stats-module-load-init:
executor: node-browsers-medium-plus
steps:
- checkout
- run:
name: Re-Install Chrome
command: ./.circleci/scripts/chrome-install.sh
- attach_workspace:
at: .
- run:
name: Move test build to dist
command: mv ./dist-test-mv3 ./dist
- run:
name: Move test zips to builds
command: mv ./builds-test-mv3 ./builds
- run:
name: Run page load benchmark
command: |
mkdir -p test-artifacts/chrome/mv3
cp -R development/charts/flamegraph test-artifacts/chrome/mv3/initialisation
cp -R development/charts/flamegraph/chart test-artifacts/chrome/mv3/initialisation/background
cp -R development/charts/flamegraph/chart test-artifacts/chrome/mv3/initialisation/ui
cp -R development/charts/table test-artifacts/chrome/mv3/load_time
- run:
name: Run page load benchmark
command: yarn mv3:stats:chrome --out test-artifacts/chrome/mv3
- run:
name: Record bundle size at commit
command: ./.circleci/scripts/bundle-stats-commit.sh
- store_artifacts:
path: test-artifacts
destination: test-artifacts
- persist_to_workspace:
root: .
paths:
- test-artifacts

job-publish-prerelease:
executor: node-browsers
steps:
Expand Down Expand Up @@ -648,7 +712,7 @@ jobs:
steps:
- add_ssh_keys:
fingerprints:
- "3d:49:29:f4:b2:e8:ea:af:d1:32:eb:2a:fc:15:85:d8"
- '3d:49:29:f4:b2:e8:ea:af:d1:32:eb:2a:fc:15:85:d8'
- checkout
- attach_workspace:
at: .
Expand All @@ -670,7 +734,7 @@ jobs:
- run:
name: test:coverage:jest
command: yarn test:coverage:jest
- run:
- run:
name: Validate coverage thresholds
command: |
if ! git diff --exit-code jest.config.js development/jest.config.js; then
Expand Down
70 changes: 70 additions & 0 deletions .circleci/scripts/bundle-stats-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash

set -e
set -u
set -o pipefail

if [[ "${CI:-}" != 'true' ]]
then
printf '%s\n' 'CI environment variable must be set to true'
exit 1
fi

if [[ "${CIRCLECI:-}" != 'true' ]]
then
printf '%s\n' 'CIRCLECI environment variable must be set to true'
exit 1
fi

if [[ -z "${GITHUB_TOKEN:-}" ]]
then
printf '%s\n' 'GITHUB_TOKEN environment variable must be set'
exit 1
elif [[ -z "${GITHUB_TOKEN_USER:-}" ]]
then
printf '%s\n' 'GITHUB_TOKEN_USER environment variable must be set'
exit 1
fi

printf '%s\n' 'Commit the manifest version and changelog if the manifest has changed'

if [[ "${CIRCLE_BRANCH}" != "develop" ]]
then
printf 'This is not develop branch'
exit 0
fi

mkdir temp

git config --global user.email "[email protected]"

git config --global user.name "MetaMask Bot"

git clone [email protected]:MetaMask/extension_bundlesize_stats.git temp

if [[ -f "temp/stats/bundle_size_stats-${CIRCLE_SHA1}.json" ]]
then
printf 'Bundle size of the commit is already recorded'
cd ..
rm -rf temp
exit 0
fi

cp -R test-artifacts/chrome/mv3/bundle_size.json temp/stats

echo " bundle_size_stats-${CIRCLE_SHA1}.json" >> temp/stats/fileList.txt

mv temp/stats/bundle_size.json "temp/stats/bundle_size_stats-${CIRCLE_SHA1}.json"

cd temp

git add .

git commit --message "Bundle size at commit: ${CIRCLE_SHA1}"

repo_slug="$CIRCLE_PROJECT_USERNAME/extension_bundlesize_stats"
git push "https://$GITHUB_TOKEN_USER:$GITHUB_TOKEN@github.com/$repo_slug" main

cd ..

rm -rf temp
4 changes: 2 additions & 2 deletions .circleci/scripts/chrome-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ set -u
set -o pipefail

# To get the latest version, see <https://www.ubuntuupdates.org/ppa/google_chrome?dist=stable>
CHROME_VERSION='101.0.4951.54-1'
CHROME_VERSION='103.0.5060.53-1'
CHROME_BINARY="google-chrome-stable_${CHROME_VERSION}_amd64.deb"
CHROME_BINARY_URL="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/${CHROME_BINARY}"

# To retrieve this checksum, run the `wget` and `shasum` commands below
CHROME_BINARY_SHA512SUM='46ebc53c806f179a5f9ab570c1097c2d35fc437dd4f5bd3fb34e758dc4f306771ceb05f8df7d450584355abf35bae34c0e70903e4f0312e2d3caa34491c8f622'
CHROME_BINARY_SHA512SUM='36f4e79f46cb71c1431dccf1489f5f8e89d35204a717a4618c7f6f638123ddc2b37bd5cbd00498be8f84c7713149f2faa447cb6da3518be1cb9703e99d110e1a'

wget -O "${CHROME_BINARY}" -t 5 "${CHROME_BINARY_URL}"

Expand Down
2 changes: 1 addition & 1 deletion .circleci/scripts/firefox-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
set -u
set -o pipefail

FIREFOX_VERSION='83.0'
FIREFOX_VERSION='102.0'
FIREFOX_BINARY="firefox-${FIREFOX_VERSION}.tar.bz2"
FIREFOX_BINARY_URL="https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/${FIREFOX_BINARY}"
FIREFOX_PATH='/opt/firefox'
Expand Down
1 change: 1 addition & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ignores:
# used in testing + ci
- '@metamask/auto-changelog' # invoked as `auto-changelog`
- '@metamask/forwarder'
- '@metamask/phishing-warning' # statically hosted as part of some e2e tests
- '@metamask/test-dapp'
- '@metamask/design-tokens' # Only imported in index.css
- '@tsconfig/node14' # required dynamically by TS, used in tsconfig.json
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'app/vendor/**',
'builds/**/*',
'development/chromereload.js',
'development/charts/**',
'dist/**/*',
'node_modules/**/*',
],
Expand Down
7 changes: 5 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ How should reviewers and QA manually test your changes? For instance:
## Pre-Merge Checklist

- [ ] PR template is filled out
- [ ] Manual testing complete & passed
- [ ] **IF** this PR fixes a bug, a test that _would have_ caught the bug has been added
- [ ] PR is linked to the appropriate GitHub issue
- [ ] **IF** QA attention is required, "QA Board" label has been applied
- [ ] PR has been added to the appropriate release Milestone

### + If there are functional changes:

- [ ] Manual testing complete & passed
- [ ] "Extension QA Board" label has been applied
3 changes: 2 additions & 1 deletion .iyarc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# improved-yarn-audit advisory exclusions
GHSA-93q8-gq69-wqmw
GHSA-257v-vj4p-3w2h
GHSA-fwr7-v2mv-hh25
GHSA-wm7h-9275-46v2
GHSA-pfrx-2q88-qq97
3 changes: 3 additions & 0 deletions .metamaskrc.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ ONBOARDING_V2=
SWAPS_USE_DEV_APIS=
COLLECTIBLES_V1=
TOKEN_DETECTION_V2=

; Set this to test changes to the phishing warning page.
PHISHING_WARNING_PAGE_URL=
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14
v16
2 changes: 1 addition & 1 deletion .storybook/1.INTRODUCTION.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Welcome to the MetaMask Browser Extension Storybook.

## Building locally and Contributing

This document is currently only specific to storybook best practices and component documentation guidelines. This may change in future but for now if you are looking to get a local build of Metamask up and running or contribute to the extension codebase please read the Metamask [README.md](https://github.com/MetaMask/metamask-extension)
This document is currently only specific to storybook best practices and component documentation guidelines. This may change in future but for now if you are looking to get a local build of MetaMask up and running or contribute to the extension codebase please read the MetaMask [README.md](https://github.com/MetaMask/metamask-extension)

## Documentation Guidelines

Expand Down
39 changes: 16 additions & 23 deletions .storybook/3.COLORS.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import { Meta } from '@storybook/addon-docs';
import ActionaleMessage from '../ui/components/ui/actionable-message';
import designTokenDiagramImage from './images/design.token.graphic.svg';

<Meta title="Design Tokens / Color" />
<Meta title="Foundations / Color" />

# Color

Color is used to express style and communicate meaning.

<ActionaleMessage
type="warning"
message="We are in the process of consolidating all of our colors, making them accessible and enabling theming. Many of the colors used throughout the codebase are deprecated please follow the guide below to ensure you are using the correct colors when building MetaMask UI"
/>

<br />

## Design tokens

We are importing design tokens as CSS variables from [@metamask/design-tokens](https://github.com/MetaMask/design-tokens) repo to help consolidate colors and enable theming across all MetaMask products.
Expand Down Expand Up @@ -67,6 +59,7 @@ var(--color-text-muted)

/** Icons */
var(--color-icon-default)
var(--color-icon-alternative)
var(--color-icon-muted)

/** Borders */
Expand All @@ -75,49 +68,49 @@ var(--color-border-muted)

/** Overlays */
var(--color-overlay-default)
var(--color-overlay-inverse)
var(--color-overlay-inverse) [DEPRECATED]

/** User Actions */
var(--color-primary-default)
var(--color-primary-alternative)
var(--color-primary-muted)
var(--color-primary-inverse)
var(--color-primary-disabled)
var(--color-primary-disabled) [DEPRECATED]

var(--color-secondary-default)
var(--color-secondary-alternative)
var(--color-secondary-muted)
var(--color-secondary-inverse)
var(--color-secondary-disabled)
var(--color-secondary-default) [DEPRECATED]
var(--color-secondary-alternative) [DEPRECATED]
var(--color-secondary-muted) [DEPRECATED]
var(--color-secondary-inverse) [DEPRECATED]
var(--color-secondary-disabled) [DEPRECATED]

/** States */
/** Error */
var(--color-error-default)
var(--color-error-alternative)
var(--color-error-muted)
var(--color-error-inverse)
var(--color-error-disabled)
var(--color-error-disabled) [DEPRECATED]

/** Warning */
var(--color-warning-default)
var(--color-warning-alternative)
var(--color-warning-alternative) [DEPRECATED]
var(--color-warning-muted)
var(--color-warning-inverse)
var(--color-warning-disabled)
var(--color-warning-disabled) [DEPRECATED]

/** Success */
var(--color-success-default)
var(--color-success-alternative)
var(--color-success-alternative) [DEPRECATED]
var(--color-success-muted)
var(--color-success-inverse)
var(--color-success-disabled)
var(--color-success-disabled) [DEPRECATED]

/** Info */
var(--color-info-default)
var(--color-info-alternative)
var(--color-info-alternative) [DEPRECATED]
var(--color-info-muted)
var(--color-info-inverse)
var(--color-info-disabled)
var(--color-info-disabled) [DEPRECATED]
```

### **Component colors** (tier 3)
Expand Down
Loading

0 comments on commit 416abd7

Please sign in to comment.