This document describes how to set up your development environment to build and test generaptr-cli.
It also explains the basic mechanics of using git, node, and npm.
See the contribution guidelines if you'd like to contribute to generaptr-cli.
Before you can build and test generaptr-cli, you must install and configure the following products on your development machine:
-
Git and/or the GitHub app (for Mac or Windows); GitHub's Guide to Installing Git is a good source of information.
-
Node.js, (version
>=7.5.0) which is used to run a development web server, run tests, and generate distributable files. We also use Node's Package Manager,npm(version>=4.0.0), which comes with Node. Depending on your system, you can install Node either from source or as a pre-packaged bundle.
Fork and clone the generpatr-cli repository:
- Login to your GitHub account or create one by following the instructions given here.
- Fork the main generaptr-cli repository.
- Clone your fork of the generaptr-cli repository and define an
upstreamremote pointing back to the generaptr-cli repository that you forked in the first place.
# Clone your GitHub repository:
git clone git@github.com:<github username>/generaptr-cli.git
# Go to the generaptr-cli directory:
cd generaptr-cli
# Add the main generaptr-cli repository as an upstream remote to your repository:
git remote add upstream https://github.com/generaptr/generaptr-cli.gitNext, install the JavaScript modules needed to build and test generaptr-cli:
# Install generaptr-cli project dependencies (package.json)
npm installTo build generaptr-cli run:
npm run linkTo run tests:
$ npm test # Run all generpatr-cli testsYou should execute the test suites before submitting a PR to github.
All the tests are executed on our Continuous Integration infrastructure and a PR could only be merged once the tests pass.
- Travis CI fails if any of the test suites described above fails or linting issues are found.
You can check that your code is properly formatted and adheres to coding style by running:
$ npm run lint