Skip to content

Latest commit

 

History

History
147 lines (95 loc) · 4.17 KB

CONTRIBUTING.md

File metadata and controls

147 lines (95 loc) · 4.17 KB

Contributing

Thanks for your interest in contributing to op-viem! Please take a moment to review this document before submitting a pull request.

Note

Please ask first before starting work on any significant new features.


Basic guide

This guide is intended to help you get started with contributing. By following these steps, you will understand the development process and workflow.

  1. Cloning the repository
  2. Installing Node.js and pnpm
  3. Installing Foundry
  4. Installing dependencies
  5. Running the test suite
  6. Writing documentation
  7. Submitting a pull request
  8. Versioning

Cloning the repository

To start contributing to the project, clone it to your local machine using git:

git clone https://github.com/wagmi-dev/viem.git --recurse-submodules

Or the GitHub CLI:

gh repo clone wagmi-dev/viem -- --recurse-submodules

Installing Node.js and pnpm

You need to install Node.js v18 or higher and pnpm.

You can run the following commands in your terminal to check your local Node.js and Bun versions:

node -v
pnpm -v

If the versions are not correct or you don't have Node.js or pnpm installed, download and follow their setup instructions:


Installing Foundry

op-viem uses Foundry for testing. We run a local Anvil instance against a forked Ethereum node, where we can also use tools like Forge to deploy test contracts to it.

Install Foundry using the following command:

curl -L https://foundry.paradigm.xyz | bash

Installing dependencies

Once in the project's root directory, run the following command to install the project's dependencies:

pnpm install

Running the test suite

pnpm run test

Sometimes there may be some tests which fail unexpectedly – you can press f to rerun them and they should pass.

When adding new features or fixing bugs, it's important to add test cases to cover the new/updated behavior.


Writing documentation

Documentation is crucial to helping developers of all experience levels use op-viem. op-viem uses VitePress and Markdown for the documentation site (located at site). To start the site in dev mode, run:

pnpm run dev:docs

Try to keep documentation brief and use plain language so folks of all experience levels can understand. If you think something is unclear or could be explained better, you are welcome to open a pull request.


Submitting a pull request

When you're ready to submit a pull request, you can follow these naming conventions:

  • Pull request titles use the Imperative Mood (e.g., Add something, Fix something).
  • Changesets use past tense verbs (e.g., Added something, Fixed something).

When you submit a pull request, GitHub will automatically lint, build, and test your changes. If you see an ❌, it's most likely a bug in your code. Please, inspect the logs through the GitHub UI to find the cause.