You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+12-18
Original file line number
Diff line number
Diff line change
@@ -12,37 +12,37 @@ We use a [GitHub project](https://github.com/orgs/NomicFoundation/projects/4/vie
12
12
13
13
## Project structure
14
14
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).
16
16
17
17
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).
18
18
19
19
## Installing
20
20
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.
22
22
23
23
## Building the projects
24
24
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.
26
26
27
27
## Testing
28
28
29
29
All tests are written using [mocha](https://mochajs.org) and [chai](https://www.chaijs.com).
30
30
31
31
### Per-package
32
32
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.
34
34
35
35
### Entire project
36
36
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.
38
38
39
39
## Code formatting
40
40
41
41
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.
42
42
43
43
We also have [eslint](https://eslint.org/) installed in all the projects. It checks that you have run Prettier and forbids some dangerous patterns.
44
44
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.
46
46
47
47
## Branching
48
48
@@ -95,23 +95,17 @@ This is a list of the modules that always get loaded during startup:
95
95
96
96
## Developing locally
97
97
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.
99
99
100
100
### Linking
101
101
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:
103
103
104
104
1. Go to `packages/hardhat-core` and run `npm link`
105
105
2. Go to some hardhat project and run `npm link hardhat`
106
106
107
107
Now any change you make in the code will be reflected in that project.
108
108
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
-
115
109
### Yalc
116
110
117
111
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
121
115
122
116
Unlike linking, if you make a change in the code, you'll need to repeat the process.
123
117
124
-
### yarn pack
118
+
### pnpm pack
125
119
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):
127
121
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`.
130
124
131
125
Unlike linking, if you make a change in the code, you'll need to repeat the process.
0 commit comments