Development
Also see CONTRIBUTING.md.
Environment setup
Here are the steps to successfully setup your development environment to contribute to this project
Setup using the VS Code dev container
This will set up a docker container with all the required tools and dependencies to get started.
Go to the Node-RED Vioneta Agro repository and fork it.
Clone your forked repository to your local machine.
git clone https://github.com/<GITHUB_USER_NAME>/node-red-contrib-vioneta-agro-websocket
Open the project in VS Code.
Install the Remote - Containers extension.
Click the green button in the lower-left corner of the window that says "Reopen in Container".
Wait for the container to build and start.
Open a terminal in VS Code and run
npm run dev
to start the development server.
Setup locally
Go to the Node-RED Vioneta Agro repository and fork it.
Clone your forked repository to your local machine.
git clone https://github.com/Vioneta/node-red-contrib-vioneta-agro-websocket
create an npm link to your forked project. This will also build this project's dependencies.
cd node-red-contrib-vioneta-agro-websocket npm link
Install Node-RED on localhost, assuming we install it on ~/dev directory (you can install it in another location as you wish)
cd ~/dev/node-red npm install -g --unsafe-perm node-red
Install your fork project into local Node-RED using npm link:
cd ~/dev/node-red npm link node-red-contrib-vioneta-agro-websocket
Starting Node-RED on localhost
cd ~/dev/node_modules/node-red npm run dev
Accessing
After running npm run dev
Node-RED will be running on ports 1880 and 3000. You can access the development server at http://localhost:1880 or http://localhost:3000 either port can be used. On port 3000 browser-sync is running and will reload the browser when changes are made to the editor source code.
Linting
This project uses ESLint and Prettier to lint and format the code. You can run npm run lint
to lint the code.
Testing
- Run
npm run test
to run the tests.