diff --git a/docs/src/content/hardhat-chai-matchers/docs/migrate-from-waffle.md b/docs/src/content/hardhat-chai-matchers/docs/migrate-from-waffle.md index 485704db0d..6cc9277f73 100644 --- a/docs/src/content/hardhat-chai-matchers/docs/migrate-from-waffle.md +++ b/docs/src/content/hardhat-chai-matchers/docs/migrate-from-waffle.md @@ -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+"} @@ -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+"} @@ -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: diff --git a/docs/src/content/hardhat-chai-matchers/docs/overview.md b/docs/src/content/hardhat-chai-matchers/docs/overview.md index d3bdf25d95..82c6073aa4 100644 --- a/docs/src/content/hardhat-chai-matchers/docs/overview.md +++ b/docs/src/content/hardhat-chai-matchers/docs/overview.md @@ -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+"} @@ -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? diff --git a/docs/src/content/hardhat-network-helpers/docs/overview.md b/docs/src/content/hardhat-network-helpers/docs/overview.md index 5730f9a16d..e7294e8973 100644 --- a/docs/src/content/hardhat-network-helpers/docs/overview.md +++ b/docs/src/content/hardhat-network-helpers/docs/overview.md @@ -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+"} @@ -39,6 +39,14 @@ yarn add --dev @nomicfoundation/hardhat-network-helpers ::: +:::tab{value="pnpm"} + +``` +pnpm add -D @nomicfoundation/hardhat-network-helpers +``` + +::: + :::: ## Usage diff --git a/docs/src/content/hardhat-runner/docs/advanced/create-task.md b/docs/src/content/hardhat-runner/docs/advanced/create-task.md index 13989b3768..11fbde9ace 100644 --- a/docs/src/content/hardhat-runner/docs/advanced/create-task.md +++ b/docs/src/content/hardhat-runner/docs/advanced/create-task.md @@ -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+"} @@ -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. diff --git a/docs/src/content/hardhat-runner/docs/advanced/migrating-from-hardhat-waffle.md b/docs/src/content/hardhat-runner/docs/advanced/migrating-from-hardhat-waffle.md index a1f8e58e0d..dcc54b86cb 100644 --- a/docs/src/content/hardhat-runner/docs/advanced/migrating-from-hardhat-waffle.md +++ b/docs/src/content/hardhat-runner/docs/advanced/migrating-from-hardhat-waffle.md @@ -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+"} @@ -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+"} @@ -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: diff --git a/docs/src/content/hardhat-runner/docs/advanced/using-esm.md b/docs/src/content/hardhat-runner/docs/advanced/using-esm.md index ce6c7e4002..a697ab523e 100644 --- a/docs/src/content/hardhat-runner/docs/advanced/using-esm.md +++ b/docs/src/content/hardhat-runner/docs/advanced/using-esm.md @@ -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+"} @@ -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+"} @@ -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: diff --git a/docs/src/content/hardhat-runner/docs/getting-started/index.md b/docs/src/content/hardhat-runner/docs/getting-started/index.md index 55b9dcbeed..f714378112 100644 --- a/docs/src/content/hardhat-runner/docs/getting-started/index.md +++ b/docs/src/content/hardhat-runner/docs/getting-started/index.md @@ -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+"} @@ -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`). diff --git a/docs/src/content/hardhat-runner/docs/guides/project-setup.md b/docs/src/content/hardhat-runner/docs/guides/project-setup.md index 728b0436c6..c25dac3190 100644 --- a/docs/src/content/hardhat-runner/docs/guides/project-setup.md +++ b/docs/src/content/hardhat-runner/docs/guides/project-setup.md @@ -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+"} @@ -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+"} @@ -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: diff --git a/docs/src/content/hardhat-runner/docs/supporter-guides/oracles.md b/docs/src/content/hardhat-runner/docs/supporter-guides/oracles.md index 619394d7c1..8a8213214d 100644 --- a/docs/src/content/hardhat-runner/docs/supporter-guides/oracles.md +++ b/docs/src/content/hardhat-runner/docs/supporter-guides/oracles.md @@ -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. - + ## Why are they needed? @@ -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+"} @@ -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: diff --git a/docs/src/content/ignition/docs/advanced/migrating.md b/docs/src/content/ignition/docs/advanced/migrating.md index 7e801c9470..ce53c88222 100644 --- a/docs/src/content/ignition/docs/advanced/migrating.md +++ b/docs/src/content/ignition/docs/advanced/migrating.md @@ -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"} @@ -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"} @@ -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: diff --git a/docs/src/content/ignition/docs/getting-started/index.md b/docs/src/content/ignition/docs/getting-started/index.md index e1dd48a3d6..78e3678450 100644 --- a/docs/src/content/ignition/docs/getting-started/index.md +++ b/docs/src/content/ignition/docs/getting-started/index.md @@ -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+"} @@ -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): diff --git a/docs/src/content/ignition/docs/guides/ledger.md b/docs/src/content/ignition/docs/guides/ledger.md index a3574d86d9..8b8a31e445 100644 --- a/docs/src/content/ignition/docs/guides/ledger.md +++ b/docs/src/content/ignition/docs/guides/ledger.md @@ -4,7 +4,7 @@ Hardhat Ignition supports deploying contracts using a Ledger hardware wallet via The first step is to install the `hardhat-ledger` plugin: -::::tabsgroup{options="npm,yarn"} +::::tabsgroup{options="npm,yarn,pnpm"} :::tab{value="npm"} @@ -22,6 +22,14 @@ yarn add --dev @nomicfoundation/hardhat-ledger ::: +:::tab{value="pnpm"} + +```sh +pnpm add -D @nomicfoundation/hardhat-ledger +``` + +::: + :::: ## Configuring the Ledger plugin diff --git a/docs/src/content/ignition/docs/guides/upgradeable-proxies.md b/docs/src/content/ignition/docs/guides/upgradeable-proxies.md index 27ac0c1f10..17ff9ac992 100644 --- a/docs/src/content/ignition/docs/guides/upgradeable-proxies.md +++ b/docs/src/content/ignition/docs/guides/upgradeable-proxies.md @@ -14,7 +14,7 @@ The finished code for this guide can be found in the [Hardhat Ignition monorepo] Before we get started, make sure you have the OpenZeppelin Contracts library installed in your project. You can install it using npm or yarn: -::::tabsgroup{options="npm,yarn"} +::::tabsgroup{options="npm,yarn,pnpm"} :::tab{value="npm"} @@ -32,6 +32,14 @@ yarn add @openzeppelin/contracts ::: +:::tab{value="pnpm"} + +```sh +pnpm add @openzeppelin/contracts +``` + +::: + :::: ## Getting to know our contracts diff --git a/docs/src/content/ignition/docs/guides/viem.md b/docs/src/content/ignition/docs/guides/viem.md index bae604be3d..dc5a051b11 100644 --- a/docs/src/content/ignition/docs/guides/viem.md +++ b/docs/src/content/ignition/docs/guides/viem.md @@ -15,7 +15,7 @@ You can also follow [Hardhat's Viem Quick Start](../../../hardhat-runner/docs/ad From the root directory of your Hardhat project run: -::::tabsgroup{options="npm 7+,npm 6,yarn"} +::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"} :::tab{value="npm 7+"} @@ -41,6 +41,14 @@ yarn add --dev @nomicfoundation/hardhat-ignition-viem @nomicfoundation/hardhat-i ::: +:::tab{value="pnpm"} + +```shell +pnpm add -D @nomicfoundation/hardhat-ignition-viem viem typescript +``` + +::: + :::: Then [enable the plugin](../../../hardhat-runner/docs/guides/project-setup.md#plugins-and-dependencies) in your config file: diff --git a/docs/src/content/tutorial/creating-a-new-hardhat-project.md b/docs/src/content/tutorial/creating-a-new-hardhat-project.md index e2cc269b94..000814ac1c 100644 --- a/docs/src/content/tutorial/creating-a-new-hardhat-project.md +++ b/docs/src/content/tutorial/creating-a-new-hardhat-project.md @@ -19,7 +19,7 @@ Use the tabs in the snippets to select your preferred package manager. We recomm :::: -::::tabsgroup{options="npm 7+,npm 6,yarn"} +::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"} :::tab{value="npm 7+"} @@ -45,11 +45,19 @@ yarn init ::: +:::tab{value="pnpm"} + +``` +pnpm init +``` + +::: + :::: Now we can install Hardhat: -::::tabsgroup{options="npm 7+,npm 6,yarn"} +::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"} :::tab{value="npm 7+"} @@ -75,6 +83,14 @@ yarn add --dev hardhat ::: +:::tab{value="pnpm"} + +``` +pnpm add -D hardhat +``` + +::: + :::: In the same directory where you installed Hardhat run: @@ -130,7 +146,7 @@ In this tutorial we are going to use our recommended plugin, [`@nomicfoundation/ To install it, run this in your project directory: -::::tabsgroup{options="npm 7+,npm 6,yarn"} +::::tabsgroup{options="npm 7+,npm 6,yarn,pnpm"} :::tab{value="npm 7+"} @@ -156,6 +172,14 @@ yarn add --dev @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-ignitio ::: +:::tab{value="pnpm"} + +``` +pnpm add -D @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-ignition @nomicfoundation/hardhat-network-helpers chai@4 ethers +``` + +::: + :::: Add the highlighted line to your `hardhat.config.js` so that it looks like this: diff --git a/docs/temp/tabsConfig.json b/docs/temp/tabsConfig.json index 963eb3ad99..91f0723903 100644 --- a/docs/temp/tabsConfig.json +++ b/docs/temp/tabsConfig.json @@ -1,6 +1,6 @@ { "TypeScript/JavaScript": "TypeScript", - "npm 7+/npm 6/yarn": "npm 7+", + "npm 7+/npm 6/yarn/pnpm": "npm 7+", "Infura/Alchemy": "Infura", "Infura | Typescript/Alchemy | Typescript/Infura | Javascript/Alchemy | Javascript": "Infura | Typescript" }