Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): lockfiles #893

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: nodejs

on:
pull_request:
push:
branches:
- master
workflow_dispatch: {}

defaults:
run:
# change this if your nextjs app does not live at the root of the repo
working-directory: ./
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PULL_NUMBER: ${{ github.event.pull_request.number }}
RUN_ID: ${{ github.run_id }}
FORCE_COLOR: 2
NEXT_TELEMETRY_DISABLED: 1

jobs:
pipeline:
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: ['16.x']
os: ['ubuntu-latest']

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

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

- uses: actions/cache@v3
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: Restore next build
uses: actions/cache@v3
id: restore-build-cache
env:
cache-name: cache-next-build
with:
# if you use a custom build directory, replace all instances of `.next` in this file with your build directory
# ex: if your app builds to `dist`, replace `.next` with `dist`
path: .next/cache
# change this if you prefer a more strict cache
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Install project dependencies
env:
NODE_OPTIONS: "--max-old-space-size=4096"
run: yarn --prefer-offline
id: install

- name: Build next.js app
env:
NODE_OPTIONS: "--max-old-space-size=4096"
run: yarn run build
id: production

# Here's the first place where next-bundle-analysis' own script is used
# This step pulls the raw bundle stats for the current bundle
- name: Analyze bundle
run: npx -p nextjs-bundle-analysis report
env:
NODE_OPTIONS: "--max-old-space-size=4096"

- name: Upload bundle
uses: actions/upload-artifact@v2
with:
name: bundle
path: .next/analyze/__bundle_analysis.json

- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@v2
if: success() && github.event.number
with:
workflow: nodejs.yml
branch: ${{ github.event.pull_request.base.ref }}
path: .next/analyze/base

# And here's the second place - this runs after we have both the current and
# base branch bundle stats, and will compare them to determine what changed.
# There are two configurable arguments that come from package.json:
#
# - budget: optional, set a budget (bytes) against which size changes are measured
# it's set to 350kb here by default, as informed by the following piece:
# https://infrequently.org/2021/03/the-performance-inequality-gap/
#
# - red-status-percentage: sets the percent size increase where you get a red
# status indicator, defaults to 20%
#
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
# entry in your package.json file.
- name: Compare with base branch bundle
if: success() && github.event.number
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
env:
NODE_OPTIONS: "--max-old-space-size=4096"

- name: Get comment body
id: get-comment-body
if: success() && github.event.number
run: |
body=$(cat .next/analyze/__bundle_analysis_comment.txt)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo ::set-output name=body::$body
- name: Find Comment
uses: peter-evans/find-comment@v1
if: success() && github.event.number
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: '<!-- __NEXTJS_BUNDLE -->'

- name: Create Comment
uses: peter-evans/[email protected]
if: success() && github.event.number && steps.fc.outputs.comment-id == 0
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.get-comment-body.outputs.body }}

- name: Update Comment
uses: peter-evans/[email protected]
if: success() && github.event.number && steps.fc.outputs.comment-id != 0
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.get-comment-body.outputs.body }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
49 changes: 49 additions & 0 deletions 0001-patch-debug.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From 893ee5eaec658c9ae79ab8c75a88ce7b7e68f4cc Mon Sep 17 00:00:00 2001
From: 0xjanitor <[email protected]>
Date: Fri, 19 Aug 2022 13:21:43 -0700
Subject: [PATCH] patch debug

---
src/config/index.ts | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/config/index.ts b/src/config/index.ts
index fc9175e72..360cbdf20 100644
--- a/src/config/index.ts
+++ b/src/config/index.ts
@@ -5,7 +5,9 @@ const config = {
defaultChainId: ChainId.ETHEREUM,
blockedAddresses: [
// SDN OFAC addresses - 08.11.2022
- "0x098B716B8Aaf21512996dC57EB0615e2383E2f96",
+ // @dev Disabled blockedAddress list
+ // for DEBUGGING PURPOSES ONLY
+ /* "0x098B716B8Aaf21512996dC57EB0615e2383E2f96",
"0xa0e1c89Ef1a489c9C7dE96311eD5Ce5D32c20E4B",
"0x3Cffd56B47B7b41c56258D9C7731ABaDc360E073",
"0x53b6936513e738f44FB50d2b9476730C0Ab3Bfc1",
@@ -34,7 +36,8 @@ const config = {
"0x48549a34ae37b12f6a30566245176994e17c6b4a",
"0x5512d943ed1f7c8a43f3435c85f7ab68b30121b0",
"0xc455f7fd3e0e12afd51fba5c106909934d8a0e4a",
- "0x7FF9cFad3877F21d41Da833E2F775dB0569eE3D9"
+ "0x7FF9cFad3877F21d41Da833E2F775dB0569eE3D9" */
+ "0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000"
],
// Network specific configuration
[ChainId.ETHEREUM]: {
@@ -47,4 +50,9 @@ const config = {
},
}

-export default config
+let hook: any
+if (typeof window !== 'undefined') {
+ hook = (window as any).__WAGMI_DEVTOOLS__
+}
+
+export default config
\ No newline at end of file
--
2.36.1

3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

tar -C node_modules/@sushiswap/core-sdk --strip-components 1 -xzf sushiswap-core-sdk-1.0.0-canary.129.tgz
7 changes: 7 additions & 0 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.SITE_URL || 'https://app.sushi.com',
generateRobotsTxt: true, // (optional
sitemapSize: 7000,
// ...other options
}
86 changes: 44 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"private": true,
"scripts": {
"analyze": "ANALYZE=true yarn build && serve .next -n",
"build": "yarn lingui && next build",
"build": "yarn lingui && patch-package && next build",
"postbuild": "next-sitemap",
"postinstall": "patch-package",
"circular": "madge --circular src --extensions ts,tsx,js,jsx",
"dev": "cross-env NODE_OPTIONS='--inspect' next dev",
"e2e": "concurrently -k -s first -n \"app,e2e\" \"yarn dev\" \"yarn e2e:safe\"",
"e2e:run": "yarn jest --testPathPattern=test/e2e --runInBand",
"e2e:safe": "wait-on -l http://localhost:3000 && yarn e2e:run",
"inspect": "NODE_OPTIONS='--inspect' next dev",
"postinstall": "yarn lingui",
"lingui": "lingui extract --clean --overwrite && lingui compile",
"lint": "npx next lint --fix",
"ngrok": "ngrok http 3000",
Expand All @@ -31,30 +32,23 @@
],
"*.{md,css}": "prettier --write"
},
"browserslist": {
"production": [
">0.3%",
"not dead",
"not op_mini all",
"not IE > 0",
"not samsung 4",
"not and_uc 12.12"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"last 2 Edge major versions ",
"last 2 iOS major versions ",
"not iOS 12.5"
]
},
"browserslist": [
">0.3%",
"not dead",
"not op_mini all",
"not IE > 0",
"not samsung 4",
"not and_uc 12.12",
"not iOS 12.5",
"last 1 safari version"
],
"resolutions": {
"@walletconnect/ethereum-provider": "1.7.8",
"@walletconnect/jsonrpc-provider": "1.0.3"
"@walletconnect/ethereum-provider": "1.8.0",
"@walletconnect/jsonrpc-provider": "1.0.5",
"@sushiswap/core-sdk": "file:./sushiswap-core-sdk-1.0.0-canary.129.tgz"
},
"devDependencies": {
"@babel/preset-react": "^7.16.7",
"@babel/preset-react": "^7.18.6",
"@binance-chain/bsc-connector": "^1.0.0",
"@builder.io/partytown": "^0.5.2",
"@chainsafe/dappeteer": "2.4.1",
Expand All @@ -64,19 +58,19 @@
"@davatar/react": "^1.9.0",
"@ethereumjs/common": "^2.4.0",
"@ethereumjs/tx": "^3.3.0",
"@ethersproject/abi": "^5.4.0",
"@ethersproject/abstract-provider": "^5.4.0",
"@ethersproject/address": "^5.4.0",
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/constants": "^5.4.0",
"@ethersproject/contracts": "^5.4.0",
"@ethersproject/experimental": "^5.4.0",
"@ethersproject/hash": "^5.4.0",
"@ethersproject/abi": "^5.6.4",
"@ethersproject/abstract-provider": "^5.6.1",
"@ethersproject/address": "^5.6.1",
"@ethersproject/bignumber": "^5.6.2",
"@ethersproject/bytes": "^5.6.1",
"@ethersproject/constants": "^5.6.1",
"@ethersproject/contracts": "^5.6.2",
"@ethersproject/experimental": "^5.6.1",
"@ethersproject/hash": "^5.6.1",
"@ethersproject/keccak256": "^5.4.0",
"@ethersproject/providers": "^5.4.0",
"@ethersproject/providers": "^5.6.8",
"@ethersproject/strings": "^5.4.0",
"@ethersproject/units": "^5.4.0",
"@ethersproject/units": "^5.6.1",
"@fontsource/dm-sans": "^4.5.0",
"@gnosis.pm/safe-apps-web3-react": "^0.6.0",
"@headlessui/react": "1.5.0",
Expand All @@ -89,23 +83,25 @@
"@lingui/react": "^3.12.1",
"@lingui/remote-loader": "^3.11.0",
"@next/bundle-analyzer": "^11.1.0",
"@next/env": "^12.2.5",
"@popperjs/core": "^2.10.0",
"@ramp-network/ramp-instant-sdk": "^2.5.0",
"@reduxjs/toolkit": "^1.8.0",
"@sentry/nextjs": "^7.0.0",
"@sentry/react": "^7.0.0",
"@sentry/tracing": "^7.0.0",
"@sushiswap/bentobox-sdk": "1.0.0-canary.109",
"@sushiswap/bentobox-sdk": "1.0.0-canary.113",
"@sushiswap/chainlink-whitelist": "0.2.8",
"@sushiswap/core": "^2.0.0-canary.1",
"@sushiswap/core-sdk": "1.0.0-canary.128",
"@sushiswap/core-sdk": "file:./sushiswap-core-sdk-1.0.0-canary.129.tgz",
"@sushiswap/kashi-sdk": "1.0.0-canary.100",
"@sushiswap/limit-order-pair-list": "0.2.17",
"@sushiswap/limit-order-sdk": "1.0.0-canary.109",
"@sushiswap/limit-order-sdk": "1.0.0-canary.113",
"@sushiswap/miso": "1.0.0-canary.47",
"@sushiswap/miso-sdk": "1.0.0-canary.98",
"@sushiswap/tines": "https://github.com/manifoldfinance/sushiswap-sdk/releases/download/latest/sushiswap-tines-1.0.0-canary.112.tgz",
"@sushiswap/trident": "^1.0.0-canary.40",
"@sushiswap/trident-sdk": "1.0.0-canary.137",
"@sushiswap/trident-sdk": "1.0.0-canary.141",
"@testing-library/jest-dom": "^5.14.0",
"@testing-library/react": "^12.1.0",
"@transak/transak-sdk": "^1.0.31",
Expand All @@ -117,13 +113,14 @@
"@types/node": "^16.11.0",
"@types/qs": "^6.9.7",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@types/react-slider": "^1.3.1",
"@types/react-table": "^7.7.9",
"@types/ua-parser-js": "^0.7.36",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"@uniswap/redux-multicall": "^1.1.0",
"@uniswap/redux-multicall": "^1.1.5",
"@uniswap/token-lists": "1.0.0-beta.27",
"@visx/axis": "^2.1.0",
"@visx/brush": "^2.1.0",
Expand All @@ -135,8 +132,8 @@
"@visx/scale": "^2.1.0",
"@visx/shape": "^2.1.0",
"@visx/text": "^2.1.0",
"@walletconnect/ethereum-provider": "^1.7.8",
"@walletconnect/jsonrpc-provider": "^1.0.3",
"@walletconnect/ethereum-provider": "^1.8.0",
"@walletconnect/jsonrpc-provider": "^1.0.5",
"@web3-react/core": "^8.0.23-beta.0",
"@web3-react/eip1193": "^8.0.18-beta.0",
"@web3-react/empty": "^8.0.12-beta.0",
Expand Down Expand Up @@ -182,6 +179,7 @@
"next": "^12.1.5",
"next-pwa": "5.4.7",
"next-seo": "^5.1.0",
"next-sitemap": "^3.1.17",
"next-unused": "^0.0.6",
"ngrok": "^4.3.1",
"node-vibrant": "3.1.6",
Expand Down Expand Up @@ -215,7 +213,7 @@
"redux-persist": "^6.0.0",
"serve": "^12.0.0",
"start-server-and-test": "1.14.0",
"swr": "^1.2.0",
"swr": "^1.3.0",
"tailwindcss": "^3.0.23",
"tailwindcss-border-gradient-radius": "^3.0.0",
"typescript": "^4.6.2",
Expand Down Expand Up @@ -247,5 +245,9 @@
"entrypoints": [
"src/pages"
]
},
"dependencies": {
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0"
}
}
Loading