Skip to content

Commit

Permalink
fix: update node and docusaurus version + add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
limsohee1002 committed Oct 11, 2024
1 parent cf01fec commit 0bf0e60
Show file tree
Hide file tree
Showing 25 changed files with 4,341 additions and 5,330 deletions.
104 changes: 48 additions & 56 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,51 @@
{
"env": {
"browser": true,
"es2021": true
},
"root": true,
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
"plugin:markdown/recommended"
"env": {
"browser": true,
"es2021": true
},
"root": true,
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"prettier/@typescript-eslint",
"eslint:recommended",
"plugin:markdown/recommended"
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["typescript-sort-keys", "simple-import-sort", "unused-imports"],
"rules": {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"typescript-sort-keys/string-enum": [
"error",
"asc",
{
"caseSensitive": true
}
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"typescript-sort-keys",
"simple-import-sort",
"unused-imports"
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "enum",
"format": ["StrictPascalCase"]
}
],
"rules": {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"typescript-sort-keys/string-enum": [
"error",
"asc",
{
"caseSensitive": true
}
],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "enum",
"format": [
"StrictPascalCase"
]
}
],
"curly": [
"warn",
"all"
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "_",
"varsIgnorePattern": "_",
"caughtErrorsIgnorePattern": "_"
}
]
}
}
"curly": ["warn", "all"],
"no-unused-vars": "off",
"no-empty": "warn",
"@typescript-eslint/no-unused-vars": [
"warn", // TODO: change back to "error" after removing all unused vars.
{
"argsIgnorePattern": "_",
"varsIgnorePattern": "_",
"caughtErrorsIgnorePattern": "_"
}
]
}
}
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
**/.git
**/.svn
**/.hg
*.mdx
*.mdx
*.md
*.hbs
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 16.20.2
nodejs 18.20.4
8 changes: 4 additions & 4 deletions docs/contracts/permit2/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Permit2",
"position": 4,
"collapsed": true
}
"label": "Permit2",
"position": 4,
"collapsed": true
}
9 changes: 4 additions & 5 deletions docs/contracts/permit2/reference/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"label": "Technical Reference",
"position": 2,
"collapsed": false
}

"label": "Technical Reference",
"position": 2,
"collapsed": false
}
8 changes: 4 additions & 4 deletions docs/contracts/uniswapx/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "UniswapX",
"position": 3,
"collapsed": true
}
"label": "UniswapX",
"position": 3,
"collapsed": true
}
9 changes: 4 additions & 5 deletions docs/contracts/uniswapx/guides/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"label": "Guides",
"position": 3,
"collapsed": false
}

"label": "Guides",
"position": 3,
"collapsed": false
}
8 changes: 4 additions & 4 deletions docs/contracts/universal-router/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Universal Router",
"position": 3,
"collapsed": true
}
"label": "Universal Router",
"position": 3,
"collapsed": true
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"label": "Interfaces"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"label": "Pool"
}
}
2 changes: 1 addition & 1 deletion docs/contracts/v3/reference/core/libraries/_category_.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"label": "Libraries"
}
}
7 changes: 3 additions & 4 deletions docs/contracts/v4/quickstart/04-hooks/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"label": "Hooks",
"collapsed": true
}

"label": "Hooks",
"collapsed": true
}
8 changes: 5 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,11 @@ module.exports = {
blogSidebarCount: 0,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
customCss2: require.resolve('./src/css/font.css'),
customCss3: require.resolve('./src/css/types.css'),
customCss: [
require.resolve('./src/css/custom.css'),
require.resolve('./src/css/font.css'),
require.resolve('./src/css/types.css'),
],
},
},
],
Expand Down
9 changes: 4 additions & 5 deletions examples/sdk/AddAndRemoveLiquidity.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Pool, Position, NonfungiblePositionManager, nearestUsableTick } from '@uniswap/v3-sdk'

import { ethers } from 'ethers'
import { Percent, Token, CurrencyAmount } from '@uniswap/sdk-core'
import { CurrencyAmount, Percent, Token } from '@uniswap/sdk-core'
import { abi as IUniswapV3PoolABI } from '@uniswap/v3-core/artifacts/contracts/interfaces/IUniswapV3Pool.sol/IUniswapV3Pool.json'
import { nearestUsableTick, NonfungiblePositionManager, Pool, Position } from '@uniswap/v3-sdk'
import { ethers } from 'ethers'

// default uses “http://localhost:8545”
// can also input your own connection with "https://mainnet.infura.io/v3/<YOUR-ENDPOINT-HERE>" as an input
Expand Down Expand Up @@ -75,7 +74,7 @@ async function liquidityExamples(sender: string, exampleType: number) {
immutables.fee,
state.sqrtPriceX96.toString(),
state.liquidity.toString(),
state.tick
state.tick,
)

