aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/plugins/guide.md
diff options
context:
space:
mode:
Diffstat (limited to 'support/doc/plugins/guide.md')
-rw-r--r--support/doc/plugins/guide.md43
1 files changed, 14 insertions, 29 deletions
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md
index ff08ce8c4..07f484934 100644
--- a/support/doc/plugins/guide.md
+++ b/support/doc/plugins/guide.md
@@ -387,7 +387,7 @@ function register (...) {
387 displayName: 'User display name', 387 displayName: 'User display name',
388 388
389 // Custom admin flags (bypass video auto moderation etc.) 389 // Custom admin flags (bypass video auto moderation etc.)
390 // https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/users/user-flag.model.ts 390 // https://github.com/Chocobozzz/PeerTube/blob/develop/packages/models/users/user-flag.model.ts
391 // PeerTube >= 5.1 391 // PeerTube >= 5.1
392 adminFlags: 0, 392 adminFlags: 0,
393 // Quota in bytes 393 // Quota in bytes
@@ -977,7 +977,7 @@ npm install --save-dev @peertube/peertube-types
977 977
978This package exposes *server* definition files by default: 978This package exposes *server* definition files by default:
979```ts 979```ts
980import { RegisterServerOptions } from '@peertube/peertube-types' 980import { RegisterServerOptions } from '@peertube/peertube-types.js'
981 981
982export async function register ({ registerHook }: RegisterServerOptions) { 982export async function register ({ registerHook }: RegisterServerOptions) {
983 registerHook({ 983 registerHook({
@@ -989,8 +989,8 @@ export async function register ({ registerHook }: RegisterServerOptions) {
989 989
990But it also exposes client types and various models used in __PeerTube__: 990But it also exposes client types and various models used in __PeerTube__:
991```ts 991```ts
992import { Video } from '@peertube/peertube-types'; 992import { Video } from '@peertube/peertube-types.js';
993import { RegisterClientOptions } from '@peertube/peertube-types/client'; 993import { RegisterClientOptions } from '@peertube/peertube-types/client.js';
994 994
995function register({ registerHook, peertubeHelpers }: RegisterClientOptions) { 995function register({ registerHook, peertubeHelpers }: RegisterClientOptions) {
996 registerHook({ 996 registerHook({
@@ -1032,7 +1032,7 @@ If you want to translate strings of your plugin (like labels of your registered
1032} 1032}
1033``` 1033```
1034 1034
1035The key should be one of the locales defined in [i18n.ts](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/i18n/i18n.ts). 1035The key should be one of the locales defined in [i18n.ts](https://github.com/Chocobozzz/PeerTube/blob/develop/packages/models/i18n/i18n.ts).
1036 1036
1037Translation files are just objects, with the english sentence as the key and the translation as the value. 1037Translation files are just objects, with the english sentence as the key and the translation as the value.
1038`fr.json` could contain for example: 1038`fr.json` could contain for example:
@@ -1070,40 +1070,25 @@ You built files are in the `dist/` directory. Check `package.json` to correctly
1070 1070
1071### Test your plugin/theme 1071### Test your plugin/theme
1072 1072
1073PeerTube dev server (ran with `npm run dev` on `localhost:3000`) can't inject plugin CSS. 1073You need to have a running PeerTube instance with an administrator account.
1074It's the reason why we don't use the dev mode but build PeerTube instead. 1074If you're using dev server on your local computer, test your plugin on `localhost:9000` using `npm run dev` because plugin CSS is not injected in Angular webserver (`localhost:3000`).
1075 1075
1076You'll need to have a local PeerTube instance: 1076Install PeerTube CLI (can be installed on another computer/server than the PeerTube instance):
1077 * Follow the [dev prerequisites](https://github.com/Chocobozzz/PeerTube/blob/develop/.github/CONTRIBUTING.md#prerequisites)
1078 (to clone the repository, install dependencies and prepare the database)
1079 * Build PeerTube:
1080 1077
1081```sh 1078```bash
1082npm run build 1079npm install -g @peertube/peertube-cli
1083```
1084
1085 * Build the CLI:
1086
1087```sh
1088npm run setup:cli
1089```
1090
1091 * Run PeerTube (you can access to your instance on `localhost:9000`):
1092
1093```sh
1094NODE_ENV=dev npm start
1095``` 1080```
1096 1081
1097 * Register the instance via the CLI: 1082Register the PeerTube instance via the CLI:
1098 1083
1099```sh 1084```sh
1100node ./dist/server/tools/peertube.js auth add -u 'http://localhost:9000' -U 'root' --password 'test' 1085peertube-cli auth add -u 'https://peertube.example.com' -U 'root' --password 'test'
1101``` 1086```
1102 1087
1103Then, you can install or reinstall your local plugin/theme by running: 1088Then, you can install your local plugin/theme by running:
1104 1089
1105```sh 1090```sh
1106node ./dist/server/tools/peertube.js plugins install --path /your/absolute/plugin-or-theme/path 1091peertube-cli plugins install --path /your/absolute/plugin-or-theme/path
1107``` 1092```
1108 1093
1109### Publish 1094### Publish