Upgrade typescript to v6

This commit is contained in:
Chocobozzz
2026-03-26 16:36:25 +01:00
parent 9e562b9437
commit 002ee2452d
16 changed files with 75 additions and 58 deletions
+8 -9
View File
@@ -19,13 +19,12 @@
"typeRoots": [ "typeRoots": [
"node_modules/@types" "node_modules/@types"
], ],
"baseUrl": "./",
"paths": { "paths": {
"@app/*": [ "@app/*": [
"src/app/*" "./src/app/*"
], ],
"@root-helpers/*": [ "@root-helpers/*": [
"src/root-helpers/*" "./src/root-helpers/*"
] ]
} }
}, },
@@ -35,12 +34,12 @@
{ "path": "../packages/typescript-utils" } { "path": "../packages/typescript-utils" }
], ],
"include": [ "include": [
"src/polyfills.ts", "./src/polyfills.ts",
"src/environments/*.ts", "./src/environments/*.ts",
"src/main*.ts", "./src/main*.ts",
"src/**/*.d.ts", "./src/**/*.d.ts",
"src/app/**/*.ts", "./src/app/**/*.ts",
"src/shims/*.ts" "./src/shims/*.ts"
], ],
"angularCompilerOptions": { "angularCompilerOptions": {
"strictInjectionParameters": true, "strictInjectionParameters": true,
+3 -3
View File
@@ -7,11 +7,11 @@
"outDir": "../packages/types-generator/dist-tmp/client/", "outDir": "../packages/types-generator/dist-tmp/client/",
"emitDeclarationOnly": true, "emitDeclarationOnly": true,
"composite": true, "composite": true,
"rootDir": "src/", "rootDir": "./src/",
"tsBuildInfoFile": "../packages/types-generator/dist-tmp/tsconfig.client.tsbuildinfo" "tsBuildInfoFile": "../packages/types-generator/dist-tmp/tsconfig.client.tsbuildinfo"
}, },
"files": [ "src/types/index.ts" ], "files": [ "./src/types/index.ts" ],
"include": [ "include": [
"src/types/**/*" "./src/types/**/*"
] ]
} }
+1 -1
View File
@@ -262,7 +262,7 @@
"tsc-watch": "^7.2.0", "tsc-watch": "^7.2.0",
"tsx": "^4.21.0", "tsx": "^4.21.0",
"type-fest": "^5.4.4", "type-fest": "^5.4.4",
"typescript": "~5.9.3" "typescript": "~6.0.2"
}, },
"packageManager": "pnpm@10.15.1+sha512.34e538c329b5553014ca8e8f4535997f96180a1d0f614339357449935350d924e22f8614682191264ec33d1462ac21561aff97f6bb18065351c162c7e8f6de67" "packageManager": "pnpm@10.15.1+sha512.34e538c329b5553014ca8e8f4535997f96180a1d0f614339357449935350d924e22f8614682191264ec33d1462ac21561aff97f6bb18065351c162c7e8f6de67"
} }
+1 -1
View File
@@ -14,7 +14,7 @@
"type": "module", "type": "module",
"devDependencies": { "devDependencies": {
"@types/superagent": "^8.1.9", "@types/superagent": "^8.1.9",
"@types/supertest": "^6.0.3", "@types/supertest": "^7.2.0",
"supertest": "^7.2.2" "supertest": "^7.2.2"
}, },
"scripts": { "scripts": {
@@ -1,4 +1,5 @@
/* oxlint-disable @typescript-eslint/no-floating-promises */ // Fix typing issue because superagent is referenced by supertest
import 'superagent'
import { pick, queryParamsToObject } from '@peertube/peertube-core-utils' import { pick, queryParamsToObject } from '@peertube/peertube-core-utils'
import { HttpStatusCode, HttpStatusCodeType } from '@peertube/peertube-models' import { HttpStatusCode, HttpStatusCodeType } from '@peertube/peertube-models'
@@ -186,7 +187,7 @@ export function makePutBodyRequest (options: {
fields: { [fieldName: string]: any } fields: { [fieldName: string]: any }
expectedStatus?: HttpStatusCodeType expectedStatus?: HttpStatusCodeType
headers?: { [name: string]: string } headers?: { [name: string]: string }
}) { }): request.Test {
const req = request(options.url).put(options.path) const req = request(options.url).put(options.path)
.send(options.fields) .send(options.fields)
@@ -1,8 +1,10 @@
/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ /* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */
import { pick } from '@peertube/peertube-core-utils'
import { HttpStatusCode, HttpStatusCodeType } from '@peertube/peertube-models' import { HttpStatusCode, HttpStatusCodeType } from '@peertube/peertube-models'
import { buildAbsoluteFixturePath, getFileSize } from '@peertube/peertube-node-utils' import { buildAbsoluteFixturePath, getFileSize } from '@peertube/peertube-node-utils'
import { expect } from 'chai' import { expect } from 'chai'
import { createReadStream } from 'fs'
import got, { Response as GotResponse } from 'got' import got, { Response as GotResponse } from 'got'
import { isAbsolute } from 'path' import { isAbsolute } from 'path'
import { import {
@@ -14,9 +16,6 @@ import {
unwrapBody, unwrapBody,
unwrapText unwrapText
} from '../requests/requests.js' } from '../requests/requests.js'
import { pick } from '@peertube/peertube-core-utils'
import { createReadStream } from 'fs'
import type { PeerTubeServer } from '../server/server.js' import type { PeerTubeServer } from '../server/server.js'
export interface OverrideCommandOptions { export interface OverrideCommandOptions {
+1
View File
@@ -5,6 +5,7 @@
"rootDir": "src", "rootDir": "src",
"tsBuildInfoFile": "./dist/.tsbuildinfo" "tsBuildInfoFile": "./dist/.tsbuildinfo"
}, },
"references": [ "references": [
{ "path": "../models" }, { "path": "../models" },
{ "path": "../core-utils" }, { "path": "../core-utils" },
+4 -4
View File
@@ -158,8 +158,8 @@ export async function testImageSize (options: {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
export function checkBadStartPagination (url: string, path: string, token?: string, query = {}) { export async function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
return makeGetRequest({ await makeGetRequest({
url, url,
path, path,
token, token,
@@ -186,8 +186,8 @@ export async function checkBadCountPagination (url: string, path: string, token?
}) })
} }
export function checkBadSort (url: string, path: string, token?: string, query = {}) { export async function checkBadSort (url: string, path: string, token?: string, query = {}) {
return makeGetRequest({ await makeGetRequest({
url, url,
path, path,
token, token,
+4 -2
View File
@@ -123,10 +123,12 @@ export async function checkExportFileExists (options: {
if (exists === true) { if (exists === true) {
if (withObjectStorage) { if (withObjectStorage) {
return makeRawRequest({ url: redirectedUrl, expectedStatus: HttpStatusCode.OK_200 }) await makeRawRequest({ url: redirectedUrl, expectedStatus: HttpStatusCode.OK_200 })
} else {
await testFileExistsOnFSOrNot(server, 'tmp-persistent', filename, true)
} }
return testFileExistsOnFSOrNot(server, 'tmp-persistent', filename, true) return
} }
await testFileExistsOnFSOrNot(server, 'tmp-persistent', filename, false) await testFileExistsOnFSOrNot(server, 'tmp-persistent', filename, false)
+1
View File
@@ -4,6 +4,7 @@
"outDir": "./dist", "outDir": "./dist",
"rootDir": "src", "rootDir": "src",
"tsBuildInfoFile": "./dist/.tsbuildinfo", "tsBuildInfoFile": "./dist/.tsbuildinfo",
"types": [ "node", "mocha" ],
"paths": { "paths": {
"@tests/*": [ "./src/*" ], "@tests/*": [ "./src/*" ],
"@server/*": [ "../../server/core/*" ], "@server/*": [ "../../server/core/*" ],
@@ -6,7 +6,6 @@
"emitDeclarationOnly": true, "emitDeclarationOnly": true,
"outDir": "../../dist-tmp/client/", "outDir": "../../dist-tmp/client/",
"rootDir": "./", "rootDir": "./",
"baseUrl": "./",
"tsBuildInfoFile": "../../dist-tmp/tsconfig.client.types.tsbuildinfo", "tsBuildInfoFile": "../../dist-tmp/tsconfig.client.types.tsbuildinfo",
"paths": { "paths": {
"@client/*": [ "../../../../client/src/*" ] "@client/*": [ "../../../../client/src/*" ]
@@ -5,13 +5,12 @@
"node_modules/@types", "node_modules/@types",
"client/node_modules/@types" "client/node_modules/@types"
], ],
"baseUrl": "./dist-tmp",
"paths": { "paths": {
"@server/*": [ "server/core/*" ], "@server/*": [ "./dist-tmp/server/core/*" ],
"@client/*": [ "client/*" ], "@client/*": [ "./dist-tmp/client/*" ],
"@peertube/peertube-models": [ "peertube-models" ], "@peertube/peertube-models": [ "./dist-tmp/peertube-models" ],
"@peertube/peertube-typescript-utils": [ "peertube-typescript-utils" ], "@peertube/peertube-typescript-utils": [ "./dist-tmp/peertube-typescript-utils" ],
"@peertube/peertube-transcription": [ "peertube-transcription" ] "@peertube/peertube-transcription": [ "./dist-tmp/peertube-transcription" ]
} }
} }
} }
@@ -6,7 +6,6 @@
"emitDeclarationOnly": true, "emitDeclarationOnly": true,
"sourceMap": false, "sourceMap": false,
"outDir": "./dist-tmp/", "outDir": "./dist-tmp/",
"baseUrl": "./",
"rootDir": "./src", "rootDir": "./src",
"tsBuildInfoFile": "./dist-tmp/tsconfig.server.types.tsbuildinfo", "tsBuildInfoFile": "./dist-tmp/tsconfig.server.types.tsbuildinfo",
"paths": { "paths": {
+37 -22
View File
@@ -214,7 +214,7 @@ importers:
version: 0.1.7 version: 0.1.7
i18next: i18next:
specifier: ^25.8.13 specifier: ^25.8.13
version: 25.8.13(typescript@5.9.3) version: 25.8.13(typescript@6.0.2)
i18next-icu: i18next-icu:
specifier: ^2.4.3 specifier: ^2.4.3
version: 2.4.3(intl-messageformat@11.1.2) version: 2.4.3(intl-messageformat@11.1.2)
@@ -365,7 +365,7 @@ importers:
devDependencies: devDependencies:
'@peertube/resolve-tspaths': '@peertube/resolve-tspaths':
specifier: ^0.8.14 specifier: ^0.8.14
version: 0.8.14(typescript@5.9.3) version: 0.8.14(typescript@6.0.2)
'@stylistic/eslint-plugin': '@stylistic/eslint-plugin':
specifier: ^5.9.0 specifier: ^5.9.0
version: 5.9.0(eslint@9.39.3(jiti@2.6.1)) version: 5.9.0(eslint@9.39.3(jiti@2.6.1))
@@ -497,7 +497,7 @@ importers:
version: 5.5.6 version: 5.5.6
i18next-cli: i18next-cli:
specifier: ^1.47.3 specifier: ^1.47.3
version: 1.47.3(@types/node@22.14.1)(i18next@25.8.13(typescript@5.9.3))(typescript@5.9.3) version: 1.47.3(@types/node@22.14.1)(i18next@25.8.13(typescript@6.0.2))(typescript@6.0.2)
jszip: jszip:
specifier: ^3.10.1 specifier: ^3.10.1
version: 3.10.1 version: 3.10.1
@@ -524,7 +524,7 @@ importers:
version: 4.59.0 version: 4.59.0
rollup-plugin-dts: rollup-plugin-dts:
specifier: ^6.3.0 specifier: ^6.3.0
version: 6.3.0(rollup@4.59.0)(typescript@5.9.3) version: 6.3.0(rollup@4.59.0)(typescript@6.0.2)
socket.io-client: socket.io-client:
specifier: ^4.8.3 specifier: ^4.8.3
version: 4.8.3(bufferutil@4.1.0)(utf-8-validate@6.0.6) version: 4.8.3(bufferutil@4.1.0)(utf-8-validate@6.0.6)
@@ -533,7 +533,7 @@ importers:
version: 4.0.4(openapi-types@12.1.3) version: 4.0.4(openapi-types@12.1.3)
tsc-watch: tsc-watch:
specifier: ^7.2.0 specifier: ^7.2.0
version: 7.2.0(typescript@5.9.3) version: 7.2.0(typescript@6.0.2)
tsx: tsx:
specifier: ^4.21.0 specifier: ^4.21.0
version: 4.21.0 version: 4.21.0
@@ -541,8 +541,8 @@ importers:
specifier: ^5.4.4 specifier: ^5.4.4
version: 5.4.4 version: 5.4.4
typescript: typescript:
specifier: ~5.9.3 specifier: ~6.0.2
version: 5.9.3 version: 6.0.2
optionalDependencies: optionalDependencies:
webtorrent: webtorrent:
specifier: ^2.8.5 specifier: ^2.8.5
@@ -883,8 +883,8 @@ importers:
specifier: ^8.1.9 specifier: ^8.1.9
version: 8.1.9 version: 8.1.9
'@types/supertest': '@types/supertest':
specifier: ^6.0.3 specifier: ^7.2.0
version: 6.0.3 version: 7.2.0
supertest: supertest:
specifier: ^7.2.2 specifier: ^7.2.2
version: 7.2.2 version: 7.2.2
@@ -4449,6 +4449,9 @@ packages:
'@types/supertest@6.0.3': '@types/supertest@6.0.3':
resolution: {integrity: sha512-8WzXq62EXFhJ7QsH3Ocb/iKQ/Ty9ZVWnVzoTKc9tyyFRRF3a74Tk2+TLFgaFFw364Ere+npzHKEJ6ga2LzIL7w==} resolution: {integrity: sha512-8WzXq62EXFhJ7QsH3Ocb/iKQ/Ty9ZVWnVzoTKc9tyyFRRF3a74Tk2+TLFgaFFw364Ere+npzHKEJ6ga2LzIL7w==}
'@types/supertest@7.2.0':
resolution: {integrity: sha512-uh2Lv57xvggst6lCqNdFAmDSvoMG7M/HDtX4iUCquxQ5EGPtaPM5PL5Hmi7LCvOG8db7YaCPNJEeoI8s/WzIQw==}
'@types/triple-beam@1.3.5': '@types/triple-beam@1.3.5':
resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==} resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==}
@@ -10848,6 +10851,11 @@ packages:
engines: {node: '>=14.17'} engines: {node: '>=14.17'}
hasBin: true hasBin: true
typescript@6.0.2:
resolution: {integrity: sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==}
engines: {node: '>=14.17'}
hasBin: true
ua-is-frozen@0.1.2: ua-is-frozen@0.1.2:
resolution: {integrity: sha512-RwKDW2p3iyWn4UbaxpP2+VxwqXh0jpvdxsYpZ5j/MLLiQOfbsV5shpgQiw93+KMYQPcteeMQ289MaAFzs3G9pw==} resolution: {integrity: sha512-RwKDW2p3iyWn4UbaxpP2+VxwqXh0jpvdxsYpZ5j/MLLiQOfbsV5shpgQiw93+KMYQPcteeMQ289MaAFzs3G9pw==}
@@ -14103,12 +14111,12 @@ snapshots:
smtp-server: 3.18.1 smtp-server: 3.18.1
wildstring: 1.0.9 wildstring: 1.0.9
'@peertube/resolve-tspaths@0.8.14(typescript@5.9.3)': '@peertube/resolve-tspaths@0.8.14(typescript@6.0.2)':
dependencies: dependencies:
ansi-colors: 4.1.3 ansi-colors: 4.1.3
commander: 11.0.0 commander: 11.0.0
fast-glob: 3.3.1 fast-glob: 3.3.1
typescript: 5.9.3 typescript: 6.0.2
'@peertube/xliffmerge@2.0.4': '@peertube/xliffmerge@2.0.4':
dependencies: dependencies:
@@ -15351,6 +15359,11 @@ snapshots:
'@types/methods': 1.1.4 '@types/methods': 1.1.4
'@types/superagent': 8.1.9 '@types/superagent': 8.1.9
'@types/supertest@7.2.0':
dependencies:
'@types/methods': 1.1.4
'@types/superagent': 8.1.9
'@types/triple-beam@1.3.5': {} '@types/triple-beam@1.3.5': {}
'@types/trusted-types@2.0.7': '@types/trusted-types@2.0.7':
@@ -19131,7 +19144,7 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
i18next-cli@1.47.3(@types/node@22.14.1)(i18next@25.8.13(typescript@5.9.3))(typescript@5.9.3): i18next-cli@1.47.3(@types/node@22.14.1)(i18next@25.8.13(typescript@6.0.2))(typescript@6.0.2):
dependencies: dependencies:
'@croct/json5-parser': 0.2.2 '@croct/json5-parser': 0.2.2
'@swc/core': 1.15.17 '@swc/core': 1.15.17
@@ -19147,7 +19160,7 @@ snapshots:
minimatch: 10.2.4 minimatch: 10.2.4
ora: 9.3.0 ora: 9.3.0
react: 19.2.4 react: 19.2.4
react-i18next: 16.5.4(i18next@25.8.13(typescript@5.9.3))(react@19.2.4)(typescript@5.9.3) react-i18next: 16.5.4(i18next@25.8.13(typescript@6.0.2))(react@19.2.4)(typescript@6.0.2)
yaml: 2.8.2 yaml: 2.8.2
transitivePeerDependencies: transitivePeerDependencies:
- '@swc/helpers' - '@swc/helpers'
@@ -19170,11 +19183,11 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- '@swc/helpers' - '@swc/helpers'
i18next@25.8.13(typescript@5.9.3): i18next@25.8.13(typescript@6.0.2):
dependencies: dependencies:
'@babel/runtime': 7.28.6 '@babel/runtime': 7.28.6
optionalDependencies: optionalDependencies:
typescript: 5.9.3 typescript: 6.0.2
iconv-lite@0.4.24: iconv-lite@0.4.24:
dependencies: dependencies:
@@ -21725,15 +21738,15 @@ snapshots:
dependencies: dependencies:
setimmediate: 1.0.5 setimmediate: 1.0.5
react-i18next@16.5.4(i18next@25.8.13(typescript@5.9.3))(react@19.2.4)(typescript@5.9.3): react-i18next@16.5.4(i18next@25.8.13(typescript@6.0.2))(react@19.2.4)(typescript@6.0.2):
dependencies: dependencies:
'@babel/runtime': 7.28.6 '@babel/runtime': 7.28.6
html-parse-stringify: 3.0.1 html-parse-stringify: 3.0.1
i18next: 25.8.13(typescript@5.9.3) i18next: 25.8.13(typescript@6.0.2)
react: 19.2.4 react: 19.2.4
use-sync-external-store: 1.6.0(react@19.2.4) use-sync-external-store: 1.6.0(react@19.2.4)
optionalDependencies: optionalDependencies:
typescript: 5.9.3 typescript: 6.0.2
react-is@18.3.1: {} react-is@18.3.1: {}
@@ -22023,11 +22036,11 @@ snapshots:
'@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.5 '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.5
'@rolldown/binding-win32-x64-msvc': 1.0.0-rc.5 '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.5
rollup-plugin-dts@6.3.0(rollup@4.59.0)(typescript@5.9.3): rollup-plugin-dts@6.3.0(rollup@4.59.0)(typescript@6.0.2):
dependencies: dependencies:
magic-string: 0.30.21 magic-string: 0.30.21
rollup: 4.59.0 rollup: 4.59.0
typescript: 5.9.3 typescript: 6.0.2
optionalDependencies: optionalDependencies:
'@babel/code-frame': 7.29.0 '@babel/code-frame': 7.29.0
@@ -23221,13 +23234,13 @@ snapshots:
optionalDependencies: optionalDependencies:
'@swc/core': 1.15.17 '@swc/core': 1.15.17
tsc-watch@7.2.0(typescript@5.9.3): tsc-watch@7.2.0(typescript@6.0.2):
dependencies: dependencies:
cross-spawn: 7.0.6 cross-spawn: 7.0.6
node-cleanup: 2.1.2 node-cleanup: 2.1.2
ps-tree: 1.2.0 ps-tree: 1.2.0
string-argv: 0.3.2 string-argv: 0.3.2
typescript: 5.9.3 typescript: 6.0.2
tsconfig-paths@3.15.0: tsconfig-paths@3.15.0:
dependencies: dependencies:
@@ -23371,6 +23384,8 @@ snapshots:
typescript@5.9.3: {} typescript@5.9.3: {}
typescript@6.0.2: {}
ua-is-frozen@0.1.2: {} ua-is-frozen@0.1.2: {}
ua-parser-js@2.0.9: ua-parser-js@2.0.9:
+1 -2
View File
@@ -3,10 +3,9 @@
"compilerOptions": { "compilerOptions": {
"outDir": "./dist", "outDir": "./dist",
"tsBuildInfoFile": "./dist/.tsbuildinfo", "tsBuildInfoFile": "./dist/.tsbuildinfo",
"baseUrl": "../",
"rootDir": ".", "rootDir": ".",
"paths": { "paths": {
"@server/*": [ "server/core/*" ] "@server/*": [ "./core/*" ]
} }
} }
} }
+4 -1
View File
@@ -31,6 +31,9 @@
"noUnusedLocals": true, "noUnusedLocals": true,
"skipLibCheck": true, "skipLibCheck": true,
"composite": true, "composite": true,
"declarationMap": true "declarationMap": true,
"types": [
"node"
]
} }
} }