Implementing and maintaining a protocol stack is a lot of work, therefore any help is appreciated, from creating issues, to contributing documentation, fixing issues and adding new features.
Please follow the best-practice contribution guidelines as mentioned below when submitting any changes.
Please, do your changes with the develop branch in your forked repo and send us your pull request from your own forked repo feature-branches or fix-branches to the develop branch of our repo!
see Git-Flow
Git-Flow feature brachnes would be great here to seperate and to review changes to get the best integration results for your good work.
npm i -g npm-check-updates
npm install
This module has a changelog which is automatically generated based on Git commit messages. This mechanism requires that all commit messages comply with the Conventional Changelog. You can check if your commit messages complies with those guidelines by using:
npm run changelog
This module uses the Google JavaScript Code-Style and enforces it using JSCS as additional linter beneath JSHint. You can test if your changes comply with the code style by executing:
npm run lint
Testing is done using Mocha and is separated into two
sets, unit
and integration
. While unit tries to test on function level,
including synthetic decoding and encoding, the integration tests are using real
recorded data and are only mocking the transport layer.
For both sets, the test-coverage is calculated using Istanbul. Running the tests and calculating the coverage can be done locally by executing:
npm run test
npm run coverage
npm run test:unit
npm run test:integration
It is expected that new features or fixes do not negatively impact the test results or the coverage.
Besides the unit
and integration
test-sets, which are ensuring functionality
using synthetical data, the compliance
test-set is using a well established
3rd BACNET device emulator to test against. It uses the same test setup with
Mocha and Istanbul, but runs
inside a Docker container, while using the BACStack Compliance Docker
image to test against. Compliance test could also be tested with your device on Id: 1234.
A compliance test will not work without the docker call or a device with Id 1234.
The compliance tests can be executed locally and require Docker and Docker-Compose. To do so, simply run:
npm run docker
uses coverage:all and coverage:all is just to use with docker, please!
The API documentation is generated using JSDoc and relies on in-line JSDoc3 syntax. The documentation can also be built locally by executing:
npm run docs
It is expected that new features or changes are reflected in the documentation as well.
Use NVM to manage Node.js versions and to test with different versions in development.
nvm install lts
nvm use lts
nvm current
./clean.sh
./npm-update.sh
Once
npm i -g npm-check-updates
Upgrade
./npm-upgrade.sh