Skip to content

Commit

Permalink
Merge branch 'develop' into feat/upgrade-wallet-package
Browse files Browse the repository at this point in the history
  • Loading branch information
karczuRF committed Dec 9, 2022
2 parents fa00075 + 5bb78f0 commit 3cdd4f7
Show file tree
Hide file tree
Showing 244 changed files with 8,633 additions and 4,015 deletions.
11 changes: 6 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
# https://docs.github.com/en/code-security/dependabot

version: 2
updates:
Expand All @@ -11,13 +11,14 @@ updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'monthly'
interval: 'weekly'
versioning-strategy: increase
open-pull-requests-limit: 50
labels:
- 'npm'
- 'dependencies'
- 'npm dependencies'
reviewers:
- 'niemam29'
- 'MilanVojnovic95'
- 'wixzi'
ignore:
- dependency-name: '*'
update-types: ['version-update:semver-patch']
53 changes: 38 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ jobs:
id: check-if-cypress-tests-should-run
continue-on-error: true
with:
one_of: ready-for-tests, QA
one_of: ready-for-tests,QA
repo_token: ${{ secrets.GITHUB_TOKEN }}

- uses: docker://agilepathway/pull-request-label-checker:latest
id: check-if-synpress-tests-should-run
continue-on-error: true
with:
one_of: ready-for-synpress-tests, QA
one_of: ready-for-synpress-tests,QA
repo_token: ${{ secrets.GITHUB_TOKEN }}

- name: Check if cypress label is present
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
if: ${{ !(github.event_name == 'schedule' || github.actor == 'dependabot[bot]') }}
steps:
- name: Inject slug variables
uses: rlespinasse/github-slug-action@4.2.5
uses: rlespinasse/github-slug-action@v4.3.0

- name: 📥 ・Download workspace artifact
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -354,29 +354,52 @@ jobs:
cypress:
name: 🎡 ・Cypress (${{ matrix.containers }})
needs: [install, prepare]
needs: [prepare]
runs-on: ubuntu-20.04
container: swapr/cypress:zstd
if: ${{ needs.prepare.outputs.cypress }}
strategy:
fail-fast: false
matrix:
containers: [Container01, Container02, Container03, Container04]
steps:
- name: 📥 ・Download workspace artifact
uses: actions/download-artifact@v3
- name: ⬇️ ・Checkout repo
uses: actions/checkout@v3
with:
name: workspace
fetch-depth: '50'

- name: Extract workspace artifact
run: tar --extract --use-compress-program='zstd -d' --file=workspace.tar.zst
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
check-latest: true
cache: 'yarn'

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Install dependencies
run: yarn install --frozen-lockfile --cache-folder $(yarn cache dir)

- name: Generate open-api
run: yarn codegen:socket

- name: Codegen socket
run: yarn codegen:socket

- name: Codegen GraphQl
run: yarn codegen:graphql

- name: Install dependencies
run: yarn install --frozen-lockfile --cache-folder $(yarn cache dir)

- name: Verify Cypress
run: yarn cypress install && yarn cypress verify
run: yarn cypress install

- name: Run cypress tests
if: ${{ !(github.event_name == 'push') }}
run: yarn cypress:ci './node_modules/.bin/cypress run -r mochawesome --record --group electron --key=${{ secrets.CYPRESS_DASHBOARD_KEY }} --parallel --tag TESTS_FROM_PR --ci-build-id=${{ needs.prepare.outputs.uuid }}'
run: yarn cypress:ci 'yarn cypress run -r mochawesome --record --group electron --key=${{ secrets.CYPRESS_DASHBOARD_KEY }} --parallel --tag TESTS_FROM_PR --ci-build-id=${{ needs.prepare.outputs.uuid }}'
continue-on-error: true
env:
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
Expand Down Expand Up @@ -466,7 +489,7 @@ jobs:
retention-days: 3

- name: Delete merged artifacts
uses: geekyeggo/delete-artifact@v1
uses: geekyeggo/delete-artifact@v2
with:
name: |
Container01
Expand All @@ -481,7 +504,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Delete workspace artifact
uses: geekyeggo/delete-artifact@v1
uses: geekyeggo/delete-artifact@v2
with:
name: workspace

Expand All @@ -492,6 +515,6 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Delete workspace artifact
uses: geekyeggo/delete-artifact@v1
uses: geekyeggo/delete-artifact@v2
with:
name: workspace
2 changes: 1 addition & 1 deletion .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Inject slug variables
uses: rlespinasse/github-slug-action@4.2.5
uses: rlespinasse/github-slug-action@v4.3.0
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ mochawesome-report

**/generated/**/*
!src/analytics/generated/**/*

storybook-static
37 changes: 37 additions & 0 deletions .storybook/i18next.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { initReactI18next } from 'react-i18next'
import i18n from 'i18next'
import Backend from 'i18next-http-backend'
import LanguageDetector from 'i18next-browser-languagedetector'

const ns = ['common', 'bridge', 'liquidity', 'pool', 'swap']

const supportedLngs = ['en']

const resources = ns.reduce((acc, n) => {
supportedLngs.forEach(lng => {
if (!acc[lng]) acc[lng] = {}
acc[lng] = {
...acc[lng],
[n]: require(`../public/locales/${lng}/${n}.json`),
}
})
return acc
}, {})

i18n
.use(initReactI18next)
.use(LanguageDetector)
.use(Backend)
.init({
//debug: true,
lng: 'en',
fallbackLng: 'en',
defaultNS: 'common',
ns,
interpolation: { escapeValue: false },
react: { useSuspense: false },
supportedLngs,
resources,
})

export default i18n
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
'@storybook/preset-create-react-app',
'@react-theming/storybook-addon',
'@storybook/addon-docs',
'storybook-react-i18next',
],
framework: '@storybook/react',
core: {
Expand Down
15 changes: 13 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { theme } from '../src/theme'
import { FixedGlobalStyle, theme } from '../src/theme'
import { ThemeProvider } from 'styled-components'
import i18n from './i18next.js'

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
Expand All @@ -18,7 +19,17 @@ export const parameters = {
gutter: '50px',
maxWidth: '1024px',
},
i18n,
locale: 'en',
locales: {
en: 'English',
},
}

const themeDecorator = storyFn => <ThemeProvider theme={theme(true)}>{storyFn()}</ThemeProvider>
const themeDecorator = storyFn => (
<ThemeProvider theme={theme(true)}>
<FixedGlobalStyle />
{storyFn()}
</ThemeProvider>
)
export const decorators = [themeDecorator]
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ COPY package.json ./
COPY yarn.lock ./

FROM base as test
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
RUN apt -y update && apt -y upgrade
RUN yarn --frozen-lockfile --prefer-offline --no-audit
COPY . .
3 changes: 1 addition & 2 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const GitRevisionPlugin = require('git-revision-webpack-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const crypto = require('crypto')

class NonceInjector {
constructor(base64Hash) {
Expand All @@ -29,7 +28,7 @@ module.exports = (config, env) => {

const gitRevisionPlugin = new GitRevisionPlugin()
const shortCommitHash = gitRevisionPlugin.commithash().substring(0, 8)
const base64Hash = crypto.randomBytes(16).toString('base64')
const base64Hash = Buffer.from(shortCommitHash).toString('base64')
const CSP_NONCE = JSON.stringify(base64Hash)

const fallback = config.resolve.fallback || {}
Expand Down
43 changes: 23 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swapr/frontend",
"version": "1.0.0-beta.16",
"version": "1.0.0-beta.17.2",
"private": true,
"description": "DXswap Decentralized Application",
"license": "GPL-3.0-or-later",
Expand Down Expand Up @@ -33,8 +33,8 @@
"codegen:graphql": "graphql-codegen --config graphql-codegen.yml"
},
"dependencies": {
"@apollo/client": "^3.4.7",
"@arbitrum/sdk": "3.0.0-beta.11",
"@apollo/client": "^3.7.0",
"@arbitrum/sdk": "3.0.0-beta.12",
"@coinbase/wallet-sdk": "^3.3.0",
"@popperjs/core": "^2.9.3",
"@reach/dialog": "^0.17.0",
Expand All @@ -43,9 +43,9 @@
"@reduxjs/toolkit": "^1.8.3",
"@swapr/core": "^0.3.19",
"@swapr/periphery": "^0.3.22",
"@swapr/sdk": "1.6.1",
"@uniswap/smart-order-router": "^2.9.3",
"@swapr/sdk": "1.7.0-beta.0",
"@types/react-helmet": "^6.1.5",
"@uniswap/smart-order-router": "^2.9.3",
"@uniswap/token-lists": "^1.0.0-beta.27",
"@walletconnect/ethereum-provider": "^1.7.5",
"@web3-react/coinbase-wallet": "8.0.34-beta.0",
Expand All @@ -57,6 +57,7 @@
"@web3-react/types": "8.0.20-beta.0",
"@web3-react/url": "8.0.25-beta.0",
"@web3-react/walletconnect": "8.0.35-beta.0",
"@uniswap/v3-periphery": "1.4.1",
"ajv": "^8.11.0",
"ajv-formats": "^2.1.1",
"aos": "^2.3.4",
Expand All @@ -72,13 +73,14 @@
"git-revision-webpack-plugin": "^3.0.6",
"graphql": "^16.5.0",
"graphql-request": "^4.3.0",
"i18next": "^21.8.16",
"i18next": "^21.9.2",
"i18next-browser-languagedetector": "^6.1.4",
"i18next-http-backend": "^1.4.1",
"lightweight-charts": "^3.8.0",
"i18next-http-backend": "^1.4.4",
"luxon": "^3.0.1",
"merkletreejs": "^0.2.32",
"multicodec": "^3.2.1",
"multiformats": "^9.7.1",
"multiformats": "^9.9.0",
"multihashes": "^4.0.3",
"node-vibrant": "^3.2.1-alpha.1",
"numeral": "^2.0.6",
Expand All @@ -94,11 +96,13 @@
"react-feather": "^2.0.8",
"react-helmet": "^6.1.0",
"react-i18next": "^11.18.3",
"react-infinite-scroll-component": "^6.1.0",
"react-loading-skeleton": "3.1.0",
"react-popper": "^2.2.5",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-toastify": "9.0.7",
"react-toastify": "9.0.8",
"react-router-dom": "^6.4.1",
"react-ts-tradingview-widgets": "^1.0.11",
"react-use": "^17.4.0",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.5",
Expand All @@ -111,8 +115,8 @@
},
"devDependencies": {
"@connext/nxtp-sdk": "^0.1.36",
"@graphql-codegen/cli": "2.11.3",
"@graphql-codegen/introspection": "2.2.0",
"@graphql-codegen/cli": "2.13.2",
"@graphql-codegen/introspection": "2.2.1",
"@graphql-codegen/typescript": "2.7.2",
"@graphql-codegen/typescript-operations": "^2.5.2",
"@graphql-codegen/typescript-react-apollo": "^3.3.2",
Expand All @@ -130,15 +134,14 @@
"@storybook/preset-create-react-app": "^4.1.2",
"@storybook/react": "^6.5.9",
"@storybook/testing-library": "^0.0.13",
"@synthetixio/synpress": "^2.3.3-beta.1",
"@synthetixio/synpress": "^2.3.3",
"@testing-library/cypress": "^8.0.3",
"@types/aos": "^3.0.4",
"@types/debug": "^4.1.7",
"@types/jest": "^28.1.6",
"@types/lodash": "^4.14.182",
"@types/luxon": "^3.0.0",
"@types/multicodec": "^2.1.0",
"@types/node": "^18.0.1",
"@types/node": "^18.8.0",
"@types/numeral": "^2.0.2",
"@types/react": "^18.0.15",
"@types/react-datepicker": "^4.4.2",
Expand All @@ -151,7 +154,7 @@
"@types/testing-library__cypress": "^5.0.9",
"@types/wcag-contrast": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.20.0",
"@typescript-eslint/parser": "^5.38.1",
"assert": "^2.0.0",
"browserslist": "^4.21.1",
"buffer": "^6.0.3",
Expand All @@ -161,7 +164,7 @@
"cypress": "^10.8.0",
"cypress-localstorage-commands": "^2.1.0",
"cypress-mochawesome-reporter": "^3.1.0",
"eslint": "^7.32.0",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.26.0",
Expand All @@ -187,11 +190,11 @@
"stream-http": "^3.2.0",
"svg-inline-loader": "^0.8.2",
"svg-react-loader": "^0.4.6",
"svg-url-loader": "^7.1.1",
"svg-url-loader": "^8.0.0",
"tls": "^0.0.1",
"typescript": "^4.7.4",
"typescript": "^4.8.4",
"url": "^0.11.0",
"webpack-bundle-analyzer": "^4.5.0",
"yargs": "^17.5.1"
"yargs": "^17.6.0"
}
}
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<meta name="twitter:site" content="@SwaprEth" />
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'strict-dynamic' 'nonce-<%= CSP_NONCE %>' 'unsafe-inline' 'unsafe-eval'; script-src-attr 'none'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; connect-src 'self' data: ws: wss: http: https:; img-src 'self' data: blob: https:; font-src 'self' data:; media-src 'self' blob: https:; frame-src 'self' blob:; object-src 'self'; base-uri 'none'"
content="default-src 'self'; script-src 'strict-dynamic' 'nonce-<%= CSP_NONCE %>' 'unsafe-inline' 'unsafe-eval'; script-src-attr 'none'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; connect-src 'self' data: ws: wss: http: https:; img-src 'self' data: blob: https:; font-src 'self' data:; media-src 'self' blob: https:; frame-src 'self' *.tradingview.com blob:; object-src 'self'; base-uri 'none'"
/>
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
<script nonce="<%= CSP_NONCE %>">
Expand Down
Loading

0 comments on commit 3cdd4f7

Please sign in to comment.