Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Contributing

Yury Delendik edited this page Feb 7, 2018 · 12 revisions

Welcome! Please get familiar with project vision.

We always looking for help with issues assigned to a project mentioned at Projects, and you can always start off with easy issues.

Contributing code

Here is the typical process of contributing the code for this project:

  1. Fork
  2. Create feature branch
  3. Make changes
  4. Run testing
  5. Push changes to your fork/branch
  6. Create pull request
  7. Code review and automated testing
  8. Merge into master

Prerequisites

  • Git client
  • GitHub account
  • Node.js (v8+)
  • A browser that supports WebAssembly

1. Fork

To fork the repository you need to have a GitHub account. Once you have an account you can click the fork button up top. Now that you have your fork you need to clone it locally. Notice that git's origin reference will point to your forked repository.

It is useful to have the upstream repository registered as well using:

git remote add upstream git://github.com/wasdk/WebAssemblyStudio.git

and periodically fetch it using git fetch upstream.

2. Create feature branch

We always work with feature branches. For example, to create and switch to branch use:

git checkout -b {branch_name} upstream/master

and replace {branch_name} with a meaningful name that describes your feature or change. For instance, if you are working on adding the export button to the toolbar, a good branch name would be export-toolbar-button.

3. Make changes

Now that you have a new branch you can edit/create/delete files. Follow the standard Git workflow to stage and locally commit your changes -- there are lots of guides that explain Git.

If the branch contains lot of small commits, you might be asked to squash the commits.

4. Run testing

Make sure that your code follows our coding guidelines and run from the WebAssemblyStudio folder:

npm run test

5. Push changes to your fork/branch

After lint and all tests pass, push the changes to your fork/branch on GitHub:

git push origin {branch_name}

6. Create pull request

Create a pull request on GitHub for your feature branch. The code will then be reviewed and tested further by our contributors and test bot.

7. Code review and automated testing

In addition to the GitHub pull request workflow, it is highly recommended that you communicate with the WebAssemblyStudio team, for example via the #general slack channel at wasm-studio.slack.com. That will help to find a reviewer for your patch and speed up the review process.

You can speed up fetching a remote GitHub branch (possibly belonging to another user) using git try {username} {branch_name}. Add the following to the .git/config file to be able to do that:

[alias]
  try = !sh -c 'IFS=\":\" read -ra ARGS <<< \"$0\" && git fetch https://github.com/${ARGS[0]}/WebAssemblyStudio.git ${ARGS[1]} && git checkout FETCH_HEAD'

8. Merge into master

If all goes well, a collaborator will merge your changes into the main repository.

Clone this wiki locally