Skip to content

Commit

Permalink
Move liquidity (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
noisekit authored Sep 10, 2024
1 parent 595719e commit 2284c25
Show file tree
Hide file tree
Showing 622 changed files with 219 additions and 29,249 deletions.
144 changes: 2 additions & 142 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ jobs:
steps:
- checkout
- yarn-install
- run: yarn codegen
- run: yarn build:ts
- run: git diff --name-only --exit-code
- run: yarn typecheck

Expand Down Expand Up @@ -204,94 +202,6 @@ jobs:
path: 'governance/cypress/cypress/videos'
destination: 'videos'

liquidity-e2e:
parameters:
chainId:
type: integer
preset:
type: string
provider-url:
type: string
working_directory: /tmp/app
docker:
- image: cypress/included:<< pipeline.parameters.cypress-version >>
resource_class: large
environment:
NODE_ENV: test
CYPRESS_CHAIN_ID: << parameters.chainId >>
CYPRESS_PRESET: << parameters.preset >>
steps:
- checkout
- install-foundry
- yarn-install

- run:
name: Run server localhost:3000
working_directory: /tmp/app/liquidity/ui
command: yarn start
background: true

- run:
name: Run anvil localhost:8545
command: anvil --fork-url "<< parameters.provider-url >>"
background: true

- run:
name: Wait for server localhost:3000
command: wget --retry-connrefused --waitretry=20 --read-timeout=20 --timeout=15 -t 10 http://localhost:3000

- run:
name: Wait for anvil localhost:8545
command: wget -q -O - --retry-connrefused --waitretry=20 --read-timeout=20 --timeout=15 -t 10 --post-data='{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}' --header='Content-Type:application/json' http://localhost:8545

- run:
working_directory: /tmp/app/liquidity/cypress
command: cypress run --e2e --browser chrome

- store_test_results:
path: 'liquidity/cypress/cypress/reports'

- store_artifacts:
path: 'liquidity/cypress/.nyc_output'
destination: 'coverage'

- store_artifacts:
path: 'liquidity/cypress/cypress/screenshots'
destination: 'screenshots'

- store_artifacts:
path: 'liquidity/cypress/cypress/videos'
destination: 'videos'

liquidity-cy:
working_directory: /tmp/app
docker:
- image: cypress/included:<< pipeline.parameters.cypress-version >>
environment:
NODE_ENV: test
steps:
- checkout
- yarn-install

- run:
working_directory: /tmp/app/liquidity/cypress
command: cypress run --component

- store_test_results:
path: 'liquidity/cypress/cypress/reports'

- store_artifacts:
path: 'liquidity/cypress/.nyc_output'
destination: 'coverage'

- store_artifacts:
path: 'liquidity/cypress/cypress/screenshots'
destination: 'screenshots'

- store_artifacts:
path: 'liquidity/cypress/cypress/videos'
destination: 'videos'

combine-coverage:
working_directory: /tmp/app
docker:
Expand All @@ -301,10 +211,7 @@ jobs:
- yarn-install
- run: rm -rf /tmp/cov
- run: yarn download-cci-coverage tests /tmp/cov || true
- run: yarn download-cci-coverage liquidity-cy /tmp/cov || true
# - run: yarn download-cci-coveragegovernance-cy /tmp/cov || true
- run: yarn download-cci-coverage liquidity-e2e-base-mainnet /tmp/cov || true
- run: yarn download-cci-coverage liquidity-e2e-optimism-mainnet /tmp/cov || true
# - run: yarn download-cci-coverage governance-cy /tmp/cov || true
- run: mkdir -p /tmp/cov
- run: ls -alR /tmp/cov
- run: mkdir -p /tmp/cov/combined
Expand All @@ -314,21 +221,6 @@ jobs:
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} --file /tmp/cov/combined/coverage.json
liquidity-ipfs:
working_directory: /tmp/app
docker:
- image: cimg/node:<< pipeline.parameters.node-version >>
resource_class: large
steps:
- checkout
- yarn-install
- run: yarn workspace @snx-v3/liquidity build
- ipfs-deploy:
source-dir: './liquidity/ui/dist'
ipfs-api: 'https://ipfs.synthetix.io:5001/api/v0'
ipfs-cluster-api: 'https://ipfs.synthetix.io/api/v0'
ipns-key: 'v3.synthetix.eth'

workflows:
ui:
unless:
Expand All @@ -339,39 +231,7 @@ workflows:
- checks
- typecheck
- tests
- liquidity-cy
- governance-e2e:
name: governance-e2e-snax-testnet
- liquidity-e2e:
name: liquidity-e2e-base-mainnet
chainId: 8453
preset: andromeda
provider-url: https://base-mainnet.infura.io/v3/$INFURA_KEY
#- liquidity-e2e:
# name: liquidity-e2e-sepolia
# chainId: 11155111
# preset: main
# provider-url: https://sepolia.infura.io/v3/$INFURA_KEY
- combine-coverage:
requires: [
tests,
liquidity-cy,
governance-e2e-snax-testnet,
liquidity-e2e-base-mainnet,
#liquidity-e2e-sepolia,
]

