Skip to content

chenghaoc/ringcentral-js-integration-commons

 
 

Repository files navigation

ringcentral-js-integration-commons

Build Status Coverage Status

Integration common javascript core library. In this project we aim to:

  1. Refactor and converge all integration js code bases into a common package.
  2. Utilize official ringcentral js sdk libraries as much as possible.

Project Init

  • Server-side test framework setup
  • Browser-side test framework setup
  • Coding style guide document
  • Eslint check setup
  • Webpack setup for distributing code
  • CI setup

#To start

  1. Install dependencies

    npm install
  2. Create accounts.json

    {
      "app": {
        "appKey": "${your app key}",
        "appSecret": "${your app secret}"
      },
      "apiServer": "${apiServer address}",
      "brand": {
        "name": "${brand name}",
        "id": "${brand id}"
      },
      "user": {
        "username": "${RingCentral sandbox account username}",
        "extension": "${RingCentral sandbox account extension}",
        "password": "${RingCentral sandbox account password}"
      }
    }

#Coding Style

Please refer to airbnb/javascript. We will use the recommended linter settings and jscs settings, and adjust as we progress.

Also refer to .eslintrc for our own overrides.

#Linting

Run linter from commandline:

npm run eslint

Linter in Editors:

npm install -g eslint babel-eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react
  1. SublimeText

    Install sublime package control from packagecontrol.io

    Required Packages: * SublimeLinter * SublimeLinter-contrib-eslint * EditorConfig Recommended Pakcages: * Babel * GitGutter

    Linting should happen on file write.

  2. VSCode

    Required Extensions: * ESLint * EditorConfig for VS Code Recommended Extensions: * Babel ES6/ES7

    The linting errors and warnings should show as ~~~ under the code.

#Tests

Run all tests:

npm run test

Run tests in specific test folder or file:

npm run quick-test -- --folder folder1 --folder folder2,folder3
npm run quick-test -- --folder test/lib

npm run quick-test -- --file test/lib/add-module.test.js

Both multiple --folder/--file declaration, or comma-delimmated list will work too.

#Test in Browsers

npm run test-Browser

Open localhost:8190 in your browser to run the tests.

#Contribution

Please fork and contribute via PR.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.8%
  • Other 1.2%