diff options
-rw-r--r-- | package.json | 1 | ||||
-rwxr-xr-x | scripts/dev/server.sh | 4 | ||||
-rw-r--r-- | server.ts | 8 | ||||
-rw-r--r-- | shared/server-commands/server/server.ts | 5 | ||||
-rw-r--r-- | yarn.lock | 10 |
5 files changed, 9 insertions, 19 deletions
diff --git a/package.json b/package.json index b0df43ffa..0aac4c860 100644 --- a/package.json +++ b/package.json | |||
@@ -205,7 +205,6 @@ | |||
205 | "proxy": "^1.0.2", | 205 | "proxy": "^1.0.2", |
206 | "resolve-tspaths": "^0.2.1", | 206 | "resolve-tspaths": "^0.2.1", |
207 | "socket.io-client": "^4.0.1", | 207 | "socket.io-client": "^4.0.1", |
208 | "source-map-support": "^0.5.0", | ||
209 | "supertest": "^6.0.1", | 208 | "supertest": "^6.0.1", |
210 | "swagger-cli": "^4.0.2", | 209 | "swagger-cli": "^4.0.2", |
211 | "ts-node": "10.4.0", | 210 | "ts-node": "10.4.0", |
diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh index 07d88eb2f..468af0a56 100755 --- a/scripts/dev/server.sh +++ b/scripts/dev/server.sh | |||
@@ -5,7 +5,7 @@ set -eu | |||
5 | if [ ! -f "./client/dist/en-US/index.html" ]; then | 5 | if [ ! -f "./client/dist/en-US/index.html" ]; then |
6 | if [ -z ${1+x} ] || [ "$1" != "--skip-client" ]; then | 6 | if [ -z ${1+x} ] || [ "$1" != "--skip-client" ]; then |
7 | echo "client/dist/en-US/index.html does not exist, compile client files..." | 7 | echo "client/dist/en-US/index.html does not exist, compile client files..." |
8 | npm run build:client -- --light | 8 | npm run build:client |
9 | fi | 9 | fi |
10 | fi | 10 | fi |
11 | 11 | ||
@@ -24,5 +24,5 @@ cp -r ./server/static ./server/assets ./dist/server | |||
24 | cp -r "./server/lib/emails" "./dist/server/lib" | 24 | cp -r "./server/lib/emails" "./dist/server/lib" |
25 | 25 | ||
26 | NODE_ENV=test node node_modules/.bin/concurrently -k \ | 26 | NODE_ENV=test node node_modules/.bin/concurrently -k \ |
27 | "node_modules/.bin/nodemon --delay 1 --watch ./dist dist/server" \ | 27 | "node_modules/.bin/nodemon --enable-source-maps --delay 1 --watch ./dist dist/server" \ |
28 | "node_modules/.bin/tsc -b -w --preserveWatchOutput" | 28 | "node_modules/.bin/tsc -b -w --preserveWatchOutput" |
@@ -1,11 +1,6 @@ | |||
1 | import { registerTSPaths } from './server/helpers/register-ts-paths' | 1 | import { registerTSPaths } from './server/helpers/register-ts-paths' |
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import { isTestInstance } from './server/helpers/core-utils' | ||
5 | if (isTestInstance()) { | ||
6 | require('source-map-support').install() | ||
7 | } | ||
8 | |||
9 | // ----------- Node modules ----------- | 4 | // ----------- Node modules ----------- |
10 | import express from 'express' | 5 | import express from 'express' |
11 | import morgan, { token } from 'morgan' | 6 | import morgan, { token } from 'morgan' |
@@ -19,7 +14,7 @@ import { program as cli } from 'commander' | |||
19 | process.title = 'peertube' | 14 | process.title = 'peertube' |
20 | 15 | ||
21 | // Create our main app | 16 | // Create our main app |
22 | const app = express().disable("x-powered-by") | 17 | const app = express().disable('x-powered-by') |
23 | 18 | ||
24 | // ----------- Core checker ----------- | 19 | // ----------- Core checker ----------- |
25 | import { checkMissedConfig, checkFFmpeg, checkNodeVersion } from './server/initializers/checker-before-init' | 20 | import { checkMissedConfig, checkFFmpeg, checkNodeVersion } from './server/initializers/checker-before-init' |
@@ -135,6 +130,7 @@ import { HttpStatusCode } from './shared/models/http/http-error-codes' | |||
135 | import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' | 130 | import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' |
136 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 131 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
137 | import { VideoViews } from '@server/lib/video-views' | 132 | import { VideoViews } from '@server/lib/video-views' |
133 | import { isTestInstance } from './server/helpers/core-utils' | ||
138 | 134 | ||
139 | // ----------- Command line ----------- | 135 | // ----------- Command line ----------- |
140 | 136 | ||
diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts index 617069b11..7b81da54d 100644 --- a/shared/server-commands/server/server.ts +++ b/shared/server-commands/server/server.ts | |||
@@ -217,11 +217,14 @@ export class PeerTubeServer { | |||
217 | execArgv: options.nodeArgs || [] | 217 | execArgv: options.nodeArgs || [] |
218 | } | 218 | } |
219 | 219 | ||
220 | const peertubeArgs = options.peertubeArgs || [] | ||
221 | peertubeArgs.push('--enable-source-maps') | ||
222 | |||
220 | return new Promise<void>((res, rej) => { | 223 | return new Promise<void>((res, rej) => { |
221 | const self = this | 224 | const self = this |
222 | let aggregatedLogs = '' | 225 | let aggregatedLogs = '' |
223 | 226 | ||
224 | this.app = fork(join(root(), 'dist', 'server.js'), options.peertubeArgs || [], forkOptions) | 227 | this.app = fork(join(root(), 'dist', 'server.js'), peertubeArgs, forkOptions) |
225 | 228 | ||
226 | const onPeerTubeExit = () => rej(new Error('Process exited:\n' + aggregatedLogs)) | 229 | const onPeerTubeExit = () => rej(new Error('Process exited:\n' + aggregatedLogs)) |
227 | const onParentExit = () => { | 230 | const onParentExit = () => { |
@@ -7926,20 +7926,12 @@ socks@^2.0.0: | |||
7926 | resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf" | 7926 | resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf" |
7927 | integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA== | 7927 | integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA== |
7928 | 7928 | ||
7929 | source-map-support@^0.5.0: | ||
7930 | version "0.5.21" | ||
7931 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" | ||
7932 | integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== | ||
7933 | dependencies: | ||
7934 | buffer-from "^1.0.0" | ||
7935 | source-map "^0.6.0" | ||
7936 | |||
7937 | source-map@^0.5.0: | 7929 | source-map@^0.5.0: |
7938 | version "0.5.7" | 7930 | version "0.5.7" |
7939 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" | 7931 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" |
7940 | integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= | 7932 | integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= |
7941 | 7933 | ||
7942 | source-map@^0.6.0, source-map@^0.6.1: | 7934 | source-map@^0.6.1: |
7943 | version "0.6.1" | 7935 | version "0.6.1" |
7944 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" | 7936 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" |
7945 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== | 7937 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== |