Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-Feofanov authored Sep 9, 2024
2 parents 55b9ba8 + 7cbd23f commit 859032f
Show file tree
Hide file tree
Showing 16 changed files with 200 additions and 24 deletions.
20 changes: 18 additions & 2 deletions docs/src/content/hardhat-chai-matchers/docs/migrate-from-waffle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `@nomicfoundation/hardhat-chai-matchers` plugin is meant to be a drop-in rep

1. Uninstall the `@nomiclabs/hardhat-waffle` and `ethereum-waffle` packages:

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -34,11 +34,19 @@ The `@nomicfoundation/hardhat-chai-matchers` plugin is meant to be a drop-in rep

:::

:::tab{value="pnpm"}

```
pnpm remove @nomiclabs/hardhat-waffle ethereum-waffle
```

:::

::::

2. Then install the Hardhat Chai Matchers plugin:

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -64,6 +72,14 @@ The `@nomicfoundation/hardhat-chai-matchers` plugin is meant to be a drop-in rep

:::

:::tab{value="pnpm"}

```
pnpm add -D @nomicfoundation/hardhat-chai-matchers
```

:::

::::

3. In your Hardhat config, import the Hardhat Chai Matchers plugin and remove the `hardhat-waffle` one:
Expand Down
10 changes: 9 additions & 1 deletion docs/src/content/hardhat-chai-matchers/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The `hardhat-chai-matchers` plugin is designed to work with `hardhat-ethers`. At

## Installation

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -43,6 +43,14 @@ yarn add --dev @nomicfoundation/hardhat-chai-matchers

:::

:::tab{value="pnpm"}

```
pnpm add -D @nomicfoundation/hardhat-chai-matchers
```

:::

::::

## How can I use it?
Expand Down
10 changes: 9 additions & 1 deletion docs/src/content/hardhat-network-helpers/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This package provides convenience functions for quick and easy interaction with

## Installation

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -39,6 +39,14 @@ yarn add --dev @nomicfoundation/hardhat-network-helpers

:::

:::tab{value="pnpm"}

```
pnpm add -D @nomicfoundation/hardhat-network-helpers
```

:::

::::

