Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Commit 99d028d

Browse files
Dependencies upgrade and module template sync (#601)
* initial use of npx @metamask/template-sync but removing and adding some missing configurations * rmeoving publish-docs workflow and references * auto lint fixes by running lint:fix * more lint fixes and ignores * running lint:fix adding fixes to changelog and package.json * adding incorrectly labelled missing dependencies and unused dependcies to depcheckrc * updating build-deploy-storybook and yarn.lock file * adding doc to tsconfig.json * reverting test coverage so it ignores index files and colors.ts * removing instance of unused typedoc from depcheckrc * fixing incorrect storybook build command * adjusting pr template to align with extension and mobile * updating build-deploy-storybook workflow as per suggestions * updating main.yml as per suggestion * integrating build-deploy-storybook into the main workflow and removing get-release-version as it's not needed as per suggestion * fixing instance of PUBLISH_DOCS_TOKEN with storybook token
1 parent 27dd45a commit 99d028d

Some content is hidden

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

49 files changed

+17288
-11920
lines changed

.depcheckrc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"ignores": [
3+
"@lavamoat/allow-scripts",
4+
"@lavamoat/preinstall-always-fail",
5+
"@metamask/auto-changelog",
6+
"@types/*",
7+
"prettier-plugin-packagejson",
8+
"ts-node",
9+
"@storybook/addon-actions",
10+
"@storybook/react-webpack5",
11+
"babel-loader",
12+
"dependency-tree",
13+
"eslint-plugin-node",
14+
"sass",
15+
"webpack",
16+
"@yarnpkg/core",
17+
"@yarnpkg/cli",
18+
"clipanion",
19+
"@yarnpkg/fslib"
20+
]
21+
}

.eslintrc.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
11
module.exports = {
22
root: true,
3+
34
extends: ['@metamask/eslint-config', 'plugin:storybook/recommended'],
5+
46
overrides: [
57
{
68
files: ['*.ts'],
79
extends: ['@metamask/eslint-config-typescript'],
810
},
11+
912
{
1013
files: ['*.js'],
1114
parserOptions: {
1215
sourceType: 'script',
1316
},
1417
extends: ['@metamask/eslint-config-nodejs'],
1518
},
19+
1620
{
1721
files: ['*.test.ts', '*.test.js'],
18-
extends: ['@metamask/eslint-config-jest'],
22+
extends: [
23+
'@metamask/eslint-config-jest',
24+
'@metamask/eslint-config-nodejs',
25+
],
1926
},
2027
],
28+
2129
ignorePatterns: [
2230
'!.eslintrc.js',
2331
'!.prettierrc.js',
2432
'dist/',
2533
'storybook-static/',
34+
'.yarn/',
35+
'docs/utils/getCSSVariablesFromStylesheet.ts',
2636
],
2737
};

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
* text=auto
22

