Skip to content

Commit 58e317e

Browse files
committed
Update CONTRIBUTING guide to use pnpm
1 parent 131336d commit 58e317e

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

CONTRIBUTING.md

+12-18
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,37 @@ We use a [GitHub project](https://github.com/orgs/NomicFoundation/projects/4/vie
1212

1313
## Project structure
1414

15-
This repository is a monorepo handled with [Yarn v1](https://classic.yarnpkg.com/lang/en/) and [Yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/).
15+
This repository is a monorepo handled with [pnpm](https://pnpm.io/) and [pnpm workspaces](https://pnpm.io/workspaces).
1616

1717
There's a folder for each subproject in `packages/`. All of them are plugins, except for `/packages/hardhat-core` which is the main project (i.e. the one that's published as [hardhat](https://npmjs.com/package/hardhat) in npm).
1818

1919
## Installing
2020

21-
To install the project's dependencies, run `yarn` in the root directory of the repository.
21+
To install the project's dependencies, run `pnpm i` in the root directory of the repository.
2222

2323
## Building the projects
2424

25-
Plugins require hardhat to be built or tested. Our recommendation is to run `yarn watch` from the root folder. This will keep everything compiled, and these problems will be avoided.
25+
Plugins require hardhat to be built or tested. Our recommendation is to run `pnpm watch` from the root folder. This will keep everything compiled, and these problems will be avoided.
2626

2727
## Testing
2828

2929
All tests are written using [mocha](https://mochajs.org) and [chai](https://www.chaijs.com).
3030

3131
### Per-package
3232

33-
You can run a package's tests by executing `yarn test` inside its folder.
33+
You can run a package's tests by executing `pnpm test` inside its folder.
3434

3535
### Entire project
3636

37-
You can run all the tests at once by running `yarn test` from the root folder.
37+
You can run all the tests at once by running `pnpm test` from the root folder.
3838

3939
## Code formatting
4040

4141
We use [Prettier](https://prettier.io/) to format all the code without any special configuration. Whatever Prettier does is considered The Right Thing. It's completely fine to commit non-prettied code and then reformat it in a later commit.
4242

4343
We also have [eslint](https://eslint.org/) installed in all the projects. It checks that you have run Prettier and forbids some dangerous patterns.
4444

45-
The linter is always run in the CI, so make sure it passes before pushing code. You can use `yarn lint` and `yarn lint:fix` inside the packages' folders.
45+
The linter is always run in the CI, so make sure it passes before pushing code. You can use `pnpm lint` and `pnpm lint:fix` inside the packages' folders.
4646

4747
## Branching
4848

@@ -95,23 +95,17 @@ This is a list of the modules that always get loaded during startup:
9595

9696
## Developing locally
9797

98-
All these tips assume you are running `yarn watch` from the root directory.
98+
All these tips assume you are running `pnpm watch` from the root directory.
9999

100100
### Linking
101101

102-
You can [link](https://classic.yarnpkg.com/en/docs/cli/link/) any package to test it locally. While the rest of the commands we run use `yarn`, we recommend you use `npm` for linking, since `yarn link` won't create the `hardhat` executable. For example, if you are working on `hardhat`, you can follow these steps:
102+
You can [link](https://docs.npmjs.com/cli/v9/commands/npm-link/) any package to test it locally. While the rest of the commands we run use `pnpm`, we recommend you use `npm` for linking. For example, if you are working on `hardhat`, you can follow these steps:
103103

104104
1. Go to `packages/hardhat-core` and run `npm link`
105105
2. Go to some hardhat project and run `npm link hardhat`
106106

107107
Now any change you make in the code will be reflected in that project.
108108

109-
If you prefer to use `yarn link`, you need to work around the lack of an executable in `node_modules/.bin/hardhat`. We recommend having an alias like this:
110-
111-
```bash
112-
alias lhh='node --preserve-symlinks $(node -e "console.log(require.resolve(\"hardhat/internal/cli/cli.js\"))")'
113-
```
114-
115109
### Yalc
116110

117111
If for any reason linking doesn't work for you, you can use [`yalc`](https://github.com/whitecolor/yalc):
@@ -121,12 +115,12 @@ If for any reason linking doesn't work for you, you can use [`yalc`](https://git
121115

122116
Unlike linking, if you make a change in the code, you'll need to repeat the process.
123117

124-
### yarn pack
118+
### pnpm pack
125119

126-
An even more realistic way of using your local changes in a project is to use [`yarn pack`](https://classic.yarnpkg.com/en/docs/cli/pack/):
120+
An even more realistic way of using your local changes in a project is to use [`pnpm pack`](https://pnpm.io/cli/pack):
127121

128-
1. Go to `packages/hardhat-core` and run `yarn pack`. This will create a `nomiclabs-hardhat-x.y.z.tgz` file in that directory.
129-
2. Go to some hardhat project and run `yarn add /path/to/hardhat/packages/hardhat/nomiclabs-hardhat-x.y.z.tgz`.
122+
1. Go to `packages/hardhat-core` and run `pnpm pack`. This will create a `nomiclabs-hardhat-x.y.z.tgz` file in that directory.
123+
2. Go to some hardhat project and run `npm install /path/to/hardhat/packages/hardhat/nomiclabs-hardhat-x.y.z.tgz`.
130124

131125
Unlike linking, if you make a change in the code, you'll need to repeat the process.
132126

0 commit comments

Comments
 (0)