Skip to content

Commit

Permalink
[email protected] release candidate (wevm#3333)
Browse files Browse the repository at this point in the history
* chore: format

* chore: tweaks

* refactor: injected

* fix: type error

* refactor: remove injected features array

* feat: reactive connectors

* chore: playground

* feat: ssr playground

* chore: mark package as private

* chore: knip

* chore: clean up

* docs: add bun to install options

* refactor: reconnect behavior

* chore: tweaks

* chore: format

* feat: eip6963 support

* chore: version

* docs: start migration guides

* chore: remove unused package

* chore: update readme

* chore: update snaps

* docs: useContractRead

* docs: reorganize sidebar (wevm#3031)

* docs: sidebar

* trigger

---------

Co-authored-by: moxey.eth <[email protected]>

* docs: connectors

* docs: connectors

* docs: code-group spacing

* docs: move connectors sidebar

* chore: tweaks

* docs: estimateGas

* docs: client

* docs: watch

* docs: client

* docs: wip

* chore: bump viem

* docs: writeContract

* chore: sidebar

* docs: more

* test: types

* docs: migration guide

* docs: migrate

* docs: migrate

* docs: useAccountEffect

* docs: useContractWrite

* docs: useContractWrite update

* docs: useContractSimulate

* chore: fix test

* docs: update

* docs: updates

* docs: tweaks

* docs: more

* docs: updates

* docs: versions

* chore: update playground

* chore: bump deps

* docs: migrate

* docs: mock connector

* chore: fix import

* chore: add og meta

* docs: og

* docs: update colors

* chore: bump version

* docs: updates

* chore: update preconstruct script

* docs: update

* docs: update

* docs: add missing sponsors

* chore: add missing logo

* feat: error types

* refactor: rename contract hooks

* chore: version

* chore: rename test hooks

* feat: create-wagmi@alpha (wevm#3071)

* wip: create-wagmi

* wip: cli

* wip: templates

* chore: update templates

* feat: create-wagmi@alpha

* chore: up snaps

* chore: format

* chore: update template

* chore: bump actions checkout

* chore: add template envs

* test: create-wagmi

* fix: test build

* chore: knip

* test: fix

* chore: remove note

* docs: reorder sidebar

* chore: changes

* chore: rename

* chore: type updates

* chore: bump ts

* chore: add ts 5.0.4 back

* chore: clean up

* feat(connectors): metaMask

* test: metaMask

* chore: bump create-wagmi

* docs: useTransaction/useWaitForTransactionReceipt

* docs: query options

* docs: config

* docs: small updates

* docs: useWalletClient/useConnectorClient

* docs: hide query properties

* chore: version

* docs: tanstack query

* chore: bump metamask sdk version

* docs: viem

* chore: update viem

* docs: react viem

* docs: ethers

* docs: ethers react

* docs: word

* chore: updates

* chore: bump viem

* docs: cli

* docs: tweaks

* docs: plugins

* docs: plugins

* docs: progress

* docs: clean up

* chore: version

* feat: error types

* fix: docs

* chore: version

* docs: error handling

* docs: connect wallet

* trigger

* chore: remove react from docs

* docs: connect wallet

* chore: lockfile

* docs: remove preview

* docs: connect wallet

* feat: ssr

* feat: next ssr

* feat: cookies

* lockfile

* feat: wire up error types

* fix: typecheck

* chore: tweaks

* docs: ssr

* fix: reconnectOnMount=false

* chore: update query

* docs(wip): infinite read contracts

* docs: useInfiniteReadContracts cont.

* docs: useReadContracts

* chore: tweaks

* docs: rest of hooks & actions

* chore: bump viem

* chore: bump versions

* chore: beta release

* chore: tweaks

* fix: doc link missing /api path (wevm#3185)

* docs: update search

* fix(react): useReadContracts chainId

* chore: bump version

* chore: comment

* chore: bump viem version

* fix: mipd subscribe

* chore: bump versions

* chore: consistent versions

* chore: bump version

* chore: ts version

* chore: bump viem version

* fix: wevm#3216

* fix(react): internal types

* fix: useWaitForTransactionReceipt enabled state (wevm#3188)

* fix: useWaitForTransactionReceipt enabled state

* test: update

---------

Co-authored-by: Tom Meagher <[email protected]>

* chore: bump version

* Fix 404 for "Caching. Deduplication. Persistence" section on beta landing page (wevm#3233)

* fix: use rpcUrls.default when requesting wallet_addEthereumChain (wevm#3251)

* chore: username

* fix: disconnect eagerly (wevm#3255)

* fix: eager disconnect

* chore: update tests

* chore: wagmi-dev to wevm

* ci: update verify

* chore: snaps

* chore: add sponsor

* docs: update

* chore: update viem

* chore: update viem

* chore: update viem

* chore: update viem

* refactor: updated walletconnect connector (wevm#3277)

* Add `getTransactionCount` and `useTransactionCount` (wevm#3271)

* feat: add getTransactionCount to core

* feat: add getTransactionCount to core

* feat: add useTransactionCount to react hooks

* docs: add useTransactionCount

* fix: useTransactionCount formatting

* fix: add getTransactionCount to exports tests

* chore: add changeset

* chore: remove changeset

* chore: remove wrapping describe

* chore: fix spacing

* fix: add retry/timeout strategy for injected connector initialization

* feat: unstable_connector transport

* chore: update snaps

* feat: upgrade @metamask/sdk package to version '0.12.4' (wevm#3237)

* feat: upgrade @metamask/sdk package to version '0.12.2'

* chore: code clean

* chore: remove the extensionOnly option

* fix: sdk is not disconnecting

* feat: upgrade @metamask/sdk package to version '0.12.4'

* feat: bump version

---------

Co-authored-by: Tom Meagher <[email protected]>

* chore: publish

* chore: update script

* chore: reshuffle type util

* test: fix flaky test

* fix(cli): import issue

* chore: version

* docs: update

* test: update

* test: update

* chore: update unstable_connector transport test

* feat(cli): react plugin - wagmi@beta (wevm#3217)

* feat(cli): react plugin

* refactor: import builder

* chore: bump msw

* refactor: create fns

* chore: checkpoint

* test: create types

* wip: refactor

* chore: tweaks

* test(cli): react plugin

* test: fix

* chore(connectors): bump deps

* fix(connectors): remove ledger

* chore: version

* chore: knip

* chore: update

* chore: lock deps

* ci: checks

* chore: lint fix

* ci: bump timeout

* chore: tweak

* test: codegen

* fix: sim codegen hook

* feat: createWatchContractEvent

* chore: readme

* feat(cli): plugins

* chore: add sponsors

* feat(cli): actions plugin

* chore: up sponsors

* docs: switch to local search

* chore: upgrade viem

* chore: version

* Feat: Add core actions and hooks for `getBlockTransactionCount`, `getGasPrice`, `getFeeHistory` and `estimateMaxPriorityFeePerGas` (wevm#3290)

* feat: add getBlockTransactionCount

* feat: add useBlockTransactionCount

* feat: add getGasPrice

* feat: add useGasPrice

* feat: add getFeeHistory

* feat: add useFeeHistory

* feat: add estimateMaxPriorityFeePerGas

* feat: add useEstimateMaxPriorityFeePerGas

* test: updates

---------

Co-authored-by: Tom Meagher <[email protected]>

* docs: transports

* docs: fix

* Feat: Add core actions and hooks for `verifyMessage` and `verifyTypedData` (wevm#3300)

* feat: add verifyMessage action

* fix: add chainId param to verifyMessage

* feat: add useVerifyMessage

* feat: add verifyTypedData

* feat: add useVerifyTypedData

* refactor: types

* docs: update

---------

Co-authored-by: Tom Meagher <[email protected]>

* fix: snaps

* chore: version

* chore: rc

* docs: fix

* fix: provide correct block explorer URL to WalletConnect (wevm#3341)

* fix: provide correct block explorer URL to WalletConnect

* chore: add changeset

* chore: remove references

* fix: provide correct block explorer URL to Coinbase connector (wevm#3342)

* fix: provide correct block explorer URL to Coinbase connector

* chore: add changeset

* chore: version

* chore: snaps

* chore: more snaps

* test: flaky

* chore: bump viem

* chore: version

* chore: fix lockfile

* docs: update

* Fix 404s in createConfig docs (wevm#3355)

* Fix doc link (wevm#3358)

fix: doc link

* Fix missing config argument (wevm#3359)

* chore(connectors): bump deps

* docs: update

* docs: update

* docs: updates

* docs: fix broken links

* docs: fix broken links

* chore: bump viem version

* chore: version

* chore: tweak

* chore: bump viem to stable

* chore: changeset

* docs: add old docs link

---------

Co-authored-by: tmm <[email protected]>
Co-authored-by: moxey.eth <[email protected]>
Co-authored-by: Omar <[email protected]>
Co-authored-by: aquatic <[email protected]>
Co-authored-by: Steve <[email protected]>
Co-authored-by: ignaciosantise <[email protected]>
Co-authored-by: Vitor Marthendal Nunes <[email protected]>
Co-authored-by: Omri Dan <[email protected]>
Co-authored-by: Eugene Chybisov <[email protected]>
Co-authored-by: POKENA7 <[email protected]>
  • Loading branch information
11 people authored Jan 4, 2024
1 parent c7dccba commit b3a0baa
Show file tree
Hide file tree
Showing 1,474 changed files with 76,119 additions and 71,930 deletions.
9 changes: 4 additions & 5 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "wagmi-dev/wagmi" }],
"commit": false,
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": ["@changesets/changelog-github", { "repo": "wevm/wagmi" }],
"commit": false,
"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
},
"ignore": ["docs", "example-dev"]
}
}
15 changes: 15 additions & 0 deletions .changeset/flat-buses-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"wagmi": major
---

Wagmi 2.0 featuring:

- Full TanStack Query support + queryKeys
- Connect multiple connectors
- Switch chains while disconnected
- EIP-6963 enabled
- Strongly typed chainId and chain properties
- Smaller bundle size
- Miscellaneous improvements and bug fixes

[Breaking Changes & Migration Guide](https://wagmi.sh/react/guides/migrate-from-v1-to-v2)
8 changes: 8 additions & 0 deletions .changeset/round-cats-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@wagmi/cli": major
---

Wagmi CLI 2.0.

[Breaking Changes & Migration Guide](https://wagmi.sh/cli/guides/migrate-from-v1-to-v2)

7 changes: 7 additions & 0 deletions .changeset/sad-cows-ponder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@wagmi/connectors": major
"create-wagmi": major
---

Added support for Wagmi 2.0.

16 changes: 16 additions & 0 deletions .changeset/short-hippos-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@wagmi/core": major
---

Wagmi Core 2.0 featuring:

- Full TanStack Query support + queryKeys
- Connect multiple connectors
- Switch chains while disconnected
- EIP-6963 enabled
- Strongly typed chainId and chain properties
- Smaller bundle size
- Miscellaneous improvements and bug fixes

[Breaking Changes & Migration Guide](https://wagmi.sh/core/guides/migrate-from-v1-to-v2)

4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@tmm @jxom

/packages/connectors/src/safe @DaniSomoza @dasanra @mikhailxyz @yagopv
/packages/connectors/src/walletConnect @ganchoradkov @0xAsimetriq
192 changes: 1 addition & 191 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,191 +1 @@
# Contributing

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).

> **Note**
>
> **Please ask first before starting work on any significant new features. This includes things like adding new connectors, hooks, chains, API providers, etc.**
>
> It's never a fun experience to have your pull request declined after investing time and effort into a new feature. To avoid this from happening, we request that contributors create a [feature request](https://github.com/wagmi-dev/wagmi/discussions/new?category=ideas) to first discuss any API changes or significant new ideas.
<br>

## Basic guide

This guide is intended to help you get started with contributing. By following these steps, you will understand the development process and workflow.

1. [Cloning the repository](#cloning-the-repository)
2. [Installing Node.js and pnpm](#installing-nodejs-and-pnpm)
3. [Installing dependencies](#installing-dependencies)
4. [Starting the development playground](#starting-the-development-playground)
5. [Running the test suite](#running-the-test-suite)
6. [Writing documentation](#writing-documentation)
7. [Submitting a pull request](#submitting-a-pull-request)

## Advanced guide

This guide covers more advanced topics. Pick the topics based on your needs.

8. [Versioning](#versioning)

<br>

---

<br>

## Cloning the repository

To start contributing to the project, clone it to your local machine using git:

```bash
git clone https://github.com/wagmi-dev/wagmi.git
```

Or the [GitHub CLI](https://cli.github.com):

```bash
gh repo clone wagmi-dev/wagmi
```

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## 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**.

You can run the following commands in your terminal to check your local Node.js and npm versions:

```bash
node -v
pnpm -v
```

If the versions are not correct or you don't have Node.js or pnpm installed, download and follow their setup instructions:

- Install Node.js using [fnm](https://github.com/Schniz/fnm) or from the [official website](https://nodejs.org)
- Install [pnpm](https://pnpm.io/installation)

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## Installing dependencies

Once in the project's root directory, run the following command to install the project's dependencies:

```bash
pnpm install
```

After the install completes, pnpm links packages across the project for development and [git hooks](https://github.com/toplenboren/simple-git-hooks) are set up.

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## Starting the development playground

To start the local development playground, run the following. This will run a [Next.js](https://nextjs.org) app (located at [`examples/_dev`](../examples/_dev)) that is set up for playing around with code while making changes.

```bash
pnpm playground
```

Once the Next.js dev server is running, you can make changes to any of the package source files (e.g. `packages/react`) and it will automatically update the playground. (If the playground isn't automatically updating, try running `pnpm dev` to relink packages in development mode.)

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## Running the test suite

wagmi uses [Anvil](https://github.com/foundry-rs/foundry/tree/master/crates/anvil) to execute tests against a local Ethereum node. First, install Anvil via [Foundry](https://book.getfoundry.sh/getting-started/installation). Next, add the following to your environment (recommended to use [`direnv`](https://github.com/direnv/direnv)):

```bash
ANVIL_FORK_URL=https://eth-mainnet.alchemyapi.io/v2/<apiKey>
```

`ANVIL_FORK_URL` can be for any RPC service provider (e.g. Alchemy or Infura). Now you are ready to run the tests! In one terminal session, spin up Anvil using `pnpm anvil`. Next, in a different terminal session, you have the following options for running tests:

- `pnpm test` — runs tests in watch mode
- `pnpm test:run` — performs single run without watch mode

When adding new features or fixing bugs, it's important to add test cases to cover the new/updated behavior. If snapshot tests fail, you can run the `test:update` command to update the snapshots.

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## Writing documentation

Documentation is crucial to helping developers of all experience levels use wagmi. wagmi uses [Nextra](https://github.com/shuding/nextra) and [MDX](https://mdxjs.com) for the documentation site (located at [`docs`](../docs)). To start the site in dev mode, run:

```bash
pnpm docs:dev
```

Try to keep documentation brief and use plain language so folks of all experience levels can understand. If you think something is unclear or could be explained better, you are welcome to open a pull request.

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## Submitting a pull request

When you're ready to submit a pull request, you can follow these naming conventions:

- Pull request titles use the [Imperative Mood](https://en.wikipedia.org/wiki/Imperative_mood) (e.g., `Add something`, `Fix something`).
- [Changesets](#versioning) use past tense verbs (e.g., `Added something`, `Fixed something`).

When you submit a pull request, GitHub will automatically lint, build, and test your changes. If you see an ❌, it's most likely a bug in your code. Please, inspect the logs through the GitHub UI to find the cause.

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

<br>

---

<div align="center">
✅ Now you're ready to contribute to wagmi! Follow the next steps if you need more advanced instructions.
</div>

---

<br>

## Versioning

When adding new features or fixing bugs, we'll need to bump the package versions. We use [Changesets](https://github.com/changesets/changesets) to do this.

> **Note**
>
> Only changes to the codebase that affect the public API or existing behavior (e.g. bugs) need changesets.
Each changeset defines which package(s) should be published and whether the change should be a major/minor/patch release, as well as providing release notes that will be added to the changelog upon release.

To create a new changeset, run `pnpm changeset`. This will run the Changesets CLI, prompting you for details about the change. You’ll be able to edit the file after it’s created — don’t worry about getting everything perfect up front.

Since we’re currently in beta, all changes should be marked as a minor/patch release to keep us within the `v0.x` range.

Even though you can technically use any markdown formatting you like, headings should be avoided since each changeset will ultimately be nested within a bullet list. Instead, bold text should be used as section headings.

If your PR is making changes to an area that already has a changeset (e.g. there’s an existing changeset covering theme API changes but you’re making further changes to the same API), you should update the existing changeset in your PR rather than creating a new one.

### Releasing

The first time a PR with a changeset is merged after a release, a new PR will automatically be created called `chore: version packages`. Any subsequent PRs with changesets will automatically update this existing version packages PR. Merging this PR triggers the release process by publishing to npm and cleaning up the changeset files.

### Creating a snapshot release

If a PR has changesets, you can create a [snapshot release](https://github.com/changesets/changesets/blob/main/docs/snapshot-releases.md) by [manually dispatching](https://github.com/wagmi-dev/wagmi/actions/workflows/snapshot.yml) the Snapshot workflow. This publishes a tagged version to npm with the PR branch name and timestamp.

<div align="right">
<a href="#advanced-guide">&uarr; back to top</a></b>
</div>
[View Contributing Guide on wagmi.sh](https://wagmi.sh/dev/contributing)
51 changes: 51 additions & 0 deletions .github/DISCUSSION_TEMPLATE/connector-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
title: '[Connector Request] '
body:
- type: markdown
attributes:
value: |
Thanks for your interest in contributing a new Connector to the wagmi! If you haven't already, please read the [Contributing Guidelines](https://wagmi.sh/dev/contributing).
Once you submit the form, the Wagmi team will follow up in the discussion thread to discuss next steps.
- type: textarea
attributes:
label: What **novel use-case** does the Connector provide?
description: |
A novel use-case is likely one that is not already covered by or not easily extended from another Connector (such as the `injected` or `walletConnect`).
Examples of **novel** use-cases could be a connector that integrates with:
- the injected `window.ethereum` provider (a la `injected`)
- a series of wallets via QR Codes or Mobile Deep Links (a la `walletConnect`)
- a wallet with it's own SDK (a la `coinbaseWallet`)
- hardware wallet(s) via Web USB/Bluetooth
- an Externally Owned Account via a private key or some other method
Examples of **nonnovel** use-cases would be a connector that:
- extends another connector (e.g. `walletConnect`) with no significant differences in functionality other than branding, etc.
placeholder: Info on what makes this connector different.
validations:
required: true

- type: textarea
attributes:
label: Are the Connector's integrations production-ready and generally available?
description: Connectors are intended to be used by consumers in production as part of wagmi. As such, the connector and all dependencies must be production-ready and generally available. This means your connector should not rely on non-production software or be restricted to a limited group of users. For example, if your connector requires a wallet that has a closed beta, it is not ready for inclusion in wagmi.
placeholder: Info about the Connector and any dependencies (e.g. browser extension, wallet app, npm package).
validations:
required: true

- type: checkboxes
attributes:
label: Are you committed to actively mainting the Connector?
description: 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. If this is not done, the connector could be removed from the future versions.
options:
- label: Yes, my team is or I am committed to actively maintaining the Connector.
required: true

- type: textarea
attributes:
label: Additional comments
description: Feel free to jot down any additional info you think might be helpful.
placeholder: Additional comments, questions, feedback.
Loading

0 comments on commit b3a0baa

Please sign in to comment.