33
yarn.lock linguist-generated=false
4+
5+
# yarn v3
6+
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
7+
/.yarn/releases/** binary
8+
/.yarn/plugins/** binary

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Lines starting with '#' are comments.
22
# Each line is a file pattern followed by one or more owners.
33

4-
* @MetaMask/devs
4+
* @MetaMask/engineering

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Please see the documentation for all configuration options:
2-
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
33

44
version: 2
55
updates:

.github/pull_request_template.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## **Description**
2+
3+
<!--
4+
Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions:
5+
1. What is the reason for the change?
6+
2. What is the improvement/solution?
7+
-->
8+
9+
## **Related issues**
10+
11+
Fixes:
12+
13+
## **Manual testing steps**
14+
15+
1. Go to this page...
16+
2.
17+
3.
18+
19+
## **Screenshots/Recordings**
20+
21+
<!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. -->
22+
23+
### **Before**
24+
25+
<!-- [screenshots/recordings] -->
26+
27+
### **After**
28+
29+
<!-- [screenshots/recordings] -->
30+
31+
## **Pre-merge author checklist**
32+
33+
- [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
34+
- [ ] I've clearly explained what problem this PR is solving and how it is solved.
35+
- [ ] I've linked related issues
36+
- [ ] I've included manual testing steps
37+
- [ ] I've included screenshots/recordings if applicable
38+
- [ ] I’ve included tests if applicable
39+
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable
40+
- [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors.
41+
- [ ] I’ve properly set the pull request status:
42+
- [ ] In case it's not yet "ready for review", I've set it to "draft".
43+
- [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft".
44+
45+
## **Pre-merge reviewer checklist**
46+
47+
- [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
48+
- [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
name: Build and Deploy Storybook
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_call:
5+
secrets:
6+
PUBLISH_STORYBOOK_TOKEN:
7+
required: true
78

89
jobs:
910
build-deploy-storybook:
1011
permissions:
1112
contents: write
1213
runs-on: ubuntu-latest
14+
environment: github-pages
1315
steps:
14-
- uses: actions/checkout@v2
16+
- name: Checkout the repository
17+
uses: actions/checkout@v3
18+
- name: Use Node.js
19+
uses: actions/setup-node@v3
1520
with:
16-
# We check out the pull request's base branch, which will be
17-
# used as the base branch for all git operations.
18-
ref: ${{ github.event.pull_request.base.ref }}
19-
- name: Get Node.js version
20-
id: nvm
21-
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
22-
- uses: actions/setup-node@v2
21+
node-version-file: '.nvmrc'
22+
cache: 'yarn'
23+
- name: Install npm dependencies
24+
run: yarn --immutable
25+
- name: Run build script
26+
run: yarn build-storybook
27+
- name: Deploy to `storybook-static` directory of `gh-pages` branch
28+
uses: peaceiris/actions-gh-pages@de7ea6f8efb354206b205ef54722213d99067935
2329
with:
24-
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
25-
- run: yarn
26-
- uses: MetaMask/action-publish-gh-pages@v2
27-
with:
28-
build-command: build-storybook
29-
source-directory: storybook-static
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
# This PUBLISH_STORYBOOK_TOKEN needs to be manually set per-repository.
31+
# Look in the repository settings under "Environments", and set this token in the github-pages environment.
32+
personal_token: ${{ secrets.PUBLISH_STORYBOOK_TOKEN }}
33+
publish_dir: ./storybook-static
34+
destination_dir: storybook-static
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Build, Lint, and Test
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
prepare:
8+
name: Prepare
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Use Node.js
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version-file: '.nvmrc'
16+
cache: 'yarn'
17+
- name: Install Yarn dependencies
18+
run: yarn --immutable
19+
20+
build:
21+
name: Build
22+
runs-on: ubuntu-latest
23+
needs:
24+
- prepare
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Use Node.js
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version-file: '.nvmrc'
31+
cache: 'yarn'
32+
- run: yarn --immutable --immutable-cache
33+
- run: yarn build
34+
- name: Require clean working directory
35+
shell: bash
36+
run: |
37+
if ! git diff --exit-code; then
38+
echo "Working tree dirty at end of job"
39+
exit 1
40+
fi
41+
42+
lint:
43+
name: Lint
44+
runs-on: ubuntu-latest
45+
needs:
46+
- prepare
47+
steps:
48+
- uses: actions/checkout@v3
49+
- name: Use Node.js
50+
uses: actions/setup-node@v3
51+
with:
52+
node-version-file: '.nvmrc'
53+
cache: 'yarn'
54+
- run: yarn --immutable --immutable-cache
55+
- run: yarn lint
56+
- name: Validate RC changelog
57+
if: ${{ startsWith(github.head_ref, 'release/') }}
58+
run: yarn lint:changelog --rc
59+
- name: Validate changelog
60+
if: ${{ !startsWith(github.head_ref, 'release/') }}
61+
run: yarn lint:changelog
62+
- name: Require clean working directory
63+
shell: bash
64+
run: |
65+
if ! git diff --exit-code; then
66+
echo "Working tree dirty at end of job"
67+
exit 1
68+
fi
69+
70+
test:
71+
name: Test
72+
runs-on: ubuntu-latest
73+
needs:
74+
- prepare
75+
strategy:
76+
matrix:
77+
node-version: [18.x, 20.x]
78+
steps:
79+
- uses: actions/checkout@v3
80+
- name: Use Node.js ${{ matrix.node-version }}
81+
uses: actions/setup-node@v3
82+
with:
83+
node-version: ${{ matrix.node-version }}
84+
cache: 'yarn'
85+
- run: yarn --immutable --immutable-cache
86+
- run: yarn test
87+
- name: Require clean working directory
88+
shell: bash
89+
run: |
90+
if ! git diff --exit-code; then
91+
echo "Working tree dirty at end of job"
92+
exit 1
93+
fi
94+
95+
compatibility-test:
96+
name: Compatibility test
97+
runs-on: ubuntu-latest
98+
needs:
99+
- prepare
100+
strategy:
101+
matrix:
102+
node-version: [18.x, 20.x]
103+
steps:
104+
- uses: actions/checkout@v3
105+
- name: Use Node.js ${{ matrix.node-version }}
106+
uses: actions/setup-node@v3
107+
with:
108+
node-version: ${{ matrix.node-version }}
109+
cache: 'yarn'
110+
- run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
111+
- run: yarn test
112+
- name: Require clean working directory
113+
shell: bash
114+
run: |
115+
git restore yarn.lock
116+
if ! git diff --exit-code; then
117+
echo "Working tree dirty at end of job"
118+
exit 1
119+
fi

.github/workflows/build-test.yml

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

0 commit comments

Comments
 (0)