Skip to content

Commit

Permalink
chore: upgrade nx, vite and jest (cowprotocol#4326)
Browse files Browse the repository at this point in the history
* chore: upgrade nx, vite and jest

* chore: upgrade vite plugins, cosmos, and lingui

* chore: fix cross-env

* chore: upgrade eslint (cowprotocol#4327)

* chore: upgrade eslint

* chore: fix tests (cowprotocol#4329)

* chore: fix tests

* chore: fix widget-cfg tests

* chore: fix exporer circular dep

* chore: fix coverageDirectory

* chore: fix build cosmos
  • Loading branch information
shoom3301 authored Apr 30, 2024
1 parent 7ed7147 commit 59cbc17
Show file tree
Hide file tree
Showing 452 changed files with 5,919 additions and 3,824 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

123 changes: 0 additions & 123 deletions .eslintrc-common.json

This file was deleted.

35 changes: 0 additions & 35 deletions .eslintrc.json

This file was deleted.

14 changes: 0 additions & 14 deletions apps/cowswap-frontend-e2e/.eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion apps/cowswap-frontend-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'cypress'
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'
import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
Expand Down
21 changes: 0 additions & 21 deletions apps/cowswap-frontend/.eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion apps/cowswap-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"patch-package": "npx patch-package",
"cosmos:clear": "rm -rf ./public/cosmos",
"cosmos:run": "yarn run _cosmos:run",
"build:cosmos": "cross-env NODE_ENV=development npx cosmos-export",
"build:cosmos": "npx cross-env NODE_ENV=development npx cosmos-export",
"_cosmos:run": "yarn cosmos:clear && npx cosmos"
},
"browser": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ReactComponent as DropDown } from '@cowprotocol/assets/images/dropdown.svg'
import DropDown from '@cowprotocol/assets/images/dropdown.svg?react'
import { UI } from '@cowprotocol/ui'

import styled from 'styled-components/macro'

export const ArrowDown = styled(DropDown)<{ $stubbed?: boolean }>`
export const ArrowDown = styled((props) => <DropDown {...props} />)<{ $stubbed?: boolean }>`
margin: 0 3px;
width: 12px;
height: 7px;
Expand Down
1 change: 0 additions & 1 deletion apps/cowswap-frontend/src/common/pure/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export function Modal({
$mobile={isMobile}
>
{/* prevents the automatic focusing of inputs on mobile by the reach dialog */}
{/* eslint-disable-next-line jsx-a11y/tabindex-no-positive, jsx-a11y/no-noninteractive-tabindex */}
{!initialFocusRef && isMobile ? <div tabIndex={1} /> : null}
{children}
</StyledDialogContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useWindowSize } from '@cowprotocol/common-hooks'

import ReactConfetti from 'react-confetti'

// eslint-disable-next-line react/prop-types
export default function Confetti({ start, variant }: { start: boolean; variant?: string }) {
const { width, height } = useWindowSize()

Expand Down
1 change: 1 addition & 0 deletions apps/cowswap-frontend/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/// <reference types="vite-plugin-svgr/client" />
import './polyfills'
import './cow-react'
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useSetAtom } from 'jotai'

import { ReactComponent as Close } from '@cowprotocol/assets/images/x.svg'
import Close from '@cowprotocol/assets/images/x.svg?react'
import { UI } from '@cowprotocol/ui'
import { useWalletDetails, useWalletInfo } from '@cowprotocol/wallet'

Expand Down Expand Up @@ -102,7 +102,7 @@ const Header = styled.div`
}
`

const CloseIcon = styled(Close)`
const CloseIcon = styled((props) => <Close {...props} />)`
opacity: 0.6;
transition: opacity var(${UI.ANIMATION_DURATION}) ease-in-out;
stroke: var(${UI.COLOR_TEXT});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ export interface LimitOrdersRawState extends ExtendedTradeRawState {
readonly isUnlocked: boolean
}

export function getDefaultLimitOrdersState(
chainId: SupportedChainId | null,
isUnlocked: boolean = false
): LimitOrdersRawState {
export function getDefaultLimitOrdersState(chainId: SupportedChainId | null, isUnlocked = false): LimitOrdersRawState {
return {
...getDefaultTradeRawState(chainId),
inputCurrencyAmount: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,12 @@ const DropDown = ({ item, context }: DropdownProps) => {
{items?.map((item, index) => {
const { sectionTitle, links } = item
return (
<>
<MenuSection key={index}>
{sectionTitle && <MenuTitle>{sectionTitle}</MenuTitle>}
{links.map((link, linkIndex) => (
<DropdownLink key={linkIndex} link={link} context={context} />
))}
</MenuSection>
</>
<MenuSection key={index}>
{sectionTitle && <MenuTitle>{sectionTitle}</MenuTitle>}
{links.map((link, linkIndex) => (
<DropdownLink key={linkIndex} link={link} context={context} />
))}
</MenuSection>
)
})}
</MenuDropdown>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ReactComponent as Close } from '@cowprotocol/assets/images/x.svg'
import Close from '@cowprotocol/assets/images/x.svg?react'
import { UI } from '@cowprotocol/ui'

import styled from 'styled-components/macro'

export const CloseIcon = styled(Close)`
export const CloseIcon = styled((props) => <Close {...props} />)`
opacity: 0.6;
transition: opacity var(${UI.ANIMATION_DURATION}) ease-in-out;
stroke: var(${UI.COLOR_TEXT});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactComponent as Close } from '@cowprotocol/assets/images/x.svg'
import Close from '@cowprotocol/assets/images/x.svg?react'
import { ExternalLink } from '@cowprotocol/ui'
import { UI } from '@cowprotocol/ui'

Expand Down Expand Up @@ -36,7 +36,7 @@ export const NewToEthereum = () => (
</Blurb>
)

export const CloseColor = styled(Close)`
export const CloseColor = styled((props) => <Close {...props} />)`
color: inherit;
path {
Expand Down
21 changes: 0 additions & 21 deletions apps/explorer/.eslintrc.json

This file was deleted.

5 changes: 3 additions & 2 deletions apps/explorer/loadConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as path from 'path'
import * as fs from 'fs'
import * as YAML from 'yaml'

import * as fs from 'fs'
import * as path from 'path'

const SUPPORTED_EXTENSIONS = 'yaml|yml|json'
const CONFIG_FILE = './config-default.yaml'

Expand Down
12 changes: 5 additions & 7 deletions apps/explorer/src/api/erc20/Erc20Api.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import BN from 'bn.js'
import { AbiItem } from 'web3-utils'
import { Erc20Contract, toBN } from '@gnosis.pm/dex-js'
import erc20Abi from '@gnosis.pm/dex-js/build/contracts/abi/Erc20.json'
import erc20_bytes32Abi from 'abis/erc20_bytes32.json'

import { TxOptionalParams, Receipt } from 'types'
import BN from 'bn.js'
import { ZERO } from 'const'
import { TxOptionalParams, Receipt } from 'types'
import { logDebug } from 'utils'
import Web3 from 'web3'
import { AbiItem } from 'web3-utils'

import erc20_bytes32Abi from 'abis/erc20_bytes32.json'
import ERC20_DETAILS from 'api/erc20/erc20Details.json'

import Web3 from 'web3'

export interface Erc20Props {
name: string
symbol: string
Expand Down
Loading

0 comments on commit 59cbc17

Please sign in to comment.