docs: plugin.repo
Massimo Melina committed
Jun 6, 2023 at 23:07 UTC
f907c39f3cc4e222a41ddb5e5a675c900ef7e285
1 file changed
+12
-6
dev-plugins.md
+12
-6
@@ -23,8 +23,8 @@ exports.init = api => ({
23
})
24
```
25
26
-The init function is called by HFS when the module is loaded and should return an object with more things to
27
-added/merged to the exported object. In the example above we are asking a css file to be loaded in the frontend.
26
+The init function is called by HFS when the module is loaded and should return an object with more things to
27
+add/merge to the exported object. In the example above we are asking a css file to be loaded in the frontend.
28
Since it's a basic example, you could have simply defined it like this:
29
```js
30
exports.frontend_css = 'mystyle.css'
@@ -40,10 +40,16 @@ Let's first look at the things you can export:
40
41
All the following properties are optional unless otherwise specified.
42
43
-- `description: string` try to explain what this plugin is for. This must go in `exports` and use "double quotes".
44
-- `version: number` use progressive numbers to distinguish each release. This must go in `exports`.
45
-- `apiRequired: number | [min:number,max:number]` declare version(s) for which the plugin is designed for. You'll find api version in `src/const.ts`. This must go in `exports` and is mandatory.
46
- - `depend: { repo: string, version: number }[]` declare what other plugins this depends on. This must go in `exports`
43
+- `description: string` try to explain what this plugin is for.
44
+- `version: number` use progressive numbers to distinguish each release
45
+- `apiRequired: number | [min:number,max:number]` declare version(s) for which the plugin is designed for. Mandatory. [Refer to API version history](#api-version-history)
46
+- `repo: string` pointer to a GitHub repo where this plugin is hosted.
47
+- `depend: { repo: string, version: number }[]` declare what other plugins this depends on.
48
+
49
+All the properties above are a bit special and must go in `exports` only (thus, not returned in `init`) and the syntax
50
+used must be strictly JSON (thus, no single quotes, only double quotes for strings and objects).
51
+
52
+- `init` described in the previous section.
53
- `frontend_css: string | string[]` path to one or more css files that you want the frontend to load. These are to be placed in the `public` folder (refer below).
54
You can also include external files, by entering a full URL.
55
- `frontend_js: string | string[]` path to one or more js files that you want the frontend to load. These are to be placed in the `public` folder (refer below).