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": [
"node_modules/@types"
],
"baseUrl": "./",
"paths": {
"@app/*": [
"src/app/*"
"./src/app/*"
],
"@root-helpers/*": [
"src/root-helpers/*"
"./src/root-helpers/*"
]
}
},
@@ -35,12 +34,12 @@
{ "path": "../packages/typescript-utils" }
],
"include": [
"src/polyfills.ts",
"src/environments/*.ts",
"src/main*.ts",
"src/**/*.d.ts",
"src/app/**/*.ts",
"src/shims/*.ts"
"./src/polyfills.ts",
"./src/environments/*.ts",
"./src/main*.ts",
"./src/**/*.d.ts",
"./src/app/**/*.ts",
"./src/shims/*.ts"
],
"angularCompilerOptions": {
"strictInjectionParameters": true,
+3 -3
View File
@@ -7,11 +7,11 @@
"outDir": "../packages/types-generator/dist-tmp/client/",
"emitDeclarationOnly": true,
"composite": true,
"rootDir": "src/",
"rootDir": "./src/",
"tsBuildInfoFile": "../packages/types-generator/dist-tmp/tsconfig.client.tsbuildinfo"
},
"files": [ "src/types/index.ts" ],
"files": [ "./src/types/index.ts" ],
"include": [
"src/types/**/*"
"./src/types/**/*"
]
}
+1 -1
View File
@@ -262,7 +262,7 @@
"tsc-watch": "^7.2.0",
"tsx": "^4.21.0",
"type-fest": "^5.4.4",
"typescript": "~5.9.3"
"typescript": "~6.0.2"
},
"packageManager": "pnpm@10.15.1+sha512.34e538c329b5553014ca8e8f4535997f96180a1d0f614339357449935350d924e22f8614682191264ec33d1462ac21561aff97f6bb18065351c162c7e8f6de67"
}
+1 -1
View File
@@ -14,7 +14,7 @@
"type": "module",
"devDependencies": {
"@types/superagent": "^8.1.9",
"@types/supertest": "^6.0.3",
"@types/supertest": "^7.2.0",
"supertest": "^7.2.2"
},
"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 { HttpStatusCode, HttpStatusCodeType } from '@peertube/peertube-models'
@@ -186,7 +187,7 @@ export function makePutBodyRequest (options: {
fields: { [fieldName: string]: any }
expectedStatus?: HttpStatusCodeType
headers?: { [name: string]: string }
}) {
}): request.Test {
const req = request(options.url).put(options.path)
.send(options.fields)
@@ -1,8 +1,10 @@
/* 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 { buildAbsoluteFixturePath, getFileSize } from '@peertube/peertube-node-utils'
import { expect } from 'chai'
import { createReadStream } from 'fs'
import got, { Response as GotResponse } from 'got'
import { isAbsolute } from 'path'
import {
@@ -14,9 +16,6 @@ import {
unwrapBody,
unwrapText
} from '../requests/requests.js'
import { pick } from '@peertube/peertube-core-utils'
import { createReadStream } from 'fs'
import type { PeerTubeServer } from '../server/server.js'
export interface OverrideCommandOptions {
+1
View File
@@ -5,6 +5,7 @@
"rootDir": "src",
"tsBuildInfoFile": "./dist/.tsbuildinfo"
},
"references": [
{ "path": "../models" },
{ "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 = {}) {
return makeGetRequest({
export async function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
await makeGetRequest({
url,
path,
token,
@@ -186,8 +186,8 @@ export async function checkBadCountPagination (url: string, path: string, token?
})
}
export function checkBadSort (url: string, path: string, token?: string, query = {}) {
return makeGetRequest({
export async function checkBadSort (url: string, path: string, token?: string, query = {}) {
await makeGetRequest({
url,
path,
token,
+4 -2
View File
@@ -123,10 +123,12 @@ export async function checkExportFileExists (options: {
if (exists === true) {
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)
+1
View File
@@ -4,6 +4,7 @@
"outDir": "./dist",
"rootDir": "src",
"tsBuildInfoFile": "./dist/.tsbuildinfo",
"types": [ "node", "mocha" ],
"paths": {
"@tests/*": [ "./src/*" ],
"@server/*": [ "../../server/core/*" ],
@@ -6,7 +6,6 @@
"emitDeclarationOnly": true,
"outDir": "../../dist-tmp/client/",
"rootDir": "./",
"baseUrl": "./",
"tsBuildInfoFile": "../../dist-tmp/tsconfig.client.types.tsbuildinfo",
"paths": {
"@client/*": [ "../../../../client/src/*" ]
@@ -5,13 +5,12 @@
"node_modules/@types",
"client/node_modules/@types"
],
"baseUrl": "./dist-tmp",
"paths": {
"@server/*": [ "server/core/*" ],
"@client/*": [ "client/*" ],
"@peertube/peertube-models": [ "peertube-models" ],
"@peertube/peertube-typescript-utils": [ "peertube-typescript-utils" ],
"@peertube/peertube-transcription": [ "peertube-transcription" ]
"@server/*": [ "./dist-tmp/server/core/*" ],
"@client/*": [ "./dist-tmp/client/*" ],
"@peertube/peertube-models": [ "./dist-tmp/peertube-models" ],
"@peertube/peertube-typescript-utils": [ "./dist-tmp/peertube-typescript-utils" ],
"@peertube/peertube-transcription": [ "./dist-tmp/peertube-transcription" ]
}
}
}
@@ -6,7 +6,6 @@
"emitDeclarationOnly": true,
"sourceMap": false,
"outDir": "./dist-tmp/",
"baseUrl": "./",
"rootDir": "./src",
"tsBuildInfoFile": "./dist-tmp/tsconfig.server.types.tsbuildinfo",
"paths": {
+37 -22
View File
@@ -214,7 +214,7 @@ importers:
version: 0.1.7
i18next:
specifier: ^25.8.13
version: 25.8.13(typescript@5.9.3)
version: 25.8.13(typescript@6.0.2)
i18next-icu:
specifier: ^2.4.3
version: 2.4.3(intl-messageformat@11.1.2)
@@ -365,7 +365,7 @@ importers:
devDependencies:
'@peertube/resolve-tspaths':
specifier: ^0.8.14
version: 0.8.14(typescript@5.9.3)
version: 0.8.14(typescript@6.0.2)
'@stylistic/eslint-plugin':
specifier: ^5.9.0
version: 5.9.0(eslint@9.39.3(jiti@2.6.1))
@@ -497,7 +497,7 @@ importers:
version: 5.5.6
i18next-cli:
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:
specifier: ^3.10.1
version: 3.10.1
@@ -524,7 +524,7 @@ importers:
version: 4.59.0
rollup-plugin-dts:
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:
specifier: ^4.8.3
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)
tsc-watch:
specifier: ^7.2.0
version: 7.2.0(typescript@5.9.3)
version: 7.2.0(typescript@6.0.2)
tsx:
specifier: ^4.21.0
version: 4.21.0
@@ -541,8 +541,8 @@ importers:
specifier: ^5.4.4
version: 5.4.4
typescript:
specifier: ~5.9.3
version: 5.9.3
specifier: ~6.0.2
version: 6.0.2
optionalDependencies:
webtorrent:
specifier: ^2.8.5
@@ -883,8 +883,8 @@ importers:
specifier: ^8.1.9
version: 8.1.9
'@types/supertest':
specifier: ^6.0.3
version: 6.0.3
specifier: ^7.2.0
version: 7.2.0
supertest:
specifier: ^7.2.2
version: 7.2.2
@@ -4449,6 +4449,9 @@ packages:
'@types/supertest@6.0.3':
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':
resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==}
@@ -10848,6 +10851,11 @@ packages:
engines: {node: '>=14.17'}
hasBin: true
typescript@6.0.2:
resolution: {integrity: sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==}
engines: {node: '>=14.17'}
hasBin: true
ua-is-frozen@0.1.2:
resolution: {integrity: sha512-RwKDW2p3iyWn4UbaxpP2+VxwqXh0jpvdxsYpZ5j/MLLiQOfbsV5shpgQiw93+KMYQPcteeMQ289MaAFzs3G9pw==}
@@ -14103,12 +14111,12 @@ snapshots:
smtp-server: 3.18.1
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:
ansi-colors: 4.1.3
commander: 11.0.0
fast-glob: 3.3.1
typescript: 5.9.3
typescript: 6.0.2
'@peertube/xliffmerge@2.0.4':
dependencies:
@@ -15351,6 +15359,11 @@ snapshots:
'@types/methods': 1.1.4
'@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/trusted-types@2.0.7':
@@ -19131,7 +19144,7 @@ snapshots:
transitivePeerDependencies:
- 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:
'@croct/json5-parser': 0.2.2
'@swc/core': 1.15.17
@@ -19147,7 +19160,7 @@ snapshots:
minimatch: 10.2.4
ora: 9.3.0
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
transitivePeerDependencies:
- '@swc/helpers'
@@ -19170,11 +19183,11 @@ snapshots:
transitivePeerDependencies:
- '@swc/helpers'
i18next@25.8.13(typescript@5.9.3):
i18next@25.8.13(typescript@6.0.2):
dependencies:
'@babel/runtime': 7.28.6
optionalDependencies:
typescript: 5.9.3
typescript: 6.0.2
iconv-lite@0.4.24:
dependencies:
@@ -21725,15 +21738,15 @@ snapshots:
dependencies:
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:
'@babel/runtime': 7.28.6
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
use-sync-external-store: 1.6.0(react@19.2.4)
optionalDependencies:
typescript: 5.9.3
typescript: 6.0.2
react-is@18.3.1: {}
@@ -22023,11 +22036,11 @@ snapshots:
'@rolldown/binding-win32-arm64-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:
magic-string: 0.30.21
rollup: 4.59.0
typescript: 5.9.3
typescript: 6.0.2
optionalDependencies:
'@babel/code-frame': 7.29.0
@@ -23221,13 +23234,13 @@ snapshots:
optionalDependencies:
'@swc/core': 1.15.17
tsc-watch@7.2.0(typescript@5.9.3):
tsc-watch@7.2.0(typescript@6.0.2):
dependencies:
cross-spawn: 7.0.6
node-cleanup: 2.1.2
ps-tree: 1.2.0
string-argv: 0.3.2
typescript: 5.9.3
typescript: 6.0.2
tsconfig-paths@3.15.0:
dependencies:
@@ -23371,6 +23384,8 @@ snapshots:
typescript@5.9.3: {}
typescript@6.0.2: {}
ua-is-frozen@0.1.2: {}
ua-parser-js@2.0.9:
+1 -2
View File
@@ -3,10 +3,9 @@
"compilerOptions": {
"outDir": "./dist",
"tsBuildInfoFile": "./dist/.tsbuildinfo",
"baseUrl": "../",
"rootDir": ".",
"paths": {
"@server/*": [ "server/core/*" ]
"@server/*": [ "./core/*" ]
}
}
}
+4 -1
View File
@@ -31,6 +31,9 @@
"noUnusedLocals": true,
"skipLibCheck": true,
"composite": true,
"declarationMap": true
"declarationMap": true,
"types": [
"node"
]
}
}