Skip to content
bacinsky edited this page Oct 24, 2014 · 4 revisions

HOME / How to develop / Contributing

Prerequisites

Webino™ uses Git for maintaining the code base and Github to share repositories. It's required that you read following rules before your contribution.

It's required to have installed the Webino Development Kit, globally.
To install development toolkit, run sudo npm install webino-devkit -g
Read more on webino devkit installation

How to commit

  1. Fork one of the Webino repositories
  • On your machine, go to Webino workspace directory
  • Clone your fork of the Webino repository here

Commit rules

  • Do not commit everything at all
  • Appropriate tests should be included in the same commit
  • Code does not generate any errors neither E_STRICT
  • Your code does not break any tests
  • Your code change is tested
  • You are commiting all needed files
  • You are not commiting useless white-space changes
  • The code uses only tabs for indentation
  • The code does not contain white-space on the right side
  • You keep code convention & coding standard used in Webino™

Commit a hotfix

Create a hotfix when you want to patch something in the master branch.

  1. Go to cloned repository directory
  • Checkout master branch:
    git checkout master
  • Create new branch for your changes:
    git checkout -b hotfix/<hotfix-name>
    NOTE: Replace "<hotfix-name>" with a short meaningful expression.
  • Do your commits
  • Publish your hotfix:
    git push origin hotfix/<hotfix-name>
  • Create a pull request to the upstream repository

Commit a fix

Create a fix when you want to patch something in the develop branch.

  1. Go to cloned repository directory
  • Checkout develop branch:
    git checkout develop
  • Create new branch for your changes:
    git checkout -b fix/<fix-name>
    NOTE: Replace "<fix-name>" with a short meaningful expression.
  • Do your commits
  • Publish your fix:
    git push origin fix/<fix-name>
  • Create a pull request to the upstream Webino repository

Commit a feature

Create a fix when you want to add new feature.

  1. Go to cloned repository directory
  • Checkout develop branch:
    git checkout develop
  • Create new branch for your changes:
    git checkout -b feature/<feature-name>
    NOTE: Replace "<feature-name>" with a short meaningful expression.
  • Do your commits
  • Publish your feature:
    git push origin feature/<feature-name>
  • Create a pull request to the upstream Webino repository

Update your fork

After you create a fork and meanwhile the Webino repository changed, you have to update your fork.

  1. Add the remote, call it "upstream":
    git remote add upstream https://github.com/<vendor>/<repo>.git
    NOTE: Replace "<vendor>" with webino and "<repo>" with required Webino repository name.
  • Fetch all the branches of that remote into remote-tracking branches:
    git fetch upstream
  • Make sure that you're on required branch, depends on a type of commit you want to do:
    git checkout <branch>
    NOTE: Replace "<branch>" with develop for fix / feature or master for hotfix.
  • Merge your local branch with the upstream branch:
    git merge upstream/<branch>

Pitfalls

Sometimes happens that you start writing code before creating a branch. There is a quick-fix for that kind of situation:

  1. Add your changes to the stash:
    git stash
  • Create new branch:
    git checkout -b <branch>
    NOTE: Replace "<branch>" with required branch name, depends on type of commit.
  • Apply your changes to a new branch:
    git stash apply
  • You can continue working on your code or commit a change

Continue on

There is the Webino Development Kit for a development automation.

How to use webino devkit