Commit 91f5fc08 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

chore: upgrade redux-multicall and smart-order-router (#3623)

* chore: upgrade redux-multicall and smart-order-router

* chore: provide @ethersproject through ethers
parent ec831f84
...@@ -193,29 +193,15 @@ ...@@ -193,29 +193,15 @@
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.0", "@babel/runtime": "^7.17.0",
"@ethersproject/abi": "^5.4.1",
"@ethersproject/abstract-provider": "^5.4.1",
"@ethersproject/abstract-signer": "^5.4.1",
"@ethersproject/address": "^5.4.0",
"@ethersproject/bignumber": "^5.4.2",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/constants": "^5.4.0",
"@ethersproject/contracts": "^5.4.1",
"@ethersproject/experimental": "^5.4.0", "@ethersproject/experimental": "^5.4.0",
"@ethersproject/hash": "^5.4.0",
"@ethersproject/providers": "^5.4.0",
"@ethersproject/solidity": "^5.4.0",
"@ethersproject/strings": "^5.4.0",
"@ethersproject/units": "^5.4.0",
"@ethersproject/wallet": "^5.4.0",
"@fontsource/ibm-plex-mono": "^4.5.1", "@fontsource/ibm-plex-mono": "^4.5.1",
"@fontsource/inter": "^4.5.1", "@fontsource/inter": "^4.5.1",
"@popperjs/core": "^2.4.4", "@popperjs/core": "^2.4.4",
"@reduxjs/toolkit": "^1.6.1", "@reduxjs/toolkit": "^1.6.1",
"@uniswap/redux-multicall": "^1.0.0", "@uniswap/redux-multicall": "^1.1.1",
"@uniswap/router-sdk": "^1.0.3", "@uniswap/router-sdk": "^1.0.3",
"@uniswap/sdk-core": "^3.0.1", "@uniswap/sdk-core": "^3.0.1",
"@uniswap/smart-order-router": "^2.5.20", "@uniswap/smart-order-router": "^2.5.26",
"@uniswap/token-lists": "^1.0.0-beta.27", "@uniswap/token-lists": "^1.0.0-beta.27",
"@uniswap/v2-sdk": "^3.0.1", "@uniswap/v2-sdk": "^3.0.1",
"@uniswap/v3-sdk": "^3.8.2", "@uniswap/v3-sdk": "^3.8.2",
......
...@@ -37,6 +37,11 @@ function isAsset(source: string) { ...@@ -37,6 +37,11 @@ function isAsset(source: string) {
return extname && [...ASSET_EXTENSIONS, '.css', '.scss'].includes(extname) return extname && [...ASSET_EXTENSIONS, '.css', '.scss'].includes(extname)
} }
function isEthers(source: string) {
// @ethersproject/* modules are provided by ethers, with the exception of experimental.
return source.startsWith('@ethersproject/') && !source.endsWith('experimental')
}
const TS_CONFIG = './tsconfig.lib.json' const TS_CONFIG = './tsconfig.lib.json'
// eslint-disable-next-line @typescript-eslint/no-var-requires // eslint-disable-next-line @typescript-eslint/no-var-requires
const { baseUrl, paths }: CompilerOptions = require(TS_CONFIG).compilerOptions const { baseUrl, paths }: CompilerOptions = require(TS_CONFIG).compilerOptions
...@@ -60,7 +65,7 @@ const plugins = [ ...@@ -60,7 +65,7 @@ const plugins = [
const check = { const check = {
input: 'src/lib/index.tsx', input: 'src/lib/index.tsx',
output: { file: 'dist/widgets.tsc', inlineDynamicImports: true }, output: { file: 'dist/widgets.tsc', inlineDynamicImports: true },
external: isAsset, external: (source: string) => isAsset(source) || isEthers(source),
plugins: [ plugins: [
externals({ exclude: ['constants'], deps: true, peerDeps: true }), // marks builtins, dependencies, and peerDependencies external externals({ exclude: ['constants'], deps: true, peerDeps: true }), // marks builtins, dependencies, and peerDependencies external
...plugins, ...plugins,
...@@ -72,7 +77,7 @@ const check = { ...@@ -72,7 +77,7 @@ const check = {
const type = { const type = {
input: 'dist/dts/lib/index.d.ts', input: 'dist/dts/lib/index.d.ts',
output: { file: 'dist/index.d.ts' }, output: { file: 'dist/index.d.ts' },
external: isAsset, external: (source: string) => isAsset(source) || isEthers(source),
plugins: [ plugins: [
externals({ exclude: ['constants'], deps: true, peerDeps: true }), externals({ exclude: ['constants'], deps: true, peerDeps: true }),
dts({ compilerOptions: { baseUrl: 'dist/dts' } }), dts({ compilerOptions: { baseUrl: 'dist/dts' } }),
...@@ -112,6 +117,7 @@ const transpile = { ...@@ -112,6 +117,7 @@ const transpile = {
sourcemap: false, sourcemap: false,
}, },
], ],
external: isEthers,
plugins: [ plugins: [
externals({ externals({
exclude: [ exclude: [
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment