Commit Graph

16 Commits (3601872153ee06a2b58b7fb45898e2b7acbb62ea)

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 9452d4fd33
/!\ Use a dedicated config file for development
It means you have to replace NODE_ENV=test to NODE_ENV=dev if you use it
npm run dev:* commands are already updated
2022-07-06 16:12:17 +02:00
Chocobozzz f8360396ff
Stop using tsconfig register
Prefer to replace paths at compile time
2022-01-06 08:26:14 +01:00
Chocobozzz 9270bd3a7e
Migrate to --enable-source-maps option 2022-01-03 16:37:16 +01:00
Chocobozzz 9b3294a849 Fix some build scripts and lint 2021-12-16 10:08:43 +01:00
Chocobozzz d573926e9b Add migrations for abuse messages 2020-07-31 11:35:19 +02:00
Chocobozzz 99ae9d3a9e
Fix npm run dev 2020-02-19 09:14:28 +01:00
Chocobozzz 0e4338fd1d
Use bash to run scripts 2020-02-19 08:56:24 +01:00
Chocobozzz 36619ac8f5
Reduce dev commands RAM usage 2020-01-22 10:18:57 +01:00
Chocobozzz c026a2e673
Remove watch scripts 2019-12-18 10:14:24 +01:00
Chocobozzz 47f6cb31d7
Fix email to field 2019-11-29 13:36:40 +01:00
Chocobozzz 2adfc7ea9a Refractor videojs player
Add fake p2p-media-loader plugin
2019-02-11 09:13:02 +01:00
Chocobozzz 8244c85ad6
Fix npm run dev:server 2018-06-29 09:33:36 +02:00
Léo Andrès 0e4ffb4b67 Clean shell scripts (#398) 2018-03-27 10:35:12 +02:00
Chocobozzz 18c8e94508 Video search -> case insensitive 2017-07-06 18:01:02 +02:00
Chocobozzz 66dd264f7b Better build/dev scripts 2017-06-11 11:36:05 +02:00