Once you are ready to show your code to ask for feedback, submit a *draft* Pull Request.Once you are ready for a code review before merge, submit a Pull Request.In any case, please link your PR to the issues it solves by using the GitHub syntax: "fixes #issue_number".
For general instructions (developping plugins, building, installation, ...), please refer to the [Peertube documentation](https://docs.joinpeertube.org/contribute-plugins?id=write-a-plugintheme).
This plugin is [REUSE](https://reuse.software/) compliant: it uses SPDX headers to identify licensing information of its source code.More information on the [REUSE](https://reuse.software/) website.You can use the [reuse](https://reuse.readthedocs.io/en/stable/readme.html#) command line tool to help you update headers.The `npm run lint` command will use the `reuse` command to check compliance.Don't forget to add your copyright information in SPDX headers when you modify some code.
This plugin uses ESBuild for frontend code generation, as the official `peertube-plugin-quickstart` plugin.ESBuild can handle Typescript, but does not check types (see [ESBuild documentation](https://esbuild.github.io/content-types/#typescript)).That's why we first compile Typescript with the `-noEmit` option, just to check types (`check:client:ts` in package.json file).Then, if everything is okay, we run ESBuild to generate the compiled javascript.
There is a debug mode for this plugin, that shorten some delay.For example, some log files will rotate every two minutes, instead of once per day.This permit to test more easily certain actions, for which it could normally take hours or days to wait.
To enable this mode, you juste have to create the `/var/www/peertube/storage/plugins/data/peertube-plugin-livechat/debug_mode` file (replacing `/var/www/peertube/storage/` by the correct path on your installation).
The simple existence of this file is sufficient to trigger the debug mode.To make sure it's taken into account, you can restart your Peertube instance.
This file can contain some JSON to enable more advanced options.To have a list of existing parameters, check `server/lib/debug.ts`.Restart Peertube after each content modification.
When debug mode is enabled, you can restart Prosody using this API call: `http://your_instance.tld/plugins/livechat/router/api/restart_prosody`.This call don't need any authentificaiton.It can be done from a command line, for example using `curl http://your_instance.tld/plugins/livechat/router/api/restart_prosody`.