Skip to content

Commit

Permalink
docs: add directions to run docs and benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
FatumaA committed Apr 11, 2024
1 parent 2e128c1 commit b85a2b9
Showing 1 changed file with 48 additions and 15 deletions.
63 changes: 48 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# Contributing to Undici

* [Guides](#guides)
* [Update `llhttp`](#update-llhttp)
* [Lint](#lint)
* [Test](#test)
* [Coverage](#coverage)
* [Update `WPTs`](#update-wpts)
* [Building for externally shared node builtins](#external-builds)
* [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin)
* [Moderation Policy](#moderation-policy)
- [Guides](#guides)
- [Update `llhttp`](#update-llhttp)
- [Lint](#lint)
- [Test](#test)
- [Coverage](#coverage)
- [Update `WPTs`](#update-wpts)
- [Building for externally shared node builtins](#external-builds)
- [Benchmarks](#benchmarks)
- [Documentation](#documentation)
- [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin)
- [Moderation Policy](#moderation-policy)

<a id="guides"></a>

## Guides

This is a collection of guides on how to run and update `undici`, and how to run different parts of the project.

<a id="update-llhttp"></a>

### Update `llhttp`

The HTTP parser used by `undici` is a WebAssembly build of [`llhttp`](https://github.com/nodejs/llhttp).
Expand All @@ -35,6 +41,7 @@ git clone git@github.com:nodejs/llhttp.git

cd llhttp
```

#### Checkout a `llhttp` release

```bash
Expand Down Expand Up @@ -84,6 +91,7 @@ npm run build:wasm
Create a commit which includes all of the updated files in lib/llhttp.

<a id="update-wpts"></a>

### Update `WPTs`

`undici` runs a subset of the [`web-platform-tests`](https://github.com/web-platform-tests/wpt).
Expand All @@ -108,6 +116,7 @@ git sparse-checkout add /mimesniff
git sparse-checkout add /storage
git sparse-checkout add /service-workers
```

</details>

#### Sparse-clone the [wpt](https://github.com/web-platform-tests/wpt) repo
Expand Down Expand Up @@ -153,20 +162,25 @@ npm run lint
```

<a id="test"></a>

### Test

```bash
npm run test
```

<a id="coverage"></a>

### Coverage

```bash
npm run coverage
```

<a id="benchmarks"></a>

<a id="external-builds"></a>

### Building for externally shared node builtins

If you are packaging `undici` for a distro, this might help if you would like to use
Expand All @@ -176,36 +190,55 @@ To enable this, pass `EXTERNAL_PATH=/path/to/global/node_modules/undici` to `bui
You shall also pass this path to `--shared-builtin-undici/undici-path` in Node.js's `configure.py`.

<a id="developers-certificate-of-origin"></a>

### Benchmarks

```bash
cd benchmarks && npm i && npm run bench
```

The benchmarks will be available at `http://localhost:3042`.

<a id="documentation"></a>

### Documentation

```bash
cd docs && npm i && npm run serve
```

The documentation will be available at `http://localhost:3000`.

## Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

* (a) The contribution was created in whole or in part by me and I
- (a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

* (b) The contribution is based upon previous work that, to the best
- (b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

* (c) The contribution was provided directly to me by some other
- (c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

* (d) I understand and agree that this project and the contribution
- (d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

<a id="moderation-policy"></a>

### Moderation Policy

The [Node.js Moderation Policy] applies to this project.

[Node.js Moderation Policy]:
https://github.com/nodejs/admin/blob/main/Moderation-Policy.md
[Node.js Moderation Policy]: https://github.com/nodejs/admin/blob/main/Moderation-Policy.md

0 comments on commit b85a2b9

Please sign in to comment.