Skip to content

Latest commit

 

History

History
56 lines (31 loc) · 3.39 KB

CONTRIBUTING.md

File metadata and controls

56 lines (31 loc) · 3.39 KB

Optimism Ecosystem monorepo contributing guide

Workflow for Pull Requests

🚨 Before making any non-trivial change, please first open an issue describing the change to solicit feedback and guidance. This will increase the likelihood of the PR getting merged.

In general, the smaller the diff the easier it will be for us to review quickly.

In order to contribute, fork the repository and make pull requests against the main branch

Additionally, if you are writing a new feature, please ensure you add appropriate test cases.

Follow the Development Quick Start to set up your local development environment.

We recommend using the Conventional Commits format on commit messages.

Unless your PR is ready for immediate review and merging, please mark it as 'draft' (or simply do not open a PR yet).

Once ready for review, make sure to include a thorough PR description to help reviewers.

Bonus: Add comments to the diff under the "Files Changed" tab on the PR page to clarify any sections where you think we might have questions about the approach taken.

Rebasing

We use the git rebase command to keep our commit history tidy. Rebasing is an easy way to make sure that each PR includes a series of clean commits with descriptive commit messages See this tutorial for a detailed explanation of git rebase and how you should use it to maintain a clean commit history.

Versioning

When we need to fix bugs or introduce new features in our npm packages, we update the package version. To ensure consistency and simplicity in this process, we use a tool called changesets.

Each changeset contains three key pieces of information:

  • The package(s) to be published
  • Whether the release is major, minor, or a patch
  • A description of the change, which will be added to the autogenerated CHANGELOG.md file for the package.

Once you are ready to start the process of publishing your changes to npm, you can simply run pnpm changeset. This command will guide you through the process of selecting packages and defining the changes. Once complete, a new file will be generated, which you need to commit to the repository. Here's an example changeset.

When the changeset is merged into the main branch, two GitHub actions will trigger:

Release Snapshot

This action publishes a snapshot of the package(s) to npm. The version number will follow a pattern like 0.0.0-main-20240906142838 instead of a standard semver version.

Release Version

This action looks for changesets on the main branch and automatically opens a new pull request. This PR will:

  • Delete changeset files related to the current release
  • Bump the package version
  • Update the autogenerated CHANGELOG.md for the package(s)

Once this PR is merged, the release will be published to npm.