Widget Pack Configuration
Each plugin must include a mobro-widget-pack-config.json
file which defines some important metadata. This file must be
located in the root directory for you widget pack project. If you created the project via the dashboard-cli
, an
example file should
exist by default.
If this file is missing, the dashboard-cli
won't be able to start the dev
command or publish the widget pack to the
marketplace and MoBro won't be able to detect it as a widget pack.
Fields
Field | Default | Restrictions | Description |
---|---|---|---|
name | - | Required Length: 3 - 128 Pattern: ^[\w-]+$ | The globally unique name (=id) of the widget pack |
displayName | name | - | Visible human readable name of the widget pack |
author | Unknown | - | The name of the author of this widget pack |
description | - | - | A short textual description for the widget pack |
Example
The following configuration file is taken from the charts widget pack.
{
"name": "modbros_charts",
"displayName": "Charts",
"description": "Includes highly customizable base widgets such as textual values, bar/line charts, donuts and gauges.",
"author": "ModBros"
}
In order to get suggestions for the config files you can add a json schema mapping to your IDE. For Jetbrains IDEs the cli automatically adds those to your project. The MoBro app is able to serve these json schemas locally. Simply add the following two mappings to your IDE to get the correct suggestions:
- files named
mobro-widget-config.json
-> http://localhost:42100/mobro-schema/mobro-widget-config.schema.json - files named
mobro-widget-pack-config.json
-> http://localhost:42100/mobro-schema/mobro-widget-pack-config.schema.json