We'd be happy to accept pull requests. If you plan on working on something big, please first drop us a line!
To get started, first fork the project on GitHub and clone the project using Git.
This project uses Yarn 4 for dependency management. To install dependencies, run the following command from the project root:
yarn install
To check for updates, run:
yarn upgrade-interactive
This project is linted using ESLint. You can lint the project by running:
yarn eslint .
This project is formatted using Prettier. You can check format the project:
prettier --write .
This project is tested using Vitest. There are two kinds of tests.
Unit tests are in the test/unit
folder of the project. You can run them using the following command:
yarn vitest test/unit
Integration tests are in the test/integration
folder. They require some extra setup.
Firstly, these tests require the Cloudflare executable. You can download this with:
curl -fsSLo cloudflared-linux-amd64 https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64
chmod +x cloudflared-linux-amd64
They also require a Transloadit key and secret, which you can get from https://transloadit.com/c/credentials.
You can run the integration tests with:
TRANSLOADIT_KEY='YOUR_TRANSLOADIT_KEY' TRANSLOADIT_SECRET='YOUR_TRANSLOADIT_SECRET' CLOUDFLARED_PATH='./cloudflared-linux-amd64' vitest run test/integration
Only maintainers can make releases. Releases to npm are automated using GitHub actions. To make a release, perform the following steps:
- Update the version using Yarn, e.g.
yarn version patch
. This will create a new Git commit and tag. - Push the tag to GitHub.
git push origin main --tags
- If the tests pass, GitHub actions will now publish the new version to npm.
- When successful add release notes.