-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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: merge widgets work into main #3065
Changes from 33 commits
d520f4d
224ee8e
2d9b81d
c42d3ce
565d051
54dca94
56b2f78
5730dd4
dae6c0e
b996277
f0d5fd4
fe129da
5b6c667
f264797
f41f0f8
3447304
416eefe
6fa8e05
1528a75
2cb1d0e
64979f8
00f1523
e60840c
57144b0
6084452
b30af78
38f4655
263840f
0f70c08
c4199ee
769b2c4
67eaeb4
70a3215
3f8919b
6b383b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
REACT_APP_INFURA_KEY="4bf032f2d38a4ed6bb975b80d6340847" | ||
REACT_APP_INFURA_KEY="4bf032f2d38a4ed6bb975b80d6340847" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Bundle Dependency Check | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- widgets | ||
pull_request: | ||
branches: | ||
- main | ||
- widgets | ||
|
||
jobs: | ||
depcheck: | ||
name: Bundle depcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v2 | ||
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: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Bundle | ||
run: yarn bundle | ||
|
||
- name: Depcheck | ||
run: yarn bundle:depcheck |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,11 @@ on: | |
push: | ||
branches: | ||
- main | ||
- widgets | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
pull_request: | ||
branches: | ||
- main | ||
- widgets | ||
|
||
jobs: | ||
integration-tests: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,11 @@ on: | |
push: | ||
branches: | ||
- main | ||
- widgets | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
pull_request: | ||
branches: | ||
- main | ||
- widgets | ||
|
||
jobs: | ||
run-linters: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,11 @@ on: | |
push: | ||
branches: | ||
- main | ||
- widgets | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
pull_request: | ||
branches: | ||
- main | ||
- widgets | ||
|
||
jobs: | ||
unit-tests: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"staticPath": "public", | ||
"watchDirs": ["src"], | ||
"watchDirs": ["src/lib"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeeah, was wondering about this one |
||
"webpack": { | ||
"configPath": "react-scripts/config/webpack.config" | ||
"configPath": "react-scripts/config/webpack.config", | ||
"overridePath": "cosmos.override.js" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const HtmlWebpackPlugin = require('html-webpack-plugin') | ||
|
||
// Renders the cosmos fixtures in isolation, instead of using public/index.html. | ||
module.exports = (webpackConfig) => ({ | ||
...webpackConfig, | ||
plugins: webpackConfig.plugins.map((plugin) => | ||
plugin instanceof HtmlWebpackPlugin | ||
? new HtmlWebpackPlugin({ | ||
templateContent: '<body></body>', | ||
}) | ||
: plugin | ||
), | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/node | ||
/** | ||
* Checks if any dependencies have been bundled with the interface library. | ||
* Exits with non-zero status if dependencies are included in the bundle. | ||
*/ | ||
/* eslint-disable */ | ||
|
||
const { readFile } = require('fs') | ||
|
||
function checkDeps(err, sourcemap) { | ||
if (err) { | ||
console.error(err) | ||
process.exit(1) | ||
} | ||
|
||
const includesDeps = sourcemap.includes('node_modules') | ||
if (includesDeps) { | ||
const deps = [...sourcemap.toString().matchAll(/node_modules[\\\/]([^\\\/]*)/g)].map(([, match]) => match) | ||
console.error(` | ||
Sourcemap includes node_modules folder(s). External deps must be bundled under "dependencies". | ||
|
||
To fix, run: \`yarn add ${deps.join(' ')}\` | ||
`) | ||
process.exit(1) | ||
} | ||
} | ||
|
||
readFile('dist/interface.esm.js.map', checkDeps) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,12 @@ | |
"@graphql-codegen/typescript-operations": "^1.18.2", | ||
"@graphql-codegen/typescript-rtk-query": "^1.1.1", | ||
"@lingui/cli": "^3.9.0", | ||
"@lingui/macro": "^3.9.0", | ||
"@lingui/react": "^3.9.0", | ||
"@metamask/jazzicon": "^2.0.0", | ||
"@popperjs/core": "^2.4.4", | ||
"@reach/dialog": "^0.10.3", | ||
"@reach/portal": "^0.10.3", | ||
"@react-hook/window-scroll": "^1.3.0", | ||
"@reduxjs/toolkit": "^1.6.1", | ||
"@svgr/cli": "^5.5.0", | ||
"@testing-library/jest-dom": "^5.14.1", | ||
"@testing-library/react": "^12.0.0", | ||
"@testing-library/react-hooks": "^7.0.2", | ||
|
@@ -54,13 +52,13 @@ | |
"@types/wcag-contrast": "^3.0.0", | ||
"@typescript-eslint/eslint-plugin": "^4.1.0", | ||
"@typescript-eslint/parser": "^4.1.0", | ||
"@uniswap/default-token-list": "^2.1.0", | ||
"@uniswap/governance": "^1.0.2", | ||
"@uniswap/liquidity-staker": "^1.0.2", | ||
"@uniswap/merkle-distributor": "1.0.1", | ||
"@uniswap/redux-multicall": "^1.0.0", | ||
"@uniswap/router-sdk": "^1.0.1", | ||
"@uniswap/router-sdk": "^1.0.3", | ||
"@uniswap/sdk-core": "^3.0.1", | ||
"@uniswap/smart-order-router": "^2.5.7", | ||
"@uniswap/smart-order-router": "^2.5.4", | ||
"@uniswap/token-lists": "^1.0.0-beta.27", | ||
"@uniswap/v2-core": "1.0.0", | ||
"@uniswap/v2-periphery": "^1.1.0-beta.0", | ||
|
@@ -84,6 +82,7 @@ | |
"d3": "^7.0.0", | ||
"eslint": "^7.11.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-better-styled-components": "^1.1.2", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-react": "^7.19.0", | ||
"eslint-plugin-react-hooks": "^4.0.0", | ||
|
@@ -99,32 +98,23 @@ | |
"ms.macro": "^2.0.0", | ||
"multicodec": "^3.0.1", | ||
"multihashes": "^4.0.2", | ||
"node-vibrant": "^3.2.1-alpha.1", | ||
"polished": "^3.3.2", | ||
"polyfill-object.fromentries": "^1.0.1", | ||
"prettier": "^2.2.1", | ||
"qs": "^6.9.4", | ||
"react": "^17.0.1", | ||
"react-confetti": "^6.0.0", | ||
"react-cosmos": "^5.6.3", | ||
"react-dom": "^17.0.1", | ||
"react-feather": "^2.0.8", | ||
"react-ga": "^2.5.7", | ||
"react-is": "^17.0.2", | ||
"react-markdown": "^4.3.1", | ||
"react-popper": "^2.2.3", | ||
"react-redux": "^7.2.2", | ||
"react-router-dom": "^5.0.0", | ||
"react-scripts": "^4.0.3", | ||
"react-spring": "^8.0.27", | ||
"react-use-gesture": "^6.0.14", | ||
"react-virtualized-auto-sizer": "^1.0.2", | ||
"react-window": "^1.8.5", | ||
"rebass": "^4.0.7", | ||
"redux-localstorage-simple": "^2.3.1", | ||
"sass": "^1.45.1", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zzmp what's this doing here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The |
||
"serve": "^11.3.2", | ||
"start-server-and-test": "^1.11.0", | ||
"styled-components": "^5.3.0", | ||
"typechain": "^5.0.0", | ||
"typescript": "^4.2.3", | ||
"ua-parser-js": "^0.7.28", | ||
|
@@ -147,13 +137,18 @@ | |
"prei18n:extract": "touch src/locales/en-US.po", | ||
"i18n:extract": "lingui extract --locale en-US", | ||
"i18n:compile": "yarn i18n:extract && lingui compile", | ||
"postinstall": "yarn contracts:compile && yarn graphql:generate && yarn i18n:compile", | ||
"i18n:pseudo": "lingui extract --locale pseudo && lingui compile", | ||
"postinstall": "yarn contracts:compile && yarn graphql:generate && yarn i18n:compile && yarn assets:generate", | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test --env=./custom-test-env.js", | ||
"test:e2e": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run --record'", | ||
"bundle": "microbundle --tsconfig tsconfig.lib.json src/lib/index.tsx --format esm,cjs", | ||
"cosmos": "open http://localhost:5000 && cross-env FAST_REFRESH=false cosmos" | ||
"assets:generate": "yarn assets:svg:generate && yarn assets:font:generate", | ||
"assets:svg:generate": "svgr -d src/lib/assets/svg --ext tsx --typescript src/lib/assets/svg && rm src/lib/assets/svg/index.tsx", | ||
"assets:font:generate": "sass src/lib/assets/fonts/index.scss src/lib/assets/fonts/index.css --no-source-map -I node_modules", | ||
"bundle": "microbundle --define process.env.REACT_APP_IS_WIDGET=true --tsconfig tsconfig.lib.json src/lib/index.tsx --format esm,cjs", | ||
"bundle:depcheck": "node depcheck.js", | ||
"cosmos": "cross-env FAST_REFRESH=false REACT_APP_IS_WIDGET=true cosmos" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
|
@@ -168,5 +163,37 @@ | |
] | ||
}, | ||
"license": "GPL-3.0-or-later", | ||
"dependencies": {} | ||
"dependencies": { | ||
"@fontsource/ibm-plex-mono": "^4.5.1", | ||
"@fontsource/inter": "^4.5.1", | ||
"@lingui/core": "^3.9.0", | ||
"@lingui/macro": "^3.9.0", | ||
"@lingui/react": "^3.9.0", | ||
"@popperjs/core": "^2.4.4", | ||
"@uniswap/redux-multicall": "^1.0.0", | ||
"immer": "^9.0.6", | ||
"jotai": "^1.3.7", | ||
"lodash": "^4.17.21", | ||
"make-plural": "^7.0.0", | ||
"node-vibrant": "^3.2.1-alpha.1", | ||
"polished": "^3.3.2", | ||
"popper-max-size-modifier": "^0.2.0", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"react-feather": "^2.0.8", | ||
"react-popper": "^2.2.3", | ||
"react-virtualized-auto-sizer": "^1.0.2", | ||
"react-window": "^1.8.5", | ||
"rebass": "^4.0.7", | ||
"redux": "^4.1.2", | ||
"styled-components": "^5.3.0", | ||
"tiny-invariant": "^1.2.0", | ||
"wcag-contrast": "^3.0.0", | ||
"wicg-inert": "^3.1.1", | ||
"widgets-web3-react/core": "npm:@web3-react/core@8.0.15-alpha.0", | ||
"widgets-web3-react/eip1193": "npm:@web3-react/eip1193@8.0.15-alpha.0", | ||
"widgets-web3-react/metamask": "npm:@web3-react/metamask@8.0.15-alpha.0", | ||
"widgets-web3-react/network": "npm:@web3-react/network@8.0.15-alpha.0", | ||
"widgets-web3-react/types": "npm:@web3-react/types@8.0.15-alpha.0" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
widgets
from bothbranches
lists