Spanish Total.js
English
Documentation For AI agents
Contents

Share a component with the official repository

Prepare a component for the official catalogue and offer it to the Total.js repository.

.md GitHub
On this page

The official components live in the public GitHub repository totaljs/flowstreamcomponents. When your component is useful to others, you can offer it there, and after it is accepted it appears in the catalogue of every Flow.

How the repository is organized

PathWhat it holds
components/One HTML file for each component. The name of the file is the id of the component in the catalogue.
db.jsonThe catalogue.
db.jsThe script that builds db.json from the files in components/.
tester.js and tests/The tester and the tests.

Prepare your component

  1. Name the file after the component, in lowercase, for example components/uppercase.html.
  2. Write each of exports.id, exports.name, exports.group, exports.version, exports.icon, exports.author, exports.color and exports.kind on one line that ends with a semicolon. db.js reads these lines one by one to build the catalogue entry.
  3. Write a <readme>. db.js copies it into the catalogue, and users read it under Read me and in Official components.
  4. Put your name in exports.author. Components whose author is not Total.js show a Community badge.
  5. Add a test in tests/, and run it.
  6. Follow the coding standards that the repository links in its README.

Build the catalogue entry

db.js reads every file in components/ and writes db.json, sorted by name. The address of each file in the catalogue is:

https://cdn.totaljs.com/flowstream/webcomponents/<file name>

Run it from the repository folder after npm install total4:

node db.js

Check that db.json has an entry for your component with the right name, group, version and readme.

Offer it

Fork the repository on GitHub, add your component and its test on a branch, and open a pull request with a short description of what the component does. Total.js publishes the catalogue at the address above.

Change a component later

Raise exports.version with every change. Flow compares the version in the catalogue with the installed one, and shows an update badge in the Download components window when the catalogue has a newer version.

Made in Europe