aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-03 17:13:11 +0100
committerChocobozzz <me@florianbigard.com>2022-01-06 08:26:14 +0100
commitf8360396ffabd2f95e9ece9c5755173bae0114b6 (patch)
tree83467f70bb5d5c2faa61c45e1d87b538c6c8fe5e /scripts
parentcea093bca5b9d311b5c1d0539d53e965c901015b (diff)
downloadPeerTube-f8360396ffabd2f95e9ece9c5755173bae0114b6.tar.gz
PeerTube-f8360396ffabd2f95e9ece9c5755173bae0114b6.tar.zst
PeerTube-f8360396ffabd2f95e9ece9c5755173bae0114b6.zip
Stop using tsconfig register
Prefer to replace paths at compile time
Diffstat (limited to 'scripts')
-rw-r--r--scripts/benchmark.ts5
-rwxr-xr-xscripts/build/server.sh6
-rwxr-xr-xscripts/ci.sh2
-rw-r--r--scripts/client-build-stats.ts3
-rw-r--r--scripts/create-import-video-file-job.ts7
-rw-r--r--scripts/create-move-video-storage-job.ts11
-rwxr-xr-xscripts/create-transcoding-job.ts13
-rwxr-xr-xscripts/dev/cli.sh3
-rwxr-xr-xscripts/dev/server.sh11
-rwxr-xr-xscripts/generate-code-contributors.ts3
-rwxr-xr-xscripts/i18n/create-custom-files.ts8
-rw-r--r--scripts/migrations/peertube-2.1.ts15
-rw-r--r--scripts/migrations/peertube-4.0.ts11
-rwxr-xr-xscripts/nightly.sh2
-rwxr-xr-xscripts/parse-log.ts7
-rwxr-xr-xscripts/plugin/install.ts7
-rwxr-xr-xscripts/plugin/uninstall.ts5
-rw-r--r--scripts/print-transcode-command.ts5
-rwxr-xr-xscripts/prune-storage.ts27
-rw-r--r--scripts/regenerate-thumbnails.ts5
-rwxr-xr-xscripts/release.sh2
-rwxr-xr-xscripts/reset-password.ts5
-rwxr-xr-xscripts/setup/cli.sh6
-rwxr-xr-xscripts/update-host.ts19
24 files changed, 68 insertions, 120 deletions
diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts
index 011519fe3..3c3c666a1 100644
--- a/scripts/benchmark.ts
+++ b/scripts/benchmark.ts
@@ -1,10 +1,7 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import autocannon, { printResult } from 'autocannon' 1import autocannon, { printResult } from 'autocannon'
5import { writeJson } from 'fs-extra' 2import { writeJson } from 'fs-extra'
6import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
7import { Video, VideoPrivacy } from '@shared/models' 3import { Video, VideoPrivacy } from '@shared/models'
4import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
8 5
9let server: PeerTubeServer 6let server: PeerTubeServer
10let video: Video 7let video: Video
diff --git a/scripts/build/server.sh b/scripts/build/server.sh
index 865bdd095..a2dfc3dd9 100755
--- a/scripts/build/server.sh
+++ b/scripts/build/server.sh
@@ -5,9 +5,7 @@ set -eu
5rm -rf ./dist 5rm -rf ./dist
6 6
7npm run tsc -- -b --verbose 7npm run tsc -- -b --verbose
8cp "./tsconfig.base.json" "./tsconfig.json" "./dist/" 8npm run resolve-tspaths:server
9cp "./scripts/tsconfig.json" "./dist/scripts/" 9
10cp "./server/tsconfig.json" "./dist/server/"
11cp "./shared/tsconfig.json" "./dist/shared/"
12cp -r "./server/static" "./server/assets" "./dist/server" 10cp -r "./server/static" "./server/assets" "./dist/server"
13cp -r "./server/lib/emails" "./dist/server/lib" 11cp -r "./server/lib/emails" "./dist/server/lib"
diff --git a/scripts/ci.sh b/scripts/ci.sh
index b0b76ca99..2bacf2a2e 100755
--- a/scripts/ci.sh
+++ b/scripts/ci.sh
@@ -23,7 +23,7 @@ runTest () {
23 joblog="$jobname-ci.log" 23 joblog="$jobname-ci.log"
24 24
25 parallel -j $jobs --retries $retries \ 25 parallel -j $jobs --retries $retries \
26 "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ./dist/server/tests/register.js --bail {}" \ 26 "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --bail {}" \
27 ::: $files 27 ::: $files
28 28
29 cat "$joblog" | uniq -c 29 cat "$joblog" | uniq -c
diff --git a/scripts/client-build-stats.ts b/scripts/client-build-stats.ts
index 91844dfcd..d5ecd5fea 100644
--- a/scripts/client-build-stats.ts
+++ b/scripts/client-build-stats.ts
@@ -1,6 +1,3 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { readdir, stat } from 'fs-extra' 1import { readdir, stat } from 'fs-extra'
5import { join } from 'path' 2import { join } from 'path'
6import { root } from '@shared/core-utils' 3import { root } from '@shared/core-utils'
diff --git a/scripts/create-import-video-file-job.ts b/scripts/create-import-video-file-job.ts
index 071d36df4..97e9c7933 100644
--- a/scripts/create-import-video-file-job.ts
+++ b/scripts/create-import-video-file-job.ts
@@ -1,12 +1,9 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { program } from 'commander' 1import { program } from 'commander'
5import { resolve } from 'path' 2import { resolve } from 'path'
6import { VideoModel } from '../server/models/video/video' 3import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc'
7import { initDatabaseModels } from '../server/initializers/database' 4import { initDatabaseModels } from '../server/initializers/database'
8import { JobQueue } from '../server/lib/job-queue' 5import { JobQueue } from '../server/lib/job-queue'
9import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc' 6import { VideoModel } from '../server/models/video/video'
10 7
11program 8program
12 .option('-v, --video [videoUUID]', 'Video UUID') 9 .option('-v, --video [videoUUID]', 'Video UUID')
diff --git a/scripts/create-move-video-storage-job.ts b/scripts/create-move-video-storage-job.ts
index 90c84b1d7..7465c1ce0 100644
--- a/scripts/create-move-video-storage-job.ts
+++ b/scripts/create-move-video-storage-job.ts
@@ -1,13 +1,10 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { program } from 'commander' 1import { program } from 'commander'
5import { VideoModel } from '@server/models/video/video' 2import { CONFIG } from '@server/initializers/config'
6import { initDatabaseModels } from '@server/initializers/database' 3import { initDatabaseModels } from '@server/initializers/database'
7import { VideoState, VideoStorage } from '@shared/models'
8import { moveToExternalStorageState } from '@server/lib/video-state'
9import { JobQueue } from '@server/lib/job-queue' 4import { JobQueue } from '@server/lib/job-queue'
10import { CONFIG } from '@server/initializers/config' 5import { moveToExternalStorageState } from '@server/lib/video-state'
6import { VideoModel } from '@server/models/video/video'
7import { VideoState, VideoStorage } from '@shared/models'
11 8
12program 9program
13 .description('Move videos to another storage.') 10 .description('Move videos to another storage.')
diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts
index 244c38fcd..d462fbf33 100755
--- a/scripts/create-transcoding-job.ts
+++ b/scripts/create-transcoding-job.ts
@@ -1,15 +1,12 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { program } from 'commander' 1import { program } from 'commander'
5import { VideoModel } from '../server/models/video/video' 2import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc'
6import { initDatabaseModels } from '../server/initializers/database'
7import { JobQueue } from '../server/lib/job-queue'
8import { computeLowerResolutionsToTranscode } from '@server/helpers/ffprobe-utils' 3import { computeLowerResolutionsToTranscode } from '@server/helpers/ffprobe-utils'
9import { VideoState, VideoTranscodingPayload } from '@shared/models'
10import { CONFIG } from '@server/initializers/config' 4import { CONFIG } from '@server/initializers/config'
11import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc'
12import { addTranscodingJob } from '@server/lib/video' 5import { addTranscodingJob } from '@server/lib/video'
6import { VideoState, VideoTranscodingPayload } from '@shared/models'
7import { initDatabaseModels } from '../server/initializers/database'
8import { JobQueue } from '../server/lib/job-queue'
9import { VideoModel } from '../server/models/video/video'
13 10
14program 11program
15 .option('-v, --video [videoUUID]', 'Video UUID') 12 .option('-v, --video [videoUUID]', 'Video UUID')
diff --git a/scripts/dev/cli.sh b/scripts/dev/cli.sh
index 4bf4808b8..327792a19 100755
--- a/scripts/dev/cli.sh
+++ b/scripts/dev/cli.sh
@@ -12,4 +12,5 @@ rm -rf ./dist/server/tools/
12mkdir -p "./dist/server/tools" 12mkdir -p "./dist/server/tools"
13cp -r "./server/tools/node_modules" "./dist/server/tools" 13cp -r "./server/tools/node_modules" "./dist/server/tools"
14 14
15npm run tsc -- --watch --sourceMap --project ./server/tools/tsconfig.json 15cd ./server/tools
16../../node_modules/.bin/tsc-watch --build --verbose --onSuccess 'sh -c "cd ../../ && npm run resolve-tspaths:all"'
diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh
index 468af0a56..9dae43a63 100755
--- a/scripts/dev/server.sh
+++ b/scripts/dev/server.sh
@@ -14,15 +14,12 @@ mkdir -p "./client/dist"
14rm -rf "./client/dist/locale" 14rm -rf "./client/dist/locale"
15cp -r "./client/src/locale" "./client/dist/locale" 15cp -r "./client/src/locale" "./client/dist/locale"
16 16
17rm -rf "./dist" 17mkdir -p "./dist/server/lib"
18
19mkdir "./dist"
20cp "./tsconfig.json" "./dist"
21 18
22npm run tsc -- -b -v --incremental 19npm run tsc -- -b -v --incremental
20npm run resolve-tspaths:server
21
23cp -r ./server/static ./server/assets ./dist/server 22cp -r ./server/static ./server/assets ./dist/server
24cp -r "./server/lib/emails" "./dist/server/lib" 23cp -r "./server/lib/emails" "./dist/server/lib"
25 24
26NODE_ENV=test node node_modules/.bin/concurrently -k \ 25./node_modules/.bin/tsc-watch --build --preserveWatchOutput --verbose --onSuccess 'sh -c "npm run resolve-tspaths:server && NODE_ENV=test node dist/server"'
27 "node_modules/.bin/nodemon --enable-source-maps --delay 1 --watch ./dist dist/server" \
28 "node_modules/.bin/tsc -b -w --preserveWatchOutput"
diff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.ts
index 449407c44..5357daf04 100755
--- a/scripts/generate-code-contributors.ts
+++ b/scripts/generate-code-contributors.ts
@@ -1,6 +1,3 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { CLICommand } from '@shared/server-commands' 1import { CLICommand } from '@shared/server-commands'
5 2
6run() 3run()
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts
index d9328b125..7556866e6 100755
--- a/scripts/i18n/create-custom-files.ts
+++ b/scripts/i18n/create-custom-files.ts
@@ -1,9 +1,7 @@
1import { registerTSPaths } from '../../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { writeJSON } from 'fs-extra' 1import { writeJSON } from 'fs-extra'
5import { values } from 'lodash' 2import { values } from 'lodash'
6import { join } from 'path' 3import { join } from 'path'
4import { root } from '@shared/core-utils'
7import { 5import {
8 buildLanguages, 6 buildLanguages,
9 VIDEO_CATEGORIES, 7 VIDEO_CATEGORIES,
@@ -16,7 +14,7 @@ import {
16} from '../../server/initializers/constants' 14} from '../../server/initializers/constants'
17import { I18N_LOCALES } from '../../shared/core-utils/i18n' 15import { I18N_LOCALES } from '../../shared/core-utils/i18n'
18 16
19const videojs = require(join(__dirname, '../../../client/src/locale/videojs.en-US.json')) 17const videojs = require(join(root(), 'client', 'src', 'locale', 'videojs.en-US.json'))
20const playerKeys = { 18const playerKeys = {
21 'Quality': 'Quality', 19 'Quality': 'Quality',
22 'Auto': 'Auto', 20 'Auto': 'Auto',
@@ -100,7 +98,7 @@ writeAll().catch(err => {
100}) 98})
101 99
102async function writeAll () { 100async function writeAll () {
103 const localePath = join(__dirname, '../../../client/src/locale') 101 const localePath = join(root(), 'client', 'src', 'locale')
104 102
105 await writeJSON(join(localePath, 'player.en-US.json'), playerKeys, { spaces: 4 }) 103 await writeJSON(join(localePath, 'player.en-US.json'), playerKeys, { spaces: 4 })
106 await writeJSON(join(localePath, 'server.en-US.json'), serverKeys, { spaces: 4 }) 104 await writeJSON(join(localePath, 'server.en-US.json'), serverKeys, { spaces: 4 })
diff --git a/scripts/migrations/peertube-2.1.ts b/scripts/migrations/peertube-2.1.ts
index 4bbc203c1..2e316d996 100644
--- a/scripts/migrations/peertube-2.1.ts
+++ b/scripts/migrations/peertube-2.1.ts
@@ -1,15 +1,12 @@
1import { registerTSPaths } from '../../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { initDatabaseModels, sequelizeTypescript } from '../../server/initializers/database'
5import * as Sequelize from 'sequelize'
6import { join } from 'path'
7import { HLS_STREAMING_PLAYLIST_DIRECTORY, STATIC_PATHS, WEBSERVER } from '@server/initializers/constants'
8import { pathExists, stat, writeFile } from 'fs-extra' 1import { pathExists, stat, writeFile } from 'fs-extra'
9import { createTorrentPromise } from '@server/helpers/webtorrent'
10import { CONFIG } from '@server/initializers/config'
11import parseTorrent from 'parse-torrent' 2import parseTorrent from 'parse-torrent'
3import { join } from 'path'
4import * as Sequelize from 'sequelize'
12import { logger } from '@server/helpers/logger' 5import { logger } from '@server/helpers/logger'
6import { createTorrentPromise } from '@server/helpers/webtorrent'
7import { CONFIG } from '@server/initializers/config'
8import { HLS_STREAMING_PLAYLIST_DIRECTORY, STATIC_PATHS, WEBSERVER } from '@server/initializers/constants'
9import { initDatabaseModels, sequelizeTypescript } from '../../server/initializers/database'
13 10
14run() 11run()
15 .then(() => process.exit(0)) 12 .then(() => process.exit(0))
diff --git a/scripts/migrations/peertube-4.0.ts b/scripts/migrations/peertube-4.0.ts
index abf431888..64cf45474 100644
--- a/scripts/migrations/peertube-4.0.ts
+++ b/scripts/migrations/peertube-4.0.ts
@@ -1,16 +1,13 @@
1import { registerTSPaths } from '../../server/helpers/register-ts-paths' 1import Bluebird from 'bluebird'
2registerTSPaths() 2import { move, readFile, writeFile } from 'fs-extra'
3
4import { join } from 'path' 3import { join } from 'path'
4import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
5import { JobQueue } from '@server/lib/job-queue' 5import { JobQueue } from '@server/lib/job-queue'
6import { initDatabaseModels } from '../../server/initializers/database'
7import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getHlsResolutionPlaylistFilename } from '@server/lib/paths' 6import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getHlsResolutionPlaylistFilename } from '@server/lib/paths'
8import { VideoPathManager } from '@server/lib/video-path-manager' 7import { VideoPathManager } from '@server/lib/video-path-manager'
9import { VideoModel } from '@server/models/video/video' 8import { VideoModel } from '@server/models/video/video'
10import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' 9import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
11import { move, readFile, writeFile } from 'fs-extra' 10import { initDatabaseModels } from '../../server/initializers/database'
12import Bluebird from 'bluebird'
13import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
14 11
15run() 12run()
16 .then(() => process.exit(0)) 13 .then(() => process.exit(0))
diff --git a/scripts/nightly.sh b/scripts/nightly.sh
index 5ad603929..572277f9d 100755
--- a/scripts/nightly.sh
+++ b/scripts/nightly.sh
@@ -32,7 +32,7 @@ sed -i 's/"version": "\([^"]\+\)"/"version": "\1-'"$nightly_version"'"/' ./packa
32 "$directory_name/client/package.json" "$directory_name/config" \ 32 "$directory_name/client/package.json" "$directory_name/config" \
33 "$directory_name/dist" "$directory_name/package.json" \ 33 "$directory_name/dist" "$directory_name/package.json" \
34 "$directory_name/scripts" "$directory_name/support" \ 34 "$directory_name/scripts" "$directory_name/support" \
35 "$directory_name/tsconfig.json" "$directory_name/yarn.lock") 35 "$directory_name/yarn.lock")
36 36
37 # temporary setup 37 # temporary setup
38 cd .. 38 cd ..
diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts
index 6cd3a1860..d3c93cee5 100755
--- a/scripts/parse-log.ts
+++ b/scripts/parse-log.ts
@@ -1,15 +1,12 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { program } from 'commander' 1import { program } from 'commander'
5import { createReadStream, readdir } from 'fs-extra' 2import { createReadStream, readdir } from 'fs-extra'
6import { join } from 'path' 3import { join } from 'path'
7import { createInterface } from 'readline' 4import { createInterface } from 'readline'
5import { format as sqlFormat } from 'sql-formatter'
6import { inspect } from 'util'
8import * as winston from 'winston' 7import * as winston from 'winston'
9import { labelFormatter, mtimeSortFilesDesc } from '../server/helpers/logger' 8import { labelFormatter, mtimeSortFilesDesc } from '../server/helpers/logger'
10import { CONFIG } from '../server/initializers/config' 9import { CONFIG } from '../server/initializers/config'
11import { inspect } from 'util'
12import { format as sqlFormat } from 'sql-formatter'
13 10
14program 11program
15 .option('-l, --level [level]', 'Level log (debug/info/warn/error)') 12 .option('-l, --level [level]', 'Level log (debug/info/warn/error)')
diff --git a/scripts/plugin/install.ts b/scripts/plugin/install.ts
index de045c2d2..0795d7c93 100755
--- a/scripts/plugin/install.ts
+++ b/scripts/plugin/install.ts
@@ -1,10 +1,7 @@
1import { registerTSPaths } from '../../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { initDatabaseModels } from '../../server/initializers/database'
5import { program } from 'commander' 1import { program } from 'commander'
6import { PluginManager } from '../../server/lib/plugins/plugin-manager'
7import { isAbsolute } from 'path' 2import { isAbsolute } from 'path'
3import { initDatabaseModels } from '../../server/initializers/database'
4import { PluginManager } from '../../server/lib/plugins/plugin-manager'
8 5
9program 6program
10 .option('-n, --npm-name [npmName]', 'Plugin to install') 7 .option('-n, --npm-name [npmName]', 'Plugin to install')
diff --git a/scripts/plugin/uninstall.ts b/scripts/plugin/uninstall.ts
index 1e14cc18f..152b651dd 100755
--- a/scripts/plugin/uninstall.ts
+++ b/scripts/plugin/uninstall.ts
@@ -1,8 +1,5 @@
1import { registerTSPaths } from '../../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { initDatabaseModels } from '../../server/initializers/database'
5import { program } from 'commander' 1import { program } from 'commander'
2import { initDatabaseModels } from '../../server/initializers/database'
6import { PluginManager } from '../../server/lib/plugins/plugin-manager' 3import { PluginManager } from '../../server/lib/plugins/plugin-manager'
7 4
8program 5program
diff --git a/scripts/print-transcode-command.ts b/scripts/print-transcode-command.ts
index 352145252..21667f544 100644
--- a/scripts/print-transcode-command.ts
+++ b/scripts/print-transcode-command.ts
@@ -1,10 +1,7 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { program } from 'commander' 1import { program } from 'commander'
5import ffmpeg from 'fluent-ffmpeg' 2import ffmpeg from 'fluent-ffmpeg'
6import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils'
7import { exit } from 'process' 3import { exit } from 'process'
4import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils'
8import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/video-transcoding-profiles' 5import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/video-transcoding-profiles'
9 6
10program 7program
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts
index 12d78fdc6..bb1e8e024 100755
--- a/scripts/prune-storage.ts
+++ b/scripts/prune-storage.ts
@@ -1,22 +1,19 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { start, get } from 'prompt'
5import { join, basename } from 'path'
6import { CONFIG } from '../server/initializers/config'
7import { VideoModel } from '../server/models/video/video'
8import { initDatabaseModels } from '../server/initializers/database'
9import { readdir, remove, stat } from 'fs-extra'
10import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy'
11import { map } from 'bluebird' 1import { map } from 'bluebird'
12import { getUUIDFromFilename } from '../server/helpers/utils' 2import { readdir, remove, stat } from 'fs-extra'
13import { ThumbnailModel } from '../server/models/video/thumbnail'
14import { ActorImageModel } from '../server/models/actor/actor-image'
15import { uniq, values } from 'lodash' 3import { uniq, values } from 'lodash'
16import { ThumbnailType } from '@shared/models' 4import { basename, join } from 'path'
17import { VideoFileModel } from '@server/models/video/video-file' 5import { get, start } from 'prompt'
18import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' 6import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants'
7import { VideoFileModel } from '@server/models/video/video-file'
19import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' 8import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
9import { ThumbnailType } from '@shared/models'
10import { getUUIDFromFilename } from '../server/helpers/utils'
11import { CONFIG } from '../server/initializers/config'
12import { initDatabaseModels } from '../server/initializers/database'
13import { ActorImageModel } from '../server/models/actor/actor-image'
14import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy'
15import { ThumbnailModel } from '../server/models/video/thumbnail'
16import { VideoModel } from '../server/models/video/video'
20 17
21run() 18run()
22 .then(() => process.exit(0)) 19 .then(() => process.exit(0))
diff --git a/scripts/regenerate-thumbnails.ts b/scripts/regenerate-thumbnails.ts
index 50d06f6fd..a377baa61 100644
--- a/scripts/regenerate-thumbnails.ts
+++ b/scripts/regenerate-thumbnails.ts
@@ -1,13 +1,10 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { map } from 'bluebird' 1import { map } from 'bluebird'
5import { program } from 'commander' 2import { program } from 'commander'
6import { pathExists, remove } from 'fs-extra' 3import { pathExists, remove } from 'fs-extra'
7import { generateImageFilename, processImage } from '@server/helpers/image-utils' 4import { generateImageFilename, processImage } from '@server/helpers/image-utils'
8import { THUMBNAILS_SIZE } from '@server/initializers/constants' 5import { THUMBNAILS_SIZE } from '@server/initializers/constants'
9import { VideoModel } from '@server/models/video/video'
10import { initDatabaseModels } from '@server/initializers/database' 6import { initDatabaseModels } from '@server/initializers/database'
7import { VideoModel } from '@server/models/video/video'
11 8
12program 9program
13 .description('Regenerate local thumbnails using preview files') 10 .description('Regenerate local thumbnails using preview files')
diff --git a/scripts/release.sh b/scripts/release.sh
index 409a52977..313087a29 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -76,7 +76,7 @@ rm -f "./client/dist/embed-stats.json"
76 "$directory_name/client/package.json" "$directory_name/config" \ 76 "$directory_name/client/package.json" "$directory_name/config" \
77 "$directory_name/dist" "$directory_name/package.json" \ 77 "$directory_name/dist" "$directory_name/package.json" \
78 "$directory_name/scripts" "$directory_name/support" \ 78 "$directory_name/scripts" "$directory_name/support" \
79 "$directory_name/tsconfig.json" "$directory_name/yarn.lock") 79 "$directory_name/yarn.lock")
80 80
81 # temporary setup 81 # temporary setup
82 cd .. 82 cd ..
diff --git a/scripts/reset-password.ts b/scripts/reset-password.ts
index 4c45396d4..b2e5639fb 100755
--- a/scripts/reset-password.ts
+++ b/scripts/reset-password.ts
@@ -1,10 +1,7 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { program } from 'commander' 1import { program } from 'commander'
2import { isUserPasswordValid } from '../server/helpers/custom-validators/users'
5import { initDatabaseModels } from '../server/initializers/database' 3import { initDatabaseModels } from '../server/initializers/database'
6import { UserModel } from '../server/models/user/user' 4import { UserModel } from '../server/models/user/user'
7import { isUserPasswordValid } from '../server/helpers/custom-validators/users'
8 5
9program 6program
10 .option('-u, --user [user]', 'User') 7 .option('-u, --user [user]', 'User')
diff --git a/scripts/setup/cli.sh b/scripts/setup/cli.sh
index d0ad2ec5f..f84260f23 100755
--- a/scripts/setup/cli.sh
+++ b/scripts/setup/cli.sh
@@ -9,8 +9,10 @@ rm -rf ./dist/server/tools/
9( 9(
10 cd ./server/tools 10 cd ./server/tools
11 yarn install --pure-lockfile 11 yarn install --pure-lockfile
12 ../../node_modules/.bin/tsc --build --verbose
12) 13)
13 14
14npm run tsc -- --build --verbose ./server/tools/tsconfig.json
15cp -r "./server/tools/node_modules" "./dist/server/tools" 15cp -r "./server/tools/node_modules" "./dist/server/tools"
16cp "./tsconfig.json" "./dist" 16
17npm run resolve-tspaths:cli
18npm run resolve-tspaths:server
diff --git a/scripts/update-host.ts b/scripts/update-host.ts
index 66c0137d9..bb54290a4 100755
--- a/scripts/update-host.ts
+++ b/scripts/update-host.ts
@@ -1,10 +1,7 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths' 1import { updateTorrentMetadata } from '@server/helpers/webtorrent'
2registerTSPaths() 2import { getServerActor } from '@server/models/application/application'
3
4import { WEBSERVER } from '../server/initializers/constants' 3import { WEBSERVER } from '../server/initializers/constants'
5import { ActorFollowModel } from '../server/models/actor/actor-follow' 4import { initDatabaseModels } from '../server/initializers/database'
6import { VideoModel } from '../server/models/video/video'
7import { ActorModel } from '../server/models/actor/actor'
8import { 5import {
9 getLocalAccountActivityPubUrl, 6 getLocalAccountActivityPubUrl,
10 getLocalVideoActivityPubUrl, 7 getLocalVideoActivityPubUrl,
@@ -12,13 +9,13 @@ import {
12 getLocalVideoChannelActivityPubUrl, 9 getLocalVideoChannelActivityPubUrl,
13 getLocalVideoCommentActivityPubUrl 10 getLocalVideoCommentActivityPubUrl
14} from '../server/lib/activitypub/url' 11} from '../server/lib/activitypub/url'
15import { VideoShareModel } from '../server/models/video/video-share'
16import { VideoCommentModel } from '../server/models/video/video-comment'
17import { AccountModel } from '../server/models/account/account' 12import { AccountModel } from '../server/models/account/account'
13import { ActorModel } from '../server/models/actor/actor'
14import { ActorFollowModel } from '../server/models/actor/actor-follow'
15import { VideoModel } from '../server/models/video/video'
18import { VideoChannelModel } from '../server/models/video/video-channel' 16import { VideoChannelModel } from '../server/models/video/video-channel'
19import { initDatabaseModels } from '../server/initializers/database' 17import { VideoCommentModel } from '../server/models/video/video-comment'
20import { updateTorrentMetadata } from '@server/helpers/webtorrent' 18import { VideoShareModel } from '../server/models/video/video-share'
21import { getServerActor } from '@server/models/application/application'
22 19
23run() 20run()
24 .then(() => process.exit(0)) 21 .then(() => process.exit(0))