Extension basics
A Paneron extension is responsible for providing the UI for manipulating structured data residing in a given repository.
Paneron’s power is in its extensions.
A Paneron extension is an NPM package, where the file specified as “entry” has a default export of certain format.
The recommended tooling for developing extensions is Microsoft VS Code, and the language is TypeScript.
Note:
Currently, Paneron requires all extension packages to be published on NPM under @riboseinc scope, named as @riboseinc/paneron-extension-<extension name>.
The extension should detect whether it is being imported in Electron’s main or renderer thread, and export a default that has the following shape:
For main thread, for now it’s just an empty object.
For renderer thread, it should be a promise that resolves to an object with a single property
repositoryView. That property should be a React component which will be responsible for displaying the UI for displaying and manipulating structured registry data.
Thread detection can be done by checking global process.type, the value of which in Electron is (counter-intuitively) “browser” for main thread, and (less confusingly) “renderer” in the renderer thread. (You’ll need to import “electron” for process.type to be available.)
Tip:
Take a look at basic extension template for an example of Paneron extension layout. You can create your own extension by using that template, too.
Your extension’s React component will have at its disposal facilities for reading and updating repository data. Those facilities are passed to your extension by Paneron via props.