This project is the node-red engine, consisting of the api
and runtime
, packaged as a lerna project.
The project contains multiple related packages that can be managed as one project, but where each package can be versioned, managed and published as a separate unit.
See Lerna Getting Started for a typical development workflow.
Install lerna
and mocha
as a global binaries
npm i -g lerna mocha
In case the packages are not included in this container project, you can clone each of them into packages (alternatively fork each, then clone from your fork)
For red-runtime
red-engine/packages/red-runtime $ git clone git@github.com:tecla5/red-runtime.git
For red-api
red-engine/packages/red-api $ git clone git@github.com:tecla5/red-api.git
Install dependencies for red-api (incl. local linking to modules in /packages
)
cd packages/red-api
npm run lerna:update
Install dependencies for red-runtime (incl. local linking to modules in /packages
)
cd packages/red-runtime
npm run lerna:update
Run test suite for red-api
cd packages/red-api
mocha test/api/comms_spec.js
Run test suite for red-runtime
cd packages/red-runtime
mocha test/runtime/i18n_spec.js
See the current status of tests in Testing.md
for red-runtime package.
No Testing.md
document yet for red-api (make one!?)
A lerna package can been configured with internal (local) dependencies such as demonstrated in the red-api
package:
"dependencies": {
...
"red-runtime": "x", // resolved locally to the lerna project if available
...
}
Lerna will npm link
to matching local packages in red-engine/packages
if available. If not found locally, it will resolve the package dependency normally via npm registry, github or some other remote location.
This makes it much easier to do development on multiple inter-dependent packages simultaneously.
To make lerna easier to use, each package comes with a lerna:update
script which updates all dependencies for a given package via lerna.
From the root folder of any package, run: npm run lerna:update
Example package update:
red-ui/packages/red-api $ npm run lerna:update
# lerna info ...
This will update and resolve all dependencies via lerna. Dependencies linked locally are linked via symbolic link as if the files are present inside the host project itself.
The lerna scripts are:
lerna:clean
- scrap all node_moduleslerna:bootstrap
- bootstrap node_moduleslerna:update
clean, then bootstrap
All the scripts are scoped to the particular package. If you run a lerna command without --scope
, it will be run on all packages.
See --scope option in Lerna Readme)
This lerna project contains the following packages:
red-api
node-red APIred-runtime
node-red runtime
The packages are inter-dependent. The api contains one or more references to the runtime and the runtime one or more refs to the api.
See red-api repo for details
See red-runtime repo for details
Additionally the /assets
folder contains the original node-red assets, including stylesheets, mustache templates etc.
Ask questions on node-red Slack channel