Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .depcheckrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"ignorePatterns": ["templates/**"],
"ignores": [
"@lavamoat/allow-scripts",
"@lavamoat/preinstall-always-fail",
"@metamask/auto-changelog",
"@metamask/eslint-config",
"@metamask/eslint-config-*",
"@types/*",
"@typescript-eslint/utils",
"@vitest/coverage-istanbul",
"@vitest/eslint-plugin",
"@yarnpkg/types",
"eslint-config-*",
"eslint-import-resolver-typescript",
"eslint-plugin-*",
"prettier-plugin-packagejson",
"ts-node",
"typedoc",
"typescript-eslint",
"vite"
]
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ yarn.lock linguist-generated=false
# yarn v3
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
/.yarn/releases/** binary
/.yarn/plugins/** binary
/.yarn/plugins/** binary
26 changes: 13 additions & 13 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: For new features
title: ''
labels: ''
assignees: ''

---

### **Description**
Expand All @@ -13,27 +12,28 @@ Describe the task. What does this aim to implement?

### **Technical Details**

- Implementation details
- Insight to what needs to be done
- Etc.
- Implementation details
- Insight to what needs to be done
- Etc.

### **Acceptance Criteria**

- Are metrics required?
- Are translations required?
- Cases to satisfy
- XYZ should work
- Etc.
- Are metrics required?
- Are translations required?
- Cases to satisfy
- XYZ should work
- Etc.

Scenario: xxxx

- GIVEN a user is in x state
- WHEN a user does x
- AND a user does x
- THEN x should occur

### **References**

- References go here.
- Issue numbers. Links.
- Slack threads.
- Etc.
- References go here.
- Issue numbers. Links.
- Slack threads.
- Etc.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,14 @@ updates:
target-branch: 'main'
versioning-strategy: 'increase-if-necessary'
open-pull-requests-limit: 10

- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
time: '06:00'
allow:
- dependency-name: 'MetaMask/*'
- dependency-name: 'actions/*'
target-branch: 'main'
open-pull-requests-limit: 10
25 changes: 13 additions & 12 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@ Describe the task. What does this aim to implement?

### **Technical Details**

- Implementation details
- Insight to what needs to be done
- Etc.
- Implementation details
- Insight to what needs to be done
- Etc.

### **Acceptance Criteria**

- Are metrics required?
- Are translations required?
- Cases to satisfy
- XYZ should work
- Etc.
- Are metrics required?
- Are translations required?
- Cases to satisfy
- XYZ should work
- Etc.

Scenario: xxxx

- GIVEN a user is in x state
- WHEN a user does x
- AND a user does x
- THEN x should occur

### **References**

- References go here.
- Issue numbers. Links.
- Slack threads.
- Etc.
- References go here.
- Issue numbers. Links.
- Slack threads.
- Etc.
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
### **What?**

-
-

### **Why?**

-
-

### **How?**

-
-
120 changes: 92 additions & 28 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,116 @@ name: Build, Lint, and Test

on:
workflow_call:
inputs:
NPM_REGISTRY_NAME:
type: string
default: '@metamask'
NPM_REGISTRY_URL:
type: string
required: false
default: 'https://registry.npmjs.org'
NPM_CLIENT:
type: string
default: 'yarn'

jobs:
pipeline:
name: Turbo Pipeline
prepare:
name: Prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 22.x]
node-version: [20.x, 22.x, 24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
uses: MetaMask/action-checkout-and-setup@v2
with:
is-high-risk-environment: false
cache-node-modules: ${{ matrix.node-version == '22.x' }}
submodules: 'recursive'
node-version: ${{ matrix.node-version }}
cache-node-modules: ${{ matrix.node-version == '24.x' }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
build:
name: Build
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v2
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn build
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi

- name: Install npm dependencies
run: yarn install
lint:
name: Lint
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v2
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
- run: yarn lint
- name: Validate RC changelog
if: ${{ startsWith(github.head_ref, 'release/') }}
run: yarn lint:changelog --rc
- name: Validate changelog
if: ${{ !startsWith(github.head_ref, 'release/') }}
run: yarn lint:changelog
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi

- name: Run build
run: yarn build
test:
name: Test
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v2
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
- run: yarn test
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi

- name: Run lint
run: yarn lint

compatibility-test:
name: Compatibility test
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v2
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
- name: Install dependencies via Yarn
run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
- run: yarn test
- name: Restore lockfile
run: git restore yarn.lock
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi
fi
36 changes: 36 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Create Release Pull Request

on:
workflow_dispatch:
inputs:
base-branch:
description: 'The base branch for git operations and the pull request.'
default: 'main'
required: true
release-type:
description: 'A SemVer version diff, i.e. major, minor, or patch. Mutually exclusive with "release-version".'
required: false
release-version:
description: 'A specific version to bump to. Mutually exclusive with "release-type".'
required: false

jobs:
create-release-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v2
with:
is-high-risk-environment: true
fetch-depth: 0
ref: ${{ github.event.inputs.base-branch }}

- uses: MetaMask/action-create-release-pr@v4
with:
release-type: ${{ github.event.inputs.release-type }}
release-version: ${{ github.event.inputs.release-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading