Skip to content

Commit

Permalink
Merge pull request #502 from cowprotocol/release/1.14
Browse files Browse the repository at this point in the history
[RELEASE 🏄] v1.14
  • Loading branch information
anxolin authored May 5, 2022
2 parents cee4696 + 1a7b9d4 commit 5b00721
Show file tree
Hide file tree
Showing 702 changed files with 37,854 additions and 22,830 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ REACT_APP_PATH_REGEX_ENS="/ipfs"

# Enables mock mode (default = true)
REACT_APP_MOCK=true

# Locales
REACT_APP_LOCALES="locales"
3 changes: 3 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ REACT_APP_PATH_REGEX_ENS="/ipfs"

# Enables mock mode (default = false)
REACT_APP_MOCK=false

# Locales
REACT_APP_LOCALES="locales"
35 changes: 30 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,50 @@
"jsx": true
}
},
"ignorePatterns": ["node_modules/**/*", ".github/*", "src/components/RateToggle/index.tsx"],
"settings": {
"react": {
"version": "detect"
}
},
"ignorePatterns": [
"src/lib/",
"__fixtures__",
".github/*",
"src/components/RateToggle/index.tsx",
"src/types/v3",
"src/abis/types",
"src/locales/**/*.js",
"src/locales/**/en-US.po",
"src/state/data/generated.ts",
"node_modules",
"coverage",
"build",
"dist",
".DS_Store",
".env.local",
".env.development.local",
".env.test.local",
".env.production.local",
".idea/",
".vscode/",
"package-lock.json",
"yarn.lock"
],
"extends": [
"react-app",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"prettier/@typescript-eslint",
"plugin:cypress/recommended",
"plugin:prettier/recommended",
"plugin:jsx-a11y/recommended"
],
"plugins": ["simple-import-sort", "unused-imports"],
"rules": {
"unused-imports/no-unused-imports": "error",
// "simple-import-sort/imports": "error",
// "simple-import-sort/exports": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"prettier/prettier": "error",
"@typescript-eslint/no-explicit-any": "off",
Expand All @@ -35,10 +64,6 @@
"error",
{
"paths": [
{
"name": "lodash",
"message": "Please import from 'lodash/module' directly to support tree-shaking."
},
{
"name": "ethers",
"message": "Please import from '@ethersproject/module' directly to support tree-shaking."
Expand Down
40 changes: 40 additions & 0 deletions .github/uniswap-original/bundle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Widgets
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn widgets:build
7 changes: 3 additions & 4 deletions .github/uniswap-original/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
integration-tests:
name: Cypress
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -38,15 +38,14 @@ jobs:
run: yarn install --frozen-lockfile

- run: yarn cypress install

- run: yarn build
env:
CI: false
REACT_APP_NETWORK_URL: "https://mainnet.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847"
REACT_APP_NETWORK_URL: 'https://mainnet.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847'
REACT_APP_SERVICE_WORKER: false

- run: yarn integration-test
env:
CYPRESS_INTEGRATION_TEST_PRIVATE_KEY: ${{ secrets.CYPRESS_INTEGRATION_TEST_PRIVATE_KEY }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}


19 changes: 11 additions & 8 deletions .github/uniswap-original/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name: Lint
on:
push:
branches:
- master
pull_request_target:
- main
pull_request:
branches:
- master
- main

jobs:
run-linters:
name: Run linters
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }}
runs-on: ubuntu-latest

steps:
Expand All @@ -35,14 +34,18 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run linters
uses: wearerequired/lint-action@b98b0918aa71490373d2eca9e8e39a9bc1cc2517
- name: Run eslint w/ autofix
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }}
uses: wearerequired/lint-action@36c7e6689e80d785d27a22f71d970f3a3b4fcb70
with:
github_token: ${{ secrets.github_token }}
eslint: true
eslint_extensions: js,jsx,ts,tsx,json
eslint_args: "-c .eslintrc.json"
auto_fix: true

- name: Run eslint
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
run: yarn eslint .
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,15 @@ jobs:
- name: Run linters
uses: wearerequired/lint-action@v1
with:
eslint: true
prettier: true
github_token: ${{ secrets.github_token }}
eslint: true
eslint_args: "-c .eslintrc.json ."
auto_fix: ${{ github.event_name == 'pull_request' }}
prettier: true

- name: Run eslint
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
run: yarn eslint .

build:
name: Build apps
Expand Down Expand Up @@ -300,8 +305,12 @@ jobs:
start: yarn start:default
wait-on: http://localhost:3000
wait-on-timeout: 200
env:
CYPRESS_INTEGRATION_TEST_PRIVATE_KEY: ${{ secrets.CYPRESS_INTEGRATION_TEST_PRIVATE_KEY }}
CYPRESS_INTEGRATION_TESTS_INFURA_KEY: ${{ secrets.CYPRESS_INTEGRATION_TESTS_INFURA_KEY }}

