generated from MetaMask/template-snap-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 24a85c4
Showing
70 changed files
with
25,936 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
|
||
extends: ['@metamask/eslint-config'], | ||
|
||
overrides: [ | ||
{ | ||
files: ['**/*.js'], | ||
extends: ['@metamask/eslint-config-nodejs'], | ||
}, | ||
|
||
{ | ||
files: ['**/*.{ts,tsx}'], | ||
extends: ['@metamask/eslint-config-typescript'], | ||
rules: { | ||
'@typescript-eslint/consistent-type-definitions': ['error', 'type'], | ||
}, | ||
}, | ||
|
||
{ | ||
files: ['**/*.test.ts', '**/*.test.js'], | ||
extends: ['@metamask/eslint-config-jest'], | ||
rules: { | ||
'@typescript-eslint/no-shadow': [ | ||
'error', | ||
{ allow: ['describe', 'expect', 'it'] }, | ||
], | ||
}, | ||
}, | ||
], | ||
|
||
ignorePatterns: [ | ||
'!.prettierrc.js', | ||
'**/!.eslintrc.js', | ||
'**/dist*/', | ||
'**/*__GENERATED__*', | ||
'**/build', | ||
'**/public', | ||
'**/.cache', | ||
], | ||
}; |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Lines starting with '#' are comments. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
* @MetaMask/snaps-devs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Build, Lint, and Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
jobs: | ||
build-lint-test: | ||
name: Build, Lint, and Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'yarn' | ||
- run: yarn install --immutable | ||
- run: yarn build | ||
- run: yarn lint | ||
- run: yarn test | ||
- name: Cache snap build | ||
if: ${{ matrix.node-version == '18.x' }} | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./packages/snap/dist | ||
key: snap-${{ runner.os }}-${{ github.sha }} | ||
- name: Require clean working directory | ||
shell: bash | ||
run: | | ||
if ! git diff --exit-code; then | ||
echo "Working tree dirty after building" | ||
exit 1 | ||
fi | ||
e2e: | ||
name: End-to-end Tests | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-lint-test | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
- name: Restore snap build cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./packages/snap/dist | ||
key: snap-${{ runner.os }}-${{ github.sha }} | ||
- run: yarn install --immutable | ||
- name: Install Google Chrome | ||
run: yarn install-chrome | ||
- name: Run e2e tests | ||
run: yarn workspace snap run test | ||
|
||
all-jobs-pass: | ||
name: All jobs pass | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-lint-test | ||
- e2e | ||
steps: | ||
- run: echo "Great success!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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, patch, prerelease etc. 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: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# This is to guarantee that the most recent tag is fetched. | ||
# This can be configured to a more reasonable value by consumers. | ||
fetch-depth: 0 | ||
# We check out the specified branch, which will be used as the base | ||
# branch for all git operations and the release PR. | ||
ref: ${{ github.event.inputs.base-branch }} | ||
- name: Get Node.js version | ||
id: nvm | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvm.outputs.NODE_VERSION }} | ||
- uses: MetaMask/action-create-release-pr@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
release-type: ${{ github.event.inputs.release-type }} | ||
release-version: ${{ github.event.inputs.release-version }} | ||
artifacts-path: gh-action__release-authors | ||
# Upload the release author artifact for use in subsequent workflows | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: release-authors | ||
path: gh-action__release-authors | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Publish Release | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
publish-release: | ||
permissions: | ||
contents: write | ||
if: | | ||
github.event.pull_request.merged == true && | ||
startsWith(github.event.pull_request.head.ref, 'release/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# We check out the release pull request's base branch, which will be | ||
# used as the base branch for all git operations. | ||
ref: ${{ github.event.pull_request.base.ref }} | ||
- name: Get Node.js version | ||
id: nvm | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvm.outputs.NODE_VERSION }} | ||
- uses: MetaMask/action-publish-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Get Yarn cache directory | ||
run: echo "::set-output name=YARN_CACHE_DIR::$(yarn cache dir)" | ||
id: yarn-cache-dir | ||
- name: Get Yarn version | ||
run: echo "::set-output name=YARN_VERSION::$(yarn --version)" | ||
id: yarn-version | ||
- name: Cache yarn dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }} | ||
key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }} | ||
- run: yarn install --immutable | ||
- run: yarn build:site | ||
- name: Publish to GitHub Pages | ||
uses: MetaMask/action-publish-gh-pages@v2 | ||
with: | ||
source-directory: packages/site/public | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
.DS_Store | ||
dist/ | ||
build/ | ||
coverage/ | ||
.cache/ | ||
public/ | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// All of these are defaults except singleQuote, but we specify them | ||
// for explicitness | ||
module.exports = { | ||
quoteProps: 'as-needed', | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'all', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"json.schemas": [ | ||
{ | ||
"fileMatch": ["snap.manifest.json"], | ||
"url": "https://raw.githubusercontent.com/MetaMask/SIPs/main/assets/sip-9/snap.manifest.schema.json" | ||
} | ||
] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.