## Usage
Expand Down
10 changes: 9 additions & 1 deletion docs/src/content/hardhat-runner/docs/advanced/create-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Tasks in Hardhat are asynchronous JavaScript functions that get access to the [

For our example, we will use the [`@nomicfoundation/hardhat-toolbox`](/hardhat-runner/plugins/nomicfoundation-hardhat-toolbox), which includes the [ethers.js](https://docs.ethers.org/v6/) library to interact with our contracts.

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -76,6 +76,14 @@ yarn add --dev @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-network

:::

:::tab{value="pnpm"}

```
pnpm add -D @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-network-helpers chai@4 ethers
```

:::

::::

Task creation code can go in `hardhat.config.js`, or whatever your configuration file is called. It’s a good place to create simple tasks. If your task is more complex, it's also perfectly valid to split the code into several files and `require` them from the configuration file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Follow these steps to migrate your project to Hardhat Toolbox.

1. First you'll need to remove some packages from your project.

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -38,11 +38,19 @@ Follow these steps to migrate your project to Hardhat Toolbox.

:::

:::tab{value="pnpm"}

```
pnpm remove @nomiclabs/hardhat-waffle ethereum-waffle
```

:::

::::

2. Then you need to install the Toolbox. If you are using yarn or an old version of npm, you'll also have to install some other packages (the peer dependencies of the Toolbox).

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -68,6 +76,14 @@ Follow these steps to migrate your project to Hardhat Toolbox.

:::

:::tab{value="pnpm"}

```
pnpm add -D @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-network-helpers ethers chai@4
```

:::

::::

3. Finally, remove `hardhat-waffle` from your imported plugins and import the Toolbox instead:
Expand Down
20 changes: 18 additions & 2 deletions docs/src/content/hardhat-runner/docs/advanced/using-esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following sections explain how to use ES modules in new or existing Hardhat

If you want to start a Hardhat project that uses ES modules by default, first you have to initialize a Node.js project:

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -46,13 +46,21 @@ yarn init -y

:::

:::tab{value="pnpm"}

```
pnpm init
```

:::

::::

Open the `package.json` that was created and add a `"type": "module"` entry. This will make the project use ESM by default.

After that, install Hardhat:

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -78,6 +86,14 @@ yarn add --dev hardhat

:::

:::tab{value="pnpm"}

```
pnpm add -D hardhat
```

:::

::::

and run `npx hardhat init` to create a Hardhat project:
Expand Down
10 changes: 9 additions & 1 deletion docs/src/content/hardhat-runner/docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To install it, you need to create an npm project by going to an empty folder, ru

Once your project is ready, you should run

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -53,6 +53,14 @@ yarn add --dev hardhat

:::

:::tab{value=pnpm}

```
pnpm add -D hardhat
```

:::

::::

To use your local installation of Hardhat, you need to use `npx` to run it (i.e. `npx hardhat init`).
Expand Down
20 changes: 18 additions & 2 deletions docs/src/content/hardhat-runner/docs/guides/project-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Hardhat projects are Node.js projects with the `hardhat` package installed and a

To initialize a Node.js project you can use [npm](https://docs.npmjs.com/cli/v8) or [yarn](https://classic.yarnpkg.com/). We recommend using npm 7 or later:

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -36,11 +36,19 @@ yarn init -y

:::

:::tab{value="pnpm"}

```
pnpm init
```

:::

::::

Then you need to install Hardhat:

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -66,6 +74,14 @@ yarn add --dev hardhat

:::

:::tab{value="pnpm"}

```
pnpm add -D hardhat
```

:::

::::

If you run `npx hardhat init` now, you will be shown some options to facilitate project creation:
Expand Down
12 changes: 10 additions & 2 deletions docs/src/content/hardhat-runner/docs/supporter-guides/oracles.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Oracles provide a bridge between the real-world and on-chain smart contracts by

Oracles play a critical role in facilitating the full potential of smart contract utility. Without a reliable connection to real-world data, smart contracts cannot effectively serve the real-world.

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/ZJfkNzyO7-U" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/ZJfkNzyO7-U" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Why are they needed?

Expand Down Expand Up @@ -94,7 +94,7 @@ Usually, you will create and manage your subscriptions on the [VRF Subscription

You will need to install it by typing:

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -120,6 +120,14 @@ yarn add --dev @chainlink/hardhat-chainlink

:::

:::tab{value="pnpm"}

```
pnpm add -D @chainlink/hardhat-chainlink
```

:::

::::

And import it inside the `hardhat.config` file:
Expand Down
20 changes: 18 additions & 2 deletions docs/src/content/ignition/docs/advanced/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To get started, we’ll uninstall the `hardhat-deploy` plugin and install the Ha

1. Remove the `hardhat-deploy` packages from your project:

::::tabsgroup{options="npm,yarn"}
::::tabsgroup{options="npm,yarn,pnpm"}

:::tab{value="npm"}

Expand All @@ -26,11 +26,19 @@ To get started, we’ll uninstall the `hardhat-deploy` plugin and install the Ha

:::

:::tab{value="pnpm"}

```sh
pnpm remove hardhat-deploy hardhat-deploy-ethers
```

:::

::::

2. Install the Hardhat Ignition package and `hardhat-network-helpers` to provide additional testing support as a replacement for `hardhat-deploy` functionality like EVM snapshots:

::::tabsgroup{options="npm,yarn"}
::::tabsgroup{options="npm,yarn,pnpm"}

:::tab{value="npm"}

Expand All @@ -48,6 +56,14 @@ To get started, we’ll uninstall the `hardhat-deploy` plugin and install the Ha

:::

:::tab{value="pnpm"}

```sh
pnpm add -D @nomicfoundation/hardhat-ignition-ethers @nomicfoundation/hardhat-network-helpers
```

:::

::::

3. Update the project’s `hardhat.config` file to remove `hardhat-deploy` and `hardhat-deploy-ethers` and instead import Hardhat Ignition:
Expand Down
10 changes: 9 additions & 1 deletion docs/src/content/ignition/docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If you prefer to use **Viem** instead of **ethers**, check out the [Viem guide](

Once you have a Hardhat project ready, open a terminal in its root directory, and run:

::::tabsgroup{options="npm 7+,npm 6,yarn"}
::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"}

:::tab{value="npm 7+"}

Expand All @@ -66,6 +66,14 @@ yarn add --dev @nomicfoundation/hardhat-ignition-ethers @nomicfoundation/hardhat

:::

:::tab{value="pnpm"}

```sh
pnpm add -D @nomicfoundation/hardhat-ignition-ethers @nomicfoundation/hardhat-ignition ethers
```

:::

::::

Finally, add this to your config file to [enable the plugin](../../../hardhat-runner/docs/guides/project-setup.md#plugins-and-dependencies):
Expand Down
Loading

0 comments on commit 859032f

Please sign in to comment.