Commit Graph

25 Commits (c727a34cb6a02973e3ff79927f3824d4f0b7dcdc)

Author SHA1 Message Date
Chocobozzz 3a4992633e
Migrate server to ESM
Sorry for the very big commit that may lead to git log issues and merge
conflicts, but it's a major step forward:

 * Server can be faster at startup because imports() are async and we can
   easily lazy import big modules
 * Angular doesn't seem to support ES import (with .js extension), so we
   had to correctly organize peertube into a monorepo:
    * Use yarn workspace feature
    * Use typescript reference projects for dependencies
    * Shared projects have been moved into "packages", each one is now a
      node module (with a dedicated package.json/tsconfig.json)
    * server/tools have been moved into apps/ and is now a dedicated app
      bundled and published on NPM so users don't have to build peertube
      cli tools manually
    * server/tests have been moved into packages/ so we don't compile
      them every time we want to run the server
 * Use isolatedModule option:
   * Had to move from const enum to const
     (https://www.typescriptlang.org/docs/handbook/enums.html#objects-vs-enums)
   * Had to explictely specify "type" imports when used in decorators
 * Prefer tsx (that uses esbuild under the hood) instead of ts-node to
   load typescript files (tests with mocha or scripts):
     * To reduce test complexity as esbuild doesn't support decorator
       metadata, we only test server files that do not import server
       models
     * We still build tests files into js files for a faster CI
 * Remove unmaintained peertube CLI import script
 * Removed some barrels to speed up execution (less imports)
2023-08-11 15:02:33 +02:00
Chocobozzz 9dfbf73576
Increase rate limits for benchmark 2023-07-27 14:18:59 +02:00
Chocobozzz ba2684cedd
Fix lint 2022-07-13 12:14:26 +02:00
Chocobozzz b211106695 Support video views/viewers stats in server
* Add "currentTime" and "event" body params to view endpoint
 * Merge watching and view endpoints
 * Introduce WatchAction AP activity
 * Add tables to store viewer information of local videos
 * Add endpoints to fetch video views/viewers stats of local videos
 * Refactor views/viewers handlers
 * Support "views" and "viewers" counters for both VOD and live videos
2022-04-15 09:49:35 +02:00
Chocobozzz 68a4b1e587
Fix benchmark tests 2022-03-24 13:42:12 +01:00
Chocobozzz 4e5e072c1b
Fix benchmark script 2022-03-21 08:24:07 +01:00
Chocobozzz 6afc0d374c
Add watching and views endpoints to benchmark 2022-03-18 14:52:53 +01:00
Chocobozzz cc45cc9ac1
Remove uneeded memoize 2022-03-08 11:39:56 +01:00
Chocobozzz 1087427616
Improve benchmark script CLI options 2022-02-28 15:19:44 +01:00
Chocobozzz f8360396ff
Stop using tsconfig register
Prefer to replace paths at compile time
2022-01-06 08:26:14 +01:00
Chocobozzz bf54587a3e
shared/ typescript types dir server-commands 2021-12-17 09:29:23 +01:00
Chocobozzz cf0c8ee588
Fix admin edition disabling feature 2021-10-14 11:35:43 +02:00
Chocobozzz 87c0f718dc
Fix benchmark test 2021-10-14 08:30:17 +02:00
Chocobozzz 736c64ca4b
Fix benchmark script 2021-08-30 14:22:33 +02:00
Chocobozzz 13e1337791
Speed up plugin transcoding tests 2021-07-22 08:55:14 +02:00
Chocobozzz c63830f154
Rename captions commands 2021-07-21 13:58:35 +02:00
Chocobozzz 254d3579f5
Use an object to represent a server 2021-07-20 15:27:18 +02:00
Chocobozzz 89d241a79c
Shorter server command names 2021-07-20 15:27:18 +02:00
Chocobozzz d23dd9fbfc
Introduce videos command 2021-07-20 15:27:18 +02:00
Chocobozzz 9293139fde
Introduce sql command 2021-07-20 15:27:18 +02:00
Chocobozzz 12edc1495a
Introduce comments command 2021-07-20 15:27:18 +02:00
Chocobozzz a2470c9f4b
Introduce captions command 2021-07-20 15:27:17 +02:00
Chocobozzz 47099aba46
Fix benchmark 2021-03-30 08:57:17 +02:00
Chocobozzz 0ce8d34ea0
Add other routes to benchmark 2021-02-25 16:23:30 +01:00
Chocobozzz 4abbeff575
Add benchmark script 2021-02-22 15:54:15 +01:00