Skip to content

Latest commit

 

History

History
98 lines (67 loc) · 3.15 KB

DEVELOPER.md

File metadata and controls

98 lines (67 loc) · 3.15 KB

Building and Testing RDS-JS

This document describes how to set up your development environment to build and test RDS-JS. It also explains the basic mechanics of using git, node, and npm.

See the contribution guidelines if you'd like to contribute to RDS-JS.

Prerequisite Software

Before you can build and test RDS-JS, you must install and configure the following products on your development machine:

Getting the Sources

Fork and clone the RDS-JS repository:

  1. Login to your GitHub account or create one by following the instructions given here.
  2. Fork the RDS-JS repository.
  3. Clone your fork of the RDS-JS repository and define an upstream remote pointing back to the RDS-JS repository that you forked in the first place.
# Clone your GitHub repository:
git clone git@github.com:<github username>/rds-js.git

# Go to the RDS-JS directory:
cd rds-js

# Add the main RDS-JS repository as an upstream remote to your repository:
git remote add upstream https://github.com/mtna/rds-js.git

Installing NPM Modules

Next, install the JavaScript modules needed to build and test RDS-JS:

# Install RDS-JS project dependencies (package.json)
npm install

Building

To build RDS-JS run:

npm run build
  • Results are put in the dist/ folder.
  • Generated documentation is put in the docs/ folder.

Running Tests Locally

Jest is used as the primary tool for testing RDS-JS.

You should execute all test suites before submitting a PR to GitHub:

  • npm run test

All the tests are executed on our Continuous Integration infrastructure. PRs can only be merged if the code is formatted properly and all tests are passing.

Formatting your source code

RDS-JS uses prettier to format the source code. If the source code is not properly formatted, the CI will fail and the PR cannot be merged.

You can automatically format your code by running:

  • npm run precommit
  • This will also happen automatically if you commit via npm run commit

A better way is to set up your IDE to format the changed file on each file save.

Linting/verifying your Source Code

You can check that your code is properly formatted and adheres to coding style by running:

$ npm run lint