This document describes how to set up your development environment to build and test.
Before you can build and test, you must install and configure the following products on your development machine:
-
Node.js, (version specified in the engines field of
package.json) which is used to run tests, and generate distributable files.
git clone https://github.com/toolsplus/json-evolutions.git
cd json-evolutionsNext, install the JavaScript modules needed to build and test:
npm installnpm run prepareTo build run:
npm run build- Results are put in the
buildfolder.
npm run testThis project uses prettier to format 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 fix:prettierA better way is to set up your IDE to format the changed file on each file save.
This project uses ESLint to enforce coding styles and quality. If the source code is not following the configured styles the CI will fail, and the PR cannot be merged.
You can check that your code is properly formatted and adheres to coding style by running:
$ npm run lintA better way is to set up your IDE to run ESLint on each file save.
To ensure consistency throughout the source code, keep these rules in mind as you are working:
- All features or bug fixes must be tested by one or more specs (unit-tests).
- All public API methods must be documented.
This project follows very precise rules over how our Git commit messages must be formatted. This format leads to easier to read commit history and allows us to do automatic generation of version numbers and changelog during the release process.
Commit messages must follow the Angular commit convention. This convention is enforced by a Git commit hook. If you use an IDE to commit your changes, and it fails, refer to the IDE's Git console for details.