Skip to content

Commit

Permalink
feat: init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DiRaiks committed Jul 26, 2023
0 parents commit c0ab6a2
Show file tree
Hide file tree
Showing 624 changed files with 36,620 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# generated
/generated

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# git
.git
**/.github

#ide
.vscode

public/runtime/
Dockerfile
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
root = true

[*]
indent_style = space
indent_size = 2
insert_final_newline = true
61 changes: 61 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# https://{NETWORK}.infura.io/v3/{INFURA_API_KEY}
INFURA_API_KEY=

# https://eth-{NETWORK}.alchemyapi.io/v2/{ALCHEMY_API_KEY}
ALCHEMY_API_KEY=

# supported networks for connecting wallet
SUPPORTED_CHAINS=1,4,5

# this chain uses when a wallet is not connected
DEFAULT_CHAIN=1

# api key for ethplorer for token data
ETHPLORER_API_KEY=freekey

# Variables to read/update staking apr stats on cloudflare vk storage
# Not necessary for development
CLOUDFLARE_API_TOKEN=
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_KV_NAMESPACE_ID=

# comma-separated trusted hosts for Content Security Policy
# e.g. http://localhost:PORT for local development
CSP_TRUSTED_HOSTS=https://*.lido.fi

# put "true" enable report only mode for CSP
CSP_REPORT_ONLY=true

# api endpoint for reporting csp violations
CSP_REPORT_URI=https://stake.lido.fi/api/csp-report

# Subgraph endpoint
SUBGRAPH_MAINNET=https://api.thegraph.com/subgraphs/name/lidofinance/lido
SUBGRAPH_ROPSTEN=
SUBGRAPH_RINKEBY=
SUBGRAPH_GOERLI=
SUBGRAPH_KOVAN=
SUBGRAPH_KINTSUGI=

SUBGRAPH_REQUEST_TIMEOUT=5000

# allow some state overrides from browser console for QA
ENABLE_QA_HELPERS=false

REWARDS_BACKEND=http://127.0.0.1:4000

# rate limit
RATE_LIMIT=60
RATE_LIMIT_TIME_FRAME=60

# ETH API
ETH_API_BASE_PATH=

# Withdrawals AI
WQ_API_BASE_PATH=

# Matomo analytics (in future will be MATOMO_HOST)
MATOMO_URL=

# WalletConnect project ID
WALLETCONNECT_PROJECT_ID=
15 changes: 15 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# dependencies
/node_modules
/.pnp

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

/public
46 changes: 46 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "react"],
"rules": {
"prettier/prettier": ["error", {}, { "usePrettierrc": true }],
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react/display-name": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"ignoreRestSiblings": true,
"argsIgnorePattern": "^_"
}
],
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/anchor-is-valid": "off",
"func-style": ["error", "expression"]
},
"settings": {
"react": {
"version": "detect"
}
}
}
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @lidofinance/lido-eth-ui @lidofinance/lido-qa
.github @lidofinance/review-gh-workflows
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
24 changes: 24 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--- If any section below doesn't make sense for your pull request, delete it please. -->

### Description

<!--- Briefly note most valuable changes in what you did and why we need it, even if the task was described in detail in the task tracker. -->

### Demo

