From 2fa8a5c0dc5634b33b33314b4da65e059a405fd4 Mon Sep 17 00:00:00 2001 From: Karelian Pie Date: Fri, 4 Aug 2023 15:19:59 +0300 Subject: [PATCH 1/5] feat: Remove docs and playground packages --- .../web-lib/.editorconfig => .editorconfig | 0 .../web-lib/.eslintignore => .eslintignore | 0 .../web-lib/.eslintrc.cjs => .eslintrc.cjs | 0 packages/web-lib/.npmignore => .npmignore | 0 LICENSE.md | 2 +- README.md | 14 +- .../components => components}/Banner.tsx | 0 .../components => components}/Button.tsx | 0 .../components => components}/Header.tsx | 0 .../components => components}/Modal.tsx | 0 .../components => components}/ModalLogin.tsx | 9 +- .../ModalMobileMenu.tsx | 0 .../components => components}/Renderable.tsx | 0 .../components => components}/yToast.tsx | 0 .../contexts => contexts}/WithYearn.tsx | 0 .../contexts => contexts}/useSettings.tsx | 0 .../web-lib/contexts => contexts}/useUI.tsx | 0 .../web-lib/contexts => contexts}/useWeb3.tsx | 2 +- .../web-lib/contexts => contexts}/utils.ts | 0 .../web-lib/hooks => hooks}/useAddToken.ts | 0 .../web-lib/hooks => hooks}/useAutoConnect.ts | 0 .../web-lib/hooks => hooks}/useBalances.tsx | 0 {packages/web-lib/hooks => hooks}/useChain.ts | 0 .../web-lib/hooks => hooks}/useChainID.tsx | 0 .../hooks => hooks}/useClientEffect.tsx | 0 .../web-lib/hooks => hooks}/useDebounce.tsx | 0 .../hooks => hooks}/useDismissToasts.ts | 0 .../web-lib/hooks => hooks}/useExplorer.tsx | 0 .../hooks => hooks}/useInjectedWallet.tsx | 0 .../hooks => hooks}/useLocalStorage.tsx | 0 .../hooks => hooks}/useSessionStorage.ts | 0 .../hooks => hooks}/useSupportedChainsID.tsx | 0 .../hooks => hooks}/useWindowInFocus.tsx | 0 .../icons => icons}/IconAddToMetamask.tsx | 0 .../icons => icons}/IconAlertCritical.tsx | 0 .../icons => icons}/IconAlertError.tsx | 0 .../icons => icons}/IconAlertWarning.tsx | 0 .../web-lib/icons => icons}/IconArrowDown.tsx | 0 .../web-lib/icons => icons}/IconCheckmark.tsx | 0 .../web-lib/icons => icons}/IconChevron.tsx | 0 .../icons => icons}/IconChevronBottom.tsx | 0 .../web-lib/icons => icons}/IconCopy.tsx | 0 .../web-lib/icons => icons}/IconCross.tsx | 0 .../web-lib/icons => icons}/IconDashboard.tsx | 0 .../web-lib/icons => icons}/IconGrip.tsx | 0 .../web-lib/icons => icons}/IconHamburger.tsx | 0 .../web-lib/icons => icons}/IconHome.tsx | 0 .../web-lib/icons => icons}/IconLabs.tsx | 0 .../web-lib/icons => icons}/IconLinkOut.tsx | 0 .../web-lib/icons => icons}/IconLoader.tsx | 0 .../web-lib/icons => icons}/IconLogoYearn.tsx | 0 .../icons => icons}/IconNetworkArbitrum.tsx | 0 .../icons => icons}/IconNetworkEthereum.tsx | 0 .../icons => icons}/IconNetworkFantom.tsx | 0 .../icons => icons}/IconNetworkOptimism.tsx | 0 .../web-lib/icons => icons}/IconSearch.tsx | 0 .../web-lib/icons => icons}/IconSettings.tsx | 0 .../icons => icons}/IconSocialDiscord.tsx | 0 .../icons => icons}/IconSocialGithub.tsx | 0 .../icons => icons}/IconSocialMedium.tsx | 0 .../icons => icons}/IconSocialTwitter.tsx | 0 .../web-lib/icons => icons}/IconThemeDark.tsx | 0 .../icons => icons}/IconThemeLight.tsx | 0 .../web-lib/icons => icons}/IconVault.tsx | 0 .../web-lib/icons => icons}/IconWallet.tsx | 0 .../icons => icons}/IconWalletCoinbase.tsx | 0 .../icons => icons}/IconWalletFrame.tsx | 0 .../icons => icons}/IconWalletLedger.tsx | 0 .../icons => icons}/IconWalletMetamask.tsx | 0 .../web-lib/icons => icons}/IconWalletOKX.tsx | 0 .../icons => icons}/IconWalletPhantom.tsx | 0 .../icons => icons}/IconWalletSafe.tsx | 0 .../icons => icons}/IconWalletTrustWallet.tsx | 0 .../IconWalletWalletConnect.tsx | 0 .../jest.config.cjs => jest.config.cjs | 0 lerna.json | 5 - package.json | 128 +- packages/docs/.eslintrc.js | 13 - packages/docs/components/CodeExample.tsx | 16 - packages/docs/components/Header.tsx | 70 - packages/docs/components/RadialBackground.tsx | 20 - .../components/specific/DropdownExample.tsx | 31 - .../docs/components/specific/ModalExample.tsx | 31 - packages/docs/middleware.ts | 30 - packages/docs/next-env.d.ts | 5 - packages/docs/next.config.js | 32 - packages/docs/package.json | 40 - packages/docs/pages/_app.tsx | 27 - packages/docs/pages/_document.tsx | 62 - packages/docs/pages/docs/1-install/meta.json | 4 - .../docs/1-install/setup-contexts-hooks.mdx | 144 - .../docs/1-install/setup-tailwindcss.mdx | 93 - packages/docs/pages/docs/2-contexts/meta.json | 5 - .../pages/docs/2-contexts/useSettings.mdx | 98 - packages/docs/pages/docs/2-contexts/useUI.mdx | 60 - .../docs/pages/docs/2-contexts/useWeb3.mdx | 72 - .../docs/pages/docs/3-web3Hooks/meta.json | 5 - .../pages/docs/3-web3Hooks/useAccount.mdx | 53 - .../pages/docs/3-web3Hooks/useBalance.mdx | 136 - .../docs/pages/docs/3-web3Hooks/useBlock.mdx | 123 - .../docs/pages/docs/4-reactHooks/meta.json | 7 - .../docs/4-reactHooks/useClientEffect.mdx | 33 - .../pages/docs/4-reactHooks/useDebounce.mdx | 63 - .../pages/docs/4-reactHooks/useInterval.mdx | 90 - .../docs/4-reactHooks/useLocalStorage.mdx | 60 - .../docs/4-reactHooks/useWindowInFocus.mdx | 32 - packages/docs/pages/docs/5-utils/ABI.mdx | 18 - packages/docs/pages/docs/5-utils/chains.mdx | 170 - packages/docs/pages/docs/5-utils/format.mdx | 182 - packages/docs/pages/docs/5-utils/meta.json | 7 - .../docs/5-utils/performBatchedUpdates.mdx | 19 - .../docs/pages/docs/5-utils/providers.mdx | 92 - .../docs/pages/docs/6-components/button.mdx | 158 - .../docs/pages/docs/6-components/dropdown.mdx | 165 - .../docs/pages/docs/6-components/meta.json | 20 - .../docs/pages/docs/6-components/modal.mdx | 98 - .../docs/pages/docs/7-icons/index.en-US.mdx | 3 - .../docs/pages/docs/7-icons/meta.en-US.json | 3 - packages/docs/pages/docs/intro.mdx | 53 - packages/docs/pages/docs/meta.json | 10 - packages/docs/pages/index.mdx | 110 - packages/docs/pages/meta.json | 15 - packages/docs/postcss.config.js | 10 - packages/docs/public/examples/blue.jpeg | Bin 433212 -> 0 bytes packages/docs/public/examples/goblin-town.jpg | Bin 836941 -> 0 bytes packages/docs/public/examples/mommy-bunny.jpg | Bin 81831 -> 0 bytes packages/docs/public/examples/token.png | Bin 18834 -> 0 bytes packages/docs/public/examples/token2.png | Bin 7339 -> 0 bytes .../public/favicons/android-icon-144x144.png | Bin 7456 -> 0 bytes .../public/favicons/android-icon-192x192.png | Bin 9106 -> 0 bytes .../public/favicons/android-icon-36x36.png | Bin 1857 -> 0 bytes .../public/favicons/android-icon-48x48.png | Bin 2534 -> 0 bytes .../public/favicons/android-icon-72x72.png | Bin 3023 -> 0 bytes .../public/favicons/android-icon-96x96.png | Bin 4798 -> 0 bytes .../public/favicons/apple-icon-114x114.png | Bin 5747 -> 0 bytes .../public/favicons/apple-icon-120x120.png | Bin 6066 -> 0 bytes .../public/favicons/apple-icon-144x144.png | Bin 7456 -> 0 bytes .../public/favicons/apple-icon-152x152.png | Bin 7925 -> 0 bytes .../public/favicons/apple-icon-180x180.png | Bin 9739 -> 0 bytes .../docs/public/favicons/apple-icon-57x57.png | Bin 2505 -> 0 bytes .../docs/public/favicons/apple-icon-60x60.png | Bin 2615 -> 0 bytes .../docs/public/favicons/apple-icon-72x72.png | Bin 3023 -> 0 bytes .../docs/public/favicons/apple-icon-76x76.png | Bin 3102 -> 0 bytes .../favicons/apple-icon-precomposed.png | Bin 9650 -> 0 bytes packages/docs/public/favicons/apple-icon.png | Bin 9650 -> 0 bytes .../docs/public/favicons/browserconfig.xml | 2 - .../docs/public/favicons/favicon-16x16.png | Bin 1102 -> 0 bytes .../docs/public/favicons/favicon-32x32.png | Bin 1834 -> 0 bytes .../docs/public/favicons/favicon-96x96.png | Bin 4798 -> 0 bytes packages/docs/public/favicons/favicon.ico | Bin 1150 -> 0 bytes packages/docs/public/favicons/manifest.json | 41 - .../docs/public/favicons/ms-icon-144x144.png | Bin 7456 -> 0 bytes .../docs/public/favicons/ms-icon-150x150.png | Bin 7754 -> 0 bytes .../docs/public/favicons/ms-icon-310x310.png | Bin 22371 -> 0 bytes .../docs/public/favicons/ms-icon-70x70.png | Bin 2854 -> 0 bytes packages/docs/style.css | 92 - packages/docs/tailwind.config.js | 11 - packages/docs/theme.config.js | 102 - packages/docs/tsconfig.json | 56 - packages/docs/types/nextra.d.ts | 1 - packages/web-lib/package.json | 113 - .../postcss.config.cjs => postcss.config.cjs | 0 .../web-lib/scripts => scripts}/postbuild.sh | 0 packages/web-lib/style.css => style.css | 0 ...tailwind.config.cjs => tailwind.config.cjs | 0 ...tailwind.plugin.cjs => tailwind.plugin.cjs | 0 .../tailwind.theme.cjs => tailwind.theme.cjs | 0 .../web-lib/tsconfig.json => tsconfig.json | 0 {packages/web-lib/types => types}/contexts.ts | 0 {packages/web-lib/types => types}/hooks.ts | 0 {packages/web-lib/types => types}/index.ts | 0 .../utils => utils}/abi/aggregate.abi.ts | 0 .../web-lib/utils => utils}/abi/erc20.abi.ts | 0 .../web-lib/utils => utils}/abi/lens.abi.ts | 0 .../utils => utils}/abi/partner.vault.abi.tsx | 0 .../web-lib/utils => utils}/abi/vault.abi.tsx | 0 .../utils => utils}/abi/zapEthToYvEth.abi.tsx | 0 .../utils => utils}/abi/zapFtmToYvFTM.abi.tsx | 0 {packages/web-lib/utils => utils}/address.ts | 0 {packages/web-lib/utils => utils}/cl.test.ts | 0 {packages/web-lib/utils => utils}/cl.ts | 0 .../web-lib/utils => utils}/constants.ts | 8 +- {packages/web-lib/utils => utils}/decoder.ts | 0 {packages/web-lib/utils => utils}/fetchers.ts | 0 .../utils => utils}/format.bigNumber.test.ts | 0 .../utils => utils}/format.bigNumber.ts | 0 .../utils => utils}/format.number.test.ts | 0 .../web-lib/utils => utils}/format.number.ts | 0 .../web-lib/utils => utils}/format.time.ts | 0 {packages/web-lib/utils => utils}/format.ts | 0 .../utils => utils}/format.value.test.ts | 0 .../web-lib/utils => utils}/format.value.ts | 0 .../handleInputChangeEventValue.test.ts | 0 .../handlers/handleInputChangeEventValue.ts | 0 {packages/web-lib/utils => utils}/helpers.ts | 0 .../web-lib/utils => utils}/isEth.test.ts | 0 {packages/web-lib/utils => utils}/isEth.ts | 0 {packages/web-lib/utils => utils}/isNumber.ts | 0 .../utils => utils}/isTAddress.test.ts | 0 .../web-lib/utils => utils}/isTAddress.ts | 0 .../web-lib/utils => utils}/isZero.test.ts | 0 {packages/web-lib/utils => utils}/isZero.ts | 0 {packages/web-lib/utils => utils}/partners.ts | 0 .../utils => utils}/performBatchedUpdates.ts | 0 .../web-lib/utils => utils}/time.test.ts | 0 {packages/web-lib/utils => utils}/time.ts | 0 .../web-lib/utils => utils}/web3/chains.ts | 0 .../web3/connectors.eip1193.ledger.ts | 0 .../utils => utils}/web3/injectedConnector.ts | 0 .../utils => utils}/web3/ledgerConnector.ts | 0 .../web-lib/utils => utils}/web3/providers.ts | 0 .../utils => utils}/web3/transaction.ts | 0 yarn.lock | 5379 +---------------- 213 files changed, 203 insertions(+), 8350 deletions(-) rename packages/web-lib/.editorconfig => .editorconfig (100%) rename packages/web-lib/.eslintignore => .eslintignore (100%) rename packages/web-lib/.eslintrc.cjs => .eslintrc.cjs (100%) rename packages/web-lib/.npmignore => .npmignore (100%) rename {packages/web-lib/components => components}/Banner.tsx (100%) rename {packages/web-lib/components => components}/Button.tsx (100%) rename {packages/web-lib/components => components}/Header.tsx (100%) rename {packages/web-lib/components => components}/Modal.tsx (100%) rename {packages/web-lib/components => components}/ModalLogin.tsx (84%) rename {packages/web-lib/components => components}/ModalMobileMenu.tsx (100%) rename {packages/web-lib/components => components}/Renderable.tsx (100%) rename {packages/web-lib/components => components}/yToast.tsx (100%) rename {packages/web-lib/contexts => contexts}/WithYearn.tsx (100%) rename {packages/web-lib/contexts => contexts}/useSettings.tsx (100%) rename {packages/web-lib/contexts => contexts}/useUI.tsx (100%) rename {packages/web-lib/contexts => contexts}/useWeb3.tsx (98%) rename {packages/web-lib/contexts => contexts}/utils.ts (100%) rename {packages/web-lib/hooks => hooks}/useAddToken.ts (100%) rename {packages/web-lib/hooks => hooks}/useAutoConnect.ts (100%) rename {packages/web-lib/hooks => hooks}/useBalances.tsx (100%) rename {packages/web-lib/hooks => hooks}/useChain.ts (100%) rename {packages/web-lib/hooks => hooks}/useChainID.tsx (100%) rename {packages/web-lib/hooks => hooks}/useClientEffect.tsx (100%) rename {packages/web-lib/hooks => hooks}/useDebounce.tsx (100%) rename {packages/web-lib/hooks => hooks}/useDismissToasts.ts (100%) rename {packages/web-lib/hooks => hooks}/useExplorer.tsx (100%) rename {packages/web-lib/hooks => hooks}/useInjectedWallet.tsx (100%) rename {packages/web-lib/hooks => hooks}/useLocalStorage.tsx (100%) rename {packages/web-lib/hooks => hooks}/useSessionStorage.ts (100%) rename {packages/web-lib/hooks => hooks}/useSupportedChainsID.tsx (100%) rename {packages/web-lib/hooks => hooks}/useWindowInFocus.tsx (100%) rename {packages/web-lib/icons => icons}/IconAddToMetamask.tsx (100%) rename {packages/web-lib/icons => icons}/IconAlertCritical.tsx (100%) rename {packages/web-lib/icons => icons}/IconAlertError.tsx (100%) rename {packages/web-lib/icons => icons}/IconAlertWarning.tsx (100%) rename {packages/web-lib/icons => icons}/IconArrowDown.tsx (100%) rename {packages/web-lib/icons => icons}/IconCheckmark.tsx (100%) rename {packages/web-lib/icons => icons}/IconChevron.tsx (100%) rename {packages/web-lib/icons => icons}/IconChevronBottom.tsx (100%) rename {packages/web-lib/icons => icons}/IconCopy.tsx (100%) rename {packages/web-lib/icons => icons}/IconCross.tsx (100%) rename {packages/web-lib/icons => icons}/IconDashboard.tsx (100%) rename {packages/web-lib/icons => icons}/IconGrip.tsx (100%) rename {packages/web-lib/icons => icons}/IconHamburger.tsx (100%) rename {packages/web-lib/icons => icons}/IconHome.tsx (100%) rename {packages/web-lib/icons => icons}/IconLabs.tsx (100%) rename {packages/web-lib/icons => icons}/IconLinkOut.tsx (100%) rename {packages/web-lib/icons => icons}/IconLoader.tsx (100%) rename {packages/web-lib/icons => icons}/IconLogoYearn.tsx (100%) rename {packages/web-lib/icons => icons}/IconNetworkArbitrum.tsx (100%) rename {packages/web-lib/icons => icons}/IconNetworkEthereum.tsx (100%) rename {packages/web-lib/icons => icons}/IconNetworkFantom.tsx (100%) rename {packages/web-lib/icons => icons}/IconNetworkOptimism.tsx (100%) rename {packages/web-lib/icons => icons}/IconSearch.tsx (100%) rename {packages/web-lib/icons => icons}/IconSettings.tsx (100%) rename {packages/web-lib/icons => icons}/IconSocialDiscord.tsx (100%) rename {packages/web-lib/icons => icons}/IconSocialGithub.tsx (100%) rename {packages/web-lib/icons => icons}/IconSocialMedium.tsx (100%) rename {packages/web-lib/icons => icons}/IconSocialTwitter.tsx (100%) rename {packages/web-lib/icons => icons}/IconThemeDark.tsx (100%) rename {packages/web-lib/icons => icons}/IconThemeLight.tsx (100%) rename {packages/web-lib/icons => icons}/IconVault.tsx (100%) rename {packages/web-lib/icons => icons}/IconWallet.tsx (100%) rename {packages/web-lib/icons => icons}/IconWalletCoinbase.tsx (100%) rename {packages/web-lib/icons => icons}/IconWalletFrame.tsx (100%) rename {packages/web-lib/icons => icons}/IconWalletLedger.tsx (100%) rename {packages/web-lib/icons => icons}/IconWalletMetamask.tsx (100%) rename {packages/web-lib/icons => icons}/IconWalletOKX.tsx (100%) rename {packages/web-lib/icons => icons}/IconWalletPhantom.tsx (100%) rename {packages/web-lib/icons => icons}/IconWalletSafe.tsx (100%) rename {packages/web-lib/icons => icons}/IconWalletTrustWallet.tsx (100%) rename {packages/web-lib/icons => icons}/IconWalletWalletConnect.tsx (100%) rename packages/web-lib/jest.config.cjs => jest.config.cjs (100%) delete mode 100755 lerna.json delete mode 100755 packages/docs/.eslintrc.js delete mode 100755 packages/docs/components/CodeExample.tsx delete mode 100755 packages/docs/components/Header.tsx delete mode 100755 packages/docs/components/RadialBackground.tsx delete mode 100755 packages/docs/components/specific/DropdownExample.tsx delete mode 100755 packages/docs/components/specific/ModalExample.tsx delete mode 100755 packages/docs/middleware.ts delete mode 100755 packages/docs/next-env.d.ts delete mode 100755 packages/docs/next.config.js delete mode 100755 packages/docs/package.json delete mode 100755 packages/docs/pages/_app.tsx delete mode 100755 packages/docs/pages/_document.tsx delete mode 100755 packages/docs/pages/docs/1-install/meta.json delete mode 100755 packages/docs/pages/docs/1-install/setup-contexts-hooks.mdx delete mode 100755 packages/docs/pages/docs/1-install/setup-tailwindcss.mdx delete mode 100755 packages/docs/pages/docs/2-contexts/meta.json delete mode 100755 packages/docs/pages/docs/2-contexts/useSettings.mdx delete mode 100755 packages/docs/pages/docs/2-contexts/useUI.mdx delete mode 100755 packages/docs/pages/docs/2-contexts/useWeb3.mdx delete mode 100755 packages/docs/pages/docs/3-web3Hooks/meta.json delete mode 100755 packages/docs/pages/docs/3-web3Hooks/useAccount.mdx delete mode 100755 packages/docs/pages/docs/3-web3Hooks/useBalance.mdx delete mode 100755 packages/docs/pages/docs/3-web3Hooks/useBlock.mdx delete mode 100755 packages/docs/pages/docs/4-reactHooks/meta.json delete mode 100755 packages/docs/pages/docs/4-reactHooks/useClientEffect.mdx delete mode 100755 packages/docs/pages/docs/4-reactHooks/useDebounce.mdx delete mode 100755 packages/docs/pages/docs/4-reactHooks/useInterval.mdx delete mode 100755 packages/docs/pages/docs/4-reactHooks/useLocalStorage.mdx delete mode 100755 packages/docs/pages/docs/4-reactHooks/useWindowInFocus.mdx delete mode 100755 packages/docs/pages/docs/5-utils/ABI.mdx delete mode 100755 packages/docs/pages/docs/5-utils/chains.mdx delete mode 100755 packages/docs/pages/docs/5-utils/format.mdx delete mode 100755 packages/docs/pages/docs/5-utils/meta.json delete mode 100755 packages/docs/pages/docs/5-utils/performBatchedUpdates.mdx delete mode 100755 packages/docs/pages/docs/5-utils/providers.mdx delete mode 100755 packages/docs/pages/docs/6-components/button.mdx delete mode 100755 packages/docs/pages/docs/6-components/dropdown.mdx delete mode 100755 packages/docs/pages/docs/6-components/meta.json delete mode 100755 packages/docs/pages/docs/6-components/modal.mdx delete mode 100755 packages/docs/pages/docs/7-icons/index.en-US.mdx delete mode 100755 packages/docs/pages/docs/7-icons/meta.en-US.json delete mode 100755 packages/docs/pages/docs/intro.mdx delete mode 100755 packages/docs/pages/docs/meta.json delete mode 100755 packages/docs/pages/index.mdx delete mode 100755 packages/docs/pages/meta.json delete mode 100755 packages/docs/postcss.config.js delete mode 100755 packages/docs/public/examples/blue.jpeg delete mode 100755 packages/docs/public/examples/goblin-town.jpg delete mode 100755 packages/docs/public/examples/mommy-bunny.jpg delete mode 100755 packages/docs/public/examples/token.png delete mode 100755 packages/docs/public/examples/token2.png delete mode 100755 packages/docs/public/favicons/android-icon-144x144.png delete mode 100755 packages/docs/public/favicons/android-icon-192x192.png delete mode 100755 packages/docs/public/favicons/android-icon-36x36.png delete mode 100755 packages/docs/public/favicons/android-icon-48x48.png delete mode 100755 packages/docs/public/favicons/android-icon-72x72.png delete mode 100755 packages/docs/public/favicons/android-icon-96x96.png delete mode 100755 packages/docs/public/favicons/apple-icon-114x114.png delete mode 100755 packages/docs/public/favicons/apple-icon-120x120.png delete mode 100755 packages/docs/public/favicons/apple-icon-144x144.png delete mode 100755 packages/docs/public/favicons/apple-icon-152x152.png delete mode 100755 packages/docs/public/favicons/apple-icon-180x180.png delete mode 100755 packages/docs/public/favicons/apple-icon-57x57.png delete mode 100755 packages/docs/public/favicons/apple-icon-60x60.png delete mode 100755 packages/docs/public/favicons/apple-icon-72x72.png delete mode 100755 packages/docs/public/favicons/apple-icon-76x76.png delete mode 100755 packages/docs/public/favicons/apple-icon-precomposed.png delete mode 100755 packages/docs/public/favicons/apple-icon.png delete mode 100755 packages/docs/public/favicons/browserconfig.xml delete mode 100755 packages/docs/public/favicons/favicon-16x16.png delete mode 100755 packages/docs/public/favicons/favicon-32x32.png delete mode 100755 packages/docs/public/favicons/favicon-96x96.png delete mode 100755 packages/docs/public/favicons/favicon.ico delete mode 100755 packages/docs/public/favicons/manifest.json delete mode 100755 packages/docs/public/favicons/ms-icon-144x144.png delete mode 100755 packages/docs/public/favicons/ms-icon-150x150.png delete mode 100755 packages/docs/public/favicons/ms-icon-310x310.png delete mode 100755 packages/docs/public/favicons/ms-icon-70x70.png delete mode 100755 packages/docs/style.css delete mode 100755 packages/docs/tailwind.config.js delete mode 100755 packages/docs/theme.config.js delete mode 100755 packages/docs/tsconfig.json delete mode 100755 packages/docs/types/nextra.d.ts delete mode 100755 packages/web-lib/package.json rename packages/web-lib/postcss.config.cjs => postcss.config.cjs (100%) rename {packages/web-lib/scripts => scripts}/postbuild.sh (100%) rename packages/web-lib/style.css => style.css (100%) rename packages/web-lib/tailwind.config.cjs => tailwind.config.cjs (100%) rename packages/web-lib/tailwind.plugin.cjs => tailwind.plugin.cjs (100%) rename packages/web-lib/tailwind.theme.cjs => tailwind.theme.cjs (100%) rename packages/web-lib/tsconfig.json => tsconfig.json (100%) rename {packages/web-lib/types => types}/contexts.ts (100%) rename {packages/web-lib/types => types}/hooks.ts (100%) rename {packages/web-lib/types => types}/index.ts (100%) rename {packages/web-lib/utils => utils}/abi/aggregate.abi.ts (100%) rename {packages/web-lib/utils => utils}/abi/erc20.abi.ts (100%) rename {packages/web-lib/utils => utils}/abi/lens.abi.ts (100%) rename {packages/web-lib/utils => utils}/abi/partner.vault.abi.tsx (100%) rename {packages/web-lib/utils => utils}/abi/vault.abi.tsx (100%) rename {packages/web-lib/utils => utils}/abi/zapEthToYvEth.abi.tsx (100%) rename {packages/web-lib/utils => utils}/abi/zapFtmToYvFTM.abi.tsx (100%) rename {packages/web-lib/utils => utils}/address.ts (100%) rename {packages/web-lib/utils => utils}/cl.test.ts (100%) rename {packages/web-lib/utils => utils}/cl.ts (100%) rename {packages/web-lib/utils => utils}/constants.ts (93%) rename {packages/web-lib/utils => utils}/decoder.ts (100%) rename {packages/web-lib/utils => utils}/fetchers.ts (100%) rename {packages/web-lib/utils => utils}/format.bigNumber.test.ts (100%) rename {packages/web-lib/utils => utils}/format.bigNumber.ts (100%) rename {packages/web-lib/utils => utils}/format.number.test.ts (100%) rename {packages/web-lib/utils => utils}/format.number.ts (100%) rename {packages/web-lib/utils => utils}/format.time.ts (100%) rename {packages/web-lib/utils => utils}/format.ts (100%) rename {packages/web-lib/utils => utils}/format.value.test.ts (100%) rename {packages/web-lib/utils => utils}/format.value.ts (100%) rename {packages/web-lib/utils => utils}/handlers/handleInputChangeEventValue.test.ts (100%) rename {packages/web-lib/utils => utils}/handlers/handleInputChangeEventValue.ts (100%) rename {packages/web-lib/utils => utils}/helpers.ts (100%) rename {packages/web-lib/utils => utils}/isEth.test.ts (100%) rename {packages/web-lib/utils => utils}/isEth.ts (100%) rename {packages/web-lib/utils => utils}/isNumber.ts (100%) rename {packages/web-lib/utils => utils}/isTAddress.test.ts (100%) rename {packages/web-lib/utils => utils}/isTAddress.ts (100%) rename {packages/web-lib/utils => utils}/isZero.test.ts (100%) rename {packages/web-lib/utils => utils}/isZero.ts (100%) rename {packages/web-lib/utils => utils}/partners.ts (100%) rename {packages/web-lib/utils => utils}/performBatchedUpdates.ts (100%) rename {packages/web-lib/utils => utils}/time.test.ts (100%) rename {packages/web-lib/utils => utils}/time.ts (100%) rename {packages/web-lib/utils => utils}/web3/chains.ts (100%) rename {packages/web-lib/utils => utils}/web3/connectors.eip1193.ledger.ts (100%) rename {packages/web-lib/utils => utils}/web3/injectedConnector.ts (100%) rename {packages/web-lib/utils => utils}/web3/ledgerConnector.ts (100%) rename {packages/web-lib/utils => utils}/web3/providers.ts (100%) rename {packages/web-lib/utils => utils}/web3/transaction.ts (100%) diff --git a/packages/web-lib/.editorconfig b/.editorconfig similarity index 100% rename from packages/web-lib/.editorconfig rename to .editorconfig diff --git a/packages/web-lib/.eslintignore b/.eslintignore similarity index 100% rename from packages/web-lib/.eslintignore rename to .eslintignore diff --git a/packages/web-lib/.eslintrc.cjs b/.eslintrc.cjs similarity index 100% rename from packages/web-lib/.eslintrc.cjs rename to .eslintrc.cjs diff --git a/packages/web-lib/.npmignore b/.npmignore similarity index 100% rename from packages/web-lib/.npmignore rename to .npmignore diff --git a/LICENSE.md b/LICENSE.md index c347bd50..aab8bfe6 100755 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 yearn +Copyright (c) 2023 yearn Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index f02510d0..bcbd69dd 100755 --- a/README.md +++ b/README.md @@ -24,20 +24,8 @@ This repo is mirrored on [NPM](https://www.npmjs.com/package/@yearn-finance/web- yarn add @yearn-finance/web-lib ``` -### Useful Commands -- `yarn dev` - Run all packages locally - -### Apps & Packages -The following packages and applications are available - -- `package/docs`: Documentation site for the library -- `packages/web-lib`: Actual library for Yearn's projects - -Each package and app is 100% [TypeScript](https://www.typescriptlang.org/). - - ### Releasing -When running `yarn build` in the `package/web-lib` folder, the library will be bumped to the next minor version, the code will be compiled and the various files will be copied in the `package/web-lib/dist` folder. +When running `yarn build` in the root folder, the library will be bumped to the next minor version, the code will be compiled and the various files will be copied in the `dist` folder. From there the library can be published to NPM via the `yarn publish ./dist` command. ### How to setup diff --git a/packages/web-lib/components/Banner.tsx b/components/Banner.tsx similarity index 100% rename from packages/web-lib/components/Banner.tsx rename to components/Banner.tsx diff --git a/packages/web-lib/components/Button.tsx b/components/Button.tsx similarity index 100% rename from packages/web-lib/components/Button.tsx rename to components/Button.tsx diff --git a/packages/web-lib/components/Header.tsx b/components/Header.tsx similarity index 100% rename from packages/web-lib/components/Header.tsx rename to components/Header.tsx diff --git a/packages/web-lib/components/Modal.tsx b/components/Modal.tsx similarity index 100% rename from packages/web-lib/components/Modal.tsx rename to components/Modal.tsx diff --git a/packages/web-lib/components/ModalLogin.tsx b/components/ModalLogin.tsx similarity index 84% rename from packages/web-lib/components/ModalLogin.tsx rename to components/ModalLogin.tsx index 27fad69d..d2ce82a4 100755 --- a/packages/web-lib/components/ModalLogin.tsx +++ b/components/ModalLogin.tsx @@ -1,7 +1,7 @@ import React, {cloneElement, useCallback} from 'react'; -import {useWeb3} from '@yearn-finance/web-lib//contexts/useWeb3'; import {Modal} from '@yearn-finance/web-lib/components/Modal'; import {yToast} from '@yearn-finance/web-lib/components/yToast'; +import {useWeb3} from '@yearn-finance/web-lib/contexts/useWeb3'; import {useInjectedWallet} from '@yearn-finance/web-lib/hooks/useInjectedWallet'; import IconWalletWalletConnect from '@yearn-finance/web-lib/icons/IconWalletWalletConnect'; @@ -21,7 +21,12 @@ function ModalLogin(props: TModalLogin): ReactElement { const onInjectedConnect = useCallback((): void => { onConnect( detectedWalletProvider.type, - (error): string => toast({content: error?.message ?? 'Impossible to connect wallet', type: 'error'}), + (error: unknown): string => { + if (!error || typeof error !== 'object' || !('message' in error) || typeof error.message !== 'string') { + return toast({content: 'Impossible to connect wallet', type: 'error'}); + } + return toast({content: error.message, type: 'error'}); + }, (): void => onClose() ); }, [detectedWalletProvider, onConnect, onClose, toast]); diff --git a/packages/web-lib/components/ModalMobileMenu.tsx b/components/ModalMobileMenu.tsx similarity index 100% rename from packages/web-lib/components/ModalMobileMenu.tsx rename to components/ModalMobileMenu.tsx diff --git a/packages/web-lib/components/Renderable.tsx b/components/Renderable.tsx similarity index 100% rename from packages/web-lib/components/Renderable.tsx rename to components/Renderable.tsx diff --git a/packages/web-lib/components/yToast.tsx b/components/yToast.tsx similarity index 100% rename from packages/web-lib/components/yToast.tsx rename to components/yToast.tsx diff --git a/packages/web-lib/contexts/WithYearn.tsx b/contexts/WithYearn.tsx similarity index 100% rename from packages/web-lib/contexts/WithYearn.tsx rename to contexts/WithYearn.tsx diff --git a/packages/web-lib/contexts/useSettings.tsx b/contexts/useSettings.tsx similarity index 100% rename from packages/web-lib/contexts/useSettings.tsx rename to contexts/useSettings.tsx diff --git a/packages/web-lib/contexts/useUI.tsx b/contexts/useUI.tsx similarity index 100% rename from packages/web-lib/contexts/useUI.tsx rename to contexts/useUI.tsx diff --git a/packages/web-lib/contexts/useWeb3.tsx b/contexts/useWeb3.tsx similarity index 98% rename from packages/web-lib/contexts/useWeb3.tsx rename to contexts/useWeb3.tsx index 37160bfb..3643999f 100755 --- a/packages/web-lib/contexts/useWeb3.tsx +++ b/contexts/useWeb3.tsx @@ -173,7 +173,7 @@ export const Web3ContextAppWrapper = ({children, options}: {children: ReactEleme isConnecting, isDisconnected, ens: ensName || '', - isActive: isConnected && [...supportedChainsID, 1337].includes(chain?.id || -1) && isMounted(), + isActive: isConnected && supportedChainsID.includes(chain?.id || -1) && isMounted(), lensProtocolHandle: '', hasProvider: !!(walletClient || publicClient), provider: connector, diff --git a/packages/web-lib/contexts/utils.ts b/contexts/utils.ts similarity index 100% rename from packages/web-lib/contexts/utils.ts rename to contexts/utils.ts diff --git a/packages/web-lib/hooks/useAddToken.ts b/hooks/useAddToken.ts similarity index 100% rename from packages/web-lib/hooks/useAddToken.ts rename to hooks/useAddToken.ts diff --git a/packages/web-lib/hooks/useAutoConnect.ts b/hooks/useAutoConnect.ts similarity index 100% rename from packages/web-lib/hooks/useAutoConnect.ts rename to hooks/useAutoConnect.ts diff --git a/packages/web-lib/hooks/useBalances.tsx b/hooks/useBalances.tsx similarity index 100% rename from packages/web-lib/hooks/useBalances.tsx rename to hooks/useBalances.tsx diff --git a/packages/web-lib/hooks/useChain.ts b/hooks/useChain.ts similarity index 100% rename from packages/web-lib/hooks/useChain.ts rename to hooks/useChain.ts diff --git a/packages/web-lib/hooks/useChainID.tsx b/hooks/useChainID.tsx similarity index 100% rename from packages/web-lib/hooks/useChainID.tsx rename to hooks/useChainID.tsx diff --git a/packages/web-lib/hooks/useClientEffect.tsx b/hooks/useClientEffect.tsx similarity index 100% rename from packages/web-lib/hooks/useClientEffect.tsx rename to hooks/useClientEffect.tsx diff --git a/packages/web-lib/hooks/useDebounce.tsx b/hooks/useDebounce.tsx similarity index 100% rename from packages/web-lib/hooks/useDebounce.tsx rename to hooks/useDebounce.tsx diff --git a/packages/web-lib/hooks/useDismissToasts.ts b/hooks/useDismissToasts.ts similarity index 100% rename from packages/web-lib/hooks/useDismissToasts.ts rename to hooks/useDismissToasts.ts diff --git a/packages/web-lib/hooks/useExplorer.tsx b/hooks/useExplorer.tsx similarity index 100% rename from packages/web-lib/hooks/useExplorer.tsx rename to hooks/useExplorer.tsx diff --git a/packages/web-lib/hooks/useInjectedWallet.tsx b/hooks/useInjectedWallet.tsx similarity index 100% rename from packages/web-lib/hooks/useInjectedWallet.tsx rename to hooks/useInjectedWallet.tsx diff --git a/packages/web-lib/hooks/useLocalStorage.tsx b/hooks/useLocalStorage.tsx similarity index 100% rename from packages/web-lib/hooks/useLocalStorage.tsx rename to hooks/useLocalStorage.tsx diff --git a/packages/web-lib/hooks/useSessionStorage.ts b/hooks/useSessionStorage.ts similarity index 100% rename from packages/web-lib/hooks/useSessionStorage.ts rename to hooks/useSessionStorage.ts diff --git a/packages/web-lib/hooks/useSupportedChainsID.tsx b/hooks/useSupportedChainsID.tsx similarity index 100% rename from packages/web-lib/hooks/useSupportedChainsID.tsx rename to hooks/useSupportedChainsID.tsx diff --git a/packages/web-lib/hooks/useWindowInFocus.tsx b/hooks/useWindowInFocus.tsx similarity index 100% rename from packages/web-lib/hooks/useWindowInFocus.tsx rename to hooks/useWindowInFocus.tsx diff --git a/packages/web-lib/icons/IconAddToMetamask.tsx b/icons/IconAddToMetamask.tsx similarity index 100% rename from packages/web-lib/icons/IconAddToMetamask.tsx rename to icons/IconAddToMetamask.tsx diff --git a/packages/web-lib/icons/IconAlertCritical.tsx b/icons/IconAlertCritical.tsx similarity index 100% rename from packages/web-lib/icons/IconAlertCritical.tsx rename to icons/IconAlertCritical.tsx diff --git a/packages/web-lib/icons/IconAlertError.tsx b/icons/IconAlertError.tsx similarity index 100% rename from packages/web-lib/icons/IconAlertError.tsx rename to icons/IconAlertError.tsx diff --git a/packages/web-lib/icons/IconAlertWarning.tsx b/icons/IconAlertWarning.tsx similarity index 100% rename from packages/web-lib/icons/IconAlertWarning.tsx rename to icons/IconAlertWarning.tsx diff --git a/packages/web-lib/icons/IconArrowDown.tsx b/icons/IconArrowDown.tsx similarity index 100% rename from packages/web-lib/icons/IconArrowDown.tsx rename to icons/IconArrowDown.tsx diff --git a/packages/web-lib/icons/IconCheckmark.tsx b/icons/IconCheckmark.tsx similarity index 100% rename from packages/web-lib/icons/IconCheckmark.tsx rename to icons/IconCheckmark.tsx diff --git a/packages/web-lib/icons/IconChevron.tsx b/icons/IconChevron.tsx similarity index 100% rename from packages/web-lib/icons/IconChevron.tsx rename to icons/IconChevron.tsx diff --git a/packages/web-lib/icons/IconChevronBottom.tsx b/icons/IconChevronBottom.tsx similarity index 100% rename from packages/web-lib/icons/IconChevronBottom.tsx rename to icons/IconChevronBottom.tsx diff --git a/packages/web-lib/icons/IconCopy.tsx b/icons/IconCopy.tsx similarity index 100% rename from packages/web-lib/icons/IconCopy.tsx rename to icons/IconCopy.tsx diff --git a/packages/web-lib/icons/IconCross.tsx b/icons/IconCross.tsx similarity index 100% rename from packages/web-lib/icons/IconCross.tsx rename to icons/IconCross.tsx diff --git a/packages/web-lib/icons/IconDashboard.tsx b/icons/IconDashboard.tsx similarity index 100% rename from packages/web-lib/icons/IconDashboard.tsx rename to icons/IconDashboard.tsx diff --git a/packages/web-lib/icons/IconGrip.tsx b/icons/IconGrip.tsx similarity index 100% rename from packages/web-lib/icons/IconGrip.tsx rename to icons/IconGrip.tsx diff --git a/packages/web-lib/icons/IconHamburger.tsx b/icons/IconHamburger.tsx similarity index 100% rename from packages/web-lib/icons/IconHamburger.tsx rename to icons/IconHamburger.tsx diff --git a/packages/web-lib/icons/IconHome.tsx b/icons/IconHome.tsx similarity index 100% rename from packages/web-lib/icons/IconHome.tsx rename to icons/IconHome.tsx diff --git a/packages/web-lib/icons/IconLabs.tsx b/icons/IconLabs.tsx similarity index 100% rename from packages/web-lib/icons/IconLabs.tsx rename to icons/IconLabs.tsx diff --git a/packages/web-lib/icons/IconLinkOut.tsx b/icons/IconLinkOut.tsx similarity index 100% rename from packages/web-lib/icons/IconLinkOut.tsx rename to icons/IconLinkOut.tsx diff --git a/packages/web-lib/icons/IconLoader.tsx b/icons/IconLoader.tsx similarity index 100% rename from packages/web-lib/icons/IconLoader.tsx rename to icons/IconLoader.tsx diff --git a/packages/web-lib/icons/IconLogoYearn.tsx b/icons/IconLogoYearn.tsx similarity index 100% rename from packages/web-lib/icons/IconLogoYearn.tsx rename to icons/IconLogoYearn.tsx diff --git a/packages/web-lib/icons/IconNetworkArbitrum.tsx b/icons/IconNetworkArbitrum.tsx similarity index 100% rename from packages/web-lib/icons/IconNetworkArbitrum.tsx rename to icons/IconNetworkArbitrum.tsx diff --git a/packages/web-lib/icons/IconNetworkEthereum.tsx b/icons/IconNetworkEthereum.tsx similarity index 100% rename from packages/web-lib/icons/IconNetworkEthereum.tsx rename to icons/IconNetworkEthereum.tsx diff --git a/packages/web-lib/icons/IconNetworkFantom.tsx b/icons/IconNetworkFantom.tsx similarity index 100% rename from packages/web-lib/icons/IconNetworkFantom.tsx rename to icons/IconNetworkFantom.tsx diff --git a/packages/web-lib/icons/IconNetworkOptimism.tsx b/icons/IconNetworkOptimism.tsx similarity index 100% rename from packages/web-lib/icons/IconNetworkOptimism.tsx rename to icons/IconNetworkOptimism.tsx diff --git a/packages/web-lib/icons/IconSearch.tsx b/icons/IconSearch.tsx similarity index 100% rename from packages/web-lib/icons/IconSearch.tsx rename to icons/IconSearch.tsx diff --git a/packages/web-lib/icons/IconSettings.tsx b/icons/IconSettings.tsx similarity index 100% rename from packages/web-lib/icons/IconSettings.tsx rename to icons/IconSettings.tsx diff --git a/packages/web-lib/icons/IconSocialDiscord.tsx b/icons/IconSocialDiscord.tsx similarity index 100% rename from packages/web-lib/icons/IconSocialDiscord.tsx rename to icons/IconSocialDiscord.tsx diff --git a/packages/web-lib/icons/IconSocialGithub.tsx b/icons/IconSocialGithub.tsx similarity index 100% rename from packages/web-lib/icons/IconSocialGithub.tsx rename to icons/IconSocialGithub.tsx diff --git a/packages/web-lib/icons/IconSocialMedium.tsx b/icons/IconSocialMedium.tsx similarity index 100% rename from packages/web-lib/icons/IconSocialMedium.tsx rename to icons/IconSocialMedium.tsx diff --git a/packages/web-lib/icons/IconSocialTwitter.tsx b/icons/IconSocialTwitter.tsx similarity index 100% rename from packages/web-lib/icons/IconSocialTwitter.tsx rename to icons/IconSocialTwitter.tsx diff --git a/packages/web-lib/icons/IconThemeDark.tsx b/icons/IconThemeDark.tsx similarity index 100% rename from packages/web-lib/icons/IconThemeDark.tsx rename to icons/IconThemeDark.tsx diff --git a/packages/web-lib/icons/IconThemeLight.tsx b/icons/IconThemeLight.tsx similarity index 100% rename from packages/web-lib/icons/IconThemeLight.tsx rename to icons/IconThemeLight.tsx diff --git a/packages/web-lib/icons/IconVault.tsx b/icons/IconVault.tsx similarity index 100% rename from packages/web-lib/icons/IconVault.tsx rename to icons/IconVault.tsx diff --git a/packages/web-lib/icons/IconWallet.tsx b/icons/IconWallet.tsx similarity index 100% rename from packages/web-lib/icons/IconWallet.tsx rename to icons/IconWallet.tsx diff --git a/packages/web-lib/icons/IconWalletCoinbase.tsx b/icons/IconWalletCoinbase.tsx similarity index 100% rename from packages/web-lib/icons/IconWalletCoinbase.tsx rename to icons/IconWalletCoinbase.tsx diff --git a/packages/web-lib/icons/IconWalletFrame.tsx b/icons/IconWalletFrame.tsx similarity index 100% rename from packages/web-lib/icons/IconWalletFrame.tsx rename to icons/IconWalletFrame.tsx diff --git a/packages/web-lib/icons/IconWalletLedger.tsx b/icons/IconWalletLedger.tsx similarity index 100% rename from packages/web-lib/icons/IconWalletLedger.tsx rename to icons/IconWalletLedger.tsx diff --git a/packages/web-lib/icons/IconWalletMetamask.tsx b/icons/IconWalletMetamask.tsx similarity index 100% rename from packages/web-lib/icons/IconWalletMetamask.tsx rename to icons/IconWalletMetamask.tsx diff --git a/packages/web-lib/icons/IconWalletOKX.tsx b/icons/IconWalletOKX.tsx similarity index 100% rename from packages/web-lib/icons/IconWalletOKX.tsx rename to icons/IconWalletOKX.tsx diff --git a/packages/web-lib/icons/IconWalletPhantom.tsx b/icons/IconWalletPhantom.tsx similarity index 100% rename from packages/web-lib/icons/IconWalletPhantom.tsx rename to icons/IconWalletPhantom.tsx diff --git a/packages/web-lib/icons/IconWalletSafe.tsx b/icons/IconWalletSafe.tsx similarity index 100% rename from packages/web-lib/icons/IconWalletSafe.tsx rename to icons/IconWalletSafe.tsx diff --git a/packages/web-lib/icons/IconWalletTrustWallet.tsx b/icons/IconWalletTrustWallet.tsx similarity index 100% rename from packages/web-lib/icons/IconWalletTrustWallet.tsx rename to icons/IconWalletTrustWallet.tsx diff --git a/packages/web-lib/icons/IconWalletWalletConnect.tsx b/icons/IconWalletWalletConnect.tsx similarity index 100% rename from packages/web-lib/icons/IconWalletWalletConnect.tsx rename to icons/IconWalletWalletConnect.tsx diff --git a/packages/web-lib/jest.config.cjs b/jest.config.cjs similarity index 100% rename from packages/web-lib/jest.config.cjs rename to jest.config.cjs diff --git a/lerna.json b/lerna.json deleted file mode 100755 index 37e0ed86..00000000 --- a/lerna.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "useWorkspaces": true, - "version": "0.2.0" -} diff --git a/package.json b/package.json index bbc7771b..3c36f8b1 100755 --- a/package.json +++ b/package.json @@ -1,17 +1,113 @@ { - "name": "@yearn-finance/web-lib-root", - "version": "0.13.28", - "private": true, - "workspaces": [ - "packages/*" - ], - "devDependencies": { - "lerna": "5.1.6" - }, - "scripts": { - "bootstrap": "lerna bootstrap --hoist", - "start": "lerna run dev --stream", - "watch": "lerna run watch --stream", - "lint": "lerna run lint --stream" - } -} + "name": "@yearn-finance/web-lib", + "version": "0.20.96", + "files": [ + "." + ], + "type": "module", + "scripts": { + "dev": "tsc --watch", + "exportStyle": "npx tailwindcss --postcss -c ./tailwind.config.cjs -i style.css -o dist/build.css --minify && sed -i -e 's/rem/em/g' dist/build.css", + "exportNextStyle": "npx tailwindcss --postcss -c ./tailwind.config.cjs -i style.css -o dist/build.css --minify && sed -i -e 's/rem/em/g' dist/build.css", + "prebuild": "rm -rf dist", + "build": "bump && tsc --module es2022 --outDir dist --jsx react", + "buildNoBump": "tsc --module es2022 --outDir dist --jsx react", + "postbuild": "sh ./scripts/postbuild.sh && npm run exportStyle && npm run exportNextStyle", + "lint": "eslint . --ext .js,.jsx,.ts,.tsx", + "test": "yarn node --experimental-vm-modules $(yarn bin jest)" + }, + "dependencies": { + "@babel/preset-typescript": "^7.22.5", + "@headlessui/react": "^1.7.15", + "@ledgerhq/iframe-provider": "^0.4.3", + "@react-hookz/deep-equal": "^1.0.4", + "@react-hookz/web": "^23.1.0", + "@safe-global/safe-apps-provider": "^0.17.0", + "@safe-global/safe-apps-sdk": "^7.11.0", + "@tailwindcss/forms": "^0.5.3", + "@tailwindcss/typography": "^0.5.9", + "@types/node": "^20.4.2", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.7", + "@typescript-eslint/eslint-plugin": "^6.0.0", + "@typescript-eslint/parser": "^6.0.0", + "@wagmi/core": "^1.3.8", + "axios": "^1.4.0", + "babel-loader": "^9.1.3", + "dayjs": "^1.11.8", + "eslint": "^8.44.0", + "eslint-config-next": "^13.4.9", + "eslint-plugin-tailwindcss": "^3.13.0", + "eslint-plugin-unused-imports": "^3.0.0", + "graphql": "^16.6.0", + "graphql-request": "^6.1.0", + "nprogress": "^0.2.0", + "postcss": "^8.4.25", + "postcss-nesting": "^12.0.0", + "react": "18.2.0", + "react-dom": "^18.2.0", + "react-hot-toast": "2.4.1", + "sass": "^1.63.6", + "sharp": "^0.32.2", + "tailwindcss": "^3.3.3", + "ts-jest": "^29.1.1", + "ts-loader": "^9.4.4", + "tsup": "^7.1.0", + "typescript": "^5.1.6", + "viem": "^1.3.0", + "wagmi": "^1.3.9", + "zod": "^3.21.4" + }, + "devDependencies": { + "@babel/preset-typescript": "^7.21.5", + "@types/express": "^4.17.17", + "@types/ioredis": "^4.28.10", + "@types/jest": "29.5.2", + "@types/node": "^20.2.5", + "@types/nprogress": "^0.2.0", + "@types/react": "^18.2.8", + "@types/react-dom": "^18.2.4", + "@typescript-eslint/eslint-plugin": "^5.59.9", + "@typescript-eslint/parser": "^5.59.9", + "autoprefixer": "^10.4.14", + "babel-loader": "^9.1.2", + "bump": "^0.2.5", + "eslint": "^8.42.0", + "eslint-config-next": "^13.4.4", + "eslint-import-resolver-typescript": "^3.5.5", + "eslint-plugin-brackets": "^0.1.3", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-react": "^7.32.2", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-simple-import-sort": "^10.0.0", + "eslint-plugin-tailwindcss": "^3.12.1", + "eslint-plugin-unused-imports": "^2.0.0", + "jest": "^29.5.0", + "postcss": "^8.4.24", + "postcss-import": "^15.1.0", + "postcss-nesting": "^11.2.2", + "sass": "^1.62.1", + "sharp": "^0.32.1", + "tailwindcss": "^3.3.2", + "ts-jest": "^29.1.0", + "ts-loader": "^9.4.3", + "tsup": "^6.7.0", + "typescript": "^5.1.3" + }, + "peerDependencies": { + "@headlessui/react": ">= 1.7.0", + "@typescript-eslint/eslint-plugin": "^5.53.0", + "@typescript-eslint/parser": "^5.53.0", + "eslint": ">= 8.25.0", + "eslint-config-next": ">= 12.3.1", + "eslint-import-resolver-typescript": ">= 3.5.1", + "eslint-plugin-brackets": ">= 0.1.3", + "eslint-plugin-import": ">= 2.26.0", + "eslint-plugin-react": ">= 7.31.10", + "eslint-plugin-simple-import-sort": ">= 8.0.0", + "eslint-plugin-tailwindcss": ">= 3.6.2", + "eslint-plugin-unused-imports": ">= 2.0.0", + "react": ">= 17.0.0", + "react-dom": ">= 17.0.0" + } +} \ No newline at end of file diff --git a/packages/docs/.eslintrc.js b/packages/docs/.eslintrc.js deleted file mode 100755 index f25ac059..00000000 --- a/packages/docs/.eslintrc.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - 'extends': ['../../node_modules/@yearn-finance/web-lib/.eslintrc.cjs'], - 'parser': '@typescript-eslint/parser', - 'parserOptions': { - 'ecmaFeatures': { - 'jsx': true - }, - 'tsconfigRootDir': __dirname, - 'ecmaVersion': 2022, - 'sourceType': 'module', - 'project': ['./tsconfig.json'] - } -}; diff --git a/packages/docs/components/CodeExample.tsx b/packages/docs/components/CodeExample.tsx deleted file mode 100755 index 8a9de171..00000000 --- a/packages/docs/components/CodeExample.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import {RadialBackground} from 'components/RadialBackground'; - -import type {ReactElement, ReactNode} from 'react'; - -function CodeExample({children}: {children: ReactNode}): ReactElement { - return ( -
- {children} - -
- ); -} - -export {CodeExample}; -export default CodeExample; diff --git a/packages/docs/components/Header.tsx b/packages/docs/components/Header.tsx deleted file mode 100755 index c9cced93..00000000 --- a/packages/docs/components/Header.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import React from 'react'; -import Image from 'next/image'; - -import type {ReactElement} from 'react'; - -export function Header(): ReactElement { - return ( -
-
-

{'Yearn Web Lib'}

- - - - - -
- -

- {'Yearn Web Lib'} -

- -
- - {''} - - - - {''} - - - - {''} - -
-
- ); -} diff --git a/packages/docs/components/RadialBackground.tsx b/packages/docs/components/RadialBackground.tsx deleted file mode 100755 index 62541f74..00000000 --- a/packages/docs/components/RadialBackground.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; - -import type {ReactElement} from 'react'; - -function RadialBackground(): ReactElement { - return ( -
-
-
- ); -} -export {RadialBackground}; diff --git a/packages/docs/components/specific/DropdownExample.tsx b/packages/docs/components/specific/DropdownExample.tsx deleted file mode 100755 index bc356c7a..00000000 --- a/packages/docs/components/specific/DropdownExample.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React, {useState} from 'react'; -import {CodeExample} from 'components/CodeExample'; -import {Dropdown} from '@yearn-finance/web-lib/components/Dropdown'; -import IconNetworkArbitrum from '@yearn-finance/web-lib/icons/IconNetworkArbitrum'; -import IconNetworkEthereum from '@yearn-finance/web-lib/icons/IconNetworkEthereum'; -import IconNetworkFantom from '@yearn-finance/web-lib/icons/IconNetworkFantom'; -import IconNetworkOptimism from '@yearn-finance/web-lib/icons/IconNetworkOptimism'; - -function DropdownExample(): React.ReactElement { - const options = [ - {icon: , label: 'Ethereum', value: 1}, - {icon: , label: 'Optimism', value: 10}, - {icon: , label: 'Fantom', value: 250}, - {icon: , label: 'Arbitrum', value: 42161}, - {label: 'No Icon', value: 123} - ]; - const [selectedOption, set_selectedOption] = useState(options[0]); - - return ( - - set_selectedOption(option)} /> - - ); -} - -export {DropdownExample}; -export default DropdownExample; diff --git a/packages/docs/components/specific/ModalExample.tsx b/packages/docs/components/specific/ModalExample.tsx deleted file mode 100755 index 7aaedae7..00000000 --- a/packages/docs/components/specific/ModalExample.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React, {useState} from 'react'; -import {CodeExample} from 'components/CodeExample'; -import {Button} from '@yearn-finance/web-lib/components/Button'; -import {Card} from '@yearn-finance/web-lib/components/Card'; -import {Modal} from '@yearn-finance/web-lib/components/Modal'; - -function ModalExample(): React.ReactElement { - const [isOpen, set_isOpen] = useState(false); - - return ( - - - set_isOpen(false)}> - - - - - - ); -} - -export {ModalExample}; -export default ModalExample; diff --git a/packages/docs/middleware.ts b/packages/docs/middleware.ts deleted file mode 100755 index b91f7e53..00000000 --- a/packages/docs/middleware.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {NextResponse} from 'next/server'; - -import type {NextRequest} from 'next/server'; - -export const config = { - matcher: [ - '/docs', - '/docs/install/:path*', - '/docs/hooks/:path*' - ] -}; - -export async function middleware(request: NextRequest): Promise { - if (request.nextUrl.pathname === ('/docs')) { - const url = request.nextUrl.clone(); - url.pathname = url.pathname.replace('docs', ''); - return NextResponse.redirect(url); - } - if (request.nextUrl.pathname.startsWith('/docs/install')) { - const url = request.nextUrl.clone(); - url.pathname = url.pathname.replace('install', '1-install'); - return NextResponse.redirect(url); - } - if (request.nextUrl.pathname.startsWith('/docs/hooks')) { - const url = request.nextUrl.clone(); - url.pathname = url.pathname.replace('hooks', '3-web3Hooks'); - return NextResponse.redirect(url); - } - return NextResponse.next(); -} diff --git a/packages/docs/next-env.d.ts b/packages/docs/next-env.d.ts deleted file mode 100755 index 4f11a03d..00000000 --- a/packages/docs/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/packages/docs/next.config.js b/packages/docs/next.config.js deleted file mode 100755 index 53d1ab98..00000000 --- a/packages/docs/next.config.js +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable no-undef */ -const withTM = require('next-transpile-modules')(['@yearn-finance/web-lib']); -const withNextra = require('nextra')({ - theme: 'nextra-theme-docs', - themeConfig: './theme.config.js', - unstable_contentDump: true, - unstable_flexsearch: true, - unstable_staticImage: true -}); - -/** @type {import('next').NextConfig} */ -const config = { - reactStrictMode: true, - typescript: { - // Disable type checking since eslint handles this - ignoreBuildErrors: true - }, - images: { - domains: ['img.shields.io'] - } -}; - -if (process.env.NODE_ENV === 'development') { - const withPreconstruct = require('@preconstruct/next'); - module.exports = withPreconstruct(withTM(withNextra(config))); -} else { - const withBundleAnalyzer = require('@next/bundle-analyzer')({ - enabled: process.env.ANALYZE === 'true' - }); - module.exports = withBundleAnalyzer(withTM(withNextra(config))); -} diff --git a/packages/docs/package.json b/packages/docs/package.json deleted file mode 100755 index bbdb0215..00000000 --- a/packages/docs/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "docs", - "version": "0.0.1", - "private": true, - "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "lint": "eslint . --ext .js,.jsx,.ts,.tsx" - }, - "dependencies": { - "@reach/skip-nav": "^0.17.0", - "@yearn-finance/web-lib": "*", - "ethers": "^5.6.9", - "next": "^12.2.3", - "next-themes": "^0.2.0", - "nextra": "2.0.0-alpha.56", - "nextra-theme-docs": "2.0.0-alpha.59", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "tailwindcss": "^3.1.6" - }, - "devDependencies": { - "@next/bundle-analyzer": "^12.2.0", - "@next/eslint-plugin-next": "^12.2.0", - "@preconstruct/next": "^4.0.0", - "@types/node": "^17.0.38", - "@types/react": "18.0.10", - "autoprefixer": "^10.4.7", - "dotenv-webpack": "^7.1.0", - "eslint": "8.16.0", - "next-transpile-modules": "9.0.0", - "postcss": "^8.4.14", - "postcss-import": "^14.1.0", - "postcss-nesting": "^10.1.10", - "sass": "^1.53.0", - "ts-loader": "^9.3.1", - "typescript": "^4.7.4" - } -} diff --git a/packages/docs/pages/_app.tsx b/packages/docs/pages/_app.tsx deleted file mode 100755 index fd7112a1..00000000 --- a/packages/docs/pages/_app.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import * as React from 'react'; -import {useTheme} from 'next-themes'; -import {useClientEffect} from '@yearn-finance/web-lib/hooks/useClientEffect'; - -import type {AppProps} from 'next/app'; - -import '../style.css'; - -function WrappedApp({Component, pageProps}: AppProps): React.ReactElement { - const {theme} = useTheme(); - - useClientEffect((): void => { - document.body.dataset.theme = theme; - }, [theme]); - - return ( - - ); -} - -function App(props: AppProps): React.ReactElement { - const getLayout = (props.Component as any).getLayout || ((page: React.ReactElement): React.ReactElement => page); // eslint-disable-line - - return (getLayout()); -} - -export default App; diff --git a/packages/docs/pages/_document.tsx b/packages/docs/pages/_document.tsx deleted file mode 100755 index d9d84923..00000000 --- a/packages/docs/pages/_document.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react'; -import Document, {Head, Html, Main, NextScript} from 'next/document'; -import {SkipNavLink} from '@reach/skip-nav'; - -import type {DocumentContext, DocumentInitialProps} from 'next/document'; -import type {ReactElement} from 'react'; - -const modeScript = ` - let darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)') - - updateMode() - darkModeMediaQuery.addEventListener('change', updateModeWithoutTransitions) - window.addEventListener('storage', updateModeWithoutTransitions) - - function updateMode() { - let isSystemDarkMode = darkModeMediaQuery.matches - let isDarkMode = true - - if (isDarkMode) { - document.documentElement.classList.add('dark') - } else { - document.documentElement.classList.remove('dark') - } - - if (isDarkMode === isSystemDarkMode) { - delete window.localStorage.isDarkMode - } - } - - function updateModeWithoutTransitions() { - updateMode() - } -`; - -class MyDocument extends Document { - static async getInitialProps(ctx: DocumentContext): Promise { - const initialProps = await Document.getInitialProps(ctx); - return {...initialProps}; - } - - render(): ReactElement { - return ( - - - - -