Skip to content

Latest commit

 

History

History
92 lines (64 loc) · 3.05 KB

File metadata and controls

92 lines (64 loc) · 3.05 KB

Contributing

Prerequisites

  • Node.js 22+
  • pnpm 10.8+
npm i -g pnpm

Pull Request Guidelines

Before getting started read CoW Protocol Front-End • Contribution Guide.

📏 Keep PRs Small and Focused

  • One feature per PR - Each PR should focus on a single change or feature
  • Break large features into multiple smaller PRs for easier review
  • Atomic changes that can be reviewed and merged independently

📝 Clear Descriptions

  • Explain the changes - What does your PR do and why?
  • Provide context - Why is this change needed?
  • Include examples - How should reviewers test your changes?
  • Link related issues - Reference any GitHub issues this PR addresses

🧪 Testing Requirements

  • New code must be covered by meaningful unit tests
  • Update tests when modifying existing functionality
  • Ensure all tests pass before creating the PR

🧹 Code Quality

  • Remove dead code - Delete unused functions, variables, and imports
  • No debugging code - Remove console.log, debugger statements, and temporary code
  • Professional appearance - Code should be clean, readable, and production-ready

Releasing

This happens automatically using release-please and GitHub Actions.

When you merge a PR into main, release-please will create a new release PR if there are changes that warrant a new release (based on conventional commits).

You must then merge that PR to create a new release.

Note: DO NOT forget to unlock the conversation after merging, otherwise the GH Action will fail.

Publishing to npm

In this project packages we use workspace:* as version for local packages in package.json dependencies.

You must not manually publish with npm (like npm publish) — it won't rewrite workspace:* before publishing.

→ Always publish with pnpm publish (or changeset publish, or a release pipeline that uses pnpm).

Publish a release candidate

Steps:

  1. Commit changes into some branch, let's say rc/sdk-changes-1
  2. Push the branch to origin
  3. Decide which package you want to publish, let's say packages/subgraph
  4. Decide which version will the RC have, let's say .1.2-rc.0
  5. Run the command in the repo root:
npx release-please release-pr \
  --path packages/subgraph \
  --release-as 0.1.2-rc.0 \
  --target-branch rc/sdk-changes-1 \
  --manifest-file .release-please-manifest.json \
  --config-file .release-please-config.json \
  --repo-url https://github.com/cowprotocol/cow-sdk \
  --token YOUR_GITHUB_TOKEN
  1. Once the command is successfuly executed, you should see a new open PR in the repo. Example
  2. Option 1: You can merge the PR and it will automatically publish a version
  3. Option 2: You can checkout the PR branch and publish the version manually:
pnpm --filter @cowprotocol/sdk-subgraph exec npm publish --tag rc

Know how

Reset pnpm store

pnpm store prune
rm -rf "$(pnpm store path)"