From e288ce70e7906262234924015a6ea16ff361177d Mon Sep 17 00:00:00 2001 From: Leonardo Zizzamia Date: Thu, 18 Jul 2024 22:14:14 -0700 Subject: [PATCH] chore: release (#838) --- .changeset/lazy-shoes-work.md | 3 +- .changeset/six-poets-pull.md | 8 --- README.md | 6 +-- biome.json | 2 +- package.json | 1 + site/docs/pages/getting-started.mdx | 12 ++--- site/docs/pages/index.mdx | 54 +++++++++---------- .../{loading => components}/Spinner.test.tsx | 0 .../{loading => components}/Spinner.tsx | 0 .../{form => components}/TextInput.tsx | 2 +- src/internal/{form => hooks}/useDebounce.ts | 0 src/swap/components/SwapAmountInput.tsx | 2 +- src/swap/components/SwapButton.test.tsx | 2 +- src/swap/components/SwapButton.tsx | 2 +- src/token/components/TokenSearch.tsx | 2 +- .../components/TransactionButton.tsx | 2 +- .../TransactionStatusAction.test.tsx | 4 +- .../TransactionStatusLabel.test.tsx | 4 +- .../hooks/useGetTransactionToast.tsx | 2 +- src/version.ts | 2 +- src/wallet/components/ConnectWallet.tsx | 2 +- vitest.config.ts | 4 +- 22 files changed, 55 insertions(+), 61 deletions(-) delete mode 100644 .changeset/six-poets-pull.md rename src/internal/{loading => components}/Spinner.test.tsx (100%) rename src/internal/{loading => components}/Spinner.tsx (100%) rename src/internal/{form => components}/TextInput.tsx (95%) rename src/internal/{form => hooks}/useDebounce.ts (100%) diff --git a/.changeset/lazy-shoes-work.md b/.changeset/lazy-shoes-work.md index e5334434a6..b3d24ce017 100644 --- a/.changeset/lazy-shoes-work.md +++ b/.changeset/lazy-shoes-work.md @@ -2,4 +2,5 @@ "@coinbase/onchainkit": patch --- -- **feat**: retrieve txn hash for chain explorer by: @abcrane123 #831 +- **feat**: polish `Transaction` component. By @abcrane123 #831 #835 +- **chore**: fix TransactionGasFee test. By @cpcramer #830 diff --git a/.changeset/six-poets-pull.md b/.changeset/six-poets-pull.md deleted file mode 100644 index d5d6d4c5fd..0000000000 --- a/.changeset/six-poets-pull.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@coinbase/onchainkit": patch ---- - --**chore**: Fix TransactionGasFee test. By @cpcramer #830 --**chore**: Landing page UI fixes. By @cpcramer #833 --**docs**: Update Code snippet UI. By @cpcramer #836 --**docs**: Remove code group border. By @cpcramer #837 diff --git a/README.md b/README.md index 78b1ab2846..94a662e99a 100644 --- a/README.md +++ b/README.md @@ -379,13 +379,13 @@ Check out the following places for more OnchainKit-related content: ## Authors -- [@zizzamia](https://github.com/zizzamia) ([X](https://twitter.com/hey_shells), [Warpcast](https://warpcast.com/zizzamia)) +- [Leonardo Zizzamia](https://github.com/zizzamia) ([X](https://twitter.com/zizzamia), [Warpcast](https://warpcast.com/zizzamia)) - [Tina He](https://github.com/fakepixels) ([X](https://twitter.com/fkpxls)) -- [@0xchiaroscuro](https://github.com/0xchiaroscuro) ([X](https://twitter.com/chiaroscuro), [Warpcast](https://warpcast.com/chiaroscuro)) +- [Shelley Lai](https://github.com/0xchiaroscuro) ([X](https://twitter.com/chiaroscuro), [Warpcast](https://warpcast.com/chiaroscuro)) - [Ky Lee](https://github.com/kyhyco) - [Mind Apivessa](https://github.com/mindapivessa) ([X](https://twitter.com/spicypaprika_)) -- [Alec Chen](https://github.com/0xAlec) ([X](https://twitter.com/0xAlec)) - [Alissa Crane](https://github.com/abcrane123) ([X](https://twitter.com/abcrane123)) +- [Alec Chen](https://github.com/0xAlec) ([X](https://twitter.com/0xAlec)) - [Paul Cramer](https://github.com/cpcramer) ([X](https://twitter.com/PaulCramer_)) - [Léo Galley](https://github.com/kirkas) diff --git a/biome.json b/biome.json index fb3b68eb40..28799dfe84 100644 --- a/biome.json +++ b/biome.json @@ -68,7 +68,7 @@ "site/env.d.ts", "site/tailwind.config.js", "site/vocs.config.tsx", - "src/internal/form/useDebounce.ts" + "src/internal/hooks/useDebounce.ts" ] }, "json": { diff --git a/package.json b/package.json index 6c48fbe786..75bd42d867 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "license": "MIT", "scripts": { "build": "packemon build --addEngines --addFiles --declaration && npx packemon validate --no-license --no-people --no-repo && tailwindcss -i ./src/styles/index.css -o ./src/tailwind.css --minify && tailwindcss -i ./src/styles/index-with-tailwind.css -o ./src/styles.css --minify", + "check": "biome check --write src/internal", "ci:format": "biome ci --linter-enabled=false --organize-imports-enabled=false", "ci:lint": "biome ci --formatter-enabled=false --organize-imports-enabled=false", "cp": "cp -R src site/docs/pages", diff --git a/site/docs/pages/getting-started.mdx b/site/docs/pages/getting-started.mdx index 3446c71efe..e543b0836d 100644 --- a/site/docs/pages/getting-started.mdx +++ b/site/docs/pages/getting-started.mdx @@ -61,12 +61,12 @@ PUBLIC_ONCHAINKIT_API_KEY=YOUR_PUBLIC_API_KEY #### Access the Public API Key in your code ```tsx [OnchainProviders.tsx] - - - + + + ``` ### Configure the OnchainKitProvider diff --git a/site/docs/pages/index.mdx b/site/docs/pages/index.mdx index 8a5f67343c..03c951747d 100644 --- a/site/docs/pages/index.mdx +++ b/site/docs/pages/index.mdx @@ -356,33 +356,33 @@ setFilteredTokens(filteredTokens);
```tsx - + ```
diff --git a/src/internal/loading/Spinner.test.tsx b/src/internal/components/Spinner.test.tsx similarity index 100% rename from src/internal/loading/Spinner.test.tsx rename to src/internal/components/Spinner.test.tsx diff --git a/src/internal/loading/Spinner.tsx b/src/internal/components/Spinner.tsx similarity index 100% rename from src/internal/loading/Spinner.tsx rename to src/internal/components/Spinner.tsx diff --git a/src/internal/form/TextInput.tsx b/src/internal/components/TextInput.tsx similarity index 95% rename from src/internal/form/TextInput.tsx rename to src/internal/components/TextInput.tsx index c53a6bfffa..189ba18939 100644 --- a/src/internal/form/TextInput.tsx +++ b/src/internal/components/TextInput.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react'; import type { ChangeEvent } from 'react'; -import { useDebounce } from './useDebounce'; +import { useDebounce } from '../hooks/useDebounce'; type TextInputReact = { className: string; diff --git a/src/internal/form/useDebounce.ts b/src/internal/hooks/useDebounce.ts similarity index 100% rename from src/internal/form/useDebounce.ts rename to src/internal/hooks/useDebounce.ts diff --git a/src/swap/components/SwapAmountInput.tsx b/src/swap/components/SwapAmountInput.tsx index fb1617289c..79161ecbd9 100644 --- a/src/swap/components/SwapAmountInput.tsx +++ b/src/swap/components/SwapAmountInput.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useMemo } from 'react'; import { TokenChip, TokenSelectDropdown } from '../../token'; import { background, cn, color, pressable, text } from '../../styles/theme'; -import { TextInput } from '../../internal/form/TextInput'; +import { TextInput } from '../../internal/components/TextInput'; import { isValidAmount } from '../../utils/isValidAmount'; import { getRoundedAmount } from '../../utils/getRoundedAmount'; import { useSwapContext } from './SwapProvider'; diff --git a/src/swap/components/SwapButton.test.tsx b/src/swap/components/SwapButton.test.tsx index d2face6b60..f24f68a5f4 100644 --- a/src/swap/components/SwapButton.test.tsx +++ b/src/swap/components/SwapButton.test.tsx @@ -7,7 +7,7 @@ vi.mock('./SwapProvider', () => ({ useSwapContext: vi.fn(), })); -vi.mock('../../internal/loading/Spinner', () => ({ +vi.mock('../../internal/components/Spinner', () => ({ Spinner: () =>
Loading...
, })); diff --git a/src/swap/components/SwapButton.tsx b/src/swap/components/SwapButton.tsx index 787a24a7a2..383181397a 100644 --- a/src/swap/components/SwapButton.tsx +++ b/src/swap/components/SwapButton.tsx @@ -1,5 +1,5 @@ import { background, cn, pressable, text } from '../../styles/theme'; -import { Spinner } from '../../internal/loading/Spinner'; +import { Spinner } from '../../internal/components/Spinner'; import { useSwapContext } from './SwapProvider'; import type { SwapButtonReact } from '../types'; diff --git a/src/token/components/TokenSearch.tsx b/src/token/components/TokenSearch.tsx index b63a064d1e..8c5ea3bcd4 100644 --- a/src/token/components/TokenSearch.tsx +++ b/src/token/components/TokenSearch.tsx @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react'; import type { TokenSearchReact } from '../types'; import { SearchIcon } from './SearchIcon'; -import { TextInput } from '../../internal/form/TextInput'; +import { TextInput } from '../../internal/components/TextInput'; import { cn, color, pressable } from '../../styles/theme'; export function TokenSearch({ diff --git a/src/transaction/components/TransactionButton.tsx b/src/transaction/components/TransactionButton.tsx index 0f57f94275..142b425035 100644 --- a/src/transaction/components/TransactionButton.tsx +++ b/src/transaction/components/TransactionButton.tsx @@ -1,6 +1,6 @@ import { background, cn, pressable, text } from '../../styles/theme'; import { useTransactionContext } from './TransactionProvider'; -import { Spinner } from '../../internal/loading/Spinner'; +import { Spinner } from '../../internal/components/Spinner'; import type { TransactionButtonReact } from '../types'; export function TransactionButton({ diff --git a/src/transaction/components/TransactionStatusAction.test.tsx b/src/transaction/components/TransactionStatusAction.test.tsx index 2a9029adc2..05f3e8f91b 100644 --- a/src/transaction/components/TransactionStatusAction.test.tsx +++ b/src/transaction/components/TransactionStatusAction.test.tsx @@ -1,9 +1,9 @@ import { render, screen } from '@testing-library/react'; import { describe, it, expect, vi } from 'vitest'; import { TransactionStatusAction } from './TransactionStatusAction'; -import { useGetTransactionStatus } from '../core/useGetTransactionStatus'; +import { useGetTransactionStatus } from '../hooks/useGetTransactionStatus'; -vi.mock('../core/useGetTransactionStatus', () => ({ +vi.mock('../hooks/useGetTransactionStatus', () => ({ useGetTransactionStatus: vi.fn(), })); diff --git a/src/transaction/components/TransactionStatusLabel.test.tsx b/src/transaction/components/TransactionStatusLabel.test.tsx index 7bce8d10d0..e384c15677 100644 --- a/src/transaction/components/TransactionStatusLabel.test.tsx +++ b/src/transaction/components/TransactionStatusLabel.test.tsx @@ -1,9 +1,9 @@ import { render, screen } from '@testing-library/react'; import { describe, it, expect, vi } from 'vitest'; import { TransactionStatusLabel } from './TransactionStatusLabel'; -import { useGetTransactionStatus } from '../core/useGetTransactionStatus'; +import { useGetTransactionStatus } from '../hooks/useGetTransactionStatus'; -vi.mock('../core/useGetTransactionStatus', () => ({ +vi.mock('../hooks/useGetTransactionStatus', () => ({ useGetTransactionStatus: vi.fn(), })); diff --git a/src/transaction/hooks/useGetTransactionToast.tsx b/src/transaction/hooks/useGetTransactionToast.tsx index 4197757d36..d552d1ac68 100644 --- a/src/transaction/hooks/useGetTransactionToast.tsx +++ b/src/transaction/hooks/useGetTransactionToast.tsx @@ -3,7 +3,7 @@ import { useTransactionContext } from '../components/TransactionProvider'; import { cn, color, text } from '../../styles/theme'; import { useOnchainKit } from '../../useOnchainKit'; import { getChainExplorer } from '../../network/getChainExplorer'; -import { Spinner } from '../../internal/loading/Spinner'; +import { Spinner } from '../../internal/components/Spinner'; import type { ReactNode } from 'react'; const successSVG = ( diff --git a/src/version.ts b/src/version.ts index f95cdbe5de..762e6ada1e 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '0.25.5'; +export const version = '0.25.6'; diff --git a/src/wallet/components/ConnectWallet.tsx b/src/wallet/components/ConnectWallet.tsx index 198d3cd727..e6031d773b 100644 --- a/src/wallet/components/ConnectWallet.tsx +++ b/src/wallet/components/ConnectWallet.tsx @@ -4,7 +4,7 @@ import { useAccount, useConnect } from 'wagmi'; import { ConnectButton } from './ConnectButton'; import { useWalletContext } from './WalletProvider'; import { IdentityProvider } from '../../identity/components/IdentityProvider'; -import { Spinner } from '../../internal/loading/Spinner'; +import { Spinner } from '../../internal/components/Spinner'; import { cn, color, pressable, text as dsText } from '../../styles/theme'; import type { ConnectWalletReact } from '../types'; diff --git a/vitest.config.ts b/vitest.config.ts index 4762d1fbfd..564fcedcf2 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -21,10 +21,10 @@ export default defineConfig({ ], reportOnFailure: true, thresholds: { - statements: 93.96, + statements: 93.78, branches: 97.3, functions: 86.82, - lines: 93.97, + lines: 93.78, }, }, environment: 'jsdom',