From ff72277e002ebea8a67cd0f01de78268940da9f0 Mon Sep 17 00:00:00 2001 From: poocart <7067483+poocart@users.noreply.github.com> Date: Fri, 17 Mar 2023 14:53:17 +0200 Subject: [PATCH] removed rollup node resolve, other types chores --- example/package-lock.json | 12 +-- example/package.json | 2 +- example/src/App.tsx | 4 +- package-lock.json | 110 +----------------------- package.json | 3 +- rollup.config.js | 4 - src/components/EtherspotTransaction.tsx | 10 ++- 7 files changed, 22 insertions(+), 123 deletions(-) diff --git a/example/package-lock.json b/example/package-lock.json index 9768a56..3081cd8 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", - "@etherspot/transaction-kit": "^0.0.13", + "@etherspot/transaction-kit": "^0.0.22", "@mui/lab": "^5.0.0-alpha.118", "@mui/material": "^5.11.7", "@types/node": "^16.18.11", @@ -27,14 +27,15 @@ }, "..": { "name": "@etherspot/transaction-kit", - "version": "0.0.13", + "version": "0.0.23", "license": "MIT", "dependencies": { - "@etherspot/react-etherspot": "^1.0.0", + "@etherspot/react-etherspot": "^1.0.1", "buffer": "^6.0.3", "ethers": "^5.6.9", "etherspot": "^1.41.2", - "react": "^18.2.0", + "lodash.uniq": "^4.5.0", + "react": ">=18.2.0", "react-dom": "^18.2.0", "reflect-metadata": "^0.1.13", "rxjs": "^6.6.7" @@ -49,6 +50,7 @@ "@rollup/plugin-typescript": "^8.3.3", "@testing-library/react": "^13.4.0", "@types/jest": "^29.2.5", + "@types/lodash.uniq": "^4.5.7", "@types/react": "^18.0.15", "babel-jest": "^29.3.1", "babel-loader": "^8.2.5", @@ -63,7 +65,7 @@ "typescript": "^4.7.4" }, "peerDependencies": { - "react": ">=16.0.0" + "react": ">=18.2.0" } }, "node_modules/@ampproject/remapping": { diff --git a/example/package.json b/example/package.json index 1bc0c97..abee2d4 100644 --- a/example/package.json +++ b/example/package.json @@ -5,7 +5,7 @@ "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", - "@etherspot/transaction-kit": "^0.0.13", + "@etherspot/transaction-kit": "^0.0.23", "@mui/lab": "^5.0.0-alpha.118", "@mui/material": "^5.11.7", "@types/node": "^16.18.11", diff --git a/example/src/App.tsx b/example/src/App.tsx index 46e7431..45f4306 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -7,7 +7,9 @@ import { useEtherspotUi, IEstimatedBatches, ISmartWalletAddress, - EstimatedBatch, ISentBatches, SentBatch, + EstimatedBatch, + ISentBatches, + SentBatch, } from '@etherspot/transaction-kit'; import { ethers } from 'ethers'; import { Box, Button, Chip, Container, Paper, Tab, Tabs, Typography } from '@mui/material'; diff --git a/package-lock.json b/package-lock.json index 154d733..5d1bad3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@etherspot/transaction-kit", - "version": "0.0.20", + "version": "0.0.23", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@etherspot/transaction-kit", - "version": "0.0.20", + "version": "0.0.23", "license": "MIT", "dependencies": { "@etherspot/react-etherspot": "^1.0.1", @@ -25,7 +25,6 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.18.6", "@jest/globals": "^29.3.1", - "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-typescript": "^8.3.3", "@testing-library/react": "^13.4.0", @@ -3306,31 +3305,6 @@ "ethers": "^5.7.2" } }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.1.tgz", - "integrity": "sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "@types/resolve": "1.20.2", - "deepmerge": "^4.2.2", - "is-builtin-module": "^3.2.0", - "is-module": "^1.0.0", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.78.0||^3.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, "node_modules/@rollup/plugin-replace": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.2.tgz", @@ -3794,12 +3768,6 @@ "@types/react": "*" } }, - "node_modules/@types/resolve": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", - "dev": true - }, "node_modules/@types/scheduler": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", @@ -4628,18 +4596,6 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -6095,21 +6051,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-builtin-module": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", - "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", - "dev": true, - "dependencies": { - "builtin-modules": "^3.3.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -6176,12 +6117,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -12829,20 +12764,6 @@ "ethers": "^5.7.2" } }, - "@rollup/plugin-node-resolve": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.1.tgz", - "integrity": "sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^5.0.1", - "@types/resolve": "1.20.2", - "deepmerge": "^4.2.2", - "is-builtin-module": "^3.2.0", - "is-module": "^1.0.0", - "resolve": "^1.22.1" - } - }, "@rollup/plugin-replace": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.2.tgz", @@ -13227,12 +13148,6 @@ "@types/react": "*" } }, - "@types/resolve": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", - "dev": true - }, "@types/scheduler": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", @@ -13908,12 +13823,6 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true - }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -15010,15 +14919,6 @@ "has-tostringtag": "^1.0.0" } }, - "is-builtin-module": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", - "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", - "dev": true, - "requires": { - "builtin-modules": "^3.3.0" - } - }, "is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -15061,12 +14961,6 @@ "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", "dev": true }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true - }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", diff --git a/package.json b/package.json index 3d37b0e..df1e01c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@etherspot/transaction-kit", "description": "React Etherspot Transaction Kit", - "version": "0.0.22", + "version": "0.0.23", "main": "dist/cjs/index.js", "scripts": { "rollup:build": "NODE_OPTIONS=--max-old-space-size=8192 rollup -c", @@ -43,7 +43,6 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.18.6", "@jest/globals": "^29.3.1", - "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-typescript": "^8.3.3", "@testing-library/react": "^13.4.0", diff --git a/rollup.config.js b/rollup.config.js index c73d149..3f0c0e3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,7 +2,6 @@ import typescript from '@rollup/plugin-typescript'; import dts from 'rollup-plugin-dts'; import dotenv from 'dotenv'; import replace from '@rollup/plugin-replace'; -import resolve from '@rollup/plugin-node-resolve'; dotenv.config(); @@ -28,9 +27,6 @@ export default [ tsconfig: './tsconfig.json', exclude: ['./example/**', './src/test/**'] }), - resolve({ - browser: true, - }), replace({ __ETHERSPOT_PROJECT_KEY__: process.env.ETHERSPOT_PROJECT_KEY ?? '', preventAssignment: true, diff --git a/src/components/EtherspotTransaction.tsx b/src/components/EtherspotTransaction.tsx index 896f117..73c9b0c 100644 --- a/src/components/EtherspotTransaction.tsx +++ b/src/components/EtherspotTransaction.tsx @@ -14,7 +14,13 @@ interface EtherspotTransactionProps extends ITransaction { children?: React.ReactNode; } -const EtherspotTransaction = ({ children, to, data, value, id: transactionId }: EtherspotTransactionProps) => { +const EtherspotTransaction = ({ + children, + to, + data, + value, + id: transactionId, +}: EtherspotTransactionProps): JSX.Element => { const context = useContext(EtherspotBatchContext); const componentId = useId(); @@ -42,7 +48,7 @@ const EtherspotTransaction = ({ children, to, data, value, id: transactionId }: } }, [componentId, to, data, value, transactionId]); - return children; + return <>{children}; }; export default EtherspotTransaction;