Skip to content

Commit

Permalink
feat: upgrade to NodeJS 18
Browse files Browse the repository at this point in the history
  • Loading branch information
ryenguyen7411 committed Sep 18, 2023
1 parent b20d1a7 commit 5880511
Show file tree
Hide file tree
Showing 9 changed files with 1,514 additions and 304 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ yarn-error.log*
# vercel
.vercel

# typescript
*.tsbuildinfo

graphql.schema.json
2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ yarn build ||
false;
)

yarn pretty-quick --staged

# If everything passes... Now we can commit
echo '✅✅✅✅ You win this time... I am committing this now. ✅✅✅✅'

18 changes: 6 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"check-types": "tsc --pretty --noEmit",
"check-format": "prettier --check .",
"check-lint": "eslint . --ext ts --ext tsx --ext js",
"test-all": "yarn check-format && yarn check-lint && yarn check-types && yarn build && yarn pretty-quick --staged",
"test-all": "yarn check-format && yarn check-lint && yarn check-types && yarn build",
"prepare": "husky install"
},
"prettier": {
Expand All @@ -28,11 +28,6 @@
"lint-staged": {
"src/**/*.{ts,tsx}": "yarn lint --fix"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"dependencies": {
"@apollo/client": "^3.8.3",
"@moxy/next-router-scroll": "^2.2.0",
Expand All @@ -53,7 +48,7 @@
"ethers": "^5.4.5",
"framer-motion": "^10.16.4",
"graphql": "^16.8.0",
"isomorphic-unfetch": "^4.0.2",
"isomorphic-unfetch": "^3.1.0",
"jest": "^29.6.4",
"luxon": "^3.4.3",
"nanoid": "^4.0.2",
Expand All @@ -63,7 +58,7 @@
"polished": "^4.2.2",
"query-string": "^7.1.3",
"react": "^18.2.0",
"react-cookie-consent": "^8.0.1",
"react-cookie-consent": "^6.4.1",
"react-countup": "^6.4.2",
"react-dom": "^18.2.0",
"react-intl": "^6.4.5",
Expand All @@ -90,7 +85,7 @@
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
"@percy/cli": "^1.0.0-beta.76",
"@percy/cypress": "^3.1.2",
"@swingby-protocol/eslint-config": "^3.0.0",
"@swingby-protocol/eslint-config": "file:./packages/eslint-config",
"@swingby-protocol/prettier-config": "^1.0.0",
"@types/big.js": "^6.2.0",
"@types/jest": "^29.5.4",
Expand All @@ -105,9 +100,8 @@
"husky": "^8.0.3",
"pino-pretty": "^10.2.0",
"prettier": "^3.0.3",
"pretty-quick": "^3.1.3",
"type-fest": "^4.3.1",
"typescript": "^5.2.2",
"type-fest": "^0.20.2",
"typescript": "^4.9.5",
"wait-on": "^7.0.1"
}
}
14 changes: 10 additions & 4 deletions src/modules/hooks/useGetStatsChartData/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SkybridgeBridge } from '@swingby-protocol/sdk';
import { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { DefaultRootState, useSelector } from 'react-redux';

import { IFloatHistoryObject } from '..';
import { ENDPOINT_SKYBRIDGE_EXCHANGE, PATH } from '../../env';
Expand All @@ -12,9 +12,15 @@ import { useToggleBridge } from '../useToggleBridge';

export const useGetStatsChartData = () => {
const { bridge } = useToggleBridge(PATH.ROOT);
const volumes = useSelector((state) => state.explorer.networkInfos.stats.volumes);
const volumes1m = useSelector((state) => state.explorer.networkInfos.stats.volumes1m);
const volumes1y = useSelector((state) => state.explorer.networkInfos.stats.volumes1y);
const volumes = useSelector(
(state: DefaultRootState) => state.explorer.networkInfos.stats.volumes,
);
const volumes1m = useSelector(
(state: DefaultRootState) => state.explorer.networkInfos.stats.volumes1m,
);
const volumes1y = useSelector(
(state: DefaultRootState) => state.explorer.networkInfos.stats.volumes1y,
);
const [floatHistories, setFloatHistories] = useState<IChartDate[]>(initialVolumes);
const [lockHistories, setLockHistories] = useState<IChartDate[]>(initialVolumes);
const [isLoading, setIsLoading] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/onboard/useOnboardInstance.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SkybridgeBridge } from '@swingby-protocol/sdk';
import { API as OnboardInstance } from 'bnc-onboard/dist/src/interfaces'; // eslint-disable-line import/no-internal-modules
import { API as OnboardInstance } from 'bnc-onboard/dist/src/interfaces'; // eslint-disable-line
import { useRouter } from 'next/router';
import { useEffect, useMemo, useState } from 'react';
import { useTheme } from 'styled-components';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/scenes/Main/MetanodeEarners/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { rem } from 'polished';
import React from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import { PromiseValue } from 'type-fest';
import { PromiseValue } from 'type-fest'; // eslint-disable-line

import { fetchNodeEarningsList } from '../../../metanodes';
import { StylingConstants } from '../../../styles';
Expand Down
4 changes: 2 additions & 2 deletions src/modules/scenes/Main/Migrate/Migrate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Migrate = () => {
<MigratePanelContainer>
<MigratePanel>
<MigrateChainContainer>
<Image src="/migrate-erc20.svg" width={222} height={55} />
<Image src="/migrate-erc20.svg" alt="migrate erc20" width={222} height={55} />

<MigrateChainAnchor href={URL.MigrateBep20} target="_blank">
<MigrateChain variant="secondary" size="city">
Expand All @@ -64,7 +64,7 @@ export const Migrate = () => {
onClick={() => copyToClipboard(copy, toastCopyAddress)}
>
<MigrateAddress>
<Image src="/coin.svg" width={20} height={20} />
<Image src="/coin.svg" alt="coin" width={20} height={20} />
<MigrateAddressText>{BRIDGE_ADDRESS}</MigrateAddressText>
</MigrateAddress>
</ButtonScale>
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
"paths": {
"react": [ "./node_modules/@types/react" ]
}
},
"include": [
"next-env.d.ts",
Expand Down
Loading

0 comments on commit 5880511

Please sign in to comment.