// create a position with the pool
Expand Down
27 changes: 17 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@
"deploy": "docusaurus deploy",
"serve": "docusaurus serve",
"clear": "docusaurus clear",
"lint": "yarn eslint src"
"lint": "yarn eslint src",
"test:types": "tsc --noEmit",
"prettier:check": "prettier --check .",
"prettier:write": "prettier --write .",
"check-licensure": "license-checker --production --failOn 'AGPL-1.0-only;AGPL-1.0-or-later;AGPL-3.0-only;AGPL-3.0-or-later;BSD-Protection;CC-BY-NC-SA-1.0;CC-BY-NC-SA-2.0;CC-BY-NC-SA-2.5;CC-BY-NC-SA-3.0;CC-BY-NC-SA-4.0;CC-BY-SA-1.0;CC-BY-SA-2.0;CC-BY-SA-2.5;CC-BY-SA-3.0;CC-BY-SA-4.0;CDDL-1.0;CDDL-1.1;CPAL-1.0;CPL-1.0;EPL-2.0;ErlPL-1.1;GPL-2.0-only;GPL-2.0-or-later;GPL-3.0-only;GPL-3.0-or-later;IPL-1.0;LGPL-2.0-only;LGPL-2.0-or-later;LGPL-2.1-only;LGPL-2.1-or-later;LGPL-3.0-only;LGPL-3.0-or-later;MPL-1.0;MPL-1.1;MS-RL;NPOSL-3.0;ODbL-1.0;OSL-1.0;OSL-1.1;OSL-2.0;OSL-2.1;OSL-3.0;Parity-6.0.0;QPL-1.0;RPL-1.1;RPL-1.5;SPL-1.0;Sleepycat'",
"test:all": "yarn run check-licensure && yarn lint && yarn run tsc --noEmit && yarn prettier:write && yarn prettier --check ."
},
"dependencies": {
"@algolia/autocomplete-preset-algolia": "^1.1.0",
"@algolia/client-search": "^4.9.1",
"@babel/core": "^7.14.6",
"@docusaurus/core": "^2.0.0-beta.17",
"@docusaurus/plugin-client-redirects": "2.0.0-beta.17",
"@docusaurus/plugin-content-docs": "^2.0.0-beta.17",
"@docusaurus/preset-classic": "^2.0.0-beta.17",
"@docusaurus/remark-plugin-npm2yarn": "^2.0.0-beta.17",
"@docusaurus/theme-search-algolia": "^2.0.0-beta.17",
"@docusaurus/core": "2.4.3",
"@docusaurus/plugin-client-redirects": "2.4.3",
"@docusaurus/plugin-content-docs": "2.4.3",
"@docusaurus/preset-classic": "2.4.3",
"@docusaurus/remark-plugin-npm2yarn": "2.4.3",
"@docusaurus/theme-search-algolia": "2.4.3",
"@mdx-js/react": "^1.6.21",
"@saucelabs/theme-github-codeblock": "https://github.com/Uniswap/docusaurus-theme-github-codeblock.git#f55fe4caed9fce974c9b82bf2164f76cc5509eef",
"@types/react": "^17.0.11",
Expand All @@ -31,11 +36,13 @@
"clsx": "^1.1.1",
"hast-util-is-element": "1.1.0",
"intl-locales-supported": "^1.8.12",
"license-checker": "^25.0.1",
"react": "18",
"react-dom": "18",
"react-feather": "^2.0.10",
"rehype-katex": "5",
"remark-math": "3",
"url": "^0.11.4",
"web-vitals": "2.1.0"
},
"browserslist": {
Expand All @@ -51,7 +58,7 @@
]
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.1.0",
"@docusaurus/module-type-aliases": "2.4.3",
"@tsconfig/docusaurus": "^1.0.6",
"@typescript-eslint/eslint-plugin": "^4",
"@typescript-eslint/parser": "^4",
Expand All @@ -67,13 +74,13 @@
"eslint-plugin-typescript-sort-keys": "^2.1.0",
"eslint-plugin-unused-imports": "^2.0.0",
"postcss": "^8.4.47",
"prettier": "2.7.1",
"prettier": "3.3.3",
"tailwindcss": "^3.4.13",
"typescript": "^4.8.4"
},
"engines": {
"npm": "please-use-yarn",
"node": "16",
"node": "18.20.4",
"yarn": ">=1.22"
}
}
2 changes: 1 addition & 1 deletion src/components/SentimentTracking/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function SentimentTracking({ analyticsSection }: { analyticsSecti

const isSentimentSelected = useCallback(
(sentiment: Sentiment) => selectedSentiment && selectedSentiment === sentiment,
[selectedSentiment]
[selectedSentiment],
)

return (
Expand Down
13 changes: 13 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
/* stylelint-disable docusaurus/copyright-header */
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/

/* You can override the default Infima variables here. */

@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';

@import './font.css';
@import './types.css';

:root {
/* add override here */
}
2 changes: 2 additions & 0 deletions src/css/types.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'tailwindcss/utilities';

@layer utilities {
.serif-heading-0 {
@apply font-riegraf;
Expand Down
Loading

0 comments on commit 0bf0e60

Please sign in to comment.