This library is hosted on Github, contributions are more then welcome.
- Fork library
- Install Pull
- Compile the library
- Run the tests
- Live-reload documentation
- Repository content
You should start by creating a fork. Or if you already had a fork sync the fork:
# Add the remote, call it "upstream": (only once) git remote add upstream https://github.com/svrooij/smartmeter2mqtt.git # Fetch all the branches of that remote into remote-tracking branches, # such as upstream/master: git fetch upstream # Make sure that you're on your beta branch: git checkout beta # Rewrite your beta branch so that any commits of yours that # aren't already in upstream/beta are replayed on top of that # other branch: git rebase upstream/beta
We like to use the Github pull application, to keep our beta branch and the forks up-to-date. You have to install this application yourself, but it will work automatically.
Before you can use this library is has to be compiled.
npm run install && npm run compile
After changing somehting you should run the tests (as they are automatically run before your PR is accepted).
npm run test
This library has several VSCode tasks defined, be sure to change your port/socket in the
.vscode/launch.json file. If you open an example file and press F5 the example is run and you can set breakpoints in the sample code and in the TypeScript code.
This documentation is build from markdown files. It uses Jekyll to generate html files from markdown. For those who don’t have ruby on their computer (like me), I’ve included a docker-compose that is setup to enable live-reloading the documentation.
# Go to docs root folder cd docs # Start docker container (first time takes longer because of package downloading). docker-compose up
Your documentation should be up at localhost:4000 and your browser will refresh on save.
- docs/ These documentations
- src/output/ Several different outputs
- src/ Main app files
- tests/.. - All the tests, using the Jest framework.