Skip to content

Contribution Guideline

Hyojin Kim edited this page Apr 21, 2020 · 14 revisions

How to support the other platforms

If you have an idea to contribute other platforms to TOAST, there are several things to do.

1. Wrapping each device APIs to TOAST APIs

It will be toast.js, when user builds

Related repository

You can folk above repository, and move to src directory. And then you can figure out all platforms which TOAST supports. Please refer one of the platforms there, create your own platform directory, and fill out the wrappers of device APIs of your platform.

Naming rule

  • tv-{platformName}

After you complete implementing and testing, please pull-request your project. And then we will review it and merge it.

2. Support packaging and building way of new platform to run TOAST application

Related repository

You can folk above repository, and move to tasks/packager And then you can figure out all platforms which TOAST supports. Please refer one of the platforms there, create your own platform directory, and fill out prepare and build function.

Naming rule

  • tv-{platformName}

After you complete implementing and testing, please pull-request your project. And then we will review it and merge it.

3. Porting new platform APIs to be a Cordova plugin

It will be cordova.js, when user builds

Related repository

Platforms by Samsung developers are allowed to add "Samsung" Organization, However unfortunately, we can't support to create new repositories for external developers who want to make additional platforms to "Samsung" Organization.

  • Samsung developers : Add repository to "Samsung" Organization.
  • External developers : Create your own repository.

And then create plugin for supporting Cordova typed APIs, for that you can refer one of the repositories which we are supporting. (ex. cordova-sectv-tizen, cordova-sectv-orsay, cordova-tv-webos)

You can refer which Cordova plugins TOAST supports. supported-cordova-plugin

4. Update README.md

You need to offer a guide for added platforms. You can update some information for your platform to the README.md of cordova-plugin-toast and grunt-cordova-sectv.

Report a bug

If you find a bug, Please report it by making an issue on GitHub issues of each projects. It will be discussed and fixed by our contributors. If you want, you can fix the bug by making a Pull Request with your patch.

Your question or bug may have already been answered or fixed, be sure to search the issues first before putting in a duplicate issue.

Please provide as much information as possible so that anyone could reproduce the bug with your report. It would be very helpful if the report includes these information:

  • Device information what you've tested. Vendor, Model code, Firmware version and so on.
  • Versions of TOAST and collaborated libraries.
  • Step-by-step instructions on how to reproduce the issue, including any required system configuration changes.

Pull Request

Before you make a PR:

  • Explain your idea by making an issue on GitHub issues of each projects, especially when introducing new features.

  • Run the precommit task by running below command on the project's root:

     $ grunt precommit

    It will check several rules that every code should follow like coding style and availability of building.

When you make a PR:

  • Reference the issue you made for explaining your idea.

Commit Message

When you leave commit message: The most important thing is simple but needs to contain primary summary what you did. And It is also recommended to start with capitalized verb the subject line. For example:

  • Remove deprecated methods Instead of:
  • methods are removed

Coding Style

Basically, every code submission should pass the JSHint and JSCS rules that is defined at .jshintrc and .jscsrc which is located at root of each projects. You can test it by using running below command on your project's root.

$ grunt precommit

Several major rules are listed below:

  • Requires 4 spaces for indentation.

  • No trailing whitespace, blank lines should have no whitespace.

  • Disallows newline before opening curly brace of all block statements.

    Code like this:

     function foo() {
     }

    Instead of:

     function foo()
     {
     }
  • Requires all quote marks to be single quote: '

Clone this wiki locally