Contributing

We appreciate contributions from the community!

Loving ScandiPWA and want to get involved? Thanks! There are plenty of ways you can help.

Please take a moment to review this document in order to make the contribution process straightforward and effective for everyone involved. We ask that you follow these guidelines make the time of the developers managing this open-source project more effective. Thank you for your time; we are looking forward to addressing your issue or assessing your patches and features!

Before You Start

Good pull requests, such as patches, improvements, and new features, are a fantastic help. They should remain focused in scope and not contain unrelated commits.

Before starting development, please ask if somebody else is already working on this task. If you are developing a new feature, please make sure the core developers agree is in-scope of the ScandiPWA App.

In general, it is always good practice to discuss your ideas with the team. By communicating and coordinating our work, we can ensure that nobody accidentally performs an unnecessary task, or fixes a bug that has already been already fixed by another developer.

The Development Environment

Prerequisites

You need to have Git, Node (version 10), and Yarn installed

git --version
node -v # expected: v10.18.1 or similar
yarn -v # expected: 1.18.0 or similar

You also need to fork the ScandiPWA repository to be able to create pull requests

Setting Up

Clone the ScandiPWA repository:

# clone your fork - replace <your-username> with your github username
git clone https://github.com/<your-username>/scandipwa
cd scandipwa # move into the directory you cloned

At the time of writing, the new way of contributing is still in beta. Until it gets merged to master, you need to checkout the correct branch after cloning:

git checkout create-scandipwa-app

Install dependencies with yarn:

yarn

Start the development server:

cd packages/scandipwa
yarn start
  1. Type in yarn start

Your browser should open at http://localhost:3000/. Now you can modify files and see changes!

Repository Structure

The ScandiPWA repository is a monorepo, containing multiple packages in the packages directory. This is managed by Lerna.

└── 📁 packages
├── 📁 scandipwa # theme sources
├── 📁 m2-theme # for building a magento2 theme
├── 📁 bundle-analyzer
├── 📁 router # the frontend routing mechanism
└── 📁 framework

These packages are under development, and are subject to change

Development

You can now make the changes you wish. Please remember to write meaningful commit messages.

In addition, before submitting a pull request, please verify that your code works as expected, and summarize your testing results in the description.

Code Quality

We are aware that the current codebase is not perfect. However, we would like ScandiPWA to improve over time. To ensure that the code is consistent and easy to maintain, please follow our code style guide for JavaScript and SCSS.

Publishing

Use lerna publish command.

For canary publishing, use lerna publish --canary --exact --preid next --dist-tag=next minor

When ready, push your commits to your fork, and create a pull request. Thanks for your contribution!