From 4aef07c51e58faf78b512b466ae1ba8ebc613175 Mon Sep 17 00:00:00 2001 From: Tom Meagher Date: Mon, 28 Aug 2023 14:33:27 -0400 Subject: [PATCH] chore: tweaks --- .github/CONTRIBUTING.md | 18 +- .github/README.md | 193 +++++++++--------- docs/core/actions.md | 27 ++- docs/react/hooks.md | 2 +- packages/cli/.gitkeep | 0 packages/react/src/hooks/useAccount.ts | 2 +- packages/react/src/hooks/useAccountEffect.ts | 2 +- packages/react/src/hooks/useBalance.ts | 2 +- packages/react/src/hooks/useBlockNumber.ts | 2 +- packages/react/src/hooks/useChainId.ts | 2 +- packages/react/src/hooks/useConnect.ts | 2 +- packages/react/src/hooks/useConnections.ts | 2 +- .../react/src/hooks/useConnectorClient.ts | 2 +- packages/react/src/hooks/useContractRead.ts | 2 +- packages/react/src/hooks/useContractReads.ts | 2 +- .../react/src/hooks/useContractSimulate.ts | 2 +- packages/react/src/hooks/useDisconnect.ts | 2 +- packages/react/src/hooks/useEnsAddress.ts | 2 +- packages/react/src/hooks/useEnsAvatar.ts | 2 +- packages/react/src/hooks/useEnsName.ts | 2 +- packages/react/src/hooks/useEnsResolver.ts | 2 +- packages/react/src/hooks/useFeeData.ts | 4 +- packages/react/src/hooks/useReconnect.ts | 2 +- packages/react/src/hooks/useSignMessage.ts | 2 +- packages/react/src/hooks/useSignTypedData.ts | 2 +- packages/react/src/hooks/useSwitchAccount.ts | 2 +- packages/react/src/hooks/useToken.ts | 2 +- packages/react/src/hooks/useTransaction.ts | 2 +- .../src/hooks/useWaitForTransactionReceipt.ts | 2 +- 29 files changed, 161 insertions(+), 129 deletions(-) create mode 100644 packages/cli/.gitkeep diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 364be227d8..5081955727 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Thanks for your interest in contributing to wagmi! Please take a moment to review this document **before submitting a pull request.** +Thanks for your interest in contributing to Wagmi! Please take a moment to review this document **before submitting a pull request.** If you want to contribute, but aren't sure where to start, you can create a [new discussion](https://github.com/wagmi-dev/wagmi/discussions/new/choose). If you are looking to add a connector or chain, check out the following guides: @@ -58,7 +58,7 @@ gh repo clone wagmi-dev/wagmi ## Installing Node.js and pnpm -wagmi uses [pnpm workspaces](https://pnpm.io/workspaces) to manage multiple projects. You need to install **Node.js v16 or higher** and **pnpm v7 or higher**. +Wagmi uses [pnpm workspaces](https://pnpm.io/workspaces) to manage multiple projects. You need to install **Node.js v16 or higher** and **pnpm v7 or higher**. You can run the following commands in your terminal to check your local Node.js and npm versions: @@ -107,7 +107,7 @@ Once the dev server is running, you can make changes to any of the package sourc ## Running the test suite -wagmi uses [Vitest](https://vitest.dev) to run tests and [anvil.js](https://github.com/wagmi-dev/anvil.js) to execute tests against a local Ethereum node. First, install [Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil) via [Foundry](https://book.getfoundry.sh/getting-started/installation). +Wagmi uses [Vitest](https://vitest.dev) to run tests and [anvil.js](https://github.com/wagmi-dev/anvil.js) to execute tests against a local Ethereum node. First, install [Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil) via [Foundry](https://book.getfoundry.sh/getting-started/installation). Next, copy over the environment variables from `.env.example` to `.env`, and fill them out. Now you are ready to run the tests! You have the following options for running tests: @@ -123,7 +123,7 @@ When adding new features or fixing bugs, it's important to add test cases to cov ## Writing documentation -Documentation is crucial to helping developers of all experience levels use wagmi. wagmi uses [VitePress](https://vitepress.dev) for the documentation site (located at [`docs`](../docs)). To start the site in dev mode, run: +Documentation is crucial to helping developers of all experience levels use Wagmi. Wagmi uses [VitePress](https://vitepress.dev) for the documentation site (located at [`docs`](../docs)). To start the site in dev mode, run: ```bash pnpm docs:dev @@ -155,7 +155,7 @@ When you submit a pull request, GitHub will automatically lint, build, and test ---
- ✅ Now you're ready to contribute to wagmi! Follow the next steps if you need more advanced instructions. + ✅ Now you're ready to contribute to Wagmi! Follow the next steps if you need more advanced instructions.
--- @@ -296,7 +296,7 @@ If you followed all the instructions, you can submit a pull request and the new > **Warning** **Please ask first before starting work on a new connector.** > -> To avoid having your pull request declined after investing time and effort into a new connector, we ask that contributors create a [Connector Request](https://github.com/wagmi-dev/wagmi/discussions/new?category=connector-request) before starting work on new Connectors. This helps ensure the connector solves for an important or general use-case of interest to wagmi users. +> To avoid having your pull request declined after investing time and effort into a new connector, we ask that contributors create a [Connector Request](https://github.com/wagmi-dev/wagmi/discussions/new?category=connector-request) before starting work on new Connectors. This helps ensure the connector solves for an important or general use-case of interest to Wagmi users. #### 0. Follow the [Basic Guide](#basic-guide). @@ -358,7 +358,7 @@ The type error should tell you what properties are missing from `createConnector `createConnector` also has the following config properties you can use within the connector: - `chains`: List of chains configured by the user. -- `emitter`: Emitter for emitting events. Used to sync connector state with wagmi config. The following events are available: +- `emitter`: Emitter for emitting events. Used to sync connector state with Wagmi `Config`. The following events are available: - `change`: Emitted when the connected accounts or chain changes. - `connect`: Emitted when the connector connects. - `disconnect`: Emitted when the connector disconnects. @@ -376,7 +376,7 @@ export { fooBarBaz } from './fooBarBaz.js' #### 5. Try out your connector and add tests. -While building a connector, it can be useful to try it out with wagmi. You can follow the setup [guide in the wagmi repo](https://github.com/wagmi-dev/wagmi/blob/main/.github/CONTRIBUTING.md), to use the local development playground for testing your changes. +While building a connector, it can be useful to try it out with Wagmi. You can follow the setup [guide in the Wagmi repo](https://github.com/wagmi-dev/wagmi/blob/main/.github/CONTRIBUTING.md), to use the local development playground for testing your changes. Ideally, you should also be able to add tests for your connector in a `connectorName.test.ts` file. This isn't always easy so at a minimum please create a test file with instructions for how to test your connector manually. The test file should include actual tests or "instruction tests" for the following: @@ -394,7 +394,7 @@ pnpm test:update packages/connectors/src/index.test.ts #### 6. Add your team to CODEOWNERS. -It is critical connectors are updated in a timely manner and actively maintained so that users of wagmi can rely on them in production settings. The wagmi core team will provide as much assistance as possible to keep connectors up-to-date with breaking changes from wagmi, but it is your responsibility to ensure that any dependencies and issues/discussions related to the connector are handled in a timely manner. +It is critical connectors are updated in a timely manner and actively maintained so that users of Wagmi can rely on them in production settings. The Wagmi core team will provide as much assistance as possible to keep connectors up-to-date with breaking changes from Wagmi, but it is your responsibility to ensure that any dependencies and issues/discussions related to the connector are handled in a timely manner. In support of this goal, add at least one member of your team to the [CODEOWNERS](./CODEOWNERS) file so that you get notified of pull requests, issues, etc. related to your connector. You can add your team like this: diff --git a/.github/README.md b/.github/README.md index 00568a5b14..da2ff0aa3d 100644 --- a/.github/README.md +++ b/.github/README.md @@ -6,7 +6,7 @@

- Reactivity for Ethereum apps + Reactive primitives for building modern Ethereum apps

@@ -22,12 +22,6 @@ MIT License - - - - Code coverage - - @@ -42,19 +36,29 @@

-
+--- ## Documentation -For documentation and examples, visit [wagmi.sh](https://wagmi.sh). +For documentation, visit [wagmi.sh](https://wagmi.sh). + +## Community + +For help, discussion about best practices, or any other conversation that would benefit from being searchable: + +[Discuss Wagmi on GitHub](https://github.com/wagmi-dev/wagmi/discussions) + +For casual chit-chat with others using the framework: + +[Join the Wagmi Slack](https://join.slack.com/t/wagmi-community/shared_invite/zt-21zxb2mhv-EcN32c1Qx4Z3vRAfEKbbJw) ## Contributing -Contributions to Wagmi are greatly appreciated! To get started, please read our [Contributing Guide](contributing). Then, check out the list of [Good First Issues](https://github.com/wagmi-dev/wagmi/contribute). Let us know if you have any questions! +Contributions to Wagmi are greatly appreciated! If you're interested in contributing to Wagmi, please read our [contributing docs](https://github.com/wagmi-dev/wagmi/blob/main/.github/CONTRIBUTING.md) **before submitting a pull request**. ## Sponsors -If you find wagmi useful, please consider [supporting development](https://github.com/sponsors/wagmi-dev?metadata_campaign=gh_readme_support). Thank you 🙏 +If you find Wagmi useful or use it at work, please consider [supporting development](https://github.com/sponsors/wagmi-dev?metadata_campaign=gh_readme_support). Thank you 🙏 @@ -65,84 +69,92 @@ If you find wagmi useful, please consider [supporting development](https://githu
-
- - - family logo - - - - - - context logo - - - - - - WalletConnect logo - - - - - - PartyDAO logo - - - - - - Dynamic logo - - - - - - Sushi logo - - - - - - Stripe logo - - - - - - BitKeep logo - - - - - - Privy logo - - - - - - Spruce logo - - - - - - rollup.id logo - - - - - - pancake logo - - - - - - celo logo - - +

+ + + + family logo + + + + + + context logo + + + + + + WalletConnect logo + + + + + + PartyDAO logo + + + + + + Dynamic logo + + + + + + Sushi logo + + + + + + Stripe logo + + + + + + BitKeep logo + + + + + + Privy logo + + + + + + Spruce logo + + + + + + rollup.id logo + + + + + + pancake logo + + + + + + celo logo + + + + + + zora logo + + +



@@ -150,6 +162,3 @@ If you find wagmi useful, please consider [supporting development](https://githu Powered by Vercel - -[docs]: https://wagmi.sh -[contributing]: https://github.com/wagmi-dev/wagmi/blob/main/.github/CONTRIBUTING.md \ No newline at end of file diff --git a/docs/core/actions.md b/docs/core/actions.md index 542f391369..e6fa717a23 100644 --- a/docs/core/actions.md +++ b/docs/core/actions.md @@ -1 +1,26 @@ -# Actions \ No newline at end of file + + +# Actions + +Actions for accounts, wallets, contracts, transactions, signing, ENS, and more. + +## Import + +```ts +import { getAccount } from '@wagmi/core' +``` + +## All Actions + + diff --git a/docs/react/hooks.md b/docs/react/hooks.md index 0c1f15edc6..ea5e38eac2 100644 --- a/docs/react/hooks.md +++ b/docs/react/hooks.md @@ -17,7 +17,7 @@ React Hooks for accounts, wallets, contracts, transactions, signing, ENS, and mo import { useAccount } from 'wagmi' ``` -## Built-In Hooks +## All Hooks