Write nodes using Typescript + Vue 3 + JSON Schemas for runtime validations

Updated the template repo with recommended .vscode extensions, eslint and prettier:

It is really easy to build your node library with this template

pnpm install
pnpm build

After building your node library, a dist will appear in your local directory

You can install the build to your local Node-RED instance running

cd ~/.node-red
npm install ${PATH_CLONED_REPO}/dist

The index.html file is generated automatically.

The files under dist can be published to npm or other package manager of your choice. It contains everything consumers will need, like source maps and type declarations.

Server dependencies are not bundled. They will be installed by Node-RED using the package.json. Client dependencies are bundled and can be chuncked for fast loading. There is an example in /src/server/vite.config.ts. Tree shaking is performed in both builds.

TODOS

  • vite plugin to process locales
  • vite plugin to process docs
  • package core lib
  • .github workflows for CI/CD and release with semantic-release
  • a ton of type definitions for node-red RED (client and server) and jquery widgets

If you have ideas just open a PR or leave a comment here. Thanks.

1 Like

Vite plugin to process labels nad docs is done!

During development locales are grouped by node to ease maintenance

once the project is built, labels and docs are grouped the way Node-RED is expecting

using i18n is now easier and natural than ever. A $i18n global function is available to all your components. Labels are automatically scoped by the node's type.