diff options
Diffstat (limited to 'support/doc/plugins/guide.md')
-rw-r--r-- | support/doc/plugins/guide.md | 43 |
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 | ||
978 | This package exposes *server* definition files by default: | 978 | This package exposes *server* definition files by default: |
979 | ```ts | 979 | ```ts |
980 | import { RegisterServerOptions } from '@peertube/peertube-types' | 980 | import { RegisterServerOptions } from '@peertube/peertube-types.js' |
981 | 981 | ||
982 | export async function register ({ registerHook }: RegisterServerOptions) { | 982 | export async function register ({ registerHook }: RegisterServerOptions) { |
983 | registerHook({ | 983 | registerHook({ |
@@ -989,8 +989,8 @@ export async function register ({ registerHook }: RegisterServerOptions) { | |||
989 | 989 | ||
990 | But it also exposes client types and various models used in __PeerTube__: | 990 | But it also exposes client types and various models used in __PeerTube__: |
991 | ```ts | 991 | ```ts |
992 | import { Video } from '@peertube/peertube-types'; | 992 | import { Video } from '@peertube/peertube-types.js'; |
993 | import { RegisterClientOptions } from '@peertube/peertube-types/client'; | 993 | import { RegisterClientOptions } from '@peertube/peertube-types/client.js'; |
994 | 994 | ||
995 | function register({ registerHook, peertubeHelpers }: RegisterClientOptions) { | 995 | function 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 | ||
1035 | The key should be one of the locales defined in [i18n.ts](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/i18n/i18n.ts). | 1035 | The 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 | ||
1037 | Translation files are just objects, with the english sentence as the key and the translation as the value. | 1037 | Translation 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 | ||
1073 | PeerTube dev server (ran with `npm run dev` on `localhost:3000`) can't inject plugin CSS. | 1073 | You need to have a running PeerTube instance with an administrator account. |
1074 | It's the reason why we don't use the dev mode but build PeerTube instead. | 1074 | If 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 | ||
1076 | You'll need to have a local PeerTube instance: | 1076 | Install 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 |
1082 | npm run build | 1079 | npm install -g @peertube/peertube-cli |
1083 | ``` | ||
1084 | |||
1085 | * Build the CLI: | ||
1086 | |||
1087 | ```sh | ||
1088 | npm run setup:cli | ||
1089 | ``` | ||
1090 | |||
1091 | * Run PeerTube (you can access to your instance on `localhost:9000`): | ||
1092 | |||
1093 | ```sh | ||
1094 | NODE_ENV=dev npm start | ||
1095 | ``` | 1080 | ``` |
1096 | 1081 | ||
1097 | * Register the instance via the CLI: | 1082 | Register the PeerTube instance via the CLI: |
1098 | 1083 | ||
1099 | ```sh | 1084 | ```sh |
1100 | node ./dist/server/tools/peertube.js auth add -u 'http://localhost:9000' -U 'root' --password 'test' | 1085 | peertube-cli auth add -u 'https://peertube.example.com' -U 'root' --password 'test' |
1101 | ``` | 1086 | ``` |
1102 | 1087 | ||
1103 | Then, you can install or reinstall your local plugin/theme by running: | 1088 | Then, you can install your local plugin/theme by running: |
1104 | 1089 | ||
1105 | ```sh | 1090 | ```sh |
1106 | node ./dist/server/tools/peertube.js plugins install --path /your/absolute/plugin-or-theme/path | 1091 | peertube-cli plugins install --path /your/absolute/plugin-or-theme/path |
1107 | ``` | 1092 | ``` |
1108 | 1093 | ||
1109 | ### Publish | 1094 | ### Publish |