<!--- If thee are visual changes, attach a link to a specific section on preview stand / add screenshots / record a [loom](https://www.loom.com/). -->

### Code review notes

<!--- Describe all uncertain decisions you made code-wise, e.g. readability vs performance. -->

### Testing notes

<!--- List all possible edge cases and how to test them. -->

### Checklist:

- [ ] Checked the changes locally.
- [ ] Created / updated analytics events.
- [ ] Created / updated the technical documentation (README.md / [docs](https://docs.lido.fi/) / etc.).
- [ ] Affects / requires changes in other services (Matomo / Sentry / CloudFlare / etc.).
11 changes: 11 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Tests and Checks

on: pull_request

jobs:
security:
uses: lidofinance/linters/.github/workflows/security.yml@master
docker:
uses: lidofinance/linters/.github/workflows/docker.yml@master
actions:
uses: lidofinance/linters/.github/workflows/actions.yml@master
39 changes: 39 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI Dev

on:
workflow_dispatch:
push:
branches:
- develop
paths-ignore:
- ".github/**"
- "test/**"

permissions:
contents: read

jobs:
# test:
# ...

deploy:
runs-on: ubuntu-latest
# needs: test
name: Build and deploy
steps:
- name: Testnet deploy
uses: lidofinance/dispatch-workflow@v1
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TARGET_REPO: "lidofinance/infra-mainnet"
TARGET_WORKFLOW: "deploy_testnet_staking_widget_ts.yaml"
TARGET: "develop"

tests:
needs: deploy
if: ${{ github.event.pull_request.draft == false }}
uses: ./.github/workflows/tests.yml
secrets: inherit
with:
stand_url: https://stake.testnet.fi
27 changes: 27 additions & 0 deletions .github/workflows/ci-preview-demolish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI Preview stand demolish

on:
workflow_dispatch:
pull_request:
types:
[converted_to_draft, closed]
branches-ignore:
- main

permissions: {}

jobs:
deploy:
runs-on: ubuntu-latest
name: Build and deploy
steps:
- name: Preview stand deploying
uses: lidofinance/dispatch-workflow@v1
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TARGET_REPO: "lidofinance/infra-mainnet"
TARGET: ${{ github.head_ref }}
TARGET_WORKFLOW: "preview_stand_demolish.yaml"
INPUTS_REPO_NAME: ${{ github.repository }}
INPUTS_PR_ID: ${{ github.event.pull_request.number }}
77 changes: 77 additions & 0 deletions .github/workflows/ci-preview-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI Preview stand deploy

on:
workflow_dispatch:
inputs:
inventory:
description: inventory to be used for preview stand deploying
default: testnet
required: false
type: choice
options:
- staging-critical
- testnet

pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches-ignore:
- main

permissions:
contents: read
pull-requests: read

jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
name: Build and deploy
outputs:
stand_url: ${{ steps.stand.outputs.url }}
steps:
- uses: lidofinance/gh-find-current-pr@v1
id: pr

- name: Set ref
id: ref
run: echo "short_ref=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Preview stand deploying
uses: lidofinance/dispatch-workflow@v1
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TARGET_REPO: 'lidofinance/infra-mainnet'
TARGET: ${{ github.head_ref || steps.ref.outputs.short_ref }}
TARGET_WORKFLOW: 'preview_stand_deploy.yaml'
INPUTS_REPO_NAME: ${{ github.repository }}
INPUTS_PR_ID: ${{ steps.pr.outputs.number }}
INPUTS_INVENTORY: "${{ inputs.inventory || 'testnet' }}"

- name: Define repo short name
run: echo "short_name=$(echo ${{ github.repository }} | cut -d "/" -f 2)" >> $GITHUB_OUTPUT
id: repo

- name: Define branch hash
run: echo "hash=$(echo "$HEAD_REF" | shasum -a 256 | cut -c -10)" >> $GITHUB_OUTPUT
id: branch
env:
HEAD_REF: ${{ github.head_ref || steps.ref.outputs.short_ref }}

- name: Extract stand url
if: always()
run: echo "url=https://$SHORT_NAME-$BRANCH_HASH.branch-preview.org" >> $GITHUB_OUTPUT
id: stand
env:
SHORT_NAME: ${{ steps.repo.outputs.short_name }}
BRANCH_HASH: ${{ steps.branch.outputs.hash }}

# tests:
# needs: deploy
# if: ${{ github.event.pull_request.draft == false }}
# uses: ./.github/workflows/tests.yml
# secrets: inherit
# with:
# stand_url: ${{ needs.deploy.outputs.stand_url }}
# stand_type: "${{ inputs.inventory || 'testnet' }}"
# on_preview_stand: true
Loading

0 comments on commit c0ab6a2

Please sign in to comment.