bubble-icon
Skip to main content

Contributing to GraphCommerce

Looking to contribute something to GraphCommerce? Here's how you can help.

Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.

Bug reports

Well-written, through bug reports are a great way to contribute to the project. Before raising a new issue, please check our issues list ↗ to determine whether the issue you encountered has already been reported.

A good bug report should be self-explanatory. Use the bug report template ↗ to create a bug report.

Feature requests

Feature requests are welcome. Please take a moment to find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince us of the merits of this feature.

Provide as much detail and context as possible. Use the feature request template ↗ to create a feature request.

Pull requests

Good pull requests (e.g. patches, improvements, new features) are a fantastic help. Please ask first ↗ before embarking on any significant pull request (e.g. implementing features or refactoring code), otherwise you risk spending a lot of time working on something that might not be relevant to the project.

File structure

File structure of GraphCommerce

├── docs
├── examples
    └── magento-graphcms
├── packages
  • To make changes to the magento-graphcms template, edit the files in examples/magento-graphcms.

  • To modify GraphCommerce framework, components, edit the files in packages/graphcommerce.

  • To make changes to the docs, edit the files in docs

Formatting and Linting

GraphCommerce uses ESLint for linting and Prettier for code formatting. Install the recommended VS Code extensions

Creating a branch

  1. Fork the repository and clone it locally.
  2. Create a branch for your PR based on the canary branch. Use the following naming convention: feature/your-branch-name or fix/your-branch-name

Creating a pull request

  1. Create a pull request. The PR can stay open until you are ready to merge.
  2. Add your changes
  3. Add a changeset
  • Run 'yarn changeset' and select 'patch' for bugfixes and 'minor' for new features. Commit the changeset that is created.

yarn changeset

Select 'patch' or 'minor' when running yarn changeset

Merge checklist for your pull request

  • Code must pass the CI checks.
  • Code must be formatted with prettier
  • Changeset is available
  • Eslint must not report any errors in the changed files
  • Eslint should not give any warnings in the changed files
  • Bundle size should not increase significantly
  • Lingui translations must be generated and translated
  • Changes made to examples/magento-graphcms should be kept to a minimum, because every change made here must be applied by every developer upgrading a GraphCommerce project
    • Extract code changes made and move them into packages where possible.
    • Stylistic only changes usually aren't prefered, less changes often is better.

Next steps