# Open tmate ssh connection on failure for debugging
# Uncomment when needed and push upstream
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: ${{ failure() }}
4 changes: 2 additions & 2 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path-to-signatures: 'signatures/version1/cla.json'
path-to-cla-document: 'https://github.com/gnosis/cowswap/blob/develop/docs/GNOSIS_CLA.md'
path-to-cla-document: 'https://github.com/cowprotocol/cla/blob/main/Cow%20Services%20CLA.md'
branch: 'cla-signatures'
allowlist: dependabot,mergify,alfetopito,anxolin,W3stside,nenadV91,annamsgeorge,avsavsavs,c3rnst,cmagan,josojo,davidalbela,fedgiac,fleupold,giacomolicari,GabrielCamba,nlordell,alongoni,elena-zh,henrypalacios,matextrem,ramirotw
allowlist: dependabot,mergify,alfetopito,anxolin,W3stside,nenadV91,annamsgeorge,avsavsavs,c3rnst,cmagan,josojo,davidalbela,fedgiac,fleupold,giacomolicari,GabrielCamba,nlordell,alongoni,elena-zh,henrypalacios,matextrem,ramirotw,fairlighteth
empty-commit-flag: false
blockchain-storage-flag: false
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
# generated contract types
/src/types/v3
/src/abis/types
/src/lib/locales/**/*.js
/src/lib/locales/**/en-US.po
/src/lib/locales/**/pseudo.po
/src/locales/**/*.js
/src/locales/**/*.ts
/src/locales/**/*.json
/src/locales/**/en-US.po
/src/locales/**/pseudo.po
/src/state/data/generated.ts

# dependencies
Expand All @@ -15,11 +19,10 @@
# testing
/coverage

# production
# builds
/build

# bundle
/dist
/dts

# misc
.DS_Store
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/gnosis/gp-swap-ui)

<p align="center">
<img width="400" src="docs/images/logo-cow-swap.png">
<img height="120" src="https://bafybeig5h43icn326c45qmwl4mpimskfaqa3o2pnkuht5pqb6gfcfjzlxi.ipfs.dweb.link/">
</p>

[![Lint](https://github.com/gnosis/dex-swap/workflows/Lint/badge.svg)](https://github.com/gnosis/dex-swap/actions?query=workflow%3ALint)
Expand All @@ -21,7 +21,7 @@ It allows you to buy and sell tokens using gas-less orders that are settled peer
- Stats: <https://dune.xyz/gnosis.protocol/Gnosis-Protocol-V2>
- Twitter: [@gnosisPM](https://twitter.com/gnosisPM)
- Reddit: [/r/gnosisPM](https://www.reddit.com/r/gnosisPM)
- Discord: <https://chat.cowswap.exchange>
- Discord: <https://discord.com/invite/cowprotocol>

Please see the:

Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion codegen.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
overrideExisting: true
schema: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3'
schema:
[
'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3',
'https://api.thegraph.com/subgraphs/name/ensdomains/ens',
]
documents: 'src/**/!(*.d).{ts,tsx}'
generates:
./src/state/data/generated.ts:
Expand Down
7 changes: 4 additions & 3 deletions cosmos.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"staticPath": "public",
"watchDirs": ["src"],
"webpack": {
"configPath": "./cosmos.webpack.config"
}
"configPath": "./cosmos.webpack.config",
"overridePath": "cosmos.override.js"
},
"port": 5001
}
26 changes: 26 additions & 0 deletions cosmos.override.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { DefinePlugin } = require('webpack')

// Renders the cosmos fixtures in isolation, instead of using public/index.html.
module.exports = (webpackConfig) => ({
...webpackConfig,
plugins: webpackConfig.plugins.map((plugin) => {
if (plugin instanceof HtmlWebpackPlugin) {
return new HtmlWebpackPlugin({
templateContent: '<body></body>',
})
}
if (plugin instanceof DefinePlugin) {
return new DefinePlugin({
...plugin.definitions,
'process.env': {
...plugin.definitions['process.env'],
REACT_APP_IS_WIDGET: true,
REACT_APP_LOCALES: '"../locales"',
},
})
}
return plugin
}),
})
2 changes: 1 addition & 1 deletion cypress-custom/integration/fee.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WETH9 as WETH } from '@uniswap/sdk-core'
import { GetQuoteResponse } from '@gnosis.pm/gp-v2-contracts'
import { GetQuoteResponse } from '@cowprotocol/contracts'
import { parseUnits } from 'ethers/lib/utils'

const DAI = '0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735'
Expand Down
Loading

0 comments on commit 5b00721

Please sign in to comment.