aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-10-21 16:02:15 +0200
committerChocobozzz <me@florianbigard.com>2019-10-21 16:02:15 +0200
commit464687bb96cf98d00714279750fd5f19a42b6a02 (patch)
tree16a3d538a99c46ed6885a119bfd8109167b61134
parentd5d9b6d7bfb7e9426b6462f7fdf285df39eea820 (diff)
downloadPeerTube-464687bb96cf98d00714279750fd5f19a42b6a02.tar.gz
PeerTube-464687bb96cf98d00714279750fd5f19a42b6a02.tar.zst
PeerTube-464687bb96cf98d00714279750fd5f19a42b6a02.zip
Fix bug with tsconfig paths
-rw-r--r--package.json2
-rwxr-xr-xscripts/build/server.sh1
-rw-r--r--server.ts15
-rw-r--r--server/tests/helpers/core-utils.ts6
-rw-r--r--yarn.lock25
5 files changed, 35 insertions, 14 deletions
diff --git a/package.json b/package.json
index f17da34d0..17cb6677d 100644
--- a/package.json
+++ b/package.json
@@ -132,7 +132,6 @@
132 "lru-cache": "^5.1.1", 132 "lru-cache": "^5.1.1",
133 "magnet-uri": "^5.1.4", 133 "magnet-uri": "^5.1.4",
134 "memoizee": "^0.4.14", 134 "memoizee": "^0.4.14",
135 "module-alias": "^2.2.1",
136 "morgan": "^1.5.3", 135 "morgan": "^1.5.3",
137 "multer": "^1.1.0", 136 "multer": "^1.1.0",
138 "nodemailer": "^6.0.0", 137 "nodemailer": "^6.0.0",
@@ -152,6 +151,7 @@
152 "sitemap": "^5.0.0", 151 "sitemap": "^5.0.0",
153 "socket.io": "^2.2.0", 152 "socket.io": "^2.2.0",
154 "srt-to-vtt": "^1.1.2", 153 "srt-to-vtt": "^1.1.2",
154 "tsconfig-paths": "^3.9.0",
155 "useragent": "^2.3.0", 155 "useragent": "^2.3.0",
156 "uuid": "^3.1.0", 156 "uuid": "^3.1.0",
157 "validator": "^11.0.0", 157 "validator": "^11.0.0",
diff --git a/scripts/build/server.sh b/scripts/build/server.sh
index 3880ac5fa..d66a52475 100755
--- a/scripts/build/server.sh
+++ b/scripts/build/server.sh
@@ -5,4 +5,5 @@ set -eu
5rm -rf ./dist 5rm -rf ./dist
6 6
7npm run tsc 7npm run tsc
8cp "./tsconfig.json" "./dist"
8cp -r "./server/static" "./server/assets" "./dist/server" 9cp -r "./server/static" "./server/assets" "./dist/server"
diff --git a/server.ts b/server.ts
index 5cfa09445..b49d10344 100644
--- a/server.ts
+++ b/server.ts
@@ -1,12 +1,18 @@
1require('module-alias/register') 1import { resolve } from 'path'
2 2
3// FIXME: https://github.com/nodejs/node/pull/16853 3const tsConfig = require('./tsconfig.json')
4import { PluginManager } from './server/lib/plugins/plugin-manager' 4const tsConfigPaths = require('tsconfig-paths')
5
6// Thanks: https://github.com/dividab/tsconfig-paths/issues/75#issuecomment-458936883
7tsConfigPaths.register({
8 baseUrl: resolve(tsConfig.compilerOptions.baseUrl || '', tsConfig.compilerOptions.outDir || ''),
9 paths: tsConfig.compilerOptions.paths
10})
5 11
12// FIXME: https://github.com/nodejs/node/pull/16853
6require('tls').DEFAULT_ECDH_CURVE = 'auto' 13require('tls').DEFAULT_ECDH_CURVE = 'auto'
7 14
8import { isTestInstance } from './server/helpers/core-utils' 15import { isTestInstance } from './server/helpers/core-utils'
9
10if (isTestInstance()) { 16if (isTestInstance()) {
11 require('source-map-support').install() 17 require('source-map-support').install()
12} 18}
@@ -121,6 +127,7 @@ import { PeerTubeSocket } from './server/lib/peertube-socket'
121import { updateStreamingPlaylistsInfohashesIfNeeded } from './server/lib/hls' 127import { updateStreamingPlaylistsInfohashesIfNeeded } from './server/lib/hls'
122import { PluginsCheckScheduler } from './server/lib/schedulers/plugins-check-scheduler' 128import { PluginsCheckScheduler } from './server/lib/schedulers/plugins-check-scheduler'
123import { Hooks } from './server/lib/plugins/hooks' 129import { Hooks } from './server/lib/plugins/hooks'
130import { PluginManager } from './server/lib/plugins/plugin-manager'
124 131
125// ----------- Command line ----------- 132// ----------- Command line -----------
126 133
diff --git a/server/tests/helpers/core-utils.ts b/server/tests/helpers/core-utils.ts
index e604cf7e3..2dbe8d635 100644
--- a/server/tests/helpers/core-utils.ts
+++ b/server/tests/helpers/core-utils.ts
@@ -2,10 +2,8 @@
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { snakeCase, isNumber } from 'lodash' 5import { snakeCase } from 'lodash'
6import { 6import { objectConverter, parseBytes } from '../../helpers/core-utils'
7 parseBytes, objectConverter
8} from '../../helpers/core-utils'
9import { isNumeric } from 'validator' 7import { isNumeric } from 'validator'
10 8
11const expect = chai.expect 9const expect = chai.expect
diff --git a/yarn.lock b/yarn.lock
index eafeffad3..b6a59b855 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -206,6 +206,11 @@
206 dependencies: 206 dependencies:
207 "@types/node" "*" 207 "@types/node" "*"
208 208
209"@types/json5@^0.0.29":
210 version "0.0.29"
211 resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
212 integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
213
209"@types/libxmljs@^0.18.0": 214"@types/libxmljs@^0.18.0":
210 version "0.18.3" 215 version "0.18.3"
211 resolved "https://registry.yarnpkg.com/@types/libxmljs/-/libxmljs-0.18.3.tgz#5aaed8fc4ec5ea99e005ee5dfb47cf9924166a4d" 216 resolved "https://registry.yarnpkg.com/@types/libxmljs/-/libxmljs-0.18.3.tgz#5aaed8fc4ec5ea99e005ee5dfb47cf9924166a4d"
@@ -4551,11 +4556,6 @@ mocha@^6.0.0:
4551 yargs-parser "13.1.1" 4556 yargs-parser "13.1.1"
4552 yargs-unparser "1.6.0" 4557 yargs-unparser "1.6.0"
4553 4558
4554module-alias@^2.2.1:
4555 version "2.2.2"
4556 resolved "https://registry.yarnpkg.com/module-alias/-/module-alias-2.2.2.tgz#151cdcecc24e25739ff0aa6e51e1c5716974c0e0"
4557 integrity sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==
4558
4559moment-timezone@^0.5.21, moment-timezone@^0.5.25: 4559moment-timezone@^0.5.21, moment-timezone@^0.5.25:
4560 version "0.5.27" 4560 version "0.5.27"
4561 resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.27.tgz#73adec8139b6fe30452e78f210f27b1f346b8877" 4561 resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.27.tgz#73adec8139b6fe30452e78f210f27b1f346b8877"
@@ -6752,6 +6752,11 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
6752 dependencies: 6752 dependencies:
6753 ansi-regex "^4.1.0" 6753 ansi-regex "^4.1.0"
6754 6754
6755strip-bom@^3.0.0:
6756 version "3.0.0"
6757 resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
6758 integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=
6759
6755strip-eof@^1.0.0: 6760strip-eof@^1.0.0:
6756 version "1.0.0" 6761 version "1.0.0"
6757 resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" 6762 resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
@@ -7097,6 +7102,16 @@ ts-node@8.4.1:
7097 source-map-support "^0.5.6" 7102 source-map-support "^0.5.6"
7098 yn "^3.0.0" 7103 yn "^3.0.0"
7099 7104
7105tsconfig-paths@^3.9.0:
7106 version "3.9.0"
7107 resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b"
7108 integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==
7109 dependencies:
7110 "@types/json5" "^0.0.29"
7111 json5 "^1.0.1"
7112 minimist "^1.2.0"
7113 strip-bom "^3.0.0"
7114
7100tslib@1.9.0: 7115tslib@1.9.0:
7101 version "1.9.0" 7116 version "1.9.0"
7102 resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" 7117 resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"