- liquidity-ipfs:
requires:
- checks
- typecheck
- tests
- liquidity-cy
- liquidity-e2e-base-mainnet
#- liquidity-e2e-sepolia
filters:
branches:
only:
- release
- master
- ipfs-deploy
requires: [tests, governance-e2e-snax-testnet]
8 changes: 1 addition & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ module.exports = {

overrides: [
{
files: [
'liquidity/ui/**/*',
'liquidity/components/**/*',
'liquidity/lib/**/*',
'theme/**/*',
'governance/ui/**/*',
],
files: ['governance/ui/**/*', 'governance/components/**/*', 'governance/lib/**/*'],

env: {
browser: true,
Expand Down
55 changes: 0 additions & 55 deletions .github/workflows/release-liquidity.yml

This file was deleted.

11 changes: 0 additions & 11 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ module.exports = {
},
],
],
plugins: [
[
require.resolve('babel-plugin-module-resolver'),
{
root: ['.'],
alias: {
'@synthetixio/v3-theme': './theme/src',
},
},
],
],
},
},
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion governance/cypress/cypress/support/component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChakraProvider } from '@chakra-ui/react';
import '@cypress/code-coverage/support';

import { theme } from '@synthetixio/v3-theme';
import { theme } from '@snx-v3/theme';
import { mount } from 'cypress/react18';
import { MemoryRouter } from 'react-router-dom';

Expand Down
2 changes: 1 addition & 1 deletion governance/cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@chakra-ui/react": "^2.8.2",
"@cypress/code-coverage": "^3.12.39",
"@snx-cy/printBrowserLogs": "workspace:*",
"@synthetixio/v3-theme": "workspace:*",
"@snx-v3/theme": "workspace:*",
"cypress": "13.11.0",
"ethers": "^5.7.2",
"react-router-dom": "^6.18.0",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions governance/lib/theme/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@snx-v3/theme",
"private": true,
"main": "index.ts",
"version": "0.0.1",
"dependencies": {
"@chakra-ui/react": "^2.8.2",
"@chakra-ui/theme-tools": "^2.1.2",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"framer-motion": "^10.16.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion governance/ui/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
cwd: path.resolve('../..'),
all: true,
excludeNodeModules: false,
include: ['liquidity', 'theme', 'governance'],
include: ['governance'],
exclude: ['**/*.test.*', '**/*.cy.*', '**/*.e2e.*'],
},
'istanbul',
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion governance/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
"@snx-v3/format": "workspace:*",
"@snx-v3/formatters": "workspace:*",
"@snx-v3/icons": "workspace:*",
"@snx-v3/theme": "workspace:*",
"@snx-v3/useBlockchain": "workspace:*",
"@synthetixio/v3-theme": "workspace:*",
"@tanstack/react-query": "^5.8.3",
"@types/react-helmet": "^6.1.9",
"@web3-onboard/coinbase": "^2.4.1",
"@web3-onboard/gnosis": "^2.3.1",
"@web3-onboard/injected-wallets": "^2.11.1",
Expand Down
2 changes: 1 addition & 1 deletion governance/ui/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client';
import App from './App';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { ChakraProvider, extendTheme } from '@chakra-ui/react';
import { theme, Fonts } from '@synthetixio/v3-theme';
import { theme, Fonts } from '@snx-v3/theme';
import { RouterProvider, Navigate, createHashRouter } from 'react-router-dom';
import { RecoilRoot } from 'recoil';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
Expand Down
12 changes: 2 additions & 10 deletions governance/ui/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ const babelRule = {
include: [
// Need to list all the folders in v3 and outside (if used)
/contracts/,
/theme/,

/liquidity\/lib/,
/liquidity\/components/,
/governance\/cypress/,
/governance\/components/,
/governance\/lib/,
/governance\/ui/,

// fixes for borked 3rd party bundles
Expand Down Expand Up @@ -145,13 +144,6 @@ module.exports = {
new webpack.NormalModuleReplacementPlugin(/^bn.js$/, require.resolve('bn.js')),
])

.concat([
new webpack.NormalModuleReplacementPlugin(
new RegExp(`^@synthetixio/v3-theme$`),
path.resolve(path.dirname(require.resolve(`@synthetixio/v3-theme/package.json`)), 'src')
),
])

.concat([
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
Expand Down
Loading

0 comments on commit 2284c25

Please sign in to comment.