Contributing Guide
Thanks for your interest in contributing to serve
! This guide will show you how to set up your environment and contribute to this library.
Set Up Your Environment
First, you need to install and be familiar with the following tools:
- Git: Here is a great guide by GitHub on installing and getting started with Git.
- Node.js and pnpm:
serve
requires Node.js v14 or higher.- We use
pnpm
as the package manager. This guide will help you install it.
Once you have the prerequisites, follow these steps to get the codebase:
- Fork the repository: Fork the
vercel/serve
repository to your own GitHub account. -
Clone your fork: Clone the repository to your local machine.
git clone https://github.com/YOUR_USERNAME/serve.git cd serve
-
Install dependencies:
pnpm install
Now you're ready to pick an open issue and start making changes!
Making Changes
-
Create a branch: Create a new branch for your feature or fix.
git switch --create my-new-feature
Please follow these branch naming guidelines:
- Prefix with the type of change:
fix/
,feat/
,docs/
,test/
, etc. - Use a short, descriptive name (e.g.,
feat/add-brotli-support
).
- Prefix with the type of change:
-
Start coding!
The CLI is written in TypeScript. Key files are located in the
source/
directory. -
Run in development mode:
You can run the CLI in watch mode, which will automatically restart it every time you save a change.
pnpm develop
-
Lint and test your code:
Before committing, ensure your code adheres to the project's standards and that all tests pass.
# Run the linter pnpm lint # Attempt to automatically fix lint issues pnpm lint --fix # Run all tests pnpm test
A pre-commit hook is configured to run
lint-staged
, which will automatically format and lint your staged files. -
Commit your changes:
Commit your changes with a descriptive message that follows the Conventional Commits specification.
git add . git commit -m "feat: add support for Brotli compression"
Submitting a Pull Request
-
Push your branch:
git push -u origin my-new-feature
-
Open a Pull Request: Go to the
vercel/serve
repository on GitHub and open a pull request from your fork. -
Review Process: The project maintainers will review your pull request. They may request changes to ensure code quality and consistency. Once approved and all CI checks have passed, your pull request will be merged.
Thank you for your contribution!