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 2 commits
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
66 changes: 50 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# Contributing to Undici

* [Guides](#guides)
* [Update `llhttp`](#update-llhttp)
* [Lint](#lint)
* [Test](#test)
* [Coverage](#coverage)
* [Releases](#releases)
* [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)
- [Releases](#releases)
- [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 @@ -36,6 +42,7 @@ git clone git@github.com:nodejs/llhttp.git

cd llhttp
```

#### Checkout a `llhttp` release

```bash
Expand Down Expand Up @@ -85,6 +92,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 @@ -109,6 +117,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 @@ -154,26 +163,30 @@ npm run lint
```

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

### Test

```bash
npm run test
```

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

### Coverage

```bash
npm run coverage
```

<a id="releases"></a>

### Issuing Releases

Release is automatic on commit to main which bumps the package.json version field.
Use the "Create release PR" github action to generate a release PR.

<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 @@ -182,37 +195,58 @@ an unbundled version instead of bundling one in `libnode.so`.
To enable this, pass `EXTERNAL_PATH=/path/to/global/node_modules/undici` to `build/wasm.js`.
You shall also pass this path to `--shared-builtin-undici/undici-path` in Node.js's `configure.py`.

<a id="benchmarks"></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`.

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

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