Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add directions to run docs and benchmarks #3092

Merged
merged 4 commits into from
Apr 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 [email protected]: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>
FatumaA marked this conversation as resolved.
Show resolved Hide resolved

<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>
FatumaA marked this conversation as resolved.
Show resolved Hide resolved

### 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
Loading