ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix types package dependencies
Chocobozzz81d02aac56d7
diff --git a/package.json b/package.jsonindex b414223431..b0df43ffa6 100644--- a/package.json+++ b/package.json@@ -211,6 +211,9 @@"ts-node": "10.4.0","typescript": "^4.0.5"},+ "resolutions": {+ "depcheck/@babel/parser": "7.16.4"+ },"bundlewatch": {"files": [{diff --git a/packages/types/generate-package.ts b/packages/types/generate-package.tsindex 853989d684..125259bb40 100644--- a/packages/types/generate-package.ts+++ b/packages/types/generate-package.ts@@ -1,8 +1,8 @@import { execSync } from 'child_process'import depcheck, { PackageDependencies } from 'depcheck'import { copyFile, readJson, remove, writeFile, writeJSON } from 'fs-extra'-import { resolve } from 'path'-import { cwd } from 'process'+import { join, resolve } from 'path'+import { root } from '../../shared/core-utils'if (!process.argv[2]) {console.error('Need version as argument')@@ -20,14 +20,14 @@ run()})async function run () {- const typesPath = resolve(cwd(), './packages/types/')- const typesDistPath = resolve(cwd(), typesPath, './dist/')- const typesDistPackageJsonPath = resolve(typesDistPath, './package.json')- const typesDistGitIgnorePath = resolve(typesDistPath, './.gitignore')- const mainPackageJson = await readJson(resolve(cwd(), './package.json'))- const distTsConfigPath = resolve(cwd(), typesPath, './tsconfig.dist.json')+ const typesPath = __dirname+ const typesDistPath = join(typesPath, 'dist')+ const typesDistPackageJsonPath = join(typesDistPath, 'package.json')+ const typesDistGitIgnorePath = join(typesDistPath, '.gitignore')+ const mainPackageJson = await readJson(join(root(), 'package.json'))+ const distTsConfigPath = join(typesPath, 'tsconfig.dist.json')const distTsConfig = await readJson(distTsConfigPath)- const clientPackageJson = await readJson(resolve(cwd(), './client/package.json'))+ const clientPackageJson = await readJson(join(root(), 'client', 'package.json'))await remove(typesDistPath)execSync('npm run tsc -- -b --verbose packages/types', { stdio: 'inherit' })@@ -35,8 +35,9 @@ async function run () {const allDependencies = Object.assign(mainPackageJson.dependencies,- mainPackageJson.devDepencies,- clientPackageJson.dependencies+ mainPackageJson.devDependencies,+ clientPackageJson.dependencies,+ clientPackageJson.devDependencies) as PackageDependencies// https://github.com/depcheck/depcheck#api@@ -50,7 +51,20 @@ async function run () {package: { dependencies: allDependencies }}- const { dependencies: unusedDependencies } = await depcheck(resolve(typesPath), depcheckOptions)+ const result = await depcheck(typesDistPath, depcheckOptions)++ if (Object.keys(result.invalidDirs).length !== 0) {+ console.error('Invalid directories detected.', { invalidDirs: result.invalidDirs })+ process.exit(-1)+ }++ if (Object.keys(result.invalidFiles).length !== 0) {+ console.error('Invalid files detected.', { invalidFiles: result.invalidFiles })+ process.exit(-1)+ }++ const unusedDependencies = result.dependencies+console.log(`Removing ${Object.keys(unusedDependencies).length} unused dependencies.`)const dependencies = Object.keys(allDependencies)diff --git a/server/tests/api/server/follow-constraints.ts b/server/tests/api/server/follow-constraints.tsindex 0f3c138ad4..455fbc7629 100644--- a/server/tests/api/server/follow-constraints.ts+++ b/server/tests/api/server/follow-constraints.ts@@ -14,7 +14,7 @@ describe('Test follow constraints', function () {let userToken: stringbefore(async function () {- this.timeout(90000)+ this.timeout(240000)servers = await createMultipleServers(2)diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.tsindex cd34df15de..c588cf6641 100644--- a/server/tests/api/server/follows.ts+++ b/server/tests/api/server/follows.ts@@ -12,7 +12,7 @@ describe('Test follows', function () {let servers: PeerTubeServer[] = []before(async function () {- this.timeout(30000)+ this.timeout(120000)servers = await createMultipleServers(3)diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.tsindex ff9172a82e..7023b3f08a 100644--- a/server/tests/api/users/users.ts+++ b/server/tests/api/users/users.ts@@ -230,7 +230,7 @@ describe('Test users', function () {})it('Should have an expired access token', async function () {- this.timeout(15000)+ this.timeout(60000)await server.sql.setTokenField(server.accessToken, 'accessTokenExpiresAt', new Date().toISOString())await server.sql.setTokenField(server.accessToken, 'refreshTokenExpiresAt', new Date().toISOString())diff --git a/yarn.lock b/yarn.lockindex 2a23f610b1..bc4d3326cf 100644--- a/yarn.lock+++ b/yarn.lock@@ -913,7 +913,12 @@chalk "^2.0.0"js-tokens "^4.0.0"-"@babel/parser@^7.12.5", "@babel/parser@^7.16.0", "@babel/parser@^7.16.4", "@babel/parser@^7.16.5", "@babel/parser@^7.6.0", "@babel/parser@^7.9.6":+"@babel/[email protected]", "@babel/parser@^7.12.5":+ version "7.16.4"+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e"+ integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng==++"@babel/parser@^7.16.0", "@babel/parser@^7.16.4", "@babel/parser@^7.16.5", "@babel/parser@^7.6.0", "@babel/parser@^7.9.6":version "7.16.6"resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.6.tgz#8f194828193e8fa79166f34a4b4e52f3e769a314"integrity sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==